Performs semantic validation of input Declarations that are annotated with
annotations claimed by this CoreAnnotationProcessor.
189620
public void check()
        throws FatalCompileTimeException
    {
        HashSet declsToCheck = new HashSet();

        //
        // First, build up the Set of declarations to check.  We don't want any duplicates.
        //
        for ( int i = 0; i < _atds.length; ++i )
        {
            AnnotationTypeDeclaration atd = _atds[i];
            Declaration[] decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith( atd );
            for ( int j = 0; j < decls.length; j++ )
            {
                declsToCheck.add( decls[j] );
            }
        }

        // Now, check the declarations.
        check(declsToCheck);
    }
492727
protected final void verify() {
        collectInitialisers();
        verifyCandidates();
        verifyInitialisers();
        collectPossibleInitialValues();
        verifyPossibleInitialValues();
        collectEffectiveAssignmentInstructions();
        verifyEffectiveAssignmentInstructions();
        collectAssignmentGuards();
        verifyAssignmentGuards();
        end();
    }
237611
void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) {
        if (annotationInfo != null) {
            annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(),
                    RelType.METHOD_ANNOTATIONS, RelType.CLASSES_WITH_METHOD_ANNOTATION);
        }
        if (parameterAnnotationInfo != null) {
            for (int i = 0; i < parameterAnnotationInfo.length; i++) {
                final AnnotationInfo[] pai = parameterAnnotationInfo[i];
                if (pai != null && pai.length > 0) {
                    boolean hasRepeatableAnnotation = false;
                    for (final AnnotationInfo ai : pai) {
                        if (allRepeatableAnnotationNames.contains(ai.getName())) {
                            hasRepeatableAnnotation = true;
                            break;
                        }
                    }
                    if (hasRepeatableAnnotation) {
                        final AnnotationInfoList aiList = new AnnotationInfoList(pai.length);
                        for (final AnnotationInfo ai : pai) {
                            aiList.add(ai);
                        }
                        // There is currently no RelType.CLASSES_WITH_METHOD_PARAMETER_ANNOTATION, so set
                        // RelType values to null
                        aiList.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(), null,
                                null);
                        parameterAnnotationInfo[i] = aiList.toArray(new AnnotationInfo[0]);
                    }
                }
            }
        }
    }
624683
private <A extends Annotation> void processMemberAnnotations(int processorIndex,
                                                                 InjectionProcessorProvider<A, ?> provider,
                                                                 Member[] members,
                                                                 AnnotatedElement[] annotatedMembers)
                    throws InjectionException
    {
        Class<A> annClass = provider.getAnnotationClass();
        if (annClass != null)
        {
            for (int i = 0; i < members.length; i++)
            {
                A ann = annotatedMembers[i].getAnnotation(annClass);
                if (ann != null)
                {
                    Member member = members[i];
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "found member annotation " + toStringSecure(ann) + " on " + member);

                    InjectionProcessor<A, ?> processor = getProcessor(processorIndex, provider);
                    addOrMergeInjectionBinding(processorIndex, processor, member.getDeclaringClass(), member, ann);
                }
            }
        }
    }
1231708
@Override
	public void validate()
	{

		boolean flagA = !controller.isEnableSQLDatabaseOutput();
		boolean flagB = controller.isMultipleOutputFiles();

		OutputCompressionEnum oce = controller.getOutputCompression();

		enableZipEncodingCompression.setSelected(controller
				.isZipCompressionEnabled());

		disableOutputCompression.setSelected(oce == OutputCompressionEnum.None);

		enableBZip2OutputCompression
				.setSelected(oce == OutputCompressionEnum.BZip2);

		activateDataFileOutput.setSelected(controller.isEnableDataFileOutput());

		outputLabel.setEnabled(flagA);
		outputPathField.setEnabled(flagA);

		enableZipEncodingCompression.setEnabled(flagA);

		outputCompression.setEnabled(flagA);
		disableOutputCompression.setEnabled(flagA);

		enable7ZipOutputCompression.setEnabled(flagA
				&& controller.is7ZipEnabled());

		enable7ZipOutputCompression
			.setSelected(oce == OutputCompressionEnum.SevenZip);

		enableBZip2OutputCompression.setEnabled(flagA);

		//Enable multiple output files only for uncompressed output
		enableMultipleOutputFiles.setEnabled(flagA&&(oce == OutputCompressionEnum.None));
		enableMultipleOutputFiles.setSelected(flagB);

		outputSizeLimitLabel.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));
		outputSizeLimitField.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));


	}
641002
def parse_declarations(input = @tokens, options = {})
      input = TokenScanner.new(input) unless input.is_a?(TokenScanner)
      consume_declarations(input, options)
    end
190498
public AnnotationValidator createAnnotationValidator(ValidateWith validateWithAnnotation) {
        AnnotationValidator validator = VALIDATORS_FOR_ANNOTATION_TYPES.get(validateWithAnnotation);
        if (validator != null) {
            return validator;
        }

        Class<? extends AnnotationValidator> clazz = validateWithAnnotation.value();
        try {
            AnnotationValidator annotationValidator = clazz.newInstance();
            VALIDATORS_FOR_ANNOTATION_TYPES.putIfAbsent(validateWithAnnotation, annotationValidator);
            return VALIDATORS_FOR_ANNOTATION_TYPES.get(validateWithAnnotation);
        } catch (Exception e) {
            throw new RuntimeException("Exception received when creating AnnotationValidator class " + clazz.getName(), e);
        }
    }
728066
@SuppressWarnings( "unchecked" )
    protected void processModifiersOfMethodDeclaration( MethodDeclaration methodDeclaration,
                                                        MethodMetadata methodMetadata ) {
        List<IExtendedModifier> extendedModifiers = methodDeclaration.modifiers();
        for (IExtendedModifier extendedModifier : extendedModifiers) {
            if (extendedModifier.isAnnotation()) {
                Annotation annotation = (Annotation)extendedModifier;
                methodMetadata.getAnnotations().add(createAnnotationMetadataFor(annotation));
            } else {
                Modifier modifier = (Modifier)extendedModifier;
                methodMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
            }
        }
    }
873366
public void validate(FacesContext context,
                         UIComponent  component,
                         Object       value) throws ValidatorException {
	if (null == context || null == component) {
	    throw new NullPointerException();
	}
        try {
            methodBinding.invoke(context, new Object[] {context, component, 
							value});
        } 
	catch (EvaluationException ee) {
	    Throwable cause = this.getExpectedCause(ValidatorException.class,
						    ee);
	    if (cause instanceof ValidatorException) {
		throw ((ValidatorException) cause);
	    }
	    if (cause instanceof RuntimeException) {
		throw ((RuntimeException) cause);
	    }
	    throw new IllegalStateException(ee);
        }
	
	
    }
508689
private Description checkAnnotations(
      Tree tree,
      int treePos,
      List<? extends AnnotationTree> annotations,
      Comment danglingJavadoc,
      int firstModifierPos,
      int lastModifierPos,
      VisitorState state) {
    SuggestedFix.Builder builder = SuggestedFix.builder();
    List<AnnotationTree> moveBefore = new ArrayList<>();
    List<AnnotationTree> moveAfter = new ArrayList<>();

    boolean annotationProblem = false;
    for (AnnotationTree annotation : annotations) {
      int annotationPos = ((JCTree) annotation).getStartPosition();
      if (annotationPos <= firstModifierPos) {
        continue;
      }
      AnnotationType annotationType =
          ASTHelpers.getAnnotationType(annotation, getSymbol(tree), state);
      if (annotationPos >= lastModifierPos) {
        if (tree instanceof ClassTree || annotationType == AnnotationType.DECLARATION) {
          annotationProblem = true;
          moveBefore.add(annotation);
        }
      } else {
        annotationProblem = true;
        if (tree instanceof ClassTree
            || annotationType == AnnotationType.DECLARATION
            || annotationType == null) {
          moveBefore.add(annotation);
        } else {
          moveAfter.add(annotation);
        }
      }
    }
    if (annotationProblem) {
      for (AnnotationTree annotation : moveBefore) {
        builder.delete(annotation);
      }
      for (AnnotationTree annotation : moveAfter) {
        builder.delete(annotation);
      }
      String javadoc =
          danglingJavadoc == null ? "" : removeJavadoc(state, treePos, danglingJavadoc, builder);
      builder
          .replace(
              firstModifierPos,
              firstModifierPos,
              String.format("%s%s ", javadoc, joinSource(state, moveBefore)))
          .replace(
              lastModifierPos, lastModifierPos, String.format("%s ", joinSource(state, moveAfter)));
      ImmutableList<String> names =
          annotations.stream()
              .map(ASTHelpers::getSymbol)
              .filter(Objects::nonNull)
              .map(Symbol::getSimpleName)
              .map(a -> "@" + a)
              .collect(toImmutableList());
      String flattened = names.stream().collect(joining(", "));
      String isAre = names.size() > 1 ? "are not type annotations" : "is not a type annotation";
      String message =
          String.format(
              "%s %s, so should appear before any modifiers and after Javadocs.", flattened, isAre);
      return buildDescription(tree).setMessage(message).addFix(builder.build()).build();
    }
    return NO_MATCH;
  }
697143
private void processAnnotations(final Field property) throws CoreException {
        // For each field annotation we will attach an event handler
        for (final Annotation a : property.getAnnotations()) {

            if (EventTarget.class.isAssignableFrom(property.getType())) {

                // Manage only JRebirth OnXxxxx annotations
                if (a.annotationType().getName().startsWith(BASE_ANNOTATION_NAME)) {

                    try {
                        // Retrieve the property value
                        final EventTarget target = (EventTarget) property.get(this);

                        // Process the annotation if the node is not null
                        if (target != null && controller() instanceof AbstractController) {
                            addHandler(target, a);
                        }

                    } catch (IllegalArgumentException | IllegalAccessException e) {
                        LOGGER.log(UIMessages.NODE_ANNO_PROCESSING_FAILURE, e, this.getClass().getName(), property.getName());
                    }
                }

                // Manage only JRebirth OnFinished annotations
            } else if (Animation.class.isAssignableFrom(property.getType())
                    && OnFinished.class.getName().equals(a.annotationType().getName())) {

                try {
                    // Retrieve the property value
                    final Animation animation = (Animation) property.get(this);

                    // Process the annotation if the node is not null
                    if (animation != null && controller() instanceof AbstractController) {
                        addHandler(animation, a);
                    }

                } catch (IllegalArgumentException | IllegalAccessException e) {
                    LOGGER.log(UIMessages.ANIM_ANNO_PROCESSING_FAILURE, e, this.getClass().getName(), property.getName());
                }

            }

        }
    }
316190
private void annotate(Parse parse, JCas cas, Constituent parent)
			throws SecurityException, IllegalArgumentException,
			ClassNotFoundException, NoSuchMethodException,
			InstantiationException, IllegalAccessException,
			InvocationTargetException {
		Constituent cons = null;
		Span span = parse.getSpan();
		String label = parse.getType();
		String labelCat;
		String[] funCatlabels = null;

		if (!label.equals(ParserME.TOK_NODE)) {
			int start = offsetMap.getMapping(span.getStart());
			int end = offsetMap.getMapping(span.getEnd());

			if (fun == true && label.contains("-")) {
				funCatlabels = label.split("-");
				labelCat = funCatlabels[0];

			} else
				labelCat = label;

			String casLabel = mapTable.get(labelCat);
			// if there is mapping between OpenNLP Parser constituent label and
			// CAS label

			if (casLabel != null) {
				cons = (Constituent) AnnotationTools.getAnnotationByClassName(
						cas, tagSet);

				cons.setBegin(start);
				cons.setEnd(end);
				cons.setComponentId(COMPONENT_ID);
				cons.setCat(casLabel);
				Class c = cons.getClass();

				makeFunAnnotations(cons, funCatlabels);

				if (parent != null)
					cons.setParent(parent);

				cons.addToIndexes();
			}

			Parse[] children = parse.getChildren();

			for (int i = 0; i < children.length; i++) {
				annotate(children[i], cas, cons);
			}

		}

	}
44877
private static void validateJndiLookup(String lookupString, Annotated annotated, Class<?> declaringClass, CDIArchive cdiArchive) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "validateJndiLookup", new Object[] { Util.identity(annotated), declaringClass, cdiArchive });
        }
        // We need to set a current component before doing anything to do with JNDI
        CDIRuntime cdiRuntime = cdiArchive.getCDIRuntime();
        try {
            cdiRuntime.beginContext(cdiArchive);
            InitialContext c = new InitialContext();

            validateJndiLookup(c, lookupString, annotated, declaringClass, cdiArchive);

        } catch (NamingException ex) {
            // Failed to look up the object, just return without failing validation
        } catch (CDIException e) {
            throw new IllegalStateException(e);
        } finally {
            cdiRuntime.endContext();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "validateJndiLookup", new Object[] { Util.identity(annotated) });
        }
    }
1183634
private Type enterSyntheticAnnotation(String name) {
        ClassType type = (ClassType)enterClass(name);
        ClassSymbol sym = (ClassSymbol)type.tsym;
        sym.completer = null;
        sym.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
        sym.erasure_field = type;
        sym.members_field = new Scope(sym);
        type.typarams_field = List.nil();
        type.allparams_field = List.nil();
        type.supertype_field = annotationType;
        type.interfaces_field = List.nil();
        return type;
    }
35023
private void initValidation() {
        // Create validators and collect the results
        SimpleProperty<Result> resultCollector1 = new SimpleProperty<Result>();
        createValidator(textField1, new StickerFeedback(textField1), resultCollector1);
        SimpleProperty<Result> resultCollector2 = new SimpleProperty<Result>();
        createValidator(textField2, new ColorFeedback(textField2, false), resultCollector2);
        SimpleProperty<Result> resultCollector3 = new SimpleProperty<Result>();
        createValidator(textField3, new ColorFeedback(textField3, true), resultCollector3);
        SimpleProperty<Result> resultCollector4 = new SimpleProperty<Result>();
        createValidator(textField4, new IconFeedback(textField4, false), resultCollector4);
        SimpleProperty<Result> resultCollector5 = new SimpleProperty<Result>();
        createValidator(textField5, new IconFeedback(textField5, true), resultCollector5);

        // Enable Apply button only when all fields are valid
        read(resultCollector1, resultCollector2, resultCollector3, resultCollector4, resultCollector5) //
                .transform(new CollectionElementTransformer<Result, Boolean>(new ResultToBooleanTransformer())) //
                .transform(new AndBooleanAggregator()) //
                .write(new ComponentEnabledProperty(applyButton));
    }
364208
public static boolean isAnnotationPresent(Annotation[] annotations,
      Class<? extends Annotation> cls) {
    for (Annotation annotation : annotations) {
      if (cls.isInstance(annotation)) {
        return true;
      }
    }
    return false;
  }
1198581
private static void checkFieldsDefinitions(SQLiteModelMethod method, Class<? extends Annotation> annotation) {
		List<String> includedFields = AnnotationUtility.extractAsStringArray(method.getElement(), annotation, AnnotationAttributeType.FIELDS);
		List<String> excludedFields = AnnotationUtility.extractAsStringArray(method.getElement(), annotation, AnnotationAttributeType.EXCLUDED_FIELDS);

		// both elements can not be defined
		if (includedFields.size() > 0 && excludedFields.size() > 0) {
			throw (new IncompatibleAttributesInAnnotationException(method.getParent(), method, method.getAnnotation(annotation), AnnotationAttributeType.FIELDS,
					AnnotationAttributeType.EXCLUDED_FIELDS));
		}
	}