nus-yam/ex-repair huggingface dataset:
Program: 10558
Project: 10558
Buggy source:
private void parseSettingArgs(){
  if (!setting_gotFirstArg) {
    setting_gotFirstArg=true;
switch (setting_type) {
case UNKNOWN:
{
        prepareNextLine();
        return;
      }
case STRING:
{
      ParsedString first=line.arguments.get(argOff);
      ParsedString last=line.arguments.get(argLen - 1);
      tokenQueue.add(first.getArgCharPos(),last.getArgEndCharPos(),tokSETTING_VAL);
      prepareNextLine();
      return;
    }
case FILE:
{
    ParsedString file=line.arguments.get(argOff);
    tokenQueue.add(file,tokSETTING_FILE);
    prepareNextLine();
    return;
  }
case FILE_ARGS:
{
  ParsedString file=line.arguments.get(argOff);
  tokenQueue.add(file,tokSETTING_FILE);
  prepareNextToken();
  return;
}
case KEYWORD_ARGS:
{
ParsedString file=line.arguments.get(argOff);
tokenQueue.add(file,tokSETTING_KEYWORD_CALL);
prepareNextToken();
return;
}
}
throw new RuntimeException();
}
 else {
switch (setting_type) {
case FILE_ARGS:
{
ParsedString first=line.arguments.get(argOff);
ParsedString last=line.arguments.get(argLen - 1);
tokenQueue.add(first.getArgCharPos(),last.getArgEndCharPos(),tokSETTING_FILE_ARG);
prepareNextLine();
return;
}
case KEYWORD_ARGS:
{
ParsedString first=line.arguments.get(argOff);
ParsedString last=line.arguments.get(argLen - 1);
tokenQueue.add(first.getArgCharPos(),last.getArgEndCharPos(),tokSETTING_KEYWORD_ARG);
prepareNextLine();
return;
}
}
throw new RuntimeException();
}
}

Fixed version (ground truth):
private void parseSettingArgs(){
  if (!setting_gotFirstArg) {
switch (setting_type) {
case UNKNOWN:
{
        prepareNextLine();
        return;
      }
case STRING:
{
      ParsedString first=line.arguments.get(argOff);
      ParsedString last=line.arguments.get(argLen - 1);
      tokenQueue.add(first.getArgCharPos(),last.getArgEndCharPos(),tokSETTING_VAL);
      prepareNextLine();
      return;
    }
case FILE:
{
    ParsedString file=line.arguments.get(argOff);
    tokenQueue.add(file,tokSETTING_FILE);
    prepareNextLine();
    return;
  }
case FILE_ARGS:
{
  ParsedString file=line.arguments.get(argOff);
  tokenQueue.add(file,tokSETTING_FILE);
  prepareNextToken();
  setting_gotFirstArg=true;
  return;
}
case KEYWORD_ARGS:
{
ParsedString file=line.arguments.get(argOff);
tokenQueue.add(file,tokSETTING_KEYWORD_CALL);
prepareNextToken();
setting_gotFirstArg=true;
return;
}
}
throw new RuntimeException();
}
 else {
switch (setting_type) {
case FILE_ARGS:
{
ParsedString first=line.arguments.get(argOff);
ParsedString last=line.arguments.get(argLen - 1);
tokenQueue.add(first.getArgCharPos(),last.getArgEndCharPos(),tokSETTING_FILE_ARG);
prepareNextLine();
return;
}
case KEYWORD_ARGS:
{
ParsedString first=line.arguments.get(argOff);
ParsedString last=line.arguments.get(argLen - 1);
tokenQueue.add(first.getArgCharPos(),last.getArgEndCharPos(),tokSETTING_KEYWORD_ARG);
prepareNextLine();
return;
}
}
throw new RuntimeException();
}
}
Program: 10559
Project: 10559
Buggy source:
private boolean tryParseContinuationLine(RFELine line) throws CoreException {
  ParsedString arg=line.arguments.get(0);
  if (!arg.getValue().equals("String_Node_Str")) {
    if (!arg.getValue().isEmpty()) {
      return false;
    }
    if (line.arguments.size() < 2) {
      return false;
    }
    if (!line.arguments.get(1).getValue().equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean tryParseContinuationLine(RFELine line) throws CoreException {
  ParsedString arg=line.arguments.get(0);
  if (!arg.getValue().equals(CONTINUATION_STR)) {
    if (!arg.getValue().isEmpty() && !arg.getValue().equals("String_Node_Str")) {
      return false;
    }
    if (line.arguments.size() < 2) {
      return false;
    }
    if (!line.arguments.get(1).getValue().equals(CONTINUATION_STR)) {
      return false;
    }
  }
  return true;
}
Program: 10560
Project: 10560
Buggy source:
static String rtrim(String line){
  int epos=line.length() - 1;
  while (epos >= 0) {
switch (line.charAt(epos)) {
case ' ':
case '\t':
      break;
default :
    return line.substring(0,epos + 1);
}
}
return null;
}

Fixed version (ground truth):
static String rtrim(String line){
  int epos=line.length() - 1;
  while (epos >= 0) {
switch (line.charAt(epos)) {
case ' ':
case '\t':
      break;
default :
    return line.substring(0,epos + 1);
}
--epos;
}
return null;
}
Program: 10561
Project: 10561
Buggy source:
/** 
 * Splits a line from a robot TXT file into arguments. Only supports the tab-or-multiple-whitespace separator right now.
 * @param line
 * @param charPos
 * @return
 */
static List<Argument> splitLineIntoArguments(String line,int charPos){
  line=rtrim(line);
  Matcher m=SEPARATOR_RE.matcher(line);
  List<Argument> arguments=new ArrayList<Argument>();
  int lastEnd=0;
  while (true) {
    if (lastEnd < line.length() && line.charAt(lastEnd) == '#') {
      break;
    }
    boolean isLastArgument=!m.find();
    int nextStart=!isLastArgument ? m.start() : line.length();
    arguments.add(new Argument(line.substring(lastEnd,nextStart),charPos + lastEnd));
    if (isLastArgument) {
      break;
    }
    lastEnd=m.end();
  }
  return arguments;
}

Fixed version (ground truth):
/** 
 * Splits a line from a robot TXT file into arguments. Only supports the tab-or-multiple-whitespace separator right now.
 * @param line
 * @param charPos
 * @return
 */
static List<Argument> splitLineIntoArguments(String line,int charPos){
  line=rtrim(line);
  if (line == null) {
    return Collections.emptyList();
  }
  Matcher m=SEPARATOR_RE.matcher(line);
  List<Argument> arguments=new ArrayList<Argument>();
  int lastEnd=0;
  while (true) {
    if (lastEnd < line.length() && line.charAt(lastEnd) == '#') {
      break;
    }
    boolean isLastArgument=!m.find();
    int nextStart=!isLastArgument ? m.start() : line.length();
    if (lastEnd == 0 && nextStart > 0 && line.charAt(0) == ' ') {
      ++lastEnd;
    }
    arguments.add(new Argument(line.substring(lastEnd,nextStart),charPos + lastEnd));
    if (isLastArgument) {
      break;
    }
    lastEnd=m.end();
  }
  return arguments;
}
Program: 10562
Project: 10562
Buggy source:
/** 
 * Release the save point at the top of the save point stack. If the rule number of the stack top is not equal to the specified one, report error. If save point is released under a unsuccessful match, pushback the buffer. If the released save point is the the last save point, clear the backup.
 * @param ruleNum
 * @param success if is a successful match
 * @return the parsing position when backuped
 */
public int releaseSavePoint(int ruleNum,boolean success){
  Integer[] top=this.savePoints.pop();
  if (top[0] != ruleNum)   throw new RuntimeException("String_Node_Str");
  if (!success) {
    List<Token> sub=this.backUp.subList(top[1],this.backUp.size());
    this.lookAheadBuf.addAll(0,sub);
    for (    Token t : sub)     this.allBufferedLexemeLength+=t.getLength();
    sub.clear();
  }
  return top[2];
}

Fixed version (ground truth):
/** 
 * Release the save point at the top of the save point stack. If the rule number of the stack top is not equal to the specified one, report error. If save point is released under a unsuccessful match, pushback the buffer. If the released save point is the the last save point, clear the backup.
 * @param ruleNum
 * @param success if is a successful match
 * @return the parsing position when backuped
 */
public int releaseSavePoint(int ruleNum,boolean success){
  Integer[] top=this.savePoints.pop();
  if (top[0] != ruleNum)   throw new RuntimeException("String_Node_Str");
  if (!success) {
    List<Token> sub=this.backUp.subList(top[1],this.backUp.size());
    this.lookAheadBuf.addAll(0,sub);
    for (    Token t : sub)     this.allBufferedLexemeLength+=t.getLength();
    sub.clear();
  }
 else   if (this.savePoints.isEmpty() && !this.backUp.isEmpty()) {
    this.backUp.clear();
  }
  return top[2];
}
Program: 10563
Project: 10563
Buggy source:
/** 
 * Let the lexer forward to the specified position directly
 * @param position
 */
public void fastForward(int position){
  int steps=position - this.getCurrentPosition();
  if (steps < 0)   throw new RuntimeException("String_Node_Str");
  for (int i=0; i < steps; i++)   this.nextElement();
}

Fixed version (ground truth):
/** 
 * Let the lexer forward to the specified position directly
 * @param position
 */
public void fastForward(int position){
  int chars=position - this.getCurrentPosition();
  if (chars < 0)   throw new RuntimeException("String_Node_Str");
  while (chars > 0)   chars-=this.nextElement().getLength();
  if (chars < 0)   throw new RuntimeException("String_Node_Str");
}
Program: 10564
Project: 10564
Buggy source:
/** 
 * build the classpath using all properties with suffix 'class.path'; to make some software setting its own class path variables happy(like maven-surfire plugin).
 * @return
 */
public static String getClassPath(){
  StringBuilder sb=new StringBuilder();
  for (  Map.Entry<Object,Object> e : System.getProperties().entrySet()) {
    String k=(String)e.getKey();
    if (k.endsWith("String_Node_Str")) {
      if (sb.length() != 0)       sb.append(File.pathSeparator);
      sb.append(e.getValue());
    }
  }
  URL url=Util.class.getResource("String_Node_Str");
  if (url != null) {
    String dropinccPath=null;
    if ("String_Node_Str".equalsIgnoreCase(url.getProtocol())) {
      String path=url.getPath();
      dropinccPath=path.substring(path.indexOf("String_Node_Str") + 1,path.indexOf("String_Node_Str"));
    }
 else     if ("String_Node_Str".equalsIgnoreCase(url.getProtocol())) {
      String path=url.getPath();
      dropinccPath=path.substring(0,path.lastIndexOf(PATH_SEP + Util.class.getName().replace("String_Node_Str",PATH_SEP) + "String_Node_Str"));
    }
    if (dropinccPath != null && !"String_Node_Str".equals(dropinccPath) && sb.indexOf(dropinccPath) == -1) {
      if (sb.length() != 0)       sb.append(File.pathSeparator);
      sb.append(dropinccPath);
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * build the classpath using all properties with suffix 'class.path'; to make some software setting its own class path variables happy(like maven-surfire plugin). XXX dirty classpath hacking to make java compiler API happy...
 * @return
 */
public static String getClassPath(){
  StringBuilder sb=new StringBuilder();
  for (  Map.Entry<Object,Object> e : System.getProperties().entrySet()) {
    String k=(String)e.getKey();
    if (k.endsWith("String_Node_Str")) {
      if (sb.length() != 0)       sb.append(File.pathSeparator);
      sb.append(e.getValue());
    }
  }
  URL url=Util.class.getResource("String_Node_Str");
  if (url != null) {
    String dropinccPath=null;
    if ("String_Node_Str".equalsIgnoreCase(url.getProtocol())) {
      String path=url.getPath();
      dropinccPath=path.substring(path.indexOf("String_Node_Str") + 1,path.indexOf("String_Node_Str"));
    }
 else     if ("String_Node_Str".equalsIgnoreCase(url.getProtocol())) {
      String path=url.getPath();
      dropinccPath=path.substring(0,path.lastIndexOf(PATH_SEP + Util.class.getName().replace("String_Node_Str",PATH_SEP) + "String_Node_Str"));
    }
    if (dropinccPath != null && !"String_Node_Str".equals(dropinccPath) && sb.indexOf(dropinccPath) == -1) {
      if (sb.length() != 0)       sb.append(File.pathSeparator);
      sb.append(dropinccPath);
    }
  }
  return sb.toString();
}
Program: 10565
Project: 10565
Buggy source:
/** 
 * Get the platform dependent temporary directory path, with 'file separator' suffix('/' on linux platform, '\' on windows).
 * @return
 */
public static String getTempDirWithFileSeparatorSuffix(){
  String p=System.getProperty("String_Node_Str");
  if (p.endsWith(PATH_SEP))   return p;
  return p + PATH_SEP;
}

Fixed version (ground truth):
/** 
 * Get the platform dependent temporary directory path, with 'file separator' suffix('/' on linux platform, '\' on windows).
 * @return
 */
public static String getTempDirWithFileSeparatorSuffix(){
  String p=System.getProperty("String_Node_Str");
  if (p.endsWith(File.separator))   return p;
  return p + PATH_SEP;
}
Program: 10566
Project: 10566
Buggy source:
public CAlternative(List<EleType> ms,Action action){
  this.matchSequence=ms;
  this.action=action;
}

Fixed version (ground truth):
public CAlternative(List<EleType> ms,Action action,Predicate pred){
  this.matchSequence=ms;
  this.action=action;
  this.predicate=pred;
}
Program: 10567
Project: 10567
Buggy source:
public void addTransition(Object edge,AtnState otherState){
  if (!edge.equals(Constants.epsilon) && !(edge instanceof TokenType) && !(edge instanceof GruleType))   throw new DropinccException("String_Node_Str" + edge);
  if (this.transitions.containsKey(edge)) {
    this.transitions.get(edge).add(otherState);
  }
 else {
    Set<AtnState> set=new HashSet<AtnState>();
    set.add(otherState);
    this.transitions.put(edge,set);
  }
}

Fixed version (ground truth):
public void addTransition(Object edge,AtnState otherState){
  if (!edge.equals(Constants.epsilon) && !(edge instanceof TokenType) && !(edge instanceof GruleType)&& !(edge instanceof Predicate))   throw new DropinccException("String_Node_Str" + edge);
  if (this.transitions.containsKey(edge)) {
    this.transitions.get(edge).add(otherState);
  }
 else {
    Set<AtnState> set=new HashSet<AtnState>();
    set.add(otherState);
    this.transitions.put(edge,set);
  }
}
Program: 10569
Project: 10569
Buggy source:
/** 
 * Check if the specified dfa state is a final state, and if it is, replace the old final state of the same alternative number with the new one
 * @param state
 * @param ret
 */
private static boolean checkIfFinalAndReplace(DfaState state,LookAheadDfa dnet){
  Set<Integer> predictingAlts=state.getAllPredictingAlts();
  if (predictingAlts.size() == 1) {
    int alt=predictingAlts.iterator().next();
    state.setAlt(alt);
    dnet.overrideFinalState(alt,state);
    state.setStopTransit(true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if the specified dfa state is a final state, and if it is, replace the old final state of the same alternative number with the new one
 */
private boolean checkIfFinalAndReplace(DfaState state,LookAheadDfa dnet,Map<Integer,DfaState> finalsBack,boolean backup){
  Set<Integer> predictingAlts=state.getAllPredictingAlts();
  if (predictingAlts.size() == 1) {
    int alt=predictingAlts.iterator().next();
    state.setAlt(alt);
    DfaState oldFinal=dnet.overrideFinalState(alt,state);
    if (backup && !finalsBack.containsKey(alt))     finalsBack.put(alt,oldFinal);
    state.setStopTransit(true);
    return true;
  }
  return false;
}
Program: 10570
Project: 10570
Buggy source:
/** 
 * Replace the old final state with the specified one
 * @param alt
 * @param state
 */
public void overrideFinalState(int alt,DfaState state){
  DfaState oldFinal=this.finalStates.put(alt,state);
  for (  DfaState s : this.states) {
    for (    Map.Entry<Object,DfaState> trans : s.getTransitions().entrySet()) {
      if (trans.getValue().equals(oldFinal)) {
        trans.setValue(state);
      }
    }
  }
  this.states.remove(oldFinal);
}

Fixed version (ground truth):
/** 
 * Replace the old final state with the specified one
 * @param alt
 * @param state
 */
public DfaState overrideFinalState(int alt,DfaState state){
  DfaState oldFinal=this.finalStates.put(alt,state);
  for (  DfaState s : this.states) {
    for (    Map.Entry<Object,DfaState> trans : s.getTransitions().entrySet()) {
      if (trans.getValue().equals(oldFinal)) {
        trans.setValue(state);
      }
    }
  }
  if (!oldFinal.equals(state))   this.states.remove(oldFinal);
  return oldFinal;
}
Program: 10571
Project: 10571
Buggy source:
private static List<CAlternative> resolveCAlts(List<Alternative> alts,TypeMappingParam param){
  List<CAlternative> ret=new ArrayList<CAlternative>();
  for (  Alternative a : alts) {
    List<EleType> ms=eleListToTypeList(a.getElements(),param);
    ret.add(new CAlternative(ms,a.getAction()));
  }
  return ret;
}

Fixed version (ground truth):
private static List<CAlternative> resolveCAlts(List<Alternative> alts,TypeMappingParam param){
  List<CAlternative> ret=new ArrayList<CAlternative>();
  for (  Alternative a : alts) {
    List<EleType> ms=eleListToTypeList(a.getElements(),param);
    ret.add(new CAlternative(ms,a.getAction(),a.getPred()));
  }
  return ret;
}
Program: 10572
Project: 10572
Buggy source:
public static void main(String... args) throws Throwable {
  Lang ll3=new Lang();
  Grule A=ll3.newGrule();
  ll3.defineGrule(A,CC.EOF);
  Grule B=ll3.newGrule();
  Grule C=ll3.newGrule();
  Grule D=ll3.newGrule();
  A.define(B,CC.ks("String_Node_Str")).alt(C,CC.kc("String_Node_Str")).alt(D,CC.op("String_Node_Str"));
  B.define("String_Node_Str","String_Node_Str","String_Node_Str",C).alt("String_Node_Str","String_Node_Str","String_Node_Str",D).alt("String_Node_Str");
  C.define("String_Node_Str","String_Node_Str","String_Node_Str",D).alt("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  D.define("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").alt("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  genImages(ll3);
}

Fixed version (ground truth):
public static void main(String... args) throws Throwable {
  Lang lang=new Lang();
  Grule A=lang.newGrule();
  lang.defineGrule(A,CC.EOF);
  Grule B=lang.newGrule();
  A.define(B,"String_Node_Str").alt(CC.ks("String_Node_Str"),"String_Node_Str").alt(CC.ks("String_Node_Str"),"String_Node_Str");
  B.define(CC.kc("String_Node_Str"),B);
  genImages(lang);
}
Program: 10573
Project: 10573
Buggy source:
/** 
 * Open the error   {@link InputStream} of an Http response. This methodsupports GZIP and DEFLATE responses.
 */
private static InputStream getErrorStream(HttpURLConnection conn) throws IOException {
  final List<String> contentEncodingValues=conn.getHeaderFields().get("String_Node_Str");
  if (contentEncodingValues != null) {
    for (    final String contentEncoding : contentEncodingValues) {
      if (contentEncoding != null) {
        if (contentEncoding.contains("String_Node_Str")) {
          return new GZIPInputStream(conn.getErrorStream());
        }
        if (contentEncoding.contains("String_Node_Str")) {
          return new InflaterInputStream(conn.getErrorStream(),new Inflater(true));
        }
      }
    }
  }
  return conn.getInputStream();
}

Fixed version (ground truth):
/** 
 * Open the error   {@link InputStream} of an Http response. This methodsupports GZIP and DEFLATE responses.
 */
private static InputStream getErrorStream(HttpURLConnection conn) throws IOException {
  final List<String> contentEncodingValues=conn.getHeaderFields().get("String_Node_Str");
  if (contentEncodingValues != null) {
    for (    final String contentEncoding : contentEncodingValues) {
      if (contentEncoding != null) {
        if (contentEncoding.contains("String_Node_Str")) {
          return new GZIPInputStream(conn.getErrorStream());
        }
        if (contentEncoding.contains("String_Node_Str")) {
          return new InflaterInputStream(conn.getErrorStream(),new Inflater(true));
        }
      }
    }
  }
  return conn.getErrorStream();
}
Program: 10574
Project: 10574
Buggy source:
@Override public void onContentChanged(){
  if (!mEnsureInflating) {
    super.onContentChanged();
  }
}

Fixed version (ground truth):
@Override public void onContentChanged(){
  if (!mIsEnsureInflating) {
    super.onContentChanged();
  }
}
Program: 10576
Project: 10576
Buggy source:
@Smoke public void testMenuItemStringTitle(){
  String expected=getActivity().getStringTitle();
  CharSequence actual=getActivity().getStringMenuItem().getTitle();
  assertNotNull(actual);
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Smoke public void testMenuItemStringTitle(){
  String expected=getActivity().getStringTitle();
  MenuItem stringMenuItem=getActivity().getStringMenuItem();
  assertNotNull(stringMenuItem);
  CharSequence actual=stringMenuItem.getTitle();
  assertNotNull(actual);
  assertEquals(expected,actual);
}
Program: 10577
Project: 10577
Buggy source:
@Smoke public void testMenuItemResourceTitle(){
  String expected=getActivity().getResourceTitle();
  CharSequence actual=getActivity().getResourceMenuItem().getTitle();
  assertNotNull(actual);
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Smoke public void testMenuItemResourceTitle(){
  String expected=getActivity().getResourceTitle();
  MenuItem resourceMenuItem=getActivity().getResourceMenuItem();
  assertNotNull(resourceMenuItem);
  CharSequence actual=resourceMenuItem.getTitle();
  assertNotNull(actual);
  assertEquals(expected,actual);
}
Program: 10578
Project: 10578
Buggy source:
private void sendUiMessage(String str){
  String gcodeComment="String_Node_Str";
  int startComment=str.indexOf("String_Node_Str");
  int endComment=str.indexOf("String_Node_Str");
  for (int i=startComment; i <= endComment; i++) {
    gcodeComment+=str.charAt(i);
  }
  Main.postConsoleMessage("String_Node_Str" + gcodeComment + "String_Node_Str");
}

Fixed version (ground truth):
private void sendUiMessage(String str){
  String gcodeComment="String_Node_Str";
  int startComment=str.indexOf("String_Node_Str");
  int endComment=str.indexOf("String_Node_Str");
  for (int i=startComment; i <= endComment; i++) {
    gcodeComment+=str.charAt(i);
  }
  Main.postConsoleMessage("String_Node_Str" + gcodeComment);
}
Program: 10580
Project: 10580
Buggy source:
public void onDisconnectActions(){
  TinygDriver.getInstance().m.setFirmwareBuild(0.0);
  TinygDriver.getInstance().m.firmwareBuild.set(0);
  TinygDriver.getInstance().m.firmwareVersion.set("String_Node_Str");
  TinygDriver.getInstance().m.m_state.set("String_Node_Str");
  TinygDriver.getInstance().m.setLineNumber(0);
  TinygDriver.getInstance().m.setMotionMode(0);
  Draw2d.setFirstDraw(true);
  TinygDriver.getInstance().serialWriter.resetBuffer();
  tgfx.ui.gcode.GcodeTabController.setCNCMachineVisible(false);
  TinygDriver.getInstance().serialWriter.clearQueueBuffer();
  TinygDriver.getInstance().serialWriter.notifyAck();
  buildChecked=false;
}

Fixed version (ground truth):
public void onDisconnectActions(){
  TinygDriver.getInstance().m.setFirmwareBuild(0.0);
  TinygDriver.getInstance().m.firmwareBuild.set(0);
  TinygDriver.getInstance().m.firmwareVersion.set("String_Node_Str");
  TinygDriver.getInstance().m.m_state.set("String_Node_Str");
  TinygDriver.getInstance().m.setLineNumber(0);
  TinygDriver.getInstance().m.setMotionMode(0);
  Draw2d.setFirstDraw(true);
  tgfx.ui.gcode.GcodeTabController.setCNCMachineVisible(false);
  TinygDriver.getInstance().serialWriter.resetBuffer();
  TinygDriver.getInstance().serialWriter.clearQueueBuffer();
  TinygDriver.getInstance().serialWriter.notifyAck();
  buildChecked=false;
}
Program: 10581
Project: 10581
Buggy source:
/** 
 * These are the actions that need to be ran upon successful serial port connection. If you have something that you want to "auto run" on connect. // * This is the place to do so. This met0 hod is called in handleConnect.
 */
private void onConnectActions(){
  try {
    Platform.runLater(new Runnable(){
      @Override public void run(){
        try {
          TinygDriver.getInstance().write(CommandManager.CMD_QUERY_HARDWARE_BUILD_NUMBER);
          postConsoleMessage("String_Node_Str");
        }
 catch (        Exception ex) {
          logger.error("String_Node_Str" + ex.getMessage());
        }
      }
    }
);
  }
 catch (  Exception ex) {
    postConsoleMessage("String_Node_Str" + ex.getMessage());
    System.out.println(ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * These are the actions that need to be ran upon successful serial port connection. If you have something that you want to "auto run" on connect. // * This is the place to do so. This met0 hod is called in handleConnect.
 */
private void onConnectActions(){
  try {
    Platform.runLater(new Runnable(){
      @Override public void run(){
        try {
          TinygDriver.getInstance().serialWriter.resetBuffer();
          TinygDriver.getInstance().serialWriter.clearQueueBuffer();
          TinygDriver.getInstance().serialWriter.notifyAck();
          TinygDriver.getInstance().write(CommandManager.CMD_QUERY_HARDWARE_BUILD_NUMBER);
          postConsoleMessage("String_Node_Str");
        }
 catch (        Exception ex) {
          logger.error("String_Node_Str" + ex.getMessage());
        }
      }
    }
);
  }
 catch (  Exception ex) {
    postConsoleMessage("String_Node_Str" + ex.getMessage());
    System.out.println(ex.getMessage());
  }
}
Program: 10582
Project: 10582
Buggy source:
@Override public void setContainerDataSource(Container newDataSource){
  super.setContainerDataSource(newDataSource);
  resetFilters();
}

Fixed version (ground truth):
@Override public void setContainerDataSource(Container newDataSource,Collection<?> visibleIds){
  super.setContainerDataSource(newDataSource,visibleIds);
  resetFilters();
}
Program: 10583
Project: 10583
Buggy source:
@Override public void setContainerDataSource(Container newDataSource){
  super.setContainerDataSource(newDataSource);
  resetFilters();
}

Fixed version (ground truth):
@Override public void setContainerDataSource(Container newDataSource,Collection<?> visibleIds){
  super.setContainerDataSource(newDataSource,visibleIds);
  resetFilters();
}
Program: 10584
Project: 10584
Buggy source:
public void removeValueChangeListeners(){
  for (  AbstractField<?> af : customFields.keySet()) {
    af.removeValueChangeListener(listener);
  }
  for (  TextField tf : texts.keySet()) {
    tf.removeValueChangeListener(listener);
  }
  for (  ComboBox cb : enums.keySet()) {
    cb.removeValueChangeListener(listener);
  }
  for (  ComboBox cb : booleans.keySet()) {
    cb.removeValueChangeListener(listener);
  }
  for (  DateFilterPopup dfp : dates.keySet()) {
    dfp.removeValueChangeListener(listener);
  }
  for (  NumberFilterPopup nfp : numbers.keySet()) {
    nfp.removeValueChangeListener(listener);
  }
}

Fixed version (ground truth):
private void removeValueChangeListeners(){
  for (  AbstractField<?> af : customFields.keySet()) {
    af.removeValueChangeListener(listener);
  }
  for (  TextField tf : texts.keySet()) {
    tf.removeValueChangeListener(listener);
  }
  for (  ComboBox cb : enums.keySet()) {
    cb.removeValueChangeListener(listener);
  }
  for (  ComboBox cb : booleans.keySet()) {
    cb.removeValueChangeListener(listener);
  }
  for (  DateFilterPopup dfp : dates.keySet()) {
    dfp.removeValueChangeListener(listener);
  }
  for (  NumberFilterPopup nfp : numbers.keySet()) {
    nfp.removeValueChangeListener(listener);
  }
}
Program: 10585
Project: 10585
Buggy source:
public void switchToOnDemandMode(){
  runFiltersOnDemand=true;
  clearFilterData();
  initializeFilterFields();
  removeValueChangeListeners();
}

Fixed version (ground truth):
void switchToOnDemandMode(){
  runFiltersOnDemand=true;
  clearFilterData();
  initializeFilterFields();
}
Program: 10586
Project: 10586
Buggy source:
public void switchToOnlineMode(){
  runFiltersOnDemand=false;
  clearFilterData();
  initializeFilterFields();
}

Fixed version (ground truth):
void switchToOnlineMode(){
  runFiltersOnDemand=false;
  clearFilterData();
  initializeFilterFields();
}
Program: 10587
Project: 10587
Buggy source:
void initializeFilterFields(){
  if (owner.getFilterable() != null) {
    for (    Object property : owner.getVisibleColumns()) {
      if (owner.getContainerPropertyIds().contains(property)) {
        AbstractField<?> filter=createField(property,owner.getContainerDataSource().getType(property));
        if (!owner.isFiltersRunOnDemand()) {
          filter.addValueChangeListener(listener);
        }
        filter.addValueChangeListener(listener);
        addFilterColumn(property,filter);
      }
 else {
        AbstractField<?> filter=createField(property,null);
        if (!owner.isFiltersRunOnDemand()) {
          filter.addValueChangeListener(listener);
        }
        addFilterColumn(property,filter);
      }
    }
  }
}

Fixed version (ground truth):
void initializeFilterFields(){
  if (owner.getFilterable() != null) {
    for (    Object property : owner.getVisibleColumns()) {
      if (owner.getContainerPropertyIds().contains(property)) {
        AbstractField<?> filter=createField(property,owner.getContainerDataSource().getType(property));
        addFilterColumn(property,filter);
      }
 else {
        AbstractField<?> filter=createField(property,null);
        addFilterColumn(property,filter);
      }
    }
    if (!runFiltersOnDemand) {
      addValueChangeListeners();
    }
  }
}
Program: 10588
Project: 10588
Buggy source:
private AbstractField<?> createField(Object property,Class<?> type){
  AbstractField<?> field=null;
  if (owner.getFilterGenerator() != null) {
    field=owner.getFilterGenerator().getCustomFilterComponent(property);
  }
  if (field != null) {
    customFields.put(field,property);
  }
 else   if (type == null) {
    field=new TextField();
    field.setWidth(100,Unit.PERCENTAGE);
    return field;
  }
 else   if (type == boolean.class || type == Boolean.class) {
    field=createBooleanField(property);
  }
 else   if (type.isEnum()) {
    field=createEnumField(type,property);
  }
 else   if (type == Date.class || type == Timestamp.class || type == java.sql.Date.class) {
    DateFilterPopup dfp=createDateField(property);
    dfp.setWidth(100,Unit.PERCENTAGE);
    dfp.setImmediate(true);
    dfp.addValueChangeListener(listener);
    return dfp;
  }
 else   if ((type == Integer.class || type == Long.class || type == Float.class || type == Double.class || type == Short.class || type == Byte.class || type == int.class || type == long.class || type == float.class || type == double.class || type == short.class || type == byte.class) && owner.getFilterDecorator() != null && owner.getFilterDecorator().usePopupForNumericProperty(property)) {
    NumberFilterPopup nfp=createNumericField(type,property);
    nfp.setWidth(100,Unit.PERCENTAGE);
    nfp.setImmediate(true);
    nfp.addValueChangeListener(listener);
    return nfp;
  }
 else {
    field=createTextField(property);
  }
  field.setWidth(null);
  field.setImmediate(true);
  field.addValueChangeListener(listener);
  return field;
}

Fixed version (ground truth):
private AbstractField<?> createField(Object property,Class<?> type){
  AbstractField<?> field=null;
  if (owner.getFilterGenerator() != null) {
    field=owner.getFilterGenerator().getCustomFilterComponent(property);
  }
  if (field != null) {
    customFields.put(field,property);
  }
 else   if (type == null) {
    field=new TextField();
    field.setWidth(100,Unit.PERCENTAGE);
    return field;
  }
 else   if (type == boolean.class || type == Boolean.class) {
    field=createBooleanField(property);
  }
 else   if (type.isEnum()) {
    field=createEnumField(type,property);
  }
 else   if (type == Date.class || type == Timestamp.class || type == java.sql.Date.class) {
    DateFilterPopup dfp=createDateField(property);
    dfp.setWidth(100,Unit.PERCENTAGE);
    dfp.setImmediate(true);
    return dfp;
  }
 else   if ((type == Integer.class || type == Long.class || type == Float.class || type == Double.class || type == Short.class || type == Byte.class || type == int.class || type == long.class || type == float.class || type == double.class || type == short.class || type == byte.class) && owner.getFilterDecorator() != null && owner.getFilterDecorator().usePopupForNumericProperty(property)) {
    NumberFilterPopup nfp=createNumericField(type,property);
    nfp.setWidth(100,Unit.PERCENTAGE);
    nfp.setImmediate(true);
    return nfp;
  }
 else {
    field=createTextField(property);
  }
  field.setWidth(null);
  field.setImmediate(true);
  return field;
}
Program: 10589
Project: 10589
Buggy source:
@Override public boolean isFiltersRunOnDemand(){
  return filtersRunOnDemand;
}

Fixed version (ground truth):
public boolean isFiltersRunOnDemand(){
  return filtersRunOnDemand;
}
Program: 10590
Project: 10590
Buggy source:
public void setFiltersRunOnDemand(boolean filtersRunOnDemand){
  if (this.filtersRunOnDemand == filtersRunOnDemand) {
    return;
  }
  this.filtersRunOnDemand=filtersRunOnDemand;
  if (filtersRunOnDemand) {
    generator.switchToOnDemandMode();
  }
 else {
    generator.switchToOnlineMode();
  }
}

Fixed version (ground truth):
public void setFiltersRunOnDemand(boolean filtersRunOnDemand){
  if (this.filtersRunOnDemand == filtersRunOnDemand) {
    return;
  }
  this.filtersRunOnDemand=filtersRunOnDemand;
  reRenderFilterFields=true;
  if (filtersRunOnDemand) {
    generator.switchToOnDemandMode();
  }
 else {
    generator.switchToOnlineMode();
  }
}
Program: 10591
Project: 10591
Buggy source:
@Override public boolean isFiltersRunOnDemand(){
  throw new UnsupportedOperationException("String_Node_Str" + getClass().getCanonicalName());
}

Fixed version (ground truth):
public boolean isFiltersRunOnDemand(){
  return false;
}
Program: 10592
Project: 10592
Buggy source:
/** 
 * Resets all filters. Note: Recreates the filter fields also!
 */
public void resetFilters(){
  if (initDone) {
    for (    Component c : columnIdToFilterMap.values()) {
      c.setParent(null);
    }
    collapsedColumnIds.clear();
    columnIdToFilterMap.clear();
    generator.clearFilterData();
    generator.initializeFilterFields();
    reRenderFilterFields=true;
  }
}

Fixed version (ground truth):
/** 
 * Resets all filters. Note: Recreates the filter fields also!
 */
public void resetFilters(){
  if (initDone) {
    disableContentRefreshing();
    for (    Component c : columnIdToFilterMap.values()) {
      c.setParent(null);
    }
    collapsedColumnIds.clear();
    columnIdToFilterMap.clear();
    generator.clearFilterData();
    generator.initializeFilterFields();
    reRenderFilterFields=true;
    enableContentRefreshing(true);
  }
}
Program: 10593
Project: 10593
Buggy source:
private void removeFilter(Object propertyId){
  if (filters.get(propertyId) != null) {
    owner.getFilterable().removeContainerFilter(filters.get(propertyId));
    filters.remove(propertyId);
  }
}

Fixed version (ground truth):
private void removeFilter(Object propertyId){
  if (filters.get(propertyId) != null) {
    if (owner.getFilterable() != null) {
      owner.getFilterable().removeContainerFilter(filters.get(propertyId));
    }
    filters.remove(propertyId);
  }
}
Program: 10594
Project: 10594
Buggy source:
void clearFilterData(){
  owner.setRefreshingEnabled(false);
  for (  Object propertyId : filters.keySet()) {
    owner.getFilterable().removeContainerFilter(filters.get(propertyId));
    if (owner.getFilterGenerator() != null) {
      owner.getFilterGenerator().filterRemoved(propertyId);
    }
  }
  removeValueChangeListeners();
  customFields.clear();
  filters.clear();
  texts.clear();
  enums.clear();
  booleans.clear();
  dates.clear();
  numbers.clear();
  owner.setRefreshingEnabled(true);
  owner.getFilterable().removeContainerFilter(lastOnDemandFilter);
}

Fixed version (ground truth):
void clearFilterData(){
  owner.setRefreshingEnabled(false);
  for (  Object propertyId : filters.keySet()) {
    if (owner.getFilterable() != null) {
      owner.getFilterable().removeContainerFilter(filters.get(propertyId));
    }
    if (owner.getFilterGenerator() != null) {
      owner.getFilterGenerator().filterRemoved(propertyId);
    }
  }
  removeValueChangeListeners();
  customFields.clear();
  filters.clear();
  texts.clear();
  enums.clear();
  booleans.clear();
  dates.clear();
  numbers.clear();
  owner.setRefreshingEnabled(true);
  if (owner.getFilterable() != null) {
    owner.getFilterable().removeContainerFilter(lastOnDemandFilter);
  }
}
Program: 10595
Project: 10595
Buggy source:
public void runFiltersNow(){
  owner.setRefreshingEnabled(false);
  owner.getFilterable().removeContainerFilter(lastOnDemandFilter);
  List<Filter> filters=new ArrayList<Filter>();
  for (  AbstractField<?> f : customFields.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : texts.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : dates.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : numbers.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : enums.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : booleans.keySet()) {
    addNonNullFilter(filters,f);
  }
  Filter[] filtersArray=filters.toArray(new Filter[0]);
  lastOnDemandFilter=new And(filtersArray);
  owner.getFilterable().addContainerFilter(lastOnDemandFilter);
  owner.setRefreshingEnabled(true);
}

Fixed version (ground truth):
public void runFiltersNow(){
  owner.setRefreshingEnabled(false);
  if (owner.getFilterable() != null) {
    owner.getFilterable().removeContainerFilter(lastOnDemandFilter);
  }
  List<Filter> filters=new ArrayList<Filter>();
  for (  AbstractField<?> f : customFields.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : texts.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : dates.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : numbers.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : enums.keySet()) {
    addNonNullFilter(filters,f);
  }
  for (  AbstractField<?> f : booleans.keySet()) {
    addNonNullFilter(filters,f);
  }
  Filter[] filtersArray=filters.toArray(new Filter[0]);
  lastOnDemandFilter=new And(filtersArray);
  if (owner.getFilterable() != null) {
    owner.getFilterable().addContainerFilter(lastOnDemandFilter);
  }
  owner.setRefreshingEnabled(true);
}
Program: 10596
Project: 10596
Buggy source:
private void setFilter(Filter filter,Object propertyId){
  owner.getFilterable().addContainerFilter(filter);
  filters.put(propertyId,filter);
}

Fixed version (ground truth):
private void setFilter(Filter filter,Object propertyId){
  if (owner.getFilterable() != null) {
    owner.getFilterable().addContainerFilter(filter);
  }
  filters.put(propertyId,filter);
}
Program: 10597
Project: 10597
Buggy source:
protected void setContainerHeight(){
  if (!isDynamicHeight()) {
    if (BrowserInfo.get().isAndroid23()) {
      getElement().getStyle().setDisplay(Display.BLOCK);
    }
    containerHeight=getOffsetHeight();
    containerHeight-=showColHeaders ? tHead.getOffsetHeight() : 0;
    containerHeight-=tFoot.getOffsetHeight();
    containerHeight-=getContentAreaBorderHeight();
    if (containerHeight < 0) {
      containerHeight=0;
    }
    scrollBodyPanel.setHeight(containerHeight + "String_Node_Str");
    if (BrowserInfo.get().isAndroid23()) {
      getElement().getStyle().clearDisplay();
    }
  }
}

Fixed version (ground truth):
public void setContainerHeight(){
  if (!isDynamicHeight()) {
    if (BrowserInfo.get().isAndroid23()) {
      getElement().getStyle().setDisplay(Display.BLOCK);
    }
    calculateContainerHeight();
    scrollBodyPanel.setHeight(containerHeight + "String_Node_Str");
    if (BrowserInfo.get().isAndroid23()) {
      getElement().getStyle().clearDisplay();
    }
  }
}
Program: 10598
Project: 10598
Buggy source:
@Override protected void setColWidth(int colIndex,int w,boolean isDefinedWidth){
  super.setColWidth(colIndex,w,isDefinedWidth);
  columnWidths.put(colIndex,w);
  filters.setFilterWidth(colIndex,w);
}

Fixed version (ground truth):
@Override protected void setColWidth(int colIndex,int w,boolean isDefinedWidth){
  super.setColWidth(colIndex,w,isDefinedWidth);
  filters.setFilterWidth(colIndex);
}
Program: 10599
Project: 10599
Buggy source:
void reRenderFilterComponents(){
  container.clear();
  for (int i=0; i < tHead.getVisibleCellCount(); i++) {
    String key=getColKeyByIndex(i);
    if (key == null) {
      continue;
    }
    Widget widget=filters.get(key);
    if (widget == null) {
      Widget placeHolder=new FlowPanel();
      placeHolder.addStyleName("String_Node_Str");
      container.add(placeHolder);
      filters.put(key,placeHolder);
      setFilterWidth(i,getColWidth(key));
    }
 else {
      container.add(widget);
      setFilterWidth(i,getColWidth(key));
    }
  }
}

Fixed version (ground truth):
void reRenderFilterComponents(){
  container.clear();
  for (int i=0; i < tHead.getVisibleCellCount(); i++) {
    String key=getColKeyByIndex(i);
    if (key == null) {
      continue;
    }
    Widget widget=filters.get(key);
    if (widget == null) {
      Widget placeHolder=new FlowPanel();
      placeHolder.addStyleName("String_Node_Str");
      container.add(placeHolder);
      filters.put(key,placeHolder);
      setFilterWidth(i);
    }
 else {
      container.add(widget);
      setFilterWidth(i);
    }
  }
}
Program: 10600
Project: 10600
Buggy source:
private void setFilterWidth(int index,int width){
  Widget p=filters.get(getColKeyByIndex(index));
  if (p != null) {
    p.setWidth(Util.getRequiredWidth(tHead.getHeaderCell(index)) + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void setFilterWidth(int index){
  Widget p=filters.get(getColKeyByIndex(index));
  if (p != null) {
    int w=Util.getRequiredWidth(tHead.getHeaderCell(index));
    if (w <= 0) {
      VScrollTableRow firstRow=scrollBody.getRowByRowIndex(scrollBody.getFirstRendered());
      final Element cell=DOM.getChild(firstRow.getElement(),index);
      w=Util.getRequiredWidth(cell);
    }
    w=w > 0 ? w : 0;
    p.setWidth(w + "String_Node_Str");
  }
}
Program: 10601
Project: 10601
Buggy source:
public void resetFilterWidths(){
  for (int i=0; i < tHead.getVisibleCellCount(); i++) {
    String key=getColKeyByIndex(i);
    if (key == null) {
      continue;
    }
    setFilterWidth(i,getColWidth(key));
  }
}

Fixed version (ground truth):
public void resetFilterWidths(){
  for (int i=0; i < tHead.getVisibleCellCount(); i++) {
    setFilterWidth(i);
  }
}
Program: 10602
Project: 10602
Buggy source:
public VFilterTable(){
  super();
  filters=new FilterPanel();
  insert(filters,1);
}

Fixed version (ground truth):
public VFilterTable(){
  super();
  filters=new FilterPanel();
  insert(filters,1);
  filters.getElement().getStyle().setDisplay(Display.NONE);
}
Program: 10603
Project: 10603
Buggy source:
@Override protected void setContentWidth(int pixels){
  super.setContentWidth(pixels);
  filters.setWidth(pixels + "String_Node_Str");
}

Fixed version (ground truth):
@Override protected void setContentWidth(int pixels){
  filters.setWidth(pixels + "String_Node_Str");
  super.setContentWidth(pixels);
}
Program: 10604
Project: 10604
Buggy source:
@Override public void paintContent(PaintTarget target) throws PaintException {
  super.paintContent(target);
  target.startTag("String_Node_Str");
  target.addAttribute("String_Node_Str",filtersVisible);
  if (filtersVisible) {
    for (    Object key : getColumnIdToFilterMap().keySet()) {
      if (collapsedColumnIds.contains(key) || !getContainerDataSource().getContainerPropertyIds().contains(key) || columnIdsOfHiddenFilters.contains(key)) {
        continue;
      }
      target.startTag("String_Node_Str" + columnIdMap.key(key));
      target.addAttribute("String_Node_Str",columnIdMap.key(key));
      Component c=getColumnIdToFilterMap().get(key);
      LegacyPaint.paint(c,target);
      target.endTag("String_Node_Str" + columnIdMap.key(key));
    }
  }
  target.endTag("String_Node_Str");
}

Fixed version (ground truth):
@Override public void paintContent(PaintTarget target) throws PaintException {
  super.paintContent(target);
  target.startTag("String_Node_Str");
  target.addAttribute("String_Node_Str",filtersVisible);
  target.addAttribute("String_Node_Str",reRenderFilterFields);
  reRenderFilterFields=false;
  if (filtersVisible) {
    for (    Object key : getColumnIdToFilterMap().keySet()) {
      if (collapsedColumnIds.contains(key) || !getContainerDataSource().getContainerPropertyIds().contains(key) || columnIdsOfHiddenFilters.contains(key)) {
        continue;
      }
      target.startTag("String_Node_Str" + columnIdMap.key(key));
      target.addAttribute("String_Node_Str",columnIdMap.key(key));
      Component c=getColumnIdToFilterMap().get(key);
      LegacyPaint.paint(c,target);
      target.endTag("String_Node_Str" + columnIdMap.key(key));
    }
  }
  target.endTag("String_Node_Str");
}
Program: 10605
Project: 10605
Buggy source:
/** 
 * Sets the Filter bar visible or hidden.
 * @param filtersVisible true to set the Filter bar visible.
 */
public void setFilterBarVisible(boolean filtersVisible){
  this.filtersVisible=filtersVisible;
  markAsDirty();
}

Fixed version (ground truth):
/** 
 * Sets the Filter bar visible or hidden.
 * @param filtersVisible true to set the Filter bar visible.
 */
public void setFilterBarVisible(boolean filtersVisible){
  this.filtersVisible=filtersVisible;
  reRenderFilterFields=true;
  markAsDirty();
}
Program: 10606
Project: 10606
Buggy source:
/** 
 * Resets all filters. Note: Recreates the filter fields also!
 */
public void resetFilters(){
  if (initDone) {
    for (    Component c : columnIdToFilterMap.values()) {
      c.setParent(null);
    }
    collapsedColumnIds.clear();
    columnIdToFilterMap.clear();
    columnIdsOfHiddenFilters.clear();
    generator.clearFilterData();
    generator.initializeFilterFields();
  }
}

Fixed version (ground truth):
/** 
 * Resets all filters. Note: Recreates the filter fields also!
 */
public void resetFilters(){
  if (initDone) {
    for (    Component c : columnIdToFilterMap.values()) {
      c.setParent(null);
    }
    collapsedColumnIds.clear();
    columnIdToFilterMap.clear();
    columnIdsOfHiddenFilters.clear();
    generator.clearFilterData();
    generator.initializeFilterFields();
    reRenderFilterFields=true;
  }
}
Program: 10607
Project: 10607
Buggy source:
/** 
 * Toggles the visibility of the filter field defined for the give column ID.
 * @param columnId Column/Property ID of the filter to toggle
 * @param visible true to set visible, false to set hidden
 */
public void setFilterFieldVisible(Object columnId,boolean visible){
  int previousSize=columnIdsOfHiddenFilters.size();
  if (visible) {
    columnIdsOfHiddenFilters.remove(columnId);
  }
 else {
    columnIdsOfHiddenFilters.add(columnId);
  }
  if (columnIdsOfHiddenFilters.size() != previousSize) {
    markAsDirty();
  }
}

Fixed version (ground truth):
/** 
 * Toggles the visibility of the filter field defined for the give column ID.
 * @param columnId Column/Property ID of the filter to toggle
 * @param visible true to set visible, false to set hidden
 */
public void setFilterFieldVisible(Object columnId,boolean visible){
  Component component=columnIdToFilterMap.get(columnId);
  if (component != null) {
    component.setVisible(visible);
    reRenderFilterFields=true;
  }
}
Program: 10608
Project: 10608
Buggy source:
/** 
 * Returns visibility state of the filter field for the given column ID
 * @param columnId Column/Property ID of the filter field to query
 * @return true if filter is visible, false if it's hidden
 */
public boolean isFilterFieldVisible(Object columnId){
  if (!getContainerDataSource().getContainerPropertyIds().contains(columnId)) {
    return false;
  }
  return !columnIdsOfHiddenFilters.contains(columnId);
}

Fixed version (ground truth):
/** 
 * Returns visibility state of the filter field for the given column ID
 * @param columnId Column/Property ID of the filter field to query
 * @return true if filter is visible, false if it's hidden
 */
public boolean isFilterFieldVisible(Object columnId){
  if (!getContainerDataSource().getContainerPropertyIds().contains(columnId)) {
    return false;
  }
  Component component=columnIdToFilterMap.get(columnId);
  if (component != null) {
    return component.isVisible();
  }
  return false;
}