nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MainActivity extends ActionBarActivity implements View . OnClickListener { TextView textView ; TextView roundView ; Button startButton ; Button pauseButton ; Button stopButton ; FightTimer fightTimer ; Timer timer ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; textView = ( ( TextView ) ( findViewById ( R . id . textView ) ) ) ; roundView = ( ( TextView ) ( findViewById ( R . id . roundView ) ) ) ; startButton = ( ( Button ) ( findViewById ( button ) ) ) ; pauseButton = ( ( Button ) ( findViewById ( button2 ) ) ) ; stopButton = ( ( Button ) ( findViewById ( button3 ) ) ) ; <START_BUG> fightTimer = new FightTimer ( 0 , 20 , 0 , 10 , 8 , textView , roundView ) ; <END_BUG> timer = new Timer ( 5 , 0 , textView ) ; startButton . setOnClickListener ( this ) ; pauseButton . setOnClickListener ( this ) ; stopButton . setOnClickListener ( this ) ; } @ Override public void onBackPressed ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onClick ( View v ) { } }

Fix:
fightTimer = new FightTimer ( 0 , 3 , 0 , 2 , 3 , textView , roundView ) ;
Buggy code:
public class AudioList implements ActionListener { private String [ ] locations ; private ArrayList < Integer > playlist ; private AudioClip clip ; private Timer loadNextSong ; private int songOn = 0 ; private boolean shuffle ; public AudioList ( Object [ ] locs , boolean shuffle ) { } public AudioList ( ArrayList < String > locs , boolean shuffle ) { } public AudioList ( boolean shuffle ) { } public AudioList ( boolean shuffle , String ... extensions ) { } public ArrayList < String > getFilesInFolder ( final File folder , ArrayList < String > locations , String ... extensions ) { for ( final File fileEntry : folder . listFiles ( ) ) if ( fileEntry . isDirectory ( ) ) <START_BUG> getFilesInFolder ( fileEntry , locations ) ; <END_BUG> else for ( String extension : extensions ) if ( getExtension ( fileEntry . getPath ( ) ) . equals ( extension ) ) locations . add ( fileEntry . getPath ( ) . substring ( ( ( getDirectory ( ) . length ( ) ) + 1 ) ) ) ; return locations ; } public String getDirectory ( ) { } public String getExtension ( String name ) { } public String getName ( String loc ) { } public void play ( ) { } public void pause ( ) { } public void stop ( ) { } public void addNext ( ) { } public void nextSong ( ) { } public void previousSong ( ) { } public boolean isPlaying ( ) { } public void playSong ( String songName ) { } public void actionPerformed ( ActionEvent e ) { } }

Fix:
getFilesInFolder ( fileEntry , locations , extensions ) ;
Buggy code:
public class DealConv { public static Deal convert ( SiteJournalDealsStruct d ) { <START_BUG> return new Deal . Builder ( ) . buyerId ( d . getDealBuyerId ( ) ) . eventId ( d . getDealEventId ( ) ) . eventTime ( d . getDealEventTime ( ) ) . id ( d . getDealId ( ) ) . itemId ( d . getDealItemId ( ) ) . quantity ( d . getDealQuantity ( ) ) . sellerId ( d . getDealSellerId ( ) ) . transactionId ( d . getDealTransactionId ( ) ) . dealType ( d . getDealEventType ( ) ) . build ( ) ; <END_BUG> } }

Fix:
return new Deal . Builder ( ) . buyerId ( d . getDealBuyerId ( ) ) . eventId ( d . getDealEventId ( ) ) . eventTime ( d . getDealEventTime ( ) ) . dealId ( d . getDealId ( ) ) . itemId ( d . getDealItemId ( ) ) . quantity ( d . getDealQuantity ( ) ) . sellerId ( d . getDealSellerId ( ) ) . transactionId ( d . getDealTransactionId ( ) ) . dealType ( d . getDealEventType ( ) ) . build ( ) ;
Buggy code:
public class CliLauncher { public static void main ( String [ ] args ) throws Exception { } private static void processGui ( String defaultControllerHost , int defaultControllerPort , final boolean connect , final String username , final char [ ] password ) throws CliInitializationException { final CommandContextImpl cmdCtx = new CommandContextImpl ( defaultControllerHost , defaultControllerPort , username , password , false ) ; SecurityActions . addShutdownHook ( new Thread ( new Runnable ( ) { @ Override public void run ( ) { if ( ! ( cmdCtx . isTerminated ( ) ) ) { cmdCtx . terminateSession ( ) ; } cmdCtx . disconnectController ( ) ; } } ) ) ; if ( connect ) { cmdCtx . connectController ( null , ( - 1 ) ) ; } try { <START_BUG> new org . jboss . as . cli . gui . GuiMain ( cmdCtx ) ; <END_BUG> } catch ( Throwable t ) { t . printStackTrace ( ) ; } } private static void processCommands ( String [ ] commands , String defaultControllerHost , int defaultControllerPort , final boolean connect , final String username , final char [ ] password ) throws CliInitializationException { } private static void processFile ( File file , String defaultControllerHost , int defaultControllerPort , final boolean connect , final String username , final char [ ] password ) throws CliInitializationException { } }

Fix:
GuiMain . start ( cmdCtx ) ;
Buggy code:
class SessionProviderFactory { static SessionProvider create ( MailSessionConfig config , final Map < String , OutboundSocketBinding > socketBindings ) throws StartException { } static SessionProvider create ( MailSessionMetaData mailSessionMetaData ) { } private static String getHostKey ( final String protocol ) { } private static String getPortKey ( final String protocol ) { } private static String getPropKey ( final String protocol , final String name ) { } private static class ManagedSession implements SessionProvider { private final Map < String , OutboundSocketBinding > socketBindings ; private final MailSessionConfig sessionConfig ; private final Properties properties = new Properties ( ) ; private ManagedSession ( MailSessionConfig sessionConfig , Map < String , OutboundSocketBinding > socketBindings ) throws StartException { } private void configure ( ) throws StartException { } private void configureCustomServers ( final Properties props , final CustomServerConfig ... serverConfigs ) throws StartException { } private void setServerProps ( final Properties props , final ServerConfig server , final String protocol ) throws StartException { } private InetSocketAddress getServerSocketAddress ( ServerConfig server ) throws StartException { final String ref = server . getOutgoingSocketBinding ( ) ; final OutboundSocketBinding binding = socketBindings . get ( ref ) ; if ( binding == null ) { <START_BUG> throw ROOT_LOGGER . outboundSocketBindingNotAvailable ( ref ) ; <END_BUG> } return new InetSocketAddress ( binding . getUnresolvedDestinationAddress ( ) , binding . getDestinationPort ( ) ) ; } @ Override public Session getSession ( ) { } } protected static class ManagedPasswordAuthenticator extends Authenticator { private MailSessionConfig config ; public ManagedPasswordAuthenticator ( MailSessionConfig sessionConfig ) { } @ Override protected PasswordAuthentication getPasswordAuthentication ( ) { } } private static class DirectSessionProvider implements SessionProvider { private final MailSessionMetaData metaData ; private final Properties properties = new Properties ( ) ; private PasswordAuthentication authenticator = null ; private DirectSessionProvider ( MailSessionMetaData metaData ) { } private void configure ( ) { } @ Override public Session getSession ( ) { } } }

Fix:
throw MESSAGES . outboundSocketBindingNotAvailable ( ref ) ;
Buggy code:
public class FeedGridViewAdapter extends BaseAdapter { private List < File > mImageList ; private Context mContext ; public FeedGridViewAdapter ( Context context ) { } public int getCount ( ) { } public Object getItem ( int position ) { } public long getItemId ( int position ) { } public View getView ( int position , View convertView , ViewGroup parent ) { ImageView imageView = ( ( ImageView ) ( convertView ) ) ; if ( convertView == null ) { imageView = new ImageView ( mContext ) ; GridView . LayoutParams imageParams = new GridView . LayoutParams ( LayoutParams . MATCH_PARENT , 300 ) ; imageView . setLayoutParams ( imageParams ) ; imageView . setScaleType ( FIT_XY ) ; <START_BUG> int padding = 10 ; <END_BUG> imageView . setPadding ( padding , padding , padding , padding ) ; } Uri imageUri = Uri . fromFile ( mImageList . get ( position ) ) ; imageView . setImageURI ( imageUri ) ; return imageView ; } public void update ( ) { } No newline ; at end ; of file ; }

Fix:
int padding = 5 ;
Buggy code:
public class Hierarchy implements LoggerRepository , RendererSupport { private LoggerFactory defaultFactory ; private Vector listeners ; Hashtable ht ; Logger root ; RendererMap rendererMap ; int enableInt ; Level enable ; boolean emittedNoAppenderWarning = false ; boolean emittedNoResourceBundleWarning = false ; public Hierarchy ( Logger root ) { } public void addRenderer ( Class classToRender , ObjectRenderer or ) { } public void addHierarchyEventListener ( HierarchyEventListener listener ) { } public void clear ( ) { } public void emitNoAppenderWarning ( Category cat ) { <START_BUG> if ( this . emittedNoAppenderWarning ) { <END_BUG> LogLog . error ( ( ( "No<seq2seq4repair_space>appenders<seq2seq4repair_space>could<seq2seq4repair_space>be<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>logger<seq2seq4repair_space>(" + ( cat . getName ( ) ) ) + ")." ) ) ; LogLog . error ( "Please<seq2seq4repair_space>initialize<seq2seq4repair_space>the<seq2seq4repair_space>log4j<seq2seq4repair_space>system<seq2seq4repair_space>properly." ) ; this . emittedNoAppenderWarning = true ; } } public Logger exists ( String name ) { } public void disable ( String levelStr ) { } public void disable ( Level p ) { } public void disableAll ( ) { } public void disableDebug ( ) { } public void disableInfo ( ) { } public void enableAll ( ) { } public void enable ( Level l ) { } public void fireAddAppenderEvent ( Category cat , Appender appender ) { } void fireRemoveAppenderEvent ( Category cat , Appender appender ) { } public Level getEnable ( ) { } public int getEnableInt ( ) { } public Logger getLogger ( String name ) { } public Logger getLogger ( String name , LoggerFactory factory ) { } public Enumeration getCurrentLoggers ( ) { } public Enumeration getCurrentCategories ( ) { } public RendererMap getRendererMap ( ) { } public Logger getRootLogger ( ) { } public boolean isDisabled ( int level ) { } public void overrideAsNeeded ( String override ) { } public void resetConfiguration ( ) { } public void setDisableOverride ( String override ) { } public void setRenderer ( Class renderedClass , ObjectRenderer renderer ) { } public void shutdown ( ) { } private final void updateParents ( Logger cat ) { } private final void updateChildren ( ProvisionNode pn , Logger logger ) { } }

Fix:
if ( ! ( this . emittedNoAppenderWarning ) ) {
Buggy code:
public class LocalFileSpy implements ProgressSpyListener { private String username ; private String filePath ; public LocalFileSpy ( ) { } @ Override public void executed ( Exercise exo ) { } public String getJLMPropertiesDir ( ) { String jlmPropertiesDir = null ; String value = Game . getProperty ( "jlm.configuration.file.path" ) ; if ( value != null ) { String [ ] paths = value . split ( "," ) ; for ( String localPath : paths ) { localPath = localPath . replace ( "$HOME$" , System . getProperty ( "user.home" ) ) ; File localPropertiesFileParentDirectory = new File ( localPath ) ; <START_BUG> File localPropertiesFileDirectory = new File ( localPath , Game . getInstance ( ) . getLocalPropertiesSubdirectory ( ) ) ; <END_BUG> if ( ! ( localPropertiesFileParentDirectory . exists ( ) ) ) { continue ; } else if ( ( localPropertiesFileDirectory . exists ( ) ) || ( localPropertiesFileDirectory . mkdir ( ) ) ) { jlmPropertiesDir = localPropertiesFileParentDirectory . getPath ( ) ; break ; } else { Logger . log ( "Game:storeProperties" , ( ( "cannot<seq2seq4repair_space>create<seq2seq4repair_space>local<seq2seq4repair_space>properties<seq2seq4repair_space>store<seq2seq4repair_space>directory<seq2seq4repair_space>(" + localPropertiesFileDirectory ) + ")" ) ) ; } } } else { int choice = JOptionPane . showConfirmDialog ( null , ( "No<seq2seq4repair_space>path<seq2seq4repair_space>provided<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>property<seq2seq4repair_space>file<seq2seq4repair_space>(or<seq2seq4repair_space>property<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>found)\n" + ( ( "You<seq2seq4repair_space>may<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>export<seq2seq4repair_space>your<seq2seq4repair_space>session<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>menu<seq2seq4repair_space>\'Session//Export<seq2seq4repair_space>session\'\n" + "to<seq2seq4repair_space>save<seq2seq4repair_space>your<seq2seq4repair_space>work<seq2seq4repair_space>manually.\n\n" ) + "Quit<seq2seq4repair_space>without<seq2seq4repair_space>saving?" ) ) , "Cannot<seq2seq4repair_space>save<seq2seq4repair_space>your<seq2seq4repair_space>changes.<seq2seq4repair_space>Quit<seq2seq4repair_space>without<seq2seq4repair_space>saving?" , JOptionPane . YES_NO_OPTION , JOptionPane . ERROR_MESSAGE ) ; return null ; } return jlmPropertiesDir ; } }

Fix:
File localPropertiesFileDirectory = new File ( localPath , Game . getLocalPropertiesSubdirectory ( ) ) ;
Buggy code:
public class ComplexFormat extends Format implements Serializable { private static final long serialVersionUID = - 6337346779577272306L ; private static final String DEFAULT_IMAGINARY_CHARACTER = "i" ; private String imaginaryCharacter ; private NumberFormat imaginaryFormat ; private NumberFormat realFormat ; public ComplexFormat ( ) { } public ComplexFormat ( NumberFormat format ) { } public ComplexFormat ( NumberFormat realFormat , NumberFormat imaginaryFormat ) { } public ComplexFormat ( String imaginaryCharacter ) { } public ComplexFormat ( String imaginaryCharacter , NumberFormat format ) { } public ComplexFormat ( String imaginaryCharacter , NumberFormat realFormat , NumberFormat imaginaryFormat ) { } public static String formatComplex ( Complex c ) { } public StringBuffer format ( Complex complex , StringBuffer toAppendTo , FieldPosition pos ) { } public StringBuffer format ( Object obj , StringBuffer toAppendTo , FieldPosition pos ) { } private StringBuffer formatDouble ( double value , NumberFormat format , StringBuffer toAppendTo , FieldPosition pos ) { } public static Locale [ ] getAvailableLocales ( ) { } private static NumberFormat getDefaultNumberFormat ( ) { } private static NumberFormat getDefaultNumberFormat ( Locale locale ) { } public String getImaginaryCharacter ( ) { } public NumberFormat getImaginaryFormat ( ) { } public static ComplexFormat getInstance ( ) { } public static ComplexFormat getInstance ( Locale locale ) { } public NumberFormat getRealFormat ( ) { } public Complex parse ( String source ) throws ParseException { } public Complex parse ( String source , ParsePosition pos ) { } private void parseAndIgnoreWhitespace ( String source , ParsePosition pos ) { } private char parseNextCharacter ( String source , ParsePosition pos ) { } private Number parseNumber ( String source , double value , ParsePosition pos ) { Number ret = null ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( '(' ) ; sb . append ( value ) ; sb . append ( ')' ) ; int n = sb . length ( ) ; int startIndex = pos . getIndex ( ) ; int endIndex = startIndex + n ; if ( endIndex < ( source . length ( ) ) ) { if ( ( source . substring ( startIndex , endIndex ) . compareTo ( sb . toString ( ) ) ) == 0 ) { <START_BUG> ret = new Double ( value ) ; <END_BUG> pos . setIndex ( endIndex ) ; } } return ret ; } private Number parseNumber ( String source , NumberFormat format , ParsePosition pos ) { } public Object parseObject ( String source , ParsePosition pos ) { } public void setImaginaryCharacter ( String imaginaryCharacter ) { } public void setImaginaryFormat ( NumberFormat imaginaryFormat ) { } public void setRealFormat ( NumberFormat realFormat ) { } }

Fix:
ret = Double . valueOf ( value ) ;
Buggy code:
public class InstanceOfExpression extends OperatorExpression { public Expression expression ; public TypeReference type ; public InstanceOfExpression ( Expression expression , TypeReference type , int operator ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { flowInfo = expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; <START_BUG> expression . checkNullStatus ( currentScope , flowInfo , FlowInfo . NON_NULL ) ; <END_BUG> return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public void reportIllegalCast ( Scope scope , TypeBinding castType , TypeBinding expressionType ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
expression . checkNullStatus ( currentScope , flowContext , flowInfo , FlowInfo . NON_NULL ) ;
Buggy code:
public class ServiceDeploymentParsingProcessor implements DeploymentUnitProcessor { static final String SERVICE_DESCRIPTOR_PATH = "META-INF//jboss-service.xml" ; static final String SERVICE_DESCRIPTOR_SUFFIX = "-service.xml" ; private final XMLMapper xmlMapper = Factory . create ( ) ; private final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; public ServiceDeploymentParsingProcessor ( ) { } public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) return ; VirtualFile serviceXmlFile = null ; if ( deploymentRoot . isDirectory ( ) ) { serviceXmlFile = deploymentRoot . getChild ( ServiceDeploymentParsingProcessor . SERVICE_DESCRIPTOR_PATH ) ; } else <START_BUG> if ( deploymentRoot . getName ( ) . endsWith ( ServiceDeploymentParsingProcessor . SERVICE_DESCRIPTOR_SUFFIX ) ) { <END_BUG> serviceXmlFile = deploymentRoot ; } if ( ( serviceXmlFile == null ) || ( ! ( serviceXmlFile . exists ( ) ) ) ) return ; InputStream xmlStream = null ; try { xmlStream = serviceXmlFile . openStream ( ) ; final XMLStreamReader reader = inputFactory . createXMLStreamReader ( xmlStream ) ; final ParseResult < JBossServiceXmlDescriptor > result = new ParseResult < JBossServiceXmlDescriptor > ( ) ; xmlMapper . parseDocument ( result , reader ) ; final JBossServiceXmlDescriptor xmlDescriptor = result . getResult ( ) ; if ( xmlDescriptor != null ) phaseContext . getDeploymentUnit ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; else throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) , e ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
if ( deploymentRoot . getLowerCaseName ( ) . endsWith ( ServiceDeploymentParsingProcessor . SERVICE_DESCRIPTOR_SUFFIX ) ) {
Buggy code:
public class MailerVisualizer extends AbstractVisualizer implements ActionListener , ChangeListener , Clearable { private static final long serialVersionUID = 240L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private JButton testerButton ; private JTextField addressField ; private JTextField fromField ; private JTextField smtpHostField ; private JTextField smtpPortField ; private JTextField failureSubjectField ; private JTextField successSubjectField ; private JTextField failureField ; private JTextField failureLimitField ; private JTextField successLimitField ; private JTextField smtpLoginField ; private JTextField smtpPasswordField ; private JComboBox authTypeCombo ; public MailerVisualizer ( ) { } public JPanel getControlPanel ( ) { } public synchronized void clearData ( ) { } public synchronized void add ( SampleResult res ) { } @ Override public String toString ( ) { } private void initGui ( ) { } public String getLabelResource ( ) { } public String getAttributesTitle ( ) { } public void actionPerformed ( ActionEvent e ) { } @ Override public void configure ( TestElement el ) { } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement c ) { } private void updateVisualizer ( MailerModel model ) { addressField . setText ( model . getToAddress ( ) ) ; fromField . setText ( model . getFromAddress ( ) ) ; smtpHostField . setText ( model . getSmtpHost ( ) ) ; <START_BUG> smtpPortField . setText ( Integer . toString ( model . getSmtpPort ( ) ) ) ; <END_BUG> smtpLoginField . setText ( model . getLogin ( ) ) ; smtpPasswordField . setText ( model . getPassword ( ) ) ; authTypeCombo . setSelectedItem ( model . getMailAuthType ( ) . toString ( ) ) ; successSubjectField . setText ( model . getSuccessSubject ( ) ) ; failureSubjectField . setText ( model . getFailureSubject ( ) ) ; failureLimitField . setText ( String . valueOf ( model . getFailureLimit ( ) ) ) ; failureField . setText ( String . valueOf ( model . getFailureCount ( ) ) ) ; successLimitField . setText ( String . valueOf ( model . getSuccessLimit ( ) ) ) ; repaint ( ) ; } private void displayMessage ( String message , boolean isError ) { } @ Override public void stateChanged ( ChangeEvent e ) { } }

Fix:
smtpPortField . setText ( model . getSmtpPort ( ) ) ;
Buggy code:
public class Javac extends MatchingTask { private static final int MODERN_COMPILER_SUCCESS = 0 ; private Path src ; private File destDir ; private Path compileClasspath ; private boolean debug = false ; private boolean optimize = false ; private boolean deprecation = false ; private boolean filtering = false ; private String target ; private Path bootclasspath ; private Path extdirs ; protected Vector compileList = new Vector ( ) ; public Path createSrc ( ) { <START_BUG> if ( ( src ) != null ) { <END_BUG> src = new Path ( project ) ; } return src ; } public void setSrcdir ( Path srcDir ) { } public void setDestdir ( File destDir ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setBootclasspath ( Path bootclasspath ) { } public Path createBootclasspath ( ) { } public void setExtdirs ( Path extdirs ) { } public Path createExtdirs ( ) { } public void setDeprecation ( boolean deprecation ) { } public void setDebug ( boolean debug ) { } public void setOptimize ( boolean optimize ) { } public void setTarget ( String target ) { } public void setFiltering ( boolean filter ) { } public void execute ( ) throws BuildException { } protected void resetFileLists ( ) { } protected void scanDir ( File srcDir , File destDir , String [ ] files ) { } private Path getCompileClasspath ( boolean addRuntime ) { } private void addExistingToClasspath ( Path target , Path source ) { } private void doClassicCompile ( ) throws BuildException { } private void doModernCompile ( ) throws BuildException { } private void doJikesCompile ( ) throws BuildException { } class JarFilenameFilter implements FilenameFilter { public boolean accept ( File dir , String name ) { } } private void addExtdirsToClasspath ( Path classpath ) { } }

Fix:
if ( ( src ) == null ) {
Buggy code:
public class ScarabRequestTool implements Recyclable , ScarabRequestScope { private RunData data ; private ScarabUser user = null ; private Issue issue = null ; private Attribute attribute = null ; private Module module = null ; private AttributeOption attributeOption = null ; public void init ( Object data ) { } public void refresh ( ) { } public ScarabRequestTool ( ) { } public void setAttribute ( Attribute attribute ) { } private IntakeTool getIntakeTool ( ) { } public void setAttributeOption ( AttributeOption option ) { } public AttributeOption getAttributeOption ( ) throws Exception { } public void setUser ( ScarabUser user ) { } public ScarabUser getUser ( ) { } public Attribute getAttribute ( ) throws Exception { try { if ( ( attribute ) == null ) { String attId = getIntakeTool ( ) . get ( "Attribute" , DEFAULT_KEY ) . get ( "Id" ) . toString ( ) ; if ( ( attId == null ) || ( ( attId . length ( ) ) == 0 ) ) { <START_BUG> attribute = Attribute . getNewInstance ( ) ; <END_BUG> } else { attribute = Attribute . getInstance ( new NumberKey ( attId ) ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } return attribute ; } public void setModule ( Module module ) { } public Module getModule ( ) throws Exception { } public RModuleAttribute getRModuleAttribute ( ) throws Exception { } public Module getModule ( String key ) throws Exception { } public void setIssue ( Issue issue ) { } public Issue getIssue ( ) { } public Issue getSearch ( ) throws Exception { } public Issue getIssue ( String key ) throws Exception { } private boolean disposed ; public void recycle ( ) { } public void dispose ( ) { } public boolean isDisposed ( ) { } }

Fix:
attribute = Attribute . getInstance ( ) ;
Buggy code:
class BatchCommitLogExecutorService extends AbstractCommitLogExecutorService implements BatchCommitLogExecutorServiceMBean , ICommitLogExecutorService { private final BlockingQueue < BatchCommitLogExecutorService . CheaterFutureTask > queue ; public BatchCommitLogExecutorService ( ) { } public BatchCommitLogExecutorService ( int queueSize ) { } public long getPendingTasks ( ) { } private final ArrayList < BatchCommitLogExecutorService . CheaterFutureTask > incompleteTasks = new ArrayList < BatchCommitLogExecutorService . CheaterFutureTask > ( ) ; private final ArrayList taskValues = new ArrayList ( ) ; private void processWithSyncBatch ( ) throws Exception { BatchCommitLogExecutorService . CheaterFutureTask firstTask = queue . take ( ) ; if ( ! ( ( firstTask . getRawCallable ( ) ) instanceof CommitLog . LogRecordAdder ) ) { firstTask . run ( ) ; return ; } incompleteTasks . clear ( ) ; taskValues . clear ( ) ; long end = ( System . nanoTime ( ) ) + ( ( long ) ( 1000000 * ( DatabaseDescriptor . getCommitLogSyncBatchWindow ( ) ) ) ) ; incompleteTasks . add ( firstTask ) ; taskValues . add ( firstTask . getRawCallable ( ) . call ( ) ) ; while ( ( ( ! ( queue . isEmpty ( ) ) ) && ( ( queue . peek ( ) . getRawCallable ( ) ) instanceof CommitLog . LogRecordAdder ) ) && ( ( System . nanoTime ( ) ) < end ) ) { BatchCommitLogExecutorService . CheaterFutureTask task = queue . remove ( ) ; incompleteTasks . add ( task ) ; taskValues . add ( task . getRawCallable ( ) . call ( ) ) ; } try { <START_BUG> CommitLog . instance ( ) . sync ( ) ; <END_BUG> } catch ( IOException e ) { throw new RuntimeException ( e ) ; } for ( int i = 0 ; i < ( incompleteTasks . size ( ) ) ; i ++ ) { incompleteTasks . get ( i ) . set ( taskValues . get ( i ) ) ; } } @ Override protected < T > RunnableFuture < T > newTaskFor ( Runnable runnable , T value ) { } @ Override protected < T > RunnableFuture < T > newTaskFor ( Callable < T > callable ) { } public void execute ( Runnable command ) { } public void add ( CommitLog . LogRecordAdder adder ) { } private static class CheaterFutureTask < V > extends FutureTask < V > { private final Callable rawCallable ; public CheaterFutureTask ( Callable < V > callable ) { } public Callable getRawCallable ( ) { } @ Override public void set ( V v ) { } } }

Fix:
instance . sync ( ) ;
Buggy code:
public class TestIndexReaderClose extends LuceneTestCase { public void testCloseUnderException ( ) throws IOException { final int iters = ( 1000 + 1 ) + ( random ( ) . nextInt ( 20 ) ) ; for ( int j = 0 ; j < iters ; j ++ ) { Directory dir = newDirectory ( ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( random ( ) , TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ) ; writer . commit ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> DirectoryReader open = DirectoryReader . open ( dir ) ; final boolean throwOnClose = ! ( rarely ( ) ) ; AtomicReader wrap = SlowCompositeReaderWrapper . wrap ( open ) ; FilterAtomicReader reader = new FilterAtomicReader ( wrap ) { @ Override protected void doClose ( ) throws IOException { super . doClose ( ) ; if ( throwOnClose ) { throw new IllegalStateException ( "BOOM!" ) ; } } } ; List < IndexReader . ReaderClosedListener > listeners = new ArrayList < > ( ) ; int listenerCount = random ( ) . nextInt ( 20 ) ; AtomicInteger count = new AtomicInteger ( ) ; boolean faultySet = false ; for ( int i = 0 ; i < listenerCount ; i ++ ) { if ( rarely ( ) ) { faultySet = true ; reader . addReaderClosedListener ( new TestIndexReaderClose . FaultyListener ( ) ) ; } else { count . incrementAndGet ( ) ; reader . addReaderClosedListener ( new TestIndexReaderClose . CountListener ( count ) ) ; } } if ( ( ! faultySet ) && ( ! throwOnClose ) ) { reader . addReaderClosedListener ( new TestIndexReaderClose . FaultyListener ( ) ) ; } try { reader . close ( ) ; fail ( "expected<seq2seq4repair_space>Exception" ) ; } catch ( IllegalStateException ex ) { if ( throwOnClose ) { assertEquals ( "BOOM!" , ex . getMessage ( ) ) ; } else { assertEquals ( "GRRRRRRRRRRRR!" , ex . getMessage ( ) ) ; } } try { reader . fields ( ) ; fail ( "we<seq2seq4repair_space>are<seq2seq4repair_space>closed" ) ; } catch ( AlreadyClosedException ex ) { } if ( random ( ) . nextBoolean ( ) ) { reader . close ( ) ; } assertEquals ( 0 , count . get ( ) ) ; wrap . close ( ) ; dir . close ( ) ; } } private static final class CountListener implements IndexReader . ReaderClosedListener { private final AtomicInteger count ; public CountListener ( AtomicInteger count ) { } @ Override public void onClose ( IndexReader reader ) { } } private static final class FaultyListener implements IndexReader . ReaderClosedListener { @ Override public void onClose ( IndexReader reader ) { } } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class GameBoard { OurField [ ] fields = new OurField [ 40 ] ; public GameBoard ( ) { } public OurField getField ( int id ) { } public OurField [ ] getFields ( ) { } public int getNumberOfFields ( ) { } public String toString ( ) { } public ArrayList < OurStreet > getAllInCategory ( int category ) { } public ArrayList < OurStreet > getBuildableFields ( int playerId ) { } public ArrayList < OurStreet > getAllWithHouses ( int id ) { ArrayList < OurStreet > streetsWithHouses = new ArrayList < OurStreet > ( ) ; for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { <START_BUG> if ( ( fields [ i ] . getType ( ) ) == "street" ) { <END_BUG> OurStreet street = ( ( OurStreet ) ( fields [ i ] ) ) ; if ( ( ( street . getNumberOfHouses ( ) ) > 0 ) && ( ( street . getOwner ( ) . getId ( ) ) == id ) ) { streetsWithHouses . add ( street ) ; } } } return streetsWithHouses ; } public OurField getFieldWhereName ( String name ) { } }

Fix:
if ( ( fields [ i ] . getType ( ) ) == "Street" ) {
Buggy code:
public class ObjectFactoryBuilder implements ObjectFactory , javax . naming . spi . ObjectFactoryBuilder { public static final ObjectFactoryBuilder INSTANCE = new ObjectFactoryBuilder ( ) ; private volatile ServiceRegistry serviceRegistry ; private ObjectFactoryBuilder ( ) { } public ObjectFactory createObjectFactory ( final Object obj , Hashtable < ? , ? > environment ) throws NamingException { } public Object getObjectInstance ( final Object ref , final Name name , final Context nameCtx , final Hashtable < ? , ? > environment ) throws Exception { } public void setServiceRegistry ( ServiceRegistry serviceRegistry ) { } private ObjectFactory factoryFromReference ( final Reference reference , final Hashtable < ? , ? > environment ) throws Exception { } private ObjectFactory factoryFromModularReference ( ModularReference modularReference , final Hashtable < ? , ? > environment ) throws Exception { <START_BUG> final Module module = Module . getCurrentModuleLoader ( ) . loadModule ( modularReference . getModuleIdentifier ( ) ) ; <END_BUG> final ClassLoader classLoader = module . getClassLoader ( ) ; return factoryFromReference ( modularReference , classLoader , environment ) ; } private ObjectFactory factoryFromReference ( final Reference reference , final ClassLoader classLoader , final Hashtable < ? , ? > environment ) throws Exception { } }

Fix:
final Module module = Module . getCallerModuleLoader ( ) . loadModule ( modularReference . getModuleIdentifier ( ) ) ;
Buggy code:
public abstract class AbstractImageBuilder implements ICompilerRequestor { protected JavaBuilder javaBuilder ; protected State newState ; protected IContainer outputFolder ; protected IContainer [ ] sourceFolders ; protected BuildNotifier notifier ; protected boolean hasSeparateOutputFolder ; protected NameEnvironment nameEnvironment ; protected Compiler compiler ; protected WorkQueue workQueue ; protected ArrayList problemTypeLocations ; protected boolean compiledAllAtOnce ; private boolean inCompiler ; public static int MAX_AT_ONCE = 1000 ; protected AbstractImageBuilder ( JavaBuilder javaBuilder ) { } public void acceptResult ( CompilationResult result ) { } protected void cleanUp ( ) { } protected void compile ( String [ ] filenames , String [ ] initialTypeNames ) { } void compile ( SourceFile [ ] units , String [ ] initialTypeNames , String [ ] additionalFilenames ) { } protected void createErrorFor ( IResource resource , String message ) { } protected String extractTypeNameFrom ( String sourceLocation ) { } protected void finishedWith ( String sourceLocation , CompilationResult result , char [ ] mainTypeName , ArrayList definedTypeNames , ArrayList duplicateTypeNames ) throws CoreException { } protected IContainer getOutputFolder ( IPath packagePath ) throws CoreException { } protected RuntimeException internalException ( CoreException t ) { } protected Compiler newCompiler ( ) { } protected IResource resourceForLocation ( String sourceLocation ) { } protected void storeProblemsFor ( IResource resource , IProblem [ ] problems ) throws CoreException { } protected void updateProblemsFor ( String sourceLocation , CompilationResult result ) throws CoreException { } protected char [ ] writeClassFile ( ClassFile classFile , boolean isSecondaryType ) throws CoreException { String fileName = new String ( classFile . fileName ( ) ) ; IPath filePath = new Path ( fileName ) ; IContainer container = outputFolder ; if ( ( filePath . segmentCount ( ) ) > 1 ) { container = getOutputFolder ( filePath . removeLastSegments ( 1 ) ) ; filePath = new Path ( filePath . lastSegment ( ) ) ; } IFile file = container . getFile ( filePath . addFileExtension ( CLASS_EXTENSION ) ) ; byte [ ] bytes = classFile . getBytes ( ) ; if ( writeClassFileCheck ( file , fileName , bytes , isSecondaryType ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( ( "Writing<seq2seq4repair_space>class<seq2seq4repair_space>file<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; <START_BUG> file . create ( new ByteArrayInputStream ( bytes ) , true , null ) ; <END_BUG> file . setDerived ( true ) ; } else if ( JavaBuilder . DEBUG ) { System . out . println ( ( "Skipped<seq2seq4repair_space>over<seq2seq4repair_space>unchanged<seq2seq4repair_space>class<seq2seq4repair_space>file<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; } return filePath . lastSegment ( ) . toCharArray ( ) ; } protected boolean writeClassFileCheck ( IFile file , String fileName , byte [ ] bytes , boolean isSecondaryType ) throws CoreException { } }

Fix:
file . create ( new ByteArrayInputStream ( bytes ) , IResource . FORCE , null ) ;
Buggy code:
public class ExtensionAdapter extends DataType { private String m_extensionName ; private DeweyDecimal m_specificationVersion ; private String m_specificationVendor ; private String m_implementationVendorID ; private String m_implementationVendor ; private DeweyDecimal m_implementationVersion ; private String m_implementationURL ; public void setExtensionName ( final String extensionName ) { } public void setSpecificationVersion ( final String specificationVersion ) { } public void setSpecificationVendor ( final String specificationVendor ) { } public void setImplementationVendorId ( final String implementationVendorID ) { } public void setImplementationVendor ( final String implementationVendor ) { } public void setImplementationVersion ( final String implementationVersion ) { } public void setImplementationUrl ( final String implementationURL ) { } public void setRefid ( final Reference reference ) throws BuildException { } private void verifyNotAReference ( ) throws BuildException { } Extension toExtension ( ) throws BuildException { } public String toString ( ) { <START_BUG> return toExtension ( ) . toString ( ) ; <END_BUG> } }

Fix:
return ( "{" + ( toExtension ( ) . toString ( ) ) ) + "}" ;
Buggy code:
public class IssueType extends org . tigris . scarab . om . BaseIssueType implements UnsecurePersistent { public static final NumberKey ISSUE__PK = new NumberKey ( "1" ) ; public static final NumberKey USER_TEMPLATE__PK = new NumberKey ( "2" ) ; public static final NumberKey GLOBAL_TEMPLATE__PK = new NumberKey ( "3" ) ; public Vector getAttributeGroups ( ScarabModule module ) throws Exception { } public int getDedupeSequence ( ScarabModule module ) throws Exception { int sequence = 1 ; Vector groups = getAttributeGroups ( module ) ; <START_BUG> for ( int i = 1 ; i < ( groups . size ( ) ) ; i ++ ) { <END_BUG> int order = ( ( AttributeGroup ) ( groups . get ( i ) ) ) . getOrder ( ) ; int previousOrder = ( ( AttributeGroup ) ( groups . get ( ( i - 1 ) ) ) ) . getOrder ( ) ; if ( order != ( previousOrder + 1 ) ) { sequence = order - 1 ; break ; } } return sequence ; } }

Fix:
for ( int i = 1 ; i <= ( groups . size ( ) ) ; i ++ ) {
Buggy code:
public class Reminder implements Serializable { private static final long serialVersionUID = 0L ; public static final String TAG = "Reminder" ; private static final String REMINDER_FILE = "reminders.ser" ; private static final String DELETED_FILE = "deleted_reminders.ser" ; private static HashMap < Integer , Reminder > cachedDeletedReminders ; private static boolean invalidatedDeletedReminders ; public static final int FLAG_AUTO = 1 ; public int flags ; private List < HAElement > homework ; private Date date ; public Reminder ( Date date , List < HAElement > homework ) { } public void save ( Context context ) { } public void delete ( Context context ) { } public String getTitle ( ) { } public int getId ( ) { } public Date getDate ( ) { } public String getDate ( String format ) { } public List < HAElement > getHAElements ( ) { } public Uri toUri ( ) { } public static Reminder fromUri ( Context context , Uri uri ) { } public boolean wasDeleted ( Context context ) { } public static Set < Reminder > loadSavedReminders ( Context context ) { } private static HashMap < Integer , Reminder > loadSavedRemindersInternal ( Context context ) { } public static Set < Reminder > loadDeletedReminders ( Context context ) { } private static HashSet < Reminder > toSet ( HashMap < Integer , Reminder > map ) { } private static HashMap < Integer , Reminder > loadDeletedRemindersInternal ( Context context ) { <START_BUG> if ( ! ( Reminder . invalidatedDeletedReminders ) ) { <END_BUG> return Reminder . cachedDeletedReminders ; } try { FileInputStream fis = context . openFileInput ( Reminder . DELETED_FILE ) ; ObjectInputStream ois = new ObjectInputStream ( fis ) ; Object readObject = ois . readObject ( ) ; ois . close ( ) ; if ( ( readObject != null ) && ( readObject instanceof HashMap ) ) { Reminder . cachedDeletedReminders = ( ( HashMap < Integer , Reminder > ) ( readObject ) ) ; Reminder . invalidatedDeletedReminders = false ; return ( ( HashMap < Integer , Reminder > ) ( readObject ) ) ; } } catch ( IOException e ) { Log . e ( Reminder . TAG , "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>deleted<seq2seq4repair_space>reminders:<seq2seq4repair_space>" , e ) ; } catch ( ClassNotFoundException e ) { Log . e ( Reminder . TAG , "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>deleted<seq2seq4repair_space>reminders:<seq2seq4repair_space>" , e ) ; } Log . w ( Reminder . TAG , "Could<seq2seq4repair_space>not<seq2seq4repair_space>load<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>deleted<seq2seq4repair_space>reminders,<seq2seq4repair_space>returning<seq2seq4repair_space>empty<seq2seq4repair_space>set." ) ; return new HashMap < Integer , Reminder > ( ) ; } public static void cleanDeletedReminders ( Context context ) { } }

Fix:
if ( ( ! ( Reminder . invalidatedDeletedReminders ) ) || ( ( Reminder . cachedDeletedReminders ) == null ) ) {
Buggy code:
public class Snippet321 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; <START_BUG> final Shell shell = new Shell ( display ) ; <END_BUG> shell . setBounds ( 10 , 10 , 200 , 200 ) ; shell . setLayout ( new FillLayout ( ) ) ; Browser browser ; try { browser = new Browser ( shell , SWT . MOZILLA ) ; } catch ( SWTError e ) { System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; display . dispose ( ) ; return ; } nsIObserver observer = new nsIObserver ( ) { public nsISupports queryInterface ( String aIID ) { if ( ( aIID . equals ( NS_IOBSERVER_IID ) ) || ( aIID . equals ( NS_ISUPPORTS_IID ) ) ) { return this ; } return null ; } public void observe ( nsISupports subject , String topic , String data ) { nsIHttpChannel channel = ( ( nsIHttpChannel ) ( subject . queryInterface ( NS_IHTTPCHANNEL_IID ) ) ) ; nsIRequest request = ( ( nsIRequest ) ( subject . queryInterface ( NS_IREQUEST_IID ) ) ) ; if ( topic . equals ( "http-on-modify-request" ) ) { System . out . println ( ( ( "---------------------\nSome<seq2seq4repair_space>Request<seq2seq4repair_space>Header<seq2seq4repair_space>Values<seq2seq4repair_space>for<seq2seq4repair_space>" + ( request . getName ( ) ) ) + ':' ) ) ; printRequestHeader ( channel , "accept" ) ; printRequestHeader ( channel , "accept-language" ) ; printRequestHeader ( channel , "host" ) ; printRequestHeader ( channel , "user-agent" ) ; } else { System . out . println ( ( ( "---------------------\n\tSome<seq2seq4repair_space>Response<seq2seq4repair_space>Header<seq2seq4repair_space>Values<seq2seq4repair_space>for<seq2seq4repair_space>" + ( request . getName ( ) ) ) + ':' ) ) ; printResponseHeader ( channel , "content-length" ) ; printResponseHeader ( channel , "content-type" ) ; printResponseHeader ( channel , "expires" ) ; printResponseHeader ( channel , "server" ) ; } } void printRequestHeader ( nsIHttpChannel channel , String header ) { try { System . out . println ( ( ( header + '=' ) + ( channel . getRequestHeader ( header ) ) ) ) ; } catch ( Exception e ) { } } void printResponseHeader ( nsIHttpChannel channel , String header ) { try { System . out . println ( ( ( ( '\t' + header ) + '=' ) + ( channel . getResponseHeader ( header ) ) ) ) ; } catch ( Exception e ) { } } } ; nsIObserverService observerService = ( ( nsIObserverService ) ( Mozilla . getInstance ( ) . getServiceManager ( ) . getServiceByContractID ( "@mozilla.org//observer-service;1" , NS_IOBSERVERSERVICE_IID ) ) ) ; observerService . addObserver ( observer , "http-on-modify-request" , false ) ; observerService . addObserver ( observer , "http-on-examine-response" , false ) ; browser . setUrl ( "http:////www.eclipse.org" ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
Shell shell = new Shell ( display ) ;
Buggy code:
public class TextViewer extends JPanel implements Observer , CaretListener , IMimePartViewer { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.gui.message.viewer" ) ; private static final Pattern CIDPattern = Pattern . compile ( "cid:([^\"]+)" , Pattern . CASE_INSENSITIVE ) ; private DocumentParser parser ; private String css = "" ; private XmlElement smilies ; private boolean enableSmilies ; private String name ; private String size ; private boolean overwrite ; private String body ; private boolean htmlMessage ; private MessageController mediator ; private IHTMLViewerPlugin viewerPlugin ; private IMailbox folder ; private Object uid ; public TextViewer ( MessageController mediator ) { } private void initHTMLViewerPlugin ( ) { } private IHTMLViewerPlugin createHTMLViewerPluginInstance ( String pluginId ) { } private void initConfiguration ( ) { } public void view ( IMailbox folder , Object uid , Integer [ ] address , MailFrameMediator mediator ) throws Exception { } private boolean isHTMLStrippingEnabled ( ) { } private void initStyleSheet ( ) { } public void update ( Observable arg0 , Object arg1 ) { } public String getSelectedText ( ) { } public JComponent getView ( ) { } public void updateGUI ( ) throws Exception { <START_BUG> System . out . println ( body ) ; <END_BUG> viewerPlugin . view ( body ) ; } public void caretUpdate ( CaretEvent arg0 ) { } private String downloadCIDParts ( String body , MimeTree mimeTree ) { } private MimePart findMimePart ( List mimeParts , String findCid ) { } private void downloadMimePart ( MimePart part , File destFile ) throws Exception { } public boolean isHtmlMessage ( ) { } }

Fix:
TextViewer . LOG . info ( body ) ;
Buggy code:
public class ModuleInformationServiceProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( deploymentUnit . hasAttachment ( OSGI_MANIFEST ) ) { return ; } final ModuleSpecification moduleSpec = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ModuleIdentifier moduleIdentifier = deploymentUnit . getAttachment ( MODULE_IDENTIFIER ) ; final List < AdditionalModuleSpecification > additionalModules = deploymentUnit . getAttachmentList ( ADDITIONAL_MODULES ) ; if ( ( moduleIdentifier == null ) || ( moduleSpec == null ) ) { return ; } phaseContext . getServiceTarget ( ) . addService ( ServiceModuleLoader . moduleInformationServiceName ( moduleIdentifier ) , new org . jboss . msc . service . ValueService < Object > ( new org . jboss . msc . value . ImmediateValue < Object > ( moduleSpec ) ) ) . install ( ) ; <START_BUG> for ( ModuleDependency dependency : moduleSpec . getDependencies ( ) ) { <END_BUG> if ( dependency . getIdentifier ( ) . getName ( ) . startsWith ( MODULE_PREFIX ) ) { phaseContext . addDependency ( ServiceModuleLoader . moduleInformationServiceName ( dependency . getIdentifier ( ) ) , MODULE_DEPENDENCY_INFORMATION ) ; } } for ( AdditionalModuleSpecification module : additionalModules ) { phaseContext . getServiceTarget ( ) . addService ( ServiceModuleLoader . moduleInformationServiceName ( module . getModuleIdentifier ( ) ) , new org . jboss . msc . service . ValueService < Object > ( new org . jboss . msc . value . ImmediateValue < Object > ( module ) ) ) . install ( ) ; } } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
for ( ModuleDependency dependency : moduleSpec . getSystemDependencies ( ) ) {