nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SolrExampleJettyTest extends SolrExampleTests { SolrServer server ; JettySolrRunner jetty ; static final int port = 8984 ; static final String context = "//example" ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } @ Override protected SolrServer getSolrServer ( ) { } @ Override protected SolrServer createNewSolrServer ( ) { try { String url = ( "http:////localhost:" + ( SolrExampleJettyTest . port ) ) + ( SolrExampleJettyTest . context ) ; CommonsHttpSolrServer s = new CommonsHttpSolrServer ( url ) ; <START_BUG> s . setConnectionTimeout ( 5 ) ; <END_BUG> s . setDefaultMaxConnectionsPerHost ( 100 ) ; s . setMaxTotalConnections ( 100 ) ; return s ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } } }

Fix:
s . setConnectionTimeout ( 100 ) ;
Buggy code:
public abstract class RestController { private static final Logger logger = LoggerFactory . getLogger ( RestController . class ) ; protected void logRequest ( Logger logger , HttpServletRequest request ) { } protected < T > Response < T > successResponse ( T responseObject ) { } protected < T > Response < T > failResponse ( T responseObject ) { } @ ExceptionHandler ( EntityNotFoundException . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . NOT_FOUND ) @ ResponseBody public Response < ErrorResponse > handleEntityNotFoundException ( EntityNotFoundException enfe ) { } @ ExceptionHandler ( FreemarkerRenderException . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . INTERNAL_SERVER_ERROR ) @ ResponseBody public Response < ErrorResponse > handleFreemarkerRenderException ( FreemarkerRenderException iae ) { } @ ExceptionHandler ( Exception . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . INTERNAL_SERVER_ERROR ) @ ResponseBody public Response < ErrorResponse > handleIllegalArgumentException ( Exception iae ) { } @ ExceptionHandler ( EscreeningDataValidationException . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . BAD_REQUEST ) @ ResponseBody public Response < ErrorResponse > handleException ( EscreeningDataValidationException ex ) { } @ ExceptionHandler ( AssessmentEngineDataValidationException . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . BAD_REQUEST ) @ ResponseBody public Response < ErrorResponse > handleException ( AssessmentEngineDataValidationException ex ) { } @ ExceptionHandler ( InvalidAssessmentContextException . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . UNAUTHORIZED ) @ ResponseBody public Response < ErrorResponse > handleException ( InvalidAssessmentContextException ex ) { } @ ExceptionHandler ( IllegalSystemStateException . class ) @ org . springframework . web . bind . annotation . ResponseStatus ( HttpStatus . INTERNAL_SERVER_ERROR ) @ ResponseBody public Response < ErrorResponse > handleIllegalSystemStateException ( IllegalSystemStateException isse ) { } private Response < ErrorResponse > errorResponse ( ErrorResponse er ) { RestController . logger . error ( er . getLogMessage ( ) ) ; <START_BUG> return new Response ( er ) ; <END_BUG> } }

Fix:
return Response . createError ( er ) ;
Buggy code:
public final class ClassFinder { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String DOT_JAR = ".jar" ; private static final String DOT_CLASS = ".class" ; private static final int DOT_CLASS_LEN = ClassFinder . DOT_CLASS . length ( ) ; private ClassFinder ( ) { } private static class FilterTreeSet extends TreeSet { private final Class [ ] parents ; private final boolean inner ; private final ClassLoader contextClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; FilterTreeSet ( Class [ ] parents , boolean inner ) { } public boolean add ( Object o ) { } } public static List findClassesThatExtend ( String [ ] paths , Class [ ] superClasses ) throws IOException , ClassNotFoundException { } private static String [ ] addJarsInPath ( String [ ] paths ) { } public static List findClassesThatExtend ( String [ ] strPathsOrJars , final Class [ ] superClasses , final boolean innerClasses ) throws IOException , ClassNotFoundException { } private static List getClasspathMatches ( String [ ] strPathsOrJars ) { } private static String fixPathEntry ( String path ) { if ( path == null ) return null ; if ( path . equals ( "." ) ) { return System . getProperty ( "user.dir" ) ; } path = path . trim ( ) . replace ( '\\' , '//' ) ; <START_BUG> path = JOrphanUtils . replaceAllString ( path , "////" , "//" ) ; <END_BUG> while ( path . endsWith ( "//" ) ) { path = path . substring ( 0 , ( ( path . length ( ) ) - 1 ) ) ; } return path ; } private static boolean isChildOf ( Class [ ] parentClasses , String strClassName , ClassLoader contextClassLoader ) { } private static String fixClassName ( String strClassName ) { } private static void findClassesInOnePath ( String strPath , Set listClasses ) throws IOException { } private static void findClassesInPaths ( List listPaths , Set listClasses ) throws IOException { } private static void findClassesInPathsDir ( String strPathElement , File dir , Set listClasses ) throws IOException { } }

Fix:
path = JOrphanUtils . substitute ( path , "////" , "//" ) ;
Buggy code:
public class ItemCollectionManager { public static boolean isItemCollectionSign ( Sign sign ) { } public static boolean isItemDepositSign ( Sign sign ) { } public static boolean isTrashItemSign ( Sign sign ) { } public static boolean isFurnaceFuelLine ( String line ) { } public static boolean isFurnaceSmeltLine ( String line ) { } public static ArrayList < String > getItemLines ( Sign sign ) { } public static MinecartManiaInventory getMinecartManiaInventory ( Block block ) { } public static ArrayList < ItemContainer > getItemContainers ( Location location , CompassDirection direction , boolean collection ) { } public static ArrayList < ItemContainer > getTrashItemContainers ( Location location , CompassDirection direction ) { } public static ArrayList < ItemContainer > getFurnaceContainers ( Location location , CompassDirection direction ) { } public static ArrayList < ItemContainer > getBrewingStandContainers ( Location location , CompassDirection direction ) { ArrayList < ItemContainer > containers = new ArrayList < ItemContainer > ( ) ; HashSet < Block > blocks = BlockUtils . getAdjacentBlocks ( location , 1 ) ; for ( Block block : blocks ) { <START_BUG> if ( ( ( ItemCollectionManager . getMinecartManiaInventory ( block ) ) != null ) && ( ( ItemCollectionManager . getMinecartManiaInventory ( block ) ) instanceof MinecartManiaFurnace ) ) { <END_BUG> MinecartManiaBrewingStand furnace = ( ( MinecartManiaBrewingStand ) ( ItemCollectionManager . getMinecartManiaInventory ( block ) ) ) ; for ( int line = 0 ; line < 4 ; line ++ ) { String text = ( ( Sign ) ( location . getBlock ( ) . getState ( ) ) ) . getLine ( line ) ; if ( ItemCollectionManager . isBrewingStandTopLine ( text ) ) { containers . add ( new BrewingStandTopContainer ( furnace , text , direction ) ) ; } else if ( ItemCollectionManager . isBrewingStandBottomLine ( text ) ) { containers . add ( new BrewingStandBottomContainer ( furnace , text , direction ) ) ; } } } } return containers ; } private static boolean isBrewingStandTopLine ( String line ) { } private static boolean isBrewingStandBottomLine ( String line ) { } private static void bracketizeSign ( Sign sign ) { } public static void createItemContainers ( MinecartManiaStorageCart minecart , HashSet < ComparableLocation > available ) { } @ SuppressWarnings ( "unchecked" ) public static void updateContainerDirections ( MinecartManiaStorageCart minecart ) { } @ SuppressWarnings ( "unchecked" ) public static void processItemContainer ( MinecartManiaStorageCart minecart ) { } }

Fix:
if ( ( ( ItemCollectionManager . getMinecartManiaInventory ( block ) ) != null ) && ( ( ItemCollectionManager . getMinecartManiaInventory ( block ) ) instanceof MinecartManiaBrewingStand ) ) {
Buggy code:
public class IntLiteral extends NumberLiteral { public int value ; public static final IntLiteral One = new IntLiteral ( new char [ ] { '1' } , 0 , 0 , 1 ) ; static final Constant FORMAT_ERROR = new DoubleConstant ( ( 1.0 // 0.0 ) ) ; public IntLiteral ( char [ ] token , int s , int e ) { } public IntLiteral ( char [ ] token , int s , int e , int value ) { } public IntLiteral ( int intValue ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { } public final boolean mayRepresentMIN_VALUE ( ) { } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding tb = super . resolveType ( scope ) ; if ( ( constant ) == ( IntLiteral . FORMAT_ERROR ) ) { <START_BUG> constant = NotAConstant ; <END_BUG> scope . problemReporter ( ) . constantOutOfFormat ( this ) ; this . resolvedType = null ; return null ; } return tb ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
constant = Constant . NotAConstant ;
Buggy code:
@ Controller public class FindOwnersForm { private final Clinic clinic ; @ Autowired public FindOwnersForm ( Clinic clinic ) { } @ InitBinder public void setAllowedFields ( WebDataBinder dataBinder ) { <START_BUG> dataBinder . setDisallowedFields ( "id" ) ; <END_BUG> } @ RequestMapping ( value = "//owners//search" , method = RequestMethod . GET ) public String setupForm ( Model model ) { } @ RequestMapping ( value = "//owners" , method = RequestMethod . GET ) public String processSubmit ( Owner owner , BindingResult result , Model model ) { } }

Fix:
dataBinder . setDisallowedFields ( new String [ ] { "id" } ) ;
Buggy code:
public class FileHierarchyParser extends Parser { private static final byte [ ] DEEPFS = token ( "deepfs" ) ; private static final byte [ ] FSML = token ( "fsml" ) ; private static final byte [ ] BACKING = token ( "backing_store" ) ; private static final byte [ ] DIR = token ( "dir" ) ; private static final byte [ ] FILE = token ( "file" ) ; private static final byte [ ] NAME = token ( "name" ) ; private static final byte [ ] SUFFIX = token ( "suffix" ) ; public static final byte [ ] ST_SIZE = token ( "st_size" ) ; private static final byte [ ] ST_MTIME = token ( "st_mtime" ) ; private static final byte [ ] ST_ATIME = token ( "st_atime" ) ; private static final byte [ ] ST_CTIME = token ( "st_ctime" ) ; private static final byte [ ] ST_NLINK = token ( "st_nlink" ) ; private static final byte [ ] ST_UID = token ( "st_uid" ) ; private static final byte [ ] ST_GID = token ( "st_gid" ) ; private static final byte [ ] ST_MODE = token ( "st_mode" ) ; private static final byte [ ] BSID = token ( "bsid" ) ; private static final byte [ ] PDF = token ( "pdf" ) ; private static TokenList MUSIC = new TokenList ( ) ; private static TokenList MAILS = new TokenList ( ) ; private static TokenList IMGS = new TokenList ( ) ; private Builder builder ; private IOFile backingStore ; private String dbname ; public FileHierarchyParser ( final String db , final String path ) throws IOException { } @ Override public void parse ( Builder b ) throws IOException { } private boolean createBackingStore ( ) { } private void parseDirectory ( IO io ) throws IOException { } private void parseFile ( IO f ) throws IOException { } private byte [ ] attsFile ( IO f ) { } private Atts attsDir ( IO dir ) { } private void attsStat ( IO f ) { } private Parser getFileParser ( byte [ ] suffix , IO f ) { } private void copyIntoBackingStore ( final IO file , final byte [ ] name ) { File target = new File ( backingStore . merge ( Token . string ( name ) ) . path ( ) ) ; <START_BUG> System . out . format ( "Writing<seq2seq4repair_space>pdf<seq2seq4repair_space>binary<seq2seq4repair_space>into<seq2seq4repair_space>backing<seq2seq4repair_space>store:<seq2seq4repair_space>%s\n" , new String ( name ) ) ; <END_BUG> Utils . copyFile ( new File ( file . path ( ) ) , target ) ; } private void FillLists ( ) { } }

Fix:
System . out . format ( "Writing<seq2seq4repair_space>data<seq2seq4repair_space>into<seq2seq4repair_space>backing<seq2seq4repair_space>store:<seq2seq4repair_space>%s\n" , new String ( name ) ) ;
Buggy code:
final class HandlerRemove extends AbstractRemoveStepHandler { static final HandlerRemove INSTANCE = new HandlerRemove ( ) ; private HandlerRemove ( ) { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { final ServerConfig config = PackageUtils . getServerConfig ( context ) ; if ( config != null ) { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final PathElement confElem = address . getElement ( ( ( address . size ( ) ) - 3 ) ) ; final String configType = confElem . getKey ( ) ; final String configName = confElem . getValue ( ) ; final String handlerChainType = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getKey ( ) ; final String handlerChainId = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; final String handlerName = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getValue ( ) ; for ( final CommonConfig commonConfig : PackageUtils . getConfigs ( config , configType ) ) { if ( configName . equals ( commonConfig . getConfigName ( ) ) ) { final List < UnifiedHandlerChainMetaData > handlerChains ; if ( Constants . PRE_HANDLER_CHAIN . equals ( handlerChainType ) ) { handlerChains = commonConfig . getPreHandlerChains ( ) ; } else if ( Constants . POST_HANDLER_CHAIN . equals ( handlerChainType ) ) { handlerChains = commonConfig . getPostHandlerChains ( ) ; } else { throw WSMessages . MESSAGES . wrongHandlerChainType ( handlerChainType , Constants . PRE_HANDLER_CHAIN , Constants . POST_HANDLER_CHAIN ) ; } final UnifiedHandlerChainMetaData handlerChain = HandlerRemove . getChain ( handlerChains , handlerChainId ) ; if ( handlerChain == null ) { throw WSMessages . MESSAGES . missingHandlerChain ( configName , handlerChainType , handlerChainId ) ; } final UnifiedHandlerMetaData handler = HandlerRemove . getHandler ( handlerChain , handlerName ) ; if ( handler == null ) { throw WSMessages . MESSAGES . missingHandler ( configName , handlerChainType , handlerChainId , handlerName ) ; } handlerChain . getHandlers ( ) . remove ( handler ) ; <START_BUG> context . restartRequired ( ) ; <END_BUG> return ; } } throw WSMessages . MESSAGES . missingConfig ( configName ) ; } } private static UnifiedHandlerChainMetaData getChain ( final List < UnifiedHandlerChainMetaData > handlerChains , final String handlerChainId ) { } private static UnifiedHandlerMetaData getHandler ( final UnifiedHandlerChainMetaData handlerChain , final String handlerName ) { } }

Fix:
context . reloadRequired ( ) ;
Buggy code:
public final class ResourceToList { final List < String > _result = new ArrayList < String > ( ) ; public ResourceToList ( InputStream in ) { } private void processLine ( String line ) { line = stripComment ( line ) ; line = line . trim ( ) ; <START_BUG> if ( line . isEmpty ( ) ) <END_BUG> return ; _result . add ( line ) ; } private String stripComment ( String line ) { } public List < String > getResult ( ) { } }

Fix:
if ( ( line . length ( ) ) == 0 )
Buggy code:
public class LongProperty extends NumberProperty { private static final long serialVersionUID = 240L ; private long value ; private long savedValue ; public LongProperty ( String name , long value ) { } public LongProperty ( ) { } @ Override public void setRunningVersion ( boolean runningVersion ) { } public void recoverRunningVersion ( TestElement owner ) { } public void setValue ( int value ) { } @ Override protected void setNumberValue ( Number n ) { } @ Override protected void setNumberValue ( String n ) throws NumberFormatException { } public String getStringValue ( ) { } public Object getObjectValue ( ) { } @ Override <START_BUG> public Object clone ( ) { <END_BUG> LongProperty prop = ( ( LongProperty ) ( super . clone ( ) ) ) ; prop . value = value ; return prop ; } @ Override public boolean getBooleanValue ( ) { } @ Override public double getDoubleValue ( ) { } @ Override public float getFloatValue ( ) { } @ Override public int getIntValue ( ) { } @ Override public long getLongValue ( ) { } }

Fix:
public LongProperty clone ( ) {
Buggy code:
public class Cvs extends Task { private Commandline cmd = new Commandline ( ) ; private String cvsRoot ; private String pack ; private String command = "checkout" ; private boolean quiet = false ; private boolean noexec = false ; private File dest ; public void execute ( ) throws BuildException { Commandline toExecute = new Commandline ( ) ; toExecute . setExecutable ( "cvs" ) ; if ( ( cvsRoot ) != null ) { toExecute . createArgument ( ) . setValue ( "-d" ) ; toExecute . createArgument ( ) . setValue ( cvsRoot ) ; } if ( noexec ) { toExecute . createArgument ( ) . setValue ( "-n" ) ; } if ( quiet ) { toExecute . createArgument ( ) . setValue ( "-q" ) ; } <START_BUG> toExecute . createArgument ( ) . setValue ( command ) ; <END_BUG> toExecute . addArguments ( cmd . getCommandline ( ) ) ; if ( ( pack ) != null ) { toExecute . createArgument ( ) . setValue ( pack ) ; } Execute exe = new Execute ( new LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) , null ) ; exe . setAntRun ( project ) ; if ( ( dest ) == null ) dest = project . getBaseDir ( ) ; exe . setWorkingDirectory ( dest ) ; exe . setCommandline ( toExecute . getCommandline ( ) ) ; try { exe . execute ( ) ; } catch ( IOException e ) { throw new BuildException ( e , location ) ; } } public void setCvsRoot ( String root ) { } public void setDest ( File dest ) { } public void setPackage ( String p ) { } public void setTag ( String p ) { } public void setDate ( String p ) { } public void setCommand ( String c ) { } public void setQuiet ( boolean q ) { } public void setNoexec ( boolean ne ) { } }

Fix:
toExecute . createArgument ( ) . setLine ( command ) ;
Buggy code:
public class CalculatorActivity extends Activity { private TextView display ; private boolean dotWasPressed = false ; private boolean allowCompletion = false ; private CalculatorState calculatorState = CalculatorState . NOT_QUEUED ; private double lastNum = 0 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void numKeyPressed ( int num ) { } private void dotKeyPressed ( ) { } private void clearKeyPressed ( ) { } private void setInitialValues ( ) { } private void operatorKeyPressed ( CalculatorState buttonType ) { String displayText = display . getText ( ) . toString ( ) ; float currentNum = Float . valueOf ( displayText ) ; allowCompletion = false ; switch ( calculatorState ) { case NOT_QUEUED : break ; case PLUS : setDisplayText ( ( ( lastNum ) + currentNum ) ) ; break ; case MINUS : setDisplayText ( ( ( lastNum ) - currentNum ) ) ; break ; case MUL : setDisplayText ( ( ( lastNum ) * currentNum ) ) ; break ; case DIV : setDisplayText ( ( ( lastNum ) // currentNum ) ) ; if ( currentNum == 0 ) { setInitialValues ( ) ; return ; } break ; } <START_BUG> lastNum = Float . valueOf ( display . getText ( ) . toString ( ) ) ; <END_BUG> calculatorState = buttonType ; } private void setDisplayText ( double number ) { } }

Fix:
lastNum = Float . valueOf ( display . getText ( ) . toString ( ) . replace ( ',' , '.' ) ) ;
Buggy code:
public class HostControllerBootstrap { private static final Logger log = Logger . getLogger ( "org.jboss.as.host.controller" ) ; static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "host" , "controller" ) ; static final int DEFAULT_POOL_SIZE = 20 ; private final ServiceContainer serviceContainer = Factory . create ( ) ; private final HostControllerEnvironment environment ; private final byte [ ] authCode ; public HostControllerBootstrap ( final HostControllerEnvironment environment , final byte [ ] authCode ) { } public void start ( ) throws Exception { } static void activateDomainController ( final HostControllerEnvironment environment , final ModelNode host , final ServiceTarget serviceTarget , final boolean backupDomainFiles , final boolean useCachedDc ) { final FileRepository fileRepository = new LocalFileRepository ( environment ) ; <START_BUG> boolean slave = ! ( host . get ( DOMAIN_CONTROLLER , LOCAL ) . isDefined ( ) ) ; <END_BUG> if ( slave ) { HostControllerBootstrap . installRemoteDomainControllerConnection ( environment , host , serviceTarget , fileRepository ) ; } HostControllerBootstrap . installLocalDomainController ( environment , host , serviceTarget , slave , fileRepository , backupDomainFiles , useCachedDc ) ; } static void installLocalDomainController ( final HostControllerEnvironment environment , final ModelNode host , final ServiceTarget serviceTarget , final boolean isSlave , final FileRepository fileRepository , final boolean backupDomainFiles , final boolean useCachedDc ) { } static void installRemoteDomainControllerConnection ( final HostControllerEnvironment environment , final ModelNode host , final ServiceTarget serviceTarget , final FileRepository repository ) { } static void activateNetworkInterfaces ( final ModelNode host , final ServiceTarget serviceTarget ) { } static ExtensibleConfigurationPersister createHostConfigurationPersister ( final File configDir ) { } static ExtensibleConfigurationPersister createDomainConfigurationPersister ( final File configDir , boolean isSlave ) { } static final class HostControllerExecutorService implements Service < Executor > { final InjectedValue < ThreadFactory > threadFactoryValue = new InjectedValue < ThreadFactory > ( ) ; private ScheduledExecutorService executorService ; @ Override public synchronized void start ( final StartContext context ) throws StartException { } @ Override public synchronized void stop ( final StopContext context ) { } @ Override public synchronized ScheduledExecutorService getValue ( ) throws IllegalStateException { } } }

Fix:
boolean slave = ! ( host . get ( DOMAIN_CONTROLLER ) . hasDefined ( LOCAL ) ) ;
Buggy code:
public class Conf { private static final String DEFAULT_CONF_FILE = "smart.conf" ; private String MQTTServer ; private String MQTTID ; private String MQTTRingTopic ; private String MQTTRingPayload ; private int MQTTQOS ; private int serverPort ; private String serverCommandQuit ; private String serverCommandRing ; private String cronCommand ; private String cronTMPFile ; private String cronTag ; public void importConf ( ) { } public void importConfFromFile ( String defaultConfFile ) { String content = BasicIO . readFile ( defaultConfFile ) ; JSONObject js = new JSONObject ( content ) ; JSONObject MQTT = js . getJSONObject ( "MQTT" ) ; this . setMQTTServer ( MQTT . getString ( "server" ) ) ; this . setMQTTID ( MQTT . getString ( "id" ) ) ; this . setMQTTRingTopic ( MQTT . getString ( "topic" ) ) ; this . setMQTTRingPayload ( MQTT . getString ( "payload" ) ) ; this . setMQTTRingQOS ( MQTT . getInt ( "QOS" ) ) ; JSONObject Server = js . getJSONObject ( "server" ) ; this . setServerPort ( Server . getInt ( "port" ) ) ; JSONObject Command = Server . getJSONObject ( "command" ) ; this . setServerCommandQuit ( Command . getString ( "quitAction" ) ) ; this . setServerCommandRing ( Command . getString ( "ringAction" ) ) ; JSONObject cron = js . getJSONObject ( "cron" ) ; this . setCronCommand ( cron . getString ( "command" ) ) ; this . setCronTag ( cron . getString ( "tag" ) ) ; <START_BUG> this . setCronTMPFile ( cron . getString ( "TmpFile" ) ) ; <END_BUG> } private void setMQTTRingQOS ( int int1 ) { } public void setMQTTID ( String string ) { } public String getMQTTID ( ) { } public String getMQTTServer ( ) { } public void setMQTTServer ( String mQTTServer ) { } public String getMQTTRingTopic ( ) { } public void setMQTTRingTopic ( String mQTTRingTopic ) { } public String getMQTTRingPayload ( ) { } public void setMQTTRingPayload ( String mQTTRingPayload ) { } public int getMQTTQOS ( ) { } public int getServerPort ( ) { } public void setServerPort ( int serverPort ) { } public String getServerCommandQuit ( ) { } public void setServerCommandQuit ( String serverCommandQuit ) { } public String getServerCommandRing ( ) { } public void setServerCommandRing ( String serverCommandRing ) { } public String getCronCommand ( ) { } public void setCronCommand ( String cronCommand ) { } public String getCronTMPFile ( ) { } public void setCronTMPFile ( String cronTMPFile ) { } public String getCronTag ( ) { } public void setCronTag ( String cronTag ) { } public void setMQTTQOS ( int mQTTQOS ) { } }

Fix:
this . setCronTMPFile ( cron . getString ( "tmpFile" ) ) ;
Buggy code:
public class CompositeOperationHandlerUnitTestCase { private ServiceContainer container ; private NewModelController controller ; private AtomicBoolean sharedState ; @ Before public void setupController ( ) throws InterruptedException { } @ After public void shutdownServiceContainer ( ) { } @ Test public void testModelStageGood ( ) throws Exception { } @ Test public void testModelStageFailure ( ) throws Exception { } @ Test public void testModelStageUnhandledFailure ( ) throws Exception { } @ Test public void testModelStageFailureNoRollback ( ) throws Exception { } @ Test public void testModelStageUnhandledFailureNoRollback ( ) throws Exception { } @ Test public void testRuntimeStageFailed ( ) throws Exception { } @ Test public void testRuntimeStageFailedNoRollback ( ) throws Exception { } @ Test public void testRuntimeStageOFENoRollback ( ) throws Exception { } @ Test public void testRuntimeStageUnhandledFailureNoRollback ( ) throws Exception { } @ Test public void testModelStageGoodNestedComposite ( ) throws Exception { } @ Test public void testModelStageFailedNestedComposite ( ) throws Exception { } @ Test public void testGoodServiceComposite ( ) throws Exception { } @ Test public void testGoodServiceNestedComposite ( ) throws Exception { } @ Test public void testBadService ( ) throws Exception { } @ Test public void testMissingService ( ) throws Exception { } @ Test public void testBadServiceNestedComposite ( ) throws Exception { } @ Test public void testMissingServiceNestedComposite ( ) throws Exception { } @ Test public void testGoodServiceCompositeTxRollback ( ) throws Exception { } @ Test public void testGoodServiceNestedCompositeTxRollback ( ) throws Exception { } @ Test public void testReloadRequired ( ) throws Exception { } @ Test public void testRestartRequired ( ) throws Exception { } @ Test public void testReloadRequiredTxRollback ( ) throws Exception { } @ Test public void testRestartRequiredTxRollback ( ) throws Exception { } @ Test public void testCompositeReleasesLocks ( ) throws Exception { System . out . println ( "------" ) ; assertTrue ( sharedState . get ( ) ) ; ModelNode step1 = ModelControllerImplUnitTestCase . getOperation ( "good" , "attr1" , 2 ) ; ModelNode step2 = ModelControllerImplUnitTestCase . getOperation ( "good-service" , "attr2" , 1 ) ; controller . execute ( CompositeOperationHandlerUnitTestCase . getCompositeOperation ( null , step1 , step2 ) , null , null , null ) ; System . out . println ( "------" ) ; final CountDownLatch latch = new CountDownLatch ( 1 ) ; final AtomicInteger i = new AtomicInteger ( ) ; new Thread ( new Runnable ( ) { @ Override public void run ( ) { i . set ( controller . execute ( ModelControllerImplUnitTestCase . getOperation ( "good" , "attr1" , 3 ) , null , null , null ) . get ( "result" ) . asInt ( ) ) ; latch . countDown ( ) ; } } ) . start ( ) ; latch . await ( ) ; <START_BUG> Assert . assertEquals ( 1 , i . get ( ) ) ; <END_BUG> } public static ModelNode getCompositeOperation ( Boolean rollback , ModelNode ... steps ) { } }

Fix:
Assert . assertEquals ( 2 , i . get ( ) ) ;
Buggy code:
public class StandaloneMockMvcBuilderTests { @ Test public void placeHoldersInRequestMapping ( ) throws Exception { StubWebApplicationContext cxt = new StubWebApplicationContext ( new MockServletContext ( ) ) ; StandaloneMockMvcBuilder builder = new StandaloneMockMvcBuilder ( new StandaloneMockMvcBuilderTests . PlaceholderController ( ) ) ; <START_BUG> builder . addPlaceHolderValues ( "sys.login.ajax" , "//foo" ) ; <END_BUG> builder . initWebAppContext ( cxt ) ; RequestMappingHandlerMapping hm = cxt . getBean ( RequestMappingHandlerMapping . class ) ; MockHttpServletRequest request = new MockHttpServletRequest ( "GET" , "//foo" ) ; HandlerExecutionChain chain = hm . getHandler ( request ) ; assertNotNull ( chain ) ; assertEquals ( "handleWithPlaceholders" , ( ( org . springframework . web . method . HandlerMethod ) ( chain . getHandler ( ) ) ) . getMethod ( ) . getName ( ) ) ; } @ Controller private static class PlaceholderController { @ RequestMapping ( "${sys.login.ajax}" ) private void handleWithPlaceholders ( ) { } } }

Fix:
builder . addPlaceHolderValue ( "sys.login.ajax" , "//foo" ) ;
Buggy code:
public class PlayerObject { public InventoryObject getInventoryAPI ( ) { } public Player getOnlinePlayer ( String username ) { } public Player getOnlinePlayerExact ( String username ) { } public Player [ ] getOnlinePlayers ( ) { <START_BUG> return ( ( Player [ ] ) ( plugin . getServer ( ) . getOnlinePlayers ( ) . toArray ( ) ) ) ; <END_BUG> } public void clearAllInventory ( Player player ) { } public void clearHotBar ( Player player ) { } public void clearInventorySlot ( Player player , int slot ) { } public void clearPotionEffects ( Player player ) { } public void clearStats ( Player player ) { } public void freezePlayer ( Player player ) { } public void unfreezePlayer ( Player player ) { } public int getNumberOfCatsOwned ( String playername ) { } public int getNumberOfWolvesOwned ( String playername ) { } public ArrayList < Ocelot > getOwnedCats ( String playername ) { } public ArrayList < Wolf > getOwnedWolves ( String playername ) { } public int getTotalNumberTamedMobs ( String playername ) { } public boolean setArmor ( Player player , ItemStack [ ] items ) { } public boolean sit ( Player player ) { } public boolean teleport ( Player player , Location location ) { } public boolean teleportAsCommand ( Player player , Location location ) { } public int getCardinalDirection ( Player player ) { } public String getDirectionTo ( Location originalLocation , Location checkedLocation ) { } public char getFrontFriendlyCardinalDirection ( int frontCardinalDirection ) { } public char getBackFriendlyCardinalDirection ( int frontCardinalDirection ) { } public char getLeftFriendlyCardinalDirection ( int frontCardinalDirection ) { } public char getRightFriendlyCardinalDirection ( int frontCardinalDirection ) { } public boolean isHelmetArmor ( Material mat ) { } public boolean isChestplateArmor ( Material mat ) { } public boolean isLeggingArmor ( Material mat ) { } public boolean isBootArmor ( Material mat ) { } public boolean isArmour ( Material mat ) { } }

Fix:
return plugin . getServer ( ) . getOnlinePlayers ( ) . toArray ( new Player [ 0 ] ) ;
Buggy code:
public class ThetaStar extends GridAStar { public ThetaStar ( ) { } public List < GridNode > findPath ( List < List < GridNode > > searchArea , GridNode start , GridNode dest ) { } protected void computeBestPath ( List < List < GridNode > > searchArea , GridNode node , GridNode neighbor ) { } private boolean lineOfSight ( List < List < GridNode > > searchArea , GridNode a , GridNode b ) { int xA = a . location ( ) . x ( ) ; int yA = a . location ( ) . y ( ) ; int xB = b . location ( ) . x ( ) ; int yB = b . location ( ) . y ( ) ; int rise = yB - yA ; int run = xB - xA ; if ( run == 0 ) { if ( yB < yA ) { int temp = yB ; yB = yA ; <START_BUG> yA = yB ; <END_BUG> } for ( int y = yA ; y < ( yB + 1 ) ; y ++ ) { if ( ! ( searchArea . get ( y ) . get ( xA ) . walkable ( ) ) ) { return false ; } } } else { float slope = ( ( float ) ( rise ) ) // run ; int adjust = 1 ; if ( slope < 0 ) { adjust = - 1 ; } int offset = 0 ; if ( ( slope <= 1 ) && ( slope >= ( - 1 ) ) ) { int delta = ( Math . abs ( rise ) ) * 2 ; int threshold = Math . abs ( run ) ; int thresholdInc = ( Math . abs ( run ) ) * 2 ; int y = yA ; if ( xB < xA ) { int temp = xB ; xB = xA ; xA = temp ; y = yB ; } for ( int x = xA ; x < xB ; x ++ ) { if ( ! ( searchArea . get ( y ) . get ( x ) . walkable ( ) ) ) { return false ; } offset += delta ; if ( offset >= threshold ) { y += adjust ; threshold += thresholdInc ; } } } else { int delta = ( Math . abs ( run ) ) * 2 ; int threshold = Math . abs ( rise ) ; int thresholdInc = ( Math . abs ( rise ) ) * 2 ; int x = xA ; if ( yB < yA ) { int temp = yB ; yB = yA ; yA = temp ; x = xB ; } for ( int y = yA ; y < ( yB + 1 ) ; y ++ ) { if ( ! ( searchArea . get ( y ) . get ( x ) . walkable ( ) ) ) { return false ; } offset += delta ; if ( offset >= threshold ) { x += adjust ; threshold += thresholdInc ; } } } } return true ; } @ Override protected int distanceBetweenNodes ( GridNode a , GridNode b ) { } public void printAllLOSNodeCombinations ( List < List < GridNode > > searchArea ) { } public List < List < String > > getVisibilityGraph ( List < List < GridNode > > searchArea , GridNode node ) { } public static void main ( String [ ] args ) { } }

Fix:
yA = temp ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.4-snapshot-20070322-1027" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.4-snapshot-20070629-0646" ;
Buggy code:
public class GoogleStockServer implements StockServer { public GoogleStockServer ( ) { } @ Override public Stock getStock ( Code code ) throws StockNotFoundException { } private Code getOriginalCode ( Map < String , Code > originalCodes , String googleTicker , String googleExchange ) { } private Currency getBestCurrency ( String l_cur ) { if ( l_cur == null ) { return null ; } l_cur = l_cur . trim ( ) ; if ( l_cur . isEmpty ( ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 , length = l_cur . length ( ) ; i < length ; i ++ ) { char c = l_cur . charAt ( i ) ; if ( ( ( ( Character . isWhitespace ( c ) ) || ( Character . isDigit ( c ) ) ) || ( c == '.' ) ) || ( c == ',' ) ) { break ; } sb . append ( c ) ; } if ( ( sb . length ( ) ) == 0 ) { return Currency . newInstance ( "USD" ) ; } <START_BUG> String currencySymbol = sb . toString ( ) ; <END_BUG> String currencyCode = GoogleStockServer . currencySymbolToCurrencyCodeMap . get ( currencySymbol ) ; try { if ( currencyCode == null ) { return Currency . newInstance ( currencySymbol ) ; } return Currency . newInstance ( currencyCode ) ; } catch ( IllegalArgumentException ex ) { GoogleStockServer . log . error ( null , ex ) ; } return null ; } @ Override public List < Stock > getStocks ( List < Code > codes ) throws StockNotFoundException { } private List < Stock > getSpecialUSStocks ( List < Code > codes ) { } private Pair < Stock , Boolean > toStockEx ( Map < String , String > jsonObject , Map < String , Code > originalCodes ) { } private static final Map < String , String > currencySymbolToCurrencyCodeMap = new HashMap < > ( ) ; private static final int SYMBOL_MAX_LENGTH = 17 ; private final Gson gson = new Gson ( ) ; private static final Log log = LogFactory . getLog ( GoogleStockServer . class ) ; }

Fix:
String currencySymbol = sb . toString ( ) . toUpperCase ( ) ;
Buggy code:
public class InterjectionTest { protected static Logger logger = LogManager . getLogger ( InterjectionTest . class ) ; private Tika tika = null ; private String spectrumResult ; @ Before public void setUp ( ) throws Exception { } @ Test public void testTika ( ) { } @ Test public void testContentTypeBmp ( ) { } @ Test public void testContentTypeTiff ( ) { } @ Test public void testEnumerationType ( ) throws IOException { } @ Test public void testSpectrumFile ( ) { } @ Test public void testSpectrumStream ( ) { } @ Test public void testInputStream ( ) { } public byte [ ] getBytesFromStream ( InputStream inputStream ) { } @ Test public void testVrmlVersion1 ( ) { } @ Test public void testVrmlVersion2 ( ) { } @ Test public void testProcess ( ) { ProcessRunner runner = new ProcessRunnerImpl ( ) ; List < String > commands = new ArrayList < String > ( ) ; try { String path = "src//test//resources" ; commands . add ( "//usr//local//bin//wine" ) ; <START_BUG> commands . add ( "external//ivvrml.exe" ) ; <END_BUG> commands . add ( "-2" ) ; commands . add ( ( path + "//penguin1.wrl" ) ) ; commands . add ( "-o" ) ; commands . add ( ( path + "//penguin4.wrl" ) ) ; runner . setStartingDir ( new File ( "." ) ) ; runner . setCommand ( commands ) ; runner . setCollection ( true ) ; runner . execute ( ) ; System . out . println ( ( "output<seq2seq4repair_space>:<seq2seq4repair_space>" + ( runner . getProcessOutputAsString ( ) ) ) ) ; System . out . println ( ( "stderr<seq2seq4repair_space>:<seq2seq4repair_space>" + ( runner . getProcessErrorAsString ( ) ) ) ) ; System . out . println ( ( "Working<seq2seq4repair_space>Directory<seq2seq4repair_space>=<seq2seq4repair_space>" + ( System . getProperty ( "user.dir" ) ) ) ) ; } catch ( ProcessRunnerException e ) { System . err . println ( ( "ERROR:<seq2seq4repair_space>" + e ) ) ; e . printStackTrace ( ) ; System . err . println ( ( "Commands:<seq2seq4repair_space>" + commands ) ) ; } } }

Fix:
commands . add ( "..//interject-access-external-tools//ivTools-3.0//ivvrml.exe" ) ;
Buggy code:
public interface Transformer { String transform ( Document document , Predicate < TagNode > transformPredicate , Transformer . TransformFunction transformFunction , Transformer . NodeConsumer nodeConsumer ) throws TransformException { } public interface NodeConsumer { void accept ( Node node , String result , String newBody ) { } public static class OffsetNodeConsumer implements Transformer . NodeConsumer { private final Transformer . Offsets offsets ; public OffsetNodeConsumer ( Transformer . Offsets offsets ) { } @ Override public void accept ( Node node , String result , String newBody ) { } } } public interface TransformFunction { String transform ( TextNode node , String original ) ; public static class OffsetHTMLEscapeTransformFunction implements Transformer . TransformFunction { private final Transformer . Offsets offsets ; public OffsetHTMLEscapeTransformFunction ( Transformer . Offsets offsets ) { } @ Override public String transform ( TextNode node , String original ) { StringBuilder build = new StringBuilder ( ) ; char [ ] ca = original . toCharArray ( ) ; for ( int i = 0 ; i < ( ca . length ) ; i ++ ) { switch ( ca [ i ] ) { case '&' : build . append ( "&amp;" ) ; offsets . add ( ( ( node . begin ) + i ) , 4 ) ; break ; case '<' : build . append ( "&lt;" ) ; offsets . add ( ( ( node . begin ) + i ) , 3 ) ; break ; case '>' : build . append ( "&gt;" ) ; offsets . add ( ( ( node . begin ) + i ) , 3 ) ; break ; case '"' : build . append ( "&quot;" ) ; offsets . add ( ( ( node . begin ) + i ) , 5 ) ; break ; case '\n' : case '\r' : <START_BUG> if ( ( ( ( i + i ) < ( ca . length ) ) && ( ( ( ca [ i ] ) == '\n' ) && ( ( ca [ ( i + 1 ) ] ) == '\r' ) ) ) || ( ( ( ca [ i ] ) == '\r' ) && ( ( ca [ ( i + 1 ) ] ) == '\n' ) ) ) { <END_BUG> offsets . add ( ( ( node . begin ) + i ) , 3 ) ; i ++ ; } else { offsets . add ( ( ( node . begin ) + i ) , 4 ) ; } build . append ( "<br//>" ) ; break ; default : build . append ( ca [ i ] ) ; } } return build . toString ( ) ; } } } class Offsets { private final Set < Pair < Integer , Integer > > offsets = new TreeSet < > ( ) ; public void add ( int position , int amount ) { } public int computeOffsetFromIndex ( int originalIndex ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } public int total ( ) { } } }

Fix:
if ( ( ( i + i ) < ( ca . length ) ) && ( ( ( ( ca [ i ] ) == '\n' ) && ( ( ca [ ( i + 1 ) ] ) == '\r' ) ) || ( ( ( ca [ i ] ) == '\r' ) && ( ( ca [ ( i + 1 ) ] ) == '\n' ) ) ) ) {
Buggy code:
public class Node { private Node leftSon ; private Node rightSon ; private int [ ] [ ] labels ; private double threshold ; private int featureNumber ; public Node ( int featureNumber , double threshold , int [ ] [ ] labels ) { } public Node getLeftSon ( ) { } public Node getRightSon ( ) { } public void setLeftSon ( Node son ) { } public void setRightSon ( Node son ) { } public double getThreshold ( ) { } public void setTrheshold ( double t ) { } public int getFeatrueNumber ( ) { } public void setFeatureNumber ( int f ) { } public int [ ] [ ] getLabels ( ) { } public void setLables ( int [ ] [ ] l ) { } public boolean isLeaf ( ) { } private int [ ] [ ] creatMat ( int [ ] [ ] orig ) { int [ ] [ ] rtrn = new int [ orig . length ] [ ] ; for ( int i = 0 ; i < ( orig . length ) ; i ++ ) { <START_BUG> rtrn [ i ] = Arrays . copyOf ( orig [ i ] , orig [ i ] . length ) ; <END_BUG> } return rtrn ; } }

Fix:
rtrn [ i ] = orig [ i ] . clone ( ) ;
Buggy code:
public abstract class DecoratorDefinition { private static final String ATT_LABEL = "label" ; private static final String ATT_OBJECT_CLASS = "objectClass" ; static final String CHILD_ENABLEMENT = "enablement" ; private static final String ATT_ADAPTABLE = "adaptable" ; private static final String ATT_ENABLED = "state" ; private ActionExpression enablement ; protected boolean enabled ; private boolean defaultEnabled ; private String id ; protected IConfigurationElement definingElement ; protected boolean labelProviderCreationFailed = false ; private boolean hasReadEnablement ; static final String ATT_CLASS = "class" ; DecoratorDefinition ( String identifier , IConfigurationElement element ) { } public String getName ( ) { } public String getDescription ( ) { } public boolean isEnabled ( ) { } public void setEnabled ( boolean newState ) { } protected abstract void refreshDecorator ( ) throws CoreException { } protected void disposeCachedDecorator ( IBaseLabelProvider disposedDecorator ) { } public boolean isAdaptable ( ) { } public String getId ( ) { } public boolean getDefaultValue ( ) { } protected ActionExpression getEnablement ( ) { } protected void initializeEnablement ( ) { } void addListener ( ILabelProviderListener listener ) { } boolean isLabelProperty ( Object element , String property ) { } protected abstract IBaseLabelProvider internalGetLabelProvider ( ) throws CoreException { } protected void handleCoreException ( CoreException exception ) { <START_BUG> WorkbenchPlugin . getDefault ( ) . getLog ( ) . log ( exception . getStatus ( ) ) ; <END_BUG> crashDisable ( ) ; } public void crashDisable ( ) { } public abstract boolean isFull ( ) { } public IConfigurationElement getConfigurationElement ( ) { } public boolean isEnabledFor ( Object element ) { } }

Fix:
WorkbenchPlugin . log ( exception ) ;
Buggy code:
public class WarehouseAgent extends Agent { private static final long serialVersionUID = 1L ; private ArrayList < String > pendingOrders ; private ArrayList < String > completedOrders ; private ArrayList < String > assignedOrders ; int currentOrder ; InitConfig config ; protected void setup ( ) { System . out . println ( ( ( getLocalName ( ) ) + ":<seq2seq4repair_space>Started." ) ) ; config = new InitConfig ( ) ; <START_BUG> config . createXML ( 10 , 3 , 5 , 0 ) ; <END_BUG> System . out . println ( ( ( getLocalName ( ) ) + ":<seq2seq4repair_space>Configuration<seq2seq4repair_space>created<seq2seq4repair_space>succesfuly." ) ) ; config . readXML ( ) ; System . out . println ( ( ( getLocalName ( ) ) + ":<seq2seq4repair_space>Configuration<seq2seq4repair_space>read<seq2seq4repair_space>succesfuly." ) ) ; pendingOrders = new ArrayList < String > ( ) ; assignedOrders = new ArrayList < String > ( ) ; completedOrders = new ArrayList < String > ( ) ; addBehaviour ( new WarehouseAgent . initialOrders ( ) ) ; addBehaviour ( new WarehouseAgent . CreateOrder ( ) ) ; addBehaviour ( new WarehouseAgent . updateOrderLists ( ) ) ; addBehaviour ( new WarehouseAgent . initialRobots ( ) ) ; addBehaviour ( new WarehouseAgent . initialShelves ( ) ) ; System . out . println ( ( ( getLocalName ( ) ) + ":<seq2seq4repair_space>Loaded<seq2seq4repair_space>behaviours" ) ) ; } protected void takeDown ( ) { } @ SuppressWarnings ( "serial" ) public class updateOrderLists extends CyclicBehaviour { public void action ( ) { } } @ SuppressWarnings ( "serial" ) private class CreateOrder extends CyclicBehaviour { public void action ( ) { } HashMap < String , Integer > readOrder ( ) { } } private class initialOrders extends OneShotBehaviour { private static final long serialVersionUID = 1L ; public void action ( ) { } } private class initialRobots extends OneShotBehaviour { public void action ( ) { } } private class initialShelves extends OneShotBehaviour { public void action ( ) { } } }

Fix:
config . createXML ( 10 , 2 , 2 , 0 ) ;
Buggy code:
public class ServerConfigurationPersisterImpl implements ServerConfigurationPersister , Service < ServerConfigurationPersister > { private static Logger logger = Logger . getLogger ( "org.jboss.as.server" ) ; private final InjectedValue < ServerEnvironment > serverEnvironment = new InjectedValue < ServerEnvironment > ( ) ; private final ServerModel configuration ; private File configFile ; public static void addService ( ServerModel configuration , BatchBuilder batchBuilder ) { } public ServerConfigurationPersisterImpl ( ServerModel configuration ) { } @ Override public void configurationModified ( ) { } private void backupConfigFile ( ) throws IOException { } private void copyFile ( File file , File backup ) throws IOException { } @ Override public void start ( StartContext context ) throws StartException { ServerEnvironment env ; try { env = serverEnvironment . getValue ( ) ; } catch ( IllegalStateException ise ) { throw new StartException ( ( ( ServerEnvironment . class . getSimpleName ( ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>injected" ) ) ; } if ( env . isStandalone ( ) ) { <START_BUG> File configDir = serverEnvironment . getValue ( ) . getServerConfigurationDir ( ) ; <END_BUG> if ( configDir . exists ( ) ) { if ( ! ( configDir . isDirectory ( ) ) ) { throw new StartException ( ( ( configDir . getAbsolutePath ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory" ) ) ; } else if ( ! ( configDir . canWrite ( ) ) ) { throw new StartException ( ( ( configDir . getAbsolutePath ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>writable" ) ) ; } } else if ( ! ( configDir . mkdirs ( ) ) ) { throw new StartException ( ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( configDir . getAbsolutePath ( ) ) ) ) ; } configFile = new File ( configDir , "standalone.xml" ) ; if ( configFile . exists ( ) ) { if ( configFile . isDirectory ( ) ) { throw new StartException ( ( ( configFile . getAbsolutePath ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>directory" ) ) ; } else if ( ! ( configDir . canWrite ( ) ) ) { throw new StartException ( ( ( configFile . getAbsolutePath ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>writable" ) ) ; } } } } @ Override public void stop ( StopContext context ) { } @ Override public ServerConfigurationPersister getValue ( ) throws IllegalStateException { } private class RootElementWriter implements XMLContentWriter { @ Override public void writeContent ( XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { } } }

Fix:
File configDir = env . getServerConfigurationDir ( ) ;