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/test/com | |
parent | 9def9b4674b9610004e915635578d26a48d98300 (diff) |
Java5 update - convert code to use generics
Change-Id: Iff078cea287d0c508d2442d65cd9314ec3231c15
Diffstat (limited to 'jurt/test/com')
5 files changed, 16 insertions, 18 deletions
diff --git a/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java b/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java index 4168bff89873..19ab5e358518 100644 --- a/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java +++ b/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java @@ -35,7 +35,7 @@ public final class BridgeFactory_Test { BridgeFactory bridgeFactory = new BridgeFactory(); // create the needed bridgeFactory // create a bridge - XBridge xBridge = bridgeFactory.createBridge("testbridge", "urp", (XConnection)leftSide, null); + XBridge xBridge = bridgeFactory.createBridge("testbridge", "urp", leftSide, null); // test that we get the same bridge assertTrue( @@ -44,7 +44,7 @@ public final class BridgeFactory_Test { // test that we can not create another bridge with same name try { - XBridge dummy = bridgeFactory.createBridge("testbridge", "urp", (XConnection)leftSide, null); + XBridge dummy = bridgeFactory.createBridge("testbridge", "urp", leftSide, null); fail(); } @@ -71,7 +71,7 @@ public final class BridgeFactory_Test { // test that we really get a new bridge - XBridge xBridge_new = bridgeFactory.createBridge("testbridge", "urp", (XConnection)leftSide, null); + XBridge xBridge_new = bridgeFactory.createBridge("testbridge", "urp", leftSide, null); assertFalse(UnoRuntime.areSame(xBridge, xBridge_new)); for(int i = 0; i <10000; ++ i) { diff --git a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory_Test.java b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory_Test.java index 9fcb929c56fc..d8134efbd69f 100644 --- a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory_Test.java +++ b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory_Test.java @@ -65,7 +65,7 @@ public final class ProxyFactory_Test { } private void testExceptions(TestRequestHandler handler, Method method, - Object obj, Object[] args, Class[] exceptions) + Object obj, Object[] args, Class<?>[] exceptions) throws Exception { for (int i = 0; i < exceptions.length; ++i) { @@ -75,7 +75,7 @@ public final class ProxyFactory_Test { } private void testExceptionType(Method method, Object obj, Object[] args, - Class exception) throws Exception { + Class<?> exception) throws Exception { try { method.invoke(obj, args); assertNull(exception); diff --git a/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java b/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java index c7b90f3c8d37..87af592acff5 100644 --- a/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java +++ b/jurt/test/com/sun/star/lib/uno/environments/remote/JobQueue_Test.java @@ -146,9 +146,8 @@ public final class JobQueue_Test { jobQueue.putJob(new Job(workAt, __iReceiver, new Message( null, true, "oid", __workAt_td, - ((MethodDescription) - __workAt_td.getMethodDescription( - "notifyme")), + __workAt_td.getMethodDescription( + "notifyme"), true, null, false, null, null)), null); while (!workAt._notified) { @@ -171,8 +170,7 @@ public final class JobQueue_Test { new Job(workAt, __iReceiver, new Message( null, true, "oid", __workAt_td, - ((MethodDescription) - __workAt_td.getMethodDescription("notifyme")), + __workAt_td.getMethodDescription("notifyme"), true, null, false, null, null)), null); while (!workAt._notified) { @@ -186,7 +184,7 @@ public final class JobQueue_Test { JobQueue jobQueue) { Message iMessage = new Message( null, true, "oid", __workAt_td, - (MethodDescription) __workAt_td.getMethodDescription(operation), + __workAt_td.getMethodDescription(operation), true, null, false, null, null); for (int i = 0; i < TestWorkAt.MESSAGES; ++ i) { Thread.yield(); // force scheduling diff --git a/jurt/test/com/sun/star/uno/AnyConverter_Test.java b/jurt/test/com/sun/star/uno/AnyConverter_Test.java index 11ea0dd2752b..b4330e4d4932 100644 --- a/jurt/test/com/sun/star/uno/AnyConverter_Test.java +++ b/jurt/test/com/sun/star/uno/AnyConverter_Test.java @@ -614,7 +614,7 @@ public final class AnyConverter_Test { String val= AnyConverter.toString(aStr); assertEquals(val, aStr); val= AnyConverter.toString(anyStr); - assertEquals(val, ((String)anyStr.getObject())); + assertEquals(val, anyStr.getObject()); // must fail try { AnyConverter.toString(aBool); fail(); diff --git a/jurt/test/com/sun/star/uno/WeakReference_Test.java b/jurt/test/com/sun/star/uno/WeakReference_Test.java index c5ce1f4ee6e0..6d076ea60bc6 100644 --- a/jurt/test/com/sun/star/uno/WeakReference_Test.java +++ b/jurt/test/com/sun/star/uno/WeakReference_Test.java @@ -49,7 +49,7 @@ public final class WeakReference_Test { private static final class Adapter implements XAdapter { public Adapter(Object obj) { - ref = new java.lang.ref.WeakReference(obj); + ref = new java.lang.ref.WeakReference<Object>(obj); } public Object queryAdapted() { @@ -73,16 +73,16 @@ public final class WeakReference_Test { } public void dispose() { - ArrayList l; + ArrayList<XReference> l; synchronized (this){ l = listeners; listeners = null; } if (l != null) { java.lang.RuntimeException ex = null; - for (Iterator i = l.iterator(); i.hasNext();) { + for (Iterator<XReference> i = l.iterator(); i.hasNext();) { try { - ((XReference) i.next()).dispose(); + i.next().dispose(); } catch (java.lang.RuntimeException e) { ex = e; } @@ -93,8 +93,8 @@ public final class WeakReference_Test { } } - private final java.lang.ref.WeakReference ref; - private ArrayList listeners = new ArrayList(); + private final java.lang.ref.WeakReference<Object> ref; + private ArrayList<XReference> listeners = new ArrayList<XReference>(); } private final Adapter adapter = new Adapter(this); |