nus-yam/ex-repair huggingface dataset:
Program: 39610
Project: 39610
Buggy source:
public Stock getStock(String name){
  Connection connection=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  Stock stockDO=null;
  try {
    connection=dbMgr.getConnection();
    ps=connection.prepareStatement("String_Node_Str");
    ps.setString(1,name);
    rs=ps.executeQuery();
    while (rs.next()) {
      stockDO=new Stock();
      stockDO.setId(rs.getLong("String_Node_Str"));
      stockDO.setName(rs.getString("String_Node_Str"));
      stockDO.setTotal(rs.getInt("String_Node_Str"));
      stockDO.setSold(rs.getDouble("String_Node_Str"));
      stockDO.setPictureUrl(rs.getString("String_Node_Str"));
      stockDO.setLastUpdate(rs.getTimestamp("String_Node_Str"));
      break;
    }
    logger.debug("String_Node_Str" + ps.toString());
  }
 catch (  SQLException ex) {
    logger.error("String_Node_Str" + ps.toString(),ex);
  }
 finally {
    try {
      if (rs != null && !rs.isClosed()) {
        rs.close();
      }
      if (ps != null && !ps.isClosed()) {
        ps.close();
      }
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
  }
  return stockDO;
}

Fixed version (ground truth):
public Stock getStock(String name){
  Connection connection=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  Stock stockDO=null;
  try {
    connection=dbMgr.getConnection();
    ps=connection.prepareStatement("String_Node_Str");
    ps.setString(1,name);
    rs=ps.executeQuery();
    while (rs.next()) {
      stockDO=new Stock();
      stockDO.setId(rs.getLong("String_Node_Str"));
      stockDO.setName(rs.getString("String_Node_Str"));
      stockDO.setTotal(rs.getInt("String_Node_Str"));
      stockDO.setPictureUrl(rs.getString("String_Node_Str"));
      stockDO.setLastUpdate(rs.getTimestamp("String_Node_Str"));
      break;
    }
    logger.debug("String_Node_Str" + ps.toString());
  }
 catch (  SQLException ex) {
    logger.error("String_Node_Str" + ps.toString(),ex);
  }
 finally {
    try {
      if (rs != null && !rs.isClosed()) {
        rs.close();
      }
      if (ps != null && !ps.isClosed()) {
        ps.close();
      }
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
  }
  return stockDO;
}
Program: 39611
Project: 39611
Buggy source:
public void updateStockHistory(){
  Connection connection=null;
  PreparedStatement ps=null;
  try {
    connection=dbMgr.getConnection();
    ps=connection.prepareStatement("String_Node_Str" + "String_Node_Str");
    ps.executeUpdate();
    logger.debug("String_Node_Str" + ps.toString());
  }
 catch (  SQLException ex) {
    logger.error("String_Node_Str" + ps.toString(),ex);
  }
 finally {
    try {
      if (ps != null && !ps.isClosed()) {
        ps.close();
      }
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void updateStockHistory(){
  Connection connection=null;
  PreparedStatement ps=null;
  try {
    connection=dbMgr.getConnection();
    ps=connection.prepareStatement("String_Node_Str");
    ps.executeUpdate();
    logger.debug("String_Node_Str" + ps.toString());
  }
 catch (  MySQLIntegrityConstraintViolationException uniqueKeyException) {
  }
catch (  SQLException ex) {
    logger.error("String_Node_Str" + ps.toString(),ex);
  }
 finally {
    try {
      if (ps != null && !ps.isClosed()) {
        ps.close();
      }
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
  }
}
Program: 39612
Project: 39612
Buggy source:
public void load(){
  Connection connection=null;
  Statement stmt=null;
  ResultSet rs=null;
  try {
    connection=dbMgr.getConnection();
    stmt=connection.createStatement();
    rs=stmt.executeQuery("String_Node_Str");
    while (rs.next()) {
      Config config=new Config();
      config.setId(rs.getLong(Config.ID));
      config.setParm(rs.getString(Config.PARM));
      config.setVal(rs.getString(Config.VAL));
      configMap.put(config.getParm(),config);
    }
    logger.debug("String_Node_Str" + stmt.toString());
    logger.debug("String_Node_Str");
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + stmt.toString(),e);
    logger.debug("String_Node_Str");
  }
catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
 finally {
    try {
      if (rs != null && !rs.isClosed()) {
        rs.close();
      }
      if (stmt != null && !stmt.isClosed()) {
        stmt.close();
      }
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
catch (    Exception ex) {
      logger.debug("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
public void load(){
  Connection connection=null;
  Statement stmt=null;
  ResultSet rs=null;
  try {
    connection=dbMgr.getConnection();
    stmt=connection.createStatement();
    rs=stmt.executeQuery("String_Node_Str");
    while (rs.next()) {
      Config config=new Config();
      config.setId(rs.getLong(Config.ID));
      config.setParm(rs.getString(Config.PARM));
      config.setVal(rs.getString(Config.VAL));
      configMap.put(config.getParm(),config);
    }
    logger.debug("String_Node_Str" + stmt.toString());
    logger.debug("String_Node_Str");
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + stmt == null ? "String_Node_Str" : stmt.toString(),e);
    logger.error("String_Node_Str");
  }
 finally {
    try {
      if (rs.isClosed()) {
        rs.close();
      }
      if (stmt.isClosed()) {
        stmt.close();
      }
      if (connection.isClosed()) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      logger.error("String_Node_Str",e);
    }
  }
}
Program: 39613
Project: 39613
Buggy source:
@Override public BuySellResponse sell(long seller,long stock,int amount){
  User user=userMgr.getUserById(seller);
  int amount2Buy=user.getCash() < amount ? user.getCash() : amount;
  Stock stockObj=stockMgr.getStockById(stock);
  double sold=(double)amount2Buy / (double)stockObj.getTotal();
  stockObj.setSold(stockObj.getSold() - sold);
  UserStock userStock=getStockInPortfolio(seller,stock);
  if (userStock != null) {
    int soldAmount=(int)(userStock.getPercent() * stockObj.getTotal());
    if (amount >= soldAmount) {
      deleteStockInPortfolio(seller,stock);
    }
 else {
      updateStockInPortfolio(seller,stock,-sold);
    }
  }
  stockMgr.updateSold(stock,-sold);
  userMgr.updateCashAndPortfolio(seller,-amount2Buy);
  transactionMgr.recordTransaction(user,stockObj,amount2Buy,TransactionMgr.SELL);
  user.setCash(user.getCash() + amount2Buy);
  user.setPortfolio(user.getPortfolio() - amount2Buy);
  UserStock updateUserStock=getStockInPortfolio(seller,stock);
  int userStockValue=updateUserStock == null ? 0 : (int)(updateUserStock.getPercent() * stockObj.getTotal());
  return new BuySellResponse(user,stockObj,userStockValue);
}

Fixed version (ground truth):
@Override public BuySellResponse sell(long seller,long stock,int amount){
  User user=userMgr.getUserById(seller);
  UserStock userStock=getStockInPortfolio(seller,stock);
  Stock stockObj=stockMgr.getStockById(stock);
  double sold=(double)amount / (double)stockObj.getTotal();
  stockObj.setSold(stockObj.getSold() - sold);
  if (userStock != null) {
    int soldAmount=(int)(userStock.getPercent() * stockObj.getTotal());
    if (amount >= soldAmount) {
      deleteStockInPortfolio(seller,stock);
    }
 else {
      updateStockInPortfolio(seller,stock,-sold);
    }
  }
  stockMgr.updateSold(stock,-sold);
  userMgr.updateCashAndPortfolio(seller,-amount);
  transactionMgr.recordTransaction(user,stockObj,amount,TransactionMgr.SELL);
  user.setCash(user.getCash() + amount);
  user.setPortfolio(user.getPortfolio() - amount);
  UserStock updateUserStock=getStockInPortfolio(seller,stock);
  int userStockValue=updateUserStock == null ? 0 : (int)(updateUserStock.getPercent() * stockObj.getTotal());
  return new BuySellResponse(user,stockObj,userStockValue);
}
Program: 39614
Project: 39614
Buggy source:
/** 
 * Checks that buyer has enough enough money and updates buyer's portfolio adding stocks.
 * @param buyer is the twitter id of Buyer
 * @param price is the total money to be paid.
 * @param stock is the twitter id of stock.
 * @param percent is the ratio of bought followers to the total followers.
 * @return
 */
Result<Object> buy(String buyer,int price,String stock,double percent);

Fixed version (ground truth):
/** 
 * Checks that buyer has enough enough money and updates buyer's portfolio adding stocks.
 * @param buyer is the twitter id of Buyer
 * @param price is the total money to be paid.
 * @param stock is the twitter id of stock.
 * @param percent is the ratio of bought followers to the total followers.
 * @return
 */
public Result<Object> buy(String buyer,int price,String stock,double percent);
Program: 39615
Project: 39615
Buggy source:
@Inject private @Override public Result<Object> buy(String buyer,int price,String stock,double percent){
  return null;
}

Fixed version (ground truth):
@Override public Result<Object> buy(String buyer,int price,String stock,double percent){
  return null;
}
Program: 39616
Project: 39616
Buggy source:
public void modelGroupAdded(NSNotification n){
  EOModelGroup group=(EOModelGroup)n.object();
  if (group.modelNamed("String_Node_Str") != null && group.modelNamed("String_Node_Str") != null) {
    ERXEOAccessUtilities.createRelationship("String_Node_Str",ERCMailAddress.ENTITY_NAME,"String_Node_Str",SESComplaintNotification.ENTITY_NAME,"String_Node_Str",true,EOClassDescription.DeleteRuleDeny,false,true,false);
    ERXEOAccessUtilities.createRelationship("String_Node_Str",ERCMailAddress.ENTITY_NAME,"String_Node_Str",SESBounceNotification.ENTITY_NAME,"String_Node_Str",true,EOClassDescription.DeleteRuleDeny,false,true,false);
  }
}

Fixed version (ground truth):
public void modelGroupAdded(NSNotification n){
  EOModelGroup group=(EOModelGroup)n.object();
  if (group.modelNamed("String_Node_Str") != null && group.modelNamed("String_Node_Str") != null) {
    createRelationship("String_Node_Str",ERCMailAddress.ENTITY_NAME,"String_Node_Str",SESComplaintNotification.ENTITY_NAME,"String_Node_Str",true,EOClassDescription.DeleteRuleDeny,false,true,false);
    createRelationship("String_Node_Str",ERCMailAddress.ENTITY_NAME,"String_Node_Str",SESBounceNotification.ENTITY_NAME,"String_Node_Str",true,EOClassDescription.DeleteRuleDeny,false,true,false);
  }
}
Program: 39617
Project: 39617
Buggy source:
public void setObject(EOEnterpriseObject object){
  this.object=object;
}

Fixed version (ground truth):
public void setObject(EOEnterpriseObject object){
  this.object=new ERXEOSerializationUtilities.SerialEOWrapper(object);
}
Program: 39618
Project: 39618
Buggy source:
public EOEnterpriseObject object(){
  return object;
}

Fixed version (ground truth):
public EOEnterpriseObject object(){
  return object.eo();
}
Program: 39619
Project: 39619
Buggy source:
public String rowClass(){
  String classes=index() % 2 == 1 ? "String_Node_Str" : "String_Node_Str";
  String level=(logger().getLevel() == null) ? "String_Node_Str" : logger().getLevel().toString().toLowerCase();
  classes=ERXStringUtilities.stringByAppendingCSSClass(classes,level);
  return classes;
}

Fixed version (ground truth):
public String rowClass(){
  String classes=index() % 2 == 0 ? "String_Node_Str" : "String_Node_Str";
  String level=(logger().getLevel() == null) ? "String_Node_Str" : logger().getLevel().toString().toLowerCase();
  classes=ERXStringUtilities.stringByAppendingCSSClass(classes,level);
  return classes;
}
Program: 39620
Project: 39620
Buggy source:
public int hashCode(){
  return (new Long(getTime()).hashCode()) ^ (new Long(duration()).hashCode());
}

Fixed version (ground truth):
public int hashCode(){
  return Long.valueOf(getTime()).hashCode() ^ Long.valueOf(duration()).hashCode();
}
Program: 39621
Project: 39621
Buggy source:
public Boolean canUpdateProperty(D2WContext c){
  EOEnterpriseObject eo=object(c);
  String propertyKey=c.propertyKey();
  if (eo == null || propertyKey == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  boolean b=CRUDUtility.canReadProperty(auth(c),eo,propertyKey);
  return Boolean.valueOf(b);
}

Fixed version (ground truth):
public Boolean canUpdateProperty(D2WContext c){
  EOEnterpriseObject eo=object(c);
  String propertyKey=c.propertyKey();
  if (eo == null || propertyKey == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  boolean b=CRUDUtility.canUpdateProperty(auth(c),eo,propertyKey);
  return Boolean.valueOf(b);
}
Program: 39622
Project: 39622
Buggy source:
protected void configureServices(Environment environment){
  services.add(TransactionServices.class,new MockTransactionServices());
  if (environment.equals(Environments.EE) || environment.equals(Environments.EE_INJECT)) {
    services.add(EjbServices.class,new MockEjBServices());
    services.add(SecurityServices.class,new MockSecurityServices());
  }
}

Fixed version (ground truth):
protected void configureServices(Environment environment){
  if (environment.equals(Environments.EE) || environment.equals(Environments.EE_INJECT)) {
    services.add(TransactionServices.class,new MockTransactionServices());
    services.add(EjbServices.class,new MockEjBServices());
    services.add(SecurityServices.class,new MockSecurityServices());
  }
}
Program: 39623
Project: 39623
Buggy source:
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  if (manager == null) {
    throw new IllegalStateException("String_Node_Str" + WeldManager.class.getName() + "String_Node_Str");
  }
  ConversationManager2 conversationManager=BeanUtils.getBeanReference(manager,ConversationManager2.class);
  CDIConversationID id=context.get(CDIConversationID.class);
  if (id == null) {
    id=new CDIConversationID(null);
  }
  conversationManager.setupContext();
  conversationManager.setupConversation(id.getId());
}

Fixed version (ground truth):
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  if (manager == null) {
    throw new IllegalStateException("String_Node_Str" + WeldManager.class.getName() + "String_Node_Str");
  }
  ConversationManager2 conversationManager=BeanUtils.getBeanReference(manager,ConversationManager2.class);
  CDIConversationID id=context.get(CDIConversationID.class);
  if (id == null) {
    id=new CDIConversationID(null);
  }
  if (!conversationManager.isContextActive()) {
    conversationManager.setupContext();
  }
  conversationManager.setupConversation(id.getId());
}
Program: 39624
Project: 39624
Buggy source:
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  Conversation conversation=BeanUtils.getBeanReference(manager,Conversation.class);
  if (!conversation.isTransient()) {
    context.add(CDIConversationID.class,new CDIConversationID(conversation.getId()));
  }
 else {
    context.add(CDIConversationID.class,new CDIConversationID(null));
  }
  ConversationManager2 conversationManager=BeanUtils.getBeanReference(manager,ConversationManager2.class);
  conversationManager.teardownConversation();
  conversationManager.teardownContext();
}

Fixed version (ground truth):
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  Conversation conversation=BeanUtils.getBeanReference(manager,Conversation.class);
  if (!conversation.isTransient()) {
    context.add(CDIConversationID.class,new CDIConversationID(conversation.getId()));
  }
 else {
    context.add(CDIConversationID.class,new CDIConversationID(null));
  }
  ConversationManager2 conversationManager=BeanUtils.getBeanReference(manager,ConversationManager2.class);
  conversationManager.teardownConversation();
}
Program: 39625
Project: 39625
Buggy source:
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  if (manager == null) {
    throw new IllegalStateException("String_Node_Str" + WeldManager.class.getName() + "String_Node_Str");
  }
  ContextLifecycle lifeCycle=manager.getServices().get(ContextLifecycle.class);
  String requestId=UUID.randomUUID().toString();
  BeanStore beanStore=new ConcurrentHashMapBeanStore();
  lifeCycle.beginRequest(requestId,beanStore);
  context.add(CDIRequestID.class,new CDIRequestID(requestId,beanStore));
}

Fixed version (ground truth):
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  if (manager == null) {
    throw new IllegalStateException("String_Node_Str" + WeldManager.class.getName() + "String_Node_Str");
  }
  ContextLifecycle lifeCycle=manager.getServices().get(ContextLifecycle.class);
  String requestId=UUID.randomUUID().toString();
  BeanStore beanStore=new ConcurrentHashMapBeanStore();
  lifeCycle.getDependentContext().setActive(true);
  lifeCycle.getRequestContext().setActive(true);
  lifeCycle.getRequestContext().setBeanStore(beanStore);
  context.add(CDIRequestID.class,new CDIRequestID(requestId,beanStore));
}
Program: 39626
Project: 39626
Buggy source:
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  CDIRequestID id=context.get(CDIRequestID.class);
  if (id != null) {
    manager.getServices().get(ContextLifecycle.class).endRequest(id.getId(),id.getBeanStore());
  }
}

Fixed version (ground truth):
public void callback(Context context,Event event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  CDIRequestID id=context.get(CDIRequestID.class);
  if (id != null) {
    ContextLifecycle lifeCycle=manager.getServices().get(ContextLifecycle.class);
    lifeCycle.getDependentContext().setActive(false);
    lifeCycle.getRequestContext().setActive(false);
  }
}
Program: 39627
Project: 39627
Buggy source:
public void callback(Context context,TestEvent event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  CDISessionID id=context.get(CDISessionID.class);
  if (id != null) {
    BeanUtils.getBeanReference(manager,HttpSessionManager.class).setSession(new MockHttpSession(id.getId(),new MockServletContext("String_Node_Str")));
  }
}

Fixed version (ground truth):
public void callback(Context context,TestEvent event) throws Exception {
  WeldManager manager=context.get(WeldManager.class);
  CDISessionID id=context.get(CDISessionID.class);
  if (id != null) {
    HttpSessionManager sessionManager=BeanUtils.getBeanReference(manager,HttpSessionManager.class);
    HttpSession session=sessionStore.get(id.getId());
    if (session == null) {
      session=new MockHttpSession(id.getId(),new MockServletContext("String_Node_Str"));
    }
    sessionManager.setSession(session);
    sessionStore.put(id.getId(),session);
  }
}
Program: 39629
Project: 39629
Buggy source:
public String getName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getName(){
  return name;
}
Program: 39630
Project: 39630
Buggy source:
@Override protected URL findResource(final String name){
  final Asset a=archive.get(name).getAsset();
  if (a == null) {
    return null;
  }
  try {
    return new URL(null,ARCHIVE_PROTOCOL + name,new URLStreamHandler(){
      @Override protected java.net.URLConnection openConnection(      URL u) throws java.io.IOException {
        return new URLConnection(u){
          @Override public void connect() throws IOException {
          }
          @Override public InputStream getInputStream() throws IOException {
            return a.openStream();
          }
        }
;
      }
    }
);
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
@Override protected URL findResource(final String name){
  final Node a=archive.get(name);
  if (a == null) {
    return null;
  }
  try {
    return new URL(null,ARCHIVE_PROTOCOL + name,new URLStreamHandler(){
      @Override protected java.net.URLConnection openConnection(      URL u) throws java.io.IOException {
        return new URLConnection(u){
          @Override public void connect() throws IOException {
          }
          @Override public InputStream getInputStream() throws IOException {
            return a.getAsset().openStream();
          }
        }
;
      }
    }
);
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 39631
Project: 39631
Buggy source:
@Override protected java.net.URLConnection openConnection(URL u) throws java.io.IOException {
  return new URLConnection(u){
    @Override public void connect() throws IOException {
    }
    @Override public InputStream getInputStream() throws IOException {
      return a.openStream();
    }
  }
;
}

Fixed version (ground truth):
@Override protected java.net.URLConnection openConnection(URL u) throws java.io.IOException {
  return new URLConnection(u){
    @Override public void connect() throws IOException {
    }
    @Override public InputStream getInputStream() throws IOException {
      return a.getAsset().openStream();
    }
  }
;
}
Program: 39632
Project: 39632
Buggy source:
@Override public InputStream getInputStream() throws IOException {
  return a.openStream();
}

Fixed version (ground truth):
@Override public InputStream getInputStream() throws IOException {
  return a.getAsset().openStream();
}
Program: 39633
Project: 39633
Buggy source:
public void ignorableWhitespace(char[] ch,int start,int length) throws SAXException {
}

Fixed version (ground truth):
public void ignorableWhitespace(char[] ch,int start,int length) throws SAXException {
  if (!sbLastWasWhitespace) {
    textBuffer.append(' ');
    tokenBuffer.append(' ');
  }
  sbLastWasWhitespace=true;
}
Program: 39634
Project: 39634
Buggy source:
public void characters(char[] ch,int start,int length) throws SAXException {
  textElementIdx++;
  if (flush) {
    flushBlock();
    flush=false;
  }
  if (inIgnorableElement != 0) {
    return;
  }
  char c;
  boolean startWhitespace=false;
  boolean endWhitespace=false;
switch (length) {
case 0:
    return;
case 1:
  c=ch[start];
startWhitespace=Character.isWhitespace(c);
endWhitespace=startWhitespace;
if (sbLastWasWhitespace) {
if (startWhitespace) {
lastEvent=Event.WHITESPACE;
return;
}
}
 else if (startWhitespace) {
textBuffer.append(' ');
tokenBuffer.append(' ');
}
 else {
textBuffer.append(c);
tokenBuffer.append(c);
}
break;
default :
final int end=start + length;
for (int i=start; i < end; i++) {
if (Character.isWhitespace(ch[i])) {
ch[i]=' ';
}
}
while (start < end) {
c=ch[start];
if (c == ' ') {
startWhitespace=true;
start++;
length--;
}
 else {
break;
}
}
while (length > 0) {
c=ch[start + length - 1];
if (c == ' ') {
endWhitespace=true;
length--;
}
 else {
break;
}
}
if (length == 0) {
if (startWhitespace || endWhitespace) {
if (!sbLastWasWhitespace) {
textBuffer.append(' ');
tokenBuffer.append(' ');
}
sbLastWasWhitespace=true;
}
 else {
sbLastWasWhitespace=false;
}
lastEvent=Event.WHITESPACE;
return;
}
if (startWhitespace) {
if (!sbLastWasWhitespace) {
textBuffer.append(' ');
tokenBuffer.append(' ');
}
}
textBuffer.append(ch,start,length);
tokenBuffer.append(ch,start,length);
if (endWhitespace) {
textBuffer.append(' ');
tokenBuffer.append(' ');
}
}
sbLastWasWhitespace=endWhitespace;
lastEvent=Event.CHARACTERS;
currentContainedTextElements.set(textElementIdx);
}

Fixed version (ground truth):
public void characters(char[] ch,int start,int length) throws SAXException {
  textElementIdx++;
  if (flush) {
    flushBlock();
    flush=false;
  }
  if (inIgnorableElement != 0) {
    return;
  }
  char c;
  boolean startWhitespace=false;
  boolean endWhitespace=false;
  if (length == 0) {
    return;
  }
  final int end=start + length;
  for (int i=start; i < end; i++) {
    if (Character.isWhitespace(ch[i])) {
      ch[i]=' ';
    }
  }
  while (start < end) {
    c=ch[start];
    if (c == ' ') {
      startWhitespace=true;
      start++;
      length--;
    }
 else {
      break;
    }
  }
  while (length > 0) {
    c=ch[start + length - 1];
    if (c == ' ') {
      endWhitespace=true;
      length--;
    }
 else {
      break;
    }
  }
  if (length == 0) {
    if (startWhitespace || endWhitespace) {
      if (!sbLastWasWhitespace) {
        textBuffer.append(' ');
        tokenBuffer.append(' ');
      }
      sbLastWasWhitespace=true;
    }
 else {
      sbLastWasWhitespace=false;
    }
    lastEvent=Event.WHITESPACE;
    return;
  }
  if (startWhitespace) {
    if (!sbLastWasWhitespace) {
      textBuffer.append(' ');
      tokenBuffer.append(' ');
    }
  }
  textBuffer.append(ch,start,length);
  tokenBuffer.append(ch,start,length);
  if (endWhitespace) {
    textBuffer.append(' ');
    tokenBuffer.append(' ');
  }
  sbLastWasWhitespace=endWhitespace;
  lastEvent=Event.CHARACTERS;
  currentContainedTextElements.set(textElementIdx);
}
Program: 39635
Project: 39635
Buggy source:
public MethodHandler getHandler(Object o){
  return instrumentors.get(o.getClass()).getInvoker(o);
}

Fixed version (ground truth):
public MethodHandler getHandler(Object o){
  Instrumentor instrumentor=instrumentors.get(o.getClass());
  return instrumentor != null ? instrumentor.getInvoker(o) : null;
}
Program: 39636
Project: 39636
Buggy source:
protected void createDomain(){
  addClass(TCK_A.class);
  addClass(Object.class);
}

Fixed version (ground truth):
protected void createDomain(){
  addClass(TCK_A.class);
}
Program: 39638
Project: 39638
Buggy source:
/** 
 * Builds the runtime and return a configured   {@link org.chromattic.api.Chromattic} instance.
 * @return the chromattic instance
 * @throws BuilderException any builder exception
 */
public Chromattic build() throws BuilderException {
  Options options=new Options(this.options);
  if (!Boolean.FALSE.equals(options.getValue(USE_SYSTEM_PROPERTIES))) {
    for (    Option<?> option : getSystemOptions()) {
      String value=System.getProperty(option.getName());
      if (value != null) {
        options.setValue(option,value,false);
      }
    }
  }
  options.setValue(INSTRUMENTOR_CLASSNAME,"String_Node_Str",false);
  options.setValue(SESSION_LIFECYCLE_CLASSNAME,"String_Node_Str",false);
  options.setValue(OBJECT_FORMATTER_CLASSNAME,DefaultObjectFormatter.class.getName(),false);
  options.setValue(PROPERTY_CACHE_ENABLED,false,false);
  options.setValue(PROPERTY_READ_AHEAD_ENABLED,false,false);
  options.setValue(JCR_OPTIMIZE_HAS_PROPERTY_ENABLED,false,false);
  options.setValue(JCR_OPTIMIZE_HAS_NODE_ENABLED,false,false);
  options.setValue(ROOT_NODE_PATH,"String_Node_Str",false);
  options.setValue(CREATE_ROOT_NODE,false,false);
  options.setValue(LAZY_CREATE_ROOT_NODE,false,false);
  return boot(options,new HashSet<Class>(classes));
}

Fixed version (ground truth):
/** 
 * Builds the runtime and return a configured   {@link org.chromattic.api.Chromattic} instance.
 * @return the chromattic instance
 * @throws BuilderException any builder exception
 */
public Chromattic build() throws BuilderException {
  Options options=new Options(this.options);
  if (!Boolean.FALSE.equals(options.getValue(USE_SYSTEM_PROPERTIES))) {
    for (    Option<?> option : getSystemOptions()) {
      String value=System.getProperty(option.getName());
      if (value != null) {
        options._setValue(option,value,false);
      }
    }
  }
  options.setValue(INSTRUMENTOR_CLASSNAME,"String_Node_Str",false);
  options.setValue(SESSION_LIFECYCLE_CLASSNAME,"String_Node_Str",false);
  options.setValue(OBJECT_FORMATTER_CLASSNAME,DefaultObjectFormatter.class.getName(),false);
  options.setValue(PROPERTY_CACHE_ENABLED,false,false);
  options.setValue(PROPERTY_READ_AHEAD_ENABLED,false,false);
  options.setValue(JCR_OPTIMIZE_HAS_PROPERTY_ENABLED,false,false);
  options.setValue(JCR_OPTIMIZE_HAS_NODE_ENABLED,false,false);
  options.setValue(ROOT_NODE_PATH,"String_Node_Str",false);
  options.setValue(CREATE_ROOT_NODE,false,false);
  options.setValue(LAZY_CREATE_ROOT_NODE,false,false);
  return boot(options,new HashSet<Class>(classes));
}
Program: 39640
Project: 39640
Buggy source:
public static Object invokeMethod(Object target,String m,Object p,MethodHandler handler){
  System.out.println(target.getClass().getName() + "String_Node_Str" + m);
  Method method;
  try {
    method=target.getClass().getMethod(m,args2Class(p));
  }
 catch (  NoSuchMethodException _) {
    try {
      method=foundMethod(target.getClass(),m,p);
    }
 catch (    NoSuchMethodException __) {
      try {
        Field field=target.getClass().getField(GroovyUtils.fieldName(m));
        return field.get(target);
      }
 catch (      Exception e) {
        throw new AssertionError(e);
      }
    }
  }
  try {
    if (isChromatticAnnoted(method)) {
      return handler.invoke(target,method,(Object[])p);
    }
 else     return method.invoke(target,(Object[])p);
  }
 catch (  RuntimeException re) {
    throw re;
  }
catch (  Error e) {
    throw e;
  }
catch (  Throwable t) {
    throw new AssertionError(t);
  }
}

Fixed version (ground truth):
public static Object invokeMethod(Object target,String m,Object p,MethodHandler handler){
  Method method;
  try {
    method=target.getClass().getMethod(m,args2Class(p));
  }
 catch (  NoSuchMethodException _) {
    try {
      method=foundMethod(target.getClass(),m,p);
    }
 catch (    NoSuchMethodException __) {
      try {
        Field field=target.getClass().getField(GroovyUtils.fieldName(m));
        return field.get(target);
      }
 catch (      Exception e) {
        throw new AssertionError(e);
      }
    }
  }
  try {
    if (isChromatticAnnoted(method)) {
      return handler.invoke(target,method,(Object[])p);
    }
 else     return method.invoke(target,(Object[])p);
  }
 catch (  RuntimeException re) {
    throw re;
  }
catch (  Error e) {
    throw e;
  }
catch (  Throwable t) {
    throw new AssertionError(t);
  }
}
Program: 39641
Project: 39641
Buggy source:
public static String fieldName(String getsetName){
  if (getsetName.length() <= 4 || (!"String_Node_Str".equals(getsetName.substring(0,3)) && !"String_Node_Str".equals(getsetName.substring(0,3))))   throw new IllegalArgumentException("String_Node_Str" + getsetName);
  return String.format("String_Node_Str",getsetName.substring(3,4).toLowerCase(),getsetName.substring(4));
}

Fixed version (ground truth):
public static String fieldName(String getsetName){
  if (!"String_Node_Str".equals(getsetName.substring(0,3)) && !"String_Node_Str".equals(getsetName.substring(0,3)))   throw new IllegalArgumentException("String_Node_Str" + getsetName);
  return String.format("String_Node_Str",getsetName.substring(3,4).toLowerCase(),getsetName.substring(4));
}
Program: 39643
Project: 39643
Buggy source:
private boolean _process(Set<? extends TypeElement> annotations,RoundEnvironment roundEnv){
  Map<String,PackageMetaData> packageMetaData=new HashMap<String,PackageMetaData>();
  Set<? extends Element> a=roundEnv.getElementsAnnotatedWith(NodeTypeDefs.class);
  for (  Element e : a) {
    PackageElement pkgElt=(PackageElement)e;
    String s=new StringBuilder().append(pkgElt.getQualifiedName()).toString();
    NodeTypeDefs ntDefs=pkgElt.getAnnotation(NodeTypeDefs.class);
    packageMetaData.put(s,new PackageMetaData(ntDefs.namespacePrefix(),ntDefs.namespaceValue()));
  }
  Set<Element> elts=new HashSet<Element>();
  elts.addAll(roundEnv.getElementsAnnotatedWith(PrimaryType.class));
  elts.addAll(roundEnv.getElementsAnnotatedWith(MixinType.class));
  try {
    process(roundEnv,elts,packageMetaData);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return true;
}

Fixed version (ground truth):
private boolean _process(Set<? extends TypeElement> annotations,RoundEnvironment roundEnv){
  Map<String,PackageMetaData> packageMetaData=new HashMap<String,PackageMetaData>();
  Set<? extends Element> a=roundEnv.getElementsAnnotatedWith(NodeTypeDefs.class);
  for (  Element e : a) {
    PackageElement pkgElt=(PackageElement)e;
    String packageName=new StringBuilder().append(pkgElt.getQualifiedName()).toString();
    NodeTypeDefs ntDefs=pkgElt.getAnnotation(NodeTypeDefs.class);
    packageMetaData.put(packageName,new PackageMetaData(packageName,ntDefs.namespacePrefix(),ntDefs.namespaceValue(),ntDefs.deep()));
  }
  Set<Element> elts=new HashSet<Element>();
  elts.addAll(roundEnv.getElementsAnnotatedWith(PrimaryType.class));
  elts.addAll(roundEnv.getElementsAnnotatedWith(MixinType.class));
  try {
    process(roundEnv,elts,packageMetaData);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return true;
}
Program: 39644
Project: 39644
Buggy source:
public PackageMetaData(String namespacePrefix,String namespaceURI){
  this.namespacePrefix=namespacePrefix;
  this.namespaceURI=namespaceURI;
}

Fixed version (ground truth):
public PackageMetaData(String packageName,String namespacePrefix,String namespaceURI,boolean deep){
  this.packageName=packageName;
  this.namespacePrefix=namespacePrefix;
  this.namespaceURI=namespaceURI;
  this.deep=deep;
}
Program: 39646
Project: 39646
Buggy source:
protected boolean _setReferenced(EntityContext referentCtx,String name,EntityContext referencedCtx,LinkType linkType) throws RepositoryException {
  if (referentCtx.getStatus() != Status.PERSISTENT) {
    throw new IllegalStateException("String_Node_Str" + this);
  }
  Node referent=referentCtx.state.getNode();
  if (referencedCtx != null) {
    if (referencedCtx.getStatus() != Status.PERSISTENT) {
      throw new IllegalStateException();
    }
    Node referenced=referencedCtx.state.getNode();
    return referenced != sessionWrapper.setReferenced(referent,name,referenced,linkType);
  }
 else {
    return null != sessionWrapper.setReferenced(referent,name,null,linkType);
  }
}

Fixed version (ground truth):
protected boolean _setReferenced(EntityContext referentCtx,String name,EntityContext referencedCtx,LinkType linkType) throws RepositoryException {
  if (referentCtx.getStatus() != Status.PERSISTENT) {
    throw new IllegalStateException("String_Node_Str" + this);
  }
  Node referent=referentCtx.state.getNode();
  if (referencedCtx != null) {
    if (referencedCtx.getStatus() != Status.PERSISTENT) {
      throw new IllegalStateException();
    }
    Node referenced=referencedCtx.state.getNode();
    Node previouslyReferenced=sessionWrapper.setReferenced(referent,name,referenced,linkType);
    if (previouslyReferenced != null) {
      String previousReferencedId=previouslyReferenced.getUUID();
      String referencedId=referenced.getUUID();
      return !referencedId.equals(previousReferencedId);
    }
 else {
      return true;
    }
  }
 else {
    return null != sessionWrapper.setReferenced(referent,name,null,linkType);
  }
}
Program: 39647
Project: 39647
Buggy source:
protected Node _getRoot() throws RepositoryException {
  Session session=sessionWrapper.getSession();
  List<String> pathSegments=domain.rootNodePathSegments;
  Node current=session.getRootNode();
  boolean created=false;
  if (!pathSegments.isEmpty()) {
    for (int i=0; i < pathSegments.size(); i++) {
      String pathSegment=pathSegments.get(i);
      if (current.hasNode(pathSegment)) {
        current=current.getNode(pathSegment);
      }
 else {
        if (domain.rootCreateMode == Domain.NO_CREATE_MODE) {
          throw new NoSuchNodeException("String_Node_Str" + domain.rootNodePath);
        }
 else {
          current=current.addNode(pathSegment);
          created=true;
        }
      }
    }
  }
  if (created) {
    if (domain.rootCreateMode == Domain.CREATE_MODE) {
      Node toSave=current;
      while (toSave.isNew()) {
        toSave=toSave.getParent();
      }
      toSave.save();
    }
  }
  return current;
}

Fixed version (ground truth):
protected Node _getRoot() throws RepositoryException {
  Session session=sessionWrapper.getSession();
  List<String> pathSegments=domain.rootNodePathSegments;
  Node current=session.getRootNode();
  String rootNodeType=domain.rootNodeType;
  boolean created=false;
  if (!pathSegments.isEmpty()) {
    for (int i=0; i < pathSegments.size(); i++) {
      String pathSegment=pathSegments.get(i);
      if (current.hasNode(pathSegment)) {
        current=current.getNode(pathSegment);
      }
 else {
        if (domain.rootCreateMode == Domain.NO_CREATE_MODE) {
          throw new NoSuchNodeException("String_Node_Str" + domain.rootNodePath);
        }
 else {
          if (rootNodeType != null) {
            current=current.addNode(pathSegment,rootNodeType);
          }
 else {
            current=current.addNode(pathSegment);
          }
          created=true;
        }
      }
    }
  }
  if (created) {
    if (domain.rootCreateMode == Domain.CREATE_MODE) {
      Node toSave=current;
      while (toSave.isNew()) {
        toSave=toSave.getParent();
      }
      toSave.save();
    }
  }
  return current;
}
Program: 39649
Project: 39649
Buggy source:
public void orderBefore(Node parentNode,Node srcNode,Node dstNode) throws RepositoryException {
  Node srcParentNode=srcNode.getParent();
  if (!srcParentNode.equals(parentNode)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (dstNode != null) {
    Node dstParentNode=dstNode.getParent();
    if (!dstParentNode.equals(parentNode)) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    parentNode.orderBefore(srcNode.getName(),dstNode.getName());
  }
 else {
    long size=parentNode.getNodes().getSize();
    if (size > 1) {
      parentNode.orderBefore(srcNode.getName(),null);
    }
  }
}

Fixed version (ground truth):
public void orderBefore(Node parentNode,Node srcNode,Node dstNode) throws RepositoryException {
  if (dstNode != null) {
    parentNode.orderBefore(srcNode.getName(),dstNode.getName());
  }
 else {
    long size=parentNode.getNodes().getSize();
    if (size > 1) {
      parentNode.orderBefore(srcNode.getName(),null);
    }
  }
}
Program: 39651
Project: 39651
Buggy source:
public final ChromatticSessionImpl login(){
  SimpleCredentials credentials=new SimpleCredentials("String_Node_Str","String_Node_Str".toCharArray());
  return (ChromatticSessionImpl)chromattic.openSession(credentials);
}

Fixed version (ground truth):
public final ChromatticSessionImpl login(){
  ChromatticSessionImpl session=(ChromatticSessionImpl)chromattic.openSession();
  sessions.add(session);
  return session;
}
Program: 39653
Project: 39653
Buggy source:
public void testNotFound() throws RepositoryException {
  ChromatticSession session=login();
  TFI_A a=session.findById(TFI_A.class,"String_Node_Str");
  assertNull(a);
}

Fixed version (ground truth):
public void testNotFound() throws RepositoryException {
  ChromatticSession session=login();
  TFI_A a=session.insert(TFI_A.class,"String_Node_Str");
  assertNotNull(a);
  String id=session.getId(a);
  session.remove(a);
  a=session.findById(TFI_A.class,id);
  assertNull(a);
}
Program: 39654
Project: 39654
Buggy source:
/** 
 * Creates a persistent instance of the specified object.
 * @param parent the parent object
 * @param clazz the object class
 * @param name the object name
 * @param < O > the object class parameter
 * @return the persistent object
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if any argument is not valid
 * @throws ChromatticException any chromattic exception
 */
<O>O insert(Object parent,Class<O> clazz,String name) throws NullPointerException, IllegalArgumentException, ChromatticException ;

Fixed version (ground truth):
/** 
 * Creates a persistent instance of the specified object.
 * @param parent the parent object
 * @param clazz the object class
 * @param name the object name
 * @param < O > the object class parameter
 * @return the persistent object
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if the name is not valid or the class is not a chromattic class or the parent isnot a persistent object
 * @throws ChromatticException any chromattic exception
 */
<O>O insert(Object parent,Class<O> clazz,String name) throws NullPointerException, IllegalArgumentException, ChromatticException ;
Program: 39655
Project: 39655
Buggy source:
/** 
 * Creates a transient instance of the specified object. The name if it is not null will be used later when the object is inserted in the JCR session. The clazz argument must be annotated class with the <tt>NodeMapping</tt> annotation.
 * @param clazz the object class
 * @param name the node name
 * @param < O > the object class parameter
 * @return the transient object
 * @throws NullPointerException if the clazz argument is null
 * @throws IllegalArgumentException if the name format is not valid
 * @throws ChromatticException any chromattic exception
 */
<O>O create(Class<O> clazz,String name) throws NullPointerException, IllegalArgumentException, ChromatticException ;

Fixed version (ground truth):
/** 
 * Creates a transient instance of the specified object. The name if it is not null will be used later when the object is inserted in the JCR session. The clazz argument must be annotated class with the <tt>NodeMapping</tt> annotation.
 * @param clazz the object class
 * @param name the node name
 * @param < O > the object class parameter
 * @return the transient object
 * @throws NullPointerException if the clazz argument is null
 * @throws IllegalArgumentException if the name format is not valid or the class is not a chromattic class
 * @throws ChromatticException any chromattic exception
 */
<O>O create(Class<O> clazz,String name) throws NullPointerException, IllegalArgumentException, ChromatticException ;
Program: 39656
Project: 39656
Buggy source:
/** 
 * Persists a transient object.
 * @param parent the parent object
 * @param o the object to persist
 * @param name the object relative name to the parent
 * @return the object id
 * @throws NullPointerException if the parent or object argument is null
 * @throws IllegalArgumentException if any argument is not valid
 * @throws ChromatticException any chromattic exception
 */
String persist(Object parent,Object o,String name) throws NullPointerException, IllegalArgumentException, ChromatticException ;

Fixed version (ground truth):
/** 
 * Persists a transient object.
 * @param parent the parent object
 * @param o the object to persist
 * @param name the object relative name to the parent
 * @return the object id
 * @throws NullPointerException if the parent or object argument is null
 * @throws IllegalArgumentException if the parent is not a persistent object or the name is not valid or the objectis not a chromattic transient object
 * @throws ChromatticException any chromattic exception
 */
String persist(Object parent,Object o,String name) throws NullPointerException, IllegalArgumentException, ChromatticException ;
Program: 39657
Project: 39657
Buggy source:
private void writeClass(RoundEnvironment roundEnv,StringBuilder out,ClassTypeInfo cti){
  String simpleClassName=cti.getSimpleName() + "String_Node_Str";
  out.append("String_Node_Str").append(cti.getPackageName()).append("String_Node_Str");
  out.append("String_Node_Str").append(Invoker.class.getName()).append("String_Node_Str");
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append(simpleClassName);
  sb.append("String_Node_Str");
  if (cti.getKind() == ClassKind.INTERFACE) {
    sb.append(Object.class.getName());
    sb.append("String_Node_Str");
    sb.append(cti.getSimpleName());
  }
 else {
    sb.append(cti.getSimpleName());
  }
  sb.append("String_Node_Str");
  out.append(sb.toString());
  appendContructor(roundEnv,out,cti);
  appendAbstractMethods(simpleClassName,roundEnv,out,cti);
  out.append("String_Node_Str");
}

Fixed version (ground truth):
private void writeClass(RoundEnvironment roundEnv,StringBuilder out,ClassTypeInfo cti){
  String simpleClassName=cti.getSimpleName() + "String_Node_Str";
  out.append("String_Node_Str").append(cti.getPackageName()).append("String_Node_Str");
  out.append("String_Node_Str").append(Invoker.class.getName()).append("String_Node_Str");
  out.append("String_Node_Str").append(Instrumented.class.getName()).append("String_Node_Str");
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append(simpleClassName);
  sb.append("String_Node_Str");
  if (cti.getKind() == ClassKind.INTERFACE) {
    sb.append(Object.class.getName());
    sb.append("String_Node_Str");
    sb.append(cti.getSimpleName());
    sb.append("String_Node_Str");
    sb.append(Instrumented.class.getSimpleName());
  }
 else {
    sb.append(cti.getSimpleName());
    sb.append("String_Node_Str");
    sb.append(Instrumented.class.getSimpleName());
  }
  sb.append("String_Node_Str");
  out.append(sb.toString());
  appendContructor(roundEnv,out,cti);
  appendAbstractMethods(simpleClassName,roundEnv,out,cti);
  out.append("String_Node_Str");
}
Program: 39658
Project: 39658
Buggy source:
public MethodHandler getInvoker(Object proxy){
  try {
    Field f=proxy.getClass().getField("String_Node_Str");
    return (MethodHandler)f.get(proxy);
  }
 catch (  NoSuchFieldException e) {
    throw new AssertionError(e);
  }
catch (  IllegalAccessException e) {
    throw new AssertionError(e);
  }
}

Fixed version (ground truth):
public MethodHandler getInvoker(Object proxy){
  if (proxy instanceof Instrumented) {
    try {
      Field f=proxy.getClass().getField("String_Node_Str");
      return (MethodHandler)f.get(proxy);
    }
 catch (    NoSuchFieldException e) {
      throw new AssertionError(e);
    }
catch (    IllegalAccessException e) {
      throw new AssertionError(e);
    }
  }
 else {
    return null;
  }
}
Program: 39659
Project: 39659
Buggy source:
public MethodHandler getInvoker(Object proxy){
  return ((MethodInterceptorInvoker)((Factory)proxy).getCallback(0)).invoker;
}

Fixed version (ground truth):
public MethodHandler getInvoker(Object proxy){
  if (proxy instanceof Factory) {
    Factory factory=(Factory)proxy;
    Callback callback=factory.getCallback(0);
    if (callback instanceof MethodInterceptorInvoker) {
      return ((MethodInterceptorInvoker)callback).invoker;
    }
  }
  return null;
}
Program: 39660
Project: 39660
Buggy source:
public final EntityContext unwrapEntity(Object o){
  if (o == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return (EntityContext)domain.getInstrumentor().getInvoker(o);
}

Fixed version (ground truth):
/** 
 * Unwraps the object to an entity context
 * @param o the object to unwrap
 * @return the related entity context
 * @throws NullPointerException if the object is null
 * @throws IllegalArgumentException if the object is not a proxy
 */
public final EntityContext unwrapEntity(Object o) throws NullPointerException, IllegalArgumentException {
  return unwrap(o,EntityContext.class);
}
Program: 39661
Project: 39661
Buggy source:
public final EmbeddedContext unwrapMixin(Object o){
  if (o == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return (EmbeddedContext)domain.getInstrumentor().getInvoker(o);
}

Fixed version (ground truth):
/** 
 * Unwraps the object to an embedded context
 * @param o the object to unwrap
 * @return the related embedded context
 * @throws NullPointerException if the object is null
 * @throws IllegalArgumentException if the object is not a proxy
 */
public final EmbeddedContext unwrapMixin(Object o){
  return unwrap(o,EmbeddedContext.class);
}