jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r231385 - /jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LocalVariableGen.java
Date Thu, 11 Aug 2005 03:36:39 GMT
Author: dbrosius
Date: Wed Aug 10 20:36:32 2005
New Revision: 231385

URL: http://svn.apache.org/viewcvs?rev=231385&view=rev
Log:
fix for 36110 - LocalVariableGen calls setStart and setEnd which add 'this' to a hashset.
The problem is that the hash is computed using start and end. since start wasn't computed
until after it is added, the add hash and remove hash will be different. Changed ctor to stuff
the start and end values before calling setStart and setEnd

Modified:
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LocalVariableGen.java

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LocalVariableGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LocalVariableGen.java?rev=231385&r1=231384&r2=231385&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LocalVariableGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LocalVariableGen.java Wed Aug 10 20:36:32
2005
@@ -58,6 +58,12 @@
     this.name  = name;
     this.type  = type;
     this.index  = index;
+    // setStart and setEnd add 'this' to a HashSet, causing the hash to compute.
+    // The hash uses start and end, so set them before calling setStart/setEnd.
+    // Otherwise, the remove will fail because the hash is different than the add.
+    // Icky, but should be ok. See Bug: 36110  -- dbrosius
+    this.start = start;
+    this.end = end;
     setStart(start);
     setEnd(end);
   }



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Mime
View raw message