nus-yam/ex-repair huggingface dataset:
Program: 54624
Project: 54624
Buggy source:
@Override public Future<?> closeCursor(CursorId cursorId) throws ToroTaskExecutionException {
  return submit(new CloseCursorCallable(wrapper,cursorId,reportFactory.createCloseCursorReport()));
}

Fixed version (ground truth):
@Override public Future<?> closeCursor(CursorId cursorId) throws ToroTaskExecutionException {
  return submit(new CloseCursorCallable(wrapper,reportFactory.createCloseCursorReport(),cursorId));
}
Program: 54625
Project: 54625
Buggy source:
private static int executeDeleteRoots(DSLContext dsl,CollectionSchema colSchema,Collection<Integer> dids){
  Field<Integer> idField=DSL.field("String_Node_Str",SQLDataType.INTEGER.nullable(false));
  Table<Record> rootTable=DSL.tableByName(colSchema.getName(),"String_Node_Str");
  return dsl.delete(rootTable).where(idField.in(dids)).execute();
}

Fixed version (ground truth):
private static int executeDeleteRoots(DSLContext dsl,CollectionSchema colSchema,Collection<Integer> dids) throws SQLException {
  ConnectionProvider connectionProvider=dsl.configuration().connectionProvider();
  Connection connection=connectionProvider.acquire();
  try {
    Table<Record> rootTable=DSL.tableByName(colSchema.getName(),"String_Node_Str");
    return delete(connection,colSchema,rootTable,dids);
  }
  finally {
    connectionProvider.release(connection);
  }
}
Program: 54626
Project: 54626
Buggy source:
private static void executeDeleteSubDocuments(DSLContext dsl,Set<SubDocTable> tables,Collection<Integer> dids){
  for (  SubDocTable table : tables) {
    dsl.delete(table).where(table.getDidColumn().in(dids)).execute();
  }
}

Fixed version (ground truth):
private static void executeDeleteSubDocuments(DSLContext dsl,Set<SubDocTable> tables,Collection<Integer> dids){
  ConnectionProvider connectionProvider=dsl.configuration().connectionProvider();
  Connection connection=connectionProvider.acquire();
  try {
    for (    SubDocTable table : tables) {
      delete(connection,table.getSchema(),table,dids);
    }
  }
 catch (  SQLException ex) {
    throw new RuntimeException(ex);
  }
 finally {
    connectionProvider.release(connection);
  }
}
Program: 54627
Project: 54627
Buggy source:
public static int execute(Configuration configuration,CollectionSchema colSchema,Multimap<DocStructure,Integer> didsByStructure){
  TableProvider tableProvider=new TableProvider(colSchema);
  DSLContext dsl=DSL.using(configuration);
  Set<SubDocTable> tables=Sets.newHashSet();
  for (  DocStructure structure : didsByStructure.keySet()) {
    tables.clear();
    structure.accept(tableProvider,tables);
    executeDeleteSubDocuments(dsl,tables,didsByStructure.get(structure));
  }
  Set<Integer> dids=Sets.newHashSet(didsByStructure.values());
  return executeDeleteRoots(dsl,colSchema,dids);
}

Fixed version (ground truth):
public static int execute(Configuration configuration,CollectionSchema colSchema,Multimap<DocStructure,Integer> didsByStructure) throws SQLException {
  TableProvider tableProvider=new TableProvider(colSchema);
  DSLContext dsl=DSL.using(configuration);
  Set<SubDocTable> tables=Sets.newHashSet();
  for (  DocStructure structure : didsByStructure.keySet()) {
    tables.clear();
    structure.accept(tableProvider,tables);
    executeDeleteSubDocuments(dsl,tables,didsByStructure.get(structure));
  }
  Set<Integer> dids=Sets.newHashSet(didsByStructure.values());
  return executeDeleteRoots(dsl,colSchema,dids);
}
Program: 54628
Project: 54628
Buggy source:
public static DocValue translateBSON(Object value){
  if (value instanceof Double) {
    return new DoubleValue((Double)value);
  }
  if (value instanceof String) {
    return new StringValue((String)value);
  }
  if (value instanceof List) {
    List list=(List)value;
    return translateArray(list);
  }
  if (value instanceof BSONObject) {
    return translateObject((BSONObject)value);
  }
  if (value instanceof ObjectId) {
    ObjectId id=(ObjectId)value;
    byte[] bsonBytes=id.toByteArray();
    return new TwelveBytesValue(bsonBytes);
  }
  if (value instanceof Boolean) {
    Boolean bool=(Boolean)value;
    if (bool) {
      return BooleanValue.TRUE;
    }
    return BooleanValue.FALSE;
  }
  if (value instanceof Date) {
    Date date=(Date)value;
    LocalDateTime dateTime=LocalDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()),ZoneOffset.UTC);
    return new DateTimeValue(dateTime);
  }
  if (value == null) {
    return NullValue.INSTANCE;
  }
  if (value instanceof Integer) {
    return new IntegerValue((Integer)value);
  }
  if (value instanceof Long) {
    return new LongValue((Long)value);
  }
  throw new IllegalArgumentException("String_Node_Str" + value.getClass() + "String_Node_Str");
}

Fixed version (ground truth):
public static DocValue translateBSON(Object value){
  if (value instanceof Double) {
    return new DoubleValue((Double)value);
  }
  if (value instanceof String) {
    return new StringValue((String)value);
  }
  if (value instanceof List) {
    List list=(List)value;
    return translateArray(list);
  }
  if (value instanceof BSONObject) {
    return translateObject((BSONObject)value);
  }
  if (value instanceof ObjectId) {
    ObjectId id=(ObjectId)value;
    byte[] bsonBytes=id.toByteArray();
    return new TwelveBytesValue(bsonBytes);
  }
  if (value instanceof Boolean) {
    Boolean bool=(Boolean)value;
    if (bool) {
      return BooleanValue.TRUE;
    }
    return BooleanValue.FALSE;
  }
  if (value instanceof Date) {
    Date date=(Date)value;
    LocalDateTime dateTime=LocalDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()),ZoneId.systemDefault());
    return new DateTimeValue(dateTime);
  }
  if (value == null) {
    return NullValue.INSTANCE;
  }
  if (value instanceof Integer) {
    return new IntegerValue((Integer)value);
  }
  if (value instanceof Long) {
    return new LongValue((Long)value);
  }
  throw new IllegalArgumentException("String_Node_Str" + value.getClass() + "String_Node_Str");
}
Program: 54629
Project: 54629
Buggy source:
@Override public int getItemViewType(int position){
  if (position == 1)   return VIEW_TYPES.FIRST_VIEW;
  return position == 0 ? VIEW_TYPES.HEADER : VIEW_TYPES.NORMAL;
}

Fixed version (ground truth):
@Override public int getItemViewType(int position){
  if (position == 1)   return VIEW_TYPES.FIRST_VIEW;
  return position == 0 && mHeader != null ? VIEW_TYPES.HEADER : VIEW_TYPES.NORMAL;
}
Program: 54630
Project: 54630
Buggy source:
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup,final int i){
  if (i == VIEW_TYPES.HEADER && mHeader != null)   return new ViewHolder(mHeader);
  if (i == VIEW_TYPES.FIRST_VIEW && mHeader != null && mRecyclerView != null) {
    final RecyclerView.ViewHolder holder=mRecyclerView.findViewHolderForAdapterPosition(0);
    if (holder != null) {
      translateHeader(-holder.itemView.getTop());
    }
  }
  final RecyclerView.ViewHolder holder=onCreateViewHolderImpl(viewGroup,this,i);
  if (mOnClickEvent != null) {
    holder.itemView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        mOnClickEvent.onClick(v,holder.getAdapterPosition() - (mHeader == null ? 0 : 1));
      }
    }
);
  }
  return holder;
}

Fixed version (ground truth):
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup,final int i){
  if (i == VIEW_TYPES.HEADER && mHeader != null) {
    return new ViewHolder(mHeader);
  }
  if (i == VIEW_TYPES.FIRST_VIEW && mHeader != null && mRecyclerView != null) {
    final RecyclerView.ViewHolder holder=mRecyclerView.findViewHolderForAdapterPosition(0);
    if (holder != null) {
      translateHeader(-holder.itemView.getTop());
    }
  }
  final RecyclerView.ViewHolder holder=onCreateViewHolderImpl(viewGroup,this,i);
  if (mOnClickEvent != null) {
    holder.itemView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        mOnClickEvent.onClick(v,holder.getAdapterPosition() - (mHeader == null ? 0 : 1));
      }
    }
);
  }
  return holder;
}
Program: 54631
Project: 54631
Buggy source:
@Override public void onScrolled(RecyclerView recyclerView,int dx,int dy){
  super.onScrolled(recyclerView,dx,dy);
  if (mHeader != null) {
    if (mHeader != null) {
      translateHeader(mRecyclerView.getLayoutManager().getChildAt(0) == mHeader ? mRecyclerView.computeVerticalScrollOffset() : mHeader.getHeight());
    }
  }
}

Fixed version (ground truth):
@Override public void onScrolled(RecyclerView recyclerView,int dx,int dy){
  super.onScrolled(recyclerView,dx,dy);
  if (mHeader != null) {
    translateHeader(mRecyclerView.getLayoutManager().getChildAt(0) == mHeader ? mRecyclerView.computeVerticalScrollOffset() : mHeader.getHeight());
  }
}
Program: 54632
Project: 54632
Buggy source:
/** 
 * Defines if we will clip the layout or not. MUST BE CALLED BEFORE   {@link #setParallaxHeader(android.view.View,android.support.v7.widget.RecyclerView)}
 * @param shouldClickView
 */
public void setShouldClipView(boolean shouldClickView){
  mShouldClipView=shouldClickView;
}

Fixed version (ground truth):
/** 
 * Defines if we will clip the layout or not. MUST BE CALLED BEFORE   {@link #setParallaxHeader(android.view.View,android.support.v7.widget.RecyclerView)}
 */
public void setShouldClipView(boolean shouldClickView){
  mShouldClipView=shouldClickView;
}
Program: 54633
Project: 54633
Buggy source:
/** 
 * Event triggered when the parallax is being scrolled.
 * @param percentage
 * @param offset
 * @param parallax
 */
void onParallaxScroll(float percentage,float offset,View parallax);

Fixed version (ground truth):
/** 
 * Event triggered when the parallax is being scrolled.
 */
void onParallaxScroll(float percentage,float offset,View parallax);
Program: 54634
Project: 54634
Buggy source:
@Override public void onBindViewHolder(RecyclerView.ViewHolder viewHolder,final int i){
  if (i != 0 && mHeader != null) {
    onBindViewHolderImpl(viewHolder,this,i - 1);
  }
 else   if (i != 0) {
    onBindViewHolderImpl(viewHolder,this,i);
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(RecyclerView.ViewHolder viewHolder,final int i){
  if (mHeader != null) {
    if (i == 0) {
      return;
    }
    onBindViewHolderImpl(viewHolder,this,i - 1);
  }
 else {
    onBindViewHolderImpl(viewHolder,this,i);
  }
}
Program: 54635
Project: 54635
Buggy source:
/** 
 * Set the view as header.
 * @param header The inflated header
 * @param view   The RecyclerView to set scroll listeners
 */
public void setParallaxHeader(View header,final RecyclerView view){
  mRecyclerView=view;
  mHeader=new CustomRelativeWrapper(header.getContext(),mShouldClipView);
  mHeader.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  mHeader.addView(header,new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
  view.setOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrolled(    RecyclerView recyclerView,    int dx,    int dy){
      super.onScrolled(recyclerView,dx,dy);
      if (mHeader != null) {
        if (mHeader != null) {
          translateHeader(mRecyclerView.getLayoutManager().getChildAt(0) == mHeader ? mRecyclerView.computeVerticalScrollOffset() : mHeader.getHeight());
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Set the view as header.
 * @param header The inflated header
 * @param view   The RecyclerView to set scroll listeners
 */
public void setParallaxHeader(View header,final RecyclerView view){
  mRecyclerView=view;
  mHeader=new CustomRelativeWrapper(header.getContext(),mShouldClipView);
  mHeader.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  mHeader.addView(header,new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
  view.setOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrolled(    RecyclerView recyclerView,    int dx,    int dy){
      super.onScrolled(recyclerView,dx,dy);
      if (mHeader != null) {
        translateHeader(mRecyclerView.getLayoutManager().getChildAt(0) == mHeader ? mRecyclerView.computeVerticalScrollOffset() : mHeader.getHeight());
      }
    }
  }
);
}
Program: 54636
Project: 54636
Buggy source:
private void startLocationPermissionRequest(){
  ActivityCompat.requestPermissions(MainActivity.this,new String[]{Manifest.permission.ACCESS_FINE_LOCATION},REQUEST_PERMISSIONS_REQUEST_CODE);
}

Fixed version (ground truth):
private void startLocationPermissionRequest(){
  ActivityCompat.requestPermissions(MainActivity.this,new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},REQUEST_PERMISSIONS_REQUEST_CODE);
}
Program: 54637
Project: 54637
Buggy source:
private void requestPermissions(){
  boolean shouldProvideRationale=ActivityCompat.shouldShowRequestPermissionRationale(this,Manifest.permission.ACCESS_FINE_LOCATION);
  if (shouldProvideRationale) {
    Log.i(TAG,"String_Node_Str");
    showSnackbar(R.string.permission_rationale,android.R.string.ok,new View.OnClickListener(){
      @Override public void onClick(      View view){
        startLocationPermissionRequest();
      }
    }
);
  }
 else {
    Log.i(TAG,"String_Node_Str");
    startLocationPermissionRequest();
  }
}

Fixed version (ground truth):
private void requestPermissions(){
  boolean shouldProvideRationale=ActivityCompat.shouldShowRequestPermissionRationale(this,Manifest.permission.ACCESS_COARSE_LOCATION);
  if (shouldProvideRationale) {
    Log.i(TAG,"String_Node_Str");
    showSnackbar(R.string.permission_rationale,android.R.string.ok,new View.OnClickListener(){
      @Override public void onClick(      View view){
        startLocationPermissionRequest();
      }
    }
);
  }
 else {
    Log.i(TAG,"String_Node_Str");
    startLocationPermissionRequest();
  }
}
Program: 54638
Project: 54638
Buggy source:
/** 
 * Removes location updates from the FusedLocationApi.
 */
private void stopLocationUpdates(){
  mFusedLocationClient.removeLocationUpdates(mLocationCallback).addOnCompleteListener(this,new OnCompleteListener<Void>(){
    @Override public void onComplete(    @NonNull Task<Void> task){
      mRequestingLocationUpdates=false;
      setButtonsEnabledState();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Removes location updates from the FusedLocationApi.
 */
private void stopLocationUpdates(){
  if (!mRequestingLocationUpdates) {
    Log.d(TAG,"String_Node_Str");
    return;
  }
  mFusedLocationClient.removeLocationUpdates(mLocationCallback).addOnCompleteListener(this,new OnCompleteListener<Void>(){
    @Override public void onComplete(    @NonNull Task<Void> task){
      mRequestingLocationUpdates=false;
      setButtonsEnabledState();
    }
  }
);
}
Program: 54639
Project: 54639
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (mRequestingLocationUpdates && checkPermissions()) {
    startLocationUpdates();
  }
 else {
    requestPermissions();
  }
  updateUI();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (mRequestingLocationUpdates && checkPermissions()) {
    startLocationUpdates();
  }
 else   if (!checkPermissions()) {
    requestPermissions();
  }
  updateUI();
}
Program: 54642
Project: 54642
Buggy source:
private static void processStatementLabel(Statement stat,Set<Statement> setBreak,Set<Statement> setContinue){
  if (stat.getExprents() == null) {
    for (    Statement st : stat.getStats()) {
      processStatementLabel(st,setBreak,setContinue);
    }
    boolean shieldtype=(stat.type == Statement.TYPE_DO || stat.type == Statement.TYPE_SWITCH);
    for (    StatEdge edge : stat.getLabelEdges()) {
      if (edge.explicit) {
        if (shieldtype && ((edge.getType() == StatEdge.TYPE_BREAK && setBreak.contains(edge.getSource())) || (edge.getType() == StatEdge.TYPE_CONTINUE && setContinue.contains(edge.getSource())))) {
          edge.labeled=false;
        }
      }
    }
switch (stat.type) {
case Statement.TYPE_DO:
      setContinue.clear();
case Statement.TYPE_SWITCH:
    setBreak.clear();
}
}
setBreak.add(stat);
setContinue.add(stat);
}

Fixed version (ground truth):
private static HashSet<Statement>[] processStatementLabel(Statement stat){
  HashSet<Statement> setBreak=new HashSet<Statement>();
  HashSet<Statement> setContinue=new HashSet<Statement>();
  if (stat.getExprents() == null) {
    for (    Statement st : stat.getStats()) {
      HashSet<Statement>[] arr=processStatementLabel(st);
      setBreak.addAll(arr[0]);
      setContinue.addAll(arr[1]);
    }
    boolean shieldtype=(stat.type == Statement.TYPE_DO || stat.type == Statement.TYPE_SWITCH);
    for (    StatEdge edge : stat.getLabelEdges()) {
      if (edge.explicit) {
        if (shieldtype && ((edge.getType() == StatEdge.TYPE_BREAK && setBreak.contains(edge.getSource())) || (edge.getType() == StatEdge.TYPE_CONTINUE && setContinue.contains(edge.getSource())))) {
          edge.labeled=false;
        }
      }
    }
switch (stat.type) {
case Statement.TYPE_DO:
      setContinue.clear();
case Statement.TYPE_SWITCH:
    setBreak.clear();
}
}
setBreak.add(stat);
setContinue.add(stat);
return new HashSet[]{setBreak,setContinue};
}
Program: 54643
Project: 54643
Buggy source:
private static byte[] readAndClose(InputStream stream,long length) throws IOException {
  try {
    byte[] bytes=new byte[(int)length];
    if (stream.read(bytes) != length) {
      throw new IOException("String_Node_Str");
    }
    return bytes;
  }
  finally {
    stream.close();
  }
}

Fixed version (ground truth):
private static byte[] readAndClose(InputStream stream,long length) throws IOException {
  try {
    byte[] bytes=new byte[(int)length];
    DataInputStream dataStream=new DataInputStream(stream);
    try {
      dataStream.readFully(bytes);
    }
 catch (    EOFException ex) {
      throw new IOException("String_Node_Str",ex);
    }
 finally {
      dataStream.close();
    }
    return bytes;
  }
  finally {
    stream.close();
  }
}
Program: 54647
Project: 54647
Buggy source:
public void dumpMapping(StringBuilder buffer){
  String lineSeparator=DecompilerContext.getNewLineSeparator();
  String indentstr1=InterpreterUtil.getIndentString(1);
  String indentstr2=InterpreterUtil.getIndentString(2);
  for (  Entry<String,HashMap<String,HashMap<Integer,Integer>>> class_entry : mapping.entrySet()) {
    HashMap<String,HashMap<Integer,Integer>> class_mapping=class_entry.getValue();
    buffer.append("String_Node_Str" + class_entry.getKey() + "String_Node_Str"+ lineSeparator);
    boolean is_first_method=true;
    for (    Entry<String,HashMap<Integer,Integer>> method_entry : class_mapping.entrySet()) {
      HashMap<Integer,Integer> method_mapping=method_entry.getValue();
      if (!is_first_method) {
        buffer.append(lineSeparator);
      }
      buffer.append(indentstr1 + "String_Node_Str" + method_entry.getKey()+ "String_Node_Str"+ lineSeparator);
      for (      Entry<Integer,Integer> line : method_mapping.entrySet()) {
        buffer.append(indentstr2 + line.getKey() + indentstr2+ line.getValue()+ lineSeparator);
      }
      buffer.append(indentstr1 + "String_Node_Str" + lineSeparator);
      is_first_method=false;
    }
    buffer.append("String_Node_Str" + lineSeparator);
  }
}

Fixed version (ground truth):
public void dumpMapping(StringBuilder buffer){
  String lineSeparator=DecompilerContext.getNewLineSeparator();
  String indentstr1=InterpreterUtil.getIndentString(1);
  String indentstr2=InterpreterUtil.getIndentString(2);
  for (  Entry<String,HashMap<String,HashMap<Integer,Integer>>> class_entry : mapping.entrySet()) {
    HashMap<String,HashMap<Integer,Integer>> class_mapping=class_entry.getValue();
    buffer.append("String_Node_Str" + class_entry.getKey() + "String_Node_Str"+ lineSeparator);
    boolean is_first_method=true;
    for (    Entry<String,HashMap<Integer,Integer>> method_entry : class_mapping.entrySet()) {
      HashMap<Integer,Integer> method_mapping=method_entry.getValue();
      if (!is_first_method) {
        buffer.append(lineSeparator);
      }
      buffer.append(indentstr1 + "String_Node_Str" + method_entry.getKey()+ "String_Node_Str"+ lineSeparator);
      for (      Entry<Integer,Integer> line : method_mapping.entrySet()) {
        buffer.append(indentstr2 + line.getKey() + indentstr2+ (line.getValue() + offset_total)+ lineSeparator);
      }
      buffer.append(indentstr1 + "String_Node_Str" + lineSeparator);
      is_first_method=false;
    }
    buffer.append("String_Node_Str" + lineSeparator);
  }
}
Program: 54648
Project: 54648
Buggy source:
public static String listToJava(List<Exprent> lst,int indent,BytecodeMappingTracer tracer){
  if (lst == null || lst.isEmpty()) {
    return "String_Node_Str";
  }
  String indstr=InterpreterUtil.getIndentString(indent);
  String new_line_separator=DecompilerContext.getNewLineSeparator();
  StringBuilder buf=new StringBuilder();
  for (  Exprent expr : lst) {
    String content=expr.toJava(indent,tracer);
    if (content.length() > 0) {
      if (expr.type != Exprent.EXPRENT_VAR || !((VarExprent)expr).isClassdef()) {
        buf.append(indstr);
      }
      buf.append(content);
      if (expr.type == Exprent.EXPRENT_MONITOR && ((MonitorExprent)expr).getMontype() == MonitorExprent.MONITOR_ENTER) {
        buf.append("String_Node_Str");
      }
      if (endsWithSemikolon(expr)) {
        buf.append("String_Node_Str");
      }
      buf.append(new_line_separator);
      tracer.incrementSourceLine();
    }
  }
  return buf.toString();
}

Fixed version (ground truth):
public static String listToJava(List<Exprent> lst,int indent,BytecodeMappingTracer tracer){
  if (lst == null || lst.isEmpty()) {
    return "String_Node_Str";
  }
  String indstr=InterpreterUtil.getIndentString(indent);
  String new_line_separator=DecompilerContext.getNewLineSeparator();
  StringBuilder buf=new StringBuilder();
  for (  Exprent expr : lst) {
    String content=expr.toJava(indent,tracer);
    if (content.length() > 0) {
      if (expr.type != Exprent.EXPRENT_VAR || !((VarExprent)expr).isClassdef()) {
        buf.append(indstr);
      }
      buf.append(content);
      if (expr.type == Exprent.EXPRENT_MONITOR && ((MonitorExprent)expr).getMontype() == MonitorExprent.MONITOR_ENTER) {
        buf.append("String_Node_Str");
      }
      if (endsWithSemikolon(expr)) {
        buf.append("String_Node_Str");
      }
      buf.append(new_line_separator);
      tracer.incrementCurrentSourceLine();
    }
  }
  return buf.toString();
}
Program: 54649
Project: 54649
Buggy source:
public static String jmpWrapper(Statement stat,int indent,boolean semicolon,BytecodeMappingTracer tracer){
  StringBuilder buf=new StringBuilder(stat.toJava(indent,tracer));
  String new_line_separator=DecompilerContext.getNewLineSeparator();
  List<StatEdge> lstSuccs=stat.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL);
  if (lstSuccs.size() == 1) {
    StatEdge edge=lstSuccs.get(0);
    if (edge.getType() != StatEdge.TYPE_REGULAR && edge.explicit && edge.getDestination().type != Statement.TYPE_DUMMYEXIT) {
      buf.append(InterpreterUtil.getIndentString(indent));
switch (edge.getType()) {
case StatEdge.TYPE_BREAK:
        buf.append("String_Node_Str");
      break;
case StatEdge.TYPE_CONTINUE:
    buf.append("String_Node_Str");
}
if (edge.labeled) {
  buf.append("String_Node_Str").append(edge.closure.id);
}
buf.append("String_Node_Str").append(new_line_separator);
tracer.incrementSourceLine();
}
}
if (buf.length() == 0 && semicolon) {
buf.append(InterpreterUtil.getIndentString(indent)).append("String_Node_Str").append(new_line_separator);
tracer.incrementSourceLine();
}
return buf.toString();
}

Fixed version (ground truth):
public static String jmpWrapper(Statement stat,int indent,boolean semicolon,BytecodeMappingTracer tracer){
  StringBuilder buf=new StringBuilder(stat.toJava(indent,tracer));
  String new_line_separator=DecompilerContext.getNewLineSeparator();
  List<StatEdge> lstSuccs=stat.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL);
  if (lstSuccs.size() == 1) {
    StatEdge edge=lstSuccs.get(0);
    if (edge.getType() != StatEdge.TYPE_REGULAR && edge.explicit && edge.getDestination().type != Statement.TYPE_DUMMYEXIT) {
      buf.append(InterpreterUtil.getIndentString(indent));
switch (edge.getType()) {
case StatEdge.TYPE_BREAK:
        buf.append("String_Node_Str");
      break;
case StatEdge.TYPE_CONTINUE:
    buf.append("String_Node_Str");
}
if (edge.labeled) {
  buf.append("String_Node_Str").append(edge.closure.id);
}
buf.append("String_Node_Str").append(new_line_separator);
tracer.incrementCurrentSourceLine();
}
}
if (buf.length() == 0 && semicolon) {
buf.append(InterpreterUtil.getIndentString(indent)).append("String_Node_Str").append(new_line_separator);
tracer.incrementCurrentSourceLine();
}
return buf.toString();
}
Program: 54654
Project: 54654
Buggy source:
public String toJava(int indent,BytecodeMappingTracer tracer){
  StringBuilder buf=new StringBuilder();
  String indstr=null;
  boolean islabeled=isLabeled();
  String new_line_separator=DecompilerContext.getNewLineSeparator();
  buf.append(ExprProcessor.listToJava(varDefinitions,indent,tracer));
  if (islabeled) {
    indstr=InterpreterUtil.getIndentString(indent);
    indent++;
    buf.append(indstr).append("String_Node_Str").append(this.id).append("String_Node_Str").append(new_line_separator);
    tracer.incrementSourceLine();
  }
  boolean notempty=false;
  for (int i=0; i < stats.size(); i++) {
    Statement st=stats.get(i);
    if (i > 0 && notempty) {
      buf.append(new_line_separator);
      tracer.incrementSourceLine();
    }
    String str=ExprProcessor.jmpWrapper(st,indent,false,tracer);
    buf.append(str);
    notempty=(str.trim().length() > 0);
  }
  if (islabeled) {
    buf.append(indstr).append("String_Node_Str").append(new_line_separator);
    tracer.incrementSourceLine();
  }
  return buf.toString();
}

Fixed version (ground truth):
public String toJava(int indent,BytecodeMappingTracer tracer){
  StringBuilder buf=new StringBuilder();
  String indstr=null;
  boolean islabeled=isLabeled();
  String new_line_separator=DecompilerContext.getNewLineSeparator();
  buf.append(ExprProcessor.listToJava(varDefinitions,indent,tracer));
  if (islabeled) {
    indstr=InterpreterUtil.getIndentString(indent);
    indent++;
    buf.append(indstr).append("String_Node_Str").append(this.id).append("String_Node_Str").append(new_line_separator);
    tracer.incrementCurrentSourceLine();
  }
  boolean notempty=false;
  for (int i=0; i < stats.size(); i++) {
    Statement st=stats.get(i);
    if (i > 0 && notempty) {
      buf.append(new_line_separator);
      tracer.incrementCurrentSourceLine();
    }
    String str=ExprProcessor.jmpWrapper(st,indent,false,tracer);
    buf.append(str);
    notempty=(str.trim().length() > 0);
  }
  if (islabeled) {
    buf.append(indstr).append("String_Node_Str").append(new_line_separator);
    tracer.incrementCurrentSourceLine();
  }
  return buf.toString();
}
Program: 54656
Project: 54656
Buggy source:
private void ssaStatements(DirectGraph dgraph,HashSet<String> updated,boolean calcLiveVars){
  for (  DirectNode node : dgraph.nodes) {
    updated.remove(node.id);
    mergeInVarMaps(node,dgraph);
    SFormsFastMapDirect varmap=new SFormsFastMapDirect(inVarVersions.get(node.id));
    SFormsFastMapDirect[] varmaparr=new SFormsFastMapDirect[]{varmap,null};
    if (node.exprents != null) {
      for (      Exprent expr : node.exprents) {
        processExprent(expr,varmaparr,node.statement,calcLiveVars);
      }
    }
    if (varmaparr[1] == null) {
      varmaparr[1]=varmaparr[0];
    }
    boolean this_updated=!mapsEqual(varmaparr[0],outVarVersions.get(node.id)) || (outNegVarVersions.containsKey(node.id) && !mapsEqual(varmaparr[1],outNegVarVersions.get(node.id)));
    if (this_updated) {
      outVarVersions.put(node.id,varmaparr[0]);
      if (dgraph.mapNegIfBranch.containsKey(node.id)) {
        outNegVarVersions.put(node.id,varmaparr[1]);
      }
      for (      DirectNode nd : node.succs) {
        updated.add(nd.id);
      }
    }
  }
}

Fixed version (ground truth):
private void ssaStatements(DirectGraph dgraph,HashSet<String> updated,boolean calcLiveVars){
  for (  DirectNode node : dgraph.nodes) {
    updated.remove(node.id);
    mergeInVarMaps(node,dgraph);
    SFormsFastMapDirect varmap=new SFormsFastMapDirect(inVarVersions.get(node.id));
    SFormsFastMapDirect[] varmaparr=new SFormsFastMapDirect[]{varmap,null};
    if (node.exprents != null) {
      for (      Exprent expr : node.exprents) {
        processExprent(expr,varmaparr,node.statement,calcLiveVars);
      }
    }
    if (varmaparr[1] == null) {
      varmaparr[1]=varmaparr[0];
    }
    boolean allow_field_propagation=node.succs.isEmpty() || (node.succs.size() == 1 && node.succs.get(0).preds.size() == 1);
    if (!allow_field_propagation && varmaparr[0] != null) {
      varmaparr[0].removeAllFields();
      varmaparr[1].removeAllFields();
    }
    boolean this_updated=!mapsEqual(varmaparr[0],outVarVersions.get(node.id)) || (outNegVarVersions.containsKey(node.id) && !mapsEqual(varmaparr[1],outNegVarVersions.get(node.id)));
    if (this_updated) {
      outVarVersions.put(node.id,varmaparr[0]);
      if (dgraph.mapNegIfBranch.containsKey(node.id)) {
        outNegVarVersions.put(node.id,varmaparr[1]);
      }
      for (      DirectNode nd : node.succs) {
        updated.add(nd.id);
      }
    }
  }
}
Program: 54665
Project: 54665
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  TrainingParameters trainingParameters=knowledgeBase.getTrainingParameters();
  boolean scaleResponse=trainingParameters.getScaleResponse() && newData.getYDataType() == TypeInference.DataType.NUMERICAL;
  double threshold=trainingParameters.getThreshold();
  Map<Object,TypeInference.DataType> columnTypes=newData.getXDataTypes();
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Object> entry : xData.entrySet()) {
      Object column=entry.getKey();
      Double value=xData.getDouble(column);
      if (value == null || columnTypes.get(column) != TypeInference.DataType.NUMERICAL) {
        continue;
      }
      xData.put(column,scale(value,threshold));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      yData=scale(value,threshold);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
  newData.recalculateMeta();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  TrainingParameters trainingParameters=knowledgeBase.getTrainingParameters();
  boolean scaleResponse=trainingParameters.getScaleResponse() && newData.getYDataType() == TypeInference.DataType.NUMERICAL;
  double threshold=trainingParameters.getThreshold();
  Map<Object,TypeInference.DataType> columnTypes=newData.getXDataTypes();
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Object> entry : xData.entrySet()) {
      Object column=entry.getKey();
      Object value=entry.getValue();
      if (value == null || columnTypes.get(column) != TypeInference.DataType.NUMERICAL) {
        continue;
      }
      xData.put(column,scale(TypeInference.toDouble(value),threshold));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      yData=scale(value,threshold);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
  newData.recalculateMeta();
}
Program: 54666
Project: 54666
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  ModelParameters modelParameters=knowledgeBase.getModelParameters();
  Map<Object,Double> maxAbsoluteColumnValues=modelParameters.getMaxAbsoluteColumnValues();
  boolean scaleResponse=knowledgeBase.getTrainingParameters().getScaleResponse() && maxAbsoluteColumnValues.containsKey(Dataframe.COLUMN_NAME_Y);
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Double> entry : maxAbsoluteColumnValues.entrySet()) {
      Object column=entry.getKey();
      Double value=xData.getDouble(column);
      if (value == null) {
        continue;
      }
      Double maxAbsolute=entry.getValue();
      xData.put(column,scale(value,maxAbsolute));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      Double maxAbsolute=maxAbsoluteColumnValues.get(Dataframe.COLUMN_NAME_Y);
      yData=scale(value,maxAbsolute);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  ModelParameters modelParameters=knowledgeBase.getModelParameters();
  Map<Object,Double> maxAbsoluteColumnValues=modelParameters.getMaxAbsoluteColumnValues();
  boolean scaleResponse=knowledgeBase.getTrainingParameters().getScaleResponse() && maxAbsoluteColumnValues.containsKey(Dataframe.COLUMN_NAME_Y);
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Object> entry : xData.entrySet()) {
      Object value=entry.getValue();
      if (value == null) {
        continue;
      }
      Object column=entry.getKey();
      Double maxAbsolute=maxAbsoluteColumnValues.get(column);
      if (maxAbsolute == null) {
        continue;
      }
      xData.put(column,scale(TypeInference.toDouble(value),maxAbsolute));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      Double maxAbsolute=maxAbsoluteColumnValues.get(Dataframe.COLUMN_NAME_Y);
      yData=scale(value,maxAbsolute);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
}
Program: 54667
Project: 54667
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  ModelParameters modelParameters=knowledgeBase.getModelParameters();
  Map<Object,Double> minColumnValues=modelParameters.getMinColumnValues();
  Map<Object,Double> maxColumnValues=modelParameters.getMaxColumnValues();
  boolean scaleResponse=knowledgeBase.getTrainingParameters().getScaleResponse() && minColumnValues.containsKey(Dataframe.COLUMN_NAME_Y);
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Double> entry : minColumnValues.entrySet()) {
      Object column=entry.getKey();
      Double value=xData.getDouble(column);
      if (value == null) {
        continue;
      }
      Double min=entry.getValue();
      Double max=maxColumnValues.get(column);
      xData.put(column,scale(value,min,max));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      Double min=minColumnValues.get(Dataframe.COLUMN_NAME_Y);
      Double max=maxColumnValues.get(Dataframe.COLUMN_NAME_Y);
      yData=scale(value,min,max);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  ModelParameters modelParameters=knowledgeBase.getModelParameters();
  Map<Object,Double> minColumnValues=modelParameters.getMinColumnValues();
  Map<Object,Double> maxColumnValues=modelParameters.getMaxColumnValues();
  boolean scaleResponse=knowledgeBase.getTrainingParameters().getScaleResponse() && minColumnValues.containsKey(Dataframe.COLUMN_NAME_Y);
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Object> entry : xData.entrySet()) {
      Object value=entry.getValue();
      if (value == null) {
        continue;
      }
      Object column=entry.getKey();
      Double min=minColumnValues.get(column);
      if (min == null) {
        continue;
      }
      Double max=maxColumnValues.get(column);
      xData.put(column,scale(TypeInference.toDouble(value),min,max));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      Double min=minColumnValues.get(Dataframe.COLUMN_NAME_Y);
      Double max=maxColumnValues.get(Dataframe.COLUMN_NAME_Y);
      yData=scale(value,min,max);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
}
Program: 54668
Project: 54668
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  ModelParameters modelParameters=knowledgeBase.getModelParameters();
  Map<Object,Double> meanColumnValues=modelParameters.getMeanColumnValues();
  Map<Object,Double> stdColumnValues=modelParameters.getStdColumnValues();
  boolean scaleResponse=knowledgeBase.getTrainingParameters().getScaleResponse() && meanColumnValues.containsKey(Dataframe.COLUMN_NAME_Y);
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Double> entry : meanColumnValues.entrySet()) {
      Object column=entry.getKey();
      Double value=xData.getDouble(column);
      if (value == null) {
        continue;
      }
      Double mean=entry.getValue();
      Double std=stdColumnValues.get(column);
      xData.put(column,scale(value,mean,std));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      Double mean=meanColumnValues.get(Dataframe.COLUMN_NAME_Y);
      Double std=stdColumnValues.get(Dataframe.COLUMN_NAME_Y);
      yData=scale(value,mean,std);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void _transform(Dataframe newData){
  ModelParameters modelParameters=knowledgeBase.getModelParameters();
  Map<Object,Double> meanColumnValues=modelParameters.getMeanColumnValues();
  Map<Object,Double> stdColumnValues=modelParameters.getStdColumnValues();
  boolean scaleResponse=knowledgeBase.getTrainingParameters().getScaleResponse() && meanColumnValues.containsKey(Dataframe.COLUMN_NAME_Y);
  streamExecutor.forEach(StreamMethods.stream(newData.entries(),isParallelized()),e -> {
    Record r=e.getValue();
    AssociativeArray xData=r.getX().copy();
    Object yData=r.getY();
    boolean modified=false;
    for (    Map.Entry<Object,Object> entry : xData.entrySet()) {
      Object value=entry.getValue();
      if (value == null) {
        continue;
      }
      Object column=entry.getKey();
      Double mean=meanColumnValues.get(column);
      if (mean == null) {
        continue;
      }
      Double std=stdColumnValues.get(column);
      xData.put(column,scale(TypeInference.toDouble(value),mean,std));
      modified=true;
    }
    if (scaleResponse && yData != null) {
      Double value=TypeInference.toDouble(yData);
      Double mean=meanColumnValues.get(Dataframe.COLUMN_NAME_Y);
      Double std=stdColumnValues.get(Dataframe.COLUMN_NAME_Y);
      yData=scale(value,mean,std);
      modified=true;
    }
    if (modified) {
      Integer rId=e.getKey();
      Record newR=new Record(xData,yData,r.getYPredicted(),r.getYPredictedProbabilities());
      newData._unsafe_set(rId,newR);
    }
  }
);
}
Program: 54669
Project: 54669
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void add(Record r){
  RealVector rv=MatrixDataframe.parseRecord(r,featureIds);
  if (size == 0) {
    xi_sum=rv;
    xi_square_sum=rv.outerProduct(rv);
  }
 else {
    xi_sum=xi_sum.add(rv);
    xi_square_sum=xi_square_sum.add(rv.outerProduct(rv));
  }
  size++;
  updateClusterParameters();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void add(Record r){
  RealVector rv=MatrixDataframe.parseRecord(r,featureIds);
  if (size == 0) {
    xi_sum=rv;
    int n=rv.getDimension();
    xi_square_sum=new BlockRealMatrix(n,n).add(rv.outerProduct(rv));
  }
 else {
    xi_sum=xi_sum.add(rv);
    xi_square_sum=xi_square_sum.add(rv.outerProduct(rv));
  }
  size++;
  updateClusterParameters();
}
Program: 54670
Project: 54670
Buggy source:
/** 
 * This method is called before serializing the objects. It extracts all the not-serializable BigMap references of the provided object and stores them in a Map. Then it replaces all the references of the provided object with nulls to avoid their serialization. The main idea is that we temporarily remove from the object any reference that will cause problems during the serialization phase.
 * @param serializableObject
 * @param < T >
 * @return
 */
protected <T extends Serializable>Map<String,Object> preSerializer(T serializableObject){
  Map<String,Object> objReferences=new HashMap<>();
  for (  Field field : ReflectionMethods.getAllFields(new LinkedList<>(),serializableObject.getClass())) {
    if (field.isAnnotationPresent(BigMap.class) && !Serializable.class.isAssignableFrom(field.getDeclaringClass())) {
      field.setAccessible(true);
      try {
        objReferences.put(field.getName(),field.get(serializableObject));
        field.set(serializableObject,null);
      }
 catch (      IllegalArgumentException|IllegalAccessException ex) {
        throw new RuntimeException(ex);
      }
    }
  }
  return objReferences;
}

Fixed version (ground truth):
/** 
 * This method is called before serializing the objects. It extracts all the not-serializable BigMap references of the provided object and stores them in a Map. Then it replaces all the references of the provided object with nulls to avoid their serialization. The main idea is that we temporarily remove from the object any reference that will cause problems during the serialization phase.
 * @param serializableObject
 * @param < T >
 * @return
 */
protected <T extends Serializable>Map<String,Object> preSerializer(T serializableObject){
  Map<String,Object> objReferences=new HashMap<>();
  for (  Field field : ReflectionMethods.getAllFields(new LinkedList<>(),serializableObject.getClass())) {
    if (field.isAnnotationPresent(BigMap.class)) {
      field.setAccessible(true);
      try {
        Object value=field.get(serializableObject);
        if (!Serializable.class.isAssignableFrom(value.getClass())) {
          objReferences.put(field.getName(),value);
          field.set(serializableObject,null);
        }
      }
 catch (      IllegalArgumentException|IllegalAccessException ex) {
        throw new RuntimeException(ex);
      }
    }
  }
  return objReferences;
}
Program: 54672
Project: 54672
Buggy source:
/** 
 * Opens the DB (if not already open) and returns the DB object.
 * @param dbType
 * @return 
 */
private DB openDB(DBType dbType){
  DB db=dbRegistry.get(dbType);
  if (!isOpenDB(db)) {
    DBMaker m;
    boolean permitCaching=true;
    if (dbType == DBType.PRIMARY_DB) {
      m=DBMaker.newFileDB(getDefaultPath().toFile());
    }
 else     if (dbType == DBType.TEMP_DB_CACHED || dbType == DBType.TEMP_DB_UNCACHED) {
      m=DBMaker.newTempFileDB().deleteFilesAfterClose();
      if (dbType == DBType.TEMP_DB_UNCACHED) {
        permitCaching=false;
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (dbConf.isCompressed()) {
      m=m.compressionEnable();
    }
    if (permitCaching && dbConf.getCacheSize() > 0) {
      m=m.cacheLRUEnable().cacheSize(dbConf.getCacheSize());
    }
 else {
      m=m.cacheDisable();
    }
    m=m.transactionDisable();
    m=m.asyncWriteEnable();
    m=m.closeOnJvmShutdown();
    db=m.make();
    dbRegistry.put(dbType,db);
  }
  return db;
}

Fixed version (ground truth):
/** 
 * Opens the DB (if not already open) and returns the DB object.
 * @param dbType
 * @return 
 */
private DB openDB(DBType dbType){
  DB db=dbRegistry.get(dbType);
  if (!isOpenDB(db)) {
    DBMaker m;
    boolean permitCaching=true;
    if (dbType == DBType.PRIMARY_DB) {
      m=DBMaker.newFileDB(getDefaultPath().toFile());
    }
 else     if (dbType == DBType.TEMP_DB_CACHED || dbType == DBType.TEMP_DB_UNCACHED) {
      m=DBMaker.newTempFileDB().deleteFilesAfterClose();
      if (dbType == DBType.TEMP_DB_UNCACHED) {
        permitCaching=false;
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (dbConf.isCompressed()) {
      m=m.compressionEnable();
    }
    if (permitCaching && dbConf.getCacheSize() > 0) {
      m=m.cacheLRUEnable().cacheSize(dbConf.getCacheSize());
    }
 else {
      m=m.cacheDisable();
    }
    m=m.transactionDisable();
    if (SynchronizedBlocks.WITHOUT_SYNCHRONIZED.isActivated()) {
    }
 else {
      m=m.asyncWriteEnable();
    }
    m=m.closeOnJvmShutdown();
    db=m.make();
    dbRegistry.put(dbType,db);
  }
  return db;
}