boolean (int nextOpcode) { // if instruction guaranteed produces non-null stack value if (nextOpcode == Opcodes.LDC || nextOpcode == NEW || nextOpcode == ANEWARRAY || nextOpcode == Opcodes.NEWARRAY || nextOpcode == Opcodes.MULTIANEWARRAY) { return false; } // for some instructions it is safe not to change previously calculated flag value if (nextOpcode == Opcodes.DUP || nextOpcode == Opcodes.DUP_X1 || nextOpcode == Opcodes.DUP_X2 || nextOpcode == Opcodes.DUP2 || nextOpcode == Opcodes.DUP2_X1 || nextOpcode == Opcodes.DUP2_X2 || nextOpcode == Opcodes.JSR || nextOpcode == Opcodes.GOTO || nextOpcode == Opcodes.NOP || nextOpcode == Opcodes.RET || nextOpcode == Opcodes.CHECKCAST) { return myCanBeNull; } // by default assume nullable return true; }