@Override public boolean visit(CastExpression node) { if ("java.lang.ClassCastException".equals(fException.getQualifiedName())) { //$NON-NLS-1$ Type type= node.getType(); fResult.add(new OccurrenceLocation(type.getStartPosition(), type.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(CastExpression node) { if ("java.lang.ClassCastException".equals(fException.getQualifiedName())) { //$NON-NLS-1$ Type type= node.getType(); fResult.add(new OccurrenceLocation(type.getStartPosition(), type.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(ClassInstanceCreation node) { if (isExitPoint(node.resolveConstructorBinding())) { Type name= node.getType(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fExitDescription)); } return true; }
@Override public boolean visit(ClassInstanceCreation node) { if (isExitPoint(node.resolveConstructorBinding())) { Type name= node.getType(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fExitDescription)); } return true; }
private void performSearch() { fResult= new ArrayList<>(); markReferences(); if (!fResult.isEmpty()) { Type returnType= fMethodDeclaration.getReturnType2(); if (returnType != null) { String desc= Messages.format(SearchMessages.MethodExitsFinder_occurrence_return_description, BasicElementLabels.getJavaElementName(fMethodDeclaration.getName().toString())); fResult.add(new OccurrenceLocation(returnType.getStartPosition(), returnType.getLength(), 0, desc)); } } }
private void performSearch() { fResult= new ArrayList<>(); markReferences(); if (!fResult.isEmpty()) { Type returnType= fMethodDeclaration.getReturnType2(); if (returnType != null) { String desc= Messages.format(SearchMessages.MethodExitsFinder_occurrence_return_description, BasicElementLabels.getJavaElementName(fMethodDeclaration.getName().toString())); fResult.add(new OccurrenceLocation(returnType.getStartPosition(), returnType.getLength(), 0, desc)); } } }
protected static Type createPlaceholderForType(final Type type, final ICompilationUnit declaringCu, final ASTRewrite rewrite) throws JavaModelException { return (Type) rewrite.createStringPlaceholder(declaringCu.getBuffer().getText(type.getStartPosition(), type.getLength()), ASTNode.SIMPLE_TYPE); }
protected static Type createPlaceholderForType(final Type type, final ICompilationUnit declaringCu, final ASTRewrite rewrite) throws JavaModelException { return (Type) rewrite.createStringPlaceholder(declaringCu.getBuffer().getText(type.getStartPosition(), type.getLength()), ASTNode.SIMPLE_TYPE); }
@Override public boolean visit(ClassInstanceCreation node) { if (matches(node.resolveConstructorBinding())) { Type type= node.getType(); fResult.add(new OccurrenceLocation(type.getStartPosition(), type.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(ClassInstanceCreation node) { if (matches(node.resolveConstructorBinding())) { Type type= node.getType(); fResult.add(new OccurrenceLocation(type.getStartPosition(), type.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(ClassInstanceCreation node) { String nodeType = node.getType().toString(); nodeType = resolveClassname(nodeType); List<String> resolvedParams = this.methodParameterGuesser(node.arguments()); ConstructorType resolvedConstructor = new ConstructorType(nodeType, resolvedParams); processConstructor(resolvedConstructor, cu.getLineNumber(node.getType().getStartPosition()), cu.getColumnNumber(node.getType().getStartPosition()), node.getType().getLength()); return super.visit(node); }
private QualifiedType createQualifiedType(TypeReference typeReference, long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, char[][] tokens, int index, Type qualifier) { SimpleName simpleName = createSimpleName(typeReference, positions, tokens, index); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(qualifier); qualifiedType.setName(simpleName); int start = qualifier.getStartPosition(); int end = simpleName.getStartPosition() + simpleName.getLength() - 1; setSourceRangeAnnotationsAndRecordNodes(typeReference, qualifiedType, typeAnnotations, index, start, end); return qualifiedType; }
private QualifiedType createQualifiedType(TypeReference typeReference, long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, char[][] tokens, int index, Type qualifier) { SimpleName simpleName = createSimpleName(typeReference, positions, tokens, index); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(qualifier); qualifiedType.setName(simpleName); int start = qualifier.getStartPosition(); int end = simpleName.getStartPosition() + simpleName.getLength() - 1; setSourceRangeAnnotationsAndRecordNodes(typeReference, qualifiedType, typeAnnotations, index, start, end); return qualifiedType; }
private QualifiedType createQualifiedType(TypeReference typeReference, long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, char[][] tokens, int index, Type qualifier) { SimpleName simpleName = createSimpleName(typeReference, positions, tokens, index); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(qualifier); qualifiedType.setName(simpleName); int start = qualifier.getStartPosition(); int end = simpleName.getStartPosition() + simpleName.getLength() - 1; setSourceRangeAnnotationsAndRecordNodes(typeReference, qualifiedType, typeAnnotations, index, start, end); return qualifiedType; }
private QualifiedType createQualifiedType(TypeReference typeReference, long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, char[][] tokens, int index, Type qualifier) { SimpleName simpleName = createSimpleName(typeReference, positions, tokens, index); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(qualifier); qualifiedType.setName(simpleName); int start = qualifier.getStartPosition(); int end = simpleName.getStartPosition() + simpleName.getLength() - 1; setSourceRangeAnnotationsAndRecordNodes(typeReference, qualifiedType, typeAnnotations, index, start, end); return qualifiedType; }
private QualifiedType createQualifiedType(TypeReference typeReference, long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, char[][] tokens, int index, Type qualifier) { SimpleName simpleName = createSimpleName(typeReference, positions, tokens, index); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(qualifier); qualifiedType.setName(simpleName); int start = qualifier.getStartPosition(); int end = simpleName.getStartPosition() + simpleName.getLength() - 1; setSourceRangeAnnotationsAndRecordNodes(typeReference, qualifiedType, typeAnnotations, index, start, end); return qualifiedType; }
@Override public boolean visit(InstanceofExpression node) { Type type = node.getRightOperand(); processType(type, TypeReferenceLocation.INSTANCE_OF, compilationUnit.getLineNumber(node.getStartPosition()), compilationUnit.getColumnNumber(type.getStartPosition()), type.getLength(), node.toString()); return super.visit(node); }
public boolean visit(org.eclipse.jdt.core.dom.CatchClause node) { Type catchType = node.getException().getType(); processType(catchType, TypeReferenceLocation.CATCH_EXCEPTION_STATEMENT, compilationUnit.getLineNumber(node.getStartPosition()), compilationUnit.getColumnNumber(catchType.getStartPosition()), catchType.getLength(), node.toString()); return super.visit(node); }
public InstanceofExpression convert(org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression expression) { InstanceofExpression instanceOfExpression = new InstanceofExpression(this.ast); if (this.resolveBindings) { recordNodes(instanceOfExpression, expression); } Expression leftExpression = convert(expression.expression); instanceOfExpression.setLeftOperand(leftExpression); final Type convertType = convertType(expression.type); instanceOfExpression.setRightOperand(convertType); int startPosition = leftExpression.getStartPosition(); int sourceEnd = convertType.getStartPosition() + convertType.getLength() - 1; instanceOfExpression.setSourceRange(startPosition, sourceEnd - startPosition + 1); return instanceOfExpression; }
public InstanceofExpression convert(org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression expression) { InstanceofExpression instanceOfExpression = new InstanceofExpression(this.ast); if (this.resolveBindings) { recordNodes(instanceOfExpression, expression); } Expression leftExpression = convert(expression.expression); instanceOfExpression.setLeftOperand(leftExpression); final Type convertType = convertType(expression.type); instanceOfExpression.setRightOperand(convertType); int startPosition = leftExpression.getStartPosition(); int sourceEnd = convertType.getStartPosition() + convertType.getLength() - 1; instanceOfExpression.setSourceRange(startPosition, sourceEnd - startPosition + 1); return instanceOfExpression; }