Skip to content

Commit

Permalink
8345175: Further cleanup in java.logging and jdk.internal.logger afte…
Browse files Browse the repository at this point in the history
…r JEP 486 integration
  • Loading branch information
dfuch committed Nov 28, 2024
1 parent d33ad07 commit 0e32721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ public Logger getLogger(String name, Module module) {
private static System.LoggerFinder loadLoggerFinder() {
System.LoggerFinder result;
try {
// Iterator iterates with the access control context stored
// at ServiceLoader creation time.
final Iterator<System.LoggerFinder> iterator =
findLoggerFinderProviders();
if (iterator.hasNext()) {
Expand Down Expand Up @@ -197,8 +195,6 @@ private static System.LoggerFinder loadDefaultImplementation() {

DefaultLoggerFinder result = null;
try {
// Iterator iterates with the access control context stored
// at ServiceLoader creation time.
if (iterator.hasNext()) {
result = iterator.next();
}
Expand Down
13 changes: 4 additions & 9 deletions src/java.logging/share/classes/java/util/logging/LogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public class LogManager {
// LoggerContext for system loggers and user loggers
private final LoggerContext systemContext = new SystemLoggerContext();
private final LoggerContext userContext = new LoggerContext();
// non final field - make it volatile to make sure that other threads
// non-final field - make it volatile to make sure that other threads
// will see the new value once ensureLogManagerInitialized() has finished
// executing.
private volatile Logger rootLogger;
Expand Down Expand Up @@ -312,7 +312,6 @@ protected LogManager() {
*/
private boolean initializedCalled = false;
private volatile boolean initializationDone = false;
@SuppressWarnings("removal")
final void ensureLogManagerInitialized() {
final LogManager owner = this;
if (initializationDone || owner != manager) {
Expand Down Expand Up @@ -422,15 +421,11 @@ private void readPrimordialConfiguration() { // must be called while holding con
}
}

// LoggerContext maps from AppContext
private WeakHashMap<Object, LoggerContext> contextsMap = null;

// Returns the LoggerContext for the user code (i.e. application or AppContext).
// Loggers are isolated from each AppContext.
private LoggerContext getUserContext() {
LoggerContext context = null;
// for standalone app, return userContext
return context != null ? context : userContext;
// return userContext
return userContext;
}

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

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

0 comments on commit 0e32721

Please sign in to comment.