fb-contrib-commit Mailing List for fb-contrib (Page 7)
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(56) |
Oct
(60) |
Nov
(58) |
Dec
(89) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(66) |
Feb
(55) |
Mar
(85) |
Apr
(115) |
May
(35) |
Jun
(28) |
Jul
(3) |
Aug
(48) |
Sep
(37) |
Oct
(22) |
Nov
(14) |
Dec
(66) |
| 2007 |
Jan
(45) |
Feb
(63) |
Mar
(10) |
Apr
(1) |
May
(1) |
Jun
(12) |
Jul
|
Aug
|
Sep
(25) |
Oct
(21) |
Nov
(39) |
Dec
|
| 2008 |
Jan
(7) |
Feb
|
Mar
(26) |
Apr
(5) |
May
(2) |
Jun
(32) |
Jul
(9) |
Aug
(10) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
| 2009 |
Jan
(10) |
Feb
(31) |
Mar
(32) |
Apr
(35) |
May
(25) |
Jun
|
Jul
(31) |
Aug
(10) |
Sep
(95) |
Oct
(35) |
Nov
(10) |
Dec
(34) |
| 2010 |
Jan
(90) |
Feb
(4) |
Mar
(7) |
Apr
(20) |
May
(20) |
Jun
(13) |
Jul
(7) |
Aug
(18) |
Sep
(25) |
Oct
(4) |
Nov
(16) |
Dec
(2) |
| 2011 |
Jan
(1) |
Feb
|
Mar
(11) |
Apr
(3) |
May
(2) |
Jun
(26) |
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(14) |
Nov
(3) |
Dec
(4) |
| 2013 |
Jan
(3) |
Feb
(2) |
Mar
(1) |
Apr
(4) |
May
|
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(3) |
| 2014 |
Jan
(4) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(3) |
| 2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
(2) |
Nov
(7) |
Dec
|
| 2017 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(3) |
| 2018 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(5) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2011-06-15 05:04:59
|
Revision: 1690
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1690&view=rev
Author: dbrosius
Date: 2011-06-15 05:04:52 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
initial implementation of STB, probably tons of FPs
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java 2011-06-15 01:28:58 UTC (rev 1689)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java 2011-06-15 05:04:52 UTC (rev 1690)
@@ -2,16 +2,18 @@
import java.util.ArrayList;
import java.util.BitSet;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
+import org.apache.bcel.Constants;
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.CodeException;
+import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
+import edu.umd.cs.findbugs.OpcodeStack;
+import edu.umd.cs.findbugs.ba.ClassContext;
/**
* looks for two or more try catch blocks that are consecutive and catch the
@@ -22,41 +24,79 @@
public class StackedTryBlocks extends BytecodeScanningDetector {
private final BugReporter bugReporter;
- private Map<TryBlock, TryBlock> blocks;
+ private List<TryBlock> blocks;
private List<TryBlock> inBlocks;
+ private OpcodeStack stack;
public StackedTryBlocks(BugReporter bugReporter) {
this.bugReporter = bugReporter;
}
@Override
+ public void visitClassContext(ClassContext classContext) {
+ try {
+ stack = new OpcodeStack();
+ super.visitClassContext(classContext);
+ } finally {
+ stack = null;
+ }
+ }
+
+ @Override
public void visitCode(Code obj) {
try {
- blocks = new HashMap<TryBlock, TryBlock>();
+ blocks = new ArrayList<TryBlock>();
inBlocks = new ArrayList<TryBlock>();
CodeException[] ces = obj.getExceptionTable();
for (CodeException ce : ces) {
TryBlock tb = new TryBlock(ce);
- TryBlock block = blocks.get(tb);
- if (block != null) {
- block.addCatchType(ce);
+ int existingBlock = blocks.indexOf(tb);
+ if (existingBlock >= 0) {
+ tb = blocks.get(existingBlock);
+ tb.addCatchType(ce);
} else {
- blocks.put(tb, tb);
+ blocks.add(tb);
}
}
- Iterator<TryBlock> it = blocks.keySet().iterator();
- int numSingleCatchBlocks = 0;
+ Iterator<TryBlock> it = blocks.iterator();
while (it.hasNext()) {
- if (!it.next().hasMultipleHandlers()) {
- numSingleCatchBlocks++;
+ if (it.next().hasMultipleHandlers()) {
+ it.remove();
}
}
- if (numSingleCatchBlocks > 1) {
+ if (blocks.size() > 1) {
+ stack.resetForMethodEntry(this);
super.visitCode(obj);
+
+ if (blocks.size() > 1) {
+ TryBlock firstBlock = blocks.get(0);
+ for (int i = 1; i < blocks.size(); i++) {
+ TryBlock secondBlock = blocks.get(i);
+
+ if ((firstBlock.getCatchType() == secondBlock
+ .getCatchType())
+ && (firstBlock.getThrowSignature()
+ .equals(secondBlock.getThrowSignature()))) {
+ bugReporter.reportBug(new BugInstance(this,
+ "STB_STACKED_TRY_BLOCKS", NORMAL_PRIORITY)
+ .addClass(this)
+ .addMethod(this)
+ .addSourceLineRange(this,
+ firstBlock.getStartPC(),
+ firstBlock.getEndHandlerPC())
+ .addSourceLineRange(this,
+ secondBlock.getStartPC(),
+ secondBlock.getEndHandlerPC()));
+
+ }
+
+ firstBlock = secondBlock;
+ }
+ }
}
} finally {
blocks = null;
@@ -67,31 +107,58 @@
@Override
public void sawOpcode(int seen) {
- TryBlock block = findBlockWithStart();
- if (block != null) {
- inBlocks.add(block);
- }
+ try {
+ int pc = getPC();
+ TryBlock block = findBlockWithStart(pc);
+ if (block != null) {
+ inBlocks.add(block);
+ block.setState(TryBlock.State.IN_TRY);
+ }
- if (inBlocks.size() > 0) {
- int nextPC = getNextPC();
- TryBlock innerBlock = inBlocks.get(inBlocks.size() - 1);
- if (nextPC == innerBlock.getHandlerPC()) {
- if ((seen == GOTO) || (seen == GOTO_W)) {
- innerBlock.setEndHandlerPC(getBranchTarget());
- } else {
- innerBlock.setEndHandlerPC(getCode().getLength());
+ if (inBlocks.size() > 0) {
+ TryBlock innerBlock = inBlocks.get(inBlocks.size() - 1);
+
+ int nextPC = getNextPC();
+ if (innerBlock.atHandlerPC(nextPC)) {
+ if ((seen == GOTO) || (seen == GOTO_W)) {
+ innerBlock.setEndHandlerPC(getBranchTarget());
+ } else {
+ inBlocks.remove(innerBlock);
+ blocks.remove(innerBlock);
+ }
+ } else if (innerBlock.atHandlerPC(pc)) {
+ innerBlock.setState(TryBlock.State.IN_CATCH);
+ } else if (innerBlock.atEndHandlerPC(pc)) {
+ inBlocks.remove(inBlocks.size() - 1);
+ innerBlock.setState(TryBlock.State.AFTER);
}
+
+ if (innerBlock.inCatch()) {
+ if (((seen >= Constants.IFEQ) && ((seen <= Constants.RET)))
+ || ((seen >= Constants.IRETURN) && (seen <= Constants.RETURN))
+ || (seen == GOTO_W)) {
+ blocks.remove(innerBlock);
+ inBlocks.remove(inBlocks.size() - 1);
+ } else if (seen == ATHROW) {
+ if (stack.getStackDepth() > 0) {
+ OpcodeStack.Item item = stack.getStackItem(0);
+ innerBlock.setThrowSignature(item.getSignature());
+ } else {
+ inBlocks.remove(inBlocks.size() - 1);
+ innerBlock.setState(TryBlock.State.AFTER);
+ }
+ }
+ }
}
+ } finally {
+ stack.sawOpcode(this, seen);
}
-
}
- private TryBlock findBlockWithStart() {
+ private TryBlock findBlockWithStart(int pc) {
- int pc = getPC();
-
- for (TryBlock block : blocks.keySet()) {
- if (block.getStartPC() == pc) {
+ for (TryBlock block : blocks) {
+ if (block.atStartPC(pc)) {
return block;
}
}
@@ -100,25 +167,41 @@
}
static class TryBlock {
+
+ public enum State {
+ BEFORE, IN_TRY, IN_CATCH, AFTER
+ };
+
int startPC;
int endPC;
int handlerPC;
int endHandlerPC;
BitSet catchTypes;
- int throwType;
+ String throwSig;
+ State state;
public TryBlock(CodeException ce) {
startPC = ce.getStartPC();
endPC = ce.getEndPC();
handlerPC = ce.getHandlerPC();
+ endHandlerPC = -1;
catchTypes = new BitSet();
catchTypes.set(ce.getCatchType());
+ state = State.BEFORE;
}
public void addCatchType(CodeException ce) {
catchTypes.set(ce.getCatchType());
}
+ public void setState(State executionState) {
+ state = executionState;
+ }
+
+ public boolean inCatch() {
+ return state == State.IN_CATCH;
+ }
+
public boolean hasMultipleHandlers() {
int bit = catchTypes.nextSetBit(0);
return catchTypes.nextSetBit(bit + 1) >= 0;
@@ -128,18 +211,38 @@
endHandlerPC = end;
}
- public void setThrowType(int type) {
- throwType = type;
+ public void setThrowSignature(String sig) {
+ throwSig = sig;
}
+ public String getThrowSignature() {
+ return throwSig;
+ }
+
public int getStartPC() {
return startPC;
}
- public int getHandlerPC() {
- return handlerPC;
+ public int getEndHandlerPC() {
+ return endHandlerPC;
}
+ public boolean atStartPC(int pc) {
+ return startPC == pc;
+ }
+
+ public boolean atHandlerPC(int pc) {
+ return handlerPC == pc;
+ }
+
+ public boolean atEndHandlerPC(int pc) {
+ return (endHandlerPC >= 0) && (endHandlerPC == pc);
+ }
+
+ public int getCatchType() {
+ return catchTypes.nextSetBit(0);
+ }
+
@Override
public int hashCode() {
return startPC ^ endPC;
@@ -158,7 +261,7 @@
@Override
public String toString() {
return "{" + startPC + " -> " + endPC + "} (catch "
- + catchTypes.get(0) + ") {" + handlerPC + " -> "
+ + catchTypes.nextSetBit(0) + ") {" + handlerPC + " -> "
+ endHandlerPC + "}";
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-15 01:29:05
|
Revision: 1689
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1689&view=rev
Author: dbrosius
Date: 2011-06-15 01:28:58 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
add notice of version 4.6.1
Modified Paths:
--------------
trunk/fb-contrib/htdocs/index.shtml
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2011-06-13 06:45:45 UTC (rev 1688)
+++ trunk/fb-contrib/htdocs/index.shtml 2011-06-15 01:28:58 UTC (rev 1689)
@@ -68,6 +68,8 @@
</li>
</ul>
</p>
+ <p style="font-weight: bold;">The latest version of fb-contrib is 4.6.1 available for download
+ <a href="http://sourceforge.net/projects/fb-contrib/files/Current/fb-contrib-4.6.1.jar/download">here</a>.</p>
</div>
<hr/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-13 06:45:57
|
Revision: 1688
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1688&view=rev
Author: dbrosius
Date: 2011-06-13 06:45:45 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
initial stub in of STB - non functional
Modified Paths:
--------------
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
Added Paths:
-----------
trunk/fb-contrib/samples/STB_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2011-06-13 05:07:07 UTC (rev 1687)
+++ trunk/fb-contrib/etc/findbugs.xml 2011-06-13 06:45:45 UTC (rev 1688)
@@ -222,6 +222,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.LingeringGraphicsObjects" speed="fast" reports="LGO_LINGERING_GRAPHICS_OBJECT" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" />
<!-- BugPattern -->
@@ -388,4 +389,5 @@
<BugPattern abbrev="SEC" type="SEC_SIDE_EFFECT_CONSTRUCTOR" category="STYLE" experimental="true" />
<BugPattern abbrev="SGSU" type="SGSU_SUSPICIOUS_GETTER_SETTER_USE" category="CORRECTNESS" experimental="true" />
<BugPattern abbrev="LGO" type="LGO_LINGERING_GRAPHICS_OBJECT" category="PERFORMANCE" experimental="true" />
+ <BugPattern abbrev="STB" type="STB_STACKED_TRY_BLOCKS" category="STYLE" experimental="true" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2011-06-13 05:07:07 UTC (rev 1687)
+++ trunk/fb-contrib/etc/messages.xml 2011-06-13 06:45:45 UTC (rev 1688)
@@ -1204,6 +1204,18 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks">
+ <Details>
+ <![CDATA[
+ <p>This detector looks for two or more try catch blocks that are consecutive
+ and catch the same kind of exception, and each catch block mandatorily throws
+ the same exception. These two catch blocks can and should be made into one
+ catch block to simply the code.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
<!-- BugPattern -->
@@ -3302,6 +3314,19 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="STB_STACKED_TRY_BLOCKS">
+ <ShortDescription>Method stacks similar try/catch blocks</ShortDescription>
+ <LongDescription>Method {1} stacks similar try/catch blocks</LongDescription>
+ <Details>
+ <![CDATA[
+ <P>This method declares two try catch blocks one after another, where each
+ catch block catches the same type of exception. They also throw uniformly the
+ same type of exception. These two catch blocks can be combined into one to
+ simplify the method.</p>
+ ]]>
+ </Details>
+ </BugPattern>
<!-- BugCode -->
@@ -3404,4 +3429,5 @@
<BugCode abbrev="SEC">Side Effect Constructor</BugCode>
<BugCode abbrev="SGSU">Suspicious Getter Setter Use</BugCode>
<BugCode abbrev="LGO">Lingering Graphics Object</BugCode>
+ <BugCode abbrev="STB">Stacked Catch Blocks</BugCode>
</MessageCollection>
Added: trunk/fb-contrib/samples/STB_Sample.java
===================================================================
--- trunk/fb-contrib/samples/STB_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/STB_Sample.java 2011-06-13 06:45:45 UTC (rev 1688)
@@ -0,0 +1,23 @@
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class STB_Sample {
+ public void testSTB(File f1, File f2) throws STBException {
+ try {
+ InputStream is = new FileInputStream(f1);
+ } catch (IOException ioe) {
+ throw new STBException();
+ }
+
+ try {
+ InputStream is = new FileInputStream(f2);
+ } catch (IOException ioe) {
+ throw new STBException();
+ }
+ }
+
+ static class STBException extends Exception {
+ }
+}
Property changes on: trunk/fb-contrib/samples/STB_Sample.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java (rev 0)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java 2011-06-13 06:45:45 UTC (rev 1688)
@@ -0,0 +1,165 @@
+package com.mebigfatguy.fbcontrib.detect;
+
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.bcel.classfile.Code;
+import org.apache.bcel.classfile.CodeException;
+
+import edu.umd.cs.findbugs.BugReporter;
+import edu.umd.cs.findbugs.BytecodeScanningDetector;
+
+/**
+ * looks for two or more try catch blocks that are consecutive and catch the
+ * same kind of exception, and throw the same exception always. These blocks can
+ * be coalesced into one.
+ */
+
+public class StackedTryBlocks extends BytecodeScanningDetector {
+
+ private final BugReporter bugReporter;
+ private Map<TryBlock, TryBlock> blocks;
+ private List<TryBlock> inBlocks;
+
+ public StackedTryBlocks(BugReporter bugReporter) {
+ this.bugReporter = bugReporter;
+ }
+
+ @Override
+ public void visitCode(Code obj) {
+
+ try {
+ blocks = new HashMap<TryBlock, TryBlock>();
+ inBlocks = new ArrayList<TryBlock>();
+
+ CodeException[] ces = obj.getExceptionTable();
+ for (CodeException ce : ces) {
+ TryBlock tb = new TryBlock(ce);
+ TryBlock block = blocks.get(tb);
+ if (block != null) {
+ block.addCatchType(ce);
+ } else {
+ blocks.put(tb, tb);
+ }
+ }
+
+ Iterator<TryBlock> it = blocks.keySet().iterator();
+ int numSingleCatchBlocks = 0;
+ while (it.hasNext()) {
+ if (!it.next().hasMultipleHandlers()) {
+ numSingleCatchBlocks++;
+ }
+ }
+
+ if (numSingleCatchBlocks > 1) {
+ super.visitCode(obj);
+ }
+ } finally {
+ blocks = null;
+ inBlocks = null;
+ }
+ }
+
+ @Override
+ public void sawOpcode(int seen) {
+
+ TryBlock block = findBlockWithStart();
+ if (block != null) {
+ inBlocks.add(block);
+ }
+
+ if (inBlocks.size() > 0) {
+ int nextPC = getNextPC();
+ TryBlock innerBlock = inBlocks.get(inBlocks.size() - 1);
+ if (nextPC == innerBlock.getHandlerPC()) {
+ if ((seen == GOTO) || (seen == GOTO_W)) {
+ innerBlock.setEndHandlerPC(getBranchTarget());
+ } else {
+ innerBlock.setEndHandlerPC(getCode().getLength());
+ }
+ }
+ }
+
+ }
+
+ private TryBlock findBlockWithStart() {
+
+ int pc = getPC();
+
+ for (TryBlock block : blocks.keySet()) {
+ if (block.getStartPC() == pc) {
+ return block;
+ }
+ }
+
+ return null;
+ }
+
+ static class TryBlock {
+ int startPC;
+ int endPC;
+ int handlerPC;
+ int endHandlerPC;
+ BitSet catchTypes;
+ int throwType;
+
+ public TryBlock(CodeException ce) {
+ startPC = ce.getStartPC();
+ endPC = ce.getEndPC();
+ handlerPC = ce.getHandlerPC();
+ catchTypes = new BitSet();
+ catchTypes.set(ce.getCatchType());
+ }
+
+ public void addCatchType(CodeException ce) {
+ catchTypes.set(ce.getCatchType());
+ }
+
+ public boolean hasMultipleHandlers() {
+ int bit = catchTypes.nextSetBit(0);
+ return catchTypes.nextSetBit(bit + 1) >= 0;
+ }
+
+ public void setEndHandlerPC(int end) {
+ endHandlerPC = end;
+ }
+
+ public void setThrowType(int type) {
+ throwType = type;
+ }
+
+ public int getStartPC() {
+ return startPC;
+ }
+
+ public int getHandlerPC() {
+ return handlerPC;
+ }
+
+ @Override
+ public int hashCode() {
+ return startPC ^ endPC;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof TryBlock) {
+ TryBlock that = (TryBlock) o;
+ return (startPC == that.startPC) && (endPC == that.endPC);
+ }
+
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "{" + startPC + " -> " + endPC + "} (catch "
+ + catchTypes.get(0) + ") {" + handlerPC + " -> "
+ + endHandlerPC + "}";
+ }
+ }
+}
Property changes on: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-13 05:07:13
|
Revision: 1687
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1687&view=rev
Author: dbrosius
Date: 2011-06-13 05:07:07 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
add docs
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java 2011-06-12 15:07:43 UTC (rev 1686)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java 2011-06-13 05:07:07 UTC (rev 1687)
@@ -33,6 +33,12 @@
import edu.umd.cs.findbugs.OpcodeStack;
import edu.umd.cs.findbugs.ba.ClassContext;
+/**
+ * looks for creation of java.awt.Graphics object that do not have the
+ * .dispose() method called on them when finished. These objects will be cleaned up by
+ * the Garbage collector, bug given the likelyhood that large numbers of these objects can
+ * be created in a short period of time, it is better to dispose them as soon as possible
+ */
public class LingeringGraphicsObjects extends BytecodeScanningDetector {
private static final Set<String> GRAPHICS_PRODUCERS = new HashSet<String>();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-12 15:07:49
|
Revision: 1686
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1686&view=rev
Author: dbrosius
Date: 2011-06-12 15:07:43 +0000 (Sun, 12 Jun 2011)
Log Message:
-----------
use - not &hyphen
Modified Paths:
--------------
trunk/fb-contrib/htdocs/repository.html
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2011-06-11 20:22:38 UTC (rev 1685)
+++ trunk/fb-contrib/htdocs/repository.html 2011-06-12 15:07:43 UTC (rev 1686)
@@ -21,7 +21,7 @@
<div style="width: 200px">
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy</td></tr>
- <tr><td><b>ArtifactId:</b></td><td>fb‐contrib</td></tr>
+ <tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
<tr><td><b>Version:</b></td><td>4.6.1</td></tr>
</table>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 20:22:44
|
Revision: 1685
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1685&view=rev
Author: dbrosius
Date: 2011-06-11 20:22:38 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
expand the svn group by default
Modified Paths:
--------------
trunk/fb-contrib/htdocs/index.shtml
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2011-06-11 20:21:32 UTC (rev 1684)
+++ trunk/fb-contrib/htdocs/index.shtml 2011-06-11 20:22:38 UTC (rev 1685)
@@ -71,9 +71,9 @@
</div>
<hr/>
- <img id="svn_image" src="flip1.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/>
+ <img id="svn_image" src="flip2.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/>
Detectors added in svn<br/>
- <div id="svn" style="display:none;">
+ <div id="svn" style="display:block;">
<ul>
<li><b>[CVAA] ContraVariant Array Assignment</b><br/>
Looks for contravariant array assignments. Since arrays are mutable data structures, their use
@@ -87,9 +87,9 @@
</ul>
</div>
<hr/>
- <img id="v4_6_0_image" src="flip2.gif" onClick="toggleBlock('v4_6_0', 'v4_6_0_image');" align="top"/>
+ <img id="v4_6_0_image" src="flip1.gif" onClick="toggleBlock('v4_6_0', 'v4_6_0_image');" align="top"/>
Detectors added in v4.6.0<br/>
- <div id="v4_6_0" style="display:block;">
+ <div id="v4_6_0" style="display:none;">
<ul>
<li><b>[SNG] Suspicious Null Guard</b><br/>
Looks for code that checks to see if a field or local variable is not null
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 20:21:38
|
Revision: 1684
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1684&view=rev
Author: dbrosius
Date: 2011-06-11 20:21:32 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
document LGO
Modified Paths:
--------------
trunk/fb-contrib/htdocs/index.shtml
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2011-06-11 20:18:37 UTC (rev 1683)
+++ trunk/fb-contrib/htdocs/index.shtml 2011-06-11 20:21:32 UTC (rev 1684)
@@ -79,6 +79,11 @@
Looks for contravariant array assignments. Since arrays are mutable data structures, their use
must be restricted to covariant or invariant usage.
<span style="color: #0000FF;">--contributed by Bhaskar Maddala - THANKS!</span></li>
+ <li><b>[LGO] Lingering Graphics Object</b><br/>
+ Looks for creation of java.awt.Graphics object that do not have the
+ .dispose() method called on them when finished. These objects will be cleaned up by
+ the Garbage collector, bug given the likelyhood that large numbers of these objects can
+ be created in a short period of time, it is better to dispose them as soon as possible.</li>
</ul>
</div>
<hr/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 20:18:43
|
Revision: 1683
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1683&view=rev
Author: dbrosius
Date: 2011-06-11 20:18:37 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
use master.dl
Modified Paths:
--------------
trunk/fb-contrib/htdocs/repository.html
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2011-06-11 20:14:33 UTC (rev 1682)
+++ trunk/fb-contrib/htdocs/repository.html 2011-06-11 20:18:37 UTC (rev 1683)
@@ -16,7 +16,7 @@
<p>fb-contrib is now available in a maven repository, with the following url:</p>
-<p><a href="http://master.dl.sourceforge.net/project/fb-contrib/repo">http://cdnetworks-us-2.dl.sourceforge.net/project/fb-contrib/repo</a></p>
+<p><a href="http://master.dl.sourceforge.net/project/fb-contrib/repo">http://master.dl.sourceforge.net/project/fb-contrib/repo</a></p>
<div style="width: 200px">
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 20:14:40
|
Revision: 1682
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1682&view=rev
Author: dbrosius
Date: 2011-06-11 20:14:33 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
use master.dl.xxx for the repo
Modified Paths:
--------------
trunk/fb-contrib/htdocs/repository.html
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2011-06-11 20:08:43 UTC (rev 1681)
+++ trunk/fb-contrib/htdocs/repository.html 2011-06-11 20:14:33 UTC (rev 1682)
@@ -16,7 +16,7 @@
<p>fb-contrib is now available in a maven repository, with the following url:</p>
-<p><a href="http://cdnetworks-us-2.dl.sourceforge.net/project/fb-contrib/repo">http://cdnetworks-us-2.dl.sourceforge.net/project/fb-contrib/repo</a></p>
+<p><a href="http://master.dl.sourceforge.net/project/fb-contrib/repo">http://cdnetworks-us-2.dl.sourceforge.net/project/fb-contrib/repo</a></p>
<div style="width: 200px">
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 20:08:49
|
Revision: 1681
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1681&view=rev
Author: dbrosius
Date: 2011-06-11 20:08:43 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
update eclipse installation
Modified Paths:
--------------
trunk/fb-contrib/htdocs/index.shtml
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2011-06-11 19:56:06 UTC (rev 1680)
+++ trunk/fb-contrib/htdocs/index.shtml 2011-06-11 20:08:43 UTC (rev 1681)
@@ -63,12 +63,8 @@
Findbugs™ directory.
</li>
<li style="margin-left: -10px;">
- To run fb-contrib from eclipse, you will need to find the plugin directory for Findbugs™ inside
- of Eclipse's plugin directory. The directory will look something like
- <div style="color: #FF2266; margin: 10px;">
- eclipse\plugins\edu.umd.cs.findbugs.plugin.eclipse_1.3.9.20090821\plugin
- </div>
- depending on what version of Findbugs™ you are using.
+ To run fb-contrib from eclipse, assuming that the main FindBugs plugin is installed,
+ simply drop the fb-contrib.jar in the plugins directory of eclipse, and restart eclipse.
</li>
</ul>
</p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 19:56:12
|
Revision: 1680
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1680&view=rev
Author: dbrosius
Date: 2011-06-11 19:56:06 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
add link to mvn repository info
Modified Paths:
--------------
trunk/fb-contrib/htdocs/index.shtml
Added Paths:
-----------
trunk/fb-contrib/htdocs/repository.html
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2011-06-11 18:54:28 UTC (rev 1679)
+++ trunk/fb-contrib/htdocs/index.shtml 2011-06-11 19:56:06 UTC (rev 1680)
@@ -49,6 +49,8 @@
<a href="javadoc/index.html">JavaDoc</a>
<img src="vbar.gif" height="12"/>
<a href="bugdescriptions.html">Bug Descriptions</a>
+ <img src="vbar.gif" height="12"/>
+ <a href="repository.html">Maven Repository</a>
<!--#include virtual="mbfg_menu.shtml" -->
<hr/>
Added: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html (rev 0)
+++ trunk/fb-contrib/htdocs/repository.html 2011-06-11 19:56:06 UTC (rev 1680)
@@ -0,0 +1,31 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>fb-contrib: Bug Descriptions</title>
+<style type="text/css">
+ h1 { font-size: 30px; }
+ ul { display: block; list-style-type: none; width: 60%; }
+ .bugcode { font-weight: bold; font-size: 18px; padding-left: 10px; border-left: 0.5em solid #6666FF; }
+ .bugdetail { font-size: 16px; margin: 4px; padding: 5px 20px 15px 40px; border-left: 1px solid #6666FF; }
+ </style>
+</head>
+<body background="true">
+<div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);"></div>
+<div style="position:absolute;top:20;left:20;z-index:2;">
+<h1>fb-contrib: Maven Repository</h1>
+
+<p>fb-contrib is now available in a maven repository, with the following url:</p>
+
+<p><a href="http://cdnetworks-us-2.dl.sourceforge.net/project/fb-contrib/repo">http://cdnetworks-us-2.dl.sourceforge.net/project/fb-contrib/repo</a></p>
+
+<div style="width: 200px">
+ <table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
+ <tr><td><b>GroupId:</b></td><td>com.mebigfatguy</td></tr>
+ <tr><td><b>ArtifactId:</b></td><td>fb‐contrib</td></tr>
+ <tr><td><b>Version:</b></td><td>4.6.1</td></tr>
+ </table>
+</div>
+
+</div>
+</body>
+</html>
Property changes on: trunk/fb-contrib/htdocs/repository.html
___________________________________________________________________
Added: mime-type
+ text/html
Added: svn:mime-type
+ text/html
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 18:54:34
|
Revision: 1679
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1679&view=rev
Author: dbrosius
Date: 2011-06-11 18:54:28 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
go back to development (4.7.0)
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/pom.xml
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2011-06-11 16:54:54 UTC (rev 1678)
+++ trunk/fb-contrib/build.xml 2011-06-11 18:54:28 UTC (rev 1679)
@@ -20,7 +20,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="fb-contrib.version" value="4.6.1"/>
+ <property name="fb-contrib.version" value="4.7.0"/>
<target name="clean" description="removes all generated collateral">
<delete dir="${classes.dir}"/>
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2011-06-11 16:54:54 UTC (rev 1678)
+++ trunk/fb-contrib/etc/findbugs.xml 2011-06-11 18:54:28 UTC (rev 1679)
@@ -133,9 +133,9 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast"
reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TRINARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM" />
-<!--
+
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- -->
+
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" />
<Detector class="com.mebigfatguy.fbcontrib.detect.DeletingWhileIterating" speed="fast" reports="DWI_DELETING_WHILE_ITERATING,DWI_MODIFYING_WHILE_ITERATING" />
@@ -219,10 +219,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SideEffectConstructor" speed="fast" reports="SEC_SIDE_EFFECT_CONSTRUCTOR" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousGetterSetterUse" speed="fast" reports="SGSU_SUSPICIOUS_GETTER_SETTER_USE" />
-<!--
+
<Detector class="com.mebigfatguy.fbcontrib.detect.LingeringGraphicsObjects" speed="fast" reports="LGO_LINGERING_GRAPHICS_OBJECT" />
--->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2011-06-11 16:54:54 UTC (rev 1678)
+++ trunk/fb-contrib/pom.xml 2011-06-11 18:54:28 UTC (rev 1679)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>4.6.1</version>
+ <version>4.7.0</version>
<parent>
<groupId>org.sonatype.oss</groupId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 16:55:00
|
Revision: 1678
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1678&view=rev
Author: dbrosius
Date: 2011-06-11 16:54:54 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
Version 4.6.1
Added Paths:
-----------
tags/v4_6_1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 16:51:43
|
Revision: 1677
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1677&view=rev
Author: dbrosius
Date: 2011-06-11 16:51:36 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
prepare for the 4.6.1 release
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/pom.xml
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2011-06-11 03:20:19 UTC (rev 1676)
+++ trunk/fb-contrib/build.xml 2011-06-11 16:51:36 UTC (rev 1677)
@@ -20,7 +20,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="fb-contrib.version" value="4.7.0"/>
+ <property name="fb-contrib.version" value="4.6.1"/>
<target name="clean" description="removes all generated collateral">
<delete dir="${classes.dir}"/>
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2011-06-11 03:20:19 UTC (rev 1676)
+++ trunk/fb-contrib/etc/findbugs.xml 2011-06-11 16:51:36 UTC (rev 1677)
@@ -133,9 +133,9 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast"
reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TRINARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM" />
-
+<!--
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
-
+ -->
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" />
<Detector class="com.mebigfatguy.fbcontrib.detect.DeletingWhileIterating" speed="fast" reports="DWI_DELETING_WHILE_ITERATING,DWI_MODIFYING_WHILE_ITERATING" />
@@ -219,8 +219,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SideEffectConstructor" speed="fast" reports="SEC_SIDE_EFFECT_CONSTRUCTOR" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousGetterSetterUse" speed="fast" reports="SGSU_SUSPICIOUS_GETTER_SETTER_USE" />
-
+<!--
<Detector class="com.mebigfatguy.fbcontrib.detect.LingeringGraphicsObjects" speed="fast" reports="LGO_LINGERING_GRAPHICS_OBJECT" />
+-->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2011-06-11 03:20:19 UTC (rev 1676)
+++ trunk/fb-contrib/pom.xml 2011-06-11 16:51:36 UTC (rev 1677)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.6.1</version>
<parent>
<groupId>org.sonatype.oss</groupId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 03:20:25
|
Revision: 1676
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1676&view=rev
Author: dbrosius
Date: 2011-06-11 03:20:19 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
more tests
Modified Paths:
--------------
trunk/fb-contrib/samples/LGO_Sample.java
Modified: trunk/fb-contrib/samples/LGO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/LGO_Sample.java 2011-06-11 01:01:08 UTC (rev 1675)
+++ trunk/fb-contrib/samples/LGO_Sample.java 2011-06-11 03:20:19 UTC (rev 1676)
@@ -1,4 +1,5 @@
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
@@ -7,6 +8,10 @@
public void testCreate(Graphics g) {
Graphics g2 = g.create();
}
+
+ public void testCreateg2D(Graphics g) {
+ Graphics2D g2 = (Graphics2D)g.create();
+ }
public void testBufferedImage(BufferedImage bi) {
Graphics g = bi.getGraphics();
@@ -20,7 +25,16 @@
g2.dispose();
}
}
+
+ public void fpG2DWasDisposed(Graphics g) {
+ Graphics2D g2 = (Graphics2D)g.create();
+ try {
+ } finally {
+ g2.dispose();
+ }
+ }
+
public Graphics returnG(Graphics g) {
return g.create();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-11 01:01:14
|
Revision: 1675
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1675&view=rev
Author: dbrosius
Date: 2011-06-11 01:01:08 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
Issue: ID: 3204521 put blocks in the visited set when they are added to the toBeProcessed set, not when they are removed
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2011-06-10 11:24:36 UTC (rev 1674)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2011-06-11 01:01:08 UTC (rev 1675)
@@ -61,7 +61,7 @@
private CFG cfg;
private ConstantPoolGen cpg;
private BitSet visitedBlocks;
-
+
/**
* constructs a FCBL detector given the reporter to report bugs on.
@@ -201,14 +201,14 @@
private void checkBlock(BasicBlock bb, Set<String> uncheckedFields) {
LinkedList<BlockState> toBeProcessed = new LinkedList<BlockState>();
toBeProcessed.add(new BlockState(bb, uncheckedFields));
-
+ visitedBlocks.set(bb.getLabel());
+
while (!toBeProcessed.isEmpty()) {
if (localizableFields.isEmpty())
return;
BlockState bState = toBeProcessed.removeFirst();
bb = bState.getBasicBlock();
- visitedBlocks.set(bb.getLabel());
InstructionIterator ii = bb.instructionIterator();
while ((bState.getUncheckedFieldSize() > 0) && ii.hasNext()) {
InstructionHandle ih = ii.next();
@@ -237,8 +237,10 @@
while (oei.hasNext()) {
Edge e = oei.next();
BasicBlock cb = e.getTarget();
- if (!visitedBlocks.get(cb.getLabel())) {
+ int label = cb.getLabel();
+ if (!visitedBlocks.get(label)) {
toBeProcessed.addLast(new BlockState(cb, bState));
+ visitedBlocks.set(label);
}
}
}
@@ -362,5 +364,10 @@
}
return false;
}
+
+ @Override
+ public String toString() {
+ return basicBlock.toString() + "|" + uncheckedFields;
+ }
}
-}
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-10 11:24:42
|
Revision: 1674
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1674&view=rev
Author: dbrosius
Date: 2011-06-10 11:24:36 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
reduce memory usage in unreadFields by employing copy on write, for http://sourceforge.net/tracker/?func=detail&aid=3204521&group_id=147536&atid=768725
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2011-06-10 11:16:47 UTC (rev 1673)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2011-06-10 11:24:36 UTC (rev 1674)
@@ -232,13 +232,13 @@
}
}
- if (uncheckedFields.size() > 0) {
+ if (bState.getUncheckedFieldSize() > 0) {
Iterator<Edge> oei = cfg.outgoingEdgeIterator(bb);
while (oei.hasNext()) {
Edge e = oei.next();
BasicBlock cb = e.getTarget();
if (!visitedBlocks.get(cb.getLabel())) {
- toBeProcessed.addLast(new BlockState(cb, uncheckedFields));
+ toBeProcessed.addLast(new BlockState(cb, bState));
}
}
}
@@ -310,6 +310,18 @@
}
/**
+ * creates a BlockState consisting of the next basic block to parse,
+ * and what fields are to be checked
+ * @param bb the basic block to parse
+ * @param the basic block to copy from
+ */
+ public BlockState(final BasicBlock bb, BlockState parentBlockState) {
+ basicBlock = bb;
+ uncheckedFields = parentBlockState.uncheckedFields;
+ fieldsAreSharedWithParent = true;
+ }
+
+ /**
* get the basic block to parse
* @return the basic block
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-10 11:16:53
|
Revision: 1673
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1673&view=rev
Author: dbrosius
Date: 2011-06-10 11:16:47 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
reduce memory usage in unreadFields by employing copy on write, for http://sourceforge.net/tracker/?func=detail&aid=3204521&group_id=147536&atid=768725
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2011-06-04 05:49:23 UTC (rev 1672)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2011-06-10 11:16:47 UTC (rev 1673)
@@ -207,17 +207,16 @@
return;
BlockState bState = toBeProcessed.removeFirst();
bb = bState.getBasicBlock();
- uncheckedFields = bState.getUncheckedFields();
visitedBlocks.set(bb.getLabel());
InstructionIterator ii = bb.instructionIterator();
- while ((uncheckedFields.size() > 0) && ii.hasNext()) {
+ while ((bState.getUncheckedFieldSize() > 0) && ii.hasNext()) {
InstructionHandle ih = ii.next();
Instruction ins = ih.getInstruction();
if (ins instanceof FieldInstruction) {
FieldInstruction fi = (FieldInstruction) ins;
String fieldName = fi.getFieldName(cpg);
- boolean justRemoved = uncheckedFields.remove(fieldName);
+ boolean justRemoved = bState.removeUncheckedField(fieldName);
if (ins instanceof GETFIELD) {
if (justRemoved) {
@@ -290,10 +289,13 @@
/**
* holds the parse state of the current basic block, and what fields are left to be checked
+ * the fields that are left to be checked are a reference from the parent block
+ * and a new collection is created on first write to the set to reduce memory concerns.
*/
private static class BlockState {
private final BasicBlock basicBlock;
- private final Set<String> uncheckedFields;
+ private Set<String> uncheckedFields;
+ private boolean fieldsAreSharedWithParent;
/**
* creates a BlockState consisting of the next basic block to parse,
@@ -303,7 +305,8 @@
*/
public BlockState(final BasicBlock bb, final Set<String> fields) {
basicBlock = bb;
- uncheckedFields = new HashSet<String>(fields);
+ uncheckedFields = fields;
+ fieldsAreSharedWithParent = true;
}
/**
@@ -315,11 +318,37 @@
}
/**
- * get the unchecked fields to look for
- * @return the unchecked fields
+ * returns the number of unchecked fields
+ * @return the number of unchecked fields
*/
- public Set<String> getUncheckedFields() {
- return uncheckedFields;
+ public int getUncheckedFieldSize() {
+ return (uncheckedFields == null) ? 0 : uncheckedFields.size();
}
+
+ /**
+ * return the field from the set of unchecked fields
+ * if this occurs make a copy of the set on write to reduce memory usage
+ * @return whether the object was removed.
+ */
+ public boolean removeUncheckedField(String field) {
+ if ((uncheckedFields != null) && uncheckedFields.contains(field)) {
+ if (uncheckedFields.size() == 1) {
+ uncheckedFields = null;
+ fieldsAreSharedWithParent = false;
+ return true;
+ }
+
+ if (fieldsAreSharedWithParent) {
+ uncheckedFields = new HashSet<String>(uncheckedFields);
+ fieldsAreSharedWithParent = false;
+ uncheckedFields.remove(field);
+ return true;
+ } else {
+ uncheckedFields.remove(field);
+ return true;
+ }
+ }
+ return false;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-04 05:49:29
|
Revision: 1672
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1672&view=rev
Author: dbrosius
Date: 2011-06-04 05:49:23 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
PCAIL class can't be an inner class (with reference)
Modified Paths:
--------------
trunk/fb-contrib/samples/PCAIL_Sample.java
Modified: trunk/fb-contrib/samples/PCAIL_Sample.java
===================================================================
--- trunk/fb-contrib/samples/PCAIL_Sample.java 2011-06-04 05:30:56 UTC (rev 1671)
+++ trunk/fb-contrib/samples/PCAIL_Sample.java 2011-06-04 05:49:23 UTC (rev 1672)
@@ -105,7 +105,7 @@
}
}
- class Foo
+ static class Foo
{
public Foo withNumber(int i)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-04 05:31:02
|
Revision: 1671
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1671&view=rev
Author: dbrosius
Date: 2011-06-04 05:30:56 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
add eclipse support for extra jars needed by plugin, as per Andrei Loskutov
Modified Paths:
--------------
trunk/fb-contrib/build.xml
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2011-06-04 05:21:49 UTC (rev 1670)
+++ trunk/fb-contrib/build.xml 2011-06-04 05:30:56 UTC (rev 1671)
@@ -117,6 +117,7 @@
<manifest>
<attribute name="fb-contrib-version" value="${fb-contrib.version}"/>
<attribute name="Main-Class" value="com.mebigfatguy.fbcontrib.FBContrib"/>
+ <attribute name="Eclipse-RegisterBuddy" value="edu.umd.cs.findbugs.plugin.eclipse"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="fb-contrib plugin"/>
<attribute name="Bundle-SymbolicName" value="fb-contrib; singleton:=true"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-04 05:21:56
|
Revision: 1670
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1670&view=rev
Author: dbrosius
Date: 2011-06-04 05:21:49 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
add fp from ID: 3309113
Modified Paths:
--------------
trunk/fb-contrib/samples/PCAIL_Sample.java
Modified: trunk/fb-contrib/samples/PCAIL_Sample.java
===================================================================
--- trunk/fb-contrib/samples/PCAIL_Sample.java 2011-06-04 04:45:20 UTC (rev 1669)
+++ trunk/fb-contrib/samples/PCAIL_Sample.java 2011-06-04 05:21:49 UTC (rev 1670)
@@ -1,5 +1,7 @@
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -93,4 +95,21 @@
s.add(String.valueOf(i));
}
}
+
+ public void fpChaining()
+ {
+ List<Foo> list = new ArrayList<Foo>();
+ for (int i = 0; i<= 10; i++)
+ {
+ list.add(new Foo().withNumber(i));
+ }
+ }
+
+ class Foo
+ {
+ public Foo withNumber(int i)
+ {
+ return this;
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-04 04:45:26
|
Revision: 1669
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1669&view=rev
Author: dbrosius
Date: 2011-06-04 04:45:20 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
spacing
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2011-06-04 04:44:54 UTC (rev 1668)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2011-06-04 04:45:20 UTC (rev 1669)
@@ -803,7 +803,7 @@
public boolean isRiskyMethodCall() {
- String clsName =getClassConstantOperand();
+ String clsName = getClassConstantOperand();
if (dangerousAssignmentClassSources.contains(clsName)) {
return true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-04 04:45:00
|
Revision: 1668
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1668&view=rev
Author: dbrosius
Date: 2011-06-04 04:44:54 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
SillynessPotPourri throws ClassCastException - ID: 3309447
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2011-06-04 00:12:55 UTC (rev 1667)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2011-06-04 04:44:54 UTC (rev 1668)
@@ -140,9 +140,7 @@
public void sawOpcode(int seen) {
int reg = -1;
String userValue = null;
- try {
- stack.mergeJumps(this);
-
+ try {
if (((seen >= IFEQ) && (seen <= GOTO)) || (seen == IFNULL) || (seen == IFNONNULL) || (seen == GOTO_W)) {
Integer branchTarget = Integer.valueOf(getBranchTarget());
Set<Integer> branchInsSet = branchTargets.get(branchTarget);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-06-04 00:13:02
|
Revision: 1667
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1667&view=rev
Author: dbrosius
Date: 2011-06-04 00:12:55 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
handle IFNULL and IFNONNULL
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2011-05-05 01:01:17 UTC (rev 1666)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2011-06-04 00:12:55 UTC (rev 1667)
@@ -270,7 +270,7 @@
ignoreRegs.add(Integer.valueOf(reg));
}
}
- } else if (((seen >= IFEQ) && (seen <= GOTO)) || (seen == GOTO_W)) {
+ } else if (((seen >= IFEQ) && (seen <= GOTO)) || (seen == IFNULL) || (seen == IFNONNULL) || (seen == GOTO_W)) {
int target = getBranchTarget();
if (target > getPC()) {
if ((seen == GOTO) || (seen == GOTO_W)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-05-05 01:01:23
|
Revision: 1666
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1666&view=rev
Author: dbrosius
Date: 2011-05-05 01:01:17 +0000 (Thu, 05 May 2011)
Log Message:
-----------
make sure to clear the reg map on method entry
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java 2011-05-05 01:00:38 UTC (rev 1665)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java 2011-05-05 01:01:17 UTC (rev 1666)
@@ -64,6 +64,7 @@
@Override
public void visitCode(Code obj) {
stack.resetForMethodEntry(this);
+ graphicsRegs.clear();
super.visitCode(obj);
for (Integer pc : graphicsRegs.values()) {
bugReporter.reportBug(new BugInstance(this, "LGO_LINGERING_GRAPHICS_OBJECT", NORMAL_PRIORITY)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|