Program: 75096
Project: 75096
Buggy source:
/** 
 * Create a proxy class for an anonymous class. The proxy class implements the   {@link Rollbackable} interface.
 * @param ast The {@link AST} object.
 * @param root The root of the AST.
 * @param state The current state of the type analyzer.
 * @return The type declaration of the proxy class.
 */
private TypeDeclaration _createProxyClass(AST ast,CompilationUnit root,TypeAnalyzerState state){
  TypeDeclaration classDeclaration=ast.newTypeDeclaration();
  classDeclaration.setName(ast.newSimpleName(_getProxyName()));
  String rollbackType=getClassName(Rollbackable.class,state,root);
  classDeclaration.superInterfaces().add(createName(ast,rollbackType));
  MethodDeclaration proxy=ast.newMethodDeclaration();
  proxy.setName(ast.newSimpleName(_getRestoreMethodName(false)));
  SingleVariableDeclaration timestamp=ast.newSingleVariableDeclaration();
  timestamp.setType(ast.newPrimitiveType(PrimitiveType.LONG));
  timestamp.setName(ast.newSimpleName("String_Node_Str"));
  proxy.parameters().add(timestamp);
  SingleVariableDeclaration trim=ast.newSingleVariableDeclaration();
  trim.setType(ast.newPrimitiveType(PrimitiveType.BOOLEAN));
  trim.setName(ast.newSimpleName("String_Node_Str"));
  proxy.parameters().add(trim);
  MethodInvocation invocation=ast.newMethodInvocation();
  invocation.setName(ast.newSimpleName(_getRestoreMethodName(true)));
  invocation.arguments().add(ast.newSimpleName("String_Node_Str"));
  invocation.arguments().add(ast.newSimpleName("String_Node_Str"));
  Block body=ast.newBlock();
  body.statements().add(ast.newExpressionStatement(invocation));
  proxy.setBody(body);
  proxy.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
  classDeclaration.bodyDeclarations().add(proxy);
  MethodDeclaration getCheckpoint=ast.newMethodDeclaration();
  String checkpointType=getClassName(Checkpoint.class,state,root);
  getCheckpoint.setName(ast.newSimpleName(_getGetCheckpointMethodName(false)));
  getCheckpoint.setReturnType(createType(ast,checkpointType));
  invocation=ast.newMethodInvocation();
  invocation.setName(ast.newSimpleName(_getGetCheckpointMethodName(true)));
  body=ast.newBlock();
  ReturnStatement returnStatement=ast.newReturnStatement();
  returnStatement.setExpression(invocation);
  body.statements().add(returnStatement);
  getCheckpoint.setBody(body);
  getCheckpoint.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
  classDeclaration.bodyDeclarations().add(getCheckpoint);
  MethodDeclaration setCheckpoint=ast.newMethodDeclaration();
  setCheckpoint.setName(ast.newSimpleName(_getSetCheckpointMethodName(false)));
  SingleVariableDeclaration checkpoint=ast.newSingleVariableDeclaration();
  checkpoint.setType(createType(ast,checkpointType));
  checkpoint.setName(ast.newSimpleName("String_Node_Str"));
  setCheckpoint.parameters().add(checkpoint);
  invocation=ast.newMethodInvocation();
  invocation.setName(ast.newSimpleName(_getSetCheckpointMethodName(true)));
  invocation.arguments().add(ast.newSimpleName("String_Node_Str"));
  body=ast.newBlock();
  body.statements().add(ast.newExpressionStatement(invocation));
  setCheckpoint.setBody(body);
  setCheckpoint.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
  classDeclaration.bodyDeclarations().add(setCheckpoint);
  classDeclaration.setModifiers(Modifier.FINAL);
  return classDeclaration;
}

Fixed version (ground truth):
/** 
 * Create a proxy class for an anonymous class. The proxy class implements the   {@link Rollbackable} interface.
 * @param ast The {@link AST} object.
 * @param root The root of the AST.
 * @param state The current state of the type analyzer.
 * @return The type declaration of the proxy class.
 */
private TypeDeclaration _createProxyClass(AST ast,CompilationUnit root,TypeAnalyzerState state){
  TypeDeclaration classDeclaration=ast.newTypeDeclaration();
  classDeclaration.setName(ast.newSimpleName(_getProxyName()));
  String rollbackType=getClassName(Rollbackable.class,state,root);
  classDeclaration.superInterfaces().add(createName(ast,rollbackType));
  MethodDeclaration proxy=ast.newMethodDeclaration();
  proxy.setName(ast.newSimpleName(_getRestoreMethodName(false)));
  SingleVariableDeclaration timestamp=ast.newSingleVariableDeclaration();
  timestamp.setType(ast.newPrimitiveType(PrimitiveType.LONG));
  timestamp.setName(ast.newSimpleName("String_Node_Str"));
  proxy.parameters().add(timestamp);
  SingleVariableDeclaration trim=ast.newSingleVariableDeclaration();
  trim.setType(ast.newPrimitiveType(PrimitiveType.BOOLEAN));
  trim.setName(ast.newSimpleName("String_Node_Str"));
  proxy.parameters().add(trim);
  MethodInvocation invocation=ast.newMethodInvocation();
  invocation.setName(ast.newSimpleName(_getRestoreMethodName(true)));
  invocation.arguments().add(ast.newSimpleName("String_Node_Str"));
  invocation.arguments().add(ast.newSimpleName("String_Node_Str"));
  Block body=ast.newBlock();
  body.statements().add(ast.newExpressionStatement(invocation));
  proxy.setBody(body);
  proxy.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
  classDeclaration.bodyDeclarations().add(proxy);
  MethodDeclaration getCheckpoint=ast.newMethodDeclaration();
  String checkpointType=getClassName(Checkpoint.class,state,root);
  getCheckpoint.setName(ast.newSimpleName(_getGetCheckpointMethodName(false)));
  getCheckpoint.setReturnType(createType(ast,checkpointType));
  invocation=ast.newMethodInvocation();
  invocation.setName(ast.newSimpleName(_getGetCheckpointMethodName(true)));
  body=ast.newBlock();
  ReturnStatement returnStatement=ast.newReturnStatement();
  returnStatement.setExpression(invocation);
  body.statements().add(returnStatement);
  getCheckpoint.setBody(body);
  getCheckpoint.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
  classDeclaration.bodyDeclarations().add(getCheckpoint);
  MethodDeclaration setCheckpoint=ast.newMethodDeclaration();
  setCheckpoint.setName(ast.newSimpleName(_getSetCheckpointMethodName(false)));
  setCheckpoint.setReturnType(createType(ast,getClassName(Object.class,state,root)));
  SingleVariableDeclaration checkpoint=ast.newSingleVariableDeclaration();
  checkpoint.setType(createType(ast,checkpointType));
  checkpoint.setName(ast.newSimpleName("String_Node_Str"));
  setCheckpoint.parameters().add(checkpoint);
  invocation=ast.newMethodInvocation();
  invocation.setName(ast.newSimpleName(_getSetCheckpointMethodName(true)));
  invocation.arguments().add(ast.newSimpleName("String_Node_Str"));
  returnStatement=ast.newReturnStatement();
  returnStatement.setExpression(ast.newThisExpression());
  body=ast.newBlock();
  body.statements().add(ast.newExpressionStatement(invocation));
  body.statements().add(returnStatement);
  setCheckpoint.setBody(body);
  setCheckpoint.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
  classDeclaration.bodyDeclarations().add(setCheckpoint);
  classDeclaration.setModifiers(Modifier.FINAL);
  return classDeclaration;
}