Buggy code:
public class ASModuleHandler extends CommandHandlerWithHelp { private class AddModuleArgument extends ArgumentWithValue { private AddModuleArgument ( String fullName ) { } private AddModuleArgument ( String fullName , CommandLineCompleter completer ) { } @ Override public boolean canAppearNext ( CommandContext ctx ) throws CommandFormatException { } } private static final String JBOSS_HOME = "JBOSS_HOME" ; private static final String PATH_SEPARATOR = File . pathSeparator ; private static final String MODULE_SEPARATOR = "," ; private static final String ACTION_ADD = "add" ; private static final String ACTION_REMOVE = "remove" ; private final ArgumentWithValue action = new ArgumentWithValue ( this , new DefaultCompleter ( new CandidatesProvider ( ) { @ Override public Collection < String > getAllCandidates ( CommandContext ctx ) { } } ) , 0 , "--action" ) ; private final ArgumentWithValue name ; private final ArgumentWithValue mainClass ; private final ArgumentWithValue resources ; private final ArgumentWithValue dependencies ; private final ArgumentWithValue props ; private final ArgumentWithValue moduleArg ; private final ArgumentWithValue slot ; private final ArgumentWithValue resourceDelimiter ; private File modulesDir ; public ASModuleHandler ( CommandContext ctx ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) throws CommandLineException { } protected void addModule ( CommandContext ctx , final ParsedCommandLine parsedCmd ) throws CommandLineException { final String moduleName = name . getValue ( parsedCmd , true ) ; final String resourcePaths = resources . getValue ( parsedCmd , ( ! ( moduleArg . isPresent ( parsedCmd ) ) ) ) ; String pathDelimiter = ASModuleHandler . PATH_SEPARATOR ; if ( resourceDelimiter . isPresent ( parsedCmd ) ) { pathDelimiter = resourceDelimiter . getValue ( parsedCmd ) ; } final String [ ] resourceArr = ( resourcePaths == null ) ? new String [ 0 ] : resourcePaths . split ( pathDelimiter ) ; File [ ] resourceFiles = new File [ resourceArr . length ] ; for ( int i = 0 ; i < ( resourceArr . length ) ; ++ i ) { <START_BUG> final File f = new File ( ctx . getCurrentDir ( ) , resourceArr [ i ] ) ; <END_BUG> if ( ! ( f . exists ( ) ) ) { throw new CommandLineException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>" + ( f . getAbsolutePath ( ) ) ) ) ; } resourceFiles [ i ] = f ; } final File moduleDir = getModulePath ( getModulesDir ( ) , moduleName , slot . getValue ( parsedCmd ) ) ; if ( moduleDir . exists ( ) ) { throw new CommandLineException ( ( ( ( "Module<seq2seq4repair_space>" + moduleName ) + "<seq2seq4repair_space>already<seq2seq4repair_space>exists<seq2seq4repair_space>at<seq2seq4repair_space>" ) + ( moduleDir . getAbsolutePath ( ) ) ) ) ; } if ( ! ( moduleDir . mkdirs ( ) ) ) { throw new CommandLineException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( moduleDir . getAbsolutePath ( ) ) ) ) ; } final ModuleConfigImpl config ; final String moduleXml = moduleArg . getValue ( parsedCmd ) ; if ( moduleXml != null ) { config = null ; final File source = new File ( moduleXml ) ; if ( ! ( source . exists ( ) ) ) { throw new CommandLineException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>the<seq2seq4repair_space>file<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>filesystem:<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) ) ; } ASModuleHandler . copy ( source , new File ( moduleDir , "module.xml" ) ) ; } else { config = new ModuleConfigImpl ( moduleName ) ; } for ( File f : resourceFiles ) { ASModuleHandler . copy ( f , new File ( moduleDir , f . getName ( ) ) ) ; if ( config != null ) { config . addResource ( new ResourceRoot ( f . getName ( ) ) ) ; } } if ( config != null ) { final String dependenciesStr = dependencies . getValue ( parsedCmd ) ; if ( dependenciesStr != null ) { final String [ ] depsArr = dependenciesStr . split ( ",+" ) ; for ( String dep : depsArr ) { config . addDependency ( new ModuleDependency ( dep ) ) ; } } final String propsStr = props . getValue ( parsedCmd ) ; if ( propsStr != null ) { final String [ ] pairs = propsStr . split ( "," ) ; for ( String pair : pairs ) { int equals = pair . indexOf ( '=' ) ; if ( equals == ( - 1 ) ) { throw new CommandFormatException ( ( ( ( ( "Property<seq2seq4repair_space>'" + pair ) + "'<seq2seq4repair_space>in<seq2seq4repair_space>'" ) + propsStr ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>missing<seq2seq4repair_space>the<seq2seq4repair_space>equals<seq2seq4repair_space>sign." ) ) ; } final String propName = pair . substring ( 0 , equals ) ; if ( propName . isEmpty ( ) ) { throw new CommandFormatException ( ( ( ( ( "Property<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>missing<seq2seq4repair_space>for<seq2seq4repair_space>'" + pair ) + "'<seq2seq4repair_space>in<seq2seq4repair_space>'" ) + propsStr ) + "'" ) ) ; } config . setProperty ( propName , pair . substring ( ( equals + 1 ) ) ) ; } } final String slotVal = slot . getValue ( parsedCmd ) ; if ( slotVal != null ) { config . setSlot ( slotVal ) ; } final String mainCls = mainClass . getValue ( parsedCmd ) ; if ( mainCls != null ) { config . setMainClass ( mainCls ) ; } FileWriter moduleWriter = null ; final File moduleFile = new File ( moduleDir , "module.xml" ) ; try { moduleWriter = new FileWriter ( moduleFile ) ; XMLExtendedStreamWriter xmlWriter = ASModuleHandler . create ( XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( moduleWriter ) ) ; config . writeContent ( xmlWriter , null ) ; xmlWriter . flush ( ) ; } catch ( IOException e ) { throw new CommandLineException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>file<seq2seq4repair_space>" + ( moduleFile . getAbsolutePath ( ) ) ) , e ) ; } catch ( XMLStreamException e ) { throw new CommandLineException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>" + ( moduleFile . getAbsolutePath ( ) ) ) , e ) ; }

Fix:
final File f = new File ( resourceArr [ i ] ) ;