nus-yam/ex-repair huggingface dataset:
Program: 9089
Project: 9089
Buggy source:
private byte[] createPayload(NdefMessageEncoder messageEncoder,SmartPosterRecord myRecord){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    if (myRecord.getTitle() != null)     baos.write(messageEncoder.encodeSingle(myRecord.getTitle()));
    if (myRecord.getUri() != null)     baos.write(messageEncoder.encodeSingle(myRecord.getUri()));
    if (myRecord.getAction() != null)     baos.write(messageEncoder.encodeSingle(myRecord.getAction()));
    return baos.toByteArray();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private byte[] createPayload(NdefMessageEncoder messageEncoder,SmartPosterRecord myRecord){
  List<Record> records=new ArrayList<Record>();
  if (myRecord.getTitle() != null)   records.add(myRecord.getTitle());
  if (myRecord.getUri() != null)   records.add(myRecord.getUri());
  if (myRecord.getAction() != null)   records.add(myRecord.getAction());
  return messageEncoder.encode(records);
}
Program: 9090
Project: 9090
Buggy source:
@Test public void testEncode() throws Exception {
  SmartPosterRecord smartPosterRecord=new SmartPosterRecord();
  smartPosterRecord.setTitle(new TextRecord("String_Node_Str",Charset.forName("String_Node_Str"),Locale.GERMAN));
  smartPosterRecord.setUri(new UriRecord("String_Node_Str"));
  byte[] payload=encoder.encodePayload(smartPosterRecord,messageEncoder);
  assertEquals(innerSmartPoster,NfcUtils.convertBinToASCII(payload));
}

Fixed version (ground truth):
@Test public void testEncode() throws Exception {
  SmartPosterRecord smartPosterRecord=new SmartPosterRecord();
  smartPosterRecord.setTitle(new TextRecord("String_Node_Str",Charset.forName("String_Node_Str"),Locale.GERMAN));
  smartPosterRecord.setUri(new UriRecord("String_Node_Str"));
  byte[] payload=messageEncoder.encodeSingle(smartPosterRecord);
  System.out.println(innerSmartPoster);
  System.out.println(NfcUtils.convertBinToASCII(payload));
  assertEquals(innerSmartPoster,NfcUtils.convertBinToASCII(payload));
}
Program: 9092
Project: 9092
Buggy source:
@Test public void testSequences() throws Exception {
  LlcpSocket llcpSocket=new LlcpSocket(new AddressPair(0,0),null);
  assertEquals(0,llcpSocket.getSendSequence());
  llcpSocket.incSendSequence();
  assertEquals(1,llcpSocket.getSendSequence());
  assertEquals(0,llcpSocket.getReceivedSequence());
  llcpSocket.incReceivedSequence();
  assertEquals(1,llcpSocket.getReceivedSequence());
}

Fixed version (ground truth):
@Test public void testSequences() throws Exception {
  LlcpSocket llcpSocket=new LlcpSocket(new AddressPair(0,0),null);
  assertEquals(0,llcpSocket.getSendSequence());
  llcpSocket.incSendSequence();
  assertEquals(1,llcpSocket.getSendSequence());
  for (int y=0; y < 3; y++) {
    for (int x=0; x < 16; x++) {
      assertEquals(x,llcpSocket.getReceivedSequence());
      llcpSocket.incReceivedSequence();
    }
  }
}
Program: 9093
Project: 9093
Buggy source:
@Test public void testSnepPut() throws Exception {
  snepClient.setSnepAgentListener(new SnepAgentListener(){
    @Override public void onSnepConnection(    SnepAgent snepAgent){
      List<Record> records=new ArrayList<Record>();
      for (int x=0; x < 50; x++)       records.add(new UriRecord("String_Node_Str"));
      snepAgent.doPut(records,ndefListener);
    }
    @Override public boolean hasDataToSend(){
      return true;
    }
  }
);
  helper.launch();
synchronized (this) {
    wait(5000);
  }
  assertTrue(ndefListener.isSuccess());
  Collection<Record> receivedRecords=ndefListener.getRecords();
  assertEquals(50,receivedRecords.size());
  UriRecord uriRecord=(UriRecord)receivedRecords.iterator().next();
  assertEquals("String_Node_Str",uriRecord.getUri());
}

Fixed version (ground truth):
@Test public void testSnepPut() throws Exception {
  snepClient.setSnepAgentListener(new SnepAgentListener(){
    @Override public void onSnepConnection(    SnepAgent snepAgent){
      List<Record> records=new ArrayList<Record>();
      for (int x=0; x < 50; x++)       records.add(new UriRecord("String_Node_Str"));
      snepAgent.doPut(records,ndefListener);
    }
    @Override public boolean hasDataToSend(){
      return true;
    }
  }
);
  helper.launch();
synchronized (this) {
    wait(500000);
  }
  assertTrue(ndefListener.isSuccess());
  Collection<Record> receivedRecords=ndefListener.getRecords();
  assertEquals(50,receivedRecords.size());
  UriRecord uriRecord=(UriRecord)receivedRecords.iterator().next();
  assertEquals("String_Node_Str",uriRecord.getUri());
}
Program: 9094
Project: 9094
Buggy source:
@Override protected ErrorRecord createRecord(NdefRecord ndefRecord,NdefMessageDecoder messageDecoder){
  ErrorRecord errorRecord=new ErrorRecord();
  byte[] payload=ndefRecord.getPayload();
  ErrorReason errorReason=ErrorReason.toErrorReason(payload[0]);
  errorRecord.setErrorReason(errorReason);
  Number number;
switch (errorReason) {
case TemporaryMemoryConstraints:
{
      number=new Short((short)(payload[1] & 0xFFFF));
      break;
    }
case PermanenteMemoryConstraints:
{
    number=new Long(((long)(payload[1] << 24 | payload[2] << 16 | payload[3] << 8 | payload[4])) & 0xFFFFFFFFL);
    break;
  }
case CarrierSpecificConstraints:
{
  number=new Short((short)(payload[1] & 0xFFFF));
  break;
}
default :
{
throw new RuntimeException();
}
}
errorRecord.setErrorData(number);
return errorRecord;
}

Fixed version (ground truth):
@Override protected ErrorRecord createRecord(NdefRecord ndefRecord,NdefMessageDecoder messageDecoder){
  ErrorRecord errorRecord=new ErrorRecord();
  byte[] payload=ndefRecord.getPayload();
  ErrorReason errorReason=ErrorReason.toErrorReason(payload[0]);
  errorRecord.setErrorReason(errorReason);
  Number number;
switch (errorReason) {
case TemporaryMemoryConstraints:
{
      number=new Short((short)(payload[1] & 0xFFFF));
      break;
    }
case PermanenteMemoryConstraints:
{
    number=new Long(((long)(payload[1] & 0xFF) << 24) + ((payload[2] & 0xFF) << 16) + ((payload[3] & 0xFF) << 8)+ ((payload[4] & 0xFF) << 0));
    break;
  }
case CarrierSpecificConstraints:
{
  number=new Short((short)(payload[1] & 0xFFFF));
  break;
}
default :
{
throw new RuntimeException();
}
}
errorRecord.setErrorData(number);
return errorRecord;
}
Program: 9095
Project: 9095
Buggy source:
@Override public NdefRecord encodeRecord(Record record,NdefMessageEncoder messageEncoder){
  ActionRecord actionRecord=new ActionRecord();
  if (!actionRecord.hasAction()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  byte[] payload=new byte[]{(byte)actionRecord.getAction().getValue()};
  return new NdefRecord(NdefConstants.TNF_WELL_KNOWN,ActionRecord.TYPE,record.getId(),payload);
}

Fixed version (ground truth):
@Override public NdefRecord encodeRecord(Record record,NdefMessageEncoder messageEncoder){
  ActionRecord actionRecord=(ActionRecord)record;
  if (!actionRecord.hasAction()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  byte[] payload=new byte[]{actionRecord.getAction().getValue()};
  return new NdefRecord(NdefConstants.TNF_WELL_KNOWN,ActionRecord.TYPE,record.getId(),payload);
}
Program: 9096
Project: 9096
Buggy source:
@Test public void testEncodeDecodeRoundtrip(){
  NdefMessageEncoder ndefMessageEncoder=NdefContext.getNdefMessageEncoder();
  NdefMessageDecoder ndefMessageDecoder=NdefContext.getNdefMessageDecoder();
  for (  Record record : records) {
    System.out.println(record.getClass().getSimpleName());
    byte[] ndef=ndefMessageEncoder.encodeSingle(record);
    Record decodedRecord=ndefMessageDecoder.decodeToRecord(ndef);
    assertEquals(record.getClass().getName(),record,decodedRecord);
  }
}

Fixed version (ground truth):
@Test public void testEncodeDecodeRoundtrip(){
  NdefMessageEncoder ndefMessageEncoder=NdefContext.getNdefMessageEncoder();
  NdefMessageDecoder ndefMessageDecoder=NdefContext.getNdefMessageDecoder();
  for (  Record record : records) {
    byte[] ndef=ndefMessageEncoder.encodeSingle(record);
    Record decodedRecord=ndefMessageDecoder.decodeToRecord(ndef);
    if (!record.equals(decodedRecord)) {
      fail(record.getClass().getName());
    }
  }
}
Program: 9098
Project: 9098
Buggy source:
public void dontIgnore(Kind kind){
}

Fixed version (ground truth):
@Override public void dontIgnore(Kind kind){
}
Program: 9099
Project: 9099
Buggy source:
/** 
 * Compile using ajc per settings.
 * @exception BuildException if the compilation has problems or if there were compiler errors and failonerror is true.
 */
public void execute() throws BuildException {
  this.logger=new TaskLogger(this);
  if (executing) {
    throw new IllegalStateException("String_Node_Str");
  }
 else {
    executing=true;
  }
  setupOptions();
  verifyOptions();
  try {
    String[] args=makeCommand();
    if (logCommand) {
      log("String_Node_Str" + Arrays.asList(args));
    }
 else {
      logVerbose("String_Node_Str" + Arrays.asList(args));
    }
    if (!fork) {
      executeInSameVM(args);
    }
 else {
      executeInOtherVM(args);
    }
  }
 catch (  BuildException e) {
    throw e;
  }
catch (  Throwable x) {
    this.logger.error(Main.renderExceptionForUser(x));
    throw new BuildException("String_Node_Str" + LangUtil.unqualifiedClassName(x) + "String_Node_Str");
  }
 finally {
    executing=false;
    if (null != tmpOutjar) {
      tmpOutjar.delete();
    }
  }
}

Fixed version (ground truth):
/** 
 * Compile using ajc per settings.
 * @exception BuildException if the compilation has problems or if there were compiler errors and failonerror is true.
 */
@Override public void execute() throws BuildException {
  this.logger=new TaskLogger(this);
  if (executing) {
    throw new IllegalStateException("String_Node_Str");
  }
 else {
    executing=true;
  }
  setupOptions();
  verifyOptions();
  try {
    String[] args=makeCommand();
    if (logCommand) {
      log("String_Node_Str" + Arrays.asList(args));
    }
 else {
      logVerbose("String_Node_Str" + Arrays.asList(args));
    }
    if (!fork) {
      executeInSameVM(args);
    }
 else {
      executeInOtherVM(args);
    }
  }
 catch (  BuildException e) {
    throw e;
  }
catch (  Throwable x) {
    this.logger.error(Main.renderExceptionForUser(x));
    throw new BuildException("String_Node_Str" + LangUtil.unqualifiedClassName(x) + "String_Node_Str");
  }
 finally {
    executing=false;
    if (null != tmpOutjar) {
      tmpOutjar.delete();
    }
  }
}
Program: 9100
Project: 9100
Buggy source:
/** 
 * to use this same Task more than once (testing) 
 */
public void reset(){
  adapterArguments=null;
  adapterFiles=new ArrayList();
  argfiles=null;
  inxmlfiles=null;
  executing=false;
  aspectpath=null;
  bootclasspath=null;
  classpath=null;
  cmd=new GuardedCommand();
  copyInjars=false;
  copyInpath=false;
  destDir=DEFAULT_DESTDIR;
  executing=false;
  executingInOtherVM=false;
  extdirs=null;
  failonerror=true;
  forkclasspath=null;
  inIncrementalMode=false;
  inIncrementalFileMode=false;
  ignored=new ArrayList();
  injars=null;
  inpath=null;
  listFileArgs=false;
  maxMem=null;
  messageHolder=null;
  outjar=null;
  sourceRootCopyFilter=null;
  inpathDirCopyFilter=null;
  sourceRoots=null;
  srcdir=null;
  tmpOutjar=null;
  verbose=false;
  timers=false;
  xweaveDir=null;
  xdoneSignal=null;
  logCommand=false;
  javaCmd=new CommandlineJava();
}

Fixed version (ground truth):
/** 
 * to use this same Task more than once (testing) 
 */
public void reset(){
  adapterArguments=null;
  adapterFiles=new ArrayList();
  compilerArgs=null;
  argfiles=null;
  inxmlfiles=null;
  executing=false;
  aspectpath=null;
  bootclasspath=null;
  classpath=null;
  cmd=new GuardedCommand();
  copyInjars=false;
  copyInpath=false;
  destDir=DEFAULT_DESTDIR;
  executing=false;
  executingInOtherVM=false;
  extdirs=null;
  failonerror=true;
  forkclasspath=null;
  inIncrementalMode=false;
  inIncrementalFileMode=false;
  ignored=new ArrayList();
  injars=null;
  inpath=null;
  listFileArgs=false;
  maxMem=null;
  messageHolder=null;
  outjar=null;
  sourceRootCopyFilter=null;
  inpathDirCopyFilter=null;
  sourceRoots=null;
  srcdir=null;
  tmpOutjar=null;
  verbose=false;
  timers=false;
  xweaveDir=null;
  xdoneSignal=null;
  logCommand=false;
  javaCmd=new CommandlineJava();
}
Program: 9102
Project: 9102
Buggy source:
/** 
 * @return null if path null or empty, String rendition otherwise 
 */
protected static void addFlaggedPath(String flag,Path path,List list){
  if (!LangUtil.isEmpty(flag) && ((null != path) && (0 < path.size()))) {
    list.add(flag);
    list.add(path.toString());
  }
}

Fixed version (ground truth):
/** 
 * @return null if path null or empty, String rendition otherwise 
 */
protected static void addFlaggedPath(String flag,Path path,List<String> list){
  if (!LangUtil.isEmpty(flag) && ((null != path) && (0 < path.size()))) {
    list.add(flag);
    list.add(path.toString());
  }
}
Program: 9103
Project: 9103
Buggy source:
public String toString(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return value;
}
Program: 9104
Project: 9104
Buggy source:
public void run(){
  doCompletionTasks();
}

Fixed version (ground truth):
@Override public void run(){
  doCompletionTasks();
}
Program: 9106
Project: 9106
Buggy source:
public void ignore(Kind kind){
}

Fixed version (ground truth):
@Override public void ignore(Kind kind){
}
Program: 9107
Project: 9107
Buggy source:
public boolean isIgnoring(Kind kind){
  return false;
}

Fixed version (ground truth):
@Override public boolean isIgnoring(Kind kind){
  return false;
}
Program: 9108
Project: 9108
Buggy source:
public boolean handleMessage(IMessage message) throws AbortException {
  Kind messageKind=message.getKind();
  String messageText=message.toString();
  if (messageKind == IMessage.ABORT) {
    this.logger.error(messageText);
  }
 else   if (messageKind == IMessage.DEBUG) {
    this.logger.debug(messageText);
  }
 else   if (messageKind == IMessage.ERROR) {
    this.logger.error(messageText);
  }
 else   if (messageKind == IMessage.FAIL) {
    this.logger.error(messageText);
  }
 else   if (messageKind == IMessage.INFO) {
    if (this.taskLevelVerbose) {
      this.logger.info(messageText);
    }
 else {
      this.logger.verbose(messageText);
    }
  }
 else   if (messageKind == IMessage.WARNING) {
    this.logger.warning(messageText);
  }
 else   if (messageKind == IMessage.WEAVEINFO) {
    this.logger.info(messageText);
  }
 else   if (messageKind == IMessage.TASKTAG) {
  }
 else {
    throw new BuildException("String_Node_Str" + messageKind.toString());
  }
  return handledMessage;
}

Fixed version (ground truth):
@Override public boolean handleMessage(IMessage message) throws AbortException {
  Kind messageKind=message.getKind();
  String messageText=message.toString();
  if (messageKind == IMessage.ABORT) {
    this.logger.error(messageText);
  }
 else   if (messageKind == IMessage.DEBUG) {
    this.logger.debug(messageText);
  }
 else   if (messageKind == IMessage.ERROR) {
    this.logger.error(messageText);
  }
 else   if (messageKind == IMessage.FAIL) {
    this.logger.error(messageText);
  }
 else   if (messageKind == IMessage.INFO) {
    if (this.taskLevelVerbose) {
      this.logger.info(messageText);
    }
 else {
      this.logger.verbose(messageText);
    }
  }
 else   if (messageKind == IMessage.WARNING) {
    this.logger.warning(messageText);
  }
 else   if (messageKind == IMessage.WEAVEINFO) {
    this.logger.info(messageText);
  }
 else   if (messageKind == IMessage.TASKTAG) {
  }
 else {
    throw new BuildException("String_Node_Str" + messageKind.toString());
  }
  return handledMessage;
}
Program: 9109
Project: 9109
Buggy source:
public String[] editCommand(String[] command){
  int len=command.length + prefix.length + suffix.length;
  String[] result=new String[len];
  System.arraycopy(result,0,prefix,0,prefix.length);
  System.arraycopy(result,prefix.length,command,0,command.length);
  System.arraycopy(result,prefix.length + command.length,suffix,0,suffix.length);
  return result;
}

Fixed version (ground truth):
@Override public String[] editCommand(String[] command){
  int len=command.length + prefix.length + suffix.length;
  String[] result=new String[len];
  System.arraycopy(result,0,prefix,0,prefix.length);
  System.arraycopy(result,prefix.length,command,0,command.length);
  System.arraycopy(result,prefix.length + command.length,suffix,0,suffix.length);
  return result;
}
Program: 9110
Project: 9110
Buggy source:
public void targetStarted(BuildEvent event){
}

Fixed version (ground truth):
@Override public void targetStarted(BuildEvent event){
}
Program: 9111
Project: 9111
Buggy source:
public void buildFinished(BuildEvent event){
}

Fixed version (ground truth):
@Override public void buildFinished(BuildEvent event){
}
Program: 9112
Project: 9112
Buggy source:
public void messageLogged(BuildEvent event){
  if (priority == event.getPriority()) {
    results.add(event.getMessage());
  }
}

Fixed version (ground truth):
@Override public void messageLogged(BuildEvent event){
  if (priority == event.getPriority()) {
    results.add(event.getMessage());
  }
}
Program: 9113
Project: 9113
Buggy source:
public void buildStarted(BuildEvent event){
}

Fixed version (ground truth):
@Override public void buildStarted(BuildEvent event){
}
Program: 9114
Project: 9114
Buggy source:
public boolean accept(File file){
  return ((null != file) && file.isFile() && file.canWrite()&& file.getPath().endsWith("String_Node_Str"));
}

Fixed version (ground truth):
@Override public boolean accept(File file){
  return ((null != file) && file.isFile() && file.canWrite()&& file.getPath().endsWith("String_Node_Str"));
}
Program: 9115
Project: 9115
Buggy source:
public void taskStarted(BuildEvent event){
}

Fixed version (ground truth):
@Override public void taskStarted(BuildEvent event){
}
Program: 9116
Project: 9116
Buggy source:
public void targetFinished(BuildEvent event){
}

Fixed version (ground truth):
@Override public void targetFinished(BuildEvent event){
}
Program: 9117
Project: 9117
Buggy source:
public void taskFinished(BuildEvent event){
}

Fixed version (ground truth):
@Override public void taskFinished(BuildEvent event){
}
Program: 9118
Project: 9118
Buggy source:
public boolean handleMessage(IMessage message){
  IMessage.Kind kind=message.getKind();
  if (IMessage.ERROR.isSameOrLessThan(kind)) {
    String m=kind.toString();
    AjcTaskTest.collectMessage(m.substring(0,1));
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean handleMessage(IMessage message){
  IMessage.Kind kind=message.getKind();
  if (IMessage.ERROR.isSameOrLessThan(kind)) {
    String m=kind.toString();
    AjcTaskTest.collectMessage(m.substring(0,1));
  }
  return true;
}
Program: 9119
Project: 9119
Buggy source:
public void tearDown(){
  deleteTempDir();
  MESSAGES.setLength(0);
}

Fixed version (ground truth):
@Override public void tearDown(){
  deleteTempDir();
  MESSAGES.setLength(0);
}
Program: 9121
Project: 9121
Buggy source:
Set getAnnotations(Member onMember);

Fixed version (ground truth):
ResolvedType[] getAnnotations(Member onMember,boolean runtimeAnnotationsOnly);
Program: 9122
Project: 9122
Buggy source:
Object getAnnotationFromClass(ResolvedType annotationType,Class aClass);

Fixed version (ground truth):
Object getAnnotationFromClass(ResolvedType annotationType,Class<?> aClass);
Program: 9123
Project: 9123
Buggy source:
@Override public boolean hasAnnotation(UnresolvedType ofType){
  unpackAnnotations();
  return super.hasAnnotation(ofType);
}

Fixed version (ground truth):
@Override public boolean hasAnnotation(UnresolvedType ofType){
  boolean areRuntimeRetentionAnnotationsSufficient=false;
  if (ofType instanceof ResolvedType) {
    areRuntimeRetentionAnnotationsSufficient=((ResolvedType)ofType).isAnnotationWithRuntimeRetention();
  }
  unpackAnnotations(areRuntimeRetentionAnnotationsSufficient);
  return super.hasAnnotation(ofType);
}
Program: 9124
Project: 9124
Buggy source:
private void unpackAnnotations(){
  if (annotationTypes == null && annotationFinder != null) {
    Set<?> s=annotationFinder.getAnnotations(reflectMember);
    if (s.size() == 0) {
      annotationTypes=ResolvedType.EMPTY_ARRAY;
    }
 else {
      annotationTypes=new ResolvedType[s.size()];
      int i=0;
      for (      Object o : s) {
        annotationTypes[i++]=(ResolvedType)o;
      }
    }
  }
}

Fixed version (ground truth):
private void unpackAnnotations(boolean areRuntimeRetentionAnnotationsSufficient){
  if (annotationFinder != null && (annotationTypes == null || (!areRuntimeRetentionAnnotationsSufficient && onlyRuntimeAnnotationsCached))) {
    annotationTypes=annotationFinder.getAnnotations(reflectMember,areRuntimeRetentionAnnotationsSufficient);
    onlyRuntimeAnnotationsCached=areRuntimeRetentionAnnotationsSufficient;
  }
}
Program: 9125
Project: 9125
Buggy source:
@Override public boolean hasAnnotations(){
  unpackAnnotations();
  return super.hasAnnotations();
}

Fixed version (ground truth):
@Override public boolean hasAnnotations(){
  unpackAnnotations(false);
  return super.hasAnnotations();
}
Program: 9126
Project: 9126
Buggy source:
@Override public ResolvedType[] getAnnotationTypes(){
  unpackAnnotations();
  return super.getAnnotationTypes();
}

Fixed version (ground truth):
@Override public ResolvedType[] getAnnotationTypes(){
  unpackAnnotations(false);
  return super.getAnnotationTypes();
}
Program: 9127
Project: 9127
Buggy source:
@Override public AnnotationAJ getAnnotationOfType(UnresolvedType ofType){
  unpackAnnotations();
  if (annotationFinder == null || annotationTypes == null) {
    return null;
  }
  for (  ResolvedType type : annotationTypes) {
    if (type.getSignature().equals(ofType.getSignature())) {
      return annotationFinder.getAnnotationOfType(ofType,reflectMember);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public AnnotationAJ getAnnotationOfType(UnresolvedType ofType){
  unpackAnnotations(false);
  if (annotationFinder == null || annotationTypes == null) {
    return null;
  }
  for (  ResolvedType type : annotationTypes) {
    if (type.getSignature().equals(ofType.getSignature())) {
      return annotationFinder.getAnnotationOfType(ofType,reflectMember);
    }
  }
  return null;
}
Program: 9128
Project: 9128
Buggy source:
/** 
 * @param kind
 * @param declaringType
 * @param modifiers
 * @param name
 * @param signature
 */
public ReflectionBasedResolvedMemberImpl(MemberKind kind,UnresolvedType declaringType,int modifiers,String name,String signature,Member reflectMember){
  super(kind,declaringType,modifiers,name,signature);
  this.reflectMember=reflectMember;
}

Fixed version (ground truth):
public ReflectionBasedResolvedMemberImpl(MemberKind kind,UnresolvedType declaringType,int modifiers,String name,String signature,Member reflectMember){
  super(kind,declaringType,modifiers,name,signature);
  this.reflectMember=reflectMember;
}
Program: 9129
Project: 9129
Buggy source:
public static ResolvedType resolve(World world,Class aClass){
  String className=aClass.getName();
  if (aClass.isArray()) {
    return world.resolve(UnresolvedType.forSignature(className.replace('.','/')));
  }
 else {
    return world.resolve(className);
  }
}

Fixed version (ground truth):
public static ResolvedType resolve(World world,Class<?> aClass){
  String className=aClass.getName();
  if (aClass.isArray()) {
    return world.resolve(UnresolvedType.forSignature(className.replace('.','/')));
  }
 else {
    return world.resolve(className);
  }
}
Program: 9130
Project: 9130
Buggy source:
public static AnnotationFinder makeAnnotationFinderIfAny(ClassLoader loader,World world){
  AnnotationFinder annotationFinder=null;
  try {
    if (LangUtil.is15VMOrGreater()) {
      Class java15AnnotationFinder=Class.forName("String_Node_Str");
      annotationFinder=(AnnotationFinder)java15AnnotationFinder.newInstance();
      annotationFinder.setClassLoader(loader);
      annotationFinder.setWorld(world);
    }
  }
 catch (  ClassNotFoundException ex) {
  }
catch (  IllegalAccessException ex) {
    throw new BCException("String_Node_Str",ex);
  }
catch (  InstantiationException ex) {
    throw new BCException("String_Node_Str",ex);
  }
  return annotationFinder;
}

Fixed version (ground truth):
public static AnnotationFinder makeAnnotationFinderIfAny(ClassLoader loader,World world){
  AnnotationFinder annotationFinder=null;
  try {
    if (LangUtil.is15VMOrGreater()) {
      Class<?> java15AnnotationFinder=Class.forName("String_Node_Str");
      annotationFinder=(AnnotationFinder)java15AnnotationFinder.newInstance();
      annotationFinder.setClassLoader(loader);
      annotationFinder.setWorld(world);
    }
  }
 catch (  ClassNotFoundException ex) {
  }
catch (  IllegalAccessException ex) {
    throw new BCException("String_Node_Str",ex);
  }
catch (  InstantiationException ex) {
    throw new BCException("String_Node_Str",ex);
  }
  return annotationFinder;
}
Program: 9131
Project: 9131
Buggy source:
public MethodBinding[] getMethods(SourceTypeBinding sourceTypeBinding,char[] selector){
  MethodBinding[] orig=sourceTypeBinding.getMethodsBase(selector);
  if (interTypeMethods.isEmpty()) {
    return orig;
  }
  List ret=new ArrayList(Arrays.asList(orig));
  for (int i=0, len=interTypeMethods.size(); i < len; i++) {
    MethodBinding method=(MethodBinding)interTypeMethods.get(i);
    if (CharOperation.equals(selector,method.selector)) {
      ret.add(method);
    }
  }
  if (ret.isEmpty()) {
    return Binding.NO_METHODS;
  }
  return (MethodBinding[])ret.toArray(new MethodBinding[ret.size()]);
}

Fixed version (ground truth):
public MethodBinding[] getMethods(SourceTypeBinding sourceTypeBinding,char[] selector){
  MethodBinding[] orig=sourceTypeBinding.getMethodsBase(selector);
  if (interTypeMethods.isEmpty()) {
    return orig;
  }
  Set<MethodBinding> ret=new HashSet<MethodBinding>(Arrays.asList(orig));
  for (int i=0, len=interTypeMethods.size(); i < len; i++) {
    MethodBinding method=(MethodBinding)interTypeMethods.get(i);
    if (CharOperation.equals(selector,method.selector)) {
      ret.add(method);
    }
  }
  if (ret.isEmpty()) {
    return Binding.NO_METHODS;
  }
  return (MethodBinding[])ret.toArray(new MethodBinding[ret.size()]);
}
Program: 9134
Project: 9134
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(AllTestsAspectJ182.suite());
  suite.addTest(AllTestsAspectJ181.suite());
  suite.addTest(AllTestsAspectJ180.suite());
  suite.addTest(AllTests17.suite());
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(AllTestsAspectJ183.suite());
  suite.addTest(AllTestsAspectJ182.suite());
  suite.addTest(AllTestsAspectJ181.suite());
  suite.addTest(AllTestsAspectJ180.suite());
  suite.addTest(AllTests17.suite());
  return suite;
}
Program: 9136
Project: 9136
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(AllTestsAspectJ173.suite());
  suite.addTest(AllTestsAspectJ172.suite());
  suite.addTest(AllTestsAspectJ171.suite());
  suite.addTest(AllTestsAspectJ170.suite());
  suite.addTest(AllTests16.suite());
  suite.addTest(AllTests15.suite());
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(AllTestsAspectJ174.suite());
  suite.addTest(AllTestsAspectJ173.suite());
  suite.addTest(AllTestsAspectJ172.suite());
  suite.addTest(AllTestsAspectJ171.suite());
  suite.addTest(AllTestsAspectJ170.suite());
  suite.addTest(AllTests16.suite());
  suite.addTest(AllTests15.suite());
  return suite;
}
Program: 9137
Project: 9137
Buggy source:
private void addPointcutsResolvingConflicts(List acc,List added,boolean isOverriding){
  for (Iterator i=added.iterator(); i.hasNext(); ) {
    ResolvedPointcutDefinition toAdd=(ResolvedPointcutDefinition)i.next();
    for (Iterator j=acc.iterator(); j.hasNext(); ) {
      ResolvedPointcutDefinition existing=(ResolvedPointcutDefinition)j.next();
      if (existing == toAdd) {
        continue;
      }
      if (!isVisible(existing.getModifiers(),existing.getDeclaringType().resolve(getWorld()),this)) {
        if (existing.isAbstract() && conflictingSignature(existing,toAdd)) {
          getWorld().showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.POINTCUT_NOT_VISIBLE,existing.getDeclaringType().getName() + "String_Node_Str" + existing.getName()+ "String_Node_Str",this.getName()),toAdd.getSourceLocation(),null);
          j.remove();
        }
        continue;
      }
      if (conflictingSignature(existing,toAdd)) {
        if (isOverriding) {
          checkLegalOverride(existing,toAdd);
          j.remove();
        }
 else {
          getWorld().showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.CONFLICTING_INHERITED_POINTCUTS,this.getName() + toAdd.getSignature()),existing.getSourceLocation(),toAdd.getSourceLocation());
          j.remove();
        }
      }
    }
    acc.add(toAdd);
  }
}

Fixed version (ground truth):
private void addPointcutsResolvingConflicts(List acc,List added,boolean isOverriding){
  for (Iterator i=added.iterator(); i.hasNext(); ) {
    ResolvedPointcutDefinition toAdd=(ResolvedPointcutDefinition)i.next();
    for (Iterator j=acc.iterator(); j.hasNext(); ) {
      ResolvedPointcutDefinition existing=(ResolvedPointcutDefinition)j.next();
      if (existing == toAdd) {
        continue;
      }
      ResolvedType pointcutDeclaringType=existing.getDeclaringType().resolve(getWorld());
      if (pointcutDeclaringType == null) {
        throw new BCException("String_Node_Str" + existing.toString());
      }
      if (!isVisible(existing.getModifiers(),pointcutDeclaringType,this)) {
        if (existing.isAbstract() && conflictingSignature(existing,toAdd)) {
          getWorld().showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.POINTCUT_NOT_VISIBLE,existing.getDeclaringType().getName() + "String_Node_Str" + existing.getName()+ "String_Node_Str",this.getName()),toAdd.getSourceLocation(),null);
          j.remove();
        }
        continue;
      }
      if (conflictingSignature(existing,toAdd)) {
        if (isOverriding) {
          checkLegalOverride(existing,toAdd);
          j.remove();
        }
 else {
          getWorld().showMessage(IMessage.ERROR,WeaverMessages.format(WeaverMessages.CONFLICTING_INHERITED_POINTCUTS,this.getName() + toAdd.getSignature()),existing.getSourceLocation(),toAdd.getSourceLocation());
          j.remove();
        }
      }
    }
    acc.add(toAdd);
  }
}
Program: 9139
Project: 9139
Buggy source:
/** 
 * Convert String[] paths to File[] as offset of base directory 
 * @param basedir the non-null File base directory for File to create with paths
 * @param paths the String[] of paths to create
 * @param suffixes the String[] of suffixes to limit sources to - ignored if null
 * @return File[] with same length as paths
 */
public static File[] getBaseDirFiles(File basedir,String[] paths,String[] suffixes){
  LangUtil.throwIaxIfNull(basedir,"String_Node_Str");
  LangUtil.throwIaxIfNull(paths,"String_Node_Str");
  File[] result=null;
  if (!LangUtil.isEmpty(suffixes)) {
    ArrayList list=new ArrayList();
    for (int i=0; i < paths.length; i++) {
      boolean listed=false;
      String path=paths[i];
      for (int j=0; !listed && (j < suffixes.length); j++) {
        String suffix=suffixes[j];
        if (listed=path.endsWith(suffix)) {
          list.add(new File(basedir,paths[i]));
        }
      }
    }
    result=(File[])list.toArray(new File[0]);
  }
 else {
    result=new File[paths.length];
    for (int i=0; i < result.length; i++) {
      result[i]=newFile(basedir,paths[i]);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Convert String[] paths to File[] as offset of base directory 
 * @param basedir the non-null File base directory for File to create with paths
 * @param paths the String[] of paths to create
 * @param suffixes the String[] of suffixes to limit sources to - ignored if null
 * @return File[] with same length as paths
 */
public static File[] getBaseDirFiles(File basedir,String[] paths,String[] suffixes){
  LangUtil.throwIaxIfNull(basedir,"String_Node_Str");
  LangUtil.throwIaxIfNull(paths,"String_Node_Str");
  File[] result=null;
  if (!LangUtil.isEmpty(suffixes)) {
    ArrayList list=new ArrayList();
    for (int i=0; i < paths.length; i++) {
      String path=paths[i];
      for (int j=0; j < suffixes.length; j++) {
        if (path.endsWith(suffixes[j])) {
          list.add(new File(basedir,paths[i]));
          break;
        }
      }
    }
    result=(File[])list.toArray(new File[0]);
  }
 else {
    result=new File[paths.length];
    for (int i=0; i < result.length; i++) {
      result[i]=newFile(basedir,paths[i]);
    }
  }
  return result;
}
Program: 9140
Project: 9140
Buggy source:
/** 
 * Add keyword if non-empty and not duplicate 
 */
public void addKeyword(String keyword){
  if (!LangUtil.isEmptyTrimmed(keyword)) {
    keyword=keyword.trim();
    if (!keywords.contains(keyword)) {
      keywords.add(keyword);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add keyword if non-empty and not duplicate 
 */
public void addKeyword(String keyword){
  if (!isEmptyTrimmed(keyword)) {
    keyword=keyword.trim();
    if (!keywords.contains(keyword)) {
      keywords.add(keyword);
    }
  }
}
Program: 9141
Project: 9141
Buggy source:
/** 
 * @return String[] copy of argfiles array 
 */
public String[] getArgfilesArray(){
  String[] argfiles=this.argfiles;
  if (LangUtil.isEmpty(argfiles)) {
    return new String[0];
  }
  return (String[])LangUtil.copy(argfiles);
}

Fixed version (ground truth):
/** 
 * @return String[] copy of argfiles array 
 */
public String[] getArgfilesArray(){
  String[] argfiles=this.argfiles;
  if (LangUtil.isEmpty(argfiles)) {
    return new String[0];
  }
  return (String[])copy(argfiles);
}
Program: 9142
Project: 9142
Buggy source:
private static String[] copy(String[] input){
  if (null == input) {
    return null;
  }
  String[] result=new String[input.length];
  System.arraycopy(input,0,result,0,input.length);
  return result;
}

Fixed version (ground truth):
/** 
 * Make a copy of the array.
 * @return an array with the same component type as sourcecontaining same elements, even if null.
 * @throws IllegalArgumentException if source is null
 */
public static final Object[] copy(Object[] source){
  LangUtil.throwIaxIfNull(source,"String_Node_Str");
  final Class c=source.getClass().getComponentType();
  Object[] result=(Object[])Array.newInstance(c,source.length);
  System.arraycopy(source,0,result,0,result.length);
  return result;
}
Program: 9147
Project: 9147
Buggy source:
/** 
 * This implementation skips if: <ul> <li>current VM is not at least any specified javaVersion </li> </ul>
 * @return false if this wants to be skipped, true otherwise
 */
protected boolean doAdoptParentValues(RT parentRuntime,IMessageHandler handler){
  if (!super.doAdoptParentValues(parentRuntime,handler)) {
    return false;
  }
  if ((null != javaVersion) && (!LangUtil.supportsJava(javaVersion))) {
    skipMessage(handler,"String_Node_Str" + javaVersion);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This implementation skips if: <ul> <li>current VM is not at least any specified javaVersion </li> </ul>
 * @return false if this wants to be skipped, true otherwise
 */
protected boolean doAdoptParentValues(RT parentRuntime,IMessageHandler handler){
  if (!super.doAdoptParentValues(parentRuntime,handler)) {
    return false;
  }
  if ((null != javaVersion) && (!Globals.supportsJava(javaVersion))) {
    skipMessage(handler,"String_Node_Str" + javaVersion);
    return false;
  }
  return true;
}
Program: 9149
Project: 9149
Buggy source:
/** 
 * @param version "1.1", "1.2", "1.3", "1.4"
 * @throws IllegalArgumentException if version is not recognized
 */
public void setJavaVersion(String version){
  LangUtil.supportsJava(version);
  this.javaVersion=version;
}

Fixed version (ground truth):
/** 
 * @param version "1.1", "1.2", "1.3", "1.4"
 * @throws IllegalArgumentException if version is not recognized
 */
public void setJavaVersion(String version){
  Globals.supportsJava(version);
  this.javaVersion=version;
}
Program: 9151
Project: 9151
Buggy source:
public Object make(LineReader reader){
  return reader + "String_Node_Str" + reader.lastLine();
}

Fixed version (ground truth):
public Object make(UtilLineReader reader){
  return reader + "String_Node_Str" + reader.lastLine();
}
Program: 9153
Project: 9153
Buggy source:
public void testDeclareMessageContents(){
  List msgs=handler.getMessages();
  IMessage msg=(IMessage)((TestMessageHandler.TestMessage)msgs.get(1)).getContainedMessage();
  assertEquals("String_Node_Str",msg.getMessage());
  assertEquals("String_Node_Str",msg.getDetails());
}

Fixed version (ground truth):
public void testDeclareMessageContents(){
  List msgs=handler.getMessages();
  IMessage msg=((TestMessageHandler.TestMessage)msgs.get(1)).getContainedMessage();
  assertEquals("String_Node_Str",msg.getMessage());
  assertEquals("String_Node_Str",msg.getDetails());
}
Program: 9154
Project: 9154
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  initialiseProject(PROJECT_DIR);
  handler=(TestMessageHandler)getCompiler().getMessageHandler();
  compilerConfig=(TestCompilerConfiguration)getCompiler().getCompilerConfiguration();
  testProps=getAbsoluteProjectDir() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str";
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  initialiseProject(PROJECT_DIR);
  handler=(TestMessageHandler)getCompiler().getMessageHandler();
  compilerConfig=(TestCompilerConfiguration)getCompiler().getCompilerConfiguration();
}
Program: 9155
Project: 9155
Buggy source:
public void testRoot(){
  IProgramElement root=(IProgramElement)model.getRoot();
  assertNotNull(root);
  assertEquals("String_Node_Str" + root.toLabelString(),root.toLabelString(),"String_Node_Str");
}

Fixed version (ground truth):
public void testRoot(){
  IProgramElement root=model.getRoot();
  assertNotNull(root);
  assertEquals("String_Node_Str" + root.toLabelString(),root.toLabelString(),"String_Node_Str");
}
Program: 9156
Project: 9156
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  initialiseProject("String_Node_Str");
  handler=(TestMessageHandler)getCompiler().getMessageHandler();
  compilerConfig=(TestCompilerConfiguration)getCompiler().getCompilerConfiguration();
  compilerConfig.setProjectSourceFiles(getSourceFileList(files));
  doBuild();
  model=AsmManager.getDefault().getHierarchy();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  initialiseProject("String_Node_Str");
  compilerConfig=(TestCompilerConfiguration)getCompiler().getCompilerConfiguration();
  compilerConfig.setProjectSourceFiles(getSourceFileList(files));
  doBuild();
  model=AsmManager.getDefault().getHierarchy();
}
Program: 9157
Project: 9157
Buggy source:
public void testAbstract(){
  IProgramElement node=(IProgramElement)model.getRoot();
  assertNotNull(node);
  IProgramElement aspect=AsmManager.getDefault().getHierarchy().findElementForType(null,"String_Node_Str");
  assertNotNull(aspect);
  String abst="String_Node_Str";
  IProgramElement abstNode=model.findElementForSignature(aspect,IProgramElement.Kind.POINTCUT,abst);
  assertNotNull(abstNode);
  assertEquals(abstNode.toLabelString(),abst);
}

Fixed version (ground truth):
public void testAbstract(){
  IProgramElement node=model.getRoot();
  assertNotNull(node);
  IProgramElement aspect=AsmManager.getDefault().getHierarchy().findElementForType(null,"String_Node_Str");
  assertNotNull(aspect);
  String abst="String_Node_Str";
  IProgramElement abstNode=model.findElementForSignature(aspect,IProgramElement.Kind.POINTCUT,abst);
  assertNotNull(abstNode);
  assertEquals(abstNode.toLabelString(),abst);
}
Program: 9158
Project: 9158
Buggy source:
public void testInterTypeMemberDeclares(){
  IProgramElement node=(IProgramElement)model.getRoot();
  assertNotNull(node);
  IProgramElement aspect=AsmManager.getDefault().getHierarchy().findElementForType(null,"String_Node_Str");
  assertNotNull(aspect);
  String fieldMsg="String_Node_Str";
  IProgramElement fieldNode=model.findElementForLabel(aspect,IProgramElement.Kind.INTER_TYPE_FIELD,fieldMsg);
  assertNotNull(fieldNode);
  assertEquals(fieldNode.toLabelString(),fieldMsg);
  String methodMsg="String_Node_Str";
  IProgramElement methodNode=model.findElementForLabel(aspect,IProgramElement.Kind.INTER_TYPE_METHOD,methodMsg);
  assertNotNull(methodNode);
  assertEquals(methodNode.toLabelString(),methodMsg);
}

Fixed version (ground truth):
public void testInterTypeMemberDeclares(){
  IProgramElement node=model.getRoot();
  assertNotNull(node);
  IProgramElement aspect=AsmManager.getDefault().getHierarchy().findElementForType(null,"String_Node_Str");
  assertNotNull(aspect);
  String fieldMsg="String_Node_Str";
  IProgramElement fieldNode=model.findElementForLabel(aspect,IProgramElement.Kind.INTER_TYPE_FIELD,fieldMsg);
  assertNotNull(fieldNode);
  assertEquals(fieldNode.toLabelString(),fieldMsg);
  String methodMsg="String_Node_Str";
  IProgramElement methodNode=model.findElementForLabel(aspect,IProgramElement.Kind.INTER_TYPE_METHOD,methodMsg);
  assertNotNull(methodNode);
  assertEquals(methodNode.toLabelString(),methodMsg);
}
Program: 9159
Project: 9159
Buggy source:
public void testPointcuts(){
  IProgramElement node=(IProgramElement)model.getRoot();
  assertNotNull(node);
  IProgramElement aspect=AsmManager.getDefault().getHierarchy().findElementForType(null,"String_Node_Str");
  assertNotNull(aspect);
  String ptct="String_Node_Str";
  IProgramElement ptctNode=model.findElementForSignature(aspect,IProgramElement.Kind.POINTCUT,ptct);
  assertNotNull(ptctNode);
  assertEquals(ptctNode.toLabelString(),ptct);
  String params="String_Node_Str";
  IProgramElement paramsNode=model.findElementForSignature(aspect,IProgramElement.Kind.POINTCUT,params);
  assertNotNull(paramsNode);
  assertEquals(paramsNode.toLabelString(),params);
}

Fixed version (ground truth):
public void testPointcuts(){
  IProgramElement node=model.getRoot();
  assertNotNull(node);
  IProgramElement aspect=AsmManager.getDefault().getHierarchy().findElementForType(null,"String_Node_Str");
  assertNotNull(aspect);
  String ptct="String_Node_Str";
  IProgramElement ptctNode=model.findElementForSignature(aspect,IProgramElement.Kind.POINTCUT,ptct);
  assertNotNull(ptctNode);
  assertEquals(ptctNode.toLabelString(),ptct);
  String params="String_Node_Str";
  IProgramElement paramsNode=model.findElementForSignature(aspect,IProgramElement.Kind.POINTCUT,params);
  assertNotNull(paramsNode);
  assertEquals(paramsNode.toLabelString(),params);
}
Program: 9160
Project: 9160
Buggy source:
protected void tearDown() throws Exception {
  super.tearDown();
  handler=null;
  compilerConfig=null;
  model=null;
}

Fixed version (ground truth):
protected void tearDown() throws Exception {
  super.tearDown();
  compilerConfig=null;
  model=null;
}
Program: 9162
Project: 9162
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  initialiseProject("String_Node_Str");
  handler=(TestMessageHandler)getCompiler().getMessageHandler();
  compilerConfig=(TestCompilerConfiguration)getCompiler().getCompilerConfiguration();
  compilerConfig.setProjectSourceFiles(getSourceFileList(files));
  doBuild();
  manager=AsmManager.getDefault();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  initialiseProject("String_Node_Str");
  compilerConfig=(TestCompilerConfiguration)getCompiler().getCompilerConfiguration();
  compilerConfig.setProjectSourceFiles(getSourceFileList(files));
  doBuild();
  manager=AsmManager.getDefault();
}
Program: 9163
Project: 9163
Buggy source:
protected void tearDown() throws Exception {
  super.tearDown();
  handler=null;
  compilerConfig=null;
  manager=null;
}

Fixed version (ground truth):
protected void tearDown() throws Exception {
  super.tearDown();
  compilerConfig=null;
  manager=null;
}
Program: 9164
Project: 9164
Buggy source:
public void testPointcutName() throws IOException {
  File testFile=openFile("String_Node_Str" + File.separator + "String_Node_Str");
  IProgramElement node=manager.getHierarchy().findElementForSourceFile(testFile.getAbsolutePath());
  assertTrue("String_Node_Str",node != null);
  IProgramElement pNode=(IProgramElement)((IProgramElement)node).getChildren().get(2);
  IProgramElement pointcut=(IProgramElement)pNode.getChildren().get(0);
  assertTrue("String_Node_Str",pointcut.getKind().equals(IProgramElement.Kind.POINTCUT));
  assertTrue("String_Node_Str" + pointcut.getName(),pointcut.toLabelString().equals("String_Node_Str"));
}

Fixed version (ground truth):
public void testPointcutName() throws IOException {
  File testFile=openFile("String_Node_Str" + File.separator + "String_Node_Str");
  IProgramElement node=manager.getHierarchy().findElementForSourceFile(testFile.getAbsolutePath());
  assertTrue("String_Node_Str",node != null);
  IProgramElement pNode=(IProgramElement)(node).getChildren().get(2);
  IProgramElement pointcut=(IProgramElement)pNode.getChildren().get(0);
  assertTrue("String_Node_Str",pointcut.getKind().equals(IProgramElement.Kind.POINTCUT));
  assertTrue("String_Node_Str" + pointcut.getName(),pointcut.toLabelString().equals("String_Node_Str"));
}
Program: 9165
Project: 9165
Buggy source:
public void testFileNodeFind() throws IOException {
  File testFile=openFile("String_Node_Str" + File.separator + "String_Node_Str");
  IProgramElement node=manager.getHierarchy().findElementForSourceLine(testFile.getAbsolutePath(),1);
  assertTrue("String_Node_Str",node != null);
  assertEquals("String_Node_Str",3,node.getChildren().size());
  IProgramElement pNode=(IProgramElement)node;
  assertTrue("String_Node_Str" + pNode.getName(),pNode.getKind().equals(IProgramElement.Kind.FILE_JAVA));
}

Fixed version (ground truth):
public void testFileNodeFind() throws IOException {
  File testFile=openFile("String_Node_Str" + File.separator + "String_Node_Str");
  IProgramElement node=manager.getHierarchy().findElementForSourceLine(testFile.getAbsolutePath(),1);
  assertTrue("String_Node_Str",node != null);
  assertEquals("String_Node_Str",3,node.getChildren().size());
  assertTrue("String_Node_Str" + node.getName(),node.getKind().equals(IProgramElement.Kind.FILE_JAVA));
}
Program: 9166
Project: 9166
Buggy source:
/** 
 * @todo	add negative test to make sure things that aren't runnable aren't annotated
 */
public void testMainClassNodeInfo() throws IOException {
  IHierarchy model=manager.getHierarchy();
  assertTrue("String_Node_Str",model != null);
  assertTrue("String_Node_Str",model.getRoot() != null);
  File testFile=openFile("String_Node_Str" + File.separator + "String_Node_Str");
  IProgramElement node=model.findElementForSourceLine(testFile.getAbsolutePath(),11);
  assertTrue("String_Node_Str",node != null);
  IProgramElement pNode=(IProgramElement)((IProgramElement)node).getParent();
  if (null == pNode) {
    assertTrue("String_Node_Str" + node,false);
  }
  assertTrue("String_Node_Str" + pNode.getName(),pNode.isRunnable());
}

Fixed version (ground truth):
/** 
 * @todo	add negative test to make sure things that aren't runnable aren't annotated
 */
public void testMainClassNodeInfo() throws IOException {
  IHierarchy model=manager.getHierarchy();
  assertTrue("String_Node_Str",model != null);
  assertTrue("String_Node_Str",model.getRoot() != null);
  File testFile=openFile("String_Node_Str" + File.separator + "String_Node_Str");
  IProgramElement node=model.findElementForSourceLine(testFile.getAbsolutePath(),11);
  assertTrue("String_Node_Str",node != null);
  IProgramElement pNode=node.getParent();
  if (null == pNode) {
    assertTrue("String_Node_Str" + node,false);
  }
  assertTrue("String_Node_Str" + pNode.getName(),pNode.isRunnable());
}