From 49ebb0522d9e31253bc341cc6e2e9c6e9b0c03ca Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 16 Apr 2017 13:49:19 +0300 Subject: [PATCH] Fix crash size is missing in bitset --- OsmAnd-java/src/net/osmand/router/GeneralRouter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java index 730377cb25..ecaae2094a 100644 --- a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java @@ -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);