summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-03 14:49:28 +0200
committerNoel Grandin <noel@peralex.com>2013-05-06 11:45:51 +0200
commite527a340051b55a6f05d05f397d82ec797165163 (patch)
tree21e81a60ed0402b0f4e33685917b184b5b1bb32b /scripting
parent587c59fbc931b12f4d63d077a78bcaa43ffbf83d (diff)
Java cleanup, convert more Vector to ArrayList
Change-Id: Icb807382eaf50f515f2c9dfada0c061414baed33
Diffstat (limited to 'scripting')
-rw-r--r--scripting/examples/java/Newsgroup/SubscribedNewsgroups.java8
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java8
2 files changed, 8 insertions, 8 deletions
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<NewsGroup> subscribed = new ArrayList<NewsGroup>();
// 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<NewsGroup> 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() ) )
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java
index fb0268024451..b8fe3e6226e4 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java
@@ -166,8 +166,8 @@ public class ParcelFolderSupport implements ParcelFolderCookie
File contents = FileUtil.toFile(
primary.getFileObject(ParcelZipper.CONTENTS_DIRNAME));
- Vector classpath = getConfigureClasspath();
- classpath.addElement(contents.getAbsolutePath());
+ ArrayList<String> classpath = getConfigureClasspath();
+ classpath.add(contents.getAbsolutePath());
try {
ParcelDescriptor descriptor = getParcelDescriptor();
@@ -210,8 +210,8 @@ public class ParcelFolderSupport implements ParcelFolderCookie
return true;
}
- private Vector getConfigureClasspath() {
- ArrayList result = new ArrayList();
+ private ArrayList<String> getConfigureClasspath() {
+ ArrayList<String> result = new ArrayList<String>();
String classpath = NbClassPath.createRepositoryPath().getClassPath();
if ( System.getProperty( "os.name" ).startsWith( "Windows" ) )