Program: 29086
Project: 29086
Buggy source:
/** 
 * Creates a new GlassFish instance and add it to a Map of instances created by this runtime.
 * @param glassFishProperties
 * @return
 * @throws Exception
 */
@Override public synchronized GlassFish newGlassFish(GlassFishProperties glassFishProperties) throws GlassFishException {
  try {
    Properties cloned=new Properties();
    cloned.putAll(glassFishProperties.getProperties());
    final GlassFishProperties gfProps=new GlassFishProperties(cloned);
    setEnv(gfProps);
    final StartupContext startupContext=new StartupContext(gfProps.getProperties());
    ModulesRegistry modulesRegistry=SingleHK2Factory.getInstance().createModulesRegistry();
    Binder postProcessorBinder=new Binder(){
      @Override public void bind(      DynamicConfiguration config){
        config.bind(BuilderHelper.createConstantDescriptor(new EmbeddedInhabitantsParser()));
      }
    }
;
    ServiceLocator serviceLocator=main.createServiceLocator(modulesRegistry,startupContext,postProcessorBinder,null);
    final Habitat habitat=serviceLocator.getService(Habitat.class);
    final ModuleStartup gfKernel=main.findStartupService(modulesRegistry,serviceLocator,null,startupContext);
    GlassFishImpl gfImpl=new GlassFishImpl(gfKernel,habitat,gfProps.getProperties()){
      @Override public void dispose() throws GlassFishException {
        try {
          super.dispose();
        }
  finally {
          gfMap.remove(gfProps.getInstanceRoot());
          if ("String_Node_Str".equalsIgnoreCase(gfProps.getProperties().getProperty(autoDelete)) && gfProps.getInstanceRoot() != null) {
            File instanceRoot=new File(gfProps.getInstanceRoot());
            if (instanceRoot.exists()) {
              Util.deleteRecursive(instanceRoot);
            }
          }
        }
      }
    }
;
    gfMap.put(gfProps.getInstanceRoot(),gfImpl);
    return gfImpl;
  }
 catch (  GlassFishException e) {
    throw e;
  }
catch (  Exception e) {
    throw new GlassFishException(e);
  }
}

Fixed version (ground truth):
/** 
 * Creates a new GlassFish instance and add it to a Map of instances created by this runtime.
 * @param glassFishProperties
 * @return
 * @throws Exception
 */
@Override public synchronized GlassFish newGlassFish(GlassFishProperties glassFishProperties) throws GlassFishException {
  try {
    Properties cloned=new Properties();
    cloned.putAll(glassFishProperties.getProperties());
    final GlassFishProperties gfProps=new GlassFishProperties(cloned);
    setEnv(gfProps);
    final StartupContext startupContext=new StartupContext(gfProps.getProperties());
    ModulesRegistry modulesRegistry=SingleHK2Factory.getInstance().createModulesRegistry();
    Binder postProcessorBinder=new Binder(){
      @Override public void bind(      DynamicConfiguration config){
        config.bind(BuilderHelper.createConstantDescriptor(new EmbeddedInhabitantsParser()));
      }
    }
;
    ServiceLocator serviceLocator=main.createServiceLocator(modulesRegistry,startupContext,postProcessorBinder,null);
    final ModuleStartup gfKernel=main.findStartupService(modulesRegistry,serviceLocator,null,startupContext);
    GlassFishImpl gfImpl=new GlassFishImpl(gfKernel,serviceLocator,gfProps.getProperties()){
      @Override public void dispose() throws GlassFishException {
        try {
          super.dispose();
        }
  finally {
          gfMap.remove(gfProps.getInstanceRoot());
          if ("String_Node_Str".equalsIgnoreCase(gfProps.getProperties().getProperty(autoDelete)) && gfProps.getInstanceRoot() != null) {
            File instanceRoot=new File(gfProps.getInstanceRoot());
            if (instanceRoot.exists()) {
              Util.deleteRecursive(instanceRoot);
            }
          }
        }
      }
    }
;
    gfMap.put(gfProps.getInstanceRoot(),gfImpl);
    return gfImpl;
  }
 catch (  GlassFishException e) {
    throw e;
  }
catch (  Exception e) {
    throw new GlassFishException(e);
  }
}