From e527a340051b55a6f05d05f397d82ec797165163 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 May 2013 14:49:28 +0200 Subject: Java cleanup, convert more Vector to ArrayList Change-Id: Icb807382eaf50f515f2c9dfada0c061414baed33 --- scripting/examples/java/Newsgroup/SubscribedNewsgroups.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripting/examples/java') diff --git a/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java b/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java index f5140690c924..cba9d62f59dc 100644 --- a/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java +++ b/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java @@ -118,7 +118,7 @@ public class SubscribedNewsgroups { } //System.out.println("mailrc files found"); - ArrayList subscribed = new ArrayList(); + ArrayList subscribed = new ArrayList(); // Get the newsgroups in each mailrc file for( int i=0; i < allMailrcs.length; i++ ) { @@ -137,7 +137,7 @@ public class SubscribedNewsgroups { // Copy all unique Newsgroups into the global array allSubscribed = new NewsGroup[ subscribed.size() ]; - subscribed.copyInto( allSubscribed ); + subscribed.toArray( allSubscribed ); // Test that at least one subscribed newsgroup has been found if( allSubscribed.length < 1 ) { @@ -153,11 +153,11 @@ public class SubscribedNewsgroups { // Tests if the NewsGroup object has already been listed by another mailrc file - private static boolean listed( NewsGroup newsgroup, Vector uniqueSubscription ) + private static boolean listed( NewsGroup newsgroup, ArrayList uniqueSubscription ) { for(int i=0; i < uniqueSubscription.size(); i++) { - NewsGroup tempGroup = (NewsGroup) uniqueSubscription.elementAt(i); + NewsGroup tempGroup = uniqueSubscription.elementAt(i); // Test for duplication if(newsgroup.getHostName().equalsIgnoreCase( tempGroup.getHostName()) && newsgroup.getNewsgroupName().equalsIgnoreCase( tempGroup.getNewsgroupName() ) ) -- cgit v1.2.3