Fix crash size is missing in bitset
This commit is contained in:
parent
c88e47b710
commit
7113eb554f
1 changed files with 5 additions and 5 deletions
|
@ -687,7 +687,7 @@ public class GeneralRouter implements VehicleRouter {
|
|||
if (value instanceof String && value.toString().startsWith("$")) {
|
||||
BitSet mask = tagRuleMask.get(value.toString().substring(1));
|
||||
if (mask != null && mask.intersects(types)) {
|
||||
BitSet findBit = new BitSet(mask.size());
|
||||
BitSet findBit = new BitSet(mask.length());
|
||||
findBit.or(mask);
|
||||
findBit.and(types);
|
||||
int v = findBit.nextSetBit(0);
|
||||
|
@ -768,16 +768,16 @@ public class GeneralRouter implements VehicleRouter {
|
|||
|
||||
public void printRule(PrintStream out) {
|
||||
out.print(" Select " + selectValue + " if ");
|
||||
for(int k = 0; k < filterTypes.size(); k++) {
|
||||
for(int k = 0; k < filterTypes.length(); k++) {
|
||||
if(filterTypes.get(k)) {
|
||||
String key = universalRulesById.get(k);
|
||||
out.print(key + " ");
|
||||
}
|
||||
}
|
||||
if(filterNotTypes.size() > 0) {
|
||||
if(filterNotTypes.length() > 0) {
|
||||
out.print(" ifnot ");
|
||||
}
|
||||
for(int k = 0; k < filterNotTypes.size(); k++) {
|
||||
for(int k = 0; k < filterNotTypes.length(); k++) {
|
||||
if(filterNotTypes.get(k)) {
|
||||
String key = universalRulesById.get(k);
|
||||
out.print(key + " ");
|
||||
|
@ -850,7 +850,7 @@ public class GeneralRouter implements VehicleRouter {
|
|||
if (selectValue instanceof String && selectValue.toString().startsWith("$")) {
|
||||
BitSet mask = tagRuleMask.get(selectValue.toString().substring(1));
|
||||
if (mask != null && mask.intersects(types)) {
|
||||
BitSet findBit = new BitSet(mask.size());
|
||||
BitSet findBit = new BitSet(mask.length());
|
||||
findBit.or(mask);
|
||||
findBit.and(types);
|
||||
int value = findBit.nextSetBit(0);
|
||||
|
|
Loading…
Reference in a new issue