diff options
author | Alexander Kurtakov | 2018-02-07 19:21:32 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-02-07 19:21:32 +0000 |
commit | 2df4e713c2e9b6cf0a6f554c2f44797cb33e566c (patch) | |
tree | 1010db1e4ac5b606eccfc1e76a53f10b4ae1c489 /tests | |
parent | f9959fe40ae5943210c66dc0d0fd0aad14f2766f (diff) | |
download | eclipse.platform.team-2df4e713c2e9b6cf0a6f554c2f44797cb33e566c.tar.gz eclipse.platform.team-2df4e713c2e9b6cf0a6f554c2f44797cb33e566c.tar.xz eclipse.platform.team-2df4e713c2e9b6cf0a6f554c2f44797cb33e566c.zip |
Bug 530860 - Generify Class related APIsS4_8_0_M6I20180308-0630I20180307-2000I20180307-1025I20180307-0900I20180307-0825I20180307-0800I20180306-2000I20180306-0800I20180305-2000I20180305-0800I20180305-0300I20180304-2000I20180304-0800I20180303-1500I20180303-1200I20180303-0800I20180303-0335I20180303-0155I20180303-0055I20180302-2000I20180301-2000I20180228-2000I20180227-2000I20180226-2000I20180225-2000I20180224-1500I20180223-2000I20180222-2000I20180221-2000I20180220-2000I20180219-2000I20180218-2000I20180217-1500I20180216-2000I20180216-0415I20180215-2000I20180214-2000I20180213-2000I20180213-0125I20180212-2000I20180211-2000I20180210-1500I20180209-2000I20180208-2000I20180207-2000
Change-Id: I2ce29644a969e3df4d47bfcbe2557ebf439c7d0b
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to '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 |