nus-yam/ex-repair huggingface dataset:
Program: 39290
Project: 39290
Buggy source:
private Map<String,Class<?>> findExistingClasses(final InputStream stream) throws XMLStreamException {
  XMLStreamReader reader=XMLInputFactory.newInstance().createXMLStreamReader(stream);
  Map<String,Class<?>> existingClasses=new HashMap<String,Class<?>>();
  while (reader.hasNext() && reader.next() > 0) {
    if (isTagStarted(reader,TAG_MODEL)) {
      String pluginIdentifier=getPluginIdentifier(reader);
      String modelName=getStringAttribute(reader,"String_Node_Str");
      String className=ClassNameUtils.getFullyQualifiedClassName(pluginIdentifier,modelName);
      try {
        existingClasses.put(className,classLoader.loadClass(className));
        LOG.info("String_Node_Str" + className + "String_Node_Str");
      }
 catch (      ClassNotFoundException e) {
        LOG.info("String_Node_Str" + className + "String_Node_Str");
      }
      break;
    }
  }
  reader.close();
  return existingClasses;
}

Fixed version (ground truth):
private Map<String,Class<?>> findExistingClasses(final InputStream stream) throws XMLStreamException {
  XMLStreamReader reader=XMLInputFactory.newInstance().createXMLStreamReader(stream);
  Map<String,Class<?>> existingClasses=new HashMap<String,Class<?>>();
  while (reader.hasNext() && reader.next() > 0) {
    if (isTagStarted(reader,TAG_MODEL)) {
      String pluginIdentifier=getPluginIdentifier(reader);
      String modelName=getStringAttribute(reader,NAME);
      String className=ClassNameUtils.getFullyQualifiedClassName(pluginIdentifier,modelName);
      try {
        existingClasses.put(className,classLoader.loadClass(className));
        LOG.info("String_Node_Str" + className + "String_Node_Str");
      }
 catch (      ClassNotFoundException e) {
        LOG.info("String_Node_Str" + className + "String_Node_Str");
      }
      break;
    }
  }
  reader.close();
  return existingClasses;
}
Program: 39291
Project: 39291
Buggy source:
private void buildToString(final CtClass ctClass,final List<String> fields) throws ModelXmlCompilingException {
  try {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str" + ctClass.getName() + "String_Node_Str");
    boolean first=true;
    for (    String field : fields) {
      if (first) {
        first=false;
      }
 else {
        sb.append("String_Node_Str");
      }
      sb.append("String_Node_Str" + field + "String_Node_Str"+ StringUtils.capitalize(field)+ "String_Node_Str");
    }
    sb.append("String_Node_Str");
    ctClass.addMethod(CtNewMethod.make("String_Node_Str" + sb.toString() + "String_Node_Str",ctClass));
  }
 catch (  CannotCompileException e) {
    throw new ModelXmlCompilingException("String_Node_Str" + ctClass.getName(),e);
  }
}

Fixed version (ground truth):
private void buildToString(final CtClass ctClass,final List<String> fields) throws ModelXmlCompilingException {
  try {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str" + ctClass.getName() + "String_Node_Str");
    boolean first=true;
    for (    String field : fields) {
      if (first) {
        first=false;
      }
 else {
        sb.append("String_Node_Str");
      }
      sb.append("String_Node_Str" + field + "String_Node_Str"+ StringUtils.capitalize(field)+ "String_Node_Str");
    }
    sb.append("String_Node_Str");
    ctClass.addMethod(CtNewMethod.make("String_Node_Str" + sb.toString() + "String_Node_Str",ctClass));
  }
 catch (  CannotCompileException e) {
    throw new ModelXmlCompilingException(FAILED_TO_COMPILE_CLASS + ctClass.getName(),e);
  }
}
Program: 39294
Project: 39294
Buggy source:
@Override @Transactional @Monitorable public void delete(final InternalDataDefinition dataDefinition,final Long... entityIds){
  checkNotNull(dataDefinition,DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isDeletable(),"String_Node_Str");
  checkState(dataDefinition.isEnabled(),DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkState(entityIds.length > 0,"String_Node_Str");
  for (  Long entityId : entityIds) {
    deleteEntity(dataDefinition,entityId);
  }
}

Fixed version (ground truth):
@Override @Transactional @Monitorable public void delete(final InternalDataDefinition dataDefinition,final Long... entityIds){
  checkNotNull(dataDefinition,L_DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isDeletable(),"String_Node_Str");
  checkState(dataDefinition.isEnabled(),L_DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkState(entityIds.length > 0,"String_Node_Str");
  for (  Long entityId : entityIds) {
    deleteEntity(dataDefinition,entityId);
  }
}
Program: 39295
Project: 39295
Buggy source:
@Override @Transactional(readOnly=true) @Monitorable public Entity get(final InternalDataDefinition dataDefinition,final Long entityId){
  checkNotNull(dataDefinition,DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isEnabled(),DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkNotNull(entityId,"String_Node_Str");
  Object databaseEntity=getDatabaseEntity(dataDefinition,entityId);
  if (databaseEntity == null) {
    LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
    return null;
  }
  Entity entity=entityService.convertToGenericEntity(dataDefinition,databaseEntity);
  LOG.info(entity + "String_Node_Str");
  return entity;
}

Fixed version (ground truth):
@Override @Transactional(readOnly=true) @Monitorable public Entity get(final InternalDataDefinition dataDefinition,final Long entityId){
  checkNotNull(dataDefinition,L_DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isEnabled(),L_DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkNotNull(entityId,"String_Node_Str");
  Object databaseEntity=getDatabaseEntity(dataDefinition,entityId);
  if (databaseEntity == null) {
    LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
    return null;
  }
  Entity entity=entityService.convertToGenericEntity(dataDefinition,databaseEntity);
  LOG.info(entity + "String_Node_Str");
  return entity;
}
Program: 39296
Project: 39296
Buggy source:
@Override @Transactional @Monitorable public void move(final InternalDataDefinition dataDefinition,final Long entityId,final int offset){
  checkNotNull(dataDefinition,DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isPrioritizable(),"String_Node_Str");
  checkState(dataDefinition.isEnabled(),DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkNotNull(entityId,"String_Node_Str");
  checkState(offset != 0,"String_Node_Str");
  Object databaseEntity=getDatabaseEntity(dataDefinition,entityId);
  if (databaseEntity == null) {
    LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
    return;
  }
  priorityService.move(dataDefinition,databaseEntity,0,offset);
  LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
}

Fixed version (ground truth):
@Override @Transactional @Monitorable public void move(final InternalDataDefinition dataDefinition,final Long entityId,final int offset){
  checkNotNull(dataDefinition,L_DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isPrioritizable(),"String_Node_Str");
  checkState(dataDefinition.isEnabled(),L_DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkNotNull(entityId,"String_Node_Str");
  checkState(offset != 0,"String_Node_Str");
  Object databaseEntity=getDatabaseEntity(dataDefinition,entityId);
  if (databaseEntity == null) {
    LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
    return;
  }
  priorityService.move(dataDefinition,databaseEntity,0,offset);
  LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
}
Program: 39297
Project: 39297
Buggy source:
@Override @Transactional @Monitorable public void moveTo(final InternalDataDefinition dataDefinition,final Long entityId,final int position){
  checkNotNull(dataDefinition,DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isPrioritizable(),"String_Node_Str");
  checkState(dataDefinition.isEnabled(),DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkNotNull(entityId,"String_Node_Str");
  checkState(position > 0,"String_Node_Str");
  Object databaseEntity=getDatabaseEntity(dataDefinition,entityId);
  if (databaseEntity == null) {
    LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
    return;
  }
  priorityService.move(dataDefinition,databaseEntity,position,0);
  LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
}

Fixed version (ground truth):
@Override @Transactional @Monitorable public void moveTo(final InternalDataDefinition dataDefinition,final Long entityId,final int position){
  checkNotNull(dataDefinition,L_DATA_DEFINITION_MUST_BE_GIVEN);
  checkState(dataDefinition.isPrioritizable(),"String_Node_Str");
  checkState(dataDefinition.isEnabled(),L_DATA_DEFINITION_BELONGS_TO_DISABLED_PLUGIN);
  checkNotNull(entityId,"String_Node_Str");
  checkState(position > 0,"String_Node_Str");
  Object databaseEntity=getDatabaseEntity(dataDefinition,entityId);
  if (databaseEntity == null) {
    LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
    return;
  }
  priorityService.move(dataDefinition,databaseEntity,position,0);
  LOG.info("String_Node_Str" + dataDefinition.getPluginIdentifier() + "String_Node_Str"+ dataDefinition.getName()+ "String_Node_Str"+ entityId+ "String_Node_Str");
}
Program: 39298
Project: 39298
Buggy source:
@Override public SearchCriteriaBuilder findWithAlias(final String alias){
  throw new UnsupportedOperationException(CANNOT_FIND_ENTITY_FOR_DYNAMIC_DATA_DEFINITION);
}

Fixed version (ground truth):
@Override public SearchCriteriaBuilder findWithAlias(final String alias){
  throw new UnsupportedOperationException(L_CANNOT_FIND_ENTITY_FOR_DYNAMIC_DATA_DEFINITION);
}
Program: 39299
Project: 39299
Buggy source:
@Override public SearchResult find(final SearchCriteria searchCriteria){
  throw new UnsupportedOperationException(CANNOT_FIND_ENTITY_FOR_DYNAMIC_DATA_DEFINITION);
}

Fixed version (ground truth):
@Override public SearchResult find(final SearchCriteria searchCriteria){
  throw new UnsupportedOperationException(L_CANNOT_FIND_ENTITY_FOR_DYNAMIC_DATA_DEFINITION);
}
Program: 39301
Project: 39301
Buggy source:
private JSONArray getColumnsForJsOptions(final Locale locale) throws JSONException {
  JSONArray jsonColumns=new JSONArray();
  String nameTranslation=null;
  for (  GridComponentColumn column : columns.values()) {
    if (column.getFields().size() == 1) {
      String fieldCode=getDataDefinition().getPluginIdentifier() + "String_Node_Str" + getDataDefinition().getName()+ "String_Node_Str"+ column.getFields().get(0).getName();
      nameTranslation=getTranslationService().translate(getTranslationPath() + "String_Node_Str" + column.getName(),fieldCode + "String_Node_Str",locale);
    }
 else {
      nameTranslation=getTranslationService().translate(getTranslationPath() + "String_Node_Str" + column.getName(),locale);
    }
    JSONObject jsonColumn=new JSONObject();
    jsonColumn.put("String_Node_Str",column.getName());
    jsonColumn.put("String_Node_Str",nameTranslation);
    jsonColumn.put("String_Node_Str",column.isLink());
    jsonColumn.put("String_Node_Str",column.isHidden());
    jsonColumn.put(WIDTH2,column.getWidth());
    jsonColumn.put("String_Node_Str",column.getAlign());
    jsonColumn.put("String_Node_Str",getFilterValuesForColumn(column,locale));
    jsonColumns.put(jsonColumn);
  }
  return jsonColumns;
}

Fixed version (ground truth):
private JSONArray getColumnsForJsOptions(final Locale locale) throws JSONException {
  JSONArray jsonColumns=new JSONArray();
  String nameTranslation=null;
  for (  GridComponentColumn column : columns.values()) {
    if (column.getFields().size() == 1) {
      String fieldCode=getDataDefinition().getPluginIdentifier() + "String_Node_Str" + getDataDefinition().getName()+ "String_Node_Str"+ column.getFields().get(0).getName();
      nameTranslation=getTranslationService().translate(getTranslationPath() + "String_Node_Str" + column.getName(),fieldCode + "String_Node_Str",locale);
    }
 else {
      nameTranslation=getTranslationService().translate(getTranslationPath() + "String_Node_Str" + column.getName(),locale);
    }
    JSONObject jsonColumn=new JSONObject();
    jsonColumn.put("String_Node_Str",column.getName());
    jsonColumn.put("String_Node_Str",nameTranslation);
    jsonColumn.put("String_Node_Str",column.isLink());
    jsonColumn.put("String_Node_Str",column.isHidden());
    jsonColumn.put(WIDTH,column.getWidth());
    jsonColumn.put("String_Node_Str",column.getAlign());
    jsonColumn.put("String_Node_Str",getFilterValuesForColumn(column,locale));
    jsonColumns.put(jsonColumn);
  }
  return jsonColumns;
}
Program: 39304
Project: 39304
Buggy source:
private void parseColumnOption(final ComponentOption option){
  GridComponentColumn column=new GridComponentColumn(option.getAtrributeValue("String_Node_Str"));
  String fields=option.getAtrributeValue("String_Node_Str");
  if (fields != null) {
    for (    FieldDefinition field : parseFields(fields,column)) {
      column.addField(field);
    }
  }
  column.setExpression(option.getAtrributeValue("String_Node_Str"));
  String columnWidth=option.getAtrributeValue(WIDTH2);
  if (columnWidth != null) {
    column.setWidth(Integer.valueOf(columnWidth));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setLink(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setHidden(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  columns.put(column.getName(),column);
}

Fixed version (ground truth):
private void parseColumnOption(final ComponentOption option){
  GridComponentColumn column=new GridComponentColumn(option.getAtrributeValue("String_Node_Str"));
  String fields=option.getAtrributeValue("String_Node_Str");
  if (fields != null) {
    for (    FieldDefinition field : parseFields(fields,column)) {
      column.addField(field);
    }
  }
  column.setExpression(option.getAtrributeValue("String_Node_Str"));
  String columnWidth=option.getAtrributeValue(WIDTH);
  if (columnWidth != null) {
    column.setWidth(Integer.valueOf(columnWidth));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setLink(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setHidden(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  columns.put(column.getName(),column);
}
Program: 39305
Project: 39305
Buggy source:
private String getCopyValueOfUniqueField(final DataDefinition dataDefinition,final FieldDefinition fieldDefinition,final String value){
  Matcher matcher=Pattern.compile("String_Node_Str").matcher(value);
  String oldValue=value;
  int index=1;
  if (matcher.matches()) {
    oldValue=matcher.group(1);
    index=Integer.valueOf(matcher.group(2)) + 1;
  }
  while (true) {
    String newValue=oldValue + "String_Node_Str" + (index++)+ "String_Node_Str";
    int matches=dataDefinition.find().setMaxResults(1).add(SearchRestrictions.eq(fieldDefinition.getName(),newValue)).list().getTotalNumberOfEntities();
    if (matches == 0) {
      return newValue;
    }
  }
}

Fixed version (ground truth):
private String getCopyValueOfUniqueField(final DataDefinition dataDefinition,final FieldDefinition fieldDefinition,final String value){
  if (value == null) {
    return value;
  }
 else {
    Matcher matcher=Pattern.compile("String_Node_Str").matcher(value);
    String oldValue=value;
    int index=1;
    if (matcher.matches()) {
      oldValue=matcher.group(1);
      index=Integer.valueOf(matcher.group(2)) + 1;
    }
    while (true) {
      String newValue=oldValue + "String_Node_Str" + (index++)+ "String_Node_Str";
      int matches=dataDefinition.find().setMaxResults(1).add(SearchRestrictions.eq(fieldDefinition.getName(),newValue)).list().getTotalNumberOfEntities();
      if (matches == 0) {
        return newValue;
      }
    }
  }
}
Program: 39306
Project: 39306
Buggy source:
@Override protected JSONObject renderContent() throws JSONException {
  JSONObject json=new JSONObject();
  json.put("String_Node_Str",scale.getZoomLevel().toString());
  json.put("String_Node_Str",dateFromErrorMessage);
  json.put("String_Node_Str",dateToErrorMessage);
  if (dateFromErrorMessage == null) {
    json.put("String_Node_Str",dateType.toString(scale.getDateFrom(),getLocale()));
  }
  if (dateToErrorMessage == null) {
    json.put("String_Node_Str",dateType.toString(scale.getDateTo(),getLocale()));
  }
  json.put("String_Node_Str",globalErrorMessage);
  if (globalErrorMessage == null) {
    json.put("String_Node_Str",scale.getAsJson());
    JSONArray rowsArray=new JSONArray();
    JSONArray itemsArray=new JSONArray();
    for (    Map.Entry<String,List<GanttChartItem>> entry : items.entrySet()) {
      rowsArray.put(entry.getKey());
      for (      GanttChartItem item : entry.getValue()) {
        if (item != null) {
          itemsArray.put(item.getAsJson());
        }
      }
    }
    json.put("String_Node_Str",rowsArray);
    json.put("String_Node_Str",itemsArray);
    JSONArray collisionItemsArray=new JSONArray();
    for (    Map.Entry<String,List<GanttChartItem>> entry : collisionItems.entrySet()) {
      for (      GanttChartItem item : entry.getValue()) {
        if (item != null) {
          collisionItemsArray.put(item.getAsJson());
        }
      }
    }
    json.put("String_Node_Str",collisionItemsArray);
    json.put("String_Node_Str",selectedEntityId);
  }
  return json;
}

Fixed version (ground truth):
@Override protected JSONObject renderContent() throws JSONException {
  JSONObject json=new JSONObject();
  json.put("String_Node_Str",scale.getZoomLevel().toString());
  json.put("String_Node_Str",dateFromErrorMessage);
  json.put("String_Node_Str",dateToErrorMessage);
  if (dateFromErrorMessage == null) {
    json.put("String_Node_Str",DATETYPE.toString(scale.getDateFrom(),getLocale()));
  }
  if (dateToErrorMessage == null) {
    json.put("String_Node_Str",DATETYPE.toString(scale.getDateTo(),getLocale()));
  }
  json.put("String_Node_Str",globalErrorMessage);
  if (globalErrorMessage == null) {
    json.put("String_Node_Str",scale.getAsJson());
    JSONArray rowsArray=new JSONArray();
    JSONArray itemsArray=new JSONArray();
    for (    Map.Entry<String,List<GanttChartItem>> entry : items.entrySet()) {
      rowsArray.put(entry.getKey());
      for (      GanttChartItem item : entry.getValue()) {
        if (item != null) {
          itemsArray.put(item.getAsJson());
        }
      }
    }
    json.put("String_Node_Str",rowsArray);
    json.put("String_Node_Str",itemsArray);
    JSONArray collisionItemsArray=new JSONArray();
    for (    Map.Entry<String,List<GanttChartItem>> entry : collisionItems.entrySet()) {
      for (      GanttChartItem item : entry.getValue()) {
        if (item != null) {
          collisionItemsArray.put(item.getAsJson());
        }
      }
    }
    json.put("String_Node_Str",collisionItemsArray);
    json.put("String_Node_Str",selectedEntityId);
  }
  return json;
}
Program: 39308
Project: 39308
Buggy source:
private JSONArray getDaysArray(){
  JSONArray daysArray=new JSONArray();
  DateTime dateTimeFrom=new DateTime(dateFrom);
  DateTime dateTimeTo=new DateTime(dateTo);
  while (dateTimeFrom.compareTo(dateTimeTo) <= 0) {
    daysArray.put(dateType.toString(dateTimeFrom.toDate(),ganttChartComponentState.getLocale()));
    dateTimeFrom=dateTimeFrom.plusDays(1);
  }
  return daysArray;
}

Fixed version (ground truth):
private JSONArray getDaysArray(){
  JSONArray daysArray=new JSONArray();
  DateTime dateTimeFrom=new DateTime(dateFrom);
  DateTime dateTimeTo=new DateTime(dateTo);
  while (dateTimeFrom.compareTo(dateTimeTo) <= 0) {
    daysArray.put(DATETYPE.toString(dateTimeFrom.toDate(),ganttChartComponentState.getLocale()));
    dateTimeFrom=dateTimeFrom.plusDays(1);
  }
  return daysArray;
}
Program: 39309
Project: 39309
Buggy source:
@Test public void shouldHaveListenersInOptions() throws Exception {
  InternalViewDefinition viewDefinition=mock(InternalViewDefinition.class);
  AbstractContainerPattern parent=new WindowComponentPattern(getComponentDefinition("String_Node_Str",viewDefinition));
  ComponentPatternMock child1=new ComponentPatternMock(getComponentDefinition("String_Node_Str","String_Node_Str",null,parent,viewDefinition));
  ComponentPatternMock child2=new ComponentPatternMock(getComponentDefinition("String_Node_Str","String_Node_Str",null,parent,viewDefinition));
  ComponentPatternMock child3=new ComponentPatternMock(getComponentDefinition("String_Node_Str",null,"String_Node_Str",parent,viewDefinition));
  parent.addChild(child1);
  parent.addChild(child2);
  parent.addChild(child3);
  parent.initialize();
  child1.initialize();
  child2.initialize();
  child3.initialize();
  Map<String,Object> model=parent.prepareView(Locale.ENGLISH);
  JSONObject options=(JSONObject)model.get("String_Node_Str");
  JSONArray listenersArray=options.getJSONArray("String_Node_Str");
  assertEquals(3,listenersArray.length());
  assertTrue(JsonArrayContain(listenersArray,"String_Node_Str"));
  assertTrue(JsonArrayContain(listenersArray,"String_Node_Str"));
  assertTrue(JsonArrayContain(listenersArray,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldHaveListenersInOptions() throws Exception {
  InternalViewDefinition viewDefinition=mock(InternalViewDefinition.class);
  AbstractContainerPattern parent=new WindowComponentPattern(getComponentDefinition("String_Node_Str",viewDefinition));
  ComponentPatternMock child1=new ComponentPatternMock(getComponentDefinition("String_Node_Str","String_Node_Str",null,parent,viewDefinition));
  ComponentPatternMock child2=new ComponentPatternMock(getComponentDefinition("String_Node_Str","String_Node_Str",null,parent,viewDefinition));
  ComponentPatternMock child3=new ComponentPatternMock(getComponentDefinition("String_Node_Str",null,"String_Node_Str",parent,viewDefinition));
  parent.addChild(child1);
  parent.addChild(child2);
  parent.addChild(child3);
  parent.initialize();
  child1.initialize();
  child2.initialize();
  child3.initialize();
  Map<String,Object> model=parent.prepareView(Locale.ENGLISH);
  JSONObject options=(JSONObject)model.get("String_Node_Str");
  JSONArray listenersArray=options.getJSONArray("String_Node_Str");
  assertEquals(3,listenersArray.length());
  assertTrue(jsonArrayContain(listenersArray,"String_Node_Str"));
  assertTrue(jsonArrayContain(listenersArray,"String_Node_Str"));
  assertTrue(jsonArrayContain(listenersArray,"String_Node_Str"));
}
Program: 39310
Project: 39310
Buggy source:
public void addRestrictionToCategoriesGrid(final ViewDefinitionState viewDefinitionState){
  GridComponent categoriesGrid=(GridComponent)viewDefinitionState.getComponentByReference("String_Node_Str");
  categoriesGrid.setCustomRestriction(new CustomRestriction(){
    @Override public void addRestriction(    final SearchCriteriaBuilder searchCriteriaBuilder){
      SearchDisjunction disjunction=SearchRestrictions.disjunction();
      for (      String[] category : hiddenCategories) {
        disjunction.add(SearchRestrictions.and(SearchRestrictions.eq("String_Node_Str",category[0]),SearchRestrictions.eq("String_Node_Str",category[1])));
      }
      searchCriteriaBuilder.add(SearchRestrictions.not(disjunction));
    }
  }
);
}

Fixed version (ground truth):
public void addRestrictionToCategoriesGrid(final ViewDefinitionState viewDefinitionState){
  GridComponent categoriesGrid=(GridComponent)viewDefinitionState.getComponentByReference("String_Node_Str");
  categoriesGrid.setCustomRestriction(new CustomRestriction(){
    @Override public void addRestriction(    final SearchCriteriaBuilder searchCriteriaBuilder){
      SearchDisjunction disjunction=SearchRestrictions.disjunction();
      for (      String[] category : HIDDEN_CATEGORIES) {
        disjunction.add(SearchRestrictions.and(SearchRestrictions.eq("String_Node_Str",category[0]),SearchRestrictions.eq("String_Node_Str",category[1])));
      }
      searchCriteriaBuilder.add(SearchRestrictions.not(disjunction));
    }
  }
);
}
Program: 39311
Project: 39311
Buggy source:
@Override public void addRestriction(final SearchCriteriaBuilder searchCriteriaBuilder){
  SearchDisjunction disjunction=SearchRestrictions.disjunction();
  for (  String[] category : hiddenCategories) {
    disjunction.add(SearchRestrictions.and(SearchRestrictions.eq("String_Node_Str",category[0]),SearchRestrictions.eq("String_Node_Str",category[1])));
  }
  searchCriteriaBuilder.add(SearchRestrictions.not(disjunction));
}

Fixed version (ground truth):
@Override public void addRestriction(final SearchCriteriaBuilder searchCriteriaBuilder){
  SearchDisjunction disjunction=SearchRestrictions.disjunction();
  for (  String[] category : HIDDEN_CATEGORIES) {
    disjunction.add(SearchRestrictions.and(SearchRestrictions.eq("String_Node_Str",category[0]),SearchRestrictions.eq("String_Node_Str",category[1])));
  }
  searchCriteriaBuilder.add(SearchRestrictions.not(disjunction));
}
Program: 39312
Project: 39312
Buggy source:
public static ReportNumberFormat getInstance(final Locale locale){
  ReportNumberFormat format=formatters.get(locale);
  if (format == null) {
synchronized (formatters) {
      format=formatters.get(locale);
      if (format == null) {
        format=new ReportNumberFormat(locale);
        formatters.put(locale,format);
      }
    }
  }
  return format;
}

Fixed version (ground truth):
public static ReportNumberFormat getInstance(final Locale locale){
  ReportNumberFormat format=FORMATTERS.get(locale);
  if (format == null) {
synchronized (FORMATTERS) {
      format=FORMATTERS.get(locale);
      if (format == null) {
        format=new ReportNumberFormat(locale);
        FORMATTERS.put(locale,format);
      }
    }
  }
  return format;
}
Program: 39313
Project: 39313
Buggy source:
@Override public boolean isPasswordValid(final String encPass,final String rawPass,final Object salt) throws DataAccessException {
  return true;
}

Fixed version (ground truth):
@Override public boolean isPasswordValid(final String encPass,final String rawPass,final Object salt){
  return true;
}
Program: 39314
Project: 39314
Buggy source:
@Override public String encodePassword(final String rawPass,final Object salt) throws DataAccessException {
  return rawPass;
}

Fixed version (ground truth):
@Override public String encodePassword(final String rawPass,final Object salt){
  return rawPass;
}
Program: 39315
Project: 39315
Buggy source:
private static final String createMessage(final String pluginIdentifier,final String moduleType,final Element element,final Throwable cause,final String message){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append(pluginIdentifier);
  builder.append("String_Node_Str");
  if (element == null) {
    builder.append("String_Node_Str");
    builder.append(moduleType);
  }
 else {
    builder.append("String_Node_Str");
    XMLOutputter outputter=new XMLOutputter();
    builder.append(outputter.outputString(element));
  }
  builder.append("String_Node_Str");
  if (cause != null) {
    builder.append(cause.getMessage());
  }
 else {
    builder.append(message);
  }
  return builder.toString();
}

Fixed version (ground truth):
private static String createMessage(final String pluginIdentifier,final String moduleType,final Element element,final Throwable cause,final String message){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append(pluginIdentifier);
  builder.append("String_Node_Str");
  if (element == null) {
    builder.append("String_Node_Str");
    builder.append(moduleType);
  }
 else {
    builder.append("String_Node_Str");
    XMLOutputter outputter=new XMLOutputter();
    builder.append(outputter.outputString(element));
  }
  builder.append("String_Node_Str");
  if (cause != null) {
    builder.append(cause.getMessage());
  }
 else {
    builder.append(message);
  }
  return builder.toString();
}
Program: 39316
Project: 39316
Buggy source:
abstract void addComponentPattern(final ComponentPattern componentPattern);

Fixed version (ground truth):
void addComponentPattern(final ComponentPattern componentPattern);
Program: 39317
Project: 39317
Buggy source:
abstract void initialize();

Fixed version (ground truth):
void initialize();
Program: 39318
Project: 39318
Buggy source:
public JSONObject getAsJson() throws JSONException {
  JSONObject scaleObject=new JSONObject();
  JSONArray categoriesArray=null;
switch (zoomLevel) {
case H1:
    categoriesArray=getDaysArray();
  scaleObject.put("String_Node_Str",24);
scaleObject.put("String_Node_Str",1);
scaleObject.put("String_Node_Str",0);
break;
case H3:
categoriesArray=getDaysArray();
scaleObject.put("String_Node_Str",8);
scaleObject.put("String_Node_Str",3);
scaleObject.put("String_Node_Str",0);
break;
case H6:
categoriesArray=getDaysArray();
scaleObject.put("String_Node_Str",4);
scaleObject.put("String_Node_Str",6);
scaleObject.put("String_Node_Str",0);
break;
case D1:
return getWeeksScale();
}
scaleObject.put("String_Node_Str",categoriesArray);
return scaleObject;
}

Fixed version (ground truth):
public JSONObject getAsJson() throws JSONException {
  JSONObject scaleObject=new JSONObject();
  JSONArray categoriesArray=null;
switch (zoomLevel) {
case H1:
    categoriesArray=getDaysArray();
  scaleObject.put("String_Node_Str",24);
scaleObject.put("String_Node_Str",1);
scaleObject.put("String_Node_Str",0);
break;
case H3:
categoriesArray=getDaysArray();
scaleObject.put("String_Node_Str",8);
scaleObject.put("String_Node_Str",3);
scaleObject.put("String_Node_Str",0);
break;
case H6:
categoriesArray=getDaysArray();
scaleObject.put("String_Node_Str",4);
scaleObject.put("String_Node_Str",6);
scaleObject.put("String_Node_Str",0);
break;
case D1:
return getWeeksScale();
default :
break;
}
scaleObject.put("String_Node_Str",categoriesArray);
return scaleObject;
}
Program: 39319
Project: 39319
Buggy source:
public void removeSelectedEntity(final String[] args){
  if (weakRelation) {
    Entity entity=null;
    for (    Long selectedId : selectedEntities.toArray(new Long[selectedEntities.size()])) {
      entity=getDataDefinition().get(selectedId);
      entity.setField(belongsToFieldDefinition.getName(),null);
      getDataDefinition().save(entity);
    }
  }
 else {
    getDataDefinition().delete(selectedEntities.toArray(new Long[selectedEntities.size()]));
  }
  if (selectedEntities.size() == 1) {
    addMessage(translateMessage("String_Node_Str"),MessageType.SUCCESS);
  }
 else {
    addMessage(selectedEntities.size() + "String_Node_Str" + translateMessage("String_Node_Str"),MessageType.SUCCESS);
  }
  setSelectedEntityId(null);
  multiselectMode=false;
  selectedEntities=new HashSet<Long>();
}

Fixed version (ground truth):
public void removeSelectedEntity(final String[] args){
  if (weakRelation) {
    Entity entity=null;
    boolean isManyToManyRelationType=belongsToFieldDefinition.getType() instanceof JoinFieldHolder;
    Long[] selectedEntitiesIds=selectedEntities.toArray(new Long[selectedEntities.size()]);
    if (isManyToManyRelationType) {
      String gridFieldName=((JoinFieldHolder)belongsToFieldDefinition.getType()).getJoinFieldName();
      Entity gridOwnerEntity=scopeFieldDataDefinition.get(belongsToEntityId);
      List<Entity> relatedEntities=gridOwnerEntity.getManyToManyField(gridFieldName);
      for (      Long selectedId : selectedEntitiesIds) {
        relatedEntities.remove(new ProxyEntity(getDataDefinition(),selectedId));
      }
      gridOwnerEntity.setField(gridFieldName,relatedEntities);
      scopeFieldDataDefinition.save(gridOwnerEntity);
    }
 else {
      for (      Long selectedId : selectedEntitiesIds) {
        entity=getDataDefinition().get(selectedId);
        entity.setField(belongsToFieldDefinition.getName(),null);
        getDataDefinition().save(entity);
      }
    }
  }
 else {
    getDataDefinition().delete(selectedEntities.toArray(new Long[selectedEntities.size()]));
  }
  if (selectedEntities.size() == 1) {
    addMessage(translateMessage("String_Node_Str"),MessageType.SUCCESS);
  }
 else {
    addMessage(selectedEntities.size() + "String_Node_Str" + translateMessage("String_Node_Str"),MessageType.SUCCESS);
  }
  setSelectedEntityId(null);
  multiselectMode=false;
  selectedEntities=new HashSet<Long>();
}
Program: 39320
Project: 39320
Buggy source:
public void addExistingEntity(final String[] selectedEntities) throws JSONException {
  if (!weakRelation || selectedEntities.length == 0) {
    return;
  }
  JSONArray selectedEntitiesArray=null;
  if (selectedEntities[0].contains("String_Node_Str")) {
    selectedEntitiesArray=new JSONArray(selectedEntities[0]);
  }
 else {
    selectedEntitiesArray=new JSONArray(selectedEntities);
  }
  List<Long> selectedEntitiesId=Lists.newArrayList();
  for (int i=0; i < selectedEntitiesArray.length(); i++) {
    selectedEntitiesId.add(Long.parseLong(selectedEntitiesArray.getString(i)));
  }
  List<Entity> existingEntities=getEntities();
  List<Entity> newlyAddedEntities=getDataDefinition().find().add(SearchRestrictions.in("String_Node_Str",selectedEntitiesId)).list().getEntities();
  entitiesToMarkAsNew=Sets.newHashSet(selectedEntitiesId);
  for (  Entity existingEntity : existingEntities) {
    entitiesToMarkAsNew.remove(existingEntity.getId());
  }
  existingEntities.addAll(newlyAddedEntities);
  Entity gridOwnerEntity=scopeFieldDataDefinition.get(belongsToEntityId);
  String ownerSideJoinFieldName=((JoinFieldHolder)belongsToFieldDefinition.getType()).getJoinFieldName();
  gridOwnerEntity.setField(ownerSideJoinFieldName,existingEntities);
  gridOwnerEntity.getDataDefinition().save(gridOwnerEntity);
  reload();
}

Fixed version (ground truth):
public void addExistingEntity(final String[] selectedEntities) throws JSONException {
  if (!weakRelation || selectedEntities.length == 0) {
    return;
  }
  JSONArray selectedEntitiesArray=null;
  if (selectedEntities[0].contains("String_Node_Str")) {
    selectedEntitiesArray=new JSONArray(selectedEntities[0]);
  }
 else {
    selectedEntitiesArray=new JSONArray(selectedEntities);
  }
  List<Long> selectedEntitiesId=Lists.newArrayList();
  for (int i=0; i < selectedEntitiesArray.length(); i++) {
    selectedEntitiesId.add(Long.parseLong(selectedEntitiesArray.getString(i)));
  }
  List<Entity> existingEntities=getEntities();
  List<Entity> newlyAddedEntities=getDataDefinition().find().add(SearchRestrictions.in("String_Node_Str",selectedEntitiesId)).list().getEntities();
  entitiesToMarkAsNew=Sets.newHashSet(selectedEntitiesId);
  for (  Entity existingEntity : existingEntities) {
    entitiesToMarkAsNew.remove(existingEntity.getId());
  }
  existingEntities.addAll(newlyAddedEntities);
  FieldType belongsToFieldType=belongsToFieldDefinition.getType();
  if (belongsToFieldType instanceof JoinFieldHolder) {
    Entity gridOwnerEntity=scopeFieldDataDefinition.get(belongsToEntityId);
    gridOwnerEntity.setField(((JoinFieldHolder)belongsToFieldType).getJoinFieldName(),existingEntities);
    gridOwnerEntity.getDataDefinition().save(gridOwnerEntity);
  }
 else   if (belongsToFieldType instanceof BelongsToType) {
    for (    Entity entity : newlyAddedEntities) {
      entity.setField(belongsToFieldDefinition.getName(),belongsToEntityId);
      entity.getDataDefinition().save(entity);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + belongsToFieldDefinition.getType().toString());
  }
  reload();
}
Program: 39321
Project: 39321
Buggy source:
@Override @SuppressWarnings("String_Node_Str") protected void initializeContext(final JSONObject json) throws JSONException {
  Iterator<String> iterator=json.keys();
  while (iterator.hasNext()) {
    String field=iterator.next();
    if (JSON_BELONGS_TO_ENTITY_ID.equals(field)) {
      onScopeEntityIdChange(json.getLong(field));
    }
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected void initializeContext(final JSONObject json) throws JSONException {
  Iterator<String> iterator=json.keys();
  while (iterator.hasNext()) {
    String field=iterator.next();
    if (JSON_BELONGS_TO_ENTITY_ID.equals(field)) {
      onScopeEntityIdChange(json.getLong(field));
    }
  }
  passFiltersFromJson(json);
}
Program: 39323
Project: 39323
Buggy source:
@Override public void onScopeEntityIdChange(final Long scopeEntityId){
  if (belongsToFieldDefinition != null) {
    if (belongsToEntityId != null && !belongsToEntityId.equals(scopeEntityId)) {
      setSelectedEntityId(null);
      selectedEntities=new HashSet<Long>();
      multiselectMode=false;
    }
    belongsToEntityId=scopeEntityId;
    setEnabled(scopeEntityId != null);
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onScopeEntityIdChange(final Long scopeEntityId){
  if (belongsToFieldDefinition == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (belongsToEntityId != null && !belongsToEntityId.equals(scopeEntityId)) {
    setSelectedEntityId(null);
    selectedEntities=new HashSet<Long>();
    multiselectMode=false;
  }
  belongsToEntityId=scopeEntityId;
  setEnabled(scopeEntityId != null);
}
Program: 39324
Project: 39324
Buggy source:
@Override protected void initializeComponent() throws JSONException {
  super.initializeComponent();
  for (  ComponentOption option : getOptions()) {
    if ("String_Node_Str".equals(option.getType())) {
      textRepresentationOnDisabled=Boolean.parseBoolean(option.getValue());
    }
 else     if ("String_Node_Str".equals(option.getType())) {
      alignment=option.getValue();
    }
 else     if ("String_Node_Str".equals(option.getType())) {
    }
 else {
      throw new IllegalStateException("String_Node_Str" + option.getType());
    }
  }
}

Fixed version (ground truth):
@Override protected void initializeComponent() throws JSONException {
  super.initializeComponent();
  for (  ComponentOption option : getOptions()) {
    if ("String_Node_Str".equals(option.getType())) {
      textRepresentationOnDisabled=Boolean.parseBoolean(option.getValue());
    }
 else     if ("String_Node_Str".equals(option.getType())) {
      alignment=option.getValue();
    }
 else     if (!"String_Node_Str".equals(option.getType())) {
      throw new IllegalStateException("String_Node_Str" + option.getType());
    }
  }
}
Program: 39325
Project: 39325
Buggy source:
private FieldDefinition getAuditFieldDefinition(final DataDefinitionImpl dataDefinition,final String name,final FieldType type){
  FieldDefinitionImpl fieldDefinition=new FieldDefinitionImpl(dataDefinition,name);
  fieldDefinition.withReadOnly(false);
  fieldDefinition.setPersistent(true);
  fieldDefinition.setExpression("String_Node_Str");
  fieldDefinition.withType(type);
  return fieldDefinition;
}

Fixed version (ground truth):
private FieldDefinition getAuditFieldDefinition(final DataDefinitionImpl dataDefinition,final String name,final FieldType type){
  FieldDefinitionImpl fieldDefinition=new FieldDefinitionImpl(dataDefinition,name);
  fieldDefinition.withReadOnly(false);
  fieldDefinition.setPersistent(true);
  fieldDefinition.withType(type);
  return fieldDefinition;
}
Program: 39326
Project: 39326
Buggy source:
public void addColumn(final String name,final String fields,final String expression,final Boolean isLink,final Integer width,final boolean isOrderable,boolean isSearchable){
  GridComponentColumn column=new GridComponentColumn(name);
  for (  FieldDefinition field : parseFields(fields)) {
    column.addField(field);
  }
  column.setExpression(expression);
  if (isLink != null) {
    column.setLink(isLink);
  }
  if (width != null) {
    column.setWidth(width);
  }
  columns.put(name,column);
  if (isOrderable) {
    orderableColumns.add(name);
  }
  if (isSearchable) {
    searchableColumns.add(name);
  }
}

Fixed version (ground truth):
public void addColumn(final String name,final String fields,final String expression,final Boolean isLink,final Integer width,final boolean isOrderable,final boolean isSearchable){
  GridComponentColumn column=new GridComponentColumn(name);
  for (  FieldDefinition field : parseFields(fields,column)) {
    column.addField(field);
  }
  column.setExpression(expression);
  if (isLink != null) {
    column.setLink(isLink);
  }
  if (width != null) {
    column.setWidth(width);
  }
  columns.put(name,column);
  if (isOrderable) {
    orderableColumns.add(name);
  }
  if (isSearchable) {
    searchableColumns.add(name);
  }
}
Program: 39327
Project: 39327
Buggy source:
private Set<FieldDefinition> parseFields(final String fields){
  Set<FieldDefinition> set=new HashSet<FieldDefinition>();
  for (  String field : fields.split("String_Node_Str")) {
    set.add(getDataDefinition().getField(field));
  }
  return set;
}

Fixed version (ground truth):
private Set<FieldDefinition> parseFields(final String fields,final GridComponentColumn column){
  Set<FieldDefinition> set=new HashSet<FieldDefinition>();
  for (  String field : fields.split("String_Node_Str")) {
    FieldDefinition fieldDefiniton=getDataDefinition().getField(field);
    if (fieldDefiniton != null) {
      set.add(fieldDefiniton);
    }
 else {
      throwIllegalStateException("String_Node_Str" + field + "String_Node_Str"+ column.getName()+ "String_Node_Str");
    }
  }
  return set;
}
Program: 39328
Project: 39328
Buggy source:
private void parseColumnOption(final ComponentOption option){
  GridComponentColumn column=new GridComponentColumn(option.getAtrributeValue("String_Node_Str"));
  String fields=option.getAtrributeValue("String_Node_Str");
  if (fields != null) {
    for (    FieldDefinition field : parseFields(fields)) {
      column.addField(field);
    }
  }
  column.setExpression(option.getAtrributeValue("String_Node_Str"));
  String columnWidth=option.getAtrributeValue("String_Node_Str");
  if (columnWidth != null) {
    column.setWidth(Integer.valueOf(columnWidth));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setLink(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setHidden(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  columns.put(column.getName(),column);
}

Fixed version (ground truth):
private void parseColumnOption(final ComponentOption option){
  GridComponentColumn column=new GridComponentColumn(option.getAtrributeValue("String_Node_Str"));
  String fields=option.getAtrributeValue("String_Node_Str");
  if (fields != null) {
    for (    FieldDefinition field : parseFields(fields,column)) {
      column.addField(field);
    }
  }
  column.setExpression(option.getAtrributeValue("String_Node_Str"));
  String columnWidth=option.getAtrributeValue("String_Node_Str");
  if (columnWidth != null) {
    column.setWidth(Integer.valueOf(columnWidth));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setLink(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  if (option.getAtrributeValue("String_Node_Str") != null) {
    column.setHidden(Boolean.parseBoolean(option.getAtrributeValue("String_Node_Str")));
  }
  columns.put(column.getName(),column);
}
Program: 39330
Project: 39330
Buggy source:
private static void addDateFilter(final SearchCriteriaBuilder criteria,final Entry<GridComponentFilterOperator,String> filterValue,final String field){
  Date minDate=null;
  Date maxDate=null;
  try {
    minDate=DateUtils.parseAndComplete(filterValue.getValue(),false);
    maxDate=DateUtils.parseAndComplete(filterValue.getValue(),true);
  }
 catch (  ParseException e) {
    throw new IllegalStateException("String_Node_Str" + filterValue.getValue(),e);
  }
  if (minDate == null || maxDate == null) {
    throw new IllegalStateException("String_Node_Str" + filterValue.getValue());
  }
switch (filterValue.getKey()) {
case EQ:
    criteria.add(SearchRestrictions.or(SearchRestrictions.ge(field,minDate),SearchRestrictions.le(field,maxDate)));
  break;
case NE:
criteria.add(SearchRestrictions.or(SearchRestrictions.le(field,minDate),SearchRestrictions.gt(field,maxDate)));
break;
case GT:
criteria.add(SearchRestrictions.gt(field,maxDate));
break;
case GE:
criteria.add(SearchRestrictions.ge(field,minDate));
break;
case LT:
criteria.add(SearchRestrictions.lt(field,minDate));
break;
case LE:
criteria.add(SearchRestrictions.le(field,maxDate));
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
private static void addDateFilter(final SearchCriteriaBuilder criteria,final Entry<GridComponentFilterOperator,String> filterValue,final String field) throws ParseException {
  Date minDate=DateUtils.parseAndComplete(filterValue.getValue(),false);
  Date maxDate=DateUtils.parseAndComplete(filterValue.getValue(),true);
switch (filterValue.getKey()) {
case EQ:
    criteria.add(SearchRestrictions.or(SearchRestrictions.ge(field,minDate),SearchRestrictions.le(field,maxDate)));
  break;
case NE:
criteria.add(SearchRestrictions.or(SearchRestrictions.le(field,minDate),SearchRestrictions.gt(field,maxDate)));
break;
case GT:
criteria.add(SearchRestrictions.gt(field,maxDate));
break;
case GE:
criteria.add(SearchRestrictions.ge(field,minDate));
break;
case LT:
criteria.add(SearchRestrictions.lt(field,minDate));
break;
case LE:
criteria.add(SearchRestrictions.le(field,maxDate));
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}