nus-yam/ex-repair huggingface dataset:
Program: 29390
Project: 29390
Buggy source:
/** 
 * Notification of a change on a configuration object
 * @param type            type of change : ADD mean the changedInstance was added to the parentREMOVE means the changedInstance was removed from the parent, CHANGE means the changedInstance has mutated.
 * @param changedType     type of the configuration object
 * @param changedInstance changed instance.
 */
public <T extends ConfigBeanProxy>NotProcessed changed(TYPE type,Class<T> changedType,T changedInstance){
  NotProcessed np=null;
switch (type) {
case CHANGE:
    if (_logger.isLoggable(Level.FINE)) {
      _logger.fine("String_Node_Str" + changedType.getName() + "String_Node_Str"+ changedInstance);
    }
  np=handleChangeEvent(changedInstance);
break;
}
return np;
}

Fixed version (ground truth):
/** 
 * Notification of a change on a configuration object
 * @param type            type of change : ADD mean the changedInstance was added to the parentREMOVE means the changedInstance was removed from the parent, CHANGE means the changedInstance has mutated.
 * @param changedType     type of the configuration object
 * @param changedInstance changed instance.
 */
public <T extends ConfigBeanProxy>NotProcessed changed(TYPE type,Class<T> changedType,T changedInstance){
  NotProcessed np=null;
switch (type) {
case CHANGE:
    if (_logger.isLoggable(Level.FINE)) {
      _logger.fine("String_Node_Str" + changedType.getName() + "String_Node_Str"+ changedInstance);
    }
  np=handleChangeEvent(changedInstance);
break;
default :
}
return np;
}
Program: 29391
Project: 29391
Buggy source:
private PropertyChangeHandler(PropertyChangeEvent[] events){
  this.events=events;
}

Fixed version (ground truth):
private PropertyChangeHandler(PropertyChangeEvent[] events){
}
Program: 29392
Project: 29392
Buggy source:
private void waitForCompletion(long steps,ResourcePool oldPool,long totalWaitTime) throws InterruptedException {
  debug("String_Node_Str");
  try {
synchronized (oldPool.getPoolWaitQueue()) {
      oldPool.getPoolWaitQueue().wait(totalWaitTime / steps);
    }
  }
 catch (  InterruptedException ie) {
  }
  debug("String_Node_Str");
}

Fixed version (ground truth):
private void waitForCompletion(long steps,ResourcePool oldPool,long totalWaitTime) throws InterruptedException {
  debug("String_Node_Str");
  try {
    Object poolWaitQueue=oldPool.getPoolWaitQueue();
synchronized (poolWaitQueue) {
      long waitTime=totalWaitTime / steps;
      if (waitTime > 0) {
        poolWaitQueue.wait(waitTime);
      }
    }
  }
 catch (  InterruptedException ie) {
  }
  debug("String_Node_Str");
}
Program: 29393
Project: 29393
Buggy source:
public static JdbcResourcesUtil createInstance(){
  if (jdbcResourcesUtil == null) {
    jdbcResourcesUtil=new JdbcResourcesUtil();
  }
  return jdbcResourcesUtil;
}

Fixed version (ground truth):
public static JdbcResourcesUtil createInstance(){
  if (jdbcResourcesUtil == null) {
synchronized (JdbcResourcesUtil.class) {
      if (jdbcResourcesUtil == null) {
        jdbcResourcesUtil=new JdbcResourcesUtil();
      }
    }
  }
  return jdbcResourcesUtil;
}
Program: 29394
Project: 29394
Buggy source:
public void updateDocumentNode(Resource originalResource,Resource modifiedResource){
  Node resourceNode=resourceMap.remove(originalResource);
  while (resourceNode.hasChildNodes()) {
    resourceNode.removeChild(resourceNode.getFirstChild());
  }
  HashMap<String,String> attrs=modifiedResource.getAttributes();
  for (  String key : attrs.keySet()) {
    ((Element)resourceNode).setAttribute(key,attrs.get(key));
  }
  Properties props=modifiedResource.getProperties();
  for (  String key : props.stringPropertyNames()) {
    String val=props.getProperty(key);
    org.w3c.dom.Element prop=document.createElement("String_Node_Str");
    prop.setAttribute("String_Node_Str",key);
    prop.setAttribute("String_Node_Str",val);
    resourceNode.appendChild(prop);
  }
  resourceMap.put(modifiedResource,resourceNode);
}

Fixed version (ground truth):
public void updateDocumentNode(Resource originalResource,Resource modifiedResource){
  Node resourceNode=resourceMap.remove(originalResource);
  while (resourceNode.hasChildNodes()) {
    resourceNode.removeChild(resourceNode.getFirstChild());
  }
  HashMap<String,String> attrs=modifiedResource.getAttributes();
  Iterator entries=attrs.entrySet().iterator();
  while (entries.hasNext()) {
    Map.Entry thisEntry=(Map.Entry)entries.next();
    ((Element)resourceNode).setAttribute((String)thisEntry.getKey(),(String)thisEntry.getValue());
  }
  Properties props=modifiedResource.getProperties();
  for (  String key : props.stringPropertyNames()) {
    String val=props.getProperty(key);
    org.w3c.dom.Element prop=document.createElement("String_Node_Str");
    prop.setAttribute("String_Node_Str",key);
    prop.setAttribute("String_Node_Str",val);
    resourceNode.appendChild(prop);
  }
  resourceMap.put(modifiedResource,resourceNode);
}
Program: 29395
Project: 29395
Buggy source:
public JavaEEResource makeClone(org.glassfish.resources.api.ResourceInfo resourceInfo){
  JavaEEResource clone=doClone(resourceInfo);
  Set entrySet=properties_.entrySet();
  for (Iterator iter=entrySet.iterator(); iter.hasNext(); ) {
    Map.Entry next=(Map.Entry)iter.next();
    ResourceProperty nextProp=(ResourceProperty)next.getValue();
    ResourceProperty propClone=new ResourcePropertyImpl((String)next.getKey());
    propClone.setValue(next.getValue());
    clone.addProperty(propClone);
  }
  clone.setEnabled(isEnabled());
  clone.setDescription(getDescription());
  return clone;
}

Fixed version (ground truth):
public JavaEEResource makeClone(org.glassfish.resources.api.ResourceInfo resourceInfo){
  JavaEEResource clone=doClone(resourceInfo);
  Set entrySet=properties_.entrySet();
  for (Iterator iter=entrySet.iterator(); iter.hasNext(); ) {
    Map.Entry next=(Map.Entry)iter.next();
    ResourceProperty propClone=new ResourcePropertyImpl((String)next.getKey());
    propClone.setValue(next.getValue());
    clone.addProperty(propClone);
  }
  clone.setEnabled(isEnabled());
  clone.setDescription(getDescription());
  return clone;
}
Program: 29396
Project: 29396
Buggy source:
private ConfigChangeHandler(PropertyChangeEvent[] events){
  this.events=events;
}

Fixed version (ground truth):
private ConfigChangeHandler(){
}
Program: 29397
Project: 29397
Buggy source:
@Override public long getArchiveSize() throws SecurityException {
  if (cachedArchiveSize != null) {
    return Integer.valueOf(cachedArchiveSize);
  }
  try {
    URLConnection cnx=archiveURL.openConnection();
    return (cachedArchiveSize=cnx.getContentLength());
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public long getArchiveSize() throws SecurityException {
  if (cachedArchiveSize != -2) {
    return cachedArchiveSize;
  }
  try {
    URLConnection cnx=archiveURL.openConnection();
    return (cachedArchiveSize=cnx.getContentLength());
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 29398
Project: 29398
Buggy source:
@Override public boolean exists(){
  if (exists != null) {
    return exists.booleanValue();
  }
  InputStream is=null;
  try {
    is=archiveURL.openStream();
    exists=Boolean.TRUE;
    is.close();
  }
 catch (  Exception e) {
    exists=Boolean.FALSE;
  }
 finally {
    return exists.booleanValue();
  }
}

Fixed version (ground truth):
@Override public boolean exists(){
  if (exists != null) {
    return exists.booleanValue();
  }
  InputStream is=null;
  exists=Boolean.FALSE;
  try {
    is=archiveURL.openStream();
    exists=Boolean.TRUE;
    is.close();
  }
  finally {
    return exists.booleanValue();
  }
}
Program: 29399
Project: 29399
Buggy source:
/** 
 * Generates content for the top-level generated client JAR from the  app clients in this app. <p> Higher-level logic will actually create the client JAR, because the need for a client JAR can be triggered by other deployers (EJB for generated stubs and web services), not only app clients.
 * @param dc
 * @param appScratchDir
 * @param facadeFileName
 * @param appClientGroupList
 * @throws IOException 
 */
private void generateAndRecordEARFacadeContents(final DeploymentContext dc,final String appClientGroupList) throws IOException {
  final ClientArtifactsManager clientArtifactsManager=ClientArtifactsManager.get(dc);
  final Manifest manifest=new Manifest();
  Attributes mainAttrs=manifest.getMainAttributes();
  mainAttrs.put(Attributes.Name.MANIFEST_VERSION,"String_Node_Str");
  mainAttrs.put(Attributes.Name.MAIN_CLASS,GLASSFISH_APPCLIENT_GROUP_FACADE_CLASS_NAME);
  mainAttrs.put(GLASSFISH_APPCLIENT_GROUP,appClientGroupList);
  final File manifestFile=File.createTempFile("String_Node_Str","String_Node_Str");
  final OutputStream manifestOutputStream=new BufferedOutputStream(new FileOutputStream(manifestFile));
  manifest.write(manifestOutputStream);
  manifestOutputStream.close();
  clientArtifactsManager.add(manifestFile,JarFile.MANIFEST_NAME,true);
  writeMainClass(clientArtifactsManager);
}

Fixed version (ground truth):
/** 
 * Generates content for the top-level generated client JAR from the  app clients in this app. <p> Higher-level logic will actually create the client JAR, because the need for a client JAR can be triggered by other deployers (EJB for generated stubs and web services), not only app clients.
 * @param dc
 * @param appScratchDir
 * @param facadeFileName
 * @param appClientGroupList
 * @throws IOException 
 */
private void generateAndRecordEARFacadeContents(final DeploymentContext dc,final String appClientGroupList) throws IOException {
  final ClientArtifactsManager clientArtifactsManager=ClientArtifactsManager.get(dc);
  final Manifest manifest=new Manifest();
  Attributes mainAttrs=manifest.getMainAttributes();
  mainAttrs.put(Attributes.Name.MANIFEST_VERSION,"String_Node_Str");
  mainAttrs.put(Attributes.Name.MAIN_CLASS,GLASSFISH_APPCLIENT_GROUP_FACADE_CLASS_NAME);
  mainAttrs.put(GLASSFISH_APPCLIENT_GROUP,appClientGroupList);
  final File manifestFile=File.createTempFile("String_Node_Str","String_Node_Str");
  final OutputStream manifestOutputStream=new BufferedOutputStream(new FileOutputStream(manifestFile));
  try {
    manifest.write(manifestOutputStream);
  }
  finally {
    manifestOutputStream.close();
  }
  clientArtifactsManager.add(manifestFile,JarFile.MANIFEST_NAME,true);
  writeMainClass(clientArtifactsManager);
}
Program: 29400
Project: 29400
Buggy source:
private String getGFClientModuleClassPath(final File gfClientJAR) throws IOException {
  final JarFile jf=new JarFile(gfClientJAR);
  final Manifest mf=jf.getManifest();
  Attributes mainAttrs=mf.getMainAttributes();
  return mainAttrs.getValue(Attributes.Name.CLASS_PATH);
}

Fixed version (ground truth):
private String getGFClientModuleClassPath(final File gfClientJAR) throws IOException {
  final JarFile jf=new JarFile(gfClientJAR);
  try {
    final Manifest mf=jf.getManifest();
    Attributes mainAttrs=mf.getMainAttributes();
    return mainAttrs.getValue(Attributes.Name.CLASS_PATH);
  }
  finally {
    jf.close();
  }
}
Program: 29401
Project: 29401
Buggy source:
MainClassLaunchable(final ServiceLocator habitat,final Class mainClass){
  super();
  this.mainClass=mainClass;
  this.habitat=habitat;
}

Fixed version (ground truth):
MainClassLaunchable(final ServiceLocator habitat,final Class mainClass){
  super();
  this.mainClass=mainClass;
}
Program: 29403
Project: 29403
Buggy source:
/** 
 * We need to dynamically load the AMX module.  HOW?  we can't depend on the amx-impl module. For now though, assume that a well-known MBean is available through other means via the amx-impl module.
 */
public synchronized ObjectName bootAMX(){
  if (mDomainRootObjectName == null) {
    final AMXStartupServiceMBean loader=getLoader();
    final ObjectName startupON=AMXStartupServiceMBean.OBJECT_NAME;
    if (!mMBeanServer.isRegistered(startupON)) {
      throw new IllegalStateException("String_Node_Str" + startupON);
    }
    try {
      mDomainRootObjectName=(ObjectName)mMBeanServer.invoke(startupON,"String_Node_Str",null,null);
    }
 catch (    final JMException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
  }
  return mDomainRootObjectName;
}

Fixed version (ground truth):
/** 
 * We need to dynamically load the AMX module.  HOW?  we can't depend on the amx-impl module. For now though, assume that a well-known MBean is available through other means via the amx-impl module.
 */
public synchronized ObjectName bootAMX(){
  if (mDomainRootObjectName == null) {
    getLoader();
    final ObjectName startupON=AMXStartupServiceMBean.OBJECT_NAME;
    if (!mMBeanServer.isRegistered(startupON)) {
      throw new IllegalStateException("String_Node_Str" + startupON);
    }
    try {
      mDomainRootObjectName=(ObjectName)mMBeanServer.invoke(startupON,"String_Node_Str",null,null);
    }
 catch (    final JMException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
  }
  return mDomainRootObjectName;
}
Program: 29404
Project: 29404
Buggy source:
public BootAMXListener(final JMXConnectorServer server,final BootAMXMBean booter){
  mServer=server;
  mBooter=booter;
}

Fixed version (ground truth):
public BootAMXListener(final BootAMXMBean booter){
  mBooter=booter;
}
Program: 29405
Project: 29405
Buggy source:
public void handleNotification(final Notification notif,final Object handback){
  if (notif instanceof JMXConnectionNotification) {
    final JMXConnectionNotification n=(JMXConnectionNotification)notif;
    if (n.getType().equals(JMXConnectionNotification.OPENED)) {
      LOGGER.log(Level.INFO,JMX_BOOTING_AMX_LISTENER,handback);
      mBooter.bootAMX();
      try {
        mServer.removeNotificationListener(this);
        LOGGER.fine("String_Node_Str");
      }
 catch (      final ListenerNotFoundException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handleNotification(final Notification notif,final Object handback){
  if (notif instanceof JMXConnectionNotification) {
    final JMXConnectionNotification n=(JMXConnectionNotification)notif;
    if (n.getType().equals(JMXConnectionNotification.OPENED)) {
      LOGGER.log(Level.INFO,JMX_BOOTING_AMX_LISTENER,handback);
      mBooter.bootAMX();
      if (mServer != null) {
        try {
          mServer.removeNotificationListener(this);
          LOGGER.fine("String_Node_Str");
        }
 catch (        final ListenerNotFoundException e) {
          e.printStackTrace();
        }
      }
    }
  }
}
Program: 29406
Project: 29406
Buggy source:
ConnectorStarter(final MBeanServer mbeanServer,final String host,final int port,final String authRealmName,final boolean securityEnabled,final ServiceLocator habitat,final BootAMXListener bootListener,final Ssl sslConfig){
  mMBeanServer=mbeanServer;
  mHostName=host;
  mPort=port;
  mAuthRealmName=authRealmName;
  mSecurityEnabled=securityEnabled;
  mHabitat=habitat;
  mBootListener=bootListener;
  ssl=sslConfig;
}

Fixed version (ground truth):
ConnectorStarter(final MBeanServer mbeanServer,final String host,final int port,final boolean securityEnabled,final ServiceLocator habitat,final BootAMXListener bootListener){
  mMBeanServer=mbeanServer;
  mHostName=host;
  mPort=port;
  mSecurityEnabled=securityEnabled;
  mHabitat=habitat;
  mBootListener=bootListener;
}
Program: 29407
Project: 29407
Buggy source:
JMXMPConnectorStarter(final MBeanServer mbeanServer,final String address,final int port,final String authRealmName,final boolean securityEnabled,final ServiceLocator habitat,final BootAMXListener bootListener,final Ssl sslConfig){
  super(mbeanServer,address,port,authRealmName,securityEnabled,habitat,bootListener,sslConfig);
}

Fixed version (ground truth):
JMXMPConnectorStarter(final MBeanServer mbeanServer,final String address,final int port,final boolean securityEnabled,final ServiceLocator habitat,final BootAMXListener bootListener){
  super(mbeanServer,address,port,securityEnabled,habitat,bootListener);
}
Program: 29408
Project: 29408
Buggy source:
private JMXConnectorServer startConnector(final JmxConnector connConfig) throws IOException {
  JMX_LOGGER.fine("String_Node_Str" + toString(connConfig));
  final String protocol=connConfig.getProtocol();
  final String address=connConfig.getAddress();
  final int port=Integer.parseInt(connConfig.getPort());
  final String authRealmName=connConfig.getAuthRealmName();
  final boolean securityEnabled=Boolean.parseBoolean(connConfig.getSecurityEnabled());
  final Ssl ssl=connConfig.getSsl();
  JMXConnectorServer server=null;
  final BootAMXListener listener=mNeedBootListeners ? new BootAMXListener(server,mAMXBooterNew) : null;
  if (protocol.equals("String_Node_Str")) {
    starter=new RMIConnectorStarter(mMBeanServer,address,port,protocol,authRealmName,securityEnabled,habitat,listener,ssl);
    server=((RMIConnectorStarter)starter).start();
  }
 else   if (protocol.equals("String_Node_Str")) {
    starter=new JMXMPConnectorStarter(mMBeanServer,address,port,authRealmName,securityEnabled,habitat,listener,ssl);
    server=((JMXMPConnectorStarter)starter).start();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + protocol);
  }
  final JMXServiceURL url=server.getAddress();
  JMX_LOGGER.log(Level.INFO,JMX_STARTED_SERVICE,url);
  try {
    connObjectName=new ObjectName(JMX_CONNECTOR_SERVER_PREFIX + "String_Node_Str" + protocol+ "String_Node_Str"+ connConfig.getName());
    ObjectName connObjectName1=mMBeanServer.registerMBean(server,connObjectName).getObjectName();
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
  return server;
}

Fixed version (ground truth):
private JMXConnectorServer startConnector(final JmxConnector connConfig) throws IOException {
  JMX_LOGGER.fine("String_Node_Str" + toString(connConfig));
  final String protocol=connConfig.getProtocol();
  final String address=connConfig.getAddress();
  final int port=Integer.parseInt(connConfig.getPort());
  final boolean securityEnabled=Boolean.parseBoolean(connConfig.getSecurityEnabled());
  final Ssl ssl=connConfig.getSsl();
  JMXConnectorServer server=null;
  final BootAMXListener listener=mNeedBootListeners ? new BootAMXListener(mAMXBooterNew) : null;
  if (protocol.equals("String_Node_Str")) {
    starter=new RMIConnectorStarter(mMBeanServer,address,port,protocol,securityEnabled,habitat,listener,ssl);
    server=((RMIConnectorStarter)starter).start();
  }
 else   if (protocol.equals("String_Node_Str")) {
    starter=new JMXMPConnectorStarter(mMBeanServer,address,port,securityEnabled,habitat,listener);
    server=((JMXMPConnectorStarter)starter).start();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + protocol);
  }
  if (listener != null) {
    listener.setServer(server);
  }
  final JMXServiceURL url=server.getAddress();
  JMX_LOGGER.log(Level.INFO,JMX_STARTED_SERVICE,url);
  try {
    connObjectName=new ObjectName(JMX_CONNECTOR_SERVER_PREFIX + "String_Node_Str" + protocol+ "String_Node_Str"+ connConfig.getName());
    mMBeanServer.registerMBean(server,connObjectName).getObjectName();
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
  return server;
}
Program: 29409
Project: 29409
Buggy source:
private PendingConfigBeanJob add(final ConfigBean cb,final CountDownLatch latch){
  ConfigBean ancestor=cb;
  ConfigBean parent;
  while ((parent=asConfigBean(ancestor.parent())) != null) {
    ancestor=parent;
  }
  PendingConfigBeanJob job=null;
  if (ancestor != null && ancestor.getProxyType().getName().endsWith("String_Node_Str")) {
    job=addJob(new PendingConfigBeanJob(cb,latch));
  }
 else {
    Util.getLogger().info("String_Node_Str" + cb.getProxyType().getName());
    if (latch != null) {
      latch.countDown();
    }
  }
  return job;
}

Fixed version (ground truth):
private PendingConfigBeanJob add(final ConfigBean cb,final CountDownLatch latch){
  ConfigBean ancestor=cb;
  ConfigBean parent;
  while ((parent=asConfigBean(ancestor.parent())) != null) {
    ancestor=parent;
  }
  PendingConfigBeanJob job=null;
  if (ancestor.getProxyType().getName().endsWith("String_Node_Str")) {
    job=addJob(new PendingConfigBeanJob(cb,latch));
  }
 else {
    Util.getLogger().log(Level.INFO,"String_Node_Str",cb.getProxyType().getName());
    if (latch != null) {
      latch.countDown();
    }
  }
  return job;
}
Program: 29410
Project: 29410
Buggy source:
public void unprocessedTransactedEvents(List<UnprocessedChangeEvents> changes){
}

Fixed version (ground truth):
@Override public void unprocessedTransactedEvents(List<UnprocessedChangeEvents> changes){
}
Program: 29411
Project: 29411
Buggy source:
/** 
 * This is a workaround for the fact that the onEntered() is not being called in all cases, namely during deployment before AMX has loaded.  See disableTransactionListener() above.
 */
public synchronized void transactionCommited(final List<PropertyChangeEvent> events){
  for (  final PropertyChangeEvent event : events) {
    final Object oldValue=event.getOldValue();
    final Object newValue=event.getNewValue();
    final Object source=event.getSource();
    final String propertyName=event.getPropertyName();
    if (oldValue == null && newValue instanceof ConfigBeanProxy) {
      final ConfigBean cb=asConfigBean(ConfigBean.unwrap((ConfigBeanProxy)newValue));
      add(cb);
    }
 else     if (newValue == null && (oldValue instanceof ConfigBeanProxy)) {
      final ConfigBean cb=asConfigBean(ConfigBean.unwrap((ConfigBeanProxy)oldValue));
      remove(cb);
    }
 else {
    }
  }
}

Fixed version (ground truth):
/** 
 * This is a workaround for the fact that the onEntered() is not being called in all cases, namely during deployment before AMX has loaded.  See disableTransactionListener() above.
 */
@Override public synchronized void transactionCommited(final List<PropertyChangeEvent> events){
  for (  final PropertyChangeEvent event : events) {
    final Object oldValue=event.getOldValue();
    final Object newValue=event.getNewValue();
    if (oldValue == null && newValue instanceof ConfigBeanProxy) {
      final ConfigBean cb=asConfigBean(ConfigBean.unwrap((ConfigBeanProxy)newValue));
      add(cb);
    }
 else     if (newValue == null && (oldValue instanceof ConfigBeanProxy)) {
      final ConfigBean cb=asConfigBean(ConfigBean.unwrap((ConfigBeanProxy)oldValue));
      remove(cb);
    }
  }
}
Program: 29412
Project: 29412
Buggy source:
public void onEntered(final Provider<ConfigBean> provider){
  final ConfigBean cb=asConfigBean(provider);
  if (cb != null) {
    add(cb);
  }
}

Fixed version (ground truth):
@Override public void onEntered(final Provider<ConfigBean> provider){
  final ConfigBean cb=asConfigBean(provider);
  if (cb != null) {
    add(cb);
  }
}
Program: 29413
Project: 29413
Buggy source:
public void postConstruct(){
  transactions.addTransactionsListener(this);
}

Fixed version (ground truth):
@Override public void postConstruct(){
  transactions.addTransactionsListener(this);
}
Program: 29414
Project: 29414
Buggy source:
/** 
 * Method to validate jndi name for app namespace
 * @param myVector
 * @return
 */
private boolean compareVectorForApp(Vector myVector,String jndiName){
  for (int j=0; j < myVector.size(); j++) {
    String firstElement=(String)myVector.get(j);
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(0,firstElement.indexOf("String_Node_Str"));
    }
    for (int i=j; i < myVector.size(); i++) {
      String otherElements=(String)myVector.get(i);
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(0,otherElements.indexOf("String_Node_Str"));
      }
      if (!firstElement.equals(otherElements)) {
        inValidJndiName=jndiName;
        DOLUtils.getDefaultLogger().log(Level.SEVERE,"String_Node_Str",new Object[]{jndiName,application.getAppName()});
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Method to validate jndi name for app namespace
 * @param myVector
 * @return
 */
private boolean compareVectorForApp(Vector myVector,String jndiName){
  for (int j=0; j < myVector.size(); j++) {
    String firstElement=(String)myVector.get(j);
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(0,firstElement.indexOf("String_Node_Str"));
    }
    for (int i=j + 1; i < myVector.size(); i++) {
      String otherElements=(String)myVector.get(i);
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(0,otherElements.indexOf("String_Node_Str"));
      }
      if (firstElement.equals(otherElements)) {
        inValidJndiName=jndiName;
        DOLUtils.getDefaultLogger().log(Level.SEVERE,"String_Node_Str",new Object[]{jndiName,application.getAppName()});
      }
    }
  }
  return true;
}
Program: 29416
Project: 29416
Buggy source:
/** 
 * Method to validate jndi name for module namespace
 * @param myVector
 * @return
 */
private boolean compareVectorForModule(Vector myVector,String jndiName){
  if (!compareVectorForApp(myVector,jndiName)) {
    return false;
  }
  for (int j=0; j < myVector.size(); j++) {
    String firstElement=(String)myVector.firstElement();
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(firstElement.indexOf("String_Node_Str") + 1,firstElement.length());
    }
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(0,firstElement.indexOf("String_Node_Str"));
    }
    for (int i=j; i < myVector.size(); i++) {
      String otherElements=(String)myVector.get(i);
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(otherElements.indexOf("String_Node_Str") + 1,otherElements.length());
      }
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(0,otherElements.indexOf("String_Node_Str"));
      }
      if (!firstElement.equals(otherElements)) {
        inValidJndiName=jndiName;
        DOLUtils.getDefaultLogger().log(Level.SEVERE,"String_Node_Str",new Object[]{jndiName,application.getAppName()});
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Method to validate jndi name for module namespace
 * @param myVector
 * @return
 */
private boolean compareVectorForModule(Vector myVector,String jndiName){
  if (!compareVectorForApp(myVector,jndiName)) {
    return false;
  }
  for (int j=0; j < myVector.size(); j++) {
    String firstElement=(String)myVector.firstElement();
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(firstElement.indexOf("String_Node_Str") + 1,firstElement.length());
    }
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(0,firstElement.indexOf("String_Node_Str"));
    }
    for (int i=j + 1; i < myVector.size(); i++) {
      String otherElements=(String)myVector.get(i);
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(otherElements.indexOf("String_Node_Str") + 1,otherElements.length());
      }
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(0,otherElements.indexOf("String_Node_Str"));
      }
      if (firstElement.equals(otherElements)) {
        inValidJndiName=jndiName;
        DOLUtils.getDefaultLogger().log(Level.SEVERE,"String_Node_Str",new Object[]{jndiName,application.getAppName()});
      }
    }
  }
  return true;
}
Program: 29418
Project: 29418
Buggy source:
/** 
 * Method to validate jndi name for comp namespace
 * @param myVector
 * @return
 */
private boolean compareVectorForComp(Vector myVector,String jndiName){
  if (!compareVectorForModule(myVector,jndiName)) {
    return false;
  }
  for (int j=0; j < myVector.size(); j++) {
    String firstElement=(String)myVector.firstElement();
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(firstElement.lastIndexOf("String_Node_Str") + 1,firstElement.length());
    }
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(firstElement.lastIndexOf("String_Node_Str") + 1,firstElement.length());
    }
    for (int i=j; i < myVector.size(); i++) {
      String otherElements=(String)myVector.get(i);
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(otherElements.lastIndexOf("String_Node_Str") + 1,otherElements.length());
      }
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(otherElements.lastIndexOf("String_Node_Str") + 1,otherElements.length());
      }
      if (!firstElement.equals(otherElements)) {
        inValidJndiName=jndiName;
        DOLUtils.getDefaultLogger().log(Level.SEVERE,"String_Node_Str",new Object[]{jndiName,application.getAppName()});
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Method to validate jndi name for comp namespace
 * @param myVector
 * @return
 */
private boolean compareVectorForComp(Vector myVector,String jndiName){
  if (!compareVectorForModule(myVector,jndiName)) {
    return false;
  }
  for (int j=0; j < myVector.size(); j++) {
    String firstElement=(String)myVector.firstElement();
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(firstElement.lastIndexOf("String_Node_Str") + 1,firstElement.length());
    }
    if (firstElement.contains("String_Node_Str")) {
      firstElement=firstElement.substring(firstElement.lastIndexOf("String_Node_Str") + 1,firstElement.length());
    }
    for (int i=j + 1; i < myVector.size(); i++) {
      String otherElements=(String)myVector.get(i);
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(otherElements.lastIndexOf("String_Node_Str") + 1,otherElements.length());
      }
      if (otherElements.contains("String_Node_Str")) {
        otherElements=otherElements.substring(otherElements.lastIndexOf("String_Node_Str") + 1,otherElements.length());
      }
      if (firstElement.equals(otherElements)) {
        inValidJndiName=jndiName;
        DOLUtils.getDefaultLogger().log(Level.SEVERE,"String_Node_Str",new Object[]{jndiName,application.getAppName()});
        return false;
      }
    }
  }
  return true;
}
Program: 29421
Project: 29421
Buggy source:
/** 
 * Set an attribute as read only.
 */
void setAttributeReadOnly(String name){
synchronized (attributes) {
    if (attributes.containsKey(name))     readOnlyAttributes.put(name,name);
  }
}

Fixed version (ground truth):
/** 
 * Set an attribute as read only.
 */
void setAttributeReadOnly(String name){
synchronized (attributesLock) {
    if (attributes.containsKey(name))     readOnlyAttributes.put(name,name);
  }
}
Program: 29422
Project: 29422
Buggy source:
/** 
 * Clear all application-created attributes.
 */
void clearAttributes(){
  ArrayList<String> list=new ArrayList<String>();
synchronized (attributes) {
    Iterator<String> iter=attributes.keySet().iterator();
    while (iter.hasNext()) {
      list.add(iter.next());
    }
  }
  Iterator<String> keys=list.iterator();
  while (keys.hasNext()) {
    String key=keys.next();
    removeAttribute(key);
  }
}

Fixed version (ground truth):
/** 
 * Clear all application-created attributes.
 */
void clearAttributes(){
  ArrayList<String> list=new ArrayList<String>();
synchronized (attributesLock) {
    Iterator<String> iter=attributes.keySet().iterator();
    while (iter.hasNext()) {
      list.add(iter.next());
    }
  }
  Iterator<String> keys=list.iterator();
  while (keys.hasNext()) {
    String key=keys.next();
    removeAttribute(key);
  }
}
Program: 29424
Project: 29424
Buggy source:
/** 
 * Remove the context attribute with the specified name, if any.
 * @param name Name of the context attribute to be removed
 */
@Override public void removeAttribute(String name){
  Object value=null;
  boolean found=false;
synchronized (attributes) {
    if (readOnlyAttributes.containsKey(name))     return;
    found=attributes.containsKey(name);
    if (found) {
      value=attributes.get(name);
      attributes.remove(name);
    }
 else {
      return;
    }
  }
  List<EventListener> listeners=context.getApplicationEventListeners();
  if (listeners.isEmpty()) {
    return;
  }
  ServletContextAttributeEvent event=new ServletContextAttributeEvent(context.getServletContext(),name,value);
  Iterator<EventListener> iter=listeners.iterator();
  while (iter.hasNext()) {
    EventListener eventListener=iter.next();
    if (!(eventListener instanceof ServletContextAttributeListener)) {
      continue;
    }
    ServletContextAttributeListener listener=(ServletContextAttributeListener)eventListener;
    try {
      context.fireContainerEvent(ContainerEvent.BEFORE_CONTEXT_ATTRIBUTE_REMOVED,listener);
      listener.attributeRemoved(event);
      context.fireContainerEvent(ContainerEvent.AFTER_CONTEXT_ATTRIBUTE_REMOVED,listener);
    }
 catch (    Throwable t) {
      context.fireContainerEvent(ContainerEvent.AFTER_CONTEXT_ATTRIBUTE_REMOVED,listener);
      log(sm.getString("String_Node_Str"),t);
    }
  }
}

Fixed version (ground truth):
/** 
 * Remove the context attribute with the specified name, if any.
 * @param name Name of the context attribute to be removed
 */
@Override public void removeAttribute(String name){
  Object value=null;
  boolean found=false;
synchronized (attributesLock) {
    if (readOnlyAttributes.containsKey(name))     return;
    value=attributes.remove(name);
    if (value == null)     return;
  }
  List<EventListener> listeners=context.getApplicationEventListeners();
  if (listeners.isEmpty()) {
    return;
  }
  ServletContextAttributeEvent event=new ServletContextAttributeEvent(context.getServletContext(),name,value);
  Iterator<EventListener> iter=listeners.iterator();
  while (iter.hasNext()) {
    EventListener eventListener=iter.next();
    if (!(eventListener instanceof ServletContextAttributeListener)) {
      continue;
    }
    ServletContextAttributeListener listener=(ServletContextAttributeListener)eventListener;
    try {
      context.fireContainerEvent(ContainerEvent.BEFORE_CONTEXT_ATTRIBUTE_REMOVED,listener);
      listener.attributeRemoved(event);
      context.fireContainerEvent(ContainerEvent.AFTER_CONTEXT_ATTRIBUTE_REMOVED,listener);
    }
 catch (    Throwable t) {
      context.fireContainerEvent(ContainerEvent.AFTER_CONTEXT_ATTRIBUTE_REMOVED,listener);
      log(sm.getString("String_Node_Str"),t);
    }
  }
}
Program: 29430
Project: 29430
Buggy source:
/** 
 * To get an instance of ConnectionHolder.<br> Will return a ConnectionHolder with or without wrapper<br>
 * @param conObject         Connection
 * @param mcObject          ManagedConnection
 * @param criObject         Connection Request Info
 * @param statementWrapping Whether to wrap statement objects or not.
 * @return ConnectionHolder
 */
public abstract ConnectionHolder getConnection(Connection conObject,ManagedConnection mcObject,javax.resource.spi.ConnectionRequestInfo criObject,boolean statementWrapping,SQLTraceDelegator sqlTraceDelegator);

Fixed version (ground truth):
/** 
 * To get an instance of ConnectionHolder.<br> Will return a ConnectionHolder with or without wrapper<br>
 * @param conObject         Connection
 * @param mcObject          ManagedConnection
 * @param criObject         Connection Request Info
 * @param statementWrapping Whether to wrap statement objects or not.
 * @return ConnectionHolder
 */
public abstract ConnectionHolder getConnection(Connection conObject,ManagedConnectionImpl mcObject,javax.resource.spi.ConnectionRequestInfo criObject,boolean statementWrapping,SQLTraceDelegator sqlTraceDelegator);
Program: 29431
Project: 29431
Buggy source:
/** 
 * Returns a DataSource instance.
 * @param mcfObject Managed Connection Factory
 * @param cmObject  Connection Manager
 * @return DataSource
 */
public abstract javax.sql.DataSource getDataSourceInstance(ManagedConnectionFactory mcfObject,javax.resource.spi.ConnectionManager cmObject);

Fixed version (ground truth):
/** 
 * Returns a DataSource instance.
 * @param mcfObject Managed Connection Factory
 * @param cmObject  Connection Manager
 * @return DataSource
 */
public abstract javax.sql.DataSource getDataSourceInstance(ManagedConnectionFactoryImpl mcfObject,javax.resource.spi.ConnectionManager cmObject);
Program: 29432
Project: 29432
Buggy source:
/** 
 * Constructor for <code>LocalTransactionImpl</code>.
 * @param mc <code>ManagedConnection</code> that returnsthis <code>LocalTransactionImpl</code> object as a result of <code>getLocalTransaction</code>
 */
public LocalTransactionImpl(ManagedConnection mc){
  this.mc=mc;
}

Fixed version (ground truth):
/** 
 * Constructor for <code>LocalTransactionImpl</code>.
 * @param mc <code>ManagedConnection</code> that returnsthis <code>LocalTransactionImpl</code> object as a result of <code>getLocalTransaction</code>
 */
public LocalTransactionImpl(ManagedConnectionImpl mc){
  this.mc=mc;
}
Program: 29433
Project: 29433
Buggy source:
public final void unregisterMBean(final ObjectName objectName) throws InstanceNotFoundException, MBeanRegistrationException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).unregisterMBean(objectName);
      return;
    }
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr))       getDelegateMBeanServer().unregisterMBean(objectName);
 else       getInstanceConnection(svr).unregisterMBean(objectName);
    }
  }
 catch (  IOException io) {
    throw new MBeanRegistrationException(io);
  }
}

Fixed version (ground truth):
public final void unregisterMBean(final ObjectName objectName) throws InstanceNotFoundException, MBeanRegistrationException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).unregisterMBean(objectName);
      return;
    }
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr))       getDelegateMBeanServer().unregisterMBean(objectName);
 else       getInstanceConnection(svr).unregisterMBean(objectName);
    }
  }
 catch (  IOException io) {
    throw new MBeanRegistrationException(io);
  }
}
Program: 29434
Project: 29434
Buggy source:
public Object invoke(final ObjectName objectName,final String operationName,final Object[] params,final String[] signature) throws ReflectionException, InstanceNotFoundException, MBeanException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  Object returnValue=null;
  try {
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr)) {
        returnValue=getDelegateMBeanServer().invoke(objectName,operationName,params,signature);
      }
 else {
        returnValue=getInstanceConnection(svr).invoke(objectName,operationName,params,signature);
      }
    }
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
  return returnValue;
}

Fixed version (ground truth):
public Object invoke(final ObjectName objectName,final String operationName,final Object[] params,final String[] signature) throws ReflectionException, InstanceNotFoundException, MBeanException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  Object returnValue=null;
  try {
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr)) {
        returnValue=getDelegateMBeanServer().invoke(objectName,operationName,params,signature);
      }
 else {
        returnValue=getInstanceConnection(svr).invoke(objectName,operationName,params,signature);
      }
    }
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
  return returnValue;
}
Program: 29435
Project: 29435
Buggy source:
public AttributeList setAttributes(final ObjectName objectName,final AttributeList attributeList) throws InstanceNotFoundException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  AttributeList ret=null;
  try {
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).setAttributes(objectName,attributeList);
    for (    String svr : result.getInstances()) {
      if ((result.getInstances().get(0).equals("String_Node_Str")))       ret=getDelegateMBeanServer().setAttributes(objectName,attributeList);
 else       ret=getInstanceConnection(svr).setAttributes(objectName,attributeList);
    }
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
  return ret;
}

Fixed version (ground truth):
public AttributeList setAttributes(final ObjectName objectName,final AttributeList attributeList) throws InstanceNotFoundException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  AttributeList ret=null;
  try {
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).setAttributes(objectName,attributeList);
    for (    String svr : result.getInstances()) {
      if ((result.getInstances().get(0).equals("String_Node_Str")))       ret=getDelegateMBeanServer().setAttributes(objectName,attributeList);
 else       ret=getInstanceConnection(svr).setAttributes(objectName,attributeList);
    }
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
  return ret;
}
Program: 29437
Project: 29437
Buggy source:
public void setAttribute(final ObjectName objectName,final Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, MBeanException, ReflectionException, InvalidAttributeValueException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).setAttribute(objectName,attribute);
      return;
    }
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr))       getDelegateMBeanServer().setAttribute(objectName,attribute);
 else       getInstanceConnection(svr).setAttribute(objectName,attribute);
    }
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}

Fixed version (ground truth):
public void setAttribute(final ObjectName objectName,final Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, MBeanException, ReflectionException, InvalidAttributeValueException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).setAttribute(objectName,attribute);
      return;
    }
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr))       getDelegateMBeanServer().setAttribute(objectName,attribute);
 else       getInstanceConnection(svr).setAttribute(objectName,attribute);
    }
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}
Program: 29438
Project: 29438
Buggy source:
public final Object getAttribute(final ObjectName objectName,final String attributeName) throws InstanceNotFoundException, AttributeNotFoundException, MBeanException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  if (!result.isTargetAnInstance())   return getDelegateMBeanServer().getAttribute(objectName,attributeName);
  try {
    return getInstanceConnection(result.getInstances().get(0)).getAttribute(objectName,attributeName);
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}

Fixed version (ground truth):
public final Object getAttribute(final ObjectName objectName,final String attributeName) throws InstanceNotFoundException, AttributeNotFoundException, MBeanException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  if (!result.isTargetAnInstance())   return getDelegateMBeanServer().getAttribute(objectName,attributeName);
  try {
    return getInstanceConnection(result.getInstances().get(0)).getAttribute(objectName,attributeName);
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}
Program: 29439
Project: 29439
Buggy source:
public final ObjectInstance createMBean(final String str,final ObjectName objectName,final ObjectName objectName2,final Object[] obj,final String[] str4) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException {
  try {
    ReplicationInfo result=getInstance(objectName);
    ObjectInstance ret=null;
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).createMBean(str,objectName,objectName2,obj,str4);
    for (    String svr : result.getInstances())     if (svr.equals("String_Node_Str"))     ret=getDelegateMBeanServer().createMBean(str,objectName,objectName2,obj,str4);
 else     ret=getInstanceConnection(svr).createMBean(str,objectName,objectName2,obj,str4);
    return ret;
  }
 catch (  Exception ioex) {
    throw new MBeanException(ioex);
  }
}

Fixed version (ground truth):
public final ObjectInstance createMBean(final String str,final ObjectName objectName,final ObjectName objectName2,final Object[] obj,final String[] str4) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException {
  try {
    DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
    ObjectInstance ret=null;
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).createMBean(str,objectName,objectName2,obj,str4);
    for (    String svr : result.getInstances())     if (svr.equals("String_Node_Str"))     ret=getDelegateMBeanServer().createMBean(str,objectName,objectName2,obj,str4);
 else     ret=getInstanceConnection(svr).createMBean(str,objectName,objectName2,obj,str4);
    return ret;
  }
 catch (  Exception ioex) {
    throw new MBeanException(ioex);
  }
}
Program: 29440
Project: 29440
Buggy source:
public final AttributeList getAttributes(final ObjectName objectName,final String[] attrNames) throws InstanceNotFoundException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).getAttributes(objectName,attrNames);
 else     return getDelegateMBeanServer().getAttributes(objectName,attrNames);
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}

Fixed version (ground truth):
public final AttributeList getAttributes(final ObjectName objectName,final String[] attrNames) throws InstanceNotFoundException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).getAttributes(objectName,attrNames);
 else     return getDelegateMBeanServer().getAttributes(objectName,attrNames);
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}