Java Code Examples for javax.lang.model.element.TypeElement#equals()

The following examples show how to use javax.lang.model.element.TypeElement#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityMetaFactory.java    From doma with Apache License 2.0 6 votes vote down vote up
void doOriginalStatesField(
    TypeElement classElement, VariableElement fieldElement, EntityMeta entityMeta) {
  if (entityMeta.hasOriginalStatesMeta()) {
    throw new AptException(Message.DOMA4125, fieldElement, new Object[] {});
  }
  if (classElement.equals(fieldElement.getEnclosingElement())) {
    if (!ctx.getMoreTypes()
        .isSameTypeWithErasure(fieldElement.asType(), classElement.asType())) {
      throw new AptException(Message.DOMA4135, fieldElement, new Object[] {});
    }
  }
  TypeElement enclosingElement =
      ctx.getMoreElements().toTypeElement(fieldElement.getEnclosingElement());
  if (enclosingElement == null) {
    throw new AptIllegalStateException(fieldElement.toString());
  }
  if (entityMeta.isImmutable() && classElement.equals(enclosingElement)) {
    throw new AptException(Message.DOMA4224, fieldElement, new Object[] {});
  }
  OriginalStatesMeta originalStatesMeta =
      new OriginalStatesMeta(classElement, fieldElement, enclosingElement);
  entityMeta.setOriginalStatesMeta(originalStatesMeta);
}
 
Example 2
Source File: AutoCodecProcessor.java    From bazel with Apache License 2.0 6 votes vote down vote up
private List<ExecutableElement> findGettersFromType(
    TypeElement encodedType, TypeElement builderTypeForFiltering)
    throws SerializationProcessingFailedException {
  List<ExecutableElement> result = new ArrayList<>();
  for (ExecutableElement method :
      ElementFilter.methodsIn(env.getElementUtils().getAllMembers(encodedType))) {
    if (!method.getModifiers().contains(Modifier.STATIC)
        && method.getModifiers().contains(Modifier.ABSTRACT)
        && method.getParameters().isEmpty()
        && method.getReturnType().getKind() != TypeKind.VOID
        && (!method.getReturnType().getKind().equals(TypeKind.DECLARED)
            || !builderTypeForFiltering.equals(
                env.getTypeUtils().asElement(method.getReturnType())))) {
      result.add(method);
    }
  }
  if (result.isEmpty()) {
    throw new SerializationProcessingFailedException(
        encodedType, "Couldn't find any properties for %s", encodedType);
  }
  return result;
}
 
Example 3
Source File: JavadocUtilities.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public static AnnotationMirror findDeprecated(CompilationInfo javac, Element elm) {
    TypeElement deprAnn = javac.getElements().getTypeElement("java.lang.Deprecated"); //NOI18N
    if (deprAnn == null) {
        String msg = String.format("Even though the source level of %s" + //NOI18N
                " is set to JDK5 or later, java.lang.Deprecated cannot" + //NOI18N
                " be found on the bootclasspath: %s", //NOI18N
                javac.getClasspathInfo().getClassPath(PathKind.SOURCE),
                javac.getClasspathInfo().getClassPath(PathKind.BOOT));
        Logger.getLogger(JavadocUtilities.class.getName()).warning(msg);
        return null;
    }
    for (AnnotationMirror annotationMirror : javac.getElements().getAllAnnotationMirrors(elm)) {
        if (deprAnn.equals(annotationMirror.getAnnotationType().asElement())) {
            return annotationMirror;
        }
    }
    return null;
}
 
Example 4
Source File: TypeUtil.java    From j2objc with Apache License 2.0 6 votes vote down vote up
public boolean isObjcSubtype(TypeElement type, TypeElement targetSupertype) {
  if (type == null) {
    return false;
  }
  if (type.equals(targetSupertype)) {
    return true;
  }
  TypeMirror superclass = type.getSuperclass();
  if (superclass != null && isObjcSubtype(getObjcClass(superclass), targetSupertype)) {
    return true;
  }
  for (TypeMirror intrface : type.getInterfaces()) {
    if (isObjcSubtype(getObjcClass(intrface), targetSupertype)) {
      return true;
    }
  }
  return false;
}
 
Example 5
Source File: WebServiceVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example 6
Source File: OuterReferenceResolver.java    From j2objc with Apache License 2.0 5 votes vote down vote up
private Scope findScopeForType(TypeElement type) {
  Scope scope = peekScope();
  while (scope != null) {
    if (scope.kind != ScopeKind.METHOD && type.equals(scope.type)) {
      return scope;
    }
    scope = scope.outer;
  }
  return null;
}
 
Example 7
Source File: PropertyWriterImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void addComments(ExecutableElement property, Content propertyDocTree) {
    TypeElement holder = (TypeElement)property.getEnclosingElement();
    if (!utils.getFullBody(property).isEmpty()) {
        if (holder.equals(typeElement) ||
                (!utils.isPublic(holder) || utils.isLinkable(holder))) {
            writer.addInlineComment(property, propertyDocTree);
        } else {
            Content link =
                    writer.getDocLink(LinkInfoImpl.Kind.PROPERTY_COPY,
                    holder, property,
                    utils.isIncluded(holder)
                            ? holder.getSimpleName() : holder.getQualifiedName(),
                        false);
            Content codeLink = HtmlTree.CODE(link);
            Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel,
                    utils.isClass(holder)
                            ? contents.descfrmClassLabel
                            : contents.descfrmInterfaceLabel);
            descfrmLabel.addContent(Contents.SPACE);
            descfrmLabel.addContent(codeLink);
            propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
            writer.addInlineComment(property, propertyDocTree);
        }
    }
}
 
Example 8
Source File: Utilities.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static Visibility getAccessModifiers(@NonNull CompilationInfo info, @NullAllowed TypeElement source, @NonNull TypeElement target) {
    if (target.getKind().isInterface()) {
        return Visibility.PUBLIC;
    }

    TypeElement outterMostSource = source != null ? info.getElementUtilities().outermostTypeElement(source) : null;
    TypeElement outterMostTarget = info.getElementUtilities().outermostTypeElement(target);

    if (outterMostTarget.equals(outterMostSource)) {
        return Visibility.PRIVATE;
    }

    Element sourcePackage;

    if (outterMostSource != null) {
        sourcePackage = outterMostSource.getEnclosingElement();
    } else if (info.getCompilationUnit().getPackageName() != null) {
        sourcePackage = info.getTrees().getElement(new TreePath(new TreePath(info.getCompilationUnit()), info.getCompilationUnit().getPackageName()));
    } else {
        sourcePackage = info.getElements().getPackageElement("");
    }

    Element targetPackage = outterMostTarget.getEnclosingElement();

    if (sourcePackage != null && sourcePackage.equals(targetPackage)) {
        return Visibility.PACKAGE_PRIVATE;
    }

    //TODO: protected?
    return Visibility.PUBLIC;
}
 
Example 9
Source File: Utils.java    From paperparcel with Apache License 2.0 5 votes vote down vote up
@Nullable
private static TypeMirror paramAsMemberOfImpl(
    Types types, DeclaredType type, TypeParameterElement param) {
  TypeElement paramEnclosingElement = (TypeElement) param.getEnclosingElement();
  TypeElement typeAsElement = (TypeElement) type.asElement();
  if (paramEnclosingElement.equals(typeAsElement)) {
    List<? extends TypeParameterElement> typeParamElements = typeAsElement.getTypeParameters();
    for (int i = 0; i < typeParamElements.size(); i++) {
      TypeParameterElement typeParamElement = typeParamElements.get(i);
      if (typeParamElement.equals(param)) {
        List<? extends TypeMirror> typeArguments = type.getTypeArguments();
        if (typeArguments.isEmpty()) {
          return types.erasure(param.asType());
        } else {
          return type.getTypeArguments().get(i);
        }
      }
    }
  }
  List<? extends TypeMirror> superTypes = types.directSupertypes(type);
  for (TypeMirror superType : superTypes) {
    if (superType.getKind() == TypeKind.DECLARED) {
      TypeMirror result = paramAsMemberOfImpl(types, (DeclaredType) superType, param);
      if (result != null) {
        return result;
      }
    }
  }
  return null;
}
 
Example 10
Source File: PullUpTransformer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static ModifiersTree removeAnnotations(WorkingCopy workingCopy, TreeMaker make,ModifiersTree oldOne, TreePath path) {
    TypeElement override = workingCopy.getElements().getTypeElement("java.lang.Override");
    if(override == null) {
        return oldOne;
    }
    List<AnnotationTree> newAnnotations = new LinkedList<>();
    for (AnnotationTree annotationTree : oldOne.getAnnotations()) {
        Element el = workingCopy.getTrees().getElement(new TreePath(path, annotationTree));
        if(!override.equals(el)) {
            newAnnotations.add(annotationTree);
        }
    }
    return make.Modifiers(oldOne, newAnnotations);
}
 
Example 11
Source File: TypeUtil.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public List<TypeElement> getObjcUpperBounds(TypeMirror t) {
  List<TypeElement> result = new ArrayList<>();
  for (TypeMirror bound : getUpperBounds(t)) {
    TypeElement elem = getObjcClass(bound);
    // NSObject is emmitted as "id".
    if (elem != null && !elem.equals(NS_OBJECT)) {
      result.add(elem);
    }
  }
  return result;
}
 
Example 12
Source File: WebServiceVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example 13
Source File: Imports.java    From spring-init with Apache License 2.0 5 votes vote down vote up
public void addImport(TypeElement owner, TypeElement imported) {
	this.included.add(imported);
	if (owner.equals(imported)) {
		return;
	}
	imports.computeIfAbsent(owner, key -> new LinkedHashSet<>()).add(imported);
	classify(imported);
}
 
Example 14
Source File: WebServiceVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example 15
Source File: WebServiceVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example 16
Source File: TypeModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static boolean isSubclass(TypeElement subType, TypeElement superType, ProcessingEnvironment env) {
    return !subType.equals(superType) && isSubElement(subType, superType);
}
 
Example 17
Source File: CreateRegistrationProcessor.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Iterable<? extends Completion> getCompletions(Element annotated, AnnotationMirror annotation, ExecutableElement attr, String userText) {
    if (processingEnv == null || annotated == null || !annotated.getKind().isClass()) {
        return Collections.emptyList();
    }

    if (   annotation == null
        || !"org.netbeans.api.editor.mimelookup.MimeRegistration".contentEquals(((TypeElement) annotation.getAnnotationType().asElement()).getQualifiedName())) {
        return Collections.emptyList();
    }

    if ("mimeType".contentEquals(attr.getSimpleName())) { // NOI18N
        return completeMimePath(annotated, annotation, attr, userText);
    }
    if (!"service".contentEquals(attr.getSimpleName())) {
        return Collections.emptyList();
    }

    TypeElement jlObject = processingEnv.getElementUtils().getTypeElement("java.lang.Object");

    if (jlObject == null) {
        return Collections.emptyList();
    }

    Collection<Completion> result = new LinkedList<Completion>();
    List<TypeElement> toProcess = new LinkedList<TypeElement>();

    toProcess.add((TypeElement) annotated);

    while (!toProcess.isEmpty()) {
        TypeElement c = toProcess.remove(0);

        result.add(new TypeCompletion(c.getQualifiedName().toString() + ".class"));

        List<TypeMirror> parents = new LinkedList<TypeMirror>();

        parents.add(c.getSuperclass());
        parents.addAll(c.getInterfaces());

        for (TypeMirror tm : parents) {
            if (tm == null || tm.getKind() != TypeKind.DECLARED) {
                continue;
            }

            TypeElement type = (TypeElement) processingEnv.getTypeUtils().asElement(tm);

            if (!jlObject.equals(type)) {
                toProcess.add(type);
            }
        }
    }

    return result;
}
 
Example 18
Source File: TypeModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static boolean isSubclass(TypeElement subType, TypeElement superType, ProcessingEnvironment env) {
    return !subType.equals(superType) && isSubElement(subType, superType);
}
 
Example 19
Source File: AccessorAttributesCollector.java    From immutables with Apache License 2.0 4 votes vote down vote up
private void processUtilityCandidateMethod(ExecutableElement utilityMethodCandidate, TypeElement originalType) {
  Name name = utilityMethodCandidate.getSimpleName();
  List<? extends VariableElement> parameters = utilityMethodCandidate.getParameters();

  TypeElement definingType = (TypeElement) utilityMethodCandidate.getEnclosingElement();
  boolean nonFinal = !utilityMethodCandidate.getModifiers().contains(Modifier.FINAL);
  boolean nonAbstract = !utilityMethodCandidate.getModifiers().contains(Modifier.ABSTRACT);

  if (isJavaLangObjectType(definingType)) {
    // We ignore methods of java.lang.Object
    return;
  }

  if (name.contentEquals(EQUALS_METHOD)
      && parameters.size() == 1
      && isJavaLangObjectType(parameters.get(0).asType())) {

    if (nonAbstract) {
      type.isEqualToDefined = true;
      type.isEqualToFinal = !nonFinal;

      if (!definingType.equals(originalType) && hasNonInheritedAttributes && nonFinal) {
        report(originalType)
            .warning(About.INCOMPAT,
                "Type inherits overriden 'equals' method but have some non-inherited attributes."
                + " Please override 'equals' with abstract method to have it generate. Otherwise override"
                + " with calling super implemtation to use custom implementation");
      }
    }
    return;
  }

  if (name.contentEquals(HASH_CODE_METHOD)
      && parameters.isEmpty()) {
    if (nonAbstract) {
      type.isHashCodeDefined = true;
      type.isHashCodeFinal = !nonFinal;

      // inherited non-abstract implementation
      if (!definingType.equals(originalType) && hasNonInheritedAttributes && nonFinal) {
        report(originalType)
            .warning(About.INCOMPAT,
                "Type inherits non-default 'hashCode' method but have some non-inherited attributes."
                + " Please override 'hashCode' with abstract method to have it generated. Otherwise override"
                + " with calling super implemtation to use custom implementation");
      }
    }
    return;
  }

  if (name.contentEquals(TO_STRING_METHOD)
      && parameters.isEmpty()) {
    if (nonAbstract) {
      type.isToStringDefined = true;

      // inherited non-abstract implementation
      if (!definingType.equals(originalType) && hasNonInheritedAttributes && nonFinal) {
        report(originalType)
            .warning(About.INCOMPAT,
                "Type inherits non-default 'toString' method but have some non-inherited attributes."
                + " Please override 'toString' with abstract method to have generate it. Otherwise override"
                + " with calling super implementation to use custom implementation");
      }
    }
    return;
  }
}
 
Example 20
Source File: InjectionPointParameterAnalyzer.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private void checkInjectionPointMetadata( VariableElement var,
        ExecutableElement method, TypeElement parent, WebBeansModel model,
        AtomicBoolean cancel , Result result )
{
    TypeElement injectionPointType = model.getCompilationController()
            .getElements().getTypeElement(AnnotationUtil.INJECTION_POINT);
    if (injectionPointType == null) {
        return;
    }
    Element varElement = model.getCompilationController().getTypes()
            .asElement(var.asType());
    if (!injectionPointType.equals(varElement)) {
        return;
    }
    if (cancel.get()) {
        return;
    }
    List<AnnotationMirror> qualifiers = model.getQualifiers(varElement,
            true);
    AnnotationHelper helper = new AnnotationHelper(
            model.getCompilationController());
    Map<String, ? extends AnnotationMirror> qualifiersFqns = helper
            .getAnnotationsByType(qualifiers);
    boolean hasDefault = model.hasImplicitDefaultQualifier(varElement);
    if (!hasDefault
            && qualifiersFqns.keySet().contains(AnnotationUtil.DEFAULT_FQN))
    {
        hasDefault = true;
    }
    if (!hasDefault || cancel.get()) {
        return;
    }
    try {
        String scope = model.getScope(parent);
        if (scope != null && !AnnotationUtil.DEPENDENT.equals(scope)) {
            result.addError(var, method, model, 
                    NbBundle.getMessage(InjectionPointParameterAnalyzer.class,"ERR_WrongQualifierInjectionPointMeta")); // NOI18N
        }
    }
    catch (CdiException e) {
        // this exception will be handled in the appropriate scope analyzer
        return;
    }
}