summaryrefslogtreecommitdiff
path: root/jurt/com/sun/star/lib/uno/protocols/urp
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-28 11:27:57 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:03 +0200
commit7af400558072e2f328f078e39a121a95bb928804 (patch)
tree464515102ce5d6cad3b5a304e77737532d206e83 /jurt/com/sun/star/lib/uno/protocols/urp
parent9def9b4674b9610004e915635578d26a48d98300 (diff)
Java5 update - convert code to use generics
Change-Id: Iff078cea287d0c508d2442d65cd9314ec3231c15
Diffstat (limited to 'jurt/com/sun/star/lib/uno/protocols/urp')
-rw-r--r--jurt/com/sun/star/lib/uno/protocols/urp/Cache.java4
-rw-r--r--jurt/com/sun/star/lib/uno/protocols/urp/PendingRequests.java10
-rw-r--r--jurt/com/sun/star/lib/uno/protocols/urp/urp.java4
3 files changed, 9 insertions, 9 deletions
diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/Cache.java b/jurt/com/sun/star/lib/uno/protocols/urp/Cache.java
index 5a2670e50b7f..14affb5bd974 100644
--- a/jurt/com/sun/star/lib/uno/protocols/urp/Cache.java
+++ b/jurt/com/sun/star/lib/uno/protocols/urp/Cache.java
@@ -38,7 +38,7 @@ final class Cache {
}
public int add(boolean[] found, Object content) {
- Entry e = (Entry) map.get(content);
+ Entry e = map.get(content);
found[0] = e != null;
if (e == null) {
if (map.size() < maxSize) {
@@ -105,7 +105,7 @@ final class Cache {
// map contains the same entries; each entry has a unique index in the range
// 0 to maxSize - 1
private final int maxSize;
- private final HashMap map = new HashMap(); // from Object to Entry
+ private final HashMap<Object, Entry> map = new HashMap<Object, Entry>(); // from Object to Entry
private Entry first = null;
private Entry last = null;
}
diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/PendingRequests.java b/jurt/com/sun/star/lib/uno/protocols/urp/PendingRequests.java
index 72a72dab3815..18005bd817c7 100644
--- a/jurt/com/sun/star/lib/uno/protocols/urp/PendingRequests.java
+++ b/jurt/com/sun/star/lib/uno/protocols/urp/PendingRequests.java
@@ -27,17 +27,17 @@ final class PendingRequests {
public PendingRequests() {}
public synchronized void push(ThreadId tid, Item item) {
- Stack s = (Stack) map.get(tid);
+ Stack<Item> s = map.get(tid);
if (s == null) {
- s = new Stack();
+ s = new Stack<Item>();
map.put(tid, s);
}
s.push(item);
}
public synchronized Item pop(ThreadId tid) {
- Stack s = (Stack) map.get(tid);
- Item i = (Item) s.pop();
+ Stack<Item> s = map.get(tid);
+ Item i = s.pop();
if (s.empty()) {
map.remove(tid);
}
@@ -58,5 +58,5 @@ final class PendingRequests {
public final Object[] arguments;
}
- private final HashMap map = new HashMap(); // from ThreadId to Stack of Item
+ private final HashMap<ThreadId, Stack<Item>> map = new HashMap<ThreadId, Stack<Item>>(); // from ThreadId to Stack of Item
}
diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
index c9af603478fd..aac00536db92 100644
--- a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
+++ b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
@@ -602,7 +602,7 @@ public final class urp implements IProtocol {
private void writeQueuedReleases() throws IOException {
for (int i = releaseQueue.size(); i > 0;) {
--i;
- QueuedRelease r = (QueuedRelease) releaseQueue.get(i);
+ QueuedRelease r = releaseQueue.get(i);
writeRequest(
r.internal, r.objectId, r.type, r.method, r.threadId, null,
false);
@@ -733,5 +733,5 @@ public final class urp implements IProtocol {
private String outL1Oid = null;
private ITypeDescription outL1Type = null;
- private final ArrayList releaseQueue = new ArrayList(); // of QueuedRelease
+ private final ArrayList<QueuedRelease> releaseQueue = new ArrayList<QueuedRelease>(); // of QueuedRelease
}