Skip to content

Commit

Permalink
Remove potential infinite loop (related to JENKINS-5922) + formating …
Browse files Browse the repository at this point in the history
…of previous patch

(cherry picked from commit 7c5da9b)
  • Loading branch information
vjuranek committed May 19, 2011
1 parent 41dc24f commit 8511294
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions remoting/src/main/java/hudson/remoting/Which.java
Expand Up @@ -114,14 +114,14 @@ public static File jarFile(Class clazz) throws IOException {
try {
Object delegate = is;
while (delegate.getClass().getEnclosingClass()!=ZipFile.class) {
Field f = is.getClass().getDeclaredField("delegate");
Field f = delegate.getClass().getDeclaredField("delegate");
f.setAccessible(true);
delegate = f.get(is);
//JENKINS-5922 - workaround for CertificateReaderInputStream; JBoss 5.0.0, EAP 5.0 and EAP 5.1
delegate = f.get(delegate);
//JENKINS-5922 - workaround for CertificateReaderInputStream; JBoss 5.0.0, EAP 5.0 and EAP 5.1
if(delegate.getClass().getName().equals("java.util.jar.JarVerifier$VerifierStream")){
f = delegate.getClass().getDeclaredField("is");
f.setAccessible(true);
delegate = f.get(delegate);
f = delegate.getClass().getDeclaredField("is");
f.setAccessible(true);
delegate = f.get(delegate);
}
}
Field f = delegate.getClass().getDeclaredField("this$0");
Expand Down

0 comments on commit 8511294

Please sign in to comment.