@Override public void visitClassContext(ClassContext classContext) { boolean comparator = Subtypes2.instanceOf(classContext.getClassDescriptor(), "java.util.Comparator"); boolean comparable = Subtypes2.instanceOf(classContext.getClassDescriptor(), "java.lang.Comparable"); isComparator = comparator; if (comparator || comparable) { super.visitClassContext(classContext); } }
@Override public boolean shouldAnalyzeClass(ClassContext classContext) { String className = classContext.getClassDescriptor().getDottedClassName(); return !InterfaceUtils.isSubtype(className, STRUTS_UTILITY_CLASSES); } }
public String getFullyQualifiedMethodName(Method method) { return getClassDescriptor().getDottedClassName() + "." + method.getName() + method.getSignature(); }
if (unconditionalDerefLocationSet.isEmpty()) { AnalysisContext.logError("empty set of unconditionally dereferenced locations at " + thisLocation.getHandle().getPosition() + " in " + classContext.getClassDescriptor() + "." + method.getName() + method.getSignature()); return;
@Override public void visitClassContext(ClassContext classContext) { Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); try { if (subtypes2.isSubtype(classContext.getClassDescriptor(), iteratorDescriptor)) { super.visitClassContext(classContext); } } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); } }
XField xf = XFactory.getExactXField(classContext.getClassDescriptor().getClassName(), f); FieldStats stats = statMap.get(xf); if (stats == null) {
if (DEBUG_DEREFS) { System.out.println("Checking for guaranteed derefs in " + classContext.getClassDescriptor().getDottedClassName() + "." + method.getName() + method.getSignature()); } catch (CheckedAnalysisException e) { AnalysisContext.logError("Error while checking guaranteed derefs in " + classContext.getClassDescriptor().getDottedClassName() + "." + method.getName() + method.getSignature(), e); } finally { profiler.end(this.getClass());
if (classDescriptor.equals(classContext.getClassDescriptor())) { continue;
changed = false; if(++iteration > MAX_ITERATIONS) { AnalysisContext.logError("FindUselessObjects: " + classContext.getClassDescriptor().getDottedClassName() + "." + method.getName() + method.getSignature() + ": cannot converge after " + MAX_ITERATIONS + " iterations; method is skipped");
@Override public void visitClassContext(ClassContext classContext) { boolean comparator = Subtypes2.instanceOf(classContext.getClassDescriptor(), "java.util.Comparator"); boolean comparable = Subtypes2.instanceOf(classContext.getClassDescriptor(), "java.lang.Comparable"); isComparator = comparator; if (comparator || comparable) { super.visitClassContext(classContext); } }
@Override public boolean shouldAnalyzeClass(ClassContext classContext) { String className = classContext.getClassDescriptor().getDottedClassName(); return InterfaceUtils.isSubtype(className, JSP_PARENT_CLASSES); } }
@Override public boolean shouldAnalyzeClass(ClassContext classContext) { String className = classContext.getClassDescriptor().getDottedClassName(); return !InterfaceUtils.isSubtype(className, STRUTS_UTILITY_CLASSES); } }
@Override public boolean shouldAnalyzeClass(ClassContext classContext) { String className = classContext.getClassDescriptor().getDottedClassName(); return InterfaceUtils.isSubtype(className, JSP_PARENT_CLASSES); } }
public String getFullyQualifiedMethodName(Method method) { return getClassDescriptor().getDottedClassName() + "." + method.getName() + method.getSignature(); }
@Override public boolean shouldAnalyzeClass(ClassContext classContext) { ConstantPoolGen constantPoolGen = classContext.getConstantPoolGen(); for (String requiredClass : REQUIRED_CLASSES) { if (constantPoolGen.lookupUtf8(requiredClass) != -1) { String className = classContext.getClassDescriptor().getDottedClassName(); return !InterfaceUtils.isSubtype(className, XssJspDetector.JSP_PARENT_CLASSES); } } return false; } }
@Override public boolean shouldAnalyzeClass(ClassContext classContext) { ConstantPoolGen constantPoolGen = classContext.getConstantPoolGen(); for (String requiredClass : REQUIRED_CLASSES) { if (constantPoolGen.lookupUtf8(requiredClass) != -1) { String className = classContext.getClassDescriptor().getDottedClassName(); return !InterfaceUtils.isSubtype(className, XssJspDetector.JSP_PARENT_CLASSES); } } return false; } }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + bugType.hashCode(); hash = 67 * hash + originalPriority; hash = 67 * hash + classContext.getClassDescriptor().hashCode(); hash = 67 * hash + method.getName().hashCode(); hash = 67 * hash + method.getSignature().hashCode(); hash = 67 * hash + method.getReturnType().hashCode(); hash = 67 * hash + instructionHandle.getInstruction().getOpcode(); hash = 67 * hash + instructionHandle.getPosition(); return hash; }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + bugType.hashCode(); hash = 67 * hash + originalPriority; hash = 67 * hash + classContext.getClassDescriptor().hashCode(); hash = 67 * hash + method.getName().hashCode(); hash = 67 * hash + method.getSignature().hashCode(); hash = 67 * hash + method.getReturnType().hashCode(); hash = 67 * hash + instructionHandle.getInstruction().getOpcode(); hash = 67 * hash + instructionHandle.getPosition(); return hash; } }
@Override public void visitClassContext(ClassContext classContext) { Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); try { if (subtypes2.isSubtype(classContext.getClassDescriptor(), iteratorDescriptor)) { super.visitClassContext(classContext); } } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); } }
@Override public void visitClassContext(ClassContext classContext) { try { cls = classContext.getJavaClass(); ClassDescriptor cd = classContext.getClassDescriptor(); callingClass = cd.getClassName(); callingPackage = cd.getPackageName(); stack = new OpcodeStack(); super.visitClassContext(classContext); } finally { callingPackage = null; stack = null; } }