nus-yam/ex-repair huggingface dataset:
Program: 29145
Project: 29145
Buggy source:
@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  ServletResponse wResponse=null;
  if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
    HttpServletRequest req=(HttpServletRequest)request;
    HttpServletResponse res=(HttpServletResponse)response;
    boolean skipNonceCheck=false;
    if (Constants.METHOD_GET.equals(req.getMethod())) {
      String path=req.getServletPath();
      if (req.getPathInfo() != null) {
        path=path + req.getPathInfo();
      }
      if (entryPoints.contains(path)) {
        skipNonceCheck=true;
      }
    }
    @SuppressWarnings("String_Node_Str") LruCache<String> nonceCache=(LruCache<String>)req.getSession(true).getAttribute(Constants.CSRF_NONCE_SESSION_ATTR_NAME);
    if (!skipNonceCheck) {
      String previousNonce=req.getParameter(Constants.CSRF_NONCE_REQUEST_PARAM);
      if (nonceCache != null && !nonceCache.contains(previousNonce)) {
        res.sendError(HttpServletResponse.SC_FORBIDDEN);
        return;
      }
    }
    if (nonceCache == null) {
      nonceCache=new LruCache<String>(nonceCacheSize);
      req.getSession().setAttribute(Constants.CSRF_NONCE_SESSION_ATTR_NAME,nonceCache);
    }
    String newNonce=generateNonce();
    nonceCache.add(newNonce);
    wResponse=new CsrfResponseWrapper(res,newNonce);
  }
 else {
    wResponse=response;
  }
  chain.doFilter(request,wResponse);
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  ServletResponse wResponse=null;
  if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
    HttpServletRequest req=(HttpServletRequest)request;
    HttpServletResponse res=(HttpServletResponse)response;
    boolean skipNonceCheck=false;
    if (Constants.METHOD_GET.equals(req.getMethod())) {
      String path=req.getServletPath();
      if (req.getPathInfo() != null) {
        path=path + req.getPathInfo();
      }
      if (entryPoints.contains(path)) {
        skipNonceCheck=true;
      }
    }
    HttpSession session=req.getSession(false);
    @SuppressWarnings("String_Node_Str") LruCache<String> nonceCache=(session == null) ? null : (LruCache<String>)session.getAttribute(Constants.CSRF_NONCE_SESSION_ATTR_NAME);
    if (!skipNonceCheck) {
      String previousNonce=req.getParameter(Constants.CSRF_NONCE_REQUEST_PARAM);
      if (nonceCache == null || previousNonce == null || !nonceCache.contains(previousNonce)) {
        res.sendError(HttpServletResponse.SC_FORBIDDEN);
        return;
      }
    }
    if (nonceCache == null) {
      nonceCache=new LruCache<String>(nonceCacheSize);
      if (session == null) {
        session=req.getSession(true);
      }
      session.setAttribute(Constants.CSRF_NONCE_SESSION_ATTR_NAME,nonceCache);
    }
    String newNonce=generateNonce();
    nonceCache.add(newNonce);
    wResponse=new CsrfResponseWrapper(res,newNonce);
  }
 else {
    wResponse=response;
  }
  chain.doFilter(request,wResponse);
}
Program: 29146
Project: 29146
Buggy source:
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  setMethodSpec((String)s.readFields().get("String_Node_Str",null));
}

Fixed version (ground truth):
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  setMethodSpec((String)s.readFields().get("String_Node_Str",null));
}
Program: 29147
Project: 29147
Buggy source:
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();
}

Fixed version (ground truth):
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();
}
Program: 29149
Project: 29149
Buggy source:
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  this.methodSpec=HttpMethodSpec.getSpec((String)s.readFields().get("String_Node_Str",null));
  this.urlPatternSpec=new URLPatternSpec(super.getName());
}

Fixed version (ground truth):
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  this.methodSpec=HttpMethodSpec.getSpec((String)s.readFields().get("String_Node_Str",null));
  this.urlPatternSpec=new URLPatternSpec(super.getName());
}
Program: 29150
Project: 29150
Buggy source:
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  parseActions((String)s.readFields().get("String_Node_Str",null));
  this.urlPatternSpec=new URLPatternSpec(super.getName());
}

Fixed version (ground truth):
/** 
 * readObject reads the serialized fields from the input stream and uses them to restore the permission.  This method need not be implemented if establishing the  values of the serialized fields (as is done by defaultReadObject)  is sufficient to initialize the permission.
 */
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  parseActions((String)s.readFields().get("String_Node_Str",null));
  this.urlPatternSpec=new URLPatternSpec(super.getName());
}
Program: 29153
Project: 29153
Buggy source:
public CustomSocketFactory(){
  SSLUtils sslUtils=Globals.getDefaultHabitat().getService(SSLUtils.class);
  SSLContext sc=null;
  try {
    sc=SSLContext.getInstance(SSL);
    sc.init(sslUtils.getKeyManagers(),sslUtils.getTrustManagers(),SharedSecureRandom.get());
  }
 catch (  Exception ex) {
    _logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  socketFactory=sc.getSocketFactory();
}

Fixed version (ground truth):
public CustomSocketFactory(){
  SSLUtils sslUtils=Globals.getDefaultHabitat().getService(SSLUtils.class);
  SSLContext sc=null;
  try {
    sc=SSLContext.getInstance(SSL);
    sc.init(sslUtils.getKeyManagers(),sslUtils.getTrustManagers(),SharedSecureRandom.get());
    socketFactory=sc.getSocketFactory();
  }
 catch (  Exception ex) {
    _logger.log(Level.WARNING,"String_Node_Str",ex);
  }
}
Program: 29155
Project: 29155
Buggy source:
public static File writeConfigFileToTempDir(String fileName) throws IOException {
  File filePath=new File(fileName);
  if (filePath.exists()) {
    return filePath;
  }
  File localFile=null;
  if (filePath.getParentFile() != null && filePath.getParentFile().exists()) {
    localFile=filePath;
    if (!localFile.createNewFile()) {
      throw new IOException();
    }
  }
 else {
    String userHome=System.getProperty("String_Node_Str");
    String embeddedServerName=getCurrentEmbeddedServerName();
    File tempDir=new File(userHome + File.separator + "String_Node_Str"+ embeddedServerName+ File.separator+ "String_Node_Str");
    boolean mkDirSuccess=true;
    if (!tempDir.exists()) {
      mkDirSuccess=tempDir.mkdirs();
    }
    localFile=new File(tempDir.getAbsolutePath() + File.separator + fileName);
    if (mkDirSuccess && !localFile.exists()) {
      localFile.createNewFile();
    }
  }
  FileOutputStream oStream=null;
  InputStream iStream=null;
  try {
    oStream=new FileOutputStream(localFile);
    iStream=Util.class.getResourceAsStream("String_Node_Str" + fileName);
    while (iStream != null && iStream.available() > 0) {
      oStream.write(iStream.read());
    }
  }
  finally {
    oStream.close();
    if (iStream != null) {
      iStream.close();
    }
  }
  return localFile;
}

Fixed version (ground truth):
public static File writeConfigFileToTempDir(String fileName) throws IOException {
  File filePath=new File(fileName);
  if (filePath.exists()) {
    return filePath;
  }
  File localFile=null;
  if (filePath.getParentFile() != null && filePath.getParentFile().exists()) {
    localFile=filePath;
    if (!localFile.createNewFile()) {
      throw new IOException();
    }
  }
 else {
    String userHome=System.getProperty("String_Node_Str");
    String embeddedServerName=getCurrentEmbeddedServerName();
    File tempDir=new File(userHome + File.separator + "String_Node_Str"+ embeddedServerName+ File.separator+ "String_Node_Str");
    boolean mkDirSuccess=true;
    if (!tempDir.exists()) {
      mkDirSuccess=tempDir.mkdirs();
    }
    localFile=new File(tempDir.getAbsolutePath() + File.separator + fileName);
    if (mkDirSuccess && !localFile.exists()) {
      localFile.createNewFile();
    }
  }
  FileOutputStream oStream=null;
  InputStream iStream=null;
  try {
    oStream=new FileOutputStream(localFile);
    iStream=Util.class.getResourceAsStream("String_Node_Str" + fileName);
    while (iStream != null && iStream.available() > 0) {
      oStream.write(iStream.read());
    }
  }
  finally {
    if (oStream != null) {
      oStream.close();
    }
    if (iStream != null) {
      iStream.close();
    }
  }
  return localFile;
}
Program: 29156
Project: 29156
Buggy source:
/** 
 * Get (EJB or Web) Policy context identifiers for app.
 * @param app2iDmap maps appName (as key) to list of policy context identifiers (as value). 
 * @param appName the application name, (i.e., the lookup key).
 * @param remove boolean indicating whether the corresponding mappingsare to be removed from the app2iDmap.
 * @return a non-zero length array containing the selectedpolicy context identifiers, or null.
 */
public <T>String[] getContextsForApp(Map<String,ArrayList<String>> app2iDmap,String appName,boolean remove){
  String[] ctxIds=null;
synchronized (app2iDmap) {
    ArrayList<String> ctxList=app2iDmap.get(appName);
    if (ctxList != null && !ctxList.isEmpty()) {
      ctxIds=ctxList.toArray(new String[0]);
    }
    if (remove) {
      app2iDmap.remove(appName);
    }
  }
  return ctxIds;
}

Fixed version (ground truth):
/** 
 * Get (EJB or Web) Policy context identifiers for app.
 * @param app2iDmap maps appName (as key) to list of policy context identifiers (as value). 
 * @param appName the application name, (i.e., the lookup key).
 * @param remove boolean indicating whether the corresponding mappingsare to be removed from the app2iDmap.
 * @return a non-zero length array containing the selectedpolicy context identifiers, or null.
 */
public <T>String[] getContextsForApp(Map<String,ArrayList<String>> app2iDmap,String appName,boolean remove){
  String[] ctxIds=null;
synchronized (app2iDmap) {
    ArrayList<String> ctxList=app2iDmap.get(appName);
    if (ctxList != null && !ctxList.isEmpty()) {
      ctxIds=ctxList.toArray(new String[ctxList.size()]);
    }
    if (remove) {
      app2iDmap.remove(appName);
    }
  }
  return ctxIds;
}
Program: 29157
Project: 29157
Buggy source:
/** 
 * Choose the client alias that will be used to select the client certificate for SSL client auth.
 * @param the keytype
 * @param the certificate issuers.
 * @param the socket used for this connection. This parameter can be null,in which case the method will return the most generic alias to use.
 * @return the alias.
 */
public String chooseClientAlias(String[] keyType,Principal[] issuers,Socket socket){
  String clientAlias=null;
  if (this.alias == null) {
    if (Util.getInstance().isNotServerORACC()) {
      clientAlias=mgr.chooseClientAlias(keyType,issuers,socket);
    }
 else {
      if (Util.getInstance().isACC()) {
        ClientSecurityContext ctx=ClientSecurityContext.getCurrent();
        Subject s=ctx.getSubject();
        if (s == null) {
          doClientLogin(SecurityConstants.CERTIFICATE,Util.getInstance().getCallbackHandler());
          s=ctx.getSubject();
        }
        Iterator itr=s.getPrivateCredentials().iterator();
        while (itr.hasNext()) {
          Object o=itr.next();
          if (o instanceof X509CertificateCredential) {
            X509CertificateCredential crt=(X509CertificateCredential)o;
            clientAlias=crt.getAlias();
            break;
          }
        }
      }
    }
  }
 else {
    clientAlias=this.alias;
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str",clientAlias);
  }
  return clientAlias;
}

Fixed version (ground truth):
/** 
 * Choose the client alias that will be used to select the client certificate for SSL client auth.
 * @param the keytype
 * @param the certificate issuers.
 * @param the socket used for this connection. This parameter can be null,in which case the method will return the most generic alias to use.
 * @return the alias.
 */
public String chooseClientAlias(String[] keyType,Principal[] issuers,Socket socket){
  String clientAlias=null;
  if (this.alias == null) {
    if (Util.getInstance().isNotServerOrACC()) {
      clientAlias=mgr.chooseClientAlias(keyType,issuers,socket);
    }
 else {
      if (Util.getInstance().isACC()) {
        ClientSecurityContext ctx=ClientSecurityContext.getCurrent();
        Subject s=ctx.getSubject();
        if (s == null) {
          doClientLogin(SecurityConstants.CERTIFICATE,Util.getInstance().getCallbackHandler());
          s=ctx.getSubject();
        }
        Iterator itr=s.getPrivateCredentials().iterator();
        while (itr.hasNext()) {
          Object o=itr.next();
          if (o instanceof X509CertificateCredential) {
            X509CertificateCredential crt=(X509CertificateCredential)o;
            clientAlias=crt.getAlias();
            break;
          }
        }
      }
    }
  }
 else {
    clientAlias=this.alias;
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str",clientAlias);
  }
  return clientAlias;
}
Program: 29159
Project: 29159
Buggy source:
public static void checkPermission(String key){
  try {
    if (Util.isEmbeddedServer() || Util.getDefaultHabitat() == null || Util.getInstance().isACC() || Util.getInstance().isNotServerORACC()) {
      return;
    }
    Permission perm=new RuntimePermission("String_Node_Str");
    AccessController.checkPermission(perm);
  }
 catch (  AccessControlException e) {
    String message=e.getMessage();
    Permission perm=new PropertyPermission(key,"String_Node_Str");
    if (message != null) {
      message=message.replace(e.getPermission().toString(),perm.toString());
    }
    throw new AccessControlException(message,perm);
  }
}

Fixed version (ground truth):
public static void checkPermission(String key){
  try {
    if (Util.isEmbeddedServer() || Util.getDefaultHabitat() == null || Util.getInstance().isACC() || Util.getInstance().isNotServerOrACC()) {
      return;
    }
    Permission perm=new RuntimePermission("String_Node_Str");
    AccessController.checkPermission(perm);
  }
 catch (  AccessControlException e) {
    String message=e.getMessage();
    Permission perm=new PropertyPermission(key,"String_Node_Str");
    if (message != null) {
      message=message.replace(e.getPermission().toString(),perm.toString());
    }
    throw new AccessControlException(message,perm);
  }
}
Program: 29160
Project: 29160
Buggy source:
/** 
 * Notification that a new config beans has entered the configuration tree.
 * @param bean the new config bean
 */
public void onEntered(Provider<ConfigBean> bean);

Fixed version (ground truth):
/** 
 * Notification that a new config beans has entered the configuration tree.
 * @param bean the new config bean
 */
public void onEntered(ActiveDescriptor<ConfigBean> bean);
Program: 29161
Project: 29161
Buggy source:
public void setParentAndTagName(Dom parent,String tagName){
  this.parent=parent;
  this.tagName=tagName;
  if (parent != null) {
    entity=parent.leafElements(tagName);
    if (parent.type().equals(JavaConfig.class)) {
      target=parent.parent().attribute("String_Node_Str");
    }
 else {
      target=parent.parent().parent().attribute("String_Node_Str");
      profiler="String_Node_Str";
    }
  }
}

Fixed version (ground truth):
public void setParentAndTagName(Dom parent,String tagName){
  this.parent=parent;
  this.tagName=tagName;
  if (parent != null) {
    entity=parent.leafElements(tagName);
    if (parent.getImplementationClass().equals(JavaConfig.class)) {
      target=parent.parent().attribute("String_Node_Str");
    }
 else {
      target=parent.parent().parent().attribute("String_Node_Str");
      profiler="String_Node_Str";
    }
  }
}
Program: 29162
Project: 29162
Buggy source:
@Override 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 ActiveDescriptor<ConfigBean> provider){
  final ConfigBean cb=asConfigBean(provider);
  if (cb != null) {
    add(cb);
  }
}
Program: 29163
Project: 29163
Buggy source:
public TaggedComponent createSSLTaggedComponent(IORInfo iorInfo,Object sInfos){
  List<com.sun.corba.ee.spi.folb.SocketInfo> socketInfos=(List<com.sun.corba.ee.spi.folb.SocketInfo>)sInfos;
  orbHelper=Lookups.getGlassFishORBHelper();
  TaggedComponent result=null;
  org.omg.CORBA.ORB orb=orbHelper.getORB();
  int sslMutualAuthPort=-1;
  try {
    sslMutualAuthPort=((com.sun.corba.ee.spi.legacy.interceptor.IORInfoExt)iorInfo).getServerPort("String_Node_Str");
  }
 catch (  com.sun.corba.ee.spi.legacy.interceptor.UnknownType ute) {
    _logger.log(Level.FINE,"String_Node_Str",ute);
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + sslMutualAuthPort);
  }
  CSIV2TaggedComponentInfo ctc=new CSIV2TaggedComponentInfo(orb,sslMutualAuthPort);
  EjbDescriptor desc=ctc.getEjbDescriptor(iorInfo);
  if (desc != null) {
    result=ctc.createSecurityTaggedComponent(socketInfos,desc);
  }
  return result;
}

Fixed version (ground truth):
public TaggedComponent createSSLTaggedComponent(IORInfo iorInfo,Object sInfos){
  List<com.sun.corba.ee.spi.folb.SocketInfo> socketInfos=(List<com.sun.corba.ee.spi.folb.SocketInfo>)sInfos;
  orbHelper=Lookups.getGlassFishORBHelper();
  TaggedComponent result=null;
  org.omg.CORBA.ORB orb=orbHelper.getORB();
  int sslMutualAuthPort=-1;
  try {
    if (iorInfo instanceof com.sun.corba.ee.spi.legacy.interceptor.IORInfoExt) {
      sslMutualAuthPort=((com.sun.corba.ee.spi.legacy.interceptor.IORInfoExt)iorInfo).getServerPort("String_Node_Str");
    }
  }
 catch (  com.sun.corba.ee.spi.legacy.interceptor.UnknownType ute) {
    _logger.log(Level.FINE,"String_Node_Str",ute);
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + sslMutualAuthPort);
  }
  CSIV2TaggedComponentInfo ctc=new CSIV2TaggedComponentInfo(orb,sslMutualAuthPort);
  EjbDescriptor desc=ctc.getEjbDescriptor(iorInfo);
  if (desc != null) {
    result=ctc.createSecurityTaggedComponent(socketInfos,desc);
  }
  return result;
}
Program: 29164
Project: 29164
Buggy source:
public void receive_reply(ClientRequestInfo ri){
  ServiceContext sc=null;
  int status=-1;
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + prname + "String_Node_Str");
  }
  ORB orb=orbHelper.getORB();
  try {
    sc=ri.get_reply_service_context(SECURITY_ATTRIBUTE_SERVICE_ID);
    if (sc == null) {
      handle_null_service_context(ri);
      return;
    }
  }
 catch (  org.omg.CORBA.BAD_PARAM e) {
    handle_null_service_context(ri);
    return;
  }
catch (  Exception ex) {
    _logger.log(Level.SEVERE,"String_Node_Str",ex);
    return;
  }
  Any a=orb.create_any();
  try {
    a=codec.decode_value(sc.context_data,SASContextBodyHelper.type());
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  SASContextBody sasctxbody=SASContextBodyHelper.extract(a);
  short sasdiscr=sasctxbody.discriminator();
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + SvcContextUtils.getMsgname(sasdiscr) + "String_Node_Str");
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str");
  }
  if ((sasdiscr != MTCompleteEstablishContext.value) && (sasdiscr != MTContextError.value)) {
    _logger.log(Level.SEVERE,"String_Node_Str");
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  int st=mapreplyStatus(ri.reply_status());
  setreplyStatus(st,ri.effective_target());
}

Fixed version (ground truth):
public void receive_reply(ClientRequestInfo ri){
  ServiceContext sc=null;
  int status=-1;
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + prname + "String_Node_Str");
  }
  ORB orb=orbHelper.getORB();
  try {
    sc=ri.get_reply_service_context(SECURITY_ATTRIBUTE_SERVICE_ID);
    if (sc == null) {
      handle_null_service_context(ri);
      return;
    }
  }
 catch (  org.omg.CORBA.BAD_PARAM e) {
    handle_null_service_context(ri);
    return;
  }
catch (  Exception ex) {
    _logger.log(Level.SEVERE,"String_Node_Str",ex);
    return;
  }
  Any a;
  try {
    a=codec.decode_value(sc.context_data,SASContextBodyHelper.type());
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  SASContextBody sasctxbody=SASContextBodyHelper.extract(a);
  short sasdiscr=sasctxbody.discriminator();
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + SvcContextUtils.getMsgname(sasdiscr) + "String_Node_Str");
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str");
  }
  if ((sasdiscr != MTCompleteEstablishContext.value) && (sasdiscr != MTContextError.value)) {
    _logger.log(Level.SEVERE,"String_Node_Str");
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  int st=mapreplyStatus(ri.reply_status());
  setreplyStatus(st,ri.effective_target());
}
Program: 29165
Project: 29165
Buggy source:
public void receive_request_service_contexts(ServerRequestInfo ri) throws ForwardRequest {
  Counter cntr=(Counter)counterForCalls.get();
  if (cntr == null) {
    cntr=new Counter();
    counterForCalls.set(cntr);
  }
  if (cntr.count == 0) {
    SecurityContextUtil.unsetSecurityContext(isLocal());
  }
  cntr.increment();
  Socket s=null;
  Connection c=((RequestInfoExt)ri).connection();
  ServerConnectionContext scc=null;
  if (c != null) {
    s=c.getSocket();
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + c);
      _logger.log(Level.FINE,"String_Node_Str" + s);
    }
    scc=new ServerConnectionContext(s);
  }
 else {
    scc=new ServerConnectionContext();
  }
  setServerConnectionContext(scc);
}

Fixed version (ground truth):
public void receive_request_service_contexts(ServerRequestInfo ri) throws ForwardRequest {
  Counter cntr=(Counter)counterForCalls.get();
  if (cntr == null) {
    cntr=new Counter();
    counterForCalls.set(cntr);
  }
  if (cntr.count == 0) {
    SecurityContextUtil.unsetSecurityContext(isLocal());
  }
  cntr.increment();
  Socket s=null;
  Connection c=null;
  if (ri instanceof RequestInfoExt) {
    c=((RequestInfoExt)ri).connection();
  }
  ServerConnectionContext scc=null;
  if (c != null) {
    s=c.getSocket();
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + c);
      _logger.log(Level.FINE,"String_Node_Str" + s);
    }
    scc=new ServerConnectionContext(s);
  }
 else {
    scc=new ServerConnectionContext();
  }
  setServerConnectionContext(scc);
}
Program: 29168
Project: 29168
Buggy source:
private String getInjectionMethodPropertyName(Method method){
  String methodName=method.getName();
  String propertyName=methodName;
  if ((methodName.length() > 3) && methodName.startsWith("String_Node_Str")) {
    propertyName=methodName.substring(3,4).toLowerCase() + methodName.substring(4);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + method.getName());
  }
  return propertyName;
}

Fixed version (ground truth):
private String getInjectionMethodPropertyName(Method method){
  String methodName=method.getName();
  String propertyName;
  if ((methodName.length() > 3) && methodName.startsWith("String_Node_Str")) {
    propertyName=methodName.substring(3,4).toLowerCase(Locale.ENGLISH) + methodName.substring(4);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + method.getName());
  }
  return propertyName;
}
Program: 29169
Project: 29169
Buggy source:
@Override public URL getResource(String name){
  ClassLoader cl=getClassLoader();
  if (cl != null) {
    return cl.getResource(name);
  }
 else {
    return getClass().getResource(name);
  }
}

Fixed version (ground truth):
@Override public URL getResource(String name){
  ClassLoader cl=getClassLoader();
  if (cl != null) {
    return cl.getResource(name);
  }
 else {
    return this.getClass().getResource(name);
  }
}
Program: 29171
Project: 29171
Buggy source:
protected GFAuthConfig(AuthConfigProvider provider,String layer,String appContext,CallbackHandler handler,String type){
  this.provider=provider;
  this.layer=layer;
  this.appContext=appContext;
  this.type=type;
  if (handler == null) {
    handler=AuthMessagePolicy.getDefaultCallbackHandler();
    this.newHandler=true;
  }
  this.handler=handler;
}

Fixed version (ground truth):
protected GFAuthConfig(AuthConfigProvider provider,String layer,String appContext,CallbackHandler handler,String type){
  this.provider=provider;
  this.layer=layer;
  this.appContext=appContext;
  this.type=type;
  if (handler == null) {
    handler=AuthMessagePolicy.getDefaultCallbackHandler();
  }
  this.handler=handler;
}
Program: 29172
Project: 29172
Buggy source:
@Test public void testRegistrationWithNonStringPropertyAndPreviousRegistration(){
  logger.info("String_Node_Str");
  Security.setProperty(DEFAULT_FACTORY_SECURITY_PROPERTY,testFactoryClassName);
  String className=_AuthConfigProvider.class.getName();
  HashMap properties=null;
  String layer="String_Node_Str";
  String appContext="String_Node_Str";
  String description=null;
  String regId=null;
  regId=AuthConfigFactory.getFactory().registerConfigProvider(className,properties,layer,appContext,description);
  assertNotNull("String_Node_Str",regId);
  AuthConfigProvider previousAcp=null;
  previousAcp=AuthConfigFactory.getFactory().getConfigProvider(layer,appContext,null);
  assertNotNull("String_Node_Str",previousAcp);
  properties=new HashMap();
  ArrayList list=new ArrayList();
  list.add("String_Node_Str");
  properties.put("String_Node_Str",list);
  layer="String_Node_Str";
  appContext="String_Node_Str";
  description=null;
  regId=null;
  try {
    regId=AuthConfigFactory.getFactory().registerConfigProvider(className,properties,layer,appContext,description);
  }
 catch (  IllegalArgumentException iae) {
    assertNull("String_Node_Str",regId);
  }
  AuthConfigProvider acp=null;
  acp=AuthConfigFactory.getFactory().getConfigProvider(layer,appContext,null);
  assertTrue("String_Node_Str",previousAcp == acp);
}

Fixed version (ground truth):
@Test public void testRegistrationWithNonStringPropertyAndPreviousRegistration(){
  logger.info("String_Node_Str");
  Security.setProperty(DEFAULT_FACTORY_SECURITY_PROPERTY,testFactoryClassName);
  String className=_AuthConfigProvider.class.getName();
  HashMap properties=null;
  String layer="String_Node_Str";
  String appContext="String_Node_Str";
  String description=null;
  String regId=null;
  regId=AuthConfigFactory.getFactory().registerConfigProvider(className,properties,layer,appContext,description);
  assertNotNull("String_Node_Str",regId);
  AuthConfigProvider previousAcp=null;
  previousAcp=AuthConfigFactory.getFactory().getConfigProvider(layer,appContext,null);
  assertNotNull("String_Node_Str",previousAcp);
  String previousRegId=regId;
  properties=new HashMap();
  ArrayList list=new ArrayList();
  list.add("String_Node_Str");
  properties.put("String_Node_Str",list);
  layer="String_Node_Str";
  appContext="String_Node_Str";
  description=null;
  regId=null;
  try {
    regId=AuthConfigFactory.getFactory().registerConfigProvider(className,properties,layer,appContext,description);
  }
 catch (  IllegalArgumentException iae) {
    assertNull("String_Node_Str",regId);
  }
  AuthConfigProvider acp=null;
  acp=AuthConfigFactory.getFactory().getConfigProvider(layer,appContext,null);
  assertTrue("String_Node_Str",previousAcp == acp);
  assertTrue("String_Node_Str",AuthConfigFactory.getFactory().removeRegistration(previousRegId));
}
Program: 29174
Project: 29174
Buggy source:
private void handle_null_service_context(ServerRequestInfo ri,ServiceContext sc,ORB orb){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + ri.operation());
  }
  int secStatus=secContextUtil.setSecurityContext(null,ri.object_id(),ri.operation(),getServerSocket());
  if (secStatus == SecurityContextUtil.STATUS_FAILED) {
    SASContextBody sasctxbody=createContextError(INVALID_MECHANISM_MAJOR,INVALID_MECHANISM_MINOR);
    sc=createSvcContext(sasctxbody,orb);
    ri.add_reply_service_context(sc,NO_REPLACE);
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
    throw new NO_PERMISSION();
  }
}

Fixed version (ground truth):
private void handle_null_service_context(ServerRequestInfo ri,ORB orb){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + ri.operation());
  }
  ServiceContext sc=null;
  int secStatus=secContextUtil.setSecurityContext(null,ri.object_id(),ri.operation(),getServerSocket());
  if (secStatus == SecurityContextUtil.STATUS_FAILED) {
    SASContextBody sasctxbody=createContextError(INVALID_MECHANISM_MAJOR,INVALID_MECHANISM_MINOR);
    sc=createSvcContext(sasctxbody,orb);
    ri.add_reply_service_context(sc,NO_REPLACE);
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
    throw new NO_PERMISSION();
  }
}
Program: 29175
Project: 29175
Buggy source:
public ServerRequestInterceptor createServerRequestInterceptor(ORBInitInfo info,Codec codec){
  ServerRequestInterceptor ret=null;
  try {
    if (!penv.getProcessType().isServer()) {
      return null;
    }
    if (altSecFactory != null || (interceptorFactory != null && createAlternateSecurityInterceptorFactory())) {
      ret=altSecFactory.getServerRequestInterceptor(codec);
    }
 else {
      ret=getServerInterceptorInstance(codec);
    }
    com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt infoExt=(com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt)info;
    IORInterceptor secIOR=getSecIORInterceptorInstance(codec,infoExt.getORB());
    info.add_ior_interceptor(secIOR);
  }
 catch (  DuplicateName ex) {
    _logger.log(Level.SEVERE,null,ex);
    throw new RuntimeException(ex);
  }
  return ret;
}

Fixed version (ground truth):
public ServerRequestInterceptor createServerRequestInterceptor(ORBInitInfo info,Codec codec){
  ServerRequestInterceptor ret=null;
  try {
    if (!penv.getProcessType().isServer()) {
      return null;
    }
    if (altSecFactory != null || (interceptorFactory != null && createAlternateSecurityInterceptorFactory())) {
      ret=altSecFactory.getServerRequestInterceptor(codec);
    }
 else {
      ret=getServerInterceptorInstance(codec);
    }
    if (info instanceof com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt) {
      com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt infoExt=(com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt)info;
      IORInterceptor secIOR=getSecIORInterceptorInstance(codec,infoExt.getORB());
      info.add_ior_interceptor(secIOR);
    }
  }
 catch (  DuplicateName ex) {
    _logger.log(Level.SEVERE,null,ex);
    throw new RuntimeException(ex);
  }
  return ret;
}
Program: 29176
Project: 29176
Buggy source:
/** 
 * Creates the file and initialized MeteredStream and passes it on to Superclass (java.util.logging.StreamHandler).
 */
private void openFile(File file) throws IOException {
  File parent=file.getParentFile();
  if (!parent.exists() && parent.mkdirs()) {
    throw new IOException(LOCAL_STRINGS.getLocalString("String_Node_Str","String_Node_Str",parent.getAbsolutePath()));
  }
  FileOutputStream fout=new FileOutputStream(file,true);
  BufferedOutputStream bout=new BufferedOutputStream(fout);
  meter=new MeteredStream(bout,file.length());
  setOutputStream(meter);
}

Fixed version (ground truth):
/** 
 * Creates the file and initialized MeteredStream and passes it on to Superclass (java.util.logging.StreamHandler).
 */
private void openFile(File file) throws IOException {
  File parent=file.getParentFile();
  if (!parent.exists() && !parent.mkdirs()) {
    throw new IOException(LOCAL_STRINGS.getLocalString("String_Node_Str","String_Node_Str",parent.getAbsolutePath()));
  }
  FileOutputStream fout=new FileOutputStream(file,true);
  BufferedOutputStream bout=new BufferedOutputStream(fout);
  meter=new MeteredStream(bout,file.length());
  setOutputStream(meter);
}
Program: 29177
Project: 29177
Buggy source:
/** 
 * Disassociate the listener from all the provider registrations whose layer and appContext values are matched by the corresponding arguments to this method.
 * @param listener the RegistrationListener to be detached.
 * @param layer a String identifying the message layer or null.
 * @param appContext a String value identifying the application contextor null.
 * @return an array of String values where each value identifies aprovider registration from which the listener was removed. This method never returns null; it returns an empty array if the listener was not removed from any registrations.
 * @exception SecurityException if the caller does not havepermission to detach the listener from the factory.
 */
@Override public String[] detachListener(RegistrationListener listener,String layer,String appContext){
  ArrayList<String> list=new ArrayList<String>();
  String regisID=getRegistrationID(layer,appContext);
  wLock.lock();
  try {
    Set<String> targets=id2RegisListenersMap.keySet();
    for (    String targetID : targets) {
      if (regIdImplies(regisID,targetID)) {
        List<RegistrationListener> listeners=id2RegisListenersMap.get(targetID);
        if (listeners != null && listeners.remove(listener)) {
          list.add(targetID);
        }
      }
    }
  }
  finally {
    wLock.unlock();
  }
  return list.toArray(new String[0]);
}

Fixed version (ground truth):
/** 
 * Disassociate the listener from all the provider registrations whose layer and appContext values are matched by the corresponding arguments to this method.
 * @param listener the RegistrationListener to be detached.
 * @param layer a String identifying the message layer or null.
 * @param appContext a String value identifying the application contextor null.
 * @return an array of String values where each value identifies aprovider registration from which the listener was removed. This method never returns null; it returns an empty array if the listener was not removed from any registrations.
 * @exception SecurityException if the caller does not havepermission to detach the listener from the factory.
 */
@Override public String[] detachListener(RegistrationListener listener,String layer,String appContext){
  ArrayList<String> list=new ArrayList<String>();
  String regisID=getRegistrationID(layer,appContext);
  wLock.lock();
  try {
    Set<String> targets=id2RegisListenersMap.keySet();
    for (    String targetID : targets) {
      if (regIdImplies(regisID,targetID)) {
        List<RegistrationListener> listeners=id2RegisListenersMap.get(targetID);
        if (listeners != null && listeners.remove(listener)) {
          list.add(targetID);
        }
      }
    }
  }
  finally {
    wLock.unlock();
  }
  return list.toArray(new String[list.size()]);
}
Program: 29178
Project: 29178
Buggy source:
protected void _loadFactory(){
  try {
    id2ProviderMap=new HashMap<String,AuthConfigProvider>();
    id2RegisContextMap=new HashMap<String,RegistrationContext>();
    id2RegisListenersMap=new HashMap<String,List<RegistrationListener>>();
    provider2IdsMap=new HashMap<AuthConfigProvider,List<String>>();
    List<EntryInfo> entryList=getRegStore().getPersistedEntries();
    for (    EntryInfo info : entryList) {
      if (info.isConstructorEntry()) {
        _constructProvider(info.getClassName(),info.getProperties(),this);
      }
 else {
        boolean first=true;
        AuthConfigProvider p=null;
        List<RegistrationContext> contexts=(info.getRegContexts());
        for (        RegistrationContext ctx : contexts) {
          if (first) {
            p=_constructProvider(info.getClassName(),info.getProperties(),null);
          }
          _loadRegistration(p,ctx.getMessageLayer(),ctx.getAppContext(),ctx.getDescription());
        }
      }
    }
  }
 catch (  Exception e) {
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
protected void _loadFactory(){
  try {
    initializeMaps();
    List<EntryInfo> entryList=getRegStore().getPersistedEntries();
    for (    EntryInfo info : entryList) {
      if (info.isConstructorEntry()) {
        _constructProvider(info.getClassName(),info.getProperties(),this);
      }
 else {
        boolean first=true;
        AuthConfigProvider p=null;
        List<RegistrationContext> contexts=(info.getRegContexts());
        for (        RegistrationContext ctx : contexts) {
          if (first) {
            p=_constructProvider(info.getClassName(),info.getProperties(),null);
          }
          _loadRegistration(p,ctx.getMessageLayer(),ctx.getAppContext(),ctx.getDescription());
        }
      }
    }
  }
 catch (  Exception e) {
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
}
Program: 29179
Project: 29179
Buggy source:
private static void notifyListeners(Map<String,List<RegistrationListener>> map){
  Set<String> regisIDSet=map.keySet();
  for (  String regisID : regisIDSet) {
    List<RegistrationListener> listeners=map.get(regisID);
    if (listeners != null && listeners.size() > 0) {
      String[] dIds=decomposeRegisID(regisID);
      for (      RegistrationListener listener : listeners) {
        listener.notify(dIds[0],dIds[1]);
      }
    }
  }
}

Fixed version (ground truth):
private static void notifyListeners(Map<String,List<RegistrationListener>> map){
  Set<Map.Entry<String,List<RegistrationListener>>> entrySet=map.entrySet();
  for (  Map.Entry<String,List<RegistrationListener>> entry : entrySet) {
    List<RegistrationListener> listeners=map.get(entry.getKey());
    if (listeners != null && listeners.size() > 0) {
      String[] dIds=decomposeRegisID(entry.getKey());
      for (      RegistrationListener listener : listeners) {
        listener.notify(dIds[0],dIds[1]);
      }
    }
  }
}
Program: 29180
Project: 29180
Buggy source:
private RegistrationContext getRegistrationContext(String id){
  final String layer=getLayer();
  final String appContext;
  if (id.toLowerCase().equals(DEFAULT_JAAS_APP_NAME)) {
    appContext=ALL_APPS;
  }
 else {
    appContext=id;
  }
  return new RegistrationContext(){
    final String description="String_Node_Str" + appContext;
    public String getMessageLayer(){
      return layer;
    }
    public String getAppContext(){
      return appContext;
    }
    public String getDescription(){
      return description;
    }
    public boolean isPersistent(){
      return false;
    }
  }
;
}

Fixed version (ground truth):
private RegistrationContext getRegistrationContext(String id){
  final String layer=getLayer();
  final String appContext;
  if (id.toLowerCase(Locale.getDefault()).equals(DEFAULT_JAAS_APP_NAME)) {
    appContext=ALL_APPS;
  }
 else {
    appContext=id;
  }
  return new RegistrationContext(){
    final String description="String_Node_Str" + appContext;
    public String getMessageLayer(){
      return layer;
    }
    public String getAppContext(){
      return appContext;
    }
    public String getDescription(){
      return description;
    }
    public boolean isPersistent(){
      return false;
    }
  }
;
}
Program: 29181
Project: 29181
Buggy source:
public final void preDeregister() throws Exception {
  mServer.removeNotificationListener(mObjectName,this);
}

Fixed version (ground truth):
@Override public final void preDeregister() throws Exception {
  if (mServer != null) {
    mServer.removeNotificationListener(mObjectName,this);
  }
}
Program: 29182
Project: 29182
Buggy source:
public final void postDeregister(){
}

Fixed version (ground truth):
@Override public final void postDeregister(){
}
Program: 29183
Project: 29183
Buggy source:
public void setEmitMBeanStatus(final boolean emit){
  mEmitMBeanStatus=emit;
}

Fixed version (ground truth):
@Override public void setEmitMBeanStatus(final boolean emit){
  mEmitMBeanStatus=emit;
}
Program: 29184
Project: 29184
Buggy source:
public synchronized Set<ObjectName> getChildrenOf(final ObjectName parent){
  final Set<ObjectName> children=mParentChildren.get(parent);
  if (children == null) {
    return Collections.emptySet();
  }
  return new HashSet<ObjectName>(children);
}

Fixed version (ground truth):
@Override public synchronized Set<ObjectName> getChildrenOf(final ObjectName parent){
  final Set<ObjectName> children=mParentChildren.get(parent);
  if (children == null) {
    return Collections.emptySet();
  }
  return new HashSet<ObjectName>(children);
}
Program: 29185
Project: 29185
Buggy source:
/** 
 * Must be 'synchronized' because we're working on two different Maps.
 */
private synchronized ObjectName removeChild(final ObjectName child){
  final ObjectName parent=mChildParent.remove(child);
  if (parent != null) {
    final Set<ObjectName> children=mParentChildren.get(parent);
    if (children != null) {
      children.remove(child);
      if (children.size() == 0) {
        mParentChildren.remove(parent);
      }
    }
  }
  return parent;
}

Fixed version (ground truth):
/** 
 * Must be 'synchronized' because we're working on two different Maps.
 */
private synchronized ObjectName removeChild(final ObjectName child){
  final ObjectName parent=mChildParent.remove(child);
  if (parent != null) {
    final Set<ObjectName> children=mParentChildren.get(parent);
    if (children != null) {
      children.remove(child);
      if (children.isEmpty()) {
        mParentChildren.remove(parent);
      }
    }
  }
  return parent;
}
Program: 29186
Project: 29186
Buggy source:
public boolean getEmitMBeanStatus(){
  return mEmitMBeanStatus;
}

Fixed version (ground truth):
@Override public boolean getEmitMBeanStatus(){
  return mEmitMBeanStatus;
}
Program: 29187
Project: 29187
Buggy source:
public ObjectName getParentOf(final ObjectName child){
  return mChildParent.get(child);
}

Fixed version (ground truth):
@Override public ObjectName getParentOf(final ObjectName child){
  return mChildParent.get(child);
}
Program: 29188
Project: 29188
Buggy source:
public final void postRegister(final Boolean registrationSucceeded){
  if (registrationSucceeded.booleanValue()) {
    try {
      mServer.addNotificationListener(JMXUtil.getMBeanServerDelegateObjectName(),this,null,null);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
  final ObjectName pattern=Util.newObjectNamePattern(mDomain,"String_Node_Str");
  final Set<ObjectName> names=JMXUtil.queryNames(mServer,pattern,null);
  for (  final ObjectName o : names) {
    addChild(o);
  }
}

Fixed version (ground truth):
@Override public final void postRegister(final Boolean registrationSucceeded){
  if (mServer == null) {
    return;
  }
  if (registrationSucceeded.booleanValue()) {
    try {
      mServer.addNotificationListener(JMXUtil.getMBeanServerDelegateObjectName(),this,null,null);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
  final ObjectName pattern=Util.newObjectNamePattern(mDomain,"String_Node_Str");
  final Set<ObjectName> names=JMXUtil.queryNames(mServer,pattern,null);
  for (  final ObjectName o : names) {
    addChild(o);
  }
}
Program: 29189
Project: 29189
Buggy source:
private void addChild(final ObjectName child){
  ObjectName parent=null;
  try {
    parent=(ObjectName)mServer.getAttribute(child,AMX.ATTR_PARENT);
  }
 catch (  final Exception e) {
  }
  if (parent != null) {
synchronized (this) {
      mChildParent.put(child,parent);
      Set<ObjectName> children=mParentChildren.get(parent);
      if (children == null) {
        children=new HashSet<ObjectName>();
        mParentChildren.put(parent,children);
      }
      children.add(child);
    }
  }
}

Fixed version (ground truth):
private void addChild(final ObjectName child){
  if (mServer == null) {
    return;
  }
  ObjectName parent=null;
  try {
    parent=(ObjectName)mServer.getAttribute(child,AMX.ATTR_PARENT);
  }
 catch (  final Exception e) {
  }
  if (parent != null) {
synchronized (this) {
      mChildParent.put(child,parent);
      Set<ObjectName> children=mParentChildren.get(parent);
      if (children == null) {
        children=new HashSet<ObjectName>();
        mParentChildren.put(parent,children);
      }
      children.add(child);
    }
  }
}
Program: 29190
Project: 29190
Buggy source:
public ObjectName preRegister(final MBeanServer server,final ObjectName nameIn) throws Exception {
  mServer=server;
  mObjectName=nameIn;
  return (nameIn);
}

Fixed version (ground truth):
@Override public ObjectName preRegister(final MBeanServer server,final ObjectName nameIn) throws Exception {
  mServer=server;
  mObjectName=nameIn;
  return (nameIn);
}