Copies annotation over to this coremap if not already set
17581
public static void copyUnsetAnnotations(CoreMap src, CoreMap dest) {
    Set<Class<?>> otherKeys = src.keySet();
    for (Class key : otherKeys) {
      if (!dest.has(key)) {
        dest.set(key, src.get(key));
      }
    }
  }
886145
function update(annotationObject, changeSet) {
  const updatedAnnotation = Object.assign({}, annotationObject, changeSet);

  let changeDetected = false;
  Object.keys(updatedAnnotation).forEach((key) => {
    if (updatedAnnotation[key] !== annotationObject[key]) {
      changeDetected = true;
    }
  });

  if (changeDetected) {
    generation += 1;
    updatedAnnotation.generation = generation;
  }

  return updatedAnnotation;
}
1138268
private void writeObject(java.io.ObjectOutputStream out) throws IOException
    {
        //
        // When serializing, compute sufficient information about the annotated element to
        // allow it to be reassociated later in readObject
        //
        if (_annotElem instanceof Class)
        {
            _elemClass = (Class)_annotElem;
            _elemDesc = null;   // non required
        }
        else if (_annotElem instanceof Field)
        {
            Field f = (Field)_annotElem;
            _elemClass = f.getDeclaringClass();
            _elemDesc = f.getName();
        }
        else if (_annotElem instanceof Method)
        {
            Method m = (Method)_annotElem;
            _elemClass = m.getDeclaringClass();
            _elemDesc = m.getName() + "(" + getMethodArgs(m) + ")";
        } 

        out.defaultWriteObject();
    }
896928
private Map<String, Element> cloneElementMap(final Map<String, Element> current) {
        final Map<String, Element> topicMetaTable = new HashMap<>(16);
        for (final Entry<String, Element> topicMetaItem: current.entrySet()) {
            topicMetaTable.put(topicMetaItem.getKey(), (Element) resultDoc.importNode(topicMetaItem.getValue(), true));
        }
        return topicMetaTable;
    }
926491
protected PropertyMap getAnnotationMap(AnnotatedElement annotElem)
    {
        Map annotCache = getPropertyMapCache();

        // If in the cache already , just return it
        if (annotCache.containsKey(annotElem))
            return (PropertyMap)annotCache.get(annotElem);

        //
        // Ask the associated ControlBeanContext to locate and initialize a PropertyMap, then
        // store it in the local cache.
        //
        PropertyMap map = getControlBeanContext().getAnnotationMap(annotElem);
        annotCache.put(annotElem, map);

        return map;
    }
625951
public static void recordDefaultAnnotationHandlerMappingInstance(Object obj) {
		if (debug) {
			System.out.println("SPRING_PLUGIN: Recording new instance of DefaultAnnotationHandlerMappingInstance");
		}
		defaultAnnotationHandlerMappingInstances.add(obj);
	}
609740
private void loadPropertyAnnotation(CodeBuilder b,
                                        StorableProperty property,
                                        StorablePropertyAnnotation annotation) {
        /* Example
           UserInfo.class.getMethod("setFirstName", new Class[] {String.class})
               .getAnnotation(LengthConstraint.class)
        */

        String methodName = annotation.getAnnotatedMethod().getName();
        boolean isAccessor = !methodName.startsWith("set");

        b.loadConstant(TypeDesc.forClass(property.getEnclosingType()));
        b.loadConstant(methodName);
        if (isAccessor) {
            // Accessor method has no parameters.
            b.loadNull();
        } else {
            // Mutator method has one parameter.
            b.loadConstant(1);
            b.newObject(TypeDesc.forClass(Class[].class));
            b.dup();
            b.loadConstant(0);
            b.loadConstant(TypeDesc.forClass(property.getType()));
            b.storeToArray(TypeDesc.forClass(Class[].class));
        }
        b.invokeVirtual(Class.class.getName(), "getMethod",
                        TypeDesc.forClass(Method.class), new TypeDesc[] {
                            TypeDesc.STRING, TypeDesc.forClass(Class[].class)
                        });
        b.loadConstant(TypeDesc.forClass(annotation.getAnnotationType()));
        b.invokeVirtual(Method.class.getName(), "getAnnotation",
                        TypeDesc.forClass(Annotation.class), new TypeDesc[] {
                            TypeDesc.forClass(Class.class)
                        });
        b.checkCast(TypeDesc.forClass(annotation.getAnnotationType()));
    }
1295337
public void visitAnnotation(@DottedClassName String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) {
        if (DEBUG) {
            System.out.println("Annotation: " + annotationClass);
            for (Map.Entry<String, ElementValue> e : map.entrySet()) {
                System.out.println("    " + e.getKey());
                System.out.println(" -> " + e.getValue());
            }
        }
    }
120184
@Override
	public Void visitAnnotation(AnnotationMirror a, String p) {
		if (AnnotationAttributeType.UPDATE_TASKS.getValue().equals(p)) {
			inTasks = true;
		}

		for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : a.getElementValues().entrySet()) {
			String key = entry.getKey().getSimpleName().toString();
			entry.getValue().accept(this, key);
		}

		if (AnnotationAttributeType.UPDATE_TASKS.getValue().equals(p)) {
			inTasks = false;
		}

		return null;
	}
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);
      }
   }
1087591
public static PropertyMap getAnnotationMap(ControlBeanContext cbc, AnnotatedElement annotElem)
    {
        if ( cbc == null )
            return new AnnotatedElementMap(annotElem);

        return cbc.getAnnotationMap(annotElem);
    }
1024962
function() {
			var annotationModel = this.getAnnotationModel();
			var textModel = this.getModel();
			if (textModel.getBaseModel) {
				textModel = textModel.getBaseModel();
			}
			var type = AT.ANNOTATION_HIGHLIGHTED_LINE;
			var annotations = annotationModel.getAnnotations(0, textModel.getCharCount());
			var remove = null;
			while (annotations.hasNext()) {
				var annotation = annotations.next();
				if (annotation.type === type) {
					remove = annotation;
					break;
				}
			}
			if (remove) {
				annotationModel.removeAnnotation(remove);
			}
		}
538141
function clone(map) {
  return map instanceof SourceMapGenerator
    ? SourceMapGenerator.fromSourceMap(new SourceMapConsumer(map.toJSON()))
    : map;
}
473215
private static boolean checkAnnotation(AnnotationsAttribute invisible, AnnotationsAttribute visible,
            String annotationName) {
        boolean exist1 = false;
        boolean exist2 = false;
        if (invisible != null) {
            exist1 = invisible.getAnnotation(annotationName) != null;
        }
        if (visible != null) {
            exist2 = visible.getAnnotation(annotationName) != null;
        }
        return exist1 || exist2;
    }
902190
private static Map<String, Object> changeAnnotationValuesToMap(Annotation annotation,
			Class<? extends Annotation> type) {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("AnnotationExist", true);
		for (Method method : type.getDeclaredMethods())
			try {
				result.put(method.getName(), method.invoke(annotation, (Object[]) null));
			} catch (Exception e) {// NOSONAR
			}
		return result;
	}
1228963
private void onSuperClass(Class<?> clazz, List<Field> keys)
    {

        Class<?> superClass = clazz.getSuperclass();
        if (superClass != null
                && (superClass.isAnnotationPresent(MappedSuperclass.class) || superClass
                        .isAnnotationPresent(Entity.class)))
        {

            while (superClass != null
                    && (superClass.isAnnotationPresent(MappedSuperclass.class) || superClass
                            .isAnnotationPresent(Entity.class)))
            {
                for (Field field : superClass.getDeclaredFields())
                {

//                    if (checkValidField(field))
//                    {

                        onIdField(field, superClass);
                        if (field.isAnnotationPresent(Id.class))
                        {
                            keys.add(field);
                            // validate @GeneratedValue annotation if given
                            if (field.isAnnotationPresent(GeneratedValue.class))
                            {
                                validateGeneratedValueAnnotation(superClass, field);
                            }
                        }
                        else if (field.isAnnotationPresent(EmbeddedId.class))
                        {
                            keys.add(field);
                        }

                   // }
                }

                if (keys.size() > 0)
                {
                    onEntityKey(keys, superClass);
                    break;
                }
                superClass = superClass.getSuperclass();

            }
        }

        onEntityKey(keys, clazz);

    }
59026
public synchronized void setDelegateMap(PropertyMap delegateMap)
    {
        if (!isCompatibleClass(delegateMap.getMapClass()))
            throw new IllegalArgumentException("The delegate map type (" + delegateMap.getMapClass() + " is an incompatible type with " + _mapClass);

        _delegateMap = delegateMap;
    }