[Fb-contrib-commit] SF.net SVN: fb-contrib:[1469] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/d
Brought to you by:
dbrosius
|
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.
|