Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25648/src/com/mebigfatguy/fbcontrib/detect
Modified Files:
BloatedSynchronizedBlock.java
Log Message:
report the proper line range when the bloated area is truncated via a branch
Index: BloatedSynchronizedBlock.java
===================================================================
RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- BloatedSynchronizedBlock.java 27 Jan 2006 04:30:49 -0000 1.11
+++ BloatedSynchronizedBlock.java 29 Jan 2006 19:47:53 -0000 1.12
@@ -40,7 +40,6 @@
private Set<Integer> unsafeAliases = new HashSet<Integer>();
private Map<Integer, Integer> branchInfo = new HashMap<Integer, Integer>();
private int syncPC;
- private int lastPC;
private boolean isStatic;
private int minSafeCodeLength;
private boolean thisCallOccurred;
@@ -75,7 +74,6 @@
syncPC = 0;
else
syncPC = -1;
- lastPC = -1;
isStatic = obj.isStatic();
unsafeAliases.clear();
branchInfo.clear();
@@ -154,7 +152,7 @@
if ((bStart >= syncPC) && (bStart <= pc)) {
int bEnd = entry.getValue().intValue();
if (bEnd > pc) {
- pc = bStart;
+ pc = bStart - 1;
}
}
}
@@ -162,13 +160,12 @@
bugReporter.reportBug(new BugInstance(this, "BSB_BLOATED_SYNCHRONIZED_BLOCK", NORMAL_PRIORITY)
.addClass(this)
.addMethod(this)
- .addSourceLineRange(this, syncPC + 1, lastPC));
+ .addSourceLineRange(this, syncPC + 1, pc));
}
}
syncPC = -1;
}
}
- lastPC = getPC();
} finally {
stack.sawOpcode(this, seen);
}
|