some bug fixes

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@990 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 56ad6fe437
commit bed556a398
  1. 24
      jode/jode/obfuscator/WildCard.java

@ -31,25 +31,21 @@ public class WildCard {
public String getNextComponent(String prefix) { public String getNextComponent(String prefix) {
int lastDot = prefix.length(); int lastDot = prefix.length();
if (lastDot < wildcard.length() if (!wildcard.startsWith(prefix))
|| !wildcard.startsWith(prefix)
|| (lastDot > 0 && wildcard.charAt(lastDot) != '.'))
return null; return null;
if (lastDot > 0) if (lastDot > 0) {
lastDot++; if (wildcard.charAt(lastDot++) != '.')
return null;
}
int nextDot = wildcard.indexOf('.', lastDot); int nextDot = wildcard.indexOf('.', lastDot);
if (firstStar == -1) { if (nextDot > 0
if (nextDot == -1) && (nextDot <= firstStar || firstStar == -1))
return wildcard.substring(lastDot, nextDot);
else if (firstStar == -1)
return wildcard.substring(lastDot); return wildcard.substring(lastDot);
else else
return wildcard.substring(lastDot, nextDot);
} else {
if (nextDot == -1 || nextDot > firstStar) {
return null; return null;
} else {
return wildcard.substring(lastDot, nextDot);
}
}
} }
public boolean startsWith(String test) { public boolean startsWith(String test) {

Loading…
Cancel
Save