fb-contrib-commit Mailing List for fb-contrib (Page 15)
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...> - 2010-01-18 16:57:55
|
Revision: 1490 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1490&view=rev Author: dbrosius Date: 2010-01-18 16:57:46 +0000 (Mon, 18 Jan 2010) Log Message: ----------- document ROOM Modified Paths: -------------- trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-01-18 16:54:08 UTC (rev 1489) +++ trunk/fb-contrib/htdocs/index.shtml 2010-01-18 16:57:46 UTC (rev 1490) @@ -66,6 +66,9 @@ check. Instead it references another object of the same type. It is likely that null check is being done on the wrong variable, either because of a copy/paste error, or a change in implementation.</li> + <li><b>[ROOM] Reflection on Object Methods</b><br/> + Looks for method calls through reflection on methods found in java.lang.Object. + As these methods are always available, there's no reason to do this.</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...> - 2010-01-18 16:54:15
|
Revision: 1489 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1489&view=rev Author: dbrosius Date: 2010-01-18 16:54:08 +0000 (Mon, 18 Jan 2010) Log Message: ----------- new detector - just starting - ROOM Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml Added Paths: ----------- trunk/fb-contrib/samples/ROOM_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-01-15 05:46:10 UTC (rev 1488) +++ trunk/fb-contrib/etc/findbugs.xml 2010-01-18 16:54:08 UTC (rev 1489) @@ -320,6 +320,10 @@ speed="fast" reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,EQ_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods" + speed="fast" + reports="ROOM_REFLECTION_ON_OBJECT_METHODS" /> + <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" @@ -555,53 +559,55 @@ <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" /> <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING" - category="STYLE" experimental="true" /> + category="STYLE" /> <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" - category="STYLE" experimental="true" /> + category="STYLE" /> <BugPattern abbrev="OC" type="OC_OVERZEALOUS_CASTING" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="PDP" type="PDP_POORLY_DEFINED_PARAMETER" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="NSE" type="NSE_NON_SYMMETRIC_EQUALS" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="NFF" type="NFF_NON_FUNCTIONAL_FIELD" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_FIELD_GUARD" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="MDM" type="MDM_RUNTIME_EXIT_OR_HALT" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_RUNFINALIZATION" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_INETADDRESS_GETLOCALHOST" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_PROMISCUOUS_SERVERSOCKET" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_THREAD_PRIORITIES" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_THREAD_YIELD" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_WAIT_WITHOUT_TIMEOUT" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_SIGNAL_NOT_SIGNALALL" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_THREAD_FAIRNESS" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_LOCK_ISLOCKED" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_STRING_BYTES_ENCODING" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_SETDEFAULTLOCALE" - category="MT_CORRECTNESS" experimental="true" /> + category="MT_CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_BIGDECIMAL_EQUALS" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_RANDOM_SEED" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> <BugPattern abbrev="MDM" type="MDM_SECURERANDOM" - category="CORRECTNESS" experimental="true" /> + category="CORRECTNESS" /> + <BugPattern abbrev="ROOM" type="ROOM_REFLECTION_ON_OBJECT_METHODS" + category="CORRECTNESS" /> </FindbugsPlugin> \ No newline at end of file Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-01-15 05:46:10 UTC (rev 1488) +++ trunk/fb-contrib/etc/messages.xml 2010-01-18 16:54:08 UTC (rev 1489) @@ -453,7 +453,7 @@ </Details> </Detector> - <Detector class="com.mebigfatguy.fbcontrib.detect.DateComparison"> + <Detector class="com.mebigfatguy.fbcontrib.detect.DateComparison"> <Details> <![CDATA[ <p> Looks for inefficient comparison of Date objects using two comparisons when one would do.</p> @@ -1099,6 +1099,17 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods"> + <Details> + <![CDATA[ + <p>This detector looks for reflective calls on methods that are found java.lang.Object. + As these methods are always available, there is no reason to use reflection to call them. + </p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <!-- BugPattern --> @@ -2996,6 +3007,18 @@ ]]> </Details> </BugPattern> + + <BugPattern type="ROOM_REFLECTION_ON_OBJECT_METHODS"> + <ShortDescription>Method uses reflection to call a method available on java.lang.Object</ShortDescription> + <LongDescription>Method {1} uses reflection to call a method available on java.lang.Object</LongDescription> + <Details> + <![CDATA[ + <p>This method uses reflection to call a method that is defined in java.lang.Object. + As these methods are always available, it is not necessary to call these methods with + reflection. + ]]> + </Details> + </BugPattern> <!-- BugCode --> @@ -3089,4 +3112,5 @@ <BugCode abbrev="NFF">Non Functional Field</BugCode> <BugCode abbrev="SNG">SUSPICIOUS Null Guard</BugCode> <BugCode abbrev="MDM">More Dumb Methods</BugCode> + <BugCode abbrev="ROOM">Reflection on Object Methods</BugCode> </MessageCollection> Added: trunk/fb-contrib/samples/ROOM_Sample.java =================================================================== --- trunk/fb-contrib/samples/ROOM_Sample.java (rev 0) +++ trunk/fb-contrib/samples/ROOM_Sample.java 2010-01-18 16:54:08 UTC (rev 1489) @@ -0,0 +1,13 @@ +import java.lang.reflect.Method; + + +public class ROOM_Sample +{ + public void testRoomWithLocals() throws Exception + { + Class c = Class.forName("java.lang.Object"); + Method m = c.getMethod("equals", Object.class); + + String s = (String)m.invoke(this, new ROOM_Sample()); + } +} Property changes on: trunk/fb-contrib/samples/ROOM_Sample.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java (rev 0) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java 2010-01-18 16:54:08 UTC (rev 1489) @@ -0,0 +1,202 @@ +package com.mebigfatguy.fbcontrib.detect; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.bcel.classfile.Code; + +import com.mebigfatguy.fbcontrib.utils.RegisterUtils; + +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 method calls through reflection on methods found in + * java.lang.Object. As these methods are always available, there's no + * reason to do this. + */ +public class ReflectionOnObjectMethods extends BytecodeScanningDetector { + + private static final Set<String> objectSigs = new HashSet<String>(); + static { + objectSigs.add("clone()"); + objectSigs.add("equals(Ljava/lang/Object;)"); + objectSigs.add("finalize()"); + objectSigs.add("getClass()"); + objectSigs.add("hashCode()"); + objectSigs.add("notify()"); + objectSigs.add("notifyAll()"); + objectSigs.add("toString()"); + objectSigs.add("wait"); + objectSigs.add("wait(J)"); + objectSigs.add("wait(JI"); + + + } + private BugReporter bugReporter; + private OpcodeStack stack; + private Map<Integer, String[]> localClassTypes; + + public ReflectionOnObjectMethods(BugReporter bugReporter) { + this.bugReporter = bugReporter; + } + + @Override + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + localClassTypes = new HashMap<Integer, String[]>(); + super.visitClassContext(classContext); + } finally { + stack = null; + localClassTypes = null; + } + } + + @Override + public void visitCode(Code obj) { + stack.resetForMethodEntry(this); + localClassTypes.clear(); + super.visitCode(obj); + } + + @Override + public void sawOpcode(int seen) { + Integer arraySize = null; + String[] loadedTypes = null; + + try { + switch (seen) { + case ANEWARRAY: { + if ("java/lang/Class".equals(getClassConstantOperand())) { + if (stack.getStackDepth() >= 1) { + OpcodeStack.Item item = stack.getStackItem(0); + arraySize = (Integer)item.getConstant(); + } + } + } + break; + + case AASTORE: { + if (stack.getStackDepth() >= 3) { + OpcodeStack.Item arrayItem = stack.getStackItem(2); + String[] arrayTypes = (String[])arrayItem.getUserValue(); + if (arrayTypes != null) { + OpcodeStack.Item valueItem = stack.getStackItem(0); + String type = (String)valueItem.getConstant(); + if (type != null) { + OpcodeStack.Item indexItem = stack.getStackItem(1); + Integer index = (Integer)indexItem.getConstant(); + if (index != null) { + arrayTypes[index.intValue()] = type; + } + } + } + } + } + break; + + case ASTORE_0: + case ASTORE_1: + case ASTORE_2: + case ASTORE_3: + case ASTORE: { + if (stack.getStackDepth() >= 1) { + OpcodeStack.Item item = stack.getStackItem(0); + String[] arrayTypes = (String[])item.getUserValue(); + if (arrayTypes != null) { + int reg = RegisterUtils.getAStoreReg(this, seen); + localClassTypes.put(Integer.valueOf(reg), arrayTypes); + } + } + } + break; + + case ALOAD_0: + case ALOAD_1: + case ALOAD_2: + case ALOAD_3: + case ALOAD: { + int reg = RegisterUtils.getAStoreReg(this, seen); + loadedTypes = localClassTypes.get(Integer.valueOf(reg)); + } + break; + + case INVOKEVIRTUAL: { + String cls = getClassConstantOperand(); + if ("java/lang/Class".equals(cls)) { + String method = getNameConstantOperand(); + if ("getMethod".equals(method)) { + String sig = getSigConstantOperand(); + if ("(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;".equals(sig)) { + if (stack.getStackDepth() >= 2) { + OpcodeStack.Item clsArgs = stack.getStackItem(0); + String[] arrayTypes = (String[])clsArgs.getUserValue(); + if (arrayTypes != null) { + OpcodeStack.Item methodItem = stack.getStackItem(1); + String methodName = (String)methodItem.getConstant(); + if (methodName != null) { + String reflectionSig = buildReflectionSignature(methodName, arrayTypes); + if (objectSigs.contains(reflectionSig)) { + loadedTypes = arrayTypes; + } + } + } + } + } + } + } else if ("java/lang/reflect/Method".equals(cls)) { + String method = getNameConstantOperand(); + if ("invoke".equals(method)) { + if (stack.getStackDepth() >= 3) { + OpcodeStack.Item methodItem = stack.getStackItem(2); + String[] arrayTypes = (String[])methodItem.getUserValue(); + if (arrayTypes != null) { + bugReporter.reportBug(new BugInstance(this, "ROOM_REFLECTION_ON_OBJECT_METHODS", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } + } + } + } + } + break; + } + } finally { + stack.sawOpcode(this, seen); + if (arraySize != null) { + if (stack.getStackDepth() >= 1) { + OpcodeStack.Item item = stack.getStackItem(0); + item.setUserValue(new String[arraySize.intValue()]); + } + } else if (loadedTypes != null) { + if (stack.getStackDepth() >= 1) { + OpcodeStack.Item item = stack.getStackItem(0); + item.setUserValue(loadedTypes); + } + } + } + } + + private String buildReflectionSignature(String methodName, String[] parmTypes) { + StringBuilder sb = new StringBuilder(64); + sb.append(methodName); + sb.append("("); + for (int i = 0; i < parmTypes.length; i++) { + sb.append("L"); + String type = parmTypes[i]; + sb.append(type); + if ((type.length() > 1) || ("IJ".indexOf(type) < 0)) + sb.append(";"); + } + sb.append(")"); + return sb.toString(); + } + +} Property changes on: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.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...> - 2010-01-15 05:46:17
|
Revision: 1488 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1488&view=rev Author: dbrosius Date: 2010-01-15 05:46:10 +0000 (Fri, 15 Jan 2010) Log Message: ----------- add HttpRequest.getAttribute Modified Paths: -------------- trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-01-14 14:21:29 UTC (rev 1487) +++ trunk/fb-contrib/htdocs/index.shtml 2010-01-15 05:46:10 UTC (rev 1488) @@ -83,8 +83,8 @@ to a class or interface higher up in the inheritance chain. You only need to cast to that class or interface.</li> <li><b>[IKNC] Inconsistent Key Name Casing</b><br/> - Looks for calls to HttpRequest.getParameter with parameters of the same - name with different cases like 'id' and 'Id'.</li> + Looks for calls to HttpRequest.getParameter and HttpRequest.getAttribute with parameters + of the same name with different cases like 'id' and 'Id'.</li> <li><b>[NSE] Non Symmetric Equals</b><br/> Looks for classes that break the fundamental rule of equivalence, which is symmetry. If a equals b, then b equals a. While it is usually wrong to allow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-14 14:21:36
|
Revision: 1487 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1487&view=rev Author: dbrosius Date: 2010-01-14 14:21:29 +0000 (Thu, 14 Jan 2010) Log Message: ----------- add additional pom sections - contributed by Grzegorz Slowikowski Modified Paths: -------------- trunk/fb-contrib/pom.xml Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2010-01-14 14:09:47 UTC (rev 1486) +++ trunk/fb-contrib/pom.xml 2010-01-14 14:21:29 UTC (rev 1487) @@ -8,12 +8,38 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>4.2.0</version> + <version>4.3.0-SNAPSHOT</version> <name>FindBugs Contrib plugin library</name> <description>An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.</description> - <url>http://fb-contrib.sourceforge.net</url> + <url>http://fb-contrib.mebigfatguy.com</url> + <inceptionYear>2005</inceptionYear> + <developers> + <developer> + <id>dbrosius</id> + <name>Dave Brosius</name> + <email>dbr...@me...</email> + </developer> + </developers> + + <contributors> + <contributor> + <name>Bhaskar Maddala</name> + </contributor> + <contributor> + <name>Chris Peterson</name> + </contributor> + <contributor> + <name>Grzegorz Slowikowski</name> + <email>gsl...@gm...</email> + <properties> + <gtalk>gsl...@gm...</gtalk> + </properties> + <timezone>+1</timezone> + </contributor> + </contributors> + <licenses> <license> <name>GNU Library or Lesser General Public License (LGPL)</name> @@ -61,9 +87,6 @@ <artifactId>findbugs</artifactId> <version>1.3.9</version> <scope>provided</scope> - <exclusions> - <exclusion><groupId>com.ibm.icu</groupId><artifactId>icu4j</artifactId></exclusion> - </exclusions> </dependency> </dependencies> @@ -85,22 +108,79 @@ </resource> </resources> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>2.3</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.1</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.5</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>2.3</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.3</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>2.1.2</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.4.1</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>2.0.1</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.1.1</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.1</version> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <version>2.4.1</version> - </plugin> </plugins> </build> </project> \ 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...> - 2010-01-14 14:09:54
|
Revision: 1486 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1486&view=rev Author: dbrosius Date: 2010-01-14 14:09:47 +0000 (Thu, 14 Jan 2010) Log Message: ----------- fix modelVersion Modified Paths: -------------- tags/v4_2_0/pom.xml Modified: tags/v4_2_0/pom.xml =================================================================== --- tags/v4_2_0/pom.xml 2010-01-14 11:59:08 UTC (rev 1485) +++ tags/v4_2_0/pom.xml 2010-01-14 14:09:47 UTC (rev 1486) @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.2.0</modelVersion> + <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> <version>4.2.0</version> @@ -23,7 +23,7 @@ <scm> <connection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/tags/v4_0_0</connection> - <developerConnection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/tags/v4_0_0</developerConnection> + <developerConnection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/tags/v4_2_0</developerConnection> <url>http://fb-contrib.svn.sourceforge.net/viewvc/fb-contrib/</url> </scm> @@ -103,4 +103,4 @@ </plugin> </plugins> </build> -</project> \ No newline at end of file +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-14 11:59:16
|
Revision: 1485 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1485&view=rev Author: dbrosius Date: 2010-01-14 11:59:08 +0000 (Thu, 14 Jan 2010) Log Message: ----------- modelVersion is always 4.0.0 Modified Paths: -------------- trunk/fb-contrib/pom.xml Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2010-01-14 06:01:07 UTC (rev 1484) +++ trunk/fb-contrib/pom.xml 2010-01-14 11:59:08 UTC (rev 1485) @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.2.0</modelVersion> + <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> <version>4.2.0</version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Grzegorz S. <gsl...@gm...> - 2010-01-14 07:56:49
|
Hi 1. I found a dummy error. Fix it in trunk and in tag. Details below. 2. Change version number to "4.3.0-SNAPSHOT" in trunk: <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> <version>4.3.0-SNAPSHOT</version> Greetings Grzegorz Slowikowski On 2010-01-14 06:31, dbr...@us... wrote: > Revision: 1481 > http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1481&view=rev > Author: dbrosius > Date: 2010-01-14 05:31:35 +0000 (Thu, 14 Jan 2010) > > Log Message: > ----------- > get ready for the 4.2.0 release > > Modified Paths: > -------------- > trunk/fb-contrib/build.xml > trunk/fb-contrib/etc/findbugs.xml > trunk/fb-contrib/htdocs/index.shtml > trunk/fb-contrib/pom.xml ... > Modified: trunk/fb-contrib/pom.xml > =================================================================== > --- trunk/fb-contrib/pom.xml 2010-01-12 06:15:01 UTC (rev 1480) > +++ trunk/fb-contrib/pom.xml 2010-01-14 05:31:35 UTC (rev 1481) > @@ -5,10 +5,10 @@ > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> > > -<modelVersion>4.0.0</modelVersion> > +<modelVersion>4.2.0</modelVersion> > This is wrong, don't change model version. :-) |
From: <dbr...@us...> - 2010-01-14 06:01:14
|
Revision: 1484 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1484&view=rev Author: dbrosius Date: 2010-01-14 06:01:07 +0000 (Thu, 14 Jan 2010) Log Message: ----------- format Modified Paths: -------------- trunk/fb-contrib/build.xml Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2010-01-14 05:45:29 UTC (rev 1483) +++ trunk/fb-contrib/build.xml 2010-01-14 06:01:07 UTC (rev 1484) @@ -159,7 +159,7 @@ <target name="build" depends="clean, -init, validate_xml, compile, compile_samples, jar" description="builds the plugin jar"> </target> - <target name="install" depends="build" description="installs the plugin into FindBugs"> + <target name="install" depends="build" description="installs the plugin into FindBugs"> <property environment="env"/> <copy todir="${env.FINDBUGS_HOME}/plugin"> <fileset dir="${basedir}"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-14 05:45:35
|
Revision: 1483 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1483&view=rev Author: dbrosius Date: 2010-01-14 05:45:29 +0000 (Thu, 14 Jan 2010) Log Message: ----------- start 4.3.0 dev Modified Paths: -------------- trunk/fb-contrib/build.xml Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2010-01-14 05:35:23 UTC (rev 1482) +++ trunk/fb-contrib/build.xml 2010-01-14 05:45:29 UTC (rev 1483) @@ -20,7 +20,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="4.2.0"/> + <property name="fb-contrib.version" value="4.3.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-14 05:35:31
|
Revision: 1482 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1482&view=rev Author: dbrosius Date: 2010-01-14 05:35:23 +0000 (Thu, 14 Jan 2010) Log Message: ----------- tag version 4.2.0 Added Paths: ----------- tags/v4_2_0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-14 05:31:43
|
Revision: 1481 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1481&view=rev Author: dbrosius Date: 2010-01-14 05:31:35 +0000 (Thu, 14 Jan 2010) Log Message: ----------- get ready for the 4.2.0 release Modified Paths: -------------- trunk/fb-contrib/build.xml trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/htdocs/index.shtml trunk/fb-contrib/pom.xml Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2010-01-12 06:15:01 UTC (rev 1480) +++ trunk/fb-contrib/build.xml 2010-01-14 05:31:35 UTC (rev 1481) @@ -20,7 +20,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="4.1.0"/> + <property name="fb-contrib.version" value="4.2.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 2010-01-12 06:15:01 UTC (rev 1480) +++ trunk/fb-contrib/etc/findbugs.xml 2010-01-14 05:31:35 UTC (rev 1481) @@ -308,13 +308,13 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" - speed="fast" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> + speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField" speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" - speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> + speed="fast" hidden="true" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-01-12 06:15:01 UTC (rev 1480) +++ trunk/fb-contrib/htdocs/index.shtml 2010-01-14 05:31:35 UTC (rev 1481) @@ -51,10 +51,28 @@ <a href="bugdescriptions.html">Bug Descriptions</a> <!--#include virtual="mbfg_menu.shtml" --> <hr/> - <img id="svn_image" src="flip2.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> + <img id="svn_image" src="flip1.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> Detectors added in svn<br/> - <div id="svn" style="display:block;"> + <div id="svn" style="display:none;"> <ul> + <li><b>[CVAA] ContraVariant Array Assignment</b><br/> + 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>[SNG] Suspicious Null Guard</b><br/> + Looks for code that checks to see if a field or local variable is not null, + before entering a code block (either an if, or while statement) and then doesn't + reference that field or local in the block of code that is guarded by the null + check. Instead it references another object of the same type. It is likely that null + check is being done on the wrong variable, either because of a copy/paste error, + or a change in implementation.</li> + </ul> + </div> + <hr/> + <img id="v4_2_0_image" src="flip2.gif" onClick="toggleBlock('v4_2_0', 'v4_2_0_image');" align="top"/> + Detectors added in v4.2.0<br/> + <div id="v4_2_0" style="display:block;"> + <ul> <li><b>[PDP] Poorly Defined Parameter</b><br/> Looks for non derivable methods that declare parameters and then cast those parameters to more specific types in the method. This is misleading and dangerous @@ -72,10 +90,6 @@ symmetry. If a equals b, then b equals a. While it is usually wrong to allow equals to compare different types, at the very least you should make sure that each class knows about each other and is able to compare themselves with each other.</li> - <li><b>[CVAA] ContraVariant Array Assignment</b><br/> - 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>[NFF] Non Functional Field</b><br/> Looks for fields in serializable classes that are defined as both final and transient. As a transient field is not initialized when streamed, and is not @@ -84,18 +98,11 @@ Looks for a variety of questionable method calls that will cause problems, are unsafe or use practices that might lead to bugs. <span style="color: #0000FF;">--contributed by Chris Peterson - THANKS!</span></li> - <li><b>[SNG] Suspicious Null Guard</b><br/> - Looks for code that checks to see if a field or local variable is not null, - before entering a code block (either an if, or while statement) and then doesn't - reference that field or local in the block of code that is guarded by the null - check. Instead it references another object of the same type. It is likely that null - check is being done on the wrong variable, either because of a copy/paste error, - or a change in implementation.</li> </ul> <ul> <li><span style="color: #0000FF;">Maven pom file contributed by Grzegorz Slowikowski - THANKS!</span></li> <ul> - </div> + </div> <hr/> <img id="v4_0_0_image" src="flip1.gif" onClick="toggleBlock('v4_0_0', 'v4_0_0_image');" align="top"/> Detectors added in v4.0.0<br/> Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2010-01-12 06:15:01 UTC (rev 1480) +++ trunk/fb-contrib/pom.xml 2010-01-14 05:31:35 UTC (rev 1481) @@ -5,10 +5,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.2.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>4.0.0</version> + <version>4.2.0</version> <name>FindBugs Contrib plugin library</name> <description>An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.</description> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-12 06:15:07
|
Revision: 1480 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1480&view=rev Author: dbrosius Date: 2010-01-12 06:15:01 +0000 (Tue, 12 Jan 2010) Log Message: ----------- be consistent with verbage Modified Paths: -------------- trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-01-12 06:13:43 UTC (rev 1479) +++ trunk/fb-contrib/htdocs/index.shtml 2010-01-12 06:15:01 UTC (rev 1480) @@ -93,7 +93,7 @@ or a change in implementation.</li> </ul> <ul> - <li><span style="color: #0000FF;">Maven pom file supplied by Grzegorz Slowikowski - THANKS!</span></li> + <li><span style="color: #0000FF;">Maven pom file contributed by Grzegorz Slowikowski - THANKS!</span></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...> - 2010-01-12 06:13:49
|
Revision: 1479 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1479&view=rev Author: dbrosius Date: 2010-01-12 06:13:43 +0000 (Tue, 12 Jan 2010) Log Message: ----------- document the pom addition Modified Paths: -------------- trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-01-12 06:07:30 UTC (rev 1478) +++ trunk/fb-contrib/htdocs/index.shtml 2010-01-12 06:13:43 UTC (rev 1479) @@ -92,6 +92,9 @@ check is being done on the wrong variable, either because of a copy/paste error, or a change in implementation.</li> </ul> + <ul> + <li><span style="color: #0000FF;">Maven pom file supplied by Grzegorz Slowikowski - THANKS!</span></li> + <ul> </div> <hr/> <img id="v4_0_0_image" src="flip1.gif" onClick="toggleBlock('v4_0_0', 'v4_0_0_image');" align="top"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-12 06:07:41
|
Revision: 1478 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1478&view=rev Author: dbrosius Date: 2010-01-12 06:07:30 +0000 (Tue, 12 Jan 2010) Log Message: ----------- soften the language of wrong null guard to suspicious null guard Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-01-12 06:00:17 UTC (rev 1477) +++ trunk/fb-contrib/etc/findbugs.xml 2010-01-12 06:07:30 UTC (rev 1478) @@ -314,7 +314,7 @@ speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" - speed="fast" reports="SNG_WRONG_NULL_FIELD_GUARD,SNG_WRONG_NULL_LOCAL_GUARD" /> + speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" @@ -570,9 +570,9 @@ category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="NFF" type="NFF_NON_FUNCTIONAL_FIELD" category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="SNG" type="SNG_WRONG_NULL_FIELD_GUARD" + <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_FIELD_GUARD" category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="SNG" type="SNG_WRONG_NULL_LOCAL_GUARD" + <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="MDM" type="MDM_RUNTIME_EXIT_OR_HALT" category="CORRECTNESS" experimental="true" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-01-12 06:00:17 UTC (rev 1477) +++ trunk/fb-contrib/etc/messages.xml 2010-01-12 06:07:30 UTC (rev 1478) @@ -2822,7 +2822,7 @@ </Details> </BugPattern> - <BugPattern type="SNG_WRONG_NULL_FIELD_GUARD"> + <BugPattern type="SNG_SUSPICIOUS_NULL_FIELD_GUARD"> <ShortDescription>method tests a field for null as guard for code that doesn't use it</ShortDescription> <LongDescription>method {1} tests a field for null as guard for code that doesn't use it</LongDescription> <Details> @@ -2835,7 +2835,7 @@ </Details> </BugPattern> - <BugPattern type="SNG_WRONG_NULL_LOCAL_GUARD"> + <BugPattern type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD"> <ShortDescription>method tests a local variable for null as guard for code that doesn't use it</ShortDescription> <LongDescription>method {1} tests a local variable for null as guard for code that doesn't use it</LongDescription> <Details> @@ -3087,6 +3087,6 @@ <BugCode abbrev="NSE">Non Symmetric Equals</BugCode> <BugCode abbrev="CVAA">Contravariant Array Assignment</BugCode> <BugCode abbrev="NFF">Non Functional Field</BugCode> - <BugCode abbrev="SNG">Wrong Null Guard</BugCode> + <BugCode abbrev="SNG">SUSPICIOUS Null Guard</BugCode> <BugCode abbrev="MDM">More Dumb Methods</BugCode> </MessageCollection> Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java 2010-01-12 06:00:17 UTC (rev 1477) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java 2010-01-12 06:07:30 UTC (rev 1478) @@ -102,7 +102,7 @@ NullGuard guard = nullGuards.remove(pc); if ((guard != null) && guard.sawSignatureOfGuard()) { boolean localBug = guard.getRegister() >= 0; - bugReporter.reportBug(new BugInstance(this, localBug ? "SNG_WRONG_NULL_LOCAL_GUARD" : "SNG_WRONG_NULL_FIELD_GUARD", localBug ? NORMAL_PRIORITY : LOW_PRIORITY) + bugReporter.reportBug(new BugInstance(this, localBug ? "SNG_SUSPICIOUS_NULL_LOCAL_GUARD" : "SNG_SUSPICIOUS_NULL_FIELD_GUARD", localBug ? NORMAL_PRIORITY : LOW_PRIORITY) .addClass(this) .addMethod(this) .addSourceLine(this, guard.getLocation())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-12 06:00:24
|
Revision: 1477 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1477&view=rev Author: dbrosius Date: 2010-01-12 06:00:17 +0000 (Tue, 12 Jan 2010) Log Message: ----------- maven pom file contributed by Grzegorz Slowikowski - thanks! Added Paths: ----------- trunk/fb-contrib/pom.xml Added: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml (rev 0) +++ trunk/fb-contrib/pom.xml 2010-01-12 06:00:17 UTC (rev 1477) @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- pom.xml developed by Grzegorz Slowikowski --> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.mebigfatguy.fb-contrib</groupId> + <artifactId>fb-contrib</artifactId> + <version>4.0.0</version> + + <name>FindBugs Contrib plugin library</name> + <description>An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.</description> + <url>http://fb-contrib.sourceforge.net</url> + + <licenses> + <license> + <name>GNU Library or Lesser General Public License (LGPL)</name> + <url>http://www.gnu.org/licenses/lgpl.txt</url> + </license> + </licenses> + + <scm> + <connection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/tags/v4_0_0</connection> + <developerConnection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/tags/v4_0_0</developerConnection> + <url>http://fb-contrib.svn.sourceforge.net/viewvc/fb-contrib/</url> + </scm> + + <mailingLists> + <mailingList> + <name>fb-contrib-commit</name> + <subscribe>https://lists.sourceforge.net/mailman/listinfo/fb-contrib-commit</subscribe> + <unsubscribe>https://lists.sourceforge.net/lists/options/fb-contrib-commit/</unsubscribe> + <post>fb-...@li...</post> + <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=fb-contrib-commit</archive> + </mailingList> + + <mailingList> + <name>fb-contrib-discuss</name> + <subscribe>https://lists.sourceforge.net/mailman/listinfo/fb-contrib-discuss</subscribe> + <unsubscribe>https://lists.sourceforge.net/lists/options/fb-contrib-discuss/</unsubscribe> + <post>fb-...@li...</post> + <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=fb-contrib-discuss</archive> + </mailingList> + </mailingLists> + + <issueManagement> + <system>SourceForge.net Tracker</system> + <url>http://sourceforge.net/tracker/?group_id=147536</url> + </issueManagement> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <dependencies> + <dependency> + <groupId>com.google.code.findbugs</groupId> + <artifactId>findbugs</artifactId> + <version>1.3.9</version> + <scope>provided</scope> + <exclusions> + <exclusion><groupId>com.ibm.icu</groupId><artifactId>icu4j</artifactId></exclusion> + </exclusions> + </dependency> + </dependencies> + + <build> + <sourceDirectory>${basedir}/src</sourceDirectory> + <resources> + <resource> + <directory>${basedir}</directory> + <includes> + <include>license.txt</include> + </includes> + </resource> + <resource> + <directory>${basedir}/etc</directory> + <excludes> + <exclude>*.xsd</exclude> + <exclude>*.xsl</exclude> + </excludes> + </resource> + </resources> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.1</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.4.1</version> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Property changes on: trunk/fb-contrib/pom.xml ___________________________________________________________________ Added: svn:mime-type + text/xml 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...> - 2010-01-11 04:18:49
|
Revision: 1476 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1476&view=rev Author: dbrosius Date: 2010-01-11 04:18:38 +0000 (Mon, 11 Jan 2010) Log Message: ----------- using 1.5 now --> use enums Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java 2010-01-11 04:14:19 UTC (rev 1475) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java 2010-01-11 04:18:38 UTC (rev 1476) @@ -40,19 +40,13 @@ */ public class UseSplit extends BytecodeScanningDetector { - public static final int SEEN_NOTHING = 0; - public static final int SEEN_STRINGTOKENIZER = 1; - public static final int SEEN_COUNTTOKENS = 2; - public static final int SEEN_NEWARRAY = 3; - public static final int SEEN_HASMORE = 4; - public static final int SEEN_NEXT = 5; - public static final int SEEN_ARRAYSTORE = 6; + enum State {SEEN_NOTHING, SEEN_STRINGTOKENIZER, SEEN_COUNTTOKENS, SEEN_NEWARRAY, SEEN_HASMORE, SEEN_NEXT, SEEN_ARRAYSTORE} private BugReporter bugReporter; private OpcodeStack stack; - private Map<Integer, Integer> regValueType; - private int state; + private Map<Integer, State> regValueType; + private State state; private int loopStart, loopEnd; public UseSplit(BugReporter bugReporter) { @@ -65,7 +59,7 @@ JavaClass cls = classContext.getJavaClass(); if (cls.getMajor() >= MAJOR_1_4) { stack = new OpcodeStack(); - regValueType = new HashMap<Integer, Integer>(); + regValueType = new HashMap<Integer, State>(); super.visitClassContext(classContext); } } finally { @@ -83,7 +77,7 @@ public void visitCode(Code obj) { stack.resetForMethodEntry(this); regValueType.clear(); - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; loopStart = -1; loopEnd = -1; super.visitCode(obj); @@ -103,38 +97,38 @@ if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) { int reg = RegisterUtils.getALoadReg(this, seen); - Integer type = regValueType.get(Integer.valueOf(reg)); + State type = regValueType.get(Integer.valueOf(reg)); if (type != null) - state = type.intValue(); + state = type; else - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; return; } if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); int reg = RegisterUtils.getAStoreReg(this, seen); - regValueType.put(Integer.valueOf(reg), (Integer)item.getUserValue()); + regValueType.put(Integer.valueOf(reg), (State)item.getUserValue()); } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; return; } if ((seen == ILOAD) || ((seen >= ILOAD_0) && (seen <= ILOAD_3))) { int reg = RegisterUtils.getLoadReg(this, seen); - Integer type = regValueType.get(Integer.valueOf(reg)); + State type = regValueType.get(Integer.valueOf(reg)); if (type != null) - state = type.intValue(); + state = type; else - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; return; } if ((seen == ISTORE) || ((seen >= ISTORE_0) && (seen <= ISTORE_3))) { if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); int reg = RegisterUtils.getStoreReg(this, seen); - regValueType.put(Integer.valueOf(reg), (Integer)item.getUserValue()); + regValueType.put(Integer.valueOf(reg), (State)item.getUserValue()); } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; return; } @@ -145,7 +139,7 @@ if (("java/util/StringTokenizer".equals(getClassConstantOperand())) && ("<init>".equals(getNameConstantOperand())) && ("(Ljava/lang/String;Ljava/lang/String;)V".equals(getSigConstantOperand()))) - state = SEEN_STRINGTOKENIZER; + state = State.SEEN_STRINGTOKENIZER; } break; @@ -155,21 +149,21 @@ String signature = getSigConstantOperand(); if (("countTokens".equals(methodName)) && ("()I".equals(signature))) - state = SEEN_COUNTTOKENS; + state = State.SEEN_COUNTTOKENS; else if ("hasMoreTokens".equals(methodName) || "hasMoreElements".equals(methodName)) - state = SEEN_HASMORE; + state = State.SEEN_HASMORE; else if ("nextToken".equals(methodName) || "nextElement".equals(methodName)) { if ((pc < loopStart) || (pc > loopEnd)) regValueType.clear(); else - state = SEEN_NEXT; + state = State.SEEN_NEXT; } } break; case SEEN_COUNTTOKENS: if (seen == ANEWARRAY) - state = SEEN_NEWARRAY; + state = State.SEEN_NEWARRAY; else if (seen == IF_ICMPGE) { int target = getBranchTarget() - 3;//sizeof goto byte[] code = getCode().getCode(); @@ -197,7 +191,7 @@ } } } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; case SEEN_NEXT: @@ -205,11 +199,10 @@ if ((pc > loopStart) && (pc < loopEnd)) { if (stack.getStackDepth() > 2) { OpcodeStack.Item arrayItem = stack.getStackItem(2); - Integer arrayType = (Integer)arrayItem.getUserValue(); + State arrayType = (State)arrayItem.getUserValue(); OpcodeStack.Item elemItem = stack.getStackItem(0); - Integer elemType = (Integer)elemItem.getUserValue(); - if (((arrayType != null) && (arrayType.intValue() == SEEN_NEWARRAY)) - && ((elemType != null) && (elemType.intValue() == SEEN_NEXT))) { + State elemType = (State)elemItem.getUserValue(); + if ((arrayType == State.SEEN_NEWARRAY) && (elemType == State.SEEN_NEXT)) { bugReporter.reportBug(new BugInstance(this, "USS_USE_STRING_SPLIT", NORMAL_PRIORITY) .addClass(this) .addMethod(this) @@ -218,15 +211,15 @@ } } } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; } } finally { stack.sawOpcode(this, seen); - if (state != SEEN_NOTHING) { + if (state != State.SEEN_NOTHING) { if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); - item.setUserValue(Integer.valueOf(state)); + item.setUserValue(state); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 04:14:28
|
Revision: 1475 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1475&view=rev Author: dbrosius Date: 2010-01-11 04:14:19 +0000 (Mon, 11 Jan 2010) Log Message: ----------- using 1.5 now --> use enums Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java 2010-01-11 04:12:47 UTC (rev 1474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java 2010-01-11 04:14:19 UTC (rev 1475) @@ -37,9 +37,8 @@ */ public class UnnecessaryStoreBeforeReturn extends BytecodeScanningDetector { - private static final int SEEN_NOTHING = 0; - private static final int SEEN_STORE = 1; - private static final int SEEN_LOAD = 2; + enum State {SEEN_NOTHING, SEEN_STORE, SEEN_LOAD } + private static final Set<Integer> branchInstructions = new HashSet<Integer>(); static { branchInstructions.add(Integer.valueOf(GOTO)); @@ -65,7 +64,7 @@ private final BugReporter bugReporter; private Set<Integer> branchTargets; private Set<Integer> catchTargets; - private int state; + private State state; private int storeReg; /** @@ -103,7 +102,7 @@ String sig = m.getSignature(); Type t = Type.getReturnType(sig); if (!t.equals(Type.VOID)) { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; branchTargets.clear(); CodeException[] ces = obj.getExceptionTable(); catchTargets.clear(); @@ -128,17 +127,17 @@ case SEEN_NOTHING: if (!catchTargets.contains(Integer.valueOf(getPC()))) { if (lookForStore(seen)) - state = SEEN_STORE; + state = State.SEEN_STORE; } break; case SEEN_STORE: if (branchTargets.contains(Integer.valueOf(getPC()))) { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; } - state = lookForLoad(seen) ? SEEN_LOAD : SEEN_NOTHING; + state = lookForLoad(seen) ? State.SEEN_LOAD : State.SEEN_NOTHING; break; case SEEN_LOAD: @@ -148,7 +147,7 @@ .addMethod(this) .addSourceLine(this)); } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 04:12:58
|
Revision: 1474 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1474&view=rev Author: dbrosius Date: 2010-01-11 04:12:47 +0000 (Mon, 11 Jan 2010) Log Message: ----------- using 1.5 now --> use enums Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2010-01-11 04:10:58 UTC (rev 1473) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2010-01-11 04:12:47 UTC (rev 1474) @@ -58,11 +58,9 @@ mapToSetMethods.add("values"); } - private static final int SEEN_NOTHING = 0; - private static final int SEEN_SYNC = 1; - private static final int SEEN_LOAD = 2; + enum State {SEEN_NOTHING, SEEN_SYNC, SEEN_LOAD} - private int state; + private State state; private Set<String> memberCollections; private Set<Integer> localCollections; private List<Object> monitorObjects; @@ -96,7 +94,7 @@ @Override public void visitCode(final Code obj) { if (obj.getCode() != null) { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; localCollections.clear(); monitorObjects.clear(); stack.resetForMethodEntry(this); @@ -113,19 +111,19 @@ case SEEN_NOTHING: if ((seen == INVOKESTATIC) && "java/util/Collections".equals(getClassConstantOperand())) { if (synchCollectionNames.contains(getNameConstantOperand())) { - state = SEEN_SYNC; + state = State.SEEN_SYNC; } } else if (seen == ALOAD) { int reg = getRegisterOperand(); if (localCollections.contains(Integer.valueOf(reg))) { collectionInfo = Integer.valueOf(reg); - state = SEEN_LOAD; + state = State.SEEN_LOAD; } } else if ((seen >= ALOAD_0) && (seen <= ALOAD_3)) { int reg = seen - ALOAD_0; if (localCollections.contains(Integer.valueOf(reg))) { collectionInfo = Integer.valueOf(reg); - state = SEEN_LOAD; + state = State.SEEN_LOAD; } } else if (seen == GETFIELD) { ConstantFieldref ref = (ConstantFieldref)getConstantRefOperand(); @@ -134,7 +132,7 @@ String fieldName = nandt.getName(getConstantPool()); if (memberCollections.contains(fieldName)) { collectionInfo = fieldName; - state = SEEN_LOAD; + state = State.SEEN_LOAD; } } break; @@ -152,7 +150,7 @@ ConstantNameAndType nandt = (ConstantNameAndType)getConstantPool().getConstant(ref.getNameAndTypeIndex()); memberCollections.add(nandt.getName(getConstantPool())); } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; case SEEN_LOAD: @@ -160,9 +158,9 @@ String calledClass = getClassConstantOperand(); if ("java/lang/Map".equals(calledClass)) { if (mapToSetMethods.contains(getNameConstantOperand())) { - state = SEEN_LOAD; + state = State.SEEN_LOAD; } else { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; } } else if (calledClass.startsWith("java/util/")) { if ("iterator".equals(getNameConstantOperand())) { @@ -171,7 +169,7 @@ .addClass(this) .addMethod(this) .addSourceLine(this)); - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; } else { Object syncObj = monitorObjects.get(monitorObjects.size() - 1); @@ -181,14 +179,14 @@ .addMethod(this) .addSourceLine(this)); } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; } } } else { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; } } else { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 04:11:11
|
Revision: 1473 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1473&view=rev Author: dbrosius Date: 2010-01-11 04:10:58 +0000 (Mon, 11 Jan 2010) Log Message: ----------- using 1.5 now --> use enums Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java 2010-01-11 04:08:55 UTC (rev 1472) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java 2010-01-11 04:10:58 UTC (rev 1473) @@ -33,18 +33,12 @@ */ public class StaticArrayCreatedInMethod extends BytecodeScanningDetector { - private static final int SEEN_NOTHING = 0; - private static final int SEEN_ARRAY_SIZE = 1; - private static final int SEEN_NEWARRAY = 2; - private static final int SEEN_DUP = 3; - private static final int SEEN_INDEX = 4; - private static final int SEEN_LDC = 5; - private static final int SEEN_INDEX_STORE = 6; + enum State {SEEN_NOTHING, SEEN_ARRAY_SIZE, SEEN_NEWARRAY, SEEN_DUP, SEEN_INDEX, SEEN_LDC, SEEN_INDEX_STORE} private BugReporter bugReporter; private int arraySize; private int storeCount; - private int state; + private State state; public StaticArrayCreatedInMethod(BugReporter bugReporter) { this.bugReporter = bugReporter; @@ -67,7 +61,7 @@ @Override public void visitCode(Code obj) { if (!"<clinit>".equals(getMethodName())) { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; super.visitCode(obj); } } @@ -86,28 +80,28 @@ if (seen == BIPUSH) { arraySize = getIntConstant(); if (arraySize > 0) - state = SEEN_ARRAY_SIZE; + state = State.SEEN_ARRAY_SIZE; }else if ((seen >= ICONST_M1) && (seen <= ICONST_5)) { arraySize = seen - ICONST_M1 - 1; if (arraySize > 0) - state = SEEN_ARRAY_SIZE; + state = State.SEEN_ARRAY_SIZE; } break; case SEEN_ARRAY_SIZE: if ((seen == ANEWARRAY) || (seen == NEWARRAY)) { - state = SEEN_NEWARRAY; + state = State.SEEN_NEWARRAY; storeCount = 0; } else - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; case SEEN_NEWARRAY: if (seen == DUP) - state = SEEN_DUP; + state = State.SEEN_DUP; else - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; case SEEN_DUP: @@ -116,28 +110,28 @@ else if ((seen >= ICONST_M1) && (seen <= ICONST_5)) index = seen - ICONST_M1 - 1; else { - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; return; } if (index != storeCount) - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; else - state = SEEN_INDEX; + state = State.SEEN_INDEX; break; case SEEN_INDEX: if ((seen == LDC) || (seen == LDC_W)) - state = SEEN_LDC; + state = State.SEEN_LDC; else - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; case SEEN_LDC: if ((seen >= IASTORE) && (seen <= SASTORE)) { if ((++storeCount) == arraySize) - state = SEEN_INDEX_STORE; + state = State.SEEN_INDEX_STORE; else - state = SEEN_NEWARRAY; + state = State.SEEN_NEWARRAY; } break; @@ -149,7 +143,7 @@ .addMethod(this) .addSourceLine(this, getPC())); } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 04:09:06
|
Revision: 1472 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1472&view=rev Author: dbrosius Date: 2010-01-11 04:08:55 +0000 (Mon, 11 Jan 2010) Log Message: ----------- now using 1.5 --> use enums Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java 2010-01-11 04:06:45 UTC (rev 1471) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java 2010-01-11 04:08:55 UTC (rev 1472) @@ -43,13 +43,11 @@ */ public class SloppyClassReflection extends BytecodeScanningDetector { - private static final int COLLECT = -1; - private static final int SEEN_NOTHING = 0; - private static final int SEEN_LDC = 1; + enum State {COLLECT, SEEN_NOTHING, SEEN_LDC} private final BugReporter bugReporter; private Set<String> refClasses; - private int state; + private State state; private String clsName; /** @@ -71,9 +69,9 @@ try { refClasses = new HashSet<String>(); refClasses.add(classContext.getJavaClass().getClassName()); - state = COLLECT; + state = State.COLLECT; super.visitClassContext(classContext); - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; super.visitClassContext(classContext); } finally { refClasses = null; @@ -90,7 +88,7 @@ if ("<clinit>".equals(obj.getName())) return; - if (state == COLLECT) { + if (state == State.COLLECT) { Type[] argTypes = obj.getArgumentTypes(); for (Type t : argTypes) addType(t); @@ -109,13 +107,13 @@ } } } else - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; super.visitMethod(obj); } @Override public void visitField(Field obj) { - if (state == COLLECT) { + if (state == State.COLLECT) { Type t = obj.getType(); addType(t); } @@ -149,7 +147,7 @@ Constant c = getConstantRefOperand(); if (c instanceof ConstantString) { clsName = ((ConstantString) c).getBytes(getConstantPool()); - state = SEEN_LDC; + state = State.SEEN_LDC; } } break; @@ -165,7 +163,7 @@ .addSourceLine(this)); } } - state = SEEN_NOTHING; + state = State.SEEN_NOTHING; break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 04:06:53
|
Revision: 1471 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1471&view=rev Author: dbrosius Date: 2010-01-11 04:06:45 +0000 (Mon, 11 Jan 2010) Log Message: ----------- now using 1.5 --> use enums Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java 2010-01-11 03:52:17 UTC (rev 1470) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java 2010-01-11 04:06:45 UTC (rev 1471) @@ -87,10 +87,10 @@ boolean processed = false; Iterator<IfStatement> isi = ifStatements.iterator(); while (isi.hasNext()) { - int action = isi.next().processOpcode(this, bugReporter, seen); - if (action == IfStatement.REMOVE_ACTION) + IfStatement.Action action = isi.next().processOpcode(this, bugReporter, seen); + if (action == IfStatement.Action.REMOVE_ACTION) isi.remove(); - else if (action == IfStatement.PROCESSED_ACTION) + else if (action == IfStatement.Action.PROCESSED_ACTION) processed = true; } @@ -104,15 +104,10 @@ } private static class IfStatement { - public static final int NO_ACTION = 0; - public static final int REMOVE_ACTION = 1; - public static final int PROCESSED_ACTION = 2; - - private final static int SEEN_ALOAD = 1; - private final static int SEEN_INSTANCEOF = 2; - private final static int SEEN_IFEQ = 3; + enum Action {NO_ACTION, REMOVE_ACTION, PROCESSED_ACTION} + enum State {SEEN_ALOAD, SEEN_INSTANCEOF, SEEN_IFEQ} - private int state; + private State state; private int reg; private int firstPC; private int branchTarget; @@ -120,30 +115,30 @@ private Set<String> instanceOfTypes; public IfStatement(BytecodeScanningDetector bsd, int seen) { - state = SEEN_ALOAD; + state = State.SEEN_ALOAD; reg = RegisterUtils.getALoadReg(bsd, seen); matchCount = 0; firstPC = bsd.getPC(); } - public int processOpcode(BytecodeScanningDetector bsd, BugReporter bugReporter, int seen) { + public IfStatement.Action processOpcode(BytecodeScanningDetector bsd, BugReporter bugReporter, int seen) { switch (state) { case SEEN_ALOAD: if (seen == INSTANCEOF) { if (instanceOfTypes == null) instanceOfTypes = new HashSet<String>(); instanceOfTypes.add(bsd.getClassConstantOperand()); - state = SEEN_INSTANCEOF; - return PROCESSED_ACTION; + state = State.SEEN_INSTANCEOF; + return IfStatement.Action.PROCESSED_ACTION; } break; case SEEN_INSTANCEOF: if (seen == IFEQ) { branchTarget = bsd.getBranchTarget(); - state = SEEN_IFEQ; + state = State.SEEN_IFEQ; matchCount++; - return PROCESSED_ACTION; + return IfStatement.Action.PROCESSED_ACTION; } break; @@ -152,8 +147,8 @@ if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) { if (reg == RegisterUtils.getALoadReg(bsd, seen)) { - state = SEEN_ALOAD; - return PROCESSED_ACTION; + state = State.SEEN_ALOAD; + return IfStatement.Action.PROCESSED_ACTION; } } if (matchCount > 1) { @@ -170,13 +165,13 @@ .addClass(bsd) .addMethod(bsd) .addSourceLine(bsd, firstPC)); - return REMOVE_ACTION; + return IfStatement.Action.REMOVE_ACTION; } } - return NO_ACTION; + return IfStatement.Action.NO_ACTION; } - return REMOVE_ACTION; + return IfStatement.Action.REMOVE_ACTION; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 03:52:23
|
Revision: 1470 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1470&view=rev Author: dbrosius Date: 2010-01-11 03:52:17 +0000 (Mon, 11 Jan 2010) Log Message: ----------- fix bad static access use Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java 2010-01-11 03:50:53 UTC (rev 1469) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java 2010-01-11 03:52:17 UTC (rev 1470) @@ -35,17 +35,8 @@ public class UseToArray extends BytecodeScanningDetector { - private static JavaClass collectionClass; - private static ClassNotFoundException ex; - static { - try { - collectionClass = Repository.lookupClass("java/util/Collection"); - } catch (ClassNotFoundException cnfe) { - collectionClass = null; - ex = cnfe; - } - } - + private JavaClass collectionClass; + private ClassNotFoundException ex; private BugReporter bugReporter; private OpcodeStack stack; private Map<Integer, Object> userValues; @@ -56,6 +47,12 @@ */ public UseToArray(BugReporter bugReporter) { this.bugReporter = bugReporter; + try { + collectionClass = Repository.lookupClass("java/util/Collection"); + } catch (ClassNotFoundException cnfe) { + collectionClass = null; + ex = cnfe; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 03:50:59
|
Revision: 1469 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1469&view=rev Author: dbrosius Date: 2010-01-11 03:50:53 +0000 (Mon, 11 Jan 2010) Log Message: ----------- fix bad use of static fields Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java 2010-01-11 03:46:56 UTC (rev 1468) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java 2010-01-11 03:50:53 UTC (rev 1469) @@ -42,17 +42,8 @@ * source is an array, you can use Arrays.asList(array), and use that as the source to addAll. */ public class UseAddAll extends BytecodeScanningDetector { - private static JavaClass collectionClass; - private static ClassNotFoundException ex; - static { - try { - collectionClass = Repository.lookupClass("java/util/Collection"); - } catch (ClassNotFoundException cnfe) { - collectionClass = null; - ex = cnfe; - } - } - + private JavaClass collectionClass; + private ClassNotFoundException ex; private final BugReporter bugReporter; private OpcodeStack stack; /** register/field to alias register/field */ @@ -67,6 +58,12 @@ */ public UseAddAll(BugReporter bugReporter) { this.bugReporter = bugReporter; + try { + collectionClass = Repository.lookupClass("java/util/Collection"); + } catch (ClassNotFoundException cnfe) { + collectionClass = null; + ex = cnfe; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 03:47:02
|
Revision: 1468 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1468&view=rev Author: dbrosius Date: 2010-01-11 03:46:56 +0000 (Mon, 11 Jan 2010) Log Message: ----------- remove dup branches Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2010-01-11 03:41:24 UTC (rev 1467) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2010-01-11 03:46:56 UTC (rev 1468) @@ -101,11 +101,7 @@ } } break; - - case SAW_NEXT: - state = State.SAW_NOTHING; - break; - + case SAW_CHECKCAST: if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { int reg = RegisterUtils.getAStoreReg(this, seen); @@ -138,6 +134,7 @@ state = State.SAW_NOTHING; break; + case SAW_NEXT: default: state = State.SAW_NOTHING; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-01-11 03:41:32
|
Revision: 1467 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1467&view=rev Author: dbrosius Date: 2010-01-11 03:41:24 +0000 (Mon, 11 Jan 2010) Log Message: ----------- remove warnings Modified Paths: -------------- trunk/fb-contrib/samples/MDM_Sample.java Modified: trunk/fb-contrib/samples/MDM_Sample.java =================================================================== --- trunk/fb-contrib/samples/MDM_Sample.java 2010-01-11 03:38:21 UTC (rev 1466) +++ trunk/fb-contrib/samples/MDM_Sample.java 2010-01-11 03:41:24 UTC (rev 1467) @@ -34,6 +34,10 @@ { // Socket tests InetAddress localhost = InetAddress.getLocalHost(); // WARNING + if (localhost == null) + { + localhost = InetAddress.getByName("booya"); + } ServerSocket ss = new ServerSocket(0); touch(ss); // WARNING ss = new ServerSocket(0,0); touch(ss); // WARNING ServerSocketFactory ssf = SSLServerSocketFactory.getDefault(); @@ -84,6 +88,7 @@ { // String tests byte[] bytes = "".getBytes(); // WARNING String s = new String(bytes); // WARNING + bytes = s.getBytes("UTF-8"); Locale.setDefault(Locale.ENGLISH); // WARNING } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |