public Stream isResourceCreation(BasicBlock basicBlock, InstructionHandle handle, ConstantPoolGen cpg) { // Use precomputed map of Locations to Stream creations, // if present. Note that we don't care about preexisting // resources here. if (resourceCollection != null) return resourceCollection.getCreatedResource(new Location(handle, basicBlock)); Instruction ins = handle.getInstruction(); if (!(ins instanceof TypedInstruction)) return null; Type type = ((TypedInstruction) ins).getType(cpg); if (!(type instanceof ObjectType)) return null; Location location = new Location(handle, basicBlock); // All StreamFactories are given an opportunity to // look at the location and possibly identify a created stream. for (StreamFactory aStreamFactoryList : streamFactoryList) { Stream stream = aStreamFactoryList.createStream(location, (ObjectType) type, cpg, lookupFailureCallback); if (stream != null) return stream; } return null; }