call applyPreserveRule only when creating a new class

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@545 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent d70ef1d7d2
commit 4ffe97870b
  1. 7
      jode/jode/obfuscator/PackageIdentifier.java

@ -80,6 +80,8 @@ public class PackageIdentifier extends Identifier {
(bundle, this, subclazz, ClassInfo.forName(fullname)); (bundle, this, subclazz, ClassInfo.forName(fullname));
loadedClasses.put(subclazz, ident); loadedClasses.put(subclazz, ident);
((ClassIdentifier) ident).initClass(); ((ClassIdentifier) ident).initClass();
if (bundle.preserveRule != -1)
ident.applyPreserveRule(bundle.preserveRule);
} }
} }
} }
@ -88,8 +90,7 @@ public class PackageIdentifier extends Identifier {
public Identifier getIdentifier(String name) { public Identifier getIdentifier(String name) {
if (loadOnDemand) { if (loadOnDemand) {
Identifier ident = loadClass(name); Identifier ident = loadClass(name);
if (ident != null && bundle.preserveRule != -1) return ident;
ident.applyPreserveRule(bundle.preserveRule);
} }
int index = name.indexOf('.'); int index = name.indexOf('.');
@ -121,6 +122,8 @@ public class PackageIdentifier extends Identifier {
ClassInfo.forName(fullname)); ClassInfo.forName(fullname));
loadedClasses.put(name, ident); loadedClasses.put(name, ident);
((ClassIdentifier) ident).initClass(); ((ClassIdentifier) ident).initClass();
if (bundle.preserveRule != -1)
ident.applyPreserveRule(bundle.preserveRule);
} }
} }
return ident; return ident;

Loading…
Cancel
Save