Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c1f8fd2b
Commit
c1f8fd2b
authored
Jan 27, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some compile warnings
parent
5a47360c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
25 deletions
+32
-25
PropertiesLauncher.java
...a/org/springframework/boot/loader/PropertiesLauncher.java
+23
-17
ExplodedArchiveTests.java
...ngframework/boot/loader/archive/ExplodedArchiveTests.java
+1
-0
RandomAccessJarFileTests.java
...ngframework/boot/loader/jar/RandomAccessJarFileTests.java
+1
-0
SpringApplicationContextLoader.java
...ngframework/boot/test/SpringApplicationContextLoader.java
+3
-7
SpringApplicationConfigurationDefaultConfigurationTests.java
...ingApplicationConfigurationDefaultConfigurationTests.java
+4
-1
No files found.
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
View file @
c1f8fd2b
...
@@ -121,6 +121,8 @@ public class PropertiesLauncher extends Launcher {
...
@@ -121,6 +121,8 @@ public class PropertiesLauncher extends Launcher {
private
static
final
Pattern
WORD_SEPARATOR
=
Pattern
.
compile
(
"\\W+"
);
private
static
final
Pattern
WORD_SEPARATOR
=
Pattern
.
compile
(
"\\W+"
);
private
static
final
URL
[]
EMPTY_URLS
=
{};
private
final
File
home
;
private
final
File
home
;
private
List
<
String
>
paths
=
new
ArrayList
<
String
>(
DEFAULT_PATHS
);
private
List
<
String
>
paths
=
new
ArrayList
<
String
>(
DEFAULT_PATHS
);
...
@@ -493,26 +495,30 @@ public class PropertiesLauncher extends Launcher {
...
@@ -493,26 +495,30 @@ public class PropertiesLauncher extends Launcher {
private
void
addParentClassLoaderEntries
(
List
<
Archive
>
lib
)
throws
IOException
,
private
void
addParentClassLoaderEntries
(
List
<
Archive
>
lib
)
throws
IOException
,
URISyntaxException
{
URISyntaxException
{
ClassLoader
parentClassLoader
=
getClass
().
getClassLoader
();
ClassLoader
parentClassLoader
=
getClass
().
getClassLoader
();
if
(
parentClassLoader
instanceof
URLClassLoader
)
{
for
(
URL
url
:
getURLs
(
parentClassLoader
))
{
URLClassLoader
urlClassLoader
=
(
URLClassLoader
)
parentClassLoader
;
if
(
url
.
toString
().
endsWith
(
".jar"
)
||
url
.
toString
().
endsWith
(
".zip"
))
{
for
(
URL
url
:
urlClassLoader
.
getURLs
())
{
lib
.
add
(
0
,
new
JarFileArchive
(
new
File
(
url
.
toURI
())));
if
(
url
.
toString
().
endsWith
(
".jar"
)
||
url
.
toString
().
endsWith
(
".zip"
))
{
}
lib
.
add
(
0
,
new
JarFileArchive
(
new
File
(
url
.
toURI
())));
else
if
(
url
.
toString
().
endsWith
(
"/*"
))
{
}
String
name
=
url
.
getFile
();
else
if
(
url
.
toString
().
endsWith
(
"/*"
))
{
File
dir
=
new
File
(
name
.
substring
(
0
,
name
.
length
()
-
1
));
String
name
=
url
.
getFile
();
if
(
dir
.
exists
())
{
File
dir
=
new
File
(
name
.
substring
(
0
,
name
.
length
()
-
1
));
lib
.
add
(
0
,
if
(
dir
.
exists
())
{
new
ExplodedArchive
(
new
File
(
name
.
substring
(
0
,
lib
.
add
(
0
,
name
.
length
()
-
1
)),
false
));
new
ExplodedArchive
(
new
File
(
name
.
substring
(
0
,
name
.
length
()
-
1
)),
false
));
}
}
else
{
lib
.
add
(
0
,
new
ExplodedArchive
(
new
File
(
url
.
getFile
())));
}
}
}
}
else
{
lib
.
add
(
0
,
new
ExplodedArchive
(
new
File
(
url
.
getFile
())));
}
}
}
private
URL
[]
getURLs
(
ClassLoader
classLoader
)
{
if
(
classLoader
instanceof
URLClassLoader
)
{
return
((
URLClassLoader
)
classLoader
).
getURLs
();
}
}
return
EMPTY_URLS
;
}
}
private
String
cleanupPath
(
String
path
)
{
private
String
cleanupPath
(
String
path
)
{
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/ExplodedArchiveTests.java
View file @
c1f8fd2b
...
@@ -126,6 +126,7 @@ public class ExplodedArchiveTests {
...
@@ -126,6 +126,7 @@ public class ExplodedArchiveTests {
}
}
@Test
@Test
@SuppressWarnings
(
"resource"
)
public
void
getFilteredArchive
()
throws
Exception
{
public
void
getFilteredArchive
()
throws
Exception
{
Archive
filteredArchive
=
this
.
archive
Archive
filteredArchive
=
this
.
archive
.
getFilteredArchive
(
new
Archive
.
EntryRenameFilter
()
{
.
getFilteredArchive
(
new
Archive
.
EntryRenameFilter
()
{
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/RandomAccessJarFileTests.java
View file @
c1f8fd2b
...
@@ -281,6 +281,7 @@ public class RandomAccessJarFileTests {
...
@@ -281,6 +281,7 @@ public class RandomAccessJarFileTests {
}
}
@Test
@Test
@SuppressWarnings
(
"resource"
)
public
void
verifySignedJar
()
throws
Exception
{
public
void
verifySignedJar
()
throws
Exception
{
String
classpath
=
System
.
getProperty
(
"java.class.path"
);
String
classpath
=
System
.
getProperty
(
"java.class.path"
);
String
[]
entries
=
classpath
.
split
(
System
.
getProperty
(
"path.separator"
));
String
[]
entries
=
classpath
.
split
(
System
.
getProperty
(
"path.separator"
));
...
...
spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
View file @
c1f8fd2b
...
@@ -46,7 +46,6 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
...
@@ -46,7 +46,6 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
* class and only creates a web application context if it is present. Non-web features,
* class and only creates a web application context if it is present. Non-web features,
* like a repository layer, can be tested cleanly by simply <em>not</em> marking the test
* like a repository layer, can be tested cleanly by simply <em>not</em> marking the test
* class <code>@WebAppConfiguration</code>.
* class <code>@WebAppConfiguration</code>.
*
* <p>
* <p>
* If <code>@ActiveProfiles</code> are provided in the test class they will be used to
* If <code>@ActiveProfiles</code> are provided in the test class they will be used to
* create the application context.
* create the application context.
...
@@ -92,12 +91,9 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
...
@@ -92,12 +91,9 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
}
}
/**
/**
* Detect the default configuration classes for the supplied test class.
* Detect the default configuration classes for the supplied test class. By default
*
* simply delegates to
* <p>
* {@link AnnotationConfigContextLoaderUtils#detectDefaultConfigurationClasses} .
* The default implementation simply delegates to
* {@link AnnotationConfigContextLoaderUtils#detectDefaultConfigurationClasses(Class)}.
*
* @param declaringClass the test class that declared {@code @ContextConfiguration}
* @param declaringClass the test class that declared {@code @ContextConfiguration}
* @return an array of default configuration classes, potentially empty but never
* @return an array of default configuration classes, potentially empty but never
* {@code null}
* {@code null}
...
...
spring-boot/src/test/java/org/springframework/boot/test/SpringApplicationConfigurationDefaultConfigurationTests.java
View file @
c1f8fd2b
/*
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
4
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -25,6 +25,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
...
@@ -25,6 +25,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
/**
/**
* Tests for
* {@link SpringApplicationContextLoader#detectDefaultConfigurationClasses(Class)}
*
* @author Dave Syer
* @author Dave Syer
*/
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment