@Override public void logError(String message, Throwable e) { if (e instanceof MethodUnprofitableException) { return; } delegate.logError(message, e); }
@Override public void logError(String message) { delegate.logError(message); }
private void logException(ClassContext classContext, Method method, Exception ex) { bugReporter.logError("Exception while analyzing " + classContext.getFullyQualifiedMethodName(method), ex); }
@Override public void visitClassContext(ClassContext classContext) { Method[] methodList = classContext.getJavaClass().getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } try { analyzeMethod(classContext, method); } catch (MethodUnprofitableException mue) { if (SystemProperties.getBoolean("unprofitable.debug")) { // don't // report bugReporter.logError("skipping unprofitable method in " + getClass().getName()); } } catch (CFGBuilderException e) { bugReporter.logError("Detector " + this.getClass().getName() + " caught exception", e); } catch (DataflowAnalysisException e) { bugReporter.logError("Detector " + this.getClass().getName() + " caught exception", e); } } }
@Override public void visitClassContext(ClassContext classContext) { Method[] methodList = classContext.getJavaClass().getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } try { analyzeMethod(classContext, method); } catch (MethodUnprofitableException mue) { if (SystemProperties.getBoolean("unprofitable.debug")) { // don't // report bugReporter.logError("skipping unprofitable method in " + getClass().getName()); } } catch (CFGBuilderException e) { bugReporter.logError("Detector " + this.getClass().getName() + " caught exception", e); } catch (DataflowAnalysisException e) { bugReporter.logError("Detector " + this.getClass().getName() + " caught exception", e); } bugAccumulator.reportAccumulatedBugs(); } }
@Override public void visitClassContext(ClassContext classContext) { Method[] methodList = classContext.getJavaClass().getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } try { analyzeMethod(classContext, method); } catch (CFGBuilderException e) { bugReporter.logError("Error compting field store types", e); } catch (DataflowAnalysisException e) { bugReporter.logError("Error compting field store types", e); } } }
/** * Report an exception that occurred while analyzing a class with a * detector. * * @param classDescriptor * class being analyzed * @param detector * detector doing the analysis * @param e * the exception */ private void logRecoverableException(ClassDescriptor classDescriptor, Detector2 detector, Throwable e) { bugReporter.logError( "Exception analyzing " + classDescriptor.toDottedClassName() + " using detector " + detector.getDetectorClassName(), e); }
private State getTransferState(InstructionHandle handle) { StateSet stateSet; try { stateSet = dataflow.getFactAtLocation(new Location(handle, curBlock)); } catch (DataflowAnalysisException e) { bugReporter.logError("Error checking obligation state at " + handle, e); return null; } List<State> prefixes = stateSet.getPrefixStates(state.getPath()); if (prefixes.size() != 1) { // Could this happen? if (DEBUG_FP) { System.out.println("at " + handle + " in " + xmethod + " found " + prefixes.size() + " states which are prefixes of error state"); } return null; } return prefixes.get(0); } }
public static XClass findImplementor(XClass clazz, String name, String signature, boolean isStatic, BugReporter bugReporter) { try { return findImplementor(clazz, name, signature, isStatic); } catch (MissingClassException e) { bugReporter.reportMissingClass(e.getClassDescriptor()); return clazz; } catch (CheckedAnalysisException e) { bugReporter.logError("Error finding " + clazz + "." + name + signature, e); return clazz; } }
@Override public void visitMethod(Method obj) { if (sawDateClass) { try { super.visitMethod(obj); currentMethod = obj; currentLockDataFlow = getClassContext().getLockDataflow(currentMethod); currentCFG = getClassContext().getCFG(currentMethod); } catch (CFGBuilderException e) { reporter.logError("Synchronization check in Static Calendar Detector caught an error.", e); } catch (DataflowAnalysisException e) { reporter.logError("Synchronization check in Static Calendar Detector caught an error.", e); } } }
public static XClass findSuperImplementor(XClass clazz, String name, String signature, boolean isStatic, BugReporter bugReporter) { try { return findSuperImplementor(clazz, name, signature, isStatic); } catch (MissingClassException e) { bugReporter.reportMissingClass(e.getClassDescriptor()); return clazz; } catch (CheckedAnalysisException e) { bugReporter.logError("Error finding " + clazz + "." + name + signature, e); return clazz; } }
@Override public void visitClassContext(ClassContext classContext) { Method[] methodList = classContext.getJavaClass().getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } try { analyzeMethod(classContext, method); } catch (CFGBuilderException e) { bugReporter.logError("Detector " + this.getClass().getName() + " caught exception", e); } catch (DataflowAnalysisException e) { // bugReporter.logError("Detector " + this.getClass().getName() // + " caught exception", e); } } }
@Override public void visitClassContext(ClassContext classContext) { JavaClass javaClass = classContext.getJavaClass(); Method[] methodList = javaClass.getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } if (!prescreen(classContext, method)) { continue; } try { analyzeMethod(classContext, method); } catch (CFGBuilderException e) { bugReporter.logError("FindSleepWithLockHeld caught exception", e); } catch (DataflowAnalysisException e) { bugReporter.logError("FindSleepWithLockHeld caught exception", e); } } }
@Override public void visitClassContext(ClassContext classContext) { Method[] methodList = classContext.getJavaClass().getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } try { analyzeMethod(classContext, method); } catch (CFGBuilderException e) { bugReporter.logError("Detector " + this.getClass().getName() + " caught exception", e); } catch (DataflowAnalysisException e) { // bugReporter.logError("Detector " + this.getClass().getName() // + " caught exception", e); } bugAccumulator.reportAccumulatedBugs(); } }
@Override public void visitClassContext(ClassContext classContext) { JavaClass javaClass = classContext.getJavaClass(); Method[] methodList = javaClass.getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } try { analyzeMethod(classContext, method); } catch (MethodUnprofitableException e) { assert true; // move along; nothing to see } catch (CFGBuilderException e) { String msg = "Detector " + this.getClass().getName() + " caught exception while analyzing " + javaClass.getClassName() + "." + method.getName() + " : " + method.getSignature(); bugReporter.logError(msg, e); } catch (DataflowAnalysisException e) { String msg = "Detector " + this.getClass().getName() + " caught exception while analyzing " + javaClass.getClassName() + "." + method.getName() + " : " + method.getSignature(); bugReporter.logError(msg, e); } } }
@Override public void visitClassContext(ClassContext classContext) { Method[] methodList = classContext.getJavaClass().getMethods(); for (Method method : methodList) { if (method.getCode() == null) { continue; } // System.out.println("--> " + method.getName()); if (METHOD != null && !method.getName().equals(METHOD)) { continue; } try { System.out.println("Analyzing " + SignatureConverter.convertMethodSignature(classContext.getJavaClass(), method)); analyzeMethod(classContext, method); } catch (CFGBuilderException e) { bugReporter.logError("Error", e); } catch (DataflowAnalysisException e) { bugReporter.logError("Error", e); } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); } } }
@Override public void visitClassContext(ClassContext classContext) { JavaClass javaClass = classContext.getJavaClass(); Method[] methodList = javaClass.getMethods(); for (Method method : methodList) { MethodGen methodGen = classContext.getMethodGen(method); if (methodGen == null) { continue; } if (!prescreen(classContext, method)) { continue; } try { analyzeMethod(classContext, method); } catch (DataflowAnalysisException e) { bugReporter.logError("Error analyzing " + method.toString(), e); } catch (CFGBuilderException e) { bugReporter.logError("Error analyzing " + method.toString(), e); } } }
private boolean isLocked() { try { if (currentMethod != null && currentLockDataFlow != null && currentCFG != null) { Collection<Location> tLocations = currentCFG.getLocationsContainingInstructionWithOffset(getPC()); for (Location tLoc : tLocations) { LockSet lockSet = currentLockDataFlow.getFactAtLocation(tLoc); if (lockSet.getNumLockedObjects() > 0) { // within a synchronized block return true; } } } } catch (DataflowAnalysisException e) { reporter.logError("Synchronization check in Static Calendar Detector caught an error.", e); } return false; }
@Override public void visitClassContext(ClassContext classContext) { for(Method method : classContext.getMethodsInCallOrder()) { if(method.isAbstract() || method.isNative()) { continue; } try { analyzeMethod(classContext, method); } catch (CheckedAnalysisException e) { reporter.logError("Error analyzing "+method+" (class: "+classContext.getJavaClass().getClassName()+")", e); } } }
private void compute() { if (defined == null) { // System.out.println("Computing"); defined = new HashSet<>(); Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); Collection<XClass> allClasses = subtypes2.getXClassCollection(); IAnalysisCache analysisCache = Global.getAnalysisCache(); for (XClass c : allClasses) { try { JavaClass jclass = analysisCache.getClassAnalysis(JavaClass.class, c.getClassDescriptor()); addAllDefinitions(jclass); } catch (MissingClassException e) { bugReporter.reportMissingClass(e.getClassDescriptor()); } catch (CheckedAnalysisException e) { bugReporter.logError("Could not find class " + c.getClassDescriptor().toDottedClassName(), e); } } // System.out.println("Done Computing: " + // defined.contains("edu.umd.cs.findbugs.ba.IsNullValueAnalysis.UNKNOWN_VALUES_ARE_NSP : Z")); } }