[Fb-contrib-commit] SF.net SVN: fb-contrib: [440] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/uti
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2006-04-11 14:34:40
|
Revision: 440 Author: dbrosius Date: 2006-04-11 07:34:15 -0700 (Tue, 11 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=440&view=rev Log Message: ----------- ClassContext.getBytecodeSet seems to have settled down. Go back to directly calling it. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java 2006-04-11 14:34:15 UTC (rev 440) @@ -28,7 +28,6 @@ import org.apache.bcel.generic.Type; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; -import com.mebigfatguy.fbcontrib.utils.VersionTransition; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; @@ -83,7 +82,7 @@ * @return if the class uses synchronization */ public boolean prescreen(Method method) { - BitSet bytecodeSet = VersionTransition.getBytecodeSet(getClassContext(), method); + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.NEWARRAY) || bytecodeSet.get(Constants.ANEWARRAY)); } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2006-04-11 14:34:15 UTC (rev 440) @@ -30,7 +30,6 @@ import org.apache.bcel.generic.Type; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; -import com.mebigfatguy.fbcontrib.utils.VersionTransition; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; @@ -83,7 +82,7 @@ * @return if the class uses synchronization */ public boolean prescreen(Method method) { - BitSet bytecodeSet = VersionTransition.getBytecodeSet(getClassContext(), method); + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.MONITORENTER)); } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2006-04-11 14:34:15 UTC (rev 440) @@ -38,8 +38,6 @@ import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle; -import com.mebigfatguy.fbcontrib.utils.VersionTransition; - import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; @@ -152,7 +150,7 @@ * @return if the class uses synchronization */ public boolean prescreen(Method method) { - BitSet bytecodeSet = VersionTransition.getBytecodeSet(getClassContext(), method); + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.PUTFIELD) || bytecodeSet.get(Constants.GETFIELD)); } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java 2006-04-11 14:34:15 UTC (rev 440) @@ -27,8 +27,6 @@ import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.Method; -import com.mebigfatguy.fbcontrib.utils.VersionTransition; - import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; @@ -88,7 +86,7 @@ * @return if the class uses synchronization */ public boolean prescreen(Method method) { - BitSet bytecodeSet = VersionTransition.getBytecodeSet(getClassContext(), method); + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.GOTO) || bytecodeSet.get(Constants.GOTO_W)); } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java 2006-04-11 14:34:15 UTC (rev 440) @@ -10,7 +10,6 @@ import org.apache.bcel.generic.Type; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; -import com.mebigfatguy.fbcontrib.utils.VersionTransition; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; @@ -57,7 +56,7 @@ * @return if the class uses synchronization */ public boolean prescreen(Method method) { - BitSet bytecodeSet = VersionTransition.getBytecodeSet(getClassContext(), method); + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return bytecodeSet != null && (bytecodeSet.get(Constants.MONITORENTER)); } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java 2006-04-11 14:34:15 UTC (rev 440) @@ -30,8 +30,6 @@ import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; -import com.mebigfatguy.fbcontrib.utils.VersionTransition; - import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; @@ -72,7 +70,7 @@ * @return if the class uses synchronization */ public boolean prescreen(Method method) { - BitSet bytecodeSet = VersionTransition.getBytecodeSet(getClassContext(), method); + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.INVOKESTATIC)); } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java 2006-04-11 14:34:15 UTC (rev 440) @@ -109,7 +109,6 @@ */ @Override public void sawOpcode(int seen) { - int loadReg; switch (state) { case SEEN_NOTHING: if (lookForStore(seen)) Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java 2006-04-11 14:28:33 UTC (rev 439) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java 2006-04-11 14:34:15 UTC (rev 440) @@ -12,25 +12,4 @@ */ public class VersionTransition { - private static java.lang.reflect.Method gbs; - - /** - * manages the change to ClassContext getBytecodeSet from member to static method - * - * @param classContext the context object for the current class - * @param m the method to get the bytecode set for - * @return the byte code set - */ - - public static BitSet getBytecodeSet(ClassContext classContext, Method m) { - try { - if (gbs == null) - gbs = ClassContext.class.getMethod("getBytecodeSet", new Class[] { Method.class }); - return (BitSet)gbs.invoke(classContext, new Object[] { m }); - } catch (Exception e) { - BitSet byteCodeSet = new BitSet(256); - byteCodeSet.set(0, 255, true); - return byteCodeSet; - } - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |