some bug fixes

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

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

Loading…
Cancel
Save