nus-yam/ex-repair huggingface dataset:
Program: 54325
Project: 54325
Buggy source:
/** 
 * @param classNames css class names to convert
 * @return map of the same class names in a form safe for use as Javaidentifiers, with the order of the input set preserved
 * @throws Failure on collisions due to conversions
 */
public Map<String,String> convertSet(Set<String> classNames) throws Failure {
  Map<String,String> rawToConverted=new LinkedHashMap<String,String>();
  Map<String,String> convertedToRaw=new LinkedHashMap<String,String>();
  for (  String className : classNames) {
    String converted=convertName(className);
    String already=convertedToRaw.get(converted);
    if (already != null) {
      throw new Failure("String_Node_Str",already,className);
    }
    if (!converted.equals(className)) {
      convertedToRaw.put(converted,className);
    }
    rawToConverted.put(className,converted);
  }
  return rawToConverted;
}

Fixed version (ground truth):
/** 
 * @param classNames css class names to convert
 * @return map of the same class names in a form safe for use as Javaidentifiers, with the order of the input set preserved
 * @throws Failure on collisions due to conversions
 */
public Map<String,String> convertSet(Set<String> classNames) throws Failure {
  Map<String,String> rawToConverted=new LinkedHashMap<String,String>();
  Map<String,String> convertedToRaw=new LinkedHashMap<String,String>();
  for (  String className : classNames) {
    String converted=convertName(className);
    String already=convertedToRaw.get(converted);
    if (already != null) {
      throw new Failure("String_Node_Str",already,className);
    }
    convertedToRaw.put(converted,className);
    rawToConverted.put(className,converted);
  }
  return rawToConverted;
}
Program: 54326
Project: 54326
Buggy source:
public void testSomeOp() throws CssNameConverter.Failure {
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Pair[] expected={new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str")};
  Map<String,String> out=converter.convertSet(in);
  for (  Pair pair : expected) {
    String convert=out.remove(pair.before);
    assertEquals(pair.after,convert);
  }
  assertTrue(out.isEmpty());
}

Fixed version (ground truth):
public void testSomeOp() throws CssNameConverter.Failure {
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Pair[] expected={new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str")};
  Map<String,String> out=converter.convertSet(in);
  for (  Pair pair : expected) {
    String convert=out.remove(pair.before);
    assertEquals(pair.after,convert);
  }
  assertTrue(out.isEmpty());
}
Program: 54327
Project: 54327
Buggy source:
public void testNoOp() throws CssNameConverter.Failure {
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Map<String,String> out=converter.convertSet(in);
  for (  Map.Entry<String,String> entry : out.entrySet()) {
    String key=entry.getKey();
    assertTrue(in.remove(key));
    assertEquals(key,entry.getValue());
  }
  assertTrue(in.isEmpty());
}

Fixed version (ground truth):
public void testNoOp() throws CssNameConverter.Failure {
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Map<String,String> out=converter.convertSet(in);
  for (  Map.Entry<String,String> entry : out.entrySet()) {
    String key=entry.getKey();
    assertTrue(in.remove(key));
    assertEquals(key,entry.getValue());
  }
  assertTrue(in.isEmpty());
}
Program: 54328
Project: 54328
Buggy source:
public void testCollision(){
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}

Fixed version (ground truth):
public void testCollision(){
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
    fail();
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}
Program: 54329
Project: 54329
Buggy source:
public void testReverseCollision(){
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}

Fixed version (ground truth):
public void testReverseCollision(){
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
    fail();
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}
Program: 54331
Project: 54331
Buggy source:
public ResolveMethodSignature(Resolver resolver,TreeLogger logger,JAbstractMethod method,TypeParameterLookup typeParamLookup,boolean hasReturnType,CollectMethodData methodData,Type[] argTypes,String[] argNames){
  this.resolver=resolver;
  this.logger=logger;
  this.method=method;
  this.typeParamLookup=typeParamLookup;
  this.hasReturnType=hasReturnType;
  this.methodData=methodData;
  this.argTypes=argTypes;
  this.argNames=argNames;
}

Fixed version (ground truth):
/** 
 * Resolve a method signature.
 * @param resolver
 * @param logger
 * @param method
 * @param typeParamLookup
 * @param hasReturnType
 * @param methodData
 * @param argTypes
 * @param argNames
 * @param argNamesAreReal
 */
public ResolveMethodSignature(Resolver resolver,TreeLogger logger,JAbstractMethod method,TypeParameterLookup typeParamLookup,boolean hasReturnType,CollectMethodData methodData,Type[] argTypes,String[] argNames,boolean argNamesAreReal){
  this.resolver=resolver;
  this.logger=logger;
  this.method=method;
  this.typeParamLookup=typeParamLookup;
  this.hasReturnType=hasReturnType;
  this.methodData=methodData;
  this.argTypes=argTypes;
  this.argNames=argNames;
  this.argNamesAreReal=argNamesAreReal;
}
Program: 54332
Project: 54332
Buggy source:
/** 
 * @return true if resolution succeeded.
 */
public boolean finish(){
  boolean failed=false;
  finishBound();
  if (hasReturnType) {
    failed|=(returnType[0] == null);
    ((JMethod)method).setReturnType(returnType[0]);
  }
  List<CollectAnnotationData>[] argAnnotations=methodData.getArgAnnotations();
  if (argTypes.length != params.size()) {
    throw new IllegalStateException("String_Node_Str" + methodData.getDesc() + "String_Node_Str"+ methodData.getSignature()+ "String_Node_Str");
  }
  for (int i=0; i < argTypes.length; ++i) {
    JType argType=params.get(i)[0];
    if (argType == null) {
      failed=true;
      continue;
    }
    Map<Class<? extends Annotation>,Annotation> declaredAnnotations=new HashMap<Class<? extends Annotation>,Annotation>();
    resolver.resolveAnnotations(logger,argAnnotations[i],declaredAnnotations);
    new JParameter(method,argType,argNames[i],declaredAnnotations);
  }
  for (  JType[] exc : exceptions) {
    if (exc[0] == null) {
      failed=true;
      continue;
    }
    method.addThrows(exc[0]);
  }
  return !failed;
}

Fixed version (ground truth):
/** 
 * @return true if resolution succeeded.
 */
public boolean finish(){
  boolean failed=false;
  finishBound();
  if (hasReturnType) {
    failed|=(returnType[0] == null);
    ((JMethod)method).setReturnType(returnType[0]);
  }
  List<CollectAnnotationData>[] argAnnotations=methodData.getArgAnnotations();
  if (argTypes.length != params.size()) {
    throw new IllegalStateException("String_Node_Str" + methodData.getDesc() + "String_Node_Str"+ methodData.getSignature()+ "String_Node_Str");
  }
  for (int i=0; i < argTypes.length; ++i) {
    JType argType=params.get(i)[0];
    if (argType == null) {
      failed=true;
      continue;
    }
    Map<Class<? extends Annotation>,Annotation> declaredAnnotations=new HashMap<Class<? extends Annotation>,Annotation>();
    resolver.resolveAnnotations(logger,argAnnotations[i],declaredAnnotations);
    new JParameter(method,argType,argNames[i],declaredAnnotations,argNamesAreReal);
  }
  for (  JType[] exc : exceptions) {
    if (exc[0] == null) {
      failed=true;
      continue;
    }
    method.addThrows(exc[0]);
  }
  return !failed;
}
Program: 54333
Project: 54333
Buggy source:
private void resolveMethodSignature(ReflectedMethod method,String signature){
  TypeParameterLookup lookup=new TypeParameterLookup();
  lookup.pushEnclosingScopes(method.getEnclosingType());
  lookup.pushScope(method.getTypeParameters());
  int access=Opcodes.ACC_PUBLIC;
  String desc=Type.getMethodDescriptor(method.getMethod());
  CollectMethodData methodData=new CollectMethodData(ClassType.TopLevel,access,method.getName(),desc,signature,null);
  Class<?>[] paramTypes=method.getMethod().getParameterTypes();
  int n=paramTypes.length;
  Type[] argTypes=new Type[n];
  String[] argNames=new String[n];
  for (int i=0; i < n; ++i) {
    argNames[i]="String_Node_Str" + i;
    argTypes[i]=Type.getType(paramTypes[i]);
  }
  ResolveMethodSignature methodResolver=new ResolveMethodSignature(resolver,failTreeLogger,method,lookup,true,methodData,argTypes,argNames);
  new SignatureReader(signature).accept(methodResolver);
  methodResolver.finish();
}

Fixed version (ground truth):
private void resolveMethodSignature(ReflectedMethod method,String signature){
  TypeParameterLookup lookup=new TypeParameterLookup();
  lookup.pushEnclosingScopes(method.getEnclosingType());
  lookup.pushScope(method.getTypeParameters());
  int access=Opcodes.ACC_PUBLIC;
  String desc=Type.getMethodDescriptor(method.getMethod());
  CollectMethodData methodData=new CollectMethodData(ClassType.TopLevel,access,method.getName(),desc,signature,null);
  Class<?>[] paramTypes=method.getMethod().getParameterTypes();
  int n=paramTypes.length;
  Type[] argTypes=new Type[n];
  String[] argNames=new String[n];
  for (int i=0; i < n; ++i) {
    argNames[i]="String_Node_Str" + i;
    argTypes[i]=Type.getType(paramTypes[i]);
  }
  ResolveMethodSignature methodResolver=new ResolveMethodSignature(resolver,failTreeLogger,method,lookup,true,methodData,argTypes,argNames,false);
  new SignatureReader(signature).accept(methodResolver);
  methodResolver.finish();
}
Program: 54335
Project: 54335
Buggy source:
/** 
 * Collects data about a class which only needs the bytecode and no TypeOracle data structures. This is used to make the initial shallow identity pass for creating JRealClassType/JGenericType objects.
 */
private CollectClassData processClass(CompiledClass compiledClass){
  byte[] classBytes=compiledClass.getBytes();
  ClassReader reader=new ClassReader(classBytes);
  CollectClassData mcv=new CollectClassData(classBytes);
  ClassVisitor cv=mcv;
  if (false) {
    cv=new TraceClassVisitor(cv,new PrintWriter(System.out));
  }
  reader.accept(cv,0);
  return mcv;
}

Fixed version (ground truth):
/** 
 * Collects data about a class which only needs the bytecode and no TypeOracle data structures. This is used to make the initial shallow identity pass for creating JRealClassType/JGenericType objects.
 */
private CollectClassData processClass(CompiledClass compiledClass){
  byte[] classBytes=compiledClass.getBytes();
  ClassReader reader=new ClassReader(classBytes);
  CollectClassData mcv=new CollectClassData();
  ClassVisitor cv=mcv;
  if (false) {
    cv=new TraceClassVisitor(cv,new PrintWriter(System.out));
  }
  reader.accept(cv,0);
  return mcv;
}
Program: 54336
Project: 54336
Buggy source:
/** 
 * Returns the binary name of a type. This is the same name that would be returned by   {@link Class#getName()} for this type.
 */
public static String computeBinaryClassName(JType type){
  JPrimitiveType primitiveType=type.isPrimitive();
  if (primitiveType != null) {
    return primitiveType.getJNISignature();
  }
  JArrayType arrayType=type.isArray();
  if (arrayType != null) {
    JType component=arrayType.getComponentType();
    if (component.isClassOrInterface() != null) {
      return "String_Node_Str" + computeBinaryClassName(arrayType.getComponentType()) + "String_Node_Str";
    }
 else {
      return "String_Node_Str" + computeBinaryClassName(arrayType.getComponentType());
    }
  }
  JParameterizedType parameterizedType=type.isParameterized();
  if (parameterizedType != null) {
    return computeBinaryClassName(parameterizedType.getBaseType());
  }
  JClassType classType=type.isClassOrInterface();
  assert(classType != null);
  JClassType enclosingType=classType.getEnclosingType();
  if (enclosingType != null) {
    return computeBinaryClassName(enclosingType) + "String_Node_Str" + classType.getSimpleSourceName();
  }
  return classType.getQualifiedSourceName();
}

Fixed version (ground truth):
/** 
 * Returns the binary name of a type. This is the same name that would be returned by   {@link Class#getName()} for this type.
 * @param type TypeOracle type to get the name for
 * @return binary name for a type 
 */
public static String computeBinaryClassName(JType type){
  JPrimitiveType primitiveType=type.isPrimitive();
  if (primitiveType != null) {
    return primitiveType.getJNISignature();
  }
  JArrayType arrayType=type.isArray();
  if (arrayType != null) {
    JType component=arrayType.getComponentType();
    if (component.isClassOrInterface() != null) {
      return "String_Node_Str" + computeBinaryClassName(arrayType.getComponentType()) + "String_Node_Str";
    }
 else {
      return "String_Node_Str" + computeBinaryClassName(arrayType.getComponentType());
    }
  }
  JParameterizedType parameterizedType=type.isParameterized();
  if (parameterizedType != null) {
    return computeBinaryClassName(parameterizedType.getBaseType());
  }
  JClassType classType=type.isClassOrInterface();
  assert(classType != null);
  JClassType enclosingType=classType.getEnclosingType();
  if (enclosingType != null) {
    return computeBinaryClassName(enclosingType) + "String_Node_Str" + classType.getSimpleSourceName();
  }
  return classType.getQualifiedSourceName();
}
Program: 54337
Project: 54337
Buggy source:
public Map<String,JRealClassType> getBinaryMapper(){
  return binaryMapper;
}

Fixed version (ground truth):
/** 
 * @return a map from binary class names to JRealClassType.
 */
public Map<String,JRealClassType> getBinaryMapper(){
  return binaryMapper;
}
Program: 54338
Project: 54338
Buggy source:
public TypeOracleMediator(TypeOracle typeOracle){
  if (typeOracle == null) {
    typeOracle=new TypeOracle();
  }
  this.typeOracle=typeOracle;
  resolver=new Resolver(){
    public Map<String,JRealClassType> getBinaryMapper(){
      return TypeOracleMediator.this.binaryMapper;
    }
    public TypeOracle getTypeOracle(){
      return TypeOracleMediator.this.typeOracle;
    }
    public boolean resolveAnnotation(    TreeLogger logger,    CollectAnnotationData annotVisitor,    Map<Class<? extends Annotation>,Annotation> declaredAnnotations){
      return TypeOracleMediator.this.resolveAnnotation(logger,annotVisitor,declaredAnnotations);
    }
    public boolean resolveAnnotations(    TreeLogger logger,    List<CollectAnnotationData> annotations,    Map<Class<? extends Annotation>,Annotation> declaredAnnotations){
      return TypeOracleMediator.this.resolveAnnotations(logger,annotations,declaredAnnotations);
    }
    public boolean resolveClass(    TreeLogger logger,    JRealClassType type){
      return TypeOracleMediator.this.resolveClass(logger,type);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Construct a TypeOracleMediator.
 * @param typeOracle TypeOracle instance to use, or null to create a new one
 */
public TypeOracleMediator(TypeOracle typeOracle){
  if (typeOracle == null) {
    typeOracle=new TypeOracle();
  }
  this.typeOracle=typeOracle;
  resolver=new Resolver(){
    public Map<String,JRealClassType> getBinaryMapper(){
      return TypeOracleMediator.this.binaryMapper;
    }
    public TypeOracle getTypeOracle(){
      return TypeOracleMediator.this.typeOracle;
    }
    public boolean resolveAnnotation(    TreeLogger logger,    CollectAnnotationData annotVisitor,    Map<Class<? extends Annotation>,Annotation> declaredAnnotations){
      return TypeOracleMediator.this.resolveAnnotation(logger,annotVisitor,declaredAnnotations);
    }
    public boolean resolveAnnotations(    TreeLogger logger,    List<CollectAnnotationData> annotations,    Map<Class<? extends Annotation>,Annotation> declaredAnnotations){
      return TypeOracleMediator.this.resolveAnnotations(logger,annotations,declaredAnnotations);
    }
    public boolean resolveClass(    TreeLogger logger,    JRealClassType type){
      return TypeOracleMediator.this.resolveClass(logger,type);
    }
  }
;
}
Program: 54339
Project: 54339
Buggy source:
public TypeOracle getTypeOracle(){
  return typeOracle;
}

Fixed version (ground truth):
/** 
 * @return the TypeOracle managed by the mediator.
 */
public TypeOracle getTypeOracle(){
  return typeOracle;
}
Program: 54340
Project: 54340
Buggy source:
public AnnotationEnum(String desc,String value){
  this.desc=desc;
  this.value=value;
}

Fixed version (ground truth):
/** 
 * Construct the value of an Enum-valued annotation.
 * @param desc type descriptor of this enum
 * @param value actual value in this enum
 */
public AnnotationEnum(String desc,String value){
  this.desc=desc;
  this.value=value;
}
Program: 54341
Project: 54341
Buggy source:
public void CollectClassData(byte[] bytes){
  this.bytes=bytes;
}

Fixed version (ground truth):
/** 
 * Construct a visitor that will collect data about a class.
 */
public void CollectClassData(){
}
Program: 54342
Project: 54342
Buggy source:
/** 
 * @return the access
 */
public int getAccess(){
  return access;
}

Fixed version (ground truth):
/** 
 * @return the access flags for this class (ie, bitwise or of Opcodes.ACC_*).
 */
public int getAccess(){
  return access;
}
Program: 54343
Project: 54343
Buggy source:
/** 
 * @return the interfaces
 */
public String[] getInterfaces(){
  return interfaces;
}

Fixed version (ground truth):
/** 
 * @return an array of internal names of interfaces implemented by this class.
 */
public String[] getInterfaces(){
  return interfaces;
}
Program: 54344
Project: 54344
Buggy source:
/** 
 * @return annotations on this class
 */
public List<CollectAnnotationData> getAnnotations(){
  return annotations;
}

Fixed version (ground truth):
/** 
 * @return a list of annotations on this class.
 */
public List<CollectAnnotationData> getAnnotations(){
  return annotations;
}
Program: 54345
Project: 54345
Buggy source:
/** 
 * @return the value
 */
public String getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * @return the annotation value.
 */
public String getValue(){
  return value;
}
Program: 54346
Project: 54346
Buggy source:
public boolean isAnonymous(){
  return classType == ClassType.Anonymous;
}

Fixed version (ground truth):
/** 
 * @return true if this class has no source name at all.
 */
public boolean isAnonymous(){
  return classType == ClassType.Anonymous;
}
Program: 54347
Project: 54347
Buggy source:
/** 
 * @return the fields
 */
public List<CollectFieldData> getFields(){
  return fields;
}

Fixed version (ground truth):
/** 
 * @return a list of fields in this class.
 */
public List<CollectFieldData> getFields(){
  return fields;
}
Program: 54348
Project: 54348
Buggy source:
/** 
 * @return the descriptor
 */
public String getDesc(){
  return desc;
}

Fixed version (ground truth):
/** 
 * @return the type descriptor of the enum type.
 */
public String getDesc(){
  return desc;
}
Program: 54349
Project: 54349
Buggy source:
public boolean hasNoExternalName(){
  return classType == ClassType.Anonymous || classType == ClassType.Local;
}

Fixed version (ground truth):
/** 
 * @return true if this class has no external name (ie, is defined insidea method).
 */
public boolean hasNoExternalName(){
  return classType.hasNoExternalName();
}
Program: 54350
Project: 54350
Buggy source:
public boolean hasHiddenConstructorArg(){
  return false;
}

Fixed version (ground truth):
/** 
 * @return true if this class type has a hidden constructor argumentfor the containing instance (ie, this$0).
 */
public boolean hasHiddenConstructorArg(){
  return false;
}
Program: 54351
Project: 54351
Buggy source:
@SuppressWarnings("String_Node_Str") public CollectMethodData(CollectClassData.ClassType classType,int access,String name,String desc,String signature,String[] exceptions){
  this.access=access;
  this.name=name;
  this.desc=desc;
  this.signature=signature;
  this.exceptions=exceptions;
  syntheticArgs=0;
  argTypes=Type.getArgumentTypes(desc);
  if (classType.hasHiddenConstructorArg() && "String_Node_Str".equals(name)) {
    syntheticArgs=1;
    int n=argTypes.length - syntheticArgs;
    Type[] newArgTypes=new Type[n];
    System.arraycopy(argTypes,syntheticArgs,newArgTypes,0,n);
    argTypes=newArgTypes;
  }
  argNames=new String[argTypes.length];
  paramAnnots=new List[argTypes.length];
  for (int i=0; i < argNames.length; ++i) {
    argNames[i]="String_Node_Str" + i;
    paramAnnots[i]=new ArrayList<CollectAnnotationData>();
  }
}

Fixed version (ground truth):
/** 
 * Prepare to collect data for a method from bytecode.
 * @param classType
 * @param access
 * @param name
 * @param desc
 * @param signature
 * @param exceptions
 */
@SuppressWarnings("String_Node_Str") public CollectMethodData(CollectClassData.ClassType classType,int access,String name,String desc,String signature,String[] exceptions){
  this.access=access;
  this.name=name;
  this.desc=desc;
  this.signature=signature;
  this.exceptions=exceptions;
  syntheticArgs=0;
  argTypes=Type.getArgumentTypes(desc);
  if (classType.hasHiddenConstructorArg() && "String_Node_Str".equals(name)) {
    if (argTypes.length < 1) {
      throw new IllegalStateException("String_Node_Str");
    }
    syntheticArgs=1;
    int n=argTypes.length - syntheticArgs;
    Type[] newArgTypes=new Type[n];
    System.arraycopy(argTypes,syntheticArgs,newArgTypes,0,n);
    argTypes=newArgTypes;
  }
  argNames=new String[argTypes.length];
  paramAnnots=new List[argTypes.length];
  for (int i=0; i < argNames.length; ++i) {
    argNames[i]="String_Node_Str" + i;
    paramAnnots[i]=new ArrayList<CollectAnnotationData>();
  }
}
Program: 54352
Project: 54352
Buggy source:
/** 
 * Attempts to get a named configuration property. Throws <code>BadPropertyValueException</code> if the property is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 */
ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named configuration property. Throws <code>BadPropertyValueException</code> if the property is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param propertyName 
 * @return the configuration property instance (never null)
 * @throws BadPropertyValueException if the property is unknown or not aconfiguration property
 */
ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException ;
Program: 54353
Project: 54353
Buggy source:
/** 
 * Attempts to get a named deferred binding property or configuration property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return a value for the property
 */
@Deprecated String getPropertyValue(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property or configuration property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return a value for the property
 * @throws BadPropertyValueException if the property is unknown or not of theright type
 */
@Deprecated String getPropertyValue(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 54354
Project: 54354
Buggy source:
/** 
 * Attempts to get a named deferred binding property and returns the list of possible values. Throws <code>BadPropertyValueException</code> if the property is a configuration property or is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return the possible values for the property
 */
@Deprecated String[] getPropertyValueSet(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property and returns the list of possible values. Throws <code>BadPropertyValueException</code> if the property is a configuration property or is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return the possible values for the property
 * @throws BadPropertyValueException if the property is unknown or not of theright type 
 */
@Deprecated String[] getPropertyValueSet(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 54355
Project: 54355
Buggy source:
/** 
 * Attempts to get a named deferred binding property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 */
SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger 
 * @param propertyName 
 * @return the selection property instance (never null)
 * @throws BadPropertyValueException if the property is unknown or not aselection property
 */
SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 54356
Project: 54356
Buggy source:
public com.google.gwt.core.ext.ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException {
  for (  final ConfigurationProperty prop : configProps) {
    if (prop.getName().equals(propertyName)) {
      return new com.google.gwt.core.ext.ConfigurationProperty(){
        public String getName(){
          return prop.getName();
        }
        public List<String> getValues(){
          return prop.getValues();
        }
      }
;
    }
  }
  throw new BadPropertyValueException(propertyName);
}

Fixed version (ground truth):
public com.google.gwt.core.ext.ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException {
  for (  final ConfigurationProperty prop : configProps) {
    if (prop.getName().equals(propertyName)) {
      return new DefaultConfigurationProperty(prop.getName(),prop.getValues());
    }
  }
  throw new BadPropertyValueException(propertyName);
}
Program: 54357
Project: 54357
Buggy source:
public String[] getOrderedPropValues(){
  return orderedPropValues;
}

Fixed version (ground truth):
/** 
 * @return an array of binding property values.
 */
public String[] getOrderedPropValues(){
  return orderedPropValues;
}
Program: 54358
Project: 54358
Buggy source:
public BindingProperty[] getOrderedProps(){
  return orderedProps;
}

Fixed version (ground truth):
/** 
 * @return an array of binding properties.
 */
public BindingProperty[] getOrderedProps(){
  return orderedProps;
}
Program: 54359
Project: 54359
Buggy source:
public StaticPropertyOracle(BindingProperty[] orderedProps,String[] orderedPropValues,ConfigurationProperty[] configProps){
  this.orderedProps=orderedProps;
  this.orderedPropValues=orderedPropValues;
  this.configProps=configProps;
  int len=orderedProps.length;
  for (int i=0; i < len; i++) {
    BindingProperty prop=orderedProps[i];
    String value=orderedPropValues[i];
    if (!prop.isAllowedValue(value)) {
      throw new IllegalArgumentException("String_Node_Str" + prop.getName() + "String_Node_Str"+ value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create a property oracle that will return the supplied values.
 * @param orderedProps array of binding properties
 * @param orderedPropValues values of the above binding properties
 * @param configProps array of config properties
 */
public StaticPropertyOracle(BindingProperty[] orderedProps,String[] orderedPropValues,ConfigurationProperty[] configProps){
  this.orderedProps=orderedProps;
  this.orderedPropValues=orderedPropValues;
  this.configProps=configProps;
  int len=orderedProps.length;
  for (int i=0; i < len; i++) {
    BindingProperty prop=orderedProps[i];
    String value=orderedPropValues[i];
    if (!prop.isAllowedValue(value)) {
      throw new IllegalArgumentException("String_Node_Str" + prop.getName() + "String_Node_Str"+ value);
    }
  }
}
Program: 54360
Project: 54360
Buggy source:
public com.google.gwt.core.ext.SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException {
  for (int i=0; i < orderedProps.length; i++) {
    final BindingProperty prop=orderedProps[i];
    final String name=prop.getName();
    final String fallback=prop.getFallback();
    if (name.equals(propertyName)) {
      final String value=orderedPropValues[i];
      String[] values=prop.getDefinedValues();
      final TreeSet<String> possibleValues=new TreeSet<String>();
      for (      String v : values) {
        possibleValues.add(v);
      }
      return new com.google.gwt.core.ext.SelectionProperty(){
        public String getCurrentValue(){
          return value;
        }
        public String getFallbackValue(){
          return fallback;
        }
        public String getName(){
          return name;
        }
        public SortedSet<String> getPossibleValues(){
          return possibleValues;
        }
      }
;
    }
  }
  throw new BadPropertyValueException(propertyName);
}

Fixed version (ground truth):
public com.google.gwt.core.ext.SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException {
  for (int i=0; i < orderedProps.length; i++) {
    final BindingProperty prop=orderedProps[i];
    final String name=prop.getName();
    if (name.equals(propertyName)) {
      final String value=orderedPropValues[i];
      String[] values=prop.getDefinedValues();
      final TreeSet<String> possibleValues=new TreeSet<String>();
      for (      String v : values) {
        possibleValues.add(v);
      }
      return new DefaultSelectionProperty(value,prop.getFallback(),name,possibleValues);
    }
  }
  throw new BadPropertyValueException(propertyName);
}
Program: 54361
Project: 54361
Buggy source:
/** 
 * Invoke a JS method and return its value.
 * @param name method name to invoke
 * @param jthis object to invoke method on, null if static method
 * @param types argument types
 * @param args argument values
 */
@Override protected JsValue doInvoke(String name,Object jthis,Class<?>[] types,Object[] args) throws Throwable {
  TreeLogger branch=host.getLogger().branch(TreeLogger.DEBUG,"String_Node_Str" + name,null);
  CompilingClassLoader isolatedClassLoader=getIsolatedClassLoader();
  JsValueOOPHM jsthis=new JsValueOOPHM();
  Class<?> jthisType=(jthis == null) ? Object.class : jthis.getClass();
  JsValueGlue.set(jsthis,isolatedClassLoader,jthisType,jthis);
  branch.log(TreeLogger.SPAM,"String_Node_Str" + jsthis);
  int argc=args.length;
  JsValueOOPHM argv[]=new JsValueOOPHM[argc];
  for (int i=0; i < argc; ++i) {
    argv[i]=new JsValueOOPHM();
    JsValueGlue.set(argv[i],isolatedClassLoader,types[i],args[i]);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + i + "String_Node_Str"+ argv[i]);
  }
  JsValueOOPHM returnVal=new JsValueOOPHM();
  try {
    channel.invokeJavascript(isolatedClassLoader,jsthis,name,argv,returnVal);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + returnVal);
  }
 catch (  Throwable t) {
    branch.log(TreeLogger.DEBUG,"String_Node_Str",t);
    throw t;
  }
  return returnVal;
}

Fixed version (ground truth):
/** 
 * Invoke a JS method and return its value.
 * @param name method name to invoke
 * @param jthis object to invoke method on, null if static method
 * @param types argument types
 * @param args argument values
 */
@Override protected JsValue doInvoke(String name,Object jthis,Class<?>[] types,Object[] args) throws Throwable {
  TreeLogger branch=host.getLogger().branch(TreeLogger.SPAM,"String_Node_Str" + name,null);
  CompilingClassLoader isolatedClassLoader=getIsolatedClassLoader();
  JsValueOOPHM jsthis=new JsValueOOPHM();
  Class<?> jthisType=(jthis == null) ? Object.class : jthis.getClass();
  JsValueGlue.set(jsthis,isolatedClassLoader,jthisType,jthis);
  branch.log(TreeLogger.SPAM,"String_Node_Str" + jsthis);
  int argc=args.length;
  JsValueOOPHM argv[]=new JsValueOOPHM[argc];
  for (int i=0; i < argc; ++i) {
    argv[i]=new JsValueOOPHM();
    JsValueGlue.set(argv[i],isolatedClassLoader,types[i],args[i]);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + i + "String_Node_Str"+ argv[i]);
  }
  JsValueOOPHM returnVal=new JsValueOOPHM();
  try {
    channel.invokeJavascript(isolatedClassLoader,jsthis,name,argv,returnVal);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + returnVal);
  }
 catch (  Throwable t) {
    branch.log(TreeLogger.SPAM,"String_Node_Str",t);
    throw t;
  }
  return returnVal;
}
Program: 54362
Project: 54362
Buggy source:
/** 
 * Return true if we are running on a Mac.
 */
private static boolean isMac(){
  String lcOSName=System.getProperty("String_Node_Str").toLowerCase();
  return lcOSName.startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Return true if we are running on a Mac.
 */
private static boolean isMac(){
  String lcOSName=System.getProperty("String_Node_Str").toLowerCase(Locale.ENGLISH);
  return lcOSName.startsWith("String_Node_Str");
}
Program: 54363
Project: 54363
Buggy source:
public static String checkHost(String hostUnderConsideration,Set<String> hosts){
  hostUnderConsideration=hostUnderConsideration.toLowerCase();
  for (  String rule : hosts) {
    if (hostUnderConsideration.matches("String_Node_Str" + rule + "String_Node_Str")) {
      return rule;
    }
  }
  return null;
}

Fixed version (ground truth):
public static String checkHost(String hostUnderConsideration,Set<String> hosts){
  hostUnderConsideration=hostUnderConsideration.toLowerCase(Locale.ENGLISH);
  for (  String rule : hosts) {
    if (hostUnderConsideration.matches("String_Node_Str" + rule + "String_Node_Str")) {
      return rule;
    }
  }
  return null;
}
Program: 54364
Project: 54364
Buggy source:
static String suggestServletName(String servletClass){
  int pos=servletClass.lastIndexOf('.');
  String suggest=(pos < 0) ? servletClass : servletClass.substring(pos + 1);
  suggest=Character.toLowerCase(suggest.charAt(0)) + suggest.substring(1);
  return suggest;
}

Fixed version (ground truth):
static String suggestServletName(String servletClass){
  int pos=servletClass.lastIndexOf('.');
  String suggest=(pos < 0) ? servletClass : servletClass.substring(pos + 1);
  String firstChar=suggest.substring(0,1).toLowerCase(Locale.ENGLISH);
  suggest=firstChar + suggest.substring(1);
  return suggest;
}
Program: 54365
Project: 54365
Buggy source:
private Set<String> getSuppressedWarnings(MethodDeclaration method){
  Annotation[] annotations=method.annotations;
  if (annotations == null) {
    return Sets.create();
  }
  for (  Annotation a : annotations) {
    if (SuppressWarnings.class.getName().equals(CharOperation.toString(((ReferenceBinding)a.resolvedType).compoundName))) {
      for (      MemberValuePair pair : a.memberValuePairs()) {
        if (String.valueOf(pair.name).equals("String_Node_Str")) {
          Expression valueExpr=pair.value;
          if (valueExpr instanceof StringLiteral) {
            return Sets.create(((StringLiteral)valueExpr).constant.stringValue().toLowerCase());
          }
 else           if (valueExpr instanceof ArrayInitializer) {
            ArrayInitializer ai=(ArrayInitializer)valueExpr;
            String[] values=new String[ai.expressions.length];
            for (int i=0, j=values.length; i < j; i++) {
              values[i]=((StringLiteral)ai.expressions[i]).constant.stringValue().toLowerCase();
            }
            return Sets.create(values);
          }
 else {
            throw new InternalCompilerException("String_Node_Str");
          }
        }
      }
    }
  }
  return Sets.create();
}

Fixed version (ground truth):
private Set<String> getSuppressedWarnings(MethodDeclaration method){
  Annotation[] annotations=method.annotations;
  if (annotations == null) {
    return Sets.create();
  }
  for (  Annotation a : annotations) {
    if (SuppressWarnings.class.getName().equals(CharOperation.toString(((ReferenceBinding)a.resolvedType).compoundName))) {
      for (      MemberValuePair pair : a.memberValuePairs()) {
        if (String.valueOf(pair.name).equals("String_Node_Str")) {
          Expression valueExpr=pair.value;
          if (valueExpr instanceof StringLiteral) {
            return Sets.create(((StringLiteral)valueExpr).constant.stringValue().toLowerCase(Locale.ENGLISH));
          }
 else           if (valueExpr instanceof ArrayInitializer) {
            ArrayInitializer ai=(ArrayInitializer)valueExpr;
            String[] values=new String[ai.expressions.length];
            for (int i=0, j=values.length; i < j; i++) {
              values[i]=((StringLiteral)ai.expressions[i]).constant.stringValue().toLowerCase(Locale.ENGLISH);
            }
            return Sets.create(values);
          }
 else {
            throw new InternalCompilerException("String_Node_Str");
          }
        }
      }
    }
  }
  return Sets.create();
}
Program: 54366
Project: 54366
Buggy source:
public static ClassPathEntry createEntryForUrl(TreeLogger logger,URL url) throws URISyntaxException, IOException {
  if (url.getProtocol().equals("String_Node_Str")) {
    File f=new File(url.toURI());
    String lowerCaseFileName=f.getName().toLowerCase();
    if (f.isDirectory()) {
      return new DirectoryClassPathEntry(f);
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new JarFile(f));
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new ZipFile(f));
    }
 else {
      try {
        return new ZipFileClassPathEntry(new JarFile(f));
      }
 catch (      Exception ignored) {
      }
      try {
        return new ZipFileClassPathEntry(new ZipFile(f));
      }
 catch (      Exception ignored) {
      }
      logger.log(TreeLogger.TRACE,"String_Node_Str" + f + "String_Node_Str");
      return null;
    }
  }
 else {
    logger.log(TreeLogger.WARN,"String_Node_Str" + url,null);
    return null;
  }
}

Fixed version (ground truth):
public static ClassPathEntry createEntryForUrl(TreeLogger logger,URL url) throws URISyntaxException, IOException {
  if (url.getProtocol().equals("String_Node_Str")) {
    File f=new File(url.toURI());
    String lowerCaseFileName=f.getName().toLowerCase(Locale.ENGLISH);
    if (f.isDirectory()) {
      return new DirectoryClassPathEntry(f);
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new JarFile(f));
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new ZipFile(f));
    }
 else {
      try {
        return new ZipFileClassPathEntry(new JarFile(f));
      }
 catch (      Exception ignored) {
      }
      try {
        return new ZipFileClassPathEntry(new ZipFile(f));
      }
 catch (      Exception ignored) {
      }
      logger.log(TreeLogger.TRACE,"String_Node_Str" + f + "String_Node_Str");
      return null;
    }
  }
 else {
    logger.log(TreeLogger.WARN,"String_Node_Str" + url,null);
    return null;
  }
}
Program: 54367
Project: 54367
Buggy source:
/** 
 * This method checks the host to see if it is in the supplied set of regexes.
 * @param hostUnderConsideration the host to be checked
 * @param hosts the set of regexes to be checked against
 * @return true if the host matches
 */
public static String checkHost(String hostUnderConsideration,Set<String> hosts){
  hostUnderConsideration=hostUnderConsideration.toLowerCase();
  for (  String rule : hosts) {
    rule=rule.toLowerCase();
    if (hostUnderConsideration.matches("String_Node_Str" + rule + "String_Node_Str")) {
      return rule;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method checks the host to see if it is in the supplied set of regexes.
 * @param hostUnderConsideration the host to be checked
 * @param hosts the set of regexes to be checked against
 * @return true if the host matches
 */
public static String checkHost(String hostUnderConsideration,Set<String> hosts){
  hostUnderConsideration=hostUnderConsideration.toLowerCase(Locale.ENGLISH);
  for (  String rule : hosts) {
    rule=rule.toLowerCase(Locale.ENGLISH);
    if (hostUnderConsideration.matches("String_Node_Str" + rule + "String_Node_Str")) {
      return rule;
    }
  }
  return null;
}
Program: 54368
Project: 54368
Buggy source:
public static CheckForUpdates createUpdateChecker(TreeLogger logger,String entryPoint){
  if (System.getProperty("String_Node_Str").toLowerCase().contains("String_Node_Str")) {
    return new CheckForUpdatesIE6(logger,entryPoint);
  }
 else {
    return new CheckForUpdates(logger,entryPoint);
  }
}

Fixed version (ground truth):
public static CheckForUpdates createUpdateChecker(TreeLogger logger,String entryPoint){
  if (System.getProperty("String_Node_Str").toLowerCase(Locale.ENGLISH).contains("String_Node_Str")) {
    return new CheckForUpdatesIE6(logger,entryPoint);
  }
 else {
    return new CheckForUpdates(logger,entryPoint);
  }
}
Program: 54369
Project: 54369
Buggy source:
/** 
 * Retrieve a short name, suitable for use in a tab or filename, for a given user agent.
 * @param userAgent
 * @return short name of user agent
 */
public static String getShortName(String userAgent){
  String lcAgent=userAgent.toLowerCase();
  if (lcAgent.contains("String_Node_Str")) {
    return IE;
  }
 else   if (lcAgent.contains("String_Node_Str")) {
    return CHROME;
  }
 else   if (lcAgent.contains("String_Node_Str")) {
    return OPERA;
  }
 else   if (lcAgent.contains("String_Node_Str") || lcAgent.contains("String_Node_Str")) {
    return SAFARI;
  }
 else   if (lcAgent.contains("String_Node_Str")) {
    return FIREFOX;
  }
  return UNKNOWN;
}

Fixed version (ground truth):
/** 
 * Retrieve a short name, suitable for use in a tab or filename, for a given user agent.
 * @param userAgent
 * @return short name of user agent
 */
public static String getShortName(String userAgent){
  String lcAgent=userAgent.toLowerCase(Locale.ENGLISH);
  if (lcAgent.contains("String_Node_Str")) {
    return IE;
  }
 else   if (lcAgent.contains("String_Node_Str")) {
    return CHROME;
  }
 else   if (lcAgent.contains("String_Node_Str")) {
    return OPERA;
  }
 else   if (lcAgent.contains("String_Node_Str") || lcAgent.contains("String_Node_Str")) {
    return SAFARI;
  }
 else   if (lcAgent.contains("String_Node_Str")) {
    return FIREFOX;
  }
  return UNKNOWN;
}
Program: 54370
Project: 54370
Buggy source:
public int handle(String[] args,int startIndex){
  if (startIndex + 1 < args.length) {
    String style=args[startIndex + 1].toLowerCase();
    if (style.startsWith("String_Node_Str")) {
      option.setOutput(JsOutputOption.OBFUSCATED);
      return 1;
    }
 else     if ("String_Node_Str".equals(style)) {
      option.setOutput(JsOutputOption.PRETTY);
      return 1;
    }
 else     if ("String_Node_Str".equals(style)) {
      option.setOutput(JsOutputOption.DETAILED);
      return 1;
    }
  }
  System.err.println(getTag() + "String_Node_Str");
  System.err.println("String_Node_Str");
  return -1;
}

Fixed version (ground truth):
public int handle(String[] args,int startIndex){
  if (startIndex + 1 < args.length) {
    String style=args[startIndex + 1].toLowerCase(Locale.ENGLISH);
    if (style.startsWith("String_Node_Str")) {
      option.setOutput(JsOutputOption.OBFUSCATED);
      return 1;
    }
 else     if ("String_Node_Str".equals(style)) {
      option.setOutput(JsOutputOption.PRETTY);
      return 1;
    }
 else     if ("String_Node_Str".equals(style)) {
      option.setOutput(JsOutputOption.DETAILED);
      return 1;
    }
  }
  System.err.println(getTag() + "String_Node_Str");
  System.err.println("String_Node_Str");
  return -1;
}
Program: 54371
Project: 54371
Buggy source:
public void testNonOverlappingPrefixesNonEmptyFilter(){
  PathPrefixSet pps=new PathPrefixSet();
  ResourceFilter allowsGifs=new ResourceFilter(){
    public boolean allows(    String path){
      return path.toLowerCase().endsWith("String_Node_Str");
    }
  }
;
  PathPrefix pp1=new PathPrefix("String_Node_Str",allowsGifs);
  PathPrefix pp2=new PathPrefix("String_Node_Str",allowsGifs);
  pps.add(pp1);
  pps.add(pp2);
  assertEquals(pp1,pps.includesResource("String_Node_Str"));
  assertEquals(pp2,pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
}

Fixed version (ground truth):
public void testNonOverlappingPrefixesNonEmptyFilter(){
  PathPrefixSet pps=new PathPrefixSet();
  ResourceFilter allowsGifs=new ResourceFilter(){
    public boolean allows(    String path){
      return path.toLowerCase(Locale.ENGLISH).endsWith("String_Node_Str");
    }
  }
;
  PathPrefix pp1=new PathPrefix("String_Node_Str",allowsGifs);
  PathPrefix pp2=new PathPrefix("String_Node_Str",allowsGifs);
  pps.add(pp1);
  pps.add(pp2);
  assertEquals(pp1,pps.includesResource("String_Node_Str"));
  assertEquals(pp2,pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
  assertNull(pps.includesResource("String_Node_Str"));
}