Author: dbrosius Date: Tue Sep 27 20:52:39 2005 New Revision: 292117 URL: http://svn.apache.org/viewcvs?rev=292117&view=rev Log: don't rely on the Enumeration interface
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/structurals/Subroutines.java Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/structurals/Subroutines.java URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/structurals/Subroutines.java?rev=292117&r1=292116&r2=292117&view=diff ============================================================================== --- jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/structurals/Subroutines.java (original) +++ jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/structurals/Subroutines.java Tue Sep 27 20:52:39 2005 @@ -19,11 +19,11 @@ import java.awt.Color; import java.util.ArrayList; -import java.util.Enumeration; import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; + import org.apache.bcel.generic.ASTORE; import org.apache.bcel.generic.ATHROW; import org.apache.bcel.generic.BranchInstruction; @@ -466,9 +466,9 @@ for (int i=0; i<handlers.length; i++){ InstructionHandle _protected = handlers[i].getStartPC(); while (_protected != handlers[i].getEndPC().getNext()){// Note the inclusive/inclusive notation of "generic API" exception handlers! - Enumeration subs = subroutines.elements(); - while (subs.hasMoreElements()){ - Subroutine sub = (Subroutine) subs.nextElement(); + Iterator subs = subroutines.values().iterator(); + while (subs.hasNext()){ + Subroutine sub = (Subroutine) subs.next(); if (sub != subroutines.get(all[0])){ // We don't want to forbid top-level exception handlers. if (sub.contains(_protected)){ throw new StructuralCodeConstraintException("Subroutine instruction '"+_protected+"' is protected by an exception handler, '"+handlers[i]+"'. This is forbidden by the JustIce verifier due to its clear definition of subroutines."); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]