nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class RundeckAPITaskBase implements TaskType { public BuildLogger buildLogger ; private TaskContext taskContext ; private void setTaskContext ( TaskContext taskContext ) { } private Map variableDefinitions ; private void setVariableDefinitions ( ) { } private boolean rundeckDisable = false ; private void setRundeckDisable ( ) throws TaskException { } private String rundeckUrl ; private void setRundeckUrl ( ) throws TaskException { } private String rundeckApiToken ; private void setRundeckApiToken ( ) throws TaskException { } private String rundeckApiUser ; private void setRundeckApiUser ( ) throws TaskException { } private String rundeckApiPassword ; private void setRundeckApiPassword ( ) throws TaskException { } private String rundeckJobId ; private void setRundeckJobId ( ) throws TaskException { } private Properties jobArgProperties ; private void setJobArgProperties ( ) throws TaskException { } private RundeckClient getRundeckClient ( ) throws TaskException { } private TaskResult runJob ( ) throws TaskException { setRundeckDisable ( ) ; if ( ( rundeckDisable ) != true ) { setRundeckJobId ( ) ; setJobArgProperties ( ) ; RundeckClient rc = getRundeckClient ( ) ; buildLogger . addBuildLogEntry ( "pinging<seq2seq4repair_space>rundeck<seq2seq4repair_space>server" ) ; rc . ping ( ) ; buildLogger . addBuildLogEntry ( ( ( ( "running<seq2seq4repair_space>rundeck<seq2seq4repair_space>job,<seq2seq4repair_space>jobId:<seq2seq4repair_space>" + ( rundeckJobId ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>argProperties:<seq2seq4repair_space>" ) + ( jobArgProperties . toString ( ) ) ) ) ; rc . runJob ( rundeckJobId , jobArgProperties ) ; } else { <START_BUG> buildLogger . addBuildLogEntry ( ( ( ( "rundeck<seq2seq4repair_space>integration<seq2seq4repair_space>disabled,<seq2seq4repair_space>NOT<seq2seq4repair_space>running<seq2seq4repair_space>rundeck<seq2seq4repair_space>job,<seq2seq4repair_space>jobId:<seq2seq4repair_space>" + ( rundeckJobId ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>argProperties:<seq2seq4repair_space>" ) + ( jobArgProperties . toString ( ) ) ) ) ; <END_BUG> } return TaskResultBuilder . create ( taskContext ) . success ( ) . build ( ) ; } public TaskResult executeUserPassStrategy ( @ NotNull final TaskContext taskContext ) throws TaskException { } public TaskResult executeTokenStrategy ( @ NotNull final TaskContext taskContext ) throws TaskException { } public abstract TaskResult execute ( @ NotNull final TaskContext taskContext ) throws TaskException { } }

Fix:
buildLogger . addBuildLogEntry ( "rundeck<seq2seq4repair_space>integration<seq2seq4repair_space>disabled,<seq2seq4repair_space>NOT<seq2seq4repair_space>running<seq2seq4repair_space>rundeck<seq2seq4repair_space>job" ) ;
Buggy code:
public class BookmarksFolderAssetRenderer extends BaseAssetRenderer implements TrashRenderer { public static final String TYPE = "bookmarks_folder" ; public BookmarksFolderAssetRenderer ( BookmarksFolder folder ) { } @ Override public String getClassName ( ) { } @ Override public long getClassPK ( ) { } @ Override public Date getDisplayDate ( ) { } @ Override public long getGroupId ( ) { } @ Override public String getIconCssClass ( ) throws PortalException { if ( ( BookmarksFolderServiceUtil . getFoldersAndEntriesCount ( _folder . getGroupId ( ) , _folder . getFolderId ( ) ) ) > 0 ) { <START_BUG> return "icon-folder-close" ; <END_BUG> } return super . getIconCssClass ( ) ; } @ Override public String getIconPath ( ThemeDisplay themeDisplay ) { } @ Override public String getPortletId ( ) { } @ Override public String getSummary ( PortletRequest portletRequest , PortletResponse portletResponse ) { } @ Override public String getThumbnailPath ( PortletRequest portletRequest ) throws Exception { } @ Override public String getTitle ( Locale locale ) { } @ Override public String getType ( ) { } @ Override public PortletURL getURLEdit ( LiferayPortletRequest liferayPortletRequest , LiferayPortletResponse liferayPortletResponse ) throws Exception { } @ Override public PortletURL getURLView ( LiferayPortletResponse liferayPortletResponse , WindowState windowState ) throws Exception { } @ Override public String getURLViewInContext ( LiferayPortletRequest liferayPortletRequest , LiferayPortletResponse liferayPortletResponse , String noSuchEntryRedirect ) { } @ Override public long getUserId ( ) { } @ Override public String getUserName ( ) { } @ Override public String getUuid ( ) { } @ Override public boolean hasEditPermission ( PermissionChecker permissionChecker ) throws PortalException { } @ Override public boolean hasViewPermission ( PermissionChecker permissionChecker ) throws PortalException { } @ Override public String render ( RenderRequest renderRequest , RenderResponse renderResponse , String template ) throws Exception { } private final BookmarksFolder _folder ; No newline ; at end ; of file ; }

Fix:
return "icon-folder-open" ;
Buggy code:
public class VistaReservarHabitacio { public void mostraPoblacions ( HashSet < String > pb ) { } <START_BUG> public void mostraHotels ( HotelInformation hotels ) { <END_BUG> View2 . getWindows ( ) [ 0 ] . dispose ( ) ; View3 v = new View3 ( hotels ) ; v . setVisible ( true ) ; } public void mostraPreu ( ReservaInformation res ) { } public void mostraDadesClient ( ReservaInformation dades ) { } public void mostraMissatgeFi ( ) { } public void mostraMissatge ( String nomView , String text ) { } public void tancar ( ) { } }

Fix:
public void mostraHotels ( HashSet < HotelInformation > hotels ) {
Buggy code:
public class DefaultExecManager implements ExecManager { private final ProcessDestroyer m_processDestroyer = new ProcessDestroyer ( ) ; private final CommandLauncher m_launcher ; private final CommandLauncher m_shellLauncher ; public DefaultExecManager ( final File antDir ) throws ExecException { } public int execute ( final ExecMetaData metaData , final InputStream input , final OutputStream output , final OutputStream error , final long timeout ) throws IOException , ExecException { } private void waitFor ( final Process process ) { } private CommandLauncher getLauncher ( final ExecMetaData metaData ) { } private CommandLauncher createShellLauncher ( final File antDir ) throws ExecException { CommandLauncher launcher = null ; if ( Os . isFamily ( "mac" ) ) { launcher = new MacCommandLauncher ( ) ; } else if ( Os . isFamily ( "os//2" ) ) { launcher = new WinNTCommandLauncher ( ) ; } else if ( Os . isFamily ( "windows" ) ) { final String osname = System . getProperty ( "os.name" ) . toLowerCase ( Locale . US ) ; if ( ( ( osname . indexOf ( "nt" ) ) >= 0 ) || ( ( osname . indexOf ( "2000" ) ) >= 0 ) ) { launcher = new WinNTCommandLauncher ( ) ; } else { final String script = resolveCommand ( antDir , "bin//antRun.bat" ) ; launcher = new ScriptCommandLauncher ( script ) ; } } else <START_BUG> if ( new Os ( "netware" ) . eval ( ) ) { <END_BUG> final String perlScript = resolveCommand ( antDir , "bin//antRun.pl" ) ; final String [ ] script = new String [ ] { "perl" , perlScript } ; launcher = new ScriptCommandLauncher ( script ) ; } else { final String script = resolveCommand ( antDir , "bin//antRun" ) ; launcher = new ScriptCommandLauncher ( script ) ; } return launcher ; } private String resolveCommand ( final File antDir , final String command ) { } }

Fix:
if ( Os . isFamily ( "netware" ) ) {
Buggy code:
public class ServerModelDeploymentStartStopUpdate extends AbstractServerModelUpdate < Void > { private static final long serialVersionUID = 5773083013951607950L ; private final ServerDeploymentStartStopHandler startStopHandler ; private ServerGroupDeploymentElement deploymentElement ; private final String deploymentUnitName ; private final boolean isStart ; public ServerModelDeploymentStartStopUpdate ( final String deploymentUnitName , boolean isStart ) { } public String getDeploymentUnitName ( ) { } @ Override public ServerModelDeploymentStartStopUpdate getCompensatingUpdate ( ServerModel original ) { } @ Override public void applyUpdate ( ServerModel serverModel ) throws UpdateFailedException { } @ Override public < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > resultHandler , final P param ) { if ( ( deploymentElement ) != null ) { if ( isStart ) { <START_BUG> startStopHandler . deploy ( deploymentElement . getUniqueName ( ) , deploymentElement . getRuntimeName ( ) , deploymentElement . getSha1Hash ( ) , updateContext . getBatchBuilder ( ) , updateContext . getServiceContainer ( ) , resultHandler , param ) ; <END_BUG> } else { startStopHandler . undeploy ( getDeploymentUnitName ( ) , updateContext . getServiceContainer ( ) , resultHandler , param ) ; } } else if ( resultHandler != null ) { resultHandler . handleSuccess ( null , param ) ; } } }

Fix:
startStopHandler . deploy ( deploymentElement . getUniqueName ( ) , deploymentElement . getRuntimeName ( ) , deploymentElement . getSha1Hash ( ) , updateContext . getServiceTarget ( ) , updateContext . getServiceContainer ( ) , resultHandler , param ) ;
Buggy code:
public final class DeferredAttrNSImpl extends AttrNSImpl implements DeferredNode { static final long serialVersionUID = 6074924934945957154L ; protected transient int fNodeIndex ; DeferredAttrNSImpl ( DeferredDocumentImpl ownerDocument , int nodeIndex ) { } public int getNodeIndex ( ) { } protected void synchronizeData ( ) { } protected void synchronizeChildren ( ) { syncChildren = false ; DeferredDocumentImpl ownerDocument = ( ( DeferredDocumentImpl ) ( this . ownerDocument ) ) ; NodeImpl last = null ; for ( int index = ownerDocument . getFirstChild ( fNodeIndex ) ; index != ( - 1 ) ; index = ownerDocument . getNextSibling ( index ) ) { NodeImpl node = ( ( NodeImpl ) ( ownerDocument . getNodeObject ( index ) ) ) ; if ( last == null ) { firstChild = node ; } else { last . nextSibling = node ; } <START_BUG> node . parentNode = this ; <END_BUG> node . previousSibling = last ; last = node ; } if ( last != null ) { lastChild = last ; } } }

Fix:
node . ownerNode = this ;
Buggy code:
public class TreeColumn extends Item { Tree parent ; String displayText = "" ; int width ; int itemImageWidth ; boolean moveable ; boolean resizable = true ; int sort = SWT . NONE ; String toolTipText ; public TreeColumn ( Tree parent , int style ) { } public TreeColumn ( Tree parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static Tree checkNull ( Tree tree ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void computeDisplayText ( GC gc ) { } public void dispose ( ) { } void dispose ( boolean notifyParent ) { } public int getAlignment ( ) { } int getContentWidth ( GC gc , boolean useDisplayText ) { } int getIndex ( ) { } public boolean getMoveable ( ) { } int getOrderIndex ( ) { } public Tree getParent ( ) { } int getPreferredWidth ( ) { } public boolean getResizable ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } int getX ( ) { } void paint ( GC gc ) { } public void pack ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image value ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean value ) { } void setSortDirection ( int value ) { } public void setText ( String value ) { } public void setToolTipText ( String string ) { } public void setWidth ( int value ) { checkWidget ( ) ; <START_BUG> if ( ( width ) < 0 ) <END_BUG> return ; if ( ( width ) == value ) return ; parent . updateColumnWidth ( this , value ) ; } void updateWidth ( GC gc ) { } void updateFont ( GC gc ) { } }

Fix:
if ( value < 0 )
Buggy code:
class ServerInventoryService implements Service < ServerInventory > { static final ServiceName SERVICE_NAME = JBOSS . append ( "host" , "controller" , "server-inventory" ) ; private final InjectedValue < ProcessControllerConnectionService > client = new InjectedValue < ProcessControllerConnectionService > ( ) ; private final InjectedValue < NetworkInterfaceBinding > interfaceBinding = new InjectedValue < NetworkInterfaceBinding > ( ) ; private final DomainController domainController ; private final HostControllerEnvironment environment ; private final HostRunningModeControl runningModeControl ; private final int port ; private final InjectedValue < ExecutorService > executorService = new InjectedValue < ExecutorService > ( ) ; private final ServerInventoryService . FutureServerInventory futureInventory = new ServerInventoryService . FutureServerInventory ( ) ; private ServerInventoryImpl serverInventory ; private ServerInventoryService ( final DomainController domainController , final HostRunningModeControl runningModeControl , final HostControllerEnvironment environment , final int port ) { } static Future < ServerInventory > install ( final ServiceTarget serviceTarget , final DomainController domainController , final HostRunningModeControl runningModeControl , final HostControllerEnvironment environment , final String interfaceBinding , final int port ) { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override public synchronized void stop ( final StopContext context ) { if ( ( runningModeControl . getRestartMode ( ) ) == ( RestartMode . SERVERS ) ) { context . asynchronous ( ) ; Runnable r = new Runnable ( ) { @ Override public void run ( ) { try { <START_BUG> serverInventory . stopServers ( ( - 1 ) , true ) ; <END_BUG> serverInventory = null ; } finally { context . complete ( ) ; } } } ; executorService . getValue ( ) . execute ( r ) ; } } @ Override public synchronized ServerInventory getValue ( ) throws IllegalArgumentException , IllegalStateException { } InjectedValue < ProcessControllerConnectionService > getClient ( ) { } private class FutureServerInventory extends AsyncFutureTask < ServerInventory > { protected FutureServerInventory ( ) { } private void setInventory ( ServerInventory inventory ) { } private void setFailure ( final Throwable t ) { } } }

Fix:
serverInventory . shutdown ( ( - 1 ) , true ) ;
Buggy code:
public class NodeListIterator implements Iterator < Node > { private final NodeList nodeList ; private int index = 0 ; public NodeListIterator ( final Node node ) { } public NodeListIterator ( final NodeList nodeList ) { } public boolean hasNext ( ) { } public Node next ( ) { } public void remove ( ) { <START_BUG> throw new UnsupportedOperationException ( "remove()<seq2seq4repair_space>method<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>NodeListIterator." ) ; <END_BUG> } }

Fix:
throw new UnsupportedOperationException ( "remove()<seq2seq4repair_space>method<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>NodeListIterator." ) ;
Buggy code:
public class ClientDriver { public static void main ( String [ ] args ) throws Exception { <START_BUG> MessageHandler . loadMessageHandlers ( Arrays . asList ( "client.protocols" ) ) ; <END_BUG> Chat chat = new Chat ( ) ; chat . announce ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>server..." ) ; Socket socket = new Socket ( "localhost" , 1234 ) ; ConnectionToChatServerHandler serverConnection = new ConnectionToChatServerHandler ( socket , chat ) ; serverConnection . start ( ( ) -> { try { chat . start ( serverConnection ) ; } catch ( ex ) { Logger . getLogger ( . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } , serverConnection ) ; } }

Fix:
MessageHandler . loadMessageHandlers ( Arrays . asList ( "com.hoten.servingchat.client.protocols" ) ) ;
Buggy code:
public class ReferenceDAODBImpl implements ReferenceDAO { @ Override public List < Reference > getReferences ( ) { } @ Override public List < Reference > getReferencesByName ( String name ) { } @ Override public Reference getReferenceById ( int id ) { Dbc . open ( ) ; System . out . println ( id ) ; ProjectReference pr = ProjectReference . findFirst ( "id<seq2seq4repair_space>=<seq2seq4repair_space>?" , id ) ; Set < Attribute > attributesSet = loadAttributes ( pr ) ; Set < String > tagsSet = loadTags ( pr ) ; Date dateCreated = new Date ( pr . getTimestamp ( "created_at" ) . getTime ( ) ) ; <START_BUG> Date dateUpdated = new Date ( pr . getTimestamp ( "created_at" ) . getTime ( ) ) ; <END_BUG> Reference reference = new Reference ( pr . parent ( ReferenceTypeDb . class ) . getString ( "name" ) , pr . getString ( "bibtextname" ) , dateCreated , dateUpdated , attributesSet , tagsSet ) ; reference . setId ( pr . getLongId ( ) . intValue ( ) ) ; Dbc . close ( ) ; return reference ; } private Set < Attribute > loadAttributes ( ProjectReference pr ) { } private Set < String > loadTags ( ProjectReference pr ) { } @ Override public Reference addReference ( Reference reference ) { } @ Override public Reference updateReference ( int id , Reference reference ) { } @ Override public boolean deleteReference ( int id ) { } private void deleteAttributes ( ProjectReference pr ) { } private void deleteTags ( ProjectReference pr ) { } private void insertReference ( Reference reference , ProjectReference pr ) { } private void insertTags ( Reference r , ProjectReference pr ) { } private void insertAttributes ( Reference r , ProjectReference pr ) { } }

Fix:
Date dateUpdated = new Date ( pr . getTimestamp ( "updated_at" ) . getTime ( ) ) ;
Buggy code:
public class AlarmListActivity extends DaybreakBaseActivity { @ Inject AlarmHelper alarmHelper ; private AlarmListAdapter adapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( alarm_list ) ; ListView alarmList = ( ( ListView ) ( findViewById ( R . id . alarm_list ) ) ) ; <START_BUG> adapter = new AlarmListAdapter ( this , layout . alarm_list_item , alarmHelper . getAll ( ) ) ; <END_BUG> alarmList . setAdapter ( adapter ) ; alarmList . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { showAlarm ( id ) ; } } ) ; } public void addAlarm ( View view ) { } public void deleteAlarm ( View view ) { } public void showAlarm ( long id ) { } }

Fix:
adapter = new AlarmListAdapter ( this , alarmHelper . getAll ( ) ) ;
Buggy code:
public class TestPortugueseStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testExamples ( ) throws IOException { } public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class ContactTest { ContactImpl contact ; @ Before public void buildUp ( ) { } @ Test public void tests_getID_returns_ContactID ( ) { int expected = 100 ; <START_BUG> assertEquals ( expected , contact . getID ( ) ) ; <END_BUG> } @ Test public void tests_getName_returns_ContactName ( ) { } @ Test public void tests_getNotes_returns_NULL_ifNoNotes_returnsNotes_ifNotesAdded ( ) { } }

Fix:
assertEquals ( expected , contact . getId ( ) ) ;
Buggy code:
public class LocalizedFormatsTest { @ Test public void testMessageNumber ( ) { <START_BUG> Assert . assertEquals ( 317 , LocalizedFormats . values ( ) . length ) ; <END_BUG> } @ Test public void testAllKeysPresentInPropertiesFiles ( ) { } @ Test public void testAllPropertiesCorrespondToKeys ( ) { } @ Test public void testNoMissingFrenchTranslation ( ) { } @ Test public void testNoOpEnglishTranslation ( ) { } @ Test public void testVariablePartsConsistency ( ) { } }

Fix:
Assert . assertEquals ( 318 , LocalizedFormats . values ( ) . length ) ;
Buggy code:
public class ModClusterGetProxyConfiguration implements OperationStepHandler , DescriptionProvider { static final ModClusterGetProxyConfiguration INSTANCE = new ModClusterGetProxyConfiguration ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; Map < InetSocketAddress , String > map = modcluster . getProxyConfiguration ( ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "Mod_cluster<seq2seq4repair_space>ProxyConfiguration<seq2seq4repair_space>%s" , map ) ; if ( ! ( map . isEmpty ( ) ) ) { final ModelNode result = new ModelNode ( ) ; Object [ ] addr = map . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < ( addr . length ) ; i ++ ) { InetSocketAddress address = ( ( InetSocketAddress ) ( addr [ i ] ) ) ; result . add ( ( ( ( address . getHostName ( ) ) + ":" ) + ( address . getPort ( ) ) ) ) ; result . add ( map . get ( addr [ i ] ) ) ; } context . getResult ( ) . set ( result ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class JavaGeneratorTool { public static final String manglePackage ( String s ) { for ( int i = 0 ; i < ( JavaGeneratorTool . keywords . length ) ; i ++ ) { char fs = File . separatorChar ; int index = s . indexOf ( JavaGeneratorTool . keywords [ i ] ) ; if ( index == ( - 1 ) ) continue ; while ( index != ( - 1 ) ) { int endIdx = index + ( JavaGeneratorTool . keywords [ i ] . length ( ) ) ; if ( ( index > 0 ) && ( ( s . charAt ( ( index - 1 ) ) ) != '//' ) ) { index = s . indexOf ( JavaGeneratorTool . keywords [ i ] , ( index + 3 ) ) ; continue ; } <START_BUG> if ( ( ( s . length ( ) ) >= endIdx ) && ( ( s . charAt ( endIdx ) ) != '//' ) ) { <END_BUG> index = s . indexOf ( JavaGeneratorTool . keywords [ i ] , ( index + 3 ) ) ; continue ; } String tmpathName = ( s . substring ( 0 , index ) ) + "_" ; s = tmpathName + ( s . substring ( index ) ) ; index = s . indexOf ( JavaGeneratorTool . keywords [ i ] , ( index + 2 ) ) ; } } s = JavaGeneratorTool . fixDigits ( s ) ; return s ; } public static boolean isKeyword ( String s ) { } public static String fixDigits ( String s ) { } public static int readVersion ( String classDir , String baseClassName ) { } public static void writeVersion ( String classDir , String baseClassName , int version ) { } public static String getVersionedName ( String baseName , int version ) { } private static final String [ ] keywords = new String [ ] { "abstract" , "boolean" , "break" , "byte" , "case" , "catch" , "char" , "class" , "const" , "continue" , "default" , "do" , "double" , "else" , "extends" , "final" , "finally" , "float" , "for" , "goto" , "if" , "implements" , "import" , "instanceof" , "int" , "interface" , "long" , "native" , "new" , "package" , "private" , "protected" , "public" , "return" , "short" , "static" , "super" , "switch" , "synchronized" , "this" , "throw" , "throws" , "transient" , "try" , "void" , "volatile" , "while" } ; }

Fix:
if ( ( ( s . length ( ) ) > endIdx ) && ( ( s . charAt ( endIdx ) ) != '//' ) ) {
Buggy code:
public class MultiSelectListPreference extends DialogPreference { private CharSequence [ ] mEntries ; private CharSequence [ ] mEntryValues ; private Set < String > mValues = new HashSet < String > ( ) ; private Set < String > mNewValues = new HashSet < String > ( ) ; private boolean mPreferenceChanged ; public MultiSelectListPreference ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { } public MultiSelectListPreference ( Context context , AttributeSet attrs , int defStyleAttr ) { } public MultiSelectListPreference ( Context context , AttributeSet attrs ) { } public MultiSelectListPreference ( Context context ) { } public void setEntries ( CharSequence [ ] entries ) { } public void setEntries ( int entriesResId ) { } public CharSequence [ ] getEntries ( ) { } public void setEntryValues ( CharSequence [ ] entryValues ) { } public void setEntryValues ( int entryValuesResId ) { } public CharSequence [ ] getEntryValues ( ) { } public void setValues ( Set < String > values ) { } public Set < String > getValues ( ) { } public int findIndexOfValue ( String value ) { } @ Override protected void onPrepareDialogBuilder ( Builder builder ) { } private boolean [ ] getSelectedItems ( ) { } @ Override protected void onDialogClosed ( boolean positiveResult ) { } @ Override protected Object onGetDefaultValue ( TypedArray a , int index ) { final CharSequence [ ] defaultValues = a . getTextArray ( index ) ; <START_BUG> final int valueCount = defaultValues . length ; <END_BUG> final Set < String > result = new HashSet < String > ( ) ; for ( int i = 0 ; i < valueCount ; i ++ ) { result . add ( defaultValues [ i ] . toString ( ) ) ; } return result ; } @ Override protected void onSetInitialValue ( boolean restoreValue , Object defaultValue ) { } @ Override protected Parcelable onSaveInstanceState ( ) { } private static class SavedState extends BaseSavedState { Set < String > values ; public SavedState ( Parcel source ) { } public SavedState ( Parcelable superState ) { } @ Override public void writeToParcel ( Parcel dest , int flags ) { } public static final Parcelable . Creator < MultiSelectListPreference . SavedState > CREATOR = new Parcelable . Creator < MultiSelectListPreference . SavedState > ( ) { public android . preference . SavedState createFromParcel ( Parcel in ) { } public android . preference . SavedState [ ] newArray ( int size ) { } } ; } }

Fix:
final int valueCount = ( defaultValues != null ) ? defaultValues . length : 0 ;
Buggy code:
public class ByteConverter extends AbstractIntegerConverter < Byte > { private static final long serialVersionUID = 1L ; public static final IConverter < Byte > INSTANCE = new ByteConverter ( ) ; <START_BUG> public Byte convertToObject ( final String value , Locale locale ) { <END_BUG> final Number number = parse ( value , Byte . MIN_VALUE , Byte . MAX_VALUE , locale ) ; if ( number == null ) { return null ; } return number . byteValue ( ) ; } @ Override protected Class < Byte > getTargetType ( ) { } }

Fix:
public Byte convertToObject ( final String value , final Locale locale ) {
Buggy code:
public class TrecJudge implements Judge { HashMap < String , TrecJudge . QRelJudgement > judgements ; public TrecJudge ( BufferedReader reader ) throws IOException { } public boolean isRelevant ( String docName , QualityQuery query ) { } private static class QRelJudgement { private String queryID ; private HashMap < String , String > relevantDocs ; QRelJudgement ( String queryID ) { } public void addRelevandDoc ( String docName ) { } boolean isRelevant ( String docName ) { } public int maxRecall ( ) { } } public boolean validateData ( QualityQuery [ ] qq , PrintWriter logger ) { <START_BUG> HashMap < String , TrecJudge . QRelJudgement > missingQueries = ( ( HashMap < String , TrecJudge . QRelJudgement > ) ( judgements . clone ( ) ) ) ; <END_BUG> ArrayList < String > missingJudgements = new ArrayList < String > ( ) ; for ( int i = 0 ; i < ( qq . length ) ; i ++ ) { String id = qq [ i ] . getQueryID ( ) ; if ( missingQueries . containsKey ( id ) ) { missingQueries . remove ( id ) ; } else { missingJudgements . add ( id ) ; } } boolean isValid = true ; if ( ( missingJudgements . size ( ) ) > 0 ) { isValid = false ; if ( logger != null ) { logger . println ( ( ( "WARNING:<seq2seq4repair_space>" + ( missingJudgements . size ( ) ) ) + "<seq2seq4repair_space>queries<seq2seq4repair_space>have<seq2seq4repair_space>no<seq2seq4repair_space>judgments!<seq2seq4repair_space>-<seq2seq4repair_space>" ) ) ; for ( int i = 0 ; i < ( missingJudgements . size ( ) ) ; i ++ ) { logger . println ( ( "<seq2seq4repair_space>" + ( missingJudgements . get ( i ) ) ) ) ; } } } if ( ( missingQueries . size ( ) ) > 0 ) { isValid = false ; if ( logger != null ) { logger . println ( ( ( "WARNING:<seq2seq4repair_space>" + ( missingQueries . size ( ) ) ) + "<seq2seq4repair_space>judgments<seq2seq4repair_space>match<seq2seq4repair_space>no<seq2seq4repair_space>query!<seq2seq4repair_space>-<seq2seq4repair_space>" ) ) ; for ( final String id : missingQueries . keySet ( ) ) { logger . println ( ( "<seq2seq4repair_space>" + id ) ) ; } } } return isValid ; } public int maxRecall ( QualityQuery query ) { } }

Fix:
HashMap < String , TrecJudge . QRelJudgement > missingQueries = new HashMap < String , TrecJudge . QRelJudgement > ( judgements ) ;
Buggy code:
public class UploadPage extends WicketExamplePage { private static Log log = LogFactory . getLog ( UploadPage . class ) ; private File tempDir ; private final List files = new ArrayList ( ) ; private UploadPage . FileTable fileTable ; public UploadPage ( final PageParameters parameters ) { } private void refreshFiles ( ) { } private class UploadForm extends FileUploadForm { public UploadForm ( String name , IValidationFeedback validationErrorHandler , File targetDirectory ) { } protected void finishUpload ( ) { } } private class FileTable extends ListView { public FileTable ( String name , List object ) { } protected void populateItem ( ListItem listItem ) { final String fileName = ( ( String ) ( listItem . getModelObject ( ) ) ) ; listItem . add ( new Label ( "file" , fileName ) ) ; listItem . add ( new Link ( "delete" ) { <START_BUG> public void linkClicked ( ) { <END_BUG> File toDelete = new File ( tempDir , fileName ) ; UploadPage . log . info ( ( "delete<seq2seq4repair_space>" + toDelete ) ) ; toDelete . delete ( ) ; try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { } refreshFiles ( ) ; } } ) ; } } }

Fix:
public void onLinkClicked ( ) {
Buggy code:
public final class HighScoresParser { private HighScoresParser ( ) { } public static HighScores readHighScores ( String fileName ) { BufferedReader reader ; HighScores hs = null ; try { reader = new BufferedReader ( new FileReader ( fileName ) ) ; hs = new HighScores ( ) ; String line = reader . readLine ( ) ; while ( line != null ) { String [ ] splitted = line . split ( "," ) ; int points = Integer . parseInt ( splitted [ 0 ] ) ; String name = splitted [ 1 ] ; Score score = new Score ( points , name ) ; hs . add ( score ) ; line = reader . readLine ( ) ; } reader . close ( ) ; } catch ( IOException e ) { <START_BUG> e . printStackTrace ( ) ; <END_BUG> } return hs ; } public static void writeHighScores ( String fileName , HighScores hs ) { } public static int checkPrivateConstructor ( boolean succes ) { } No newline ; at end ; of file ; }

Fix:
System . out . println ( "exception" ) ;
Buggy code:
public class InternalErrorPage extends WebPage { private static final long serialVersionUID = 1L ; public InternalErrorPage ( ) { } @ Override protected void configureResponse ( ) { super . configureResponse ( ) ; <START_BUG> getWebRequestCycle ( ) . getWebResponse ( ) . getHttpServletResponse ( ) . setStatus ( SC_INTERNAL_SERVER_ERROR ) ; <END_BUG> } @ Override public boolean isVersioned ( ) { } @ Override public boolean isErrorPage ( ) { } }

Fix:
getRequestCycle ( ) . getWebResponse ( ) . getHttpServletResponse ( ) . setStatus ( SC_INTERNAL_SERVER_ERROR ) ;
Buggy code:
public class ServiceActivator implements org . jboss . msc . service . ServiceActivator { public void activate ( ServiceActivatorContext serviceActivatorContext ) throws ServiceRegistryException { System . out . println ( "Running" ) ; final ServiceTarget serviceTarget = serviceActivatorContext . getServiceTarget ( ) ; final LookupService rebindService = new LookupService ( "BeanWithSimpleInjected" ) ; <START_BUG> serviceTarget . addService ( JBOSS . append ( "BeanWithSimpleInjected" , "rebind" ) , rebindService ) . addDependency ( MODULE_CONTEXT_SERVICE_NAME . append ( "managedbean-example.jar" ) , Context . class , rebindService . getLookupContextInjector ( ) ) . addDependency ( JBOSS . append ( "managed" , "bean" , "managedbean-example.jar" , "BeanWithSimpleInjected" ) ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> } }

Fix:
serviceTarget . addService ( JBOSS . append ( "BeanWithSimpleInjected" , "rebind" ) , rebindService ) . addDependency ( MODULE_CONTEXT_SERVICE_NAME . append ( "managedbean-example.jar" ) , Context . class , rebindService . getLookupContextInjector ( ) ) . addDependency ( JBOSS . append ( "deployment" , "managedbean-example.jar" , "component" , "BeanWithSimpleInjected" ) ) . setInitialMode ( ACTIVE ) . install ( ) ;
Buggy code:
public final class RunListenerPrintReproduceInfo extends RunListener { private static List < String > testClassesRun = new ArrayList < String > ( ) ; private LifecycleScope scope ; private boolean testFailed ; private boolean suiteFailed ; private boolean printDiagnosticsAfterClass ; @ Override public void testRunStarted ( Description description ) throws Exception { } @ Override public void testStarted ( Description description ) throws Exception { } @ Override public void testFailure ( Failure failure ) throws Exception { } @ Override public void testFinished ( Description description ) throws Exception { } @ Override public void testRunFinished ( Result result ) throws Exception { } static void printDebuggingInformation ( ) { if ( ( LuceneTestCase . classEnvRule ) != null ) { <START_BUG> System . err . println ( ( ( ( ( ( ( ( "NOTE:<seq2seq4repair_space>test<seq2seq4repair_space>params<seq2seq4repair_space>are:<seq2seq4repair_space>codec=" + ( Codec . getDefault ( ) ) ) + ",<seq2seq4repair_space>sim=" ) + ( LuceneTestCase . classEnvRule . similarity ) ) + ",<seq2seq4repair_space>locale=" ) + ( LuceneTestCase . classEnvRule . locale ) ) + ",<seq2seq4repair_space>timezone=" ) + ( ( LuceneTestCase . classEnvRule . timeZone ) == null ? "(null)" : timeZone . getID ( ) ) ) ) ; <END_BUG> } System . err . println ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "NOTE:<seq2seq4repair_space>" + ( System . getProperty ( "os.name" ) ) ) + "<seq2seq4repair_space>" ) + ( System . getProperty ( "os.version" ) ) ) + "<seq2seq4repair_space>" ) + ( System . getProperty ( "os.arch" ) ) ) + "//" ) + ( System . getProperty ( "java.vendor" ) ) ) + "<seq2seq4repair_space>" ) + ( System . getProperty ( "java.version" ) ) ) + "<seq2seq4repair_space>" ) + ( Constants . JRE_IS_64BIT ? "(64-bit)" : "(32-bit)" ) ) + "//" ) + "cpus=" ) + ( Runtime . getRuntime ( ) . availableProcessors ( ) ) ) + "," ) + "threads=" ) + ( Thread . activeCount ( ) ) ) + "," ) + "free=" ) + ( Runtime . getRuntime ( ) . freeMemory ( ) ) ) + "," ) + "total=" ) + ( Runtime . getRuntime ( ) . totalMemory ( ) ) ) ) ; System . err . println ( ( "NOTE:<seq2seq4repair_space>All<seq2seq4repair_space>tests<seq2seq4repair_space>run<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>JVM:<seq2seq4repair_space>" + ( Arrays . toString ( RunListenerPrintReproduceInfo . testClassesRun . toArray ( ) ) ) ) ) ; } public void reportAdditionalFailureInfo ( final String testName ) { } private static String reproduceWithExtraParams ( ) { } }

Fix:
System . err . println ( ( ( ( ( ( ( ( "NOTE:<seq2seq4repair_space>test<seq2seq4repair_space>params<seq2seq4repair_space>are:<seq2seq4repair_space>codec=" + ( LuceneTestCase . classEnvRule . codec ) ) + ",<seq2seq4repair_space>sim=" ) + ( LuceneTestCase . classEnvRule . similarity ) ) + ",<seq2seq4repair_space>locale=" ) + ( LuceneTestCase . classEnvRule . locale ) ) + ",<seq2seq4repair_space>timezone=" ) + ( ( LuceneTestCase . classEnvRule . timeZone ) == null ? "(null)" : timeZone . getID ( ) ) ) ) ;
Buggy code:
public class SceneCamera extends OrthographicCamera implements Serializable { private static final float START_SCROLLX = 0.1F ; private static final float START_SCROLLY = 0.15F ; private static final Vector2 tmpPos = new Vector2 ( ) ; private float startScrollDistanceX ; private float startScrollDistanceY ; private float scrollingWidth ; private float scrollingHeight ; private CameraTween cameraTween ; public SceneCamera ( ) { } public void create ( float worldWidth , float worldHeight ) { } public float getWidth ( ) { } public float getHeight ( ) { } public float getScrollingWidth ( ) { } public float getScrollingHeight ( ) { } public void setScrollingDimensions ( float w , float h ) { } public void update ( float delta ) { } public void setPosition ( float x , float y ) { float maxleft = ( ( viewportWidth ) // 2 ) * ( zoom ) ; float maxright = ( scrollingWidth ) - ( ( ( viewportWidth ) // 2 ) * ( zoom ) ) ; float maxbottom = ( ( viewportHeight ) // 2 ) * ( zoom ) ; float maxtop = ( scrollingHeight ) - ( ( ( viewportHeight ) // 2 ) * ( zoom ) ) ; x = MathUtils . clamp ( x , maxleft , maxright ) ; <START_BUG> y = MathUtils . clamp ( x , maxbottom , maxtop ) ; <END_BUG> position . set ( x , y , 0 ) ; update ( ) ; } public void setZoom ( float zoom ) { } public Vector2 getPosition ( ) { } public float getZoom ( ) { } public void startAnimation ( float destX , float destY , float zoom , float duration , ActionCallback cb ) { } public void getInputUnProject ( Viewport viewport , Vector3 out ) { } public void updatePos ( SpriteActor followActor ) { } public void scene2screen ( Viewport viewport , Vector3 out ) { } @ Override public void write ( Json json ) { } @ Override public void read ( Json json , JsonValue jsonData ) { } }

Fix:
y = MathUtils . clamp ( y , maxbottom , maxtop ) ;
Buggy code:
public class FailureRecorder extends ProjectComponent implements BuildListener , JUnitResultFormatter { public static final String MAGIC_PROPERTY_CLASS_LOCATION = "ant.junit.failureCollector" ; public static final String DEFAULT_CLASS_LOCATION = ( System . getProperty ( "java.io.tmpdir" ) ) + "FailedTests" ; private static final String LOG_PREFIX = "<seq2seq4repair_space>[junit]" ; private static SortedSet failedTests = new TreeSet ( ) ; private BufferedWriter writer ; private static String locationName ; private String getLocationName ( ) { } public void setProject ( Project project ) { } public void endTestSuite ( JUnitTest suite ) throws BuildException { } public void addError ( Test test , Throwable throwable ) { } public void addFailure ( Test test , AssertionFailedError error ) { } public void setOutput ( OutputStream out ) { } public void setSystemError ( String err ) { } public void setSystemOutput ( String out ) { } public void startTestSuite ( JUnitTest suite ) throws BuildException { } public void endTest ( Test test ) { } public void startTest ( Test test ) { } private void writeJavaClass ( ) { try { File sourceFile = new File ( ( ( getLocationName ( ) ) + ".java" ) ) ; verbose ( ( ( "Write<seq2seq4repair_space>collector<seq2seq4repair_space>class<seq2seq4repair_space>to<seq2seq4repair_space>'" + ( sourceFile . getAbsolutePath ( ) ) ) + "'" ) ) ; <START_BUG> if ( ! ( sourceFile . delete ( ) ) ) { <END_BUG> throw new IOException ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>delete<seq2seq4repair_space>" + sourceFile ) ) ; } writer = new BufferedWriter ( new FileWriter ( sourceFile ) ) ; createClassHeader ( ) ; createSuiteMethod ( ) ; createClassFooter ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { FileUtils . close ( writer ) ; } } private void createClassHeader ( ) throws IOException { } private void createSuiteMethod ( ) throws IOException { } private void createClassFooter ( ) throws IOException { } public void log ( String message ) { } public void verbose ( String message ) { } public static class TestInfos implements Comparable { private final String className ; private final String methodName ; public TestInfos ( Test test ) { } public String toString ( ) { } public int compareTo ( Object other ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } } public void buildFinished ( BuildEvent event ) { } public void buildStarted ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { } public void targetFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } }

Fix:
if ( ( sourceFile . exists ( ) ) && ( ! ( sourceFile . delete ( ) ) ) ) {
Buggy code:
public class RequiredValidator extends StringValidator { private static final long serialVersionUID = 1L ; private static final RequiredValidator instance = new RequiredValidator ( ) ; public static RequiredValidator getInstance ( ) { } protected RequiredValidator ( ) { } public final void onValidate ( final FormComponent formComponent , final String value ) { <START_BUG> if ( formComponent . isEnabled ( ) ) { <END_BUG> return ; } if ( ( value == null ) && ( ! ( formComponent . isInputNullable ( ) ) ) ) { return ; } if ( Strings . isEmpty ( value ) ) { error ( formComponent ) ; } } public String toString ( ) { } }

Fix:
if ( ! ( formComponent . isEnabled ( ) ) ) {
Buggy code:
public class Assignment extends Expression { public Expression lhs ; public Expression expression ; public Assignment ( Expression lhs , Expression expression , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } void checkAssignmentEffect ( BlockScope scope ) { } void checkAssignment ( BlockScope scope , TypeBinding lhsType , TypeBinding rhsType ) { FieldBinding leftField = getLastField ( this . lhs ) ; <START_BUG> if ( ( ( leftField != null ) && ( lhsType . isWildcard ( ) ) ) && ( rhsType != ( NullBinding ) ) ) { <END_BUG> scope . problemReporter ( ) . unsafeWildcardAssignment ( lhsType , rhsType , this . expression ) ; } else if ( ( ( leftField != null ) && ( leftField . declaringClass . isRawType ( ) ) ) && ( ( rhsType . isParameterizedType ( ) ) || ( rhsType . isGenericType ( ) ) ) ) { scope . problemReporter ( ) . unsafeRawFieldAssignment ( leftField , rhsType , this . lhs ) ; } else if ( ( rhsType . isRawType ( ) ) && ( ( lhsType . isParameterizedType ( ) ) || ( lhsType . isGenericType ( ) ) ) ) { scope . problemReporter ( ) . unsafeRawAssignment ( this . expression , rhsType , lhsType ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } Binding getDirectBinding ( Expression someExpression ) { } FieldBinding getLastField ( Expression someExpression ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( ( ( leftField != null ) && ( rhsType != ( NullBinding ) ) ) && ( lhsType . isWildcard ( ) ) ) && ( ( ( ( WildcardBinding ) ( lhsType ) ) . kind ) != ( Wildcard . SUPER ) ) ) {
Buggy code:
public class CommandCompleter implements Completor , CommandLineCompleter { private final CommandContext ctx ; private final CommandRegistry cmdRegistry ; public CommandCompleter ( CommandRegistry cmdRegistry , CommandContext ctx ) { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) @ Override public int complete ( String buffer , int cursor , List candidates ) { } @ Override public int complete ( CommandContext ctx , String buffer , int cursor , List < String > candidates ) { int cmdFirstIndex = 0 ; while ( cmdFirstIndex < ( buffer . length ( ) ) ) { if ( ! ( Character . isWhitespace ( buffer . charAt ( cmdFirstIndex ) ) ) ) { break ; } ++ cmdFirstIndex ; } if ( cmdFirstIndex == ( buffer . length ( ) ) ) { for ( String cmd : cmdRegistry . getTabCompletionCommands ( ) ) { CommandHandler handler = cmdRegistry . getCommandHandler ( cmd ) ; if ( handler . isAvailable ( ctx ) ) { candidates . add ( cmd ) ; } } return cmdFirstIndex ; } char firstChar = buffer . charAt ( cmdFirstIndex ) ; if ( ( ( firstChar == '.' ) || ( firstChar == ':' ) ) || ( firstChar == '//' ) ) { return INSTANCE . complete ( ctx , buffer , cursor , candidates ) ; } int cmdLastIndex = cmdFirstIndex + 1 ; while ( ( cmdLastIndex < ( buffer . length ( ) ) ) && ( ! ( Character . isWhitespace ( buffer . charAt ( cmdLastIndex ) ) ) ) ) { ++ cmdLastIndex ; } String cmd = buffer . substring ( cmdFirstIndex , cmdLastIndex ) ; if ( cmdLastIndex < ( buffer . length ( ) ) ) { CommandHandler handler = cmdRegistry . getCommandHandler ( cmd ) ; if ( handler != null ) { CommandLineCompleter argsCompleter = handler . getArgumentCompleter ( ) ; if ( argsCompleter != null ) { int nextCharIndex = cmdLastIndex + 1 ; while ( nextCharIndex < ( buffer . length ( ) ) ) { if ( ! ( Character . isWhitespace ( buffer . charAt ( nextCharIndex ) ) ) ) { break ; } ++ nextCharIndex ; } String cmdBuffer = buffer . substring ( nextCharIndex ) ; <START_BUG> int result = argsCompleter . complete ( ctx , cmdBuffer , cursor , candidates ) ; <END_BUG> if ( result >= 0 ) { return nextCharIndex + result ; } else { return result ; } } } } if ( cmdLastIndex < ( buffer . length ( ) ) ) { cmd = buffer . substring ( cmdFirstIndex ) ; } for ( String command : cmdRegistry . getTabCompletionCommands ( ) ) { if ( ! ( command . startsWith ( cmd ) ) ) { continue ; } CommandHandler handler = cmdRegistry . getCommandHandler ( command ) ; if ( handler . isAvailable ( ctx ) ) { candidates . add ( command ) ; } } Collections . sort ( candidates ) ; return ( buffer . length ( ) ) - ( cmd . length ( ) ) ; } }

Fix:
int result = argsCompleter . complete ( ctx , cmdBuffer , ( cursor - nextCharIndex ) , candidates ) ;
Buggy code:
interface VisualMethods { ObjectPosition getBallPosition ( ) { } ObjectPosition getOurPosition ( ) { } ObjectPosition getOpponentPosition ( ) { } ObjectPosition getOurOrientation ( ) { } ObjectPosition getOpponentOrientation ( ) { } Vector2 getDistanceToOpponent ( ) { } Vector2 getDistanceToSide ( ) { } Vector2 getBallVelocity ( ) { } Vector2 getOurVelocity ( ) { } Vector2 getOpponentVelocity ( ) { } Vector2 getDistanceToBall ( ) { } int whatDidWeHit ( ) { } <START_BUG> Bool didWeScore ( ) ; <END_BUG> }

Fix:
boolean didWeScore ( ) ;