nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BindStatus { private final RequestContext requestContext ; private final String path ; private final boolean htmlEscape ; private final String expression ; private final Errors errors ; private BindingResult bindingResult ; private Object value ; private Class valueType ; private Object actualValue ; private PropertyEditor editor ; private List objectErrors ; private String [ ] errorCodes ; private String [ ] errorMessages ; public BindStatus ( RequestContext requestContext , String path , boolean htmlEscape ) throws IllegalStateException { } private void initErrorCodes ( ) { } private void initErrorMessages ( ) throws NoSuchMessageException { } public String getPath ( ) { } public String getExpression ( ) { } public Object getValue ( ) { } public Class getValueType ( ) { } public Object getActualValue ( ) { } public String getDisplayValue ( ) { } public boolean isError ( ) { } public String [ ] getErrorCodes ( ) { } public String getErrorCode ( ) { } public String [ ] getErrorMessages ( ) { } public String getErrorMessage ( ) { } public String getErrorMessagesAsString ( String delimiter ) { } public Errors getErrors ( ) { } public PropertyEditor getEditor ( ) { } public PropertyEditor findEditor ( Class valueClass ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( "BindStatus:<seq2seq4repair_space>" ) ; <END_BUG> sb . append ( "expression=[" ) . append ( this . expression ) . append ( "];<seq2seq4repair_space>" ) ; sb . append ( "value=[" ) . append ( this . value ) . append ( "]" ) ; if ( isError ( ) ) { sb . append ( ";<seq2seq4repair_space>errorCodes=" ) . append ( Arrays . asList ( this . errorCodes ) ) ; } return sb . toString ( ) ; } }

Fix:
StringBuilder sb = new StringBuilder ( "BindStatus:<seq2seq4repair_space>" ) ;
Buggy code:
public class OSGiAttachmentsDeploymentProcessor implements DeploymentUnitProcessor { private ServiceRegistry serviceRegistry ; public OSGiAttachmentsDeploymentProcessor ( ServiceRegistry serviceRegistry ) { } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { <START_BUG> final DeploymentUnit deploymentUnitContext = phaseContext . getDeploymentUnitContext ( ) ; <END_BUG> Deployment deployment = OSGiDeploymentAttachment . getAttachment ( deploymentUnitContext ) ; String location = InstallBundleInitiatorService . getLocation ( serviceRegistry , deploymentUnitContext . getName ( ) ) ; VirtualFile virtualFile = phaseContext . getAttachment ( DEPLOYMENT_ROOT ) ; BundleInfo info = BundleInfoAttachment . getBundleInfoAttachment ( deploymentUnitContext ) ; if ( ( deployment == null ) && ( info != null ) ) { deployment = DeploymentFactory . createDeployment ( info ) ; deployment . addAttachment ( BundleInfo . class , info ) ; OSGiDeploymentAttachment . attachDeployment ( deploymentUnitContext , deployment ) ; } OSGiMetaData metadata = OSGiMetaDataAttachment . getOSGiMetaDataAttachment ( deploymentUnitContext ) ; if ( ( deployment == null ) && ( metadata != null ) ) { String symbolicName = metadata . getBundleSymbolicName ( ) ; Version version = metadata . getBundleVersion ( ) ; deployment = DeploymentFactory . createDeployment ( AbstractVFS . adapt ( virtualFile ) , location , symbolicName , version ) ; deployment . addAttachment ( OSGiMetaData . class , metadata ) ; OSGiDeploymentAttachment . attachDeployment ( deploymentUnitContext , deployment ) ; } XModule resModule = XModuleAttachment . getXModuleAttachment ( deploymentUnitContext ) ; if ( ( deployment == null ) && ( resModule != null ) ) { String symbolicName = resModule . getName ( ) ; Version version = resModule . getVersion ( ) ; deployment = DeploymentFactory . createDeployment ( AbstractVFS . adapt ( virtualFile ) , location , symbolicName , version ) ; deployment . addAttachment ( XModule . class , resModule ) ; OSGiDeploymentAttachment . attachDeployment ( deploymentUnitContext , deployment ) ; } if ( deployment != null ) { MountHandle mount = phaseContext . getAttachment ( ATTACHMENT_KEY ) ; deployment . addAttachment ( MountHandle . class , mount ) ; deployment . setAutoStart ( true ) ; OSGiDeploymentService . addService ( phaseContext ) ; } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final DeploymentUnit deploymentUnitContext = phaseContext . getDeploymentUnit ( ) ;
Buggy code:
public abstract class DedupContextBase implements IDedupContext { protected static class Output implements Serializable { public String streamId ; public List < Object > tuple ; public Output ( String streamId , List < Object > tuple ) { } } private static final Log LOG = LogFactory . getLog ( DedupContextBase . class ) ; private static final byte [ ] UPTIME = Bytes . toBytes ( "uptime" ) ; private static final byte [ ] EMIT_COUNT = Bytes . toBytes ( "emit<seq2seq4repair_space>count" ) ; private Map conf ; private TopologyContext context ; private String identifier ; private Map < BytesArrayRef , byte [ ] > stateMap ; private Map < BytesArrayRef , byte [ ] > newState ; private Map < BytesArrayRef , byte [ ] > systemMap ; private Map < BytesArrayRef , byte [ ] > newSystem ; private Map < String , DedupContextBase . Output > outputMap ; private Map < String , DedupContextBase . Output > newOutput ; private Map < BytesArrayRef , byte [ ] > newDelete ; private IStateStore stateStore ; private byte [ ] storeKey ; public DedupContextBase ( Map conf , TopologyContext context ) throws IOException { } public void close ( ) throws IOException { } protected String getIdentifier ( ) { } protected Map < String , DedupContextBase . Output > getNewOutput ( ) { } protected Map < String , DedupContextBase . Output > getOutputMap ( ) { } protected DedupContextBase . Output getOutput ( String id ) { } protected void deleteOutput ( String tupleid , byte [ ] value ) { } protected byte [ ] getSystemState ( byte [ ] key ) { } protected void setSystemState ( byte [ ] key , byte [ ] value ) { } protected void saveChanges ( ) throws IOException { } protected void clearChanges ( ) { } @ Override public Object getConf ( Object key ) { } @ Override public byte [ ] getState ( byte [ ] key ) { } @ Override public void setState ( byte [ ] key , byte [ ] value ) { } @ Override public void emit ( List < Object > tuple ) { } @ Override public void emit ( String streamId , List < Object > tuple ) { } public void emit ( String streamId , List < Object > tuple , String tupleid ) { } protected String getTupleID ( List < Object > tuple ) { <START_BUG> return ( ( String ) ( tuple . get ( ( ( tuple . size ( ) ) - 2 ) ) ) ) ; <END_BUG> } protected abstract String getNextTupleID ( ) { } }

Fix:
return ( ( String ) ( tuple . get ( ( ( tuple . size ( ) ) - 1 ) ) ) ) ;
Buggy code:
public class LsHandler extends CommandHandlerWithHelp { public LsHandler ( ) { } public LsHandler ( String command ) { } @ Override protected void doHandle ( CommandContext ctx ) { final OperationRequestAddress address ; String nodePath = null ; <START_BUG> List < String > args = ctx . getArguments ( ) ; <END_BUG> if ( ! ( args . isEmpty ( ) ) ) { nodePath = args . get ( 0 ) ; } if ( nodePath != null ) { address = new org . jboss . as . cli . operation . impl . DefaultOperationRequestAddress ( ctx . getPrefix ( ) ) ; OperationRequestParser . CallbackHandler handler = new org . jboss . as . cli . operation . impl . DefaultOperationCallbackHandler ( address ) ; try { ctx . getOperationRequestParser ( ) . parse ( nodePath , handler ) ; } catch ( CommandFormatException e ) { ctx . printLine ( e . getLocalizedMessage ( ) ) ; } } else { address = ctx . getPrefix ( ) ; } final List < String > names ; if ( address . endsOnType ( ) ) { names = ctx . getOperationCandidatesProvider ( ) . getNodeNames ( address ) ; } else { names = ctx . getOperationCandidatesProvider ( ) . getNodeTypes ( address ) ; } printList ( ctx , names ) ; } }

Fix:
List < String > args = ctx . getOtherArguments ( ) ;
Buggy code:
@ FacesValidator ( "existingUser" ) public class ExistingUser implements Validator { private final DbContext dbContext ; private final AdminUserController ctrl ; public ExistingUser ( ) { } @ Override public void validate ( FacesContext facesContext , UIComponent component , Object value ) throws ValidatorException { if ( ( value != null ) && ( ! ( value . toString ( ) . equals ( "" ) ) ) ) { User u ; User temp ; temp = new User ( ) ; temp . setName ( value . toString ( ) ) ; u = ( ( User ) ( dbContext . User ( ) . getByAlternateKey ( temp ) ) ) ; <START_BUG> if ( ( ( ( u . getName ( ) ) != null ) && ( ! ( ctrl . getNewUser ( ) . equals ( u ) ) ) ) && ( temp . getName ( ) . toLowerCase ( ) . equals ( u . getName ( ) . toLowerCase ( ) ) ) ) { <END_BUG> FacesMessage msg = new FacesMessage ( null , null ) ; msg . setSeverity ( SEVERITY_ERROR ) ; throw new ValidatorException ( msg ) ; } } } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( u . getName ( ) ) != null ) && ( ! ( ctrl . getUser ( ) . equals ( u ) ) ) ) && ( temp . getName ( ) . toLowerCase ( ) . equals ( u . getName ( ) . toLowerCase ( ) ) ) ) {
Buggy code:
@ Repository @ Scope ( "request" ) public class MenuDao extends BaseDao { public void createMenu ( Menu menu ) { } public List < Map < String , Object > > getMenus ( Long ownerID ) { <START_BUG> String sql = "SELECT<seq2seq4repair_space>menus.id,menus.name,menus.ownerID,menus.likes,menuRecipe.recipeID<seq2seq4repair_space>FROM<seq2seq4repair_space>menus<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>menuRecipe<seq2seq4repair_space>ON<seq2seq4repair_space>menus.id<seq2seq4repair_space>=<seq2seq4repair_space>menuRecipe.menuID<seq2seq4repair_space>WHERE<seq2seq4repair_space>ownerID=?<seq2seq4repair_space>AND<seq2seq4repair_space>NOT<seq2seq4repair_space>menus.isDeleted" ; <END_BUG> return this . jdbcTemplate . queryForList ( sql , ownerID ) ; } }

Fix:
String sql = "SELECT<seq2seq4repair_space>menus.id,menus.name<seq2seq4repair_space>as<seq2seq4repair_space>menu_name,menus.ownerID,menus.likes,menuRecipe.recipeID<seq2seq4repair_space>FROM<seq2seq4repair_space>menus<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>menuRecipe<seq2seq4repair_space>ON<seq2seq4repair_space>menus.id<seq2seq4repair_space>=<seq2seq4repair_space>menuRecipe.menuID<seq2seq4repair_space>WHERE<seq2seq4repair_space>ownerID=?<seq2seq4repair_space>AND<seq2seq4repair_space>NOT<seq2seq4repair_space>menus.isDeleted" ;
Buggy code:
class TextTab extends ScrollableTab { Text text ; Group textGroup ; Button wrapButton ; Button readOnlyButton ; Button leftButton ; Button centerButton ; Button rightButton ; TextTab ( ControlExample instance ) { } void createExampleGroup ( ) { super . createExampleGroup ( ) ; textGroup = new Group ( exampleGroup , SWT . NONE ) ; textGroup . setLayout ( new GridLayout ( ) ) ; <START_BUG> textGroup . setLayoutData ( new GridData ( ( ( ( GridData . GRAB_HORIZONTAL ) | ( GridData . HORIZONTAL_ALIGN_FILL ) ) | ( GridData . VERTICAL_ALIGN_FILL ) ) ) ) ; <END_BUG> textGroup . setText ( "Text" ) ; } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String getTabText ( ) { } void setExampleWidgetState ( ) { } }

Fix:
textGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ;
Buggy code:
public class MainActivity extends MyActivity implements View . OnClickListener { public Footer footer ; private SignUpInFragment signUpInFragment ; private CallbackManager fbCallbackManager ; private ProfileTracker fbProfileTracker ; private Profile fbProfile ; private AccessTokenTracker fbAccessTokenTracker ; public LoginManager fbLoginManager ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void checkNotice ( ) { } private void gotoNoteListdFragment ( ) { } private void gotoSignUpInFragment ( ) { } private void onCreateFooter ( ) { this . footer = new Footer ( this ) ; footer . setOnItemsClickListener ( this ) ; <START_BUG> footer . checkFooterItem ( 0 ) ; <END_BUG> } private void setUpFacebookCallbacks ( ) { } private void setProfile ( Profile profile ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public void onClick ( View view ) { } public void onClickFooterItem1 ( ) { } public void gotoSettingFragment ( ) { } public void onClickFooterItem2 ( ) { } private void gotoPrimaryCardFragment ( ) { } public void onClickFooterItem3 ( ) { } public void gotoBookListFragment ( ) { } public void onClickFooterItem4 ( ) { } public void gotoTaskListFragment ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onDestroy ( ) { } }

Fix:
footer . checkFooterItem ( 3 ) ;
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; int itemCount ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { } void createItem ( TabItem item , int index ) { } void createWidget ( ) { } void destroyItem ( TabItem item ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public TabItem getItem ( Point point ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } void releaseChildren ( boolean destroy ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setFont ( NSFont font ) { } public void setSelection ( TabItem item ) { } public void setSelection ( TabItem [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify , boolean force ) { <START_BUG> if ( index >= ( itemCount ) ) <END_BUG> return ; int currentIndex = getSelectionIndex ( ) ; if ( ( ! force ) && ( currentIndex == index ) ) return ; if ( currentIndex != ( - 1 ) ) { TabItem item = items [ currentIndex ] ; if ( item != null ) { Control control = item . control ; if ( ( control != null ) && ( ! ( control . isDisposed ( ) ) ) ) { control . setVisible ( false ) ; } } } ( ( NSTabView ) ( view ) ) . selectTabViewItemAtIndex ( index ) ; index = getSelectionIndex ( ) ; if ( index != ( - 1 ) ) { TabItem item = items [ index ] ; if ( item != null ) { Control control = item . control ; if ( ( control != null ) && ( ! ( control . isDisposed ( ) ) ) ) { control . setVisible ( true ) ; } if ( notify ) { Event event = new Event ( ) ; event . item = item ; sendEvent ( Selection , event ) ; } } } } boolean traversePage ( boolean next ) { } void willSelectTabViewItem ( int tabView , int tabViewItem ) { } }

Fix:
if ( ! ( ( 0 <= index ) && ( index < ( itemCount ) ) ) )
Buggy code:
public class TestConstructor extends ExternalsTestBase { @ Test public void test_const_object_literal ( ) throws IOException { compile ( "constructor_params.js" ) ; assertTrue ( model . hasClass ( "FinalClass" ) ) ; <START_BUG> assertTrue ( model . getClassReference ( "FinalClass" ) . hasMethod ( "bar" ) ) ; <END_BUG> assertTrue ( model . getClassReference ( "FinalClass" ) . getStaticMethod ( "bar" ) . isStatic ( ) ) ; } @ Test public void test_constructor_args ( ) throws IOException { } @ Test public void test_constructor_comment ( ) throws IOException { } @ Override protected void configure ( ExternCConfiguration config ) throws IOException { } }

Fix:
assertTrue ( model . getClassReference ( "FinalClass" ) . hasStaticMethod ( "bar" ) ) ;
Buggy code:
public final class PrependContextPathHandler extends AbstractMarkupFilter { private static final Log log = LogFactory . getLog ( PrependContextPathHandler . class ) ; private static final String [ ] attributeNames = new String [ ] { "href" , "src" } ; private String contextPath ; public PrependContextPathHandler ( ) { } public PrependContextPathHandler ( final String virtualContextPath ) { } public MarkupElement nextTag ( ) throws ParseException { final ComponentTag tag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ; <START_BUG> if ( tag == null ) { <END_BUG> return tag ; } if ( ( contextPath ) == null ) { contextPath = ( ( wicket . protocol . http . WebRequestCycle ) ( wicket . RequestCycle . get ( ) ) ) . getWebRequest ( ) . getContextPath ( ) ; if ( ( contextPath ) == null ) { contextPath = "" ; } else if ( ( contextPath . endsWith ( "//" ) ) == false ) { contextPath += "//" ; } } if ( ( contextPath . length ( ) ) > 0 ) { for ( int i = 0 ; i < ( PrependContextPathHandler . attributeNames . length ) ; i ++ ) { String attrName = PrependContextPathHandler . attributeNames [ i ] ; String attrValue = tag . getAttributes ( ) . getString ( attrName ) ; if ( ( ( attrValue != null ) && ( ( attrValue . startsWith ( "//" ) ) == false ) ) && ( ( attrValue . indexOf ( ":" ) ) < 0 ) ) { String url = ( contextPath ) + attrValue ; tag . getAttributes ( ) . put ( attrName , url ) ; tag . setModified ( true ) ; } } } return tag ; } }

Fix:
if ( ( tag == null ) || ( ( tag . getId ( ) ) != null ) ) {
Buggy code:
public interface HyperlinkDAO { public long save ( Hyperlink hyperlink ) throws DataAccessException { } public void update ( Hyperlink hyperlink ) throws DataAccessException { } public boolean deleteById ( long id ) throws DataAccessException { } public long countHyperlinks ( ) throws DataAccessException { } public Hyperlink getById ( long idz ) throws DataAccessException { } <START_BUG> public List < Hyperlink > getAllWithTag ( MetaTag tag , String order ) throws DataAccessException ; <END_BUG> public List < Hyperlink > getAllWithLink ( String link , String order ) throws DataAccessException { } public List < Hyperlink > getAll ( String order ) throws DataAccessException { } No newline ; at end ; of file ; }

Fix:
public List < Hyperlink > getAllWithTag ( String tag , String order ) throws DataAccessException ;
Buggy code:
public class QueuelessThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT , QUEUE_SIZE ) ; public QueuelessThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final QueuelessThreadPoolService pool = ( ( QueuelessThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . QUEUE_SIZE ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else { <START_BUG> throw MESSAGES . unsupportedQueuelessThreadPoolMetric ( attributeName ) ; <END_BUG> } } }

Fix:
throw ROOT_LOGGER . unsupportedQueuelessThreadPoolMetric ( attributeName ) ;
Buggy code:
public final class ChangeListenerSet extends ListenerSet { protected void notifyListener ( IListener listener ) { <START_BUG> ( ( IChangeListener ) ( listener ) ) . changed ( ) ; <END_BUG> } }

Fix:
( ( IChangeListener ) ( listener ) ) . onChange ( ) ;
Buggy code:
public class DRPCSpout implements IRichSpout { public static Logger LOG = Logger . getLogger ( DRPCSpout . class ) ; SpoutOutputCollector _collector ; List < DRPCClient > _clients = new ArrayList < DRPCClient > ( ) ; String _function ; String _local_drpc_id = null ; private static class DRPCMessageId { String id ; int index ; public DRPCMessageId ( String id , int index ) { } } public DRPCSpout ( String function ) { } public DRPCSpout ( String function , ILocalDRPC drpc ) { } @ Override public boolean isDistributed ( ) { } @ Override public void open ( Map conf , TopologyContext context , SpoutOutputCollector collector ) { _collector = collector ; if ( ( _local_drpc_id ) == null ) { int numTasks = context . getComponentTasks ( context . getThisComponentId ( ) ) . size ( ) ; int index = context . getThisTaskIndex ( ) ; <START_BUG> int port = ( ( Long ) ( conf . get ( DRPC_PORT ) ) ) . intValue ( ) ; <END_BUG> List < String > servers = ( ( List < String > ) ( conf . get ( DRPC_SERVERS ) ) ) ; if ( servers . isEmpty ( ) ) { throw new RuntimeException ( "No<seq2seq4repair_space>DRPC<seq2seq4repair_space>servers<seq2seq4repair_space>configured<seq2seq4repair_space>for<seq2seq4repair_space>topology" ) ; } if ( numTasks < ( servers . size ( ) ) ) { for ( String s : servers ) { _clients . add ( new DRPCClient ( s , port ) ) ; } } else { int i = index % ( servers . size ( ) ) ; _clients . add ( new DRPCClient ( servers . get ( i ) , port ) ) ; } } } @ Override public void close ( ) { } @ Override public void nextTuple ( ) { } @ Override public void ack ( Object msgId ) { } @ Override public void fail ( Object msgId ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } }

Fix:
int port = Utils . getInt ( conf . get ( DRPC_PORT ) ) ;
Buggy code:
public final class StandardAcceptanceFunction implements AcceptanceFunction { private final Random random ; @ Inject StandardAcceptanceFunction ( Random random ) { } @ Override public boolean acceptNewState ( double originalScore , double newScore , double temperature ) { if ( newScore >= originalScore ) { return true ; } <START_BUG> double probability = Math . exp ( ( ( originalScore - newScore ) // temperature ) ) ; <END_BUG> return ( random . nextLong ( ) ) < probability ; } }

Fix:
double probability = Math . exp ( ( ( newScore - originalScore ) // temperature ) ) ;
Buggy code:
public class StickyPartitioner implements Partitioner { static final String NAME = "sticky" ; public static final long DEFAULT_INTERVAL_MS = TimeUnit . SECONDS . toMillis ( 5 ) ; public static class Builder { private Supplier < Long > interval = Suppliers . ofInstance ( StickyPartitioner . DEFAULT_INTERVAL_MS ) ; public StickyPartitioner . Builder withInterval ( long interval ) { } public StickyPartitioner . Builder withInterval ( long interval , TimeUnit units ) { } public StickyPartitioner . Builder withInterval ( Supplier < Long > interval ) { } public StickyPartitioner build ( ) { } } public static StickyPartitioner . Builder builder ( ) { } private final Random prng ; private final Supplier < Long > interval ; private final ConcurrentMap < String , Integer > indexCache ; private StickyPartitioner ( StickyPartitioner . Builder builder ) { } @ Override public Integer partition ( final String topic , final byte [ ] partitionKey , final List < PartitionInfo > partitions ) { if ( topic == null ) { throw new IllegalArgumentException ( "topic<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } if ( partitions . isEmpty ( ) ) { throw new IllegalArgumentException ( ( "no<seq2seq4repair_space>partitions<seq2seq4repair_space>for<seq2seq4repair_space>topic:<seq2seq4repair_space>" + topic ) ) ; } final int numPartitions = partitions . size ( ) ; if ( partitionKey != null ) { return ( Utils . abs ( Utils . murmur2 ( partitionKey ) ) ) % numPartitions ; } else { Integer index = indexCache . get ( topic ) ; if ( index != null ) { return index ; } else { int partition = prng . nextInt ( numPartitions ) ; for ( int i = 0 ; i < numPartitions ; i ++ ) { if ( ( partitions . get ( partition ) . leader ( ) ) != null ) { index = indexCache . putIfAbsent ( topic , partition ) ; <START_BUG> return index ; <END_BUG> } else { partition = ( partition + 1 ) % numPartitions ; } } return partition ; } } } }

Fix:
return index != null ? index : partition ;
Buggy code:
public class IntentLauncher extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; if ( getIntent ( ) . getAction ( ) . equals ( ACTION_VIEW ) ) { String u = getIntent ( ) . getData ( ) . getEncodedPath ( ) ; boolean run = false ; Globals . idf = null ; Globals . zip = null ; Globals . qm = null ; if ( u . endsWith ( ".idf" ) ) { run = true ; Globals . idf = u ; } else if ( u . endsWith ( ".zip" ) ) { run = true ; Globals . zip = u ; } else if ( u . endsWith ( ".qm" ) ) { run = true ; Globals . qm = u ; } if ( run ) { try { <START_BUG> Intent myIntent = new Intent ( this , Class . forName ( "com.silentlexx.instead.universal.UniversalMainMenu" ) ) ; <END_BUG> startActivity ( myIntent ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } } } finish ( ) ; } }

Fix:
Intent myIntent = new Intent ( this , Class . forName ( "com.silentlexx.instead.standalone.MainMenu" ) ) ;
Buggy code:
public class Scoreboard { private PlayerNumber largestArmy ; private PlayerNumber longestRoad ; private Map < PlayerNumber , Integer > points ; private Map < PlayerNumber , Integer > activeKnights ; private Map < PlayerNumber , Integer > builtRoads ; public Scoreboard ( List < TransportPlayer > player , TransportTurnTracker turnTracker ) { } public Scoreboard ( ) { } private void initializeMap ( Map < PlayerNumber , Integer > map ) { } private void countRoads ( List < TransportPlayer > players ) { } private void countKnights ( List < TransportPlayer > players ) { for ( int i = 0 ; i < ( players . size ( ) ) ; i ++ ) { <START_BUG> builtRoads . put ( players . get ( i ) . playerIndex , players . get ( i ) . soldiers ) ; <END_BUG> } } private void countPoints ( List < TransportPlayer > players ) { } private void updatePlayerMaps ( Map < PlayerNumber , Integer > playerMap , PlayerNumber player , int difference ) { } public void dwellingBuilt ( PlayerNumber player ) { } public void roadBuilt ( PlayerNumber player ) { } private void calculateSpecialCardHolder ( Map < PlayerNumber , Integer > specialCard , PlayerNumber currentHolder ) { } public void devCardPlayed ( PlayerNumber player , DevCardType type ) { } public int getPoints ( PlayerNumber player ) { } }

Fix:
activeKnights . put ( players . get ( i ) . playerIndex , players . get ( i ) . soldiers ) ;
Buggy code:
public class DataSourceTestCase extends AbstractCliTestBase { private static String [ ] profileNames ; private static final String [ ] [ ] DS_PROPS = new String [ ] [ ] { new String [ ] { "idle-timeout-minutes" , "5" } } ; @ BeforeClass public static void before ( ) throws Exception { } @ AfterClass public static void after ( ) throws Exception { } @ Before public void init ( ) { } @ Test public void testDataSource ( ) throws Exception { } @ Test public void testXaDataSource ( ) throws Exception { } private void testAddDataSource ( ) throws Exception { } private void testRemoveDataSource ( ) throws Exception { } private void testModifyDataSource ( ) throws Exception { } private void testAddXaDataSource ( ) throws Exception { <START_BUG> cli . sendLine ( ( ( "xa-data-source<seq2seq4repair_space>add<seq2seq4repair_space>--profile=" + ( DataSourceTestCase . profileNames [ 0 ] ) ) + "<seq2seq4repair_space>--jndi-name=java:jboss//datasources//TestXADS<seq2seq4repair_space>--name=java:jboss//datasources//TestXADS<seq2seq4repair_space>--driver-name=h2" ) ) ; <END_BUG> cli . sendLine ( ( ( "cd<seq2seq4repair_space>//profile=" + ( DataSourceTestCase . profileNames [ 0 ] ) ) + "//subsystem=datasources//xa-data-source" ) ) ; cli . sendLine ( "ls" ) ; String ls = cli . readAllUnformated ( WAIT_TIMEOUT , WAIT_LINETIMEOUT ) ; assertTrue ( ls . contains ( "java:jboss//datasources//TestXADS" ) ) ; } private void testModifyXaDataSource ( ) throws Exception { } private void testRemoveXaDataSource ( ) throws Exception { } }

Fix:
cli . sendLine ( ( ( "xa-data-source<seq2seq4repair_space>add<seq2seq4repair_space>--profile=" + ( DataSourceTestCase . profileNames [ 0 ] ) ) + "<seq2seq4repair_space>--jndi-name=java:jboss//datasources//TestXADS<seq2seq4repair_space>--name=java:jboss//datasources//TestXADS<seq2seq4repair_space>--driver-name=h2<seq2seq4repair_space>--xa-datasource-properties=ServerName=localhost,PortNumber=50011" ) ) ;
Buggy code:
public class MOOSEFormEditor extends ICEFormEditor { public static final String ID = "org.eclipse.ice.client.widgets.moose.MOOSEFormEditor" ; private static final String PLANT_PAGE_ID = "Plant<seq2seq4repair_space>View" ; private Entry appsEntry ; private PlantAppState plantView ; private final PlantBlockManager factory = new PlantBlockManager ( ) ; private boolean wireframe ; @ Override protected void setInput ( IEditorInput input ) { } private void addPlantPage ( ) { } private void populatePlantViewSection ( Section section , FormToolkit toolkit ) { } private void fillPlantViewToolBar ( ToolBarManager toolBar ) { } private void removePlantPage ( ) { } private void removePageWithID ( String id ) { } private TreeComposite findComponentBlock ( ) { } private TreeComposite findNamedRootBlock ( String name ) { } @ Override protected String getTreeCompositeViewerID ( ) { } @ Override protected int getTreeCompositeViewerInputID ( ) { } @ Override public void doSave ( IProgressMonitor monitor ) { super . doSave ( monitor ) ; <START_BUG> String appStr = appsEntry . getValue ( ) ; <END_BUG> if ( "relap" . equals ( appStr ) ) { addPlantPage ( ) ; } else { removePlantPage ( ) ; } return ; } }

Fix:
String appStr = appsEntry . getValue ( ) . toLowerCase ( ) ;
Buggy code:
public class Zone { public static final int CACHE = 1 ; public static final int PRIMARY = 2 ; public static final int SECONDARY = 3 ; private Hashtable data ; private Name origin = null ; private int type ; public Zone ( String file , int _type , Zone cache ) throws IOException { } public Hashtable findName ( Name name ) { } public Name getOrigin ( ) { } public RRset getNS ( ) { } public SOARecord getSOA ( ) { } Name parseOrigin ( MyStringTokenizer st ) throws IOException { } Record parseRR ( MyStringTokenizer st , boolean useLast , Record last , Name origin ) throws IOException { Name name ; int ttl ; short type ; short dclass ; if ( ! useLast ) name = new Name ( st . nextToken ( ) , origin ) ; else name = last . name ; String s = st . nextToken ( ) ; try { <START_BUG> ttl = Integer . parseInt ( s ) ; <END_BUG> s = st . nextToken ( ) ; } catch ( NumberFormatException e ) { if ( ( ! useLast ) || ( last == null ) ) ttl = 3600 ; else ttl = last . ttl ; } if ( ( dclass = DClass . value ( s ) ) > 0 ) s = st . nextToken ( ) ; else dclass = DClass . IN ; if ( ( type = Type . value ( s ) ) < 0 ) throw new IOException ( "Parse<seq2seq4repair_space>error" ) ; return Record . fromString ( name , type , dclass , ttl , st , origin ) ; } public void addRR ( Record record ) { } }

Fix:
ttl = TTL . parseTTL ( s ) ;
Buggy code:
public class RenderPageRequestHandler implements IPageClassRequestHandler , IPageRequestHandler { private final IPageProvider pageProvider ; private final RenderPageRequestHandler . RedirectPolicy redirectPolicy ; public enum RedirectPolicy { ALWAYS_REDIRECT , NEVER_REDIRECT , AUTO_REDIRECT ; } public RenderPageRequestHandler ( IPageProvider pageProvider ) { } public RenderPageRequestHandler ( IPageProvider pageProvider , RenderPageRequestHandler . RedirectPolicy redirectPolicy ) { } public IPageProvider getPageProvider ( ) { } public RenderPageRequestHandler . RedirectPolicy getRedirectPolicy ( ) { } public Class < ? extends IRequestablePage > getPageClass ( ) { } public PageParameters getPageParameters ( ) { } public void detach ( RequestCycle requestCycle ) { } public IRequestablePage getPage ( ) { } public void respond ( RequestCycle requestCycle ) { <START_BUG> org . apache . wicket . Application . get ( ) . getRenderPageRequestHandlerDelegate ( this ) . respond ( requestCycle ) ; <END_BUG> } }

Fix:
org . apache . wicket . Application . get ( ) . getPageRendererProvider ( ) . get ( this ) . respond ( requestCycle ) ;
Buggy code:
public class CompressedSequentialWriter extends SequentialWriter { public static final int CHUNK_LENGTH = 65536 ; public static SequentialWriter open ( String dataFilePath , String indexFilePath , boolean skipIOCache ) throws IOException { } private long chunkOffset = 0 ; private final Writer metadataWriter ; private final byte [ ] compressed ; private int chunkCount = 0 ; private final Checksum checksum = new CRC32 ( ) ; public CompressedSequentialWriter ( File file , String indexFilePath , boolean skipIOCache ) throws IOException { } @ Override public void sync ( ) throws IOException { } @ Override public void flush ( ) throws IOException { } @ Override protected void flushData ( ) throws IOException { } @ Override public FileMark mark ( ) { } @ Override public synchronized void resetAndTruncate ( FileMark mark ) throws IOException { assert mark instanceof CompressedSequentialWriter . CompressedFileWriterMark ; CompressedSequentialWriter . CompressedFileWriterMark realMark = ( ( CompressedSequentialWriter . CompressedFileWriterMark ) ( mark ) ) ; current = realMark . uncDataOffset ; if ( ( realMark . chunkOffset ) == ( chunkOffset ) ) { validBufferBytes = realMark . bufferOffset ; return ; } syncInternal ( ) ; chunkOffset = realMark . chunkOffset ; int chunkSize = ( ( int ) ( ( ( metadataWriter . chunkOffsetBy ( realMark . nextChunkIndex ) ) - ( chunkOffset ) ) - 4 ) ) ; out . seek ( chunkOffset ) ; <START_BUG> out . read ( compressed , 0 , chunkSize ) ; <END_BUG> int validBytes = Snappy . rawUncompress ( compressed , 0 , chunkSize , buffer , 0 ) ; checksum . update ( buffer , 0 , validBytes ) ; if ( ( out . readInt ( ) ) != ( ( int ) ( checksum . getValue ( ) ) ) ) throw new CorruptedBlockException ( getPath ( ) , chunkOffset , chunkSize ) ; checksum . reset ( ) ; validBufferBytes = realMark . bufferOffset ; bufferOffset = ( current ) - ( validBufferBytes ) ; chunkCount = ( realMark . nextChunkIndex ) - 1 ; truncate ( chunkOffset ) ; metadataWriter . resetAndTruncate ( realMark . nextChunkIndex ) ; } private void seekToChunkStart ( ) throws IOException { } @ Override public void close ( ) throws IOException { } protected static class CompressedFileWriterMark implements FileMark { long chunkOffset ; long uncDataOffset ; int bufferOffset ; int nextChunkIndex ; public CompressedFileWriterMark ( long chunkOffset , long uncDataOffset , int bufferOffset , int nextChunkIndex ) { } } }

Fix:
out . readFully ( compressed , 0 , chunkSize ) ;
Buggy code:
public class SnappyDecompressor { private static final int TAG_MASK = 3 ; public static final int BLOCK_SIZE = 32768 ; private final byte [ ] decompressBuf ; private int decompressBufIndex ; protected final int blockSize ; protected final InputStream in ; protected final int size ; public SnappyDecompressor ( final byte [ ] buf ) throws IOException { } public SnappyDecompressor ( final byte [ ] buf , int blockSize ) throws IOException { } public SnappyDecompressor ( final InputStream is ) throws IOException { } public SnappyDecompressor ( final InputStream is , final int blockSize ) throws IOException { } public void decompress ( final OutputStream os ) throws IOException { } private void flushDecompressBuffer ( final OutputStream os ) throws IOException { os . write ( decompressBuf , 0 , this . blockSize ) ; <START_BUG> System . arraycopy ( decompressBuf , SnappyDecompressor . BLOCK_SIZE , decompressBuf , 0 , this . blockSize ) ; <END_BUG> decompressBufIndex -= this . blockSize ; } private boolean expandLiteral ( final int length ) throws IOException { } private boolean expandCopy ( final int offset , int length ) throws IOException { } private int readOneByte ( ) throws IOException { } private long readSize ( ) throws IOException { } public int getSize ( ) { } }

Fix:
System . arraycopy ( decompressBuf , blockSize , decompressBuf , 0 , this . blockSize ) ;
Buggy code:
public class MultiOrbInitialContextFactory implements InitialContextFactory , ObjectFactory { public Context getInitialContext ( Hashtable env ) throws NamingException { if ( TraceCarol . isDebugJndiCarol ( ) ) { TraceCarol . debugJndiCarol ( "MultiOrbInitialContextFactory.getInitialContext(Hashtable<seq2seq4repair_space>env)" ) ; } <START_BUG> return new MultiOrbInitialContext ( ) ; <END_BUG> } public Object getObjectInstance ( Object ref , Name name , Context nameCtx , Hashtable env ) throws NamingException { } }

Fix:
return new ContextWrapper ( env ) ;
Buggy code:
public abstract class AbstractServicePublicationTest extends ECFAbstractTestCase implements ECFServicePublication , ECFServiceConstants { protected static void assertStringsEqual ( final String [ ] s1 , final String [ ] s2 ) { } protected IContainer container ; protected String [ ] ifaces ; protected abstract IContainer createContainer ( ) throws Exception { } protected abstract String [ ] createInterfaces ( ) throws Exception { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public IContainer getContainer ( ) { } public String [ ] getInterfaces ( ) { } public void setContainer ( IContainer container ) { } public void testServicePublication ( ) throws InterruptedException { final BundleContext context = Activator . getDefault ( ) . getContext ( ) ; final Dictionary props = new Hashtable ( ) ; props . put ( OSGI_REMOTE_INTERFACES , getInterfaces ( ) ) ; final ServiceTracker tracker = new ServiceTracker ( context , TestServiceInterface1 . class . getName ( ) , null ) ; tracker . open ( ) ; context . registerService ( TestServiceInterface1 . class . getName ( ) , new TestService1 ( ) , props ) ; tracker . waitForService ( 1000 ) ; final ServiceReference ref = context . getServiceReference ( ServicePublication . class . getName ( ) ) ; assertTrue ( ( ref != null ) ) ; final Object o = ref . getProperty ( PROP_KEY_SERVICE_INTERFACE_NAME ) ; assertTrue ( ( o instanceof Collection ) ) ; final Collection refIfaces = ( ( Collection ) ( o ) ) ; AbstractServicePublicationTest . assertStringsEqual ( getInterfaces ( ) , ( ( String [ ] ) ( refIfaces . toArray ( new String [ ] { } ) ) ) ) ; <START_BUG> Thread . sleep ( 50000 ) ; <END_BUG> } public void setInterfaces ( String [ ] interfaces ) { } }

Fix:
Thread . sleep ( 10000 ) ;
Buggy code:
public class DifferentiableMultivariateMultiStartOptimizerTest { @ Test public void testCircleFitting ( ) { DifferentiableMultivariateMultiStartOptimizerTest . Circle circle = new DifferentiableMultivariateMultiStartOptimizerTest . Circle ( ) ; circle . addPoint ( 30.0 , 68.0 ) ; circle . addPoint ( 50.0 , ( - 6.0 ) ) ; circle . addPoint ( 110.0 , ( - 20.0 ) ) ; circle . addPoint ( 35.0 , 15.0 ) ; circle . addPoint ( 45.0 , 97.0 ) ; <START_BUG> NonLinearConjugateGradientOptimizer underlying = new NonLinearConjugateGradientOptimizer ( ConjugateGradientFormula . POLAK_RIBIERE , new SimpleScalarValueChecker ( 1.0E-10 , 1.0E-10 ) ) ; <END_BUG> JDKRandomGenerator g = new JDKRandomGenerator ( ) ; g . setSeed ( 753289573253L ) ; RandomVectorGenerator generator = new UncorrelatedRandomVectorGenerator ( new double [ ] { 50.0 , 50.0 } , new double [ ] { 10.0 , 10.0 } , new org . apache . commons . math . random . GaussianRandomGenerator ( g ) ) ; DifferentiableMultivariateMultiStartOptimizer optimizer = new DifferentiableMultivariateMultiStartOptimizer ( underlying , 10 , generator ) ; PointValuePair optimum = optimizer . optimize ( 200 , circle , MINIMIZE , new double [ ] { 98.68 , 47.345 } ) ; Assert . assertEquals ( 200 , optimizer . getMaxEvaluations ( ) ) ; PointValuePair [ ] optima = optimizer . getOptima ( ) ; for ( PointValuePair o : optima ) { Point2D . Double center = new Point2D . Double ( o . getPointRef ( ) [ 0 ] , o . getPointRef ( ) [ 1 ] ) ; Assert . assertEquals ( 69.960161753 , circle . getRadius ( center ) , 1.0E-8 ) ; Assert . assertEquals ( 96.075902096 , center . x , 1.0E-8 ) ; Assert . assertEquals ( 48.135167894 , center . y , 1.0E-8 ) ; } Assert . assertTrue ( ( ( optimizer . getEvaluations ( ) ) > 70 ) ) ; Assert . assertTrue ( ( ( optimizer . getEvaluations ( ) ) < 90 ) ) ; Assert . assertEquals ( 3.1267527 , optimum . getValue ( ) , 1.0E-8 ) ; } private static class Circle implements DifferentiableMultivariateFunction { private ArrayList < Point2D . Double > points ; public Circle ( ) { } public void addPoint ( double px , double py ) { } public double getRadius ( Point2D . Double center ) { } private double [ ] gradient ( double [ ] point ) { } public double value ( double [ ] variables ) { } public MultivariateVectorFunction gradient ( ) { } public MultivariateFunction partialDerivative ( final int k ) { } } }

Fix:
NonLinearConjugateGradientOptimizer underlying = new NonLinearConjugateGradientOptimizer ( ConjugateGradientFormula . POLAK_RIBIERE , new SimpleValueChecker ( 1.0E-10 , 1.0E-10 ) ) ;
Buggy code:
public class ecoDrop { private Material item ; private byte data ; private int maxAmount ; private int minAmount ; private Double percentage ; private Boolean isFixedDrops ; private Set < ecoDrop . ecoEnchantment > enchantments ; private Random random = new Random ( ) ; public ecoDrop ( ) { } class ecoEnchantment { private Enchantment enchantment ; private int level ; public Enchantment getEnchantment ( ) { } public void setEnchantment ( Enchantment enchantment ) { } public int getLevel ( ) { } public void setLevel ( int level ) { } } public Material getItem ( ) { } public void setItem ( Material item ) { } public int getData ( ) { } public void setData ( byte data ) { } public int getMaxAmount ( ) { } public void setMaxAmount ( int maxAmount ) { } public int getMinAmount ( ) { } public void setMinAmount ( int minAmount ) { } public Double getPercentage ( ) { } public void setPercentage ( Double percentage ) { } public Boolean getIsFixedDrops ( ) { } public void setIsFixedDrops ( Boolean isFixedDrops ) { } public void addEnchantment ( Enchantment enchantment , int level ) { } public ItemStack computeItemStack ( ) { <START_BUG> if ( ( ( ( random . nextDouble ( ) ) * 100.0 ) + 1 ) < ( percentage ) ) { <END_BUG> int dropAmount = ( isFixedDrops ) ? maxAmount : ( minAmount ) + ( random . nextInt ( Math . abs ( ( ( ( maxAmount ) - ( minAmount ) ) + 1 ) ) ) ) ; if ( dropAmount > 0 ) { ItemStack itemStack ; if ( ( data ) == 0 ) { itemStack = new ItemStack ( item , dropAmount ) ; } else { MaterialData materialData = new MaterialData ( item , data ) ; itemStack = materialData . toItemStack ( dropAmount ) ; } for ( ecoDrop . ecoEnchantment e : enchantments ) { itemStack . addEnchantment ( e . getEnchantment ( ) , e . getLevel ( ) ) ; } if ( ( itemStack . getAmount ( ) ) > 0 ) { return itemStack ; } } } return null ; } @ Override public String toString ( ) { } }

Fix:
if ( ( Math . round ( ( ( Math . random ( ) ) * 100.0 ) ) ) < ( percentage ) ) {
Buggy code:
class ErrorContextHandler { private static final String INDEX_HTML = "index.html" ; private static final String INDEX_WIN_HTML = "index_win.html" ; private static final String ERROR_MODULE = "org.jboss.as.domain-http-error-context" ; static final String ERROR_CONTEXT = "//error" ; private static final String DEFAULT_RESOURCE ; private ErrorContextHandler ( ) { } public static HttpHandler createErrorContext ( final String slot ) throws ModuleLoadException { final ClassPathResourceManager cpresource = new ClassPathResourceManager ( ErrorContextHandler . getClassLoader ( Module . getCallerModuleLoader ( ) , ErrorContextHandler . ERROR_MODULE , slot ) , "" ) ; final ResourceHandler handler = new ResourceHandler ( ) . setAllowed ( Predicates . not ( Predicates . path ( "META-INF" ) ) ) . setResourceManager ( cpresource ) . setDirectoryListingEnabled ( false ) . setCachable ( Predicates . < HttpServerExchange > falsePredicate ( ) ) ; <START_BUG> PredicateHandler predicateHandler = new PredicateHandler ( Predicates . path ( "//" ) , new RedirectHandler ( ( ( ErrorContextHandler . ERROR_CONTEXT ) + ( ErrorContextHandler . DEFAULT_RESOURCE ) ) ) , handler ) ; <END_BUG> return predicateHandler ; } private static ClassLoader getClassLoader ( final ModuleLoader moduleLoader , final String module , final String slot ) throws ModuleLoadException { } }

Fix:
PredicateHandler predicateHandler = new PredicateHandler ( Predicates . path ( "" ) , new RedirectHandler ( ( ( ErrorContextHandler . ERROR_CONTEXT ) + ( ErrorContextHandler . DEFAULT_RESOURCE ) ) ) , handler ) ;
Buggy code:
public class BuildNotifier { protected IProgressMonitor monitor ; protected int rootPathLength ; protected boolean cancelling ; protected float percentComplete ; protected float progressPerCompilationUnit ; protected int newErrorCount ; protected int fixedErrorCount ; protected int newWarningCount ; protected int fixedWarningCount ; protected int workDone ; protected int totalWork ; protected String previousSubtask ; public BuildNotifier ( IProgressMonitor monitor , IProject project ) { } public void aboutToCompile ( ICompilationUnit unit ) { } public void begin ( ) { } public void checkCancel ( ) { } public void checkCancelWithinCompiler ( ) { } public void compiled ( ICompilationUnit unit ) { } public void done ( ) { } protected String problemsMessage ( ) { int numNew = ( newErrorCount ) + ( newWarningCount ) ; int numFixed = ( fixedErrorCount ) + ( fixedWarningCount ) ; if ( ( numNew == 0 ) && ( numFixed == 0 ) ) return "" ; if ( numFixed == 0 ) return ( '(' + ( numNew == 1 ? Util . bind ( "build.oneProblemFound" , String . valueOf ( numNew ) ) : Util . bind ( "build.problemsFound" , String . valueOf ( numNew ) ) ) ) + ')' ; if ( numNew == 0 ) return ( '(' + ( numFixed == 1 ? Util . bind ( "build.oneProblemFixed" , String . valueOf ( numFixed ) ) : Util . bind ( "build.problemsFixed" , String . valueOf ( numFixed ) ) ) ) + ')' ; <START_BUG> return ( ( ( '(' + ( numFixed == 1 ? Util . bind ( "build.oneProblemFixed" , String . valueOf ( numFixed ) ) : Util . bind ( "build.problemsFixed" , String . valueOf ( numFixed ) ) ) ) + '<seq2seq4repair_space>' ) + ( numNew == 1 ? Util . bind ( "build.oneProblemFound" , String . valueOf ( numNew ) ) : Util . bind ( "build.problemsFound" , String . valueOf ( numNew ) ) ) ) + ')' ; <END_BUG> } public void setCancelling ( boolean cancelling ) { } public void setProgressPerCompilationUnit ( float progress ) { } public void subTask ( String message ) { } protected void updateProblemCounts ( IProblem [ ] newProblems ) { } protected void updateProblemCounts ( IMarker [ ] oldProblems , IProblem [ ] newProblems ) { } public void updateProgress ( float percentComplete ) { } public void updateProgressDelta ( float percentWorked ) { } }

Fix:
return ( ( ( '(' + ( numFixed == 1 ? Util . bind ( "build.oneProblemFixed" , String . valueOf ( numFixed ) ) : Util . bind ( "build.problemsFixed" , String . valueOf ( numFixed ) ) ) ) + ",<seq2seq4repair_space>" ) + ( numNew == 1 ? Util . bind ( "build.oneProblemFound" , String . valueOf ( numNew ) ) : Util . bind ( "build.problemsFound" , String . valueOf ( numNew ) ) ) ) + ')' ;
Buggy code:
public class PolymorphicResolverTest { @ Test public void testWithoutGuards ( ) { } private Collection < Function > getCandidates ( Object ... params ) { final FunctionDefContextImpl fdc = ( ( FunctionDefContextImpl ) ( createEmptyFdc ( new CompositeTypesystem ( ) ) ) ) ; <START_BUG> return new org . eclipse . xtend . backend . functions . internal . PolymorphicResolver ( new QualifiedName ( "operatorPlus" ) ) . getBestFitCandidates ( fdc . findFunctionCandidates ( new QualifiedName ( "operatorPlus" ) , fdc . typesForParameters ( createEmptyExecutionContext ( ) . getTypesystem ( ) , Arrays . asList ( params ) ) ) ) ; <END_BUG> } }

Fix:
return new org . eclipse . xtend . backend . functions . internal . PolymorphicResolver ( new QualifiedName ( "operatorPlus" ) ) . getBestFitCandidates ( fdc . findFunctionCandidates ( new QualifiedName ( "operatorPlus" ) , fdc . typesForParameters ( createEmptyExecutionContext ( ) . getTypesystem ( ) , Arrays . asList ( params ) ) , false ) ) ;