diff options
author | Dani Megert | 2015-03-25 14:51:49 +0000 |
---|---|---|
committer | Dani Megert | 2015-03-25 14:51:49 +0000 |
commit | 27c287a20ae29578aaaf3f2b0b97cd74727b80b0 (patch) | |
tree | 8701a9dcd9a059b832b73948880fa855927c5215 | |
parent | 7b528b4fb5d545c20892357e4c92b0f3b5c5cba3 (diff) | |
download | eclipse.jdt.ui-27c287a20ae29578aaaf3f2b0b97cd74727b80b0.tar.gz eclipse.jdt.ui-27c287a20ae29578aaaf3f2b0b97cd74727b80b0.tar.xz eclipse.jdt.ui-27c287a20ae29578aaaf3f2b0b97cd74727b80b0.zip |
Fixed bug 460359: Fix compiler problems from generified IAdaptable#getAdapter(..)
5 files changed, 22 insertions, 17 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java index 5f6d74f821..81e86b7226 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 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 @@ -69,10 +69,11 @@ public class MembersView extends JavaBrowsingPart implements IPropertyChangeList /* (non-Javadoc) * @see org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart#getAdapter(java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class key) { + public <T> T getAdapter(Class<T> key) { if (key == IShowInTargetList.class) { - return new IShowInTargetList() { + return (T) new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES }; } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesView.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesView.java index 9be6b4fc00..6b4b343693 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesView.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 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 @@ -218,10 +218,11 @@ public class PackagesView extends JavaBrowsingPart{ /* (non-Javadoc) * @see org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart#getAdapter(java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class key) { + public <T> T getAdapter(Class<T> key) { if (key == IShowInTargetList.class) { - return new IShowInTargetList() { + return (T) new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java index 8c996e55e7..b6177c62c8 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 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 @@ -81,10 +81,11 @@ public class ProjectsView extends JavaBrowsingPart { /* (non-Javadoc) * @see org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart#getAdapter(java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class key) { + public <T> T getAdapter(Class<T> key) { if (key == IShowInTargetList.class) { - return new IShowInTargetList() { + return (T) new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/TypesView.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/TypesView.java index f057da407b..3481b7509b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/TypesView.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/TypesView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 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 @@ -64,10 +64,11 @@ public class TypesView extends JavaBrowsingPart { /* (non-Javadoc) * @see org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart#getAdapter(java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class key) { + public <T> T getAdapter(Class<T> key) { if (key == IShowInTargetList.class) { - return new IShowInTargetList() { + return (T) new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java index f7a17aa1a4..c545c0c802 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 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 @@ -712,13 +712,14 @@ public class TypeHierarchyViewPart extends ViewPart implements ITypeHierarchyVie /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class key) { + public <T> T getAdapter(Class<T> key) { if (key == IShowInSource.class) { - return getShowInSource(); + return (T) getShowInSource(); } if (key == IShowInTargetList.class) { - return new IShowInTargetList() { + return (T) new IShowInTargetList() { public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV }; } @@ -726,7 +727,7 @@ public class TypeHierarchyViewPart extends ViewPart implements ITypeHierarchyVie }; } if (key == IContextProvider.class) { - return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW); + return (T) JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW); } return super.getAdapter(key); } |