diff options
author | Eike Stepper | 2015-03-24 09:50:35 +0000 |
---|---|---|
committer | Eike Stepper | 2015-03-24 09:50:35 +0000 |
commit | 20582a73ebe7c16c9b3a5621e5dbd4c80f2f6d46 (patch) | |
tree | 719a0ecfec4b5974e824adf325443b8934231833 /plugins/org.eclipse.emf.cdo.explorer.ui/src | |
parent | dbc9cff6f1b9638fb4afb0c707cc19156483c6ca (diff) | |
download | cdo-20582a73ebe7c16c9b3a5621e5dbd4c80f2f6d46.tar.gz cdo-20582a73ebe7c16c9b3a5621e5dbd4c80f2f6d46.tar.xz cdo-20582a73ebe7c16c9b3a5621e5dbd4c80f2f6d46.zip |
[Releng] Adjust to generification of getAdapter()
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer.ui/src')
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/NewActionProvider.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/NewActionProvider.java index 7f4d297160..41edeb965b 100644 --- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/NewActionProvider.java +++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/NewActionProvider.java @@ -362,7 +362,7 @@ public class NewActionProvider extends CommonActionProvider implements ISelectio return delegate.getLabel(); } - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) + public <T> T getAdapter(Class<T> adapter) { return delegate.getAdapter(adapter); } diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java index 316bbc461a..3d7aa8b94c 100644 --- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java @@ -40,42 +40,42 @@ import org.eclipse.core.runtime.jobs.Job; /** * @since 4.4 */ -@SuppressWarnings("rawtypes") public class ExplorerUIAdapterFactory implements IAdapterFactory { private static final Class<CDORenameContext> CLASS_EXPLORER_RENAME_CONTEXT = CDORenameContext.class; private static final Class<StateProvider> CLASS_STATE_PROVIDER = StateProvider.class; - private static final Class[] CLASSES = { CLASS_EXPLORER_RENAME_CONTEXT, CLASS_STATE_PROVIDER }; + private static final Class<?>[] CLASSES = { CLASS_EXPLORER_RENAME_CONTEXT, CLASS_STATE_PROVIDER }; public ExplorerUIAdapterFactory() { } - public Class[] getAdapterList() + public Class<?>[] getAdapterList() { return CLASSES; } - public Object getAdapter(Object adaptableObject, Class adapterType) + @SuppressWarnings("unchecked") + public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adapterType == CLASS_EXPLORER_RENAME_CONTEXT) { if (adaptableObject instanceof AbstractElement) { AbstractElement element = (AbstractElement)adaptableObject; - return createRenameContext(element); + return (T)createRenameContext(element); } else if (adaptableObject instanceof CDOBranch) { CDOBranch branch = (CDOBranch)adaptableObject; - return createRenameContext(branch); + return (T)createRenameContext(branch); } else if (adaptableObject instanceof CDOResourceNode) { CDOResourceNode resourceNode = (CDOResourceNode)adaptableObject; - return createRenameContext(resourceNode); + return (T)createRenameContext(resourceNode); } } else if (adapterType == CLASS_STATE_PROVIDER) @@ -86,7 +86,7 @@ public class ExplorerUIAdapterFactory implements IAdapterFactory CDOCheckout checkout = CDOExplorerUtil.getCheckout(eObject); if (checkout != null) { - return checkout; + return (T)checkout; } } } |