jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r292108 - /jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/PassVerifier.java
Date Wed, 28 Sep 2005 03:42:15 GMT
Author: dbrosius
Date: Tue Sep 27 20:42:08 2005
New Revision: 292108

URL: http://svn.apache.org/viewcvs?rev=292108&view=rev
Log:
don't convert lists to arrays manually, use toArray

Modified:
    jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/PassVerifier.java

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/PassVerifier.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/PassVerifier.java?rev=292108&r1=292107&r2=292108&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/PassVerifier.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/PassVerifier.java Tue Sep 27 20:42:08
2005
@@ -18,6 +18,7 @@
 
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A PassVerifier actually verifies a class file; it is instantiated
@@ -48,7 +49,7 @@
 public abstract class PassVerifier{
 
 	/** The (warning) messages. */
-	private ArrayList messages = new ArrayList(); //Type of elements: String
+	private List messages = new ArrayList(); //Type of elements: String
 	
 	/** The VerificationResult cache. */
 	private VerificationResult verificationResult = null;
@@ -97,10 +98,7 @@
 	 */
 	public String[] getMessages(){
 		verify(); // create messages if not already done (cached!)
-		String[] ret = new String[messages.size()];
-		for (int i=0; i<messages.size(); i++){
-			ret[i] = (String) messages.get(i);
-		}
-		return ret;
+		
+		return (String[]) messages.toArray(new String[messages.size()]);
 	}
 }



---------------------------------------------------------------------
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