From 172228da45134a6c13282369d3cf023a41572dfa Mon Sep 17 00:00:00 2001 From: Manindra Moharana Date: Thu, 26 Jun 2014 13:51:41 +0530 Subject: [PATCH] index out of bounds, blooper check --- pdex/src/processing/mode/experimental/OffsetMatcher.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pdex/src/processing/mode/experimental/OffsetMatcher.java b/pdex/src/processing/mode/experimental/OffsetMatcher.java index 88aaf9917..ef907b50d 100644 --- a/pdex/src/processing/mode/experimental/OffsetMatcher.java +++ b/pdex/src/processing/mode/experimental/OffsetMatcher.java @@ -95,8 +95,7 @@ public class OffsetMatcher { + offsetMatch.get(i).pdeOffset); } int pdeOff = offsetMatch.get(++i).pdeOffset; - if(i > 0) - while (offsetMatch.get(--i).pdeOffset == pdeOff); + while (i > 0 && offsetMatch.get(--i).pdeOffset == pdeOff); int j = i + 1; if (j > -1 && j < offsetMatch.size()) return offsetMatch.get(j).pdeOffset; @@ -118,8 +117,7 @@ public class OffsetMatcher { // + offsetMatch.get(i).pdeOffset); } int javaOff = offsetMatch.get(++i).javaOffset; - if(i > 0) - while (offsetMatch.get(--i).javaOffset == javaOff); + while (i > 0 && offsetMatch.get(--i).javaOffset == javaOff); int j = i + 1; if (j > -1 && j < offsetMatch.size()) return offsetMatch.get(j).javaOffset;