Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-03-16 22:22:56 +0000
committerThomas Wolf2019-03-16 22:24:40 +0000
commit3678f186301a9d9565defd502d1a95680b92a3de (patch)
treeaac8d747ee78c15ad836bca1609bbd41a71c8e7b /org.eclipse.egit.mylyn.ui
parentb385340dae9e2b715fe8e10e3c98ed5c698e28bf (diff)
downloadegit-3678f186301a9d9565defd502d1a95680b92a3de.tar.gz
egit-3678f186301a9d9565defd502d1a95680b92a3de.tar.xz
egit-3678f186301a9d9565defd502d1a95680b92a3de.zip
Generify most getAdapter() methods
There are some overrides of getAdapter() inherited from platform compare which still inherit a non-generic signature in Eclipse Neon. But the large majority can finally be generified. Change-Id: I8b1b5e81e8d608d044bfd9d2c5d66569cb04e466 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.mylyn.ui')
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
index 4d417a979e..eb1dd8b85e 100644
--- a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
@@ -50,20 +50,18 @@ public class TaskReferenceFactory implements IAdapterFactory {
private static final String BUGTRACK_URL = "url"; //$NON-NLS-1$
@Override
- @SuppressWarnings({ "rawtypes" })
- public Class[] getAdapterList() {
- final Class[] c = new Class[ADAPTER_TYPES.length];
+ public Class<?>[] getAdapterList() {
+ final Class<?>[] c = new Class[ADAPTER_TYPES.length];
System.arraycopy(ADAPTER_TYPES, 0, c, 0, c.length);
return c;
}
@Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (!AbstractTaskReference.class.equals(adapterType))
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
+ if (!AbstractTaskReference.class.equals(adapterType)) {
return null;
-
- return adaptFromObject(adaptableObject);
+ }
+ return adapterType.cast(adaptFromObject(adaptableObject));
}
private AbstractTaskReference adaptFromObject(Object element) {

Back to the top