preserveRule fixing

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@321 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 8abe8d2190
commit 8ed9c73276
  1. 26
      jode/jode/obfuscator/ClassIdentifier.java

@ -31,7 +31,6 @@ public class ClassIdentifier extends Identifier {
ClassInfo info;
boolean willStrip;
int preserveRule;
int fieldCount;
/* The first fieldCount are of type FieldIdentifier, the remaining
* are MethodIdentifier
@ -47,12 +46,6 @@ public class ClassIdentifier extends Identifier {
this.pack = pack;
this.name = name;
this.info = info;
preserveRule = bundle.preserveRule;
if ((preserveRule & (info.getModifiers() ^ Modifier.PRIVATE)) != 0) {
setReachable();
setPreserved();
}
}
public void addSubClass(ClassIdentifier ci) {
@ -73,6 +66,15 @@ public class ClassIdentifier extends Identifier {
}
}
public void applyPreserveRule(int preserveRule) {
if ((preserveRule & (info.getModifiers() ^ Modifier.PRIVATE)) != 0) {
setReachable();
setPreserved();
}
for (int i=0; i< identifiers.length; i++)
identifiers[i].applyPreserveRule(preserveRule);
}
public void reachableIdentifier(String name, String typeSig,
boolean isVirtual) {
for (int i=0; i < identifiers.length; i++) {
@ -208,20 +210,10 @@ public class ClassIdentifier extends Identifier {
identifiers = new Identifier[finfos.length + minfos.length];
for (int i=0; i< fieldCount; i++) {
identifiers[i] = new FieldIdentifier(this, finfos[i]);
if ((preserveRule & (finfos[i].getModifiers() ^ Modifier.PRIVATE))
!= 0) {
identifiers[i].setReachable();
identifiers[i].setPreserved();
}
}
for (int i=0; i< minfos.length; i++) {
identifiers[fieldCount + i]
= new MethodIdentifier(this, minfos[i]);
if ((preserveRule & (minfos[i].getModifiers() ^ Modifier.PRIVATE))
!= 0) {
identifiers[i].setReachable();
identifiers[i].setPreserved();
}
if (identifiers[i].getName().equals("<init>"))
identifiers[i].setPreserved();
}

Loading…
Cancel
Save