nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TestSpanishLightStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class ReadMessageTest { @ Test public void testMakeReadMessage ( ) { ArrayList < String > colList = new ArrayList < String > ( ) ; colList . add ( "col1" ) ; colList . add ( "col2" ) ; ReadCommand rm ; ReadCommand rm2 ; rm = new SliceByNamesReadCommand ( "Table1" , "row1" , "foo" , colList ) ; rm2 = serializeAndDeserializeReadMessage ( rm ) ; assert rm2 . toString ( ) . equals ( rm . toString ( ) ) ; rm = new ColumnReadCommand ( "Table1" , "row1" , "foo:col1" ) ; rm2 = serializeAndDeserializeReadMessage ( rm ) ; assert rm2 . toString ( ) . equals ( rm . toString ( ) ) ; rm = new RowReadCommand ( "Table1" , "row1" ) ; rm2 = serializeAndDeserializeReadMessage ( rm ) ; assert rm2 . toString ( ) . equals ( rm . toString ( ) ) ; rm = new ColumnsSinceReadCommand ( "Table1" , "row1" , "foo" , 1 ) ; rm2 = serializeAndDeserializeReadMessage ( rm ) ; assert rm2 . toString ( ) . equals ( rm . toString ( ) ) ; <START_BUG> rm = new SliceFromReadCommand ( "Table1" , "row1" , "foo" , true , 2 ) ; <END_BUG> rm2 = serializeAndDeserializeReadMessage ( rm ) ; assert rm2 . toString ( ) . equals ( rm . toString ( ) ) ; rm = new SliceByRangeReadCommand ( "Table1" , "row1" , "foo" , "a" , "z" , 5 ) ; rm2 = serializeAndDeserializeReadMessage ( rm ) ; assertEquals ( rm2 . toString ( ) , rm . toString ( ) ) ; } private ReadCommand serializeAndDeserializeReadMessage ( ReadCommand rm ) { } @ Test public void testGetColumn ( ) throws IOException , ColumnFamilyNotDefinedException { } }

Fix:
rm = new SliceFromReadCommand ( "Table1" , "row1" , "foo" , true , 0 , 2 ) ;
Buggy code:
class FileRemoveTask implements PatchingTask { private final MiscContentItem item ; private final File target ; private final File backup ; private final PatchingTaskDescription description ; private final List < ContentModification > rollback = new ArrayList < ContentModification > ( ) ; FileRemoveTask ( PatchingTaskDescription description , File target , File backup ) { } @ Override public ContentItem getContentItem ( ) { } @ Override public boolean prepare ( PatchingTaskContext context ) throws IOException { } @ Override public void execute ( PatchingTaskContext context ) throws IOException { } void backup ( final File root , final File backupLocation , final List < String > path , final List < ContentModification > rollback ) throws IOException { if ( ! ( root . exists ( ) ) ) { } else if ( root . isDirectory ( ) ) { final File [ ] files = root . listFiles ( ) ; final String rootName = root . getName ( ) ; <START_BUG> if ( ( files . length ) == 0 ) { <END_BUG> rollback . add ( FileRemoveTask . createRollbackItem ( rootName , path , IoUtils . NO_CONTENT , true ) ) ; } else { final List < String > newPath = new ArrayList < String > ( path ) ; newPath . add ( rootName ) ; for ( File file : files ) { final String name = file . getName ( ) ; final File newBackupLocation = new File ( backupLocation , name ) ; backup ( file , newBackupLocation , newPath , rollback ) ; } } } else { final byte [ ] hash = IoUtils . copy ( root , backupLocation ) ; rollback . add ( FileRemoveTask . createRollbackItem ( root . getName ( ) , path , hash , false ) ) ; } } static ContentModification createRollbackItem ( String name , List < String > path , byte [ ] backupHash , boolean directory ) { } }

Fix:
if ( ( files == null ) || ( ( files . length ) == 0 ) ) {
Buggy code:
public class IdentityManagerImpl implements IdentityManager { private static final Logger LOGGER = LoggerFactory . getLogger ( IdentityManagerImpl . class ) ; public static final String PUBLIC_USER_ID = "public-user" ; private FileDbProvider fileDbProvider ; @ Inject private SecurityManager securityManager ; @ Inject private RelationManager relationManager ; @ Inject public IdentityManagerImpl ( FileDbProvider fileDbProvider ) { } private void createDefaultUsers ( ) { } @ Override public RelationManager getRelationManager ( ) { } @ Override public User getPublicUser ( ) { } @ Override public String getPublicUserId ( ) { } @ Override public UserSession loginPublicUser ( ) { } @ Override public UserSession loginUser ( String fingerprint , String authMessage ) { } @ Override public User authenticateUser ( String fingerprint , String authMessage ) { } @ Override public User authenticateByToken ( String token ) { } @ Override public User getUser ( String fingerprint ) { } @ Override public User getSystemOwner ( ) { } @ Override public User setSystemOwner ( String fingerprint , String publicKeyASCII ) { } @ Override public User addUser ( String publicKeyASCII ) { } @ Override public User addUser ( String publicKeyASCII , int userType ) { User user = null ; try { if ( userType == ( System . getId ( ) ) ) { user = new DefaultUser ( ) ; user . setKeyId ( publicKeyASCII ) ; user . setKeyFingerprint ( publicKeyASCII ) ; user . setType ( System . getId ( ) ) ; } else { if ( ! ( Strings . isNullOrEmpty ( publicKeyASCII ) ) ) { user = new DefaultUser ( securityManager . readPGPKey ( publicKeyASCII ) ) ; <START_BUG> user . setType ( Regular . getId ( ) ) ; <END_BUG> } else { IdentityManagerImpl . LOGGER . info ( "<seq2seq4repair_space>*****<seq2seq4repair_space>Error<seq2seq4repair_space>adding<seq2seq4repair_space>user<seq2seq4repair_space>invalid<seq2seq4repair_space>public<seq2seq4repair_space>key" ) ; } } if ( user != null ) { saveUser ( user ) ; } } catch ( Exception ex ) { IdentityManagerImpl . LOGGER . error ( "<seq2seq4repair_space>*****<seq2seq4repair_space>Error<seq2seq4repair_space>adding<seq2seq4repair_space>user:" , ex ) ; return null ; } return user ; } @ Override public User saveUser ( User user ) { } @ Override public List < User > getAllUsers ( ) { } @ Override public UserToken createUserToken ( User user , String token , String secret , String issuer , Date validDate ) { } @ Override public boolean hasPermmission ( User user , RelationObject relationObject , Permission permission ) { } No newline ; at end ; of file ; }

Fix:
user . setType ( userType ) ;
Buggy code:
public class GraphicsExample { Composite parent ; GraphicsTab [ ] tabs ; GraphicsTab tab ; GraphicsBackground background ; ToolBar toolBar ; Tree tabList ; Text tabDesc ; Sash hSash ; Sash vSash ; Canvas canvas ; Composite tabControlPanel ; ToolItem backItem ; ToolItem dbItem ; Menu backMenu ; ArrayList resources ; ArrayList tabs_in_order ; boolean animate = true ; static boolean advanceGraphics ; static boolean advanceGraphicsInit ; static final int MARGIN = 5 ; static final int SASH_SPACING = 1 ; static final int TIMER = 30 ; static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( "examples_graphics" ) ; public GraphicsExample ( ) { } public GraphicsExample ( final Composite parent ) { } boolean checkAdvancedGraphics ( ) { } void createControls ( final Composite parent ) { } void createCanvas ( Composite parent ) { } void recreateCanvas ( ) { } void createControlPanel ( Composite parent ) { } void createToolBar ( final Composite parent ) { } static Image createThumbnail ( Device device , String name ) { } static Image createImage ( Device device , Color color1 , Color color2 , int width , int height ) { } static Image createImage ( Device device , Color color ) { } void createTabList ( Composite parent ) { } void createTabDesc ( Composite parent ) { } GraphicsTab [ ] createTabs ( ) { } public void dispose ( ) { } TreeItem findItemByData ( TreeItem [ ] items , Object data ) { } public GraphicsTab getTab ( ) { } static String getResourceString ( String key ) { } static Image loadImage ( Device device , Class clazz , String string ) { } Image loadImage ( Device device , String name ) { } public Shell open ( final Display display ) { Shell shell = new Shell ( display ) ; <START_BUG> shell . setText ( GraphicsExample . getResourceString ( "AdvancedGraphics" ) ) ; <END_BUG> final GraphicsExample example = new GraphicsExample ( shell ) ; shell . addListener ( Close , new Listener ( ) { public void handleEvent ( Event event ) { example . dispose ( ) ; } } ) ; shell . open ( ) ; return shell ; } public void redraw ( ) { } public void setDoubleBuffered ( boolean doubleBuffered ) { } public void setFocus ( ) { } public void setTab ( GraphicsTab tab ) { } void startAnimationTimer ( ) { } public static void main ( String [ ] args ) { } }

Fix:
shell . setText ( GraphicsExample . getResourceString ( "GraphicsExample" ) ) ;
Buggy code:
public class ToolBar extends Composite { int itemCount ; ToolItem [ ] items ; NSArray accessibilityAttributes = null ; public ToolBar ( Composite parent , int style ) { } int accessibilityAttributeNames ( int id , int sel ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { NSView widget = ( ( NSView ) ( new SWTView ( ) . alloc ( ) ) ) ; <START_BUG> widget . initWithFrame ( new NSRect ( ) ) ; <END_BUG> view = widget ; } void createItem ( ToolItem item , int index ) { } void createWidget ( ) { } void destroyItem ( ToolItem item ) { } void enableWidget ( boolean enabled ) { } public Rectangle getClientArea ( ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point pt ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } int [ ] layoutHorizontal ( int width , int height , boolean resize ) { } int [ ] layoutVertical ( int width , int height , boolean resize ) { } int [ ] layout ( int nWidth , int nHeight , boolean resize ) { } void relayout ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void removeControl ( Control control ) { } void resized ( ) { } void setFont ( NSFont font ) { } public void setRedraw ( boolean redraw ) { } }

Fix:
widget . init ( ) ;
Buggy code:
public class IO { public static boolean debugMode = true ; private static YTJBServer server = null ; public static void setServer ( YTJBServer s ) { } public static void printlnDebug ( Object speaker , String input ) { } public static BufferedReader getFileOutput ( String filename ) { } public static boolean deleteGapList ( String filename ) { } public static BufferedWriter getFileInput ( String filename ) { } public static String [ ] getGapLists ( String directory ) { IO . printlnDebug ( null , "getting<seq2seq4repair_space>gap<seq2seq4repair_space>lists..." ) ; String [ ] result = null ; File dir = new File ( directory ) ; File [ ] gaplists = dir . listFiles ( ( File f , String s ) -> { <START_BUG> if ( s . contains ( ".jb" ) ) <END_BUG> return true ; else return false ; } ) ; if ( gaplists != null ) { result = new String [ gaplists . length ] ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { result [ i ] = gaplists [ i ] . getName ( ) . substring ( 0 , ( ( gaplists [ i ] . getName ( ) . length ( ) ) - 3 ) ) ; } } return result ; } public static String [ ] readOutGapList ( String filename ) { } public static boolean loadGapListFromFile ( String filename , YTJBServer server ) { } public static boolean saveGapListToFile ( LinkedList < MusicTrack > urls , String filename , YTJBServer server ) { } public static boolean receiveAndSaveFile ( Socket socket , String filename ) { } public static boolean sendFile ( Socket socket , String filename ) { } }

Fix:
if ( s . substring ( ( ( s . length ( ) ) - 3 ) ) . equals ( ".jb" ) )
Buggy code:
public class FullPlaybackActivity extends PlaybackActivity implements View . OnLongClickListener , SeekBar . OnSeekBarChangeListener { public static final int DISPLAY_INFO_OVERLAP = 0 ; public static final int DISPLAY_INFO_BELOW = 1 ; public static final int DISPLAY_INFO_WIDGETS = 2 ; public static final int DISPLAY_INFO_WIDGETS_ZOOMED = 3 ; private TextView mOverlayText ; private View mControlsBottom ; private SeekBar mSeekBar ; private TextView mElapsedView ; private TextView mDurationView ; private TextView mTitle ; private TextView mAlbum ; private TextView mArtist ; private boolean mControlsVisible ; private long mDuration ; private boolean mSeekBarTracking ; private boolean mPaused ; private int mDisplayMode ; private Action mCoverPressAction ; private Action mCoverLongPressAction ; private final StringBuilder mTimeBuilder = new StringBuilder ( ) ; private Song mCurrentSong ; @ Override public void onCreate ( Bundle icicle ) { } @ Override public void onStart ( ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } private void hideMessageOverlay ( ) { } private void showOverlayMessage ( int text ) { } @ Override protected void onStateChange ( int state , int toggled ) { } @ Override protected void onSongChange ( Song song ) { } private void setDuration ( long duration ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public boolean onSearchRequested ( ) { } @ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { } @ Override public boolean onKeyUp ( int keyCode , KeyEvent event ) { } private void updateProgress ( ) { <START_BUG> int position = ( PlaybackService . hasInstance ( ) ) ? PlaybackService . get ( this ) . getPosition ( ) : 0 ; <END_BUG> if ( ! ( mSeekBarTracking ) ) { long duration = mDuration ; mSeekBar . setProgress ( ( duration == 0 ? 0 : ( ( int ) ( ( 1000 * position ) // duration ) ) ) ) ; } mElapsedView . setText ( DateUtils . formatElapsedTime ( mTimeBuilder , ( position // 1000 ) ) ) ; if ( ( ( ! ( mPaused ) ) && ( mControlsVisible ) ) && ( ( ( mState ) & ( PlaybackService . FLAG_PLAYING ) ) != 0 ) ) { long next = 1000 - ( position % 1000 ) ; mUiHandler . removeMessages ( FullPlaybackActivity . MSG_UPDATE_PROGRESS ) ; mUiHandler . sendEmptyMessageDelayed ( FullPlaybackActivity . MSG_UPDATE_PROGRESS , next ) ; } } private void setControlsVisible ( boolean visible ) { } private static final int MSG_UPDATE_PROGRESS = 10 ; private static final int MSG_SAVE_CONTROLS = 14 ; @ Override public boolean handleMessage ( Message message ) { } @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { } @ Override public void performAction ( Action action ) { } @ Override public void onClick ( View view ) { } @ Override public boolean onLongClick ( View view ) { } }

Fix:
long position = ( PlaybackService . hasInstance ( ) ) ? PlaybackService . get ( this ) . getPosition ( ) : 0 ;
Buggy code:
public class ClassFileLoader implements ModuleReader { private ArrayList < BytecodeAttribute . Reader > readers ; private ClassFileReader reader ; public ClassFileLoader ( ) { } public Module read ( ModuleID module , InputStream input ) throws IOException { } protected Module createModule ( ModuleID mid , ClassFile cf ) { } protected Method createMethodInfo ( ModuleID mid , ClassFile . Method cm ) { try { int split = cm . name ( ) . indexOf ( '$' ) ; String name = cm . name ( ) . substring ( 0 , split ) ; String mangle = cm . name ( ) . substring ( ( split + 1 ) , cm . name ( ) . length ( ) ) ; BinaryInputStream bin = new BinaryInputStream ( new JavaIdentifierInputStream ( mangle ) ) ; <START_BUG> Type . Function type = ( ( Type . Function ) ( new Type . BinaryReader ( bin ) . readType ( ) ) ) ; <END_BUG> List < Attribute > attrs = new ArrayList < Attribute > ( ) ; for ( BytecodeAttribute ba : cm . attributes ( ) ) { if ( ba instanceof Attribute ) { attrs . add ( ( ( Attribute ) ( ba ) ) ) ; } } ArrayList < String > parameterNames = new ArrayList < String > ( ) ; for ( int i = 0 ; i != ( type . params ( ) . size ( ) ) ; ++ i ) { parameterNames . add ( ( "$" + i ) ) ; } List < Module . Case > mcases = new ArrayList < Module . Case > ( ) ; mcases . add ( new Module . Case ( null , null , null , Collections . EMPTY_LIST , attrs ) ) ; return new Module . Method ( Collections . EMPTY_LIST , name , type , mcases ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } }

Fix:
Type . FunctionOrMethodOrMessage type = ( ( Type . FunctionOrMethodOrMessage ) ( new Type . BinaryReader ( bin ) . readType ( ) ) ) ;
Buggy code:
public class LongConverter extends AbstractIntegerConverter < Long > { private static final long serialVersionUID = 1L ; public static final IConverter < Long > INSTANCE = new LongConverter ( ) ; public Long convertToObject ( final String value , Locale locale ) { final Number number = parse ( value , Long . MIN_VALUE , Long . MAX_VALUE , locale ) ; if ( number == null ) { return null ; } <START_BUG> return new Long ( number . longValue ( ) ) ; <END_BUG> } @ Override protected Class < Long > getTargetType ( ) { } }

Fix:
return number . longValue ( ) ;
Buggy code:
public class SafepointManager { private final RubyContext context ; private final Set < SafepointManager . RunningThread > runningThreads = Collections . newSetFromMap ( new ConcurrentHashMap < SafepointManager . RunningThread , Boolean > ( ) ) ; @ CompilerDirectives . CompilationFinal private Assumption assumption = Truffle . getRuntime ( ) . createAssumption ( ) ; private final ReentrantLock lock = new ReentrantLock ( ) ; private final Phaser phaser = new Phaser ( ) ; private volatile Consumer < RubyThread > action ; public SafepointManager ( RubyContext context ) { } public void enterThread ( ) { } public void enterThread ( boolean interruptible ) { } public void leaveThread ( ) { CompilerAsserts . neverPartOfCompilation ( ) ; phaser . arriveAndDeregister ( ) ; <START_BUG> runningThreads . remove ( Thread . currentThread ( ) ) ; <END_BUG> } public void poll ( ) { } private void poll ( boolean holdsGlobalLock ) { } private void assumptionInvalidated ( boolean holdsGlobalLock , boolean isDrivingThread ) { } private void step ( RubyThread thread , boolean isDrivingThread ) { } public void pauseAllThreadsAndExecute ( Consumer < RubyThread > action ) { } public void pauseAllThreadsAndExecuteFromNonRubyThread ( Consumer < RubyThread > action ) { } public void pauseAllThreadsAndExecute ( boolean holdsGlobalLock , Consumer < RubyThread > action ) { } private void interruptAllThreads ( ) { } private static class RunningThread { private final Thread thread ; private final boolean interruptible ; public RunningThread ( Thread thread , boolean interruptible ) { } public Thread getThread ( ) { } public boolean isInterruptible ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } } }

Fix:
runningThreads . remove ( new SafepointManager . RunningThread ( Thread . currentThread ( ) , false ) ) ;
Buggy code:
public class MessageConstructor { private Context mContext ; private ProgressNotification mProgressNotification ; private SettingsHelper mSettingsHelper ; public MessageConstructor ( Context context , SettingsHelper settingsHelper ) { } public String makeMessage ( GuiUpdateObject guiUpdateObject ) { } public void updateNotification ( AuthorUpdateProgress progress ) { } public void updateNotification ( Author author ) { if ( ( mProgressNotification ) == null ) { <START_BUG> mProgressNotification = new ProgressNotification ( mSettingsHelper , "text" ) ; <END_BUG> } mProgressNotification . update ( author ) ; } private void showMessage ( String msg ) { } public void showMessage ( GuiUpdateObject guiUpdateObject ) { } public void showUpdateNotification ( Result res ) { } public void cancelProgress ( ) { } }

Fix:
return ;
Buggy code:
public class ServerAddHandler extends AbstractAddStepHandler { public static final String OPERATION_NAME = ADD ; public static final ServerAddHandler INSTANCE = new ServerAddHandler ( ) ; private ServerAddHandler ( ) { } @ Override protected void populateModel ( final OperationContext context , final ModelNode operation , final Resource resource ) throws OperationFailedException { final ModelNode model = resource . getModel ( ) ; for ( AttributeDefinition attr : ServerConfigResourceDefinition . WRITABLE_ATTRIBUTES ) { attr . validateAndSet ( operation , model ) ; } final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final PathAddress running = address . subAddress ( 0 , 1 ) . append ( PathElement . pathElement ( RUNNING_SERVER , address . getLastElement ( ) . getValue ( ) ) ) ; final ModelNode runningServerAdd = new ModelNode ( ) ; runningServerAdd . get ( OP ) . set ( ADD ) ; runningServerAdd . get ( OP_ADDR ) . set ( running . toModelNode ( ) ) ; context . addStep ( runningServerAdd , new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { context . createResource ( EMPTY_ADDRESS ) ; context . stepCompleted ( ) ; } <START_BUG> } , IMMEDIATE ) ; <END_BUG> } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { } }

Fix:
} , MODEL , true ) ;
Buggy code:
public class WebBinder extends GenericBinder { private String defaultPrefix = "!" ; private String presentPrefix = "_" ; public WebBinder ( Object model ) { } public void setDefaultPrefix ( String defaultPrefix ) { } public void setPresentPrefix ( String presentPrefix ) { } @ Override public UserValues createUserValues ( Map < String , ? extends Object > userMap ) { } protected Object getEmptyValue ( BindingImpl binding ) { <START_BUG> Class < ? > type = binding . getValueType ( ) ; <END_BUG> if ( ( boolean . class . equals ( type ) ) || ( Boolean . class . equals ( type ) ) ) { return Boolean . FALSE ; } else { return null ; } } }

Fix:
Class < ? > type = binding . getType ( ) ;
Buggy code:
public class CsfdDatasource implements IDatasource { public CsfdDatasource ( ) { } @ Override public Film getFilmByName ( String name ) throws FilmNotFoundException , IOException , JSONException { URL url = new URL ( ( "http:////csfdapi.cz//movie?search=" + ( name . replace ( "<seq2seq4repair_space>" , "+" ) ) ) ) ; HttpURLConnection con = null ; try { con = ( ( HttpURLConnection ) ( url . openConnection ( ) ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } InputStream is = con . getInputStream ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( is ) ) ; StringBuilder out = new StringBuilder ( ) ; String line ; JSONArray obj = null ; try { while ( ( line = reader . readLine ( ) ) != null ) { out . append ( line ) ; } } catch ( IOException e ) { System . err . println ( "Unknown<seq2seq4repair_space>I//O<seq2seq4repair_space>error<seq2seq4repair_space>while<seq2seq4repair_space>reading<seq2seq4repair_space>response<seq2seq4repair_space>from<seq2seq4repair_space>server!<seq2seq4repair_space>Dying..." ) ; } String response = out . toString ( ) ; <START_BUG> if ( response == "[]" ) { <END_BUG> throw new FilmNotFoundException ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>film<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>name!" ) ; } obj = new JSONArray ( response ) ; return getFilmById ( String . valueOf ( obj . getJSONObject ( 0 ) . getInt ( "id" ) ) ) ; } @ Override public Film getFilmById ( String id ) throws IOException , JSONException { } }

Fix:
if ( response . equals ( "[]" ) ) {
Buggy code:
public class CreateVirtualFolderAction extends FrameAction implements SelectionListener { public CreateVirtualFolderAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { EditFolderDialog dialog = new EditFolderDialog ( "New<seq2seq4repair_space>Folder" ) ; dialog . showDialog ( ) ; String name ; <START_BUG> if ( ( dialog . success ( ) ) == true ) { <END_BUG> name = dialog . getName ( ) ; try { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( frameController . getSelectionManager ( ) . getSelection ( "mail.tree" ) ) ) ; r [ 0 ] . getFolder ( ) . addFolder ( name , "VirtualFolder" ) ; treeModel . nodeStructureChanged ( ( ( MailFrameController ) ( getFrameController ( ) ) ) . treeController . getTreeSelectionManager ( ) . getFolder ( ) ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } else { return ; } } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
if ( dialog . success ( ) ) {
Buggy code:
public class DetachedWindow { private PartStack folder ; private WorkbenchPage page ; private String title ; private Rectangle bounds = new Rectangle ( 0 , 0 , 0 , 0 ) ; private Shell s ; private boolean hideViewsOnClose = true ; private ShellListener shellListener = new ShellAdapter ( ) { public void shellClosed ( ShellEvent e ) { } } ; private Listener resizeListener = new Listener ( ) { public void handleEvent ( Event event ) { } } ; public DetachedWindow ( WorkbenchPage workbenchPage ) { } public Shell getShell ( ) { } public void create ( ) { } public void add ( ViewPane part ) { } public boolean belongsToWorkbenchPage ( IWorkbenchPage workbenchPage ) { } public boolean close ( ) { } private boolean handleClose ( ) { } private void collectViewPanes ( List result , LayoutPart [ ] parts ) { } protected void configureShell ( Shell shell ) { } protected Control createContents ( Composite parent ) { } public LayoutPart [ ] getChildren ( ) { } public WorkbenchPage getWorkbenchPage ( ) { } public void restoreState ( IMemento memento ) { } public void saveState ( IMemento memento ) { } public Control getControl ( ) { } private static boolean intersectsAnyMonitor ( Display display , Rectangle someRectangle ) { } public int open ( ) { if ( ( getShell ( ) ) == null ) create ( ) ; Rectangle bounds = getShell ( ) . getBounds ( ) ; <START_BUG> getShell ( ) . open ( ) ; <END_BUG> if ( ! ( bounds . equals ( getShell ( ) . getBounds ( ) ) ) ) { getShell ( ) . setBounds ( bounds ) ; } return Window . OK ; } }

Fix:
getShell ( ) . setVisible ( true ) ;
Buggy code:
public class Button extends Control { String text = "" ; Image image ; int cIcon ; boolean isImage ; boolean tracking ; public Button ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void click ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } int defaultThemeFont ( ) { } void drawWidget ( int control , int damageRgn , int visibleRgn , int theEvent ) { } public int getAlignment ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public boolean getSelection ( ) { } public String getText ( ) { } Rect getInset ( ) { } int kEventControlHit ( int nextHandler , int theEvent , int userData ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { int result = super . kEventMouseDown ( nextHandler , theEvent , userData ) ; if ( result == ( OS . noErr ) ) return result ; display . grabControl = null ; display . runDeferredEvents ( ) ; tracking = false ; result = OS . CallNextEventHandler ( nextHandler , theEvent ) ; if ( tracking ) { org . eclipse . swt . internal . carbon . Point outPt = new org . eclipse . swt . internal . carbon . Point ( ) ; OS . GetGlobalMouse ( outPt ) ; Rect rect = new Rect ( ) ; int window = OS . GetControlOwner ( handle ) ; OS . GetWindowBounds ( window , ( ( short ) ( kWindowContentRgn ) ) , rect ) ; int x = ( outPt . h ) - ( rect . left ) ; int y = ( outPt . v ) - ( rect . top ) ; OS . GetControlBounds ( handle , rect ) ; x -= rect . left ; y -= rect . top ; short [ ] button = new short [ 1 ] ; OS . GetEventParameter ( theEvent , kEventParamMouseButton , typeMouseButton , null , 2 , null , button ) ; int chord = OS . GetCurrentEventButtonState ( ) ; int modifiers = OS . GetCurrentEventKeyModifiers ( ) ; <START_BUG> sendMouseEvent ( MouseUp , button [ 0 ] , chord , ( ( short ) ( x ) ) , ( ( short ) ( y ) ) , modifiers , false ) ; <END_BUG> } tracking = false ; return result ; } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventControlTrack ( int nextHandler , int theEvent , int userData ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAlignment ( int alignment ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } void setDefault ( boolean value ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } int traversalCode ( int key , int theEvent ) { } }

Fix:
sendMouseEvent ( MouseUp , button [ 0 ] , chord , ( ( short ) ( x ) ) , ( ( short ) ( y ) ) , modifiers , true ) ;
Buggy code:
public abstract class AbstractVector implements Vector { private transient Map < String , Integer > bindings ; private String name ; protected int size ; protected double lengthSquared = - 1 ; protected AbstractVector ( ) { } protected AbstractVector ( String name ) { } protected AbstractVector ( String name , int size ) { } public double aggregate ( BinaryFunction aggregator , UnaryFunction map ) { } public double aggregate ( Vector other , BinaryFunction aggregator , BinaryFunction combiner ) { } protected abstract Matrix matrixLike ( int rows , int columns ) { } public Vector viewPart ( int offset , int length ) { } @ Override public Vector clone ( ) { } public Vector divide ( double x ) { } public double dot ( Vector x ) { if ( ( size ( ) ) != ( x . size ( ) ) ) { <START_BUG> throw new CardinalityException ( ) ; <END_BUG> } double result = 0 ; Iterator < Element > iter = iterateNonZero ( ) ; while ( iter . hasNext ( ) ) { Element element = iter . next ( ) ; result += ( element . get ( ) ) * ( x . getQuick ( element . index ( ) ) ) ; } return result ; } public double get ( int index ) { } public Vector minus ( Vector x ) { } public Vector normalize ( ) { } public Vector normalize ( double power ) { } public double norm ( double power ) { } public double getLengthSquared ( ) { } public double getDistanceSquared ( Vector v ) { } public double maxValue ( ) { } public int maxValueIndex ( ) { } public Vector plus ( double x ) { } public Vector plus ( Vector x ) { } public void addTo ( Vector v ) { } public void set ( int index , double value ) { } public Vector times ( double x ) { } public Vector times ( Vector x ) { } public double zSum ( ) { } public Vector assign ( double value ) { } public Vector assign ( double [ ] values ) { } public Vector assign ( Vector other ) { } public Vector assign ( BinaryFunction f , double y ) { } public Vector assign ( UnaryFunction function ) { } public Vector assign ( Vector other , BinaryFunction function ) { } public Matrix cross ( Vector other ) { } public static Vector decodeVector ( String formattedString ) { } public String getName ( ) { } public void setName ( String name ) { } public int size ( ) { } public String asFormatString ( ) { } public static boolean equivalent ( Vector left , Vector right ) { } public static boolean strictEquivalence ( Vector left , Vector right ) { } @ Override public int hashCode ( ) { } public double get ( String label ) throws IndexException , UnboundLabelException { } public Map < String , Integer > getLabelBindings ( ) { } public void set ( String label , double value ) throws IndexException , UnboundLabelException { } public void setLabelBindings ( Map < String , Integer > bindings ) { } public void set ( String label , int index , double value ) throws IndexException { } }

Fix:
throw new CardinalityException ( size ( ) , x . size ( ) ) ;
Buggy code:
public class DeploymentDeployHandler implements ModelUpdateOperationHandler , DescriptionProvider { public static final String OPERATION_NAME = DEPLOY ; static ModelNode getOperation ( ModelNode address ) { } public static final DeploymentDeployHandler INSTANCE = new DeploymentDeployHandler ( ) ; private DeploymentDeployHandler ( ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public OperationResult execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) throws OperationFailedException { ModelNode model = context . getSubModel ( ) ; model . get ( ENABLED ) . set ( true ) ; ModelNode compensatingOp = DeploymentUndeployHandler . getOperation ( operation . get ( OP_ADDR ) ) ; final String name = model . require ( NAME ) . asString ( ) ; final String runtimeName = model . require ( RUNTIME_NAME ) . asString ( ) ; final DeploymentHandlerUtil [ ] contents = AbstractDeploymentHandler . getContents ( model . require ( CONTENT ) ) ; <START_BUG> DeploymentHandlerUtil . deploy ( context , name , runtimeName , resultHandler , contents ) ; <END_BUG> return new org . jboss . as . controller . BasicOperationResult ( compensatingOp ) ; } }

Fix:
DeploymentHandlerUtil . deploy ( context , runtimeName , name , resultHandler , contents ) ;
Buggy code:
public class ContactManagerImpl implements ContactManager { private Set < Contact > contacts ; private int lastContactId ; public ContactManagerImpl ( ) { } public int addFutureMeeting ( Set < Contact > contacts , Calendar date ) { } public PastMeeting getPastMeeting ( int id ) { } public FutureMeeting getFutureMeeting ( int id ) { } public Meeting getMeeting ( int id ) { } public List < Meeting > getFutureMeetingList ( Contact contact ) { } public List < Meeting > getFutureMeetingList ( Calendar date ) { } public List < PastMeeting > getPastMeetingList ( Contact contact ) { } public void addNewPastMeeting ( Set < Contact > contacts , Calendar date , String text ) { } public void addMeetingNotes ( int id , String text ) { } public void addNewContact ( String name , String notes ) { } public Set < Contact > getContacts ( int ... ids ) { for ( int i = 0 ; i < ( ids . length ) ; i ++ ) { <START_BUG> if ( ( ( ids [ i ] ) < 0 ) || ( ( ids [ i ] ) > ( lastContactId ) ) ) { <END_BUG> throw new IllegalArgumentException ( "ID<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ; } } return new HashSet < Contact > ( ) ; } public Set < Contact > getContacts ( String name ) { } public void flush ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ids [ i ] ) <= 0 ) || ( ( ids [ i ] ) > ( lastContactId ) ) ) {
Buggy code:
@ Configuration public class ApplicationConfiguration { @ Inject Environment env ; @ Bean public ConversionService conversionService ( ) { } @ Bean public Boolean initializeData ( ) { <START_BUG> if ( ( env . getProperty ( "init" ) ) == null ) { <END_BUG> return Boolean . FALSE ; } else { return Boolean . TRUE ; } } }

Fix:
if ( ( ( env ) != null ) && ( ( env . getProperty ( "init" ) ) == null ) ) {
Buggy code:
public final class WicketComponentTree extends Panel { public WicketComponentTree ( final String id , final Page page ) { } private List getComponentData ( final Page page ) { final List data = new ArrayList ( ) ; page . visitChildren ( new IVisitor ( ) { public Object component ( final Component component ) { if ( ! ( component . getPath ( ) . startsWith ( WicketComponentTree . this . getPath ( ) ) ) ) { final WicketComponentTree . ComponentData object = new WicketComponentTree . ComponentData ( ) ; String name = component . getClass ( ) . getName ( ) ; if ( ( name . indexOf ( "$" ) ) > 0 ) { name = component . getClass ( ) . getSuperclass ( ) . getName ( ) ; } <START_BUG> name = Strings . lastPathComponent ( name , '.' ) ; <END_BUG> object . path = component . getPageRelativePath ( ) ; object . type = name ; try { object . value = component . getModelObjectAsString ( ) ; } catch ( Exception e ) { object . value = e . getMessage ( ) ; } data . add ( object ) ; } return IVisitor . CONTINUE_TRAVERSAL ; } } ) ; return data ; } private class ComponentData implements Serializable { public String path ; public String type ; public String value ; } }

Fix:
name = Strings . lastPathComponent ( name , ':' ) ;
Buggy code:
public class SelectPage extends WicketExamplePage { private static final List < String > SITES = Arrays . asList ( "The<seq2seq4repair_space>Server<seq2seq4repair_space>Side" , "Java<seq2seq4repair_space>Lobby" , "Java.Net" ) ; private static final List < ? extends String > MANY_CHOICES = Arrays . asList ( "Choice1" , "Choice2" , "Choice3" , "Choice4" , "Choice5" , "Choice6" , "Choice7" , "Choice8" , "Choice9" ) ; public SelectPage ( ) { } private static class Input implements IClusterable { public String site = "sd" ; public List < String > choices = new ArrayList < String > ( ) ; public Input ( ) { } @ Override public String toString ( ) { } private String listAsString ( List < String > list ) { <START_BUG> StringBuffer b = new StringBuffer ( ) ; <END_BUG> for ( Iterator < String > i = list . iterator ( ) ; i . hasNext ( ) ; ) { b . append ( i . next ( ) ) ; if ( i . hasNext ( ) ) { b . append ( ",<seq2seq4repair_space>" ) ; } } return b . toString ( ) ; } } @ Override protected void explain ( ) { } }

Fix:
StringBuilder b = new StringBuilder ( ) ;
Buggy code:
@ Service public class ContentServiceImpl extends BaseServiceImpl implements ContentService { @ Resource private ContentDao contentDao ; @ Resource private UserDao userDao ; @ Override public Pagination < ContentListVO > listAllContents ( ContentListRequest contentListRequest ) { } @ Override public ContentVO getDetailById ( Integer contentId ) { } @ Override @ Transactional public void publishContent ( ContentRequest contentRequest ) { } private List < ContentListVO > formatContentsToVOs ( List < Content > contents ) { } private ContentListVO formatContentToVO ( Content content ) { ContentListVO vo = new ContentListVO ( ) ; vo . setContentId ( content . getContentId ( ) ) ; vo . setTitle ( content . getTitle ( ) ) ; vo . setDescription ( content . getDescription ( ) ) ; vo . setSortOrder ( content . getSortOrder ( ) ) ; <START_BUG> vo . setCreate ( content . getCreated ( ) ) ; <END_BUG> User user = userDao . getById ( content . getUserId ( ) ) ; vo . setNickname ( user . getNickname ( ) ) ; vo . setAvatar ( user . getAvatar ( ) ) ; return vo ; } private ContentListCriteria generateCriteria ( ContentListRequest contentListRequest ) { } }

Fix:
vo . setCreated ( content . getCreated ( ) ) ;
Buggy code:
public final class FontData { public String name ; public float height ; public int style ; public byte [ ] string ; String lang ; String country ; String variant ; public FontData ( ) { } public FontData ( String string ) { } public FontData ( String name , int height , int style ) { } FontData ( String name , float height , int style ) { } public boolean equals ( Object object ) { } public int getHeight ( ) { } float getHeightF ( ) { } public String getLocale ( ) { } public String getName ( ) { } public int getStyle ( ) { } public int hashCode ( ) { } public void setHeight ( int height ) { } void setHeight ( float height ) { } public void setLocale ( String locale ) { } public void setName ( String name ) { } public void setStyle ( int style ) { } public String toString ( ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> buffer . append ( "1|" ) ; buffer . append ( getName ( ) ) ; buffer . append ( "|" ) ; buffer . append ( getHeightF ( ) ) ; buffer . append ( "|" ) ; buffer . append ( getStyle ( ) ) ; buffer . append ( "|" ) ; buffer . append ( "GTK|1|" ) ; return buffer . toString ( ) ; } }

Fix:
StringBuffer buffer = new StringBuffer ( 128 ) ;
Buggy code:
public class JettyWebSocketClient extends AbstractWebSocketClient implements SmartLifecycle { private final WebSocketClient client ; private boolean autoStartup = true ; private int phase = Integer . MAX_VALUE ; private final Object lifecycleMonitor = new Object ( ) ; private AsyncListenableTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor ( "WebSocketClient-" ) ; public JettyWebSocketClient ( ) { } public JettyWebSocketClient ( WebSocketClient client ) { } public void setTaskExecutor ( AsyncListenableTaskExecutor taskExecutor ) { <START_BUG> Assert . notNull ( taskExecutor , "taskExecutor<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; <END_BUG> this . taskExecutor = taskExecutor ; } public AsyncListenableTaskExecutor getTaskExecutor ( ) { } public void setAutoStartup ( boolean autoStartup ) { } @ Override public boolean isAutoStartup ( ) { } public void setPhase ( int phase ) { } @ Override public int getPhase ( ) { } @ Override public boolean isRunning ( ) { } @ Override public void start ( ) { } @ Override public void stop ( ) { } @ Override public void stop ( Runnable callback ) { } @ Override public ListenableFuture < WebSocketSession > doHandshake ( WebSocketHandler webSocketHandler , String uriTemplate , Object ... uriVars ) { } @ Override public ListenableFuture < WebSocketSession > doHandshakeInternal ( WebSocketHandler wsHandler , HttpHeaders headers , final URI uri , List < String > protocols , List < WebSocketExtension > extensions , Map < String , Object > handshakeAttributes ) { } protected Principal getUser ( ) { } }

Fix:
Assert . notNull ( taskExecutor , "TaskExecutor<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ;
Buggy code:
public abstract class AbstractAddStepHandler implements NewStepHandler { public void execute ( final NewOperationContext context , final ModelNode operation ) throws OperationFailedException { final ModelNode model = context . readModelForUpdate ( EMPTY_ADDRESS ) ; populateModel ( operation , model ) ; if ( requiresRuntime ( ) ) { if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new NewStepHandler ( ) { public void execute ( NewOperationContext context , ModelNode operation ) throws OperationFailedException { final List < ServiceController < ? > > controllers = new ArrayList < ServiceController < ? > > ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; performRuntime ( context , operation , model , verificationHandler , controllers ) ; if ( requiresRuntimeVerification ( ) ) { context . addStep ( verificationHandler , VERIFY ) ; } if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { for ( ServiceController < ? > controller : controllers ) { <START_BUG> context . removeService ( controller ) ; <END_BUG> } } } } , RUNTIME ) ; } } context . completeStep ( ) ; } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected void performRuntime ( final NewOperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } protected boolean requiresRuntime ( ) { } protected boolean requiresRuntimeVerification ( ) { } }

Fix:
context . removeService ( controller . getName ( ) ) ;
Buggy code:
public class UploadWebRequest extends ServletWebRequest { public UploadWebRequest ( final HttpServletRequest httpServletRequest , final String filterPrefix ) { } public UploadWebRequest ( final HttpServletRequest httpServletRequest , final String filterPrefix , final Url url ) { } @ Override public MultipartServletWebRequest newMultipartWebRequest ( final Bytes maxsize ) throws FileUploadException { <START_BUG> return new MultipartRequest ( getHttpServletRequest ( ) , getFilterPrefix ( ) , maxsize ) ; <END_BUG> } private static final String SESSION_KEY = UploadWebRequest . class . getName ( ) ; static UploadInfo getUploadInfo ( final HttpServletRequest req ) { } static void setUploadInfo ( final HttpServletRequest req , final UploadInfo uploadInfo ) { } static void clearUploadInfo ( final HttpServletRequest req ) { } }

Fix:
return new MultipartRequest ( getContainerRequest ( ) , getFilterPrefix ( ) , maxsize ) ;
Buggy code:
public class FormTagTests extends AbstractHtmlElementTagTests { private static final String REQUEST_URI = "//my//form" ; private static final String QUERY_STRING = "foo=bar" ; private FormTag tag ; private MockHttpServletRequest request ; @ Override @ SuppressWarnings ( "serial" ) protected void onSetUp ( ) { } @ Override protected void extendRequest ( MockHttpServletRequest request ) { } public void testWriteForm ( ) throws Exception { } public void testWithActionFromRequest ( ) throws Exception { } public void testWithNullResolvedCommand ( ) throws Exception { } public void testXSSScriptingExploitWhenActionIsResolvedFromQueryString ( ) throws Exception { } public void testGet ( ) throws Exception { } public void testPost ( ) throws Exception { } public void testPut ( ) throws Exception { } public void testDelete ( ) throws Exception { } public void testCustomMethodParameter ( ) throws Exception { } public void testClearAttributesOnFinally ( ) throws Exception { } public void testRequestDataValueProcessorHooks ( ) throws Exception { String action = "//my//form?foo=bar" ; RequestDataValueProcessor processor = getMockRequestDataValueProcessor ( ) ; expect ( processor . processAction ( this . request , action ) ) . andReturn ( action ) ; expect ( processor . getExtraHiddenFields ( this . request ) ) . andReturn ( Collections . singletonMap ( "key" , "value" ) ) ; replay ( processor ) ; this . tag . doStartTag ( ) ; this . tag . doEndTag ( ) ; this . tag . doFinally ( ) ; String output = getOutput ( ) ; <START_BUG> assertEquals ( "<input<seq2seq4repair_space>type=\"hidden\"<seq2seq4repair_space>name=\"key\"<seq2seq4repair_space>value=\"value\"><//input>" , getInputTag ( output ) ) ; <END_BUG> FormTagTests . assertFormTagOpened ( output ) ; FormTagTests . assertFormTagClosed ( output ) ; verify ( processor ) ; } private String getFormTag ( String output ) { } private String getInputTag ( String output ) { } private static void assertFormTagOpened ( String output ) { } private static void assertFormTagClosed ( String output ) { } }

Fix:
assertEquals ( "<input<seq2seq4repair_space>type=\"hidden\"<seq2seq4repair_space>name=\"key\"<seq2seq4repair_space>value=\"value\"<seq2seq4repair_space>//>" , getInputTag ( output ) ) ;
Buggy code:
public class RuleReportTest extends TestCase { public RuleReportTest ( String testName ) { } public static Test suite ( ) { } public void testConstructorAndGetters ( ) { Rule mockRule = mock ( Rule . class ) ; RuleReport ruleReport = new RuleReport ( mockRule , "should<seq2seq4repair_space>be<seq2seq4repair_space>like<seq2seq4repair_space>that" , 5.0F ) ; assertEquals ( "should<seq2seq4repair_space>be<seq2seq4repair_space>like<seq2seq4repair_space>that" , ruleReport . getSuggestion ( ) ) ; <START_BUG> assertEquals ( 100.0F , ruleReport . getScore ( ) ) ; <END_BUG> ReportEntry mockReportEntry = mock ( ReportEntry . class ) ; when ( mockReportEntry . isSuccess ( ) ) . thenReturn ( true ) ; ruleReport . addEntry ( mockReportEntry ) ; assertTrue ( ruleReport . getEntries ( ) . contains ( mockReportEntry ) ) ; assertEquals ( 100.0F , ruleReport . getScore ( ) ) ; assertEquals ( 0.0F , ruleReport . getDebt ( ) ) ; ReportEntry mockReportEntry2 = mock ( ReportEntry . class ) ; when ( mockReportEntry2 . isSuccess ( ) ) . thenReturn ( false ) ; ruleReport . addEntry ( mockReportEntry2 ) ; assertTrue ( ruleReport . getEntries ( ) . contains ( mockReportEntry2 ) ) ; assertEquals ( 50.0F , ruleReport . getScore ( ) ) ; assertEquals ( 5.0F , ruleReport . getDebt ( ) ) ; } }

Fix:
assertEquals ( null , ruleReport . getScore ( ) ) ;