Skip to content

Commit

Permalink
Prevent Class Cast Exception in cases where two classloaders handle t…
Browse files Browse the repository at this point in the history
…he same TracingLogger

Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol committed Sep 7, 2023
1 parent 9d96068 commit 5a2b251
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -118,8 +118,8 @@ public static TracingLogger getInstance(final PropertiesDelegate propertiesDeleg
//not server side
return EMPTY;
}
final TracingLogger tracingLogger = (TracingLogger) propertiesDelegate.getProperty(PROPERTY_NAME);
return (tracingLogger != null) ? tracingLogger : EMPTY;
final Object tracingLogger = propertiesDelegate.getProperty(PROPERTY_NAME);
return TracingLogger.class.isInstance(tracingLogger) ? (TracingLogger) tracingLogger : EMPTY;
}

/**
Expand Down

0 comments on commit 5a2b251

Please sign in to comment.