nus-yam/ex-repair huggingface dataset:
Program: 175905
Project: 175905
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T>T populatePojo(T pojo,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojo.getClass(),0);
  final Map<String,Type> typeArgsMap=new HashMap<String,Type>();
  Type[] genericTypeArgsExtra=TypeManufacturerUtil.fillTypeArgMap(typeArgsMap,pojo.getClass(),genericTypeArgs);
  try {
    List<Annotation> annotations=null;
    return this.populatePojoInternal(pojo,annotations,manufacturingCtx,typeArgsMap,genericTypeArgsExtra);
  }
 catch (  InstantiationException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  IllegalAccessException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  InvocationTargetException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  ClassNotFoundException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T>T populatePojo(T pojo,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojo.getClass(),1);
  final Map<String,Type> typeArgsMap=new HashMap<String,Type>();
  Type[] genericTypeArgsExtra=TypeManufacturerUtil.fillTypeArgMap(typeArgsMap,pojo.getClass(),genericTypeArgs);
  try {
    List<Annotation> annotations=null;
    return this.populatePojoInternal(pojo,annotations,manufacturingCtx,typeArgsMap,genericTypeArgsExtra);
  }
 catch (  InstantiationException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  IllegalAccessException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  InvocationTargetException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  ClassNotFoundException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
}
Program: 175906
Project: 175906
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojoWithFullData(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,0);
  manufacturingCtx.setConstructorOrdering(Order.HEAVY_FIRST);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojoWithFullData(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,1);
  manufacturingCtx.setConstructorOrdering(Order.HEAVY_FIRST);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}
Program: 175908
Project: 175908
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojo(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,0);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojo(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,1);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}
Program: 175909
Project: 175909
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int getMaxDepth(Class<?> type){
  return -1;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int getMaxDepth(Class<?> type){
  return 1;
}
Program: 175910
Project: 175910
Buggy source:
private void createPojoWithCircularDependencies(PodamFactory podamFactory) throws Exception {
  Parent parent=podamInvocationSteps.whenIInvokeTheFactoryForClass(Parent.class,podamFactory);
  int depth=0;
  while (null != parent) {
    podamValidationSteps.thePojoMustBeOfTheType(parent,Parent.class);
    Child child=parent.getChild();
    podamValidationSteps.thePojoMustBeOfTheType(child,Child.class);
    parent=child.getParent();
    depth++;
  }
  podamValidationSteps.theIntFieldShouldHaveThePreciseValueOf(depth,podamFactory.getStrategy().getMaxDepth(Parent.class) + 2);
}

Fixed version (ground truth):
private void createPojoWithCircularDependencies(PodamFactory podamFactory) throws Exception {
  Parent parent=podamInvocationSteps.whenIInvokeTheFactoryForClass(Parent.class,podamFactory);
  int depth=0;
  while (null != parent) {
    podamValidationSteps.thePojoMustBeOfTheType(parent,Parent.class);
    Child child=parent.getChild();
    podamValidationSteps.thePojoMustBeOfTheType(child,Child.class);
    parent=child.getParent();
    depth++;
  }
  podamValidationSteps.theIntFieldShouldHaveThePreciseValueOf(depth,podamFactory.getStrategy().getMaxDepth(Parent.class));
}
Program: 175919
Project: 175919
Buggy source:
/** 
 * It returns a   {@link Field} matching the attribute name or null if a fieldwas not found.
 * @param pojoClass The class supposed to contain the field
 * @param attributeName The field name
 * @return a {@link Field} matching the attribute name or null if a fieldwas not found.
 */
public static Field getField(Class<?> pojoClass,String attributeName){
  Field field=null;
  Class<?> clazz=pojoClass;
  while (clazz != null) {
    try {
      field=clazz.getDeclaredField(attributeName);
      break;
    }
 catch (    NoSuchFieldException e) {
      clazz=clazz.getSuperclass();
    }
  }
  if (field == null) {
    LOG.warn("String_Node_Str",pojoClass,attributeName);
  }
  return field;
}

Fixed version (ground truth):
/** 
 * It returns a   {@link Field} matching the attribute name or null if a fieldwas not found.
 * @param pojoClass The class supposed to contain the field
 * @param attributeName The field name
 * @return a {@link Field} matching the attribute name or null if a fieldwas not found.
 */
public static Field getField(Class<?> pojoClass,String attributeName){
  Class<?> clazz=pojoClass;
  while (clazz != null) {
    try {
      return clazz.getDeclaredField(attributeName);
    }
 catch (    NoSuchFieldException e) {
      clazz=clazz.getSuperclass();
    }
  }
  LOG.warn("String_Node_Str",pojoClass,attributeName);
  return null;
}
Program: 175921
Project: 175921
Buggy source:
private void log(AttributeMetadata attributeMetadata){
  LOG.trace("String_Node_Str",attributeMetadata.getPojoClass().getName(),attributeMetadata.getAttributeName() != null ? attributeMetadata.getAttributeName() : "String_Node_Str");
}

Fixed version (ground truth):
private void log(AttributeMetadata attributeMetadata){
  LOG.trace("String_Node_Str",attributeMetadata.getPojoClass() != null ? attributeMetadata.getPojoClass().getName() : "String_Node_Str",attributeMetadata.getAttributeName() != null ? attributeMetadata.getAttributeName() : "String_Node_Str");
}
Program: 175924
Project: 175924
Buggy source:
/** 
 * Full constructor
 * @param list1 First List
 * @param list2 Second List
 */
public GenericCollectionsConstructorPojo(List<Long> list1,List<String> list2){
  this.list1=new ArrayList<Long>(list1);
  this.list2=new ArrayList<String>(list2);
}

Fixed version (ground truth):
/** 
 * Full constructor
 * @param list1 First List
 * @param list2 Second List
 */
public GenericCollectionsConstructorPojo(List<Long> list1,List<String> list2,List<?> list3){
  this.list1=new Vector<Long>(list1);
  this.list2=new Vector<String>(list2);
  this.list3=new Vector<Object>(list3);
}
Program: 175925
Project: 175925
Buggy source:
@Override public String toString(){
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(list1);
  sb.append("String_Node_Str").append(list2);
  sb.append('}');
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(list1);
  sb.append("String_Node_Str").append(list2);
  sb.append("String_Node_Str").append(list3);
  sb.append('}');
  return sb.toString();
}
Program: 175926
Project: 175926
Buggy source:
@Test @Title("String_Node_Str") public void podamShouldHandleGenericCollectionsInConstructorWithMemoizationDisabled() throws Exception {
  PodamFactory podamFactory=podamFactorySteps.givenAStandardPodamFactory();
  GenericCollectionsConstructorPojo pojo=podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericCollectionsConstructorPojo.class,podamFactory);
  podamValidationSteps.theObjectShouldNotBeNull(pojo);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList1(),Long.class);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList2(),String.class);
}

Fixed version (ground truth):
@Test @Title("String_Node_Str") public void podamShouldHandleGenericCollectionsInConstructorWithMemoizationDisabled() throws Exception {
  PodamFactory podamFactory=podamFactorySteps.givenAStandardPodamFactory();
  GenericCollectionsConstructorPojo pojo=podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericCollectionsConstructorPojo.class,podamFactory);
  podamValidationSteps.theObjectShouldNotBeNull(pojo);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList1(),Long.class);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList2(),String.class);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList3(),Object.class);
}
Program: 175927
Project: 175927
Buggy source:
@Test @Title("String_Node_Str") public void podamShouldHandleGenericCollectionsInConstructorWithMemoizationEnabled() throws Exception {
  PodamFactory podamFactory=podamFactorySteps.givenAStandardPodamFactoryWithMemoizationEnabled();
  GenericCollectionsConstructorPojo pojo=podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericCollectionsConstructorPojo.class,podamFactory);
  podamValidationSteps.theObjectShouldNotBeNull(pojo);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList1(),Long.class);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList2(),String.class);
}

Fixed version (ground truth):
@Test @Title("String_Node_Str") public void podamShouldHandleGenericCollectionsInConstructorWithMemoizationEnabled() throws Exception {
  PodamFactory podamFactory=podamFactorySteps.givenAStandardPodamFactoryWithMemoizationEnabled();
  GenericCollectionsConstructorPojo pojo=podamInvocationSteps.whenIInvokeTheFactoryForClass(GenericCollectionsConstructorPojo.class,podamFactory);
  podamValidationSteps.theObjectShouldNotBeNull(pojo);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList1(),Long.class);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList2(),String.class);
  podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList3(),Object.class);
}
Program: 175928
Project: 175928
Buggy source:
@Step("String_Node_Str") public boolean theObjectShouldNotBeNull(Object pojo){
  return pojo == null;
}

Fixed version (ground truth):
@Step("String_Node_Str") public void theObjectShouldNotBeNull(Object pojo){
  assertThat(pojo,is(notNullValue()));
}
Program: 175929
Project: 175929
Buggy source:
/** 
 * Full constructor.
 * @param dataProviderStrategy The DataProviderStrategy
 * @param attributeMetadata    The AttributeMetadata
 * @param typeArgumentsMap The map of type arguments
 */
public TypeManufacturerParamsWrapperForGenericTypes(DataProviderStrategy dataProviderStrategy,AttributeMetadata attributeMetadata,Map<String,Type> typeArgumentsMap,Type attributeGenericType){
  super(dataProviderStrategy,attributeMetadata);
  this.typeArgumentsMap=new HashMap<String,Type>(typeArgumentsMap);
  this.attributeGenericType=attributeGenericType;
}

Fixed version (ground truth):
/** 
 * Full constructor.
 * @param dataProviderStrategy The DataProviderStrategy
 * @param attributeMetadata    The AttributeMetadata
 * @param typeArgumentsMap The map of type arguments
 * @param attributeGenericType The attribute generic type
 */
public TypeManufacturerParamsWrapperForGenericTypes(DataProviderStrategy dataProviderStrategy,AttributeMetadata attributeMetadata,Map<String,Type> typeArgumentsMap,Type attributeGenericType){
  super(dataProviderStrategy,attributeMetadata);
  this.typeArgumentsMap=new HashMap<String,Type>(typeArgumentsMap);
  this.attributeGenericType=attributeGenericType;
}
Program: 175932
Project: 175932
Buggy source:
/** 
 * Bind an interface/abstract class to a specific implementation. If the strategy previously contained a binding for the interface/abstract class, the old value is replaced by the new value. If you want to implement more sophisticated binding strategy, override this class.
 * @param < T > return type
 * @param abstractClass the interface/abstract class to bind
 * @param specificClass the specific class implementing or extending {@code abstractClass}.
 * @return itself
 */
public <T>AbstractRandomDataProviderStrategy addSpecific(final Class<T> abstractClass,final Class<? extends T> specificClass){
  Class<?> aClass=specificTypes.putIfAbsent(abstractClass,specificClass);
  if (aClass == null) {
    aClass=specificClass;
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Bind an interface/abstract class to a specific implementation. If the strategy previously contained a binding for the interface/abstract class, the old value is replaced by the new value. If you want to implement more sophisticated binding strategy, override this class.
 * @param < T > return type
 * @param abstractClass the interface/abstract class to bind
 * @param specificClass the specific class implementing or extending {@code abstractClass}.
 * @return itself
 */
public <T>AbstractRandomDataProviderStrategy addSpecific(final Class<T> abstractClass,final Class<? extends T> specificClass){
  Class<? extends T> aClass=(Class<? extends T>)specificTypes.putIfAbsent(abstractClass,specificClass);
  if (aClass == null) {
    aClass=specificClass;
  }
  return this;
}
Program: 175933
Project: 175933
Buggy source:
/** 
 * Given the attribute and setter it combines annotations from them or an empty collection if no custom annotations were found
 * @param attribute The class attribute
 * @param attributeName The class attribute's setter
 * @return all annotations for the attribute
 */
public static List<Annotation> getAttributeAnnotations(final Field attribute,final Method setter){
  Annotation[] annotations=(attribute != null ? attribute.getAnnotations() : null);
  List<Annotation> retValue;
  if (annotations != null && annotations.length != 0) {
    retValue=Arrays.asList(annotations);
  }
 else {
    retValue=new ArrayList<Annotation>();
  }
  for (  Annotation annotation : setter.getParameterAnnotations()[0]) {
    retValue.add(annotation);
  }
  return retValue;
}

Fixed version (ground truth):
/** 
 * Given the attribute and setter it combines annotations from them or an empty collection if no custom annotations were found
 * @param attribute The class attribute
 * @param setter The class attribute's setter
 * @return all annotations for the attribute
 */
public static List<Annotation> getAttributeAnnotations(final Field attribute,final Method setter){
  Annotation[] annotations=(attribute != null ? attribute.getAnnotations() : null);
  List<Annotation> retValue;
  if (annotations != null && annotations.length != 0) {
    retValue=Arrays.asList(annotations);
  }
 else {
    retValue=new ArrayList<Annotation>();
  }
  for (  Annotation annotation : setter.getParameterAnnotations()[0]) {
    retValue.add(annotation);
  }
  return retValue;
}
Program: 175942
Project: 175942
Buggy source:
public JenkinsWindowManager(Project project){
  this.project=project;
  final BrowserPanel browserPanel=BrowserPanel.getInstance(project);
  Content content=ContentFactory.SERVICE.getInstance().createContent(browserPanel,null,false);
  ToolWindowManager toolWindowManager=ToolWindowManager.getInstance(project);
  ToolWindow toolWindow=toolWindowManager.registerToolWindow(JENKINS_BROWSER,false,ToolWindowAnchor.RIGHT);
  toolWindow.setIcon(JENKINS_ICON);
  ContentManager contentManager=toolWindow.getContentManager();
  contentManager.addContent(content);
  final StatusBar statusBar=WindowManager.getInstance().getStatusBar(project);
  JenkinsWidget jenkinsWidget=JenkinsWidget.getInstance(project);
  statusBar.addWidget(jenkinsWidget);
  jenkinsWidget.install(statusBar);
  final RssLogic rssLogic=RssLogic.getInstance(project);
  StartupManager.getInstance(project).registerPostStartupActivity(new DumbAwareRunnable(){
    @Override public void run(){
      browserPanel.init();
      rssLogic.init();
    }
  }
);
}

Fixed version (ground truth):
public JenkinsWindowManager(Project project){
  this.project=project;
  final BrowserPanel browserPanel=BrowserPanel.getInstance(project);
  Content content=ContentFactory.SERVICE.getInstance().createContent(browserPanel,null,false);
  ToolWindowManager toolWindowManager=ToolWindowManager.getInstance(project);
  ToolWindow toolWindow=toolWindowManager.registerToolWindow(JENKINS_BROWSER,false,ToolWindowAnchor.RIGHT);
  toolWindow.setIcon(JENKINS_ICON);
  ContentManager contentManager=toolWindow.getContentManager();
  contentManager.addContent(content);
  final StatusBar statusBar=WindowManager.getInstance().getStatusBar(project);
  final JenkinsWidget jenkinsWidget=JenkinsWidget.getInstance(project);
  statusBar.addWidget(jenkinsWidget);
  jenkinsWidget.install(statusBar);
  final RssLogic rssLogic=RssLogic.getInstance(project);
  StartupManager.getInstance(project).registerPostStartupActivity(new DumbAwareRunnable(){
    @Override public void run(){
      browserPanel.init();
      rssLogic.init();
    }
  }
);
}
Program: 175944
Project: 175944
Buggy source:
/** 
 * Set the IP address that Spark should listen on. If not called the default address is '0.0.0.0'. This has to be called before any route mapping is done.
 * @param port The port number
 */
public synchronized static void setIpAddress(String ipAddress){
  if (initialized) {
    throw new IllegalStateException("String_Node_Str");
  }
  Spark.ipAddress=ipAddress;
}

Fixed version (ground truth):
/** 
 * Set the IP address that Spark should listen on. If not called the default address is '0.0.0.0'. This has to be called before any route mapping is done.
 * @param port The ipAddress
 */
public synchronized static void setIpAddress(String ipAddress){
  if (initialized) {
    throw new IllegalStateException("String_Node_Str");
  }
  Spark.ipAddress=ipAddress;
}
Program: 175945
Project: 175945
Buggy source:
/** 
 * Ignites the spark server listening on the provided address and port
 * @param port The port to listen on
 * @param host The address to listen on
 */
void ignite(String host,int port);

Fixed version (ground truth):
/** 
 * Ignites the spark server listening on the provided address and port
 * @param host The address to listen on
 * @param port The port to listen on
 */
void ignite(String host,int port);
Program: 175946
Project: 175946
Buggy source:
synchronized static void stop(){
  if (server != null) {
    server.stop();
    initialized=false;
  }
}

Fixed version (ground truth):
synchronized static void stop(){
  if (server != null) {
    server.stop();
  }
  initialized=false;
}
Program: 175949
Project: 175949
Buggy source:
/** 
 * Initialize draw objects
 */
private void initDraw(int textColor,float textSize,int selectedColor,int footerLineHeight,int footerColor){
  paintText=new Paint();
  paintText.setColor(textColor);
  paintText.setTextSize(textSize);
  paintText.setAntiAlias(true);
  paintSelected=new Paint();
  paintSelected.setColor(selectedColor);
  paintSelected.setTextSize(textSize);
  paintSelected.setAntiAlias(true);
  paintFooterLine=new Paint();
  paintFooterLine.setStyle(Paint.Style.FILL_AND_STROKE);
  paintFooterLine.setStrokeWidth(footerLineHeight);
  paintFooterLine.setColor(FOOTER_COLOR);
  paintFooterTriangle=new Paint();
  paintFooterTriangle.setStyle(Paint.Style.FILL_AND_STROKE);
  paintFooterTriangle.setColor(footerColor);
}

Fixed version (ground truth):
/** 
 * Initialize draw objects
 */
private void initDraw(int textColor,float textSize,int selectedColor,int footerLineHeight,int footerColor){
  paintText=new Paint();
  paintText.setColor(textColor);
  paintText.setTextSize(textSize);
  paintText.setAntiAlias(true);
  paintSelected=new Paint();
  paintSelected.setColor(selectedColor);
  paintSelected.setTextSize(textSize);
  paintSelected.setAntiAlias(true);
  paintFooterLine=new Paint();
  paintFooterLine.setStyle(Paint.Style.FILL_AND_STROKE);
  paintFooterLine.setStrokeWidth(footerLineHeight);
  paintFooterLine.setColor(footerColor);
  paintFooterTriangle=new Paint();
  paintFooterTriangle.setStyle(Paint.Style.FILL_AND_STROKE);
  paintFooterTriangle.setColor(footerColor);
}
Program: 175950
Project: 175950
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  return onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (getChildCount() == 0)   return false;
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int action=ev.getAction();
  final float x=ev.getX();
switch (action) {
case MotionEvent.ACTION_DOWN:
    if (!mScroller.isFinished()) {
      mScroller.abortAnimation();
    }
  mLastMotionX=x;
mTouchState=mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING;
break;
case MotionEvent.ACTION_MOVE:
final int xDiff=(int)Math.abs(x - mLastMotionX);
boolean xMoved=xDiff > mTouchSlop;
if (xMoved) {
mTouchState=TOUCH_STATE_SCROLLING;
}
if (mTouchState == TOUCH_STATE_SCROLLING) {
final int deltaX=(int)(mLastMotionX - x);
mLastMotionX=x;
final int scrollX=getScrollX();
if (deltaX < 0) {
if (scrollX > 0) {
scrollBy(Math.max(-scrollX,deltaX),0);
}
}
 else if (deltaX > 0) {
final int availableToScroll=getChildAt(getChildCount() - 1).getRight() - scrollX - getWidth();
if (availableToScroll > 0) {
scrollBy(Math.min(availableToScroll,deltaX),0);
}
}
return true;
}
break;
case MotionEvent.ACTION_UP:
if (mTouchState == TOUCH_STATE_SCROLLING) {
final VelocityTracker velocityTracker=mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000,mMaximumVelocity);
int velocityX=(int)velocityTracker.getXVelocity();
if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) {
snapToScreen(mCurrentScreen - 1);
}
 else if (velocityX < -SNAP_VELOCITY && mCurrentScreen < getChildCount() - 1) {
snapToScreen(mCurrentScreen + 1);
}
 else {
snapToDestination();
}
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
}
mTouchState=TOUCH_STATE_REST;
break;
case MotionEvent.ACTION_CANCEL:
mTouchState=TOUCH_STATE_REST;
}
return false;
}
Program: 175951
Project: 175951
Buggy source:
private void logBuffer(){
  int index=0;
  for (  View view : mLoadedViews) {
    if (view instanceof LinearLayout) {
      LinearLayout ll=((LinearLayout)view);
      for (int i=0; i < ll.getChildCount(); i++) {
        View v=ll.getChildAt(i);
        if (v instanceof TextView) {
          Log.d("String_Node_Str","String_Node_Str" + index + "String_Node_Str"+ ((TextView)v).getText());
          break;
        }
      }
    }
    index++;
  }
  Log.d("String_Node_Str","String_Node_Str" + mScroller.getCurrX() + "String_Node_Str"+ mScroller.getCurrY());
  Log.d("String_Node_Str","String_Node_Str" + mCurrentAdapterIndex + "String_Node_Str"+ mCurrentBufferIndex);
}

Fixed version (ground truth):
private void logBuffer(){
  Log.d("String_Node_Str","String_Node_Str" + mLoadedViews.size() + "String_Node_Str"+ mScroller.getCurrX()+ "String_Node_Str"+ mScroller.getCurrY());
  Log.d("String_Node_Str","String_Node_Str" + mCurrentAdapterIndex + "String_Node_Str"+ mCurrentBufferIndex);
}
Program: 175953
Project: 175953
Buggy source:
@Override protected void create(List<TableInfo> tableInfos){
  List listTables=r.db(databaseName).tableList().run(connection);
  for (  TableInfo tableInfo : tableInfos) {
    try {
      if (listTables.contains(tableInfo.getTableName())) {
        r.db(databaseName).tableDrop(tableInfo.getTableName()).run(connection);
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + tableInfo.getTableName() + "String_Node_Str"+ e);
      throw new KunderaException("String_Node_Str" + tableInfo.getTableName() + "String_Node_Str"+ e);
    }
    r.db(databaseName).tableCreate(tableInfo.getTableName()).run(connection);
  }
}

Fixed version (ground truth):
@Override protected void create(List<TableInfo> tableInfos){
  List dbList=r.dbList().run(connection);
  if (!dbList.contains(databaseName)) {
    r.dbCreate(databaseName).run(connection);
  }
  List listTables=r.db(databaseName).tableList().run(connection);
  for (  TableInfo tableInfo : tableInfos) {
    try {
      if (listTables.contains(tableInfo.getTableName())) {
        r.db(databaseName).tableDrop(tableInfo.getTableName()).run(connection);
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + tableInfo.getTableName() + "String_Node_Str"+ e);
      throw new KunderaException("String_Node_Str" + tableInfo.getTableName() + "String_Node_Str"+ e);
    }
    r.db(databaseName).tableCreate(tableInfo.getTableName()).run(connection);
  }
}
Program: 175954
Project: 175954
Buggy source:
@Override public void dropSchema(){
  try {
    r.dbDrop(databaseName);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new SchemaGenerationException(e,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void dropSchema(){
  try {
    if (operation != null && ("String_Node_Str").equalsIgnoreCase(operation)) {
      r.dbDrop(databaseName);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new SchemaGenerationException(e,"String_Node_Str");
  }
}
Program: 175955
Project: 175955
Buggy source:
/** 
 * Gets the validation serializer class instance.
 * @param dataType the data type
 * @param isCql3Enabled the is cql3 enabled
 * @return the validation serializer class instance
 */
public static TypeSerializer<?> getValidationSerializerClassInstance(Class<?> dataType,boolean isCql3Enabled){
  resetMapperForCQL3(isCql3Enabled);
  TypeSerializer<?> validation_class;
  validation_class=validationSerializerClassMapper.get(dataType);
  if (!(validation_class != null)) {
    validation_class=BytesSerializer.instance;
  }
  resetMapperForThrift(isCql3Enabled);
  return validation_class;
}

Fixed version (ground truth):
/** 
 * Gets the validation serializer class instance.
 * @param dataType the data type
 * @param isCql3Enabled the is cql3 enabled
 * @return the validation serializer class instance
 */
public static TypeSerializer<?> getValidationSerializerClassInstance(Class<?> dataType,boolean isCql3Enabled){
  resetMapperForCQL3(isCql3Enabled);
  TypeSerializer<?> validation_class;
  validation_class=validationSerializerClassMapper.get(dataType);
  if (validation_class == null) {
    if (dataType.isEnum()) {
      validation_class=UTF8Serializer.instance;
    }
 else {
      validation_class=BytesSerializer.instance;
    }
  }
  resetMapperForThrift(isCql3Enabled);
  return validation_class;
}
Program: 175958
Project: 175958
Buggy source:
/** 
 * Sets the element collection list.
 * @param listType the cql column metadata
 * @param thriftColumnValue the thrift column value
 * @param entity the entity
 * @param field the field
 * @param metaModel the meta model
 * @param embeddedObject the embedded object
 * @return the object
 */
private Object setElementCollectionList(ListType listType,ByteBuffer thriftColumnValue,Object entity,Field field,MetamodelImpl metaModel,Class embeddedClass,boolean useNativeProtocol2){
  ListSerializer listSerializer=listType.getSerializer();
  Collection outputCollection=new ArrayList();
  if (useNativeProtocol2) {
    outputCollection.addAll((Collection)listSerializer.deserializeForNativeProtocol(thriftColumnValue,2));
  }
 else {
    outputCollection.addAll((Collection)listSerializer.deserialize(thriftColumnValue));
  }
  UserType usertype=(UserType)listType.getElementsType();
  Collection result=new ArrayList();
  Iterator collectionItems=outputCollection.iterator();
  while (collectionItems.hasNext()) {
    Object embeddedObject=KunderaCoreUtils.createNewInstance(embeddedClass);
    Object value=populateEmbeddedRecursive((ByteBuffer)collectionItems.next(),usertype.allTypes(),usertype.fieldNames(),embeddedObject,metaModel);
    result.add(value);
  }
  PropertyAccessorHelper.set(entity,field,result);
  return entity;
}

Fixed version (ground truth):
/** 
 * Sets the element collection list.
 * @param listType the cql column metadata
 * @param thriftColumnValue the thrift column value
 * @param entity the entity
 * @param field the field
 * @param metaModel the meta model
 * @param embeddedClass the embedded class
 * @param useNativeProtocol2 the use native protocol2
 * @return the object
 */
private Object setElementCollectionList(ListType listType,ByteBuffer thriftColumnValue,Object entity,Field field,MetamodelImpl metaModel,Class embeddedClass,boolean useNativeProtocol2){
  ListSerializer listSerializer=listType.getSerializer();
  Collection outputCollection=new ArrayList();
  if (useNativeProtocol2) {
    outputCollection.addAll((Collection)listSerializer.deserializeForNativeProtocol(thriftColumnValue,2));
  }
 else {
    outputCollection.addAll((Collection)listSerializer.deserialize(thriftColumnValue));
  }
  UserType usertype=(UserType)listType.getElementsType();
  Collection result=new ArrayList();
  Iterator collectionItems=outputCollection.iterator();
  while (collectionItems.hasNext()) {
    Object embeddedObject=KunderaCoreUtils.createNewInstance(embeddedClass);
    Object value=populateEmbeddedRecursive((ByteBuffer)collectionItems.next(),usertype.allTypes(),usertype.fieldNames(),embeddedObject,metaModel);
    result.add(value);
  }
  PropertyAccessorHelper.set(entity,field,result);
  return entity;
}
Program: 175959
Project: 175959
Buggy source:
/** 
 * Sets the element collection set.
 * @param setType the cql column metadata
 * @param thriftColumnValue the thrift column value
 * @param entity the entity
 * @param field the field
 * @param metaModel the meta model
 * @param embeddedObject the embedded object
 * @return the object
 */
private Object setElementCollectionSet(SetType setType,ByteBuffer thriftColumnValue,Object entity,Field field,MetamodelImpl metaModel,Class embeddedClass,boolean useNativeProtocol2){
  SetSerializer setSerializer=setType.getSerializer();
  Collection outputCollection=new ArrayList();
  if (useNativeProtocol2) {
    outputCollection.addAll((Collection)setSerializer.deserializeForNativeProtocol(thriftColumnValue,2));
  }
 else {
    outputCollection.addAll((Collection)setSerializer.deserialize(thriftColumnValue));
  }
  UserType usertype=(UserType)setType.getElementsType();
  Collection result=new HashSet();
  Iterator collectionItems=outputCollection.iterator();
  while (collectionItems.hasNext()) {
    Object embeddedObject=KunderaCoreUtils.createNewInstance(embeddedClass);
    Object value=populateEmbeddedRecursive((ByteBuffer)collectionItems.next(),usertype.allTypes(),usertype.fieldNames(),embeddedObject,metaModel);
    result.add(value);
  }
  PropertyAccessorHelper.set(entity,field,result);
  return entity;
}

Fixed version (ground truth):
/** 
 * Sets the element collection set.
 * @param setType the cql column metadata
 * @param thriftColumnValue the thrift column value
 * @param entity the entity
 * @param field the field
 * @param metaModel the meta model
 * @param embeddedClass the embedded class
 * @param useNativeProtocol2 the use native protocol2
 * @return the object
 */
private Object setElementCollectionSet(SetType setType,ByteBuffer thriftColumnValue,Object entity,Field field,MetamodelImpl metaModel,Class embeddedClass,boolean useNativeProtocol2){
  SetSerializer setSerializer=setType.getSerializer();
  Collection outputCollection=new ArrayList();
  if (useNativeProtocol2) {
    outputCollection.addAll((Collection)setSerializer.deserializeForNativeProtocol(thriftColumnValue,2));
  }
 else {
    outputCollection.addAll((Collection)setSerializer.deserialize(thriftColumnValue));
  }
  UserType usertype=(UserType)setType.getElementsType();
  Collection result=new HashSet();
  Iterator collectionItems=outputCollection.iterator();
  while (collectionItems.hasNext()) {
    Object embeddedObject=KunderaCoreUtils.createNewInstance(embeddedClass);
    Object value=populateEmbeddedRecursive((ByteBuffer)collectionItems.next(),usertype.allTypes(),usertype.fieldNames(),embeddedObject,metaModel);
    result.add(value);
  }
  PropertyAccessorHelper.set(entity,field,result);
  return entity;
}
Program: 175960
Project: 175960
Buggy source:
/** 
 * Sets the element collection map.
 * @param mapType the cql column metadata
 * @param thriftColumnValue the thrift column value
 * @param entity the entity
 * @param field the field
 * @param metaModel the meta model
 * @param embeddedObject the embedded object
 * @return the object
 */
private Object setElementCollectionMap(MapType mapType,ByteBuffer thriftColumnValue,Object entity,Field field,MetamodelImpl metaModel,Class embeddedClass,boolean useNativeProtocol2){
  Map result=new HashMap();
  MapSerializer mapSerializer=mapType.getSerializer();
  Map outputCollection=new HashMap();
  if (useNativeProtocol2) {
    outputCollection.putAll(mapSerializer.deserializeForNativeProtocol(thriftColumnValue,2));
  }
 else {
    outputCollection.putAll((Map)mapSerializer.deserialize(thriftColumnValue));
  }
  UserType usertype=(UserType)mapType.getValuesType();
  for (  Object key : outputCollection.keySet()) {
    Object embeddedObject=KunderaCoreUtils.createNewInstance(embeddedClass);
    Object value=populateEmbeddedRecursive((ByteBuffer)outputCollection.get(key),usertype.allTypes(),usertype.fieldNames(),embeddedObject,metaModel);
    result.put(key,value);
  }
  PropertyAccessorHelper.set(entity,field,result);
  return entity;
}

Fixed version (ground truth):
/** 
 * Sets the element collection map.
 * @param mapType the cql column metadata
 * @param thriftColumnValue the thrift column value
 * @param entity the entity
 * @param field the field
 * @param metaModel the meta model
 * @param embeddedClass the embedded class
 * @param useNativeProtocol2 the use native protocol2
 * @return the object
 */
private Object setElementCollectionMap(MapType mapType,ByteBuffer thriftColumnValue,Object entity,Field field,MetamodelImpl metaModel,Class embeddedClass,boolean useNativeProtocol2){
  Map result=new HashMap();
  MapSerializer mapSerializer=mapType.getSerializer();
  Map outputCollection=new HashMap();
  if (useNativeProtocol2) {
    outputCollection.putAll(mapSerializer.deserializeForNativeProtocol(thriftColumnValue,2));
  }
 else {
    outputCollection.putAll((Map)mapSerializer.deserialize(thriftColumnValue));
  }
  UserType usertype=(UserType)mapType.getValuesType();
  for (  Object key : outputCollection.keySet()) {
    Object embeddedObject=KunderaCoreUtils.createNewInstance(embeddedClass);
    Object value=populateEmbeddedRecursive((ByteBuffer)outputCollection.get(key),usertype.allTypes(),usertype.fieldNames(),embeddedObject,metaModel);
    result.put(key,value);
  }
  PropertyAccessorHelper.set(entity,field,result);
  return entity;
}
Program: 175963
Project: 175963
Buggy source:
/** 
 * Compile group.
 */
private void compileGroup(){
  GroupByClause groupByClause=null;
  if (query.isSelectStatement()) {
    groupByClause=(GroupByClause)query.getSelectStatement().getGroupByClause();
  }
  if (groupByClause == null && groupByClause.toActualText().length() == 0) {
    throw new JPQLParseException("String_Node_Str");
  }
  groupingClause=groupByClause.toActualText();
}

Fixed version (ground truth):
/** 
 * Compile group.
 */
private void compileGroup(){
  GroupByClause groupByClause=null;
  if (query.isSelectStatement()) {
    groupByClause=(GroupByClause)query.getSelectStatement().getGroupByClause();
  }
  if (groupByClause == null || groupByClause.toActualText().length() == 0) {
    throw new JPQLParseException("String_Node_Str");
  }
  groupingClause=groupByClause.toActualText();
}
Program: 175964
Project: 175964
Buggy source:
/** 
 * Compile having.
 */
private void compileHaving(){
  HavingClause havingClause=null;
  if (query.isSelectStatement()) {
    havingClause=(HavingClause)query.getSelectStatement().getHavingClause();
  }
  if (havingClause == null && havingClause.toActualText().length() == 0) {
    throw new JPQLParseException("String_Node_Str");
  }
  if (groupingClause != null) {
    groupingClause=groupingClause.trim() + havingClause.toActualText();
  }
 else {
    groupingClause=havingClause.toActualText();
  }
}

Fixed version (ground truth):
/** 
 * Compile having.
 */
private void compileHaving(){
  HavingClause havingClause=null;
  if (query.isSelectStatement()) {
    havingClause=(HavingClause)query.getSelectStatement().getHavingClause();
  }
  if (havingClause == null || havingClause.toActualText().length() == 0) {
    throw new JPQLParseException("String_Node_Str");
  }
  if (groupingClause != null) {
    groupingClause=groupingClause.trim() + havingClause.toActualText();
  }
 else {
    groupingClause=havingClause.toActualText();
  }
}
Program: 175966
Project: 175966
Buggy source:
@Override public final void process(final Class<?> entityClass,EntityMetadata metadata){
  EntityListeners entityListeners=(EntityListeners)entityClass.getAnnotation(EntityListeners.class);
  if (entityListeners != null) {
    Class<?>[] entityListenerClasses=entityListeners.value();
    if (entityListenerClasses != null) {
      for (      Class<?> entityListener : entityListenerClasses) {
        try {
          entityListener.getConstructor();
        }
 catch (        NoSuchMethodException nsme) {
          throw new MetamodelLoaderException("String_Node_Str" + entityListener.getName() + "String_Node_Str");
        }
        for (        Method method : entityListener.getDeclaredMethods()) {
          List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityListener,method,1,entityClass);
          for (          Class<?> jpaAnnotation : jpaAnnotations) {
            CallbackMethod callBackMethod=new ExternalCallbackMethod(entityListener,method);
            addCallBackMethod(metadata,jpaAnnotation,callBackMethod);
          }
        }
      }
    }
  }
  for (  Method method : entityClass.getMethods()) {
    List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityClass,method,0,entityClass);
    for (    Class<?> jpaAnnotation : jpaAnnotations) {
      CallbackMethod callbackMethod=new InternalCallbackMethod(metadata,method);
      addCallBackMethod(metadata,jpaAnnotation,callbackMethod);
    }
  }
}

Fixed version (ground truth):
@Override public final void process(final Class<?> entityClass,EntityMetadata metadata){
  EntityListeners entityListeners=(EntityListeners)entityClass.getAnnotation(EntityListeners.class);
  if (entityListeners == null && entityClass.getSuperclass() != null) {
    entityListeners=entityClass.getSuperclass().getAnnotation(EntityListeners.class);
  }
  if (entityListeners != null) {
    Class<?>[] entityListenerClasses=entityListeners.value();
    if (entityListenerClasses != null) {
      for (      Class<?> entityListener : entityListenerClasses) {
        try {
          entityListener.getConstructor();
        }
 catch (        NoSuchMethodException nsme) {
          throw new MetamodelLoaderException("String_Node_Str" + entityListener.getName() + "String_Node_Str");
        }
        for (        Method method : entityListener.getDeclaredMethods()) {
          List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityListener,method,1,entityClass);
          for (          Class<?> jpaAnnotation : jpaAnnotations) {
            CallbackMethod callBackMethod=new ExternalCallbackMethod(entityListener,method);
            addCallBackMethod(metadata,jpaAnnotation,callBackMethod);
          }
        }
      }
    }
  }
  for (  Method method : entityClass.getMethods()) {
    List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityClass,method,0,entityClass);
    for (    Class<?> jpaAnnotation : jpaAnnotations) {
      CallbackMethod callbackMethod=new InternalCallbackMethod(metadata,method);
      addCallBackMethod(metadata,jpaAnnotation,callbackMethod);
    }
  }
}
Program: 175967
Project: 175967
Buggy source:
/** 
 * On query over composite columns.
 * @param m the m
 * @param client the client
 * @param metaModel the meta model
 * @param relations the relations
 * @return the list
 */
String onQueryOverCQL3(EntityMetadata m,Client client,MetamodelImpl metaModel,List<String> relations){
  Class compoundKeyClass=m.getIdAttribute().getBindableJavaType();
  EmbeddableType compoundKey=null;
  String idColumn;
  if (metaModel.isEmbeddable(compoundKeyClass)) {
    compoundKey=metaModel.embeddable(compoundKeyClass);
    idColumn=((AbstractAttribute)m.getIdAttribute()).getJPAColumnName();
  }
 else {
    idColumn=((AbstractAttribute)m.getIdAttribute()).getJPAColumnName();
  }
  StringBuilder builder=new StringBuilder();
  boolean isPresent=false;
  List<String> columns=getColumnList(m,metaModel,getKunderaQuery().getResult(),compoundKey);
  String selectQuery=setSelectQuery(columns);
  CQLTranslator translator=new CQLTranslator();
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),m.getTableName(),false).toString());
  builder=CassandraUtilities.appendColumns(builder,columns,selectQuery,translator);
  addWhereClause(builder);
  onCondition(m,metaModel,compoundKey,idColumn,builder,isPresent,translator,true);
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * On query over composite columns.
 * @param m the m
 * @param client the client
 * @param metaModel the meta model
 * @param relations the relations
 * @return the list
 */
public String onQueryOverCQL3(EntityMetadata m,Client client,MetamodelImpl metaModel,List<String> relations){
  Class compoundKeyClass=m.getIdAttribute().getBindableJavaType();
  EmbeddableType compoundKey=null;
  String idColumn;
  if (metaModel.isEmbeddable(compoundKeyClass)) {
    compoundKey=metaModel.embeddable(compoundKeyClass);
    idColumn=((AbstractAttribute)m.getIdAttribute()).getJPAColumnName();
  }
 else {
    idColumn=((AbstractAttribute)m.getIdAttribute()).getJPAColumnName();
  }
  StringBuilder builder=new StringBuilder();
  boolean isPresent=false;
  List<String> columns=getColumnList(m,metaModel,getKunderaQuery().getResult(),compoundKey);
  String selectQuery=setSelectQuery(columns);
  CQLTranslator translator=new CQLTranslator();
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),m.getTableName(),false).toString());
  builder=CassandraUtilities.appendColumns(builder,columns,selectQuery,translator);
  addWhereClause(builder);
  onCondition(m,metaModel,compoundKey,idColumn,builder,isPresent,translator,true);
  return builder.toString();
}
Program: 175968
Project: 175968
Buggy source:
/** 
 * Sets the relational entities.
 * @param enhanceEntities the enhance entities
 * @param client the client
 * @param m the m
 */
void setRelationalEntities(List enhanceEntities,Client client,EntityMetadata m){
  super.setRelationEntities(enhanceEntities,client,m);
}

Fixed version (ground truth):
/** 
 * Sets the relational entities.
 * @param enhanceEntities the enhance entities
 * @param client the client
 * @param m the m
 */
public void setRelationalEntities(List enhanceEntities,Client client,EntityMetadata m){
  super.setRelationEntities(enhanceEntities,client,m);
}
Program: 175971
Project: 175971
Buggy source:
/** 
 * Constructor with parameters.
 * @param query the query
 * @param m the m
 * @param client the client
 * @param reader the reader
 * @param fetchSize the fetch size
 * @param kunderaMetadata the kundera metadata
 */
ResultIterator(final Query query,final EntityMetadata m,final Client client,final EntityReader reader,final int fetchSize,final KunderaMetadata kunderaMetadata){
  this.client=client;
  this.query=(CassQuery)query;
  this.entityMetadata=m;
  this.reader=reader;
  this.scrollComplete=false;
  this.fetchSize=fetchSize;
  this.kunderaMetadata=kunderaMetadata;
}

Fixed version (ground truth):
/** 
 * Constructor with parameters.
 * @param query the query
 * @param m the m
 * @param client the client
 * @param reader the reader
 * @param fetchSize the fetch size
 * @param kunderaMetadata the kundera metadata
 */
protected ResultIterator(final Query query,final EntityMetadata m,final Client client,final EntityReader reader,final int fetchSize,final KunderaMetadata kunderaMetadata){
  this.client=client;
  this.query=(CassQuery)query;
  this.entityMetadata=m;
  this.reader=reader;
  this.scrollComplete=false;
  this.fetchSize=fetchSize;
  this.kunderaMetadata=kunderaMetadata;
}
Program: 175972
Project: 175972
Buggy source:
@Before public void setUp() throws Exception {
  emf=Persistence.createEntityManagerFactory("String_Node_Str");
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  emf=Persistence.createEntityManagerFactory("String_Node_Str");
  em=emf.createEntityManager();
}
Program: 175974
Project: 175974
Buggy source:
@After public void tearDown() throws Exception {
  EntityManager em=emf.createEntityManager();
  String deleteQuery="String_Node_Str";
  Query query=em.createQuery(deleteQuery);
  query.executeUpdate();
  deleteQuery="String_Node_Str";
  query=em.createQuery(deleteQuery);
  query.executeUpdate();
  deleteQuery="String_Node_Str";
  query=em.createQuery(deleteQuery);
  query.executeUpdate();
  em.close();
  emf.close();
}

Fixed version (ground truth):
@After public void tearDown() throws Exception {
  purge();
  em.close();
  emf.close();
}
Program: 175976
Project: 175976
Buggy source:
/** 
 * Returns collection of parsed filter.
 * @return map.
 */
Filter getFilter(){
  FilterList filters=new FilterList(new PageFilter(getMaxResults()));
  if (filterList != null) {
    if (this.isORQuery) {
      filters.addFilter(new FilterList(FilterList.Operator.MUST_PASS_ONE,filterList));
    }
 else {
      filters.addFilter(new FilterList(filterList));
    }
  }
  return filters;
}

Fixed version (ground truth):
/** 
 * Returns collection of parsed filter.
 * @return map.
 */
Filter getFilter(){
  FilterList filters=new FilterList(new PageFilter(getMaxResults()));
  if (filterList != null) {
    this.setWhereQuery(true);
    if (this.isORQuery) {
      filters.addFilter(new FilterList(FilterList.Operator.MUST_PASS_ONE,filterList));
    }
 else {
      filters.addFilter(new FilterList(filterList));
    }
  }
  return filters;
}