public BugInstance addFieldOrMethodValueSource(OpcodeStack.Item item) { addOptionalAnnotation(getFieldOrMethodValueSource(item)); return this; }
public static @javax.annotation.CheckForNull BugAnnotation getValueSource(OpcodeStack.Item item, Method method, int pc) { LocalVariableAnnotation lv = LocalVariableAnnotation.getLocalVariableAnnotation(method, item, pc); if (lv != null && lv.isNamed()) { return lv; } BugAnnotation a = getFieldOrMethodValueSource(item); if (a != null) { return a; } Object c = item.getConstant(); if (c instanceof String) { a = new StringAnnotation((String) c); a.setDescription(StringAnnotation.STRING_CONSTANT_ROLE); return a; } if (c instanceof Integer && !item.isArray()) { a = new IntAnnotation((Integer) c); a.setDescription(IntAnnotation.INT_VALUE); return a; } return null; }
LocalVariableAnnotation fallback = new LocalVariableAnnotation("?", -1, -1); boolean foundSource = bugInstance.tryAddingOptionalUniqueAnnotations(variableAnnotation, BugInstance.getFieldOrMethodValueSource(item1), BugInstance.getFieldOrMethodValueSource(item2));
public BugInstance addFieldOrMethodValueSource(OpcodeStack.Item item) { addOptionalAnnotation(getFieldOrMethodValueSource(item)); return this; }
public static @javax.annotation.CheckForNull BugAnnotation getValueSource(OpcodeStack.Item item, Method method, int pc) { LocalVariableAnnotation lv = LocalVariableAnnotation.getLocalVariableAnnotation(method, item, pc); if (lv != null && lv.isNamed()) { return lv; } BugAnnotation a = getFieldOrMethodValueSource(item); if (a != null) { return a; } Object c = item.getConstant(); if (c instanceof String) { a = new StringAnnotation((String) c); a.setDescription(StringAnnotation.STRING_CONSTANT_ROLE); return a; } if (c instanceof Integer && !item.isArray()) { a = new IntAnnotation((Integer) c); a.setDescription(IntAnnotation.INT_VALUE); return a; } return null; }
LocalVariableAnnotation fallback = new LocalVariableAnnotation("?", -1, -1); boolean foundSource = bugInstance.tryAddingOptionalUniqueAnnotations(variableAnnotation, BugInstance.getFieldOrMethodValueSource(item1), BugInstance.getFieldOrMethodValueSource(item2));