nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ModuleContextProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( DeploymentTypeMarker . isType ( EAR , deploymentUnit ) ) { return ; } EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ServiceName appContextServiceName = ContextNames . contextServiceNameOfApplication ( moduleDescription . getApplicationName ( ) ) ; final ServiceName moduleContextServiceName = ContextNames . contextServiceNameOfModule ( moduleDescription . getApplicationName ( ) , moduleDescription . getModuleName ( ) ) ; final NamingStoreService contextService = new NamingStoreService ( ) ; serviceTarget . addService ( moduleContextServiceName , contextService ) . install ( ) ; final BinderService moduleNameBinder = new BinderService ( "ModuleName" ) ; serviceTarget . addService ( moduleContextServiceName . append ( "ModuleName" ) , moduleNameBinder ) . addInjection ( moduleNameBinder . getManagedObjectInjector ( ) , new org . jboss . as . naming . ValueManagedReferenceFactory ( Values . immediateValue ( moduleDescription . getModuleName ( ) ) ) ) . addDependency ( moduleContextServiceName , ServiceBasedNamingStore . class , moduleNameBinder . getNamingStoreInjector ( ) ) . install ( ) ; deploymentUnit . putAttachment ( Attachments . MODULE_CONTEXT_CONFIG , moduleContextServiceName ) ; final InjectedEENamespaceContextSelector selector = new InjectedEENamespaceContextSelector ( ) ; phaseContext . addDependency ( appContextServiceName , NamingStore . class , selector . getAppContextInjector ( ) ) ; phaseContext . addDependency ( moduleContextServiceName , NamingStore . class , selector . getModuleContextInjector ( ) ) ; phaseContext . addDependency ( moduleContextServiceName , NamingStore . class , selector . getCompContextInjector ( ) ) ; phaseContext . addDependency ( JBOSS_CONTEXT_SERVICE_NAME , NamingStore . class , selector . getJbossContextInjector ( ) ) ; phaseContext . addDependency ( GLOBAL_CONTEXT_SERVICE_NAME , NamingStore . class , selector . getGlobalContextInjector ( ) ) ; moduleDescription . setNamespaceContextSelector ( selector ) ; final Set < ServiceName > serviceNames = new HashSet < ServiceName > ( ) ; serviceNames . add ( appContextServiceName ) ; serviceNames . add ( moduleContextServiceName ) ; serviceNames . add ( JBOSS_CONTEXT_SERVICE_NAME ) ; serviceNames . add ( GLOBAL_CONTEXT_SERVICE_NAME ) ; <START_BUG> final JavaNamespaceSetup setupAction = new JavaNamespaceSetup ( selector ) ; <END_BUG> deploymentUnit . addToAttachmentList ( org . jboss . as . server . deployment . Attachments . SETUP_ACTIONS , setupAction ) ; deploymentUnit . addToAttachmentList ( EE_SETUP_ACTIONS , setupAction ) ; } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final JavaNamespaceSetup setupAction = new JavaNamespaceSetup ( selector , serviceTarget ) ;
Buggy code:
public class ContextedRuntimeExceptionTest extends AbstractExceptionContextTest < ContextedRuntimeException > { @ Override @ Before public void setUp ( ) throws Exception { } @ Test public void testContextedException ( ) { } @ Test public void testContextedExceptionString ( ) { } @ Test public void testContextedExceptionThrowable ( ) { } @ Test public void testContextedExceptionStringThrowable ( ) { } @ Test public void testContextedExceptionStringThrowableContext ( ) { <START_BUG> exceptionContext = new ContextedRuntimeException ( TEST_MESSAGE_2 , new Exception ( TEST_MESSAGE ) , new DefaultExceptionContext ( ) ) ; <END_BUG> final String message = exceptionContext . getMessage ( ) ; final String trace = ExceptionUtils . getStackTrace ( exceptionContext ) ; assertTrue ( ( ( trace . indexOf ( "ContextedException" ) ) >= 0 ) ) ; assertTrue ( ( ( trace . indexOf ( TEST_MESSAGE ) ) >= 0 ) ) ; assertTrue ( ( ( trace . indexOf ( TEST_MESSAGE_2 ) ) >= 0 ) ) ; assertTrue ( ( ( message . indexOf ( TEST_MESSAGE_2 ) ) >= 0 ) ) ; } @ Test public void testNullExceptionPassing ( ) { } @ Test public void testRawMessage ( ) { } }

Fix:
exceptionContext = new ContextedRuntimeException ( TEST_MESSAGE_2 , new Exception ( TEST_MESSAGE ) , new DefaultExceptionContext ( ) { } ) ;
Buggy code:
public class ToolBar extends Composite { int itemCount ; ToolItem [ ] items ; public ToolBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createItem ( ToolItem item , int index ) { } void createWidget ( ) { } int defaultThemeFont ( ) { } void destroyItem ( ToolItem item ) { } void drawBackground ( int control , int context ) { } void enableWidget ( boolean enabled ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point pt ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } void invalidateChildrenVisibleRegion ( int control ) { } int kEventAccessibleGetNamedAttribute ( int nextHandler , int theEvent , int userData ) { } 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 ( ) { <START_BUG> if ( ( drawCount ) > 0 ) <END_BUG> return ; Rectangle rect = getClientArea ( ) ; layout ( rect . width , rect . height , true ) ; } void releaseChildren ( boolean destroy ) { } void removeControl ( Control control ) { } void setBackground ( float [ ] color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } void setFontStyle ( Font font ) { } void setForeground ( float [ ] color ) { } public void setRedraw ( boolean redraw ) { } }

Fix:
if ( ! ( getDrawing ( ) ) )
Buggy code:
public final class DoubleCalcView1 extends JFrame implements DoubleCalcView { private static final long serialVersionUID = 1 ; private DoubleCalcController controller ; private final JTextArea tOutput ; private final JButton bClear ; private final JButton bEnter ; private final JButton bAdd ; private final JButton bSubtract ; private final JButton bMultiply ; private final JButton bDivide ; private final JButton bSquare ; private final JButton bSquareRoot ; private final JButton bDecimal ; private final JButton bPosNeg ; private final JButton [ ] bDigits ; private static final int TEXT_AREA_HEIGHT = 3 ; private static final int TEXT_AREA_WIDTH = 13 ; private static final int DIGIT_BUTTONS = 10 ; private static final int MAIN_BUTTON_PANEL_GRID_ROWS = 4 ; private static final int MAIN_BUTTON_PANEL_GRID_COLUMNS = 3 ; private static final int SIDE_BUTTON_PANEL_GRID_ROWS = 4 ; private static final int SIDE_BUTTON_PANEL_GRID_COLUMNS = 2 ; private static final int CALC_GRID_ROWS = 2 ; private static final int CALC_GRID_COLUMNS = 1 ; public DoubleCalcView1 ( ) { } @ Override public void actionPerformed ( ActionEvent event ) { <START_BUG> this . setCursor ( Cursor . getPredefinedCursor ( Cursor . WAIT_CURSOR ) ) ; <END_BUG> Object source = event . getSource ( ) ; if ( source == ( this . bClear ) ) { this . controller . processClearEvent ( ) ; } else if ( source == ( this . bEnter ) ) { this . controller . processEnterEvent ( ) ; } else if ( source == ( this . bAdd ) ) { this . controller . processAddEvent ( ) ; } else if ( source == ( this . bSubtract ) ) { this . controller . processSubtractEvent ( ) ; } else if ( source == ( this . bMultiply ) ) { this . controller . processMultiplyEvent ( ) ; } else if ( source == ( this . bDivide ) ) { this . controller . processDivideEvent ( ) ; } else if ( source == ( this . bSquare ) ) { this . controller . processSquareEvent ( ) ; } else if ( source == ( this . bSquareRoot ) ) { this . controller . processSquareRootEvent ( ) ; } else if ( source == ( this . bPosNeg ) ) { this . controller . processPosNegEvent ( ) ; } else { for ( int i = 0 ; i < ( DoubleCalcView1 . DIGIT_BUTTONS ) ; i ++ ) { if ( source == ( this . bDigits [ i ] ) ) { this . controller . processDigitEvent ( i ) ; } } } } @ Override public void registerObserver ( DoubleCalcController controller ) { } @ Override public void updateOutput ( Double d ) { } }

Fix:
this . setCursor ( Cursor . getPredefinedCursor ( Cursor . DEFAULT_CURSOR ) ) ;
Buggy code:
public class Group extends Composite { NSView contentView ; String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } NSView contentView ( ) { } void createHandle ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect , boolean sendPaint ) { } NSView eventView ( ) { } public Rectangle getClientArea ( ) { } String getNameText ( ) { } public String getText ( ) { } float getThemeAlpha ( ) { <START_BUG> return 0.25F * ( parent . getThemeAlpha ( ) ) ; <END_BUG> } void register ( ) { } void releaseHandle ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setText ( String string ) { } }

Fix:
return ( ( background ) != null ? 1 : 0.25F ) * ( parent . getThemeAlpha ( ) ) ;
Buggy code:
public class CommandPlaceLine implements ICommand { public static boolean REQUIRES_OP = false ; public static int XP_COST_PER_PLACE = 1 ; private ArrayList < String > aliases = new ArrayList < String > ( ) ; public CommandPlaceLine ( ) { } @ Override public int compareTo ( Object arg0 ) { } @ Override public String getName ( ) { } @ Override public String getCommandUsage ( ICommandSender sender ) { } @ Override public List getAliases ( ) { } @ Override public void execute ( ICommandSender sender , String [ ] args ) throws CommandException { if ( ( PlaceLib . canSenderPlace ( sender ) ) == false ) { return ; } EntityPlayer player = ( ( EntityPlayer ) ( sender ) ) ; int want = player . inventory . getCurrentItem ( ) . stackSize ; Block pblock = Block . getBlockFromItem ( player . inventory . getCurrentItem ( ) . getItem ( ) ) ; IBlockState placing = pblock . getStateFromMeta ( player . inventory . getCurrentItem ( ) . getMetadata ( ) ) ; if ( ( ( args . length ) > 0 ) && ( ( args [ 0 ] ) != null ) ) { want = Math . min ( Integer . parseInt ( args [ 0 ] ) , player . inventory . getCurrentItem ( ) . stackSize ) ; } int skip = 1 ; if ( ( ( args . length ) > 1 ) && ( ( args [ 1 ] ) != null ) ) { skip = Math . max ( Integer . parseInt ( args [ 1 ] ) , 1 ) ; } <START_BUG> PlaceLib . line ( sender . getEntityWorld ( ) , player , player . getPosition ( ) , placing , want , skip , CommandPlaceLine . XP_COST_PER_PLACE ) ; <END_BUG> } @ Override public boolean canCommandSenderUse ( ICommandSender ic ) { } @ Override public List addTabCompletionOptions ( ICommandSender sender , String [ ] args , BlockPos pos ) { } @ Override public boolean isUsernameIndex ( String [ ] args , int index ) { } }

Fix:
PlaceLib . line ( player . worldObj , player , player . getPosition ( ) , placing , want , skip , CommandPlaceLine . XP_COST_PER_PLACE ) ;
Buggy code:
@ Component @ Path ( "issues" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public class IssueWebService { @ Context private UriInfo uriInfo ; private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext ( ) ; private final IssueService service = getIssueService ( ) ; @ POST public Response createIssue ( final Issue issue ) { service . createOrUpdateIssue ( issue ) ; final String id = "id//" + ( issue . getId ( ) ) ; final URI location = uriInfo . getAbsolutePathBuilder ( ) . path ( id ) . build ( ) ; <START_BUG> return Response . ok ( Status . CREATED ) . location ( location ) . build ( ) ; <END_BUG> } @ PUT @ Path ( "id//{id}" ) public Response updateIssueById ( @ PathParam ( "id" ) final Long id , final Issue issue ) { } private IssueService getIssueService ( ) { } }

Fix:
return Response . created ( location ) . build ( ) ;
Buggy code:
public class EventSourceTransportHandler extends AbstractHttpSendingTransportHandler { @ Override public TransportType getTransportType ( ) { } @ Override protected MediaType getContentType ( ) { } @ Override public StreamingSockJsSession createSession ( String sessionId , WebSocketHandler handler ) { <START_BUG> Assert . notNull ( getSockJsConfig ( ) , "This<seq2seq4repair_space>transport<seq2seq4repair_space>requires<seq2seq4repair_space>SockJsConfiguration" ) ; <END_BUG> return new StreamingSockJsSession ( sessionId , getSockJsConfig ( ) , handler ) { @ Override protected void writePrelude ( ) throws IOException { getResponse ( ) . getBody ( ) . write ( '\r' ) ; getResponse ( ) . getBody ( ) . write ( '\n' ) ; getResponse ( ) . flush ( ) ; } } ; } @ Override protected FrameFormat getFrameFormat ( ServerHttpRequest request ) { } }

Fix:
Assert . state ( ( ( getSockJsConfig ( ) ) != null ) , "This<seq2seq4repair_space>transport<seq2seq4repair_space>requires<seq2seq4repair_space>SockJsConfiguration" ) ;
Buggy code:
class GarbageCollectorMXBeanAttributeHandler extends AbstractPlatformMBeanAttributeHandler { static final GarbageCollectorMXBeanAttributeHandler INSTANCE = new GarbageCollectorMXBeanAttributeHandler ( ) ; private GarbageCollectorMXBeanAttributeHandler ( ) { } @ Override protected void executeReadAttribute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final String gcName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; final String name = operation . require ( NAME ) . asString ( ) ; GarbageCollectorMXBean gcMBean = null ; for ( GarbageCollectorMXBean mbean : ManagementFactory . getGarbageCollectorMXBeans ( ) ) { if ( gcName . equals ( PlatformMBeanUtil . escapeMBeanName ( mbean . getName ( ) ) ) ) { gcMBean = mbean ; } } if ( gcMBean == null ) { throw ROOT_LOGGER . unknownGarbageCollector ( gcName ) ; } <START_BUG> if ( ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) && ( OBJECT_NAME . getName ( ) . equals ( name ) ) ) { <END_BUG> final String objName = PlatformMBeanUtil . getObjectNameStringWithNameKey ( ManagementFactory . GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE , gcName ) ; context . getResult ( ) . set ( objName ) ; } else if ( NAME . equals ( name ) ) { context . getResult ( ) . set ( PlatformMBeanUtil . escapeMBeanName ( gcMBean . getName ( ) ) ) ; } else if ( VALID . getName ( ) . equals ( name ) ) { context . getResult ( ) . set ( gcMBean . isValid ( ) ) ; } else if ( MEMORY_POOL_NAMES . equals ( name ) ) { final ModelNode result = context . getResult ( ) ; result . setEmptyList ( ) ; for ( String pool : gcMBean . getMemoryPoolNames ( ) ) { result . add ( PlatformMBeanUtil . escapeMBeanName ( pool ) ) ; } } else if ( COLLECTION_COUNT . equals ( name ) ) { context . getResult ( ) . set ( gcMBean . getCollectionCount ( ) ) ; } else if ( COLLECTION_TIME . equals ( name ) ) { context . getResult ( ) . set ( gcMBean . getCollectionTime ( ) ) ; } else if ( ( GARBAGE_COLLECTOR_READ_ATTRIBUTES . contains ( name ) ) || ( GARBAGE_COLLECTOR_METRICS . contains ( name ) ) ) { throw ROOT_LOGGER . badReadAttributeImpl ( name ) ; } else { throw unknownAttribute ( operation ) ; } } @ Override protected void executeWriteAttribute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } }

Fix:
if ( OBJECT_NAME . getName ( ) . equals ( name ) ) {
Buggy code:
public class DetailsFragment extends Fragment { private static final String ARG_NAME = "userName" ; private static final String ARG_URL = "pictureUrl" ; private static final String ARG_STATUS = "userStatus" ; private static final String ARG_GENDER = "userGender" ; private static final String ARG_AGE = "userAge" ; private static final String ARG_INTERESTED = "interestedIn" ; private String pictureUrl ; private String userName ; private int userStatus ; private int userAge ; private int userGender ; private int userInterested ; private String TAG = "DetailsFragment" ; public static DetailsFragment newInstance ( String name , String url , int status , int age , int gender , int interestedIn ) { } public DetailsFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View v = inflater . inflate ( fragment_details , container , false ) ; ImageView profpic = ( ( ImageView ) ( v . findViewById ( imageView3 ) ) ) ; new DetailsFragment . ImageLoadTask ( ( ( String ) ( getArguments ( ) . get ( DetailsFragment . ARG_URL ) ) ) , profpic ) . execute ( ) ; TextView name = ( ( TextView ) ( v . findViewById ( textView3 ) ) ) ; name . setText ( ( ( String ) ( getArguments ( ) . getString ( DetailsFragment . ARG_NAME ) ) ) ) ; TextView status = ( ( TextView ) ( v . findViewById ( textView4 ) ) ) ; int statusInt = ( ( int ) ( getArguments ( ) . getInt ( DetailsFragment . ARG_STATUS ) ) ) ; String [ ] stat = getResources ( ) . getStringArray ( statuses ) ; <START_BUG> status . setText ( stat [ statusInt ] ) ; <END_BUG> TextView age = ( ( TextView ) ( v . findViewById ( textView6 ) ) ) ; String agee = ( ( int ) ( getArguments ( ) . getInt ( DetailsFragment . ARG_AGE ) ) ) + "" ; age . setText ( agee ) ; TextView gen = ( ( TextView ) ( v . findViewById ( textView8 ) ) ) ; if ( ( ( int ) ( getArguments ( ) . getInt ( DetailsFragment . ARG_GENDER ) ) ) == 1 ) { gen . setText ( "M" ) ; } else { gen . setText ( "F" ) ; } TextView inin = ( ( TextView ) ( v . findViewById ( textView10 ) ) ) ; if ( ( ( int ) ( getArguments ( ) . getInt ( DetailsFragment . ARG_INTERESTED ) ) ) == 1 ) { inin . setText ( "M" ) ; } else if ( ( ( int ) ( getArguments ( ) . getInt ( DetailsFragment . ARG_INTERESTED ) ) ) == 2 ) { inin . setText ( "F" ) ; } else { inin . setText ( "BOTH" ) ; } return v ; } private class ImageLoadTask extends AsyncTask < Void , Void , Bitmap > { private String url ; private ImageView imageView ; public ImageLoadTask ( String url , ImageView imageView ) { } @ Override protected Bitmap doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( Bitmap result ) { } } }

Fix:
status . setText ( stat [ ( statusInt - 1 ) ] ) ;
Buggy code:
public class Presenter_CommitFile extends Presenter { private ArrayList < CommitFile > commitFiles ; public ArrayList < CommitFile > getCommitFile ( ) { } public void setCommitFile ( ArrayList < CommitFile > commitFiles ) { } public Presenter_CommitFile ( ArrayList < CommitFile > commitFiles ) { } public String getText ( ) { float impact = 0 ; for ( CommitFile commitFile : commitFiles ) { if ( ( commitFile . impact ) > impact ) { impact = commitFile . impact ; } } <START_BUG> return String . format ( "%s<seq2seq4repair_space>-<seq2seq4repair_space>%f" , commitFiles . get ( 0 ) . newPath . toPath ( ) . getFileName ( ) . toString ( ) , impact ) ; <END_BUG> } public boolean isAvailable ( ) { } public Color getColor ( ) { } @ Override public JLabel present ( JLabel defaultLabel ) { } @ Override public Collection < ? extends DataElement > visit ( Visitor visitor ) { } }

Fix:
return String . format ( "%s<seq2seq4repair_space>-<seq2seq4repair_space>%.1f" , commitFiles . get ( 0 ) . newPath . toPath ( ) . getFileName ( ) . toString ( ) , impact ) ;
Buggy code:
public class TestingForm extends JDialog { private static final long serialVersionUID = - 3725574796168603069L ; private DefaultTableModel model = new DefaultTableModel ( ) ; private EventForm eventForm ; private SimulatorGuiForm mainForm ; private Timer tm ; private JPanel panel ; protected TesterHostMBean host ; private JTextField tbL1State ; private JTable tNotif ; private JButton btStart ; private JButton btStop ; private JButton btRefresh ; private JPanel panel_b ; protected JPanel panel_c ; private JPanel panel_a_1 ; private JLabel lblLState_1 ; private JPanel panel_a_but ; private JPanel panel_a ; private JScrollPane scrollPane ; private JLabel lblLState ; private JTextField tbL2State ; private JLabel lblLState_2 ; private JTextField tbL3State ; private JLabel lblTestingState ; private JLabel lbTestState ; private JButton btnOpenEventWindow ; private JPanel panel_1 ; private JPanel panel_2 ; private JPanel panel_3 ; public TestingForm ( JFrame owner ) { } private void setEventMsg ( ) { } public void setData ( SimulatorGuiForm mainForm , final TesterHostMBean host ) { } private JDialog getJFrame ( ) { } public void refreshState ( ) { } public void sendNotif ( Notification notif ) { Date d1 = new Date ( notif . getTimeStamp ( ) ) ; <START_BUG> String s1 = DateFormat . getDateInstance ( ) . format ( d1 ) ; <END_BUG> Vector < String > newRow = new Vector < String > ( ) ; newRow . add ( s1 ) ; newRow . add ( notif . getType ( ) ) ; newRow . add ( notif . getMessage ( ) ) ; newRow . add ( notif . getUserData ( ) . toString ( ) ) ; model . getDataVector ( ) . add ( 0 , newRow ) ; model . newRowsAdded ( new TableModelEvent ( model ) ) ; } public void eventFormClose ( ) { } private void openEventWindow ( ) { } private void closingWindow ( ) { } }

Fix:
String s1 = DateFormat . getDateTimeInstance ( ) . format ( d1 ) ;
Buggy code:
public class PublisherSampler extends BaseJMSSampler implements TestListener { public static final String INPUT_FILE = "jms.input_file" ; public static final String RANDOM_PATH = "jms.random_path" ; public static final String TEXT_MSG = "jms.text_message" ; public static final String CONFIG_CHOICE = "jms.config_choice" ; public static final String MESSAGE_CHOICE = "jms.config_msg_type" ; private Publisher PUB = null ; private StringBuffer BUFFER = new StringBuffer ( ) ; private static FileServer FSERVER = FileServer . getFileServer ( ) ; private String file_contents = null ; static Logger log = LoggingManager . getLoggerForClass ( ) ; public PublisherSampler ( ) { } public void testStarted ( String test ) { } public void testEnded ( String test ) { } public void testEnded ( ) { } public void testStarted ( ) { } public void testIterationStart ( LoopIterationEvent event ) { } public synchronized void initClient ( ) { } public SampleResult sample ( Entry e ) { } public SampleResult sample ( ) { SampleResult result = new SampleResult ( ) ; result . setSampleLabel ( getName ( ) ) ; if ( ( this . PUB ) == null ) { this . initClient ( ) ; } int loop = this . getIterationCount ( ) ; if ( ( this . PUB ) != null ) { result . sampleStart ( ) ; for ( int idx = 0 ; idx < loop ; idx ++ ) { String tmsg = this . getMessageContent ( ) ; this . PUB . publish ( tmsg ) ; this . BUFFER . append ( tmsg ) ; } result . sampleEnd ( ) ; String content = this . BUFFER . toString ( ) ; <START_BUG> result . setContentLength ( content . getBytes ( ) . length ) ; <END_BUG> result . setResponseCode ( "message<seq2seq4repair_space>published<seq2seq4repair_space>successfully" ) ; result . setResponseMessage ( ( loop + "<seq2seq4repair_space>messages<seq2seq4repair_space>published" ) ) ; result . setSuccessful ( true ) ; result . setResponseData ( content . getBytes ( ) ) ; result . setSampleCount ( loop ) ; this . BUFFER . setLength ( 0 ) ; } return result ; } public String getMessageContent ( ) { } public String getFileContent ( String path ) { } public void setConfigChoice ( String choice ) { } public String getConfigChoice ( ) { } public void setMessageChoice ( String choice ) { } public String getMessageChoice ( ) { } public void setInputFile ( String file ) { } public String getInputFile ( ) { } public void setRandomPath ( String path ) { } public String getRandomPath ( ) { } public void setTextMessage ( String message ) { } public String getTextMessage ( ) { } }

Fix:
result . setBytes ( content . getBytes ( ) . length ) ;
Buggy code:
public class Won extends Activity { private String winner ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void showWinner ( ) { Intent called = getIntent ( ) ; winner = called . getExtras ( ) . getString ( "Winner" ) ; String word = called . getExtras ( ) . getString ( "Word" ) ; TextView playerWon = ( ( TextView ) ( findViewById ( R . id . winner ) ) ) ; <START_BUG> playerWon . setText ( ( ( ( ( winner ) + "<seq2seq4repair_space>won!<seq2seq4repair_space>\"" ) + word ) + "\"<seq2seq4repair_space>was<seq2seq4repair_space>spelled" ) ) ; <END_BUG> } }

Fix:
playerWon . setText ( ( ( ( ( winner ) + "<seq2seq4repair_space>won!<seq2seq4repair_space>\"" ) + word ) + "\"<seq2seq4repair_space>was<seq2seq4repair_space>spelled<seq2seq4repair_space>by<seq2seq4repair_space>the<seq2seq4repair_space>other<seq2seq4repair_space>player" ) ) ;
Buggy code:
public class Videos extends Fragment { private LoadResource loadResource ; private RecyclerView mRecyclerView ; private LayoutManager mLayoutManager ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View rootView = inflater . inflate ( fragment_article , container , false ) ; String [ ] sub = new String [ ] { "Visual<seq2seq4repair_space>Art" , "Science" } ; mRecyclerView = ( ( RecyclerView ) ( rootView . findViewById ( recycler_res ) ) ) ; mRecyclerView . setHasFixedSize ( true ) ; mLayoutManager = new android . support . v7 . widget . LinearLayoutManager ( getActivity ( ) ) ; mRecyclerView . setLayoutManager ( mLayoutManager ) ; <START_BUG> loadResource = new LoadResource ( getActivity ( ) , mRecyclerView , sub , "LowerElem" , 1 ) ; <END_BUG> loadResource . execute ( ) ; return rootView ; } }

Fix:
loadResource = new LoadResource ( getActivity ( ) , getActivity ( ) , mRecyclerView , sub , "LowerElem" , 1 ) ;
Buggy code:
public class ToolBar extends JToolBar { ResourceBundle toolbarLabels ; GridBagConstraints gridbagConstraints ; GridBagLayout gridbagLayout ; int i ; FrameController frameController ; public ToolBar ( FrameController controller ) { } private void createButtons ( XmlElement toolbar ) { ListIterator iterator = toolbar . getElements ( ) . listIterator ( ) ; XmlElement buttonElement ; while ( iterator . hasNext ( ) ) { try { buttonElement = ( ( XmlElement ) ( iterator . next ( ) ) ) ; if ( buttonElement . getName ( ) . equals ( "button" ) ) <START_BUG> addButton ( ( ( ActionPluginHandler ) ( pluginManager . getHandler ( "action" ) ) ) . getAction ( buttonElement . getAttribute ( "action" ) , frameController ) ) ; <END_BUG> else if ( buttonElement . getName ( ) . equals ( "separator" ) ) addSeparator ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } add ( Box . createHorizontalGlue ( ) ) ; } public void addButton ( BasicAction action ) { } public void addCButtons ( ) { } }

Fix:
addButton ( ( ( ActionPluginHandler ) ( pluginManager . getHandler ( "org.columba.core.action" ) ) ) . getAction ( buttonElement . getAttribute ( "action" ) , frameController ) ) ;
Buggy code:
public class BalancedSegmentMergePolicy extends LogByteSizeMergePolicy { public static final int DEFAULT_NUM_LARGE_SEGMENTS = 10 ; private boolean _partialExpunge = false ; private int _numLargeSegments = BalancedSegmentMergePolicy . DEFAULT_NUM_LARGE_SEGMENTS ; private int _maxSmallSegments = 2 * ( LogMergePolicy . DEFAULT_MERGE_FACTOR ) ; private int _maxSegments = ( _numLargeSegments ) + ( _maxSmallSegments ) ; public BalancedSegmentMergePolicy ( ) { } public void setMergePolicyParams ( BalancedSegmentMergePolicy . MergePolicyParams params ) { } @ Override protected long size ( SegmentInfo info ) throws IOException { <START_BUG> long byteSize = info . sizeInBytes ( ) ; <END_BUG> float delRatio = ( ( info . docCount ) <= 0 ) ? 0.0F : ( ( float ) ( info . getDelCount ( ) ) ) // ( ( float ) ( info . docCount ) ) ; return ( info . docCount ) <= 0 ? byteSize : ( ( long ) ( ( 1.0F - delRatio ) * byteSize ) ) ; } public void setPartialExpunge ( boolean doPartialExpunge ) { } public boolean getPartialExpunge ( ) { } public void setNumLargeSegments ( int numLargeSegments ) { } public int getNumLargeSegments ( ) { } public void setMaxSmallSegments ( int maxSmallSegments ) { } public int getMaxSmallSegments ( ) { } @ Override public void setMergeFactor ( int mergeFactor ) { } @ Override public MergeSpecification findMergesForOptimize ( SegmentInfos infos , int maxNumSegments , Set < SegmentInfo > segmentsToOptimize ) throws IOException { } private MergeSpecification findBalancedMerges ( SegmentInfos infos , int infoLen , int maxNumSegments , boolean partialExpunge ) throws IOException { } private double [ ] [ ] createVarianceTable ( SegmentInfos infos , int last , int maxNumSegments ) throws IOException { } @ Override public MergeSpecification findMergesToExpungeDeletes ( SegmentInfos infos ) throws IOException , CorruptIndexException { } @ Override public MergeSpecification findMerges ( SegmentInfos infos ) throws IOException { } private OneMerge findOneSegmentToExpunge ( SegmentInfos infos , int maxNumSegments ) throws IOException { } public static class MergePolicyParams { private int _numLargeSegments ; private int _maxSmallSegments ; private boolean _doPartialExpunge ; private int _mergeFactor ; private boolean _useCompoundFile ; private int _maxMergeDocs ; public MergePolicyParams ( ) { } public void setNumLargeSegments ( int numLargeSegments ) { } public int getNumLargeSegments ( ) { } public void setMaxSmallSegments ( int maxSmallSegments ) { } public int getMaxSmallSegments ( ) { } public void setPartialExpunge ( boolean doPartialExpunge ) { } public boolean getPartialExpunge ( ) { } public void setMergeFactor ( int mergeFactor ) { } public int getMergeFactor ( ) { } public void setMaxMergeDocs ( int maxMergeDocs ) { } public int getMaxMergeDocs ( ) { } public void setUseCompoundFile ( boolean useCompoundFile ) { } public boolean isUseCompoundFile ( ) { } } }

Fix:
long byteSize = info . sizeInBytes ( true ) ;
Buggy code:
class ClasspathDirectory implements FileSystem . Classpath { String path ; Hashtable directoryCache ; String [ ] missingPackageHolder = new String [ 1 ] ; String encoding ; ClasspathDirectory ( File directory , String encoding ) { } String [ ] directoryList ( String qualifiedPackageName ) { String [ ] dirList = ( ( String [ ] ) ( directoryCache . get ( qualifiedPackageName ) ) ) ; if ( dirList == ( missingPackageHolder ) ) return null ; if ( dirList != null ) return dirList ; File dir = new File ( ( ( path ) + qualifiedPackageName ) ) ; notFound : if ( ( dir != null ) && ( dir . isDirectory ( ) ) ) { int index = qualifiedPackageName . length ( ) ; <START_BUG> int last = qualifiedPackageName . lastIndexOf ( '//' ) ; <END_BUG> while ( ( ( -- index ) > last ) && ( ! ( Character . isUpperCase ( qualifiedPackageName . charAt ( index ) ) ) ) ) { } if ( index > last ) { if ( last == ( - 1 ) ) { if ( ! ( doesFileExist ( qualifiedPackageName , "" ) ) ) break notFound ; } else { String packageName = qualifiedPackageName . substring ( ( last + 1 ) ) ; String parentPackage = qualifiedPackageName . substring ( 0 , last ) ; if ( ! ( doesFileExist ( packageName , parentPackage ) ) ) break notFound ; } } if ( ( dirList = dir . list ( ) ) == null ) dirList = new String [ 0 ] ; directoryCache . put ( qualifiedPackageName , dirList ) ; return dirList ; } directoryCache . put ( qualifiedPackageName , missingPackageHolder ) ; return null ; } boolean doesFileExist ( String fileName , String qualifiedPackageName ) { } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) { } public boolean isPackage ( String qualifiedPackageName ) { } public void reset ( ) { } public String toString ( ) { } }

Fix:
int last = qualifiedPackageName . lastIndexOf ( File . separatorChar ) ;
Buggy code:
public class FileSystemEventParser implements EventSource { private final BufferedReader bufferedReader ; private final FileSystemClient client ; public FileSystemEventParser ( FileSystemClient client , InputStream traceStream ) { } @ Override public Event getNextEvent ( ) { } private String readNextLine ( ) throws IOException { } private UnlinkEvent parseUnlinkEvent ( StringTokenizer tokenizer ) { } private CloseEvent parseCloseEvent ( StringTokenizer tokenizer ) { } private ReadEvent parseReadEvent ( StringTokenizer tokenizer ) { } private Event parseWriteEvent ( StringTokenizer tokenizer ) { Time [ ] timestampAndDuration = parseTime ( tokenizer . nextToken ( ) ) ; String filePath = tokenizer . nextToken ( ) ; long length = Long . parseLong ( tokenizer . nextToken ( ) ) ; <START_BUG> return new WriteEvent ( client , timestampAndDuration [ 0 ] , length , timestampAndDuration [ 2 ] , filePath ) ; <END_BUG> } private Time [ ] parseTime ( String traceTimestamp ) { } No newline ; at end ; of file ; }

Fix:
return new WriteEvent ( client , timestampAndDuration [ 0 ] , length , timestampAndDuration [ 1 ] , filePath ) ;
Buggy code:
public class CrawlQueueController { public static final String DB_NAME = "crawlerQUEUE" ; private DAO < CrawlRequest , ObjectId > dao ; private CrawlQueueController . Poller poller ; private static final Integer [ ] AVAILABLE_PORTS = new Integer [ ] { 9995 , 9997 , 9999 } ; public CrawlQueueController ( ) { } public void shutdown ( ) { } public synchronized CrawlRequest submit ( boolean isNew , String crawlDir , String collectionName , String ... keywords ) { } public synchronized CrawlRequest cancel ( String id ) { } public synchronized CrawlRequest getStatus ( String id ) { } public List < Image > getImages ( String id , int count , int offset ) { } private void cancelForPort ( int portNumber ) { } private CrawlRequest enqueue ( boolean isNew , String crawlDir , String collectionName , String ... keywords ) { } private void tryLaunch ( ) { } private void launch ( String scriptName ) { } public class Poller implements Runnable { final ScheduledExecutorService exec = Executors . newSingleThreadScheduledExecutor ( ) ; Future future = null ; @ Override public void run ( ) { <START_BUG> System . out . println ( "polling<seq2seq4repair_space>event" ) ; <END_BUG> tryLaunch ( ) ; } public void startPolling ( ) { } public void stopPolling ( ) { } } private List < CrawlRequest > getCrawlRequest ( String id ) { } private List < CrawlRequest > getRunningCrawls ( ) { } private List < CrawlRequest > getWaitingCrawls ( ) { } private boolean isPortAvailable ( int port ) { } private static void inheritIO ( final InputStream src , final PrintStream dest ) { } }

Fix:
System . out . println ( "NEW<seq2seq4repair_space>polling<seq2seq4repair_space>event" ) ;
Buggy code:
public class VAJImport extends VAJTask { protected ArrayList filesets = new ArrayList ( ) ; protected boolean importSources = true ; protected boolean importResources = true ; protected boolean importClasses = false ; protected String importProject = null ; protected boolean useDefaultExcludes = true ; public void setDefaultexcludes ( boolean useDefaultExcludes ) { } public void setImportClasses ( boolean importClasses ) { } public void setImportResources ( boolean importResources ) { } public void setImportSources ( boolean importSources ) { } public void setProject ( String projectName ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws TaskException { } protected void importFileset ( FileSet fileset ) { <START_BUG> DirectoryScanner ds = fileset . getDirectoryScanner ( this . getProject ( ) ) ; <END_BUG> if ( ( ds . getIncludedFiles ( ) . length ) == 0 ) { return ; } String [ ] includes = null ; String [ ] excludes = null ; try { Class directoryScanner = ds . getClass ( ) ; Field includesField = directoryScanner . getDeclaredField ( "includes" ) ; includesField . setAccessible ( true ) ; includes = ( ( String [ ] ) ( includesField . get ( ds ) ) ) ; Field excludesField = directoryScanner . getDeclaredField ( "excludes" ) ; excludesField . setAccessible ( true ) ; excludes = ( ( String [ ] ) ( excludesField . get ( ds ) ) ) ; } catch ( NoSuchFieldException nsfe ) { throw new TaskException ( ( "DirectoryScanner.includes<seq2seq4repair_space>or<seq2seq4repair_space>.excludes<seq2seq4repair_space>missing" + ( nsfe . getMessage ( ) ) ) ) ; } catch ( IllegalAccessException iae ) { throw new TaskException ( "Access<seq2seq4repair_space>to<seq2seq4repair_space>DirectoryScanner.includes<seq2seq4repair_space>or<seq2seq4repair_space>.excludes<seq2seq4repair_space>not<seq2seq4repair_space>allowed" ) ; } getUtil ( ) . importFiles ( importProject , ds . getBasedir ( ) , includes , excludes , importClasses , importResources , importSources , useDefaultExcludes ) ; } }

Fix:
DirectoryScanner ds = fileset . getDirectoryScanner ( ) ;
Buggy code:
public class CompositeCollectionTest < E > extends AbstractCollectionTest < E > { public CompositeCollectionTest ( final String name ) { } @ Override public boolean isAddSupported ( ) { } @ Override public boolean isRemoveSupported ( ) { } @ Override public Collection < E > makeObject ( ) { } @ Override public Collection < E > makeConfirmedCollection ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public E [ ] getFullElements ( ) { } @ Override public Collection < E > makeFullCollection ( ) { } @ Override public Collection < E > makeConfirmedFullCollection ( ) { } @ Override public void testUnsupportedRemove ( ) { } protected CompositeCollection < E > c ; protected Collection < E > one ; protected Collection < E > two ; protected void setUpTest ( ) { } @ SuppressWarnings ( "serial" ) protected void setUpMutatorTest ( ) { setUpTest ( ) ; c . setMutator ( new CompositeCollection . CollectionMutator < E > ( ) { <START_BUG> public boolean add ( CompositeCollection < E > composite , List < Collection < E > > collections , E obj ) { <END_BUG> for ( final Collection < E > coll : collections ) { coll . add ( obj ) ; } return true ; } public boolean addAll ( final CompositeCollection < E > composite , final List < Collection < E > > collections , final Collection < ? extends E > coll ) { for ( final Collection < E > collection : collections ) { collection . addAll ( coll ) ; } return true ; } public boolean remove ( final CompositeCollection < E > composite , final List < Collection < E > > collections , final Object obj ) { for ( final Collection < E > collection : collections ) { collection . remove ( obj ) ; } return true ; } } ) ; } @ SuppressWarnings ( "unchecked" ) public void testSize ( ) { } @ SuppressWarnings ( "unchecked" ) public void testMultipleCollectionsSize ( ) { } @ SuppressWarnings ( "unchecked" ) public void testIsEmpty ( ) { } @ SuppressWarnings ( "unchecked" ) public void testIterator ( ) { } @ SuppressWarnings ( "unchecked" ) public void testClear ( ) { } @ SuppressWarnings ( "unchecked" ) public void testContainsAll ( ) { } @ SuppressWarnings ( "unchecked" ) public void testRetainAll ( ) { } @ SuppressWarnings ( { "unchecked" , "serial" } ) public void testAddAllMutator ( ) { } @ SuppressWarnings ( { "unchecked" , "serial" } ) public void testAddMutator ( ) { } @ SuppressWarnings ( "unchecked" ) public void testToCollection ( ) { } @ SuppressWarnings ( "unchecked" ) public void testAddAllToCollection ( ) { } @ SuppressWarnings ( "unchecked" ) public void testRemove ( ) { } @ SuppressWarnings ( "unchecked" ) public void testRemoveAll ( ) { } @ SuppressWarnings ( "unchecked" ) public void testRemoveComposited ( ) { } @ Override public String getCompatibilityVersion ( ) { } }

Fix:
public boolean add ( final CompositeCollection < E > composite , final List < Collection < E > > collections , final E obj ) {
Buggy code:
public abstract class Directory implements Closeable { public abstract String [ ] listAll ( ) throws IOException { } public abstract boolean fileExists ( String name ) throws IOException { } public abstract void deleteFile ( String name ) throws IOException { } public abstract long fileLength ( String name ) throws IOException { } public abstract IndexOutput createOutput ( String name , IOContext context ) throws IOException { } public abstract void sync ( Collection < String > names ) throws IOException { } public abstract IndexInput openInput ( String name , IOContext context ) throws IOException { } public abstract Lock makeLock ( String name ) { } public abstract void clearLock ( String name ) throws IOException { } @ Override public abstract void close ( ) throws IOException { } public abstract void setLockFactory ( LockFactory lockFactory ) throws IOException { } public abstract LockFactory getLockFactory ( ) { } public String getLockID ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( super . toString ( ) ) + "<seq2seq4repair_space>lockFactory=" ) + ( getLockFactory ( ) ) ; <END_BUG> } public void copy ( Directory to , String src , String dest , IOContext context ) throws IOException { } public Directory . IndexInputSlicer createSlicer ( final String name , final IOContext context ) throws IOException { } protected void ensureOpen ( ) throws AlreadyClosedException { } public abstract class IndexInputSlicer implements Closeable { public abstract IndexInput openSlice ( String sliceDescription , long offset , long length ) throws IOException { } } private static final class SlicedIndexInput extends BufferedIndexInput { IndexInput base ; long fileOffset ; long length ; SlicedIndexInput ( final String sliceDescription , final IndexInput base , final long fileOffset , final long length ) { } SlicedIndexInput ( final String sliceDescription , final IndexInput base , final long fileOffset , final long length , int readBufferSize ) { } @ Override public Directory . SlicedIndexInput clone ( ) { } @ Override protected void readInternal ( byte [ ] b , int offset , int len ) throws IOException { } @ Override protected void seekInternal ( long pos ) { } @ Override public void close ( ) throws IOException { } @ Override public long length ( ) { } } }

Fix:
return ( ( ( ( getClass ( ) . getSimpleName ( ) ) + '@' ) + ( Integer . toHexString ( hashCode ( ) ) ) ) + "<seq2seq4repair_space>lockFactory=" ) + ( getLockFactory ( ) ) ;
Buggy code:
public class UserDAO { private static List < UserDTO > userCollections = new ArrayList < UserDTO > ( ) ; public UserDAO ( ) { } public static void save ( UserDTO givenUser ) { } public static UserDTO getByUserName ( String userName ) { for ( UserDTO user : UserDAO . userCollections ) { <START_BUG> if ( ( user . getName ( ) ) == userName ) { <END_BUG> return user ; } } return null ; } }

Fix:
if ( user . getName ( ) . equals ( userName ) ) {
Buggy code:
public class MP4Util { private static Map < Codec , String > codecMapping = new HashMap < Codec , String > ( ) ; public static MovieBox createRefMovie ( SeekableByteChannel input , String url ) throws IOException { } public static MovieBox parseMovie ( SeekableByteChannel input ) throws IOException { } public static List < MovieFragmentBox > parseMovieFragments ( SeekableByteChannel input ) throws IOException { } public static List < MP4Util . Atom > getRootAtoms ( SeekableByteChannel input ) throws IOException { } public static MP4Util . Atom findFirstAtom ( String fourcc , File input ) throws IOException { } public static MP4Util . Atom findFirstAtom ( String fourcc , SeekableByteChannel input ) throws IOException { } public static MP4Util . Atom atom ( SeekableByteChannel input ) throws IOException { } public static class Atom { private long offset ; private Header header ; public Atom ( Header header , long offset ) { } public long getOffset ( ) { } public Header getHeader ( ) { } public Box parseBox ( SeekableByteChannel input ) throws IOException { input . position ( ( ( offset ) + ( header . headerSize ( ) ) ) ) ; <START_BUG> return NodeBox . parseBox ( NIOUtils . fetchFrom ( input , ( ( int ) ( header . getSize ( ) ) ) ) , header , BoxFactory . getDefault ( ) ) ; <END_BUG> } public void copy ( SeekableByteChannel input , WritableByteChannel out ) throws IOException { } } public static MovieBox parseMovie ( File source ) throws IOException { } public static MovieBox createRefMovie ( File source ) throws IOException { } public static void writeMovie ( File f , MovieBox movie ) throws IOException { } public static void writeMovie ( SeekableByteChannel out , MovieBox movie ) throws IOException { } public static void writeMovie ( SeekableByteChannel out , MovieBox movie , int additionalSize ) throws IOException { } public static int estimateMoovBoxSize ( MovieBox movie ) { } public static Box cloneBox ( Box box , int approxSize ) { } public static Box cloneBox ( Box box , int approxSize , BoxFactory bf ) { } public static String getFourcc ( Codec codec ) { } public static ByteBuffer writeBox ( Box box , int approxSize ) { } No newline ; at end ; of file ; }

Fix:
return NodeBox . parseBox ( NIOUtils . fetchFrom ( input , ( ( int ) ( header . getBodySize ( ) ) ) ) , header , BoxFactory . getDefault ( ) ) ;
Buggy code:
public class RandomAdaptorTest { @ Test public void testAdaptor ( ) { } private void checkConstant ( Random random ) { byte [ ] bytes = new byte [ ] { 0 } ; random . nextBytes ( bytes ) ; Assert . assertEquals ( 0 , bytes [ 0 ] ) ; <START_BUG> Assert . assertEquals ( false , random . nextBoolean ( ) ) ; <END_BUG> Assert . assertEquals ( 0 , random . nextDouble ( ) , 0 ) ; Assert . assertEquals ( 0 , random . nextFloat ( ) , 0 ) ; Assert . assertEquals ( 0 , random . nextGaussian ( ) , 0 ) ; Assert . assertEquals ( 0 , random . nextInt ( ) ) ; Assert . assertEquals ( 0 , random . nextInt ( 1 ) ) ; Assert . assertEquals ( 0 , random . nextLong ( ) ) ; random . setSeed ( 100 ) ; Assert . assertEquals ( 0 , random . nextDouble ( ) , 0 ) ; } public static class ConstantGenerator implements RandomGenerator { private final double value ; public ConstantGenerator ( ) { } public ConstantGenerator ( double value ) { } public boolean nextBoolean ( ) { } public void nextBytes ( byte [ ] bytes ) { } public double nextDouble ( ) { } public float nextFloat ( ) { } public double nextGaussian ( ) { } public int nextInt ( ) { } public int nextInt ( int n ) { } public long nextLong ( ) { } public void setSeed ( int seed ) { } public void setSeed ( int [ ] seed ) { } public void setSeed ( long seed ) { } } }

Fix:
Assert . assertFalse ( random . nextBoolean ( ) ) ;
Buggy code:
public class BTree { private static final int NODE_SIZE = 2 ; public static class Node { public Node ( long data ) { } protected int usedSize = 1 ; protected BTree . Node parent ; protected BTree . Node [ ] children = new BTree . Node [ ( BTree . NODE_SIZE ) + 1 ] ; protected Long [ ] datas = new Long [ BTree . NODE_SIZE ] ; public boolean isLeaf ( ) { <START_BUG> return ( datas [ 0 ] ) == null ? true : false ; <END_BUG> } public BTree . Node insert ( Long data ) { } public void merge ( BTree . Node target , BTree . Node source ) { } public boolean isFull ( ) { } private BTree . Node split ( BTree . Node [ ] array ) { } private BTree . Node [ ] createArray ( long data ) { } private void gnomeSort ( Long [ ] array ) { } private void recursiveSort ( int i , Long [ ] array ) { } private void swap ( int i , Long [ ] array ) { } private void swap ( int i , int j , Long [ ] array ) { } private BTree . Node [ ] bubbleSort ( BTree . Node [ ] array ) { } private void swap ( int i , BTree . Node [ ] array ) { } private void swap ( int i , int j , BTree . Node [ ] array ) { } private long firstData ( BTree . Node node ) { } } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
return ( children [ 0 ] ) == null ? true : false ;
Buggy code:
public class StandaloneAccessControlTestCase extends AbstractCoreModelTest { @ Test public void testConfiguration ( ) throws Exception { new org . jboss . as . controller . access . constraint . management . SensitiveTargetAccessConstraintDefinition ( new SensitivityClassification ( "play" , "security-realm" , true , true , true ) ) ; new org . jboss . as . controller . access . constraint . management . ApplicationTypeAccessConstraintDefinition ( new ApplicationTypeConfig ( "play" , "deployment" , false ) ) ; <START_BUG> KernelServices kernelServices = createKernelServicesBuilder ( STANDALONE ) . setXmlResource ( "constraints.xml" ) . validateDescription ( ) . build ( ) ; <END_BUG> Assert . assertTrue ( kernelServices . isSuccessfulBoot ( ) ) ; String marshalled = kernelServices . getPersistedSubsystemXml ( ) ; ModelTestUtils . compareXml ( ModelTestUtils . readResource ( this . getClass ( ) , "standalone.xml" ) , marshalled ) ; } }

Fix:
KernelServices kernelServices = createKernelServicesBuilder ( STANDALONE ) . setXmlResource ( "standalone.xml" ) . validateDescription ( ) . build ( ) ;