nus-yam/ex-repair huggingface dataset:
Program: 82061
Project: 82061
Buggy source:
/** 
 * Scans the class to find all methods annotated with @UiChild
 * @param ownerType the type of the owner class
 * @throws UnableToCompleteException
 */
private void findUiChildren(JClassType ownerType) throws UnableToCompleteException {
  JMethod[] methods=ownerType.getMethods();
  while (ownerType != null) {
    for (    JMethod method : methods) {
      UiChild annotation=method.getAnnotation(UiChild.class);
      if (annotation != null) {
        String tag=annotation.tagname();
        int limit=annotation.limit();
        if (tag.equals("String_Node_Str")) {
          String name=method.getName();
          if (name.startsWith("String_Node_Str")) {
            tag=name.substring(3).toLowerCase();
          }
 else {
            logger.die(method.getName() + "String_Node_Str" + "String_Node_Str");
          }
        }
        uiChildren.put(tag,Pair.create(method,limit));
      }
    }
    ownerType=ownerType.getSuperclass();
  }
}

Fixed version (ground truth):
/** 
 * Scans the class to find all methods annotated with @UiChild.
 * @param ownerType the type of the owner class
 * @throws UnableToCompleteException
 */
private void findUiChildren(JClassType ownerType) throws UnableToCompleteException {
  JMethod[] methods=ownerType.getMethods();
  while (ownerType != null) {
    for (    JMethod method : methods) {
      UiChild annotation=method.getAnnotation(UiChild.class);
      if (annotation != null) {
        String tag=annotation.tagname();
        int limit=annotation.limit();
        if (tag.equals("String_Node_Str")) {
          String name=method.getName();
          if (name.startsWith("String_Node_Str")) {
            tag=name.substring(3).toLowerCase();
          }
 else {
            logger.die(method.getName() + "String_Node_Str" + "String_Node_Str");
          }
        }
        uiChildren.put(tag,Pair.create(method,limit));
      }
    }
    ownerType=ownerType.getSuperclass();
  }
}
Program: 82062
Project: 82062
Buggy source:
/** 
 * Gets the panel's child widget.
 * @return the child widget, or <code>null</code> if none is present
 */
public Widget getWidget();

Fixed version (ground truth):
/** 
 * Gets the panel's child widget.
 * @return the child widget, or <code>null</code> if none is present
 */
Widget getWidget();
Program: 82063
Project: 82063
Buggy source:
/** 
 * Sets this panel's widget. Any existing child widget will be removed.
 * @param w the panel's new widget, or <code>null</code> to clear the panel
 */
public void setWidget(Widget w);

Fixed version (ground truth):
/** 
 * Sets this panel's widget. Any existing child widget will be removed.
 * @param w the panel's new widget, or <code>null</code> to clear the panel
 */
void setWidget(Widget w);
Program: 82064
Project: 82064
Buggy source:
/** 
 * Validates all constraints placed on the property named <code>propertyName</code> of the class <code>beanType</code> would the property value be <code>value</code> <p/> <code>ConstraintViolation</code> objects return null for  {@link ConstraintViolation#getRootBean()} and{@link ConstraintViolation#getLeafBean()}
 * @param < T > the type of the RootBean for this validation context
 * @param context The gwt validation context
 * @param beanType the bean type
 * @param propertyName property to validate
 * @param value property value to validate
 * @param groups group or list of groups targeted for validation (default to{@link javax.validation.groups.Default})
 * @return constraint violations or an empty Set if none
 * @throws IllegalArgumentException if <code>beanType</code> is null, if<code>propertyName</code> null, empty or not a valid object property or if null is passed to the varargs groups
 * @throws ValidationException if a non recoverable error happens during thevalidation process
 */
<T>Set<ConstraintViolation<T>> validateValue(GwtValidationContext<T> context,Class<G> beanType,String propertyName,Object value,Class<?>... groups) throws ValidationException ;

Fixed version (ground truth):
/** 
 * Validates all constraints placed on the property named <code>propertyName</code> of the class <code>beanType</code> where the property value is <code>value</code>. <p/> <code>ConstraintViolation</code> objects return null for  {@link ConstraintViolation#getRootBean()} and{@link ConstraintViolation#getLeafBean()}
 * @param < T > the type of the RootBean for this validation context
 * @param context The gwt validation context
 * @param beanType the bean type
 * @param propertyName property to validate
 * @param value property value to validate
 * @param groups group or list of groups targeted for validation (default to{@link javax.validation.groups.Default})
 * @return constraint violations or an empty Set if none
 * @throws IllegalArgumentException if <code>beanType</code> is null, if<code>propertyName</code> null, empty or not a valid object property or if null is passed to the varargs groups
 * @throws ValidationException if a non recoverable error happens during thevalidation process
 */
<T>Set<ConstraintViolation<T>> validateValue(GwtValidationContext<T> context,Class<G> beanType,String propertyName,Object value,Class<?>... groups) throws ValidationException ;
Program: 82065
Project: 82065
Buggy source:
public final String create(){
  SourceWriter sourceWriter=getSourceWriter(logger,context);
  if (sourceWriter != null) {
    writeClassBody(sourceWriter);
    sourceWriter.commit(logger);
  }
  return getQaulifiedName();
}

Fixed version (ground truth):
public final String create(){
  SourceWriter sourceWriter=getSourceWriter(logger,context);
  if (sourceWriter != null) {
    writeClassBody(sourceWriter);
    sourceWriter.commit(logger);
  }
  return getQualifiedName();
}
Program: 82066
Project: 82066
Buggy source:
private final String getSimpleName(){
  return validatorType.getSimpleSourceName() + "String_Node_Str";
}

Fixed version (ground truth):
private String getSimpleName(){
  return validatorType.getSimpleSourceName() + "String_Node_Str";
}
Program: 82067
Project: 82067
Buggy source:
private final SourceWriter getSourceWriter(TreeLogger logger,GeneratorContext ctx){
  String packageName=getPackage();
  String simpleName=getSimpleName();
  PrintWriter printWriter=ctx.tryCreate(logger,packageName,simpleName);
  if (printWriter == null) {
    return null;
  }
  ClassSourceFileComposerFactory composerFactory=new ClassSourceFileComposerFactory(packageName,simpleName);
  compose(composerFactory);
  SourceWriter sourceWriter=composerFactory.createSourceWriter(ctx,printWriter);
  return sourceWriter;
}

Fixed version (ground truth):
private SourceWriter getSourceWriter(TreeLogger logger,GeneratorContext ctx){
  String packageName=getPackage();
  String simpleName=getSimpleName();
  PrintWriter printWriter=ctx.tryCreate(logger,packageName,simpleName);
  if (printWriter == null) {
    return null;
  }
  ClassSourceFileComposerFactory composerFactory=new ClassSourceFileComposerFactory(packageName,simpleName);
  compose(composerFactory);
  SourceWriter sourceWriter=composerFactory.createSourceWriter(ctx,printWriter);
  return sourceWriter;
}
Program: 82069
Project: 82069
Buggy source:
/** 
 * Returns the string representation of the parameters to be passed to the server side method.
 */
private String getParametersAsString(JMethod method,TypeOracle typeOracle){
  StringBuilder sb=new StringBuilder();
  for (  JParameter parameter : method.getParameters()) {
    if (sb.length() > 0) {
      sb.append("String_Node_Str");
    }
    JClassType classType=parameter.getType().isClassOrInterface();
    JType paramType=parameter.getType();
    JParameterizedType params=paramType.isParameterized();
    if (params != null) {
      classType=params.getTypeArgs()[0];
    }
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str" + classType.getQualifiedBinaryName() + "String_Node_Str"+ "String_Node_Str");
    }
    sb.append(parameter.getName());
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str");
    }
  }
  return "String_Node_Str" + sb.toString() + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the string representation of the parameters to be passed to the server side method.
 */
private String getParametersAsString(JMethod method,TypeOracle typeOracle){
  StringBuilder sb=new StringBuilder();
  for (  JParameter parameter : method.getParameters()) {
    if (sb.length() > 0) {
      sb.append("String_Node_Str");
    }
    JClassType classType=parameter.getType().isClassOrInterface();
    JType paramType=parameter.getType();
    if (paramType.getQualifiedSourceName().equals(EntityProxyId.class.getName())) {
      sb.append("String_Node_Str" + parameter.getName() + "String_Node_Str");
      continue;
    }
    JParameterizedType params=paramType.isParameterized();
    if (params != null) {
      classType=params.getTypeArgs()[0];
    }
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str" + classType.getQualifiedBinaryName() + "String_Node_Str"+ "String_Node_Str");
    }
    sb.append(parameter.getName());
    if (classType != null && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
      sb.append("String_Node_Str");
    }
  }
  return "String_Node_Str" + sb.toString() + "String_Node_Str";
}
Program: 82072
Project: 82072
Buggy source:
public void testInternalPrecision(){
  long millis=System.currentTimeMillis();
  Date now=new Date(millis);
  Date after=new Date(now.getTime() + 1);
  Date before=new Date(now.getTime() - 1);
  assertTrue(after.after(now));
  assertTrue(before.before(now));
}

Fixed version (ground truth):
public void testInternalPrecision(){
  long millis=1283895273475L;
  Date now=new Date(millis);
  Date after=new Date(now.getTime() + 1);
  Date before=new Date(now.getTime() - 1);
  assertTrue(after.after(now));
  assertTrue(before.before(now));
}
Program: 82073
Project: 82073
Buggy source:
public void testInternalPrecision(){
  long millis=System.currentTimeMillis();
  Time today=new Time(millis);
  Time after=new Time(today.getTime() + 1);
  Time before=new Time(today.getTime() - 1);
  assertTrue(after.after(today));
  assertTrue(before.before(today));
}

Fixed version (ground truth):
public void testInternalPrecision(){
  long millis=1283895273475L;
  Time today=new Time(millis);
  Time after=new Time(today.getTime() + 1);
  Time before=new Time(today.getTime() - 1);
  assertTrue(after.after(today));
  assertTrue(before.before(today));
}
Program: 82074
Project: 82074
Buggy source:
public void testNanosAffectTime(){
  long now=System.currentTimeMillis();
  int millis=(int)(now % 1000);
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals(millis * 1000000,t.getNanos());
  t.setNanos(0);
  assertEquals(now - millis,t.getTime());
  t.setNanos(999999999);
  assertEquals(now - millis + 999,t.getTime());
}

Fixed version (ground truth):
public void testNanosAffectTime(){
  long now=1283895273475L;
  int millis=(int)(now % 1000);
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals(millis * 1000000,t.getNanos());
  t.setNanos(0);
  assertEquals(now - millis,t.getTime());
  t.setNanos(999999999);
  assertEquals(now - millis + 999,t.getTime());
}
Program: 82075
Project: 82075
Buggy source:
public void testNanosRange(){
  long now=System.currentTimeMillis();
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals((now % 1000) * 1000000,t.getNanos());
  try {
    t.setNanos(-1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(0);
  try {
    t.setNanos(1000000000);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(999999999);
}

Fixed version (ground truth):
public void testNanosRange(){
  long now=1283895273475L;
  Timestamp t=new Timestamp(now);
  assertEquals(now,t.getTime());
  assertEquals((now % 1000) * 1000000,t.getNanos());
  try {
    t.setNanos(-1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(0);
  try {
    t.setNanos(1000000000);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  t.setNanos(999999999);
}
Program: 82076
Project: 82076
Buggy source:
public void testTimeAffectsNanos(){
  long now=(System.currentTimeMillis() / 1000) * 1000 + 5;
  Timestamp t=new Timestamp(now);
  assertEquals(5000000,t.getNanos());
  t.setTime(now + 1);
  assertEquals(6000000,t.getNanos());
}

Fixed version (ground truth):
public void testTimeAffectsNanos(){
  long now=1283895273005L;
  Timestamp t=new Timestamp(now);
  assertEquals(5000000,t.getNanos());
  t.setTime(now + 1);
  assertEquals(6000000,t.getNanos());
}
Program: 82077
Project: 82077
Buggy source:
public void testNanosComparison(){
  long now=System.currentTimeMillis();
  Timestamp t=new Timestamp(now);
  t.setNanos(0);
  Timestamp t2=new Timestamp(t.getTime());
  t2.setNanos(0);
  assertEquals(t,t2);
  assertEquals(0,t.compareTo(t2));
  assertFalse(t.before(t2));
  assertFalse(t.after(t2));
  t2.setNanos(1);
  assertFalse(t.equals(t2));
  assertTrue(t.compareTo(t2) < 0);
  assertTrue(t2.compareTo(t) > 0);
  assertTrue(t.before(t2));
  assertTrue(t2.after(t));
}

Fixed version (ground truth):
public void testNanosComparison(){
  long now=1283895273475L;
  Timestamp t=new Timestamp(now);
  t.setNanos(0);
  Timestamp t2=new Timestamp(t.getTime());
  t2.setNanos(0);
  assertEquals(t,t2);
  assertEquals(0,t.compareTo(t2));
  assertFalse(t.before(t2));
  assertFalse(t.after(t2));
  t2.setNanos(1);
  assertFalse(t.equals(t2));
  assertTrue(t.compareTo(t2) < 0);
  assertTrue(t2.compareTo(t) > 0);
  assertTrue(t.before(t2));
  assertTrue(t2.after(t));
}
Program: 82078
Project: 82078
Buggy source:
/** 
 * Timestamps have some non-obvious comparison semantics when compared to dates.
 */
public void testDateComparison(){
  long now=System.currentTimeMillis();
  Date d=new Date(now);
  Timestamp t=new Timestamp(d.getTime());
  if (now % 1000 == 0) {
    t.setNanos(1000001);
  }
 else {
    t.setNanos(1);
  }
  Date d2=new Date(t.getTime());
  assertFalse("String_Node_Str",d.equals(t));
  assertEquals("String_Node_Str",d2,t);
  assertEquals("String_Node_Str",d2.hashCode(),t.hashCode());
  assertFalse("String_Node_Str",t.equals(d2));
  assertEquals(1,t.compareTo(d2));
  Timestamp t2=new Timestamp(d.getTime());
  t2.setNanos(t.getNanos() + 1);
  assertFalse("String_Node_Str",t.equals(t2));
  assertEquals("String_Node_Str",t.hashCode(),t2.hashCode());
}

Fixed version (ground truth):
/** 
 * Timestamps have some non-obvious comparison semantics when compared to dates.
 */
public void testDateComparison(){
  testDateComparisonOneValue(1283895274000L);
  testDateComparisonOneValue(1283895273475L);
}
Program: 82079
Project: 82079
Buggy source:
Sandbox(AbstractCompiler outer,boolean doGenerateBytes){
  this.outer=outer;
  this.doGenerateBytes=doGenerateBytes;
  rememberPackage("String_Node_Str");
  INameEnvironment env=new INameEnvironmentImpl();
  IErrorHandlingPolicy pol=DefaultErrorHandlingPolicies.proceedWithAllProblems();
  IProblemFactory probFact=new DefaultProblemFactory(Locale.getDefault());
  ICompilerRequestor req=new ICompilerRequestorImpl();
  CompilerOptions options=getCompilerOptions();
  options.docCommentSupport=false;
  compiler=new CompilerImpl(env,pol,options,req,probFact);
  for (  CompilationUnit unit : outer.compilationState.getCompilationUnits()) {
    String packageName=Shared.getPackageName(unit.getTypeName());
    rememberPackage(packageName);
  }
}

Fixed version (ground truth):
Sandbox(AbstractCompiler outer,boolean doGenerateBytes){
  this.outer=outer;
  this.doGenerateBytes=doGenerateBytes;
  rememberPackage("String_Node_Str");
  INameEnvironment env=new INameEnvironmentImpl();
  IErrorHandlingPolicy pol=DefaultErrorHandlingPolicies.proceedWithAllProblems();
  IProblemFactory probFact=new DefaultProblemFactory(Locale.getDefault());
  ICompilerRequestor req=new ICompilerRequestorImpl();
  CompilerOptions options=getCompilerOptions();
  options.docCommentSupport=false;
  compiler=new CompilerImpl(env,pol,options,req,probFact);
  refreshPackagesFromCompState();
}
Program: 82080
Project: 82080
Buggy source:
/** 
 * Causes the compilation service itself to recognize the specified package name (and all its parent packages), avoiding a call back into the host. This is useful as an optimization, but more importantly, it is useful to compile against bytecode that was pre-compiled to which we don't have the source. This ability is crucial bridging the gap between user-level and "dev" code in hosted mode for classes such as JavaScriptHost and ShellJavaScriptHost.
 */
private void rememberPackage(String packageName){
  int i=packageName.lastIndexOf('.');
  if (i != -1) {
    rememberPackage(packageName.substring(0,i));
  }
  knownPackages.add(packageName);
}

Fixed version (ground truth):
/** 
 * Causes the compilation service itself to recognize the specified package name (and all its parent packages), avoiding a call back into the host. This is useful as an optimization, but more importantly, it is useful to compile against bytecode that was pre-compiled to which we don't have the source. This ability is crucial bridging the gap between user-level and "dev" code in hosted mode for classes such as JavaScriptHost and ShellJavaScriptHost.
 */
private void rememberPackage(String packageName){
  if (knownPackages.add(packageName)) {
    int i=packageName.lastIndexOf('.');
    if (i != -1) {
      rememberPackage(packageName.substring(0,i));
    }
  }
}
Program: 82083
Project: 82083
Buggy source:
private void setValue(Layer layer,String prop,double value,Unit unit,boolean vertical,boolean noNegative){
switch (unit) {
case PX:
case PCT:
    break;
default :
  value=value * (int)getUnitSizeInPixels(layer.container,unit,vertical);
unit=Unit.PX;
break;
}
if (noNegative) {
if (value < 0) {
value=0;
}
}
layer.getContainerElement().getStyle().setProperty(prop,value,unit);
}

Fixed version (ground truth):
private void setValue(Layer layer,String prop,double value,Unit unit,boolean vertical,boolean noNegative){
switch (unit) {
case PX:
case PCT:
    break;
default :
  value=value * getUnitSizeInPixels(layer.container,unit,vertical);
unit=Unit.PX;
break;
}
if (noNegative) {
if (value < 0) {
value=0;
}
}
layer.getContainerElement().getStyle().setProperty(prop,(int)(value + 0.5),unit);
}
Program: 82084
Project: 82084
Buggy source:
/** 
 * Get the columns displayed in the expense table.
 */
private Collection<Property<?>> getExpenseColumns(){
  List<Property<?>> columns=new ArrayList<Property<?>>();
  columns.add(ExpenseRecord.amount);
  columns.add(ExpenseRecord.approval);
  columns.add(ExpenseRecord.category);
  columns.add(ExpenseRecord.created);
  columns.add(ExpenseRecord.description);
  columns.add(ExpenseRecord.reasonDenied);
  return columns;
}

Fixed version (ground truth):
/** 
 * Get the columns displayed in the expense table.
 */
private String[] getExpenseColumns(){
  return new String[]{ExpenseRecord.amount.getName(),ExpenseRecord.approval.getName(),ExpenseRecord.category.getName(),ExpenseRecord.created.getName(),ExpenseRecord.description.getName(),ExpenseRecord.reasonDenied.getName()};
}
Program: 82085
Project: 82085
Buggy source:
/** 
 * Request the expenses.
 */
private void requestExpenses(){
  refreshTimer.cancel();
  lastReceiver=new Receiver<List<ExpenseRecord>>(){
    public void onSuccess(    List<ExpenseRecord> newValues,    Set<SyncResult> syncResults){
      if (this == lastReceiver) {
        List<ExpenseRecord> list=new ArrayList<ExpenseRecord>(newValues);
        sortExpenses(list,lastComparator);
        items.setList(list);
        refreshCost();
        boolean isInitialData=knownExpenseKeys == null;
        if (knownExpenseKeys == null) {
          knownExpenseKeys=new HashMap<Object,ExpenseRecord>();
        }
        for (        ExpenseRecord value : newValues) {
          Object key=items.getKey(value);
          if (!isInitialData) {
            ExpenseRecord existing=knownExpenseKeys.get(key);
            if (existing == null || !value.getAmount().equals(existing.getAmount()) || !value.getDescription().equals(existing.getDescription()) || !value.getCategory().equals(existing.getCategory())) {
              (new PhaseAnimation.CellTablePhaseAnimation<ExpenseRecord>(table,value,items)).run();
            }
          }
          knownExpenseKeys.put(key,value);
        }
      }
      refreshTimer.schedule(REFRESH_INTERVAL);
    }
  }
;
  expensesRequestFactory.expenseRequest().findExpensesByReport(report.getRef(Record.id)).forProperties(getExpenseColumns()).fire(lastReceiver);
}

Fixed version (ground truth):
/** 
 * Request the expenses.
 */
private void requestExpenses(){
  refreshTimer.cancel();
  lastReceiver=new Receiver<List<ExpenseRecord>>(){
    public void onSuccess(    List<ExpenseRecord> newValues,    Set<SyncResult> syncResults){
      if (this == lastReceiver) {
        List<ExpenseRecord> list=new ArrayList<ExpenseRecord>(newValues);
        sortExpenses(list,lastComparator);
        items.setList(list);
        refreshCost();
        boolean isInitialData=knownExpenseKeys == null;
        if (knownExpenseKeys == null) {
          knownExpenseKeys=new HashMap<Object,ExpenseRecord>();
        }
        for (        ExpenseRecord value : newValues) {
          Object key=items.getKey(value);
          if (!isInitialData) {
            ExpenseRecord existing=knownExpenseKeys.get(key);
            if (existing == null || !value.getAmount().equals(existing.getAmount()) || !value.getDescription().equals(existing.getDescription()) || !value.getCategory().equals(existing.getCategory())) {
              (new PhaseAnimation.CellTablePhaseAnimation<ExpenseRecord>(table,value,items)).run();
            }
          }
          knownExpenseKeys.put(key,value);
        }
      }
      refreshTimer.schedule(REFRESH_INTERVAL);
    }
  }
;
  expensesRequestFactory.expenseRequest().findExpensesByReport(report.getRef(Record.id)).with(getExpenseColumns()).fire(lastReceiver);
}
Program: 82086
Project: 82086
Buggy source:
public void onReportChanged(ReportRecordChanged event){
  ReportRecord changed=event.getRecord();
  if (report != null && report.getId().equals(changed.getId())) {
    report=changed;
    setNotesEditState(false,false,changed.getNotes());
  }
}

Fixed version (ground truth):
public void onReportChanged(ReportRecordChanged event){
  ReportRecord changed=event.getRecord();
  if (report != null && report.getId().equals(changed.getId())) {
    expensesRequestFactory.reportRequest().findReport(report.getRef(ReportRecord.id)).with(ReportRecord.notes.getName()).fire(new Receiver<ReportRecord>(){
      @Override public void onSuccess(      ReportRecord response,      Set<SyncResult> syncResults){
        report=response;
        setNotesEditState(false,false,response.getNotes());
      }
    }
);
  }
}
Program: 82087
Project: 82087
Buggy source:
public ExpenseList(){
  reports.setKeyProvider(Expenses.REPORT_RECORD_KEY_PROVIDER);
  reportColumns=new ArrayList<Property<?>>();
  reportColumns.add(ReportRecord.created);
  reportColumns.add(ReportRecord.purpose);
  reportColumns.add(ReportRecord.notes);
  createTable();
  searchBox=new DefaultTextBox("String_Node_Str");
  initWidget(uiBinder.createAndBindUi(this));
  reports.addDataDisplay(table);
  searchBox.addKeyUpHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        search();
        return;
      }
      String text=searchBox.getText();
      if (text.length() > 0) {
        searchRegExp=RegExp.compile("String_Node_Str" + text + "String_Node_Str","String_Node_Str");
      }
 else {
        searchRegExp=null;
      }
      table.redraw();
    }
  }
);
  searchButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      search();
    }
  }
);
}

Fixed version (ground truth):
public ExpenseList(){
  reports.setKeyProvider(Expenses.REPORT_RECORD_KEY_PROVIDER);
  createTable();
  searchBox=new DefaultTextBox("String_Node_Str");
  initWidget(uiBinder.createAndBindUi(this));
  reports.addDataDisplay(table);
  searchBox.addKeyUpHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        search();
        return;
      }
      String text=searchBox.getText();
      if (text.length() > 0) {
        searchRegExp=RegExp.compile("String_Node_Str" + text + "String_Node_Str","String_Node_Str");
      }
 else {
        searchRegExp=null;
      }
      table.redraw();
    }
  }
);
  searchButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      search();
    }
  }
);
}
Program: 82089
Project: 82089
Buggy source:
@Override protected void onRangeChanged(HasData<EmployeeRecord> view){
  Range range=view.getVisibleRange();
  requestFactory.employeeRequest().findEmployeeEntriesByDepartment(department,range.getStart(),range.getLength()).forProperties(getEmployeeMenuProperties()).fire(this);
}

Fixed version (ground truth):
@Override protected void onRangeChanged(HasData<EmployeeRecord> view){
  Range range=view.getVisibleRange();
  requestFactory.employeeRequest().findEmployeeEntriesByDepartment(department,range.getStart(),range.getLength()).with(getEmployeeMenuProperties()).fire(this);
}
Program: 82090
Project: 82090
Buggy source:
public boolean isLeaf(Object value){
  return !isDepartment(value) || isAllDepartment(value);
}

Fixed version (ground truth):
public boolean isLeaf(Object value){
  return value != null && (!isDepartment(value) || isAllDepartment(value));
}
Program: 82091
Project: 82091
Buggy source:
private Collection<Property<?>> getEmployeeMenuProperties(){
  List<Property<?>> columns=new ArrayList<Property<?>>();
  columns.add(EmployeeRecord.displayName);
  columns.add(EmployeeRecord.userName);
  return columns;
}

Fixed version (ground truth):
private String[] getEmployeeMenuProperties(){
  return new String[]{EmployeeRecord.displayName.getName(),EmployeeRecord.userName.getName()};
}
Program: 82093
Project: 82093
Buggy source:
public void create(ReportRecord report){
  expense=(ExpenseRecord)requestFactory.create(ExpenseRecord.class);
  requestObject=requestFactory.expenseRequest().persist(expense);
  ExpenseRecord editableExpense=requestObject.edit(expense);
  editableExpense.setReport(report);
  displayExpense();
}

Fixed version (ground truth):
public void create(ReportRecord report){
  expense=requestFactory.create(ExpenseRecord.class);
  requestObject=requestFactory.expenseRequest().persist(expense);
  ExpenseRecord editableExpense=requestObject.edit(expense);
  editableExpense.setReport(report);
  displayExpense();
}
Program: 82094
Project: 82094
Buggy source:
private Collection<Property<?>> getExpenseColumns(){
  List<Property<?>> columns=new ArrayList<Property<?>>();
  columns.add(ExpenseRecord.description);
  columns.add(ExpenseRecord.amount);
  return columns;
}

Fixed version (ground truth):
private String[] getExpenseColumns(){
  return new String[]{ExpenseRecord.description.getName(),ExpenseRecord.amount.getName()};
}
Program: 82095
Project: 82095
Buggy source:
/** 
 * Request the expenses.
 */
private void requestExpenses(){
  refreshTimer.cancel();
  if (requestFactory == null || report == null) {
    return;
  }
  lastReceiver=new Receiver<List<ExpenseRecord>>(){
    public void onSuccess(    List<ExpenseRecord> newValues,    Set<SyncResult> syncResults){
      if (this == lastReceiver) {
        int size=newValues.size();
        expenseDataProvider.updateRowCount(size,true);
        expenseDataProvider.updateRowData(0,newValues);
        boolean isInitialData=knownDeniedKeys == null;
        if (knownDeniedKeys == null) {
          knownDeniedKeys=new HashSet<Object>();
        }
        for (        ExpenseRecord value : newValues) {
          Object key=expenseDataProvider.getKey(value);
          String approval=value.getApproval();
          if (Expenses.Approval.DENIED.getText().equals(approval)) {
            if (!isInitialData && !knownDeniedKeys.contains(key)) {
              (new PhaseAnimation.CellListPhaseAnimation<ExpenseRecord>(expenseList,value,expenseDataProvider)).run();
            }
            knownDeniedKeys.add(key);
          }
 else {
            knownDeniedKeys.remove(key);
          }
        }
        refreshTimer.schedule(REFRESH_INTERVAL);
      }
    }
  }
;
  requestFactory.expenseRequest().findExpensesByReport(report.getRef(ReportRecord.id)).forProperties(getExpenseColumns()).fire(lastReceiver);
}

Fixed version (ground truth):
/** 
 * Request the expenses.
 */
private void requestExpenses(){
  refreshTimer.cancel();
  if (requestFactory == null || report == null) {
    return;
  }
  lastReceiver=new Receiver<List<ExpenseRecord>>(){
    public void onSuccess(    List<ExpenseRecord> newValues,    Set<SyncResult> syncResults){
      if (this == lastReceiver) {
        int size=newValues.size();
        expenseDataProvider.updateRowCount(size,true);
        expenseDataProvider.updateRowData(0,newValues);
        boolean isInitialData=knownDeniedKeys == null;
        if (knownDeniedKeys == null) {
          knownDeniedKeys=new HashSet<Object>();
        }
        for (        ExpenseRecord value : newValues) {
          Object key=expenseDataProvider.getKey(value);
          String approval=value.getApproval();
          if (Expenses.Approval.DENIED.getText().equals(approval)) {
            if (!isInitialData && !knownDeniedKeys.contains(key)) {
              (new PhaseAnimation.CellListPhaseAnimation<ExpenseRecord>(expenseList,value,expenseDataProvider)).run();
            }
            knownDeniedKeys.add(key);
          }
 else {
            knownDeniedKeys.remove(key);
          }
        }
        refreshTimer.schedule(REFRESH_INTERVAL);
      }
    }
  }
;
  requestFactory.expenseRequest().findExpensesByReport(report.getRef(ReportRecord.id)).with(getExpenseColumns()).fire(lastReceiver);
}
Program: 82096
Project: 82096
Buggy source:
public void create(EmployeeRecord reporter){
  report=(ReportRecord)requestFactory.create(ReportRecord.class);
  requestObject=requestFactory.reportRequest().persist(report);
  ReportRecord editableReport=requestObject.edit(report);
  editableReport.setReporter(reporter);
  displayReport();
}

Fixed version (ground truth):
public void create(EmployeeRecord reporter){
  report=requestFactory.create(ReportRecord.class);
  requestObject=requestFactory.reportRequest().persist(report);
  ReportRecord editableReport=requestObject.edit(report);
  editableReport.setReporter(reporter);
  displayReport();
}
Program: 82097
Project: 82097
Buggy source:
private void requestReports(){
  if (requestFactory == null) {
    return;
  }
  lastReceiver=new Receiver<List<ReportRecord>>(){
    public void onSuccess(    List<ReportRecord> newValues,    Set<SyncResult> syncResults){
      int size=newValues.size();
      reportDataProvider.updateRowCount(size,true);
      reportDataProvider.updateRowData(0,newValues);
    }
  }
;
  requestFactory.reportRequest().findReportEntriesBySearch(employee.getId(),"String_Node_Str","String_Node_Str",ReportRecord.created.getName() + "String_Node_Str",0,25).forProperties(getReportColumns()).fire(lastReceiver);
}

Fixed version (ground truth):
private void requestReports(){
  if (requestFactory == null) {
    return;
  }
  lastReceiver=new Receiver<List<ReportRecord>>(){
    public void onSuccess(    List<ReportRecord> newValues,    Set<SyncResult> syncResults){
      int size=newValues.size();
      reportDataProvider.updateRowCount(size,true);
      reportDataProvider.updateRowData(0,newValues);
    }
  }
;
  requestFactory.reportRequest().findReportEntriesBySearch(employee.getId(),"String_Node_Str","String_Node_Str",ReportRecord.created.getName() + "String_Node_Str",0,25).with(getReportColumns()).fire(lastReceiver);
}
Program: 82098
Project: 82098
Buggy source:
private Collection<Property<?>> getReportColumns(){
  List<Property<?>> columns=new ArrayList<Property<?>>();
  columns.add(ReportRecord.created);
  columns.add(ReportRecord.purpose);
  return columns;
}

Fixed version (ground truth):
private String[] getReportColumns(){
  return new String[]{ReportRecord.created.getName(),ReportRecord.purpose.getName()};
}
Program: 82099
Project: 82099
Buggy source:
/** 
 * Create an instance with the given default value.
 * @param the value that will be returned by {@link #process} if{@link #setResult} is not called.
 */
public ExpensesEntityTypesProcessor(T defaultValue){
  this.defaultValue=defaultValue;
}

Fixed version (ground truth):
/** 
 * Create an instance with the given default value.
 * @param defaultValue the value that will be returned by {@link #process} if{@link #setResult} is not called.
 */
public ExpensesEntityTypesProcessor(T defaultValue){
  this.defaultValue=defaultValue;
}
Program: 82100
Project: 82100
Buggy source:
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  if (resolveChanges()) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  resolveChanges();
}
Program: 82101
Project: 82101
Buggy source:
private boolean resolveChanges(){
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    boolean defaultSelected=isDefaultSelected(object);
    Object key=getKey(object);
    Boolean previousException=exceptions.get(key);
    if (defaultSelected == selected) {
      if (previousException != null) {
        exceptions.remove(key);
        changed=true;
      }
    }
 else {
      if (previousException != Boolean.valueOf(selected)) {
        exceptions.put(key,selected);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  return changed;
}

Fixed version (ground truth):
private void resolveChanges(){
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    boolean defaultSelected=isDefaultSelected(object);
    Object key=getKey(object);
    Boolean previousException=exceptions.get(key);
    if (defaultSelected == selected) {
      if (previousException != null) {
        exceptions.remove(key);
        changed=true;
      }
    }
 else {
      if (previousException != Boolean.valueOf(selected)) {
        exceptions.put(key,selected);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 82102
Project: 82102
Buggy source:
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  if (resolveChanges()) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  resolveChanges();
}
Program: 82103
Project: 82103
Buggy source:
private boolean resolveChanges(){
  if (selectionChanges.isEmpty()) {
    return false;
  }
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    Object key=getKey(object);
    T oldValue=selectedSet.get(key);
    if (selected) {
      if (oldValue == null || !oldValue.equals(object)) {
        selectedSet.put(getKey(object),object);
        changed=true;
      }
    }
 else {
      if (oldValue != null) {
        selectedSet.remove(key);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  return changed;
}

Fixed version (ground truth):
private void resolveChanges(){
  if (selectionChanges.isEmpty()) {
    return;
  }
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    Object key=getKey(object);
    T oldValue=selectedSet.get(key);
    if (selected) {
      if (oldValue == null || !oldValue.equals(object)) {
        selectedSet.put(getKey(object),object);
        changed=true;
      }
    }
 else {
      if (oldValue != null) {
        selectedSet.remove(key);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 82104
Project: 82104
Buggy source:
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  if (resolveChanges()) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
@Override protected void fireSelectionChangeEvent(){
  if (isEventScheduled()) {
    setEventCancelled(true);
  }
  resolveChanges();
}
Program: 82105
Project: 82105
Buggy source:
private boolean resolveChanges(){
  if (newSelectedObject == null) {
    return false;
  }
  Object key=getKey(newSelectedObject);
  boolean sameKey=curKey == null ? key == null : curKey.equals(key);
  boolean changed=false;
  if (newSelected) {
    changed=!sameKey;
    curSelection=newSelectedObject;
    curKey=key;
  }
 else   if (sameKey) {
    changed=true;
    curSelection=null;
    curKey=null;
  }
  newSelectedObject=null;
  return changed;
}

Fixed version (ground truth):
private void resolveChanges(){
  if (newSelectedObject == null) {
    return;
  }
  Object key=getKey(newSelectedObject);
  boolean sameKey=curKey == null ? key == null : curKey.equals(key);
  boolean changed=false;
  if (newSelected) {
    changed=!sameKey;
    curSelection=newSelectedObject;
    curKey=key;
  }
 else   if (sameKey) {
    changed=true;
    curSelection=null;
    curKey=null;
  }
  newSelectedObject=null;
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 82106
Project: 82106
Buggy source:
public void setSelected(T object,boolean selected){
}

Fixed version (ground truth):
public void setSelected(T object,boolean selected){
  scheduleSelectionChangeEvent();
}
Program: 82108
Project: 82108
Buggy source:
public void computeTypeCastabilityMaps(){
  computeSourceType(program.getTypeJavaLangString());
  assert(castableTypeMaps.size() == 3);
  for (  JReferenceType type : program.getDeclaredTypes()) {
    if (type instanceof JClassType) {
      computeSourceType(type);
    }
  }
  for (  JArrayType type : program.getAllArrayTypes()) {
    computeSourceType(type);
  }
  program.initTypeInfo(castableTypeMaps);
  JClassType jsoType=program.getJavaScriptObject();
  if (jsoType != null) {
    queryIds.put(jsoType,-1);
  }
  program.recordQueryIds(queryIds);
}

Fixed version (ground truth):
public void computeTypeCastabilityMaps(){
  computeSourceType(program.getTypeJavaLangString());
  assert(castableTypeMaps.size() == 2);
  for (  JReferenceType type : program.getDeclaredTypes()) {
    if (type instanceof JClassType) {
      computeSourceType(type);
    }
  }
  for (  JArrayType type : program.getAllArrayTypes()) {
    computeSourceType(type);
  }
  program.initTypeInfo(castableTypeMaps);
  JClassType jsoType=program.getJavaScriptObject();
  if (jsoType != null) {
    queryIds.put(jsoType,-1);
  }
  program.recordQueryIds(queryIds);
}
Program: 82109
Project: 82109
Buggy source:
public Object encodePropertyValue(Object value){
  if (value == null) {
    return value;
  }
  Class<?> type=value.getClass();
  if (Boolean.class == type) {
    return value;
  }
  if (Date.class == type) {
    return String.valueOf(((Date)value).getTime());
  }
  if (Enum.class.isAssignableFrom(type)) {
    return Double.valueOf(((Enum<?>)value).ordinal());
  }
  if (BigDecimal.class == type || BigInteger.class == type || Long.class == type) {
    return String.valueOf(value);
  }
  if (Number.class.isAssignableFrom(type)) {
    return ((Number)value).doubleValue();
  }
  return String.valueOf(value);
}

Fixed version (ground truth):
public Object encodePropertyValue(Object value){
  if (value == null) {
    return value;
  }
  Class<?> type=value.getClass();
  if (Boolean.class == type) {
    return value;
  }
  if (Date.class.isAssignableFrom(type)) {
    return String.valueOf(((Date)value).getTime());
  }
  if (Enum.class.isAssignableFrom(type)) {
    return Double.valueOf(((Enum<?>)value).ordinal());
  }
  if (BigDecimal.class == type || BigInteger.class == type || Long.class == type) {
    return String.valueOf(value);
  }
  if (Number.class.isAssignableFrom(type)) {
    return ((Number)value).doubleValue();
  }
  return String.valueOf(value);
}
Program: 82110
Project: 82110
Buggy source:
/** 
 * Flush pending list changes to the displays. By default,
 */
private void flushNow(){
  if (flushPending) {
    flushCancelled=true;
  }
  int newSize=list.size();
  if (curSize != newSize) {
    curSize=newSize;
    updateRowCount(curSize,true);
  }
  if (modified) {
    updateRowData(minModified,list.subList(minModified,maxModified));
    modified=false;
  }
  minModified=Integer.MAX_VALUE;
  maxModified=Integer.MIN_VALUE;
}

Fixed version (ground truth):
/** 
 * Flush pending list changes to the displays. By default,
 */
private void flushNow(){
  if (flushPending) {
    flushCancelled=true;
  }
  if (listWrapper != this) {
    return;
  }
  int newSize=list.size();
  if (curSize != newSize) {
    curSize=newSize;
    updateRowCount(curSize,true);
  }
  if (modified) {
    updateRowData(minModified,list.subList(minModified,maxModified));
    modified=false;
  }
  minModified=Integer.MAX_VALUE;
  maxModified=Integer.MIN_VALUE;
}
Program: 82111
Project: 82111
Buggy source:
public void testSetList(){
  ListDataProvider<String> provider=createListDataProvider(10);
  MockHasData<String> display=new MockHasData<String>();
  display.setVisibleRange(0,15);
  provider.addDataDisplay(display);
  provider.flush();
  display.clearLastRowDataAndRange();
  assertEquals("String_Node_Str",provider.getList().get(0));
  List<String> replace=new ArrayList<String>();
  replace.add("String_Node_Str");
  provider.setList(replace);
  assertEquals("String_Node_Str",provider.getList().get(0));
  assertEquals(1,display.getRowCount());
  assertEquals(replace,display.getLastRowData());
  assertEquals(new Range(0,1),display.getLastRowDataRange());
}

Fixed version (ground truth):
public void testSetList(){
  ListDataProvider<String> provider=createListDataProvider(10);
  final MockHasData<String> display=new MockHasData<String>();
  display.setVisibleRange(0,15);
  provider.addDataDisplay(display);
  provider.flush();
  display.clearLastRowDataAndRange();
  List<String> oldList=provider.getList();
  assertEquals("String_Node_Str",oldList.get(0));
  List<String> replace=new ArrayList<String>();
  replace.add("String_Node_Str");
  provider.setList(replace);
  assertEquals("String_Node_Str",provider.getList().get(0));
  assertEquals(1,display.getRowCount());
  assertEquals(replace,display.getLastRowData());
  assertEquals(new Range(0,1),display.getLastRowDataRange());
  display.clearLastRowDataAndRange();
  oldList.set(0,"String_Node_Str");
  delayTestFinish(2000);
  Scheduler.get().scheduleDeferred(new ScheduledCommand(){
    public void execute(){
      assertNull(display.getLastRowData());
      finishTest();
    }
  }
);
}
Program: 82112
Project: 82112
Buggy source:
String toJson(){
  if (operations.size() > 1) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  return toJsonWithoutChecks();
}

Fixed version (ground truth):
String toJson(){
}
Program: 82114
Project: 82114
Buggy source:
public void testCreate(){
  Record created=requestFactory.create(SimpleFooRecord.class);
  assertNotNull(created.getId());
  assertNotNull(created.getVersion());
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  assertFalse(deltaValueStore.isChanged());
  deltaValueStore.set(SimpleFooRecord.userName,created,"String_Node_Str");
  assertTrue(deltaValueStore.isChanged());
  testAndGetChangeRecord(deltaValueStore.toJson(),WriteOperation.CREATE);
}

Fixed version (ground truth):
public void testCreate(){
  Record created=requestFactory.create(SimpleFooRecord.class);
  assertNotNull(created.getId());
  assertNotNull(created.getVersion());
  DeltaValueStoreJsonImpl deltaValueStore=new DeltaValueStoreJsonImpl(valueStore,requestFactory);
  String json=deltaValueStore.toJson();
  testAndGetChangeRecord(json,WriteOperation.CREATE);
}
Program: 82115
Project: 82115
Buggy source:
@Override public void gwtSetUp(){
  valueStore=new ValueStoreJsonImpl();
  requestFactory=new RequestFactoryJsonImpl(){
    public Record create(    Class token){
      return create(token,typeMap);
    }
    public RecordSchema getSchema(    String token){
      return typeMap.getType(token);
    }
    @Override public void init(    EventBus eventBus){
    }
    public LoggingRequest loggingRequest(){
      return null;
    }
    public Class<? extends Record> getClass(    String token){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public Record getProxy(    String token){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public String getToken(    Class<? extends Record> clazz){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
  jso=RecordJsoImpl.fromJson("String_Node_Str");
  jso.set(SimpleFooRecord.id,42L);
  jso.set(SimpleFooRecord.version,1);
  jso.set(SimpleFooRecord.userName,"String_Node_Str");
  jso.set(SimpleFooRecord.password,"String_Node_Str");
  jso.set(SimpleFooRecord.intId,4);
  jso.set(SimpleFooRecord.created,new Date());
  jso.setSchema(SimpleFooRecordImpl.SCHEMA);
  valueStore.setRecord(jso,requestFactory);
}

Fixed version (ground truth):
@Override public void gwtSetUp(){
  valueStore=new ValueStoreJsonImpl();
  requestFactory=new RequestFactoryJsonImpl(){
    public Record create(    Class token){
      return create(token,typeMap);
    }
    @Override public RecordSchema getSchema(    String token){
      return typeMap.getType(token);
    }
    @Override public void init(    EventBus eventBus){
    }
    public LoggingRequest loggingRequest(){
      return null;
    }
    public Class<? extends Record> getClass(    String token){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public Record getProxy(    String token){
      throw new UnsupportedOperationException("String_Node_Str");
    }
    public String getToken(    Class<? extends Record> clazz){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
  jso=RecordJsoImpl.fromJson("String_Node_Str");
  jso.set(SimpleFooRecord.id,42L);
  jso.set(SimpleFooRecord.version,1);
  jso.set(SimpleFooRecord.userName,"String_Node_Str");
  jso.set(SimpleFooRecord.password,"String_Node_Str");
  jso.set(SimpleFooRecord.intId,4);
  jso.set(SimpleFooRecord.created,new Date());
  jso.setSchema(SimpleFooRecordImpl.SCHEMA);
  valueStore.setRecord(jso,requestFactory);
}
Program: 82116
Project: 82116
Buggy source:
public RecordSchema getSchema(String token){
  return typeMap.getType(token);
}

Fixed version (ground truth):
@Override public RecordSchema getSchema(String token){
  return typeMap.getType(token);
}