public ClassAnnotation getTopLevelClass() { int firstDollar = className.indexOf('$'); if (firstDollar <= 0) { return this; } return new ClassAnnotation(className.substring(0, firstDollar)); }
/** * Factory method to create a ClassAnnotation from a ClassDescriptor. * * @param classDescriptor * the ClassDescriptor * @return the ClassAnnotation */ public static ClassAnnotation fromClassDescriptor(ClassDescriptor classDescriptor) { return new ClassAnnotation(classDescriptor.toDottedClassName()); }
/** * Add a class annotation. If this is the first class annotation added, it * becomes the primary class annotation. * * @param className * the name of the class * @param sourceFileName * the source file of the class * @return this object */ @Nonnull public BugInstance addClass(String className, String sourceFileName) { ClassAnnotation classAnnotation = new ClassAnnotation(className, sourceFileName); add(classAnnotation); return this; }
/** * Add a class annotation for the classNode. * * @param classNode * the ASM visitor * @return this object */ @Nonnull public BugInstance addClass(ClassNode classNode) { String dottedClassName = ClassName.toDottedClassName(classNode.name); ClassAnnotation classAnnotation = new ClassAnnotation(dottedClassName); add(classAnnotation); return this; }
/** * Add a class annotation. If this is the first class annotation added, it * becomes the primary class annotation. * * @param className * the name of the class * @return this object */ @Nonnull public BugInstance addClass(@SlashedClassName(when = When.UNKNOWN) String className) { ClassAnnotation classAnnotation = new ClassAnnotation(ClassName.toDottedClassName(className)); add(classAnnotation); return this; }
private void suppressWarning(int parameter, String pattern) { String className = getDottedClassName(); ClassAnnotation clazz = new ClassAnnotation(className); suppressionMatcher.addSuppressor(new ParameterWarningSuppressor(pattern, clazz, MethodAnnotation.fromVisitedMethod(this), parameter)); }
static ClassAnnotation obfuscate(ClassAnnotation m) { ClassAnnotation result = new ClassAnnotation(hashClass(m.getClassName())); result.setDescription(m.getDescription()); return result; }
if ("Class".equals(qName)) { String className = getRequiredAttribute(attributes, "classname", qName); bugAnnotation = bugAnnotationWithSourceLines = new ClassAnnotation(className); } else if ("Type".equals(qName)) { String typeDescriptor = getRequiredAttribute(attributes, "descriptor", qName);
private void suppressWarning(String pattern) { String className = getDottedClassName(); ClassAnnotation clazz = new ClassAnnotation(className); if (className.endsWith(".package-info")) { suppressionMatcher.addPackageSuppressor(new PackageWarningSuppressor(pattern, getPackageName().replace('/', '.'))); } else if (visitingMethod()) { suppressionMatcher .addSuppressor(new MethodWarningSuppressor(pattern, clazz, MethodAnnotation.fromVisitedMethod(this))); } else if (visitingField()) { suppressionMatcher.addSuppressor(new FieldWarningSuppressor(pattern, clazz, FieldAnnotation.fromVisitedField(this))); } else { suppressionMatcher.addSuppressor(new ClassWarningSuppressor(pattern, clazz)); } }
ClassAnnotation classAnnotation = new ClassAnnotation(getDottedClassName()); equalsKindSummary.put(classAnnotation, kind); parentMap.put(classAnnotation, new ClassAnnotation(superClassName));
.get(new ClassAnnotation(obj.getClassName())); if (equalsKind == EqualsKindSummary.KindOfEquals.ALWAYS_FALSE) { return;
public ClassAnnotation getTopLevelClass() { int firstDollar = className.indexOf('$'); if (firstDollar <= 0) { return this; } return new ClassAnnotation(className.substring(0, firstDollar)); }
/** * Factory method to create a ClassAnnotation from a ClassDescriptor. * * @param classDescriptor * the ClassDescriptor * @return the ClassAnnotation */ public static ClassAnnotation fromClassDescriptor(ClassDescriptor classDescriptor) { return new ClassAnnotation(classDescriptor.toDottedClassName()); }
/** * Add a class annotation. If this is the first class annotation added, it * becomes the primary class annotation. * * @param className * the name of the class * @param sourceFileName * the source file of the class * @return this object */ @Nonnull public BugInstance addClass(String className, String sourceFileName) { ClassAnnotation classAnnotation = new ClassAnnotation(className, sourceFileName); add(classAnnotation); return this; }
/** * Add a class annotation for the classNode. * * @param classNode * the ASM visitor * @return this object */ @Nonnull public BugInstance addClass(ClassNode classNode) { String dottedClassName = ClassName.toDottedClassName(classNode.name); ClassAnnotation classAnnotation = new ClassAnnotation(dottedClassName); add(classAnnotation); return this; }
/** * Add a class annotation. If this is the first class annotation added, it * becomes the primary class annotation. * * @param className * the name of the class * @return this object */ @Nonnull public BugInstance addClass(@SlashedClassName(when = When.UNKNOWN) String className) { ClassAnnotation classAnnotation = new ClassAnnotation(ClassName.toDottedClassName(className)); add(classAnnotation); return this; }
private void suppressWarning(int parameter, String pattern) { String className = getDottedClassName(); ClassAnnotation clazz = new ClassAnnotation(className); suppressionMatcher.addSuppressor(new ParameterWarningSuppressor(pattern, clazz, MethodAnnotation.fromVisitedMethod(this), parameter)); }
static ClassAnnotation obfuscate(ClassAnnotation m) { ClassAnnotation result = new ClassAnnotation(hashClass(m.getClassName())); result.setDescription(m.getDescription()); return result; }
private void suppressWarning(String pattern) { String className = getDottedClassName(); ClassAnnotation clazz = new ClassAnnotation(className); if (className.endsWith(".package-info")) { suppressionMatcher.addPackageSuppressor(new PackageWarningSuppressor(pattern, getPackageName().replace('/', '.'))); } else if (visitingMethod()) { suppressionMatcher .addSuppressor(new MethodWarningSuppressor(pattern, clazz, MethodAnnotation.fromVisitedMethod(this))); } else if (visitingField()) { suppressionMatcher.addSuppressor(new FieldWarningSuppressor(pattern, clazz, FieldAnnotation.fromVisitedField(this))); } else { suppressionMatcher.addSuppressor(new ClassWarningSuppressor(pattern, clazz)); } }
ClassAnnotation classAnnotation = new ClassAnnotation(getDottedClassName()); equalsKindSummary.put(classAnnotation, kind); parentMap.put(classAnnotation, new ClassAnnotation(superClassName));