diff options
author | Dani Megert | 2015-02-20 12:08:00 +0000 |
---|---|---|
committer | Dani Megert | 2015-02-20 12:08:00 +0000 |
commit | 035b16c4845dde58ab3f6463878cbe662349e58c (patch) | |
tree | a312725ef6ac6c4aeedc3ca81bad03b0583f5fb1 /org.eclipse.debug.tests | |
parent | 87bf3db976790862ceb9b321661e0234afb342ca (diff) | |
download | eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.tar.gz eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.tar.xz eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.zip |
Fixed bug 460417: Fix compiler problems from generified IAdaptable#getAdapter(..)
Diffstat (limited to 'org.eclipse.debug.tests')
5 files changed, 50 insertions, 45 deletions
diff --git a/org.eclipse.debug.tests/META-INF/MANIFEST.MF b/org.eclipse.debug.tests/META-INF/MANIFEST.MF index a7168199b..93bfb3619 100644 --- a/org.eclipse.debug.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.debug.tests/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Version: 3.9.200.qualifier Bundle-Activator: org.eclipse.debug.tests.TestsPlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)", org.eclipse.debug.ui;bundle-version="[3.10.0,4.0.0)", org.junit, org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)", diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java index 1e5155548..94b162520 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java @@ -1,10 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -39,15 +39,15 @@ import org.eclipse.ui.IEditorInput; /** * Test the ordering used in the breakpoints view. - * + * * Using a special Comparator which sorts breakpoint texts like file:1, file:2 and file:11 in a numerical ordering. */ public class BreakpointOrderingTests extends TestCase { - + public BreakpointOrderingTests(String name) { super(name); } - + /** * Test only implementation of IBreakpoint. */ @@ -59,7 +59,7 @@ public class BreakpointOrderingTests extends TestCase { TestBreakpoint(String text) { this(text, IBreakpoint.BREAKPOINT_MARKER); } - + TestBreakpoint(String text, final String markerType) { fText = text; final IResource resource = ResourcesPlugin.getWorkspace().getRoot(); @@ -77,14 +77,14 @@ public class BreakpointOrderingTests extends TestCase { catch ( CoreException e ) { fail("Unexpected exception: " + e.toString()); //$NON-NLS-1$ } - + } - + void ReportFailure(String msg) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, TestsPlugin.PLUGIN_ID, msg)); } - - + + String getText() { return fText; } @@ -141,11 +141,11 @@ public class BreakpointOrderingTests extends TestCase { @Override public void setRegistered(boolean registered) throws CoreException { fail("not implemented in test"); //$NON-NLS-1$ - + } @Override - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { fail("not implemented in test"); //$NON-NLS-1$ return null; } @@ -160,7 +160,7 @@ public class BreakpointOrderingTests extends TestCase { TestLineBreakpoint(String text, int lineNum) { super(text, IBreakpoint.LINE_BREAKPOINT_MARKER); - fLineNum = lineNum; + fLineNum = lineNum; } @Override @@ -233,9 +233,9 @@ public class BreakpointOrderingTests extends TestCase { public Control getControl() { fail("not implemented in test"); //$NON-NLS-1$ return null; - }}; - - // Test debug model presentation for label text retrieval. + }}; + + // Test debug model presentation for label text retrieval. IDebugModelPresentation fDebugModelPres = new IDebugModelPresentation() { @Override @@ -256,7 +256,7 @@ public class BreakpointOrderingTests extends TestCase { } @Override - public void setAttribute(String attribute, Object value) { + public void setAttribute(String attribute, Object value) { fail("not implemented in test"); //$NON-NLS-1$ } @@ -292,10 +292,10 @@ public class BreakpointOrderingTests extends TestCase { fail("not implemented in test"); //$NON-NLS-1$ return null; }}; - + // Test vector with some UNIX paths TestBreakpoint[] createTestBreakpoints0() { - TestBreakpoint[] fTestBps = { + TestBreakpoint[] fTestBps = { new TestBreakpoint(""), //$NON-NLS-1$ new TestBreakpoint("/file/text.c"), //$NON-NLS-1$ new TestBreakpoint("/file/text.c:1"), //$NON-NLS-1$ @@ -317,11 +317,11 @@ public class BreakpointOrderingTests extends TestCase { new TestLineBreakpoint("/file/text.c:y", 0), //$NON-NLS-1$ }; return fTestBps; - } - - // Check plain numbers + } + + // Check plain numbers TestBreakpoint[] createTestBreakpoints1() { - TestBreakpoint[] fTestBps = { + TestBreakpoint[] fTestBps = { new TestLineBreakpoint("0", 0), //$NON-NLS-1$ new TestLineBreakpoint("1", 1), //$NON-NLS-1$ new TestLineBreakpoint("1_a", 1), //$NON-NLS-1$ @@ -337,11 +337,11 @@ public class BreakpointOrderingTests extends TestCase { new TestLineBreakpoint("112b", 112), //$NON-NLS-1$ }; return fTestBps; - } - + } + // Test consistent behavior with leading 0's TestBreakpoint[] createTestBreakpoints2() { - TestBreakpoint[] fTestBps = { + TestBreakpoint[] fTestBps = { new TestLineBreakpoint("0", 0), //$NON-NLS-1$ new TestLineBreakpoint("00", 0), //$NON-NLS-1$ new TestLineBreakpoint("0000", 0), //$NON-NLS-1$ @@ -351,18 +351,18 @@ public class BreakpointOrderingTests extends TestCase { new TestLineBreakpoint("10000", 10000), //$NON-NLS-1$ }; return fTestBps; - } - + } + // Test Win32 paths TestBreakpoint[] createTestBreakpoints3() { - TestBreakpoint[] fTestBps = { + TestBreakpoint[] fTestBps = { new TestLineBreakpoint(":a", 0), //$NON-NLS-1$ new TestLineBreakpoint("c:\\file\\text.c:1", 1), //$NON-NLS-1$ new TestLineBreakpoint("c:\\file\\text.c:2", 2), //$NON-NLS-1$ new TestLineBreakpoint("d:\\file\\text.c:3", 3), //$NON-NLS-1$ }; return fTestBps; - } + } public void testBreakpointOrdering0() throws CoreException { executeTest(createTestBreakpoints0()); @@ -376,7 +376,7 @@ public class BreakpointOrderingTests extends TestCase { public void testBreakpointOrdering3() throws CoreException { executeTest(createTestBreakpoints3()); } - + /** * Test expected ordering. @@ -400,14 +400,14 @@ public class BreakpointOrderingTests extends TestCase { if (!ltCheck) { System.err.println("Less Comparison in between " + inner + " and " + outer + " (" + testBps[inner].getText() + " and " + testBps[outer].getText() + ") failed"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ failed = true; - } - } + } + } } assertFalse(failed); } finally { for (int index = 0; index < testBps.length; index++) { testBps[index].delete(); } - } + } } }
\ No newline at end of file diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java index 2e6da1a2c..2db408a54 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 IBM Corporation and others. + * Copyright (c) 2014, 2015 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 @@ -42,7 +42,7 @@ public class TestStackFrame implements IStackFrame { } @Override - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { return null; } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java index dd0c7e019..6298dc1b2 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java @@ -1,10 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -17,7 +17,7 @@ import org.eclipse.debug.core.model.IMemoryBlock; /** * Dummy memory block implementation. - * + * * @since 3.1 */ public class MemoryBlock implements IMemoryBlock { @@ -94,7 +94,7 @@ public class MemoryBlock implements IMemoryBlock { * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @Override - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { return null; } } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java index 5ed32d5f0..7ec70948f 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 Wind River Systems and others. + * Copyright (c) 2009, 2015 Wind River Systems 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 @@ -17,6 +17,7 @@ import java.util.LinkedList; import java.util.List; import org.eclipse.core.runtime.PlatformObject; + import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer; import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate; import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate; @@ -38,10 +39,13 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer; import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; + import org.eclipse.jface.viewers.TreePath; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; + import org.eclipse.swt.widgets.Display; + import org.junit.Assert; /** @@ -78,10 +82,11 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider return fModel; } - @Override - public Object getAdapter(Class adapter) { + @SuppressWarnings("unchecked") + @Override + public <T> T getAdapter(Class<T> adapter) { if (adapter.isInstance(fModel)) { - return fModel; + return (T) fModel; } return null; } |