Method scoped classes can look like inner classes. Try to distinguish by

bytecode name.


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1291 379699f6-c40d-0410-875b-85095c16579e
master
hoenicke 24 years ago
parent 03a84b8f4f
commit 9470aef606
  1. 14
      jode/jode/bytecode/ClassInfo.java

@ -458,7 +458,7 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
* Some other InnerClass records, the extra classes. This is * Some other InnerClass records, the extra classes. This is
* optional, but we don't want to loose this information if we * optional, but we don't want to loose this information if we
* just transform classes, so we memorize for which classes we * just transform classes, so we memorize for which classes we
* have to keep the inforamtion anyway. * have to keep the information anyway.
* *
* Currently we don't use all informations, since we don't * Currently we don't use all informations, since we don't
* update the information for inner/outer/extra classes or * update the information for inner/outer/extra classes or
@ -494,6 +494,18 @@ public final class ClassInfo extends BinaryInfo implements Comparable {
if (innername != null && innername.length() == 0) if (innername != null && innername.length() == 0)
innername = null; 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;
ClassInfo innerCI = classpath.getClassInfo(inner); ClassInfo innerCI = classpath.getClassInfo(inner);
ClassInfo outerCI = null; ClassInfo outerCI = null;
if (outer != null) { if (outer != null) {

Loading…
Cancel
Save