if (!(ins instanceof NEW))
Location location = new Location(handle, basicBlock);  try { if (ins instanceof NEW) {  NEW newIns = (NEW) ins; Type type = newIns.getType(cpg); String sig = type.getSignature();  if (!sig.startsWith("L") || !sig.endsWith(";")) return null;    String className = sig.substring(1, sig.length() - 1).replace('/', '.'); if (Repository.instanceOf(className, "java.io.InputStream")) { boolean isUninteresting = Repository.instanceOf(className, "java.io.ByteArrayInputStream") || Repository.instanceOf(className, "java.io.ObjectInputStream"); return new Stream(location, className, "java.io.InputStream", isUninteresting);  } else if (Repository.instanceOf(className, "java.io.OutputStream")) { boolean isUninteresting = Repository.instanceOf(className, "java.io.ByteArrayOutputStream") || Repository.instanceOf(className, "java.io.ObjectOutputStream"); return new Stream(location, className, "java.io.OutputStream", isUninteresting);  } else if (Repository.instanceOf(className, "java.io.Reader")) { boolean isUninteresting = Repository.instanceOf(className, "java.io.StringReader") || Repository.instanceOf(className, "java.io.CharArrayReader"); return new Stream(location, className, "java.io.Reader", isUninteresting);  } else if (Repository.instanceOf(className, "java.io.Writer")) { boolean isUninteresting = Repository.instanceOf(className, "java.io.StringWriter") || Repository.instanceOf(className, "java.io.CharArrayWriter"); return new Stream(location, className, "java.io.Writer", isUninteresting);  }  } else if (ins instanceof INVOKEVIRTUAL) {     INVOKEVIRTUAL inv = (INVOKEVIRTUAL) ins; String className = inv.getClassName(cpg);  if (Repository.instanceOf(className, "java.net.Socket")) { String methodName = inv.getName(cpg); String methodSig = inv.getSignature(cpg); if (DEBUG) System.out.println("Socket call: " + methodName + " : " + methodSig);  if (methodName.equals("getOutputStream") && methodSig.endsWith(")Ljava/io/OutputStream;")) { return new Stream(location, "java.io.OutputStream", "java.io.OutputStream", true, true);  } else if (methodName.equals("getInputStream") && methodSig.endsWith(")Ljava/io/InputStream;")) { return new Stream(location, "java.io.InputStream", "java.io.InputStream", true, true); } }  } else if (ins instanceof GETSTATIC) {    GETSTATIC getstatic = (GETSTATIC) ins; String className = getstatic.getClassName(cpg);  if (className.equals("java.lang.System")) { String fieldName = getstatic.getName(cpg); String fieldSig = getstatic.getSignature(cpg);  if (fieldName.equals("in") && fieldSig.equals("Ljava/io/InputStream;")) { return new Stream(location, "java.io.InputStream", "java.io.InputStream", true, true);  } else if ((fieldName.equals("out") || fieldName.equals("err")) && fieldSig.equals("Ljava/io/PrintStream;")) { return new Stream(location, "java.io.PrintStream", "java.io.OutputStream", true, true);  } } }
		public Stream isResourceCreation(BasicBlock basicBlock, InstructionHandle handle, ConstantPoolGen cpg) {			Instruction ins = handle.getInstruction();			if (!(ins instanceof NEW))				return null;			NEW newIns = (NEW) ins;			Type type = newIns.getType(cpg);			String sig = type.getSignature();			if (!sig.startsWith("L") || !sig.endsWith(";"))				return null;			// Track any subclass of InputStream, OutputStream, Reader, and Writer			// (but not ByteArray/CharArray/String variants)			String className = sig.substring(1, sig.length() - 1).replace('/', '.');			try {				if (Repository.instanceOf(className, "java.io.InputStream")) {					boolean isByteArray = Repository.instanceOf(className, "java.io.ByteArrayInputStream");					return new Stream(new Location(handle, basicBlock), className, "java.io.InputStream", isByteArray);				} else if (Repository.instanceOf(className, "java.io.OutputStream")) {					boolean isByteArray = Repository.instanceOf(className, "java.io.ByteArrayOutputStream");					return new Stream(new Location(handle, basicBlock), className, "java.io.OutputStream", isByteArray);				} else if (Repository.instanceOf(className, "java.io.Reader")) {					boolean isByteArray = Repository.instanceOf(className, "java.io.StringReader")						|| Repository.instanceOf(className, "java.io.CharArrayReader");					return new Stream(new Location(handle, basicBlock), className, "java.io.Reader", isByteArray);				} else if (Repository.instanceOf(className, "java.io.Writer")) {					boolean isByteArray = Repository.instanceOf(className, "java.io.StringWriter")						|| Repository.instanceOf(className, "java.io.CharArrayWriter");					return new Stream(new Location(handle, basicBlock), className, "java.io.Writer", isByteArray);				} else					return null;								} catch (ClassNotFoundException e) {				lookupFailureCallback.reportMissingClass(e);				return null;			}		}