"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/java/edu/umd/cs/findbugs/detect/IncompatMask.java" between
findbugs-3.0.0-source.zip and findbugs-3.0.1-source.zip

About: FindBugs uses static analysis to look for bugs in Java code. Source.

IncompatMask.java  (findbugs-3.0.0-source):IncompatMask.java  (findbugs-3.0.1-source)
skipping to change at line 166 skipping to change at line 166
isLong = true; isLong = true;
return; /* Ignore. An 'if' opcode will follow */ return; /* Ignore. An 'if' opcode will follow */
} }
state = 0; state = 0;
return; return;
case IFLE: case IFLE:
case IFLT: case IFLT:
case IFGT: case IFGT:
case IFGE: case IFGE:
if (state == 3 && isLong || state == 2 & !isLong) { if (state == 3 && isLong || state == 2 && !isLong) {
long bits = getFlagBits(isLong, arg0); long bits = getFlagBits(isLong, arg0);
boolean highbit = !isLong && (bits & 0x80000000) != 0 || isLong && bits < 0 && bits << 1 == 0; boolean highbit = !isLong && (bits & 0x80000000) != 0 || isLong && bits < 0 && bits << 1 == 0;
boolean onlyLowBits = bits >>> 12 == 0; boolean onlyLowBits = bits >>> 12 == 0;
BugInstance bug; BugInstance bug;
if (highbit) { if (highbit) {
bug = new BugInstance(this, "BIT_SIGNED_CHECK_HIGH_BIT", (se en == IFLE || seen == IFGT) ? HIGH_PRIORITY bug = new BugInstance(this, "BIT_SIGNED_CHECK_HIGH_BIT", (se en == IFLE || seen == IFGT) ? HIGH_PRIORITY
: NORMAL_PRIORITY); : NORMAL_PRIORITY);
} else { } else {
bug = new BugInstance(this, "BIT_SIGNED_CHECK", onlyLowBits ? LOW_PRIORITY : NORMAL_PRIORITY); bug = new BugInstance(this, "BIT_SIGNED_CHECK", onlyLowBits ? LOW_PRIORITY : NORMAL_PRIORITY);
} }
skipping to change at line 226 skipping to change at line 226
dif = arg1 & ~arg0; dif = arg1 & ~arg0;
t = "BIT_AND"; t = "BIT_AND";
} else { } else {
dif = 1; dif = 1;
t = "BIT_AND_ZZ"; t = "BIT_AND_ZZ";
} }
if (dif != 0) { if (dif != 0) {
// System.out.println("Match at offset " + getPC()); // System.out.println("Match at offset " + getPC());
BugInstance bug = new BugInstance(this, t, HIGH_PRIORITY).addClassAn dMethod(this); BugInstance bug = new BugInstance(this, t, HIGH_PRIORITY).addClassAn dMethod(this);
if (!t.equals("BIT_AND_ZZ")) { if (!"BIT_AND_ZZ".equals(t)) {
bug.addString("0x" + Long.toHexString(arg0)).addString("0x" + Lo ng.toHexString(arg1)); bug.addString("0x" + Long.toHexString(arg0)).addString("0x" + Lo ng.toHexString(arg1));
} }
bug.addSourceLine(this); bug.addSourceLine(this);
bugReporter.reportBug(bug); bugReporter.reportBug(bug);
} }
state = 0; state = 0;
} }
static long getFlagBits(boolean isLong, long arg0) { static long getFlagBits(boolean isLong, long arg0) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS