summaryrefslogtreecommitdiff
path: root/odk/source/com/sun/star/lib/loader/Loader.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-20 17:05:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-08-20 19:04:33 +0100
commit8bfe47960f60e1dc2e6bcf0f3c3f7e43dfd3fc0b (patch)
tree12399f5232ff90f000bb58e213629140e564f0ce /odk/source/com/sun/star/lib/loader/Loader.java
parentf906ac27761332580b769f5f90d1f6bbd7f93701 (diff)
Java5 updates - convert to generics
Change-Id: I039e51958865a7ea000034e7bf765f64d49689cd
Diffstat (limited to 'odk/source/com/sun/star/lib/loader/Loader.java')
-rw-r--r--odk/source/com/sun/star/lib/loader/Loader.java18
1 files changed, 9 insertions, 9 deletions
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(