You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by db...@apache.org on 2013/10/15 08:21:06 UTC

svn commit: r1532205 - /commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java

Author: dbrosius
Date: Tue Oct 15 06:21:06 2013
New Revision: 1532205

URL: http://svn.apache.org/r1532205
Log:
only allocate the instructionhandle q once per MethodGen

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java?rev=1532205&r1=1532204&r2=1532205&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java Tue Oct 15 06:21:06 2013
@@ -413,6 +413,7 @@ public class Subroutines{
 		
 		Map<InstructionHandle, Integer> colors = new HashMap<InstructionHandle, Integer>(); //Graph colouring. Key: InstructionHandle, Value: Integer .
 		
+        List<InstructionHandle> Q = new ArrayList<InstructionHandle>();		
 		for (InstructionHandle actual : sub_leaders) {
 			// Do some BFS with "actual" as the root of the graph.
 			// Init colors
@@ -421,7 +422,8 @@ public class Subroutines{
 			}
 			colors.put(actual, GRAY);
 			// Init Queue
-			List<InstructionHandle> Q = new ArrayList<InstructionHandle>();
+
+			Q.clear();
 			Q.add(actual); // add(Obj) adds to the end, remove(0) removes from the start.
 			
 			/* BFS ALGORITHM MODIFICATION: Start out with multiple "root" nodes, as exception handlers are starting points of top-level code, too. [why top-level? TODO: Refer to the special JustIce notion of subroutines.]*/