/** * Gets whether this result object is empty, i.e. contains no information flows * * @return True if this result object is empty, otherwise false. */ public boolean isEmpty() { return this.results == null || this.results.isEmpty(); }
/** * Gets whether there are any flows inside this summary object * * @return True if there are any flows inside this summary object, otherwise * false */ public boolean hasFlows() { return this.flows != null && !this.flows.isEmpty(); }
/** * Gets whether this data object is empty, i.e., does not contain any data flows * * @return True if this data object is empty, otherwise false */ public boolean isEmpty() { return this.results.isEmpty(); }
/** * Gets whether there are any clears (kill taints) inside this summary object * * @return True if there are any clears (kill taints) inside this summary * object, otherwise false */ public boolean hasClears() { return this.clears != null && !this.clears.isEmpty(); }
/** * Merges the given flows into the this method summary object * * @param newFlows The new flows to be merged */ public void merge(MultiMap<String, MethodFlow> newFlows) { if (newFlows != null && !newFlows.isEmpty()) flows.putAll(newFlows); }
/** * Gets the total number of flows in this summary object * * @return The total number of flows in this summary object */ public int getFlowCount() { return this.flows == null || this.flows.isEmpty() ? 0 : this.flows.values().size(); }
/** * Gets the data flow results in a flat set * * @return The data flow results in a flat set. If no data flows are available, * the return value is null. */ public Set<DataFlowResult> getResultSet() { if (results == null || results.isEmpty()) return null; Set<DataFlowResult> set = new HashSet<>(results.size() * 10); for (ResultSinkInfo sink : results.keySet()) { for (ResultSourceInfo source : results.get(sink)) set.add(new DataFlowResult(source, sink)); } return set; }
/** * Returns a filter this object that contains only flows for the given method * signature * * @param signature The method for which to filter the flows * @return An object containing only flows for the given method */ public MethodSummaries filterForMethod(String signature) { MethodSummaries summaries = null; // Get the flows if (flows != null && !flows.isEmpty()) { Set<MethodFlow> sigFlows = flows.get(signature); if (sigFlows != null && !sigFlows.isEmpty()) { if (summaries == null) summaries = new MethodSummaries(); summaries.mergeFlows(sigFlows); } } // Get the clears if (clears != null && !clears.isEmpty()) { Set<MethodClear> sigClears = clears.get(signature); if (sigClears != null && !sigClears.isEmpty()) { if (summaries == null) summaries = new MethodSummaries(); summaries.mergeClears(sigClears); } } return summaries; }
/** * Validates all flows inside this method summary object */ private void validateFlows() { if (this.flows == null || this.flows.isEmpty()) return; for (String methodName : getFlows().keySet()) for (MethodFlow flow : getFlows().get(methodName)) { flow.validate(); } }
if (newFlows.flows != null && !newFlows.flows.isEmpty()) { for (String key : newFlows.flows.keySet()) { for (MethodFlow flow : newFlows.flows.get(key)) { if (newFlows.clears != null && !newFlows.clears.isEmpty()) { for (String key : newFlows.clears.keySet()) { for (MethodClear clear : newFlows.clears.get(key)) {
/** * Adds all results from the given data structure to this one * * @param results The data structure from which to copy the results */ public void addAll(InfoflowResults results) { if (results == null || results.isEmpty()) return; if (results.getExceptions() != null) { for (String e : results.getExceptions()) addException(e); } if (!results.getResults().isEmpty()) { for (ResultSinkInfo sink : results.getResults().keySet()) for (ResultSourceInfo source : results.getResults().get(sink)) addResult(sink, source); } // Sum up the performance data if (results.performanceData != null) { if (this.performanceData == null) this.performanceData = results.performanceData; else this.performanceData.add(results.performanceData); } }
if (collectedAbstractions != null && !collectedAbstractions.isEmpty()) {
if (fragmentClasses != null && !fragmentClasses.isEmpty()) { for (SootClass scFragment : fragmentClasses.get(currentClass)) {