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
078536ad
Commit
078536ad
authored
Oct 03, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
Closes gh-18502
parents
bc8a88d7
f42b442c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
ChangeableUrls.java
...springframework/boot/devtools/restart/ChangeableUrls.java
+8
-1
ChangeableUrlsTests.java
...gframework/boot/devtools/restart/ChangeableUrlsTests.java
+5
-2
No files found.
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java
View file @
078536ad
...
...
@@ -22,6 +22,7 @@ import java.lang.management.ManagementFactory;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URLClassLoader
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
...
...
@@ -156,7 +157,13 @@ final class ChangeableUrls implements Iterable<URL> {
urls
.
add
(
referenced
);
}
else
{
nonExistentEntries
.
add
(
referenced
);
referenced
=
new
URL
(
jarUrl
,
URLDecoder
.
decode
(
entry
,
"UTF-8"
));
if
(
new
File
(
referenced
.
getFile
()).
exists
())
{
urls
.
add
(
referenced
);
}
else
{
nonExistentEntries
.
add
(
referenced
);
}
}
}
catch
(
MalformedURLException
ex
)
{
...
...
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java
View file @
078536ad
...
...
@@ -87,14 +87,17 @@ class ChangeableUrlsTests {
absolute
.
mkdirs
();
URL
absoluteUrl
=
absolute
.
toURI
().
toURL
();
File
jarWithClassPath
=
makeJarFileWithUrlsInManifestClassPath
(
"project-core/target/classes/"
,
"project-web/target/classes/"
,
"does-not-exist/target/classes"
,
relative
.
getName
()
+
"/"
,
absoluteUrl
);
"project-web/target/classes/"
,
"project%20space/target/classes/"
,
"does-not-exist/target/classes/"
,
relative
.
getName
()
+
"/"
,
absoluteUrl
);
new
File
(
jarWithClassPath
.
getParentFile
(),
"project-core/target/classes"
).
mkdirs
();
new
File
(
jarWithClassPath
.
getParentFile
(),
"project-web/target/classes"
).
mkdirs
();
new
File
(
jarWithClassPath
.
getParentFile
(),
"project space/target/classes"
).
mkdirs
();
ChangeableUrls
urls
=
ChangeableUrls
.
fromClassLoader
(
new
URLClassLoader
(
new
URL
[]
{
jarWithClassPath
.
toURI
().
toURL
(),
makeJarFileWithNoManifest
()
}));
assertThat
(
urls
.
toList
()).
containsExactly
(
new
URL
(
jarWithClassPath
.
toURI
().
toURL
(),
"project-core/target/classes/"
),
new
URL
(
jarWithClassPath
.
toURI
().
toURL
(),
"project-web/target/classes/"
),
relative
.
toURI
().
toURL
(),
new
URL
(
jarWithClassPath
.
toURI
().
toURL
(),
"project-web/target/classes/"
),
new
URL
(
jarWithClassPath
.
toURI
().
toURL
(),
"project space/target/classes/"
),
relative
.
toURI
().
toURL
(),
absoluteUrl
);
}
...
...
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