nus-yam/ex-repair huggingface dataset:
Program: 124363
Project: 124363
Buggy source:
/** 
 * @param orderPositionId is the {@link OrderPositionEto#getId() ID} of the requested {@link OrderPositionEto}.
 * @return the {@link OrderPositionEto} with the given ID. Will be {@code null} if the {@link OrderPositionEto}does not exist.
 */
OrderPositionEto findOrderPosition(Long orderPositionId);

Fixed version (ground truth):
/** 
 * @param orderPositionId is the {@link OrderPositionEto#getId() ID} of the requested {@link OrderPositionEto}.
 * @return the {@link OrderPositionEto} with the given ID. Will be {@code null} if the {@link OrderPositionEto} doesnot exist.
 */
OrderPositionEto findOrderPosition(long orderPositionId);
Program: 124364
Project: 124364
Buggy source:
/** 
 * @param orderId for which the {@link OrderPositionEto}s are requested.
 * @return the {@link List} of all {@link OrderPositionEto}s   {@link OrderPositionEto#getId() associated} with thegiven <code>orderId</code>. Will be the empty  {@link List} if no such {@link OrderPositionEto} exists.
 */
List<OrderPositionEto> findOpenOrderPositionsByOrderId(Long orderId);

Fixed version (ground truth):
/** 
 * @param orderId for which the {@link OrderPositionEto}s are requested.
 * @return the {@link List} of all {@link OrderPositionEto}s   {@link OrderPositionEto#getId() associated} with thegiven <code>orderId</code>. Will be the empty  {@link List} if no such {@link OrderPositionEto} exists.
 */
List<OrderPositionEto> findOpenOrderPositionsByOrderId(long orderId);
Program: 124365
Project: 124365
Buggy source:
/** 
 * @param orderId is the {@link io.oasp.gastronomy.restaurant.salesmanagement.common.api.Order#getId() ID} of the{@link io.oasp.gastronomy.restaurant.salesmanagement.common.api.Order} for which the{@link OrderPositionEto positions} are requested.
 * @return the {@link List} of {@link OrderPositionEto}s   {@link OrderPositionEto#getOrderId() associated} with thegiven <code>orderId</code>.
 */
List<OrderPositionEto> findOrderPositionsByOrderId(Long orderId);

Fixed version (ground truth):
/** 
 * @param orderId is the {@link io.oasp.gastronomy.restaurant.salesmanagement.common.api.Order#getId() ID} of the{@link io.oasp.gastronomy.restaurant.salesmanagement.common.api.Order} for which the{@link OrderPositionEto positions} are requested.
 * @return the {@link List} of {@link OrderPositionEto}s   {@link OrderPositionEto#getOrderId() associated} with thegiven <code>orderId</code>.
 */
List<OrderPositionEto> findOrderPositionsByOrderId(long orderId);
Program: 124366
Project: 124366
Buggy source:
/** 
 * This method deletes a   {@link BillEto} from the database by its given id.
 * @param billId the ID of the {@link BillEto} that has to be deleted.
 */
void deleteBill(Long billId);

Fixed version (ground truth):
/** 
 * This method deletes a   {@link BillEto} from the database by its given id.
 * @param billId the ID of the {@link BillEto} that has to be deleted.
 */
void deleteBill(long billId);
Program: 124367
Project: 124367
Buggy source:
/** 
 * @param id is the {@link OrderEto#getId() ID} of the order to delete.
 */
void deleteOrder(Long id);

Fixed version (ground truth):
/** 
 * @param id is the {@link OrderEto#getId() ID} of the order to delete.
 */
void deleteOrder(long id);
Program: 124368
Project: 124368
Buggy source:
@Override public OrderEto findOrder(Long id){
  return this.ucFindOrder.findOrder(id);
}

Fixed version (ground truth):
@Override public OrderEto findOrder(long id){
  return this.ucFindOrder.findOrder(id);
}
Program: 124369
Project: 124369
Buggy source:
@Override public BillCto findBill(Long id){
  return this.ucFindBill.findBill(id);
}

Fixed version (ground truth):
@Override public BillCto findBill(long id){
  return this.ucFindBill.findBill(id);
}
Program: 124370
Project: 124370
Buggy source:
@Override public void deleteOrder(Long id){
  this.ucManageOrder.deleteOrder(id);
}

Fixed version (ground truth):
@Override public void deleteOrder(long id){
  this.ucManageOrder.deleteOrder(id);
}
Program: 124371
Project: 124371
Buggy source:
@Override public List<OrderPositionEto> findOrderPositionsByOrderId(Long orderId){
  return this.ucFindOrderPosition.findOrderPositionsByOrderId(orderId);
}

Fixed version (ground truth):
@Override public List<OrderPositionEto> findOrderPositionsByOrderId(long orderId){
  return this.ucFindOrderPosition.findOrderPositionsByOrderId(orderId);
}
Program: 124372
Project: 124372
Buggy source:
@Override public List<OrderPositionEto> findOpenOrderPositionsByOrderId(Long orderId){
  return this.ucFindOrderPosition.findOpenOrderPositionsByOrderId(orderId);
}

Fixed version (ground truth):
@Override public List<OrderPositionEto> findOpenOrderPositionsByOrderId(long orderId){
  return this.ucFindOrderPosition.findOpenOrderPositionsByOrderId(orderId);
}
Program: 124373
Project: 124373
Buggy source:
@Override public OrderPositionEto findOrderPosition(Long orderPositionId){
  return this.ucFindOrderPosition.findOrderPosition(orderPositionId);
}

Fixed version (ground truth):
@Override public OrderPositionEto findOrderPosition(long orderPositionId){
  return this.ucFindOrderPosition.findOrderPosition(orderPositionId);
}
Program: 124374
Project: 124374
Buggy source:
@Override public void deleteBill(Long billId){
  this.ucManageBill.deleteBill(billId);
}

Fixed version (ground truth):
@Override public void deleteBill(long billId){
  this.ucManageBill.deleteBill(billId);
}
Program: 124375
Project: 124375
Buggy source:
@Override public OrderEto findOpenOrderForTable(Long tableId){
  return this.ucFindOrder.findOpenOrderForTable(tableId);
}

Fixed version (ground truth):
@Override public OrderEto findOpenOrderForTable(long tableId){
  return this.ucFindOrder.findOpenOrderForTable(tableId);
}
Program: 124376
Project: 124376
Buggy source:
@Override @RolesAllowed(PermissionConstants.FIND_BILL) public BillCto findBill(Long id){
  LOG.debug("String_Node_Str" + id + "String_Node_Str");
  BillCto billCto=new BillCto();
  BillEto bill=getBeanMapper().map(getBillDao().findOne(id),BillEto.class);
  if (bill == null) {
    return null;
  }
  billCto.setBill(bill);
  List<OrderPositionEto> orderPositions=new ArrayList<>();
  for (  Long orderPositionId : bill.getOrderPositionIds()) {
    OrderPositionEto position=this.salesmanagement.findOrderPosition(orderPositionId);
    orderPositions.add(position);
  }
  billCto.setPositions(orderPositions);
  return billCto;
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.FIND_BILL) public BillCto findBill(long id){
  LOG.debug("String_Node_Str" + id + "String_Node_Str");
  BillCto billCto=new BillCto();
  BillEto bill=getBeanMapper().map(getBillDao().findOne(id),BillEto.class);
  if (bill == null) {
    return null;
  }
  billCto.setBill(bill);
  List<OrderPositionEto> orderPositions=new ArrayList<>();
  for (  Long orderPositionId : bill.getOrderPositionIds()) {
    OrderPositionEto position=this.salesmanagement.findOrderPosition(orderPositionId);
    orderPositions.add(position);
  }
  billCto.setPositions(orderPositions);
  return billCto;
}
Program: 124377
Project: 124377
Buggy source:
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public OrderEto findOrder(Long orderId){
  LOG.debug("String_Node_Str");
  return getBeanMapper().map(getOrderDao().findOne(orderId),OrderEto.class);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public OrderEto findOrder(long orderId){
  LOG.debug("String_Node_Str");
  return getBeanMapper().map(getOrderDao().findOne(orderId),OrderEto.class);
}
Program: 124378
Project: 124378
Buggy source:
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public OrderEto findOpenOrderForTable(Long tableId){
  OrderEntity order=getOrderDao().findOpenOrderByTable(tableId);
  return getBeanMapper().map(order,OrderEto.class);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public OrderEto findOpenOrderForTable(long tableId){
  OrderEntity order=getOrderDao().findOpenOrderByTable(tableId);
  return getBeanMapper().map(order,OrderEto.class);
}
Program: 124379
Project: 124379
Buggy source:
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public OrderPositionEto findOrderPosition(Long orderPositionId){
  LOG.debug("String_Node_Str");
  OrderPositionEntity orderPositionEntities=getOrderPositionDao().findOne(orderPositionId);
  OrderPositionEto orderPositionBo=getBeanMapper().map(orderPositionEntities,OrderPositionEto.class);
  return orderPositionBo;
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public OrderPositionEto findOrderPosition(long orderPositionId){
  LOG.debug("String_Node_Str");
  OrderPositionEntity orderPositionEntities=getOrderPositionDao().findOne(orderPositionId);
  OrderPositionEto orderPositionBo=getBeanMapper().map(orderPositionEntities,OrderPositionEto.class);
  return orderPositionBo;
}
Program: 124380
Project: 124380
Buggy source:
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public List<OrderPositionEto> findOpenOrderPositionsByOrderId(Long orderId){
  LOG.debug("String_Node_Str" + orderId + "String_Node_Str");
  return getBeanMapper().mapList(getOrderPositionDao().findOpenOrderPositionsByOrder(orderId),OrderPositionEto.class);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public List<OrderPositionEto> findOpenOrderPositionsByOrderId(long orderId){
  LOG.debug("String_Node_Str" + orderId + "String_Node_Str");
  return getBeanMapper().mapList(getOrderPositionDao().findOpenOrderPositionsByOrder(orderId),OrderPositionEto.class);
}
Program: 124381
Project: 124381
Buggy source:
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public List<OrderPositionEto> findOrderPositionsByOrderId(Long orderId){
  List<OrderPositionEntity> positions=getOrderPositionDao().findOrderPositionsByOrder(orderId);
  return getBeanMapper().mapList(positions,OrderPositionEto.class);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public List<OrderPositionEto> findOrderPositionsByOrderId(long orderId){
  List<OrderPositionEntity> positions=getOrderPositionDao().findOrderPositionsByOrder(orderId);
  return getBeanMapper().mapList(positions,OrderPositionEto.class);
}
Program: 124382
Project: 124382
Buggy source:
@Override @RolesAllowed(PermissionConstants.DELETE_BILL) public void deleteBill(Long billId){
  getBillDao().delete(billId);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.DELETE_BILL) public void deleteBill(long billId){
  getBillDao().delete(billId);
}
Program: 124383
Project: 124383
Buggy source:
@Override @RolesAllowed(PermissionConstants.DELETE_ORDER) public void deleteOrder(Long id){
  getOrderDao().delete(id);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.DELETE_ORDER) public void deleteOrder(long id){
  getOrderDao().delete(id);
}
Program: 124384
Project: 124384
Buggy source:
@Override public boolean isValid(Money value,ConstraintValidatorContext context){
  return value.getValue().compareTo(BigDecimal.ZERO) >= 0;
}

Fixed version (ground truth):
@Override public boolean isValid(Money value,ConstraintValidatorContext context){
  if (value == null) {
    return true;
  }
  return value.getValue().compareTo(BigDecimal.ZERO) >= 0;
}
Program: 124385
Project: 124385
Buggy source:
/** 
 * Sets the field 'comment'.
 * @param comment new value for comment
 */
public void setComment(String comment){
  this.comment=comment;
}

Fixed version (ground truth):
/** 
 * Sets the field 'comment'.
 * @param comment new value for comment
 */
@Override public void setComment(String comment){
  this.comment=comment;
}
Program: 124386
Project: 124386
Buggy source:
/** 
 * Returns the field 'comment'.
 * @return Comment as string
 */
public String getComment(){
  return this.comment;
}

Fixed version (ground truth):
/** 
 * Returns the field 'comment'.
 * @return Comment as string
 */
@Override public String getComment(){
  return this.comment;
}
Program: 124387
Project: 124387
Buggy source:
/** 
 * Saves or updates the given   {@link OrderPositionEto}.
 * @param orderPosition is the {@link OrderPositionEto} to persist.
 * @return the saved {@link OrderPositionEto}.
 */
OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition);

Fixed version (ground truth):
/** 
 * Saves or updates the given   {@link OrderPositionEto}.
 * @param orderPosition is the {@link OrderPositionEto} to persist.
 * @return the saved {@link OrderPositionEto}.
 */
OrderPositionEto saveOrderPosition(@Valid OrderPositionEto orderPosition);
Program: 124388
Project: 124388
Buggy source:
/** 
 * @param currentOrderPosition is the current {@link OrderPosition} from the persistence.
 * @param updateOrderPosition is the new {@link OrderPosition} to update to.
 */
private void verifyUpdate(OrderPosition currentOrderPosition,OrderPosition updateOrderPosition){
  if (!Objects.equals(currentOrderPosition.getOrderId(),currentOrderPosition.getOrderId())) {
    throw new IllegalPropertyChangeException(updateOrderPosition,"String_Node_Str");
  }
  if (!Objects.equals(currentOrderPosition.getOfferId(),currentOrderPosition.getOfferId())) {
    throw new IllegalPropertyChangeException(updateOrderPosition,"String_Node_Str");
  }
  OrderPositionState currentState=currentOrderPosition.getState();
  OrderPositionState newState=updateOrderPosition.getState();
  ProductOrderState newDrinkState=updateOrderPosition.getDrinkState();
  verifyOrderPositionStateChange(updateOrderPosition,currentState,newState);
  verifyDrinkStateChange(updateOrderPosition,currentState,newState,newDrinkState);
}

Fixed version (ground truth):
/** 
 * @param currentOrderPosition is the current {@link OrderPosition} from the persistence.
 * @param updateOrderPosition is the new {@link OrderPosition} to update to.
 */
private void verifyUpdate(OrderPosition currentOrderPosition,OrderPosition updateOrderPosition){
  if (!Objects.equals(currentOrderPosition.getOrderId(),currentOrderPosition.getOrderId())) {
    throw new IllegalPropertyChangeException(updateOrderPosition,"String_Node_Str");
  }
  if (!Objects.equals(currentOrderPosition.getOfferId(),currentOrderPosition.getOfferId())) {
    throw new IllegalPropertyChangeException(updateOrderPosition,"String_Node_Str");
  }
  if (!Objects.equals(currentOrderPosition.getPrice(),currentOrderPosition.getPrice())) {
    throw new IllegalPropertyChangeException(updateOrderPosition,"String_Node_Str");
  }
  if (!Objects.equals(currentOrderPosition.getOfferName(),currentOrderPosition.getOfferName())) {
    throw new IllegalPropertyChangeException(updateOrderPosition,"String_Node_Str");
  }
  OrderPositionState currentState=currentOrderPosition.getState();
  OrderPositionState newState=updateOrderPosition.getState();
  ProductOrderState newDrinkState=updateOrderPosition.getDrinkState();
  verifyOrderPositionStateChange(updateOrderPosition,currentState,newState);
  verifyDrinkStateChange(updateOrderPosition,currentState,newState,newDrinkState);
}
Program: 124389
Project: 124389
Buggy source:
@Override @RolesAllowed(PermissionConstants.SAVE_ORDER_POSITION) public OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition){
  Objects.requireNonNull(orderPosition,"String_Node_Str");
  Long orderPositionId=orderPosition.getId();
  String action;
  if (orderPositionId == null) {
    action="String_Node_Str";
  }
 else {
    OrderPositionEntity targetOrderPosition=getOrderPositionDao().find(orderPositionId);
    verifyUpdate(targetOrderPosition,orderPosition);
    action="String_Node_Str";
  }
  OrderPositionEntity orderPositionEntity=getBeanMapper().map(orderPosition,OrderPositionEntity.class);
  orderPositionEntity=getOrderPositionDao().save(orderPositionEntity);
  LOG.debug("String_Node_Str",orderPositionEntity.getId(),action);
  return getBeanMapper().map(orderPositionEntity,OrderPositionEto.class);
}

Fixed version (ground truth):
@Override @RolesAllowed(PermissionConstants.SAVE_ORDER_POSITION) public OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition){
  Objects.requireNonNull(orderPosition,"String_Node_Str");
  Long orderPositionId=orderPosition.getId();
  String action;
  if (orderPositionId == null) {
    action="String_Node_Str";
    Long offerId=orderPosition.getOfferId();
    OfferEto offer=this.offerManagement.findOffer(offerId);
    Objects.requireNonNull(offer,"String_Node_Str" + offerId);
    orderPosition.setPrice(offer.getPrice());
    orderPosition.setOfferName(offer.getName());
  }
 else {
    OrderPositionEntity targetOrderPosition=getOrderPositionDao().find(orderPositionId);
    verifyUpdate(targetOrderPosition,orderPosition);
    action="String_Node_Str";
  }
  OrderPositionEntity orderPositionEntity=getBeanMapper().map(orderPosition,OrderPositionEntity.class);
  orderPositionEntity=getOrderPositionDao().save(orderPositionEntity);
  LOG.debug("String_Node_Str",orderPositionEntity.getId(),action);
  return getBeanMapper().map(orderPositionEntity,OrderPositionEto.class);
}
Program: 124390
Project: 124390
Buggy source:
/** 
 * Gets the profile of the user being currently logged in.
 * @param request provided by the RS-Context
 * @return the {@link UserData} taken from the Spring Security context
 */
@Produces(MediaType.APPLICATION_JSON) @GET @Path("String_Node_Str") public UserDetailsClientTo getCurrentUser(@Context HttpServletRequest request){
  if (request.getRemoteUser() == null) {
    throw new NoActiveUserException();
  }
  return UserData.get().toClientTo();
}

Fixed version (ground truth):
/** 
 * Gets the profile of the user being currently logged in.
 * @param request provided by the RS-Context
 * @return the {@link UserData} taken from the Spring Security context
 */
@Produces(MediaType.APPLICATION_JSON) @GET @Path("String_Node_Str") @PermitAll public UserDetailsClientTo getCurrentUser(@Context HttpServletRequest request){
  if (request.getRemoteUser() == null) {
    throw new NoActiveUserException();
  }
  return UserData.get().toClientTo();
}
Program: 124391
Project: 124391
Buggy source:
/** 
 * Retrieves the CSRF token from the server session.
 * @param request {@link HttpServletRequest} to retrieve the current session from
 * @param response {@link HttpServletResponse} to send additional information
 * @return the Spring Security {@link CsrfToken}
 */
@Produces(MediaType.APPLICATION_JSON) @GET @Path("String_Node_Str") public CsrfToken getCsrfToken(@Context HttpServletRequest request,@Context HttpServletResponse response){
  CsrfToken token=this.csrfTokenRepository.loadToken(request);
  if (token == null) {
    LOG.warn("String_Node_Str");
    token=this.csrfTokenRepository.generateToken(request);
    this.csrfTokenRepository.saveToken(token,request,response);
  }
  return token;
}

Fixed version (ground truth):
/** 
 * Retrieves the CSRF token from the server session.
 * @param request {@link HttpServletRequest} to retrieve the current session from
 * @param response {@link HttpServletResponse} to send additional information
 * @return the Spring Security {@link CsrfToken}
 */
@Produces(MediaType.APPLICATION_JSON) @GET @Path("String_Node_Str") @PermitAll public CsrfToken getCsrfToken(@Context HttpServletRequest request,@Context HttpServletResponse response){
  CsrfToken token=this.csrfTokenRepository.loadToken(request);
  if (token == null) {
    LOG.warn("String_Node_Str");
    token=this.csrfTokenRepository.generateToken(request);
    this.csrfTokenRepository.saveToken(token,request,response);
  }
  return token;
}
Program: 124392
Project: 124392
Buggy source:
/** 
 * Sets the field 'ucFindProduct'.
 * @param ucFindProduct New value for ucFindProduct
 */
@Inject public void setUcFindProduct(UcFindProductImpl ucFindProduct){
  this.ucFindProduct=ucFindProduct;
}

Fixed version (ground truth):
/** 
 * Sets the field 'ucFindProduct'.
 * @param ucFindProduct New value for ucFindProduct
 */
@Inject public void setUcFindProduct(UcFindProduct ucFindProduct){
  this.ucFindProduct=ucFindProduct;
}
Program: 124393
Project: 124393
Buggy source:
/** 
 * Sets the field 'ucManageOffer'.
 * @param ucManageOffer New value for ucManageOffer
 */
@Inject public void setUcManageOffer(UcManageOfferImpl ucManageOffer){
  this.ucManageOffer=ucManageOffer;
}

Fixed version (ground truth):
/** 
 * Sets the field 'ucManageOffer'.
 * @param ucManageOffer New value for ucManageOffer
 */
@Inject public void setUcManageOffer(UcManageOffer ucManageOffer){
  this.ucManageOffer=ucManageOffer;
}
Program: 124394
Project: 124394
Buggy source:
/** 
 * Sets the field 'ucManageProduct'.
 * @param ucManageProduct New value for ucManageProduct
 */
@Inject public void setUcManageProduct(UcManageProductImpl ucManageProduct){
  this.ucManageProduct=ucManageProduct;
}

Fixed version (ground truth):
/** 
 * Sets the field 'ucManageProduct'.
 * @param ucManageProduct New value for ucManageProduct
 */
@Inject public void setUcManageProduct(UcManageProduct ucManageProduct){
  this.ucManageProduct=ucManageProduct;
}
Program: 124395
Project: 124395
Buggy source:
/** 
 * Sets the field 'ucFindOffer'.
 * @param ucFindOffer New value for ucFindOffer
 */
@Inject public void setUcFindOffer(UcFindOfferImpl ucFindOffer){
  this.ucFindOffer=ucFindOffer;
}

Fixed version (ground truth):
/** 
 * Sets the field 'ucFindOffer'.
 * @param ucFindOffer New value for ucFindOffer
 */
@Inject public void setUcFindOffer(UcFindOffer ucFindOffer){
  this.ucFindOffer=ucFindOffer;
}
Program: 124396
Project: 124396
Buggy source:
/** 
 * @param ucFindOrderPosition the {@link UcFindOrderPosition} to {@link Inject}.
 */
@Inject public void setUcFindOrderPosition(UcFindOrderPositionImpl ucFindOrderPosition){
  this.ucFindOrderPosition=ucFindOrderPosition;
}

Fixed version (ground truth):
/** 
 * @param ucFindOrderPosition the {@link UcFindOrderPosition} to {@link Inject}.
 */
@Inject public void setUcFindOrderPosition(UcFindOrderPosition ucFindOrderPosition){
  this.ucFindOrderPosition=ucFindOrderPosition;
}
Program: 124397
Project: 124397
Buggy source:
/** 
 * Marks the   {@link BillEntity} and its contained {@link OrderPositionEntity}s as payed.
 * @param bill {@link BillEntity} to be payed
 */
private void markBillAndOrderPositionsAsPayed(BillEto bill){
  bill.setPayed(true);
  LOG.debug("String_Node_Str" + bill.getId() + "String_Node_Str");
  update(bill);
  for (  Long orderPositionId : bill.getOrderPositionIds()) {
    OrderPositionEto orderPosition=this.ucFindOrderPosition.findOrderPosition(orderPositionId);
    verifyNotClosed(orderPosition);
    this.ucManageOrderPosition.markOrderPositionAs(orderPosition,OrderPositionState.PAYED);
    LOG.debug("String_Node_Str",orderPositionId,bill.getId());
  }
}

Fixed version (ground truth):
/** 
 * Marks the   {@link BillEntity} and its contained {@link OrderPositionEntity}s as payed.
 * @param bill {@link BillEntity} to be payed
 */
private void markBillAndOrderPositionsAsPayed(BillEto bill){
  bill.setPayed(true);
  LOG.debug("String_Node_Str" + bill.getId() + "String_Node_Str");
  update(bill);
  for (  Long orderPositionId : bill.getOrderPositionIds()) {
    OrderPositionEto orderPosition=this.salesmanagement.findOrderPosition(orderPositionId);
    verifyNotClosed(orderPosition);
    this.salesmanagement.markOrderPositionAs(orderPosition,OrderPositionState.PAYED);
    LOG.debug("String_Node_Str",orderPositionId,bill.getId());
  }
}
Program: 124398
Project: 124398
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.SAVE_BILL) public BillEto createBill(List<OrderPositionEto> orderPositions,Money tip){
  Objects.requireNonNull(orderPositions,"String_Node_Str");
  Money total=Money.ZERO;
  for (  OrderPositionEto position : orderPositions) {
    OrderPositionEto orderPosition=this.ucFindOrderPosition.findOrderPosition(position.getId());
    verifyNotClosed(orderPosition);
    total=total.add(orderPosition.getPrice());
  }
  Money localTip=tip;
  if (localTip == null) {
    localTip=Money.ZERO;
  }
  BillEntity bill=new BillEntity();
  List<OrderPositionEntity> myOrderPositions=new ArrayList<>();
  for (  OrderPositionEto position : orderPositions) {
    myOrderPositions.add(getBeanMapper().map(position,OrderPositionEntity.class));
  }
  bill.setOrderPositions(myOrderPositions);
  bill.setTip(localTip);
  bill.setPayed(false);
  bill.setTotal(total);
  getBillDao().save(bill);
  BillEto returnBill=getBeanMapper().map(bill,BillEto.class);
  LOG.debug("String_Node_Str",returnBill.getId());
  return returnBill;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.SAVE_BILL) public BillEto createBill(List<OrderPositionEto> orderPositions,Money tip){
  Objects.requireNonNull(orderPositions,"String_Node_Str");
  Money total=Money.ZERO;
  for (  OrderPositionEto position : orderPositions) {
    OrderPositionEto orderPosition=this.salesmanagement.findOrderPosition(position.getId());
    verifyNotClosed(orderPosition);
    total=total.add(orderPosition.getPrice());
  }
  Money localTip=tip;
  if (localTip == null) {
    localTip=Money.ZERO;
  }
  BillEntity bill=new BillEntity();
  List<OrderPositionEntity> myOrderPositions=new ArrayList<>();
  for (  OrderPositionEto position : orderPositions) {
    myOrderPositions.add(getBeanMapper().map(position,OrderPositionEntity.class));
  }
  bill.setOrderPositions(myOrderPositions);
  bill.setTip(localTip);
  bill.setPayed(false);
  bill.setTotal(total);
  getBillDao().save(bill);
  BillEto returnBill=getBeanMapper().map(bill,BillEto.class);
  LOG.debug("String_Node_Str",returnBill.getId());
  return returnBill;
}
Program: 124399
Project: 124399
Buggy source:
/** 
 * This method updates a   {@link BillEntity} by checking the existence of a bill with that {@link BillEntity#getId() id} in the database. If no such {@link BillEntity} exists, a new bill will be created by calling{@link UcManageBillImpl#create(List,Money)}. Otherwise, the existing   {@link BillEntity} will be updated byoverriding the set  {@link BillEntity#getOrderPositions() order positions},   {@link BillEntity#getTip() tip} and the{@link BillEntity#getTotal() total amount}.
 * @param bill The {@link BillEntity} to update.
 * @return the updated {@link BillEntity}
 */
private BillEto update(BillEto bill){
  Objects.requireNonNull(bill,"String_Node_Str");
  Long billId=bill.getId();
  BillEntity targetBill=getBillDao().findOne(billId);
  List<Long> orderPositionIds=bill.getOrderPositionIds();
  if (targetBill == null) {
    List<OrderPositionEto> orderPositions=new ArrayList<>();
    for (    Long id : orderPositionIds) {
      OrderPositionEto position=this.ucFindOrderPosition.findOrderPosition(id);
      orderPositions.add(position);
    }
    return createBill(orderPositions,bill.getTip());
  }
 else {
    targetBill.setOrderPositionIds(orderPositionIds);
    targetBill.setPayed(bill.isPayed());
    targetBill.setTip(bill.getTip());
    targetBill.setTotal(bill.getTotal());
    getBillDao().save(targetBill);
    LOG.debug("String_Node_Str",billId);
    return getBeanMapper().map(targetBill,BillEto.class);
  }
}

Fixed version (ground truth):
/** 
 * This method updates a   {@link BillEntity} by checking the existence of a bill with that {@link BillEntity#getId() id} in the database. If no such {@link BillEntity} exists, a new bill will be created by calling{@link UcManageBillImpl#create(List,Money)}. Otherwise, the existing   {@link BillEntity} will be updated byoverriding the set  {@link BillEntity#getOrderPositions() order positions},   {@link BillEntity#getTip() tip} and the{@link BillEntity#getTotal() total amount}.
 * @param bill The {@link BillEntity} to update.
 * @return the updated {@link BillEntity}
 */
private BillEto update(BillEto bill){
  Objects.requireNonNull(bill,"String_Node_Str");
  Long billId=bill.getId();
  BillEntity targetBill=getBillDao().findOne(billId);
  List<Long> orderPositionIds=bill.getOrderPositionIds();
  if (targetBill == null) {
    List<OrderPositionEto> orderPositions=new ArrayList<>();
    for (    Long id : orderPositionIds) {
      OrderPositionEto position=this.salesmanagement.findOrderPosition(id);
      orderPositions.add(position);
    }
    return createBill(orderPositions,bill.getTip());
  }
 else {
    targetBill.setOrderPositionIds(orderPositionIds);
    targetBill.setPayed(bill.isPayed());
    targetBill.setTip(bill.getTip());
    targetBill.setTotal(bill.getTotal());
    getBillDao().save(targetBill);
    LOG.debug("String_Node_Str",billId);
    return getBeanMapper().map(targetBill,BillEto.class);
  }
}
Program: 124400
Project: 124400
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected UserProfile retrievePrincipal(String username,UsernamePasswordAuthenticationToken authentication){
  try {
    return this.usermanagement.findUserProfileByLogin(username);
  }
 catch (  RuntimeException e) {
    UsernameNotFoundException exception=new UsernameNotFoundException("String_Node_Str",e);
    LOG.warn("String_Node_Str",username,exception);
    throw exception;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected UserProfile retrievePrincipal(String username,UsernamePasswordAuthenticationToken authentication){
  try {
    return this.usermanagement.findUserProfileByLogin(username);
  }
 catch (  RuntimeException e) {
    e.printStackTrace();
    UsernameNotFoundException exception=new UsernameNotFoundException("String_Node_Str",e);
    LOG.warn("String_Node_Str",username,exception);
    throw exception;
  }
}
Program: 124401
Project: 124401
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public OfferCto findOfferCto(Long id){
  LOG.debug("String_Node_Str",id);
  OfferCto result=new OfferCto();
  OfferEto offerEto=findOffer(id);
  if (offerEto == null) {
    return null;
  }
  result.setOffer(offerEto);
  Long mealId=offerEto.getMealId();
  if (mealId != null) {
    result.setMeal(this.offerManagement.findMeal(mealId));
  }
  Long drinkId=offerEto.getDrinkId();
  if (drinkId != null) {
    result.setDrink(this.offerManagement.findDrink(drinkId));
  }
  Long sideDishId=offerEto.getSideDishId();
  if (sideDishId != null) {
    result.setSideDish(this.offerManagement.findSideDish(sideDishId));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_OFFER) public OfferCto findOfferCto(Long id){
  LOG.debug("String_Node_Str",id);
  OfferCto result=new OfferCto();
  OfferEto offerEto=findOffer(id);
  if (offerEto == null) {
    return null;
  }
  result.setOffer(offerEto);
  Long mealId=offerEto.getMealId();
  if (mealId != null) {
    result.setMeal(this.offerManagement.findMeal(mealId));
  }
  Long drinkId=offerEto.getDrinkId();
  if (drinkId != null) {
    result.setDrink(this.offerManagement.findDrink(drinkId));
  }
  Long sideDishId=offerEto.getSideDishId();
  if (sideDishId != null) {
    result.setSideDish(this.offerManagement.findSideDish(sideDishId));
  }
  return result;
}
Program: 124402
Project: 124402
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public BinaryObjectEto findProductPicture(Long productId){
  return getUcManageBinaryObject().findBinaryObject(findProduct(productId).getPictureId());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_PRODUCT) public BinaryObjectEto findProductPicture(Long productId){
  return getUcManageBinaryObject().findBinaryObject(findProduct(productId).getPictureId());
}
Program: 124403
Project: 124403
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public SideDishEto findSideDish(Long id){
  ProductEto product=findProduct(id);
  try {
    return (SideDishEto)product;
  }
 catch (  ClassCastException e) {
    throw new ObjectMismatchException(product,SideDishEto.class,e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_PRODUCT) public SideDishEto findSideDish(Long id){
  ProductEto product=findProduct(id);
  try {
    return (SideDishEto)product;
  }
 catch (  ClassCastException e) {
    throw new ObjectMismatchException(product,SideDishEto.class,e);
  }
}
Program: 124404
Project: 124404
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DrinkEto findDrink(Long id){
  ProductEto product=findProduct(id);
  try {
    return (DrinkEto)product;
  }
 catch (  ClassCastException e) {
    throw new ObjectMismatchException(product,DrinkEto.class,e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_PRODUCT) public DrinkEto findDrink(Long id){
  ProductEto product=findProduct(id);
  try {
    return (DrinkEto)product;
  }
 catch (  ClassCastException e) {
    throw new ObjectMismatchException(product,DrinkEto.class,e);
  }
}
Program: 124405
Project: 124405
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public MealEto findMeal(Long id){
  ProductEto product=findProduct(id);
  try {
    return (MealEto)product;
  }
 catch (  ClassCastException e) {
    throw new ObjectMismatchException(product,MealEto.class,e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_PRODUCT) public MealEto findMeal(Long id){
  ProductEto product=findProduct(id);
  try {
    return (MealEto)product;
  }
 catch (  ClassCastException e) {
    throw new ObjectMismatchException(product,MealEto.class,e);
  }
}
Program: 124406
Project: 124406
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void changeTable(OrderEto order,TableEto newTable){
  long oldTableId=order.getTableId();
  TableState oldTableState=this.tableManagement.findTable(oldTableId).getState();
  order.setTableId(newTable.getId());
  this.tableManagement.markTableAs(this.tableManagement.findTable(oldTableId),TableState.FREE);
  this.tableManagement.markTableAs(newTable,oldTableState);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.SAVE_TABLE) public void changeTable(OrderEto order,TableEto newTable){
  long oldTableId=order.getTableId();
  TableState oldTableState=this.tableManagement.findTable(oldTableId).getState();
  order.setTableId(newTable.getId());
  this.tableManagement.markTableAs(this.tableManagement.findTable(oldTableId),TableState.FREE);
  this.tableManagement.markTableAs(newTable,oldTableState);
}
Program: 124407
Project: 124407
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<OrderEto> findOrderEtos(OrderSearchCriteriaTo criteria){
  criteria.limitMaximumHitCount(MAXIMUM_HIT_LIMIT);
  List<OrderEntity> orders=getOrderDao().findOrders(criteria);
  return getBeanMapper().mapList(orders,OrderEto.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public List<OrderEto> findOrderEtos(OrderSearchCriteriaTo criteria){
  criteria.limitMaximumHitCount(MAXIMUM_HIT_LIMIT);
  List<OrderEntity> orders=getOrderDao().findOrders(criteria);
  return getBeanMapper().mapList(orders,OrderEto.class);
}
Program: 124408
Project: 124408
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public OrderCto findOrderCto(OrderEto order){
  OrderCto result=new OrderCto();
  result.setOrder(order);
  List<OrderPositionEto> positions=this.salesManagement.findOrderPositionsByOrderId(order.getId());
  result.setPositions(positions);
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public OrderCto findOrderCto(OrderEto order){
  OrderCto result=new OrderCto();
  result.setOrder(order);
  List<OrderPositionEto> positions=this.salesManagement.findOrderPositionsByOrderId(order.getId());
  result.setPositions(positions);
  return result;
}
Program: 124409
Project: 124409
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public OrderEto findOpenOrderForTable(Long tableId){
  OrderEntity order=getOrderDao().findOpenOrderByTable(tableId);
  return getBeanMapper().map(order,OrderEto.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_ORDER) public OrderEto findOpenOrderForTable(Long tableId){
  OrderEntity order=getOrderDao().findOpenOrderByTable(tableId);
  return getBeanMapper().map(order,OrderEto.class);
}
Program: 124410
Project: 124410
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<OrderPositionEto> findOpenOrderPositionsByOrderId(Long orderId){
  LOG.debug("String_Node_Str" + orderId + "String_Node_Str");
  return getBeanMapper().mapList(getOrderPositionDao().findOpenOrderPositionsByOrder(orderId),OrderPositionEto.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public List<OrderPositionEto> findOpenOrderPositionsByOrderId(Long orderId){
  LOG.debug("String_Node_Str" + orderId + "String_Node_Str");
  return getBeanMapper().mapList(getOrderPositionDao().findOpenOrderPositionsByOrder(orderId),OrderPositionEto.class);
}
Program: 124411
Project: 124411
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<OrderPositionEto> findOrderPositionsByOrderId(Long orderId){
  List<OrderPositionEntity> positions=getOrderPositionDao().findOrderPositionsByOrder(orderId);
  return getBeanMapper().mapList(positions,OrderPositionEto.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_ORDER_POSITION) public List<OrderPositionEto> findOrderPositionsByOrderId(Long orderId){
  List<OrderPositionEntity> positions=getOrderPositionDao().findOrderPositionsByOrder(orderId);
  return getBeanMapper().mapList(positions,OrderPositionEto.class);
}
Program: 124412
Project: 124412
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void deleteOrder(Long id){
  getOrderDao().delete(id);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.DELETE_ORDER) public void deleteOrder(Long id){
  getOrderDao().delete(id);
}
Program: 124413
Project: 124413
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public StaffMemberEto findStaffMember(Long id){
  return getBeanMapper().map(getStaffMemberDao().find(id),StaffMemberEto.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_STAFF_MEMBER) public StaffMemberEto findStaffMember(Long id){
  return getBeanMapper().map(getStaffMemberDao().find(id),StaffMemberEto.class);
}
Program: 124414
Project: 124414
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.FIND_STAFF_MEMBER) public StaffMemberEto findStaffMemberByLogin(String login){
  return getBeanMapper().map(getStaffMemberDao().findByLogin(login),StaffMemberEto.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Do not extract this method as a service, because of PermitAll. (only for login)
 */
@Override @RolesAllowed(PermissionConstants.FIND_STAFF_MEMBER) public StaffMemberEto findStaffMemberByLogin(String login){
  return privateFindStaffMemberByLogin(login);
}
Program: 124415
Project: 124415
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void deleteStaffMember(Long staffMemberId){
  getStaffMemberDao().delete(staffMemberId);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @RolesAllowed(PermissionConstants.DELETE_STAFF_MEMBER) public void deleteStaffMember(Long staffMemberId){
  getStaffMemberDao().delete(staffMemberId);
}
Program: 124416
Project: 124416
Buggy source:
/** 
 * Check if all relevant methods in use case implementations have permission checks i.e.   {@link RolesAllowed},  {@link DenyAll} or {@link PermitAll} annotation is applied. This is only checked for methods that are declared inthe corresponding interface and thus have the  {@link Override} annotations applied.
 */
@Test public void permissionCheckAnnotationPresent(){
  String packageName="String_Node_Str";
  Filter<String> filter=new Filter<String>(){
    @Override public boolean accept(    String value){
      return value.contains("String_Node_Str") && value.endsWith("String_Node_Str");
    }
  }
;
  ReflectionUtil ru=ReflectionUtilImpl.getInstance();
  Set<String> classNames=ru.findClassNames(packageName,true,filter);
  Set<Class<?>> classes=ru.loadClasses(classNames);
  for (  Class<?> clazz : classes) {
    Method[] methods=clazz.getDeclaredMethods();
    for (    Method method : methods) {
      if (method.getAnnotation(Override.class) != null) {
        assertTrue("String_Node_Str" + method.getName() + "String_Node_Str"+ clazz.getSimpleName()+ "String_Node_Str",method.getAnnotation(RolesAllowed.class) != null || method.getAnnotation(DenyAll.class) != null || method.getAnnotation(PermitAll.class) != null);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Check if all relevant methods in use case implementations have permission checks i.e.   {@link RolesAllowed},  {@link DenyAll} or {@link PermitAll} annotation is applied. This is only checked for methods that are declared inthe corresponding interface and thus have the  {@link Override} annotations applied.
 */
@Test public void permissionCheckAnnotationPresent(){
  String packageName="String_Node_Str";
  Filter<String> filter=new Filter<String>(){
    @Override public boolean accept(    String value){
      return value.contains("String_Node_Str") && value.endsWith("String_Node_Str");
    }
  }
;
  ReflectionUtil ru=ReflectionUtilImpl.getInstance();
  Set<String> classNames=ru.findClassNames(packageName,true,filter);
  Set<Class<?>> classes=ru.loadClasses(classNames);
  for (  Class<?> clazz : classes) {
    Method[] methods=clazz.getDeclaredMethods();
    for (    Method method : methods) {
      Method parentMethod=ru.getParentMethod(method);
      if (parentMethod != null) {
        Class<?> declaringClass=parentMethod.getDeclaringClass();
        if (declaringClass.isInterface() && declaringClass.getSimpleName().startsWith("String_Node_Str")) {
          assertTrue("String_Node_Str" + method.getName() + "String_Node_Str"+ clazz.getSimpleName()+ "String_Node_Str",method.getAnnotation(RolesAllowed.class) != null || method.getAnnotation(DenyAll.class) != null || method.getAnnotation(PermitAll.class) != null);
        }
      }
    }
  }
}
Program: 124418
Project: 124418
Buggy source:
@Override public void compile(boolean result,IEnvironmentMethod environment){
  if (!result)   return;
  Method method=interfaceClass.getMethods()[0];
  String clsName=environment.makeClassName();
  ClassWriter cw=new ClassWriter(ClassWriter.COMPUTE_FRAMES);
  cw.visit(Opcodes.V1_6,Opcodes.ACC_PUBLIC,clsName,null,"String_Node_Str",new String[]{internal(interfaceClass)});
  MethodOutput constructor=new MethodOutput(cw,Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  constructor.start();
  constructor.loadObject(0);
  constructor.invokeSpecial("String_Node_Str","String_Node_Str","String_Node_Str");
  constructor.ret();
  constructor.end();
  MethodOutput output=new MethodOutput(cw,Opcodes.ACC_PUBLIC,method.getName(),descriptor(method),null,null);
  IEnvironmentClass environmentClass=new EnvironmentClass(cw,environment);
  IEnvironmentMethod environmentMethod=new EnvironmentMethod(output,environmentClass);
  for (int i=0; i < arguments.size(); i++) {
    environmentMethod.putValue(arguments.get(i).getName(),new SymbolArgument(i + 1,environment.getType(method.getGenericParameterTypes()[i])),getPosition());
  }
  output.start();
  for (  Statement statement : statements) {
    statement.compile(environmentMethod);
  }
  output.ret();
  output.end();
  environment.putClass(clsName,cw.toByteArray());
  environment.getOutput().newObject(clsName);
  environment.getOutput().dup();
  environment.getOutput().construct(clsName);
}

Fixed version (ground truth):
@Override public void compile(boolean result,IEnvironmentMethod environment){
  if (!result)   return;
  Method method=interfaceClass.getMethods()[0];
  String clsName=environment.makeClassName();
  ClassWriter cw=new ClassWriter(ClassWriter.COMPUTE_FRAMES);
  cw.visit(Opcodes.V1_6,Opcodes.ACC_PUBLIC,clsName,null,"String_Node_Str",new String[]{internal(interfaceClass)});
  MethodOutput constructor=new MethodOutput(cw,Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  constructor.start();
  constructor.loadObject(0);
  constructor.invokeSpecial("String_Node_Str","String_Node_Str","String_Node_Str");
  constructor.ret();
  constructor.end();
  MethodOutput output=new MethodOutput(cw,Opcodes.ACC_PUBLIC,method.getName(),descriptor(method),null,null);
  IEnvironmentClass environmentClass=new EnvironmentClass(cw,environment);
  IEnvironmentMethod environmentMethod=new EnvironmentMethod(output,environmentClass);
  for (int i=0; i < arguments.size(); i++) {
    environmentMethod.putValue(arguments.get(i).getName(),new SymbolArgument(i + 1,environment.getType(method.getGenericParameterTypes()[i])),getPosition());
  }
  output.start();
  for (  Statement statement : statements) {
    statement.compile(environmentMethod);
  }
  output.end();
  environment.putClass(clsName,cw.toByteArray());
  environment.getOutput().newObject(clsName);
  environment.getOutput().dup();
  environment.getOutput().construct(clsName);
}
Program: 124419
Project: 124419
Buggy source:
private int processChar(CharStream stream){
  if (stream.optional('\\')) {
    if (stream.optional('u'))     return UNICODE_ESCAPE;
    if (stream.optional('e'))     return -1;
    if (stream.optional('r'))     return '\r';
    if (stream.optional('n'))     return '\n';
    if (stream.optional('t'))     return '\t';
    if (stream.optional('['))     return '[';
    if (stream.optional(']'))     return ']';
    if (stream.optional('('))     return '(';
    if (stream.optional(')'))     return ')';
    if (stream.optional('.'))     return '.';
    if (stream.optional('+'))     return '+';
    if (stream.optional('-'))     return '-';
    if (stream.optional('\\'))     return '\\';
    if (stream.optional('{'))     return '{';
    if (stream.optional('}'))     return '}';
    if (stream.optional('?'))     return '?';
    if (stream.optional('*'))     return '*';
    if (stream.optional('~'))     return '~';
    if (stream.optional('|'))     return '|';
    if (stream.optional('^'))     return '^';
    throw new IllegalArgumentException("String_Node_Str" + stream.next());
  }
 else {
    if (stream.peek('[') || stream.peek(']') || stream.peek('(')|| stream.peek(')')|| stream.peek('{')|| stream.peek('}')|| stream.peek('.')|| stream.peek('-')|| stream.peek('+')|| stream.peek('?')|| stream.peek('*')) {
      throw new IllegalArgumentException("String_Node_Str" + stream.next());
    }
 else {
      return stream.next();
    }
  }
}

Fixed version (ground truth):
private int processChar(CharStream stream){
  if (stream.optional('\\')) {
    if (stream.optional('e'))     return -1;
    if (stream.optional('r'))     return '\r';
    if (stream.optional('n'))     return '\n';
    if (stream.optional('t'))     return '\t';
    if (stream.optional('['))     return '[';
    if (stream.optional(']'))     return ']';
    if (stream.optional('('))     return '(';
    if (stream.optional(')'))     return ')';
    if (stream.optional('.'))     return '.';
    if (stream.optional('+'))     return '+';
    if (stream.optional('-'))     return '-';
    if (stream.optional('\\'))     return '\\';
    if (stream.optional('{'))     return '{';
    if (stream.optional('}'))     return '}';
    if (stream.optional('?'))     return '?';
    if (stream.optional('*'))     return '*';
    if (stream.optional('~'))     return '~';
    if (stream.optional('|'))     return '|';
    if (stream.optional('^'))     return '^';
    throw new IllegalArgumentException("String_Node_Str" + stream.next());
  }
 else {
    if (stream.peek('[') || stream.peek(']') || stream.peek('(')|| stream.peek(')')|| stream.peek('{')|| stream.peek('}')|| stream.peek('.')|| stream.peek('-')|| stream.peek('+')|| stream.peek('?')|| stream.peek('*')) {
      throw new IllegalArgumentException("String_Node_Str" + stream.next());
    }
 else {
      return stream.next();
    }
  }
}