Polish "Add Log Output when DevTools restart is disabled"

Closes gh-14807
This commit is contained in:
Andy Wilkinson
2018-10-29 12:38:43 +00:00
parent e76605ff75
commit 8ec9f23719
2 changed files with 12 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,17 +68,16 @@ public class RestartApplicationListener
if (enabled == null || Boolean.parseBoolean(enabled)) {
String[] args = event.getArgs();
DefaultRestartInitializer initializer = new DefaultRestartInitializer();
boolean restartOnInitialize = true;
if (AgentReloader.isActive()) {
boolean restartOnInitialize = !AgentReloader.isActive();
if (!restartOnInitialize) {
logger.info(
"Restart disabled due to an agent-based reloader being active");
restartOnInitialize = false;
}
Restarter.initialize(args, false, initializer, restartOnInitialize);
}
else {
logger.info("Restart disabled due to System property '" + ENABLED_PROPERTY
+ "' set to false");
+ "' being set to false");
Restarter.disable();
}
}