Finds @UsedByPerson annotations.
432260
private void findUsedByPersonAnnotations(Component component, String typeName) {
        try {
            Class<?> type = getTypeRepository().loadClass(typeName);
            UsedByPerson[] annotations = type.getAnnotationsByType(UsedByPerson.class);
            for (UsedByPerson annotation : annotations) {
                String name = annotation.name();
                String description = annotation.description();
                String technology = annotation.technology();

                Person person = component.getModel().getPersonWithName(name);
                if (person != null) {
                    person.uses(component, description, technology);
                } else {
                    log.warn("A person named \"" + name + "\" could not be found.");
                }
            }
        } catch (ClassNotFoundException e) {
            log.warn("Could not load type " + typeName);
        }
    }
1251148
public Set<Method> getMethodsWithAnyParamAnnotated(Annotation annotation) {
        return filter(getMethodsWithAnyParamAnnotated(annotation.annotationType()), withAnyParameterAnnotation(annotation));
    }
124004
private static Set<Annotation> getAnnotations(final Annotation[] annotations, final Class<? extends Annotation> neededAnnotationType) {
        final Set<Annotation> ret = new HashSet<>();

        for (final Annotation annotation : annotations) {
            annotation.annotationType().getAnnotations();
            final Annotation[] metaAnnotations = annotation.annotationType().getAnnotations();
            for (final Annotation metaAnnotation : metaAnnotations) {
                if (metaAnnotation.annotationType().equals(neededAnnotationType)) {
                    ret.add(annotation);
                }
            }
        }

        return ret;
    }
1210180
private void findPrinters() {
        mOauthObservable.subscribe(new Action1<String>() {
            @Override
            public void call(final String token) {
                searchPrinters(token).subscribe(new Action1<JacksonPrinterSearchResult>() {
                    @Override
                    public void call(JacksonPrinterSearchResult result) {
                        onPrinterSearchResult(result);
                    }
                }, mShowPrinterNotFoundAction);
            }
        }, mAuthErrorAction);
    }
1221070
@Deprecated
    public List<String> getUsers() {
        String value = getParameter(UsernameActivationStrategy.PARAM_USERS);
        if (Strings.isNotBlank(value)) {
            return Strings.splitAndTrim(value, ",");
        }
        return Collections.emptyList();
    }
1340653
public Iterable<? extends Completion> getCompletions(Element element,
                                                         AnnotationMirror annotation,
                                                         ExecutableElement member,
                                                         String userText) {
        return Collections.emptyList();
    }
393841
def get_unused_list_annotation_values(graph) -> Mapping[str, Set[str]]:
    
    result = {}
    for annotation, values in graph.annotation_list.items():
        used_values = get_annotation_values(graph, annotation)
        if len(used_values) == len(values):  # all values have been used
            continue
        result[annotation] = set(values) - used_values
    return result
999742
private static void inspectRecursively(Class<?> c, List<Method> s, Class<? extends Annotation> annotationType) {

      for (Method m : c.getDeclaredMethods()) {
         // don't bother if this method has already been overridden by a subclass
         if (notFound(m, s) && m.isAnnotationPresent(annotationType)) {
            s.add(m);
         }
      }

      if (!c.equals(Object.class)) {
         if (!c.isInterface()) {
            inspectRecursively(c.getSuperclass(), s, annotationType);
         }
         for (Class<?> ifc : c.getInterfaces()) inspectRecursively(ifc, s, annotationType);
      }
   }
219675
@Override
    public List<AnnotationInfoImpl> getAnnotations() {
        if (annotations != null) {
            return annotations;
        }

        // Several cases where superclasses contribute no annotations.  In
        // each of these cases case, simply re-use the declared annotations
        // collection.
        //
        // (One case: All of the inheritable superclass annotations is
        // overridden by the immediate class, is not detected.)

        ClassInfoImpl useSuperClass = getSuperclass(); // Null for 'java.lang.Object'; null for interfaces.  
        if (useSuperClass == null) {
                annotations = declaredAnnotations;
            return annotations;
                    }

        // Retrieve *all* annotations of the superclass.  The effect
        // is to recurse across annotations of all superclasses.

        List<AnnotationInfoImpl> superAnnos = useSuperClass.getAnnotations();
        if (superAnnos.isEmpty()) {
            annotations = declaredAnnotations;
            return annotations;
                }

        Map<String, AnnotationInfoImpl> allAnnotations =
                        new HashMap<String, AnnotationInfoImpl>(superAnnos.size() + declaredAnnotations.size(), 1.0f);

        boolean sawInherited = false;
        for (AnnotationInfoImpl superAnno : superAnnos) {
            if (sawInherited = superAnno.isInherited()) {
                allAnnotations.put(superAnno.getAnnotationClassName(), superAnno);
            }
                }

        if (!sawInherited) {
            annotations = declaredAnnotations;
            return annotations;
        }

        // Make sure to add the declared annotations *after* adding the super class
        // annotations.  The immediate declared annotations have precedence.

        // We could test the number of overwritten annotations against the
        // number of inherited annotations.  That case seems infrequent, and
        // is not implemented.

        for (AnnotationInfoImpl declaredAnno : declaredAnnotations) {
            AnnotationInfoImpl overwrittenAnno = allAnnotations.put(declaredAnno.getAnnotationClassName(), declaredAnno);
            if (overwrittenAnno != null) {
                // NO-OP: But maybe we want to log this
            }
        }

        annotations = new ArrayList<AnnotationInfoImpl>(allAnnotations.values());
        return annotations;
    }
764450
private static <A extends Annotation> LinkedHashSet<String> extractFieldsFromAnnotation(final SQLiteModelMethod method, Class<A> annotationClazz, final boolean includePrimaryKey) {
		final SQLiteEntity entity = method.getEntity();

		List<String> annotatedFieldValues = AnnotationUtility.extractAsStringArray(method.getElement(), annotationClazz, AnnotationAttributeType.FIELDS);
		List<String> annotatedExcludedFieldValues = AnnotationUtility.extractAsStringArray(method.getElement(), annotationClazz, AnnotationAttributeType.EXCLUDED_FIELDS);
		CollectionUtils.trim(annotatedFieldValues);
		CollectionUtils.trim(annotatedExcludedFieldValues);

		final One<Integer> count = new One<>(0);

		// extract properties from managed bean
		final Set<String> allFields = new LinkedHashSet<>();
		forEachFields(method, new OnPropertyListener() {

			@Override
			public void onProperty(SQLProperty item) {
				if (!item.isPrimaryKey() || (item.isPrimaryKey() && includePrimaryKey)) {
					allFields.add(item.getName());
				}

				if (TypeUtility.isEquals(item.getPropertyType().getTypeName(), typeName(entity.getElement()))) {
					count.value0++;
				}
			}
		});

		// use attribute includedFields and excludedFields to mantain or remove
		// properties from selected set.
		if (annotatedFieldValues.size() == 0 && annotatedExcludedFieldValues.size() == 0) {
			// if no fields was selected, select all
			annotatedFieldValues.clear();
			annotatedFieldValues.addAll(allFields);
		} else if (annotatedExcludedFieldValues.size() > 0) {
			for (String fieldName : annotatedExcludedFieldValues) {
				if (!entity.contains(fieldName)) {
					AssertKripton.failUnknownPropertyInJQLException(method, annotationClazz, AnnotationAttributeType.EXCLUDED_FIELDS, fieldName);
				}
			}

			allFields.removeAll(annotatedExcludedFieldValues);

			annotatedFieldValues.clear();
			annotatedFieldValues.addAll(allFields);
		}
		LinkedHashSet<String> result = new LinkedHashSet<>();
		result.addAll(annotatedFieldValues);

		return result;
	}
518591
def get_all(self, name):
        
        return [annot for annot in self.all_annotations if annot.name == name]
251745
Collection<Method> getRelevantGetters(Class<?> clazz) {
        synchronized (getterCache) {
            if ( !getterCache.containsKey(clazz) ) {
                List<Method> relevantGetters = new LinkedList<Method>();
                for ( Method m : clazz.getMethods() ) {
                    if ( isRelevantGetter(m) ) {
                        relevantGetters.add(m);
                    }
                }
                getterCache.put(clazz, relevantGetters);
            }
        }
        return getterCache.get(clazz);
    }
360957
private Map<String, Set<String>> scanForAnnotatedClasses(Set<URL> urls) throws IOException {
        AnnotationDB db = new AnnotationDB();
        db.setScanClassAnnotations(true);
        db.setScanFieldAnnotations(false);
        db.setScanMethodAnnotations(false);
        db.setScanParameterAnnotations(false);
      
        db.scanArchives(urls.toArray(new URL[urls.size()]));
        return db.getAnnotationIndex();
        
    }
1336379
private static List<Method> getAnnotatedMethodsFromChildToParent(Class<?> clazz, Class<? extends Annotation> annotation,
      Logger log) {
    List<Method> methodsToRun = new ArrayList<Method>();
    while(clazz != null) {
      List<Method> newMethods = getMethodsWithAnnotation(clazz, annotation, log);
      for(Method newMethod : newMethods) {
        if(containsMethod(newMethod, methodsToRun)) {
          removeMethodByName(newMethod, methodsToRun);
        } else {
          methodsToRun.add(newMethod);
        }
      }
      clazz = clazz.getSuperclass();
      if(clazz != null && clazz.equals(Object.class)) {
        clazz = null;
      }
    }
    return methodsToRun;
  }
1079079
static Annotation[] findAndSortAnnotations(Annotation annotation) {
        final Annotation[] metaAnnotations = annotation.annotationType().getAnnotations();
        Arrays.sort(metaAnnotations, new Comparator<Annotation>() {
            @Override
            public int compare(Annotation o1, Annotation o2) {
                if (o1 instanceof ChameleonTarget) {
                    return -1;
                }

                if (o2 instanceof ChameleonTarget) {
                    return 1;
                }

                return 0;

            }
        });
        return metaAnnotations;
    }
316844
private void findUsesComponentAnnotations(Component component, String typeName) {
        try {
            Class type = getTypeRepository().loadClass(typeName);
            for (Field field : type.getDeclaredFields()) {
                UsesComponent annotation = field.getAnnotation(UsesComponent.class);
                if (annotation != null) {
                    String name = field.getType().getCanonicalName();
                    String description = field.getAnnotation(UsesComponent.class).description();
                    String technology = annotation.technology();

                    Component destination = componentFinder.getContainer().getComponentOfType(name);
                    if (destination != null) {
                        for (Relationship relationship : component.getRelationships()) {
                            if (relationship.getDestination() == destination && StringUtils.isNullOrEmpty(relationship.getDescription())) {
                                // only change the details of relationships that have no description
                                component.getModel().modifyRelationship(relationship, description, technology);
                            }
                        }
                    } else {
                        log.warn("A component of type \"" + name + "\" could not be found.");
                    }
                }
            }
        } catch (ClassNotFoundException e) {
            log.warn("Could not load type " + typeName);
        }
    }
1153786
protected void obtainFindBugsMarkers() {
        // Delete old markers
        markers.clear();
        if (editor == null || ruler == null) {
            return;
        }

        // Obtain all markers in the editor
        IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class);
        if(resource == null){
            return;
        }
        IMarker[] allMarkers = MarkerUtil.getMarkers(resource, IResource.DEPTH_ZERO);
        if(allMarkers.length == 0) {
            return;
        }
        // Discover relevant markers, i.e. FindBugsMarkers
        AbstractMarkerAnnotationModel model = getModel();
        IDocument document = getDocument();
        for (int i = 0; i < allMarkers.length; i++) {
            if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
                if (MarkerUtil.isFindBugsMarker(allMarkers[i])) {
                    markers.add(allMarkers[i]);
                }
            }
        }
    }