@Override public Stream createStream(Location location, ObjectType type, ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback) { Instruction ins = location.getHandle().getInstruction(); if (ins.getOpcode() != Const.GETSTATIC) { return null; } GETSTATIC getstatic = (GETSTATIC) ins; if (!className.equals(getstatic.getClassName(cpg)) || !fieldName.equals(getstatic.getName(cpg)) || !fieldSig.equals(getstatic.getSignature(cpg))) { return null; } return new Stream(location, type.getClassName(), streamBaseClass).setIgnoreImplicitExceptions(true).setIsOpenOnCreation( true); } }
String fieldSig = obj.getSignature(cpg); ValueNumberFrame frame = getFrame();
private boolean isSafeValue(Location location, ConstantPoolGen cpg) throws CFGBuilderException { Instruction prevIns = location.getHandle().getInstruction(); if (prevIns instanceof LDC || prevIns instanceof GETSTATIC) { return true; } if (prevIns instanceof InvokeInstruction) { String methodName = ((InvokeInstruction) prevIns).getMethodName(cpg); if (methodName.startsWith("to") && methodName.endsWith("String") && methodName.length() > 8) { return true; } } if (prevIns instanceof AALOAD) { CFG cfg = classContext.getCFG(method); Location prev = getPreviousLocation(cfg, location, true); if (prev != null) { Location prev2 = getPreviousLocation(cfg, prev, true); if (prev2 != null && prev2.getHandle().getInstruction() instanceof GETSTATIC) { GETSTATIC getStatic = (GETSTATIC) prev2.getHandle().getInstruction(); if ("[Ljava/lang/String;".equals(getStatic.getSignature(cpg))) { return true; } } } } return false; }
GETSTATIC getStatic = (GETSTATIC)ih.getInstruction(); if ("$assertionsDisabled".equals(getStatic.getFieldName(methodGen.getConstantPool())) && "Z".equals(getStatic.getSignature(methodGen.getConstantPool()))) { int end = ((IFNE)next).getTarget().getPosition(); assertionBlocks.set(ih.getNext().getPosition(), end);
&& "Z".equals(getStatic.getSignature(methodGen.getConstantPool()))) { edgesToRemove.add(e);
ConstantPoolGen cpg = methodGen.getConstantPool(); foundDeadClassInitialization = getStatic.getFieldName(cpg).startsWith("class$") && "Ljava/lang/Class;".equals(getStatic.getSignature(cpg)); for (Iterator<Location> j = cfg.locationIterator(); j.hasNext();) { Location location2 = j.next();
@Override public Stream createStream(Location location, ObjectType type, ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback) { Instruction ins = location.getHandle().getInstruction(); if (ins.getOpcode() != Constants.GETSTATIC) { return null; } GETSTATIC getstatic = (GETSTATIC) ins; if (!className.equals(getstatic.getClassName(cpg)) || !fieldName.equals(getstatic.getName(cpg)) || !fieldSig.equals(getstatic.getSignature(cpg))) { return null; } return new Stream(location, type.getClassName(), streamBaseClass).setIgnoreImplicitExceptions(true).setIsOpenOnCreation( true); } }
String fieldSig = obj.getSignature(cpg); ValueNumberFrame frame = getFrame();
private boolean isSafeValue(Location location, ConstantPoolGen cpg) throws CFGBuilderException { Instruction prevIns = location.getHandle().getInstruction(); if (prevIns instanceof LDC || prevIns instanceof GETSTATIC) { return true; } if (prevIns instanceof InvokeInstruction) { String methodName = ((InvokeInstruction) prevIns).getMethodName(cpg); if (methodName.startsWith("to") && methodName.endsWith("String") && methodName.length() > 8) { return true; } } if (prevIns instanceof AALOAD) { CFG cfg = classContext.getCFG(method); Location prev = getPreviousLocation(cfg, location, true); if (prev != null) { Location prev2 = getPreviousLocation(cfg, prev, true); if (prev2 != null && prev2.getHandle().getInstruction() instanceof GETSTATIC) { GETSTATIC getStatic = (GETSTATIC) prev2.getHandle().getInstruction(); if ("[Ljava/lang/String;".equals(getStatic.getSignature(cpg))) { return true; } } } } return false; }
GETSTATIC getStatic = (GETSTATIC)ih.getInstruction(); if ("$assertionsDisabled".equals(getStatic.getFieldName(methodGen.getConstantPool())) && "Z".equals(getStatic.getSignature(methodGen.getConstantPool()))) { int end = ((IFNE)next).getTarget().getPosition(); assertionBlocks.set(ih.getNext().getPosition(), end);
&& "Z".equals(getStatic.getSignature(methodGen.getConstantPool()))) { edgesToRemove.add(e);
ConstantPoolGen cpg = methodGen.getConstantPool(); foundDeadClassInitialization = getStatic.getFieldName(cpg).startsWith("class$") && "Ljava/lang/Class;".equals(getStatic.getSignature(cpg)); for (Iterator<Location> j = cfg.locationIterator(); j.hasNext();) { Location location2 = j.next();