GlobalOptions

bug fix: check for class!= null before doing loadInfoReflection


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@677 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 912b7bf041
commit dfa569f377
  1. 17
      jode/jode/bytecode/ClassInfo.java

@ -18,7 +18,7 @@
*/ */
package jode.bytecode; package jode.bytecode;
import jode.Decompiler; import jode.GlobalOptions;
import jode.type.Type; import jode.type.Type;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
@ -450,7 +450,7 @@ public class ClassInfo extends BinaryInfo {
fs = clazz.getDeclaredFields(); fs = clazz.getDeclaredFields();
} catch (SecurityException ex) { } catch (SecurityException ex) {
fs = clazz.getFields(); fs = clazz.getFields();
Decompiler.err.println GlobalOptions.err.println
("Could only get public fields of class " ("Could only get public fields of class "
+ name + "."); + name + ".");
} }
@ -467,7 +467,7 @@ public class ClassInfo extends BinaryInfo {
ms = clazz.getDeclaredMethods(); ms = clazz.getDeclaredMethods();
} catch (SecurityException ex) { } catch (SecurityException ex) {
ms = clazz.getMethods(); ms = clazz.getMethods();
Decompiler.err.println GlobalOptions.err.println
("Could only get public methods of class " ("Could only get public methods of class "
+ name + "."); + name + ".");
} }
@ -493,9 +493,9 @@ public class ClassInfo extends BinaryInfo {
} catch (IOException ex) { } catch (IOException ex) {
String message = ex.getMessage(); String message = ex.getMessage();
if ((howMuch & ~(FIELDS|METHODS|HIERARCHY)) != 0) { if ((howMuch & ~(FIELDS|METHODS|HIERARCHY)) != 0) {
Decompiler.err.println GlobalOptions.err.println
("Can't read class " + name + "."); ("Can't read class " + name + ".");
ex.printStackTrace(Decompiler.err); ex.printStackTrace(GlobalOptions.err);
throw new NoClassDefFoundError(name); throw new NoClassDefFoundError(name);
} }
// Try getting the info through the reflection interface // Try getting the info through the reflection interface
@ -507,15 +507,16 @@ public class ClassInfo extends BinaryInfo {
} catch (NoClassDefFoundError ex2) { } catch (NoClassDefFoundError ex2) {
} }
try { try {
loadInfoReflection(clazz, howMuch); if (clazz != null)
loadInfoReflection(clazz, howMuch);
return; return;
} catch (SecurityException ex2) { } catch (SecurityException ex2) {
Decompiler.err.println GlobalOptions.err.println
(ex2+" while collecting info about class " + name + "."); (ex2+" while collecting info about class " + name + ".");
} }
// Give a warning and ``guess'' the hierarchie, methods etc. // Give a warning and ``guess'' the hierarchie, methods etc.
Decompiler.err.println GlobalOptions.err.println
("Can't read class " + name + ", types may be incorrect. (" ("Can't read class " + name + ", types may be incorrect. ("
+ ex.getClass().getName() + ex.getClass().getName()
+ (message != null ? ": " + message : "") + ")"); + (message != null ? ": " + message : "") + ")");

Loading…
Cancel
Save