Skip to content

Commit 6b7b5bd

Browse files
Fixed #930
1 parent ba0e0ef commit 6b7b5bd

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main/java/soot/jbco/Main.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ else if (arg.startsWith("-t:")) {
172172
Object o = null;
173173
arg = arg.substring(4);
174174

175-
int tweight = 0;
175+
int tweight = 9;
176176
char cweight = arg.charAt(0);
177177
if (cweight >= '0' && cweight <= '9') {
178178
try {
@@ -209,6 +209,7 @@ else if (arg.startsWith("-t:")) {
209209
o = arg;
210210
}
211211

212+
transformsToAdd.add(trans);
212213
Map<Object, Integer> htmp = transformsToMethodsToWeights.get(trans);
213214
if (htmp == null) {
214215
htmp = new HashMap<Object, Integer>();
@@ -470,6 +471,8 @@ public static int getWeight(String phasename, String method) {
470471
if (o instanceof java.util.regex.Pattern) {
471472
if (((java.util.regex.Pattern) o).matcher(method).matches()) {
472473
intg = (Integer) htmp.get(o);
474+
} else {
475+
intg = 0;
473476
}
474477
} else if (o instanceof String && method.equals(o)) {
475478
intg = (Integer) htmp.get(o);

src/main/java/soot/jbco/jimpleTransformations/FieldRenamer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected void internalTransform(String phaseName, Map<String, String> options)
118118
}
119119
// rename all the fields in the class
120120
for (SootField f : sc.getFields()) {
121-
int weight = soot.jbco.Main.getWeight(phaseName, f.getName());
121+
int weight = soot.jbco.Main.getWeight(phaseName, f.getSignature());
122122
if (weight > 0) {
123123
renameField(className, f);
124124
}

src/main/java/soot/jbco/jimpleTransformations/MethodRenamer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public String getNewName() {
379379
}
380380

381381
private boolean isRenamingAllowed(SootMethod method) {
382-
if (soot.jbco.Main.getWeight(MethodRenamer.name, method.getName()) == 0) {
382+
if (soot.jbco.Main.getWeight(MethodRenamer.name, method.getSignature()) == 0) {
383383
return false;
384384
}
385385

0 commit comments

Comments
 (0)