Skip to content

Commit

Permalink
bug fixed for classloader
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Jan 5, 2014
1 parent e97dc43 commit dba6659
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/main/java/com/alibaba/druid/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ public static Class<?> loadClass(String className) {
if (className == null) {
return null;
}

try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
// skip
}

ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
if (ctxClassLoader != null) {
Expand All @@ -227,15 +233,7 @@ public static Class<?> loadClass(String className) {
}
}

if (clazz != null) {
return clazz;
}

try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
return null;
}
return clazz;
}

private static Date startTime;
Expand Down

0 comments on commit dba6659

Please sign in to comment.