nus-yam/ex-repair huggingface dataset:
Program: 26159
Project: 26159
Buggy source:
/** 
 * Converts the uris to vertices. Omits uris that cannot be found in the provided graph.
 */
public static List<Vertex> verticesByUri(Graph graph,Collection<String> uris){
  List<Vertex> vertices=new LinkedList<Vertex>();
  for (  String uri : uris) {
    Vertex v=vertexByUri(graph,uri);
    if (v != null)     vertices.add(v);
  }
  return vertices;
}

Fixed version (ground truth):
/** 
 * Converts the uris to vertices. Omits uris that cannot be found in the provided graph.
 */
public static List<Vertex> verticesByUri(Graph graph,Collection<String> uris){
  List<Vertex> vertices=new LinkedList<Vertex>();
  for (  String uri : uris) {
    Vertex v=vertexByUri(graph,uri);
    if (v != null)     vertices.add(v);
 else     logger.warn("String_Node_Str",uri);
  }
  return vertices;
}
Program: 26160
Project: 26160
Buggy source:
public static void main(String[] args) throws IOException, URISyntaxException {
  dbpediaDemo();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, URISyntaxException {
  String sensesFileName="String_Node_Str";
  Collection<SurfaceFormSenses<DefaultSurfaceForm,DefaultSense>> wordsSensesString=ModelTransformer.surfaceFormsSensesFromFile(DemoSubgraphConstruction.class,sensesFileName,GraphConfig.DBPEDIA_RESOURCE_PREFIX,factory);
  Graph graph=GraphFactory.getDBpediaGraph();
  demo(graph,wordsSensesString);
}
Program: 26161
Project: 26161
Buggy source:
public static <T extends SurfaceForm,U extends Sense>Collection<Vertex> verticesFromSenses(Graph graph,SurfaceFormSenses<T,U> surfaceFormSenses){
  Collection<Vertex> vertices=new ArrayList<>(surfaceFormSenses.getSenses().size());
  for (  Sense sense : surfaceFormSenses.getSenses())   vertices.add(Graphs.vertexByUri(graph,sense.fullUri()));
  return vertices;
}

Fixed version (ground truth):
public static <T extends SurfaceForm,U extends Sense>Collection<Vertex> verticesFromSenses(Graph graph,SurfaceFormSenses<T,U> surfaceFormSenses){
  Collection<Vertex> vertices=new ArrayList<>(surfaceFormSenses.getSenses().size());
  for (  Sense sense : surfaceFormSenses.getSenses()) {
    Vertex v=Graphs.vertexByUri(graph,sense.fullUri());
    if (v != null)     vertices.add(v);
 else     logger.warn("String_Node_Str",sense.fullUri());
  }
  return vertices;
}
Program: 26162
Project: 26162
Buggy source:
/** 
 * Read all lines from a file and return all non-empty and non-comment lines (comment lines start with '#').
 * @param clazz the class whose classpath will be used.
 */
public static List<String> readRelevantLinesFromFile(Class<?> clazz,String fileName) throws IOException, URISyntaxException {
  URL url=clazz.getResource(fileName);
  if (url == null)   throw new IllegalArgumentException("String_Node_Str" + fileName);
  List<String> lines=Files.readAllLines(Paths.get(url.toURI()),StandardCharsets.UTF_8);
  Iterator<String> iter=lines.iterator();
  while (iter.hasNext()) {
    String line=iter.next();
    if (line.isEmpty() || line.startsWith("String_Node_Str"))     iter.remove();
  }
  return lines;
}

Fixed version (ground truth):
/** 
 * Read all lines from a file and return all non-empty and non-comment lines (comment lines start with '#').
 * @param clazz the class whose classpath will be used.
 */
public static List<String> readRelevantLinesFromFile(Class<?> clazz,String fileName) throws IOException, URISyntaxException {
  URL url=clazz.getResource(fileName);
  if (url == null)   throw new IllegalArgumentException("String_Node_Str" + fileName);
  List<String> lines=Files.readAllLines(Paths.get(url.toURI()),StandardCharsets.UTF_8);
  Iterator<String> iter=lines.iterator();
  while (iter.hasNext()) {
    String line=iter.next();
    if (line.trim().isEmpty() || line.startsWith("String_Node_Str"))     iter.remove();
  }
  return lines;
}
Program: 26163
Project: 26163
Buggy source:
/** 
 * Open a graph based on configuration settings.
 */
private static TransactionalGraph openGraph(){
  long startTime=System.currentTimeMillis();
  Graph graph=com.tinkerpop.blueprints.GraphFactory.open(GraphConfig.config());
  if (graph instanceof Neo4jGraph) {
    Neo4jGraph nGraph=(Neo4jGraph)graph;
    nGraph.createKeyIndex(GraphConfig.URI_PROPERTY,Vertex.class);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime) / 1000.0);
  if (graph instanceof TransactionalGraph)   return (TransactionalGraph)graph;
 else   throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Open a graph based on configuration settings.
 */
private static TransactionalGraph openGraph(){
  long startTime=System.currentTimeMillis();
  Graph graph=com.tinkerpop.blueprints.GraphFactory.open(GraphConfig.config());
  if (Graphs.isEmptyGraph(graph))   logger.warn(String.format("String_Node_Str",GraphConfig.graphDirectory()));
  if (graph instanceof Neo4jGraph) {
    Neo4jGraph nGraph=(Neo4jGraph)graph;
    nGraph.createKeyIndex(GraphConfig.URI_PROPERTY,Vertex.class);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime) / 1000.0);
  if (graph instanceof TransactionalGraph)   return (TransactionalGraph)graph;
 else   throw new IllegalArgumentException("String_Node_Str");
}
Program: 26164
Project: 26164
Buggy source:
/** 
 * Accessor for the dbpedia graph.
 * @return the dbpedia graph
 */
public static TransactionalGraph getDBpediaGraph(){
  return graph;
}

Fixed version (ground truth):
/** 
 * Accessor for the dbpedia graph.
 * @return the dbpedia graph
 */
public static TransactionalGraph getDBpediaGraph(){
  if (Graphs.isEmptyGraph(graph))   throw new IllegalStateException("String_Node_Str");
  return graph;
}
Program: 26165
Project: 26165
Buggy source:
public static Vertex vertexByUri(Graph graph,String uri){
  String shortUri=UriShortener.shorten(uri);
  List<Vertex> vertices=new LinkedList<Vertex>();
  Iterable<Vertex> verticesIter=graph.getVertices(GraphConfig.URI_PROPERTY,shortUri);
  for (  Vertex v : verticesIter)   vertices.add(v);
  if (vertices.size() == 0)   return null;
  if (vertices.size() > 1) {
    logger.warn("String_Node_Str" + uri);
    for (    Vertex v : vertices) {
      int inDegree=vertexDegree(v,Direction.IN);
      int outDegree=vertexDegree(v,Direction.OUT);
      logger.warn("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY),inDegree,outDegree);
    }
    logger.warn("String_Node_Str");
  }
  return vertices.get(0);
}

Fixed version (ground truth):
public static Vertex vertexByUri(Graph graph,String uri){
  String shortUri=UriShortener.shorten(uri);
  List<Vertex> vertices=new LinkedList<Vertex>();
  Iterable<Vertex> verticesIter=graph.getVertices(GraphConfig.URI_PROPERTY,shortUri);
  for (  Vertex v : verticesIter)   vertices.add(v);
  if (vertices.size() == 0) {
    logger.warn("String_Node_Str",uri);
    return null;
  }
  if (vertices.size() > 1) {
    logger.warn("String_Node_Str",uri);
    for (    Vertex v : vertices) {
      int inDegree=vertexDegree(v,Direction.IN);
      int outDegree=vertexDegree(v,Direction.OUT);
      logger.warn("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY),inDegree,outDegree);
    }
    logger.warn("String_Node_Str");
  }
  return vertices.get(0);
}
Program: 26166
Project: 26166
Buggy source:
public static SubgraphConstruction newDefaultImplementation(Graph graph,SubgraphConstructionSettings settings){
  return newInstance(defaultClass(),settings,graph);
}

Fixed version (ground truth):
public static SubgraphConstruction newDefaultImplementation(SubgraphConstructionSettings settings){
  return newDefaultImplementation(GraphFactory.getDBpediaGraph(),settings);
}
Program: 26167
Project: 26167
Buggy source:
public static void checkValidSenses(Graph graph,Collection<Vertex> senses){
  if (senses == null)   throw new NullPointerException("String_Node_Str");
  if (senses.size() == 0)   throw new IllegalArgumentException("String_Node_Str");
  for (  Vertex v : senses)   if (graph.getVertex(v.getId()) == null)   throw new IllegalArgumentException(String.format("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY)));
}

Fixed version (ground truth):
public static void checkValidSenses(Graph graph,Collection<Vertex> senses){
  if (senses == null)   throw new NullPointerException("String_Node_Str");
  if (senses.size() == 0)   throw new IllegalArgumentException("String_Node_Str");
  for (  Vertex v : senses) {
    if (v == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (graph.getVertex(v.getId()) == null)     throw new IllegalArgumentException(String.format("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY)));
  }
}
Program: 26168
Project: 26168
Buggy source:
public static <T extends SurfaceForm,U extends Sense>Collection<Collection<Vertex>> wordsVerticesFromSenses(Graph graph,Collection<SurfaceFormSenses<T,U>> surfaceFormsSenses){
  Collection<Collection<Vertex>> wordVertices=new ArrayList<>();
  for (  SurfaceFormSenses<T,U> surfaceFormSenses : surfaceFormsSenses) {
    Collection<Vertex> vertices=verticesFromSenses(graph,surfaceFormSenses);
    wordVertices.add(vertices);
  }
  return wordVertices;
}

Fixed version (ground truth):
public static <T extends SurfaceForm,U extends Sense>Collection<Collection<Vertex>> wordsVerticesFromSenses(Graph graph,Collection<SurfaceFormSenses<T,U>> surfaceFormsSenses){
  Collection<Collection<Vertex>> wordVertices=new ArrayList<>();
  for (  SurfaceFormSenses<T,U> surfaceFormSenses : surfaceFormsSenses) {
    Collection<Vertex> vertices=verticesFromSenses(graph,surfaceFormSenses);
    if (!vertices.isEmpty())     wordVertices.add(vertices);
  }
  return wordVertices;
}
Program: 26169
Project: 26169
Buggy source:
public static void checkValidSenses(Graph graph,Collection<Vertex> senses){
  if (senses == null)   throw new NullPointerException("String_Node_Str");
  if (senses.size() == 0)   throw new IllegalArgumentException("String_Node_Str");
  for (  Vertex v : senses) {
    if (v == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (graph.getVertex(v.getId()) == null)     throw new IllegalArgumentException(String.format("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY)));
  }
}

Fixed version (ground truth):
public static void checkValidSenses(Graph graph,Collection<Vertex> senses){
  if (senses == null)   throw new NullPointerException("String_Node_Str");
  for (  Vertex v : senses) {
    if (v == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (graph.getVertex(v.getId()) == null)     throw new IllegalArgumentException(String.format("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY)));
  }
}
Program: 26170
Project: 26170
Buggy source:
public static void checkValidWordsSenses(Graph graph,Collection<Collection<Vertex>> wordsSenses){
  if (wordsSenses == null)   throw new NullPointerException("String_Node_Str");
  if (wordsSenses.size() == 0)   throw new IllegalArgumentException("String_Node_Str");
  for (  Collection<Vertex> senses : wordsSenses)   checkValidSenses(graph,senses);
}

Fixed version (ground truth):
public static void checkValidWordsSenses(Graph graph,Collection<Collection<Vertex>> wordsSenses){
  if (wordsSenses == null)   throw new NullPointerException("String_Node_Str");
  for (  Collection<Vertex> senses : wordsSenses)   checkValidSenses(graph,senses);
}
Program: 26171
Project: 26171
Buggy source:
/** 
 * Creates and returns a graph implementation. The graph is created for batch inserts using the provided buffer size.
 */
public Graph getBatchGraph(long bufferSize){
  return new BatchGraph<TransactionalGraph>(graph,bufferSize);
}

Fixed version (ground truth):
/** 
 * Creates and returns a graph implementation. The graph is created for batch inserts using the provided buffer size.
 */
public Graph getBatchGraph(long bufferSize){
  BatchGraph<TransactionalGraph> bgraph=new BatchGraph<TransactionalGraph>(graph,bufferSize);
  long verticesCount=new GremlinPipeline<Object,Object>(graph.getVertices()).count();
  if (verticesCount != 0) {
    bgraph.setVertexIdKey(GraphConfig.URI_PROPERTY);
    bgraph.setLoadingFromScratch(false);
    logger.info("String_Node_Str",verticesCount);
  }
  return bgraph;
}
Program: 26172
Project: 26172
Buggy source:
/** 
 * Open a graph based on configuration settings.
 */
private TransactionalGraph openGraph(){
  long startTime=System.currentTimeMillis();
  Graph graph=GraphFactory.open(GraphConfig.getInstance().getConfig());
  logger.debug(String.format("String_Node_Str",(System.currentTimeMillis() - startTime) / 1000.0));
  if (graph instanceof TransactionalGraph) {
    return (TransactionalGraph)graph;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Open a graph based on configuration settings.
 */
private TransactionalGraph openGraph(){
  long startTime=System.currentTimeMillis();
  Graph graph=GraphFactory.open(GraphConfig.getInstance().getConfig());
  if (graph instanceof Neo4jGraph) {
    Neo4jGraph nGraph=(Neo4jGraph)graph;
    nGraph.createKeyIndex(GraphConfig.URI_PROPERTY,Vertex.class);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime) / 1000.0);
  if (graph instanceof TransactionalGraph) {
    return (TransactionalGraph)graph;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 26173
Project: 26173
Buggy source:
protected void refreshUI(boolean gameOverNoWinner,GameWinPattern gameWinPattern,GameSymbol winningSymbol,int[] selectedXBoxIds,int[] selectedOBoxIds){
  if (gameWinPattern != null) {
    hapticFeedbackHelper.vibrate(hapticFeedbackHelper.getWinningPattern(toeGame.symbolIsAndroid(winningSymbol)),HapticFeedbackHelper.VIBE_PATTERN_NO_REPEAT);
    disableAllBoxes();
    highlightWinningPattern(gameWinPattern);
    messageTurnIndicatorValue.setText(getString(R.string.game_message_wins,winningSymbol.getValue()));
  }
 else   if (gameOverNoWinner) {
    messageTurnIndicatorValue.setText(getString(R.string.game_message_draw));
  }
 else {
    messageTurnIndicatorValue.setText(toeGame.getTurn().getValue());
    startTurn(selectedXBoxIds,selectedOBoxIds);
  }
}

Fixed version (ground truth):
protected void refreshUI(boolean gameOverNoWinner,GameWinPattern gameWinPattern,GameSymbol winningSymbol,int[] selectedXBoxIds,int[] selectedOBoxIds){
  if (gameWinPattern != null) {
    hapticFeedbackHelper.vibrate(hapticFeedbackHelper.getWinningPattern(toeGame.symbolIsAndroid(winningSymbol)),HapticFeedbackHelper.VIBE_PATTERN_NO_REPEAT);
    disableAllBoxes();
    highlightWinningPattern(gameWinPattern);
    getMessageTurnIndicator.setText(getString(R.string.game_message_over));
    messageTurnIndicatorValue.setText(getString(R.string.game_message_wins,winningSymbol.getValue()));
  }
 else   if (gameOverNoWinner) {
    getMessageTurnIndicator.setText(getString(R.string.game_message_over));
    messageTurnIndicatorValue.setText(getString(R.string.game_message_draw));
  }
 else {
    getMessageTurnIndicator.setText(getString(R.string.message_turn_indicator));
    messageTurnIndicatorValue.setText(toeGame.getTurn().getValue());
    startTurn(selectedXBoxIds,selectedOBoxIds);
  }
}
Program: 26174
Project: 26174
Buggy source:
public int getBoxId(int[] selectedXBoxIds,int[] selectedOBoxIds,GameSymbol androidSymbol){
  Random random=new Random();
  int selectedIndex=random.nextInt(availableBoxes.length - 1);
  return availableBoxes[selectedIndex];
}

Fixed version (ground truth):
public int getBoxId(int[] selectedXBoxIds,int[] selectedOBoxIds,GameSymbol androidSymbol){
  Random random=new Random();
  int max=availableBoxes.length - 1;
  Log.d(Toe.TAG,"String_Node_Str" + max);
  int selectedIndex=max > 0 ? random.nextInt(max) : 0;
  return availableBoxes[selectedIndex];
}
Program: 26177
Project: 26177
Buggy source:
public DownloadCardViewItem(Context context){
  super(context,R.layout.download_cardview);
  headerCardView=new HeaderCardView(context);
  setUpTitle();
}

Fixed version (ground truth):
public DownloadCardViewItem(Context context){
  super(context,R.layout.download_cardview);
}
Program: 26179
Project: 26179
Buggy source:
private void setUpTitle(){
  if (headerCardView != null) {
    if (version == null)     removeHeader();
 else     addHeader(headerCardView);
  }
  if (headerCardView != null && version != null) {
    String text=getContext().getString(R.string.version) + "String_Node_Str" + version;
    if (size != null)     text+="String_Node_Str" + size + "String_Node_Str";
    headerCardView.setText(text);
  }
}

Fixed version (ground truth):
private void setUpTitle(){
  if (downloadHeaderView != null) {
    if (version == null)     removeHeader();
 else     addHeader(downloadHeaderView);
  }
  if (downloadHeaderView != null && version != null) {
    String text=getContext().getString(R.string.version) + "String_Node_Str" + version;
    if (size != null)     text+="String_Node_Str" + size + "String_Node_Str";
    downloadHeaderView.setText(text);
  }
}
Program: 26181
Project: 26181
Buggy source:
@Override public void run(){
  DevicesJson json=Utils.getDevicesJson(getActivity());
  RootUtils.writePartition("String_Node_Str",json.getRecoveryPartition());
  installing=false;
  setTextTitle(getString(R.string.done) + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  Utils.confirmDialog(null,getString(R.string.installation_success),new Utils.OnConfirmDialogListener(){
    @Override public void onDismiss(){
    }
    @Override public void onConfirm(){
      Utils.reboot();
    }
  }
,getActivity());
}
Program: 26182
Project: 26182
Buggy source:
@Override public void onSuccess(){
  new Thread(new Runnable(){
    @Override public void run(){
      int count=0;
      installing=true;
      while (installing) {
        try {
          count++;
          String title=getString(R.string.installing);
          for (int i=0; i < count; i++)           title+="String_Node_Str";
          setTextTitle(title);
          if (count >= 5)           count=0;
          Thread.sleep(500);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
).start();
  new Thread(new Runnable(){
    @Override public void run(){
      DevicesJson json=Utils.getDevicesJson(getActivity());
      RootUtils.writePartition("String_Node_Str",json.getRecoveryPartition());
      installing=false;
      setTextTitle(getString(R.string.done) + "String_Node_Str");
    }
  }
).start();
}

Fixed version (ground truth):
@Override public void onSuccess(){
  new Thread(new Runnable(){
    @Override public void run(){
      int count=0;
      installing=true;
      while (installing) {
        try {
          count++;
          String title=getString(R.string.installing);
          for (int i=0; i < count; i++)           title+="String_Node_Str";
          setTextTitle(title);
          if (count >= 5)           count=0;
          Thread.sleep(500);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
).start();
  new Thread(new Runnable(){
    @Override public void run(){
      DevicesJson json=Utils.getDevicesJson(getActivity());
      RootUtils.writePartition("String_Node_Str",json.getRecoveryPartition());
      installing=false;
      setTextTitle(getString(R.string.done) + "String_Node_Str");
      getActivity().runOnUiThread(new Runnable(){
        @Override public void run(){
          Utils.confirmDialog(null,getString(R.string.installation_success),new Utils.OnConfirmDialogListener(){
            @Override public void onDismiss(){
            }
            @Override public void onConfirm(){
              Utils.reboot();
            }
          }
,getActivity());
        }
      }
);
    }
  }
).start();
}
Program: 26183
Project: 26183
Buggy source:
@Override protected void onPreExecute(){
  super.onPreExecute();
  PowerManager pm=(PowerManager)context.getSystemService(Context.POWER_SERVICE);
  mWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,context.getClass().getName());
  mWakeLock.acquire();
  if (!new File(path).exists())   new File(path).mkdirs();
  LinearLayout layout=new LinearLayout(context);
  layout.setOrientation(LinearLayout.VERTICAL);
  mProgressDialog=new ProgressDialog(context);
  mProgressDialog.setMessage(context.getString(R.string.downloading,file));
  mProgressDialog.setIndeterminate(true);
  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgressDialog.setCancelable(true);
  mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      cancel();
    }
  }
);
  mProgressDialog.setOnDismissListener(new DialogInterface.OnDismissListener(){
    @Override public void onDismiss(    DialogInterface dialog){
      cancel();
    }
  }
);
  mProgressDialog.show();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  super.onPreExecute();
  PowerManager pm=(PowerManager)context.getSystemService(Context.POWER_SERVICE);
  mWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,context.getClass().getName());
  mWakeLock.acquire();
  if (!new File(path).exists())   new File(path).mkdirs();
  LinearLayout layout=new LinearLayout(context);
  layout.setOrientation(LinearLayout.VERTICAL);
  mProgressDialog=new ProgressDialog(context);
  mProgressDialog.setMessage(context.getString(R.string.downloading));
  mProgressDialog.setIndeterminate(true);
  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgressDialog.setCancelable(true);
  mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      cancel();
    }
  }
);
  mProgressDialog.show();
}
Program: 26185
Project: 26185
Buggy source:
/** 
 * @param metric
 * @return
 */
public boolean contains(final Metric metric){
  if (metric == this.rate) {
    return true;
  }
 else   if (this.intervals.values().contains(metric)) {
    return true;
  }
 else   if (this.sinceGauges.contains(metric)) {
    return true;
  }
 else   if (metric == this.timer) {
    return true;
  }
 else   if (this.counters.values().contains(metric)) {
    return true;
  }
 else   if (this.histograms.values().contains(metric)) {
    return true;
  }
 else   if (this.gauges.values().contains(metric)) {
    return true;
  }
 else   if (this.cachedGauges.values().contains(metric)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param metric
 * @return
 */
public boolean contains(final Metric metric){
  if (metric == this.rate) {
    return true;
  }
 else   if (this.intervals.values().contains(metric)) {
    return true;
  }
 else   if (this.sinceGauges.contains(metric)) {
    return true;
  }
 else   if (metric == this.timer) {
    return true;
  }
 else   if (this.counters.values().contains(metric)) {
    return true;
  }
 else   if (this.histograms.values().contains(metric)) {
    return true;
  }
 else   if (this.meters.values().contains(metric)) {
    return true;
  }
 else   if (this.gauges.values().contains(metric)) {
    return true;
  }
 else   if (this.cachedGauges.values().contains(metric)) {
    return true;
  }
  return false;
}
Program: 26186
Project: 26186
Buggy source:
/** 
 * @param cachedGaugeDefinition
 */
public void addCachedGaugeDefinition(final CachedGaugeDefinition cachedGaugeDefinition){
  if (cachedGaugeDefinition != null) {
    String subName=cachedGaugeDefinition.getName();
    if (subName == null) {
      subName=CachedGaugeDefinition.getNextDefaultName();
    }
    String lclName=MetricUtils.calculateFullMetricName(this.fullName,subName);
    LOGGER.debug(MARKER,"String_Node_Str",lclName,cachedGaugeDefinition);
    CachedGauge<Object> cachedGauge=new CachedGauge<Object>(cachedGaugeDefinition.getDuration(),cachedGaugeDefinition.getDurationUnit()){
      @Override protected Object loadValue(){
        if (MetricGroup.this.lastExchange != null) {
          return cachedGaugeDefinition.getExpression().evaluate(MetricGroup.this.lastExchange,Object.class);
        }
 else {
          return null;
        }
      }
    }
;
    this.cachedGauges.put(cachedGaugeDefinition,cachedGauge);
  }
}

Fixed version (ground truth):
/** 
 * @param cachedGaugeDefinition
 */
public void addCachedGaugeDefinition(final CachedGaugeDefinition cachedGaugeDefinition){
  if (cachedGaugeDefinition != null) {
    String subName=cachedGaugeDefinition.getName();
    if (subName == null) {
      subName=CachedGaugeDefinition.getNextDefaultName();
    }
    String lclName=MetricUtils.calculateFullMetricName(this.fullName,subName);
    LOGGER.debug(MARKER,"String_Node_Str",lclName,cachedGaugeDefinition);
    CachedGauge<Object> cachedGauge=new CachedGauge<Object>(cachedGaugeDefinition.getDuration(),cachedGaugeDefinition.getDurationUnit()){
      @Override protected Object loadValue(){
        if (MetricGroup.this.lastExchange != null) {
          return cachedGaugeDefinition.getExpression().evaluate(MetricGroup.this.lastExchange,Object.class);
        }
 else {
          return null;
        }
      }
    }
;
    this.metricRegistry.register(lclName,cachedGauge);
    this.cachedGauges.put(cachedGaugeDefinition,cachedGauge);
  }
}
Program: 26187
Project: 26187
Buggy source:
/** 
 * @param gaugeDefinition
 */
public void addGaugeDefinition(final GaugeDefinition gaugeDefinition){
  if (gaugeDefinition != null) {
    String subName=gaugeDefinition.getName();
    if (subName == null) {
      subName=GaugeDefinition.getNextDefaultName();
    }
    String lclName=MetricUtils.calculateFullMetricName(this.fullName,subName);
    LOGGER.debug(MARKER,"String_Node_Str",lclName,gaugeDefinition);
    Gauge<Object> gauge=new Gauge<Object>(){
      @Override public Object getValue(){
        if (MetricGroup.this.lastExchange != null) {
          return gaugeDefinition.getExpression().evaluate(MetricGroup.this.lastExchange,Object.class);
        }
 else {
          return null;
        }
      }
    }
;
    this.gauges.put(gaugeDefinition,gauge);
  }
}

Fixed version (ground truth):
/** 
 * @param gaugeDefinition
 */
public void addGaugeDefinition(final GaugeDefinition gaugeDefinition){
  if (gaugeDefinition != null) {
    String subName=gaugeDefinition.getName();
    if (subName == null) {
      subName=GaugeDefinition.getNextDefaultName();
    }
    String lclName=MetricUtils.calculateFullMetricName(this.fullName,subName);
    LOGGER.debug(MARKER,"String_Node_Str",lclName,gaugeDefinition);
    Gauge<Object> gauge=new Gauge<Object>(){
      @Override public Object getValue(){
        if (MetricGroup.this.lastExchange != null) {
          return gaugeDefinition.getExpression().evaluate(MetricGroup.this.lastExchange,Object.class);
        }
 else {
          return null;
        }
      }
    }
;
    this.metricRegistry.register(lclName,gauge);
    this.gauges.put(gaugeDefinition,gauge);
  }
}
Program: 26188
Project: 26188
Buggy source:
/** 
 * @param gauges the gauges to set
 */
public void setGauges(final String gauges){
  List<GaugeDefinition> gaugeDefinitions;
  try {
    gaugeDefinitions=GSON.fromJson(gauges,GsonHelper.GAUGE_DEFINITIONS_TYPE);
  }
 catch (  Exception e) {
    GaugeDefinition gaugeDefinition=GSON.fromJson(gauges,GsonHelper.GAUGE_DEFINITION_TYPE);
    gaugeDefinitions=new ArrayList<GaugeDefinition>();
    gaugeDefinitions.add(gaugeDefinition);
  }
  for (  GaugeDefinition gaugeDefinition : this.gaugeDefinitions) {
    gaugeDefinition.createExpression(getCamelContext());
  }
  this.gaugeDefinitions=gaugeDefinitions;
}

Fixed version (ground truth):
/** 
 * @param gauges the gauges to set
 */
public void setGauges(final String gauges){
  List<GaugeDefinition> gaugeDefinitions;
  try {
    gaugeDefinitions=GSON.fromJson(gauges,GsonHelper.GAUGE_DEFINITIONS_TYPE);
  }
 catch (  Exception e) {
    GaugeDefinition gaugeDefinition=GSON.fromJson(gauges,GsonHelper.GAUGE_DEFINITION_TYPE);
    gaugeDefinitions=new ArrayList<GaugeDefinition>();
    gaugeDefinitions.add(gaugeDefinition);
  }
  this.gaugeDefinitions=gaugeDefinitions;
  for (  GaugeDefinition gaugeDefinition : this.gaugeDefinitions) {
    gaugeDefinition.createExpression(getCamelContext());
  }
}
Program: 26189
Project: 26189
Buggy source:
/** 
 * @param cachedGauges the cachedGauges to set
 */
public void setCachedGauges(final String cachedGauges){
  List<CachedGaugeDefinition> cacheGaugeDefinitions;
  try {
    cacheGaugeDefinitions=GSON.fromJson(cachedGauges,CACHED_GAUGE_DEFINITIONS_TYPE);
  }
 catch (  Exception e) {
    CachedGaugeDefinition cachedGaugeDefinition=GSON.fromJson(cachedGauges,CACHED_GAUGE_DEFINITION_TYPE);
    cacheGaugeDefinitions=new ArrayList<CachedGaugeDefinition>();
    cacheGaugeDefinitions.add(cachedGaugeDefinition);
  }
  for (  CachedGaugeDefinition cachedGaugeDefinition : cacheGaugeDefinitions) {
    cachedGaugeDefinition.createExpression(getCamelContext());
  }
  this.cachedGaugeDefinitions=cacheGaugeDefinitions;
}

Fixed version (ground truth):
/** 
 * @param cachedGauges the cachedGauges to set
 */
public void setCachedGauges(final String cachedGauges){
  List<CachedGaugeDefinition> cacheGaugeDefinitions;
  try {
    cacheGaugeDefinitions=GSON.fromJson(cachedGauges,CACHED_GAUGE_DEFINITIONS_TYPE);
  }
 catch (  Exception e) {
    CachedGaugeDefinition cachedGaugeDefinition=GSON.fromJson(cachedGauges,CACHED_GAUGE_DEFINITION_TYPE);
    cacheGaugeDefinitions=new ArrayList<CachedGaugeDefinition>();
    cacheGaugeDefinitions.add(cachedGaugeDefinition);
  }
  this.cachedGaugeDefinitions=cacheGaugeDefinitions;
  for (  CachedGaugeDefinition cachedGaugeDefinition : cacheGaugeDefinitions) {
    cachedGaugeDefinition.createExpression(getCamelContext());
  }
}
Program: 26190
Project: 26190
Buggy source:
/** 
 * @param value
 * @param runtimeValue
 * @param runtimeSimpleValue
 * @param creatingExchange
 * @return
 */
public static String evaluateValue(final String value,final String runtimeValue,final String runtimeSimpleValue,final Exchange creatingExchange){
  final String evaluatedValue;
  if (creatingExchange == null) {
    evaluatedValue=value;
  }
 else {
    if (runtimeSimpleValue == null) {
      evaluatedValue=runtimeValue;
    }
 else {
      evaluatedValue=evaluateExpression(runtimeSimpleValue,creatingExchange,String.class);
    }
  }
  return evaluatedValue;
}

Fixed version (ground truth):
/** 
 * @param value
 * @param runtimeValue
 * @param runtimeSimpleValue
 * @param creatingExchange
 * @return
 */
public static String evaluateValue(final String value,final String runtimeValue,final String runtimeSimpleValue,final Exchange creatingExchange){
  if (creatingExchange != null) {
    final String evaluatedValue;
    if (runtimeSimpleValue == null) {
      evaluatedValue=runtimeValue;
    }
 else {
      evaluatedValue=evaluateExpression(runtimeSimpleValue,creatingExchange,String.class);
    }
    if (evaluatedValue != null) {
      return evaluatedValue;
    }
  }
  return value;
}
Program: 26191
Project: 26191
Buggy source:
/** 
 * @param deltaInNanos
 */
private void updateAllIntervals(final long deltaInNanos){
  for (  Entry<TimeUnit,Histogram> entry : this.intervals.entrySet()) {
    long delta=entry.getKey().convert(deltaInNanos,TimeUnit.NANOSECONDS);
    LOGGER.info("String_Node_Str",entry.getKey(),delta);
    entry.getValue().update(delta);
  }
}

Fixed version (ground truth):
/** 
 * @param deltaInNanos
 */
private void updateAllIntervals(final long deltaInNanos){
  for (  Entry<TimeUnit,Histogram> entry : this.intervals.entrySet()) {
    Histogram histogram=entry.getValue();
    long delta=entry.getKey().convert(deltaInNanos,TimeUnit.NANOSECONDS);
    LOGGER.info("String_Node_Str",entry.getKey(),delta);
    LOGGER.info("String_Node_Str",histogram);
    LOGGER.info("String_Node_Str",histogram.getSnapshot().get99thPercentile());
    histogram.update(delta);
    LOGGER.info("String_Node_Str",histogram.getSnapshot().get99thPercentile());
  }
}
Program: 26192
Project: 26192
Buggy source:
@Override public ConsoleReporterDefinition applyAsOverride(final ConsoleReporterDefinition override){
  ConsoleReporterDefinition consoleReporterDefinition=new ConsoleReporterDefinition();
  consoleReporterDefinition.setName(this.name);
  consoleReporterDefinition.setDurationUnit(this.durationUnit);
  consoleReporterDefinition.setRateUnit(this.rateUnit);
  consoleReporterDefinition.setPeriodDuration(this.periodDuration);
  consoleReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  consoleReporterDefinition.setFilter(this.filter);
  consoleReporterDefinition.setNameIfNotNull(override.getName());
  consoleReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  consoleReporterDefinition.setRateUnitIfNotNull(override.getDurationUnit());
  consoleReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  consoleReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  consoleReporterDefinition.setFilterIfNotNull(override.getFilter());
  return consoleReporterDefinition;
}

Fixed version (ground truth):
@Override public ConsoleReporterDefinition applyAsOverride(final ConsoleReporterDefinition override){
  ConsoleReporterDefinition consoleReporterDefinition=new ConsoleReporterDefinition();
  consoleReporterDefinition.setName(this.name);
  consoleReporterDefinition.setDurationUnit(this.durationUnit);
  consoleReporterDefinition.setRateUnit(this.rateUnit);
  consoleReporterDefinition.setPeriodDuration(this.periodDuration);
  consoleReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  consoleReporterDefinition.setFilter(this.filter);
  consoleReporterDefinition.setNameIfNotNull(override.getName());
  consoleReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  consoleReporterDefinition.setRateUnitIfNotNull(override.getRateUnit());
  consoleReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  consoleReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  consoleReporterDefinition.setFilterIfNotNull(override.getFilter());
  return consoleReporterDefinition;
}
Program: 26193
Project: 26193
Buggy source:
@Override public CsvReporterDefinition applyAsOverride(final CsvReporterDefinition override){
  CsvReporterDefinition csvReporterDefinition=new CsvReporterDefinition();
  csvReporterDefinition.setName(this.name);
  csvReporterDefinition.setDurationUnit(this.durationUnit);
  csvReporterDefinition.setRateUnit(this.rateUnit);
  csvReporterDefinition.setPeriodDuration(this.periodDuration);
  csvReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  csvReporterDefinition.setFilter(this.filter);
  csvReporterDefinition.setDirectory(this.directory);
  csvReporterDefinition.setNameIfNotNull(override.getName());
  csvReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  csvReporterDefinition.setRateUnitIfNotNull(override.getDurationUnit());
  csvReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  csvReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  csvReporterDefinition.setFilterIfNotNull(override.getFilter());
  csvReporterDefinition.setDirectoryIfNotNull(override.getDirectory());
  return csvReporterDefinition;
}

Fixed version (ground truth):
@Override public CsvReporterDefinition applyAsOverride(final CsvReporterDefinition override){
  CsvReporterDefinition csvReporterDefinition=new CsvReporterDefinition();
  csvReporterDefinition.setName(this.name);
  csvReporterDefinition.setDurationUnit(this.durationUnit);
  csvReporterDefinition.setRateUnit(this.rateUnit);
  csvReporterDefinition.setPeriodDuration(this.periodDuration);
  csvReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  csvReporterDefinition.setFilter(this.filter);
  csvReporterDefinition.setDirectory(this.directory);
  csvReporterDefinition.setNameIfNotNull(override.getName());
  csvReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  csvReporterDefinition.setRateUnitIfNotNull(override.getRateUnit());
  csvReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  csvReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  csvReporterDefinition.setFilterIfNotNull(override.getFilter());
  csvReporterDefinition.setDirectoryIfNotNull(override.getDirectory());
  return csvReporterDefinition;
}
Program: 26194
Project: 26194
Buggy source:
@Override public GraphiteReporterDefinition applyAsOverride(final GraphiteReporterDefinition override){
  GraphiteReporterDefinition graphiteReporterDefinition=new GraphiteReporterDefinition();
  graphiteReporterDefinition.setName(this.name);
  graphiteReporterDefinition.setDurationUnit(this.durationUnit);
  graphiteReporterDefinition.setRateUnit(this.rateUnit);
  graphiteReporterDefinition.setPeriodDuration(this.periodDuration);
  graphiteReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  graphiteReporterDefinition.setHost(this.host);
  graphiteReporterDefinition.setPort(this.port);
  graphiteReporterDefinition.setPrefix(this.prefix);
  graphiteReporterDefinition.setFilter(this.filter);
  graphiteReporterDefinition.setNameIfNotNull(override.getName());
  graphiteReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  graphiteReporterDefinition.setRateUnitIfNotNull(override.getDurationUnit());
  graphiteReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  graphiteReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  graphiteReporterDefinition.setHostIfNotNull(override.getHost());
  graphiteReporterDefinition.setPortIfNotNull(override.getPort());
  graphiteReporterDefinition.setPrefixIfNotNull(override.getPrefix());
  graphiteReporterDefinition.setFilterIfNotNull(override.getFilter());
  return graphiteReporterDefinition;
}

Fixed version (ground truth):
@Override public GraphiteReporterDefinition applyAsOverride(final GraphiteReporterDefinition override){
  GraphiteReporterDefinition graphiteReporterDefinition=new GraphiteReporterDefinition();
  graphiteReporterDefinition.setName(this.name);
  graphiteReporterDefinition.setDurationUnit(this.durationUnit);
  graphiteReporterDefinition.setRateUnit(this.rateUnit);
  graphiteReporterDefinition.setPeriodDuration(this.periodDuration);
  graphiteReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  graphiteReporterDefinition.setHost(this.host);
  graphiteReporterDefinition.setPort(this.port);
  graphiteReporterDefinition.setPrefix(this.prefix);
  graphiteReporterDefinition.setFilter(this.filter);
  graphiteReporterDefinition.setNameIfNotNull(override.getName());
  graphiteReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  graphiteReporterDefinition.setRateUnitIfNotNull(override.getRateUnit());
  graphiteReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  graphiteReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  graphiteReporterDefinition.setHostIfNotNull(override.getHost());
  graphiteReporterDefinition.setPortIfNotNull(override.getPort());
  graphiteReporterDefinition.setPrefixIfNotNull(override.getPrefix());
  graphiteReporterDefinition.setFilterIfNotNull(override.getFilter());
  return graphiteReporterDefinition;
}
Program: 26195
Project: 26195
Buggy source:
@Override public JmxReporterDefinition applyAsOverride(final JmxReporterDefinition override){
  JmxReporterDefinition jmxReporterDefinition=new JmxReporterDefinition();
  jmxReporterDefinition.setName(this.name);
  jmxReporterDefinition.setDomain(this.domain);
  jmxReporterDefinition.setDurationUnit(this.durationUnit);
  jmxReporterDefinition.setRateUnit(this.rateUnit);
  jmxReporterDefinition.setFilter(this.filter);
  jmxReporterDefinition.setNameIfNotNull(override.getName());
  jmxReporterDefinition.setDomainIfNotNull(override.getDomain());
  jmxReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  jmxReporterDefinition.setRateUnitIfNotNull(override.getDurationUnit());
  jmxReporterDefinition.setFilterIfNotNull(override.getFilter());
  return jmxReporterDefinition;
}

Fixed version (ground truth):
@Override public JmxReporterDefinition applyAsOverride(final JmxReporterDefinition override){
  JmxReporterDefinition jmxReporterDefinition=new JmxReporterDefinition();
  jmxReporterDefinition.setName(this.name);
  jmxReporterDefinition.setDomain(this.domain);
  jmxReporterDefinition.setDurationUnit(this.durationUnit);
  jmxReporterDefinition.setRateUnit(this.rateUnit);
  jmxReporterDefinition.setFilter(this.filter);
  jmxReporterDefinition.setNameIfNotNull(override.getName());
  jmxReporterDefinition.setDomainIfNotNull(override.getDomain());
  jmxReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  jmxReporterDefinition.setRateUnitIfNotNull(override.getRateUnit());
  jmxReporterDefinition.setFilterIfNotNull(override.getFilter());
  return jmxReporterDefinition;
}
Program: 26196
Project: 26196
Buggy source:
@Override public Slf4jReporterDefinition applyAsOverride(final Slf4jReporterDefinition override){
  Slf4jReporterDefinition slf4jReporterDefinition=new Slf4jReporterDefinition();
  slf4jReporterDefinition.setName(this.name);
  slf4jReporterDefinition.setDurationUnit(this.durationUnit);
  slf4jReporterDefinition.setRateUnit(this.rateUnit);
  slf4jReporterDefinition.setPeriodDuration(this.periodDuration);
  slf4jReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  slf4jReporterDefinition.setFilter(this.filter);
  slf4jReporterDefinition.setLoggerName(this.loggerName);
  slf4jReporterDefinition.setMarkerName(this.markerName);
  slf4jReporterDefinition.setNameIfNotNull(override.getName());
  slf4jReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  slf4jReporterDefinition.setRateUnitIfNotNull(override.getDurationUnit());
  slf4jReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  slf4jReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  slf4jReporterDefinition.setFilterIfNotNull(override.getFilter());
  slf4jReporterDefinition.setLoggerNameIfNotNull(override.getLoggerName());
  slf4jReporterDefinition.setMarkerNameIfNotNull(override.getMarkerName());
  return slf4jReporterDefinition;
}

Fixed version (ground truth):
@Override public Slf4jReporterDefinition applyAsOverride(final Slf4jReporterDefinition override){
  Slf4jReporterDefinition slf4jReporterDefinition=new Slf4jReporterDefinition();
  slf4jReporterDefinition.setName(this.name);
  slf4jReporterDefinition.setDurationUnit(this.durationUnit);
  slf4jReporterDefinition.setRateUnit(this.rateUnit);
  slf4jReporterDefinition.setPeriodDuration(this.periodDuration);
  slf4jReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);
  slf4jReporterDefinition.setFilter(this.filter);
  slf4jReporterDefinition.setLoggerName(this.loggerName);
  slf4jReporterDefinition.setMarkerName(this.markerName);
  slf4jReporterDefinition.setNameIfNotNull(override.getName());
  slf4jReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());
  slf4jReporterDefinition.setRateUnitIfNotNull(override.getRateUnit());
  slf4jReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());
  slf4jReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());
  slf4jReporterDefinition.setFilterIfNotNull(override.getFilter());
  slf4jReporterDefinition.setLoggerNameIfNotNull(override.getLoggerName());
  slf4jReporterDefinition.setMarkerNameIfNotNull(override.getMarkerName());
  return slf4jReporterDefinition;
}
Program: 26197
Project: 26197
Buggy source:
/** 
 * @param uri
 * @param metricsComponent
 * @param name
 * @param parameters
 * @throws Exception
 */
public MetricsEndpoint(final String uri,final MetricsComponent metricsComponent,final String name,final Map<String,Object> parameters) throws Exception {
  super(uri,metricsComponent);
  LOGGER.debug(MARKER,"String_Node_Str",uri,metricsComponent,parameters);
  this.metricsComponent=metricsComponent;
  this.name=name;
  warnIfTimingStopIsUsedWithOtherParameters(parameters);
  EndpointHelper.setProperties(getCamelContext(),this,parameters);
switch (this.timingAction) {
case STOP:
    LOGGER.debug(MARKER,"String_Node_Str",this.timingAction);
  break;
default :
this.metricsComponent.registerName(this.name);
initializeMetricGroup(this.name);
break;
}
}

Fixed version (ground truth):
/** 
 * @param uri
 * @param metricsComponent
 * @param name
 * @param parameters
 * @throws Exception
 */
public MetricsEndpoint(final String uri,final MetricsComponent metricsComponent,final String name,final Map<String,Object> parameters) throws Exception {
  super(uri,metricsComponent);
  LOGGER.info(MARKER,"String_Node_Str",uri,metricsComponent,parameters);
  this.metricsComponent=metricsComponent;
  this.name=name;
  warnIfTimingStopIsUsedWithOtherParameters(parameters);
  EndpointHelper.setProperties(getCamelContext(),this,parameters);
switch (this.timingAction) {
case STOP:
    LOGGER.debug(MARKER,"String_Node_Str",this.timingAction);
  break;
default :
initializeMetricGroup(this.name);
break;
}
}
Program: 26198
Project: 26198
Buggy source:
/** 
 * @param metricRegistry
 * @return
 */
public Slf4jReporter buildReporter(final MetricRegistry metricRegistry,final Exchange creatingExchange,final MetricGroup metricGroup){
  Slf4jReporterDefinition definitionWithDefaults=getReporterDefinitionWithDefaults();
  final String filterValue=evaluateValue(definitionWithDefaults.getFilter(),definitionWithDefaults.getRuntimeFilter(),definitionWithDefaults.getRuntimeSimpleFilter(),creatingExchange);
  final String loggerNameValue=evaluateValue(definitionWithDefaults.getFilter(),definitionWithDefaults.getRuntimeFilter(),definitionWithDefaults.getRuntimeSimpleFilter(),creatingExchange);
  final String markerNameValue=evaluateValue(definitionWithDefaults.getFilter(),definitionWithDefaults.getRuntimeFilter(),definitionWithDefaults.getRuntimeSimpleFilter(),creatingExchange);
  Slf4jReporter slf4jReporter=Slf4jReporter.forRegistry(metricRegistry).convertDurationsTo(definitionWithDefaults.getDurationUnit()).convertRatesTo(definitionWithDefaults.getRateUnit()).filter(new MetricFilter(){
    @Override public boolean matches(    final String name,    final Metric metric){
      if (!metricGroup.contains(metric)) {
        return false;
      }
      if (name == null || filterValue == null) {
        return true;
      }
      boolean result=name.matches(filterValue);
      return result;
    }
  }
).outputTo(LoggerFactory.getLogger(loggerNameValue)).markWith(MarkerFactory.getMarker(markerNameValue)).build();
  return slf4jReporter;
}

Fixed version (ground truth):
/** 
 * @param metricRegistry
 * @return
 */
public Slf4jReporter buildReporter(final MetricRegistry metricRegistry,final Exchange creatingExchange,final MetricGroup metricGroup){
  Slf4jReporterDefinition definitionWithDefaults=getReporterDefinitionWithDefaults();
  final String filterValue=evaluateValue(definitionWithDefaults.getFilter(),definitionWithDefaults.getRuntimeFilter(),definitionWithDefaults.getRuntimeSimpleFilter(),creatingExchange);
  final String loggerNameValue=evaluateValue(definitionWithDefaults.getLoggerName(),definitionWithDefaults.getRuntimeLoggerName(),definitionWithDefaults.getRuntimeSimpleLoggerName(),creatingExchange);
  final String markerNameValue=evaluateValue(definitionWithDefaults.getMarkerName(),definitionWithDefaults.getRuntimeMarkerName(),definitionWithDefaults.getRuntimeSimpleMarkerName(),creatingExchange);
  Slf4jReporter slf4jReporter=Slf4jReporter.forRegistry(metricRegistry).convertDurationsTo(definitionWithDefaults.getDurationUnit()).convertRatesTo(definitionWithDefaults.getRateUnit()).filter(new MetricFilter(){
    @Override public boolean matches(    final String name,    final Metric metric){
      if (!metricGroup.contains(metric)) {
        return false;
      }
      if (name == null || filterValue == null) {
        return true;
      }
      boolean result=name.matches(filterValue);
      return result;
    }
  }
).outputTo(LoggerFactory.getLogger(loggerNameValue)).markWith(MarkerFactory.getMarker(markerNameValue)).build();
  return slf4jReporter;
}