Skip to content

Commit

Permalink
Update CommonUtil.java (#3932)
Browse files Browse the repository at this point in the history
* Update CommonUtil.java

When logLevel set to FINE;  castings to URLClassLoader  was throwing  java.lang.ClassCastException.
To fix this issue logClassPath method changed

Signed-off-by: Berkant Karduman <karduman.berkant@gmail.com>

* Update CommonUtil.java

classpath directly logged

Signed-off-by: Berkant Karduman <karduman.berkant@gmail.com>

* Update CommonUtil.java

variable name changed

Signed-off-by: Berkant Karduman <karduman.berkant@gmail.com>

Signed-off-by: Berkant Karduman <karduman.berkant@gmail.com>
  • Loading branch information
berkant-k authored Aug 31, 2022
1 parent 04207f3 commit 19f1a83
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ public static void configureLogger() {
public static void logClasspath(Logger logger) {
if (logger.isLoggable(Level.FINE)) {
logger.fine("CLASSPATH: ");
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] classpath = ((URLClassLoader) cl).getURLs();
for (URL u : classpath) {
logger.fine(" " + u.getFile());
}
String classPath = System.getProperty("java.class.path");
logger.fine(classPath);
}
}

Expand Down Expand Up @@ -182,4 +179,4 @@ public static IDatabaseAdapter getDbAdapter(DbType dbType, IConnectionProvider c
throw new IllegalStateException("Unsupported db type: " + dbType);
}
}
}
}

0 comments on commit 19f1a83

Please sign in to comment.