[Fb-contrib-commit] SF.net SVN: fb-contrib:[1765] trunk/fb-contrib
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2014-02-17 21:23:02
|
Revision: 1765
http://sourceforge.net/p/fb-contrib/code/1765
Author: dbrosius
Date: 2014-02-17 21:22:53 +0000 (Mon, 17 Feb 2014)
Log Message:
-----------
merge from git, prepare for 5.0.3 release
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/ABC_Sample.java
trunk/fb-contrib/samples/ACEM_Sample.java
trunk/fb-contrib/samples/AFBR_Sample.java
trunk/fb-contrib/samples/AIOB_Sample.java
trunk/fb-contrib/samples/AOM_Sample.java
trunk/fb-contrib/samples/AWCBR_Sample.java
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/BED_Sample.java
trunk/fb-contrib/samples/BSB_Sample.java
trunk/fb-contrib/samples/CAAL_Sample.java
trunk/fb-contrib/samples/CAO_Sample.java
trunk/fb-contrib/samples/CBX_Sample.java
trunk/fb-contrib/samples/CCNE_Sample.java
trunk/fb-contrib/samples/CEBE_EqualsToEqualsSample.java
trunk/fb-contrib/samples/CE_Sample.java
trunk/fb-contrib/samples/CFS_Sample.java
trunk/fb-contrib/samples/CHBH_HashcodeToHashcodeSample.java
trunk/fb-contrib/samples/CLI_Sample.java
trunk/fb-contrib/samples/CNC_Sample.java
trunk/fb-contrib/samples/COM_Sample.java
trunk/fb-contrib/samples/CSBTS_StringToStringSample.java
trunk/fb-contrib/samples/CU_Sample.java
trunk/fb-contrib/samples/CVAA_Sample.java
trunk/fb-contrib/samples/DDC_Sample.java
trunk/fb-contrib/samples/DLC_Sample.java
trunk/fb-contrib/samples/DRE_Sample.java
trunk/fb-contrib/samples/DSOC_Sample.java
trunk/fb-contrib/samples/DTEP_Sample.java
trunk/fb-contrib/samples/DWI_Sample.java
trunk/fb-contrib/samples/EXS_Sample.java
trunk/fb-contrib/samples/FCBL_Sample.java
trunk/fb-contrib/samples/FPL_Sample.java
trunk/fb-contrib/samples/FP_Sample.java
trunk/fb-contrib/samples/ICA_Sample.java
trunk/fb-contrib/samples/IICU_Sample.java
trunk/fb-contrib/samples/IKNC_Sample.java
trunk/fb-contrib/samples/IPU_Sample.java
trunk/fb-contrib/samples/ISB_Sample.java
trunk/fb-contrib/samples/ITC_Sample.java
trunk/fb-contrib/samples/ITU_Sample.java
trunk/fb-contrib/samples/JAO_Sample.java
trunk/fb-contrib/samples/JVR_Sample.java
trunk/fb-contrib/samples/LEST_Sample.java
trunk/fb-contrib/samples/LGO_Sample.java
trunk/fb-contrib/samples/LII_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/LSC_Sample.java
trunk/fb-contrib/samples/LSYC_Sample.java
trunk/fb-contrib/samples/MAC_Sample.java
trunk/fb-contrib/samples/MDM_Sample.java
trunk/fb-contrib/samples/MOM_Sample.java
trunk/fb-contrib/samples/MRC_Sample.java
trunk/fb-contrib/samples/MTA_Sample.java
trunk/fb-contrib/samples/NAB_Sample.java
trunk/fb-contrib/samples/NCMU_Sample.java
trunk/fb-contrib/samples/NCS_Sample.java
trunk/fb-contrib/samples/NFF_Sample.java
trunk/fb-contrib/samples/NIR_Sample.java
trunk/fb-contrib/samples/NMCS_Sample.java
trunk/fb-contrib/samples/NOS_Sample.java
trunk/fb-contrib/samples/NPMC_Sample.java
trunk/fb-contrib/samples/NRTL_Sample.java
trunk/fb-contrib/samples/NSE_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/OC_Sample.java
trunk/fb-contrib/samples/ODN_Sample.java
trunk/fb-contrib/samples/PCAIL_Sample.java
trunk/fb-contrib/samples/PCOA_Sample.java
trunk/fb-contrib/samples/PDP_Sample.java
trunk/fb-contrib/samples/PIS_Sample.java
trunk/fb-contrib/samples/PL_Sample.java
trunk/fb-contrib/samples/PMB_Sample.java
trunk/fb-contrib/samples/PME_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/PSC_Sample.java
trunk/fb-contrib/samples/PUS_Sample.java
trunk/fb-contrib/samples/ROOM_Sample.java
trunk/fb-contrib/samples/S508C_Sample.java
trunk/fb-contrib/samples/SACM_Sample.java
trunk/fb-contrib/samples/SCA_Sample.java
trunk/fb-contrib/samples/SCII_Sample.java
trunk/fb-contrib/samples/SCI_Sample.java
trunk/fb-contrib/samples/SCRV_Sample.java
trunk/fb-contrib/samples/SCR_Sample.java
trunk/fb-contrib/samples/SCSS_Sample.java
trunk/fb-contrib/samples/SC_Sample.java
trunk/fb-contrib/samples/SEC_Sample.java
trunk/fb-contrib/samples/SGSU_Sample.java
trunk/fb-contrib/samples/SG_Sample.java
trunk/fb-contrib/samples/SIL_Sample.java
trunk/fb-contrib/samples/SJVU_Sample.java
trunk/fb-contrib/samples/SMA_Sample.java
trunk/fb-contrib/samples/SMII_Sample.java
trunk/fb-contrib/samples/SNG_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/STB_Sample.java
trunk/fb-contrib/samples/STS_Sample.java
trunk/fb-contrib/samples/SUA_Sample.java
trunk/fb-contrib/samples/SWCO_Sample.java
trunk/fb-contrib/samples/TBP_Sample.java
trunk/fb-contrib/samples/TR_Sample.java
trunk/fb-contrib/samples/UAA_Sample.java
trunk/fb-contrib/samples/UCC_Sample.java
trunk/fb-contrib/samples/UCPM_Sample.java
trunk/fb-contrib/samples/UEC_Sample.java
trunk/fb-contrib/samples/UMTP_Sample.java
trunk/fb-contrib/samples/UNNC_Sample.java
trunk/fb-contrib/samples/URV_Sample.java
trunk/fb-contrib/samples/USBR_Sample.java
trunk/fb-contrib/samples/USS_Sample.java
trunk/fb-contrib/samples/UTA_Sample.java
trunk/fb-contrib/samples/UVA_Sample.java
trunk/fb-contrib/samples/WEM_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
Added Paths:
-----------
trunk/fb-contrib/samples/UP_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
Removed Paths:
-------------
trunk/fb-contrib/META-INF/
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/.classpath 2014-02-17 21:22:53 UTC (rev 1765)
@@ -5,18 +5,18 @@
<classpathentry excluding="lib/" kind="src" path="samples"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
- <classpathentry kind="lib" path="lib/annotations-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/asm-tree-3.3.1.jar"/>
<classpathentry kind="lib" path="lib/backport-util-concurrent-3.1.jar"/>
<classpathentry kind="lib" path="lib/bcel-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
- <classpathentry kind="lib" path="lib/commons-lang3-3.1.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
- <classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.2.1.jar"/>
<classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
<classpathentry kind="lib" path="lib/findbugs-2.0.3.jar"/>
<classpathentry kind="lib" path="lib/guava-15.0.jar"/>
+ <classpathentry kind="lib" path="lib/annotations-2.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang3-3.2.jar"/>
+ <classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/build.xml 2014-02-17 21:22:53 UTC (rev 1765)
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="5.0.2" />
+ <property name="fb-contrib.version" value="5.0.3" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -49,7 +49,7 @@
<echo message=""/>
<echo message=" this project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
<echo message=" download yank.jar and place in ant/lib directory"/>
- <echo message=" http://search.maven.org/#artifactdetails%7Ccom.mebigfatguy.yank%7Cyank%7C0.4.2%7Cjar"/>
+ <echo message=" http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.mebigfatguy.yank%22"/>
<antcall target="install"/>
</target>
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/etc/findbugs.xml 2014-02-17 21:22:53 UTC (rev 1765)
@@ -31,7 +31,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -106,7 +106,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.JDBCVendorReliance" speed="fast" reports="JVR_JDBC_VENDOR_RELIANCE" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat" speed="fast" reports="PMB_POSSIBLE_MEMORY_BLOAT" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat" speed="fast" reports="PMB_POSSIBLE_MEMORY_BLOAT,PMB_INSTANCE_BASED_THREAD_LOCAL" />
<Detector class="com.mebigfatguy.fbcontrib.detect.LocalSynchronizedCollection" speed="moderate" reports="LSYC_LOCAL_SYNCHRONIZED_COLLECTION" />
@@ -146,7 +146,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" />
<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_TERNARY,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,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING" />
+ 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_TERNARY,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,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" />
@@ -248,7 +248,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument" speed="fast" reports="ICA_INVALID_CONSTANT_ARRAY" />
- <!-- COMMENT OUT FOR POINT RELEASE
+ <!-- COMMENT OUT FOR POINT RELEASE
<Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections" speed="fast" reports="PSC_PRESIZE_COLLECTIONS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds" speed="fast" reports="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS,AIOB_ARRAY_STORE_TO_NULL_REFERENCE" />
@@ -257,8 +257,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.PoorMansEnum" speed="fast" reports="PME_POOR_MANS_ENUM" />
- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.UnusedParameter" speed="fast" reports="UP_UNUSED_PARAMETER" />
+ COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -308,6 +310,7 @@
<BugPattern abbrev="SWCO" type="SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT" category="CORRECTNESS" />
<BugPattern abbrev="JVR" type="JVR_JDBC_VENDOR_RELIANCE" category="CORRECTNESS" />
<BugPattern abbrev="PMB" type="PMB_POSSIBLE_MEMORY_BLOAT" category="CORRECTNESS" />
+ <BugPattern abbrev="PMB" type="PMB_INSTANCE_BASED_THREAD_LOCAL" category="CORRECTNESS" />
<BugPattern abbrev="LSYC" type="LSYC_LOCAL_SYNCHRONIZED_COLLECTION" category="CORRECTNESS" />
<BugPattern abbrev="FCBL" type="FCBL_FIELD_COULD_BE_LOCAL" category="CORRECTNESS" />
<BugPattern abbrev="NRTL" type="NRTL_NON_RECYCLEABLE_TAG_LIB" category="CORRECTNESS"/>
@@ -362,6 +365,7 @@
<BugPattern abbrev="SPP" type="SPP_DOUBLE_APPENDED_LITERALS" category="PERFORMANCE" />
<BugPattern abbrev="SPP" type="SPP_NULL_BEFORE_INSTANCEOF" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_NON_USEFUL_TOSTRING" category="STYLE" />
+ <BugPattern abbrev="SPP" type="SPP_TOSTRING_ON_STRING" category="CORRECTNESS" />
<BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" category="PERFORMANCE" />
<BugPattern abbrev="SCII" type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" category="STYLE" />
<BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" category="CORRECTNESS" />
@@ -455,4 +459,5 @@
<BugPattern abbrev="ICA" type="ICA_INVALID_CONSTANT_ARGUMENT" category="CORRECTNESS" />
<BugPattern abbrev="CNC" type="CNC_COLLECTION_NAMING_CONFUSION" category="STYLE" />
<BugPattern abbrev="PME" type="PME_POOR_MANS_ENUM" category="STYLE" />
+ <BugPattern abbrev="UP" type="UP_UNUSED_PARAMETER" category="STYLE" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/etc/messages.xml 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1352,7 +1352,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.CollectionNamingConfusion">
<Details>
<![CDATA[
- <p>Looks for fields or local variables that are collections but which names have a different type
+ <p>Looks for fields or local variables that are collections but the names have a different type
of collection in the name. This is confusing, and is probably a left over from a type change, such as
</p>
<p>List<String> mySet;</p>
@@ -1371,6 +1371,16 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.UnusedParameter">
+ <Details>
+ <![CDATA[
+ <p>Looks for private or static methods that have parameters that aren't used. These parameters
+ can be removed.</p>
+ <p>It is fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -1409,7 +1419,7 @@
<Details>
<![CDATA[
<p>This method concatenates the output of a toString() call into a StringBuffer/Builder.
- It is simpler just pass the object you want to append to the to append call, as that form
+ It is simpler just to pass the object you want to append to the append call, as that form
does not suffer the potential for NullPointerExceptions, and is easier to read.</p>
]]>
</Details>
@@ -2004,6 +2014,21 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="PMB_INSTANCE_BASED_THREAD_LOCAL">
+ <ShortDescription>Field is an instance based ThreadLocal variable</ShortDescription>
+ <LongDescription>Field {1} is an instance based ThreadLocal variable</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This ThreadLocal field is defined as being instance based (not static). As all
+ ThreadLocal variables describe permanent reachability roots so far as the garbage
+ collector is concerned, these variables will never be reclaimed (so long as the Thread lives).
+ Since this ThreadLocal is instanced, you potentially will be creating many non reclaimable
+ variables, even after the owning instance has been reclaimed. It is almost a certainty that
+ you want to use static based ThreadLocal variables.</p>
+ ]]>
+ </Details>
+ </BugPattern>
<BugPattern type="LSYC_LOCAL_SYNCHRONIZED_COLLECTION">
<ShortDescription>Method creates local variable-based synchronized collection</ShortDescription>
@@ -2685,6 +2710,16 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="SPP_TOSTRING_ON_STRING">
+ <ShortDescription>Method calls toString() on a String</ShortDescription>
+ <LongDescription>Method {1} calls toString() on a String</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This methods calls toString on a String. Just use the object itself if you want a String.</p>
+ ]]>
+ </Details>
+ </BugPattern>
<BugPattern type="BAS_BLOATED_ASSIGNMENT_SCOPE">
<ShortDescription>Method assigns a variable in a larger scope then is needed</ShortDescription>
@@ -3813,7 +3848,7 @@
<Details>
<![CDATA[
<p>This class defines a field or local collection variable with a name that contains a different type
- of collection in it's name. This is confusing to the reader, and likely caused by a previous refactor of
+ of collection in its name. This is confusing to the reader, and likely caused by a previous refactor of
type, without changing the name.</p>
]]>
</Details>
@@ -3825,11 +3860,24 @@
<Details>
<![CDATA[
<p>This field, although defined as a simple variable (int, String, etc) only has a set of constant values
- assigned to it. This appears to be used like an enum value, and should probably be defined as such.
+ assigned to it. Thus it appears to be used like an enum value, and should probably be defined as such.
</p>
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="UP_UNUSED_PARAMETER">
+ <ShortDescription>Static or private method has unused parameters</ShortDescription>
+ <LongDescription>Static or private method {1} has unused parameters</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method defines parameters that are never used. As this method is either static of private,
+ and can't be derived from, it is safe to remove these parameters and simplify your method.
+ You should consider, while unlikely, that this method may be used reflectively, and thus you will
+ want to change that call as well.
+ ]]>
+ </Details>
+ </BugPattern>
<!-- BugCode -->
@@ -3947,4 +3995,5 @@
<BugCode abbrev="ICA">Invalid Constant Argument</BugCode>
<BugCode abbrev="CNC">Collection Naming Confusion</BugCode>
<BugCode abbrev="PME">Poor Mans Enum</BugCode>
+ <BugCode abbrev="UP">Unused Parameter</BugCode>
</MessageCollection>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/htdocs/index.shtml 2014-02-17 21:22:53 UTC (rev 1765)
@@ -68,14 +68,14 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 5.0.2 available for download
- <a href="http://sourceforge.net/projects/fb-contrib/files/Current/fb-contrib-5.0.2.jar/download">here</a>.</p>
+ <p style="font-weight: bold;">The latest version of fb-contrib is 5.0.3 available for download
+ <a href="http://sourceforge.net/projects/fb-contrib/files/Current/fb-contrib-5.0.3.jar/download">here</a>.</p>
</div>
<hr/>
- <img id="git_image" src="flip1.gif" onClick="toggleBlock('git', 'git_image');" align="top"/>
+ <img id="git_image" src="flip2.gif" onClick="toggleBlock('git', 'git_image');" align="top"/>
Detectors added in git<br/>
- <div id="git" style="display:none;">
+ <div id="git" style="display:block;">
<ul>
<li><b>[STB] Stacked Try Blocks</b><br/>
Looks for two or more try catch blocks that are consecutive and catch the
@@ -106,12 +106,16 @@
Looks for simple fields that only store one of several constant values. This usually is an indication
that this field should really be an enum type.
</li>
+ <li><b>[UP] Unused Parameter</b><br/>
+ Looks for private or static methods that have parameters that aren't used. These parameters
+ can be removed.
+ </li>
</ul>
</div>
<hr/>
- <img id="v5_0_0_image" src="flip2.gif" onClick="toggleBlock('v5_0_0', 'v5_0_0_image');" align="top"/>
+ <img id="v5_0_0_image" src="flip1.gif" onClick="toggleBlock('v5_0_0', 'v5_0_0_image');" align="top"/>
Detectors added in v5.0.0<br/>
- <div id="v5_0_0" style="display:block;">
+ <div id="v5_0_0" style="display:none;">
<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.<br/>
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/htdocs/repository.html 2014-02-17 21:22:53 UTC (rev 1765)
@@ -22,7 +22,7 @@
<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.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>5.0.2</td></tr>
+ <tr><td><b>Version:</b></td><td>5.0.3</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/pom.xml 2014-02-17 21:22:53 UTC (rev 1765)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>5.0.2</version>
+ <version>5.0.3</version>
<parent>
<groupId>org.sonatype.oss</groupId>
Modified: trunk/fb-contrib/samples/ABC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/ABC_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/ABC_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -6,46 +6,36 @@
import java.util.Set;
import java.util.TreeMap;
+public class ABC_Sample {
+ public Map<String[], String> testMaps(String[] key, String value) {
+ Map<String[], String> m = new HashMap<String[], String>();
+ m.put(key, value);
+ return m;
+ }
+ public Set<String[]> testSets(String[] values) {
+ Set<String[]> s = new HashSet<String[]>();
+ s.add(values);
+ return s;
+ }
-public class ABC_Sample
-{
- public Map<String[], String> testMaps(String[] key, String value)
- {
- Map<String[], String> m = new HashMap<String[], String>();
- m.put(key, value);
- return m;
- }
-
- public Set<String[]> testSets(String[] values)
- {
- Set<String[]> s = new HashSet<String[]>();
- s.add(values);
- return s;
- }
-
- public boolean testLists(List<String[]> l, String[] value)
- {
- return l.contains(value);
- }
-
- public static class UseComparator
- {
- private Map<byte[], byte[]> testComp;
-
- public UseComparator()
- {
- testComp = new TreeMap<byte[], byte[]>( new Comparator<byte[]>()
- {
- public int compare(byte[] b1, byte[] b2)
- {
- return b1.length - b2.length;
- }
- });
- }
-
- public void testc() {
- testComp.put(new byte[5], new byte[3]);
- }
- }
+ public boolean testLists(List<String[]> l, String[] value) {
+ return l.contains(value);
+ }
+
+ public static class UseComparator {
+ private Map<byte[], byte[]> testComp;
+
+ public UseComparator() {
+ testComp = new TreeMap<byte[], byte[]>(new Comparator<byte[]>() {
+ public int compare(byte[] b1, byte[] b2) {
+ return b1.length - b2.length;
+ }
+ });
+ }
+
+ public void testc() {
+ testComp.put(new byte[5], new byte[3]);
+ }
+ }
}
Modified: trunk/fb-contrib/samples/ACEM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/ACEM_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/ACEM_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,13 +1,9 @@
+public abstract class ACEM_Sample {
+ public void test() {
+ }
-public abstract class ACEM_Sample
-{
- public void test()
- {
- }
-
- public int test1()
- {
- throw new UnsupportedOperationException("Not implemented");
- }
+ public int test1() {
+ throw new UnsupportedOperationException("Not implemented");
+ }
}
\ No newline at end of file
Modified: trunk/fb-contrib/samples/AFBR_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AFBR_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/AFBR_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -3,80 +3,55 @@
import java.io.InputStream;
@SuppressWarnings("all")
-public class AFBR_Sample
-{
- public int test1(boolean b)
- {
- try
- {
- int i = 0;
- }
- finally
- {
- if (b)
- return 0;
- int j = 0;
- }
- return 2;
- }
-
- public int test2()
- {
- try
- {
- return 0;
- }
- finally
- {
- throw new NullPointerException();
- }
- }
-
- public int test3() throws Exception
- {
- try
- {
- return 0;
- }
- finally
- {
- throw new Exception();
- }
- }
-
- public int test4()
- {
- try
- {
- throw new Exception();
- }
- catch (Exception e)
- {
- return 1;
- }
- finally
- {
- return 0;
- }
- }
-
- public int test5() throws IOException
- {
- InputStream is = null;
- try
- {
- is = new FileInputStream("test");
- return 1;
- }
- catch (IOException ioe)
- {
- System.out.println("error");
- }
- finally
- {
- if (is != null)
- is.close();
- }
- return 0;
- }
+public class AFBR_Sample {
+ public int test1(boolean b) {
+ try {
+ int i = 0;
+ } finally {
+ if (b)
+ return 0;
+ int j = 0;
+ }
+ return 2;
+ }
+
+ public int test2() {
+ try {
+ return 0;
+ } finally {
+ throw new NullPointerException();
+ }
+ }
+
+ public int test3() throws Exception {
+ try {
+ return 0;
+ } finally {
+ throw new Exception();
+ }
+ }
+
+ public int test4() {
+ try {
+ throw new Exception();
+ } catch (Exception e) {
+ return 1;
+ } finally {
+ return 0;
+ }
+ }
+
+ public int test5() throws IOException {
+ InputStream is = null;
+ try {
+ is = new FileInputStream("test");
+ return 1;
+ } catch (IOException ioe) {
+ System.out.println("error");
+ } finally {
+ if (is != null)
+ is.close();
+ }
+ return 0;
+ }
}
\ No newline at end of file
Modified: trunk/fb-contrib/samples/AIOB_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AIOB_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/AIOB_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,62 +1,58 @@
import java.util.List;
-
-public class AIOB_Sample
-{
+public class AIOB_Sample {
int[] fa = new int[4];
int[] fb;
-
- public void testOutOfBounds()
- {
+
+ public void testOutOfBounds() {
int[] a = new int[4];
-
+
a[4] = 2;
fa[4] = 2;
}
-
- public void testUnallocated()
- {
+
+ public void testUnallocated() {
int[] b = null;
-
+
b[4] = 4;
fb[4] = 4;
}
-
+
public int[] fpPlusPlusNotRecognized(List<String> l) {
int size = 0;
-
+
for (String s : l) {
size++;
}
-
+
int[] data = new int[size];
-
+
data[0] = 0;
return data;
}
-
+
public void fpPostAllocate() {
double[] da = null;
-
+
for (int i = 0; i < 10; i++) {
if ((i & 1) == 1) {
da[0] = 0.0;
}
-
+
if (da == null)
da = new double[10];
}
}
-
+
public void fpPlusEquals(List<String> ss) {
int size = 0;
-
+
for (String s : ss) {
size += s.length();
}
-
+
int[] a = new int[size];
-
+
a[0] = 1;
}
}
Modified: trunk/fb-contrib/samples/AOM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AOM_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/AOM_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,19 +1,17 @@
+class AOM_Super {
+ public void test1() {
+ test2();
+ System.out.println("test");
+ }
-class AOM_Super
-{
- public void test1() {
- test2();
- System.out.println("test");
- }
-
- private void test2() {
- System.out.println("test");
- }
+ private void test2() {
+ System.out.println("test");
+ }
}
-public abstract class AOM_Sample extends AOM_Super
-{
- @Override
- public abstract void test1();
- public abstract void test2();
+public abstract class AOM_Sample extends AOM_Super {
+ @Override
+ public abstract void test1();
+
+ public abstract void test2();
}
Modified: trunk/fb-contrib/samples/AWCBR_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AWCBR_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/AWCBR_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,33 +1,27 @@
+public class AWCBR_Sample {
+ public void m(int[] v) {
+ v[0]++;
+ }
-public class AWCBR_Sample
-{
- public void m(int[] v)
- {
- v[0]++;
- }
-
- public int testuninitedalloc(int i)
- {
- int[] data = new int[1];
- data[0] = i;
- m(data);
- i = data[0];
- return i;
- }
-
- public int testinitedalloc(int i)
- {
- int[] data = new int[] { i };
- m(data);
- i = data[0];
- return i;
- }
-
- public int testNoCall(int i)
- {
- //while silly don't report this, as there is no arg usage
- int[] data = new int[] { i };
- i = data[0];
- return i;
- }
+ public int testuninitedalloc(int i) {
+ int[] data = new int[1];
+ data[0] = i;
+ m(data);
+ i = data[0];
+ return i;
+ }
+
+ public int testinitedalloc(int i) {
+ int[] data = new int[] { i };
+ m(data);
+ i = data[0];
+ return i;
+ }
+
+ public int testNoCall(int i) {
+ // while silly don't report this, as there is no arg usage
+ int[] data = new int[] { i };
+ i = data[0];
+ return i;
+ }
}
Modified: trunk/fb-contrib/samples/BAS_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BAS_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/BAS_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -8,177 +8,165 @@
import java.util.Set;
@SuppressWarnings("all")
-public class BAS_Sample
-{
- private final Map<String, String> m = new HashMap<String, String>();
+public class BAS_Sample {
+ private final Map<String, String> m = new HashMap<String, String>();
- public void testIfScope(String s)
- {
- Object o = new Object();
- if (s.equals("Foo"))
- {
- s = o.toString();
- }
- }
+ public void testIfScope(String s) {
+ Object o = new Object();
+ if (s.equals("Foo")) {
+ s = o.toString();
+ }
+ }
- public String testFPForScope(String s)
- {
- Object o = new Object();
- while (s.length() > 0)
- {
- o = s.substring(0, 1);
- s = s.substring(1);
- }
- return s;
- }
+ public String testFPForScope(String s) {
+ Object o = new Object();
+ while (s.length() > 0) {
+ o = s.substring(0, 1);
+ s = s.substring(1);
+ }
+ return s;
+ }
- public String testFP2Scopes(String s)
- {
- Object o = new Object();
- if (s.equals("Boo"))
- {
+ public String testFP2Scopes(String s) {
+ Object o = new Object();
+ if (s.equals("Boo")) {
s = o.toString();
- }
- else if (s.equals("Hoo"))
- {
+ } else if (s.equals("Hoo")) {
s = o.toString();
}
- return s;
- }
+ return s;
+ }
- public String test2InnerScopes(String s)
- {
- Object o = new Object();
- if (s != null)
- {
- if (s.equals("Boo"))
- {
+ public String test2InnerScopes(String s) {
+ Object o = new Object();
+ if (s != null) {
+ if (s.equals("Boo")) {
s = o.toString();
- }
- else if (s.equals("Hoo"))
- {
+ } else if (s.equals("Hoo")) {
s = o.toString();
}
- }
+ }
- return s;
- }
+ return s;
+ }
- public String testFPLoopCond(List<String> in)
- {
- StringBuilder sb = new StringBuilder();
- for (String s : in)
- {
- sb.append(s);
- }
- return sb.toString();
- }
+ public String testFPLoopCond(List<String> in) {
+ StringBuilder sb = new StringBuilder();
+ for (String s : in) {
+ sb.append(s);
+ }
+ return sb.toString();
+ }
- public List<String> getList()
- {
- return null;
- }
+ public List<String> getList() {
+ return null;
+ }
- public String testSwitch(int a)
- {
- String v = "Test";
+ public String testSwitch(int a) {
+ String v = "Test";
- switch (a)
- {
- case 1:
- v = "Testa";
- break;
+ switch (a) {
+ case 1:
+ v = "Testa";
+ break;
- case 2:
- v = "Tesseract";
- break;
+ case 2:
+ v = "Tesseract";
+ break;
- case 3:
- v = "Testy";
- break;
+ case 3:
+ v = "Testy";
+ break;
- default:
- v = "Rossa";
- break;
- }
+ default:
+ v = "Rossa";
+ break;
+ }
- return null;
- }
+ return null;
+ }
- public void testFPSync(Set<String> a, Set<String> b)
- {
- String c, d;
+ public void testFPSync(Set<String> a, Set<String> b) {
+ String c, d;
- synchronized(this)
- {
- c = a.iterator().next();
- d = b.iterator().next();
- }
+ synchronized (this) {
+ c = a.iterator().next();
+ d = b.iterator().next();
+ }
- if (d.length() > 0)
- {
- d = c;
- }
- }
+ if (d.length() > 0) {
+ d = c;
+ }
+ }
- public int testFPObjChange(Calendar c, boolean b)
- {
- int hour = c.get(Calendar.HOUR_OF_DAY);
- c.set(2000, Calendar.JANUARY, 1);
+ public int testFPObjChange(Calendar c, boolean b) {
+ int hour = c.get(Calendar.HOUR_OF_DAY);
+ c.set(2000, Calendar.JANUARY, 1);
- if (b)
- {
- return hour;
- }
+ if (b) {
+ return hour;
+ }
- return 0;
- }
+ return 0;
+ }
- public void testFPSrcOverwrite(int src, boolean b)
- {
- int d = src;
- src = 0;
+ public void tstFPRefChange(Holder h1, Holder h2, boolean b) {
- if (b)
- {
- System.out.println(d);
- }
- }
+ int h = h1.member;
+ h1 = h2;
- public void testFPRiskies1(boolean b) {
- long start = System.currentTimeMillis();
+ if (b) {
+ System.out.println(h);
+ }
+ }
- if (b) {
- long delta = System.currentTimeMillis() - start;
- System.out.println(delta);
- }
- }
+ public void testFPSrcOverwrite(int src, boolean b) {
+ int d = src;
+ src = 0;
- public String testFPIteratorNext(Collection<String> c, boolean b) {
- Iterator<String> it = c.iterator();
+ if (b) {
+ System.out.println(d);
+ }
+ }
- String s = it.next();
+ public void testFPRiskies1(boolean b) {
+ long start = System.currentTimeMillis();
- if (b) {
- if (s == null) {
- return "yay";
- }
- }
+ if (b) {
+ long delta = System.currentTimeMillis() - start;
+ System.out.println(delta);
+ }
+ }
- return it.next();
- }
-
- public List<String> testFPSynchronized(String s, String p) {
- List<String> l = new ArrayList<String>();
- String x = s;
- synchronized(s) {
- if (p != null) {
- l.add(p);
- return l;
- }
- }
-
- return null;
- }
+ public String testFPIteratorNext(Collection<String> c, boolean b) {
+ Iterator<String> it = c.iterator();
+
+ String s = it.next();
+
+ if (b) {
+ if (s == null) {
+ return "yay";
+ }
+ }
+
+ return it.next();
+ }
+
+ public List<String> testFPSynchronized(String s, String p) {
+ List<String> l = new ArrayList<String>();
+ String x = s;
+ synchronized (s) {
+ if (p != null) {
+ l.add(p);
+ return l;
+ }
+ }
+
+ return null;
+ }
+
+ static class Holder {
+ int member;
+ }
}
Modified: trunk/fb-contrib/samples/BED_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BED_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/BED_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -10,62 +10,49 @@
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
-
@SuppressWarnings("all")
-public class BED_Sample
-{
- IOException ioe;
+public class BED_Sample {
+ IOException ioe;
- public BED_Sample() throws IOException
- {
+ public BED_Sample() throws IOException {
- }
+ }
- public BED_Sample(String name) throws NamingException
- {
- Hashtable<String, String> env = new Hashtable<String, String>();
- env.put("name", name);
- DirContext context = new InitialDirContext(env);
- }
+ public BED_Sample(String name) throws NamingException {
+ Hashtable<String, String> env = new Hashtable<String, String>();
+ env.put("name", name);
+ DirContext context = new InitialDirContext(env);
+ }
- private void badThrow() throws SQLException
- {
+ private void badThrow() throws SQLException {
- }
+ }
- public static void badStatic() throws DataFormatException
- {
+ public static void badStatic() throws DataFormatException {
- }
-
- public final void badFinal() throws ClassNotFoundException
- {
-
- }
+ }
- public static void doIt() throws SQLException, IOException
- {
- InputStream is = new FileInputStream("c:\\temp.txt");
- }
+ public final void badFinal() throws ClassNotFoundException {
- public static void fp() throws Exception
- {
- InputStream is = new FileInputStream("c:\\temp.txt");
- }
+ }
- private void fpThrowField(boolean b) throws IOException
- {
- if (b)
- {
- throw ioe;
- }
- else
- {
- IOException e = ioe;
- throw ioe;
- }
- }
+ public static void doIt() throws SQLException, IOException {
+ InputStream is = new FileInputStream("c:\\temp.txt");
+ }
+ public static void fp() throws Exception {
+ InputStream is = new FileInputStream("c:\\temp.txt");
+ }
+
+ private void fpThrowField(boolean b) throws IOException {
+ if (b) {
+ throw ioe;
+ } else {
+ IOException e = ioe;
+ throw ioe;
+ }
+ }
+
public Object iAmCreatingAnObject() {
return new Object() {
private byte[] iHaveToThrowAnException() throws IOException {
Modified: trunk/fb-contrib/samples/BSB_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BSB_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/BSB_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -6,67 +6,56 @@
import java.util.Set;
@SuppressWarnings("all")
-public class BSB_Sample
-{
- private Object lock = new Object();
- private Set<String> info = new HashSet<String>();
- private Map<String, Object> synchMap = Collections.synchronizedMap(new HashMap<String, Object>());
+public class BSB_Sample {
+ private Object lock = new Object();
+ private Set<String> info = new HashSet<String>();
+ private Map<String, Object> synchMap = Collections.synchronizedMap(new HashMap<String, Object>());
- public void testFieldBeginBloated(int i, int j)
- {
- synchronized(lock)
- {
- StringBuffer sb = new StringBuffer();
- sb.append("Test");
- sb.append(i);
- info.add(sb.toString());
- }
- }
-
- public void testLocalBeginBloated(int j)
- {
- Set<String> i = getInfo();
- synchronized(i)
- {
- StringBuffer sb = new StringBuffer();
- sb.append("Test");
- sb.append(j);
- i.add(sb.toString());
- }
- }
-
- public void testAliasedLocalBeginBloated(int j)
- {
- Set<String> i = getInfo();
- synchronized(info)
- {
- StringBuffer sb = new StringBuffer();
- sb.append("Test");
- sb.append(j);
- i.add(sb.toString());
- }
- }
-
- public void testBranchCutDown(int j)
- {
- Set<String> i = getInfo();
- synchronized(i)
- {
- StringBuffer sb = new StringBuffer();
- if (sb.length() > 0)
- {
- sb.append("Test");
- sb.append(j);
- i.add(sb.toString());
- }
- }
- }
-
- public Set<String> getInfo()
- {
- return info;
- }
-
+ public void testFieldBeginBloated(int i, int j) {
+ synchronized (lock) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Test");
+ sb.append(i);
+ info.add(sb.toString());
+ }
+ }
+
+ public void testLocalBeginBloated(int j) {
+ Set<String> i = getInfo();
+ synchronized (i) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Test");
+ sb.append(j);
+ i.add(sb.toString());
+ }
+ }
+
+ public void testAliasedLocalBeginBloated(int j) {
+ Set<String> i = getInfo();
+ synchronized (info) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Test");
+ sb.append(j);
+ i.add(sb.toString());
+ }
+ }
+
+ public void testBranchCutDown(int j) {
+ Set<String> i = getInfo();
+ synchronized (i) {
+ StringBuffer sb = new StringBuffer();
+ if (sb.length() > 0) {
+ sb.append("Test");
+ sb.append(j);
+ i.add(sb.toString());
+ }
+ }
+ }
+
+ public Set<String> getInfo() {
+ return info;
+ }
+
public void accessSyncMap() {
Set keySet = synchMap.keySet();
synchronized (synchMap) {
Modified: trunk/fb-contrib/samples/CAAL_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CAAL_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CAAL_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,7 +1,6 @@
import java.util.Arrays;
import java.util.List;
-
public class CAAL_Sample {
public void testCAAL(int[] v) {
Modified: trunk/fb-contrib/samples/CAO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CAO_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CAO_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,52 +1,42 @@
+public class CAO_Sample {
+ public void testci(Character c) {
+ System.out.println("Character");
+ }
-public class CAO_Sample
-{
- public void testci(Character c)
- {
- System.out.println("Character");
- }
-
- public void testci(int i)
- {
- System.out.println("int");
- }
-
- public void testcj(Character c)
- {
- System.out.println("Character");
- }
-
- public void testcj(long l)
- {
- System.out.println("long");
- }
+ public void testci(int i) {
+ System.out.println("int");
+ }
- public void testcd(Character c)
- {
- System.out.println("Character");
- }
-
- public void testcd(double d)
- {
- System.out.println("double");
- }
+ public void testcj(Character c) {
+ System.out.println("Character");
+ }
- public void testcf(Character c)
- {
- System.out.println("Character");
- }
-
- public void testcf(float f)
- {
- System.out.println("float");
- }
- public static void main(String[] args)
- {
- CAO_Sample s = new CAO_Sample();
- s.testci('a');
- s.testcj('a');
- s.testcd('a');
- s.testcf('a');
- }
+ public void testcj(long l) {
+ System.out.println("long");
+ }
+
+ public void testcd(Character c) {
+ System.out.println("Character");
+ }
+
+ public void testcd(double d) {
+ System.out.println("double");
+ }
+
+ public void testcf(Character c) {
+ System.out.println("Character");
+ }
+
+ public void testcf(float f) {
+ System.out.println("float");
+ }
+
+ public static void main(String[] args) {
+ CAO_Sample s = new CAO_Sample();
+ s.testci('a');
+ s.testcj('a');
+ s.testcd('a');
+ s.testcf('a');
+ }
}
\ No newline at end of file
Modified: trunk/fb-contrib/samples/CBX_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CBX_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CBX_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,12 +1,9 @@
-
-public class CBX_Sample
-{
- public String testBuildXML(int val, String info)
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<sample>");
- sb.append("<test name='" + val + "'>" + info + "</test>");
- sb.append("</sample>");
- return sb.toString();
- }
+public class CBX_Sample {
+ public String testBuildXML(int val, String info) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<sample>");
+ sb.append("<test name='" + val + "'>" + info + "</test>");
+ sb.append("</sample>");
+ return sb.toString();
+ }
}
Modified: trunk/fb-contrib/samples/CCNE_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CCNE_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CCNE_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -2,8 +2,7 @@
public void compareClassEquals() {
Object o = new CCNE_Sample();
Object p = new CCNE_Sample();
- System.out.println(o.getClass().getName()
- .equals(p.getClass().getName()));
+ System.out.println(o.getClass().getName().equals(p.getClass().getName()));
}
public void fpCompareAgainstString(String name) {
Modified: trunk/fb-contrib/samples/CEBE_EqualsToEqualsSample.java
===================================================================
--- trunk/fb-contrib/samples/CEBE_EqualsToEqualsSample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CEBE_EqualsToEqualsSample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -2,30 +2,29 @@
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class CEBE_EqualsToEqualsSample {
- public final String name;
- public final int age;
+ public final String name;
+ public final int age;
- CEBE_EqualsToEqualsSample(String name, int age) {
- this.name = name;
- this.age = age;
- }
+ CEBE_EqualsToEqualsSample(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(name).append(age).toHashCode();
- }
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).append(age).toHashCode();
+ }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CEBE_EqualsToEqualsSample other = (CEBE_EqualsToEqualsSample) obj;
- return new EqualsBuilder().append(this.name, other.name)
- .append(this.age, other.age).equals(obj);
- }
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CEBE_EqualsToEqualsSample other = (CEBE_EqualsToEqualsSample) obj;
+ return new EqualsBuilder().append(this.name, other.name).append(this.age, other.age).equals(obj);
+ }
}
Modified: trunk/fb-contrib/samples/CE_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CE_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CE_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,37 +1,37 @@
+public class CE_Sample {
+ public void test() {
+ Envy e = new Envy();
+ e.a();
+ e.b();
+ test2();
+ e.c();
+ e.d();
+ e.e();
+ e.f();
+ }
-public class CE_Sample
-{
- public void test()
- {
- Envy e = new Envy();
- e.a();
- e.b();
- test2();
- e.c();
- e.d();
- e.e();
- e.f();
- }
-
- public void test2()
- {
-
- }
+ public void test2() {
+
+ }
}
-class Envy
-{
- public void a() {}
-
- public void b() {}
-
- public void c() {}
-
- public void d() {}
-
- public void e() {}
-
- public void f() {}
+class Envy {
+ public void a() {
+ }
+
+ public void b() {
+ }
+
+ public void c() {
+ }
+
+ public void d() {
+ }
+
+ public void e() {
+ }
+
+ public void f() {
+ }
}
-
Modified: trunk/fb-contrib/samples/CFS_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CFS_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CFS_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,19 +1,16 @@
import java.util.Date;
-public class CFS_Sample
-{
- @SuppressWarnings("deprecation")
- public Date getNextDate(Date d)
- {
- d.setHours(0);
- return d;
- }
-
- @SuppressWarnings("deprecation")
- public Date getNextDateFP(Date d)
- {
- d = (Date)d.clone();
- d.setHours(0);
- return d;
- }
+public class CFS_Sample {
+ @SuppressWarnings("deprecation")
+ public Date getNextDate(Date d) {
+ d.setHours(0);
+ return d;
+ }
+
+ @SuppressWarnings("deprecation")
+ public Date getNextDateFP(Date d) {
+ d = (Date) d.clone();
+ d.setHours(0);
+ return d;
+ }
}
Modified: trunk/fb-contrib/samples/CHBH_HashcodeToHashcodeSample.java
===================================================================
--- trunk/fb-contrib/samples/CHBH_HashcodeToHashcodeSample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CHBH_HashcodeToHashcodeSample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -2,29 +2,28 @@
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class CHBH_HashcodeToHashcodeSample {
- public final String name;
- public final int age;
+ public final String name;
+ public final int age;
- CHBH_HashcodeToHashcodeSample(String name, int age) {
- this.name = name;
- this.age = age;
- }
+ CHBH_HashcodeToHashcodeSample(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(name).append(age).hashCode();
- }
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).append(age).hashCode();
+ }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CHBH_HashcodeToHashcodeSample other = (CHBH_HashcodeToHashcodeSample) obj;
- return new EqualsBuilder().append(this.name, other.name)
- .append(this.age, other.age).isEquals();
- }
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CHBH_HashcodeToHashcodeSample other = (CHBH_HashcodeToHashcodeSample) obj;
+ return new EqualsBuilder().append(this.name, other.name).append(this.age, other.age).isEquals();
+ }
}
Modified: trunk/fb-contrib/samples/CLI_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CLI_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CLI_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,44 +1,37 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
+@SuppressWarnings("all")
+public class CLI_Sample {
+ public String test1(String[] sa) {
+ String result = "";
+ for (String element : sa)
+ result += sa[0];
+ return result;
+ }
-@SuppressWarnings("all")
-public class CLI_Sample
-{
- public String test1(String[] sa)
- {
- String result = "";
- for (String element : sa)
- result += sa[0];
- return result;
- }
-
- public String test2(String[] sa)
- {
- String name = sa[0];
- String address = sa[1];
- String ss = sa[2];
- return name + address + ss;
- }
-
- public String testFPSplit(String s) {
- String[] parts = s.split(",");
- String a = parts[0];
- String b = parts[1];
- String c = parts[2];
- return c + b + a;
- }
-
- class FPHander implements InvocationHandler
- {
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- if (args[2] == null)
- {
+ public String test2(String[] sa) {
+ String name = sa[0];
+ String address = sa[1];
+ String ss = sa[2];
+ return name + address + ss;
+ }
+
+ public String testFPSplit(String s) {
+ String[] parts = s.split(",");
+ String a = parts[0];
+ String b = parts[1];
+ String c = parts[2];
+ return c + b + a;
+ }
+
+ class FPHander implements InvocationHandler {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ if (args[2] == null) {
return null;
}
-
+
return String.valueOf(args[0]) + String.valueOf(args[1]);
}
- }
+ }
}
Modified: trunk/fb-contrib/samples/CNC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CNC_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CNC_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -2,13 +2,12 @@
import java.util.Map;
import java.util.Set;
-
public class CNC_Sample {
Map<String, String> argList;
Set<Integer> targetMap;
List<Double> bernoulliSet;
-
+
public void testCNC(Map<String, String> argSet, Set<String> nameList, List<String> nameMap) {
-
+
}
}
Modified: trunk/fb-contrib/samples/COM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/COM_Sample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/COM_Sample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -1,85 +1,73 @@
import java.util.HashSet;
import java.util.Set;
-public class COM_Sample
-{
+public class COM_Sample {
- public void test1()
- {
- }
+ public void test1() {
+ }
- public String test2(int i)
- {
- return String.valueOf(i);
- }
+ public String test2(int i) {
+ return String.valueOf(i);
+ }
- public Set<String> test3(String a, String b, String c)
- {
- Set<String> ss = new HashSet<String>();
- ss.add(a);
- ss.add(b);
- ss.add(c);
- return ss;
- }
+ public Set<String> test3(String a, String b, String c) {
+ Set<String> ss = new HashSet<String>();
+ ss.add(a);
+ ss.add(b);
+ ss.add(c);
+ return ss;
+ }
- public static class Derived extends COM_Sample
- {
- @Override
- public void test1()
- {
- }
+ public static class Derived extends COM_Sample {
+ @Override
+ public void test1() {
+ }
- @Override
- public Set<String> test3(String a, String b, String c)
- {
- Set<String> ss = new HashSet<String>();
- ss.add(a);
- ss.add(b);
- ss.add(c);
- return ss;
- }
+ @Override
+ public Set<String> test3(String a, String b, String c) {
+ Set<String> ss = new HashSet<String>();
+ ss.add(a);
+ ss.add(b);
+ ss.add(c);
+ return ss;
+ }
- @Override
- public String test2(int i)
- {
- return String.valueOf(i);
- }
- }
+ @Override
+ public String test2(int i) {
+ return String.valueOf(i);
+ }
+ }
}
-interface Inf
-{
- void m1();
- void m2();
+interface Inf {
+ void m1();
+
+ void m2();
}
-abstract class c1 implements Inf
-{
- public void m1() {}
+abstract class c1 implements Inf {
+ public void m1() {
+ }
}
-abstract class c2 extends c1
-{
- public void m2() {}
+abstract class c2 extends c1 {
+ public void m2() {
+ }
}
-abstract class s1
-{
- public static final String FOO = "foo";
+abstract class s1 {
+ public static final String FOO = "foo";
- public String getFoo()
- {
- return FOO;
- }
+ public String getFoo() {
+ return FOO;
+ }
}
-abstract class s2 extends s1
-{
- public static final String FOO = "foo2";
+abstract class s2 extends s1 {
+ public static final String FOO = "foo2";
- @Override
- public String getFoo()
- {
- return FOO;
- }
+ @Override
+ public String getFoo() {
+ return FOO;
+ }
}
Modified: trunk/fb-contrib/samples/CSBTS_StringToStringSample.java
===================================================================
--- trunk/fb-contrib/samples/CSBTS_StringToStringSample.java 2014-01-15 20:53:03 UTC (rev 1764)
+++ trunk/fb-contrib/samples/CSBTS_StringToStringSample.java 2014-02-17 21:22:53 UTC (rev 1765)
@@ -18,8 +18,7 @@
// string representation for derived types
// return ToStringBuilder.reflectionToString(this);
// Use for final classes most efficient solution
- return new ToStringBuilder(this).append("name", name)
- .append("age", age).toString();
+ return new ToStringBuilder(this).append("name", name).append("age", age).toString();
}
}
@@ -46,11 +45,7 @@
...
[truncated message content] |