Skip to content

Commit 3b21a29

Browse files
committed
8345175: Further cleanup in java.logging and jdk.internal.logger after JEP 486 integration
Reviewed-by: alanb, coffeys
1 parent 7dc00d3 commit 3b21a29

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java

-4
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ public Logger getLogger(String name, Module module) {
148148
private static System.LoggerFinder loadLoggerFinder() {
149149
System.LoggerFinder result;
150150
try {
151-
// Iterator iterates with the access control context stored
152-
// at ServiceLoader creation time.
153151
final Iterator<System.LoggerFinder> iterator =
154152
findLoggerFinderProviders();
155153
if (iterator.hasNext()) {
@@ -197,8 +195,6 @@ private static System.LoggerFinder loadDefaultImplementation() {
197195

198196
DefaultLoggerFinder result = null;
199197
try {
200-
// Iterator iterates with the access control context stored
201-
// at ServiceLoader creation time.
202198
if (iterator.hasNext()) {
203199
result = iterator.next();
204200
}

src/java.logging/share/classes/java/util/logging/LogManager.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public class LogManager {
164164
// LoggerContext for system loggers and user loggers
165165
private final LoggerContext systemContext = new SystemLoggerContext();
166166
private final LoggerContext userContext = new LoggerContext();
167-
// non final field - make it volatile to make sure that other threads
167+
// non-final field - make it volatile to make sure that other threads
168168
// will see the new value once ensureLogManagerInitialized() has finished
169169
// executing.
170170
private volatile Logger rootLogger;
@@ -312,7 +312,6 @@ protected LogManager() {
312312
*/
313313
private boolean initializedCalled = false;
314314
private volatile boolean initializationDone = false;
315-
@SuppressWarnings("removal")
316315
final void ensureLogManagerInitialized() {
317316
final LogManager owner = this;
318317
if (initializationDone || owner != manager) {
@@ -422,15 +421,11 @@ private void readPrimordialConfiguration() { // must be called while holding con
422421
}
423422
}
424423

425-
// LoggerContext maps from AppContext
426-
private WeakHashMap<Object, LoggerContext> contextsMap = null;
427-
428424
// Returns the LoggerContext for the user code (i.e. application or AppContext).
429425
// Loggers are isolated from each AppContext.
430426
private LoggerContext getUserContext() {
431-
LoggerContext context = null;
432-
// for standalone app, return userContext
433-
return context != null ? context : userContext;
427+
// return userContext
428+
return userContext;
434429
}
435430

436431
// The system context.
@@ -447,7 +442,7 @@ private List<LoggerContext> contexts() {
447442

448443
// Find or create a specified logger instance. If a logger has
449444
// already been created with the given name it is returned.
450-
// Otherwise a new logger instance is created and registered
445+
// Otherwise, a new logger instance is created and registered
451446
// in the LogManager global namespace.
452447
// This method will always return a non-null Logger object.
453448
// Synchronization is not required here. All synchronization for

0 commit comments

Comments
 (0)