nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CheckoutDatabaseAction extends AbstractDownloadDatabaseAction < IfcModel > { private final long roid ; private BimServer bimServer ; private long serializerOid ; public CheckoutDatabaseAction ( BimServer bimServer , DatabaseSession databaseSession , AccessMethod accessMethod , Authorization authorization , long roid , long serializerOid ) { } @ Override public IfcModel execute ( ) throws BimserverDatabaseException , BimserverLockConflictException , UserException { } private IfcModel realCheckout ( Project project , Revision revision , DatabaseSession databaseSession , User user ) throws BimserverDatabaseException , BimserverLockConflictException , UserException { SerializerPluginConfiguration serializerPluginConfiguration = getDatabaseSession ( ) . get ( eINSTANCE . getSerializerPluginConfiguration ( ) , serializerOid , Query . getDefault ( ) ) ; final long totalSize = revision . getSize ( ) ; final AtomicLong total = new AtomicLong ( ) ; IfcModelSet ifcModelSet = new IfcModelSet ( ) ; for ( ConcreteRevision subRevision : revision . getConcreteRevisions ( ) ) { IfcModel subModel = new IfcModel ( ) ; int highestStopId = findHighestStopRid ( project , subRevision ) ; Query query = new Query ( subRevision . getProject ( ) . getId ( ) , subRevision . getId ( ) , null , Deep . YES , highestStopId ) ; subModel . addChangeListener ( new IfcModelChangeListener ( ) { @ Override public void objectAdded ( ) { total . incrementAndGet ( ) ; if ( totalSize == 0 ) { setProgress ( "Preparing<seq2seq4repair_space>checkout..." , 0 ) ; } else { <START_BUG> setProgress ( "Preparing<seq2seq4repair_space>checkout..." , Math . round ( ( ( 100L * ( total . get ( ) ) ) // totalSize ) ) ) ; <END_BUG> } } } ) ; getDatabaseSession ( ) . getMap ( subModel , query ) ; try { checkGeometry ( serializerPluginConfiguration , bimServer . getPluginManager ( ) , subModel , project , subRevision , revision ) ; } catch ( GeometryGeneratingException e ) { throw new UserException ( e ) ; } subModel . getModelMetaData ( ) . setDate ( subRevision . getDate ( ) ) ; ifcModelSet . add ( subModel ) ; } IfcModelInterface ifcModel = new IfcModel ( ) ; if ( ( ifcModelSet . size ( ) ) > 1 ) { try { ifcModel = bimServer . getMergerFactory ( ) . createMerger ( getDatabaseSession ( ) , getAuthorization ( ) . getUoid ( ) ) . merge ( revision . getProject ( ) , ifcModelSet , new org . bimserver . plugins . ModelHelper ( ifcModel ) ) ; } catch ( MergeException e ) { throw new UserException ( e ) ; } } else { ifcModel = ifcModelSet . iterator ( ) . next ( ) ; } ifcModel . getModelMetaData ( ) . setName ( ( ( ( project . getName ( ) ) + "." ) + ( revision . getId ( ) ) ) ) ; ifcModel . getModelMetaData ( ) . setRevisionId ( ( ( project . getRevisions ( ) . indexOf ( revision ) ) + 1 ) ) ; ifcModel . getModelMetaData ( ) . setAuthorizedUser ( user . getName ( ) ) ; ifcModel . getModelMetaData ( ) . setDate ( new Date ( ) ) ; return ( ( IfcModel ) ( ifcModel ) ) ; } No newline ; at end ; of file ; }

Fix:
setProgress ( "Preparing<seq2seq4repair_space>checkout..." , ( ( int ) ( Math . round ( ( ( 100.0 * ( total . get ( ) ) ) // totalSize ) ) ) ) ) ;
Buggy code:
public class DungeonGenTest { public static void main ( String [ ] args ) { DungeonGen bg = new DungeonGen ( new XorRNG ( 1384820248253783040L ) ) ; for ( TilesetType tt : TilesetType . values ( ) ) { System . out . println ( tt . toString ( ) ) ; <START_BUG> bg . generate ( tt , 80 , 80 ) ; <END_BUG> bg . wallWrap ( ) ; System . out . println ( bg ) ; bg . setDungeon ( DungeonUtility . hashesToLines ( bg . getDungeon ( ) ) ) ; System . out . println ( bg ) ; System . out . println ( ) ; } } }

Fix:
bg . generate ( tt , 80 , 40 ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class EditorFrame extends JFrame { private static final int FRAME_GAP = 20 ; private static final int ESTIMATED_FRAMES = 5 ; private static final int MAX_RECENT_FILES = 8 ; private static final double GROW_SCALE_FACTOR = Math . sqrt ( 2 ) ; private static final int MARGIN_SCREEN = 8 ; private static final int MARGIN_IMAGE = 2 ; private static final int HELP_MENU_TEXT_WIDTH = 10 ; private static final int HELP_MENU_TEXT_HEIGHT = 40 ; private MenuFactory aAppFactory ; private ResourceBundle aAppResources ; private ResourceBundle aVersionResources ; private ResourceBundle aEditorResources ; private JTabbedPane aTabbedPane ; private ArrayList < JInternalFrame > aTabs = new ArrayList < > ( ) ; private JMenu aNewMenu ; private Clipboard aClipboard = new Clipboard ( ) ; private RecentFilesQueue aRecentFiles = new RecentFilesQueue ( ) ; private JMenu aRecentFilesMenu ; private WelcomeTab aWelcomeTab ; public EditorFrame ( Class < ? > pAppClass ) { } private void createFileMenu ( MenuFactory pFactory ) { } private void createEditMenu ( MenuFactory pFactory ) { } private void createViewMenu ( MenuFactory pFactory ) { } private void createHelpMenu ( MenuFactory pFactory ) { } public void addGraphType ( String pResourceName , final Class < ? > pGraphClass ) { } public void setIcon ( ) { try { <START_BUG> URL url = getClass ( ) . getResource ( aAppResources . getString ( "app.icon" ) ) ; <END_BUG> Toolkit kit = Toolkit . getDefaultToolkit ( ) ; Image img = kit . createImage ( url ) ; setIconImage ( img ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public void readArgs ( String [ ] pArgs ) { } private void open ( String pName ) { } private void addTab ( final JInternalFrame pInternalFrame ) { } private String setTitle ( JInternalFrame pInternalFrame ) { } public void addWelcomeTab ( ) { } public void removeWelcomeTab ( ) { } public void removeTab ( final JInternalFrame pInternalFrame ) { } private void addRecentFile ( String pNewFile ) { } private void buildRecentFilesMenu ( ) { } public void openFile ( ) { } public void cut ( ) { } public void copy ( ) { } public void paste ( ) { } public void copyToClipboard ( ) { } public void close ( ) { } public void close ( JInternalFrame pJInternalFrame ) { } public void save ( ) { } public void saveAs ( ) { } static String replaceExtension ( String pOriginal , String pToBeRemoved , String pDesired ) { } public void exportImage ( ) { } private File chooseFileToExportTo ( ) { } private static BufferedImage getImage ( Graph pGraph ) { } public void showAboutDialog ( ) { } public void exit ( ) { } }

Fix:
URL url = getClass ( ) . getClassLoader ( ) . getResource ( aAppResources . getString ( "app.icon" ) ) ;
Buggy code:
public class SQLStoreQuery extends AbstractStoreQuery { private static final Localizer _loc = Localizer . forPackage ( SQLStoreQuery . class ) ; private final transient JDBCStore _store ; public SQLStoreQuery ( JDBCStore store ) { } public JDBCStore getStore ( ) { } public boolean supportsParameterDeclarations ( ) { } public boolean supportsDataStoreExecution ( ) { } public Executor newDataStoreExecutor ( ClassMetaData meta , boolean subclasses ) { } public boolean requiresCandidateType ( ) { } public boolean requiresParameterDeclarations ( ) { } protected static class SQLExecutor extends AbstractExecutor { private final ClassMetaData _meta ; private final boolean _select ; private final boolean _call ; private final QueryResultMapping _resultMapping ; public SQLExecutor ( SQLStoreQuery q , ClassMetaData candidate ) { } public int getOperation ( StoreQuery q ) { } public Number executeUpdate ( StoreQuery q , Object [ ] params ) { } public ResultObjectProvider executeQuery ( StoreQuery q , Object [ ] params , Range range ) { } public String [ ] getDataStoreActions ( StoreQuery q , Object [ ] params , Range range ) { } public boolean isPacking ( StoreQuery q ) { } protected PreparedStatement prepareCall ( Connection conn , SQLBuffer buf ) throws SQLException { } protected int executeUpdate ( JDBCStore store , Connection conn , PreparedStatement stmnt , SQLBuffer buf ) throws SQLException { } protected PreparedStatement prepareCall ( Connection conn , SQLBuffer buf , JDBCFetchConfiguration fetch , int rsType , int rsConcur ) throws SQLException { } protected PreparedStatement prepareStatement ( Connection conn , SQLBuffer buf ) throws SQLException { } protected PreparedStatement prepareStatement ( Connection conn , SQLBuffer buf , JDBCFetchConfiguration fetch , int rsType , int rsConcur ) throws SQLException { } protected ResultSet executeQuery ( JDBCStore store , Connection conn , PreparedStatement stmnt , SQLBuffer buf , List paramList ) throws SQLException { } public Object [ ] toParameterArray ( StoreQuery q , Map userParams ) { if ( ( userParams == null ) || ( userParams . isEmpty ( ) ) ) return StoreQuery . EMPTY_OBJECTS ; String sql = q . getContext ( ) . getQueryString ( ) ; List < Integer > paramOrder = new ArrayList < Integer > ( ) ; try { sql = SQLStoreQuery . substituteParams ( sql , paramOrder ) ; } catch ( IOException ex ) { throw new UserException ( ex . getLocalizedMessage ( ) ) ; } Object [ ] result = new Object [ paramOrder . size ( ) ] ; int idx = 0 ; for ( Integer key : paramOrder ) { if ( ! ( userParams . containsKey ( key ) ) ) <START_BUG> throw new UserException ( SQLStoreQuery . _loc . get ( "uparam-missing" , sql , key , userParams ) ) ; <END_BUG> result [ ( idx ++ ) ] = userParams . get ( key ) ; } q . getContext ( ) . getQuery ( ) . setQuery ( sql ) ; return result ; } } public static String substituteParams ( String sql , List < Integer > paramOrder ) throws IOException { } }

Fix:
throw new UserException ( SQLStoreQuery . _loc . get ( "uparam-missing" , key , sql , userParams ) ) ;
Buggy code:
public class ErrorState implements State { private final State nextState ; private final String errorMessage ; private final StateValues stateValues ; private ConsoleWrapper theConsole ; public ErrorState ( ConsoleWrapper theConsole , String errorMessage ) { } public ErrorState ( ConsoleWrapper theConsole , String errorMessage , State nextState ) { } public ErrorState ( ConsoleWrapper theConsole , String errorMessage , State nextState , StateValues stateValues ) { } public State execute ( ) { boolean direct = ( theConsole . getConsole ( ) ) == null ; printf ( AddUser . NEW_LINE , direct ) ; printf ( "<seq2seq4repair_space>*<seq2seq4repair_space>" , direct ) ; printf ( DomainManagementMessages . MESSAGES . errorHeader ( ) , direct ) ; printf ( "<seq2seq4repair_space>*<seq2seq4repair_space>" , direct ) ; printf ( AddUser . NEW_LINE , direct ) ; printf ( errorMessage , direct ) ; printf ( AddUser . NEW_LINE , direct ) ; printf ( AddUser . NEW_LINE , direct ) ; if ( ( ( ( stateValues ) != null ) && ( ! ( stateValues . isInteractive ( ) ) ) ) && ( ( nextState ) == null ) ) { <START_BUG> throw new AddUserFailedException ( errorMessage ) ; <END_BUG> } return nextState ; } private void printf ( final String message , final boolean direct ) { } }

Fix:
throw new RuntimeException ( errorMessage ) ;
Buggy code:
public class AboutFragment extends Fragment { private View root ; private Animation animation_logo ; private Animation animation_info ; private ImageView logo ; private TextView info ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { root = inflater . inflate ( fragment_about , container , false ) ; logo = ( ( ImageView ) ( root . findViewById ( imageView_logo ) ) ) ; info = ( ( TextView ) ( root . findViewById ( textView_info ) ) ) ; logo . setVisibility ( GONE ) ; info . setVisibility ( GONE ) ; animation_logo = AnimationUtils . loadAnimation ( getActivity ( ) , anim_move_up ) ; animation_info = AnimationUtils . loadAnimation ( getActivity ( ) , anim_fade_in ) ; animation_logo . setAnimationListener ( new AnimationListener ( ) { @ Override public void onAnimationStart ( Animation animation ) { } @ Override public void onAnimationRepeat ( Animation animation ) { } @ Override public void onAnimationEnd ( Animation animation ) { <START_BUG> String aboutme = "Thông<seq2seq4repair_space>tin<seq2seq4repair_space>nhóm:<seq2seq4repair_space>19\n" + ( ( ( "Thành<seq2seq4repair_space>viên:\n" + "\t\t\tĐinh<seq2seq4repair_space>Văn<seq2seq4repair_space>Hoàng\n" ) + "\t\t\tHoàng<seq2seq4repair_space>Văn<seq2seq4repair_space>Lâm\n" ) + "\t\t\tNguyễn<seq2seq4repair_space>Thị<seq2seq4repair_space>Bích<seq2seq4repair_space>Nhung" ) ; <END_BUG> info . setText ( aboutme ) ; info . setVisibility ( VISIBLE ) ; info . setAnimation ( animation_info ) ; } } ) ; logo . setVisibility ( VISIBLE ) ; logo . setAnimation ( animation_logo ) ; return root ; } }

Fix:
String aboutme = "Thông<seq2seq4repair_space>tin<seq2seq4repair_space>nhóm:<seq2seq4repair_space>03\n" + ( ( ( "Thành<seq2seq4repair_space>viên:\n" + "\t\t\tĐinh<seq2seq4repair_space>Văn<seq2seq4repair_space>Hoàng\n" ) + "\t\t\tHoàng<seq2seq4repair_space>Văn<seq2seq4repair_space>Lâm\n" ) + "\t\t\tNguyễn<seq2seq4repair_space>Thị<seq2seq4repair_space>Bích<seq2seq4repair_space>Nhung" ) ;
Buggy code:
public class EditGroupDialog extends JDialog implements ActionListener { private AddressbookDNDListView addressbook ; private AddressbookDNDListView list ; private JButton addButton ; private JButton removeButton ; private JButton okButton ; private JButton cancelButton ; private JLabel nameLabel ; private JLabel descriptionLabel ; private JTextField nameTextField ; private JTextField descriptionTextField ; private AddressbookInterface addressbookInterface ; private AddressbookListModel members ; private AddressbookListRenderer renderer ; boolean result ; public EditGroupDialog ( JFrame frame , AddressbookInterface i , AdapterNode groupNode ) { } protected void init ( ) { } public boolean getResult ( ) { } public void setHeaderList ( HeaderItemList list ) { } public void updateComponents ( GroupListCard card , HeaderItemList list , boolean b ) { } public void actionPerformed ( ActionEvent e ) { String command = e . getActionCommand ( ) ; if ( command . equals ( "CANCEL" ) ) { result = false ; setVisible ( false ) ; } else if ( command . equals ( "CHOOSE" ) ) { SelectAddressbookFolderDialog dialog = addressbookInterface . tree . getSelectAddressbookFolderDialog ( ) ; Folder selectedFolder = dialog . getSelectedFolder ( ) ; <START_BUG> if ( ( folder ) != null ) { <END_BUG> HeaderItemList list = selectedFolder . getHeaderItemList ( ) ; setHeaderList ( list ) ; } } else if ( command . equals ( "OK" ) ) { if ( ( nameTextField . getText ( ) . length ( ) ) == 0 ) { JOptionPane . showMessageDialog ( this , "You<seq2seq4repair_space>must<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>name<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>group!" ) ; return ; } result = true ; setVisible ( false ) ; } else if ( command . equals ( "ADD" ) ) { int [ ] array = addressbook . getSelectedIndices ( ) ; HeaderItem item ; for ( int j = 0 ; j < ( array . length ) ; j ++ ) { item = ( ( HeaderItem ) ( addressbook . get ( array [ j ] ) ) ) ; System . out . println ( ( "add<seq2seq4repair_space>item:" + item ) ) ; members . addElement ( item ) ; } } else if ( command . equals ( "REMOVE" ) ) { int [ ] array = list . getSelectedIndices ( ) ; for ( int j = 0 ; j < ( array . length ) ; j ++ ) { System . out . println ( ( "remove<seq2seq4repair_space>index:" + ( array [ j ] ) ) ) ; members . remove ( array [ j ] ) ; } } } }

Fix:
if ( selectedFolder != null ) {
Buggy code:
public abstract class ResourceTransformationDescriptionBuilder extends TransformationDescriptionBuilder { protected ResourceTransformationDescriptionBuilder ( PathElement pathElement ) { } public abstract ResourceTransformationDescriptionBuilder rejectExpressions ( Collection < String > attributeNames ) { } public abstract ResourceTransformationDescriptionBuilder rejectExpressions ( String ... attributeNames ) { } public abstract ResourceTransformationDescriptionBuilder rejectExpressions ( AttributeDefinition ... defintions ) { } public abstract ResourceTransformationDescriptionBuilder setResourceTransformer ( ResourceTransformer resourceTransformer ) { } public abstract ResourceTransformationDescriptionBuilder addCustomTransformation ( ModelTransformer transformer ) { } public abstract ResourceTransformationDescriptionBuilder addChildResource ( PathElement pathElement ) { } public abstract ResourceTransformationDescriptionBuilder addChildResource ( ResourceDefinition definition ) { } <START_BUG> public abstract TransformationDescriptionBuilder discardChildResource ( PathElement pathElement ) ; <END_BUG> }

Fix:
public abstract DiscardTransformationDescriptionBuilder discardChildResource ( PathElement pathElement ) ;
Buggy code:
public class ActionProvider extends AbstractProvider { private Map idToElement = new HashMap ( ) ; public String getId ( ) { } public AbstractElement getElementForId ( String id ) { } public AbstractElement [ ] getElements ( ) { } private void collectContributions ( MenuManager menu , Set result ) { IContributionItem [ ] items = menu . getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { IContributionItem item = items [ i ] ; if ( item instanceof SubContributionItem ) { item = ( ( SubContributionItem ) ( item ) ) . getInnerItem ( ) ; } if ( item instanceof MenuManager ) { collectContributions ( ( ( MenuManager ) ( item ) ) , result ) ; } else <START_BUG> if ( item instanceof ActionContributionItem ) { <END_BUG> result . add ( item ) ; } } } public ImageDescriptor getImageDescriptor ( ) { } public String getName ( ) { } }

Fix:
if ( ( item instanceof ActionContributionItem ) && ( item . isEnabled ( ) ) ) {
Buggy code:
public class startActivity extends Activity implements httpReply { private PendingIntent pendingIntent ; public String userid ; @ Override public void updateActivity ( String result ) { } protected void onCreate ( Bundle savedInstanceState ) { } public void scheduleAlarm ( View V ) { Intent alarmIntent = new Intent ( this , alarm . class ) ; pendingIntent = PendingIntent . getBroadcast ( this , 0 , alarmIntent , 0 ) ; AlarmManager alarmManager = ( ( AlarmManager ) ( getSystemService ( ALARM_SERVICE ) ) ) ; <START_BUG> int interval = ( 1000 * 60 ) * 15 ; <END_BUG> alarmManager . setInexactRepeating ( RTC_WAKEUP , System . currentTimeMillis ( ) , interval , pendingIntent ) ; Toast . makeText ( this , "Setting<seq2seq4repair_space>alarm..." , LENGTH_SHORT ) . show ( ) ; } public void startMaps ( View view ) { } public void startScan ( View view ) { } public void startloginActivity ( View view ) { } public void coverActivity ( View view ) { } public void viewdata ( View view ) { } public void sendUrl ( View view ) { } }

Fix:
int interval = ( 1000 * 60 ) * 1 ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( GlobalModulesTestCase . GlobalModulesTestCaseServerSetup . class ) public class GlobalModulesTestCase { static class GlobalModulesTestCaseServerSetup implements ServerSetupTask { @ Override public void setup ( final ManagementClient managementClient , final String containerId ) throws Exception { } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } private static void deleteRecursively ( File file ) { } private static void createTestModule ( File testModuleRoot ) throws IOException { } } private static void copyFile ( File target , InputStream src ) throws IOException { } private static File getModulePath ( ) { String modulePath = System . getProperty ( "module.path" , null ) ; if ( modulePath == null ) { String jbossHome = System . getProperty ( "jboss.home" , null ) ; if ( jbossHome == null ) { throw new IllegalStateException ( "Neither<seq2seq4repair_space>-Dmodule.path<seq2seq4repair_space>nor<seq2seq4repair_space>-Djboss.home<seq2seq4repair_space>were<seq2seq4repair_space>set" ) ; } modulePath = ( jbossHome + ( File . separatorChar ) ) + "modules" ; } else { <START_BUG> modulePath = modulePath . split ( File . pathSeparator ) [ 1 ] ; <END_BUG> } File moduleDir = new File ( modulePath ) ; if ( ! ( moduleDir . exists ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ; } if ( ! ( moduleDir . isDirectory ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>dir" ) ; } return moduleDir ; } @ Deployment public static Archive < ? > deploy ( ) { } @ ArquillianResource private InitialContext ctx ; @ Test public void testDataSourceDefinition ( ) throws SQLException , NamingException { } }

Fix:
modulePath = modulePath . split ( File . pathSeparator ) [ 0 ] ;
Buggy code:
public class IsTerm extends AST { AST value ; String name ; int arity ; public IsTerm ( AST value , String name , int arity ) { } public void compile ( List < FrameVar > locals , List < DynamicVar > dynamics , Vector < Instr > code ) { } public void FV ( HashSet < String > vars ) { } public void DV ( HashSet < String > vars ) { } public int maxLocals ( ) { } public String toString ( ) { } public AST subst ( AST ast , String name ) { <START_BUG> return new IsTerm ( value . subst ( ast , name ) , name , arity ) ; <END_BUG> } }

Fix:
return new IsTerm ( value . subst ( ast , name ) , this . name , arity ) ;
Buggy code:
public class Log extends ActionBarActivity { String ip = null ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } protected void onResume ( ) { } public void setList ( String json ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private class getJson extends AsyncTask < String , Void , String > { @ Override protected String doInBackground ( String ... urls ) { String responseString = null ; int i = 0 ; <START_BUG> while ( responseString == null ) { <END_BUG> i ++ ; System . out . println ( ( ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>server...<seq2seq4repair_space>(Try<seq2seq4repair_space>" + ( Integer . toString ( i ) ) ) + ")" ) ) ; System . out . println ( ( "Host:<seq2seq4repair_space>" + ( String . format ( "http:////%s//choreapi//v1//getlogs" , ip ) ) ) ) ; HttpParams params = new BasicHttpParams ( ) ; HttpConnectionParams . setConnectionTimeout ( params , 20000 ) ; HttpConnectionParams . setSoTimeout ( params , 20000 ) ; HttpClient httpclient = new org . apache . http . impl . client . DefaultHttpClient ( params ) ; HttpResponse response ; try { response = httpclient . execute ( new HttpGet ( String . format ( "http:////%s//choreapi//v1//getlogs" , ip ) ) ) ; StatusLine statusLine = response . getStatusLine ( ) ; if ( ( statusLine . getStatusCode ( ) ) == ( HttpStatus . SC_OK ) ) { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; response . getEntity ( ) . writeTo ( out ) ; out . close ( ) ; responseString = out . toString ( ) ; } else { response . getEntity ( ) . getContent ( ) . close ( ) ; throw new IOException ( statusLine . getReasonPhrase ( ) ) ; } } catch ( ClientProtocolException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { System . out . println ( "IO<seq2seq4repair_space>Exception" ) ; e . printStackTrace ( ) ; } } System . out . println ( responseString ) ; return responseString ; } @ Override protected void onPostExecute ( String json ) { } } }

Fix:
while ( ( responseString == null ) && ( i <= 3 ) ) {
Buggy code:
public class ReconcileWorkingCopyOperation extends JavaModelOperation { public static boolean PERF = false ; boolean createAST ; int astLevel ; boolean forceProblemDetection ; WorkingCopyOwner workingCopyOwner ; CompilationUnit ast ; public ReconcileWorkingCopyOperation ( IJavaElement workingCopy , boolean creatAST , int astLevel , boolean forceProblemDetection , WorkingCopyOwner workingCopyOwner ) { } protected void executeOperation ( ) throws JavaModelException { if ( ( this . progressMonitor ) != null ) { if ( this . progressMonitor . isCanceled ( ) ) throw new OperationCanceledException ( ) ; this . progressMonitor . beginTask ( Messages . element_reconciling , 2 ) ; } CompilationUnit workingCopy = getWorkingCopy ( ) ; boolean wasConsistent = workingCopy . isConsistent ( ) ; try { if ( ! wasConsistent ) { JavaElementDeltaBuilder deltaBuilder = new JavaElementDeltaBuilder ( workingCopy ) ; this . ast = workingCopy . makeConsistent ( this . createAST , this . astLevel , this . progressMonitor ) ; deltaBuilder . buildDeltas ( ) ; if ( ( progressMonitor ) != null ) progressMonitor . worked ( 2 ) ; JavaElementDelta delta = deltaBuilder . delta ; if ( delta != null ) { delta . changedAST ( this . ast ) ; addReconcileDelta ( workingCopy , delta ) ; } } else { if ( this . forceProblemDetection ) { IProblemRequestor problemRequestor = workingCopy . getPerWorkingCopyInfo ( ) ; boolean computeProblems = ( ( JavaProject . hasJavaNature ( workingCopy . getJavaProject ( ) . getProject ( ) ) ) && ( problemRequestor != null ) ) && ( problemRequestor . isActive ( ) ) ; if ( computeProblems ) { CompilationUnitDeclaration unit = null ; try { problemRequestor . beginReporting ( ) ; char [ ] contents = workingCopy . getContents ( ) ; <START_BUG> unit = CompilationUnitProblemFinder . process ( workingCopy , contents , this . workingCopyOwner , problemRequestor , ( ! ( this . createAST ) ) , this . progressMonitor ) ; <END_BUG> problemRequestor . endReporting ( ) ; if ( ( progressMonitor ) != null ) progressMonitor . worked ( 1 ) ; if ( ( this . createAST ) && ( unit != null ) ) { Map options = workingCopy . getJavaProject ( ) . getOptions ( true ) ; this . ast = AST . convertCompilationUnit ( this . astLevel , unit , contents , options , true , workingCopy , this . progressMonitor ) ; JavaElementDelta delta = new JavaElementDelta ( workingCopy ) ; delta . changedAST ( this . ast ) ; addReconcileDelta ( workingCopy , delta ) ; if ( ( progressMonitor ) != null ) progressMonitor . worked ( 1 ) ; } } finally { if ( unit != null ) { unit . cleanUp ( ) ; } } } } } } finally { if ( ( progressMonitor ) != null ) progressMonitor . done ( ) ; } } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } protected IJavaModelStatus verify ( ) { } }

Fix:
unit = CompilationUnitProblemFinder . process ( workingCopy , contents , this . workingCopyOwner , problemRequestor , this . createAST , this . progressMonitor ) ;
Buggy code:
public class WithincodePointcut extends Pointcut { private SignaturePattern signature ; private static final Set matchedShadowKinds = new HashSet ( ) ; public WithincodePointcut ( SignaturePattern signature ) { } public SignaturePattern getSignature ( ) { } public Set couldMatchKinds ( ) { } public FuzzyBoolean fastMatch ( FastMatchInfo type ) { } public FuzzyBoolean fastMatch ( Class targetType ) { } protected FuzzyBoolean matchInternal ( Shadow shadow ) { <START_BUG> return FuzzyBoolean . fromBoolean ( signature . matches ( shadow . getEnclosingCodeSignature ( ) , shadow . getIWorld ( ) ) ) ; <END_BUG> } public FuzzyBoolean match ( JoinPoint jp , JoinPoint . StaticPart encJP ) { } public boolean matchesDynamically ( Object thisObject , Object targetObject , Object [ ] args ) { } public FuzzyBoolean matchesStatically ( String joinpointKind , Member member , Class thisClass , Class targetClass , Member withinCode ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public void resolveBindingsFromRTTI ( ) { } public void postRead ( ResolvedType enclosingType ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } protected Test findResidueInternal ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedType inAspect , IntMap bindings ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } }

Fix:
return FuzzyBoolean . fromBoolean ( signature . matches ( shadow . getEnclosingCodeSignature ( ) , shadow . getIWorld ( ) , false ) ) ;
Buggy code:
public class ServerConfigParser { public static final String SERVER_ELEMENT = "server" ; public static final String CONNECTOR_ELEMENT = "connector" ; public static final String GROUP_ELEMENT = "group" ; public static final String PROTOCOL_ATTR = "protocol" ; public static final String HOSTNAME_ATTR = "hostname" ; public static final String PORT_ATTR = "port" ; public static final String TIMEOUT_ATTR = "timeout" ; public static final String NAME_ATTR = "name" ; protected void findElementsNamed ( Node top , String name , List aList ) { } protected List processConnectorNodes ( List connectorNodes ) { List res = new ArrayList ( ) ; for ( Iterator i = connectorNodes . iterator ( ) ; i . hasNext ( ) ; ) { Node n = ( ( Node ) ( i . next ( ) ) ) ; String ports = getAttributeValue ( n , ServerConfigParser . PORT_ATTR ) ; int port = Connector . DEFAULT_PORT ; if ( ports != null ) { try { Integer porti = new Integer ( ports ) ; port = porti . intValue ( ) ; } catch ( NumberFormatException e ) { } } String timeouts = getAttributeValue ( n , ServerConfigParser . TIMEOUT_ATTR ) ; int timeout = Connector . DEFAULT_TIMEOUT ; if ( timeouts != null ) { try { Integer timeouti = new Integer ( timeouts ) ; timeout = timeouti . intValue ( ) ; } catch ( NumberFormatException e ) { } } String prot = getAttributeValue ( n , ServerConfigParser . PROTOCOL_ATTR ) ; String host = getAttributeValue ( n , ServerConfigParser . HOSTNAME_ATTR ) ; <START_BUG> Connector c = new Connector ( this , prot , host , port , timeout ) ; <END_BUG> processConnector ( n , c ) ; res . add ( c ) ; } return res ; } protected void processConnector ( Node n , Connector c ) { } protected List loadConnectors ( Document doc ) { } protected String getAttributeValue ( Node node , String attrName ) { } public List load ( InputStream ins ) throws IOException , ParserConfigurationException , SAXException { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
Connector c = new Connector ( prot , host , port , timeout ) ;
Buggy code:
public class DefaultTabFolder extends AbstractTabFolder { private PaneFolder paneFolder ; private Control viewToolBar ; private Label titleLabel ; private PaneFolderButtonListener buttonListener = new PaneFolderButtonListener ( ) { public void stateButtonPressed ( int buttonId ) { } public void closeButtonPressed ( CTabItem item ) { } public void showList ( CTabFolderEvent event ) { } } ; private Listener selectionListener = new Listener ( ) { public void handleEvent ( Event e ) { } } ; private static DefaultTabFolderColors defaultColors = new DefaultTabFolderColors ( ) ; private DefaultTabFolderColors [ ] activeShellColors = new DefaultTabFolderColors [ ] { DefaultTabFolder . defaultColors , DefaultTabFolder . defaultColors , DefaultTabFolder . defaultColors } ; private DefaultTabFolderColors [ ] inactiveShellColors = new DefaultTabFolderColors [ ] { DefaultTabFolder . defaultColors , DefaultTabFolder . defaultColors , DefaultTabFolder . defaultColors } ; private boolean shellActive = false ; public DefaultTabFolder ( Composite parent , int flags , boolean allowMin , boolean allowMax ) { } public void setMinimumCharacters ( int count ) { } public void setSimpleTabs ( boolean simple ) { } protected DefaultTabItem getTab ( CTabItem item ) { } public Point computeSize ( int widthHint , int heightHint ) { } PaneFolder getFolder ( ) { } public AbstractTabItem getSelection ( ) { } public AbstractTabItem add ( int index , int flags ) { } public Composite getContentParent ( ) { } public void setContent ( Control newContent ) { } public AbstractTabItem [ ] getItems ( ) { } public int getItemCount ( ) { } public void setSelection ( AbstractTabItem toSelect ) { } public Composite getToolbarParent ( ) { } public Control getControl ( ) { } public void setUnselectedCloseVisible ( boolean visible ) { } public void setUnselectedImageVisible ( boolean visible ) { } public Rectangle getTabArea ( ) { <START_BUG> return Geometry . toDisplay ( paneFolder . getControl ( ) . getParent ( ) , paneFolder . getTitleArea ( ) ) ; <END_BUG> } public void enablePaneMenu ( boolean enabled ) { } public void setSelectedInfo ( PartInfo info ) { } public Point getPaneMenuLocation ( ) { } public Point getPartListLocation ( ) { } public Point getSystemMenuLocation ( ) { } public boolean isOnBorder ( Point toTest ) { } public void layout ( boolean flushCache ) { } public void setState ( int state ) { } public void setActive ( int activeState ) { } public void setTabPosition ( int tabPosition ) { } public void flushToolbarSize ( ) { } public void setToolbar ( Control toolbarControl ) { } public void setColors ( DefaultTabFolderColors colors , int activationState , boolean shellActivationState ) { } private void updateColors ( ) { } public void setColors ( DefaultTabFolderColors colors , int activationState ) { } public void shellActive ( boolean isActive ) { } public void setFont ( Font font ) { } protected int computeTabHeight ( ) { } public void setSingleTab ( boolean b ) { } }

Fix:
return Geometry . toDisplay ( paneFolder . getControl ( ) , paneFolder . getTitleArea ( ) ) ;
Buggy code:
public class Staff extends Fragment { private Staff . OnFragmentInteractionListener mListener ; ProgressBar prog ; ListView lstStaff ; public Staff ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } public interface OnFragmentInteractionListener { } String [ ] staffArray ; String [ ] emailArray ; List < String > staffList = new ArrayList < > ( ) ; public class StaffScrape extends AsyncTask < Void , Void , Void > { @ Override protected Void doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( Void aVoid ) { } } private class StaffAdapter extends BaseAdapter { private static final int TYPE_ITEM = 0 ; private static final int TYPE_SEPARATOR = 1 ; private static final int TYPE_MAX_COUNT = ( Staff . StaffAdapter . TYPE_SEPARATOR ) + 1 ; private ArrayList < String > mData = new ArrayList < String > ( ) ; private LayoutInflater mInflater ; private TreeSet < Integer > mSeparatorsSet = new TreeSet < Integer > ( ) ; public StaffAdapter ( ) { } public void addItem ( final String item ) { } public void addSeparatorItem ( final String item ) { } @ Override public int getItemViewType ( int position ) { } @ Override public int getViewTypeCount ( ) { } @ Override public int getCount ( ) { } @ Override public String getItem ( int position ) { } @ Override public long getItemId ( int position ) { } public View getView ( int position , View convertView , ViewGroup parent ) { Staff . ViewHolder holder = null ; int type = getItemViewType ( position ) ; holder = new Staff . ViewHolder ( ) ; switch ( type ) { case Staff . StaffAdapter . TYPE_ITEM : <START_BUG> convertView = mInflater . inflate ( bluelist , null ) ; <END_BUG> holder . textView = ( ( TextView ) ( convertView . findViewById ( text ) ) ) ; break ; } convertView . setTag ( holder ) ; holder . textView . setText ( mData . get ( position ) ) ; return convertView ; } } public static class ViewHolder { public TextView textView ; } }

Fix:
convertView = mInflater . inflate ( stafflist , null ) ;
Buggy code:
public final class PresentationRegistryPopulator { public static void populateRegistry ( FontRegistry registry , FontDefinition [ ] definitions , IPreferenceStore store ) { } private static void installFont ( FontDefinition definition , FontRegistry registry , IPreferenceStore store ) { String id = definition . getId ( ) ; FontData [ ] prefFont = ( store != null ) ? PreferenceConverter . getFontDataArray ( store , id ) : null ; FontData [ ] defaultFont = null ; if ( ( definition . getValue ( ) ) != null ) <START_BUG> defaultFont = new FontData [ ] { StringConverter . asFontData ( definition . getValue ( ) , null ) } ; <END_BUG> else if ( ( definition . getDefaultsTo ( ) ) != null ) defaultFont = registry . getFontData ( definition . getDefaultsTo ( ) ) ; else defaultFont = PreferenceConverter . FONTDATA_ARRAY_DEFAULT_DEFAULT ; if ( ( prefFont == null ) || ( prefFont == ( PreferenceConverter . FONTDATA_ARRAY_DEFAULT_DEFAULT ) ) ) { prefFont = defaultFont ; } if ( ( defaultFont != null ) && ( store != null ) ) { PreferenceConverter . setDefault ( store , id , defaultFont ) ; } if ( prefFont != null ) { registry . put ( id , prefFont ) ; } } public static void populateRegistry ( GradientRegistry registry , GradientDefinition [ ] definitions , IPreferenceStore store ) { } private static void installGradient ( GradientDefinition definition , GradientRegistry registry , IPreferenceStore store ) { } public static void populateRegistry ( ColorRegistry registry , ColorDefinition [ ] definitions , IPreferenceStore store ) { } private static void installColor ( ColorDefinition definition , ColorRegistry registry , IPreferenceStore store ) { } private PresentationRegistryPopulator ( ) { } }

Fix:
defaultFont = new FontData [ ] { StringConverter . asFontData ( definition . getValue ( ) , FONTDATA_DEFAULT_DEFAULT ) } ;
Buggy code:
public class LoadFile extends JDialog { public boolean okClicked = false ; private ArrayList < Node > nodes ; private ArrayList < ArrayList < Connection > > connections ; private ArrayList < Goal > goals ; public LoadFile ( ) { } public class LoadPanel extends JPanel { private JTextField tbFileName ; private JLabel jcomp2 ; private JButton btnBrowse ; private JButton btnOK ; private JButton btnCancel ; public LoadPanel ( ) { } private void close ( ) { } } private void load ( String fileName ) { ArrayList < Node > loadedNodes = new ArrayList < Node > ( ) ; ArrayList < ArrayList < Connection > > loadedConnections = new ArrayList < ArrayList < Connection > > ( ) ; ArrayList < Goal > loadedGoals = new ArrayList < Goal > ( ) ; JSONParser parser = new JSONParser ( ) ; try { Object obj = parser . parse ( new FileReader ( fileName ) ) ; JSONObject mapList = ( ( JSONObject ) ( obj ) ) ; JSONArray nodeList = ( ( JSONArray ) ( mapList . get ( "nodes" ) ) ) ; JSONArray connectionList = ( ( JSONArray ) ( mapList . get ( "connections" ) ) ) ; JSONArray goalList = ( ( JSONArray ) ( mapList . get ( "goals" ) ) ) ; for ( int i = 0 ; i < ( nodeList . size ( ) ) ; i ++ ) { JSONObject nodeJSON = ( ( JSONObject ) ( nodeList . get ( i ) ) ) ; if ( nodeJSON . get ( "type" ) . toString ( ) . equals ( "Station" ) ) { Station node = new Station ( i , nodeJSON . get ( "name" ) . toString ( ) , new Point ( nodeJSON . get ( "location" ) . toString ( ) ) ) ; loadedNodes . add ( node ) ; } else { Junction node = new Junction ( i , nodeJSON . get ( "name" ) . toString ( ) , new Point ( nodeJSON . get ( "location" ) . toString ( ) ) ) ; loadedNodes . add ( node ) ; } } for ( int i = 0 ; i < ( connectionList . size ( ) ) ; i ++ ) { ArrayList < Connection > innerList = new ArrayList < Connection > ( ) ; JSONArray innerArray = ( ( JSONArray ) ( connectionList . get ( i ) ) ) ; for ( int x = 0 ; x < ( innerArray . size ( ) ) ; x ++ ) { if ( ( innerArray . get ( x ) ) != null ) { innerList . add ( new Connection ( Integer . valueOf ( innerArray . get ( x ) . toString ( ) ) ) ) ; } else { innerList . add ( null ) ; } } loadedConnections . add ( innerList ) ; } for ( int i = 0 ; i < ( goalList . size ( ) ) ; i ++ ) { <START_BUG> JSONObject goalJSON = ( ( JSONObject ) ( nodeList . get ( i ) ) ) ; <END_BUG> Node startNode = null ; Node endNode = null ; for ( Node node : loadedNodes ) { if ( node . getName ( ) . equals ( goalJSON . get ( "start" ) ) ) { startNode = node ; } if ( node . getName ( ) . equals ( goalJSON . get ( "end" ) ) ) { endNode = node ; } } Goal tempGoal = new Goal ( Integer . valueOf ( goalJSON . get ( "points" ) . toString ( ) ) , startNode , endNode ) ; loadedGoals . add ( tempGoal ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } this . nodes = loadedNodes ; this . connections = loadedConnections ; this . goals = loadedGoals ; } public ArrayList < Node > getNodes ( ) { } public ArrayList < ArrayList < Connection > > getConnections ( ) { } public ArrayList < Goal > getGoals ( ) { } }

Fix:
JSONObject goalJSON = ( ( JSONObject ) ( goalList . get ( i ) ) ) ;
Buggy code:
public class RangeVerbHandler implements IVerbHandler { public void doVerb ( Message message ) { List < String > keys ; try { RangeCommand command = RangeCommand . read ( message ) ; Table table = Table . open ( command . table ) ; keys = table . getKeyRange ( command . startWith , command . stopAt , command . maxResults ) ; <START_BUG> } catch ( IOException e ) { <END_BUG> throw new RuntimeException ( e ) ; } Message response = new RangeReply ( keys ) . getReply ( message ) ; MessagingService . getMessagingInstance ( ) . sendOneWay ( response , message . getFrom ( ) ) ; } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class ManagementClient { private static final String SUBDEPLOYMENT = "subdeployment" ; private static final String WEB = "web" ; private static final String JMX = "jmx" ; private static final String NAME = "name" ; private static final String SERVLET = "servlet" ; private static final String POSTFIX_WEB = ".war" ; private static final String POSTFIX_EAR = ".ear" ; private final String mgmtAddress ; private final int mgmtPort ; private final ModelControllerClient client ; private final Map < String , URI > subsystemURICache ; private ModelNode rootNode = null ; private MBeanServerConnection connection ; private JMXConnector connector ; public ManagementClient ( ModelControllerClient client , final String mgmtAddress , final int managementPort ) { } public ModelControllerClient getControllerClient ( ) { } public URI getSubSystemURI ( String subsystem ) { } public ProtocolMetaData getDeploymentMetaData ( String deploymentName ) { } public boolean isServerInRunningState ( ) { } public void close ( ) { } private URI extractSubSystemURI ( String subsystem ) { } private void readRootNode ( ) throws Exception { } private URI getBinding ( final String socketBinding ) { } private String getInterface ( final String name ) { } private boolean isEnterpriseArchive ( String deploymentName ) { } private boolean isWebArchive ( String deploymentName ) { } private ModelNode createDeploymentAddress ( String deploymentName ) { } private void extractEnterpriseArchiveContexts ( HTTPContext context , ModelNode deploymentNode ) { } private void extractWebArchiveContexts ( HTTPContext context , ModelNode deploymentNode ) { } private void extractWebArchiveContexts ( HTTPContext context , String deploymentName , ModelNode deploymentNode ) { } private String toContextName ( String deploymentName ) { } private ModelNode readResource ( ModelNode address ) throws Exception { } private ModelNode executeForResult ( final ModelNode operation ) throws Exception { } private void checkSuccessful ( final ModelNode result , final ModelNode operation ) throws ManagementClient . UnSuccessfulOperationException { } private static class UnSuccessfulOperationException extends Exception { private static final long serialVersionUID = 1L ; public UnSuccessfulOperationException ( String message ) { } } private MBeanServerConnection getConnection ( ) { } private JMXServiceURL getRemoteJMXURL ( ) { try { <START_BUG> return new JMXServiceURL ( ( ( ( "service:jmx:remote:////" + ( mgmtAddress ) ) + ":" ) + ( mgmtPort ) ) ) ; <END_BUG> } catch ( Exception e ) { throw new RuntimeException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>JMXServiceURL:" + ( this ) ) , e ) ; } } }

Fix:
return new JMXServiceURL ( ( ( ( "service:jmx:remoting-jmx:////" + ( mgmtAddress ) ) + ":" ) + ( mgmtPort ) ) ) ;
Buggy code:
public class ColumbaCmdLineParser { private static final String RESOURCE_PATH = "org.columba.core.i18n.global" ; private static CmdLineParser parser ; private static Option help ; private static Option version ; private static Option debug ; private static Option composer ; private static Option rcpt ; private static Option body ; private static Option path ; private static Option mailurl ; private static Option subject ; private static Option cc ; private static Option bcc ; private static Option attachment ; protected String pathOption ; protected String rcptOption ; protected String bodyOption ; protected boolean composerOption = false ; protected String mailurlOption ; protected String subjectOption ; protected String ccOption ; protected String bccOption ; protected String attachmentOption = null ; public ColumbaCmdLineParser ( ) { } public void parseCmdLine ( String [ ] args ) throws IllegalArgumentException { } private void checkHelp ( ) { } private void checkVersion ( ) { } private void checkDebug ( ) { } private void checkPath ( ) { } private void checkRCPT ( ) { } private void checkBody ( ) { } private void checkComposer ( ) { } private void checkMailurl ( ) { } private void checkSubject ( ) { } private void checkAttachment ( ) { } public static void printUsage ( ) { } public static void printVersionInfo ( ) { <START_BUG> System . out . println ( ( "columba<seq2seq4repair_space>" + ( MainInterface . version ) ) ) ; <END_BUG> } public String getPathOption ( ) { } public String getBodyOption ( ) { } public boolean getComposerOption ( ) { } public String getRcptOption ( ) { } public void setPathOption ( String string ) { } public void setBodyOption ( String string ) { } public void setComposerOption ( boolean b ) { } public void setRcptOption ( String string ) { } public String getBccOption ( ) { } public String getCcOption ( ) { } public String getMailurlOption ( ) { } public String getAttachmentOption ( ) { } public String getSubjectOption ( ) { } public void setBccOption ( String string ) { } public void setCcOption ( String string ) { } public void setMailurlOption ( String string ) { } public void setSubjectOption ( String string ) { } public void setAttachmentOption ( String string ) { } }

Fix:
System . out . println ( ( "Columba<seq2seq4repair_space>" + ( VersionInfo . getVersion ( ) ) ) ) ;
Buggy code:
@ Component public class BookGenerator { private static String SEPERATOR = "<hr>\n" ; public void generate ( String outputPath , ArrayList < Paragraph > paragraphArrayList ) { } private void save ( String outputPath , StringBuilder sb ) { } private void generateContent ( StringBuilder sb , ArrayList < Paragraph > paragraphArrayList ) { String lastChapterTitle = "" ; for ( Paragraph paragraph : paragraphArrayList ) { <START_BUG> if ( ( paragraph . getTitle ( ) ) != lastChapterTitle ) { <END_BUG> appendH2 ( sb , paragraph . getTitle ( ) ) ; lastChapterTitle = paragraph . getTitle ( ) ; } appendContent ( sb , paragraph ) ; } } private void appendH2 ( StringBuilder sb , String content ) { } private void appendContent ( StringBuilder sb , Paragraph paragraph ) { } private void generateTitle ( StringBuilder sb , ArrayList < Paragraph > paragraphArrayList ) { } private void appendH1 ( StringBuilder sb , String content ) { } private void appendP ( StringBuilder sb , String content ) { } private void appendX ( String tag , StringBuilder sb , String content ) { } }

Fix:
if ( ! ( paragraph . getTitle ( ) . equals ( lastChapterTitle ) ) ) {
Buggy code:
public class CassandraDaemon extends AbstractCassandraDaemon { private static Logger logger = LoggerFactory . getLogger ( CassandraDaemon . class ) ; private HttpServer server ; private InetAddress listenAddr ; private int listenPort ; protected void setup ( ) throws IOException { } public void start ( ) throws IOException { if ( CassandraDaemon . logger . isDebugEnabled ( ) ) CassandraDaemon . logger . debug ( String . format ( "Binding<seq2seq4repair_space>avro<seq2seq4repair_space>service<seq2seq4repair_space>to<seq2seq4repair_space>%s:%s" , listenAddr , listenPort ) ) ; SpecificResponder responder = new SpecificResponder ( Cassandra . class , new CassandraServer ( ) ) ; <START_BUG> CassandraDaemon . logger . info ( "Cassandra<seq2seq4repair_space>starting<seq2seq4repair_space>up..." ) ; <END_BUG> Mx4jTool . maybeLoad ( ) ; server = new HttpServer ( responder , listenPort ) ; } public void stop ( ) { } public static void main ( String [ ] args ) { } }

Fix:
CassandraDaemon . logger . info ( "Listening<seq2seq4repair_space>for<seq2seq4repair_space>avro<seq2seq4repair_space>clients..." ) ;