Index: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/JavaUtils.java |
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/JavaUtils.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/JavaUtils.java |
index 4ea69f82c2500d345f39e224d9b3b9c0d377273c..f3fd8aee72882f6eb0cbbc74275a75f815a61b5d 100644 |
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/JavaUtils.java |
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/JavaUtils.java |
@@ -20,6 +20,8 @@ import org.eclipse.jdt.core.dom.IBinding; |
import org.eclipse.jdt.core.dom.IMethodBinding; |
import org.eclipse.jdt.core.dom.IPackageBinding; |
import org.eclipse.jdt.core.dom.ITypeBinding; |
+import org.eclipse.jdt.core.dom.IVariableBinding; |
+import org.eclipse.jdt.core.dom.Modifier; |
/** |
* Helper for JDT integration. |
@@ -295,6 +297,14 @@ public class JavaUtils { |
return false; |
} |
+ public static boolean isStaticFieldBinding(Object binding) { |
+ if (binding instanceof IVariableBinding) { |
+ IVariableBinding fieldBinding = (IVariableBinding) binding; |
+ return fieldBinding.isField() && isStatic(fieldBinding); |
+ } |
+ return false; |
+ } |
+ |
public static boolean isSubtype(ITypeBinding binding, ITypeBinding superBinding) { |
if (binding != null) { |
if (binding == superBinding) { |
@@ -394,4 +404,8 @@ public class JavaUtils { |
return null; |
} |
} |
+ |
+ private static boolean isStatic(IBinding binding) { |
+ return Modifier.isStatic(binding.getModifiers()); |
+ } |
} |