Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8255225: compiler/aot tests fail on Windows with NPE during artifact …
…resolution

Reviewed-by: erikj, clanger
  • Loading branch information
shipilev committed Oct 23, 2020
1 parent a824781 commit 64dc4b1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java
Expand Up @@ -14,14 +14,22 @@ public ArtifactResolverException(String message, Throwable cause) {
}

public String toString() {
return super.toString() + ": " + getRootCause().toString();
Throwable root = getRootCause();
if (root != null) {
return super.toString() + ": " + root.toString();
} else {
return super.toString();
}
}

public Throwable getRootCause() {
Throwable rootCause = getCause();
while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
rootCause = rootCause.getCause();
Throwable root = getCause();
if (root == null) {
return null;
}
while (root.getCause() != null && root.getCause() != root) {
root = root.getCause();
}
return rootCause;
return root;
}
}

1 comment on commit 64dc4b1

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 64dc4b1 Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.