if (modifier instanceof org.eclipse.jdt.core.dom.Annotation) { org.eclipse.jdt.core.dom.Annotation annotation = (org.eclipse.jdt.core.dom.Annotation)modifier; String qualifiedAnnotationName = annotation.resolveTypeBinding().getQualifiedName(); if (!"java.lang.Override".equals(qualifiedAnnotationName) && !"java.lang.SuppressWarnings".equals(qualifiedAnnotationName)) annotations.add(annotation);
signature.append("@").append(annotation.resolveTypeBinding().getQualifiedName()); if (!values.isEmpty()) { signature.append("(");
private static IMethodBinding findAnnotationMember(Annotation annotation, String name) { ITypeBinding annotBinding= annotation.resolveTypeBinding(); if (annotBinding != null) { return Bindings.findMethodInType(annotBinding, name, (String[]) null); } return null; }
public static IMethodBinding findAnnotationMember(Annotation annotation, String name) { ITypeBinding annotBinding= annotation.resolveTypeBinding(); if (annotBinding != null) { return Bindings.findMethodInType(annotBinding, name, (String[]) null); } return null; }
private static IMethodBinding findAnnotationMember(Annotation annotation, String name) { ITypeBinding annotBinding= annotation.resolveTypeBinding(); if (annotBinding != null) { return Bindings.findMethodInType(annotBinding, name, (String[]) null); } return null; }
public MissingAnnotationAttributesProposal(ICompilationUnit cu, Annotation annotation, int relevance) { super(CorrectionMessages.MissingAnnotationAttributesProposal_add_missing_attributes_label, cu, null, relevance, null); setImage(JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)); fAnnotation= annotation; Assert.isNotNull(fAnnotation.resolveTypeBinding()); }
public MissingAnnotationAttributesProposal(ICompilationUnit cu, Annotation annotation, int relevance) { super(CorrectionMessages.MissingAnnotationAttributesProposal_add_missing_attributes_label, cu, null, relevance, null); setImage(JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)); fAnnotation= annotation; Assert.isNotNull(fAnnotation.resolveTypeBinding()); }
public MissingAnnotationAttributesProposal(ICompilationUnit cu, Annotation annotation, int relevance) { super(CorrectionMessages.MissingAnnotationAttributesProposal_add_missing_attributes_label, cu, null, relevance, null); setImage(JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)); fAnnotation= annotation; Assert.isNotNull(fAnnotation.resolveTypeBinding()); }
private static Annotation findExistingAnnotation(List<? extends ASTNode> modifiers) { for (int i= 0, len= modifiers.size(); i < len; i++) { Object curr= modifiers.get(i); if (curr instanceof NormalAnnotation || curr instanceof SingleMemberAnnotation) { Annotation annotation= (Annotation) curr; ITypeBinding typeBinding= annotation.resolveTypeBinding(); if (typeBinding != null) { if ("java.lang.SuppressWarnings".equals(typeBinding.getQualifiedName())) { //$NON-NLS-1$ return annotation; } } else { String fullyQualifiedName= annotation.getTypeName().getFullyQualifiedName(); if ("SuppressWarnings".equals(fullyQualifiedName) || "java.lang.SuppressWarnings".equals(fullyQualifiedName)) { //$NON-NLS-1$ //$NON-NLS-2$ return annotation; } } } } return null; } }
private static Annotation findExistingAnnotation(List<? extends ASTNode> modifiers) { for (int i= 0, len= modifiers.size(); i < len; i++) { Object curr= modifiers.get(i); if (curr instanceof NormalAnnotation || curr instanceof SingleMemberAnnotation) { Annotation annotation= (Annotation) curr; ITypeBinding typeBinding= annotation.resolveTypeBinding(); if (typeBinding != null) { if ("java.lang.SuppressWarnings".equals(typeBinding.getQualifiedName())) { //$NON-NLS-1$ return annotation; } } else { String fullyQualifiedName= annotation.getTypeName().getFullyQualifiedName(); if ("SuppressWarnings".equals(fullyQualifiedName) || "java.lang.SuppressWarnings".equals(fullyQualifiedName)) { //$NON-NLS-1$ //$NON-NLS-2$ return annotation; } } } } return null; } }
private static Annotation findExistingAnnotation(List modifiers) { for (int i= 0, len= modifiers.size(); i < len; i++) { Object curr= modifiers.get(i); if (curr instanceof NormalAnnotation || curr instanceof SingleMemberAnnotation) { Annotation annotation= (Annotation) curr; ITypeBinding typeBinding= annotation.resolveTypeBinding(); if (typeBinding != null) { if ("java.lang.SuppressWarnings".equals(typeBinding.getQualifiedName())) { //$NON-NLS-1$ return annotation; } } else { String fullyQualifiedName= annotation.getTypeName().getFullyQualifiedName(); if ("SuppressWarnings".equals(fullyQualifiedName) || "java.lang.SuppressWarnings".equals(fullyQualifiedName)) { //$NON-NLS-1$ //$NON-NLS-2$ return annotation; } } } } return null; } }
public static void addValueForAnnotationProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) { ICompilationUnit cu= context.getCompilationUnit(); ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot()); if (selectedNode instanceof Annotation) { Annotation annotation= (Annotation) selectedNode; if (annotation.resolveTypeBinding() == null) { return; } MissingAnnotationAttributesProposal proposal= new MissingAnnotationAttributesProposal(cu, annotation, 10); proposals.add(proposal); } }
public static void addValueForAnnotationProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) { ICompilationUnit cu= context.getCompilationUnit(); ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot()); if (selectedNode instanceof Annotation) { Annotation annotation= (Annotation) selectedNode; if (annotation.resolveTypeBinding() == null) { return; } MissingAnnotationAttributesProposal proposal= new MissingAnnotationAttributesProposal(cu, annotation, 10); proposals.add(proposal); } }
public static void addValueForAnnotationProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) { ICompilationUnit cu= context.getCompilationUnit(); ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot()); if (selectedNode instanceof Annotation) { Annotation annotation= (Annotation) selectedNode; if (annotation.resolveTypeBinding() == null) { return; } MissingAnnotationAttributesProposal proposal= new MissingAnnotationAttributesProposal(cu, annotation, 10); proposals.add(proposal); } }
private String qualifiedName(Annotation annotation) { ITypeBinding typeBinding = annotation.resolveTypeBinding(); if (typeBinding != null) { String resolvedName = typeBinding.getQualifiedName(); if (resolvedName != null) { return resolvedName; } } // hack(?): check for a matching import because when moving a stand-alone // annotation to its container in CombinationIndexedDeclarationAnnotationAdapter // the container's import is added but then it won't "resolve" upon // subsequent lookups... :-( return this.importFor(annotation.getTypeName().getFullyQualifiedName()); // look for a matching import // OLD METHOD SOURCE: // String name = annotation.getTypeName().getFullyQualifiedName(); // if (name.indexOf('.') != -1) { // return name; // name is already qualified // } // String resolvedName = JDTTools.resolve(name, this.type()); // // hack(?): check for a matching import because when moving a stand-alone // // annotation to its container in CombinationIndexedDeclarationAnnotationAdapter // // the container's import is added but then it won't "resolve" upon // // subsequent lookups... :-( // return this.importFor(name); // look for a matching import }
protected ASTRewrite getRewrite() throws CoreException { AST ast= fAnnotation.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast); createImportRewrite((CompilationUnit) fAnnotation.getRoot()); ListRewrite listRewrite; if (fAnnotation instanceof NormalAnnotation) { listRewrite= rewrite.getListRewrite(fAnnotation, NormalAnnotation.VALUES_PROPERTY); } else { NormalAnnotation newAnnotation= ast.newNormalAnnotation(); newAnnotation.setTypeName((Name) rewrite.createMoveTarget(fAnnotation.getTypeName())); rewrite.replace(fAnnotation, newAnnotation, null); listRewrite= rewrite.getListRewrite(newAnnotation, NormalAnnotation.VALUES_PROPERTY); } addMissingAtributes(fAnnotation.resolveTypeBinding(), listRewrite); return rewrite; }
@Override protected ASTRewrite getRewrite() throws CoreException { AST ast= fAnnotation.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast); createImportRewrite((CompilationUnit) fAnnotation.getRoot()); ListRewrite listRewrite; if (fAnnotation instanceof NormalAnnotation) { listRewrite= rewrite.getListRewrite(fAnnotation, NormalAnnotation.VALUES_PROPERTY); } else { NormalAnnotation newAnnotation= ast.newNormalAnnotation(); newAnnotation.setTypeName((Name) rewrite.createMoveTarget(fAnnotation.getTypeName())); rewrite.replace(fAnnotation, newAnnotation, null); listRewrite= rewrite.getListRewrite(newAnnotation, NormalAnnotation.VALUES_PROPERTY); } addMissingAtributes(fAnnotation.resolveTypeBinding(), listRewrite); return rewrite; }
@Override protected ASTRewrite getRewrite() throws CoreException { AST ast= fAnnotation.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast); createImportRewrite((CompilationUnit) fAnnotation.getRoot()); ListRewrite listRewrite; if (fAnnotation instanceof NormalAnnotation) { listRewrite= rewrite.getListRewrite(fAnnotation, NormalAnnotation.VALUES_PROPERTY); } else { NormalAnnotation newAnnotation= ast.newNormalAnnotation(); newAnnotation.setTypeName((Name) rewrite.createMoveTarget(fAnnotation.getTypeName())); rewrite.replace(fAnnotation, newAnnotation, null); listRewrite= rewrite.getListRewrite(newAnnotation, NormalAnnotation.VALUES_PROPERTY); } addMissingAtributes(fAnnotation.resolveTypeBinding(), listRewrite); return rewrite; }
ITypeBinding annotBinding= annotation.resolveTypeBinding(); if (annotBinding == null) { return;
ITypeBinding annotBinding= annotation.resolveTypeBinding(); if (annotBinding == null) { return;