ITypeBinding binding= ASTResolving.guessBindingForTypeReference(node); if (binding != null) { ITypeBinding simpleBinding= binding; ASTNode normalizedNode= ASTNodes.getNormalizedNode(node); if (!(normalizedNode.getParent() instanceof Type) && node.getParent() != normalizedNode) { ITypeBinding normBinding= ASTResolving.guessBindingForTypeReference(normalizedNode); if (normBinding != null) { proposals.add(createTypeRefChangeFullProposal(cu, normBinding, normalizedNode, relevance + 2));
ITypeBinding binding= ASTResolving.guessBindingForTypeReference(node); if (binding != null) { ITypeBinding simpleBinding= binding; ASTNode normalizedNode= ASTNodes.getNormalizedNode(node); if (!(normalizedNode.getParent() instanceof Type) && node.getParent() != normalizedNode) { ITypeBinding normBinding= ASTResolving.guessBindingForTypeReference(normalizedNode); if (normBinding != null) { proposals.add(createTypeRefChangeFullProposal(cu, normBinding, normalizedNode, relevance + 2));
ITypeBinding binding= ASTResolving.guessBindingForTypeReference(node); if (binding != null) { ITypeBinding simpleBinding= binding; ASTNode normalizedNode= ASTNodes.getNormalizedNode(node); if (!(normalizedNode.getParent() instanceof Type) && node.getParent() != normalizedNode) { ITypeBinding normBinding= ASTResolving.guessBindingForTypeReference(normalizedNode); if (normBinding != null && !normBinding.isRecovered()) { proposals.add(createTypeRefChangeFullProposal(cu, normBinding, normalizedNode, relevance + 5));
private ITypeBinding getPossibleSuperTypeBinding(ASTNode node) { if (fTypeKind == K_ANNOTATION) { return null; } AST ast= node.getAST(); node= ASTNodes.getNormalizedNode(node); ASTNode parent= node.getParent(); switch (parent.getNodeType()) { case ASTNode.METHOD_DECLARATION: if (node.getLocationInParent() == MethodDeclaration.THROWN_EXCEPTIONS_PROPERTY) { return ast.resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$ } break; case ASTNode.THROW_STATEMENT : return ast.resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$ case ASTNode.SINGLE_VARIABLE_DECLARATION: if (parent.getLocationInParent() == CatchClause.EXCEPTION_PROPERTY) { return ast.resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$ } break; case ASTNode.VARIABLE_DECLARATION_STATEMENT: case ASTNode.FIELD_DECLARATION: return null; // no guessing for LHS types, cannot be a supertype of a known type case ASTNode.PARAMETERIZED_TYPE: return null; // Inheritance doesn't help: A<X> z= new A<String>(); -> } return ASTResolving.guessBindingForTypeReference(node); }
return null; // Inheritance doesn't help: A<X> z= new A<String>(); -> ITypeBinding binding= ASTResolving.guessBindingForTypeReference(node); if (binding != null && !binding.isRecovered()) { return binding;
ITypeBinding binding= ASTResolving.guessBindingForTypeReference(node); if (binding != null) { ASTNode parent= node.getParent(); ASTNode normalizedNode= ASTNodes.getNormalizedNode(node); if (!(normalizedNode.getParent() instanceof Type) && node.getParent() != normalizedNode) { ITypeBinding normBinding= ASTResolving.guessBindingForTypeReference(normalizedNode); if (normBinding != null && !normBinding.isRecovered()) { proposals.add(UnresolvedElementsSubProcessor.createTypeRefChangeFullProposal(cu, normBinding, normalizedNode, IProposalRelevance.TYPE_ARGUMENTS_FROM_CONTEXT));