nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CreateJoinLeagueFragment extends Fragment { View rootview ; EditText mLeagueName ; Button mSignUpButton ; String userSelection ; String LeagueName ; private static final Logger logger = Logger . getLogger ( BuyFragment . class . getName ( ) ) ; @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } public void onViewCreated ( View view , Bundle savedInstanceState ) { final ListView leaguesL = ( ( ListView ) ( view . findViewById ( leagueList ) ) ) ; mSignUpButton = ( ( Button ) ( view . findViewById ( btnjoinleague ) ) ) ; mLeagueName = ( ( EditText ) ( view . findViewById ( txtTeamName ) ) ) ; super . onViewCreated ( view , savedInstanceState ) ; updateLeagueList ( leaguesL ) ; leaguesL . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { public void onItemClick ( AdapterView parent , View v , int position , long id ) { userSelection = ( ( android . widget . TextView ) ( v ) ) . getText ( ) . toString ( ) ; LeagueName = userSelection . substring ( 6 ) ; mLeagueName . setText ( LeagueName ) ; } } ) ; mSignUpButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { ParseUser user = new ParseUser ( ) . getCurrentUser ( ) ; final String leagueName = mLeagueName . getText ( ) . toString ( ) ; <START_BUG> if ( ( userSelection ) == null ) { <END_BUG> Toast . makeText ( getActivity ( ) , "League<seq2seq4repair_space>name<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>blank.<seq2seq4repair_space>Please<seq2seq4repair_space>try<seq2seq4repair_space>again" , LENGTH_SHORT ) . show ( ) ; } else { user . put ( "League" , leagueName ) ; user . saveInBackground ( new SaveCallback ( ) { @ Override public void done ( ParseException e ) { if ( e == null ) { Toast a = Toast . makeText ( getActivity ( ) , "You<seq2seq4repair_space>have<seq2seq4repair_space>joined<seq2seq4repair_space>the<seq2seq4repair_space>league." , LENGTH_LONG ) ; a . show ( ) ; ParseObject Leagues = new ParseObject ( "Leagues" ) ; Leagues . put ( "League" , leagueName ) ; Leagues . put ( "UserID" , ParseUser . getCurrentUser ( ) . getObjectId ( ) ) ; Leagues . saveInBackground ( ) ; Fragment newFragment = new CreateJoinLeagueFragment ( ) ; FragmentTransaction transaction = getFragmentManager ( ) . beginTransaction ( ) ; transaction . replace ( container , newFragment ) ; transaction . addToBackStack ( null ) ; transaction . commit ( ) ; } else { Toast a = Toast . makeText ( getActivity ( ) , "You<seq2seq4repair_space>are<seq2seq4repair_space>unable<seq2seq4repair_space>to<seq2seq4repair_space>join<seq2seq4repair_space>at<seq2seq4repair_space>this<seq2seq4repair_space>time." , LENGTH_LONG ) ; a . show ( ) ; } } } ) ; } } } ) ; } private void updateLeagueList ( ListView leaguesL ) { } }

Fix:
if ( leagueName == null ) {
Buggy code:
public class RecentFilesMenu extends EnhancedMenu { public RecentFilesMenu ( ) { } public void setPopupMenuVisible ( boolean b ) { if ( b ) { final View view = EditAction . getView ( this ) ; if ( ( getMenuComponentCount ( ) ) != 0 ) removeAll ( ) ; ActionListener actionListener = new ActionListener ( ) { public void actionPerformed ( ActionEvent evt ) { jEdit . openFile ( view , evt . getActionCommand ( ) ) ; view . getStatus ( ) . setMessage ( null ) ; } } ; MouseListener mouseListener = new MouseAdapter ( ) { public void mouseEntered ( MouseEvent evt ) { view . getStatus ( ) . setMessage ( ( ( JMenuItem ) ( evt . getSource ( ) ) ) . getActionCommand ( ) ) ; } public void mouseExited ( MouseEvent evt ) { view . getStatus ( ) . setMessage ( null ) ; } } ; Vector recentVector = BufferHistory . getBufferHistory ( ) ; if ( ( recentVector . size ( ) ) == 0 ) { add ( GUIUtilities . loadMenuItem ( "no-recent" ) ) ; return ; } <START_BUG> int recentFileCount = Math . min ( recentVector . size ( ) , Integer . parseInt ( jEdit . getProperty ( "history" ) ) ) ; <END_BUG> for ( int i = ( recentVector . size ( ) ) - 1 ; i >= ( ( recentVector . size ( ) ) - recentFileCount ) ; i -- ) { String path = ( ( BufferHistory . Entry ) ( recentVector . elementAt ( i ) ) ) . path ; VFS vfs = VFSManager . getVFSForPath ( path ) ; JMenuItem menuItem = new JMenuItem ( vfs . getFileName ( path ) ) ; menuItem . setActionCommand ( path ) ; menuItem . addActionListener ( actionListener ) ; menuItem . addMouseListener ( mouseListener ) ; add ( menuItem ) ; } } super . setPopupMenuVisible ( b ) ; } }

Fix:
int recentFileCount = Math . min ( recentVector . size ( ) , jEdit . getIntegerProperty ( "history" , 25 ) ) ;
Buggy code:
public abstract class AbstractRoleRule extends AbstractRule implements Rule { ObjectMapper mapper = ServiceLocator . getInstance ( ) . getMapper ( ) ; public abstract boolean execute ( Object ... objects ) throws Exception { } protected String getRoleById ( String id ) { } protected void addRole ( Map < String , Object > data ) throws Exception { } protected void updRole ( Map < String , Object > data ) throws Exception { } protected void delRole ( String id ) throws Exception { } protected String getRoles ( String host ) { } protected String getRoleDropdown ( String host ) { String sql = "SELECT<seq2seq4repair_space>FROM<seq2seq4repair_space>Role" ; if ( host != null ) { sql = ( ( sql + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>host<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + host ) + "'<seq2seq4repair_space>OR<seq2seq4repair_space>host<seq2seq4repair_space>IS<seq2seq4repair_space>NULL" ; } String json = null ; ODatabaseDocumentTx db = ServiceLocator . getInstance ( ) . getDb ( ) ; try { OSQLSynchQuery < ODocument > query = new OSQLSynchQuery ( sql ) ; List < ODocument > roles = db . command ( query ) . execute ( ) ; if ( ( roles . size ( ) ) > 0 ) { List < Map < String , String > > list = new ArrayList < Map < String , String > > ( ) ; for ( ODocument doc : roles ) { Map < String , String > map = new HashMap < String , String > ( ) ; String id = doc . field ( "id" ) ; <START_BUG> map . put ( "label" , id ) ; <END_BUG> map . put ( "value" , id ) ; list . add ( map ) ; } json = mapper . writeValueAsString ( list ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { db . close ( ) ; } return json ; } }

Fix:
map . put ( "id" , id ) ;
Buggy code:
public class PCClassFileTransformer implements ClassFileTransformer { private static final Localizer _loc = Localizer . forPackage ( PCClassFileTransformer . class ) ; private final MetaDataRepository _repos ; private final Flags _flags ; private final ClassLoader _tmpLoader ; private final Log _log ; private final Set _names ; private boolean _transforming = false ; public PCClassFileTransformer ( MetaDataRepository repos , Options opts , ClassLoader loader ) { } private static Flags toFlags ( Options opts ) { } public PCClassFileTransformer ( MetaDataRepository repos , PCEnhancer . Flags flags , ClassLoader tmpLoader , boolean devscan ) { } public byte [ ] transform ( ClassLoader loader , String className , Class redef , ProtectionDomain domain , byte [ ] bytes ) throws IllegalClassFormatException { if ( loader == ( _tmpLoader ) ) return null ; if ( _transforming ) return null ; _transforming = true ; try { Boolean enhance = needsEnhance ( className , redef , bytes ) ; if ( ( enhance != null ) && ( _log . isTraceEnabled ( ) ) ) _log . trace ( PCClassFileTransformer . _loc . get ( "needs-runtime-enhance" , className , enhance ) ) ; if ( enhance != ( Boolean . TRUE ) ) return null ; PCEnhancer enhancer = new PCEnhancer ( _repos . getConfiguration ( ) , new Project ( ) . loadClass ( new ByteArrayInputStream ( bytes ) , _tmpLoader ) , _repos ) ; enhancer . setAddDefaultConstructor ( _flags . addDefaultConstructor ) ; enhancer . setEnforcePropertyRestrictions ( _flags . enforcePropertyRestrictions ) ; if ( ( enhancer . run ( ) ) == ( PCEnhancer . ENHANCE_NONE ) ) return null ; <START_BUG> return enhancer . getBytecode ( ) . toByteArray ( ) ; <END_BUG> } catch ( Throwable t ) { _log . warn ( PCClassFileTransformer . _loc . get ( "cft-exception-thrown" , className ) , t ) ; if ( t instanceof RuntimeException ) throw ( ( RuntimeException ) ( t ) ) ; if ( t instanceof IllegalClassFormatException ) throw ( ( IllegalClassFormatException ) ( t ) ) ; throw new GeneralException ( t ) ; } finally { _transforming = false ; } } private Boolean needsEnhance ( String clsName , Class redef , byte [ ] bytes ) { } private static boolean isEnhanced ( byte [ ] b ) { } }

Fix:
return enhancer . getPCBytecode ( ) . toByteArray ( ) ;
Buggy code:
public abstract class SequenceUpdater implements Cacheable { protected DataDictionaryImpl _dd ; protected String _uuidString ; protected SequenceGenerator _sequenceGenerator ; private long _lockTimeoutInMillis ; public SequenceUpdater ( ) { } public SequenceUpdater ( DataDictionaryImpl dd ) { } protected abstract SequenceGenerator createSequenceGenerator ( TransactionController readOnlyTC ) throws StandardException { } protected abstract boolean updateCurrentValueOnDisk ( TransactionController tc , Long oldValue , Long newValue , boolean wait ) throws StandardException { } public void clean ( boolean forRemove ) throws StandardException { } public boolean isDirty ( ) { } public Object getIdentity ( ) { } public void clearIdentity ( ) { } public Cacheable createIdentity ( Object key , Object createParameter ) throws StandardException { } public Cacheable setIdentity ( Object key ) throws StandardException { } public void getCurrentValueAndAdvance ( NumberDataValue returnValue ) throws StandardException { } private Long peekAtCurrentValue ( ) throws StandardException { } public boolean updateCurrentValueOnDisk ( Long oldValue , Long newValue ) throws StandardException { TransactionController executionTransaction = SequenceUpdater . getLCC ( ) . getTransactionExecute ( ) ; TransactionController nestedTransaction = null ; try { nestedTransaction = executionTransaction . startNestedUserTransaction ( false ) ; } catch ( StandardException se ) { } if ( nestedTransaction != null ) { try { return updateCurrentValueOnDisk ( nestedTransaction , oldValue , newValue , false ) ; } catch ( StandardException se ) { <START_BUG> if ( ! ( se . getMessageId ( ) . equals ( LOCK_TIMEOUT ) ) ) { <END_BUG> throw se ; } } finally { nestedTransaction . commit ( ) ; nestedTransaction . destroy ( ) ; } } return updateCurrentValueOnDisk ( executionTransaction , oldValue , newValue , true ) ; } protected int getLockTimeout ( ) { } private static LanguageConnectionContext getLCC ( ) { } private StandardException unimplementedFeature ( ) { } public static final class SyssequenceUpdater extends SequenceUpdater { private RowLocation _sequenceRowLocation ; public SyssequenceUpdater ( ) { } public SyssequenceUpdater ( DataDictionaryImpl dd ) { } protected SequenceGenerator createSequenceGenerator ( TransactionController readOnlyTC ) throws StandardException { } protected boolean updateCurrentValueOnDisk ( TransactionController tc , Long oldValue , Long newValue , boolean wait ) throws StandardException { } } }

Fix:
if ( ! ( se . isLockTimeout ( ) ) ) {
Buggy code:
public interface ITopologyValidator { <START_BUG> void validate ( String topologyName , Map topologyConf , StormTopology topology , Map NimbusConf ) throws InvalidTopologyException ; <END_BUG> }

Fix:
void validate ( String topologyName , Map topologyConf , StormTopology topology ) throws InvalidTopologyException ;
Buggy code:
public interface LocationProvider { <START_BUG> public void init ( Context context , SmartLocation . OnLocationUpdatedListener listener , LocationParams params , boolean singleUpdate , Logger loggingEnabled ) ; <END_BUG> public void start ( ) { } public void stopUpdates ( ) { } public Location getLastLocation ( ) { } }

Fix:
public void init ( Context context , SmartLocation . OnLocationUpdatedListener listener , LocationParams params , boolean singleUpdate , Logger logger ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class DataSourceResourcesUnitTestCase { private ModelControllerClient client ; @ Deployment public static Archive < ? > getDeployment ( ) { } private ModelControllerClient getModelControllerClient ( ) throws UnknownHostException { } @ After public void tearDown ( ) { } @ Test public void testReadChildrenResources ( ) throws IOException { } @ Test public void testReadResourceResources ( ) throws IOException { final ModelNode address = new ModelNode ( ) ; address . add ( "subsystem" , "datasources" ) ; address . protect ( ) ; final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( "read-resource-description" ) ; operation . get ( OP_ADDR ) . set ( address ) ; final ModelNode result = getModelControllerClient ( ) . execute ( operation ) ; Assert . assertTrue ( result . hasDefined ( RESULT ) ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; final Map < String , ModelNode > children = DataSourceOperationTestUtil . getChildren ( result . get ( RESULT ) . get ( "attributes" ) . get ( "installed-drivers" ) . get ( "value-type" ) ) ; Assert . assertFalse ( children . isEmpty ( ) ) ; HashSet < String > keys = new HashSet < String > ( ) ; for ( final Map . Entry < String , ModelNode > child : children . entrySet ( ) ) { Assert . assertTrue ( ( ( child . getKey ( ) ) != null ) ) ; keys . add ( child . getKey ( ) ) ; } <START_BUG> Assert . assertTrue ( keys . contains ( "driver-xa-data-source-class-name" ) ) ; <END_BUG> Assert . assertTrue ( keys . contains ( "module-slot" ) ) ; Assert . assertTrue ( keys . contains ( "driver-name" ) ) ; } }

Fix:
Assert . assertTrue ( keys . contains ( "driver-xa-datasource-class-name" ) ) ;
Buggy code:
public interface ISharedObjectContext { public ID getContainerID ( ) { } public ISharedObjectManager getSharedObjectManager ( ) { } public QueueEnqueue getQueue ( ) { } public void joinGroup ( ID groupID , Object loginData ) throws SharedObjectContainerJoinException { } <START_BUG> public Object leaveGroup ( ) ; <END_BUG> public ID getGroupID ( ) { } public boolean isGroupManager ( ) { } public boolean isGroupServer ( ) { } public ID [ ] getGroupMembership ( ) { } public void sendCreate ( ID toContainerID , SharedObjectDescription sd ) throws IOException { } public void sendDispose ( ID toContainerID ) throws IOException { } public void sendMessage ( ID toContainerID , byte [ ] data ) throws IOException { } public void sendMessage ( ID toContainerID , Serializable data ) throws IOException { } public Object getAdapter ( Class clazz ) { } public IOSGIService getServiceAccess ( ) { } }

Fix:
public void leaveGroup ( ) ;
Buggy code:
public class EqualsBuilder implements Builder < Boolean > { private static final ThreadLocal < Set < Pair < IDKey , IDKey > > > REGISTRY = new ThreadLocal < Set < Pair < IDKey , IDKey > > > ( ) ; static Set < Pair < IDKey , IDKey > > getRegistry ( ) { } static Pair < IDKey , IDKey > getRegisterPair ( Object lhs , Object rhs ) { } static boolean isRegistered ( Object lhs , Object rhs ) { } static void register ( Object lhs , Object rhs ) { } static void unregister ( Object lhs , Object rhs ) { } private boolean isEquals = true ; public EqualsBuilder ( ) { } public static boolean reflectionEquals ( Object lhs , Object rhs ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , Collection < String > excludeFields ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , String [ ] excludeFields ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients , Class < ? > reflectUpToClass ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients , Class < ? > reflectUpToClass , String [ ] excludeFields ) { } private static void reflectionAppend ( Object lhs , Object rhs , Class < ? > clazz , EqualsBuilder builder , boolean useTransients , String [ ] excludeFields ) { } public EqualsBuilder appendSuper ( boolean superEquals ) { } public EqualsBuilder append ( Object lhs , Object rhs ) { } public EqualsBuilder append ( long lhs , long rhs ) { } public EqualsBuilder append ( int lhs , int rhs ) { } public EqualsBuilder append ( short lhs , short rhs ) { } public EqualsBuilder append ( char lhs , char rhs ) { } public EqualsBuilder append ( byte lhs , byte rhs ) { } public EqualsBuilder append ( double lhs , double rhs ) { } public EqualsBuilder append ( float lhs , float rhs ) { } public EqualsBuilder append ( boolean lhs , boolean rhs ) { } public EqualsBuilder append ( Object [ ] lhs , Object [ ] rhs ) { } public EqualsBuilder append ( long [ ] lhs , long [ ] rhs ) { } public EqualsBuilder append ( int [ ] lhs , int [ ] rhs ) { } public EqualsBuilder append ( short [ ] lhs , short [ ] rhs ) { } public EqualsBuilder append ( char [ ] lhs , char [ ] rhs ) { } public EqualsBuilder append ( byte [ ] lhs , byte [ ] rhs ) { } public EqualsBuilder append ( double [ ] lhs , double [ ] rhs ) { } public EqualsBuilder append ( float [ ] lhs , float [ ] rhs ) { } public EqualsBuilder append ( boolean [ ] lhs , boolean [ ] rhs ) { } public boolean isEquals ( ) { } public Boolean build ( ) { <START_BUG> return isEquals ( ) ; <END_BUG> } protected void setEquals ( boolean isEquals ) { } public void reset ( ) { } }

Fix:
return Boolean . valueOf ( isEquals ( ) ) ;
Buggy code:
public final class JavaEnvUtils { private JavaEnvUtils ( ) { } private static final boolean IS_DOS = Os . isFamily ( "dos" ) ; private static final boolean IS_NETWARE = Os . isName ( "netware" ) ; private static final boolean IS_AIX = Os . isName ( "aix" ) ; private static final String JAVA_HOME = System . getProperty ( "java.home" ) ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private static String javaVersion ; private static int javaVersionNumber ; public static final String JAVA_1_0 = "1.0" ; public static final int VERSION_1_0 = 10 ; public static final String JAVA_1_1 = "1.1" ; public static final int VERSION_1_1 = 11 ; public static final String JAVA_1_2 = "1.2" ; public static final int VERSION_1_2 = 12 ; public static final String JAVA_1_3 = "1.3" ; public static final int VERSION_1_3 = 13 ; public static final String JAVA_1_4 = "1.4" ; public static final int VERSION_1_4 = 14 ; public static final String JAVA_1_5 = "1.5" ; public static final int VERSION_1_5 = 15 ; public static final String JAVA_1_6 = "1.6" ; public static final int VERSION_1_6 = 16 ; private static boolean kaffeDetected ; private static Vector jrePackages ; public static String getJavaVersion ( ) { } public static int getJavaVersionNumber ( ) { } public static boolean isJavaVersion ( String version ) { } public static boolean isAtLeastJavaVersion ( String version ) { } public static boolean isKaffe ( ) { } public static String getJreExecutable ( String command ) { } public static String getJdkExecutable ( String command ) { } private static String addExtension ( String command ) { } private static File findInDir ( String dirName , String commandName ) { } private static void buildJrePackages ( ) { } public static Vector getJrePackageTestCases ( ) { } public static Vector getJrePackages ( ) { } public static File createVmsJavaOptionFile ( String [ ] cmd ) throws IOException { <START_BUG> File script = JavaEnvUtils . FILE_UTILS . createTempFile ( "ANT" , ".JAVA_OPTS" , null ) ; <END_BUG> PrintWriter out = null ; try { out = new PrintWriter ( new BufferedWriter ( new FileWriter ( script ) ) ) ; for ( int i = 0 ; i < ( cmd . length ) ; i ++ ) { out . println ( cmd [ i ] ) ; } } finally { FileUtils . close ( out ) ; } return script ; } public static String getJavaHome ( ) { } }

Fix:
File script = JavaEnvUtils . FILE_UTILS . createTempFile ( "ANT" , ".JAVA_OPTS" , null , false , true ) ;
Buggy code:
public class ECGViewHandler { private final ECGModel model ; public ECGViewHandler ( ECGModel model ) { } public void loadFile ( String file ) throws IOException { } public void loadFileSubset ( String file , double start , double end ) throws IOException { } public void loadAnnotations ( String file ) { } public void writeDataCSV ( String file ) throws IOException { } public void writeDataMat ( String file ) throws IOException { } public void writeDataSubsetCSV ( String file , double start , double end ) throws IOException { } public void writeDataSubsetMat ( String file , double start , double end ) throws IOException { } public void writeBadLeads ( String file ) throws IOException { } public void writeAnnotations ( String file ) throws IOException { } public void convertTo12 ( String file ) throws IOException { } public int size ( ) { } public int leadSize ( int index ) { } public double getSampleInterval ( ) { } public int [ ] [ ] getLayout ( ) { } public String [ ] getTitles ( ) { } public int getOffset ( ) { } public ECGView getView ( int i , boolean withLabels ) { } public ECGView getCompositeView ( boolean withLabels ) { } public void fix12Lead ( ) { } public void applyFilter ( FilterDialog f , int index ) { } public void applyFilterAll ( final FilterDialog f , final MainFrame attach ) { } public ECGView shallowFilter ( int index , int filterId , Number [ ] params , boolean withLabels ) { ECGDataSet data = ( ( ECGDataSet ) ( model . getDataset ( index ) . clone ( ) ) ) ; switch ( filterId ) { case 0 : data . sgolayfilt ( ( ( int ) ( params [ 0 ] ) ) , ( ( int ) ( params [ 1 ] ) ) , ( ( int ) ( params [ 2 ] ) ) ) ; break ; case 1 : data . highpassfilt ( ( ( double ) ( params [ 0 ] ) ) ) ; break ; case 2 : data . lowpassfilt ( ( ( double ) ( params [ 0 ] ) ) ) ; break ; case 3 : data . highpassfftfilt ( ( ( double ) ( params [ 0 ] ) ) , 0 ) ; break ; case 4 : data . detrend ( ( ( int ) ( params [ 0 ] ) ) ) ; break ; case 5 : data . waveletfilt ( ( ( double ) ( params [ 0 ] ) ) ) ; break ; case 6 : data . constofffilt ( ( ( double ) ( params [ 0 ] ) ) ) ; break ; case 7 : data . butterworthfilt ( ( ( int ) ( params [ 0 ] ) ) , model . getSamplesPerSecond ( ) , ( ( double ) ( params [ 1 ] ) ) , ( ( int ) ( params [ 2 ] ) ) ) ; break ; case 8 : data . harmonicDetrend ( ) ; break ; case 9 : data . medianDetrend ( ) ; break ; default : break ; } <START_BUG> return new ECGView ( this , data , index , ( "" + ( index + 4 ) ) , withLabels ) ; <END_BUG> } public ArrayList < Annotation > getAnnotations ( ) { } public void addAnnotation ( int type , double i ) { } public void removeAnnotation ( int index ) { } public void clearAnnotations ( ) { } public void extractFeatures ( int lead ) { } public void setBad ( int index , boolean isBad ) { } public boolean isBad ( int index ) { } public void undo ( ) { } public void redo ( ) { } public String undoMessage ( ) { } public String redoMessage ( ) { } public boolean canUndo ( ) { } public boolean canRedo ( ) { } }

Fix:
return new ECGView ( this , data , index , getTitles ( ) [ index ] , withLabels ) ;
Buggy code:
public class OpsWorksService { private AWSOpsWorks opsWorks ; public OpsWorksService ( AWSOpsWorks opsWorks ) { } public String CreateDeployment ( final String stackName , final String appName ) throws Exception { } public boolean IsDeploymentComplete ( String deploymentId ) { } public boolean IsDeploymentSuccessful ( String deploymentId ) { } public String GetStackId ( final String stackName ) throws Exception { } public String GetAppId ( final String appName , final String stackId ) throws Exception { } private boolean IsDeploymentOfStatus ( String deploymentId , String status ) { DescribeDeploymentsRequest request = new DescribeDeploymentsRequest ( ) . withDeploymentIds ( deploymentId ) ; final DescribeDeploymentsResult result = opsWorks . describeDeployments ( request ) ; for ( Deployment deployment : result . getDeployments ( ) ) { <START_BUG> if ( deployment . getStatus ( ) . equals ( status ) ) { <END_BUG> return false ; } } return true ; } }

Fix:
if ( ! ( deployment . getStatus ( ) . equals ( status ) ) ) {
Buggy code:
@ RunWith ( MockitoJUnitRunner . class ) public class SecureGraphWorkspaceRepositoryTest { private InMemoryGraph graph ; private ReadOnlyInMemoryOntologyRepository ontologyRepository ; @ Mock private WorkspaceDiffHelper workspaceDiff ; private InMemoryUser user1 ; private InMemoryUser user2 ; private QueueIdGenerator idGenerator ; private WorkspaceRepository workspaceRepository ; private AuthorizationRepository authorizationRepository ; private Vertex entity1Vertex ; @ Mock private UserListenerUtil userListenerUtil ; @ Before public void setup ( ) throws Exception { Visibility visibility = new Visibility ( "" ) ; Authorizations authorizations = new InMemoryAuthorizations ( ) ; InMemoryGraphConfiguration config = new InMemoryGraphConfiguration ( new HashMap ( ) ) ; idGenerator = new QueueIdGenerator ( ) ; <START_BUG> graph = InMemoryGraph . create ( config , idGenerator , new org . securegraph . search . DefaultSearchIndex ( config . getConfig ( ) ) ) ; <END_BUG> authorizationRepository = new InMemoryAuthorizationRepository ( ) ; Configuration lumifyConfiguration = new HashMapConfigurationLoader ( new HashMap ( ) ) . createConfiguration ( ) ; LockRepository lockRepository = new io . lumify . core . model . lock . LocalLockRepository ( lumifyConfiguration ) ; InMemoryUserRepository userRepository = new InMemoryUserRepository ( lumifyConfiguration , userListenerUtil ) ; user1 = ( ( InMemoryUser ) ( userRepository . addUser ( "user2" , "user2" , null , "none" , new String [ 0 ] ) ) ) ; graph . addVertex ( user1 . getUserId ( ) , visibility , authorizations ) ; user2 = ( ( InMemoryUser ) ( userRepository . addUser ( "user2" , "user2" , null , "none" , new String [ 0 ] ) ) ) ; graph . addVertex ( user2 . getUserId ( ) , visibility , authorizations ) ; ontologyRepository = new ReadOnlyInMemoryOntologyRepository ( ) ; ontologyRepository . init ( lumifyConfiguration ) ; workspaceRepository = new SecureGraphWorkspaceRepository ( ontologyRepository , graph , userRepository , authorizationRepository , workspaceDiff , lockRepository ) ; String entity1VertexId = "entity1Id" ; entity1Vertex = graph . addVertex ( entity1VertexId , new LumifyVisibility ( ) . getVisibility ( ) , new InMemoryAuthorizations ( ) ) ; } @ Test public void testAddWorkspace ( ) { } @ Test public void testAccessControl ( ) { } @ Test public void testEntities ( ) { } }

Fix:
graph = InMemoryGraph . create ( config , idGenerator , new org . securegraph . search . DefaultSearchIndex ( config ) ) ;
Buggy code:
public class InputPanel extends JPanel { private static final long serialVersionUID = 1L ; private JTextField tfInput ; private JButton btnAddImage ; private JButton btnSend ; private ClientController controller ; public InputPanel ( ClientController controller ) { } public JTextField getInputField ( ) { } public void actionEvent ( ) { if ( ( tfInput . getText ( ) . length ( ) ) > 0 ) { <START_BUG> if ( ( controller . getSelectedUsers ( ) . length ) > 0 ) { <END_BUG> String [ ] recipients = controller . getSelectedUsers ( ) ; controller . send ( new Message ( tfInput . getText ( ) , recipients ) ) ; } else { controller . send ( new Message ( tfInput . getText ( ) , true ) ) ; } tfInput . setText ( "" ) ; } } private class EnterPressListener implements KeyListener { public void keyTyped ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } public void keyPressed ( KeyEvent e ) { } } }

Fix:
if ( ( controller . getSelectedUsers ( ) ) != null ) {
Buggy code:
public class WordParser { private final String [ ] sinhalaChars = new String [ ] { "අ" , "ආ" , "ඇ" , "ඈ" , "ඉ" , "ඊ" , "උ" , "ඌ" , "ඍ" , "ඎ" , "ඏ" , "ඐ" , "එ" , "ඒ" , "ඓ" , "ඔ" , "ඕ" , "ඖ" , "ක" , "ඛ" , "ග" , "ඝ" , "ඞ" , "ඟ" , "ච" , "ඡ" , "ජ" , "ඣ" , "ඤ" , "ඥ" , "ඦ" , "ට" , "ඨ" , "ඩ" , "ඪ" , "ණ" , "ඬ" , "ත" , "ථ" , "ද" , "ධ" , "න" , "ඳ" , "ප" , "ඵ" , "බ" , "භ" , "ම" , "ඹ" , "ය" , "ර" , "ල" , "ව" , "ශ" , "ෂ" , "ස" , "හ" , "ළ" , "ෆ" , "ං" , "ඃ" , "‍" } ; private final String [ ] sinhalaVowelSigns = new String [ ] { "්" , "ා" , "ැ" , "ෑ" , "ි" , "ී" , "ු" , "ූ" , "ෘ" , "ෙ" , "ේ" , "ෛ" , "ො" , "ෝ" , "ෞ" , "ෟ" , "ෲ" , "ෳ" , "෴" } ; private final String letterSeparator ; private final SinhalaVowelLetterFixer vowelFixer ; private final boolean debug ; public WordParser ( ) { } private String fixVowels ( String str ) { } private int isASinhalaLetter ( String c ) { } private int isASinhalaVowelLetter ( String c ) { } public String encode ( String str ) { str = fixVowels ( str ) ; LinkedList < SinhalaLetter > letterList = new LinkedList < SinhalaLetter > ( ) ; for ( int i = 0 ; i < ( str . length ( ) ) ; ++ i ) { String c = ( str . charAt ( i ) ) + "" ; if ( c . equals ( "*" ) ) { letterList . addLast ( new SinhalaLetter ( "*" ) ) ; continue ; } else if ( c . equals ( "?" ) ) { <START_BUG> letterList . addLast ( new SinhalaLetter ( "?????" ) ) ; <END_BUG> continue ; } int letter = isASinhalaLetter ( c ) ; if ( letter >= 0 ) { letterList . addLast ( new SinhalaLetter ( letter ) ) ; continue ; } int vowelLetter = isASinhalaVowelLetter ( c ) ; if ( vowelLetter >= 0 ) { if ( letterList . isEmpty ( ) ) { if ( debug ) System . out . println ( ( "vowel<seq2seq4repair_space>char<seq2seq4repair_space>at<seq2seq4repair_space>start<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>word<seq2seq4repair_space>:" + str ) ) ; return null ; } SinhalaLetter last = letterList . getLast ( ) ; last . setVowel ( vowelLetter ) ; continue ; } else { SinhalaLetter nonSinhalaLetter = new SinhalaLetter ( ) ; nonSinhalaLetter . setNonSinhalaChar ( c ) ; letterList . addLast ( nonSinhalaLetter ) ; continue ; } } String encoded = "" ; for ( SinhalaLetter letter : letterList ) { if ( letter . isSearchLetter ( ) ) { encoded += ( letter . getSearchLetter ( ) ) + ( letterSeparator ) ; } else if ( letter . isANonSinhalaChar ( ) ) { String l = letter . getNonSinhalaChar ( ) ; encoded += ( ( ( ( l + l ) + l ) + l ) + l ) + ( letterSeparator ) ; } else { encoded += ( letter . getValue ( ) ) + ( letterSeparator ) ; } } return encoded ; } public String decode ( String str ) { } public void check ( String w , int no ) { } }

Fix:
letterList . addLast ( new SinhalaLetter ( "????" ) ) ;
Buggy code:
public class TestStrategyAnnotaion extends SingleEMFTestCase { @ Override public void setUp ( ) { <START_BUG> super . setUp ( Person . class , Address . class , CLEAR_TABLES ) ; <END_BUG> } public void testStrategy ( ) { } }

Fix:
super . setUp ( DROP_TABLES , Person . class , Address . class ) ;
Buggy code:
public class CompletionOnJavadocTypeParamReference extends JavadocSingleTypeReference implements CompletionOnJavadoc { public int completionFlags = CompletionOnJavadoc . JAVADOC ; public char [ ] [ ] missingParams ; public CompletionOnJavadocTypeParamReference ( char [ ] name , long pos , int start , int end ) { } public CompletionOnJavadocTypeParamReference ( JavadocSingleTypeReference typeRef ) { } public void addCompletionFlags ( int flags ) { } public int getCompletionFlags ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { <START_BUG> output . append ( "<CompleteOnJavadocSingleTypeReference:" ) ; <END_BUG> if ( ( this . token ) != null ) super . printExpression ( indent , output ) ; return output . append ( '>' ) ; } public TypeBinding reportError ( BlockScope scope ) { } }

Fix:
output . append ( "<CompletionOnJavadocTypeParamReference:" ) ;
Buggy code:
public class GameLogListActivity extends GenericListActivity < GameLog > { private static final String TAG = "PickLog" ; private GameLogListManager mGameLogList ; private Mode mMode ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void startListing ( GameLogListManager . Mode mode ) { } private final GregorianCalendar mTmpCalendar = new GregorianCalendar ( ) ; @ Override public String getListLabel ( GameLog log ) { } @ Override public int numStreams ( ) { } @ Override public GameLog [ ] readNthStream ( int index ) throws Throwable { <START_BUG> Collection < GameLog > list = GameLogListManager . getInstance ( ) . listLogs ( this , mMode ) ; <END_BUG> return list . toArray ( new GameLog [ 0 ] ) ; } @ Override public void onListItemClick ( ListView l , View v , int position , long id ) { } private void replayGame ( int position ) { } @ Override protected Dialog onCreateDialog ( int id ) { } @ Override public void onCreateContextMenu ( ContextMenu menu , View v , ContextMenuInfo menuInfo ) { } private Menu mOptionsMenu ; @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } static final int DIALOG_LOG_PROPERTIES = 1 ; private final ArrayList < GameLogListManager . UndoToken > mUndoTokens = new ArrayList < GameLogListManager . UndoToken > ( ) ; private void addUndoToken ( GameLogListManager . UndoToken undoToken ) { } private class DeleteLogTask extends AsyncTask < GameLog , String , GameLogListManager . UndoToken > { private final Activity mActivity ; DeleteLogTask ( Activity a ) { } @ Override protected UndoToken doInBackground ( GameLog ... log ) { } @ Override protected void onPostExecute ( GameLogListManager . UndoToken undo ) { } } private class SaveLogInSdcardTask extends AsyncTask < GameLog , String , String > { private final Activity mActivity ; SaveLogInSdcardTask ( Activity a ) { } @ Override protected String doInBackground ( GameLog ... log ) { } @ Override protected void onPostExecute ( String unused ) { } } private class UndoTask extends AsyncTask < GameLogListManager . UndoToken , String , String > { private final Activity mActivity ; UndoTask ( Activity a ) { } @ Override protected String doInBackground ( GameLogListManager ... token ) { } @ Override protected void onPostExecute ( String unused ) { } } @ Override public boolean onContextItemSelected ( MenuItem item ) { } private void updateUndoMenu ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
Collection < GameLog > list = mGameLogList . listLogs ( this , mMode ) ;
Buggy code:
public class AssertStatement extends Statement { public Expression assertExpression ; public Expression exceptionArgument ; int preAssertInitStateIndex = - 1 ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { } public AssertStatement ( Expression assertExpression , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; SourceTypeBinding outerMostClass = currentScope . enclosingSourceType ( ) ; while ( outerMostClass . isLocalType ( ) ) { ReferenceBinding enclosing = outerMostClass . enclosingType ( ) ; if ( ( enclosing == null ) || ( enclosing . isInterface ( ) ) ) break ; outerMostClass = ( ( SourceTypeBinding ) ( enclosing ) ) ; } this . assertionSyntheticFieldBinding = outerMostClass . addSyntheticField ( this , currentScope ) ; TypeDeclaration typeDeclaration = outerMostClass . scope . referenceType ( ) ; AbstractMethodDeclaration [ ] methods = typeDeclaration . methods ; for ( int i = 0 , max = methods . length ; i < max ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( method . isClinit ( ) ) { <START_BUG> ( ( Clinit ) ( method ) ) . addSupportForAssertion ( assertionSyntheticFieldBinding ) ; <END_BUG> break ; } } } public String toString ( int tab ) { } }

Fix:
( ( Clinit ) ( method ) ) . setAssertionSupport ( assertionSyntheticFieldBinding ) ;
Buggy code:
public class HexBinaryDatatypeValidator extends AbstractStringValidator { public HexBinaryDatatypeValidator ( ) throws InvalidDatatypeFacetException { } public HexBinaryDatatypeValidator ( DatatypeValidator base , Hashtable facets , boolean derivedByList ) throws InvalidDatatypeFacetException { } protected void assignAdditionalFacets ( String key , Hashtable facets ) throws InvalidDatatypeFacetException { } protected void checkValueSpace ( String content ) throws InvalidDatatypeValueException { } protected int getLength ( String content ) { <START_BUG> return HexBin . getDataLength ( content . getBytes ( ) ) ; <END_BUG> } public Object clone ( ) throws CloneNotSupportedException { } }

Fix:
return HexBin . getDecodedDataLength ( content . getBytes ( ) ) ;
Buggy code:
public class BrokerFactoryEventManager extends AbstractConcurrentEventManager { private static final Localizer _loc = Localizer . forPackage ( BrokerFactoryEventManager . class ) ; private final Configuration _conf ; public BrokerFactoryEventManager ( Configuration conf ) { } protected void fireEvent ( Object event , Object listener ) { try { BrokerFactoryEvent e = ( ( BrokerFactoryEvent ) ( event ) ) ; <START_BUG> ( ( BrokerFactoryListener ) ( listener ) ) . afterBrokerFactoryCreate ( e ) ; <END_BUG> } catch ( Exception e ) { _conf . getLog ( LOG_RUNTIME ) . warn ( BrokerFactoryEventManager . _loc . get ( "broker-factory-listener-exception" ) , e ) ; } } }

Fix:
( ( BrokerFactoryListener ) ( listener ) ) . eventFired ( e ) ;
Buggy code:
public class Pathfinding { private GameState gameState ; private ArrayList < Integer > [ ] graph ; private int [ ] previous ; private int [ ] distance ; private int [ ] [ ] length ; private boolean [ ] scanned ; public Coordinate nextStepToGoal ; private int stepsToGoal = - 1 ; public PriorityQueue < Coordinate > queue ; public Pathfinding ( GameState gameState ) { } public Coordinate getNextStepToGoal ( ) { } public int getStepsToGoal ( ) { } public void resetState ( ) { } public void calculateShortestPath ( Coordinate start , Coordinate goal ) { } public void updateResults ( Coordinate start , Coordinate goal ) { int target = convertToInt ( goal . getX ( ) , goal . getY ( ) ) ; this . stepsToGoal = 0 ; ArrayDeque < Coordinate > nodesToTarget = new ArrayDeque < Coordinate > ( ) ; while ( ( this . previous [ target ] ) != 0 ) { nodesToTarget . add ( convertFromInt ( target ) ) ; target = this . previous [ target ] ; ( this . stepsToGoal ) ++ ; if ( ( this . stepsToGoal ) > 10000 ) { this . stepsToGoal = - 1 ; break ; } } Coordinate coordinate = null ; while ( ! ( nodesToTarget . isEmpty ( ) ) ) { coordinate = nodesToTarget . poll ( ) ; } <START_BUG> if ( coordinate != null ) { <END_BUG> this . nextStepToGoal = coordinate ; } else { this . nextStepToGoal = null ; } } public int convertToInt ( int x , int y ) { } public int convertToInt ( Coordinate coordinate ) { } public Coordinate convertFromInt ( int i ) { } }

Fix:
if ( ( coordinate != null ) && ( ( this . stepsToGoal ) != ( - 1 ) ) ) {
Buggy code:
public class EnglishLetterDecoderEncoder implements LetterDecoderEncoder { public static final int ENGLISH_SMALL_LETTER_OFFSET = 96 ; public static int SUFFIX_LENGTH = 6 ; public static final int DASH_CHAR = 45 ; public static final int DASH_CODE = 27 ; public Integer encode ( String string ) { if ( ( string . length ( ) ) > 6 ) throw new SuffixToLongException ( ( "Suffix<seq2seq4repair_space>length<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>greater<seq2seq4repair_space>then<seq2seq4repair_space>" + 12 ) ) ; int result = 0 ; for ( int i = 0 ; i < ( string . length ( ) ) ; i ++ ) { int c = ( 0 + ( string . charAt ( i ) ) ) - ( EnglishLetterDecoderEncoder . ENGLISH_SMALL_LETTER_OFFSET ) ; if ( c == ( 45 - ( EnglishLetterDecoderEncoder . ENGLISH_SMALL_LETTER_OFFSET ) ) ) { c = EnglishLetterDecoderEncoder . DASH_CODE ; } if ( ( c < 0 ) || ( c > 27 ) ) <START_BUG> throw new WrongCharaterException ( ( ( "Symblo<seq2seq4repair_space>" + ( string . charAt ( i ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>small<seq2seq4repair_space>cirillic<seq2seq4repair_space>letter" ) ) ; <END_BUG> result = ( result * 28 ) + c ; } for ( int i = string . length ( ) ; i < 6 ; i ++ ) { result *= 28 ; } return result ; } public int [ ] encodeToArray ( String s ) { } public String decodeArray ( int [ ] array ) { } public String decode ( Integer suffixN ) { } public boolean checkCharacter ( char c ) { } public boolean checkString ( String word ) { } public String cleanString ( String s ) { } }

Fix:
throw new WrongCharaterException ( ( ( "Symbol<seq2seq4repair_space>" + ( string . charAt ( i ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>small<seq2seq4repair_space>cirillic<seq2seq4repair_space>letter" ) ) ;
Buggy code:
class SettingsReloader implements EBComponent { public void handleMessage ( EBMessage msg ) { } private void maybeReload ( String path ) { String jEditHome = jEdit . getJEditHome ( ) ; String settingsDirectory = jEdit . getSettingsDirectory ( ) ; if ( ! ( MiscUtilities . isURL ( path ) ) ) path = MiscUtilities . resolveSymlinks ( path ) ; if ( ( ( VFSManager . getVFSForPath ( path ) . getCapabilities ( ) ) & ( VFS . CASE_INSENSITIVE_CAP ) ) != 0 ) { path = path . toLowerCase ( ) ; jEditHome = jEditHome . toLowerCase ( ) ; settingsDirectory = settingsDirectory . toLowerCase ( ) ; } SearchFileSet fileset = SearchAndReplace . getSearchFileSet ( ) ; if ( fileset instanceof DirectoryListSet ) { DirectoryListSet dirset = ( ( DirectoryListSet ) ( fileset ) ) ; String dir = MiscUtilities . resolveSymlinks ( dirset . getDirectory ( ) ) ; <START_BUG> if ( path . startsWith ( dirset . getDirectory ( ) ) ) <END_BUG> dirset . invalidateCachedList ( ) ; } if ( ( jEditHome != null ) && ( path . startsWith ( jEditHome ) ) ) path = path . substring ( jEditHome . length ( ) ) ; else if ( ( settingsDirectory != null ) && ( path . startsWith ( settingsDirectory ) ) ) path = path . substring ( settingsDirectory . length ( ) ) ; else { return ; } if ( ( path . startsWith ( File . separator ) ) || ( path . startsWith ( "//" ) ) ) path = path . substring ( 1 ) ; if ( path . startsWith ( "macros" ) ) Macros . loadMacros ( ) ; else if ( ( path . startsWith ( "modes" ) ) && ( ( path . endsWith ( ".xml" ) ) || ( path . endsWith ( "catalog" ) ) ) ) jEdit . reloadModes ( ) ; } }

Fix:
if ( path . startsWith ( dir ) )
Buggy code:
public abstract class Range { public Range ( ) { } public abstract Number getMinimumNumber ( ) { } public long getMinimumLong ( ) { } public int getMinimumInteger ( ) { } public double getMinimumDouble ( ) { } public float getMinimumFloat ( ) { } public abstract Number getMaximumNumber ( ) { } public long getMaximumLong ( ) { } public int getMaximumInteger ( ) { } public double getMaximumDouble ( ) { } public float getMaximumFloat ( ) { } public abstract boolean containsNumber ( Number number ) { } public boolean containsLong ( Number value ) { } public boolean containsLong ( long value ) { } public boolean containsInteger ( Number value ) { } public boolean containsInteger ( int value ) { } public boolean containsDouble ( Number value ) { } public boolean containsDouble ( double value ) { } public boolean containsFloat ( Number value ) { } public boolean containsFloat ( float value ) { } public boolean containsRange ( Range range ) { } public boolean overlapsRange ( Range range ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( 32 ) ; <END_BUG> buf . append ( "Range[" ) ; buf . append ( getMinimumNumber ( ) ) ; buf . append ( ',' ) ; buf . append ( getMaximumNumber ( ) ) ; buf . append ( ']' ) ; return buf . toString ( ) ; } }

Fix:
StringBuilder buf = new StringBuilder ( 32 ) ;
Buggy code:
public class UrlPathHelper { private static final String WEBSPHERE_URI_ATTRIBUTE = "com.ibm.websphere.servlet.uri_non_decoded" ; private static final Log logger = LogFactory . getLog ( UrlPathHelper . class ) ; static volatile Boolean websphereComplianceFlag ; private boolean alwaysUseFullPath = false ; private boolean urlDecode = true ; private boolean removeSemicolonContent = true ; private String defaultEncoding = WebUtils . DEFAULT_CHARACTER_ENCODING ; public void setAlwaysUseFullPath ( boolean alwaysUseFullPath ) { } public void setUrlDecode ( boolean urlDecode ) { } public void setRemoveSemicolonContent ( boolean removeSemicolonContent ) { } public boolean shouldRemoveSemicolonContent ( ) { } public void setDefaultEncoding ( String defaultEncoding ) { } protected String getDefaultEncoding ( ) { } public String getLookupPathForRequest ( HttpServletRequest request ) { } public String getPathWithinServletMapping ( HttpServletRequest request ) { } public String getPathWithinApplication ( HttpServletRequest request ) { } private String getRemainingPath ( String requestUri , String mapping , boolean ignoreCase ) { } public String getRequestUri ( HttpServletRequest request ) { } public String getContextPath ( HttpServletRequest request ) { } public String getServletPath ( HttpServletRequest request ) { } public String getOriginatingRequestUri ( HttpServletRequest request ) { } public String getOriginatingContextPath ( HttpServletRequest request ) { } public String getOriginatingServletPath ( HttpServletRequest request ) { } public String getOriginatingQueryString ( HttpServletRequest request ) { } private String decodeAndCleanUriString ( HttpServletRequest request , String uri ) { } public String decodeRequestString ( HttpServletRequest request , String source ) { } @ SuppressWarnings ( "deprecation" ) private String decodeInternal ( HttpServletRequest request , String source ) { } protected String determineEncoding ( HttpServletRequest request ) { } public String removeSemicolonContent ( String requestUri ) { } private String removeSemicolonContentInternal ( String requestUri ) { } private String removeJsessionid ( String requestUri ) { <START_BUG> int startIndex = requestUri . indexOf ( ";jsessionid=" ) ; <END_BUG> if ( startIndex != ( - 1 ) ) { int endIndex = requestUri . indexOf ( ';' , ( startIndex + 12 ) ) ; String start = requestUri . substring ( 0 , startIndex ) ; requestUri = ( endIndex != ( - 1 ) ) ? start + ( requestUri . substring ( endIndex ) ) : start ; } return requestUri ; } public Map < String , String > decodePathVariables ( HttpServletRequest request , Map < String , String > vars ) { } public MultiValueMap < String , String > decodeMatrixVariables ( HttpServletRequest request , MultiValueMap < String , String > vars ) { } private boolean shouldRemoveTrailingServletPathSlash ( HttpServletRequest request ) { } }

Fix:
int startIndex = requestUri . toLowerCase ( ) . indexOf ( ";jsessionid=" ) ;
Buggy code:
public class LoadFileTest extends BuildFileTest { public LoadFileTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testNoSourcefileDefined ( ) { } public void testNoPropertyDefined ( ) { } public void testNoSourcefilefound ( ) { <START_BUG> expectBuildExceptionContaining ( "testNoSourcefilefound" , "File<seq2seq4repair_space>not<seq2seq4repair_space>found" , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>file" ) ; <END_BUG> } public void testFailOnError ( ) throws BuildException { } public void testLoadAFile ( ) throws BuildException { } public void testLoadAFileEnc ( ) throws BuildException { } public void testEvalProps ( ) throws BuildException { } public void testFilterChain ( ) throws BuildException { } public final void testStripJavaComments ( ) throws BuildException { } public void testOneLine ( ) throws BuildException { } }

Fix:
expectBuildExceptionContaining ( "testNoSourcefilefound" , "File<seq2seq4repair_space>not<seq2seq4repair_space>found" , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>resource" ) ;