index out of bounds, blooper check

This commit is contained in:
Manindra Moharana
2014-06-26 13:51:41 +05:30
parent db8ef56e06
commit 172228da45
@@ -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;