private void annotateList(List annotations, IAnnotationBinding [] annotationBindings, AST ast, ImportRewriteContext context) { for (int i = 0; i< annotationBindings.length; i++) { Annotation annotation = addAnnotation(annotationBindings[i], ast, context); if (annotation != null) annotations.add(annotation); } }
private void annotateList(List annotations, IAnnotationBinding [] annotationBindings, AST ast, ImportRewriteContext context) { for (int i = 0; i< annotationBindings.length; i++) { Annotation annotation = addAnnotation(annotationBindings[i], ast, context); if (annotation != null) annotations.add(annotation); } }
private void annotateList(List annotations, IAnnotationBinding [] annotationBindings, AST ast, ImportRewriteContext context) { for (int i = 0; i< annotationBindings.length; i++) { Annotation annotation = addAnnotation(annotationBindings[i], ast, context); if (annotation != null) annotations.add(annotation); } }
private void annotateList(List annotations, IAnnotationBinding [] annotationBindings, AST ast, ImportRewriteContext context, TypeLocation location, ITypeBinding type) { if (context == null) context= this.defaultContext; annotationBindings = context.removeRedundantTypeAnnotations(annotationBindings, location, type); for (int i = 0; i< annotationBindings.length; i++) { Annotation annotation = addAnnotation(annotationBindings[i], ast, context); if (annotation != null) annotations.add(annotation); } }
private void annotateList(List annotations, IAnnotationBinding [] annotationBindings, AST ast, ImportRewriteContext context, TypeLocation location, ITypeBinding type) { if (context == null) context= this.defaultContext; annotationBindings = context.removeRedundantTypeAnnotations(annotationBindings, location, type); for (int i = 0; i< annotationBindings.length; i++) { Annotation annotation = addAnnotation(annotationBindings[i], ast, context); if (annotation != null) annotations.add(annotation); } }
if (qn.endsWith(n) && (qn.length() == n.length() || qn.charAt(qn.length() - n.length() - 1) == '.')) { if (StubUtility2.isCopyOnInheritAnnotation(otherAnnotationType, javaProject, defaultNullness)) result.add(importRewrite.addAnnotation(annotation, ast, context)); break; result.add(importRewrite.addAnnotation(annotation, ast, context));
if (qn.endsWith(n) && (qn.length() == n.length() || qn.charAt(qn.length() - n.length() - 1) == '.')) { if (StubUtility2Core.isCopyOnInheritAnnotation(otherAnnotationType, javaProject, nullnessDefault, TypeLocation.RETURN_TYPE)) result.add(importRewrite.addAnnotation(annotation, ast, context)); break; result.add(importRewrite.addAnnotation(annotation, ast, context));
return result; } else if (value instanceof IAnnotationBinding) { return addAnnotation((IAnnotationBinding) value, ast, context); } else if (value instanceof Object[]) { Object[] values = (Object[]) value; if (values.length == 1) return addAnnotation(ast, values[0], context); int size = values.length; for (int i = 0; i < size; i++) expressions.add(addAnnotation(ast, values[i], context)); return initializer; } else {
return result; } else if (value instanceof IAnnotationBinding) { return addAnnotation((IAnnotationBinding) value, ast, context); } else if (value instanceof Object[]) { Object[] values = (Object[]) value; if (values.length == 1) return addAnnotation(ast, values[0], context); int size = values.length; for (int i = 0; i < size; i++) expressions.add(addAnnotation(ast, values[i], context)); return initializer; } else {
return result; } else if (value instanceof IAnnotationBinding) { return addAnnotation((IAnnotationBinding) value, ast, context); } else if (value instanceof Object[]) { Object[] values = (Object[]) value; if (values.length == 1) return addAnnotation(ast, values[0], context); int size = values.length; for (int i = 0; i < size; i++) expressions.add(addAnnotation(ast, values[i], context)); return initializer; } else {
return result; } else if (value instanceof IAnnotationBinding) { return addAnnotation((IAnnotationBinding) value, ast, context); } else if (value instanceof Object[]) { Object[] values = (Object[]) value; if (values.length == 1) return addAnnotation(ast, values[0], context); int size = values.length; for (int i = 0; i < size; i++) expressions.add(addAnnotation(ast, values[i], context)); return initializer; } else {
return result; } else if (value instanceof IAnnotationBinding) { return addAnnotation((IAnnotationBinding) value, ast, context); } else if (value instanceof Object[]) { Object[] values = (Object[]) value; if (values.length == 1) return addAnnotation(ast, values[0], context); int size = values.length; for (int i = 0; i < size; i++) expressions.add(addAnnotation(ast, values[i], context)); return initializer; } else {
/** * Create a Type suitable as the creationType in a ClassInstanceCreation expression. * @param ast The AST to create the nodes for. * @param typeBinding binding representing the given class type * @param importRewrite the import rewrite to use * @param importContext the import context used to determine which (null) annotations to consider * @return a Type suitable as the creationType in a ClassInstanceCreation expression. */ public static Type newCreationType(AST ast, ITypeBinding typeBinding, ImportRewrite importRewrite, ImportRewriteContext importContext) { if (typeBinding.isParameterizedType()) { Type baseType= newCreationType(ast, typeBinding.getTypeDeclaration(), importRewrite, importContext); IAnnotationBinding[] typeAnnotations= importContext.removeRedundantTypeAnnotations(typeBinding.getTypeAnnotations(), TypeLocation.NEW, typeBinding); for (IAnnotationBinding typeAnnotation : typeAnnotations) { ((AnnotatableType)baseType).annotations().add(importRewrite.addAnnotation(typeAnnotation, ast, importContext)); } ParameterizedType parameterizedType= ast.newParameterizedType(baseType); for (ITypeBinding typeArgument : typeBinding.getTypeArguments()) { typeArgument= StubUtility2Core.replaceWildcardsAndCaptures(typeArgument); parameterizedType.typeArguments().add(importRewrite.addImport(typeArgument, ast, importContext, TypeLocation.TYPE_ARGUMENT)); } return parameterizedType; } else { return importRewrite.addImport(typeBinding, ast, importContext, TypeLocation.NEW); } } }
dimensionAnnotations[dim]= new ArrayList<>(); for (IAnnotationBinding annotation : type.getTypeAnnotations()) { dimensionAnnotations[dim].add(imports.addAnnotation(annotation, ast, context)); for (IAnnotationBinding annotation : annotations) { if (StubUtility2Core.isCopyOnInheritAnnotation(annotation.getAnnotationType(), project, nullnessDefault, TypeLocation.PARAMETER)) var.modifiers().add(imports.addAnnotation(annotation, ast, context));
Object value = mvps[0].getValue(); if (value != null) result.setValue(addAnnotation(ast, value, context)); return result; } else { Object value = mvp.getValue(); if (value != null) mvpNode.setValue(addAnnotation(ast, value, context)); result.values().add(mvpNode);
Object value = mvps[0].getValue(); if (value != null) result.setValue(addAnnotation(ast, value, context)); return result; } else { Object value = mvp.getValue(); if (value != null) mvpNode.setValue(addAnnotation(ast, value, context)); result.values().add(mvpNode);
Object value = mvps[0].getValue(); if (value != null) result.setValue(addAnnotation(ast, value, context)); return result; } else { Object value = mvp.getValue(); if (value != null) mvpNode.setValue(addAnnotation(ast, value, context)); result.values().add(mvpNode);
IAnnotationBinding[] typeAnnotations= typeBinding.getTypeAnnotations(); for (IAnnotationBinding typeAnnotation : typeAnnotations) { dimension.annotations().add(importRewrite.addAnnotation(typeAnnotation, ast, importContext));
Object value = mvps[0].getValue(); if (value != null) result.setValue(addAnnotation(ast, value, context)); return result; } else { Object value = mvp.getValue(); if (value != null) mvpNode.setValue(addAnnotation(ast, value, context)); result.values().add(mvpNode);
Object value = mvps[0].getValue(); if (value != null) result.setValue(addAnnotation(ast, value, context)); return result; } else { Object value = mvp.getValue(); if (value != null) mvpNode.setValue(addAnnotation(ast, value, context)); result.values().add(mvpNode);