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
d6fe4b9a
Commit
d6fe4b9a
authored
Dec 13, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
e5361d88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
Restarter.java
.../org/springframework/boot/devtools/restart/Restarter.java
+6
-14
No files found.
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
View file @
d6fe4b9a
...
@@ -23,7 +23,6 @@ import java.net.URL;
...
@@ -23,7 +23,6 @@ import java.net.URL;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -273,11 +272,10 @@ public class Restarter {
...
@@ -273,11 +272,10 @@ public class Restarter {
private
Throwable
doStart
()
throws
Exception
{
private
Throwable
doStart
()
throws
Exception
{
Assert
.
notNull
(
this
.
mainClassName
,
"Unable to find the main class to restart"
);
Assert
.
notNull
(
this
.
mainClassName
,
"Unable to find the main class to restart"
);
ClassLoader
parent
=
this
.
applicationClassLoader
;
URL
[]
urls
=
this
.
urls
.
toArray
(
new
URL
[
this
.
urls
.
size
()]);
URL
[]
urls
=
this
.
urls
.
toArray
(
new
URL
[
this
.
urls
.
size
()]);
ClassLoaderFiles
updatedFiles
=
new
ClassLoaderFiles
(
this
.
classLoaderFiles
);
ClassLoaderFiles
updatedFiles
=
new
ClassLoaderFiles
(
this
.
classLoaderFiles
);
ClassLoader
classLoader
=
new
RestartClassLoader
(
parent
,
urls
,
updatedFiles
,
ClassLoader
classLoader
=
new
RestartClassLoader
(
this
.
applicationClassLoader
,
this
.
logger
);
urls
,
updatedFiles
,
this
.
logger
);
if
(
this
.
logger
.
isDebugEnabled
())
{
if
(
this
.
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Starting application "
+
this
.
mainClassName
+
" with URLs "
this
.
logger
.
debug
(
"Starting application "
+
this
.
mainClassName
+
" with URLs "
+
Arrays
.
asList
(
urls
));
+
Arrays
.
asList
(
urls
));
...
@@ -361,14 +359,8 @@ public class Restarter {
...
@@ -361,14 +359,8 @@ public class Restarter {
}
}
if
(
instance
instanceof
Map
)
{
if
(
instance
instanceof
Map
)
{
Map
<?,
?>
map
=
((
Map
<?,
?>)
instance
);
Map
<?,
?>
map
=
((
Map
<?,
?>)
instance
);
for
(
Iterator
<?>
iterator
=
map
.
keySet
().
iterator
();
iterator
.
hasNext
();)
{
map
.
keySet
().
removeIf
(
value
->
value
instanceof
Class
&&
((
Class
<?>)
value
)
Object
value
=
iterator
.
next
();
.
getClassLoader
()
instanceof
RestartClassLoader
);
if
(
value
instanceof
Class
&&
((
Class
<?>)
value
)
.
getClassLoader
()
instanceof
RestartClassLoader
)
{
iterator
.
remove
();
}
}
}
}
}
}
...
@@ -505,7 +497,7 @@ public class Restarter {
...
@@ -505,7 +497,7 @@ public class Restarter {
/**
/**
* Initialize restart support. See
* Initialize restart support. See
* {@link #initialize(String[], boolean, RestartInitializer)} for details.
* {@link #initialize(String[], boolean, RestartInitializer
, boolean
)} for details.
* @param args main application arguments
* @param args main application arguments
* @param forceReferenceCleanup if forcing of soft/weak reference should happen on
* @param forceReferenceCleanup if forcing of soft/weak reference should happen on
* @param initializer the restart initializer
* @param initializer the restart initializer
...
@@ -559,7 +551,7 @@ public class Restarter {
...
@@ -559,7 +551,7 @@ public class Restarter {
* Set the restarter instance (useful for testing).
* Set the restarter instance (useful for testing).
* @param instance the instance to set
* @param instance the instance to set
*/
*/
final
static
void
setInstance
(
Restarter
instance
)
{
static
void
setInstance
(
Restarter
instance
)
{
synchronized
(
INSTANCE_MONITOR
)
{
synchronized
(
INSTANCE_MONITOR
)
{
Restarter
.
instance
=
instance
;
Restarter
.
instance
=
instance
;
}
}
...
...
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