nus-yam/ex-repair huggingface dataset:
Buggy code:
public class domainCreateServiceTest extends BaseTest { @ Autowired @ Qualifier ( "domainCreateServiceImpl" ) private UpdateService < DomainDto , Domain > createService ; @ Test public void test_invalid_unicodeName_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_status_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_variant_idnTable_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_variant_relation_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_variant_ldhName_exceedMaxLength ( ) throws Exception { DomainDto dto = generateDomainDto ( ) ; List < VariantDto > variantDto = new ArrayList < VariantDto > ( ) ; dto . setVariants ( variantDto ) ; VariantDto v = new VariantDto ( ) ; v . setIdnTable ( "idnTable" ) ; variantDto . add ( v ) ; <START_BUG> String stringExceedOneMoreChar = createStringWithLength ( ( ( UpdateValidateUtil . MAX_LENGTH_HANDLE ) + 1 ) ) ; <END_BUG> List < VariantNameDto > variantNames = new ArrayList < VariantNameDto > ( ) ; VariantNameDto name = new VariantNameDto ( ) ; variantNames . add ( name ) ; name . setLdhName ( stringExceedOneMoreChar ) ; v . setVariantNames ( variantNames ) ; UpdateResponse response = createService . execute ( dto ) ; assertNotNull ( response ) ; assertEquals ( 400 , response . getErrorCode ( ) ) ; assertEquals ( 4003 , response . getSubErrorCode ( ) ) ; } @ Test public void test_invalid_variant_unicodeName_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_secureDns_maxSigLife_exceedMin ( ) throws Exception { } @ Test public void test_invalid_secureDns_maxSigLife_exceedMax ( ) throws Exception { } @ Test public void test_invalid_secureDns_ds_keyTag_exceedMax ( ) throws Exception { } @ Test public void test_invalid_secureDns_ds_keyTag_exceedMin ( ) throws Exception { } @ Test public void test_invalid_secureDns_key_flags_exceedMin ( ) throws Exception { } @ Test public void test_invalid_secureDns_key_flags_exceedMax ( ) throws Exception { } @ Test public void test_invalid_entities_role_maxLength ( ) throws Exception { } @ Test public void test_invalid_entities_role_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_publicId_identifier_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_remark_title_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_link_title_exceedMaxLength ( ) throws Exception { } @ Test public void test_invalid_event_action_exceedMaxLength ( ) throws Exception { } private DomainDto generateDomainDto ( ) { } private String createStringWithLength ( int length ) { } }

Fix:
String stringExceedOneMoreChar = createStringWithLength ( ( ( UpdateValidateUtil . MAX_LENGTH_LDHNAME ) + 1 ) ) ;
Buggy code:
public class AbstractActionTest { @ Test public void buildRestUrlWithValidParameters ( ) { } @ Test public void buildUrlWithRequestParameterWithMultipleValues ( ) { } @ Test public void testEqualsAndHashcode ( ) { } @ Test public void restMethodNameMultipleClientRequest ( ) { } @ Test public void requestDataMultipleClientRequest ( ) { } @ Test public void getIdFromNullSource ( ) { } @ Test public void getIdFromSourceWithoutAnnotation ( ) { } @ Test public void getIdFromSourceWithAnnotation ( ) { } @ Test public void getIdFromSourceWithAnnotationWithNullId ( ) { } static class DummyAction extends GenericResultAbstractAction { public DummyAction ( AbstractActionTest . DummyAction . Builder builder ) { } @ Override public String getRestMethodName ( ) { } public static class Builder extends AbstractAction . Builder < AbstractActionTest . DummyAction , AbstractActionTest . DummyAction . Builder > { @ Override public AbstractActionTest . DummyAction build ( ) { } } } @ Test public void convertJsonStringToMapObject ( ) { } @ Test public void convertEmptyJsonStringToMapObject ( ) { } @ Test public void convertNullJsonStringToMapObject ( ) { } @ Test ( expected = JsonSyntaxException . class ) public void propagateExceptionWhenTheResponseIsNotJson ( ) { } @ Test public void getSuccessIndexResult ( ) { } @ Test public void getFailedIndexResult ( ) { String jsonString = "{\"error\":\"Invalid<seq2seq4repair_space>index\",\"status\":400}" ; Index index = new Index . Builder ( "{\"abc\":\"dce\"}" ) . index ( "test" ) . build ( ) ; JestResult result = index . createNewElasticSearchResult ( jsonString , 400 , null , new Gson ( ) ) ; assertFalse ( result . isSucceeded ( ) ) ; <START_BUG> assertEquals ( "Invalid<seq2seq4repair_space>index" , result . getErrorMessage ( ) ) ; <END_BUG> } @ Test public void getSuccessDeleteResult ( ) { } @ Test public void getFailedDeleteResult ( ) { } @ Test public void getSuccessGetResult ( ) { } class Source { @ JestId String email ; String data ; Source ( String data , String email ) { } } No newline ; at end ; of file ; }

Fix:
assertEquals ( "\"Invalid<seq2seq4repair_space>index\"" , result . getErrorMessage ( ) ) ;
Buggy code:
public class ApplicationClientParsingDeploymentProcessor implements DeploymentUnitProcessor { private static final String APP_XML = "META-INF//application-client.xml" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( DeploymentTypeMarker . isType ( APPLICATION_CLIENT , deploymentUnit ) ) ) { return ; } final VirtualFile deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; final VirtualFile appXml = deploymentRoot . getChild ( ApplicationClientParsingDeploymentProcessor . APP_XML ) ; if ( appXml . exists ( ) ) { InputStream is = null ; try { is = appXml . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXmlResolver . create ( ) ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; ApplicationClientMetaData data = new ApplicationClientMetaDataParser ( ) . parse ( xmlReader ) ; deploymentUnit . putAttachment ( APPLICATION_CLIENT_META_DATA , data ) ; <START_BUG> DeploymentDescriptorEnvironment environment = new DeploymentDescriptorEnvironment ( "java:module//env" , data . getEnvironmentRefsGroupMetaData ( ) ) ; <END_BUG> deploymentUnit . putAttachment ( MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT , environment ) ; } catch ( XMLStreamException e ) { throw new DeploymentUnitProcessingException ( ( ( ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + appXml ) + "<seq2seq4repair_space>at<seq2seq4repair_space>[" ) + ( e . getLocation ( ) . getLineNumber ( ) ) ) + "," ) + ( e . getLocation ( ) . getColumnNumber ( ) ) ) + "]" ) ) ; } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + appXml ) , e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
DeploymentDescriptorEnvironment environment = new DeploymentDescriptorEnvironment ( "java:module//env//" , data . getEnvironmentRefsGroupMetaData ( ) ) ;
Buggy code:
public class GeolocationExtractor { public String [ ] latitudeExtractor ( File file ) { <START_BUG> String [ ] locationCoordinates = null ; <END_BUG> try { Metadata metadata = ImageMetadataReader . readMetadata ( file ) ; GpsDirectory gpsDirectory = metadata . getDirectory ( GpsDirectory . class ) ; if ( gpsDirectory != null ) { GeoLocation geoLocation = gpsDirectory . getGeoLocation ( ) ; if ( ! ( geoLocation . isZero ( ) ) ) { locationCoordinates = geoLocation . toString ( ) . split ( ",<seq2seq4repair_space>" ) ; } else return null ; } else { return null ; } } catch ( NullPointerException e2 ) { return null ; } catch ( ImageProcessingException e ) { return null ; } catch ( IOException e ) { throw Throwables . propagate ( e ) ; } return locationCoordinates ; } public String locationExtractor ( File file ) throws IOException { } public JsonElement getLocationInfo ( String lat , String lng ) { } private JsonElement readJson ( InputStream openStream ) { } public String getPlaceName ( JsonElement location ) { } public String handlePolishSigns ( String location ) { } }

Fix:
String [ ] locationCoordinates = new String [ 2 ] ;
Buggy code:
public class PhatLootsChest { public String world ; public int x ; public int y ; public int z ; public HashMap users = new HashMap ( ) ; public PhatLootsChest ( Block block ) { } public PhatLootsChest ( String world , int x , int y , int z ) { } public int [ ] getTime ( String player ) { } public boolean isBlock ( Block block ) { } @ Override public String toString ( ) { String string = ( ( ( ( ( ( ( world ) + "'" ) + ( x ) ) + "'" ) + ( y ) ) + "'" ) + ( z ) ) + "{" ; Iterator itr = users . keySet ( ) . iterator ( ) ; while ( itr . hasNext ( ) ) { String key = ( ( String ) ( itr . next ( ) ) ) ; int [ ] time = getTime ( key ) ; <START_BUG> string = string . concat ( ( ( ( ( ( ( ( ( key + "@" ) + ( time [ 0 ] ) ) + "'" ) + ( time [ 1 ] ) ) + "'" ) + ( time [ 2 ] ) ) + "'" ) + ( time [ 3 ] ) ) ) ; <END_BUG> if ( itr . hasNext ( ) ) string = string . concat ( ",<seq2seq4repair_space>" ) ; } return string . concat ( "}" ) ; } No newline ; at end ; of file ; }

Fix:
string = string . concat ( ( ( ( ( ( ( ( ( ( ( key + "@" ) + ( time [ 0 ] ) ) + "'" ) + ( time [ 1 ] ) ) + "'" ) + ( time [ 2 ] ) ) + "'" ) + ( time [ 3 ] ) ) + "'" ) + ( time [ 4 ] ) ) ) ;
Buggy code:
@ Component public class UserOrdinaturValidator implements GDEWebConstants , Validator { @ Autowired private FileValidator fileValidator ; @ Override public boolean supports ( final Class < ? > aClass ) { } @ Override public void validate ( final Object object , final Errors err ) { } protected void validateRequiredData ( final UserOrdinaturDetailDto dto , final Errors err ) { } protected void validateData ( final UserOrdinaturDetailDto dto , final Errors err ) { try { if ( ( ! ( GDEStringUtils . isNullOrEmpty ( dto . getStartDate ( ) ) ) ) && ( ! ( GDEStringUtils . isNullOrEmpty ( dto . getEndDate ( ) ) ) ) ) { if ( ! ( DateUtil . compareStringDates ( dto . getStartDate ( ) , dto . getEndDate ( ) , DISPLAY_FORMAT ) ) ) { err . rejectValue ( "userOrdinaturDetailDto.endDate" , "invalid.end.date" ) ; } } if ( ( ! ( GDEStringUtils . isNullOrEmpty ( dto . getValidUntil ( ) ) ) ) && ( ! ( GDEStringUtils . isNullOrEmpty ( dto . getEndDate ( ) ) ) ) ) { if ( ! ( DateUtil . compareStringDates ( dto . getEndDate ( ) , dto . getValidUntil ( ) , DISPLAY_FORMAT ) ) ) { <START_BUG> err . rejectValue ( "userOrdinaturDetailDto.validUntil" , "invalid.end.date" ) ; <END_BUG> } } if ( ( ! ( GDEStringUtils . isNullOrEmpty ( dto . getStartDateAcademic ( ) ) ) ) && ( ! ( GDEStringUtils . isNullOrEmpty ( dto . getEndDateAcademic ( ) ) ) ) ) { if ( ! ( DateUtil . compareStringDates ( dto . getStartDateAcademic ( ) , dto . getEndDateAcademic ( ) , DISPLAY_FORMAT ) ) ) { err . rejectValue ( "userOrdinaturDetailDto.endDateAcademic" , "invalid.end.date" ) ; } } List < DocumentDto > documentDtoList = new ArrayList < DocumentDto > ( ) ; dto . getCertificateOrdinatur ( ) . setHtmlPath ( "userOrdinaturDetailDto.certificateOrdinatur.file" ) ; dto . getCertificateAcademicRank ( ) . setHtmlPath ( "userOrdinaturDetailDto.certificateAcademicRank.file" ) ; if ( ( ( dto . getCertificateOrdinatur ( ) . getFile ( ) ) != null ) && ( ! ( dto . getCertificateOrdinatur ( ) . getFile ( ) . isEmpty ( ) ) ) ) { documentDtoList . add ( dto . getCertificateOrdinatur ( ) ) ; } if ( ( ( dto . getCertificateAcademicRank ( ) . getFile ( ) ) != null ) && ( ! ( dto . getCertificateAcademicRank ( ) . getFile ( ) . isEmpty ( ) ) ) ) { documentDtoList . add ( dto . getCertificateAcademicRank ( ) ) ; } List < String > hashValueList = new ArrayList < String > ( ) ; if ( ( documentDtoList != null ) && ( ( documentDtoList . size ( ) ) > 0 ) ) { for ( DocumentDto documentDto : documentDtoList ) { documentDto . setHashValue ( GDEFileUtil . getHashValue ( documentDto . getFile ( ) ) ) ; if ( hashValueList . contains ( documentDto . getHashValue ( ) ) ) { err . rejectValue ( documentDto . getHtmlPath ( ) , "file.already.uploaded.error" ) ; } else { fileValidator . validate ( documentDto , err ) ; } hashValueList . add ( documentDto . getHashValue ( ) ) ; } } } catch ( Exception e ) { throw new GDEException ( e ) ; } } }

Fix:
err . rejectValue ( "userOrdinaturDetailDto.validUntil" , "invalid.validuntil.date" ) ;
Buggy code:
public class CountryDataService { public static List < Country > get ( String query , String field , String tableName ) { } public static Country getItem ( int country_id , String tableName , String field ) { } public static void create ( Country country ) { try ( Connection conn = sql2o . open ( ) ) { <START_BUG> String sql = "insert<seq2seq4repair_space>into<seq2seq4repair_space>country<seq2seq4repair_space>(country,<seq2seq4repair_space>last_update)<seq2seq4repair_space>values<seq2seq4repair_space>(:country_id,<seq2seq4repair_space>:country,<seq2seq4repair_space>:last_update)" ; <END_BUG> conn . createQuery ( sql ) . addParameter ( "country_id" , country . country_id ) . addParameter ( "country" , country . country ) . addParameter ( "last_update" , country . last_update ) . executeUpdate ( ) ; } } public static void delete ( int country_id ) { } public static void update ( Country country ) { } public static boolean isNumeric ( String str ) { } }

Fix:
String sql = "insert<seq2seq4repair_space>into<seq2seq4repair_space>country<seq2seq4repair_space>(country_id,<seq2seq4repair_space>country,<seq2seq4repair_space>last_update)<seq2seq4repair_space>values<seq2seq4repair_space>(:country_id,<seq2seq4repair_space>:country,<seq2seq4repair_space>:last_update)" ;
Buggy code:
public class RaAdd extends AbstractAddStepHandler { static final RaAdd INSTANCE = new RaAdd ( ) ; @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override public void performRuntime ( final OperationContext context , ModelNode operation , ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { final ModelNode address = operation . require ( OP_ADDR ) ; final String name = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; final String archiveOrModuleName ; if ( ( ! ( model . hasDefined ( Constants . ARCHIVE . getName ( ) ) ) ) && ( ! ( model . hasDefined ( Constants . MODULE . getName ( ) ) ) ) ) { throw ROOT_LOGGER . archiveOrModuleRequired ( ) ; } if ( model . get ( Constants . ARCHIVE . getName ( ) ) . isDefined ( ) ) { archiveOrModuleName = model . get ( Constants . ARCHIVE . getName ( ) ) . asString ( ) ; } else { archiveOrModuleName = model . get ( Constants . MODULE . getName ( ) ) . asString ( ) ; } ModifiableResourceAdapter resourceAdapter = RaOperationUtil . buildResourceAdaptersObject ( name , context , operation , archiveOrModuleName ) ; if ( model . get ( Constants . ARCHIVE . getName ( ) ) . isDefined ( ) ) { RaOperationUtil . installRaServices ( context , verificationHandler , name , resourceAdapter , newControllers ) ; } else { RaOperationUtil . installRaServicesAndDeployFromModule ( context , verificationHandler , name , resourceAdapter , archiveOrModuleName , newControllers ) ; if ( context . isBooting ( ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( final OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceVerificationHandler svh = new ServiceVerificationHandler ( ) ; ServiceName restartedServiceName = RaOperationUtil . restartIfPresent ( context , archiveOrModuleName , name , svh ) ; if ( restartedServiceName == null ) { <START_BUG> RaOperationUtil . activate ( context , name , svh ) ; <END_BUG> } context . addStep ( svh , VERIFY ) ; context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { try { RaOperationUtil . removeIfActive ( context , archiveOrModuleName , name ) ; } catch ( OperationFailedException e ) { } } } ) ; } } , RUNTIME ) ; } } } }

Fix:
RaOperationUtil . activate ( context , name , archiveOrModuleName , svh ) ;
Buggy code:
public class GoClassifierToStr implements TreeModelPrereqs { public String toString ( ) { <START_BUG> return Localizer . localize ( "Tree" , "Class->Attribute" ) ; <END_BUG> } public Object getRoot ( ) { } public void setRoot ( Object r ) { } public Object getChild ( Object parent , int index ) { } public int getChildCount ( Object parent ) { } public int getIndexOfChild ( Object parent , Object child ) { } public boolean isLeaf ( Object node ) { } public void valueForPathChanged ( TreePath path , Object newValue ) { } public void addTreeModelListener ( TreeModelListener l ) { } public void removeTreeModelListener ( TreeModelListener l ) { } public Vector getPrereqs ( ) { } public Vector getProvidedTypes ( ) { } }

Fix:
return Localizer . localize ( "Tree" , "misc.class.attribute" ) ;
Buggy code:
i < 64 ; i ++ ) aframe [ i ] = 0 ; dataP = 4 ; flagP = 0 ; flagCnt = 1 ; } } switch ( flagCnt ) { case 0 : aframe [ flagP ] = ( ( byte ) ( 192 ) ) ; flagCnt ++ ; break ; case 1 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 48 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt ++ ; break ; case 2 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 12 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt ++ ; break ; case 3 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 3 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt = 0 ; flagP ++ ; break ; } aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( diff > > > 24 ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( diff > > > 16 ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( diff > > > 8 ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( diff & 255 ) ) ; } else { if ( ! preShort ) { preDiff = diff ; preShort = true ; } else { preShort = false ; switch ( flagCnt ) { case 0 : aframe [ flagP ] = ( ( byte ) ( 128 ) ) ; flagCnt ++ ; break ; case 1 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 32 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt ++ ; break ; case 2 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 8 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt ++ ; break ; case 3 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 2 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt = 0 ; flagP ++ ; break ; } aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( ( short ) ( preDiff > > > 8 ) ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( ( short ) ( preDiff ) ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( ( short ) ( diff > > > 8 ) ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( ( short ) ( diff ) ) & 255 ) ) ; } } pre = cur ; if ( dataP == 64 ) { mseedFile . write ( aframe ) ; fileSize += 64 ; for ( int i = 0 ; i < 64 ; i ++ ) aframe [ i ] = 0 ; dataP = 4 ; flagP = 0 ; flagCnt = 1 ; } else if ( p == dataCnt ) { <START_BUG> if ( preShort = true ) { <END_BUG> switch ( flagCnt ) { case 0 : aframe [ flagP ] = ( ( byte ) ( 192 ) ) ; flagCnt ++ ; break ; case 1 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 48 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt ++ ; break ; case 2 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 12 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt ++ ; break ; case 3 : aframe [ flagP ] = ( ( byte ) ( ( ( ( ( ( aframe [ flagP ] ) & 255 ) | 3 ) << 24 ) > > > 24 ) & 255 ) ) ; flagCnt = 0 ; flagP ++ ; break ; } aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( preDiff > > > 24 ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( preDiff > > > 16 ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( ( preDiff > > > 8 ) & 255 ) ) ; aframe [ ( dataP ++ ) ] = ( ( byte ) ( preDiff & 255 ) ) ; } mseedFile . write ( aframe ) ; fileSize += 64 ; } } long realSize = 1 ; int powOfTwo = 0 ; while ( realSize < fileSize ) { realSize = realSize << 1 ; powOfTwo ++ ; } for ( int i = 0 ; i < 64 ;

Fix:
if ( preShort == true ) {
Buggy code:
public class Elevator extends Subsystem { public Elevator ( ) { } CANTalon elevTalon = new CANTalon ( 5 ) ; Encoder e1 = new Encoder ( 6 , 7 ) ; DigitalInput d6 = new DigitalInput ( 8 ) ; DigitalInput d7 = new DigitalInput ( 9 ) ; @ Override protected void initDefaultCommand ( ) { } public void zero ( ) { } public void up ( ) { <START_BUG> if ( ! ( d6 . get ( ) ) ) { <END_BUG> elevTalon . set ( 1 ) ; } } public void down ( ) { } public void gamePadControl ( Joystick stick ) { } }

Fix:
if ( ! ( d7 . get ( ) ) ) {
Buggy code:
@ WebServlet ( name = "LoginServlet" , urlPatterns = { "//login" } ) public class LoginServlet extends HttpServlet { @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { String email = ( ( String ) ( req . getParameter ( "email" ) ) ) ; String password = ( ( String ) ( req . getParameter ( "password" ) ) ) ; if ( ( email . isEmpty ( ) ) || ( password . isEmpty ( ) ) ) { req . setAttribute ( "erreur" , "Vous<seq2seq4repair_space>devez<seq2seq4repair_space>remplir<seq2seq4repair_space>les<seq2seq4repair_space>deux<seq2seq4repair_space>champs." ) ; getServletContext ( ) . getRequestDispatcher ( "login.jsp" ) . forward ( req , resp ) ; } else { req . setAttribute ( "email" , email ) ; req . setAttribute ( "password" , password ) ; <START_BUG> speakerLogin = ( ( Speaker ) ( DaoFactory . getDaoFactory ( ) . getSpeakerDao ( ) . login ( email , password ) ) ) ; <END_BUG> getServletContext ( ) . getRequestDispatcher ( "intervention.jsp" ) . forward ( req , resp ) ; } } }

Fix:
Speaker speakerLogin = ( ( Speaker ) ( DaoFactory . getDaoFactory ( ) . getSpeakerDao ( ) . login ( email , password ) ) ) ;
Buggy code:
public class jlink extends Object { public void setOutfile ( String outfile ) { } public void addMergeFile ( String mergefile ) { } public void addAddFile ( String addfile ) { } public void addMergeFiles ( String [ ] mergefiles ) { } public void addAddFiles ( String [ ] addfiles ) { } public void setCompression ( boolean compress ) { } public void link ( ) throws Exception { } public static void main ( String [ ] args ) { } private void mergeZipJarContents ( ZipOutputStream output , File f ) throws IOException { if ( ! ( f . exists ( ) ) ) { return ; } ZipFile zipf = new ZipFile ( f ) ; Enumeration entries = zipf . entries ( ) ; while ( entries . hasMoreElements ( ) ) { ZipEntry inputEntry = ( ( ZipEntry ) ( entries . nextElement ( ) ) ) ; String inputEntryName = inputEntry . getName ( ) ; int index = inputEntryName . indexOf ( "META-INF" ) ; if ( index < 0 ) { try { output . putNextEntry ( processEntry ( zipf , inputEntry ) ) ; } catch ( ZipException ex ) { String mess = ex . getMessage ( ) ; <START_BUG> if ( ( mess . indexOf ( "duplicate" ) ) > 0 ) { <END_BUG> continue ; } else { throw ex ; } } InputStream in = zipf . getInputStream ( inputEntry ) ; int len = buffer . length ; int count = - 1 ; while ( ( count = in . read ( buffer , 0 , len ) ) > 0 ) { output . write ( buffer , 0 , count ) ; } in . close ( ) ; output . closeEntry ( ) ; } } zipf . close ( ) ; } private void addDirContents ( ZipOutputStream output , File dir , String prefix , boolean compress ) throws IOException { } private String getEntryName ( File file , String prefix ) { } private void addFile ( ZipOutputStream output , File file , String prefix , boolean compress ) throws IOException { } private void addToOutputStream ( ZipOutputStream output , InputStream input , ZipEntry ze ) throws IOException { } private ZipEntry processEntry ( ZipFile zip , ZipEntry inputEntry ) throws IOException { } private long calcChecksum ( File f ) throws IOException { } private long calcChecksum ( InputStream in , long size ) throws IOException { } private String outfile = null ; private Vector mergefiles = new Vector ( 10 ) ; private Vector addfiles = new Vector ( 10 ) ; private boolean compression = false ; byte [ ] buffer = new byte [ 8192 ] ; }

Fix:
if ( ( mess . indexOf ( "duplicate" ) ) >= 0 ) {
Buggy code:
public class CompareModel implements Runnable { private Thread t ; private ArrayList < File > searchFiles ; private GUICreator guiC ; private ListChangeListener . Change < ? extends FileModelForTableView > file ; public CompareModel ( ArrayList < File > fileList , GUICreator guiC , ListChangeListener . Change < ? extends FileModelForTableView > file ) { } public void run ( ) { } public void start ( ) { } public void compareToSearch ( FileModelForTableView source ) { BufferedImage sourceImage = null ; BufferedImage targetImage = null ; Double similarity ; this . guiC . getDuplicateTable ( ) . removeItems ( ) ; try { sourceImage = ImageIO . read ( source . getFilePath ( ) . toURL ( ) ) ; Integer i = 0 ; for ( File fm : this . searchFiles ) { targetImage = ImageIO . read ( fm . toURI ( ) . toURL ( ) ) ; similarity = this . percentageSimilarity ( sourceImage , targetImage ) ; if ( similarity > 0 ) { <START_BUG> this . guiC . fillDuplicateTableList ( new FileModelForTableView ( fm . getName ( ) , fm . getPath ( ) , similarity . toString ( ) ) ) ; <END_BUG> } i ++ ; this . guiC . comparsionProgress . setProgress ( ( ( ( double ) ( i ) ) // ( this . searchFiles . size ( ) ) ) ) ; } } catch ( IOException e ) { System . out . println ( e . getMessage ( ) ) ; } } private Double percentageSimilarity ( BufferedImage sourceImage , BufferedImage targetImage ) { } }

Fix:
this . guiC . fillDuplicateTableList ( new FileModelForTableView ( false , fm . getName ( ) , fm . getPath ( ) , similarity . toString ( ) ) ) ;
Buggy code:
public class PermissionUtil { public static PermissionOverride getFullPermOverride ( ) { } public static boolean checkPermission ( User user , Permission perm , Channel channel ) { } public static boolean checkPermission ( User user , Permission perm , Guild guild ) { } public static int getEffectivePermission ( User user , Channel channel ) { } private static boolean checkPermission ( User user , Permission perm , GuildImpl guild , Map < Role , PermissionOverride > roleOverrides , Map < User , PermissionOverride > userOverrides ) { if ( PermissionUtil . checkPermission ( user , MANAGE_ROLES , guild ) ) return true ; int effectivePerms = PermissionUtil . getEffectivePermission ( user , guild , roleOverrides , userOverrides ) ; <START_BUG> return ( effectivePerms & ( 1 << ( perm . getOffset ( ) ) ) ) > 0 ; <END_BUG> } private static int getEffectivePermission ( User user , GuildImpl guild , Map < Role , PermissionOverride > roleOverrides , Map < User , PermissionOverride > userOverrides ) { } private static int apply ( int permission , int allow , int deny ) { } }

Fix:
return ( ( effectivePerms & ( 1 << ( MANAGE_PERMISSIONS . getOffset ( ) ) ) ) | ( effectivePerms & ( 1 << ( perm . getOffset ( ) ) ) ) ) > 0 ;
Buggy code:
public class AddContact extends AppCompatActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } public boolean onCreateOptionsMenu ( Menu menu ) { <START_BUG> getMenuInflater ( ) . inflate ( menu_about_contacts , menu ) ; <END_BUG> return true ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } No newline ; at end ; of file ; }

Fix:
getMenuInflater ( ) . inflate ( menu_add_contact , menu ) ;
Buggy code:
public class JDTCompilerAdapter extends DefaultCompilerAdapter { private static final char [ ] SEPARATOR_CHARS = new char [ ] { '//' , '\\' } ; private static final char [ ] ADAPTER_PREFIX = "#ADAPTER#" . toCharArray ( ) ; private static final char [ ] ADAPTER_ENCODING = "ENCODING#" . toCharArray ( ) ; private static final char [ ] ADAPTER_ACCESS = "ACCESS#" . toCharArray ( ) ; private static String compilerClass = "org.eclipse.jdt.internal.compiler.batch.Main" ; String logFileName ; Map customDefaultOptions ; private Map fileEncodings = null ; private Map dirEncodings = null ; private List accessRules = null ; public boolean execute ( ) throws BuildException { } protected Commandline setupJavacCommand ( ) throws BuildException { } private String [ ] processCompilerArguments ( Class javacClass ) { } private void checkCompilerArgs ( String [ ] args ) { } private void createClasspathArgument ( Commandline cmd , Path classpath ) { } protected void logAndAddFilesToCompile ( Commandline cmd ) { } private void addExtdirs ( Path extDirs , Path classpath ) { if ( extDirs == null ) { String extProp = System . getProperty ( "java.ext.dirs" ) ; if ( extProp != null ) { extDirs = new Path ( classpath . getProject ( ) , extProp ) ; } else { return ; } } String [ ] dirs = extDirs . list ( ) ; for ( int i = 0 ; i < ( dirs . length ) ; i ++ ) { File dir = classpath . getProject ( ) . resolveFile ( dirs [ i ] ) ; if ( ( dir . exists ( ) ) && ( dir . isDirectory ( ) ) ) { FileSet fs = new FileSet ( ) ; fs . setDir ( dir ) ; <START_BUG> fs . setIncludes ( "*" ) ; <END_BUG> classpath . addFileset ( fs ) ; } } } }

Fix:
fs . setIncludes ( "*.zip,*.jar" ) ;
Buggy code:
public class Board { public static final int BOARDHEIGHT = 6 ; public static final int BOARDWIDTH = 7 ; public static final int WINLENGTH = 4 ; private final int playerCount ; private final int [ ] [ ] board ; private final int [ ] lastMove ; public Board ( int playerCount ) { } public Board ( int playerCount , int boardWidth , int boardHeight ) { } protected Board ( int [ ] [ ] board , int [ ] lastMove , int playerCount ) { } public Board move ( int move , int player ) throws InvalidMoveException { } public boolean isLegalMove ( int move ) { } public int getField ( int x , int y ) { } public int getColumnSize ( int x ) { } public boolean isFull ( ) { boolean full = false ; int column = 0 ; while ( column <= ( Board . BOARDWIDTH ) ) { <START_BUG> full = full && ( ( getColumnSize ( column ) ) == ( ( Board . BOARDHEIGHT ) ++ ) ) ; <END_BUG> column ++ ; } return full ; } public int getWinner ( ) { } public int getBoardWidth ( ) { } public int getBoardHeight ( ) { } public String toString ( ) { } }

Fix:
full = full && ( ( getColumnSize ( column ) ) == ( Board . BOARDHEIGHT ) ) ;
Buggy code:
public class DormandPrince54StepInterpolatorTest { @ Test public void derivativesConsistency ( ) { } @ Test public void serialization ( ) throws IOException , ClassNotFoundException { } @ Test public void checkClone ( ) { TestProblem3 pb = new TestProblem3 ( 0.9 ) ; double minStep = 0 ; double maxStep = ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ; double scalAbsoluteTolerance = 1.0E-8 ; double scalRelativeTolerance = scalAbsoluteTolerance ; DormandPrince54Integrator integ = new DormandPrince54Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; integ . addStepHandler ( new StepHandler ( ) { public void handleStep ( StepInterpolator interpolator , boolean isLast ) { StepInterpolator cloned = interpolator . copy ( ) ; double tA = cloned . getPreviousTime ( ) ; double tB = cloned . getCurrentTime ( ) ; double halfStep = ( FastMath . abs ( ( tB - tA ) ) ) // 2 ; Assert . assertEquals ( interpolator . getPreviousTime ( ) , tA , 1.0E-12 ) ; Assert . assertEquals ( interpolator . getCurrentTime ( ) , tB , 1.0E-12 ) ; for ( int i = 0 ; i < 10 ; ++ i ) { double t = ( ( i * tB ) + ( ( 9 - i ) * tA ) ) // 9 ; interpolator . setInterpolatedTime ( t ) ; Assert . assertTrue ( ( ( FastMath . abs ( ( ( cloned . getInterpolatedTime ( ) ) - t ) ) ) > ( halfStep // 10 ) ) ) ; cloned . setInterpolatedTime ( t ) ; Assert . assertEquals ( t , cloned . getInterpolatedTime ( ) , 1.0E-12 ) ; double [ ] referenceState = interpolator . getInterpolatedState ( ) ; double [ ] cloneState = cloned . getInterpolatedState ( ) ; for ( int j = 0 ; j < ( referenceState . length ) ; ++ j ) { Assert . assertEquals ( referenceState [ j ] , cloneState [ j ] , 1.0E-12 ) ; } } } <START_BUG> public void reset ( ) { <END_BUG> } } ) ; integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; } }

Fix:
public void init ( double t0 , double [ ] y0 , double t ) {
Buggy code:
public class SiteModelInputEditor extends BEASTObjectInputEditor { private static final long serialVersionUID = 1L ; IntegerInputEditor categoryCountEditor ; JTextField categoryCountEntry ; InputEditor gammaShapeEditor ; ParameterInputEditor inVarEditor ; JCheckBox fixMeanRatesCheckBox ; DeltaExchangeOperator operator ; protected SmallLabel fixMeanRatesValidateLabel ; public SiteModelInputEditor ( BeautiDoc doc ) { } @ Override public Class < ? > type ( ) { } @ Override public void init ( Input < ? > input , BEASTInterface plugin , int itemNr , ExpandOption bExpandOption , boolean bAddButtons ) { fixMeanRatesCheckBox = new JCheckBox ( "Fix<seq2seq4repair_space>mean<seq2seq4repair_space>substitution<seq2seq4repair_space>rate" ) ; fixMeanRatesCheckBox . setName ( "FixMeanMutationRate" ) ; fixMeanRatesCheckBox . setEnabled ( ( ! ( doc . bAutoUpdateFixMeanSubstRate ) ) ) ; super . init ( input , plugin , itemNr , bExpandOption , bAddButtons ) ; List < Operator > operators = ( ( MCMC ) ( mcmc . get ( ) ) ) . operatorsInput . get ( ) ; fixMeanRatesCheckBox . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { JCheckBox averageRatesBox = ( ( JCheckBox ) ( e . getSource ( ) ) ) ; doFixMeanRates ( averageRatesBox . isSelected ( ) ) ; if ( averageRatesBox . isSelected ( ) ) setUpOperator ( ) ; } } ) ; operator = ( ( DeltaExchangeOperator ) ( pluginmap . get ( "FixMeanMutationRatesOperator" ) ) ) ; if ( ( operator ) == null ) { operator = new DeltaExchangeOperator ( ) ; try { operator . setID ( "FixMeanMutationRatesOperator" ) ; operator . initByName ( "weight" , 2.0 , "delta" , 0.75 ) ; } catch ( Throwable e1 ) { } doc . addPlugin ( operator ) ; } fixMeanRatesCheckBox . setSelected ( operators . contains ( operator ) ) ; Box box = Box . createHorizontalBox ( ) ; box . add ( fixMeanRatesCheckBox ) ; box . add ( Box . createHorizontalGlue ( ) ) ; fixMeanRatesValidateLabel = new SmallLabel ( "x" , Color . GREEN ) ; fixMeanRatesValidateLabel . setVisible ( false ) ; box . add ( fixMeanRatesValidateLabel ) ; <START_BUG> if ( ( ( alignments . size ( ) ) > 1 ) && ( ( operator ) != null ) ) { <END_BUG> JComponent component = ( ( JComponent ) ( getComponents ( ) [ 0 ] ) ) ; component . add ( box ) ; } setUpOperator ( ) ; } private void doFixMeanRates ( boolean averageRates ) { } public InputEditor createGammaCategoryCountEditor ( ) throws Exception { } void processEntry2 ( ) { } public InputEditor createShapeEditor ( ) throws Exception { } public InputEditor createProportionInvariantEditor ( ) throws Exception { } public static boolean customConnector ( BeautiDoc doc ) { } public void setUpOperator ( ) { } }

Fix:
if ( ( ( alignments . size ( ) ) >= 1 ) && ( ( operator ) != null ) ) {
Buggy code:
public class ColognePhonetic implements StringEncoder { private abstract class CologneBuffer { protected final char [ ] data ; protected int length = 0 ; public CologneBuffer ( char [ ] data ) { } public CologneBuffer ( int buffSize ) { } protected abstract char [ ] copyData ( int start , final int length ) { } public int length ( ) { } @ Override public String toString ( ) { } } private class CologneOutputBuffer extends ColognePhonetic . CologneBuffer { public CologneOutputBuffer ( int buffSize ) { } public void addRight ( char chr ) { } @ Override protected char [ ] copyData ( int start , final int length ) { } } private class CologneInputBuffer extends ColognePhonetic . CologneBuffer { public CologneInputBuffer ( char [ ] data ) { } public void addLeft ( char ch ) { } @ Override protected char [ ] copyData ( int start , final int length ) { } public char getNextChar ( ) { } protected int getNextPos ( ) { } public char removeNext ( ) { } } private static final char [ ] [ ] PREPROCESS_MAP = new char [ ] [ ] { new char [ ] { 'Ä' , 'A' } , new char [ ] { 'Ü' , 'U' } , new char [ ] { 'Ö' , 'O' } , new char [ ] { 'ß' , 'S' } } ; private static boolean arrayContains ( char [ ] arr , char key ) { } public String colognePhonetic ( String text ) { } public Object encode ( Object object ) throws EncoderException { if ( ! ( object instanceof String ) ) { <START_BUG> throw new EncoderException ( ( ( ( ( "This<seq2seq4repair_space>methodâ€™s<seq2seq4repair_space>parameter<seq2seq4repair_space>was<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>type<seq2seq4repair_space>" + ( String . class . getName ( ) ) ) + ".<seq2seq4repair_space>But<seq2seq4repair_space>actually<seq2seq4repair_space>it<seq2seq4repair_space>was<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>type<seq2seq4repair_space>" ) + ( object . getClass ( ) . getName ( ) ) ) + "." ) ) ; <END_BUG> } return encode ( ( ( String ) ( object ) ) ) ; } public String encode ( String text ) { } public boolean isEncodeEqual ( String text1 , String text2 ) { } private String preprocess ( String text ) { } }

Fix:
throw new EncoderException ( ( ( ( ( "This<seq2seq4repair_space>method's<seq2seq4repair_space>parameter<seq2seq4repair_space>was<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>type<seq2seq4repair_space>" + ( String . class . getName ( ) ) ) + ".<seq2seq4repair_space>But<seq2seq4repair_space>actually<seq2seq4repair_space>it<seq2seq4repair_space>was<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>type<seq2seq4repair_space>" ) + ( object . getClass ( ) . getName ( ) ) ) + "." ) ) ;
Buggy code:
public class HandlerChainRules extends AbstractAnnotationProcessor { @ Override public void process ( ) { AnnotationTypeDeclaration annotationDeclaration = ( ( AnnotationTypeDeclaration ) ( environment . getTypeDeclaration ( HandlerChain . class . getName ( ) ) ) ) ; Collection < Declaration > annotatedTypes = environment . getDeclarationsAnnotatedWith ( annotationDeclaration ) ; for ( Declaration declaration : annotatedTypes ) { if ( declaration instanceof TypeDeclaration ) { @ SuppressWarnings ( "deprecation" ) AnnotationMirror annotationMirror = AnnotationUtils . getAnnotation ( declaration , SOAPMessageHandlers . class ) ; if ( annotationMirror != null ) { <START_BUG> printError ( annotationMirror . getPosition ( ) , HANDLER_CHAIN_SOAP_MESSAGE_HANDLERS ) ; <END_BUG> } } if ( declaration instanceof FieldDeclaration ) { AnnotationMirror annotationMirror = AnnotationUtils . getAnnotation ( declaration , HandlerChain . class ) ; printError ( annotationMirror . getPosition ( ) , HANDLER_CHAIN_ON_FIELD ) ; } if ( declaration instanceof MethodDeclaration ) { AnnotationMirror annotationMirror = AnnotationUtils . getAnnotation ( declaration , HandlerChain . class ) ; printError ( annotationMirror . getPosition ( ) , HANDLER_CHAIN_ON_METHOD ) ; } } } }

Fix:
printFixableError ( annotationMirror . getPosition ( ) , HANDLER_CHAIN_SOAP_MESSAGE_HANDLERS ) ;
Buggy code:
public class FingerDown extends Command { public FingerDown ( ) { } protected void initialize ( ) { } protected void execute ( ) { <START_BUG> fingers . fingerDown ( ) ; <END_BUG> } protected boolean isFinished ( ) { } protected void end ( ) { } protected void interrupted ( ) { } }

Fix:
fingers . fingersDown ( ) ;
Buggy code:
public class WebAppFileSetResolver implements FileSetResolver { private static final String CLASSPATH_VAR = "$CLASSPATH" ; private static final String WEB_APP_ROOT_VAR = "$WEBROOT" ; private ServletContext servletContext ; public WebAppFileSetResolver ( ServletContext servletContext ) { } public List < URL > filesFromNamespace ( String searchPath , String namespace , String suffix ) { Preconditions . checkNotNull ( searchPath , "A<seq2seq4repair_space>searchpath<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkNotNull ( namespace , "A<seq2seq4repair_space>namespace<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkNotNull ( suffix , "A<seq2seq4repair_space>file<seq2seq4repair_space>name<seq2seq4repair_space>suffix<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; List < URL > resourcesList = new ArrayList < URL > ( ) ; <START_BUG> for ( String path : searchPath . split ( "[;:]" ) ) { <END_BUG> path = path . trim ( ) ; if ( WebAppFileSetResolver . CLASSPATH_VAR . equals ( path ) ) { resourcesList . addAll ( listResourcesFromClasspath ( namespace , suffix ) ) ; } if ( path . startsWith ( WebAppFileSetResolver . WEB_APP_ROOT_VAR ) ) { String base = "//" ; if ( ! ( WebAppFileSetResolver . WEB_APP_ROOT_VAR . equals ( path ) ) ) { base = path . substring ( WebAppFileSetResolver . WEB_APP_ROOT_VAR . length ( ) ) ; } resourcesList . addAll ( listResourcesFromWebDir ( base , namespace , suffix ) ) ; } if ( ( resourcesList . size ( ) ) > 0 ) { return resourcesList ; } } return resourcesList ; } private List < URL > listResourcesFromClasspath ( String namespace , String suffix ) { } private List < URL > listResourcesFromWebDir ( String base , String namespace , String suffix ) { } }

Fix:
for ( String path : searchPath . split ( "[;:,]" ) ) {
Buggy code:
public class PydevDebugConsoleCommunication implements IScriptConsoleCommunication { private int TIMEOUT = PydevConsoleConstants . CONSOLE_TIMEOUT ; String EMPTY = StringUtils . EMPTY ; private volatile boolean waitingForInput ; private volatile String inputReceived ; private volatile Object lock = new Object ( ) ; private volatile InterpreterResponse nextResponse ; private final IPyStackFrameProvider consoleFrameProvider ; private ICallback < Object , Tuple < String , String > > onContentsReceived ; private boolean bufferedOutput ; public void setBufferedOutput ( boolean bufferedOutput ) { } public boolean getBufferedOutput ( ) { } public PydevDebugConsoleCommunication ( boolean bufferedOutput , IPyStackFrameProvider consoleFrameProvider ) { } @ Override public boolean isConnected ( ) { } @ Override public void setOnContentsReceivedCallback ( ICallback < Object , Tuple < String , String > > onContentsReceived ) { } @ Override public void interrupt ( ) { } public void execInterpreter ( final String command , final ICallback < Object , InterpreterResponse > onResponseReceived ) { } public ICompletionProposal [ ] getCompletions ( String text , String actTok , int offset , boolean showForTabCompletion ) throws Exception { ICompletionProposal [ ] receivedCompletions = new ICompletionProposal [ ] { } ; if ( waitingForInput ) { return new ICompletionProposal [ 0 ] ; } PyStackFrame frame = consoleFrameProvider . getLastSelectedFrame ( ) ; if ( frame == null ) { return new ICompletionProposal [ 0 ] ; } final EvaluateDebugConsoleExpression evaluateDebugConsoleExpression = new EvaluateDebugConsoleExpression ( frame ) ; String result = evaluateDebugConsoleExpression . getCompletions ( actTok , offset ) ; if ( ( result . length ( ) ) > 0 ) { List < Object [ ] > fromServer = XMLUtils . convertXMLcompletionsFromConsole ( result ) ; List < ICompletionProposal > ret = new ArrayList < ICompletionProposal > ( ) ; <START_BUG> PydevConsoleCommunication . convertToICompletions ( text , actTok , offset , fromServer , ret , false ) ; <END_BUG> receivedCompletions = ret . toArray ( new ICompletionProposal [ ret . size ( ) ] ) ; } return receivedCompletions ; } public String getDescription ( String text ) throws Exception { } public void linkWithDebugSelection ( boolean isLinkedWithDebug ) { } public void close ( ) throws Exception { } }

Fix:
PydevConsoleCommunication . convertConsoleCompletionsToICompletions ( text , actTok , offset , fromServer , ret , false ) ;
Buggy code:
public class Status extends StageCommand { private static enum Field { NAME , DIRECTORY , WRAPPER , URL , TYPE , OWNER , TOMCAT , DEBUGGER , JCONSOLE , APPS ; public String toString ( ) { } public int length ( ) { } } private final List < Status . Field > selected = new ArrayList < > ( ) ; public Status ( Session session ) throws IOException { } @ Remaining public void field ( String str ) { } @ Override public void doInvoke ( Stage stage ) throws Exception { } private Map < Status . Field , Object > status ( Stage stage ) throws IOException , SAXException { } private Object getAppUrls ( Stage stage ) throws IOException , SAXException { } private Ports tomcatStatus ( Stage stage , Map < Status . Field , Object > result ) throws IOException { String tomcatPid ; String debug ; Ports ports ; tomcatPid = stage . runningTomcat ( ) ; result . put ( Status . Field . TOMCAT , daemonStatus ( tomcatPid , stage . state ( ) ) ) ; if ( tomcatPid != null ) { ports = stage . loadPorts ( ) ; try { <START_BUG> if ( stage . getDirectory ( ) . exec ( "ps" , "u" , "-p" , tomcatPid ) . contains ( "-Xdebug" ) ) { <END_BUG> debug = ( "on<seq2seq4repair_space>(port<seq2seq4repair_space>" + ( ports . debug ( ) ) ) + ")" ; } else { debug = "off" ; } } catch ( IOException e ) { debug = "unknown" ; } } else { ports = null ; debug = "off" ; } result . put ( Status . Field . DEBUGGER , debug ) ; return ports ; } private String daemonStatus ( String pid , Stage . State state ) { } }

Fix:
if ( stage . shared ( ) . join ( "conf//service-wrapper.conf" ) . readString ( ) . contains ( "=-Xdebug\n" ) ) {
Buggy code:
public class ExternalEditor { private IFile file ; private EditorDescriptor descriptor ; public ExternalEditor ( IFile newFile , EditorDescriptor editorDescriptor ) { } public void open ( ) throws CoreException { } public void openWithUserDefinedProgram ( ) throws CoreException { String programFileName = null ; IConfigurationElement configurationElement = descriptor . getConfigurationElement ( ) ; if ( configurationElement != null ) { URL installURL = configurationElement . getDeclaringExtension ( ) . getDeclaringPluginDescriptor ( ) . getInstallURL ( ) ; try { URL commandURL = new URL ( installURL , descriptor . getFileName ( ) ) ; URL localName = Platform . asLocalURL ( commandURL ) ; File file = new File ( localName . getFile ( ) ) ; if ( file . exists ( ) ) programFileName = file . getAbsolutePath ( ) ; } catch ( IOException e ) { } } if ( programFileName == null ) programFileName = descriptor . getFileName ( ) ; String path = file . getLocation ( ) . toOSString ( ) ; try { <START_BUG> Process p = Runtime . getRuntime ( ) . exec ( new String [ ] { programFileName , path } ) ; <END_BUG> } catch ( Exception e ) { throw new CoreException ( new Status ( Status . ERROR , WorkbenchPlugin . PI_WORKBENCH , 0 , WorkbenchMessages . format ( "ExternalEditor.errorMessage" , new Object [ ] { programFileName } ) , e ) ) ; } } }

Fix:
Runtime . getRuntime ( ) . exec ( new String [ ] { programFileName , path } ) ;
Buggy code:
public class ConstructorInvocation extends Statement { public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( ConstructorInvocation . class , "typeArguments" , Type . class , ASTNode . NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( ConstructorInvocation . class , "arguments" , Expression . class , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private ASTNode . NodeList typeArguments = null ; private ASTNode . NodeList arguments = new ASTNode . NodeList ( ConstructorInvocation . ARGUMENTS_PROPERTY ) ; ConstructorInvocation ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { ConstructorInvocation result = new ConstructorInvocation ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . copyLeadingComment ( this ) ; if ( ( this . ast . apiLevel ) >= ( AST . JLS3 ) ) { result . typeArguments ( ) . addAll ( ASTNode . copySubtrees ( target , typeArguments ( ) ) ) ; } result . arguments ( ) . addAll ( ASTNode . copySubtrees ( target , arguments ( ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public List typeArguments ( ) { } public List arguments ( ) { } public IMethodBinding resolveConstructorBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;