diff options
Diffstat (limited to 'tests/org.eclipse.compare.tests')
4 files changed, 13 insertions, 13 deletions
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java index bd41c5864..fa30c83bf 100644 --- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java +++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java @@ -133,7 +133,7 @@ public class PatchLinesTest extends TestCase { } private int getNewLength(IHunk hunk) { - Class cls = hunk.getClass(); + Class<?> cls = hunk.getClass(); try { Field fld = cls.getDeclaredField("fNewLength"); fld.setAccessible(true); @@ -152,7 +152,7 @@ public class PatchLinesTest extends TestCase { } private int getOldLength(IHunk hunk) { - Class cls = hunk.getClass(); + Class<?> cls = hunk.getClass(); try { Field fld = cls.getDeclaredField("fOldLength"); fld.setAccessible(true); diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java index c1d0c7564..d0c033f55 100644 --- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java +++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2017 IBM Corporation and others. + * Copyright (c) 2009, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ public class PatchUtils { fileName = old; } - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { return null; } @@ -92,7 +92,7 @@ public class PatchUtils { return true; } - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { return null; } } @@ -127,7 +127,7 @@ public class PatchUtils { return true; } - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { return null; } } diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java index 8d19b3415..87d5980b1 100644 --- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java +++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,12 +19,12 @@ public class ReflectionUtils { public static Object callMethod(Object object, String name, Object args[]) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { - Class types[] = new Class[args.length]; + Class<?> types[] = new Class[args.length]; for (int i = 0; i < args.length; i++) { types[i] = args[i].getClass(); } Method method = null; - Class clazz = object.getClass(); + Class<?> clazz = object.getClass(); NoSuchMethodException ex = null; while (method == null && clazz != null) { try { @@ -56,7 +56,7 @@ public class ReflectionUtils { public static Object getField(Object object, String name, boolean deep) throws IllegalArgumentException, IllegalAccessException, SecurityException, NoSuchFieldException { - Class clazz = object.getClass(); + Class<?> clazz = object.getClass(); NoSuchFieldException ex = null; while (clazz != null) { try { diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java index 5e8217b66..2531f5416 100644 --- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java +++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/WorkspaceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,14 +36,14 @@ public class WorkspaceTest extends ResourceTest { protected static IProgressMonitor DEFAULT_MONITOR = new NullProgressMonitor(); protected static final IProgressMonitor DEFAULT_PROGRESS_MONITOR = new NullProgressMonitor(); - public static Test suite(Class c) { + public static Test suite(Class<?> c) { String testName = System.getProperty("eclipse.team.testName"); if (testName == null) { TestSuite suite = new TestSuite(c); return suite; } try { - return (Test)c.getConstructor(new Class[] { String.class }).newInstance(new Object[] {testName}); + return (Test)c.getConstructor(String.class).newInstance(testName); } catch (Exception e) { fail(e.getMessage()); // Above will throw so below is never actually reached |