From 816bca302db7f65362ac6a46a96afea91d6775b6 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Mon, 29 Jan 2001 19:47:04 +0000 Subject: [PATCH] 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 --- jode/jode/bytecode/ClassInfo.java.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jode/jode/bytecode/ClassInfo.java.in b/jode/jode/bytecode/ClassInfo.java.in index 83f6533..4feceeb 100644 --- a/jode/jode/bytecode/ClassInfo.java.in +++ b/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);