diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-20 17:05:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-20 19:04:33 +0100 |
commit | 8bfe47960f60e1dc2e6bcf0f3c3f7e43dfd3fc0b (patch) | |
tree | 12399f5232ff90f000bb58e213629140e564f0ce /odk/source | |
parent | f906ac27761332580b769f5f90d1f6bbd7f93701 (diff) |
Java5 updates - convert to generics
Change-Id: I039e51958865a7ea000034e7bf765f64d49689cd
Diffstat (limited to 'odk/source')
-rw-r--r-- | odk/source/com/sun/star/lib/loader/InstallationFinder.java | 6 | ||||
-rw-r--r-- | odk/source/com/sun/star/lib/loader/Loader.java | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/odk/source/com/sun/star/lib/loader/InstallationFinder.java b/odk/source/com/sun/star/lib/loader/InstallationFinder.java index 5110035728ec..6b2860f4d705 100644 --- a/odk/source/com/sun/star/lib/loader/InstallationFinder.java +++ b/odk/source/com/sun/star/lib/loader/InstallationFinder.java @@ -37,7 +37,7 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.util.StringTokenizer; -import java.util.Vector; +import java.util.ArrayList; /** * This class finds a UNO installation on the system. @@ -395,7 +395,7 @@ final class InstallationFinder { File fSVersion = new File( System.getProperty( "user.home" ) ,SVERSION ); if ( fSVersion.exists() ) { - Vector lines = new Vector(); + ArrayList<String> lines = new ArrayList<String>(); BufferedReader br = null; try { br = new BufferedReader( new InputStreamReader( @@ -427,7 +427,7 @@ final class InstallationFinder { } for ( int i = lines.size() - 1; i >= 0; i-- ) { StringTokenizer tokens = new StringTokenizer( - (String)lines.elementAt( i ), "=" ); + lines.get( i ), "=" ); if ( tokens.countTokens() != 2 ) continue; String key = tokens.nextToken(); diff --git a/odk/source/com/sun/star/lib/loader/Loader.java b/odk/source/com/sun/star/lib/loader/Loader.java index cc2242a9fe31..682f19dcb425 100644 --- a/odk/source/com/sun/star/lib/loader/Loader.java +++ b/odk/source/com/sun/star/lib/loader/Loader.java @@ -41,7 +41,7 @@ import java.util.Enumeration; import java.util.jar.Attributes; import java.util.jar.Manifest; import java.util.StringTokenizer; -import java.util.Vector; +import java.util.ArrayList; /** * This class can be used as a loader for application classes which use UNO. @@ -72,22 +72,22 @@ public final class Loader { String className = null; Class clazz = Loader.class; ClassLoader loader = clazz.getClassLoader(); - Vector res = new Vector(); + ArrayList<URL> res = new ArrayList<URL>(); try { - Enumeration en = loader.getResources( "META-INF/MANIFEST.MF" ); + Enumeration<URL> en = loader.getResources( "META-INF/MANIFEST.MF" ); while ( en.hasMoreElements() ) { - res.add( (URL) en.nextElement() ); + res.add( en.nextElement() ); } // the jarfile with the com/sun/star/lib/loader/Loader.class // per-entry attribute is most probably the last resource in the // list, therefore search backwards for ( int i = res.size() - 1; i >= 0; i-- ) { - URL jarurl = (URL) res.elementAt( i ); + URL jarurl = res.get( i ); try { JarURLConnection jarConnection = (JarURLConnection) jarurl.openConnection(); Manifest mf = jarConnection.getManifest(); - Attributes attrs = (Attributes) mf.getAttributes( + Attributes attrs = mf.getAttributes( "com/sun/star/lib/loader/Loader.class" ); if ( attrs != null ) { className = attrs.getValue( "Application-Class" ); @@ -154,7 +154,7 @@ public final class Loader { // get the urls from which to load classes and resources // from the class path - Vector vec = new Vector(); + ArrayList<URL> vec = new ArrayList<URL>(); String classpath = null; try { classpath = System.getProperty( "java.class.path" ); @@ -233,7 +233,7 @@ public final class Loader { return m_Loader; } - private static void addUrls(Vector urls, String data, String delimiter) { + private static void addUrls(ArrayList<URL> urls, String data, String delimiter) { StringTokenizer tokens = new StringTokenizer( data, delimiter ); while ( tokens.hasMoreTokens() ) { try { @@ -247,7 +247,7 @@ public final class Loader { } } - private static void callUnoinfo(String path, Vector urls) { + private static void callUnoinfo(String path, ArrayList<URL> urls) { Process p; try { p = Runtime.getRuntime().exec( |