[Title] JSDT : SelectionOnSingleNameReference bug is fixed.
authorJaeheung Kim <jaeheung.kim@samsung.com>
Fri, 22 Mar 2013 02:59:31 +0000 (11:59 +0900)
committerhyukmin kwon <hyukmin0530.kwon@samsung.com>
Fri, 22 Mar 2013 02:59:31 +0000 (11:59 +0900)
[Desc.] SelectionOnSingleNameReference.resolveForAllocation function
is fixed to resolve correctly.
[Issue] REDMINE-7934

org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnSingleNameReference.java

index 2db439a..95b06b1 100644 (file)
@@ -84,7 +84,9 @@ public TypeBinding resolveType(BlockScope scope, boolean define, TypeBinding use
 public TypeBinding resolveForAllocation(BlockScope scope, ASTNode location) {
        TypeBinding typeBinding=null;
        this.binding=   
-                       scope.getBinding(this.token, (Binding.TYPE|Binding.METHOD | bits)  & RestrictiveFlagMASK, this, true /*resolve*/);
+                       scope.getBinding(this.token, (Binding.TYPE | bits)  & RestrictiveFlagMASK, this, true /*resolve*/);
+       if(binding == null)
+               this.binding = scope.getBinding(this.token, (Binding.TYPE | Binding.METHOD | bits)  & RestrictiveFlagMASK, this, true /*resolve*/);
        if (binding instanceof TypeBinding)
                typeBinding=(TypeBinding)binding;
        else if (binding instanceof MethodBinding)