nus-yam/ex-repair huggingface dataset:
Buggy code:
public class StandaloneServer { private static final String STANDALONE_XML = "standalone.xml" ; private final StandardElementReaderRegistrar extensionRegistrar ; static final Logger log = Logger . getLogger ( "org.jboss.as.server" ) ; private final ServerEnvironment environment ; protected StandaloneServer ( ServerEnvironment environment ) { } public void start ( ) throws ServerStartException { final File standalone = new File ( environment . getServerConfigurationDir ( ) , StandaloneServer . STANDALONE_XML ) ; if ( ! ( standalone . isFile ( ) ) ) { throw new ServerStartException ( ( ( "File<seq2seq4repair_space>" + ( standalone . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ) ; } if ( ! ( standalone . canWrite ( ) ) ) { throw new ServerStartException ( ( ( "File<seq2seq4repair_space>" + ( standalone . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>writable." ) ) ; } final List < AbstractServerModelUpdate < ? > > updates = new ArrayList < AbstractServerModelUpdate < ? > > ( ) ; try { final XMLMapper mapper = Factory . create ( ) ; extensionRegistrar . registerStandardStandaloneReaders ( mapper ) ; mapper . parseDocument ( updates , XMLInputFactory . newInstance ( ) . createXMLStreamReader ( new BufferedReader ( new FileReader ( standalone ) ) ) ) ; } catch ( Exception e ) { throw new ServerStartException ( "Caught<seq2seq4repair_space>exception<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>of<seq2seq4repair_space>standalone.xml" , e ) ; } <START_BUG> final ServerStartTask startTask = new ServerStartTask ( "server<seq2seq4repair_space>name" , 0 , null , Collections . < ServiceActivator > emptyList ( ) , updates , environment ) ; <END_BUG> startTask . run ( Collections . < ServiceActivator > emptyList ( ) ) ; new Thread ( ) { @ Override public void run ( ) { for ( ; ; ) try { Thread . sleep ( 1000000L ) ; } catch ( InterruptedException ignore ) { } } } . start ( ) ; } }

Fix:
final ServerStartTask startTask = new ServerStartTask ( "server<seq2seq4repair_space>name" , 0 , Collections . < ServiceActivator > emptyList ( ) , updates , environment ) ;
Buggy code:
public class TimerHandleImpl implements TimerHandle { private static final long serialVersionUID = 1L ; private final String timedObjectId ; private final String serviceName ; private final String id ; private transient TimerServiceImpl service ; public TimerHandleImpl ( final String id , final String timedObjectId , final TimerServiceImpl service ) throws IllegalArgumentException { } public Timer getTimer ( ) throws IllegalStateException , EJBException { if ( ( service ) == null ) { service = ( ( TimerServiceImpl ) ( TimerHandleImpl . currentServiceContainer ( ) . getRequiredService ( ServiceName . parse ( serviceName ) ) . getValue ( ) ) ) ; if ( ( service ) == null ) { throw EjbMessages . MESSAGES . timerServiceWithIdNotRegistered ( timedObjectId ) ; } } final TimerImpl timer = this . service . getTimer ( this ) ; <START_BUG> if ( ( timer != null ) && ( ( timer . isActive ( ) ) == false ) ) { <END_BUG> throw EjbMessages . MESSAGES . timerHandleIsNotActive ( this ) ; } return timer ; } public String getId ( ) { } public String getTimedObjectId ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } private static ServiceContainer currentServiceContainer ( ) { } }

Fix:
if ( ( timer == null ) || ( ! ( timer . isActive ( ) ) ) ) {
Buggy code:
public class TestDemo extends LuceneTestCase { public void testDemo ( ) throws IOException { Analyzer analyzer = new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ; Directory directory = newDirectory ( ) ; RandomIndexWriter iwriter = new RandomIndexWriter ( random ( ) , directory , analyzer ) ; Document doc = new Document ( ) ; String longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm" ; String text = "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>text<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>indexed.<seq2seq4repair_space>" + longTerm ; doc . add ( newTextField ( "fieldname" , text , YES ) ) ; iwriter . addDocument ( doc ) ; <START_BUG> iwriter . close ( ) ; <END_BUG> IndexReader ireader = DirectoryReader . open ( directory ) ; IndexSearcher isearcher = newSearcher ( ireader ) ; assertEquals ( 1 , isearcher . search ( new TermQuery ( new Term ( "fieldname" , longTerm ) ) , 1 ) . totalHits ) ; Query query = new TermQuery ( new Term ( "fieldname" , "text" ) ) ; TopDocs hits = isearcher . search ( query , null , 1 ) ; assertEquals ( 1 , hits . totalHits ) ; for ( int i = 0 ; i < ( hits . scoreDocs . length ) ; i ++ ) { StoredDocument hitDoc = isearcher . doc ( hits . scoreDocs [ i ] . doc ) ; assertEquals ( text , hitDoc . get ( "fieldname" ) ) ; } PhraseQuery phraseQuery = new PhraseQuery ( ) ; phraseQuery . add ( new Term ( "fieldname" , "to" ) ) ; phraseQuery . add ( new Term ( "fieldname" , "be" ) ) ; assertEquals ( 1 , isearcher . search ( phraseQuery , null , 1 ) . totalHits ) ; ireader . close ( ) ; directory . close ( ) ; } }

Fix:
iwriter . shutdown ( ) ;
Buggy code:
@ SuppressWarnings ( "restriction" ) final class ProjectAnalyzer extends Job { private final IJavaProject project ; private ResourceSet rs ; private Map < IStorage , Resource > mapping ; private Map < String , EPackage > packages ; public ProjectAnalyzer ( final IJavaProject project ) { } @ Override protected IStatus run ( final IProgressMonitor monitor ) { } private void loadMetamodelsForProject ( final IJavaProject javaProject , final ResourceSet rs , final IProgressMonitor monitor ) { try { final String ext = Messages . ProjectAnalyzer_2 ; if ( ! ( javaProject . exists ( ) ) ) return ; for ( final IPackageFragmentRoot root : javaProject . getPackageFragmentRoots ( ) ) { if ( ! ( root . isArchive ( ) ) ) { IResource rootResource = null ; if ( root instanceof ExternalPackageFragmentRoot ) { rootResource = ( ( ExternalPackageFragmentRoot ) ( root ) ) . resource ( ) ; } else { rootResource = root . getUnderlyingResource ( ) ; } if ( rootResource != null ) { try { <START_BUG> if ( ! ( rootResource . exists ( ) ) ) <END_BUG> rootResource . refreshLocal ( IResource . DEPTH_INFINITE , monitor ) ; rootResource . accept ( new IResourceVisitor ( ) { public boolean visit ( final IResource resource ) throws CoreException { if ( ( resource instanceof IFile ) && ( ext . equals ( ( ( IFile ) ( resource ) ) . getFileExtension ( ) ) ) ) { loadModelFromStorage ( rs , ( ( IFile ) ( resource ) ) ) ; } return true ; } } ) ; } catch ( final CoreException e ) { EmfToolsLog . logError ( e ) ; } } } else { if ( ( ( JarPackageFragmentRoot ) ( root ) ) . getPath ( ) . toString ( ) . contains ( ProjectAnalyzer_3 ) ) { if ( EmfToolsPlugin . trace ) { System . out . println ( ( ( Messages . ProjectAnalyzer_4 ) + ( ( ( JarPackageFragmentRoot ) ( root ) ) . getPath ( ) . toString ( ) ) ) ) ; } continue ; } root . open ( monitor ) ; try { final ZipFile zip = ( ( JarPackageFragmentRoot ) ( root ) ) . getJar ( ) ; final Enumeration < ? extends ZipEntry > entries = zip . entries ( ) ; while ( entries . hasMoreElements ( ) ) { final ZipEntry entry = entries . nextElement ( ) ; final String name = entry . getName ( ) ; if ( name . endsWith ( ext ) ) { final String fqn = name . substring ( 0 , ( ( ( name . length ( ) ) - ( ext . length ( ) ) ) - 1 ) ) . replaceAll ( ProjectAnalyzer_5 , ProjectAnalyzer_6 ) ; final ResourceID resourceID = new ResourceID ( fqn , ext ) ; final IStorage findStorage = JDTUtil . loadFromJar ( resourceID , root ) ; if ( findStorage != null ) { loadModelFromStorage ( rs , findStorage ) ; } } } } catch ( final CoreException e ) { EmfToolsLog . logError ( e ) ; } finally { root . close ( ) ; } } } } catch ( final JavaModelException e ) { EmfToolsLog . logError ( e ) ; } } private void loadModelFromStorage ( final ResourceSet rs , final IStorage storage ) { } private void registerEPackages ( final ResourceSet rs , final Resource r , boolean overwrite ) { } private void registerPackage ( final EPackage pack , ResourceSet rs , boolean overwrite ) { } public Map < String , EPackage > getNamedEPackageMap ( ) { } }

Fix:
if ( ( ! ( rootResource . exists ( ) ) ) || ( ! ( rootResource . isAccessible ( ) ) ) )
Buggy code:
public class Sleep extends Task { private boolean failOnError = true ; private int seconds = 0 ; private int hours = 0 ; private int minutes = 0 ; private int milliseconds = 0 ; public Sleep ( ) { } public void setFailOnError ( boolean failOnError ) { } public void setHours ( int hours ) { } public void setMilliseconds ( int milliseconds ) { } public void setMinutes ( int minutes ) { } public void setSeconds ( int seconds ) { } public void doSleep ( long millis ) { } public void execute ( ) throws BuildException { try { validate ( ) ; long sleepTime = getSleepTime ( ) ; log ( ( ( "sleeping<seq2seq4repair_space>for<seq2seq4repair_space>" + sleepTime ) + "<seq2seq4repair_space>milliseconds" ) , MSG_VERBOSE ) ; doSleep ( sleepTime ) ; } catch ( Exception e ) { if ( failOnError ) { <START_BUG> throw new BuildException ( e ) ; <END_BUG> } else { String text = e . toString ( ) ; log ( text , MSG_ERR ) ; } } } public void validate ( ) throws BuildException { } private long getSleepTime ( ) { } }

Fix:
throw new BuildException ( "Error" , e ) ;
Buggy code:
public abstract class SharedEntityManagerCreator { public static EntityManager createSharedEntityManager ( EntityManagerFactory emf ) { } public static EntityManager createSharedEntityManager ( EntityManagerFactory emf , Map properties ) { } public static EntityManager createSharedEntityManager ( EntityManagerFactory emf , Map properties , Class ... entityManagerInterfaces ) { } private static class SharedEntityManagerInvocationHandler implements Serializable , InvocationHandler { private final Log logger = LogFactory . getLog ( getClass ( ) ) ; private final EntityManagerFactory targetFactory ; private final Map properties ; private volatile transient ClassLoader proxyClassLoader ; public SharedEntityManagerInvocationHandler ( EntityManagerFactory target , Map properties ) { } private void initProxyClassLoader ( ) { if ( ( this . targetFactory ) instanceof EntityManagerFactoryInfo ) { this . proxyClassLoader = ( ( EntityManagerFactoryInfo ) ( this . targetFactory ) ) . getBeanClassLoader ( ) ; } else { <START_BUG> this . proxyClassLoader = EntityManagerFactory . class . getClassLoader ( ) ; <END_BUG> } } public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { } private void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } } private static class DeferredQueryInvocationHandler implements InvocationHandler { private final Query target ; private final EntityManager em ; public DeferredQueryInvocationHandler ( Query target , EntityManager em ) { } public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { } } }

Fix:
this . proxyClassLoader = this . targetFactory . getClass ( ) . getClassLoader ( ) ;
Buggy code:
public class PackageResourceTest extends TestCase { public WebApplication application ; public PackageResourceTest ( ) { } public PackageResourceTest ( String name ) { } @ Override protected void setUp ( ) throws Exception { } public void testBindAbsolutePackageResource ( ) throws Exception { } public void testPackageResourceGuard ( ) throws Exception { } public void testLenientPackageResourceMatching ( ) throws Exception { <START_BUG> final SharedResources sharedResources = Application . get ( ) . getSharedResources ( ) ; <END_BUG> Resource invalidResource = new PackageResource ( PackageResourceTest . class , "packaged3.txt" , Locale . ENGLISH , null ) ; assertNotNull ( "resource<seq2seq4repair_space>packaged3.txt<seq2seq4repair_space>SHOULD<seq2seq4repair_space>be<seq2seq4repair_space>available<seq2seq4repair_space>as<seq2seq4repair_space>a<seq2seq4repair_space>packaged<seq2seq4repair_space>resource<seq2seq4repair_space>even<seq2seq4repair_space>if<seq2seq4repair_space>it<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist" , invalidResource ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1.txt" , null , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1.txt" , Locale . CHINA , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1.txt" , Locale . CHINA , "foo" ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1.txt" , null , "foo" ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_en.txt" , null , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_en_US.txt" , null , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_en_US.txt" , null , "foo" ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_en_US.txt" , Locale . US , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_en_US.txt" , Locale . CANADA , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_en_US.txt" , Locale . CHINA , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_foo_bar_en.txt" , null , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_foo_bar_en_US.txt" , null , null ) ) ; assertTrue ( PackageResource . exists ( PackageResourceTest . class , "packaged1_foo_bar_en_US_MAC.txt" , null , null ) ) ; try { invalidResource . getResourceStream ( ) ; fail ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>raised<seq2seq4repair_space>an<seq2seq4repair_space>AbortException" ) ; } catch ( AbortException e ) { } } }

Fix:
Application . get ( ) . getSharedResources ( ) ;
Buggy code:
public class Linker { public void link ( DependencyInfo dependency , ClassHolder cls ) { } private void link ( DependencyInfo dependency , MethodHolder method ) { Program program = method . getProgram ( ) ; for ( int i = 0 ; i < ( program . basicBlockCount ( ) ) ; ++ i ) { BasicBlock block = program . basicBlockAt ( i ) ; for ( Instruction insn : block . getInstructions ( ) ) { if ( insn instanceof InvokeInstruction ) { InvokeInstruction invoke = ( ( InvokeInstruction ) ( insn ) ) ; <START_BUG> MethodDependencyInfo linkedMethod = dependency . getMethod ( invoke . getMethod ( ) ) ; <END_BUG> if ( linkedMethod != null ) { invoke . setMethod ( linkedMethod . getReference ( ) ) ; } } else if ( insn instanceof GetFieldInstruction ) { GetFieldInstruction getField = ( ( GetFieldInstruction ) ( insn ) ) ; FieldDependencyInfo linkedField = dependency . getField ( getField . getField ( ) ) ; if ( linkedField != null ) { getField . setField ( linkedField . getReference ( ) ) ; } } else if ( insn instanceof PutFieldInstruction ) { PutFieldInstruction getField = ( ( PutFieldInstruction ) ( insn ) ) ; FieldDependencyInfo linkedField = dependency . getField ( getField . getField ( ) ) ; if ( linkedField != null ) { getField . setField ( linkedField . getReference ( ) ) ; } } } } } }

Fix:
MethodDependencyInfo linkedMethod = dependency . getMethodImplementation ( invoke . getMethod ( ) ) ;
Buggy code:
public class ServerModelInterfaceRemove extends AbstractServerModelUpdate < Void > { private static final long serialVersionUID = - 4178671085310775352L ; private final String interfaceName ; public ServerModelInterfaceRemove ( final String name ) { } protected void applyUpdate ( ServerModel element ) throws UpdateFailedException { } public AbstractServerModelUpdate < ? > getCompensatingUpdate ( ServerModel original ) { } public < P > void applyUpdate ( UpdateContext updateContext , org . jboss . as . model . UpdateResultHandler < ? extends Void , P > resultHandler , P param ) { <START_BUG> final ServiceController < ? > controller = updateContext . getServiceContainer ( ) . getService ( JBOSS_NETWORK_INTERFACE . append ( interfaceName ) ) ; <END_BUG> if ( controller == null ) { resultHandler . handleSuccess ( null , param ) ; return ; } controller . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } }

Fix:
final ServiceController < ? > controller = updateContext . getServiceRegistry ( ) . getService ( JBOSS_NETWORK_INTERFACE . append ( interfaceName ) ) ;
Buggy code:
public class HostControllerBootstrap { private final ServiceContainer serviceContainer = Factory . create ( "host-controller" ) ; private final HostControllerEnvironment environment ; private final byte [ ] authCode ; public HostControllerBootstrap ( final HostControllerEnvironment environment , final byte [ ] authCode ) { } public void bootstrap ( ) throws Exception { final HostRunningModeControl runningModeControl = environment . getRunningModeControl ( ) ; <START_BUG> final ControlledProcessState processState = new ControlledProcessState ( false ) ; <END_BUG> ServiceTarget target = serviceContainer . subTarget ( ) ; ControlledProcessStateService . addService ( target , processState ) ; final HostControllerService hcs = new HostControllerService ( environment , runningModeControl , authCode , processState ) ; target . addService ( HC_SERVICE_NAME , hcs ) . install ( ) ; } }

Fix:
final ControlledProcessState processState = new ControlledProcessState ( true ) ;
Buggy code:
public class MessageCenter { private static final MessageCenter instance = new MessageCenter ( ) ; private final Logger logger = Logger . getLogger ( MessageCenter . class ) ; private Layout layout = new TTCCLayout ( ) ; private final JList messageList = new JList ( ) ; private final MessageCenterAppender appender = new MessageCenterAppender ( ) ; private ListCellRenderer listCellRenderer = new MessageCenter . LayoutListCellRenderer ( layout ) ; private PropertyChangeSupport propertySupport = new PropertyChangeSupport ( this ) ; private JScrollPane pane = new JScrollPane ( messageList ) ; private final JToolBar toolbar = new JToolBar ( ) ; private JPopupMenu popupMenu = new JPopupMenu ( ) ; private PopupListener popupListener = new PopupListener ( popupMenu ) ; private Action clearAction ; private final JPanel componentPanel = new JPanel ( new BorderLayout ( ) ) ; private MessageCenter ( ) { } private void setupPopMenu ( ) { } private void setupToolbar ( ) { } private void setupActions ( ) { } private void setupListeners ( ) { } private void updateActions ( ) { } private void setupLogger ( ) { logger . addAppender ( appender ) ; logger . setAdditivity ( false ) ; <START_BUG> logger . setLevel ( Level . DEBUG ) ; <END_BUG> } private void setupComponentPanel ( ) { } public final JComponent getGUIComponent ( ) { } public ListModel getModel ( ) { } public static MessageCenter getInstance ( ) { } public void addMessage ( String message ) { } public final Layout getLayout ( ) { } public final void setLayout ( Layout layout ) { } public final Logger getLogger ( ) { } private static class LayoutListCellRenderer extends DefaultListCellRenderer implements ListCellRenderer { private Layout layout ; public LayoutListCellRenderer ( Layout layout ) { } public Component getListCellRendererComponent ( JList list , Object value , int index , boolean isSelected , boolean cellHasFocus ) { } } }

Fix:
logger . setLevel ( ( Boolean . getBoolean ( "log4j.debug" ) ? Level . DEBUG : Level . INFO ) ) ;
Buggy code:
public class CSVParser { private static BufferedReader br ; public static ArrayList < HashMap < String , String > > parse ( File file ) { ArrayList < HashMap < String , String > > data = new ArrayList < HashMap < String , String > > ( ) ; try { <START_BUG> CSVParser . br = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , "ISO-8859-1" ) ) ; <END_BUG> String line = "" ; int lineNumber = 0 ; int col = 0 ; HashMap < String , String > tmpLine ; line = CSVParser . br . readLine ( ) ; String [ ] keys = line . split ( ";" ) ; while ( null != ( line = CSVParser . br . readLine ( ) ) ) { if ( 0 != lineNumber ) { tmpLine = new HashMap < String , String > ( ) ; col = 0 ; for ( String key : keys ) { tmpLine . put ( key , line . split ( ";" ) [ col ] ) ; col += 1 ; } data . add ( tmpLine ) ; } lineNumber += 1 ; } CSVParser . br . close ( ) ; } catch ( FileNotFoundException e ) { System . err . println ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; } catch ( IOException e ) { System . err . println ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; } return data ; } }

Fix:
CSVParser . br = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , "UTF-8" ) ) ;
Buggy code:
public class ArffConverter { private LinkedHashMap < String , Integer > attrMap ; private String asmDirPath ; private String outFilePath ; private Set < String > labelSet ; public ArffConverter ( String attrPath , String asmDirPath , String outFilePath ) { } private void buildLabelSet ( ) { } private void buildAttrMap ( String attrPath ) { } private String [ ] getAsmFileList ( ) { } private ArrayList < Integer > createAttrList ( String asmFile ) { } private String attrListToString ( ArrayList < Integer > attrList ) { } private void printArffMetaData ( PrintWriter pw ) { } public void create ( ) throws FileNotFoundException , UnsupportedEncodingException { PrintWriter pw = new PrintWriter ( outFilePath , "UTF-8" ) ; printArffMetaData ( pw ) ; for ( String asmFile : getAsmFileList ( ) ) { <START_BUG> ArrayList < Integer > attrList = createAttrList ( ( "//home//patrrand//machine-learning//output//" + asmFile ) ) ; <END_BUG> String arffRow = attrListToString ( attrList ) ; pw . println ( arffRow ) ; } pw . close ( ) ; } public static void main ( String [ ] args ) throws FileNotFoundException , UnsupportedEncodingException { } }

Fix:
ArrayList < Integer > attrList = createAttrList ( ( ( asmDirPath ) + asmFile ) ) ;
Buggy code:
public class TopicListParser extends Parser { private static final Pattern PATTERN_REPLY_TIME = Pattern . compile ( "•\\s*(.+?)(?:\\s+•|$)" ) ; public static List < Topic > parseDoc ( Document doc , Page page ) { if ( page instanceof Node ) { return TopicListParser . parseDocForNode ( doc , ( ( Node ) ( page ) ) ) ; } else <START_BUG> if ( ( page instanceof Tab ) || ( page == ( Page . PAGE_FAV_TOPIC ) ) ) { <END_BUG> return TopicListParser . parseDocForTab ( doc ) ; } else { throw new IllegalArgumentException ( ( "unknown<seq2seq4repair_space>page<seq2seq4repair_space>type:<seq2seq4repair_space>" + page ) ) ; } } private static List < Topic > parseDocForTab ( Document doc ) { } private static List < Topic > parseDocForNode ( Document doc , Node node ) { } private static Topic parseItemForTab ( Element item ) { } private static Topic parseItemForNode ( Element item , Node node ) { } private static void parseReplyCount ( Topic . Builder topicBuilder , Element ele ) { } private static void parseInfo ( Topic . Builder topicBuilder , Element ele , Node node ) { } static Node parseNode ( Element nodeEle ) { } private static void parseReplyTime ( Topic . Builder topicBuilder , TextNode textNode ) { } private static void parseTitle ( Topic . Builder topicBuilder , Element ele ) { } static void parseMember ( Topic . Builder builder , Element ele ) { } }

Fix:
if ( ( page instanceof Tab ) || ( PAGE_FAV_TOPIC . equals ( page ) ) ) {
Buggy code:
public class ManagementReadsTestCase { private static DomainTestSupport testSupport ; private static DomainLifecycleUtil domainMasterLifecycleUtil ; private static DomainLifecycleUtil domainSlaveLifecycleUtil ; @ BeforeClass public static void setupDomain ( ) throws Exception { <START_BUG> ManagementReadsTestCase . testSupport = new DomainTestSupport ( CoreResourceManagementTestCase . class . getSimpleName ( ) , "domain-configs//domain-standard.xml" , "host-configs//host-master.xml" , "host-configs//host-slave.xml" ) ; <END_BUG> ManagementReadsTestCase . testSupport . start ( ) ; ManagementReadsTestCase . domainMasterLifecycleUtil = ManagementReadsTestCase . testSupport . getDomainMasterLifecycleUtil ( ) ; ManagementReadsTestCase . domainSlaveLifecycleUtil = ManagementReadsTestCase . testSupport . getDomainSlaveLifecycleUtil ( ) ; } @ AfterClass public static void tearDownDomain ( ) throws Exception { } @ Test public void testDomainReadResource ( ) throws IOException { } @ Test public void testHostReadResource ( ) throws IOException { } @ Test public void testHostReadResourceViaSlave ( ) throws IOException { } @ Test public void testServerReadResource ( ) throws IOException { } @ Test public void testServerReadResourceViaSlave ( ) throws IOException { } @ Test @ Ignore ( "AS7-376" ) public void testReadResourceWildcards ( ) throws IOException { } @ Test public void testDomainReadResourceDescription ( ) throws IOException { } @ Test public void testHostReadResourceDescription ( ) throws IOException { } @ Test public void testServerReadResourceDescription ( ) throws IOException { } @ Test public void testDomainReadConfigAsXml ( ) throws IOException { } @ Test public void testHostReadConfigAsXml ( ) throws IOException { } @ Test public void testServerReadConfigAsXml ( ) throws IOException { } }

Fix:
ManagementReadsTestCase . testSupport = new DomainTestSupport ( ManagementReadsTestCase . class . getSimpleName ( ) , "domain-configs//domain-standard.xml" , "host-configs//host-master.xml" , "host-configs//host-slave.xml" ) ;
Buggy code:
public class Conversation implements Runnable { private static HashMap < String , Conversation > conversations = new HashMap < > ( ) ; public static final String MESSAGE_SENT = "Message<seq2seq4repair_space>sent." ; public static final String ADDRESSE_NOT_FOUND = "Addresee<seq2seq4repair_space>not<seq2seq4repair_space>found." ; public static final String SUCCESFULLY_LOGGED_IN = "Succesfully<seq2seq4repair_space>logged<seq2seq4repair_space>in." ; public static final String USERNAME_NOT_FOUND = "Username<seq2seq4repair_space>not<seq2seq4repair_space>found." ; public static final String SUCCESFULLY_LOGGED_OUT = "Succesfully<seq2seq4repair_space>logged<seq2seq4repair_space>out." ; public static final String ALREADY_LOGGED_IN = "User<seq2seq4repair_space>already<seq2seq4repair_space>logged." ; public static final String INVALID_STREAMS = "Streams<seq2seq4repair_space>not<seq2seq4repair_space>initialized." ; private PrintWriter out ; private BufferedReader in ; private Socket clientSocket ; private CommandInterpreter commandInterpreter ; private AtomicInteger messagesSent = new AtomicInteger ( 0 ) ; private String username ; private boolean logout = false ; public Conversation ( Socket clientSocket ) { } public boolean login ( String username ) { } public static Set < String > getUsers ( ) { } public boolean isLoggedIn ( ) { } public String sendMessage ( String destination , String message ) { } public String sendBroadcast ( String message ) { Collection < Conversation > addressees ; synchronized ( Conversation . conversations ) { addressees = Conversation . conversations . values ( ) ; } for ( Conversation addressee : addressees ) { <START_BUG> if ( addressee != ( this ) ) <END_BUG> addressee . out . println ( message ) ; } messagesSent . incrementAndGet ( ) ; return Conversation . MESSAGE_SENT ; } public int getNumberOfMessages ( ) { } public boolean logout ( ) { } public void setLogout ( boolean logout ) { } public void run ( ) { } private void close ( ) { } }

Fix:
if ( ( addressee != ( this ) ) && ( ( addressee . out ) != null ) )
Buggy code:
public class Ear extends Jar { private File deploymentDescriptor ; private boolean descriptorAdded ; public Ear ( ) { } public void setEarfile ( File earFile ) { } public void setAppxml ( File descr ) { } public void addArchives ( ZipFileSet fs ) { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { <START_BUG> if ( ( deploymentDescriptor ) == null ) { <END_BUG> throw new BuildException ( "appxml<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>required" , location ) ; } super . initZipOutputStream ( zOut ) ; } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } protected void cleanUp ( ) { } }

Fix:
if ( ( ( deploymentDescriptor ) == null ) && ( ! ( isInUpdateMode ( ) ) ) ) {
Buggy code:
public class ParameterizedMethodBinding extends MethodBinding { protected MethodBinding originalMethod ; public ParameterizedMethodBinding ( final ParameterizedTypeBinding parameterizedDeclaringClass , MethodBinding originalMethod ) { } public ParameterizedMethodBinding ( ) { } public char [ ] computeUniqueKey ( ) { } public static ParameterizedMethodBinding instantiateGetClass ( TypeBinding receiverType , MethodBinding originalMethod , Scope scope ) { ParameterizedMethodBinding method = new ParameterizedMethodBinding ( ) ; method . modifiers = originalMethod . modifiers ; method . selector = originalMethod . selector ; method . declaringClass = originalMethod . declaringClass ; method . typeVariables = NoTypeVariables ; method . originalMethod = originalMethod ; method . parameters = originalMethod . parameters ; method . thrownExceptions = originalMethod . thrownExceptions ; ReferenceBinding genericClassType = scope . getJavaLangClass ( ) ; <START_BUG> method . returnType = scope . createParameterizedType ( genericClassType , new TypeBinding [ ] { scope . environment ( ) . createWildcard ( genericClassType , 0 , receiverType . erasure ( ) , Wildcard . EXTENDS ) } , null ) ; <END_BUG> return method ; } public boolean hasSubstitutedParameters ( ) { } public boolean hasSubstitutedReturnType ( ) { } public MethodBinding original ( ) { } }

Fix:
method . returnType = scope . createParameterizedType ( genericClassType , new TypeBinding [ ] { scope . environment ( ) . createWildcard ( genericClassType , 0 , receiverType . erasure ( ) , null , Wildcard . EXTENDS ) } , null ) ;
Buggy code:
public class ValueReplacer { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; CompoundVariable masterFunction = new CompoundVariable ( ) ; Map variables = new HashMap ( ) ; public ValueReplacer ( ) { } public ValueReplacer ( TestPlan tp ) { } public void setUserDefinedVariables ( Map variables ) { } public void replaceValues ( TestElement el ) throws InvalidVariableException { } private void setProperties ( TestElement el , Collection newProps ) { } public void reverseReplace ( TestElement el ) throws InvalidVariableException { } public void undoReverseReplace ( TestElement el ) throws InvalidVariableException { } public void addVariable ( String name , String value ) { } public void addVariables ( Map vars ) { } private Collection replaceValues ( PropertyIterator iter , ValueTransformer transform ) throws InvalidVariableException { List props = new LinkedList ( ) ; while ( iter . hasNext ( ) ) { JMeterProperty val = iter . next ( ) ; if ( ValueReplacer . log . isDebugEnabled ( ) ) { ValueReplacer . log . debug ( ( ( ( "About<seq2seq4repair_space>to<seq2seq4repair_space>replace<seq2seq4repair_space>in<seq2seq4repair_space>property<seq2seq4repair_space>of<seq2seq4repair_space>tipe:<seq2seq4repair_space>" + ( val . getClass ( ) ) ) + ":<seq2seq4repair_space>" ) + val ) ) ; } if ( val instanceof StringProperty ) { <START_BUG> val = transform . transformValue ( ( ( StringProperty ) ( val ) ) ) ; <END_BUG> if ( ValueReplacer . log . isDebugEnabled ( ) ) { ValueReplacer . log . debug ( ( "Replacement<seq2seq4repair_space>result:<seq2seq4repair_space>" + val ) ) ; } } else if ( val instanceof MultiProperty ) { MultiProperty multiVal = ( ( MultiProperty ) ( val ) ) ; Collection newValues = replaceValues ( multiVal . iterator ( ) , transform ) ; multiVal . clear ( ) ; Iterator propIter = newValues . iterator ( ) ; while ( propIter . hasNext ( ) ) { multiVal . addProperty ( ( ( JMeterProperty ) ( propIter . next ( ) ) ) ) ; } if ( ValueReplacer . log . isDebugEnabled ( ) ) { ValueReplacer . log . debug ( ( "Replacement<seq2seq4repair_space>result:<seq2seq4repair_space>" + multiVal ) ) ; } } else { if ( ValueReplacer . log . isDebugEnabled ( ) ) { ValueReplacer . log . debug ( "Won't<seq2seq4repair_space>replace." ) ; } } props . add ( val ) ; } return props ; } public static class Test extends TestCase { TestPlan variables ; public Test ( String name ) { } public void setUp ( ) { } public void testReverseReplacement ( ) throws Exception { } public void testReplace ( ) throws Exception { } protected void tearDown ( ) throws Exception { } } }

Fix:
val = transform . transformValue ( val ) ;
Buggy code:
public class Unknown { public Vector < GPSPoint > pontos = new Vector < GPSPoint > ( ) ; public Timestamp enterTime ; public Timestamp leaveTime ; public int pk ; public String tableName ; private boolean isbuffer ; private int SRID ; public Unknown ( ) { } public Unknown ( boolean buffer , int s ) { } public boolean check ( long minTimeMilis ) { } public String saveUnknown ( int clusterId , int buffer ) { } public String toSQL ( double buffer ) { if ( ( pontos . size ( ) ) < 4 ) return "null" ; String ret = "ST_LineFromText('LINESTRING(" ; for ( int i = 0 ; i < ( pontos . size ( ) ) ; i ++ ) { ret += ( ( ( pontos . elementAt ( i ) . point . getX ( ) ) + "<seq2seq4repair_space>" ) + ( pontos . elementAt ( i ) . point . getY ( ) ) ) + "," ; } ret = ( ( ( ret . substring ( 0 , ( ( ret . length ( ) ) - 2 ) ) ) + ")'," ) + ( SRID ) ) + ")" ; if ( this . isbuffer ) { <START_BUG> ret = ( ( ( "ST_Multi(ST_Buffer(" + ret ) + "," ) + buffer ) + "))" ; <END_BUG> } return ret ; } public double avgSpeed ( ) { } public double avg ( boolean DB ) { } public void organizedPoints ( ) { } }

Fix:
ret = ( ( ( "ST_Multi(ST_Buffer(" + ret ) + "::geography," ) + buffer ) + ")::geometry)" ;
Buggy code:
public class IMAPTstFactory implements MailboxTstFactory { IMAPRootFolder cyrusRoot ; IMAPFolder inbox ; String namebase ; public IMAPTstFactory ( ) { } <START_BUG> public MessageFolder createFolder ( int folderId ) { <END_BUG> try { IMAPFolder folder = new IMAPFolder ( ( ( namebase ) + ( Integer . toString ( folderId ) ) ) , "IMAPFolder" , ( ( FolderTstHelper . homeDirectory ) + "//folders//" ) ) ; inbox . addSubfolder ( folder ) ; return folder ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; } }

Fix:
public AbstractMessageFolder createFolder ( int folderId ) {
Buggy code:
public final class MarkupStream { private MarkupElement current ; private int currentIndex = 0 ; private final Markup markup ; public MarkupStream ( final Markup markupFragment ) { } protected MarkupStream ( ) { } public boolean atCloseTag ( ) { } public boolean atOpenCloseTag ( ) { } public boolean atOpenCloseTag ( final String componentId ) { } public boolean atOpenTag ( ) { } public boolean atOpenTag ( final String id ) { } public boolean atTag ( ) { } public final Iterator componentTagIterator ( ) { } public boolean equalTo ( final MarkupStream that ) { } public final boolean equalMarkup ( final MarkupStream markupStream ) { } public final int findComponentIndex ( final String path , final String id ) { } public MarkupElement get ( ) { } public final Class getContainerClass ( ) { } public int getCurrentIndex ( ) { } public final String getEncoding ( ) { } public IResourceStream getResource ( ) { } public ComponentTag getTag ( ) { } public final String getWicketNamespace ( ) { } public String getXmlDeclaration ( ) { } public boolean hasMore ( ) { } public final boolean isMergedMarkup ( ) { } public MarkupElement next ( ) { } public void setCurrentIndex ( final int currentIndex ) { } public final void skipComponent ( ) { } public void skipRawMarkup ( ) { } public void skipUntil ( final String wicketTagName ) { } public void throwMarkupException ( final String message ) { } public String toHtmlDebugString ( ) { final StringBuffer buffer = new StringBuffer ( ) ; for ( int i = 0 ; i < ( markup . size ( ) ) ; i ++ ) { if ( i == ( currentIndex ) ) { buffer . append ( "<font<seq2seq4repair_space>color<seq2seq4repair_space>=<seq2seq4repair_space>\"red\">" ) ; } final MarkupElement element = markup . get ( i ) ; <START_BUG> buffer . append ( Strings . escapeMarkup ( element . toString ( ) , true ) ) ; <END_BUG> if ( i == ( currentIndex ) ) { buffer . append ( "<//font>" ) ; } } return buffer . toString ( ) ; } public String toString ( ) { } private MarkupElement get ( final int index ) { } private void skipToMatchingCloseTag ( final ComponentTag openTag ) { } }

Fix:
buffer . append ( Strings . escapeMarkup ( element . toString ( ) , true ) . toString ( ) ) ;
Buggy code:
public final class AutoComponentResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; <START_BUG> private final Map nestedComponents = new HashMap ( ) ; <END_BUG> public final boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag instanceof WicketTag ) { final WicketTag wicketTag = ( ( WicketTag ) ( tag ) ) ; if ( wicketTag . isComponentTag ( ) ) { final Component component = createComponent ( container , wicketTag ) ; if ( component != null ) { nestedComponents . put ( component , null ) ; try { container . autoAdd ( component ) ; } finally { nestedComponents . remove ( component ) ; } return true ; } } } if ( ( ( tag . getId ( ) ) != null ) && ( nestedComponents . containsKey ( container ) ) ) { MarkupContainer parent = container . getParent ( ) ; while ( ( parent != null ) && ( nestedComponents . containsKey ( parent ) ) ) { parent = parent . getParent ( ) ; } if ( parent != null ) { final Component component = parent . get ( tag . getId ( ) ) ; if ( component != null ) { component . render ( markupStream ) ; return true ; } } } return false ; } private final Component createComponent ( final MarkupContainer container , final WicketTag tag ) { } }

Fix:
private final Map < Component , Object > nestedComponents = new HashMap < Component , Object > ( ) ;
Buggy code:
public class KeepMissionsDecision extends Decision { public final Set < Mission > missions ; public KeepMissionsDecision ( int player , Set < Mission > missions ) { } @ Override public String toString ( ) { } @ Override public boolean equals ( Object o ) { } private static final int classHashCode = "KeepMissionsDecision" . hashCode ( ) ; @ Override public int hashCode ( ) { } public static Set < Decision > availableTo ( State s , PlayerState ps , Set < Decision > ds ) { } @ Override public String reasonForIllegality ( State s ) { } @ Override public KeepMissionsDecision . AppliedDecision apply ( State s , boolean undoably ) { } public class AppliedDecision extends hobo . AppliedDecision { public Set < Mission > drawn_missions = null ; public AppliedDecision ( Decision d , State s ) { } @ Override public void undo ( ) { state . unswitchTurns ( ) ; PlayerState p = state . playerState ( player ) ; <START_BUG> p . unreceiveMissions ( drawn_missions ) ; <END_BUG> state . missions . removeAll ( drawn_missions ) ; p . drawn_missions = drawn_missions ; super . undo ( ) ; } @ Override public String toString ( ) { } } }

Fix:
p . unreceiveMissions ( missions ) ;
Buggy code:
public class ListFragment extends Fragment { private ListView listView ; private PokemonListAdapter pokemonListAdapter ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } private ArrayList < PokemonModel > getData ( ) { final ArrayList < PokemonModel > pokemonItems = new ArrayList < > ( ) ; String [ ] images = getResources ( ) . getStringArray ( image_ids ) ; for ( int i = 0 ; i < ( images . length ) ; i ++ ) { <START_BUG> pokemonItems . add ( new PokemonModel ( ( i + 1 ) , "pokemonName" , "type" , "https:////s3-eu-west-1.amazonaws.com//calpaterson-pokemon//1.jpeg" ) ) ; <END_BUG> } return pokemonItems ; } No newline ; at end ; of file ; }

Fix:
pokemonItems . add ( new PokemonModel ( ( i + 1 ) , "pokemonName" , "type" , "http:////s3-eu-west-1.amazonaws.com//calpaterson-pokemon//1.jpeg" ) ) ;
Buggy code:
public class NumStepsWithoutImprovementStoppingCondition < T extends Individual > extends StoppingCondition < T > { public static final String P_NUM_STEPS_WITHOUT_IMPROVEMENT = "numStepsWithoutImprovement" ; public static final String P_FITNESS_COMPARATOR = "fitnessComparator" ; private final int numStepsAllowedWithoutImprovement ; private final FitnessComparator < T > fitnessComparator ; private T bestSoFar ; private int stepsPassedSinceLastImprovement ; public NumStepsWithoutImprovementStoppingCondition ( final Parameters parameters , final String base ) { } @ Override public final void reset ( ) { } @ Override public boolean stop ( List < T > population , int step ) { } @ Override public final boolean repOK ( ) { <START_BUG> return ( ( ( ( ( ( ( ( NumStepsWithoutImprovementStoppingCondition . P_FITNESS_COMPARATOR ) != null ) && ( ! ( NumStepsWithoutImprovementStoppingCondition . P_FITNESS_COMPARATOR . isEmpty ( ) ) ) ) && ( ( NumStepsWithoutImprovementStoppingCondition . P_NUM_STEPS_WITHOUT_IMPROVEMENT ) != null ) ) && ( ! ( NumStepsWithoutImprovementStoppingCondition . P_NUM_STEPS_WITHOUT_IMPROVEMENT . isEmpty ( ) ) ) ) && ( ( numStepsAllowedWithoutImprovement ) >= 0 ) ) && ( ( fitnessComparator ) != null ) ) && ( ( stepsPassedSinceLastImprovement ) >= 0 ) ) && ( ( stepsPassedSinceLastImprovement ) <= ( numStepsAllowedWithoutImprovement ) ) ; <END_BUG> } @ Override public boolean equals ( final Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
return ( ( ( ( ( ( ( ( NumStepsWithoutImprovementStoppingCondition . P_FITNESS_COMPARATOR ) != null ) && ( ! ( NumStepsWithoutImprovementStoppingCondition . P_FITNESS_COMPARATOR . isEmpty ( ) ) ) ) && ( ( NumStepsWithoutImprovementStoppingCondition . P_NUM_STEPS_WITHOUT_IMPROVEMENT ) != null ) ) && ( ! ( NumStepsWithoutImprovementStoppingCondition . P_NUM_STEPS_WITHOUT_IMPROVEMENT . isEmpty ( ) ) ) ) && ( ( numStepsAllowedWithoutImprovement ) >= 0 ) ) && ( ( fitnessComparator ) != null ) ) && ( ( stepsPassedSinceLastImprovement ) >= 0 ) ) && ( ( stepsPassedSinceLastImprovement ) <= ( ( numStepsAllowedWithoutImprovement ) + 1 ) ) ;
Buggy code:
public class ExecuteWatchdogTest extends TestCase { private static final int TIME_OUT = 5000 ; private static final String TEST_CLASSPATH = ExecuteWatchdogTest . getTestClassPath ( ) ; private static final int CLOCK_ERROR = 200 ; private static final int TIME_OUT_TEST = ( ExecuteWatchdogTest . TIME_OUT ) - ( ExecuteWatchdogTest . CLOCK_ERROR ) ; private ExecuteWatchdog watchdog ; public ExecuteWatchdogTest ( String name ) { } protected void setUp ( ) { } private static String getTestClassPath ( ) { } private Process getProcess ( int timetorun ) throws Exception { <START_BUG> String [ ] cmdArray = new String [ ] { "java" , "-classpath" , ExecuteWatchdogTest . TEST_CLASSPATH , TimeProcess . class . getName ( ) , String . valueOf ( timetorun ) } ; <END_BUG> return Runtime . getRuntime ( ) . exec ( cmdArray ) ; } private String getErrorOutput ( Process p ) throws Exception { } private int waitForEnd ( Process p ) throws Exception { } public void testNoTimeOut ( ) throws Exception { } public void testTimeOut ( ) throws Exception { } public void testFailed ( ) throws Exception { } public void testManualStop ( ) throws Exception { } }

Fix:
String [ ] cmdArray = new String [ ] { JavaEnvUtils . getJdkExecutable ( "java" ) , "-classpath" , ExecuteWatchdogTest . TEST_CLASSPATH , TimeProcess . class . getName ( ) , String . valueOf ( timetorun ) } ;
Buggy code:
public class JSONPTransportFilter implements PerRequestBroadcastFilter { @ Override public BroadcastAction filter ( HttpServletRequest request , HttpServletResponse response , Object message ) { String s = request . getParameter ( JSONP_CALLBACK_NAME ) ; if ( s != null ) { String contentType = response . getContentType ( ) ; if ( contentType == null ) { contentType = ( ( String ) ( request . getAttribute ( EXPECTED_CONTENT_TYPE ) ) ) ; } <START_BUG> if ( ( contentType == null ) || ( ! ( contentType . contains ( "json" ) ) ) ) { <END_BUG> String jsonPMessage = ( ( s + "({\"message\"<seq2seq4repair_space>:<seq2seq4repair_space>\"" ) + message ) + "\"})" ; return new BroadcastAction ( jsonPMessage ) ; } else { String jsonPMessage = ( ( s + "({\"message\"<seq2seq4repair_space>:" ) + message ) + "})" ; return new BroadcastAction ( jsonPMessage ) ; } } return new BroadcastAction ( message ) ; } @ Override public BroadcastAction filter ( Object originalMessage , Object message ) { } }

Fix:
if ( ( contentType != null ) && ( ! ( contentType . contains ( "json" ) ) ) ) {
Buggy code:
public class Network { private ArrayList < ArrayList < Neuron > > layers ; private int maxWeight ; private Random generator ; public Network ( ) { } public Network ( int maxWeight ) { } public Network ( Network n ) { } private void copyNeuronLinksToLayer ( Neuron active , Neuron old , int layer ) { } public void addLayer ( ) { } public void addLayer ( ArrayList < Neuron > layer ) { } public ArrayList < Neuron > getLayer ( int layer ) { } public ArrayList < ArrayList < Neuron > > getLayers ( ) { } public void addNeuron ( int layer , Neuron n ) { } public void input ( ArrayList < Integer > input ) throws InvalidInputLayerException { ArrayList < Neuron > inputLayer = layers . get ( ( ( layers . size ( ) ) - 1 ) ) ; for ( int i = 0 ; i < ( inputLayer . size ( ) ) ; i ++ ) { if ( inputLayer . get ( i ) . getClass ( ) . equals ( ConstantInput . class ) ) { ( ( ConstantInput ) ( inputLayer . get ( i ) ) ) . setValue ( input . get ( i ) ) ; } else { throw new InvalidInputLayerException ( "" ) ; } } <START_BUG> for ( int i = ( layers . size ( ) ) - 2 ; i > 0 ; -- i ) { <END_BUG> for ( int j = 0 ; j < ( layers . get ( i ) . size ( ) ) ; ++ j ) { layers . get ( i ) . get ( j ) . setValue ( ) ; } } } public int output ( int node ) throws InvalidInputLayerException { } }

Fix:
for ( int i = ( layers . size ( ) ) - 2 ; i >= 0 ; -- i ) {
Buggy code:
public class CreatePackageDeclarationOperation extends CreateElementInCUOperation { protected String name = null ; public CreatePackageDeclarationOperation ( String name , ICompilationUnit parentElement ) { } protected StructuralPropertyDescriptor getChildPropertyDescriptor ( ASTNode parent ) { } protected ASTNode generateElementAST ( ASTRewrite rewriter , IDocument document , ICompilationUnit cu ) throws JavaModelException { IJavaElement [ ] children = getCompilationUnit ( ) . getChildren ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { if ( ( ( children [ i ] . getElementType ( ) ) == ( IJavaElement . PACKAGE_DECLARATION ) ) && ( this . name . equals ( children [ i ] . getElementName ( ) ) ) ) { this . creationOccurred = false ; return null ; } } AST ast = this . cuAST . getAST ( ) ; PackageDeclaration pkgDeclaration = ast . newPackageDeclaration ( ) ; <START_BUG> Name astName = ast . newName ( new String [ ] { this . name } ) ; <END_BUG> pkgDeclaration . setName ( astName ) ; return pkgDeclaration ; } protected IJavaElement generateResultHandle ( ) { } public String getMainTaskName ( ) { } protected void initializeDefaultPosition ( ) { } public IJavaModelStatus verify ( ) { } }

Fix:
Name astName = ast . newName ( this . name ) ;