Program: 40656
Project: 40656
Buggy source:
/** 
 * @param pei a potentially-excepting insruction
 * @return the exception types that pei may throw, independent of the classhierarchy Notes <ul> <li>this method will <em>NOT</em> return the exception type explicitly thrown by an athrow <li>this method will <em>NOT</em> return the exception types that a called method may throw <li>this method ignores OutOfMemoryError <li>this method ignores linkage errors <li>this method ignores IllegalMonitorState exceptions </ul> TODO: move this elsewhere.
 * @throws IllegalArgumentException  if pei is null
 */
public static Collection<TypeReference> getIndependentExceptionTypes(Instruction pei){
  if (pei == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (pei.getOpcode()) {
case OP_iaload:
case OP_laload:
case OP_faload:
case OP_daload:
case OP_aaload:
case OP_baload:
case OP_caload:
case OP_saload:
case OP_iastore:
case OP_lastore:
case OP_fastore:
case OP_dastore:
case OP_bastore:
case OP_castore:
case OP_sastore:
    return getArrayAccessExceptions();
case OP_aastore:
  return getAaStoreExceptions();
case OP_getfield:
case OP_putfield:
case OP_invokevirtual:
case OP_invokespecial:
case OP_invokestatic:
case OP_invokeinterface:
return getNullPointerException();
case OP_idiv:
case OP_irem:
case OP_ldiv:
case OP_lrem:
return getArithmeticException();
case OP_new:
return newScalarExceptions;
case OP_newarray:
case OP_anewarray:
case OP_multianewarray:
return newArrayExceptions;
case OP_arraylength:
return getNullPointerException();
case OP_athrow:
return getNullPointerException();
case OP_checkcast:
return getClassCastException();
case OP_monitorenter:
case OP_monitorexit:
return getNullPointerException();
case OP_ldc_w:
if (((ConstantInstruction)pei).getType().equals(TYPE_Class)) return getClassNotFoundException();
 else return null;
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * @param pei a potentially-excepting instruction
 * @return the exception types that pei may throw, independent of the classhierarchy.   null if none. Notes <ul> <li>this method will <em>NOT</em> return the exception type explicitly thrown by an athrow <li>this method will <em>NOT</em> return the exception types that a called method may throw <li>this method ignores OutOfMemoryError <li>this method ignores linkage errors <li>this method ignores IllegalMonitorState exceptions </ul> TODO: move this elsewhere.
 * @throws IllegalArgumentException  if pei is null
 */
public static Collection<TypeReference> getIndependentExceptionTypes(Instruction pei){
  if (pei == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (pei.getOpcode()) {
case OP_iaload:
case OP_laload:
case OP_faload:
case OP_daload:
case OP_aaload:
case OP_baload:
case OP_caload:
case OP_saload:
case OP_iastore:
case OP_lastore:
case OP_fastore:
case OP_dastore:
case OP_bastore:
case OP_castore:
case OP_sastore:
    return getArrayAccessExceptions();
case OP_aastore:
  return getAaStoreExceptions();
case OP_getfield:
case OP_putfield:
case OP_invokevirtual:
case OP_invokespecial:
case OP_invokeinterface:
return getNullPointerException();
case OP_idiv:
case OP_irem:
case OP_ldiv:
case OP_lrem:
return getArithmeticException();
case OP_new:
return newScalarExceptions;
case OP_newarray:
case OP_anewarray:
case OP_multianewarray:
return newArrayExceptions;
case OP_arraylength:
return getNullPointerException();
case OP_athrow:
return getNullPointerException();
case OP_checkcast:
return getClassCastException();
case OP_monitorenter:
case OP_monitorexit:
return getNullPointerException();
case OP_ldc_w:
if (((ConstantInstruction)pei).getType().equals(TYPE_Class)) return getClassNotFoundException();
 else return null;
default :
return null;
}
}