/** * Combine the pragma flags for a given list of annotations. * * @param annotations * @param className */ private static int getMethodPragmaFlags(VmAnnotation[] annotations, String className) { int flags = 0; for (VmAnnotation a : annotations) { final String typeDescr = a.getTypeDescriptor(); for (PragmaAnnotation ma : METHOD_ANNOTATIONS) { if (ma.typeDescr.equals(typeDescr)) { ma.checkPragmaAllowed(className); flags |= ma.flags; } } } return flags; }
/** * Combine the pragma flags for a given list of annotations. * * @param annotations * @param className */ private static int getClassPragmaFlags(VmAnnotation[] annotations, String className) { int flags = 0; for (VmAnnotation a : annotations) { final String typeDescr = a.getTypeDescriptor(); for (PragmaAnnotation ma : CLASS_ANNOTATIONS) { if (ma.typeDescr.equals(typeDescr)) { ma.checkPragmaAllowed(className); flags |= ma.flags; } } } for (String name : SHARED_STATICS_CLASSNAMES) { if (className.equals(name)) { System.out.println("FOUND IT: " + className); flags |= TypePragmaFlags.SHAREDSTATICS; break; } } return flags; }