Skip to content

Commit

Permalink
Fix infinite recursion in PluginClasspathChecker debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vierbergenlars committed Jan 22, 2020
1 parent a266868 commit f3bd2eb
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ private static boolean isDisabled() {
private static String buildClassChain(Class<?> clazz) {
StringBuilder classString = new StringBuilder();
do {
classString.append(clazz)
classString
.append("Class<")
.append(clazz.getName())
.append(">")
.append("@")
.append(Integer.toHexString(clazz.hashCode()))
.append('[')
.append(clazz.getClassLoader())
.append("@")
.append(Integer.toHexString(clazz.getClassLoader().hashCode()))
.append(']')
.append(" -> ");
clazz = clazz.getSuperclass();
Expand All @@ -47,7 +54,7 @@ private static String buildClassChain(Class<?> clazz) {
}

private static String buildClassChain(Object instance) {
return instance + "{" + buildClassChain(instance) + "}";
return instance + "{" + buildClassChain(instance.getClass()) + "}";
}

public PluginClasspathChecker(Project project) {
Expand Down

0 comments on commit f3bd2eb

Please sign in to comment.