Distinguish method scoped classes from inner classes in a better way.

git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1287 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 24 years ago
parent 0785a7cd21
commit 816bca302d
  1. 13
      jode/jode/bytecode/ClassInfo.java.in

@ -192,6 +192,19 @@ public class ClassInfo extends BinaryInfo {
int access = input.readUnsignedShort();
if (innername != null && innername.length() == 0)
innername = null;
/* Some compilers give method scope classes a valid
* outer field, but we mustn't handle them as inner
* classes. The best way to distinguish this case
* is by the class name.
*/
if (outer != null && innername != null
&& inner.length() > outer.length() + 2 + innername.length()
&& inner.startsWith(outer+"$")
&& inner.endsWith("$"+innername)
&& Character.isDigit(inner.charAt(outer.length() + 1)))
outer = null;
InnerClassInfo ici = new InnerClassInfo
(inner, outer, innername, access);

Loading…
Cancel
Save