nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LinkomaticTest extends WebTestCase { public LinkomaticTest ( String name ) { } public void setUp ( ) throws Exception { } public void testHelloWorld ( ) { beginAt ( "//linkomatic" ) ; <START_BUG> assertTitleEquals ( "Wicket<seq2seq4repair_space>-<seq2seq4repair_space>LinkOMatic<seq2seq4repair_space>example" ) ; <END_BUG> } public static Test suite ( ) { } }

Fix:
assertTitleEquals ( "Wicket<seq2seq4repair_space>Examples<seq2seq4repair_space>-<seq2seq4repair_space>linkomatic" ) ;
Buggy code:
public class OI { private enum ButtonMap { SOUTH ( F310Button . A ) , NORTH ( F310Button . Y ) , EAST ( F310Button . B ) , WEST ( F310Button . X ) , PICKUP_MOTORS ( F310Button . LB ) , DEPLOY_PICKUP ( F310Button . RB ) , LEFT_EYEBROW ( F310Button . LT ) , RIGHT_EYEBROW ( F310Button . RT ) , RELAY_ON ( F310Button . Y ) , RELAY_FORWARD ( F310Button . B ) , RELAY_REVERSE ( F310Button . X ) , DRIVE_MODE ( F310Button . L_STICK ) ; F310Button button ; ButtonMap ( F310Button button ) { } F310Button getButton ( ) { } } private enum StickMap { DRIVE_STICK ( F310Stick . LEFT ) , ROTATION_STICK ( F310Stick . RIGHT ) ; F310Stick stick ; StickMap ( F310Stick stick ) { } F310Stick getStick ( ) { } } private PIDEnable motorPIDEnable = PIDEnable . ENABLED ; private PIDEnable rotationPIDEnable = PIDEnable . ENABLED ; private Joystick_F310 driverJoystick = new Joystick_F310 ( 0 ) ; private NetworkTableOI networkTableOI = new NetworkTableOI ( ) ; private Toggle robotRelativeToggle = new Toggle ( false ) ; public int getDirectionPointer ( ) { } public DriveMode getDriveMode ( ) { <START_BUG> if ( robotRelativeToggle . getState ( ) ) { <END_BUG> return DriveMode . FIELD_RELATIVE ; } return DriveMode . ROBOT_RELATIVE ; } public PolarCoordinate getDriverPolarCoordinate ( ) { } public int getDriverPov ( ) { } public double getDriverRotation ( ) { } public boolean getLeftEyebrowButton ( ) { } public PIDEnable getMotorPIDEnable ( ) { } public CartesianCoordinate getMouseEvent ( ) { } public boolean getPickupButton ( ) { } public boolean getRightEyebrowButton ( ) { } public PIDEnable getRotationPIDEnable ( ) { } public boolean getPickupRollerButton ( ) { } public boolean getTogglePIDButton ( ) { } public void isNewMouseEvent ( ) { } public void periodic ( ) { } public void updateDashboard ( ) { } }

Fix:
if ( ! ( robotRelativeToggle . getState ( ) ) ) {
Buggy code:
public class QualifiedName extends Name { private Name qualifier = null ; private SimpleName name = null ; QualifiedName ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Name getQualifier ( ) { } public void setQualifier ( Name qualifier ) { } public SimpleName getName ( ) { } public void setName ( SimpleName name ) { } int memSize ( ) { <START_BUG> return ( ASTNode . BASE_NODE_SIZE ) + ( 3 * 4 ) ; <END_BUG> } int treeSize ( ) { } }

Fix:
return ( Name . BASE_NAME_NODE_SIZE ) + ( 2 * 4 ) ;
Buggy code:
public class StringUtils { public static boolean isNullOrWhiteSpace ( String stringToCheck ) { } public static boolean isNotNullOrWhiteSpace ( String stringToCheck ) { } public static String FormatDateTime ( String dateString ) { } public static String FormatTime ( String dateString ) { } public static String ToSimpleDate ( Date dt ) { } public static String splitCamelCase ( String s ) { } public static String outputStringOrNA ( String str ) { } public static String outputIntOrNA ( Integer value ) { } public static String outputHeightOrNA ( Integer feet , Integer inches ) { <START_BUG> if ( ( feet == null ) && ( inches == null ) ) { <END_BUG> return "N//A" ; } else { String output = "" ; if ( feet != null ) { output += feet + "'" ; } if ( inches != null ) { output += inches + "\"" ; } return output ; } } public static String outputFloatOrNA ( Float value ) { } public static String outputBloodPressureOrNA ( String systolic , String diastolic ) { } }

Fix:
if ( ( ( feet == null ) && ( inches == null ) ) || ( ( feet == 0 ) && ( inches == 0 ) ) ) {
Buggy code:
@ Entity @ Table ( name = "availability" ) @ XmlRootElement @ NamedQueries ( { @ NamedQuery ( name = "Availability.findAll" , query = "SELECT<seq2seq4repair_space>a<seq2seq4repair_space>FROM<seq2seq4repair_space>Availability<seq2seq4repair_space>a" ) , @ NamedQuery ( name = "Availability.findByAvailabilityId" , query = "SELECT<seq2seq4repair_space>a<seq2seq4repair_space>FROM<seq2seq4repair_space>Availability<seq2seq4repair_space>a<seq2seq4repair_space>WHERE<seq2seq4repair_space>a.availabilityId<seq2seq4repair_space>=<seq2seq4repair_space>:availabilityId" ) , @ NamedQuery ( name = "Availability.findByPersonId" , query = "SELECT<seq2seq4repair_space>a<seq2seq4repair_space>FROM<seq2seq4repair_space>Availability<seq2seq4repair_space>a<seq2seq4repair_space>WHERE<seq2seq4repair_space>a.personId<seq2seq4repair_space>=<seq2seq4repair_space>:personId" ) , @ NamedQuery ( name = "Availability.findByFromDate" , query = "SELECT<seq2seq4repair_space>a<seq2seq4repair_space>FROM<seq2seq4repair_space>Availability<seq2seq4repair_space>a<seq2seq4repair_space>WHERE<seq2seq4repair_space>a.fromDate<seq2seq4repair_space>=<seq2seq4repair_space>:fromDate" ) , @ NamedQuery ( name = "Availability.findByToDate" , query = "SELECT<seq2seq4repair_space>a<seq2seq4repair_space>FROM<seq2seq4repair_space>Availability<seq2seq4repair_space>a<seq2seq4repair_space>WHERE<seq2seq4repair_space>a.toDate<seq2seq4repair_space>=<seq2seq4repair_space>:toDate" ) } ) public class Availability implements Serializable { private static final long serialVersionUID = 1L ; @ Id @ Basic ( optional = false ) @ NotNull @ Column ( name = "availability_id" ) private Long availabilityId ; @ Column ( name = "person_id" ) private BigInteger personId ; @ Column ( name = "from_date" ) @ Temporal ( TemporalType . DATE ) private Date fromDate ; @ Column ( name = "to_date" ) @ Temporal ( TemporalType . DATE ) private Date toDate ; public Availability ( ) { } public Availability ( Long availabilityId ) { } public Long getAvailabilityId ( ) { } public void setAvailabilityId ( Long availabilityId ) { } public BigInteger getPersonId ( ) { } public void setPersonId ( BigInteger personId ) { } public Date getFromDate ( ) { } public void setFromDate ( Date fromDate ) { } public Date getToDate ( ) { } public void setToDate ( Date toDate ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public String toString ( ) { <START_BUG> return ( "se.kth.Availability[<seq2seq4repair_space>availabilityId=" + ( availabilityId ) ) + "<seq2seq4repair_space>]" ; <END_BUG> } }

Fix:
return ( "se.kth.model.Availability[<seq2seq4repair_space>availabilityId=" + ( availabilityId ) ) + "<seq2seq4repair_space>]" ;
Buggy code:
public class CppCodeFormatter extends CodeFormatter { private CppStyleMessageConsole console = null ; private CppStyleConsolePatternMatchListener listener = null ; private MessageConsoleStream out = null ; private MessageConsoleStream err = null ; public CppCodeFormatter ( ) { } @ Override public String createIndentationString ( int indentationLevel ) { } @ Override public void setOptions ( Map < String , ? > arg0 ) { } @ Override public TextEdit format ( int kind , String source , int offset , int length , int arg4 , String lineSeparator ) { } @ Override public TextEdit [ ] format ( int kind , String source , IRegion [ ] regions , String lineSeparator ) { } public void formatAndApply ( ICEditor editor ) { } private TextEdit [ ] format ( String source , IEditorPart editor , IRegion [ ] regions ) { } private String getClangForamtConfigureFile ( String path ) { } public boolean checkClangFormat ( ) { } public void checkFileFormat ( IFile file ) { } private void parserCpplintOutput ( IFile file , BufferedReader reader ) { } public void createIssueMarker ( IResource resource , int line , String msg ) { } public void deleteAllMarkers ( IResource target ) { } private boolean enableCpplintOnSave ( IResource resource ) { } public boolean runCpplintOnSave ( IResource resource ) { } private boolean enableClangFormatOnSave ( IResource resource ) { } public boolean runClangFormatOnSave ( IResource resource ) { } public static String getClangFormatPath ( ) { } public static String getCpplintPath ( ) { } static String getVersionControlRoot ( IFile file ) { } public static String getCpplintRoot ( IFile file ) { IProject project = file . getProject ( ) ; String rootSpec ; try { rootSpec = project . getPersistentProperty ( new QualifiedName ( "" , CppStyleConstants . CPPLINT_PROJECT_ROOT ) ) ; <START_BUG> if ( rootSpec . isEmpty ( ) ) { <END_BUG> return null ; } } catch ( CoreException e ) { return null ; } String rootVc = CppCodeFormatter . getVersionControlRoot ( file ) ; if ( rootVc == null ) { return null ; } String relative = new File ( rootVc ) . toURI ( ) . relativize ( new File ( rootSpec ) . toURI ( ) ) . getPath ( ) ; if ( relative . endsWith ( ( "" + ( Path . SEPARATOR ) ) ) ) { return relative . substring ( 0 , ( ( relative . length ( ) ) - 1 ) ) ; } return relative ; } private void setupConsoleStream ( ) { } private void showConsoleView ( ) { } }

Fix:
if ( ( rootSpec == null ) || ( rootSpec . isEmpty ( ) ) ) {
Buggy code:
public class PolynomialFunction implements Serializable , DifferentiableUnivariateRealFunction { private static final long serialVersionUID = - 7726511984200295583L ; private final double [ ] coefficients ; public PolynomialFunction ( double [ ] c ) { } public double value ( double x ) { } public int degree ( ) { } public double [ ] getCoefficients ( ) { } protected static double evaluate ( double [ ] coefficients , double argument ) { } public PolynomialFunction add ( final PolynomialFunction p ) { } public PolynomialFunction subtract ( final PolynomialFunction p ) { } public PolynomialFunction negate ( ) { } public PolynomialFunction multiply ( final PolynomialFunction p ) { } protected static double [ ] differentiate ( double [ ] coefficients ) { } public PolynomialFunction polynomialDerivative ( ) { } public UnivariateRealFunction derivative ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer s = new StringBuffer ( ) ; <END_BUG> if ( ( coefficients [ 0 ] ) == 0.0 ) { if ( ( coefficients . length ) == 1 ) { return "0" ; } } else { s . append ( Double . toString ( coefficients [ 0 ] ) ) ; } for ( int i = 1 ; i < ( coefficients . length ) ; ++ i ) { if ( ( coefficients [ i ] ) != 0 ) { if ( ( s . length ( ) ) > 0 ) { if ( ( coefficients [ i ] ) < 0 ) { s . append ( "<seq2seq4repair_space>-<seq2seq4repair_space>" ) ; } else { s . append ( "<seq2seq4repair_space>+<seq2seq4repair_space>" ) ; } } else { if ( ( coefficients [ i ] ) < 0 ) { s . append ( "-" ) ; } } double absAi = FastMath . abs ( coefficients [ i ] ) ; if ( ( absAi - 1 ) != 0 ) { s . append ( Double . toString ( absAi ) ) ; s . append ( '<seq2seq4repair_space>' ) ; } s . append ( "x" ) ; if ( i > 1 ) { s . append ( '^' ) ; s . append ( Integer . toString ( i ) ) ; } } } return s . toString ( ) ; } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
StringBuilder s = new StringBuilder ( ) ;
Buggy code:
public class Reverse { public static String stringReverse ( String string ) { String results ; ArrayList < Character > list = new ArrayList < > ( ) ; char [ ] work = string . toCharArray ( ) ; for ( int i = 0 ; i < ( work . length ) ; i ++ ) { list . add ( work [ ( ( work . length ) - ( i + 1 ) ) ] ) ; } <START_BUG> results = list . toString ( ) ; <END_BUG> return results ; } }

Fix:
results = list . toString ( ) . replaceAll ( "[^\\w]" , "" ) ;
Buggy code:
class DebugLogger { private Stack < DebugLogger . DebugInfo > debugStack ; NamedList output ; private static final String LINE = "---------------------------------------------" ; private MessageFormat fmt = new MessageFormat ( "-----------<seq2seq4repair_space>row<seq2seq4repair_space>#{0}-------------" , Locale . ROOT ) ; boolean enabled = true ; public DebugLogger ( ) { } private DebugLogger . DebugInfo peekStack ( ) { } public void log ( DIHLogLevels event , String name , Object row ) { } private void popAllTransformers ( ) { } private void addToNamedList ( NamedList nl , Object row ) { } DataSource wrapDs ( final DataSource ds ) { return new DataSource ( ) { @ Override public void init ( Context context , Properties initProps ) { ds . init ( context , initProps ) ; } @ Override public void close ( ) { ds . close ( ) ; } @ Override public Object getData ( String query ) { log ( ENTITY_META , "query" , query ) ; <START_BUG> long start = System . currentTimeMillis ( ) ; <END_BUG> try { return ds . getData ( query ) ; } catch ( DataImportHandlerException de ) { log ( ENTITY_EXCEPTION , null , de ) ; throw de ; } catch ( Exception e ) { log ( ENTITY_EXCEPTION , null , e ) ; DataImportHandlerException de = new DataImportHandlerException ( DataImportHandlerException . SEVERE , "" , e ) ; de . debugged = true ; throw de ; } finally { log ( ENTITY_META , "time-taken" , DocBuilder . getTimeElapsedSince ( start ) ) ; } } } ; } Transformer wrapTransformer ( final Transformer t ) { } public static String getStacktraceString ( Exception e ) { } static String getTransformerName ( Transformer t ) { } private static class DebugInfo { String name ; int tCount ; int rowCount ; NamedList lst ; DIHLogLevels type ; DebugLogger . DebugInfo parent ; public DebugInfo ( String name , DIHLogLevels type , DebugLogger . DebugInfo parent ) { } } }

Fix:
long start = System . nanoTime ( ) ;
Buggy code:
public class ZipEngine { public static String unzip ( File file , String dest ) throws ZipVocationException { ZipFile archive = null ; try { archive = new ZipFile ( file ) ; Enumeration e = archive . entries ( ) ; while ( e . hasMoreElements ( ) ) { ZipEntry entry = ( ( ZipEntry ) ( e . nextElement ( ) ) ) ; File zfile = new File ( dest , entry . getName ( ) ) ; if ( ( entry . isDirectory ( ) ) && ( ! ( zfile . exists ( ) ) ) ) { zfile . mkdirs ( ) ; } else { if ( ! ( zfile . getParentFile ( ) . exists ( ) ) ) { zfile . getParentFile ( ) . mkdirs ( ) ; } InputStream in = archive . getInputStream ( entry ) ; <START_BUG> BufferedOutputStream out = new BufferedOutputStream ( new FileOutputStream ( file ) ) ; <END_BUG> byte [ ] buffer = new byte [ 8192 ] ; int read ; while ( ( - 1 ) != ( read = in . read ( buffer ) ) ) { out . write ( buffer , 0 , read ) ; } in . close ( ) ; out . close ( ) ; } } } catch ( ZipException e1 ) { e1 . printStackTrace ( ) ; throw new ZipVocationException ( e1 . getMessage ( ) ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; throw new ZipVocationException ( e1 . getMessage ( ) ) ; } return dest ; } public static File zip ( String location ) throws ZipVocationException { } }

Fix:
BufferedOutputStream out = new BufferedOutputStream ( new FileOutputStream ( zfile ) ) ;
Buggy code:
public class OctalUnescaperTest { @ Test public void testBetween ( ) { <START_BUG> OctalUnescaper oue = new OctalUnescaper ( ) ; <END_BUG> String input = "\\45" ; String result = oue . translate ( input ) ; assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>octal<seq2seq4repair_space>characters<seq2seq4repair_space>via<seq2seq4repair_space>the<seq2seq4repair_space>between<seq2seq4repair_space>method" , "%" , result ) ; input = "\\377" ; result = oue . translate ( input ) ; assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>octal<seq2seq4repair_space>characters<seq2seq4repair_space>via<seq2seq4repair_space>the<seq2seq4repair_space>between<seq2seq4repair_space>method" , "ÿ" , result ) ; input = "\\377<seq2seq4repair_space>and" ; result = oue . translate ( input ) ; assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>octal<seq2seq4repair_space>characters<seq2seq4repair_space>via<seq2seq4repair_space>the<seq2seq4repair_space>between<seq2seq4repair_space>method" , "ÿ<seq2seq4repair_space>and" , result ) ; input = "\\378<seq2seq4repair_space>and" ; result = oue . translate ( input ) ; assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>octal<seq2seq4repair_space>characters<seq2seq4repair_space>via<seq2seq4repair_space>the<seq2seq4repair_space>between<seq2seq4repair_space>method" , "<seq2seq4repair_space>8<seq2seq4repair_space>and" , result ) ; input = "\\378" ; result = oue . translate ( input ) ; assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>octal<seq2seq4repair_space>characters<seq2seq4repair_space>via<seq2seq4repair_space>the<seq2seq4repair_space>between<seq2seq4repair_space>method" , "<seq2seq4repair_space>8" , result ) ; input = "\\1" ; result = oue . translate ( input ) ; assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>octal<seq2seq4repair_space>characters<seq2seq4repair_space>via<seq2seq4repair_space>the<seq2seq4repair_space>between<seq2seq4repair_space>method" , "" , result ) ; } }

Fix:
final OctalUnescaper oue = new OctalUnescaper ( ) ;
Buggy code:
@ With ( Secure . class ) public class Events extends Controller { private static DateTimeFormatter format = DateTimeFormat . forPattern ( "dd.MM.yyyyHH:mm" ) ; private static void add ( Long calendarId ) { } public static void add ( Long calendarId , Integer year , Integer month , Integer day ) { } public static void edit ( Long calendarId , Long eventId ) { } public static void delete ( Long calendarId , Long eventId ) { } public static void joinCalendar ( Long calendarId , Long eventId ) { } public static void update ( Long calendarId , Long eventId , @ Required String name , @ Required String startDate , @ Required String startTime , @ Required String endDate , @ Required String endTime , boolean isPrivate , String description , String street , String num , String city , String country , String pincode ) { } public static void addEvent ( Long calendarId , String name , String startDate , String startTime , String endDate , String endTime , boolean isPrivate , String description , String street , String num , String city , String country , String pincode ) { Calendar calendar = Calendar . findById ( calendarId ) ; assert calendar != null ; try { Events . format . parseDateTime ( ( startDate + startTime ) ) ; Events . format . parseDateTime ( ( endDate + endTime ) ) ; } catch ( IllegalArgumentException e ) { validation . addError ( "Start.InvalidDate" , "Invalid<seq2seq4repair_space>Date" ) ; params . flash ( ) ; validation . keep ( ) ; Events . add ( calendarId ) ; } Event event = new Event ( calendar ) ; event . name = name ; event . startDate = Events . format . parseDateTime ( ( startDate + startTime ) ) ; event . endDate = Events . format . parseDateTime ( ( endDate + endTime ) ) ; event . isPrivate = isPrivate ; event . description = description ; event . location = new Location ( ) ; event . location . street = street ; event . location . num = num ; event . location . city = city ; event . location . country = country ; event . location . pincode = pincode ; <START_BUG> if ( ( event . validateAndSave ( ) ) && ( event . location . validateAndSave ( ) ) ) <END_BUG> Calendars . show ( calendarId , event . startDate . getYear ( ) , event . startDate . getMonthOfYear ( ) , event . startDate . getDayOfMonth ( ) ) ; else { for ( Error e : Validation . errors ( ) ) Logger . error ( e . message ( ) ) ; params . flash ( ) ; validation . keep ( ) ; Events . add ( calendarId ) ; } } No newline ; at end ; of file ; }

Fix:
if ( ( event . location . validateAndSave ( ) ) && ( event . validateAndSave ( ) ) )
Buggy code:
public class XTSSubsystemDefinition extends SimpleResourceDefinition { protected static final XTSSubsystemDefinition INSTANCE = new XTSSubsystemDefinition ( ) ; protected static final SimpleAttributeDefinition ENVIRONMENT_URL = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( org . jboss . as . controller . descriptions . ModelDescriptionConstants . URL , org . jboss . dmr . ModelType . STRING , true ) . setAllowExpression ( true ) . setXmlName ( URL . getLocalName ( ) ) . setFlags ( RESTART_ALL_SERVICES ) . build ( ) ; @ Deprecated private static final ObjectTypeAttributeDefinition ENVIRONMENT = Builder . of ( XTS_ENVIRONMENT , XTSSubsystemDefinition . ENVIRONMENT_URL ) . setDeprecated ( ModelVersion . create ( 1 , 1 , 0 ) ) . build ( ) ; private XTSSubsystemDefinition ( ) { } @ Override public void registerOperations ( ManagementResourceRegistration registration ) { super . registerOperations ( registration ) ; <START_BUG> registration . registerOperationHandler ( DESCRIBE , GenericSubsystemDescribeHandler . INSTANCE , GenericSubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; <END_BUG> } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } }

Fix:
registration . registerOperationHandler ( DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ;
Buggy code:
public class FeedIssueChangesLongDates extends BaseDataChange { private final System2 system ; public FeedIssueChangesLongDates ( Database db , System2 system ) { } @ Override public void execute ( Context context ) throws SQLException { final long now = system . now ( ) ; MassUpdate massUpdate = context . prepareMassUpdate ( ) ; <START_BUG> massUpdate . select ( "SELECT<seq2seq4repair_space>i.created_at,<seq2seq4repair_space>i.updated_at,<seq2seq4repair_space>i.issue_change_creation_date_ms,<seq2seq4repair_space>i.id<seq2seq4repair_space>FROM<seq2seq4repair_space>issue_changes<seq2seq4repair_space>i<seq2seq4repair_space>WHERE<seq2seq4repair_space>created_at_ms<seq2seq4repair_space>IS<seq2seq4repair_space>NULL" ) ; <END_BUG> massUpdate . update ( "UPDATE<seq2seq4repair_space>issue_changes<seq2seq4repair_space>SET<seq2seq4repair_space>created_at_ms=?,<seq2seq4repair_space>updated_at_ms=?,<seq2seq4repair_space>issue_change_creation_date_ms=?<seq2seq4repair_space>WHERE<seq2seq4repair_space>id=?" ) ; massUpdate . rowPluralName ( "issue_changes" ) ; massUpdate . execute ( new MassUpdate . Handler ( ) { @ Override public boolean handle ( Select . Row row , SqlStatement update ) throws SQLException { Date createdAt = row . getDate ( 1 ) ; Date updatedAt = row . getDate ( 2 ) ; Date functionalCreatedAt = row . getDate ( 3 ) ; Long id = row . getLong ( 4 ) ; updateColumn ( update , 1 , createdAt ) ; updateColumn ( update , 2 , updatedAt ) ; if ( functionalCreatedAt == null ) { update . setLong ( 3 , null ) ; } else { update . setLong ( 3 , functionalCreatedAt . getTime ( ) ) ; } update . setLong ( 4 , id ) ; return true ; } private void updateColumn ( SqlStatement update , int position , Date time ) throws SQLException { if ( time == null ) { update . setLong ( position , now ) ; } else { update . setLong ( position , Math . min ( now , time . getTime ( ) ) ) ; } } } ) ; } }

Fix:
massUpdate . select ( "SELECT<seq2seq4repair_space>i.created_at,<seq2seq4repair_space>i.updated_at,<seq2seq4repair_space>i.issue_change_creation_date,<seq2seq4repair_space>i.id<seq2seq4repair_space>FROM<seq2seq4repair_space>issue_changes<seq2seq4repair_space>i<seq2seq4repair_space>WHERE<seq2seq4repair_space>created_at_ms<seq2seq4repair_space>IS<seq2seq4repair_space>NULL" ) ;
Buggy code:
@ Component public class ImageProcessor { private final ImageDAO imageDAO ; private final ImageRecordDAO imageRecordDAO ; private final TagDAO tagDAO ; private static final int THUMBNAIL_SIZE = 200 ; @ Inject public ImageProcessor ( final ImageDAO imageDAO , final ImageRecordDAO imageRecordDAO , final TagDAO tagDAO ) { } public String processImage ( InputStream inputStream , String caption , String description , String tags , String originalFileName ) { } private void saveImage ( InputStream inputStream , String id , String caption , String description , String tags , String originalFileName ) throws IOException , InterruptedException { } private Set < String > processTagsString ( String tags ) { Set < String > tagSet = new HashSet < String > ( ) ; String [ ] tagStrings = tags . split ( "," ) ; for ( String tagString : tagStrings ) { <START_BUG> tagSet . add ( tagString . trim ( ) ) ; <END_BUG> } return tagSet ; } private Image createImage ( BufferedImage bufferedImage , Date currentTime ) throws IOException { } }

Fix:
tagSet . add ( tagString . trim ( ) . toLowerCase ( ) ) ;
Buggy code:
public class CheckGroupSelector extends LabeledWebMarkupContainer { private static final long serialVersionUID = 1L ; private final CheckGroup < ? > group ; public CheckGroupSelector ( String id ) { } public CheckGroupSelector ( String id , CheckGroup < ? > group ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "checkbox" ) ; CheckGroup < ? > group = this . group ; if ( group == null ) { group = findParent ( CheckGroup . class ) ; if ( group == null ) { throw new org . apache . wicket . WicketRuntimeException ( ( ( "CheckGroupSelector<seq2seq4repair_space>component<seq2seq4repair_space>[" + ( getPath ( ) ) ) + "]<seq2seq4repair_space>cannot<seq2seq4repair_space>find<seq2seq4repair_space>its<seq2seq4repair_space>parent<seq2seq4repair_space>CheckGroup.<seq2seq4repair_space>All<seq2seq4repair_space>CheckGroupSelector<seq2seq4repair_space>components<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>child<seq2seq4repair_space>of<seq2seq4repair_space>or<seq2seq4repair_space>below<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>hierarchy<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>CheckGroup<seq2seq4repair_space>component." ) ) ; } } <START_BUG> tag . put ( "onclick" , ( ( "var<seq2seq4repair_space>cb=this.form['" + ( group . getInputName ( ) ) ) + "'];<seq2seq4repair_space>if<seq2seq4repair_space>(cb!=null)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(!isNaN(cb.length))<seq2seq4repair_space>{<seq2seq4repair_space>for(var<seq2seq4repair_space>i=0;i<cb.length;i++)<seq2seq4repair_space>{<seq2seq4repair_space>cb[i].checked=this.checked;<seq2seq4repair_space>}<seq2seq4repair_space>}<seq2seq4repair_space>else<seq2seq4repair_space>{<seq2seq4repair_space>cb.checked=this.checked;<seq2seq4repair_space>}<seq2seq4repair_space>}" ) ) ; <END_BUG> super . onComponentTag ( tag ) ; } }

Fix:
tag . put ( "onclick" , ( ( "var<seq2seq4repair_space>cb=this.form['" + ( group . getInputName ( ) ) ) + "'];<seq2seq4repair_space>if<seq2seq4repair_space>(cb!=null)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(!isNaN(cb.length))<seq2seq4repair_space>{<seq2seq4repair_space>for(var<seq2seq4repair_space>i=0;i<cb.length;i++)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(cb[i].checked<seq2seq4repair_space>!=<seq2seq4repair_space>this.checked)<seq2seq4repair_space>{cb[i].click();}<seq2seq4repair_space>}<seq2seq4repair_space>}<seq2seq4repair_space>else<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(cb.checked<seq2seq4repair_space>!=<seq2seq4repair_space>this.checked)<seq2seq4repair_space>{cb.click();}<seq2seq4repair_space>}<seq2seq4repair_space>}" ) ) ;
Buggy code:
public class MParse extends AbstractMetamataTask { private File target = null ; private boolean verbose = false ; private boolean debugparser = false ; private boolean debugscanner = false ; private boolean cleanup = false ; public void setTarget ( File target ) { } public void setVerbose ( boolean flag ) { } public void setDebugscanner ( boolean flag ) { } public void setDebugparser ( boolean flag ) { } public void setCleanup ( boolean value ) { } public MParse ( ) { } public void execute ( ) throws BuildException { } protected ExecuteStreamHandler createStreamHandler ( ) { } protected void setUp ( ) throws BuildException { } protected void _execute ( ExecuteStreamHandler handler ) throws BuildException { String pathname = target . getAbsolutePath ( ) ; int pos = ( pathname . length ( ) ) - ( ".jj" . length ( ) ) ; pathname = ( pathname . substring ( 0 , pos ) ) + ".java" ; File javaFile = new File ( pathname ) ; if ( ( javaFile . exists ( ) ) && ( ( target . lastModified ( ) ) < ( javaFile . lastModified ( ) ) ) ) { getProject ( ) . log ( ( ( "Target<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>build<seq2seq4repair_space>-<seq2seq4repair_space>skipping<seq2seq4repair_space>(" + ( target ) ) + ")" ) ) ; return ; } final Execute process = new Execute ( handler ) ; log ( cmdl . describeCommand ( ) , MSG_VERBOSE ) ; process . setCommandline ( cmdl . getCommandline ( ) ) ; try { <START_BUG> if ( Execute . isFailure ( process . execute ( ) ) ) { <END_BUG> throw new BuildException ( "Metamata<seq2seq4repair_space>task<seq2seq4repair_space>failed." ) ; } } catch ( IOException e ) { throw new BuildException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>launch<seq2seq4repair_space>Metamata<seq2seq4repair_space>task:<seq2seq4repair_space>" , e ) ; } } protected void cleanUp ( ) { } protected File [ ] getMetamataLibs ( ) { } protected void checkOptions ( ) throws BuildException { } protected Vector getOptions ( ) { } protected void generateOptionsFile ( File tofile , String [ ] options ) throws BuildException { } }

Fix:
if ( ( process . execute ( ) ) != 0 ) {
Buggy code:
public class Main extends Application { private TableView < String > table = new TableView < > ( ) ; private ObservableList < String > strings = FXCollections . observableArrayList ( ) ; final HBox hb = new HBox ( ) ; public static void main ( String [ ] args ) { } @ Override public void start ( Stage stage ) { Group mainGroup = new Group ( ) ; stage . setTitle ( "CTRLfood" ) ; stage . setWidth ( 450 ) ; stage . setHeight ( 550 ) ; table . setEditable ( true ) ; table . setItems ( strings ) ; final TextField numOfCols = new TextField ( ) ; numOfCols . setPromptText ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>columns" ) ; final TextField numOfRows = new TextField ( ) ; numOfRows . setPromptText ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>rows" ) ; final Button recreateButton = new Button ( "Recreate" ) ; recreateButton . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent e ) { if ( ( table . getColumns ( ) . size ( ) ) != 0 ) { table . getColumns ( ) . remove ( 0 , table . getColumns ( ) . size ( ) ) ; strings . remove ( 0 , strings . size ( ) ) ; } try { int colCount = Integer . parseInt ( numOfCols . getText ( ) ) ; int rowCount = Integer . parseInt ( numOfRows . getText ( ) ) ; if ( ( colCount < 0 ) || ( rowCount < 0 ) ) { throw new Exception ( ) ; } for ( int i = 0 ; i < colCount ; i ++ ) { TableColumn column = new TableColumn ( ( "Column<seq2seq4repair_space>" + ( i + 1 ) ) ) ; column . setMinWidth ( ( ( table . getWidth ( ) ) // colCount ) ) ; column . setCellFactory ( TextFieldTableCell . forTableColumn ( ) ) ; column . setMinWidth ( 100 ) ; table . getColumns ( ) . addAll ( column ) ; } for ( int i = 0 ; i < rowCount ; i ++ ) { <START_BUG> strings . add ( null ) ; <END_BUG> } table . setFixedCellSize ( ( ( table . getHeight ( ) ) // rowCount ) ) ; } catch ( Exception ex ) { Alert error = new Alert ( Alert . AlertType . ERROR ) ; error . setTitle ( "Data<seq2seq4repair_space>error" ) ; error . setContentText ( "You<seq2seq4repair_space>have<seq2seq4repair_space>entered<seq2seq4repair_space>an<seq2seq4repair_space>incorrect<seq2seq4repair_space>data!" ) ; error . showAndWait ( ) ; } } } ) ; hb . getChildren ( ) . addAll ( numOfCols , numOfRows , recreateButton ) ; hb . setSpacing ( 3 ) ; final VBox vbox = new VBox ( ) ; vbox . setSpacing ( 5 ) ; vbox . setPadding ( new Insets ( 10 , 0 , 0 , 10 ) ) ; vbox . getChildren ( ) . addAll ( table , hb ) ; ScrollPane scrollPane = new ScrollPane ( ) ; scrollPane . setContent ( vbox ) ; mainGroup . getChildren ( ) . addAll ( vbox ) ; Scene scene = new Scene ( mainGroup ) ; stage . setScene ( scene ) ; stage . show ( ) ; } No newline ; at end ; of file ; }

Fix:
strings . add ( "" ) ;
Buggy code:
public class Aptitudeselect extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void setupmessagebutton ( ) { Button messageButton11 = ( ( Button ) ( findViewById ( prac ) ) ) ; messageButton11 . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View arg0 ) { <START_BUG> startActivity ( new Intent ( Aptitudeselect . this , Practicedisplay . class ) ) ; <END_BUG> } } ) ; Button messageButton12 = ( ( Button ) ( findViewById ( maintest ) ) ) ; messageButton12 . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View arg0 ) { startActivity ( new Intent ( Aptitudeselect . this , Aptimain . class ) ) ; } } ) ; } }

Fix:
startActivity ( new Intent ( Aptitudeselect . this , Aptiprac . class ) ) ;
Buggy code:
public class ReserviorSampling { public List < Integer > select ( ListNode node , int K ) { int count = 0 ; ListNode n = node ; List < Integer > res = new ArrayList ( ) ; while ( n != null ) { if ( count < K ) { res . add ( n . val ) ; } else { <START_BUG> int offset = new Random ( ) . nextInt ( count ) ; <END_BUG> if ( offset < K ) { res . set ( offset , n . val ) ; } } n = n . next ; count ++ ; } } No newline ; at end ; of file ; }

Fix:
int offset = new Random ( ) . nextInt ( ( count + 1 ) ) ;
Buggy code:
public class ThrowStatement extends Statement { public Expression exception ; public TypeBinding exceptionType ; public ThrowStatement ( Expression exception , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { exceptionType = exception . resolveTypeExpecting ( scope , scope . getJavaLangThrowable ( ) ) ; if ( ( ( exceptionType ) == ( NullBinding ) ) && ( ( scope . environment ( ) . options . complianceLevel ) <= ( ClassFileConstants . JDK1_3 ) ) ) { scope . problemReporter ( ) . cannotThrowNull ( this ) ; } <START_BUG> exception . implicitWidening ( exceptionType , exceptionType ) ; <END_BUG> } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
exception . computeConversion ( scope , exceptionType , exceptionType ) ;
Buggy code:
public class DatabaseHelper extends OrmLiteSqliteOpenHelper { private static final String DATABASE_NAME = "tasklist.db" ; private static final int DATABASE_VERSION = 1 ; private static final String TAG = DatabaseHelper . class . getName ( ) ; private RuntimeExceptionDao < TaskEntity , Integer > taskDao ; public DatabaseHelper ( Context context ) { } @ Override public void onCreate ( SQLiteDatabase sqLiteDatabase , ConnectionSource connectionSource ) { } @ Override public void onUpgrade ( SQLiteDatabase sqLiteDatabase , ConnectionSource connectionSource , int older , int newer ) { } public RuntimeExceptionDao < TaskEntity , Integer > getTaskDao ( ) { } private List < TaskEntity > getAllTasks ( ) { } public static DatabaseHelper getHelper ( Context context ) { } public static List < TaskEntity > queryAllTasks ( Context context ) { } public static TaskEntity query ( Context context , int taskid ) { } public static boolean disableTask ( Context context , TaskEntity task ) { } public static boolean saveDefaultTasks ( Context context ) { try { RuntimeExceptionDao < TaskEntity , Integer > dao = DatabaseHelper . getHelper ( context ) . getTaskDao ( ) ; dao . create ( new TaskEntity ( true , TaskEntity . getRepeatWorkday ( ) , 0 , 0 , context . getResources ( ) . getString ( task_default_sleep_name ) , true ) ) ; <START_BUG> dao . create ( new TaskEntity ( true , TaskEntity . getRepeatWorkday ( ) , 6 , 30 , context . getResources ( ) . getString ( task_default_getup_name ) , true ) ) ; <END_BUG> return true ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return false ; } }

Fix:
dao . create ( new TaskEntity ( false , TaskEntity . getRepeatWorkday ( ) , 6 , 30 , context . getResources ( ) . getString ( task_default_getup_name ) , true ) ) ;
Buggy code:
public class UnicastingInvocationHandler implements InvocationHandler { private static final Logger LOGGER = LoggerFactory . getLogger ( UnicastingInvocationHandler . class ) ; private final FetchStrategy fetchStrategy ; private final Class < ? > serviceApi ; private final ClientProxyGenerator clientProxyGenerator ; public UnicastingInvocationHandler ( FetchStrategy fetchStrategy , Class < ? > serviceApi , ClientProxyGenerator clientProxyGenerator ) { } @ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { String serviceAddress = fetchStrategy . fetchServiceAddress ( serviceApi . getName ( ) ) ; if ( StringUtils . isEmpty ( serviceAddress ) ) { UnicastingInvocationHandler . LOGGER . error ( "No<seq2seq4repair_space>instance<seq2seq4repair_space>named<seq2seq4repair_space>{}" , serviceApi . getName ( ) ) ; <START_BUG> return null ; <END_BUG> } final Object clientProxy = clientProxyGenerator . generate ( serviceApi , serviceAddress ) ; UnicastingInvocationHandler . LOGGER . debug ( "Calling<seq2seq4repair_space>{}<seq2seq4repair_space>on<seq2seq4repair_space>address<seq2seq4repair_space>{}" , serviceApi . getName ( ) , serviceAddress ) ; try { return method . invoke ( clientProxy , args ) ; } catch ( InvocationTargetException e ) { throw e . getTargetException ( ) ; } } }

Fix:
throw new NoServiceInstanceFound ( serviceApi ) ;
Buggy code:
public class NBTSerializer { public static NBTTagCompound read ( InputStream stream ) { } public static void write ( NBTTagCompound compound , OutputStream stream ) { } public static NBTTagCompound fromJava ( Map < String , Object > map ) { } @ SuppressWarnings ( "unchecked" ) private static NBTTagBase < ? > decodeObject ( Object obj ) { if ( obj instanceof Number ) { <START_BUG> return new NBTTagNumber < Number > ( ( ( NBTTagType ) ( obj ) ) ) ; <END_BUG> } if ( obj instanceof String ) { return new NBTTagString ( ( ( String ) ( obj ) ) ) ; } if ( obj instanceof byte [ ] ) { return new NBTTagByteArray ( ( ( byte [ ] ) ( obj ) ) ) ; } if ( obj instanceof int [ ] ) { return new NBTTagIntArray ( ( ( int [ ] ) ( obj ) ) ) ; } if ( obj instanceof List ) { NBTTagList < NBTTagBase < ? > > list = new NBTTagList < NBTTagBase < ? > > ( ) ; for ( Object element : ( ( List < Object > ) ( obj ) ) ) { list . add ( NBTSerializer . decodeObject ( element ) ) ; } return list ; } if ( obj instanceof Map ) { NBTTagCompound compound = new NBTTagCompound ( ) ; for ( Map . Entry < Object , Object > entry : ( ( Map < Object , Object > ) ( obj ) ) . entrySet ( ) ) { if ( ! ( ( entry . getKey ( ) ) instanceof String ) ) { throw new IllegalArgumentException ( "Map<seq2seq4repair_space>key<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>String" ) ; } compound . set ( ( ( String ) ( entry . getKey ( ) ) ) , NBTSerializer . decodeObject ( entry . getValue ( ) ) ) ; } } throw new IllegalArgumentException ( ( ( "Can't<seq2seq4repair_space>convert<seq2seq4repair_space>" + obj ) + "<seq2seq4repair_space>to<seq2seq4repair_space>NBT,<seq2seq4repair_space>object<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>of<seq2seq4repair_space>any<seq2seq4repair_space>possible<seq2seq4repair_space>types" ) ) ; } @ SuppressWarnings ( "unchecked" ) private static < T extends Throwable > void sneakyThrow ( Throwable throwable ) throws T { } }

Fix:
return new NBTTagNumber < Number > ( ( ( Number ) ( obj ) ) ) ;
Buggy code:
class SimpleFSLock extends Lock { File lockFile ; File lockDir ; public SimpleFSLock ( File lockDir , String lockFileName ) { } public boolean obtain ( ) throws IOException { } public void release ( ) throws LockReleaseFailedException { <START_BUG> if ( ! ( lockFile . delete ( ) ) ) <END_BUG> throw new LockReleaseFailedException ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>" + ( lockFile ) ) ) ; } public boolean isLocked ( ) { } public String toString ( ) { } }

Fix:
if ( ( lockFile . exists ( ) ) && ( ! ( lockFile . delete ( ) ) ) )
Buggy code:
public class SlidingTabLayout extends HorizontalScrollView { public interface TabColorizer { int getIndicatorColor ( int position ) { } } private static final int TITLE_OFFSET_DIPS = 24 ; private static final int TAB_VIEW_PADDING_DIPS = 16 ; private static final int TAB_VIEW_TEXT_SIZE_SP = 12 ; private int mTitleOffset ; private int mTabViewLayoutId ; private int mTabViewTextViewId ; private boolean mDistributeEvenly ; private ViewPager mViewPager ; private SparseArray < String > mContentDescriptions = new SparseArray < String > ( ) ; private OnPageChangeListener mViewPagerPageChangeListener ; private SlidingTabLayout . OnTabItemClickListener onTabItemClickListener ; private final SlidingTabStrip mTabStrip ; public SlidingTabLayout ( Context context ) { } public SlidingTabLayout ( Context context , AttributeSet attrs ) { } public SlidingTabLayout ( Context context , AttributeSet attrs , int defStyle ) { } public void setCustomTabColorizer ( SlidingTabLayout . TabColorizer tabColorizer ) { } public void setDistributeEvenly ( boolean distributeEvenly ) { } public void setSelectedIndicatorColors ( int ... colors ) { } public void setOnPageChangeListener ( ViewPager . OnPageChangeListener listener ) { } public void setCustomTabView ( int layoutResId , int textViewId ) { } public void setViewPager ( ViewPager viewPager ) { mTabStrip . removeAllViews ( ) ; mViewPager = viewPager ; if ( viewPager != null ) { <START_BUG> viewPager . setOnPageChangeListener ( new SlidingTabLayout . InternalViewPagerListener ( ) ) ; <END_BUG> populateTabStrip ( ) ; } } protected TextView createDefaultTabView ( Context context ) { } public void setOnTabItemClickListener ( SlidingTabLayout . OnTabItemClickListener listener ) { } private void populateTabStrip ( ) { } public void setContentDescription ( int i , String desc ) { } @ Override protected void onAttachedToWindow ( ) { } private void scrollToTab ( int tabIndex , int positionOffset ) { } private class InternalViewPagerListener implements ViewPager . OnPageChangeListener { private int mScrollState ; @ Override public void onPageScrolled ( int position , float positionOffset , int positionOffsetPixels ) { } @ Override public void onPageScrollStateChanged ( int state ) { } @ Override public void onPageSelected ( int position ) { } } private class TabClickListener implements OnClickListener { @ Override public void onClick ( View v ) { } } public interface OnTabItemClickListener { public void onTabItemClick ( int pos ) { } } No newline ; at end ; of file ; }

Fix:
viewPager . addOnPageChangeListener ( new SlidingTabLayout . InternalViewPagerListener ( ) ) ;
Buggy code:
abstract class XidTransactionManagementTask implements Runnable { protected final short invocationId ; protected final ChannelAssociation channelAssociation ; protected final EJBRemoteTransactionsRepository transactionsRepository ; protected final XidTransactionID xidTransactionID ; protected final MarshallerFactory marshallerFactory ; protected final TransactionRequestHandler transactionRequestHandler ; XidTransactionManagementTask ( final TransactionRequestHandler txRequestHandler , final EJBRemoteTransactionsRepository transactionsRepository , final MarshallerFactory marshallerFactory , final XidTransactionID xidTransactionID , final ChannelAssociation channelAssociation , final short invocationId ) { } @ Override public void run ( ) { } protected abstract void manageTransaction ( ) throws Throwable { } protected void resumeTransaction ( final Transaction transaction ) throws Exception { } protected SubordinateTransaction tryRecoveryForImportedTransaction ( ) throws Exception { final XATerminator xaTerminator = SubordinationManager . getXATerminator ( ) ; if ( xaTerminator instanceof XATerminatorImple ) { <START_BUG> ROOT_LOGGER . debugf ( "Trying<seq2seq4repair_space>to<seq2seq4repair_space>recover<seq2seq4repair_space>an<seq2seq4repair_space>imported<seq2seq4repair_space>transaction<seq2seq4repair_space>for<seq2seq4repair_space>Xid<seq2seq4repair_space>%s" , this . xidTransactionID . getXid ( ) ) ; <END_BUG> ( ( XATerminatorImple ) ( xaTerminator ) ) . doRecover ( null , null ) ; } return SubordinationManager . getTransactionImporter ( ) . getImportedTransaction ( this . xidTransactionID . getXid ( ) ) ; } }

Fix:
ROOT_LOGGER . debug ( ( "Trying<seq2seq4repair_space>to<seq2seq4repair_space>recover<seq2seq4repair_space>an<seq2seq4repair_space>imported<seq2seq4repair_space>transaction<seq2seq4repair_space>for<seq2seq4repair_space>Xid<seq2seq4repair_space>" + ( this . xidTransactionID . getXid ( ) ) ) ) ;
Buggy code:
public class OntologyToDatalogPrinting { public static void main ( String [ ] args ) throws Exception { OWLOntologyManager manager = OWLManager . createOWLOntologyManager ( ) ; <START_BUG> String source_url = "examples//lubm//" ; <END_BUG> File inputOntologyFile = new File ( ( source_url + "univ-bench.owl" ) ) ; OWLOntology Tbox = manager . loadOntologyFromOntologyDocument ( inputOntologyFile ) ; for ( int i = 0 ; i < 15 ; i ++ ) { String aboxfilename = ( ( source_url + "University0_" ) + i ) + ".owl" ; File inputAboxFile = new File ( aboxfilename ) ; OWLOntology Abox = manager . loadOntologyFromOntologyDocument ( inputAboxFile ) ; } OWLOntologyMerger merger = new OWLOntologyMerger ( manager ) ; IRI mergedOntologyIRI = IRI . create ( "http:////www.semanticweb.com//mymergedont" ) ; OWLOntology ontology = merger . createMergedOntology ( manager , mergedOntologyIRI ) ; System . out . println ( ontology . toString ( ) ) ; Reasoner hermit = new Reasoner ( ontology ) ; File DLFile = new File ( ( source_url + "lubm-univ" ) ) ; if ( DLFile . exists ( ) ) { DLFile . delete ( ) ; } DLFile . createNewFile ( ) ; FileOutputStream out = new FileOutputStream ( DLFile , true ) ; out . write ( hermit . getDLOntology ( ) . toString ( ) . getBytes ( ) ) ; out . close ( ) ; DLFileProcess dlp = new DLFileProcess ( ) ; dlp . process_dl ( source_url ) ; } }

Fix:
String source_url = "examples//lubm-full//" ;
Buggy code:
public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehavior { private final Duration updateInterval ; private boolean attachedBodyOnLoadModifier = false ; public AbstractAjaxTimerBehavior ( final Duration updateInterval ) { } protected void onBind ( ) { } protected void onRenderHeadContribution ( final Response response ) { } protected final String getJsTimeoutCall ( final Duration updateInterval ) { } protected final void respond ( final AjaxRequestTarget target ) { onTimer ( target ) ; <START_BUG> target . addJavascript ( getJsTimeoutCall ( updateInterval ) ) ; <END_BUG> } protected abstract void onTimer ( final AjaxRequestTarget target ) { } }

Fix:
target . appendJavascript ( getJsTimeoutCall ( updateInterval ) ) ;