@CheckForNull public LocationAndFactPair getLocationAndFactForInstruction(int pc) { Collection<Location> locations = getCFG().getLocationsContainingInstructionWithOffset(pc); LocationAndFactPair result = null; // Return the first valid frame at any of the returned Locations for (Location location : locations) { try { TypeFrame frame = getFactAtLocation(location); if (frame.isValid()) { result = new LocationAndFactPair(location, frame); break; } } catch (DataflowAnalysisException e) { // Ignore } } return result; } }
public boolean isDuplicated(WarningPropertySet<WarningProperty> propertySet, int pc, boolean isConsistent) { boolean duplicated = false; if (!isConsistent) { if (propertySet.containsProperty(NullDerefProperty.DEREFS_ARE_CLONED)) { duplicated = true; } else { try { CFG cfg = classContext.getCFG(method); if (cfg.getLocationsContainingInstructionWithOffset(pc).size() > 1) { propertySet.addProperty(NullDerefProperty.DEREFS_ARE_INLINED_FINALLY_BLOCKS); duplicated = true; } } catch (CFGBuilderException e) { AnalysisContext.logError("Error while analyzing " + classContext.getFullyQualifiedMethodName(method), e); } } } return duplicated; }
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; }
int occurrences = cfg.getLocationsContainingInstructionWithOffset(pc).size(); boolean split = occurrences > 1; if (lineNumberTable != null) {
makeFactTop(result); for (Location loc : cfg.getLocationsContainingInstructionWithOffset(pc)) { BasicBlock b = loc.getBasicBlock(); BasicBlock b2 = null;
propertySet.addProperty(DeadLocalStoreProperty.MANY_STORES); int occurrences = cfg.getLocationsContainingInstructionWithOffset(pc).size(); if (occurrences > 2 || sourceLineAnnotation.getStartLine() > 0 && linesMentionedMultipleTimes.get(sourceLineAnnotation.getStartLine())) {
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; }
public boolean isDuplicated(WarningPropertySet<WarningProperty> propertySet, int pc, boolean isConsistent) { boolean duplicated = false; if (!isConsistent) { if (propertySet.containsProperty(NullDerefProperty.DEREFS_ARE_CLONED)) { duplicated = true; } else { try { CFG cfg = classContext.getCFG(method); if (cfg.getLocationsContainingInstructionWithOffset(pc).size() > 1) { propertySet.addProperty(NullDerefProperty.DEREFS_ARE_INLINED_FINALLY_BLOCKS); duplicated = true; } } catch (CFGBuilderException e) { AnalysisContext.logError("Error while analyzing " + classContext.getFullyQualifiedMethodName(method), e); } } } return duplicated; }
public LocationAndFactPair getLocationAndFactForInstruction(int pc) { Collection<Location> locations = getCFG().getLocationsContainingInstructionWithOffset(pc); LocationAndFactPair result = null; // Return the first valid frame at any of the returned Locations for (Location location : locations) { try { TypeFrame frame = getFactAtLocation(location); if (frame.isValid()) { result = new LocationAndFactPair(location, frame); break; } } catch (DataflowAnalysisException e) { // Ignore } } return result; } }
int occurrences = cfg.getLocationsContainingInstructionWithOffset(pc).size(); boolean split = occurrences > 1; if (lineNumberTable != null) {
makeFactTop(result); for (Location loc : cfg.getLocationsContainingInstructionWithOffset(pc)) { BasicBlock b = loc.getBasicBlock(); BasicBlock b2 = null;
propertySet.addProperty(DeadLocalStoreProperty.MANY_STORES); int occurrences = cfg.getLocationsContainingInstructionWithOffset(pc).size(); if (occurrences > 2 || sourceLineAnnotation.getStartLine() > 0 && linesMentionedMultipleTimes.get(sourceLineAnnotation.getStartLine())) {