nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class Task extends ProjectComponent { protected Target target ; protected String taskName ; protected String taskType ; protected RuntimeConfigurable wrapper ; private boolean invalid ; public Task ( ) { } public void setOwningTarget ( Target target ) { } public Target getOwningTarget ( ) { } public void setTaskName ( String name ) { } public String getTaskName ( ) { } public void setTaskType ( String type ) { } public void init ( ) throws BuildException { } public void execute ( ) throws BuildException { } public RuntimeConfigurable getRuntimeConfigurableWrapper ( ) { } public void setRuntimeConfigurableWrapper ( RuntimeConfigurable wrapper ) { } public void maybeConfigure ( ) throws BuildException { } public void reconfigure ( ) { } protected void handleOutput ( String output ) { } protected void handleFlush ( String output ) { } protected int handleInput ( byte [ ] buffer , int offset , int length ) throws IOException { } protected void handleErrorOutput ( String output ) { } protected void handleErrorFlush ( String output ) { } public void log ( String msg ) { } public void log ( String msg , int msgLevel ) { } public void log ( Throwable t , int msgLevel ) { } public void log ( String msg , Throwable t , int msgLevel ) { } public final void perform ( ) { } final void markInvalid ( ) { } protected final boolean isInvalid ( ) { } private UnknownElement replacement ; private UnknownElement getReplacement ( ) { if ( ( replacement ) == null ) { replacement = new UnknownElement ( taskType ) ; replacement . setProject ( getProject ( ) ) ; replacement . setTaskType ( taskType ) ; replacement . setTaskName ( taskName ) ; <START_BUG> replacement . setLocation ( location ) ; <END_BUG> replacement . setOwningTarget ( target ) ; replacement . setRuntimeConfigurableWrapper ( wrapper ) ; wrapper . setProxy ( replacement ) ; replaceChildren ( wrapper , replacement ) ; target . replaceChild ( this , replacement ) ; replacement . maybeConfigure ( ) ; } return replacement ; } private void replaceChildren ( RuntimeConfigurable wrapper , UnknownElement parentElement ) { } public String getTaskType ( ) { } protected RuntimeConfigurable getWrapper ( ) { } public final void bindToOwner ( Task owner ) { } }

Fix:
replacement . setLocation ( getLocation ( ) ) ;
Buggy code:
public class PitScoutingMainFragment extends Fragment implements OnNavigationListener , IListFragmentCallbacks { @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void displayAssignedTeamList ( ) { } private void displayAllTeamList ( ) { Fragment fragment = new ViewQueryResultsInListFragment ( ) ; ( ( ViewQueryResultsInListFragment ) ( fragment ) ) . setCallbacks ( this ) ; Bundle args = new Bundle ( ) ; args . putInt ( QUERY_TYPE , ALL_PIT_LIST ) ; fragment . setArguments ( args ) ; <START_BUG> getFragmentManager ( ) . beginTransaction ( ) . add ( list_container , fragment , "teamList" ) . commitAllowingStateLoss ( ) ; <END_BUG> } @ Override public void onListItemClick ( String fragmentTag , int position , long id ) { } @ Override public boolean onNavigationItemSelected ( int position , long id ) { } }

Fix:
getFragmentManager ( ) . beginTransaction ( ) . replace ( list_container , fragment , "teamList" ) . commitAllowingStateLoss ( ) ;
Buggy code:
public class DataSourceEnable implements OperationStepHandler { static final DataSourceEnable LOCAL_INSTANCE = new DataSourceEnable ( false ) ; static final DataSourceEnable XA_INSTANCE = new DataSourceEnable ( true ) ; private final boolean xa ; public DataSourceEnable ( boolean xa ) { } public void execute ( OperationContext context , ModelNode operation ) { final ModelNode model = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; boolean persist = operation . get ( PERSISTENT ) . asBoolean ( true ) ; if ( persist ) { model . get ( ENABLED ) . set ( true ) ; } else if ( ( model . hasDefined ( ENABLED ) ) && ( ! ( model . get ( ENABLED ) . asBoolean ( ) ) ) ) { model . get ( ENABLED ) . set ( new ModelNode ( ) ) ; } <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; DataSourceEnable . addServices ( context , operation , verificationHandler , model , isXa ( ) ) ; context . addStep ( verificationHandler , VERIFY ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } static void addServices ( OperationContext context , ModelNode operation , ServiceVerificationHandler verificationHandler , ModelNode model , boolean isXa ) throws OperationFailedException { } public static DataSourceEnable getLocalInstance ( ) { } public boolean isXa ( ) { } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class AcknowledgedDemo { private static class Listener implements BroadcastListener < BroadcastDataMessage > { boolean doOnce = true ; private Channel master ; boolean printed = false ; Listener ( Channel master ) { } @ Override public void receiveMessage ( BroadcastDataMessage message ) { if ( doOnce ) { doOnce = false ; new Thread ( ) { public void run ( ) { sendAck ( ) ; } } . start ( ) ; } if ( message instanceof DeviceInfoQueryable ) { if ( ! ( printed ) ) { printed = true ; DeviceInfoQueryable d = ( ( DeviceInfoQueryable ) ( message ) ) ; System . out . println ( ) ; System . out . println ( ( "Ex.<seq2seq4repair_space>id:" + ( d . getDeviceNumber ( ) ) ) ) ; System . out . println ( ( "Ex.<seq2seq4repair_space>tran:" + ( d . getTransmissionType ( ) ) ) ) ; <START_BUG> System . out . println ( ( "Ex.<seq2seq4repair_space>type:" + ( ( d . getDeviceType ( ) . intValue ( ) ) & 255 ) ) ) ; <END_BUG> System . out . println ( ) ; } } } public void sendAck ( ) { } } public static void sendAnAck ( Channel master ) { } private static class AckListener implements BroadcastListener < AcknowledgedDataMessage > { @ Override public void receiveMessage ( AcknowledgedDataMessage message ) { } } private static final int HRM_CHANNEL_PERIOD = 8070 ; private static final int HRM_CHANNEL_FREQ = 57 ; private static final boolean HRM_PAIRING_FLAG = true ; private static final int HRM_TRANSMISSION_TYPE = 1 ; private static final int HRM_DEVICE_TYPE = 120 ; private static final int MASTER_ID = 1234 ; private static final ChannelId HRM_WILDCARD_CHANNEL_ID = Builder . newInstance ( ) . setDeviceNumber ( WILDCARD ) . setDeviceType ( AcknowledgedDemo . HRM_DEVICE_TYPE ) . setTransmissonType ( WILDCARD ) . setPairingFlag ( AcknowledgedDemo . HRM_PAIRING_FLAG ) . build ( ) ; private static final ChannelId HRM_MASTER_CHANNEL_ID = Builder . newInstance ( ) . setDeviceNumber ( AcknowledgedDemo . MASTER_ID ) . setDeviceType ( AcknowledgedDemo . HRM_DEVICE_TYPE ) . setTransmissonType ( AcknowledgedDemo . HRM_TRANSMISSION_TYPE ) . setPairingFlag ( AcknowledgedDemo . HRM_PAIRING_FLAG ) . build ( ) ; private static final ChannelType MASTER_TYPE = new MasterChannelType ( ) ; private static final ChannelType SLAVE_TYPE = new SlaveChannelType ( ) ; public static final Level LOG_LEVEL = Level . SEVERE ; public static void setupHrmChannel ( Channel channel , ChannelType type , String name , ChannelId id ) { } public static void main ( String [ ] args ) throws InterruptedException , TimeoutException , TransferException { } public static void setupLogging ( ) { } }

Fix:
System . out . println ( ( "Ex.<seq2seq4repair_space>type:" + ( d . getDeviceType ( ) ) ) ) ;
Buggy code:
public abstract class ContainerFieldStrategy extends AbstractFieldStrategy { protected abstract ClassMapping [ ] getIndependentElementMappings ( boolean traverse ) { } public void appendIsEmpty ( SQLBuffer sql , Select sel , Joins joins ) { } public void appendIsNotEmpty ( SQLBuffer sql , Select sel , Joins joins ) { } public void appendIsNull ( SQLBuffer sql , Select sel , Joins joins ) { } public void appendIsNotNull ( SQLBuffer sql , Select sel , Joins joins ) { } private void testEmpty ( SQLBuffer sql , Select sel , Joins joins , boolean empty ) { } protected abstract ForeignKey getJoinForeignKey ( ) { } public void appendSize ( SQLBuffer sql , Select sel , Joins joins ) { } public void appendIndex ( SQLBuffer sql , Select sel , Joins joins ) { <START_BUG> sql . append ( sel . getOrderedColumnAlias ( field . getOrderColumn ( ) , field . getName ( ) ) ) ; <END_BUG> } protected static void appendJoinCount ( SQLBuffer sql , Select sel , Joins joins , DBDictionary dict , FieldMapping field , ForeignKey fk ) { } public static void appendUnaliasedJoin ( SQLBuffer sql , Select sel , Joins joins , DBDictionary dict , FieldMapping field , ForeignKey fk ) { } }

Fix:
sql . append ( sel . getColumnAlias ( field . getOrderColumn ( ) , field . getName ( ) ) ) ;
Buggy code:
public class DateUtils { public static final String DATE_FORMAT = "yyyy-MM-dd" ; public static final String dateRegExFormat = "([0-9]{4})-([0-9]{2})-([0-9]{2})" ; public static final DateTimeFormatter formatter = DateTimeFormat . forPattern ( DateUtils . DATE_FORMAT ) ; public static String getCurrentDate ( ) { } public static ArrayList < Tuple > getDateIntervals ( String from , String to ) { } public static ArrayList < Tuple > getDateIntervals ( ArrayList < String > dates , int n ) { ArrayList < Tuple > res = new ArrayList < > ( ) ; int len = ( dates . size ( ) ) // n ; int modulo = ( dates . size ( ) ) % n ; if ( n > ( dates . size ( ) ) ) { <START_BUG> for ( int i = 0 ; i < ( res . size ( ) ) ; i ++ ) { <END_BUG> Tuple tuple = new Tuple ( dates . get ( i ) , dates . get ( i ) ) ; res . add ( tuple ) ; } } else { int cur = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i != ( n - 1 ) ) { System . out . println ( ( ( cur + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( ( cur + len ) - 1 ) ) ) ; Tuple tuple = new Tuple ( dates . get ( cur ) , dates . get ( ( ( cur + len ) - 1 ) ) ) ; res . add ( tuple ) ; } else { System . out . println ( ( ( cur + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( ( ( cur + len ) - 1 ) + modulo ) ) ) ; Tuple tuple = new Tuple ( dates . get ( cur ) , dates . get ( ( ( ( cur + len ) - 1 ) + modulo ) ) ) ; res . add ( tuple ) ; } cur += len ; } } return res ; } public static String addOneDay ( String date ) { } public static int compare ( String d1 , String d2 ) { } public static ArrayList < String > generateDates ( String from , String to ) { } }

Fix:
for ( int i = 0 ; i < ( dates . size ( ) ) ; i ++ ) {
Buggy code:
public final class BasicDeviceConfig extends BasicElementConfig < DeviceId > { private static final String TYPE = "type" ; private static final String DRIVER = "driver" ; private static final String MANAGEMENT_ADDRESS = "managementAddress" ; @ Override public boolean isValid ( ) { } public Type type ( ) { } public BasicDeviceConfig type ( Device . Type type ) { } public String driver ( ) { <START_BUG> return get ( BasicDeviceConfig . DRIVER , subject . toString ( ) ) ; <END_BUG> } public BasicElementConfig driver ( String driverName ) { } public String managementAddress ( ) { } public BasicElementConfig managementAddress ( String managementAddress ) { } }

Fix:
return get ( BasicDeviceConfig . DRIVER , null ) ;
Buggy code:
public class FunctionProperty extends AbstractProperty { CompoundVariable function ; int testIteration = - 1 ; String cacheValue ; public FunctionProperty ( String name , CompoundVariable func ) { } public FunctionProperty ( ) { } public void setObjectValue ( Object v ) { } public boolean equals ( Object o ) { } public String getStringValue ( ) { <START_BUG> if ( ! ( isRunningVersion ( ) ) ) { <END_BUG> log . debug ( "Not<seq2seq4repair_space>running<seq2seq4repair_space>version,<seq2seq4repair_space>return<seq2seq4repair_space>raw<seq2seq4repair_space>function<seq2seq4repair_space>string" ) ; return function . getRawParameters ( ) ; } else { log . debug ( "Running<seq2seq4repair_space>version,<seq2seq4repair_space>executing<seq2seq4repair_space>function" ) ; int iter = JMeterContextService . getContext ( ) . getVariables ( ) . getIteration ( ) ; if ( iter < ( testIteration ) ) { testIteration = - 1 ; } if ( ( iter > ( testIteration ) ) || ( ( cacheValue ) == null ) ) { testIteration = iter ; cacheValue = function . execute ( ) ; } return cacheValue ; } } public Object getObjectValue ( ) { } public Object clone ( ) { } public void recoverRunningVersion ( TestElement owner ) { } }

Fix:
if ( ( ! ( isRunningVersion ( ) ) ) || ( ! ( JMeterContextService . getContext ( ) . isSamplingStarted ( ) ) ) ) {
Buggy code:
public class Room implements IRoom { private Queue < Media > songQueue ; private Media currentMedia ; private PlaybackStatus playbackStatus ; private ISongTimer songTimer ; private TaskScheduler taskScheduler ; private ScheduledFuture < ? > heartBeatScheduledFuture ; private ScheduledFuture < ? > requestScheduledFuture ; private String roomId ; private IUserManager userManager ; private SimpMessageSendingOperations simpMessagingTemplate ; public Room ( String roomId , ISongTimer songTimer , SimpMessageSendingOperations simpMessagingTemplate , TaskScheduler taskScheduler , IUserManager userManager ) { } private void sendMessage ( OutBoundMessage message ) { } private void setNextSong ( ) { } @ Override public PlaybackStatus getPlaybackStatus ( ) { } @ Override public void setSeek ( long time ) { } @ Override public void play ( ) throws InterruptedException , ExecutionException { } @ Override public void pause ( ) { if ( ( this . currentMedia ) == null ) { this . sendMessage ( new com . poo . musicbroadcaster . model . client . outbound . PlaylistMessage ( PlaylistMessageType . FINISHED ) ) ; return ; } System . out . println ( ( "Seek<seq2seq4repair_space>is<seq2seq4repair_space>at<seq2seq4repair_space>time:<seq2seq4repair_space>" + ( this . songTimer . getSeek ( ) ) ) ) ; <START_BUG> if ( ( this . songTimer . getTimeRemaining ( ) ) < 2000 ) { <END_BUG> return ; } boolean result = this . songTimer . pause ( ) ; if ( result ) { this . playbackStatus = PlaybackStatus . PAUSED ; this . sendMessage ( new com . poo . musicbroadcaster . model . client . outbound . PlaybackMessage ( PlaybackMessageType . PAUSE ) ) ; } } @ Override public void addMedia ( Media media ) { } @ Override public void removeMedia ( String media ) { } @ Override public Queue < Media > getPlaylist ( ) { } @ Override public Media getCurrentMedia ( ) { } @ Override public boolean isEmpty ( ) { } @ Override public IUserManager getUserManager ( ) { } @ Override public long getSeek ( ) { } }

Fix:
if ( ( ( this . currentMedia . getLength ( ) ) - ( this . songTimer . getSeek ( ) ) ) < 2000 ) {
Buggy code:
public class CommandProcessor implements Runnable { private static final Logger LOG = Logger . getLogger ( "org.columba.core.command" ) ; public static final int MAX_WORKERS = 5 ; List operationQueue ; List worker ; private Mutex oneMutex ; private TaskManager taskManager ; private int timeStamp ; public CommandProcessor ( ) { } public CommandProcessor ( boolean start ) { } public void addOp ( final Command op ) { } public void addOp ( final Command op , final int operationMode ) { } private boolean canBeProcessed ( final OperationItem opItem ) { <START_BUG> return opItem . getOperation ( ) . canBeProcessed ( opItem . getOperationMode ( ) ) ; <END_BUG> } private OperationItem nextOpItem ( ) { } public void operationFinished ( final Command op , final Worker w ) { } Worker getWorker ( int priority ) { } private synchronized void waitForNotify ( ) { } private synchronized void wakeUp ( ) { } public void run ( ) { } boolean startOperation ( ) { } public TaskManager getTaskManager ( ) { } }

Fix:
return opItem . getOperation ( ) . canBeProcessed ( ) ;
Buggy code:
public class CreateGameEntryParser implements EntryParser { private boolean restrictIndentation ; private final int indentation ; private CreateGameEntryParser ( ) { } private CreateGameEntryParser ( final int indentation ) { } private static final Pattern EXTRACT_CREATE_GAME_PATTERN = Pattern . compile ( ( ( ( ( "^" + ( Pattern . quote ( "[Power]<seq2seq4repair_space>GameState.DebugPrintPower()<seq2seq4repair_space>-<seq2seq4repair_space>" ) ) ) + "(\\s*)" ) + ( Pattern . quote ( "CREATE_GAME" ) ) ) + "$" ) ) ; @ Override public boolean isParsable ( final String input ) { } @ Override public LogEntry parse ( final String input , final LineReader lineReader ) throws NotParsableException { if ( ! ( isValidIndentation ( input ) ) ) { throw new NotParsableException ( ) ; } <START_BUG> LogReader logReader = LogReaderUtils . fromInputAndExtraLineReader ( lineReader . readNextLine ( ) , lineReader , ( line ) -> ( LogLineUtils . isFromNamedLogger ( line ) ) && ( ( LogLineUtils . countLeadingSpaces ( LogLineUtils . getContentFromLineFromNamedLogger ( line ) ) ) > 0 ) , new java . util . HashSet ( Arrays . asList ( ( restrictIndentation ? GameEntityEntryParser . createForIndentation ( ( ( indentation ) + 4 ) ) : GameEntityEntryParser . create ( ) ) , ( restrictIndentation ? PlayerEntryParser . createForIndentation ( ( ( indentation ) + 4 ) ) : PlayerEntryParser . create ( ) ) ) ) ) ; <END_BUG> try { CreateGameLogEntry . Builder builder = new CreateGameLogEntry . Builder ( ) ; Matcher createGameLogEntryMatcher = CreateGameEntryParser . EXTRACT_CREATE_GAME_PATTERN . matcher ( input ) ; if ( ! ( createGameLogEntryMatcher . find ( ) ) ) { throw new NotParsableException ( ) ; } int localIndentation = createGameLogEntryMatcher . group ( 1 ) . length ( ) ; builder . indentation ( localIndentation ) ; GameEntityLogEntry gameEntityLogEntry = ( ( GameEntityLogEntry ) ( logReader . readNextEntry ( ) ) ) ; builder . gameEntityLogEntry ( gameEntityLogEntry ) ; while ( logReader . hasNextEntry ( ) ) { PlayerLogEntry playerLogEntry = ( ( PlayerLogEntry ) ( logReader . readNextEntry ( ) ) ) ; builder . addPlayerLogEntry ( playerLogEntry ) ; } return builder . build ( ) ; } catch ( NotReadableException ex ) { throw new NotParsableException ( ex ) ; } } private boolean isValidIndentation ( final String input ) { } public static CreateGameEntryParser create ( ) { } public static CreateGameEntryParser createForIndentation ( final int indentation ) { } }

Fix:
LogReader logReader = LogReaderUtils . fromInputAndExtraLineReader ( lineReader . readNextLine ( ) , lineReader , ( line ) -> ( LogLineUtils . isFromNamedLogger ( line ) ) && ( ( LogLineUtils . countLeadingSpaces ( LogLineUtils . getContentFromLineFromNamedLogger ( line ) ) ) > ( indentation ) ) , new java . util . HashSet ( Arrays . asList ( ( restrictIndentation ? GameEntityEntryParser . createForIndentation ( ( ( indentation ) + 4 ) ) : GameEntityEntryParser . create ( ) ) , ( restrictIndentation ? PlayerEntryParser . createForIndentation ( ( ( indentation ) + 4 ) ) : PlayerEntryParser . create ( ) ) ) ) ) ;
Buggy code:
public class DebugFrameController extends FrameController { public DebugFrameController ( Model model ) { } public void windowClosing ( WindowEvent we ) { <START_BUG> model . toggleQueriesOpened ( ) ; <END_BUG> } }

Fix:
model . toggleDebugOpened ( ) ;
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; ImageList imageList ; static final int TabFolderProc ; static final TCHAR TabFolderClass = new TCHAR ( 0 , OS . WC_TABCONTROL , true ) ; static final int ID_UPDOWN = 1 ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createItem ( TabItem item , int index ) { } void createHandle ( ) { } void createWidget ( ) { } void destroyItem ( TabItem item ) { } void drawThemeBackground ( int hDC , int hwnd , RECT rect ) { } Control findThemeControl ( ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public TabItem getItem ( Point point ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } int imageIndex ( Image image ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setSelection ( TabItem item ) { } public void setSelection ( TabItem [ ] items ) { } public void setFont ( Font font ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } String toolTipText ( NMTTDISPINFO hdr ) { } boolean traversePage ( boolean next ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { LRESULT result = super . WM_GETDLGCODE ( wParam , lParam ) ; if ( result != null ) return result ; <START_BUG> return new LRESULT ( OS . DLGC_BUTTON ) ; <END_BUG> } LRESULT WM_MOUSELEAVE ( int wParam , int lParam ) { } LRESULT WM_NCHITTEST ( int wParam , int lParam ) { } LRESULT WM_NOTIFY ( int wParam , int lParam ) { } LRESULT WM_PARENTNOTIFY ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGING ( int wParam , int lParam ) { } LRESULT wmNotifyChild ( NMHDR hdr , int wParam , int lParam ) { } }

Fix:
return new LRESULT ( ( ( OS . DLGC_BUTTON ) | ( OS . DLGC_WANTARROWS ) ) ) ;
Buggy code:
public class LaunchServers { private static final int NUMBER_OF_HOTELS = 1 ; private static final boolean SHOULD_POPULATE = true ; public static void main ( String [ ] args ) { System . out . println ( "Launching<seq2seq4repair_space>Remote<seq2seq4repair_space>objects:<seq2seq4repair_space>GuestHub<seq2seq4repair_space>and<seq2seq4repair_space>ManagerHub<seq2seq4repair_space>" ) ; try { HotelGuestHubInterface guestHub = ( ( HotelGuestHubInterface ) ( UnicastRemoteObject . exportObject ( new GuestHub ( ) , 2020 ) ) ) ; HotelManagerHubInterface managerHub = ( ( HotelManagerHubInterface ) ( UnicastRemoteObject . exportObject ( new ManagerHub ( ) , 2020 ) ) ) ; Registry registry = LocateRegistry . createRegistry ( 2020 ) ; registry . rebind ( "guestHub" , guestHub ) ; registry . rebind ( "managerHub" , managerHub ) ; } catch ( RemoteException e ) { e . printStackTrace ( ) ; } try { <START_BUG> HotelHubInterface hotelHub = ( ( HotelHubInterface ) ( UnicastRemoteObject . exportObject ( new HotelHub ( LaunchServers . NUMBER_OF_HOTELS , LaunchServers . SHOULD_POPULATE ) , 2021 ) ) ) ; <END_BUG> Registry registry = LocateRegistry . createRegistry ( 2021 ) ; registry . rebind ( "hotelHub" , hotelHub ) ; } catch ( Exception e ) { } System . out . println ( "Hubs<seq2seq4repair_space>Created." ) ; } }

Fix:
HotelHubInterface hotelHub = ( ( HotelHubInterface ) ( UnicastRemoteObject . exportObject ( new HotelHub ( LaunchServers . NUMBER_OF_HOTELS , new int [ ] [ ] { new int [ ] { 2 , 3 , 3 } , new int [ ] { 3 , 3 , 3 } , new int [ ] { 3 , 3 , 3 } } ) , 2021 ) ) ) ;
Buggy code:
public class PreferenceInitializer extends AbstractPreferenceInitializer { @ Override public void initializeDefaultPreferences ( ) { IPreferenceStore store = Activator . getDefault ( ) . getPreferenceStore ( ) ; <START_BUG> store . setDefault ( DIM , 25 ) ; <END_BUG> store . setDefault ( FIXED , true ) ; } }

Fix:
store . setDefault ( DIM , 0.5 ) ;
Buggy code:
public abstract class PriorityQueue { private Object [ ] heap ; private int size ; protected abstract boolean lessThan ( Object a , Object b ) { } protected final void initialize ( int maxSize ) { } public final void put ( Object element ) { } public final Object top ( ) { } public final Object pop ( ) { } public final void adjustTop ( ) { } public final int size ( ) { } public final void clear ( ) { <START_BUG> for ( int i = 0 ; i < ( size ) ; i ++ ) <END_BUG> heap [ i ] = null ; size = 0 ; } private final void upHeap ( ) { } private final void downHeap ( ) { } }

Fix:
for ( int i = 0 ; i <= ( size ) ; i ++ )
Buggy code:
public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethodInvoker implements BeanClassLoaderAware , BeanFactoryAware , BeanNameAware , FactoryBean < JobDetail > , InitializingBean { private String name ; private String group = Scheduler . DEFAULT_GROUP ; private boolean concurrent = true ; private String targetBeanName ; private String beanName ; private ClassLoader beanClassLoader = ClassUtils . getDefaultClassLoader ( ) ; private BeanFactory beanFactory ; private JobDetail jobDetail ; public void setName ( String name ) { } public void setGroup ( String group ) { } public void setConcurrent ( boolean concurrent ) { } public void setTargetBeanName ( String targetBeanName ) { } @ Override public void setBeanName ( String beanName ) { } @ Override public void setBeanClassLoader ( ClassLoader classLoader ) { } @ Override public void setBeanFactory ( BeanFactory beanFactory ) { } @ Override protected Class < ? > resolveClassName ( String className ) throws ClassNotFoundException { } @ Override @ SuppressWarnings ( "unchecked" ) public void afterPropertiesSet ( ) throws ClassNotFoundException , NoSuchMethodException { prepare ( ) ; String name = ( ( this . name ) != null ) ? this . name : this . beanName ; Class < ? > jobClass = ( this . concurrent ) ? MethodInvokingJobDetailFactoryBean . MethodInvokingJob . class : MethodInvokingJobDetailFactoryBean . StatefulMethodInvokingJob . class ; JobDetailImpl jdi = new JobDetailImpl ( ) ; jdi . setName ( name ) ; <START_BUG> jdi . setGroup ( group ) ; <END_BUG> jdi . setJobClass ( ( ( Class ) ( jobClass ) ) ) ; jdi . setDurability ( true ) ; jdi . getJobDataMap ( ) . put ( "methodInvoker" , this ) ; this . jobDetail = jdi ; postProcessJobDetail ( this . jobDetail ) ; } protected void postProcessJobDetail ( JobDetail jobDetail ) { } @ Override public Class < ? > getTargetClass ( ) { } @ Override public Object getTargetObject ( ) { } @ Override public JobDetail getObject ( ) { } @ Override public Class < ? extends JobDetail > getObjectType ( ) { } @ Override public boolean isSingleton ( ) { } public static class MethodInvokingJob extends QuartzJobBean { protected static final Log logger = LogFactory . getLog ( MethodInvokingJobDetailFactoryBean . MethodInvokingJob . class ) ; private MethodInvoker methodInvoker ; public void setMethodInvoker ( MethodInvoker methodInvoker ) { } @ Override protected void executeInternal ( JobExecutionContext context ) throws JobExecutionException { } } @ PersistJobDataAfterExecution @ DisallowConcurrentExecution public static class StatefulMethodInvokingJob extends MethodInvokingJobDetailFactoryBean . MethodInvokingJob { } }

Fix:
jdi . setGroup ( this . group ) ;
Buggy code:
public class SensorUtilJava { public static String getTypeConstantName ( int type ) { } public static void printExperimentConfig ( ExperimentConfig currentConfig ) { } public static String experimentConfigToString ( ExperimentConfig currentConfig ) { } public static String experimentRequestToString ( ExperimentRequest request ) { } public static float scoreSensorType ( SensorConfig config , SensorRequest request ) { } public static float scoreValueRange ( SensorConfig config , SensorRequest request ) { } public static float scoreStepSize ( SensorConfig config , SensorRequest request ) { if ( ( ( request . getType ( ) ) == ( SensorConfig . QUANTITY_GAS_PRESSURE ) ) || ( ( request . getType ( ) ) == ( SensorConfig . QUANTITY_FORCE ) ) ) { <START_BUG> if ( ! ( Float . isNaN ( request . getStepSize ( ) ) ) ) { <END_BUG> return 1.0F ; } if ( ( ( request . getStepSize ( ) ) <= 0 ) && ( ( config . getStepSize ( ) ) <= 0 ) ) { return 1.0F ; } if ( ( request . getStepSize ( ) ) >= ( config . getStepSize ( ) ) ) { return 1.0F ; } return 0.0F ; } return 1.0F ; } }

Fix:
if ( Float . isNaN ( request . getStepSize ( ) ) ) {
Buggy code:
public class UserLibraryClasspathContainer implements IClasspathContainer { private String name ; public UserLibraryClasspathContainer ( String name ) { } public IClasspathEntry [ ] getClasspathEntries ( ) { } public String getDescription ( ) { } public int getKind ( ) { } public IPath getPath ( ) { } private UserLibrary getUserLibrary ( ) { UserLibrary userLibrary = JavaModelManager . getUserLibraryManager ( ) . getUserLibrary ( this . name ) ; <START_BUG> if ( ( userLibrary == null ) && ( JavaModelManager . CP_RESOLVE_VERBOSE ) ) { <END_BUG> verbose_no_user_library_found ( this . name ) ; } return userLibrary ; } private void verbose_no_user_library_found ( String userLibraryName ) { } }

Fix:
if ( ( userLibrary == null ) && ( ( JavaModelManager . CP_RESOLVE_VERBOSE ) || ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) ) ) {
Buggy code:
abstract class Const extends AbstractVal implements Constant { private ClassMetaData _meta = null ; public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public Object getSQLValue ( Select sel , ExpContext ctx , ExpState state ) { } public boolean isSQLValueNull ( Select sel , ExpContext ctx , ExpState state ) { } public Object getValue ( ExpContext ctx , ExpState state ) { } public ExpState initialize ( Select sel , ExpContext ctx , int flags ) { } protected static class ConstExpState extends ExpState { public Column [ ] cols = null ; public Column getColumn ( int index ) { } } public void calculateValue ( Select sel , ExpContext ctx , ExpState state , Val other , ExpState otherState ) { } public void select ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } private SQLBuffer newSQLBuffer ( Select sel , ExpContext ctx , ExpState state ) { } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void groupBy ( Select sel , ExpContext ctx , ExpState state ) { } public void orderBy ( Select sel , ExpContext ctx , ExpState state , boolean asc ) { <START_BUG> sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false ) ; <END_BUG> } public Object load ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } public int length ( Select sel , ExpContext ctx , ExpState state ) { } public void appendIsEmpty ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIsNotEmpty ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendSize ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIsNull ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIsNotNull ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } }

Fix:
sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false , getSelectAs ( ) ) ;
Buggy code:
public class BigFractionFormat extends AbstractFormat implements Serializable { private static final long serialVersionUID = - 2932167925527338976L ; public BigFractionFormat ( ) { } public BigFractionFormat ( final NumberFormat format ) { } public BigFractionFormat ( final NumberFormat numeratorFormat , final NumberFormat denominatorFormat ) { } public static Locale [ ] getAvailableLocales ( ) { } public static String formatBigFraction ( final BigFraction f ) { } public static BigFractionFormat getImproperInstance ( ) { } public static BigFractionFormat getImproperInstance ( final Locale locale ) { } public static BigFractionFormat getProperInstance ( ) { } public static BigFractionFormat getProperInstance ( final Locale locale ) { } public StringBuffer format ( final BigFraction BigFraction , final StringBuffer toAppendTo , final FieldPosition pos ) { } @ Override public StringBuffer format ( final Object obj , final StringBuffer toAppendTo , final FieldPosition pos ) { } @ Override public BigFraction parse ( final String source ) throws ParseException { final ParsePosition parsePosition = new ParsePosition ( 0 ) ; final BigFraction result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { <START_BUG> throw MathRuntimeException . createParseException ( parsePosition . getErrorIndex ( ) , "unparseable<seq2seq4repair_space>fraction<seq2seq4repair_space>number:<seq2seq4repair_space>\"{0}\"" , source ) ; <END_BUG> } return result ; } @ Override public BigFraction parse ( final String source , final ParsePosition pos ) { } protected BigInteger parseNextBigInteger ( final String source , final ParsePosition pos ) { } }

Fix:
throw MathRuntimeException . createParseException ( parsePosition . getErrorIndex ( ) , UNPARSEABLE_FRACTION_NUMBER , source ) ;
Buggy code:
public class FieldNotEditableResult implements BindingResult { private String fieldName ; private Object submittedValue ; private MessageSource messageSource ; public FieldNotEditableResult ( String fieldName , Object submittedValue , MessageSource messageSource ) { } public String getFieldName ( ) { } public Object getSubmittedValue ( ) { } public boolean isFailure ( ) { } public Alert getAlert ( ) { return new Alert ( ) { public String getCode ( ) { return "fieldNotEditable" ; } public Severity getSeverity ( ) { return Severity . WARNING ; } public String getMessage ( ) { MessageBuilder builder = new MessageBuilder ( messageSource ) ; <START_BUG> builder . code ( "bindSuccess" ) ; <END_BUG> builder . arg ( "label" , new ResolvableArgument ( fieldName ) ) ; builder . arg ( "value" , submittedValue ) ; builder . defaultMessage ( new DefaultMessageFactory ( ) { public String createDefaultMessage ( ) { return ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>bind<seq2seq4repair_space>submitted<seq2seq4repair_space>value<seq2seq4repair_space>" + ( StylerUtils . style ( submittedValue ) ) ) + ";<seq2seq4repair_space>field<seq2seq4repair_space>'" ) + ( fieldName ) ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>editable" ; } } ) ; return builder . build ( ) ; } } ; } public String toString ( ) { } }

Fix:
builder . code ( getCode ( ) ) ;
Buggy code:
public final class TextSerializerHelper { static final byte [ ] digits = new byte [ ] { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' } ; static final boolean [ ] HexadecimalChars ; static final boolean [ ] DecimalChars ; static final byte [ ] ToAppend = new byte [ 64 ] ; public static void serializeHexLong ( long i , Text t , char toAppend ) { } public static long deserializeHexLong ( byte [ ] buf , int offset , int len ) { } public static long consumeHexLong ( Text text , char separator ) { } public static double consumeDouble ( Text text , char separator ) { } public static void serializeDouble ( double d , Text t , char toAppend ) { } public static void serializeLong ( long i , Text t , char toAppend ) { } public static long deserializeLong ( byte [ ] buf , int offset , int len ) { } public static long consumeLong ( Text text , char separator ) { } public static void serializeInt ( int i , Text t , char toAppend ) { } public static int deserializeInt ( byte [ ] buf , int offset , int len ) { } public static int consumeInt ( Text text , char separator ) { } private static final byte [ ] Separators = new byte [ ] { '[' , '#' , ',' , ']' } ; private static final int MapStart = 0 ; private static final int KeyValueSeparator = 1 ; private static final int FieldSeparator = 2 ; private static final int MapEnd = 3 ; public static void consumeMap ( Text text , Map < String , String > tags ) { } public static Text serializeMap ( Text text , Map < String , String > tags ) { } private static final byte [ ] [ ] ShapeNames = new byte [ ] [ ] { "LINESTRING" . getBytes ( ) , "POINT" . getBytes ( ) , "POLYGON" . getBytes ( ) , "MULTIPOINT" . getBytes ( ) , "MULTILINESTRING" . getBytes ( ) , "MULTIPOLYGON" . getBytes ( ) , "GEOMETRYCOLLECTION" . getBytes ( ) } ; public static OGCGeometry consumeGeometryESRI ( Text text , char separator ) { } public static OGCGeometry parseText ( String str ) { } public static byte [ ] hexToBytes ( String hex ) { } public static void serializeGeometry ( Text text , OGCGeometry geom , char toAppend ) { } private static final WKTReader wktReader = new WKTReader ( new GeometryFactory ( ) ) ; private static final WKBReader wkbReader = new WKBReader ( new GeometryFactory ( ) ) ; public static void serializeGeometry ( Text text , Geometry geom , char toAppend ) { <START_BUG> String wkt = geom . toText ( ) ; <END_BUG> byte [ ] wkt_b = wkt . getBytes ( ) ; text . append ( wkt_b , 0 , wkt_b . length ) ; if ( toAppend != '' ) text . append ( new byte [ ] { ( ( byte ) ( toAppend ) ) } , 0 , 1 ) ; } public static synchronized Geometry consumeGeometryJTS ( Text text , char separator ) { } private static final boolean [ ] IsHex = new boolean [ 256 ] ; private static final byte [ ] HexLookupTable = new byte [ ] { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' } ; public static String bytesToHex ( byte [ ] binary ) { } }

Fix:
String wkt = ( geom == null ) ? "" : geom . toText ( ) ;
Buggy code:
public class TestJava5ReflectionBasedReferenceTypeDelegate extends ReflectionBasedReferenceTypeDelegateTest { public static Test suite ( ) { } public void testResolveGeneric ( ) { UnresolvedType collectionType = UnresolvedType . forName ( "java.util.Collection" ) ; world . resolve ( collectionType ) . getRawType ( ) . resolve ( world ) ; ResolvedMember [ ] methods = world . resolve ( collectionType ) . getDeclaredMethods ( ) ; int i = findMethod ( "toArray" , 1 , methods ) ; assertTrue ( ( "Couldn't<seq2seq4repair_space>find<seq2seq4repair_space>'toArray'<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>set<seq2seq4repair_space>of<seq2seq4repair_space>methods?<seq2seq4repair_space>" + methods ) , ( i != ( - 1 ) ) ) ; <START_BUG> String expectedSignature = "T[]<seq2seq4repair_space>java.util.Collection.toArray(T[])" ; <END_BUG> assertTrue ( ( ( ( "Expected<seq2seq4repair_space>signature<seq2seq4repair_space>of<seq2seq4repair_space>'" + expectedSignature ) + "'<seq2seq4repair_space>but<seq2seq4repair_space>it<seq2seq4repair_space>was<seq2seq4repair_space>'" ) + ( methods [ i ] ) ) , methods [ i ] . toString ( ) . equals ( expectedSignature ) ) ; } public void testResolveEnum ( ) { } public void testResolveClass ( ) { } public void testGenericInterfaceSuperclass_ReflectionWorldResolution ( ) { } }

Fix:
String expectedSignature = "java.lang.Object[]<seq2seq4repair_space>java.util.Collection.toArray(java.lang.Object[])" ;
Buggy code:
public class PolyLineFigure extends AbstractFigure { public static final int ARROW_TIP_NONE = 0 ; public static final int ARROW_TIP_START = 1 ; public static final int ARROW_TIP_END = 2 ; public static final int ARROW_TIP_BOTH = 3 ; protected Vector fPoints ; protected LineDecoration fStartDecoration = null ; protected LineDecoration fEndDecoration = null ; protected Color fFrameColor = Color . black ; private static final long serialVersionUID = - 7951352179906577773L ; private int polyLineFigureSerializedDataVersion = 1 ; public PolyLineFigure ( ) { } public PolyLineFigure ( int size ) { } public PolyLineFigure ( int x , int y ) { } public Rectangle displayBox ( ) { Enumeration k = points ( ) ; <START_BUG> Rectangle r = new Rectangle ( ( ( Point ) ( k . nextElement ( ) ) ) ) ; <END_BUG> while ( k . hasMoreElements ( ) ) { r . add ( ( ( Point ) ( k . nextElement ( ) ) ) ) ; } return r ; } public boolean isEmpty ( ) { } public Vector handles ( ) { } public void basicDisplayBox ( Point origin , Point corner ) { } public void addPoint ( int x , int y ) { } public Enumeration points ( ) { } public int pointCount ( ) { } protected void basicMoveBy ( int dx , int dy ) { } public void setPointAt ( Point p , int i ) { } public void insertPointAt ( Point p , int i ) { } public void removePointAt ( int i ) { } public int splitSegment ( int x , int y ) { } public Point pointAt ( int i ) { } public boolean joinSegments ( int x , int y ) { } public Connector connectorAt ( int x , int y ) { } public void setStartDecoration ( LineDecoration l ) { } public LineDecoration getStartDecoration ( ) { } public void setEndDecoration ( LineDecoration l ) { } public LineDecoration getEndDecoration ( ) { } public void draw ( Graphics g ) { } protected void drawLine ( Graphics g , int x1 , int y1 , int x2 , int y2 ) { } public boolean containsPoint ( int x , int y ) { } public int findSegment ( int x , int y ) { } private void decorate ( Graphics g ) { } public Object getAttribute ( String name ) { } public Object getAttribute ( FigureAttributeConstant attributeConstant ) { } public void setAttribute ( String name , Object value ) { } public void setAttribute ( FigureAttributeConstant attributeConstant , Object value ) { } public void write ( StorableOutput dw ) { } public void read ( StorableInput dr ) throws IOException { } public static Locator locator ( int pointIndex ) { } protected Color getFrameColor ( ) { } protected void setFrameColor ( Color c ) { } protected Rectangle invalidateRectangle ( Rectangle r ) { } }

Fix:
Rectangle r = new Rectangle ( ) ;
Buggy code:
public abstract class ResourceUtils { public static final String CLASSPATH_URL_PREFIX = "classpath:" ; public static final String FILE_URL_PREFIX = "file:" ; public static final String URL_PROTOCOL_FILE = "file" ; public static final String URL_PROTOCOL_JAR = "jar" ; public static final String URL_PROTOCOL_ZIP = "zip" ; public static final String URL_PROTOCOL_VFSZIP = "vfszip" ; public static final String URL_PROTOCOL_VFS = "vfs" ; public static final String URL_PROTOCOL_WSJAR = "wsjar" ; public static final String URL_PROTOCOL_CODE_SOURCE = "code-source" ; public static final String JAR_URL_SEPARATOR = "!//" ; public static boolean isUrl ( String resourceLocation ) { } public static URL getURL ( String resourceLocation ) throws FileNotFoundException { } public static File getFile ( String resourceLocation ) throws FileNotFoundException { } public static File getFile ( URL resourceUrl ) throws FileNotFoundException { } public static File getFile ( URL resourceUrl , String description ) throws FileNotFoundException { } public static File getFile ( URI resourceUri ) throws FileNotFoundException { } public static File getFile ( URI resourceUri , String description ) throws FileNotFoundException { } public static boolean isFileURL ( URL url ) { } public static boolean isJarURL ( URL url ) { } public static URL extractJarFileURL ( URL jarUrl ) throws MalformedURLException { } public static URI toURI ( URL url ) throws URISyntaxException { } public static URI toURI ( String location ) throws URISyntaxException { } public static void useCachesIfNecessary ( URLConnection con ) { <START_BUG> con . setUseCaches ( con . getClass ( ) . getName ( ) . startsWith ( "JNLP" ) ) ; <END_BUG> } }

Fix:
con . setUseCaches ( con . getClass ( ) . getSimpleName ( ) . startsWith ( "JNLP" ) ) ;
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 testPrependServletPath ( ) 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 ( ) ; <START_BUG> given ( processor . processAction ( this . request , action ) ) . willReturn ( action ) ; <END_BUG> given ( processor . getExtraHiddenFields ( this . request ) ) . willReturn ( Collections . singletonMap ( "key" , "value" ) ) ; this . tag . doStartTag ( ) ; this . tag . doEndTag ( ) ; this . tag . doFinally ( ) ; String output = getOutput ( ) ; assertEquals ( "<input<seq2seq4repair_space>type=\"hidden\"<seq2seq4repair_space>name=\"key\"<seq2seq4repair_space>value=\"value\"<seq2seq4repair_space>//>" , getInputTag ( output ) ) ; FormTagTests . assertFormTagOpened ( output ) ; FormTagTests . assertFormTagClosed ( output ) ; } private String getFormTag ( String output ) { } private String getInputTag ( String output ) { } private static void assertFormTagOpened ( String output ) { } private static void assertFormTagClosed ( String output ) { } }

Fix:
given ( processor . processAction ( this . request , action , "post" ) ) . willReturn ( action ) ;
Buggy code:
public abstract class AjaxHandler implements IBehaviour , IBehaviourListener , IHeaderContributor , IBodyOnloadContributor { private Component component ; private static final ThreadLocal bodyOnloadContribHolder = new ThreadLocal ( ) ; private static final ThreadLocal headContribHolder = new ThreadLocal ( ) ; public AjaxHandler ( ) { } public final String getBodyOnload ( ) { } public final void renderHead ( HtmlHeaderContainer container ) { } public final void onComponentTag ( Component component , ComponentTag tag ) { } public void onComponentTag ( ComponentTag tag ) { } public void detachModel ( ) { } public final String getCallbackUrl ( ) { } protected abstract String getImplementationId ( ) { } protected IResourceStream getResponse ( ) { } protected void renderHeadInitContribution ( HtmlHeaderContainer container ) { } protected void renderHeadContribution ( HtmlHeaderContainer container ) { } protected final Component getComponent ( ) { } protected void onBind ( ) { } protected String getBodyOnloadInitContribution ( ) { } protected String getBodyOnloadContribution ( ) { } public void rendered ( Component hostComponent ) { } protected void onComponentRendered ( ) { } protected String getResponseType ( ) { } protected void addJsReference ( HtmlHeaderContainer container , PackageResourceReference ref ) { } public final void bind ( Component hostComponent ) { if ( hostComponent == null ) { <START_BUG> throw new NullPointerException ( "argument<seq2seq4repair_space>hostComponent<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>not<seq2seq4repair_space>null" ) ; <END_BUG> } if ( ( this . component ) != null ) { throw new IllegalStateException ( ( ( ( ( ( "this<seq2seq4repair_space>kind<seq2seq4repair_space>of<seq2seq4repair_space>handler<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>attached<seq2seq4repair_space>to<seq2seq4repair_space>" + "multiple<seq2seq4repair_space>components;<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>attached<seq2seq4repair_space>to<seq2seq4repair_space>component<seq2seq4repair_space>" ) + ( this . component ) ) + ",<seq2seq4repair_space>but<seq2seq4repair_space>component<seq2seq4repair_space>" ) + hostComponent ) + "<seq2seq4repair_space>wants<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>attached<seq2seq4repair_space>too" ) ) ; } this . component = hostComponent ; onBind ( ) ; } public final void onRequest ( ) { } protected void respond ( ) { } private final void write ( HtmlHeaderContainer container , String s ) { } }

Fix:
throw new IllegalArgumentException ( "Argument<seq2seq4repair_space>hostComponent<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>not<seq2seq4repair_space>null" ) ;