nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PatternSet extends DataType { private Vector includeList = new Vector ( ) ; private Vector excludeList = new Vector ( ) ; private Vector includesFileList = new Vector ( ) ; private Vector excludesFileList = new Vector ( ) ; public class NameEntry { private String name ; private String ifCond ; private String unlessCond ; public void setName ( String name ) { } public void setIf ( String cond ) { } public void setUnless ( String cond ) { } public String getName ( ) { } public String evalName ( Project p ) { } private boolean valid ( Project p ) { } public String toString ( ) { } } public PatternSet ( ) { } public void setRefid ( Reference r ) throws BuildException { } public PatternSet . NameEntry createInclude ( ) { } public PatternSet . NameEntry createIncludesFile ( ) { } public PatternSet . NameEntry createExclude ( ) { } public PatternSet . NameEntry createExcludesFile ( ) { } public void setIncludes ( String includes ) { } public void setExcludes ( String excludes ) { } private PatternSet . NameEntry addPatternToList ( Vector list ) { } public void setIncludesfile ( File includesFile ) throws BuildException { } public void setExcludesfile ( File excludesFile ) throws BuildException { } private void readPatterns ( File patternfile , Vector patternlist , Project p ) throws BuildException { BufferedReader patternReader = null ; try { patternReader = new BufferedReader ( new FileReader ( patternfile ) ) ; String line = patternReader . readLine ( ) ; while ( line != null ) { if ( ( line . length ( ) ) > 0 ) { <START_BUG> line = ProjectHelper . replaceProperties ( p , line ) ; <END_BUG> addPatternToList ( patternlist ) . setName ( line ) ; } line = patternReader . readLine ( ) ; } } catch ( IOException ioe ) { String msg = "An<seq2seq4repair_space>error<seq2seq4repair_space>occured<seq2seq4repair_space>while<seq2seq4repair_space>reading<seq2seq4repair_space>from<seq2seq4repair_space>pattern<seq2seq4repair_space>file:<seq2seq4repair_space>" + patternfile ; throw new BuildException ( msg , ioe ) ; } finally { if ( null != patternReader ) { try { patternReader . close ( ) ; } catch ( IOException ioe ) { } } } } public void append ( PatternSet other , Project p ) { } public String [ ] getIncludePatterns ( Project p ) { } public String [ ] getExcludePatterns ( Project p ) { } boolean hasPatterns ( ) { } private PatternSet getRef ( Project p ) { } private String [ ] makeArray ( Vector list , Project p ) { } private void readFiles ( Project p ) { } public String toString ( ) { } }

Fix:
line = p . replaceProperties ( line ) ;
Buggy code:
public class RPNCalc { private Stack < Double > operandStack ; public RPNCalc ( ) { } @ Override public String toString ( ) { } public void push ( double value ) { } public int getSize ( ) { } public double peek ( int n ) { } public double peek ( int n , double def ) { <START_BUG> if ( ( operandStack . size ( ) ) < n ) { <END_BUG> return def ; } return operandStack . get ( ( ( ( operandStack . size ( ) ) - n ) - 1 ) ) ; } public double pop ( double def ) { } public double pop ( ) { } public void performOperation ( char op ) { } }

Fix:
if ( ( n < 0 ) || ( ( operandStack . size ( ) ) <= n ) ) {
Buggy code:
public class SettingsActivity extends Activity implements View . OnClickListener { private Button mValidateButton ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onClick ( View v ) { if ( ( v . getId ( ) ) == ( id . settings_button_validate ) ) { EditText editText = ( ( EditText ) ( findViewById ( settings_Ball_Speed ) ) ) ; int ball_speed = Integer . valueOf ( editText . getText ( ) . toString ( ) ) ; <START_BUG> SharedPreferences sharedPreferences_ball_speed = PreferenceManager . getDefaultSharedPreferences ( getApplicationContext ( ) ) ; <END_BUG> SharedPreferences . Editor editor = sharedPreferences_ball_speed . edit ( ) ; editor . putInt ( "ball_speed" , ball_speed ) ; editor . commit ( ) ; this . finish ( ) ; } } }

Fix:
SharedPreferences sharedPreferences_ball_speed = PreferenceManager . getDefaultSharedPreferences ( this ) ;
Buggy code:
public class PlacementModelContainer extends NetworkImpl { private int nodes ; private int hotspots ; private Partitioner partitioner ; private PlacementModel hotspotPlacer ; private PlacementModel nodePlacer ; private NodeConnector connector ; private PlaneIdentifierSpaceSimple idSpace ; public PlacementModelContainer ( int nodes , int hotspots , PlacementModel hotspotPlacer , PlacementModel nodePlacer , Partitioner partitioner , NodeConnector nodeConnector , RoutingAlgorithm r , Transformation [ ] t ) { } private static String getKey ( PlacementModel hotspotPlacer , PlacementModel nodePlacer ) { } private static String [ ] getConfigValues ( PlacementModel hotspotPlacer , PlacementModel nodePlacer , NodeConnector connector , Partitioner partitioner ) { } private static String [ ] getConfigKeys ( PlacementModel hotspotPlacer , PlacementModel nodePlacer , NodeConnector connector , Partitioner partitioner ) { } @ Override public Graph generate ( ) { Point [ ] hotspotCoords = hotspotPlacer . place ( hotspots ) ; PlanePartitionSimple [ ] coords = new PlanePartitionSimple [ nodes ] ; int [ ] nodesPerSpot = partitioner . partition ( nodes , hotspots ) ; int temp = 0 ; int curNodes ; for ( int i = 0 ; i < ( hotspots ) ; i ++ ) { curNodes = nodesPerSpot [ i ] ; addNodeCoords ( coords , nodePlacer . place ( curNodes ) , hotspotCoords [ i ] , temp ) ; temp += curNodes ; } Graph g = new Graph ( description ( ) ) ; idSpace . setPartitions ( coords ) ; <START_BUG> g . addProperty ( "id_space_0" , idSpace ) ; <END_BUG> Node [ ] nodes = Node . init ( this . nodes ( ) , g ) ; connector . connect ( nodes , idSpace ) ; g . setNodes ( nodes ) ; return g ; } private void addNodeCoords ( PlanePartitionSimple [ ] pps , Point [ ] nodeCoords , Point coordOffset , int arrayOffset ) { } }

Fix:
g . addProperty ( "ID_SPACE_0" , idSpace ) ;
Buggy code:
public class DefaultMapperContext implements IMapperContext { public String getBookmarkableIdentifier ( ) { } public String getNamespace ( ) { } public String getPageIdentifier ( ) { } public String getResourceIdentifier ( ) { } public ResourceReferenceRegistry getResourceReferenceRegistry ( ) { } public RequestListenerInterface requestListenerInterfaceFromString ( final String interfaceName ) { } public String requestListenerInterfaceToString ( final RequestListenerInterface listenerInterface ) { } public IRequestablePage newPageInstance ( final Class < ? extends IRequestablePage > pageClass , final PageParameters pageParameters ) { } public IRequestablePage getPageInstance ( final int pageId ) { <START_BUG> IManageablePage manageablePage = Application . get ( ) . getPageManager ( ) . getPage ( pageId ) ; <END_BUG> IRequestablePage requestablePage = null ; if ( manageablePage instanceof IRequestablePage ) { requestablePage = ( ( IRequestablePage ) ( manageablePage ) ) ; } return requestablePage ; } public Class < ? extends IRequestablePage > getHomePageClass ( ) { } }

Fix:
IManageablePage manageablePage = Session . get ( ) . getPageManager ( ) . getPage ( pageId ) ;
Buggy code:
public class EvictionMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> PathAddress address = Operations . getPathAddress ( operation ) ; <END_BUG> String containerName = address . getElement ( ( ( address . size ( ) ) - 3 ) ) . getValue ( ) ; String cacheName = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; String name = Operations . getAttributeName ( operation ) ; EvictionMetric metric = EvictionMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { Cache < ? , ? > cache = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CACHE . getServiceName ( containerName , cacheName ) ) ; if ( cache != null ) { context . getResult ( ) . set ( metric . getValue ( cache ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
PathAddress address = context . getCurrentAddress ( ) ;
Buggy code:
public class StringWidget extends A_EditWidget { private boolean m_valueChangeHandlerInitialized ; @ Override public HandlerRegistration addValueChangeHandler ( ValueChangeHandler < String > handler ) { } @ Override public String getValue ( ) { } public I_EditWidget initWidget ( Element element ) { setElement ( element ) ; DOM . setEventListener ( getElement ( ) , this ) ; setPreviousValue ( getValue ( ) ) ; <START_BUG> getElement ( ) . setAttribute ( "contenteditable" , "true" ) ; <END_BUG> getElement ( ) . addClassName ( INSTANCE . form ( ) . input ( ) ) ; return this ; } public void setConfiguration ( String confuguration ) { } public void setValue ( String value ) { } public void setValue ( String value , boolean fireEvents ) { } }

Fix:
getElement ( ) . setAttribute ( "contentEditable" , "true" ) ;
Buggy code:
public class FilePictureGallery extends CustomFileList { protected static final int GALLERY_SIZE = 400 ; private static final int GALLERY_ITEM_PADDING = 10 ; protected ArrayList < CustomImageView > galleryImages ; protected LinearLayout galleriesLayout ; public FilePictureGallery ( Context context ) { } public FilePictureGallery ( Context context , FormInputDef attribute , String ref , boolean dynamic , boolean sync ) { } @ Override public void reset ( ) { } @ Override public List < ? > getValues ( ) { } @ Override public List < NameValuePair > getPairs ( ) { } @ Override public void populate ( List < NameValuePair > pairs ) { } public void populateImages ( List < Picture > pictures ) { } protected CustomImageView addGallery ( Picture picture ) { } protected void longSelectImage ( View v ) { } protected void setGalleryImage ( CustomImageView gallery , String path ) { } public Bitmap decodeFile ( File f , int WIDTH , int HIGHT ) { } public void addFile ( String value , String annotation , String certainty ) { } public void addFileView ( String filePath ) { } public void addFilePicture ( Picture picture , String annotation , String certainty ) { } public void removeGalleryItem ( CustomImageView view ) { } @ Override public void reload ( ) { } public void populateAndKeepPictureURL ( List < NameValuePair > oldPairs , List < NameValuePair > newPairs ) { if ( oldPairs == null ) return ; ArrayList < Picture > pictures = new ArrayList < Picture > ( ) ; for ( int i = 0 ; i < ( oldPairs . size ( ) ) ; i ++ ) { NameValuePair oldPair = oldPairs . get ( i ) ; NameValuePair newPair = newPairs . get ( i ) ; <START_BUG> Picture picture = new Picture ( newPair . getName ( ) , null , oldPair . getValue ( ) ) ; <END_BUG> pictures . add ( picture ) ; } populateImages ( pictures ) ; } public String getGalleryFileName ( CustomImageView gallery ) { } }

Fix:
Picture picture = new Picture ( newPair . getName ( ) , null , oldPair . getName ( ) ) ;
Buggy code:
public class Audit extends Row < AuditRowKey > { public static final String TABLE_NAME = "lumify_audit" ; public Audit ( RowKey rowKey ) { } public Audit ( String rowKey ) { } public Audit ( ) { } public AuditCommon getAuditCommon ( ) { } public AuditEntity getAuditEntity ( ) { } public AuditRelationship getAuditRelationship ( ) { } public AuditProperty getAuditProperty ( ) { } public JSONObject toJson ( ) { try { JSONObject json = new JSONObject ( ) ; json . put ( "data" , this . getAuditCommon ( ) . toJson ( ) ) ; String type = this . getAuditCommon ( ) . getType ( ) ; if ( type . equals ( TYPE_PROPERTY ) ) { json . put ( PROPERTY_AUDIT , this . getAuditProperty ( ) . toJson ( ) ) ; } else if ( type . equals ( TYPE_RELATIONSHIP ) ) { json . put ( RELATIONSHIP_AUDIT , this . getAuditRelationship ( ) . toJson ( ) ) ; } else { json . put ( ENTITY_AUDIT , this . getAuditEntity ( ) . toJson ( ) ) ; } String [ ] rowKey = RowKeyHelper . splitOnMinorFieldSeperator ( getRowKey ( ) . toString ( ) ) ; json . put ( "graphVertexID" , rowKey [ 0 ] ) ; <START_BUG> json . put ( "dateTime" , dateFormat . parse ( rowKey [ 1 ] ) . getTime ( ) ) ; <END_BUG> return json ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } }

Fix:
json . put ( "dateTime" , AuditRowKey . getDateFormat ( ) . parse ( rowKey [ 1 ] ) . getTime ( ) ) ;
Buggy code:
public class PackageFragmentRoot extends Openable implements IPackageFragmentRoot { protected IResource fResource ; protected PackageFragmentRoot ( IResource resource , IJavaProject project ) { } protected PackageFragmentRoot ( IResource resource , IJavaProject project , String path ) { } public void attachSource ( IPath zipPath , IPath rootPath , IProgressMonitor monitor ) throws JavaModelException { } protected boolean computeChildren ( OpenableElementInfo info ) throws JavaModelException { } protected void computeFolderChildren ( IContainer folder , String prefix , ArrayList vChildren , char [ ] [ ] exclusionPatterns ) throws JavaModelException { } protected OpenableElementInfo createElementInfo ( ) { } public IPackageFragment createPackageFragment ( String name , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected int determineKind ( IResource underlyingResource ) throws JavaModelException { } public boolean equals ( Object o ) { } public boolean exists ( ) { } char [ ] [ ] getExclusionPatterns ( ) { try { <START_BUG> return ( ( ClasspathEntry ) ( getRawClasspathEntry ( ) ) ) . charBasedExclusionPatterns ( ) ; <END_BUG> } catch ( JavaModelException e ) { return null ; } } protected boolean generateInfos ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } protected char getHandleMementoDelimiter ( ) { } public int getKind ( ) throws JavaModelException { } public Object [ ] getNonJavaResources ( ) throws JavaModelException { } public IPackageFragment getPackageFragment ( String packageName ) { } protected String getPackageName ( IFolder folder ) throws JavaModelException { } public IPath getPath ( ) { } public IClasspathEntry getRawClasspathEntry ( ) throws JavaModelException { } public IResource getResource ( ) { } public IPath getSourceAttachmentPath ( ) throws JavaModelException { } public IPath getSourceAttachmentRootPath ( ) throws JavaModelException { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isArchive ( ) { } public boolean isExternal ( ) { } protected boolean isOnClasspath ( ) { } protected void openWhenClosed ( IProgressMonitor pm ) throws JavaModelException { } public void refreshChildren ( ) { } public IJavaElement rootedAt ( IJavaProject project ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
return ( ( ClasspathEntry ) ( getRawClasspathEntry ( ) ) ) . fulExclusionPatternChars ( ) ;
Buggy code:
public class FieldReference extends Reference implements InvocationSite { public Expression receiver ; public char [ ] token ; public FieldBinding binding ; protected FieldBinding codegenBinding ; public MethodBinding [ ] syntheticAccessors ; public static final int READ = 0 ; public static final int WRITE = 1 ; public long nameSourcePosition ; public TypeBinding receiverType ; public TypeBinding genericCast ; public FieldReference ( char [ ] source , long pos ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { boolean nonStatic = ! ( binding . isStatic ( ) ) ; receiver . analyseCode ( currentScope , flowContext , flowInfo , nonStatic ) ; if ( nonStatic ) <START_BUG> receiver . checkNullStatus ( currentScope , flowInfo , FlowInfo . NON_NULL ) ; <END_BUG> if ( valueRequired ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo , true ) ; } return flowInfo ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { } public FieldBinding fieldBinding ( ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public static final Constant getConstantFor ( FieldBinding binding , Reference reference , boolean isImplicit , Scope referenceScope ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo , boolean isReadAccess ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int index ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
receiver . checkNullStatus ( currentScope , flowContext , flowInfo , FlowInfo . NON_NULL ) ;
Buggy code:
@ ParseClassName ( "Course" ) public class Course extends BaseParseObject implements Comparable < Course > { public static final String TAG_COURSE_NAME = "courseName" ; public static final String TAG_COURSE_TIME = "courseTime" ; public static final String TAG_DURATION = "duration" ; public String getCourseName ( ) { } public void setCourseName ( String courseName ) { } public int getDuration ( ) { } public void setDuration ( int duration ) { } public void setCourseTime ( Date time ) { } public void setDayOfWeek ( int dayOfWeek ) { } public void setCourseTime ( int hourOfDay , int minute ) { } public Date getTime ( ) { } public int getDayOfWeek ( ) { } public int getHourOfDay ( ) { } public int getMinute ( ) { } @ Override public int compareTo ( Course another ) { int dowDiff = ( getDayOfWeek ( ) ) - ( another . getDayOfWeek ( ) ) ; if ( dowDiff != 0 ) { return dowDiff ; } int hodDiff = ( getHourOfDay ( ) ) - ( another . getHourOfDay ( ) ) ; if ( hodDiff != 0 ) { return hodDiff ; } int minuteDiff = ( getMinute ( ) ) - ( another . getMinute ( ) ) ; if ( minuteDiff != 0 ) { return minuteDiff ; } <START_BUG> return getCreatedAt ( ) . compareTo ( another . getCreatedAt ( ) ) ; <END_BUG> } }

Fix:
return 0 ;
Buggy code:
public class IdentityMap < K , V > extends AbstractHashedMap < K , V > implements Serializable , Cloneable { private static final long serialVersionUID = 2028493495224302329L ; public IdentityMap ( ) { } public IdentityMap ( final int initialCapacity ) { } public IdentityMap ( final int initialCapacity , final float loadFactor ) { } public IdentityMap ( final Map < K , V > map ) { } @ Override protected int hash ( final Object key ) { } @ Override protected boolean isEqualKey ( final Object key1 , final Object key2 ) { } @ Override protected boolean isEqualValue ( final Object value1 , final Object value2 ) { } @ Override protected IdentityMap . IdentityEntry < K , V > createEntry ( final HashEntry < K , V > next , final int hashCode , final K key , final V value ) { } protected static class IdentityEntry < K , V > extends HashEntry < K , V > { protected IdentityEntry ( final HashEntry < K , V > next , final int hashCode , final K key , final V value ) { } @ Override public boolean equals ( final Object obj ) { if ( obj == ( this ) ) { return true ; } <START_BUG> if ( ( obj instanceof Map . Entry ) == false ) { <END_BUG> return false ; } final Map . Entry < ? , ? > other = ( ( Map . Entry < ? , ? > ) ( obj ) ) ; return ( ( IdentityMap . IdentityEntry . getKey ( ) ) == ( other . getKey ( ) ) ) && ( ( IdentityMap . IdentityEntry . getValue ( ) ) == ( other . getValue ( ) ) ) ; } @ Override public int hashCode ( ) { } } @ Override public IdentityMap < K , V > clone ( ) { } private void writeObject ( final ObjectOutputStream out ) throws IOException { } private void readObject ( final ObjectInputStream in ) throws IOException , ClassNotFoundException { } }

Fix:
if ( ! ( obj instanceof Entry ) ) {
Buggy code:
public class ClassfileSet extends FileSet { private Vector rootClasses = new Vector ( ) ; public static class ClassRoot { private String rootClass ; public void setClassname ( String name ) { } public String getClassname ( ) { } } public ClassfileSet ( ) { } protected ClassfileSet ( ClassfileSet s ) { } public void setRootClass ( String rootClass ) { } public DirectoryScanner getDirectoryScanner ( Project p ) { } public void addConfiguredRoot ( ClassfileSet . ClassRoot root ) { <START_BUG> rootClasses . add ( root . getClassname ( ) ) ; <END_BUG> } public Object clone ( ) { } }

Fix:
rootClasses . addElement ( root . getClassname ( ) ) ;
Buggy code:
public abstract class ListView extends WebMarkupContainer { private static Log log = LogFactory . getLog ( ListView . class ) ; private int firstIndex = 0 ; private boolean optimizeItemRemoval = false ; private int viewSize = Integer . MAX_VALUE ; public ListView ( final String id ) { } public ListView ( final String id , final IModel model ) { } public ListView ( final String id , final List list ) { } public final List getList ( ) { } public boolean getOptimizeItemRemoval ( ) { } public final int getStartIndex ( ) { } public int getViewSize ( ) { } public final Link moveDownLink ( final String id , final ListItem item ) { } public final Link moveUpLink ( final String id , final ListItem item ) { } public final Link removeLink ( final String id , final ListItem item ) { return new Link ( id ) { public void onClick ( ) { item . modelChanging ( ) ; getList ( ) . remove ( item . getModelObject ( ) ) ; <START_BUG> item . modelChanged ( ) ; <END_BUG> } } ; } public void setOptimizeItemRemoval ( boolean optimizeItemRemoval ) { } public ListView setStartIndex ( final int startIndex ) { } public ListView setViewSize ( final int size ) { } protected IModel getListItemModel ( final IModel listViewModel , final int index ) { } protected void internalOnBeginRequest ( ) { } protected ListItem newItem ( final int index ) { } protected void onBeginPopulateItem ( final ListItem item ) { } protected void onRender ( ) { } protected abstract void populateItem ( final ListItem item ) { } protected void renderItem ( final ListItem item ) { } }

Fix:
ListView . this . modelChanged ( ) ;
Buggy code:
public class LoopingFlowContext extends SwitchFlowContext { public Label continueLabel ; public UnconditionalFlowInfo initsOnContinue = FlowInfo . DEAD_END ; Reference [ ] finalAssignments ; VariableBinding [ ] finalVariables ; int assignCount = 0 ; Scope associatedScope ; public LoopingFlowContext ( FlowContext parent , AstNode associatedNode , Label breakLabel , Label continueLabel , Scope associatedScope ) { } public void complainOnFinalAssignmentsInLoop ( BlockScope scope , FlowInfo flowInfo ) { } public Label continueLabel ( ) { } public String individualToString ( ) { } public boolean isContinuable ( ) { } public boolean isContinuedTo ( ) { } public void recordContinueFrom ( FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; if ( ( initsOnContinue ) == ( FlowInfo . DEAD_END ) ) { initsOnContinue = flowInfo . copy ( ) . unconditionalInits ( ) ; } else { <START_BUG> initsOnContinue . mergedWith ( flowInfo . unconditionalInits ( ) ) ; <END_BUG> } } boolean recordFinalAssignment ( VariableBinding binding , Reference finalAssignment ) { } void removeFinalAssignmentIfAny ( Reference reference ) { } }

Fix:
initsOnContinue = initsOnContinue . mergedWith ( flowInfo . unconditionalInits ( ) ) ;
Buggy code:
public class GoAndClearFilter extends GoFilter { private static final long serialVersionUID = 1L ; protected static final IModel defaultClearModel = new Model ( "clear" ) ; private final Button clear ; private final Object originalState ; public GoAndClearFilter ( String id , FilterForm form ) { } public GoAndClearFilter ( String id , FilterForm form , IModel goModel , IModel clearModel ) { } protected Button getClearButton ( ) { } protected void onClearSubmit ( Button button ) { <START_BUG> button . getForm ( ) . setModelObject ( originalState ) ; <END_BUG> } }

Fix:
button . getForm ( ) . setModelObject ( Objects . clone ( originalState ) ) ;
Buggy code:
public class ConstructorDeclaration extends AbstractMethodDeclaration { public ExplicitConstructorCall constructorCall ; public static final char [ ] ConstantPoolName = "<init>" . toCharArray ( ) ; public boolean isDefaultConstructor = false ; public ConstructorDeclaration ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext initializerFlowContext , FlowInfo flowInfo ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } public void generateSyntheticFieldInitializationsIfNecessary ( MethodScope methodScope , CodeStream codeStream , ReferenceBinding declaringClass ) { } private void internalGenerateCode ( ClassScope classScope , ClassFile classFile ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public boolean isInitializationMethod ( ) { } public boolean isRecursive ( ArrayList visited ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public void resolveAnnotation ( ) { if ( ( ( this . binding ) == null ) || ( ( this . annotation ) != null ) ) { super . resolveAnnotation ( ) ; return ; } if ( ( ! ( isDefaultConstructor ) ) && ( ( ( this . binding . modifiers ) & ( AccPublic ) ) != 0 ) ) { <START_BUG> this . scope . problemReporter ( ) . annotationMissingForPublic ( this . sourceStart , ( ( ( this . sourceStart ) + ( this . selector . length ) ) - 1 ) , true ) ; <END_BUG> } } public void resolveStatements ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , ClassScope classScope ) { } }

Fix:
this . scope . problemReporter ( ) . annotationMissingForPublic ( this . sourceStart , this . sourceEnd ) ;
Buggy code:
@ WebServlet ( name = "AddDiscussionPost" , urlPatterns = { "//AddDiscussionPost" } ) public class AddDiscussionPost extends HttpServlet { protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String author = ( ( String ) ( request . getParameter ( "author" ) ) ) ; String comment = ( ( String ) ( request . getParameter ( "comment" ) ) ) ; try { String dataDirectory = System . getenv ( "OPENSHIFT_DATA_DIR" ) ; String where = ( dataDirectory != null ) ? dataDirectory + "posts.txt" : "posts.txt" ; File dir = new File ( where ) ; if ( ! ( dir . exists ( ) ) ) { dir . createNewFile ( ) ; } <START_BUG> FileWriter fstream = new FileWriter ( dir ) ; <END_BUG> BufferedWriter out = new BufferedWriter ( fstream ) ; out . write ( ( ( author + ":" ) + comment ) ) ; out . newLine ( ) ; out . close ( ) ; System . out . println ( ( ( ( "Post<seq2seq4repair_space>Added<seq2seq4repair_space>" + author ) + "<seq2seq4repair_space>" ) + comment ) ) ; } catch ( Exception e ) { System . out . println ( "#######################################" ) ; System . out . println ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>adding<seq2seq4repair_space>discussion<seq2seq4repair_space>post" ) ; System . out . println ( e . getMessage ( ) ) ; System . out . println ( "#######################################" ) ; } request . getRequestDispatcher ( "LoadPosts" ) . forward ( request , response ) ; } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override public String getServletInfo ( ) { } }

Fix:
FileWriter fstream = new FileWriter ( dir , true ) ;
Buggy code:
public class GroupingHandlerAdd implements OperationStepHandler , DescriptionProvider { public static final GroupingHandlerAdd INSTANCE = new GroupingHandlerAdd ( ) ; private GroupingHandlerAdd ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { } static void addGroupingHandlerConfig ( final OperationContext context , final Configuration configuration , final ModelNode model ) throws OperationFailedException { if ( model . hasDefined ( GROUPING_HANDLER ) ) { <START_BUG> Property prop = model . get ( BROADCAST_GROUP ) . asProperty ( ) ; <END_BUG> configuration . setGroupingHandlerConfiguration ( GroupingHandlerAdd . createGroupingHandlerConfiguration ( context , prop . getName ( ) , prop . getValue ( ) ) ) ; } } static GroupingHandlerConfiguration createGroupingHandlerConfiguration ( final OperationContext context , final String name , final ModelNode model ) throws OperationFailedException { } }

Fix:
Property prop = model . get ( GROUPING_HANDLER ) . asProperty ( ) ;
Buggy code:
@ Service public class UserSignInAdapter implements SignInAdapter { @ Inject ChallengerUserDetailsService userDetailsService ; @ Override public String signIn ( String userId , Connection < ? > connection , NativeWebRequest request ) { UserDetails userDetail = userDetailsService . loadUserById ( userId ) ; Authentication auth = new org . springframework . security . authentication . UsernamePasswordAuthenticationToken ( userDetail , null , userDetail . getAuthorities ( ) ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( auth ) ; <START_BUG> return "welcome" ; <END_BUG> } }

Fix:
return "//welcome" ;
Buggy code:
public class ConnectionTools extends Thread { private UserDao userDao ; private static final String SCRIPT_PATH = Cfg . inst ( ) . getProp ( MAIN_CONFIG , SCENARIO_RESOURCES_PATH ) ; private static final Logger LOGGER = org . slf4j . LoggerFactory . getLogger ( ConnectionTools . class ) ; private static final String dummyUser = "DEBUG_USER" ; private static final String STATS_DIR = "miscellaneous" ; private static final String SUB_DIR = "0" ; private static final SimpleDateFormat timeFormat = new SimpleDateFormat ( "HH:mm:ss" ) ; private static final SimpleDateFormat dateFormat = new SimpleDateFormat ( "dd.MM.yyyy" ) ; private static final SimpleDateFormat dateFileSession = new SimpleDateFormat ( "yyyy_MM_dd" ) ; private static final SimpleDateFormat dateFileExecuter = new SimpleDateFormat ( "yyyy_MM_dd-HH" ) ; private String executerStatsFile ; private String sessionStatsFile ; private String oldvalue = "" ; private static ConnectionTools instance ; private Thread currentThread ; public static ConnectionTools inst ( ) { } private ConnectionTools ( ) { } @ Override public void run ( ) { } private void initStatsLog ( ) { } private synchronized void logExecuterStats ( String string ) { } private synchronized void logSessionStats ( String string ) { } private String hashMapToOutput ( Map < Date , String > map ) { } public void cleanUp ( ) { } public void addSomeTestStudents ( ) { final ScenarioDao scenarioDao = new ScenarioDao ( ) ; final ExerciseGroupDao groupDao = new ExerciseGroupDao ( ) ; final ExerciseDao exerciseDao = new ExerciseDao ( ) ; final List < Scenario > scenarios = scenarioDao . findAll ( ) ; for ( int i = 0 ; i < 20 ; i ++ ) { String userID = "student_" + ( new Random ( ) . nextInt ( 10000 ) ) ; User userToInsert = new User ( ) ; userToInsert . setId ( userID ) ; userToInsert . setIsAdmin ( false ) ; if ( ( userDao . getById ( userID ) ) == null ) { userDao . insertNewInstance ( userToInsert ) ; } } final Random random = new Random ( ) ; for ( Scenario scenario : scenarios ) { for ( ExerciseGroup group : groupDao . findByScenario ( scenario ) ) { if ( group . getIsRated ( ) ) { List < Exercise > exercises = exerciseDao . findByExGroup ( group ) ; for ( Exercise exercise : exercises ) { <START_BUG> for ( int i = 0 ; i < ( random . nextInt ( 10 ) ) ; i ++ ) { <END_BUG> User user = userDao . getRandom ( ) ; if ( ! ( user . getId ( ) . equals ( ConnectionTools . dummyUser ) ) ) { try { List < SolutionQuery > solutions = new ExerciseDao ( ) . getSolutions ( exercise ) ; String solution = solutions . get ( 0 ) . getQuery ( ) ; if ( ( random . nextInt ( 3 ) ) == 2 ) { solution = StringTools . forgetOneWord ( solution ) ; } ConnectionManager . instance ( ) ; ExerciseController exc = new ExerciseController ( ) . init_debug ( scenario , exercise , user ) ; exc . setUserString ( solution ) ; } catch ( Exception e ) { } finally { } } } } } } } } public void addSomeTestData ( ) { } }

Fix:
for ( int i = 0 ; i < ( random . nextInt ( 20 ) ) ; i ++ ) {
Buggy code:
public class OpenSessionInViewFilter extends OncePerRequestFilter { public static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory" ; private String sessionFactoryBeanName = OpenSessionInViewFilter . DEFAULT_SESSION_FACTORY_BEAN_NAME ; public void setSessionFactoryBeanName ( String sessionFactoryBeanName ) { } protected String getSessionFactoryBeanName ( ) { } @ Override protected boolean shouldNotFilterAsyncDispatch ( ) { } @ Override protected boolean shouldNotFilterErrorDispatch ( ) { } @ Override protected void doFilterInternal ( HttpServletRequest request , HttpServletResponse response , FilterChain filterChain ) throws IOException , ServletException { } protected SessionFactory lookupSessionFactory ( HttpServletRequest request ) { } protected SessionFactory lookupSessionFactory ( ) { } protected Session openSession ( SessionFactory sessionFactory ) throws DataAccessResourceFailureException { try { <START_BUG> Session session = SessionFactoryUtils . openSession ( sessionFactory ) ; <END_BUG> session . setFlushMode ( MANUAL ) ; return session ; } catch ( HibernateException ex ) { throw new DataAccessResourceFailureException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>open<seq2seq4repair_space>Hibernate<seq2seq4repair_space>Session" , ex ) ; } } private boolean applySessionBindingInterceptor ( WebAsyncManager asyncManager , String key ) { } private static class SessionBindingCallableInterceptor extends CallableProcessingInterceptorAdapter { private final SessionFactory sessionFactory ; private final SessionHolder sessionHolder ; public SessionBindingCallableInterceptor ( SessionFactory sessionFactory , SessionHolder sessionHolder ) { } @ Override public < T > void preProcess ( NativeWebRequest request , Callable < T > task ) { } @ Override public < T > void postProcess ( NativeWebRequest request , Callable < T > task , Object concurrentResult ) { } private void initializeThread ( ) { } } }

Fix:
Session session = sessionFactory . openSession ( ) ;
Buggy code:
public class TestASCIIFoldingFilter extends BaseTokenStreamTestCase { public void testLatin1Accents ( ) throws Exception { } public void testAllFoldings ( ) throws Exception { } void assertTermEquals ( String expected , TokenStream stream , CharTermAttribute termAtt ) throws Exception { } public void testRandomStrings ( ) throws Exception { Analyzer a = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { Tokenizer tokenizer = new MockTokenizer ( reader , MockTokenizer . WHITESPACE , false ) ; return new TokenStreamComponents ( tokenizer , new ASCIIFoldingFilter ( tokenizer ) ) ; } } ; <START_BUG> checkRandomData ( random ( ) , a , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , a , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class SmokeSuiteTwo extends AbstractTest { @ Test public void GooglePlusFlow ( ) { CustomHooks . dismissPotHoleError ( ) ; SignInPage . clicksignInGooglePlusSignIn ( ) ; CustomHooks . dismissMultiLoginMessage ( ) ; LandingPage . clicktabTitleStores ( ) ; StoresPage . clickStoresPageNameAndKickInformation ( ) ; CustomHooks . waitFor ( 10 ) ; ToolTipsPage . clickToolTipCloseButton ( ) ; driver . scrollTo ( "Trending<seq2seq4repair_space>on<seq2seq4repair_space>shopkick" ) ; StoresPage . clickStoresPageOfferCellLeft ( ) ; RelatedOfferPage . clickRelatedOfferSaveOffer ( ) ; CustomHooks . pressBack ( ) ; CustomHooks . pressBack ( ) ; LandingPage . clicktabTitleDeals ( ) ; CustomHooks . waitFor ( 3 ) ; driver . scrollTo ( "Michaels" ) ; DealsPage . clickDealsPageMichales ( ) ; DealAggregationPage . clickOnDealTile ( ) ; <START_BUG> if ( ! ( driver . findElement ( By . name ( "SAVE" ) ) . isDisplayed ( ) ) ) { <END_BUG> DealDetailpage . clickOnSaveDeal ( ) ; } else { DealDetailpage . unSaveDeal ( ) ; } CustomHooks . pressBack ( ) ; CustomHooks . pressBack ( ) ; LandingPage . clicktabTitleProducts ( ) ; ProductsPage . clickProductsPageLookbookCover ( ) ; LookbookPage . clickLookbookPageLookbookOfferSaveHeart ( ) ; CustomHooks . pressBack ( ) ; ProductsPage . clickProductsPageMySaves ( ) ; MySavesPage . clickMySavesANYOfferTile ( ) ; OfferPage . clickOfferPageOfferSaveButton ( ) ; CustomHooks . pressBack ( ) ; CustomHooks . pressBack ( ) ; CustomHooks . pressBack ( ) ; LandingPage . openLeftNavSignedIn ( ) ; driver . scrollTo ( "Settings" ) ; LeftNavBar . clickOnSettingsLeftNav ( ) ; LeftNavSettings . clicksettingsAccountSettings ( ) ; AccountSettings . clickAccountSettingsLogOut ( ) ; } @ After public void teardown ( ) { } }

Fix:
if ( driver . findElement ( By . name ( "SAVE" ) ) . isDisplayed ( ) ) {
Buggy code:
public enum UnitType { Peasant ( 10 ) , Infantry ( 20 ) , Soldier ( 30 ) , Knight ( 40 ) , Cannon ( 35 ) ; private int cost ; private UnitType ( int cost ) { } public int getCost ( ) { } public int getCostFrom ( UnitType type ) { } public boolean canInvadeBy ( UnitType type ) { } public boolean canGoNear ( UnitType type ) { if ( type . equals ( UnitType . Cannon ) ) return true ; <START_BUG> return ( ( type . ordinal ( ) ) - ( this . ordinal ( ) ) ) > 0 ; <END_BUG> } public int getSalary ( ) { } }

Fix:
return ( ( type . ordinal ( ) ) - ( this . ordinal ( ) ) ) < 0 ;
Buggy code:
class ConnectionTask implements Task { private static final long MAX_CONNECT_TIME = 75000 ; private final WebSocketClientFactory _factory ; private final SparseArray < Connection > _map ; public ConnectionTask ( WebSocketClientFactory factory , SparseArray < Connection > map ) { } private static URI complementPort ( String url ) throws URISyntaxException { } private static void setCookie ( Map < String , String > cookies , String url ) { } @ Override public void execute ( JSONArray args , CallbackContext ctx ) { try { WebSocketClient client = _factory . newWebSocketClient ( ) ; int id = args . getInt ( 0 ) ; String url = args . getString ( 1 ) ; String protocol = args . getString ( 2 ) ; JSONObject options = args . getJSONObject ( 3 ) ; String origin = options . optString ( "origin" , "" ) ; long maxConnectTime = options . optLong ( "maxConnectTime" , ConnectionTask . MAX_CONNECT_TIME ) ; URI uri = ConnectionTask . complementPort ( url ) ; if ( ( protocol . length ( ) ) > 0 ) { client . setProtocol ( protocol ) ; } if ( ( origin . length ( ) ) > 0 ) { client . setOrigin ( origin ) ; } <START_BUG> client . setMaxTextMessageSize ( ( - 1 ) ) ; <END_BUG> client . setMaxBinaryMessageSize ( ( - 1 ) ) ; ConnectionTask . setCookie ( client . getCookies ( ) , uri . getHost ( ) ) ; WebSocketGenerator gen = new WebSocketGenerator ( id , ctx ) ; gen . setOnOpenListener ( new OnOpenListener ( ) { @ Override public void onOpen ( int id , Connection conn ) { _map . put ( id , conn ) ; } } ) ; gen . setOnCloseListener ( new OnCloseListener ( ) { @ Override public void onClose ( int id ) { if ( ( _map . indexOfKey ( id ) ) >= 0 ) { _map . remove ( id ) ; } } } ) ; client . open ( uri , gen , maxConnectTime , TimeUnit . MILLISECONDS ) ; } catch ( Exception e ) { if ( ! ( ctx . isFinished ( ) ) ) { PluginResult result = new PluginResult ( Status . ERROR ) ; result . setKeepCallback ( true ) ; ctx . sendPluginResult ( result ) ; } } } }

Fix:
client . setMaxTextMessageSize ( Integer . MAX_VALUE ) ;
Buggy code:
@ Component public class DirectoryWatcherDao { private static final Logger LOGGER = LoggerFactory . getLogger ( DirectoryWatcherDao . class ) ; private final ApplicationEventPublisher applicationEventPublisher ; @ Inject public DirectoryWatcherDao ( final ApplicationEventPublisher applicationEventPublisher ) { } @ Async @ SuppressWarnings ( "SameParameterValue" ) public void watch ( String baseDir ) throws IOException { } private void register ( Path dir , WatchService watchService ) throws IOException { } private void registerAll ( Path start , final WatchService watchService ) throws IOException { } private boolean isIgnoredPath ( String dir ) { <START_BUG> return ! ( dir . startsWith ( "." ) ) ; <END_BUG> } private void processWatchEvents ( Path parent , List < WatchEvent < ? > > events , WatchService watchService ) throws IOException { } private DirectoryWatcherDao . FilesystemChangeEvent . Type watchEventKindToType ( WatchEvent . Kind < ? > kind ) { } public static class FilesystemChangeEvent extends ApplicationEvent { private final String target ; private final DirectoryWatcherDao . FilesystemChangeEvent . Type type ; public FilesystemChangeEvent ( Object source , String target , DirectoryWatcherDao . FilesystemChangeEvent . Type type ) { } public String getTarget ( ) { } public DirectoryWatcherDao . FilesystemChangeEvent . Type getType ( ) { } @ Override public String toString ( ) { } public static enum Type { CREATE , DELETE , MODIFY ; } } }

Fix:
return dir . startsWith ( "." ) ;
Buggy code:
public class PatternFilter extends ViewerFilter { private Map cache = new HashMap ( ) ; private StringMatcher matcher ; public Object [ ] filter ( Viewer viewer , Object parent , Object [ ] elements ) { } public boolean select ( Viewer viewer , Object parentElement , Object element ) { } public void setPattern ( String patternString ) { cache . clear ( ) ; if ( ( patternString == null ) || ( patternString . equals ( "" ) ) ) matcher = null ; else <START_BUG> matcher = new StringMatcher ( ( patternString + "*" ) , true , false ) ; <END_BUG> } protected boolean match ( String string ) { } }

Fix:
matcher = new StringMatcher ( ( ( "*" + patternString ) + "*" ) , true , false ) ;
Buggy code:
public class URLController implements ActionListener { private String address ; private URL link ; public JPopupMenu createContactMenu ( String contact ) { } public JPopupMenu createLinkMenu ( ) { } public void setAddress ( String s ) { } public String getAddress ( ) { } public URL getLink ( ) { } public void setLink ( URL u ) { } public void compose ( String address ) { <START_BUG> ComposerController controller = new ComposerController ( null ) ; <END_BUG> controller . getModel ( ) . setTo ( address ) ; controller . showComposerWindow ( ) ; } public void contact ( String address ) { } public JPopupMenu createMenu ( URL url ) { } public void open ( URL url ) { } public void openWith ( URL url ) { } public void actionPerformed ( ActionEvent e ) { } }

Fix:
ComposerController controller = new ComposerController ( ) ;
Buggy code:
public class EditorArea extends PartSashContainer { private static final String DEFAULT_WORKBOOK_ID = "DefaultEditorWorkbook" ; private IPartDropListener partDropListener ; private ArrayList editorWorkbooks = new ArrayList ( 3 ) ; private EditorWorkbook activeEditorWorkbook ; private DropTarget dropTarget ; private DropTargetAdapter dropTargetAdapter ; public EditorArea ( String editorId , IPartDropListener listener , WorkbenchPage page ) { } public void addEditor ( EditorPane pane ) { } protected void childAdded ( LayoutPart child ) { } protected void childRemoved ( LayoutPart child ) { } protected EditorWorkbook createDefaultWorkbook ( ) { } protected Composite createParent ( Composite parentWidget ) { } public void dispose ( ) { } protected void disposeParent ( ) { } public EditorWorkbook getActiveWorkbook ( ) { } public String getActiveWorkbookID ( ) { } public ArrayList getEditorWorkbooks ( ) { } public int getEditorWorkbookCount ( ) { } public IPartDropListener getPartDropListener ( ) { } protected boolean isActiveWorkbook ( EditorWorkbook workbook ) { } public void findSashes ( LayoutPart pane , PartPane . Sashes sashes ) { } public void removeAllEditors ( ) { } public void removeEditor ( EditorPane pane ) { } public IStatus restoreState ( IMemento memento ) { } public IStatus saveState ( IMemento memento ) { } public void setActiveWorkbook ( EditorWorkbook newWorkbook , boolean hasFocus ) { } public void setActiveWorkbookFromID ( String id ) { } public void updateTabList ( ) { } public void createControl ( Composite parent ) { } private void addDropSupport ( ) { if ( ( dropTarget ) == null ) { Transfer [ ] types = new Transfer [ ] { EditorInputTransfer . getInstance ( ) , ResourceTransfer . getInstance ( ) , MarkerTransfer . getInstance ( ) } ; <START_BUG> dropTarget = new DropTarget ( getControl ( ) , DND . DROP_DEFAULT ) ; <END_BUG> dropTarget . setTransfer ( types ) ; dropTarget . addDropListener ( dropTargetAdapter ) ; } } }

Fix:
dropTarget = new DropTarget ( getControl ( ) , ( ( DND . DROP_DEFAULT ) | ( DND . DROP_COPY ) ) ) ;
Buggy code:
public class RunTraining { public static void main ( String [ ] args ) throws Exception { } public static void train ( String dataFolder , String outputFolder , int cores , int iterations , double percentOfData , double dropout , String startModel , boolean secondOrder , boolean costAugmenting ) throws IOException , ClassNotFoundException { WordEnumeration words = new WordEnumeration ( ) ; LabelEnumeration labels = new LabelEnumeration ( ) ; RuleEnumeration rules = new RuleEnumeration ( ) ; FeatureParameters params = new FeatureParameters ( ) ; if ( startModel != null ) { SaveObject start = SaveObject . loadSaveObject ( startModel ) ; words = start . getWords ( ) ; labels = start . getLabels ( ) ; rules = start . getRules ( ) ; params = start . getParameters ( ) ; } List < SpannedWords > examples = PennTreebankReader . loadFromFiles ( dataFolder , 2 , 22 , words , labels , rules , true ) ; if ( percentOfData < 1 ) { examples = new java . util . ArrayList ( examples . subList ( 0 , ( ( int ) ( ( examples . size ( ) ) * percentOfData ) ) ) ) ; } RandomizedGreedyDecoder decoder = new RandomizedGreedyDecoder ( words , labels , rules , cores ) ; <START_BUG> Train pa = new Train ( words , labels , rules , decoder ) ; <END_BUG> for ( int i = 0 ; i < iterations ; i ++ ) { pa . train ( examples , dropout , secondOrder , costAugmenting ) ; params = pa . getParameters ( ) ; Test . test ( words , labels , rules , params , dataFolder , secondOrder , 100 , 0.1 , cores ) ; SaveObject so = new SaveObject ( words , labels , rules , params ) ; so . save ( ( ( outputFolder + "//modelIteration" ) + i ) ) ; } } static class TrainResult { FeatureParameters finalParameters ; FeatureParameters parametersAveragedOverIterations ; } static class TrainOneIteration implements Callable < RunTraining . TrainResult > { WordEnumeration words ; LabelEnumeration labels ; RuleEnumeration rules ; List < SpannedWords > data ; FeatureParameters initialParams ; double dropout ; boolean secondOrder ; boolean costAugmenting ; public TrainOneIteration ( WordEnumeration words , LabelEnumeration labels , RuleEnumeration rules , List < SpannedWords > data , FeatureParameters initialParams , double dropout , boolean secondOrder , boolean costAugmenting ) { } @ Override public RunTraining . TrainResult call ( ) throws Exception { } } public static void trainParallel ( String dataFolder , String outputFolder , int numberThreads , int iterations , double percentOfData , double dropout , String startModel , boolean secondOrder , boolean costAugmenting ) throws IOException , ClassNotFoundException , InterruptedException , ExecutionException { } }

Fix:
Train pa = new Train ( words , labels , rules , decoder , params ) ;