diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-28 11:27:57 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:03 +0200 |
commit | 7af400558072e2f328f078e39a121a95bb928804 (patch) | |
tree | 464515102ce5d6cad3b5a304e77737532d206e83 /jurt/com/sun/star/lib/uno/environments | |
parent | 9def9b4674b9610004e915635578d26a48d98300 (diff) |
Java5 update - convert code to use generics
Change-Id: Iff078cea287d0c508d2442d65cd9314ec3231c15
Diffstat (limited to 'jurt/com/sun/star/lib/uno/environments')
3 files changed, 9 insertions, 9 deletions
diff --git a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java index 427f24d7d36a..1fdfdf9e3d9b 100644 --- a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java +++ b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java @@ -263,7 +263,7 @@ public final class java_environment implements IEnvironment { private static final class Level2Entry extends WeakReference<Object> { public Level2Entry( - String oid, Type type, Object object, ReferenceQueue queue) + String oid, Type type, Object object, ReferenceQueue<Object> queue) { super(object, queue); this.oid = oid; @@ -288,7 +288,7 @@ public final class java_environment implements IEnvironment { private final HashMap<String, Level1Entry> level1map = new HashMap<String, Level1Entry>(); - private final ReferenceQueue queue = new ReferenceQueue(); + private final ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); } private boolean isProxy(Object object) { diff --git a/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPoolFactory.java b/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPoolFactory.java index 6e9ea465b7fb..9d5fc2c6334b 100644 --- a/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPoolFactory.java +++ b/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPoolFactory.java @@ -43,7 +43,7 @@ final class JavaThreadPoolFactory { public JobQueue getJobQueue(ThreadId threadId) { synchronized (jobQueues) { - return (JobQueue) jobQueues.get(threadId); + return jobQueues.get(threadId); } } @@ -55,8 +55,8 @@ final class JavaThreadPoolFactory { public void dispose(Object disposeId, Throwable throwable) { JobQueue[] qs; synchronized (jobQueues) { - Collection c = jobQueues.values(); - qs = (JobQueue[]) c.toArray(new JobQueue[c.size()]); + Collection<JobQueue> c = jobQueues.values(); + qs = c.toArray(new JobQueue[c.size()]); } for (int i = 0; i < qs.length; ++i) { qs[i].dispose(disposeId, throwable); @@ -70,7 +70,7 @@ final class JavaThreadPoolFactory { } else { ThreadId id; synchronized (threadIdMap) { - id = (ThreadId) threadIdMap.get(t); + id = threadIdMap.get(t); if (id == null) { id = ThreadId.createFresh(); threadIdMap.put(t, id); @@ -80,6 +80,6 @@ final class JavaThreadPoolFactory { } } - private static final WeakHashMap threadIdMap = new WeakHashMap(); - private final HashMap jobQueues = new HashMap(); + private static final WeakHashMap<Thread, ThreadId> threadIdMap = new WeakHashMap<Thread, ThreadId>(); + private final HashMap<ThreadId, JobQueue> jobQueues = new HashMap<ThreadId, JobQueue>(); } diff --git a/jurt/com/sun/star/lib/uno/environments/remote/Job.java b/jurt/com/sun/star/lib/uno/environments/remote/Job.java index df1f49d7d525..cc8d142ed68f 100644 --- a/jurt/com/sun/star/lib/uno/environments/remote/Job.java +++ b/jurt/com/sun/star/lib/uno/environments/remote/Job.java @@ -67,7 +67,7 @@ public class Job { * @param o_out_sig the out signature as an out parameter */ protected Object dispatch_queryInterface(Type type) { - Class zInterface = type.getTypeDescription().getZClass(); + Class<?> zInterface = type.getTypeDescription().getZClass(); Object result = null; |