nus-yam/ex-repair huggingface dataset:
Buggy code:
public interface SSLSupport { public String getCipherSuite ( ) throws IOException { } <START_BUG> public Certificate [ ] getPeerCertificateChain ( ) throws IOException ; <END_BUG> }

Fix:
public Object [ ] getPeerCertificateChain ( ) throws IOException ;
Buggy code:
public class RemoveTest extends CleanupHelper { StorageService ss = StorageService . instance ; TokenMetadata tmd = ss . getTokenMetadata ( ) ; IPartitioner oldPartitioner ; ArrayList < Token > endpointTokens = new ArrayList < Token > ( ) ; ArrayList < Token > keyTokens = new ArrayList < Token > ( ) ; List < InetAddress > hosts = new ArrayList < InetAddress > ( ) ; InetAddress removalhost ; Token removaltoken ; @ Before public void setup ( ) throws IOException , ConfigurationException { tmd . clearUnsafe ( ) ; IPartitioner partitioner = new RandomPartitioner ( ) ; oldPartitioner = ss . setPartitionerUnsafe ( partitioner ) ; Util . createInitialRing ( ss , partitioner , endpointTokens , keyTokens , hosts , 6 ) ; MessagingService . instance ( ) . listen ( FBUtilities . getLocalAddress ( ) ) ; <START_BUG> instance . start ( FBUtilities . getLocalAddress ( ) , 1 ) ; <END_BUG> for ( int i = 0 ; i < 6 ; i ++ ) { instance . initializeNodeUnsafe ( hosts . get ( i ) , 1 ) ; } removalhost = hosts . get ( 5 ) ; hosts . remove ( removalhost ) ; removaltoken = endpointTokens . get ( 5 ) ; endpointTokens . remove ( removaltoken ) ; } @ After public void tearDown ( ) { } @ Test ( expected = UnsupportedOperationException . class ) public void testBadToken ( ) { } @ Test ( expected = UnsupportedOperationException . class ) public void testLocalToken ( ) { } @ Test public void testRemoveToken ( ) throws InterruptedException { } @ Test public void testStartRemoving ( ) { } @ Test public void testFinishRemoving ( ) { } class ReplicationSink implements IMessageSink { public Message handleMessage ( Message msg , String id , InetAddress to ) { } } class NotificationSink implements IMessageSink { public int callCount = 0 ; public Message handleMessage ( Message msg , String id , InetAddress to ) { } } }

Fix:
instance . start ( 1 ) ;
Buggy code:
public interface OWLPropertyExpression extends AsOWLAnnotationProperty , AsOWLDataProperty , AsOWLObjectProperty , IsAnonymous , OWLObject { void accept ( @ Nonnull OWLPropertyExpressionVisitor visitor ) { } @ Nonnull < O > O accept ( @ Nonnull OWLPropertyExpressionVisitorEx < O > visitor ) { } default boolean isDataPropertyExpression ( ) { } default OWLDataPropertyExpression asDataPropertyExpression ( ) { } default boolean isObjectPropertyExpression ( ) { } default OWLObjectPropertyExpression asObjectPropertyExpression ( ) { <START_BUG> if ( isDataPropertyExpression ( ) ) { <END_BUG> return ( ( OWLObjectPropertyExpression ) ( this ) ) ; } throw new ClassCastException ( ( ( getClass ( ) . getName ( ) ) + "is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>OWLObjectPropertyExpression" ) ) ; } default boolean isOWLTopObjectProperty ( ) { } default boolean isOWLBottomObjectProperty ( ) { } default boolean isOWLTopDataProperty ( ) { } default boolean isOWLBottomDataProperty ( ) { } }

Fix:
if ( isObjectPropertyExpression ( ) ) {
Buggy code:
public class TestGroupTests { @ Rule public ExpectedException thrown = ExpectedException . none ( ) ; @ Test public void parseNull ( ) throws Exception { } @ Test public void parseEmptyString ( ) throws Exception { } @ Test public void parseWithSpaces ( ) throws Exception { } @ Test public void parseInMixedCase ( ) throws Exception { } @ Test public void parseMissing ( ) throws Exception { thrown . expect ( IllegalArgumentException . class ) ; <START_BUG> thrown . expectMessage ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>test<seq2seq4repair_space>group<seq2seq4repair_space>'missing'<seq2seq4repair_space>when<seq2seq4repair_space>parsing<seq2seq4repair_space>" + ( "testGroups<seq2seq4repair_space>value:<seq2seq4repair_space>'performance,<seq2seq4repair_space>missing'.<seq2seq4repair_space>Available<seq2seq4repair_space>groups<seq2seq4repair_space>include:<seq2seq4repair_space>" + "[LONG_RUNNING,PERFORMANCE,JMXMP]" ) ) ) ; <END_BUG> TestGroup . parse ( "performance,<seq2seq4repair_space>missing" ) ; } @ Test public void parseAll ( ) throws Exception { } }

Fix:
thrown . expectMessage ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>test<seq2seq4repair_space>group<seq2seq4repair_space>'missing'<seq2seq4repair_space>when<seq2seq4repair_space>parsing<seq2seq4repair_space>" + ( "testGroups<seq2seq4repair_space>value:<seq2seq4repair_space>'performance,<seq2seq4repair_space>missing'.<seq2seq4repair_space>Available<seq2seq4repair_space>groups<seq2seq4repair_space>include:<seq2seq4repair_space>" + "[LONG_RUNNING,PERFORMANCE,JMXMP,CI]" ) ) ) ;
Buggy code:
public class TestSynchronizedSet < E > extends AbstractTestSet < E > { public TestSynchronizedSet ( String testName ) { } public static Test suite ( ) { } @ Override public Set < E > makeObject ( ) { <START_BUG> return SynchronizedSet . decorate ( new HashSet < E > ( ) ) ; <END_BUG> } @ Override public String getCompatibilityVersion ( ) { } }

Fix:
return SynchronizedSet . synchronizedSet ( new HashSet < E > ( ) ) ;
Buggy code:
public class TestNoDeletionPolicy extends LuceneTestCase { @ Test public void testNoDeletionPolicy ( ) throws Exception { } @ Test public void testFinalSingleton ( ) throws Exception { } @ Test public void testMethodsOverridden ( ) throws Exception { } @ Test public void testAllCommitsRemain ( ) throws Exception { Directory dir = newDirectory ( ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setIndexDeletionPolicy ( INSTANCE ) ) ; for ( int i = 0 ; i < 10 ; i ++ ) { Document doc = new Document ( ) ; doc . add ( newTextField ( "c" , ( "a" + i ) , YES ) ) ; writer . addDocument ( doc ) ; writer . commit ( ) ; assertEquals ( "wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>commits<seq2seq4repair_space>!" , ( i + 1 ) , DirectoryReader . listCommits ( dir ) . size ( ) ) ; } <START_BUG> writer . close ( ) ; <END_BUG> dir . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class InputHandler implements EventHandler < KeyEvent > { private MainView mainview ; public InputHandler ( MainView mainview ) { } public void handle ( KeyEvent t ) { if ( ( t . getEventType ( ) ) == ( KeyEvent . KEY_PRESSED ) ) System . out . println ( t . getCode ( ) ) ; else if ( ( t . getCode ( ) ) == ( KeyCode . ENTER ) ) { if ( mainview . getLibrary ( ) . isFocused ( ) ) { mainview . play ( mainview . getLibrary ( ) . getSelectionModel ( ) . getSelectedItem ( ) ) ; mainview . getLibrary ( ) . updateQueue ( ) ; } else if ( mainview . getFilebrowser ( ) . isFocused ( ) ) { System . out . println ( mainview . getFilebrowser ( ) . getSelectionModel ( ) . getSelectedItem ( ) ) ; } } else if ( ( t . getCode ( ) ) == ( KeyCode . UP ) ) <START_BUG> mainview . showLyrics ( ) ; <END_BUG> else if ( ( t . getCode ( ) ) == ( KeyCode . DOWN ) ) System . out . println ( "DOWN" ) ; else if ( ( t . getCode ( ) ) == ( KeyCode . LEFT ) ) mainview . skipBackward ( ) ; else if ( ( t . getCode ( ) ) == ( KeyCode . RIGHT ) ) mainview . skipForward ( ) ; else if ( ( t . getCode ( ) ) == ( KeyCode . SPACE ) ) { if ( mainview . getMusicPlayer ( ) . isPlaying ( ) ) mainview . pause ( ) ; else if ( ( ( mainview . getMusicPlayer ( ) . getNowPlaying ( ) ) != null ) && ( ! ( mainview . getMusicPlayer ( ) . isPlaying ( ) ) ) ) mainview . play ( ) ; } } }

Fix:
System . out . println ( "UP" ) ;
Buggy code:
public class SplashActivity extends Activity { private final int TIME_WAIT = 3000 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_splash ) ; new Handler ( ) . postDelayed ( new Runnable ( ) { @ Override public void run ( ) { <START_BUG> Intent intent = new Intent ( SplashActivity . this , MainActivity . class ) ; <END_BUG> SplashActivity . this . startActivity ( intent ) ; SplashActivity . this . finish ( ) ; } } , TIME_WAIT ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
Intent intent = new Intent ( SplashActivity . this , CasinoLobbyActivity . class ) ;
Buggy code:
public final class KeySupport { private static final ResourceBundle resourceBundle = ResourceBundle . getBundle ( KeySupport . class . getName ( ) ) ; private static final String ALT = "Alt" ; private static final String COMMAND = "Command" ; private static final String CTRL = "Ctrl" ; private static final String MODIFIER_SEPARATOR = "+" ; private static final String SHIFT = "Shift" ; private static final String STROKE_SEPARATOR = "<seq2seq4repair_space>" ; private static Map stringToValueMap = new TreeMap ( ) ; private static Map valueToStringMap = new TreeMap ( ) ; public static String formatSequence ( Sequence sequence , boolean localize ) throws IllegalArgumentException { } public static String formatStroke ( Stroke stroke , boolean localize ) throws IllegalArgumentException { } public static Sequence parseSequence ( String string ) throws IllegalArgumentException { } public static Stroke parseStroke ( String string ) throws IllegalArgumentException { if ( string == null ) throw new IllegalArgumentException ( ) ; List list = new ArrayList ( ) ; StringTokenizer stringTokenizer = new StringTokenizer ( string , KeySupport . MODIFIER_SEPARATOR , true ) ; while ( stringTokenizer . hasMoreTokens ( ) ) list . add ( stringTokenizer . nextToken ( ) ) ; int size = list . size ( ) ; int value = 0 ; if ( ( size % 2 ) == 1 ) { String token = ( ( String ) ( list . get ( ( size - 1 ) ) ) ) ; Integer integer = ( ( Integer ) ( KeySupport . stringToValueMap . get ( token . toUpperCase ( ) ) ) ) ; if ( integer != null ) value = integer . intValue ( ) ; else if ( ( token . length ( ) ) == 1 ) <START_BUG> value = token . charAt ( 0 ) ; <END_BUG> if ( value != 0 ) { for ( int i = 0 ; i < ( size - 1 ) ; i ++ ) { token = ( ( String ) ( list . get ( i ) ) ) ; if ( ( i % 2 ) == 0 ) { if ( KeySupport . CTRL . equalsIgnoreCase ( token ) ) { if ( ( value & ( SWT . CTRL ) ) != 0 ) return Stroke . create ( 0 ) ; value |= SWT . CTRL ; } else if ( KeySupport . ALT . equalsIgnoreCase ( token ) ) { if ( ( value & ( SWT . ALT ) ) != 0 ) return Stroke . create ( 0 ) ; value |= SWT . ALT ; } else if ( KeySupport . SHIFT . equalsIgnoreCase ( token ) ) { if ( ( value & ( SWT . SHIFT ) ) != 0 ) return Stroke . create ( 0 ) ; value |= SWT . SHIFT ; } else if ( KeySupport . COMMAND . equalsIgnoreCase ( token ) ) { if ( ( value & ( SWT . COMMAND ) ) != 0 ) return Stroke . create ( 0 ) ; value |= SWT . COMMAND ; } else return Stroke . create ( 0 ) ; } else if ( ! ( KeySupport . MODIFIER_SEPARATOR . equals ( token ) ) ) return Stroke . create ( 0 ) ; } } } return Stroke . create ( value ) ; } private KeySupport ( ) { } }

Fix:
value = token . toUpperCase ( ) . charAt ( 0 ) ;
Buggy code:
public class CanWriteFileFilter extends AbstractFileFilter implements Serializable { public static final IOFileFilter CAN_WRITE = new CanWriteFileFilter ( ) ; public static final IOFileFilter CANNOT_WRITE = new NotFileFilter ( CanWriteFileFilter . CAN_WRITE ) ; protected CanWriteFileFilter ( ) { } @ Override <START_BUG> public boolean accept ( File file ) { <END_BUG> return file . canWrite ( ) ; } }

Fix:
public boolean accept ( final File file ) {
Buggy code:
public class FXMLMainMenuController implements Initializable { @ FXML private TextArea informationArea ; @ FXML private AnchorPane helpAnchorpane ; @ FXML private Button backButton ; private String buttonText ; @ Override public void initialize ( URL url , ResourceBundle rb ) { } @ FXML private void menuClick ( ActionEvent event ) { } private void readOptionSettingFromFile ( ) { OptionObject objectload = new OptionObject ( ) ; <START_BUG> try ( ObjectInputStream oIn = new ObjectInputStream ( new FileInputStream ( ( ( ".//SaveFiles//" + ( DataStorage . getInstance ( ) . getNewActiveUser ( ) ) ) + ".txt" ) ) ) ) { <END_BUG> objectload = ( ( OptionObject ) ( oIn . readObject ( ) ) ) ; System . out . println ( "Filöppning<seq2seq4repair_space>lyckades" ) ; DataStorage . getInstance ( ) . setDifficulty ( objectload . getDifficulty ( ) ) ; DataStorage . getInstance ( ) . setMusicChoice ( objectload . getMusicChoice ( ) ) ; DataStorage . getInstance ( ) . setRoundLimit ( objectload . getRoundLimit ( ) ) ; DataStorage . getInstance ( ) . setMusicSet ( objectload . isMusicSet ( ) ) ; DataStorage . getInstance ( ) . setLoadOnceCheck ( true ) ; } catch ( Exception ex ) { System . out . println ( "Ingen<seq2seq4repair_space>fil<seq2seq4repair_space>skapad" ) ; } } private void helpViewer ( ) { } private void backToMenuFromHelp ( ) { } }

Fix:
try ( ObjectInputStream oIn = new ObjectInputStream ( new FileInputStream ( ( ( ".//AccountSettings//" + ( DataStorage . getInstance ( ) . getNewActiveUser ( ) ) ) + ".txt" ) ) ) ) {
Buggy code:
public class XLinkResolver { private static Vector < Document > documentList_ = new Vector < Document > ( ) ; public void resolveXLinks ( String fileToResolve ) throws XLinkException , IOException , ParserConfigurationException , TransformerException , XPathExpressionException , SAXException { } private static Document handleNodeList ( Document doc ) throws XLinkException , IOException , ParserConfigurationException , XPathExpressionException , SAXException { } private static void writeXMLFile ( Document doc ) throws IOException , TransformerException { TransformerFactory transfac = TransformerFactory . newInstance ( ) ; Transformer trans = transfac . newTransformer ( ) ; trans . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; trans . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "no" ) ; StringWriter sw = new StringWriter ( ) ; StreamResult result = new StreamResult ( sw ) ; DOMSource source = new DOMSource ( doc ) ; trans . transform ( source , result ) ; String xmlString = sw . toString ( ) ; if ( Definitions . debug_ ) System . out . println ( xmlString ) ; <START_BUG> FileWriter fstream = new FileWriter ( Definitions . tmpOutputFile_ ) ; <END_BUG> BufferedWriter out = new BufferedWriter ( fstream ) ; out . write ( xmlString ) ; out . close ( ) ; } private static Document parseXML ( String xmlURI ) throws IOException , ParserConfigurationException , SAXException { } private static NodeList extractXLinkElements ( Document doc ) throws XPathExpressionException { } private static String extractXLinkHref ( Node node ) throws XLinkException { } private static void printNode ( Node node ) { } No newline ; at end ; of file ; }

Fix:
FileWriter fstream = new FileWriter ( Definitions . tmpOutputFile ) ;
Buggy code:
public class ServerGroupProfileWriteAttributeHandler extends StringLengthValidatingHandler { public static final ServerGroupProfileWriteAttributeHandler INSTANCE = new ServerGroupProfileWriteAttributeHandler ( ) ; private ServerGroupProfileWriteAttributeHandler ( ) { } @ Override protected void modelChanged ( OperationContext context , ModelNode operation , String attributeName , ModelNode newValue , ModelNode currentValue ) throws OperationFailedException { if ( newValue . equals ( currentValue ) ) { <START_BUG> context . attach ( DONT_PROPAGATE_TO_SERVERS_ATTACHMENT , true ) ; <END_BUG> } final Resource profile = context . getOriginalRootResource ( ) . getChild ( PathElement . pathElement ( PROFILE , newValue . asString ( ) ) ) ; if ( profile == null ) { throw MESSAGES . noProfileCalled ( newValue . asString ( ) ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } }

Fix:
ServerOperationResolver . addToDontPropagateToServersAttachment ( context , operation ) ;
Buggy code:
public class StrictMaxPoolRemove extends AbstractRemoveStepHandler { public static final StrictMaxPoolRemove INSTANCE = new StrictMaxPoolRemove ( ) ; @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { if ( context . isResourceServiceRestartAllowed ( ) ) { <START_BUG> StrictMaxPoolAdd . INSTANCE . installRuntimeService ( context , model , null ) ; <END_BUG> } else { context . revertReloadRequired ( ) ; } } void removeRuntimeService ( OperationContext context , ModelNode operation ) { } }

Fix:
StrictMaxPoolAdd . INSTANCE . installRuntimeService ( context , operation , model , null ) ;
Buggy code:
public class XProductA implements AbstractProductA { @ Override public String methodA ( ) { <START_BUG> return "Implementación<seq2seq4repair_space>X<seq2seq4repair_space>del<seq2seq4repair_space>producto<seq2seq4repair_space>A" ; <END_BUG> } }

Fix:
return "Implementaci_n<seq2seq4repair_space>X<seq2seq4repair_space>del<seq2seq4repair_space>producto<seq2seq4repair_space>A" ;
Buggy code:
@ WebServlet ( name = "ControllerServlet" , loadOnStartup = 1 , urlPatterns = { "//category" , "//addToCart" , "//viewCart" , "//updateCart" , "//checkout" , "//purchase" , "//chooseLanguage" } ) public class ControllerServlet extends HttpServlet { private String surcharge ; @ EJB private CategoryFacade categoryFacade ; @ EJB private ProductFacade productFacade ; @ EJB private OrderManager orderManager ; public void init ( ServletConfig servletConfig ) throws ServletException { } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String userPath = request . getServletPath ( ) ; HttpSession session = request . getSession ( ) ; ShoppingCart cart = ( ( ShoppingCart ) ( session . getAttribute ( "cart" ) ) ) ; if ( userPath . equals ( "//addToCart" ) ) { if ( cart == null ) { cart = new ShoppingCart ( ) ; session . setAttribute ( "cart" , cart ) ; } int productId = Integer . parseInt ( request . getParameter ( "productId" ) ) ; cart . addItem ( productFacade . find ( productId ) ) ; userPath = "//category" ; } else if ( userPath . equals ( "//updateCart" ) ) { int productId = Integer . parseInt ( request . getParameter ( "productId" ) ) ; <START_BUG> int quantity = Integer . parseInt ( request . getParameter ( "quantity" ) ) ; <END_BUG> cart . update ( productId , quantity ) ; userPath = "//cart" ; } else if ( userPath . equals ( "//purchase" ) ) { if ( cart != null ) { String name = request . getParameter ( "name" ) ; String email = request . getParameter ( "email" ) ; String phone = request . getParameter ( "phone" ) ; String address = request . getParameter ( "address" ) ; String cityRegion = request . getParameter ( "cityRegion" ) ; String ccNumber = request . getParameter ( "creditcard" ) ; int orderId = orderManager . placeOrder ( name , email , phone , address , cityRegion , ccNumber , cart ) ; } userPath = "//confirmation" ; } String url = ( "//WEB-INF//view" + userPath ) + ".jsp" ; try { request . getRequestDispatcher ( url ) . forward ( request , response ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } @ Override public String getServletInfo ( ) { } }

Fix:
short quantity = Short . parseShort ( request . getParameter ( "quantity" ) ) ;
Buggy code:
public class HTTPAcceptorRemove extends AbstractRemoveStepHandler { static final HTTPAcceptorRemove INSTANCE = new HTTPAcceptorRemove ( ) ; protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; String hornetqServerName = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; String acceptorName = address . getLastElement ( ) . getValue ( ) ; <START_BUG> HTTPAcceptorAdd . INSTANCE . launchServices ( context , hornetqServerName , acceptorName , model , null , null ) ; <END_BUG> } }

Fix:
HTTPAcceptorAdd . INSTANCE . launchServices ( context , hornetqServerName , acceptorName , model ) ;
Buggy code:
public class DefaultCrawlControllerBuilder implements ICrawlControllerBuilder { @ Override public CrawlController build ( CrawlParameters parameters ) throws Exception { if ( parameters == null ) throw new IllegalArgumentException ( "Necessary<seq2seq4repair_space>parameters<seq2seq4repair_space>for<seq2seq4repair_space>crawling<seq2seq4repair_space>are<seq2seq4repair_space>missing" ) ; String errorMessages = parameters . validate ( ) ; <START_BUG> if ( ( errorMessages != null ) && ( errorMessages != "" ) ) <END_BUG> throw new IllegalArgumentException ( errorMessages ) ; PageFetcher pageFetcher = new PageFetcher ( parameters . getConfig ( ) ) ; RobotstxtConfig robotstxtConfig = new RobotstxtConfig ( ) ; RobotstxtServer robotstxtServer = new RobotstxtServer ( robotstxtConfig , pageFetcher ) ; CrawlController controller = new CrawlController ( parameters . getConfig ( ) , pageFetcher , robotstxtServer ) ; return controller ; } }

Fix:
if ( ( errorMessages != null ) && ( ( errorMessages . length ( ) ) > 1 ) )
Buggy code:
public class HornetQServerControlWriteHandler extends AbstractWriteAttributeHandler < Void > { public static final HornetQServerControlWriteHandler INSTANCE = new HornetQServerControlWriteHandler ( ) ; private HornetQServerControlWriteHandler ( ) { } public void registerAttributes ( final ManagementResourceRegistration registry , boolean registerRuntimeOnly ) { for ( AttributeDefinition attr : CommonAttributes . SIMPLE_ROOT_RESOURCE_ATTRIBUTES ) { if ( registerRuntimeOnly || ( ! ( attr . getFlags ( ) . contains ( STORAGE_RUNTIME ) ) ) ) { if ( attr . getName ( ) . equals ( CommonAttributes . CLUSTERED . getName ( ) ) ) { registry . registerReadWriteAttribute ( CommonAttributes . CLUSTERED , HornetQServerControlWriteHandler . ClusteredAttributeHandlers . READ_HANDLER , HornetQServerControlWriteHandler . ClusteredAttributeHandlers . WRITE_HANDLER ) ; } else { registry . registerReadWriteAttribute ( attr , null , this ) ; } } } <START_BUG> registry . registerReadWriteAttribute ( LIVE_CONNECTOR_REF , null , new DeprecatedAttributeWriteHandler ( LIVE_CONNECTOR_REF . getName ( ) ) ) ; <END_BUG> } @ Override protected boolean applyUpdateToRuntime ( final OperationContext context , final ModelNode operation , final String attributeName , final ModelNode newValue , final ModelNode currentValue , final HandbackHolder < Void > handbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( final OperationContext context , final ModelNode operation , final String attributeName , final ModelNode valueToRestore , final ModelNode valueToRevert , final Void handback ) throws OperationFailedException { } private void applyOperationToHornetQService ( final OperationContext context , ModelNode operation , String attributeName , ServiceController < ? > hqService ) { } private static final class ClusteredAttributeHandlers { static final OperationStepHandler READ_HANDLER = new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } } ; static final OperationStepHandler WRITE_HANDLER = new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } } ; private static boolean isClustered ( OperationContext context ) { } } }

Fix:
registry . registerReadWriteAttribute ( LIVE_CONNECTOR_REF , null , DeprecatedAttributeWriteHandler . INSTANCE ) ;
Buggy code:
public class Button extends Control { String text ; Image image ; boolean grayed ; static final int EXTRA_HEIGHT = 2 ; static final int EXTRA_WIDTH = 6 ; static final int IMAGE_GAP = 2 ; public Button ( Composite parent , int style ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } public void addSelectionListener ( SelectionListener listener ) { } NSSize cellSize ( int id , int sel ) { } static int checkStyle ( int style ) { } void click ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } NSAttributedString createString ( ) { <START_BUG> NSAttributedString attribStr = createString ( text , null , foreground , style , true , true ) ; <END_BUG> attribStr . autorelease ( ) ; return attribStr ; } void createHandle ( ) { } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } void drawImageWithFrameInView ( int id , int sel , int image , NSRect rect , int view ) { } void drawInteriorWithFrame_inView ( int id , int sel , NSRect cellRect , int viewid ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect ) { } public int getAlignment ( ) { } public boolean getGrayed ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public boolean getSelection ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } int nextState ( int id , int sel ) { } void register ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } void sendSelection ( ) { } public void setAlignment ( int alignment ) { } void _setAlignment ( int alignment ) { } void updateBackground ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } NSRect titleRectForBounds ( int id , int sel , NSRect cellFrame ) { } int traversalCode ( int key , NSEvent theEvent ) { } void updateAlignment ( ) { } }

Fix:
NSAttributedString attribStr = createString ( text , null , foreground , style , false , true , true ) ;
Buggy code:
public class SubmitLink extends Button { private static final long serialVersionUID = 1L ; private Form form ; public SubmitLink ( String id ) { } public SubmitLink ( String id , IModel model ) { } public SubmitLink ( String id , Form form ) { } public SubmitLink ( String id , IModel model , Form form ) { } protected void onComponentTag ( ComponentTag tag ) { } private String getTriggerJavaScript ( ) { } public final Form getForm ( ) { if ( ( form ) == null ) { <START_BUG> form = getForm ( ) ; <END_BUG> } return form ; } }

Fix:
form = super . getForm ( ) ;
Buggy code:
public class NSBox extends NSView { public NSBox ( ) { } public NSBox ( int id ) { } public NSColor borderColor ( ) { } public NSRect borderRect ( ) { } public int borderType ( ) { } public float borderWidth ( ) { } public int boxType ( ) { } public NSView contentView ( ) { } public NSSize contentViewMargins ( ) { NSSize result = new NSSize ( ) ; <START_BUG> OS . objc_msgSend_struct ( result , this . id , sel_contentViewMargins ) ; <END_BUG> return result ; } public float cornerRadius ( ) { } public NSColor fillColor ( ) { } public boolean isTransparent ( ) { } public void setBorderColor ( NSColor borderColor ) { } public void setBorderType ( int aType ) { } public void setBorderWidth ( float borderWidth ) { } public void setBoxType ( int boxType ) { } public void setContentView ( NSView aView ) { } public void setContentViewMargins ( NSSize offsetSize ) { } public void setCornerRadius ( float cornerRadius ) { } public void setFillColor ( NSColor fillColor ) { } public void setFrameFromContentFrame ( NSRect contentFrame ) { } public void setTitle ( NSString aString ) { } public void setTitleFont ( NSFont fontObj ) { } public void setTitlePosition ( int aPosition ) { } public void setTitleWithMnemonic ( NSString stringWithAmpersand ) { } public void setTransparent ( boolean flag ) { } public void sizeToFit ( ) { } public NSString title ( ) { } public NSCell titleCell ( ) { } public NSFont titleFont ( ) { } public int titlePosition ( ) { } public NSRect titleRect ( ) { } }

Fix:
OS . objc_msgSend_stret ( result , this . id , sel_contentViewMargins ) ;
Buggy code:
public class LineSegment implements Comparable < LineSegment > { private Vertex endPointA ; private Vertex endPointB ; private double slope ; private double offset ; private static Random random = new Random ( ) ; public LineSegment ( Vertex a , Vertex b ) { } public double getM ( ) { } public double getC ( ) { } public double calculateY ( double x ) { } public double calculateX ( double y ) { <START_BUG> return ( y - ( c ) ) // ( m ) ; <END_BUG> } public Vertex getA ( ) { } public Vertex getB ( ) { } public void setPointA ( Vertex a ) { } public void setPointB ( Vertex b ) { } public double getLength ( ) { } public String toString ( ) { } public int compareSLHeight ( LineSegment seg2 , double x ) { } @ Override public int compareTo ( LineSegment o ) { } }

Fix:
return ( y - ( offset ) ) // ( slope ) ;
Buggy code:
public class AllPackageTests { public static Test suite ( ) { TestSuite suite = new TestSuite ( "Test<seq2seq4repair_space>for<seq2seq4repair_space>org.eclipse.xtend.shared.ui.test.xpand2.core" ) ; suite . addTestSuite ( Bug155018Test . class ) ; suite . addTestSuite ( JdtJavaBeanTest . class ) ; <START_BUG> suite . addTestSuite ( OawProjectTest . class ) ; <END_BUG> suite . addTestSuite ( SimpleProjectTest . class ) ; suite . addTestSuite ( ASTTest . class ) ; return suite ; } }

Fix:
suite . addTestSuite ( XtendXpandProjectTest . class ) ;
Buggy code:
public class Versions { public static String getTaxonDNA ( ) { <START_BUG> return "1.7.9" ; <END_BUG> } }

Fix:
return "1.8" ;
Buggy code:
public class SCMConfigXmlWriterTest extends BaseConfigXmlWriterTest { @ Test public void shouldWriteSCMConfiguration ( ) throws Exception { } @ Test public void shouldWriteSCMConfigurationWhenNoSCMIdIsProvided ( ) throws Exception { } @ Test public void shouldNotAllowMultipleSCMsWithSameId ( ) throws Exception { Configuration configuration = new Configuration ( getConfigurationProperty ( "url" , false , "http:////go" ) ) ; CruiseConfig configToSave = new CruiseConfig ( ) ; SCM scm1 = createSCM ( "id" , "name1" , "plugin-id-1" , "1.0" , configuration ) ; SCM scm2 = createSCM ( "id" , "name2" , "plugin-id-2" , "1.0" , configuration ) ; configToSave . setSCMs ( new com . thoughtworks . go . domain . scm . SCMs ( scm1 , scm2 ) ) ; try { xmlWriter . write ( configToSave , output , false ) ; fail ( "should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>allowed<seq2seq4repair_space>two<seq2seq4repair_space>SCMs<seq2seq4repair_space>with<seq2seq4repair_space>same<seq2seq4repair_space>id" ) ; } catch ( XsdValidationException e ) { <START_BUG> assertThat ( e . getMessage ( ) , is ( "Duplicate<seq2seq4repair_space>unique<seq2seq4repair_space>value<seq2seq4repair_space>[id]<seq2seq4repair_space>declared<seq2seq4repair_space>for<seq2seq4repair_space>identity<seq2seq4repair_space>constraint<seq2seq4repair_space>\"uniqueSCMId\"<seq2seq4repair_space>of<seq2seq4repair_space>element<seq2seq4repair_space>\"scms\"." ) ) ; <END_BUG> } } @ Test public void shouldNotAllowSCMWithInvalidId ( ) throws Exception { } @ Test public void shouldNotAllowMultipleSCMsWithSameName ( ) throws Exception { } @ Test public void shouldNotAllowSCMWithInvalidName ( ) throws Exception { } @ Test public void shouldAllowSCMTypeMaterialForPipeline ( ) throws Exception { } @ Test public void shouldAllowFolderAndFilterForPluggableSCMMaterialForPipeline ( ) throws Exception { } @ Test public void shouldFailValidationIfSCMTypeMaterialForPipelineHasARefToNonExistentSCM ( ) throws Exception { } @ Test public void shouldNotWriteToFileWithDefaultValueOfTrueForSCMAutoUpdateWhenTrue ( ) throws Exception { } @ Test public void shouldWriteToFileWithValueOfFalseForSCMAutoUpdateWhenFalse ( ) throws Exception { } private ConfigurationProperty getConfigurationProperty ( String key , boolean isSecure , String value ) { } private SCM createSCM ( String id , String name , String pluginId , String version , Configuration configuration ) { } }

Fix:
assertThat ( e . getMessage ( ) , is ( "Duplicate<seq2seq4repair_space>unique<seq2seq4repair_space>value<seq2seq4repair_space>[id]<seq2seq4repair_space>declared<seq2seq4repair_space>for<seq2seq4repair_space>identity<seq2seq4repair_space>constraint<seq2seq4repair_space>\"uniqueSCMId\"<seq2seq4repair_space>of<seq2seq4repair_space>element<seq2seq4repair_space>\"cruise\"." ) ) ;
Buggy code:
public class ClassLiteralAccess extends Expression { public TypeReference type ; public TypeBinding targetType ; FieldBinding syntheticField ; public ClassLiteralAccess ( int sourceEnd , TypeReference t ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; <START_BUG> if ( ( targetType = type . resolveType ( scope ) ) == null ) <END_BUG> return null ; if ( ( targetType . isArrayType ( ) ) && ( ( ( ( ArrayBinding ) ( targetType ) ) . leafComponentType ) == ( VoidBinding ) ) ) { scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; return null ; } else if ( targetType . isTypeVariable ( ) ) { scope . problemReporter ( ) . illegalClassLiteralForTypeVariable ( ( ( TypeVariableBinding ) ( targetType ) ) , this ) ; } ReferenceBinding classType = scope . getJavaLangClass ( ) ; if ( classType . isGenericType ( ) ) { this . resolvedType = scope . createParameterizedType ( classType , new TypeBinding [ ] { scope . boxing ( targetType ) } , null ) ; } else { this . resolvedType = classType ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( targetType = type . resolveType ( scope , true ) ) == null )
Buggy code:
public abstract class AbstractXMLDataSourceRuntimeHandler < T > extends AbstractRuntimeOnlyHandler { protected static final String CONNECTION_PROPERTIES = "connection-properties" ; protected static final String XA_DATASOURCE_PROPERTIES = "xa-datasource-properties" ; protected static final String DATA_SOURCE = "data-source" ; protected static final String XA_DATA_SOURCE = "xa-data-source" ; private final Map < PathAddress , T > dataSourceConfigs = Collections . synchronizedMap ( new HashMap < PathAddress , T > ( ) ) ; @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { String opName = operation . require ( OP ) . asString ( ) ; PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final T dataSource = getDataSourceConfig ( address ) ; if ( READ_ATTRIBUTE_OPERATION . equals ( opName ) ) { final String attributeName = operation . require ( NAME ) . asString ( ) ; executeReadAttribute ( attributeName , context , dataSource , address ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } else { throw AbstractXMLDataSourceRuntimeHandler . unknownOperation ( opName ) ; } } public void registerDataSource ( final PathAddress address , final T dataSource ) { } public void unregisterDataSource ( final PathAddress address ) { } protected abstract void executeReadAttribute ( final String attributeName , final OperationContext context , final T dataSource , final PathAddress address ) { } private static IllegalStateException unknownOperation ( String opName ) { } private T getDataSourceConfig ( final PathAddress operationAddress ) throws OperationFailedException { } protected void setLongIfNotNull ( final OperationContext context , final Long value ) { } protected void setIntIfNotNull ( final OperationContext context , final Integer value ) { } protected void setBooleanIfNotNull ( final OperationContext context , final Boolean value ) { } protected void setStringIfNotNull ( final OperationContext context , final String value ) { } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class IncrementalImageBuilder extends AbstractImageBuilder { protected ArrayList locations ; protected ArrayList previousLocations ; protected ArrayList typeNames ; protected ArrayList qualifiedStrings ; protected ArrayList simpleStrings ; protected ArrayList secondaryTypesToRemove ; public static int MaxCompileLoop = 5 ; protected IncrementalImageBuilder ( JavaBuilder javaBuilder ) { } public boolean build ( SimpleLookupTable deltas ) { } protected void addAffectedSourceFiles ( ) { } protected void addDependentsOf ( IPath path , boolean hasStructuralChanges ) { } protected void cleanUp ( ) { } protected boolean findAffectedSourceFiles ( IResourceDelta delta , IResource [ ] binaryResources ) { } protected void findAffectedSourceFiles ( IResourceDelta binaryDelta , int segmentCount ) { } protected boolean findSourceFiles ( IResourceDelta delta ) throws CoreException { } protected void findSourceFiles ( IResourceDelta sourceDelta , int segmentCount ) throws CoreException { } protected void finishedWith ( String sourceLocation , CompilationResult result , char [ ] mainTypeName , ArrayList definedTypeNames , ArrayList duplicateTypeNames ) throws CoreException { } protected void removeClassFile ( IPath typePath ) throws CoreException { } protected void removeSecondaryTypes ( ) throws CoreException { } protected void resetCollections ( ) { } protected void updateProblemsFor ( String sourceLocation , CompilationResult result ) throws CoreException { } protected boolean writeClassFileCheck ( IFile file , String fileName , byte [ ] newBytes , boolean isSecondaryType ) throws CoreException { if ( file . exists ( ) ) { try { byte [ ] oldBytes = Util . getResourceContentsAsByteArray ( file ) ; notEqual : if ( ( newBytes . length ) == ( oldBytes . length ) ) { for ( int i = newBytes . length ; ( -- i ) >= 0 ; ) if ( ( newBytes [ i ] ) != ( oldBytes [ i ] ) ) break notEqual ; return false ; } ClassFileReader reader = new ClassFileReader ( oldBytes , file . getLocation ( ) . toString ( ) . toCharArray ( ) ) ; <START_BUG> if ( ( ! ( reader . isLocal ( ) ) ) && ( reader . hasStructuralChanges ( newBytes ) ) ) { <END_BUG> if ( JavaBuilder . DEBUG ) System . out . println ( ( "Type<seq2seq4repair_space>has<seq2seq4repair_space>structural<seq2seq4repair_space>changes<seq2seq4repair_space>" + fileName ) ) ; addDependentsOf ( new Path ( fileName ) , true ) ; } } catch ( ClassFormatException e ) { addDependentsOf ( new Path ( fileName ) , true ) ; } file . delete ( IResource . FORCE , null ) ; } else if ( isSecondaryType ) { addDependentsOf ( new Path ( fileName ) , true ) ; } return true ; } public String toString ( ) { } }

Fix:
if ( ( ! ( ( reader . isLocal ( ) ) || ( reader . isAnonymous ( ) ) ) ) && ( reader . hasStructuralChanges ( newBytes ) ) ) {
Buggy code:
public class BookBlockArrayAdapter extends ArrayAdapter < InBookBlockPVM > { public static final int layoutResourceId = layout . row_book_block ; private Context context ; private Base data ; public BookBlockArrayAdapter ( Context context , BookBlockPLVM data ) { } public BookBlockArrayAdapter ( Context context , UserOrderPLVM data ) { } @ Override public View getView ( int position , View bookBlockView , ViewGroup parent ) { data . actualPosition = position ; InBookBlockPVM vm = data . products . get ( position ) ; if ( bookBlockView == null ) { LayoutInflater inflater = LayoutInflater . from ( context ) ; bookBlockView = inflater . inflate ( BookBlockArrayAdapter . layoutResourceId , parent , false ) ; bookBlockView . setTag ( new BookBlock . ViewHolder ( bookBlockView ) ) ; } BookBlock . ViewHolder vh = ( ( BookBlock . ViewHolder ) ( bookBlockView . getTag ( ) ) ) ; <START_BUG> BookBlock bookBlock = new BookBlock ( vm , bookBlockView , context , data ) ; <END_BUG> bookBlock . fill ( ) ; bookBlock . setupContextMenu ( ) ; return bookBlockView ; } }

Fix:
BookBlock bookBlock = new BookBlock ( vm , vh , bookBlockView , context , data ) ;
Buggy code:
public class BcweaverJarMaker { private static String cp = ( "..//lib//test//aspectjrt.jar;..//lib//test//testing-client.jar" + ( File . pathSeparator ) ) + ( System . getProperty ( "aspectjrt.path" ) ) ; public BcweaverJarMaker ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void makeJar0 ( ) throws IOException { } public static void makeJar1 ( ) throws IOException { } public static void makeJarObviousNothing ( ) throws IOException { } public static void makeJarHardNothing ( ) throws IOException { } public static void makeJar1a ( ) throws IOException { List args = new ArrayList ( ) ; args . add ( "-outjar" ) ; args . add ( "..//weaver//testdata//megatraceNoweave.jar" ) ; <START_BUG> args . add ( "-noweave" ) ; <END_BUG> args . add ( "-classpath" ) ; args . add ( AjcTests . aspectjrtClasspath ( ) ) ; args . add ( ( ( AjdtAjcTests . TESTDATA_PATH ) + "//src1//trace//MegaTrace.java" ) ) ; args . add ( ( ( AjdtAjcTests . TESTDATA_PATH ) + "//src1//trace//ExecTrace.java" ) ) ; CommandTestCase . runCompiler ( args , NO_ERRORS ) ; } public static void makeJar2 ( ) throws IOException { } public static void makeTestJars ( ) throws IOException { } public static void makeURLWeavingClassLoaderJars ( ) throws IOException { } private static void buildJarWithClasspath ( String outjar , String input , String deps , boolean nodebug ) { } private static void buildShowWeaveInfoTestingJars ( ) { } public static void makeDuplicateManifestTestJars ( ) throws IOException { } public static void makeAspectPathTestJars ( ) throws IOException { } public static void makeAjc11TestJars ( ) throws IOException { } public static void makeOutjarTestJars ( ) throws IOException { } }

Fix:
args . add ( "-XterminateAfterCompilation" ) ;
Buggy code:
public class ConcurrentCacheTest extends AbstractNativeCacheTest < ConcurrentMap < Object , Object > > { @ Override protected Cache createCache ( ConcurrentMap < Object , Object > nativeCache ) { <START_BUG> return new ConcurrentCache ( nativeCache , CACHE_NAME ) ; <END_BUG> } @ Override protected ConcurrentMap < Object , Object > createNativeCache ( ) throws Exception { } }

Fix:
return new ConcurrentMapCache ( nativeCache , CACHE_NAME , true ) ;
Buggy code:
public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor { public static final String PARTICIPATE_SUFFIX = ".PARTICIPATE" ; protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private SessionFactory sessionFactory ; public void setSessionFactory ( SessionFactory sessionFactory ) { } public SessionFactory getSessionFactory ( ) { } public void preHandle ( WebRequest request ) throws DataAccessException { } public void postHandle ( WebRequest request , ModelMap model ) { } public void afterCompletion ( WebRequest request , Exception ex ) throws DataAccessException { } private boolean decrementParticipateCount ( WebRequest request ) { } public void afterConcurrentHandlingStarted ( WebRequest request ) { } protected Session openSession ( ) throws DataAccessResourceFailureException { try { <START_BUG> Session session = SessionFactoryUtils . openSession ( getSessionFactory ( ) ) ; <END_BUG> session . setFlushMode ( MANUAL ) ; return session ; } catch ( HibernateException ex ) { throw new DataAccessResourceFailureException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>open<seq2seq4repair_space>Hibernate<seq2seq4repair_space>Session" , ex ) ; } } protected String getParticipateAttributeName ( ) { } private boolean applySessionBindingInterceptor ( WebAsyncManager asyncManager , String key ) { } private class SessionBindingCallableInterceptor extends CallableProcessingInterceptorAdapter { private final SessionHolder sessionHolder ; public SessionBindingCallableInterceptor ( SessionHolder sessionHolder ) { } @ Override public < T > void preProcess ( NativeWebRequest request , Callable < T > task ) { } @ Override public < T > void postProcess ( NativeWebRequest request , Callable < T > task , Object concurrentResult ) { } private void initializeThread ( ) { } } }

Fix:
Session session = getSessionFactory ( ) . openSession ( ) ;
Buggy code:
@ GraphAnalyticTool ( name = "MergeGroups" , description = "Merge<seq2seq4repair_space>groups<seq2seq4repair_space>for<seq2seq4repair_space>find<seq2seq4repair_space>minimal<seq2seq4repair_space>satisfied<seq2seq4repair_space>groups" ) public class MergeGroups implements GenericGraphTool { protected static final Pattern SEPERATOR = Pattern . compile ( "[\t<seq2seq4repair_space>]" ) ; HashMap < Integer , Group > rawGroups ; HashMap < String , Group > refinedGroups ; ArrayList < Integer > flags ; private double threshold ; private boolean isPrune ; @ Override public void run ( CommandLine cmd ) { } public void mergeFinalGroup ( HashMap < Integer , Group > globalGroups , String savePath ) { for ( int gid : rawGroups . keySet ( ) ) { Group rawGroup = rawGroups . get ( gid ) ; boolean isChanged = false ; do { Set < Integer > maxInterSet = null ; for ( int memberId : rawGroup . getMemberList ( ) ) { Group memberGroup = globalGroups . get ( memberId ) ; if ( memberGroup == null ) continue ; <START_BUG> Set < Integer > inter = rawGroup . intersection ( globalGroups . get ( gid ) ) ; <END_BUG> if ( ( maxInterSet == null ) || ( ( maxInterSet . size ( ) ) < ( inter . size ( ) ) ) ) { maxInterSet = inter ; } } if ( ( maxInterSet != null ) && ( ( maxInterSet . size ( ) ) > 2 ) ) { isChanged = true ; for ( int did : maxInterSet ) { rawGroup . deleteMember ( did ) ; } } } while ( isChanged ) ; } System . out . println ( "Saving<seq2seq4repair_space>results......" ) ; try { FileOutputStream fout = new FileOutputStream ( savePath ) ; BufferedWriter fwr = new BufferedWriter ( new OutputStreamWriter ( fout ) ) ; for ( int gid : rawGroups . keySet ( ) ) { Group gg = rawGroups . get ( gid ) ; fwr . write ( ( ( ( gg . getGroupId ( ) ) + ":<seq2seq4repair_space>" ) + ( gg . toString ( ) ) ) ) ; } fwr . flush ( ) ; fwr . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public void mergeGlobalGroup ( String savePath ) { } public void doMergeGroup ( Group group , HashSet < Group > gSet ) { } @ Override public boolean verifyParameters ( CommandLine cmd ) { } boolean isOutputId ( int vid ) { } public void doCompute ( String savePath ) { } public Group refineGroup ( int gid ) { } public void dfs ( int vid , Group curClique , Group res , int depth ) { } public boolean checkConnectivity ( int vid , Group curClique ) { } public void updateRawGroups ( Group newGroup ) { } public void saveResults ( String savePath ) { } public void loadRawGroupFile ( String filePath ) { } public void loadGlobalGroupFile ( HashMap < Integer , Group > globalGroups , String filePath ) { } }

Fix:
Set < Integer > inter = rawGroup . intersection ( memberGroup ) ;
Buggy code:
public class Robot extends IterativeRobot { final int GRABBER = 1 ; final int LIFTERUP = 5 ; final int LIFTERDOWN = 6 ; final int TURNRIGHT = 3 ; final int TURNLEFT = 4 ; final int RESET = 7 ; final int LIGHTS = 8 ; RobotDrive myRobot ; Joystick stick ; Joystick rightStick ; CANTalon motor1 = new CANTalon ( 1 ) ; CANTalon motor2 = new CANTalon ( 0 ) ; CANTalon motor3 = new CANTalon ( 2 ) ; int autoLoopCounter ; Compressor compressor1 = new Compressor ( ) ; public void robotInit ( ) { myRobot = new RobotDrive ( 0 , 1 ) ; compressor1 . stop ( ) ; stick = new Joystick ( 1 ) ; <START_BUG> stick1 = new Joystick ( 2 ) ; <END_BUG> } public void autonomousInit ( ) { } public void autonomousPeriodic ( ) { } public void teleopInit ( ) { } public void teleopPeriodic ( ) { } public void testPeriodic ( ) { } }

Fix:
rightStick = new Joystick ( 2 ) ;
Buggy code:
public class DateFormatterTests { private DateFormatter formatter = new DateFormatter ( "yyyy-MM-dd" ) ; @ Test public void formatValue ( ) { Calendar cal = Calendar . getInstance ( Locale . US ) ; cal . clear ( ) ; cal . set ( Calendar . YEAR , 2009 ) ; cal . set ( Calendar . MONTH , Calendar . JUNE ) ; cal . set ( Calendar . DAY_OF_MONTH , 1 ) ; <START_BUG> assertEquals ( "2009-06-01" , formatter . format ( cal . getTime ( ) , Locale . US ) ) ; <END_BUG> } @ Test public void parseValue ( ) throws ParseException { } }

Fix:
assertEquals ( "2009-06-01" , formatter . print ( cal . getTime ( ) , Locale . US ) ) ;