[Fb-contrib-commit] SF.net SVN: fb-contrib:[1841] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2018-07-21 17:43:54
|
Revision: 1841 http://sourceforge.net/p/fb-contrib/code/1841 Author: dbrosius Date: 2018-07-21 17:43:49 +0000 (Sat, 21 Jul 2018) Log Message: ----------- sync from github Modified Paths: -------------- trunk/fb-contrib/build.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/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AnnotationIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java trunk/fb-contrib/src/samples/java/ex/AI_Sample.java trunk/fb-contrib/src/samples/java/ex/PRMC_Sample.java Added Paths: ----------- trunk/fb-contrib/yank.csv Removed Paths: ------------- trunk/fb-contrib/yank.xls Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/build.xml 2018-07-21 17:43:49 UTC (rev 1841) @@ -31,7 +31,7 @@ <property name="javac.debug" value="on" /> <property name="test_reports.dir" value="${target.dir}/reports/test"/> - <property name="fb-contrib.version" value="7.4.2" /> + <property name="fb-contrib.version" value="7.4.3" /> <property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" /> @@ -42,7 +42,7 @@ <target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib"> <mkdir dir="${user.home}/.ant/lib" /> - <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/2.0.0/yank-2.0.0.jar" dest="${user.home}/.ant/lib"/> + <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/2.0.1/yank-2.0.1.jar" dest="${user.home}/.ant/lib"/> <get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/> <get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/> <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.6.0/fb-delta-0.6.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/> @@ -151,7 +151,7 @@ </path> </target> - <target name="validate_xml" depends="-init" description="validates the xml files"> + <target name="validate_xml" depends="-init" unless="skip-validate" description="validates the xml files"> <taskdef name="bug-rank-check-style" classname="text.style.check.BugRankCheckStyleTask"/> <xmlvalidate lenient="false" failonerror="yes"> <attribute name="http://apache.org/xml/features/validation/schema" value="true" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/etc/messages.xml 2018-07-21 17:43:49 UTC (rev 1841) @@ -6190,6 +6190,9 @@ produces a far simpler instance of List. Since both of these arrays are immutable (from the List's point of view) they are equivalent from a usage standpoint. </p> + <p>There is one difference between Array.asList and Collections.singletonList that you should be mindful of. The rarely used set(index, value) method is + allowed to be used with a List created by Array.asList, but not with Collections.singletonList. So if you do use the set(index, value) method + continue using Arrays.asList. ]]> </Details> </BugPattern> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/htdocs/index.shtml 2018-07-21 17:43:49 UTC (rev 1841) @@ -68,7 +68,7 @@ </li> </ul> </p> - <p style="font-weight: bold;">The latest version of fb-contrib is 7.4.2 available for download + <p style="font-weight: bold;">The latest version of fb-contrib is 7.4.3 available for download <a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p> <p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p> <p style="font-weight: bold;">Please note that active development for this project is now done on Modified: trunk/fb-contrib/htdocs/repository.html =================================================================== --- trunk/fb-contrib/htdocs/repository.html 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/htdocs/repository.html 2018-07-21 17:43:49 UTC (rev 1841) @@ -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>7.4.2 or 7.4.2.sb</td></tr> + <tr><td><b>Version:</b></td><td>7.4.3 or 7.4.3.sb</td></tr> </table> </div> Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/pom.xml 2018-07-21 17:43:49 UTC (rev 1841) @@ -6,7 +6,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>7.4.2</version> + <version>7.4.3</version> <!-- TODO: Delete this and replace with enforcer plugin. This is for maven plugins only! Latest maven will through warnings. --> <prerequisites> @@ -90,6 +90,9 @@ <contributor> <name>David Burström</name> </contributor> + <contributor> + <name>Venkata Gajavalli</name> + </contributor> </contributors> <licenses> Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -138,7 +138,8 @@ String clsName = getClassName(); Method method = getMethod(); int accessFlags = method.getAccessFlags(); - MethodInfo mi = Statistics.getStatistics().addMethodStatistics(clsName, getMethodName(), getMethodSig(), accessFlags, obj.getLength(), numMethodCalls); + MethodInfo mi = Statistics.getStatistics().addMethodStatistics(clsName, getMethodName(), getMethodSig(), accessFlags, code.length, + numMethodCalls); if ((clsName.indexOf(Values.INNER_CLASS_SEPARATOR) >= 0) || ((accessFlags & (ACC_ABSTRACT | ACC_INTERFACE | ACC_ANNOTATION)) != 0)) { mi.addCallingAccess(Constants.ACC_PUBLIC); } else if ((accessFlags & Constants.ACC_PRIVATE) == 0) { Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -18,11 +18,11 @@ */ package com.mebigfatguy.fbcontrib.collect; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import com.mebigfatguy.fbcontrib.utils.FQMethod; import com.mebigfatguy.fbcontrib.utils.ToString; @@ -38,7 +38,7 @@ private static Statistics statistics = new Statistics(); private static final MethodInfo NOT_FOUND_METHOD_INFO = new MethodInfo(); - private final Map<FQMethod, MethodInfo> methodStatistics = new HashMap<>(); + private final Map<FQMethod, MethodInfo> methodStatistics = new ConcurrentHashMap<>(); private final Set<String> autowiredBeans = new HashSet<>(); Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AnnotationIssues.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AnnotationIssues.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AnnotationIssues.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -79,7 +79,7 @@ NULLABLE_ANNOTATIONS.add("Lcom/sun/istack/Nullable;"); NULLABLE_ANNOTATIONS.add("Ledu/umd/cs/findbugs/annotations/Nullable;"); NULLABLE_ANNOTATIONS.add("Lorg/springframework/lang/Nullable;"); - NULLABLE_ANNOTATIONS.add("Landroid/support/annotations/Nullable"); + NULLABLE_ANNOTATIONS.add("Landroid/support/annotation/Nullable"); String userAnnotations = System.getProperty(USER_NULLABLE_ANNOTATIONS); if ((userAnnotations != null) && !userAnnotations.isEmpty()) { Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -64,6 +64,8 @@ public static final String PRMC_HIGH_METHODCALLS = "fbcontrib.PRMC.highmethodcalls"; public static final String PRMC_NORMAL_BYTECOUNT = "fbcontrib.PRMC.normalbytecount"; public static final String PRMC_NORMAL_METHODCALLS = "fbcontrib.PRMC.normalmethodcalls"; + public static final String PRMC_LOW_BYTECOUNT = "fbcontrib.PRMC.lowbytecount"; + public static final String PRMC_LOW_METHODCALLS = "fbcontrib.PRMC.lowmethodcalls"; /** * a collection of names that are to be checked against a currently parsed method, to see if that method is risky to be called redundant. The contents are @@ -76,8 +78,10 @@ private static Set<String> riskyMethodNameContents = new HashSet<>(); private static int highByteCountLimit = 200; private static int highMethodCallLimit = 10; - private static int normalByteCountLimit = 50; + private static int normalByteCountLimit = 75; private static int normalMethodCallLimit = 4; + private static int lowByteCountLimit = 10; + private static int lowMethodCallLimit = 1; static { riskyMethodNameContents.add("next"); @@ -130,6 +134,14 @@ if (prop != null) { normalMethodCallLimit = prop.intValue(); } + prop = Integer.getInteger(PRMC_LOW_BYTECOUNT); + if (prop != null) { + lowByteCountLimit = prop.intValue(); + } + prop = Integer.getInteger(PRMC_LOW_METHODCALLS); + if (prop != null) { + lowMethodCallLimit = prop.intValue(); + } } private static Set<String> riskyClassNames = new HashSet<>(); @@ -372,8 +384,7 @@ if (mc != null) { if (!signature.endsWith(Values.SIG_VOID) && methodName.equals(mc.getName()) && signature.equals(mc.getSignature()) - && !isRiskyName(className, methodName) - && !commonMethods.contains(new FQMethod(getClassConstantOperand(), methodName, signature))) { + && !isRiskyName(className, methodName) && !commonMethods.contains(new FQMethod(className, methodName, signature))) { Object[] parms = mc.getParms(); if (Arrays.equals(parms, parmConstants)) { int ln = getLineNumber(pc); @@ -380,7 +391,7 @@ if ((ln != mc.getLineNumber()) || (Math.abs(pc - mc.getPC()) < 10)) { Statistics statistics = Statistics.getStatistics(); - MethodInfo mi = statistics.getMethodStatistics(getClassConstantOperand(), methodName, signature); + MethodInfo mi = statistics.getMethodStatistics(className, methodName, signature); bugReporter.reportBug( new BugInstance(this, BugType.PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS.name(), getBugPriority(methodName, mi)) @@ -461,7 +472,7 @@ return NORMAL_PRIORITY; } - if ((mi.getNumBytes() == 0) || (mi.getNumMethodCalls() == 0)) { + if ((mi.getNumBytes() >= lowByteCountLimit) || (mi.getNumMethodCalls() >= lowMethodCallLimit)) { return LOW_PRIORITY; } Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -37,7 +37,7 @@ private static final QMethod SETACCESSIBLE = new QMethod("setAccessible", SignatureBuilder.SIG_BOOLEAN_TO_VOID); private static final FQMethod SETACCESSIBLE_ARRAY = new FQMethod("java/lang/reflect/AccessibleObject", "setAccessible", - new SignatureBuilder().withParamTypes(AccessibleObject.class).build()); + new SignatureBuilder().withParamTypes(AccessibleObject[].class, boolean.class).build()); private static final JavaClass ACCESSIBLE_OBJECT_CLASS; static { Modified: trunk/fb-contrib/src/samples/java/ex/AI_Sample.java =================================================================== --- trunk/fb-contrib/src/samples/java/ex/AI_Sample.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/samples/java/ex/AI_Sample.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -97,6 +97,23 @@ return ss; } + public String fpGetProperty296(final String key, final String defaultValue) { + String strResult = getProperty(key); + if (strResult != null) { + return strResult; + } else { + putDefault(key, defaultValue); + return defaultValue; + } + } + + public String getProperty(final String key) { + return Math.random() > 0.5 ? null : ""; + } + + private void putDefault(String key, String value) { + } + interface Stringer { String get(); } Modified: trunk/fb-contrib/src/samples/java/ex/PRMC_Sample.java =================================================================== --- trunk/fb-contrib/src/samples/java/ex/PRMC_Sample.java 2018-06-01 00:39:50 UTC (rev 1840) +++ trunk/fb-contrib/src/samples/java/ex/PRMC_Sample.java 2018-07-21 17:43:49 UTC (rev 1841) @@ -106,6 +106,15 @@ List p = Collections.emptyList(); } + public void fpSimpleGetter() { + getData(); + getData(); + } + + public String getData() { + return data; + } + enum FPEnum { fee, fi, fo, fum }; Added: trunk/fb-contrib/yank.csv =================================================================== --- trunk/fb-contrib/yank.csv (rev 0) +++ trunk/fb-contrib/yank.csv 2018-07-21 17:43:49 UTC (rev 1841) @@ -0,0 +1,73 @@ +"GroupId","ArtifactId","Version","Digest" +,,, +"com.google.code.findbugs","findbugs","3.0.1","7ae69957c437fd71628d3904572170cf80c01551" +,"bcel-findbugs","6.0","7a7563ba41dceff3da4af4927b7c09908bd5132c" +,"findbugs-annotations","3.0.1","0bf2342edabc0fc37fc0b1de0b03f071bef935c3" +,"findbugs-ant","3.0.0","56f704b2769296de1b86102caefb6e8bd8b979af" +,"jsr305","3.0.2","25ea2e8b0c338a877313bd4672d3fe056ea78f0d" +,,, +"jaxen","jaxen","1.1.6","3f8c36d9a0578e8e98f030c662b69888b1430ac0" +,,, +"dom4j","dom4j","1.6.1","5d3ccc056b6f056dbf0dddfdf43894b9065a8f94" +,,, +"org.ow2.asm","asm-debug-all","5.0.2","5742eaa4eb2f0583b642eb2a2a7597c996139103" +,,, +"org.testng","testng","6.9.10","6feb3e964aeb7097aff30c372aac3ec0f8d87ede" +,,, +"com.beust","jcommander","1.48","bfcb96281ea3b59d626704f74bc6d625ff51cbce" +,,, +"org.beanshell","bsh","2.0b4","a05f0a0feefa8d8467ac80e16e7de071489f0d9c" +,,, +"com.google.inject","guice","4.1.0","eeb69005da379a10071aa4948c48d89250febb07" +,,, +"----- Jars for Samples ----",,, +,,, +"org.apache.commons","commons-lang3","3.4","5fe28b9518e58819180a43a850fbc0dd24b7c050" +,,, +"javax.servlet.jsp","javax.servlet.jsp-api","2.3.1","95c630902565feda8155eb32d46064ef348435fc" +,,, +"junit","junit","4.12","2973d150c0dc1fefe998f834810d68f278ea58ec" +,,, +"log4j","log4j","1.2.17","5af35056b4d257e4b64b9e8069c0746e8b08629f" +,,, +"org.apache.logging.log4j","log4j-api","2.9.1","7a2999229464e7a324aa503c0a52ec0f05efe7bd" +,,, +"javax.servlet","javax.servlet-api","3.1.0","3cd63d075497751784b2fa84be59432f4905bf7c" +,,, +"backport-util-concurrent","backport-util-concurrent","3.1","682f7ac17fed79e92f8e87d8455192b63376347b" +,,, +"org.threeten","threetenbp","1.3.2","6ef0f1feae9c5b5cce4b3478e8f1541d1c86ec2a" +,,, +"commons-collections","commons-collections","3.2.2","8ad72fe39fa8c91eaaf12aadb21e0c3661fe26d5" +,,, +"org.slf4j","slf4j-api","1.7.21","139535a69a4239db087de9bab0bee568bf8e0b70" +,,, +"com.google.guava","guava","19.0","6ce200f6b23222af3d8abb6b6459e6c44f4bb0e9" +,,, +"org.apache.httpcomponents","httpclient","4.5.2","733db77aa8d9b2d68015189df76ab06304406e50" +,"httpcore","4.4.5","e7501a1b34325abb00d17dde96150604a0658b54" +,"httpclient-cache","4.5.2","bd50ea83908dbf2f387a333216e66d2f0c5079bd" +,,, +"commons-codec","commons-codec","1.10","4b95f4897fa13f2cd904aee711aeafc0c5295cd8" +,,, +"javax.ws.rs","javax.ws.rs-api","2.0.1","104e9c2b5583cfcfeac0402316221648d6d8ea6b" +,,, +"org.glassfish.jersey.media","jersey-media-multipart","2.25.1","1d2db0078ee1b740c4e7ec7413d328a8a7e1c480" +,,, +"org.springframework","spring-tx","4.3.3.RELEASE","15fe147d2725b9b85bfe79817dc10b4246d0364d" +,"spring-beans",,"8e446175b4c8f9bf42abfa11e8194cb729171675" +,"spring-context",,"cfcd94c9b28d71e81bdfc058fd386c1aa4a61aea" +,,, +"org.eclipse.persistence","javax.persistence","2.1.1","4954fdf995d5083a1bdbf171ea3b240b88c85bac" +,,, +"commons-io","commons-io","2.4","b1b6ea3b7e4aa4f492509a4952029cd8e48019ad" +,,, +"org.mockito","mockito-core","2.8.47","48840cfced22ec0c07203a0201c5ae7bc12557b5" +,,, +"net.bytebuddy","byte-buddy","1.6.14","871c3e49dc6183d0d361601c2f1d11abb1a6b48c" +,,, +"org.objenesis","objenesis","2.5","612ecb799912ccf77cba9b3ed8c813da086076e9" +,,, +"org.hamcrest","hamcrest-core","1.3","42a25dc3219429f0e5d060061f71acb49bf010a0" +,,, +"org.apache.jena","jena-shaded-guava","3.1.0","6e2400a81e3d6d50a894daa07db0501fc900c659" Property changes on: trunk/fb-contrib/yank.csv ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Deleted: trunk/fb-contrib/yank.xls =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |