Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.core/src/org/eclipse/egit/core/internal/Utils.java')
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/Utils.java33
1 files changed, 0 insertions, 33 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/Utils.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/Utils.java
index 82abd31c28..afbfab3dc6 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/Utils.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/Utils.java
@@ -17,7 +17,6 @@ import java.io.IOException;
import java.text.MessageFormat;
import java.util.Collection;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.egit.core.Activator;
import org.eclipse.jgit.annotations.NonNull;
@@ -96,38 +95,6 @@ public class Utils {
}
/**
- * Returns the adapter corresponding to the given adapter class.
- * <p>
- * Workaround for "Unnecessary cast" errors, see bug 460685. Can be removed
- * when EGit depends on Eclipse 4.5 or higher.
- *
- * @param adaptable
- * the adaptable
- * @param adapterClass
- * the adapter class to look up
- * @return a object of the given class, or <code>null</code> if this object
- * does not have an adapter for the given class
- */
- public static <T> T getAdapter(IAdaptable adaptable, Class<T> adapterClass) {
- Object adapter = adaptable.getAdapter(adapterClass);
- if (adapter == null) {
- return null;
- }
- // Guard against misbehaving IAdaptables...
- if (adapterClass.isInstance(adapter)) {
- return adapterClass.cast(adapter);
- } else {
- Activator.logError(
- MessageFormat.format(CoreText.Utils_InvalidAdapterError,
- adaptable.getClass().getName(),
- adapterClass.getName(),
- adapter.getClass().getName()),
- new IllegalStateException());
- return null;
- }
- }
-
- /**
* Validates a given ref name, including testing whether a ref with that
* name already exists, or if the name conflicts with an already existing
* ref.

Back to the top