nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Cab extends MatchingTask { private Vector filesets = new Vector ( ) ; private boolean doCompress = true ; private boolean doVerbose = false ; protected String archiveType = "cab" ; private FileUtils fileUtils = FileUtils . newFileUtils ( ) ; private File baseDir ; private File cabFile ; private String cmdOptions ; public void setBasedir ( File baseDir ) { } public void setCabfile ( File cabFile ) { } public void setCompress ( boolean compress ) { } public void setOptions ( String options ) { } public void setVerbose ( boolean verbose ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws TaskException { checkConfiguration ( ) ; Vector files = getFileList ( ) ; if ( isUpToDate ( files ) ) return ; <START_BUG> log ( ( ( ( "Building<seq2seq4repair_space>" + ( archiveType ) ) + ":<seq2seq4repair_space>" ) + ( cabFile . getAbsolutePath ( ) ) ) ) ; <END_BUG> if ( ! ( Os . isFamily ( "windows" ) ) ) { log ( "Using<seq2seq4repair_space>listcab//libcabinet" , MSG_VERBOSE ) ; StringBuffer sb = new StringBuffer ( ) ; Enumeration fileEnum = files . elements ( ) ; while ( fileEnum . hasMoreElements ( ) ) { sb . append ( fileEnum . nextElement ( ) ) . append ( "\n" ) ; } sb . append ( "\n" ) . append ( cabFile . getAbsolutePath ( ) ) . append ( "\n" ) ; try { Process p = Runtime . getRuntime ( ) . exec ( "listcab" ) ; OutputStream out = p . getOutputStream ( ) ; out . write ( sb . toString ( ) . getBytes ( ) ) ; out . flush ( ) ; out . close ( ) ; } catch ( IOException ex ) { String msg = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( cabFile ) ) + "<seq2seq4repair_space>" ) + ( ex . getMessage ( ) ) ; throw new TaskException ( msg ) ; } } else { try { File listFile = createListFile ( files ) ; ExecTask exec = createExec ( ) ; File outFile = null ; exec . setFailonerror ( true ) ; exec . setDir ( baseDir ) ; if ( ! ( doVerbose ) ) { outFile = fileUtils . createTempFile ( "ant" , "" , null ) ; exec . setOutput ( outFile ) ; } setupCommand ( listFile , exec ) ; exec . execute ( ) ; if ( outFile != null ) { outFile . delete ( ) ; } listFile . delete ( ) ; } catch ( IOException ioe ) { String msg = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( cabFile ) ) + "<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new TaskException ( msg ) ; } } } protected Vector getFileList ( ) throws TaskException { } protected boolean isUpToDate ( Vector files ) { } protected void appendFiles ( Vector files , DirectoryScanner ds ) { } protected void checkConfiguration ( ) throws TaskException { } protected void setupCommand ( File listFile , ExecTask exec ) throws TaskException { } protected ExecTask createExec ( ) throws TaskException { } protected File createListFile ( Vector files ) throws IOException { } }

Fix:
getLogger ( ) . info ( ( ( ( "Building<seq2seq4repair_space>" + ( archiveType ) ) + ":<seq2seq4repair_space>" ) + ( cabFile . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class EmoticonPanel extends JPanel implements ActionListener { private final int width = 40 ; private final int height = 24 ; private final int iconWidth = 20 ; private final int iconHeight = 20 ; public JButton [ ] emoticons ; public String [ ] strings ; public BufferedImage [ ] images ; public RolloverIcon [ ] rolloverIcons ; private final JPanel panel ; private static JTextField msgTF ; private static SendPanel sendPanel ; private final JButton leftButton ; private final JButton rightButton ; private final Font defaultFont ; public EmoticonPanel ( final ImageLoader imageLoader , final JTextField msgTF , final Font defaultFont , final SendPanel sendPanel ) { } private void insert ( int position , Object button , boolean space ) { String pre = "" ; if ( space ) { pre = "<seq2seq4repair_space>" ; } try { <START_BUG> EmoticonPanel . msgTF . getDocument ( ) . insertString ( position , ( pre + ( strings [ ( ( ( Arrays . asList ( emoticons ) . indexOf ( button ) ) * 2 ) + 1 ) ] ) ) , null ) ; <END_BUG> } catch ( BadLocationException | ArrayIndexOutOfBoundsException ex ) { Logger . getLogger ( EmoticonPanel . class . getName ( ) ) . log ( Level . SEVERE , "" , ex ) ; } } @ Override public void actionPerformed ( ActionEvent e ) { } private boolean shouldPanelBeUndecorated ( ) { } @ Override protected void paintComponent ( Graphics g ) { } }

Fix:
EmoticonPanel . msgTF . getDocument ( ) . insertString ( position , ( pre + ( strings [ Arrays . asList ( emoticons ) . indexOf ( button ) ] ) ) , null ) ;
Buggy code:
public class MessageId { private Map < Long , Long > _anchorsToIds ; public static long generateId ( ) { } public static MessageId makeUnanchored ( ) { } public static MessageId makeId ( Map < Long , Long > anchorsToIds ) { } public static MessageId makeRootId ( long id ) { } protected MessageId ( Map < Long , Long > anchorsToIds ) { } public Map < Long , Long > getAnchorsToIds ( ) { } public Set < Long > getAnchors ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object other ) { if ( other instanceof MessageId ) { <START_BUG> return ( _anchorsToIds ) == ( ( ( MessageId ) ( other ) ) . _anchorsToIds ) ; <END_BUG> } else { return false ; } } @ Override public String toString ( ) { } public void serialize ( DataOutputStream out ) throws IOException { } public static MessageId deserialize ( DataInputStream in ) throws IOException { } }

Fix:
return _anchorsToIds . equals ( ( ( MessageId ) ( other ) ) . _anchorsToIds ) ;
Buggy code:
public class StandardConfigsXMLParsingMarshallingUnitTestCase extends TestCase { private String modulePath = null ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testHost ( ) throws Exception { } public void testDomain ( ) throws Exception { } public void testStandalone ( ) throws Exception { } private DomainModel parseDomain ( final Reader reader ) throws ModuleLoadException { } private HostModel parseHost ( final Reader reader ) throws ModuleLoadException { } private ServerModel parseServer ( final Reader reader ) throws ModuleLoadException { final XMLMapper mapper = Factory . create ( ) ; registerStandardServerReaders ( mapper ) ; try { final List < AbstractServerModelUpdate < ? > > serverUpdates = new ArrayList < AbstractServerModelUpdate < ? > > ( ) ; mapper . parseDocument ( serverUpdates , XMLInputFactory . newInstance ( ) . createXMLStreamReader ( new BufferedReader ( reader ) ) ) ; final ServerModel serverModel = new ServerModel ( ) ; for ( final AbstractServerModelUpdate < ? > update : serverUpdates ) { serverModel . update ( update ) ; } return serverModel ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { <START_BUG> throw new RuntimeException ( "Caught<seq2seq4repair_space>exception<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>of<seq2seq4repair_space>host.xml" , e ) ; <END_BUG> } } private String writeModel ( final Element element , final XMLContentWriter content ) throws FactoryConfigurationError , XMLStreamException { } private synchronized void registerStandardDomainReaders ( XMLMapper mapper ) throws ModuleLoadException { } private synchronized void registerStandardHostReaders ( XMLMapper mapper ) throws ModuleLoadException { } private synchronized void registerStandardServerReaders ( XMLMapper mapper ) throws ModuleLoadException { } private URL getXmlUrl ( String xmlName ) throws MalformedURLException { } private Reader getReader ( URL url ) throws IOException { } private class RootElementWriter implements XMLContentWriter { private final Element element ; private final XMLContentWriter content ; RootElementWriter ( final Element element , final XMLContentWriter content ) { } @ Override public void writeContent ( XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { } } protected static String getASHome ( ) { } }

Fix:
throw new RuntimeException ( "Caught<seq2seq4repair_space>exception<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>of<seq2seq4repair_space>standalone.xml" , e ) ;
Buggy code:
public class GameLobby { public static HashMap < Integer , Game > gameCollection = new HashMap < > ( ) ; public static HashMap < Integer , Player > playerCollection = new HashMap < > ( ) ; public static DB db = new DB ( ) ; public static Game createGame ( int uid ) { } public static void joinGame ( int uid , int gid ) { } public static String returnGames ( ) { String message = "G" ; int numOfPlayers ; int gid ; for ( Map . Entry < Integer , Game > entry : GameLobby . gameCollection . entrySet ( ) ) { numOfPlayers = entry . getValue ( ) . playerNum ( ) ; gid = entry . getKey ( ) ; if ( numOfPlayers > 0 ) { <START_BUG> message = ( ( ( message + ( Integer . toString ( gid ) ) ) + "`" ) + ( Integer . toString ( numOfPlayers ) ) ) + "`" ; <END_BUG> } else { GameLobby . gameCollection . remove ( gid ) ; } } return message ; } public static String returnPlayers ( ) { } public static Game findGame ( int gid ) { } public static Player findPlayer ( int uid ) { } public static void delPlayer ( int uid ) { } public static int enterLobby ( String Username , String Password , boolean newUser ) throws Exception { } }

Fix:
message = ( ( ( ( ( message + ( Integer . toString ( gid ) ) ) + "`" ) + ( entry . getValue ( ) . name ) ) + "`" ) + ( Integer . toString ( numOfPlayers ) ) ) + "`" ;
Buggy code:
public final class FinishButton extends WizardButton { private static final long serialVersionUID = 1L ; public FinishButton ( String id , Wizard wizard ) { } public final boolean isEnabled ( ) { } public final void onClick ( ) { IWizardModel wizardModel = getWizardModel ( ) ; IWizardStep step = wizardModel . getActiveStep ( ) ; step . applyState ( ) ; if ( step . isComplete ( ) ) { <START_BUG> getWizard ( ) . onFinish ( ) ; <END_BUG> } else { error ( getLocalizer ( ) . getString ( "wicket.extensions.wizard.FinishButton.step.did.not.complete" , this ) ) ; } } }

Fix:
getWizardModel ( ) . finish ( ) ;
Buggy code:
public class Radio extends WebMarkupContainer { private static final String ATTR_DISABLED = "disabled" ; private static final long serialVersionUID = 1L ; public Radio ( String id ) { } public Radio ( String id , IModel model ) { } protected void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "radio" ) ; RadioGroup group = ( ( RadioGroup ) ( findParent ( RadioGroup . class ) ) ) ; String path = getPath ( ) ; if ( group == null ) { throw new WicketRuntimeException ( ( ( "Radio<seq2seq4repair_space>component<seq2seq4repair_space>[" + path ) + "]<seq2seq4repair_space>cannot<seq2seq4repair_space>find<seq2seq4repair_space>its<seq2seq4repair_space>parent<seq2seq4repair_space>RadioGroup.<seq2seq4repair_space>All<seq2seq4repair_space>Radio<seq2seq4repair_space>components<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>child<seq2seq4repair_space>of<seq2seq4repair_space>or<seq2seq4repair_space>below<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>hierarchy<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>RadioGroup<seq2seq4repair_space>component." ) ) ; } String relativePath = path . substring ( ( ( group . getPath ( ) . length ( ) ) + 1 ) ) ; tag . put ( "name" , group . getInputName ( ) ) ; tag . put ( "value" , relativePath ) ; if ( group . hasRawInput ( ) ) { String rawInput = group . getRawInput ( ) ; if ( ( rawInput != null ) && ( rawInput . equals ( relativePath ) ) ) { tag . put ( "checked" , "checked" ) ; } } else if ( Objects . equal ( group . getModelObject ( ) , getModelObject ( ) ) ) { tag . put ( "checked" , "checked" ) ; } if ( group . wantOnSelectionChangedNotifications ( ) ) { final CharSequence url = group . urlFor ( INTERFACE ) ; Form form = ( ( Form ) ( group . findParent ( Form . class ) ) ) ; if ( form != null ) { tag . put ( "onclick" , form . getJsForInterfaceUrl ( url ) ) ; } else { tag . put ( "onclick" , ( ( ( ( "location.href='" + url ) + "&" ) + ( group . getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.value;" ) ) ; } } <START_BUG> if ( ( ! ( isActionAuthorized ( ENABLE ) ) ) || ( ! ( isEnabled ( ) ) ) ) { <END_BUG> tag . put ( Radio . ATTR_DISABLED , Radio . ATTR_DISABLED ) ; } } }

Fix:
if ( ( ( ! ( isActionAuthorized ( ENABLE ) ) ) || ( ! ( isEnabled ( ) ) ) ) || ( ! ( group . isEnabled ( ) ) ) ) {
Buggy code:
public class ParserUtils { private static final EnumSet < LeolaTokenType > PARAM_OPS = EnumSet . of ( COMMA , VAR_ARGS , IDENTIFIER ) ; public static Expr [ ] parseActualParameters ( StmtParser parser , Token currentToken , EnumSet < LeolaTokenType > commaDelimeter , LeolaTokenType endToken ) throws Exception { } public static List < Pair < Expr , Expr > > parseMapParameters ( StmtParser parser , Token currentToken , EnumSet < LeolaTokenType > commaDelimeter , LeolaTokenType endToken ) throws Exception { <START_BUG> ExprParser expressionParser = new ExprParser ( parser ) ; <END_BUG> Token token = parser . nextToken ( ) ; List < Pair < Expr , Expr > > paramsNode = new ArrayList < Pair < Expr , Expr > > ( ) ; while ( ( token . getType ( ) ) != endToken ) { Pair < Expr , Expr > element = new Pair < Expr , Expr > ( ) ; ASTNode key = expressionParser . parse ( token ) ; element . setFirst ( ( ( Expr ) ( key ) ) ) ; token = expressionParser . currentToken ( ) ; if ( ( token . getType ( ) ) != ( LeolaTokenType . ARROW ) ) { parser . getExceptionHandler ( ) . errorToken ( token , parser , MISSING_ARROW ) ; } else { token = expressionParser . nextToken ( ) ; } ASTNode value = expressionParser . parse ( token ) ; element . setSecond ( ( ( Expr ) ( value ) ) ) ; paramsNode . add ( element ) ; token = parser . synchronize ( commaDelimeter ) ; LeolaTokenType tokenType = token . getType ( ) ; if ( tokenType == ( COMMA ) ) { token = parser . nextToken ( ) ; } else if ( EXPR_START_SET . contains ( tokenType ) ) { parser . getExceptionHandler ( ) . errorToken ( token , parser , MISSING_COMMA ) ; } else if ( tokenType != endToken ) { token = parser . synchronize ( EXPR_START_SET ) ; } } token = parser . nextToken ( ) ; return paramsNode ; } public static ParameterList parseParameterListings ( Parser parser , Token next ) throws Exception { } public static String parseClassName ( Parser parser , Token token , LeolaTokenType ... endTokenTypes ) throws Exception { } public static String parseClassName ( Parser parser , Token token ) throws Exception { } }

Fix:
ExprParser expressionParser = new ExprParser ( parser , true ) ;
Buggy code:
public class Game { public static void main ( String [ ] args ) { Possible_List list = new Possible_List ( ) ; list . addActionToList ( MoveForward . move_forward ( ) ) ; list . addActionToList ( Jump . jump ( ) ) ; list . addActionToList ( TurnRIght . turn_right ( ) ) ; Terrain terrain_test = new Terrain ( 7 , 6 ) ; abstr_Case initRob ; for ( int i = 0 ; i < 7 ; i ++ ) { for ( int j = 0 ; j < 6 ; j ++ ) { Coordonnees cord = new Coordonnees ( i , j , 0 ) ; Normal_Case carre = new Normal_Case ( 0 , cord ) ; terrain_test . add_case ( i , j , carre ) ; } } try { initRob = terrain_test . get_case ( 3 , 3 ) ; Robot robert = new Robot ( initRob , list ) ; Robot [ ] robotlist = new Robot [ 1 ] ; Terrain [ ] terrainlist = new Terrain [ 1 ] ; robotlist [ 0 ] = robert ; terrainlist [ 0 ] = terrain_test ; currentWorld . set_liste_terrain ( terrainlist ) ; currentWorld . set_liste_robot ( robotlist ) ; <START_BUG> World . currentWorld . currentWorld . basic_print_world ( ) ; <END_BUG> try { robert . add_Action_User_Actions ( MoveForward . move_forward ( ) ) ; robert . add_Action_User_Actions ( TurnRIght . turn_right ( ) ) ; robert . add_Action_User_Actions ( MoveForward . move_forward ( ) ) ; System . out . println ( "Position<seq2seq4repair_space>initiale<seq2seq4repair_space>:<seq2seq4repair_space>" ) ; robert . printPosition ( ) ; Robot [ ] roblist = new Robot [ 1 ] ; roblist [ 0 ] = robert ; Terrain [ ] terrlist = new Terrain [ 1 ] ; terrlist [ 0 ] = terrain_test ; currentWorld . set_liste_robot ( roblist ) ; currentWorld . set_liste_terrain ( terrlist ) ; try { robert . run ( ) ; System . out . println ( "Position<seq2seq4repair_space>finale<seq2seq4repair_space>:<seq2seq4repair_space>" ) ; robert . printPosition ( ) ; } catch ( MouvementEx e ) { System . out . println ( e . getMessage ( ) ) ; } } catch ( ActionEx ex ) { System . out . println ( ex . getMessage ( ) ) ; } } catch ( UnreachableCase e1 ) { System . out . println ( e1 . getMessage ( ) ) ; } EventQueue . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { try { Menu2 frame = new Menu2 ( ) ; frame . setLocationRelativeTo ( null ) ; frame . setVisible ( true ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } ) ; } }

Fix:
currentWorld . basic_print_world ( ) ;
Buggy code:
@ Deprecated public final class FrenchStemFilter extends TokenFilter { private FrenchStemmer stemmer = new FrenchStemmer ( ) ; private Set < ? > exclusions = null ; private final CharTermAttribute termAtt = addAttribute ( CharTermAttribute . class ) ; private final KeywordAttribute keywordAttr = addAttribute ( KeywordAttribute . class ) ; public FrenchStemFilter ( TokenStream in ) { } @ Deprecated public FrenchStemFilter ( TokenStream in , Set < ? > exclusiontable ) { } @ Override public boolean incrementToken ( ) throws IOException { } public void setStemmer ( FrenchStemmer stemmer ) { } @ Deprecated public void setExclusionTable ( Map < ? , ? > exclusiontable ) { <START_BUG> exclusions = new HashSet ( exclusiontable . keySet ( ) ) ; <END_BUG> } }

Fix:
exclusions = exclusiontable . keySet ( ) ;
Buggy code:
public abstract class AutoAssistBehavior extends AbstractAutoAssistBehavior { private static final long serialVersionUID = 1L ; private final IAutoAssistRenderer renderer ; public AutoAssistBehavior ( IAutoAssistRenderer renderer ) { } protected final void onRequest ( final String val , RequestCycle requestCycle ) { IRequestTarget target = new IRequestTarget ( ) { public void respond ( RequestCycle requestCycle ) { Response r = requestCycle . getResponse ( ) ; Iterator comps = getAssists ( val ) ; while ( comps . hasNext ( ) ) { final Object comp = comps . next ( ) ; renderer . render ( comp , r ) ; } } <START_BUG> public void cleanUp ( RequestCycle requestCycle ) { <END_BUG> } public Object getLock ( RequestCycle requestCycle ) { return requestCycle . getSession ( ) ; } } ; requestCycle . setRequestTarget ( target ) ; } protected abstract Iterator getAssists ( String input ) { } }

Fix:
public void detach ( RequestCycle requestCycle ) {
Buggy code:
public abstract class ThreadPoolMetricsHandler extends AbstractRuntimeOnlyHandler { private final List < AttributeDefinition > metrics ; private final ServiceName serviceNameBase ; protected ThreadPoolMetricsHandler ( List < AttributeDefinition > metrics , ServiceName serviceNameBase ) { } public void registerAttributes ( final ManagementResourceRegistration registration ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } protected abstract void setResult ( OperationContext context , String attributeName , Service < ? > service ) throws OperationFailedException { } protected ServiceController < ? > getService ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final String name = Util . getNameFromAddress ( operation . require ( OP_ADDR ) ) ; ServiceController < ? > controller = context . getServiceRegistry ( true ) . getService ( serviceNameBase . append ( name ) ) ; if ( controller == null ) { <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>executor<seq2seq4repair_space>service<seq2seq4repair_space>" + ( serviceNameBase . append ( name ) ) ) ) ) ; <END_BUG> } return controller ; } }

Fix:
throw MESSAGES . threadPoolServiceNotFoundForMetrics ( serviceNameBase . append ( name ) ) ;
Buggy code:
public interface DeploymentUnitProcessor { void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } <START_BUG> void undeploy ( DeploymentUnitContext context ) ; <END_BUG> }

Fix:
void undeploy ( DeploymentUnit context ) ;
Buggy code:
public class BindingRemoveHandler extends SocketBindingRemoveHandler { public static final BindingRemoveHandler INSTANCE = new BindingRemoveHandler ( ) ; private BindingRemoveHandler ( ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return ( context . getType ( ) ) == ( Type . SERVER ) ; <END_BUG> } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
return context . isNormalServer ( ) ;
Buggy code:
public class Fragment < T > extends WebMarkupContainer < T > { private static final long serialVersionUID = 1L ; private String markupId ; private MarkupContainer markupProvider ; public Fragment ( MarkupContainer parent , final String id , final String markupId ) { } public Fragment ( MarkupContainer parent , final String id , final String markupId , final IModel < T > model ) { } public Fragment ( MarkupContainer parent , final String id , final String markupId , final MarkupContainer markupProvider ) { } public Fragment ( MarkupContainer parent , final String id , final String markupId , final MarkupContainer markupProvider , final IModel < T > model ) { } public final String getFragmentMarkupId ( ) { } public final void setMarkupTagReferenceId ( final String markupId ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected MarkupStream chooseMarkupStream ( final MarkupStream markupStream ) { } private void renderFragment ( final MarkupStream providerMarkupStream , final ComponentTag openTag ) { int currentIndex = providerMarkupStream . getCurrentIndex ( ) ; <START_BUG> int index = providerMarkupStream . findComponentIndex ( null , markupId ) ; <END_BUG> if ( index == ( - 1 ) ) { throw new MarkupException ( ( ( ( "Markup<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>a<seq2seq4repair_space>fragment<seq2seq4repair_space>with<seq2seq4repair_space>id=" + ( markupId ) ) + ";<seq2seq4repair_space>Component:<seq2seq4repair_space>" ) + ( toString ( ) ) ) ) ; } providerMarkupStream . setCurrentIndex ( index ) ; try { ComponentTag fragmentOpenTag = providerMarkupStream . getTag ( ) ; providerMarkupStream . next ( ) ; super . onComponentTagBody ( providerMarkupStream , fragmentOpenTag ) ; } finally { providerMarkupStream . setCurrentIndex ( currentIndex ) ; } } public final MarkupContainer getMarkupProvider ( ) { } }

Fix:
int index = providerMarkupStream . findComponentIndex ( markupId ) ;
Buggy code:
@ RunWith ( JUnit4 . class ) public class NewRelicClientTest { @ Test ( expected = APIViolationException . class ) public void testInvalidEventType ( ) throws APIViolationException { NewRelicEvent event = new NewRelicEvent ( ) { @ Override public String getEventType ( ) { return "Bad.Event" ; } } ; NewRelicClient client = new NewRelicClient ( ) ; client . setInsertKey ( "test" ) ; <START_BUG> client . setAccountId ( 0 ) ; <END_BUG> try { client . submit ( event ) ; } catch ( IllegalStateException | NewRelicLoggingException | NullPointerException e ) { fail ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>any<seq2seq4repair_space>other<seq2seq4repair_space>exception<seq2seq4repair_space>than<seq2seq4repair_space>an<seq2seq4repair_space>APIViolationException." ) ; } } }

Fix:
client . setAccountId ( 1 ) ;
Buggy code:
@ SideOnly ( Side . CLIENT ) public class SoundHandler { private static final int MAX = 15 ; public static List < String > soundHistory = Lists . newArrayList ( ) ; @ SubscribeEvent public void soundPlay ( PlaySoundEvent17 event ) { if ( ( Minecraft . getMinecraft ( ) . thePlayer ) == null ) return ; if ( ( SoundHandler . soundHistory ) != null ) { if ( ( SoundHandler . soundHistory . size ( ) ) > ( SoundHandler . MAX ) ) SoundHandler . soundHistory . remove ( Iterables . get ( SoundHandler . soundHistory , 0 ) ) ; if ( ! ( SoundHandler . soundHistory . contains ( event . name ) ) ) SoundHandler . soundHistory . add ( event . name ) ; } EntityPlayer player = Minecraft . getMinecraft ( ) . thePlayer ; ISound sound = null ; for ( ItemStack itemStack : player . inventory . armorInventory ) { if ( ( itemStack != null ) && ( ( itemStack . getItem ( ) ) instanceof IItemSoundMuffler ) ) { ISound muffled = SoundHelper . getMuffledSound ( event . name , event . sound , event . category , itemStack ) ; if ( ( sound == null ) && ( muffled != null ) ) { sound = muffled ; } } } if ( Loader . isModLoaded ( "Baubles" ) ) { IInventory baublesInventory = BaublesApi . getBaubles ( player ) ; for ( int i = 0 ; i < ( baublesInventory . getSizeInventory ( ) ) ; i ++ ) { ItemStack itemStack = baublesInventory . getStackInSlot ( i ) ; if ( ( itemStack != null ) && ( ( itemStack . getItem ( ) ) instanceof IItemSoundMuffler ) ) { ISound muffled = SoundHelper . getMuffledSound ( event . name , event . sound , event . category , itemStack ) ; if ( ( sound == null ) && ( muffled != null ) ) { sound = muffled ; } } } } for ( ITileSoundMuffler soundMuffler : InternalHandler . soundMufflerList ) { ISound muffled = SoundHelper . getMuffledSound ( event . name , event . sound , event . category , soundMuffler ) ; if ( muffled != null ) { if ( sound != null ) { if ( sound . getPositionedSoundLocation ( ) . equals ( muffled . getPositionedSoundLocation ( ) ) ) { if ( ( muffled . getVolume ( ) ) < ( sound . getVolume ( ) ) ) sound = muffled ; } } else { sound = muffled ; } } } <START_BUG> if ( sound != null ) { <END_BUG> player . worldObj . spawnParticle ( "note" , ( ( ( double ) ( sound . getXPosF ( ) ) ) + 0.5 ) , ( ( ( double ) ( sound . getYPosF ( ) ) ) + 1.2 ) , ( ( ( double ) ( sound . getZPosF ( ) ) ) + 0.5 ) , ( ( ( double ) ( new Random ( ) . nextInt ( 12 ) ) ) // 24.0 ) , 0.0 , 0.0 ) ; event . result = sound ; } } }

Fix:
if ( ( sound != null ) && ( ! ( sound instanceof SoundReplaced ) ) ) {
Buggy code:
public class GraphModificationListener { private UndoManager aUndoManager ; private Node [ ] aSelectionNodes ; private Rectangle2D [ ] aSelectionBounds ; private Object [ ] aPropertyValues ; public GraphModificationListener ( UndoManager pUndo ) { } public void nodeAdded ( GraphPanel pGraphPanel , Node pNode ) { } public void nodeRemoved ( GraphPanel pGraphPanel , Node pNode ) { } public void nodeMoved ( GraphPanel pGraphPanel , Node pNode , double pDX , double pDY ) { } public void childAttached ( GraphPanel pGraphPanel , int pIndex , Node pParent , Node pChild ) { } public void childDetached ( GraphPanel pGraphPanel , int pIndex , Node pParent , Node pChild ) { } public void startTrackingMove ( GraphPanel pGraphPanel , SelectionList pSelectedElements ) { } public void endTrackingMove ( GraphPanel pGraphPanel , SelectionList pSelectedElements ) { CompoundCommand cc = new CompoundCommand ( ) ; Rectangle2D [ ] selectionBounds2 = new Rectangle2D [ pSelectedElements . size ( ) ] ; int i = 0 ; for ( GraphElement e : pSelectedElements ) { if ( e instanceof Node ) { selectionBounds2 [ i ] = ( ( Node ) ( e ) ) . getBounds ( ) ; i ++ ; } } for ( i = 0 ; ( i < ( aSelectionNodes . length ) ) && ( ( aSelectionNodes [ i ] ) != null ) ; i ++ ) { double dY = ( selectionBounds2 [ i ] . getY ( ) ) - ( aSelectionBounds [ i ] . getY ( ) ) ; double dX = ( selectionBounds2 [ i ] . getX ( ) ) - ( aSelectionBounds [ i ] . getX ( ) ) ; <START_BUG> if ( ( dX > 0 ) || ( dY > 0 ) ) { <END_BUG> cc . add ( new ca . mcgill . cs . stg . jetuml . commands . MoveCommand ( pGraphPanel , aSelectionNodes [ i ] , dX , dY ) ) ; } } if ( ( cc . size ( ) ) > 0 ) { aUndoManager . add ( cc ) ; } } public void trackPropertyChange ( GraphPanel pGraphPanel , Object pEdited ) { } public void finishPropertyChange ( GraphPanel pGraphPanel , Object pEdited ) { } public void edgeAdded ( GraphPanel pGraphPanel , Edge pEdge ) { } public void edgeRemoved ( GraphPanel pGraphPanel , Edge pEdge ) { } private Object propertyClone ( Object pObject ) { } private boolean propertyEquals ( Object pObject1 , Object pObject2 ) { } }

Fix:
if ( ( dX != 0 ) || ( dY != 0 ) ) {
Buggy code:
public class ModelView extends Activity { public Commands commands ; public View3D view3d ; public Model model ; public boolean paused = false ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; Log . e ( "ssg" , "ModelView.onCreate" ) ; requestWindowFeature ( FEATURE_NO_TITLE ) ; model = new Model ( ) ; commands = new Commands ( this ) ; view3d = new View3D ( this ) ; view3d . setEGLConfigChooser ( true ) ; view3d . setRenderer ( view3d ) ; view3d . setRenderMode ( RENDERMODE_WHEN_DIRTY ) ; setContentView ( view3d ) ; view3d . requestFocus ( ) ; view3d . setFocusableInTouchMode ( true ) ; String modelName = getIntent ( ) . getStringExtra ( "model" ) ; Log . e ( "ssg" , ( "model<seq2seq4repair_space>=<seq2seq4repair_space>" + modelName ) ) ; if ( modelName == null ) modelName = "cocotte.txt" ; Log . e ( "ssg" , ( "model<seq2seq4repair_space>=<seq2seq4repair_space>" + modelName ) ) ; <START_BUG> commands . command ( ( "read<seq2seq4repair_space>" + modelName ) ) ; <END_BUG> } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } }

Fix:
commands . command ( ( "read<seq2seq4repair_space>" + modelName ) , this ) ;
Buggy code:
public class MusicService extends Service implements MediaPlayer . OnCompletionListener , MediaPlayer . OnErrorListener , MediaPlayer . OnPreparedListener { private MediaPlayer player ; private ArrayList < Song > songs ; private int songPosn ; private final IBinder musicBind = new MusicService . MusicBinder ( ) ; private String songTitle = "" ; private static final int NOTIFY_ID = 1 ; public void onCreate ( ) { } public void initMusicPlayer ( ) { } public void setList ( ArrayList < Song > theSongs ) { } public class MusicBinder extends Binder { MusicService getService ( ) { } } @ Override public IBinder onBind ( Intent arg0 ) { } @ Override public boolean onUnbind ( Intent intent ) { } @ Override public void onCompletion ( MediaPlayer mp ) { } @ Override public boolean onError ( MediaPlayer mp , int what , int extra ) { } @ Override public void onPrepared ( MediaPlayer mp ) { } public void setSong ( int songIndex ) { } public void playSong ( ) { } public int getPosn ( ) { } public int getDur ( ) { } public boolean isPng ( ) { } public void pausePlayer ( ) { } public void seek ( int posn ) { } public void go ( ) { } public void playPrev ( ) { } public void playNext ( ) { ( songPosn ) ++ ; <START_BUG> if ( ( songPosn ) > ( songs . size ( ) ) ) <END_BUG> songPosn = 0 ; playSong ( ) ; } @ Override public void onDestroy ( ) { } }

Fix:
if ( ( songPosn ) > ( ( songs . size ( ) ) - 1 ) )
Buggy code:
public class TestComparatorChain extends AbstractTestComparator < TestComparatorChain . PseudoRow > { public TestComparatorChain ( String testName ) { } public static Test suite ( ) { } public Comparator < TestComparatorChain . PseudoRow > makeObject ( ) { } public void testNoopComparatorChain ( ) { } public void testBadNoopComparatorChain ( ) { } public void testListComparatorChain ( ) { } public void testBadListComparatorChain ( ) { } public void testComparatorChainOnMinvaluedCompatator ( ) { } public List < TestComparatorChain . PseudoRow > getComparableObjectsOrdered ( ) { } @ SuppressWarnings ( "serial" ) public static class PseudoRow implements Serializable { public int [ ] cols = new int [ 3 ] ; public PseudoRow ( int col1 , int col2 , int col3 ) { } public int getColumn ( int colIndex ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( ) ; <END_BUG> buf . append ( "[" ) ; buf . append ( cols [ 0 ] ) ; buf . append ( "," ) ; buf . append ( cols [ 1 ] ) ; buf . append ( "," ) ; buf . append ( cols [ 2 ] ) ; buf . append ( "]" ) ; return buf . toString ( ) ; } public boolean equals ( Object o ) { } } public static class ColumnComparator implements Serializable , Comparator < TestComparatorChain . PseudoRow > { private static final long serialVersionUID = - 2284880866328872105L ; protected int colIndex = 0 ; public ColumnComparator ( int colIndex ) { } public int compare ( TestComparatorChain . PseudoRow o1 , TestComparatorChain . PseudoRow o2 ) { } public int hashCode ( ) { } public boolean equals ( Object that ) { } } }

Fix:
StringBuilder buf = new StringBuilder ( ) ;
Buggy code:
public class LF5Appender extends AppenderSkeleton { protected LogBrokerMonitor _logMonitor ; protected static LogBrokerMonitor _defaultLogMonitor ; protected static AppenderFinalizer _finalizer ; public LF5Appender ( ) { } public LF5Appender ( LogBrokerMonitor monitor ) { } public void append ( LoggingEvent event ) { String category = event . getLoggerName ( ) ; String logMessage = event . getRenderedMessage ( ) ; String nestedDiagnosticContext = event . getNDC ( ) ; String threadDescription = event . getThreadName ( ) ; String level = event . getLevel ( ) . toString ( ) ; <START_BUG> long time = event . timeStamp ; <END_BUG> LocationInfo locationInfo = event . getLocationInformation ( ) ; Log4JLogRecord record = new Log4JLogRecord ( ) ; record . setCategory ( category ) ; record . setMessage ( logMessage ) ; record . setLocation ( locationInfo . fullInfo ) ; record . setMillis ( time ) ; record . setThreadDescription ( threadDescription ) ; if ( nestedDiagnosticContext != null ) { record . setNDC ( nestedDiagnosticContext ) ; } else { record . setNDC ( "" ) ; } if ( ( event . getThrowableInformation ( ) ) != null ) { record . setThrownStackTrace ( event . getThrowableInformation ( ) ) ; } try { record . setLevel ( LogLevel . valueOf ( level ) ) ; } catch ( LogLevelFormatException e ) { record . setLevel ( LogLevel . WARN ) ; } if ( ( _logMonitor ) != null ) { _logMonitor . addMessage ( record ) ; } } public void close ( ) { } public boolean requiresLayout ( ) { } public void setCallSystemExitOnClose ( boolean callSystemExitOnClose ) { } public boolean equals ( LF5Appender compareTo ) { } public LogBrokerMonitor getLogBrokerMonitor ( ) { } public static void main ( String [ ] args ) { } public void setMaxNumberOfRecords ( int maxNumberOfRecords ) { } protected static synchronized LogBrokerMonitor getDefaultInstance ( ) { } protected static int getScreenWidth ( ) { } protected static int getScreenHeight ( ) { } protected static int getDefaultMonitorWidth ( ) { } protected static int getDefaultMonitorHeight ( ) { } }

Fix:
long time = event . getTimeStamp ( ) ;
Buggy code:
public class RemoveAnnotationFromMethodTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testRemoveAnnotationFromMethod ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebMethod . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "add" , new String [ ] { "I" , "I" } ) ; assertNotNull ( method ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( method , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertNotNull ( source . getImport ( WebMethod . class . getCanonicalName ( ) ) ) ; textFileChange . addEdit ( AnnotationUtils . createRemoveAnnotationTextEdit ( method , annotation ) ) ; <START_BUG> textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( method , WebMethod . class ) ) ; <END_BUG> assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertFalse ( AnnotationUtils . isAnnotationPresent ( method , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertFalse ( source . getImport ( WebMethod . class . getCanonicalName ( ) ) . exists ( ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( method , WebMethod . class . getCanonicalName ( ) ) ) ;
Buggy code:
public class MessageBuilderHelper { private static final Pattern quotePattern = Pattern . compile ( "^(.*)$" ) ; public static boolean isAlreadyReply ( String subject , String pattern ) { } public static String createReplySubject ( String subject ) { } public static String createForwardSubject ( String subject ) { } public static String createTo ( Header header ) { } public static String createToAll ( Header header ) { } public static String createToMailinglist ( Header header ) { } public static void createMailingListHeaderItems ( Header header , ComposerModel model ) { } public static AccountItem getAccountItem ( Integer accountUid ) { } public static String createBodyText ( MimePart mimePart ) throws IOException { CharSequence bodyText = "" ; StreamableMimePart bodyPart = ( ( StreamableMimePart ) ( mimePart ) ) ; String charsetName = bodyPart . getHeader ( ) . getContentParameter ( "charset" ) ; int encoding = bodyPart . getHeader ( ) . getContentTransferEncoding ( ) ; InputStream body = bodyPart . getInputStream ( ) ; switch ( encoding ) { case MimeHeader . QUOTED_PRINTABLE : { body = new QuotedPrintableDecoderInputStream ( body ) ; break ; } case MimeHeader . BASE64 : { body = new Base64DecoderInputStream ( body ) ; break ; } } if ( charsetName != null ) { Charset charset ; try { charset = Charset . forName ( charsetName ) ; } catch ( UnsupportedCharsetException e ) { charset = Charset . forName ( System . getProperty ( "file.encoding" ) ) ; } body = new CharsetDecoderInputStream ( body , charset ) ; } <START_BUG> String bodyMsg = StreamUtils . readInString ( body ) . toString ( ) ; <END_BUG> return bodyMsg ; } public static String createQuotedBodyText ( CharSequence bodyText , boolean html ) throws IOException { } public static boolean isHTMLEnabled ( ) { } public static void addAddressesToAddressbook ( Address [ ] addresses ) { } }

Fix:
String bodyMsg = StreamUtils . readCharacterStream ( body ) . toString ( ) ;