nus-yam/ex-repair huggingface dataset:
Buggy code:
public class OAuthTokenWebListener implements Callable < OAuthTokenFinish > { private static final Logger logger = Logger . getLogger ( OAuthTokenWebListener . class . getName ( ) ) ; private static final int PORT_LOWER = 55500 ; private static final int PORT_UPPER = 55599 ; private static final List < InetAddress > ALLOWED_CLIENT_IPS = Lists . newArrayList ( ) ; private final int port ; private final String id ; private final SynchronousQueue < Object > ioQueue = Queues . newSynchronousQueue ( ) ; private final OAuthTokenInterceptor interceptor ; private final OAuthTokenExtractor extractor ; private final List < InetAddress > allowedClients ; private Undertow server ; public static OAuthTokenWebListener . Builder forId ( String id ) { } public static class Builder { private final String id ; private final List < InetAddress > allowedClients = Lists . newArrayList ( ) ; private OAuthTokenInterceptor interceptor = new OAuthTokenInterceptors . RedirectTokenInterceptor ( ) ; private OAuthTokenExtractor extractor = new OAuthTokenExtractors . NamedQueryTokenExtractor ( ) ; private int port ; private Builder ( String id ) { } public OAuthTokenWebListener . Builder setTokenInterceptor ( OAuthTokenInterceptor interceptor ) { } public OAuthTokenWebListener . Builder setTokenExtractor ( OAuthTokenExtractor extractor ) { } public OAuthTokenWebListener . Builder setPort ( int port ) { <START_BUG> if ( Range . open ( 1 , 65535 ) . contains ( port ) ) { <END_BUG> throw new IllegalArgumentException ( ( "Invalid<seq2seq4repair_space>port<seq2seq4repair_space>number<seq2seq4repair_space>" + port ) ) ; } if ( ! ( OAuthTokenWebListener . isPortAvailable ( port ) ) ) { throw new RuntimeException ( ( "Token<seq2seq4repair_space>listener<seq2seq4repair_space>tried<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>a<seq2seq4repair_space>defined<seq2seq4repair_space>but<seq2seq4repair_space>already<seq2seq4repair_space>taken<seq2seq4repair_space>port<seq2seq4repair_space>" + port ) ) ; } this . port = port ; return this ; } public OAuthTokenWebListener . Builder addAllowedClient ( InetAddress ... clientIp ) { } public OAuthTokenWebListener build ( ) { } } private OAuthTokenWebListener ( String id , int port , OAuthTokenInterceptor interceptor , OAuthTokenExtractor extractor , List < InetAddress > allowedClients ) { } public URI start ( ) throws IOException { } public Future < OAuthTokenFinish > getToken ( ) { } @ Override public OAuthTokenFinish call ( ) throws Exception { } @ Override public void finalize ( ) throws Throwable { } private void createServer ( ) { } private String createPath ( String prefix ) { } private static boolean isPortAvailable ( int port ) { } static final class ExtractingTokenInterceptor implements OAuthTokenInterceptor { public static final String PATH_PREFIX = "//extract" ; private final SynchronousQueue < Object > queue ; private ExtractingTokenInterceptor ( SynchronousQueue < Object > queue ) { } @ Override public String getPathPrefix ( ) { } @ Override public void handleRequest ( HttpServerExchange exchange ) throws Exception { } } }

Fix:
if ( ! ( Range . open ( 1 , 65535 ) . contains ( port ) ) ) {
Buggy code:
public class MyClassBase { public static String getName ( ) { <START_BUG> return MyClassBase . class . getCanonicalName ( ) ; <END_BUG> } }

Fix:
return MyClassBase . class . getName ( ) ;
Buggy code:
public class ActivityBusinessReviews extends CharsooActivity implements IAddReview , IPullToRefresh , IWebserviceResponse , NetworkStateChangeListener { public static final String TAG = "ActivityBusinessReviews" ; WaitDialog progressDialog ; private int businessId ; AdapterBusinessReview adapterBusinessReview ; ListView listView ; ArrayList < Review > results ; ArrayList < Review > sampleResults ; int visitorIntId ; PullToRefreshList pullToRefreshListView ; @ Override public void notifyRefresh ( ) { } @ Override public void notifyLoadMore ( ) { } @ Override public void doOnNetworkConnected ( ) { } private enum Status { FIRST_TIME , LOADING_MORE , REFRESHING , NONE ; } private ActivityBusinessReviews . Status status ; private View addReview ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_business_reviews ) ; setTitle ( getResources ( ) . getString ( reviews ) ) ; addReview = findViewById ( btn_new_review ) ; try { sampleResults = TestUnit . getUserReviewAdapterItems ( ) ; } catch ( Exception e ) { } visitorIntId = LoginInfo . getUserId ( this ) ; businessId = getIntent ( ) . getExtras ( ) . getInt ( BUSINESS_ID_STRING ) ; if ( getIntent ( ) . getExtras ( ) . getBoolean ( BUSINESS_OWNER ) ) addReview . setVisibility ( GONE ) ; results = new ArrayList ( ) ; status = ActivityBusinessReviews . Status . FIRST_TIME ; progressDialog = new WaitDialog ( this ) ; progressDialog . setMessage ( getResources ( ) . getString ( please_wait ) ) ; pullToRefreshListView = new PullToRefreshList ( this , ( ( PullToRefreshListView ) ( findViewById ( pull_refresh_list ) ) ) , this ) ; listView = pullToRefreshListView . getListView ( ) ; adapterBusinessReview = new AdapterBusinessReview ( this , results ) ; listView . setAdapter ( adapterBusinessReview ) ; progressDialog . show ( ) ; new ir . rasen . charsoo . model . review . GetBusinessReviews ( this , visitorIntId , businessId , 0 , getResources ( ) . getInteger ( R . integer . lazy_load_limitation ) , this ) . execute ( ) ; addReview . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { <START_BUG> new ir . rasen . charsoo . view . dialog . DialogAddReview ( ActivityBusinessReviews . this , businessId , ActivityBusinessReviews . this , progressDialog ) . show ( ) ; <END_BUG> } } ) ; } public void loadMoreData ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void getResult ( Object result ) { } @ Override public void getError ( Integer errorCode , String callerStringID ) { } @ Override public void notifyAddReview ( int rating , String review ) { } }

Fix:
new ir . rasen . charsoo . view . dialog . DialogAddReview ( ActivityBusinessReviews . this , businessId , ActivityBusinessReviews . this , progressDialog , getResources ( ) . getString ( R . string . add_review ) , getResources ( ) . getString ( R . string . ok_review ) ) . show ( ) ;
Buggy code:
public class GlobalConnectTask extends AsyncTask < Void , Void , Boolean > { private static final String TAG = GlobalConnectTask . class . getSimpleName ( ) ; private final Object instance ; private final Class < ? > clazz ; private final MultiValuedMap < String , String > trainParams ; private final MultiValuedMap < String , String > busParams ; private final XmlParser xmlParser ; private final JsonParser jsonParser ; private SparseArray < TrainArrival > trainArrivals ; private final List < BusArrival > busArrivals ; private List < BikeStation > bikeStations ; private final TrainData train ; private TrackerException trackerTrainException ; private TrackerException trackerBusException ; private TrackerException trackerBikeException ; private final boolean loadBike ; public GlobalConnectTask ( @ NonNull final Object instance , @ NonNull final Class < ? > clazz , @ NonNull final MultiValuedMap < String , String > trainParams , @ NonNull final MultiValuedMap < String , String > busParams , final boolean loadBike ) { } @ Override protected final Boolean doInBackground ( final Void ... connects ) { } private void loadTrains ( ) { } private void loadBuses ( ) { } private void loadBikes ( ) { } @ Override protected final void onProgressUpdate ( final Void ... progress ) { } @ Override protected final void onPostExecute ( final Boolean networkAvailable ) { try { boolean error = false ; if ( ( ( ( trackerBikeException ) != null ) || ( ( trackerBusException ) != null ) ) || ( ( trackerTrainException ) != null ) ) { error = true ; } if ( networkAvailable ) { clazz . getMethod ( "reloadData" , SparseArray . class , List . class , List . class , Boolean . class ) . invoke ( instance , trainArrivals , busArrivals , bikeStations , error ) ; } else { <START_BUG> clazz . getMethod ( "displayError" , String . class ) . invoke ( instance , App . getContext ( ) . getString ( message_network_error ) ) ; <END_BUG> } } catch ( final Exception e ) { Log . e ( GlobalConnectTask . TAG , e . getMessage ( ) , e ) ; } super . onPostExecute ( networkAvailable ) ; } }

Fix:
clazz . getMethod ( "displayError" , Integer . class ) . invoke ( instance , message_network_error ) ;
Buggy code:
public class SwitchCase extends Statement { private Expression optionalExpression = null ; private boolean expressionInitialized = false ; SwitchCase ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { SwitchCase result = new SwitchCase ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setExpression ( ( ( Expression ) ( ASTNode . copySubtree ( target , getExpression ( ) ) ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { } public void setExpression ( Expression expression ) { } public boolean isDefault ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class Travels { private static float getCorrectYawForPlayer ( Player player , Location destination ) { } public static void toCoordinates ( Player player , int x , int y , int z , String worldname , Boolean checkForStation ) { } public static void toFactionhome ( Player player , Boolean checkForStation ) { } public static void toHome ( Player player , Boolean checkForStation ) { } public static void toPlayer ( Player player , Player targetplayer , Boolean checkForStation ) { } public static void toRandomdest ( Player player , Boolean checkForStation ) { } public static void toStation ( Player player , String stationname , Boolean checkForStation ) { } public static void travel ( Player player , Location destination , Boolean checkForStation ) { if ( ( checkForStation && ( config . getBoolean ( "MountingLimit.EnableForTravels" ) ) ) && ( ! ( player . hasPermission ( "dt.ignoreusestations.travels" ) ) ) ) { if ( ! ( dbStationsHandler . checkForStation ( player ) ) ) { player . sendMessage ( messagesHandler . getMessage ( "Messages.Stations.Error.NotAtAStation" ) ) ; return ; } } Location temploc = player . getLocation ( ) ; int maxdist = config . getInt ( "MaxTravelDistance" ) ; if ( maxdist != ( - 1 ) ) { if ( ( temploc . distance ( destination ) ) >= maxdist ) { player . sendMessage ( messagesHandler . getMessage ( "Messages.Travels.Error.MaxTravelDistanceExceeded" ) ) ; return ; } } if ( ( destination . getWorld ( ) . getName ( ) ) == ( player . getWorld ( ) . getName ( ) ) ) { temploc . setYaw ( Travels . getCorrectYawForPlayer ( player , destination ) ) ; player . teleport ( temploc ) ; } else { Location temploc2 = new Location ( player . getWorld ( ) , ( ( player . getLocation ( ) . getX ( ) ) + 80 ) , ( ( player . getLocation ( ) . getY ( ) ) + 80 ) , ( ( player . getLocation ( ) . getZ ( ) ) + 80 ) ) ; temploc . setYaw ( Travels . getCorrectYawForPlayer ( player , temploc2 ) ) ; player . teleport ( temploc ) ; } <START_BUG> if ( ! ( DragonManagement . mount ( player ) ) ) <END_BUG> return ; if ( ! ( listofDragonriders . containsKey ( player ) ) ) return ; RyeDragon dragon = listofDragonriders . get ( player ) ; if ( ( destination . getWorld ( ) . getName ( ) ) == ( player . getWorld ( ) . getName ( ) ) ) dragon . startTravel ( destination , false ) ; else dragon . startTravel ( destination , true ) ; } }

Fix:
if ( ! ( DragonManagement . mount ( player , true ) ) )
Buggy code:
@ Controller @ RequestMapping ( "//survey_instances" ) public class SurveyInstanceRestService { @ Inject private SurveyInstanceDAO surveyInstanceDao ; @ Inject private SurveyDAO surveyDao ; @ RequestMapping ( method = RequestMethod . GET , value = "" ) @ ResponseBody public Map < String , Object > listSurveyInstances ( @ RequestParam ( value = "beginDate" , defaultValue = "" ) Long bDate , @ RequestParam ( value = "endDate" , defaultValue = "" ) Long eDate , @ RequestParam ( value = "surveyId" , required = false ) Long surveyId , @ RequestParam ( value = "since" , defaultValue = "" ) String since , @ RequestParam ( value = "unapprovedOnlyFlag" , defaultValue = "" ) Boolean unapprovedOnlyFlag , @ RequestParam ( value = "deviceId" , defaultValue = "" ) String deviceId , @ RequestParam ( value = "submitterName" , defaultValue = "" ) String submitterName , @ RequestParam ( value = "countryCode" , defaultValue = "" ) String countryCode , @ RequestParam ( value = "level1" , defaultValue = "" ) String level1 , @ RequestParam ( value = "level2" , defaultValue = "" ) String level2 , @ RequestParam ( value = "surveyedLocaleId" , defaultValue = "" ) Long surveyedLocaleId ) { } @ RequestMapping ( method = RequestMethod . GET , value = "//{id}" ) @ ResponseBody public Map < String , SurveyInstanceDto > findSurveyInstanceById ( @ PathVariable ( "id" ) Long id ) { } @ RequestMapping ( method = RequestMethod . DELETE , value = "//{id}" ) @ ResponseBody public Map < String , RestStatusDto > deleteSurveyInstanceById ( @ PathVariable ( "id" ) Long id ) { final Map < String , RestStatusDto > response = new HashMap < String , RestStatusDto > ( ) ; SurveyInstance s = surveyInstanceDao . getByKey ( id ) ; RestStatusDto statusDto = new RestStatusDto ( ) ; statusDto . setStatus ( "failed" ) ; if ( s != null ) { surveyInstanceDao . deleteSurveyInstance ( s ) ; statusDto . setStatus ( "ok" ) ; } response . put ( "meta" , statusDto ) ; List < Long > ids = new ArrayList < Long > ( ) ; <START_BUG> ids . add ( id ) ; <END_BUG> SurveyUtils . notifyReportService ( ids , "invalidate" ) ; return response ; } @ RequestMapping ( method = RequestMethod . PUT , value = "//{id}" ) @ ResponseBody public Map < String , Object > saveExistingSurveyInstance ( @ RequestBody SurveyInstancePayload payLoad ) { } @ RequestMapping ( method = RequestMethod . POST ) @ ResponseBody public Map < String , Object > saveNewSurveyInstance ( @ RequestBody SurveyInstancePayload payLoad ) { } }

Fix:
ids . add ( s . getSurveyId ( ) ) ;
Buggy code:
public class SetUpClientPlayerClientTest { ServerLauncher launcher ; SetUpClient setUpClient ; PlayerClient playerClient ; @ Before public void buildUp ( ) { } @ Test public void testBothClientsAddAndDelete ( ) throws IllegalAccessException , IllegalArgumentException { } @ Test public void testCurrentlyBeingPlayedQuizList ( ) { setUpClient . createQuiz ( "test<seq2seq4repair_space>quiz" ) ; setUpClient . addQuestionToQuiz ( "what<seq2seq4repair_space>is<seq2seq4repair_space>2+2" , new String [ ] { "1" , "2" , "3" , "4" } , 3 ) ; try { <START_BUG> Field field = SetUpClient . class . getDeclaredField ( "remoteServerObject" ) ; <END_BUG> field . setAccessible ( true ) ; QuizRemoteInterface serverObject = ( ( QuizRemoteInterface ) ( field . get ( playerClient ) ) ) ; int idOfNewQuiz = serverObject . createQuizId ( ) ; setUpClient . addQuizToServer ( ) ; serverObject . addCurrentlyBeingPlayedQuiz ( idOfNewQuiz ) ; assertEquals ( false , playerClient . deleteQuiz ( idOfNewQuiz ) ) ; serverObject . removeCurrentlyBeingPlayedQuiz ( idOfNewQuiz ) ; assertEquals ( true , playerClient . deleteQuiz ( idOfNewQuiz ) ) ; } catch ( NoSuchFieldException e ) { e . printStackTrace ( ) ; } catch ( SecurityException e ) { e . printStackTrace ( ) ; } catch ( IllegalArgumentException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } catch ( RemoteException e ) { e . printStackTrace ( ) ; } } }

Fix:
Field field = PlayerClient . class . getDeclaredField ( "remoteServerObject" ) ;
Buggy code:
public class HostApplet extends JApplet implements IAppletServer { IApplet applet ; public void init ( ) { try { final String appletClassName = getParameter ( "appletClassName" ) ; Container container = getContentPane ( ) ; Class c = Class . forName ( appletClassName ) ; if ( c != null ) { applet = ( ( IApplet ) ( c . newInstance ( ) ) ) ; <START_BUG> applet . init ( container , this , getModel ( ) ) ; <END_BUG> } } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } catch ( InstantiationException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } } public void setModel ( ) { } public void setModel ( Object model ) { } public Object getModel ( ) { } }

Fix:
applet . init ( this , container , getModel ( ) ) ;
Buggy code:
@ Reversible public class ConditionalLeafRule extends LeafRule { private static final long serialVersionUID = 2L ; private Condition c ; private class LeafMatcher extends Matcher { private Map < Integer , CachedMatch > cache ; private boolean fresh = true ; public LeafMatcher ( CharSequence s , Integer offset , Map < Integer , CachedMatch > [ ] cache , Matcher master ) { } @ Override public Match match ( ) { } @ Override public boolean mightHaveNext ( ) { } @ Override public String toString ( ) { } @ Override protected Rule rule ( ) { } } public ConditionalLeafRule ( LeafRule lr , Condition c , String id ) { } @ Override public Matcher matcher ( CharSequence s , final Integer offset , Map < Integer , CachedMatch > [ ] cache , Matcher master ) { } @ Override public Set < Integer > study ( CharSequence s , Map < Integer , CachedMatch > [ ] cache , Set < Rule > studiedRules , GlobalState options ) { } @ Override public Rule conditionalize ( Condition c , String id ) { if ( ( this . c ) == null ) { this . c = c ; this . condition = id ; } else { if ( ( this . c ) instanceof LogicalCondition ) { if ( ! ( ( ( LogicalCondition ) ( this . c ) ) . replace ( id , c ) ) ) <START_BUG> throw new GrammarException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>defined<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>condition" ) ) ; <END_BUG> } else if ( ( this . c ) instanceof LeafCondition ) { LeafCondition lc = ( ( LeafCondition ) ( this . c ) ) ; if ( lc . cnd . equals ( id ) ) this . c = c ; else throw new GrammarException ( ( ( ( "rule<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>carry<seq2seq4repair_space>condition<seq2seq4repair_space>" ) + id ) ) ; } else throw new GrammarException ( ( ( "condition<seq2seq4repair_space>on<seq2seq4repair_space>rule<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>redefined" ) ) ; } return this ; } }

Fix:
throw new GrammarException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>define<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>condition" ) ) ;
Buggy code:
public final class DeploymentReflectionIndex { private final Map < Class < ? > , ClassReflectionIndex < ? > > classes = new HashMap < Class < ? > , ClassReflectionIndex < ? > > ( ) ; DeploymentReflectionIndex ( ) { } private static final Permission DEPLOYMENT_REFLECTION_INDEX_PERMISSION = new RuntimePermission ( "createDeploymentReflectionIndex" ) ; public static DeploymentReflectionIndex create ( ) { } @ SuppressWarnings ( { "unchecked" } ) public synchronized < T > ClassReflectionIndex < T > getClassIndex ( Class < T > clazz ) { try { ClassReflectionIndex < T > index = ( ( ClassReflectionIndex < T > ) ( classes . get ( clazz ) ) ) ; if ( index == null ) { classes . put ( clazz , ( index = new ClassReflectionIndex < T > ( clazz , this ) ) ) ; } return index ; } catch ( Throwable e ) { <START_BUG> throw new RuntimeException ( ( "Error<seq2seq4repair_space>getting<seq2seq4repair_space>reflective<seq2seq4repair_space>information<seq2seq4repair_space>for<seq2seq4repair_space>" + clazz ) , e ) ; <END_BUG> } } }

Fix:
throw new RuntimeException ( ( ( ( "Error<seq2seq4repair_space>getting<seq2seq4repair_space>reflective<seq2seq4repair_space>information<seq2seq4repair_space>for<seq2seq4repair_space>" + clazz ) + "<seq2seq4repair_space>with<seq2seq4repair_space>ClassLoader<seq2seq4repair_space>" ) + ( clazz . getClassLoader ( ) ) ) , e ) ;
Buggy code:
public class Finger { public FingerNode f ; public static BufferedImage img ; public Finger ( ) { } public static BufferedImage load ( String path ) { } public void setFinger ( FingerNode N ) { } public void moveTo ( FingerNode N ) { } public void moveUp ( ) { } public void moveDown ( int num ) { } public void move ( int num ) { } public void draw ( View v ) { if ( ( f ) == null ) { v . drawImage ( Finger . img , 50 , 50 , 20 , 20 ) ; } else { <START_BUG> v . drawImage ( Finger . img , ( ( f . x ) + 5 ) , ( ( f . y ) + 5 ) , ( 2 * ( f . D . radius ) ) , ( 2 * ( f . D . radius ) ) ) ; <END_BUG> } } }

Fix:
v . drawImage ( Finger . img , ( ( f . x ) + 5 ) , ( ( f . y ) + 5 ) , 20 , 20 ) ;
Buggy code:
public class Quiz { public int quizID ; public String name ; public String quizURL ; public String description ; public String category ; public User creator ; public boolean isRandom ; public boolean opFeedback ; public boolean opPractice ; public int raterNumber ; public double totalRating ; public static final String DBTable = "quiz" ; public Quiz ( String name , String quizURL , String description , String category , int userID , boolean isRandom , boolean opFeedback , boolean opPractice ) { } public Quiz ( int quizID , String name , String quizURL , String description , String category , int userID , boolean isRandom , boolean opFeedback , boolean opPractice , int raterNumber , double totalRating ) { } public void addQuizToDB ( ) { try { String statement = new String ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>" + ( Quiz . DBTable ) ) + "<seq2seq4repair_space>(name,<seq2seq4repair_space>url,<seq2seq4repair_space>description,<seq2seq4repair_space>category,<seq2seq4repair_space>userid,<seq2seq4repair_space>israndom,<seq2seq4repair_space>opfeedback,<seq2seq4repair_space>oppractice,<seq2seq4repair_space>raternumber,<seq2seq4repair_space>rating)" ) + "<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ) ; PreparedStatement stmt = con . prepareStatement ( statement , new String [ ] { "qid" } ) ; stmt . setString ( 1 , name ) ; stmt . setString ( 2 , quizURL ) ; stmt . setString ( 3 , description ) ; stmt . setString ( 4 , category ) ; stmt . setInt ( 5 , creator . userID ) ; stmt . setBoolean ( 6 , isRandom ) ; stmt . setBoolean ( 7 , opFeedback ) ; stmt . setBoolean ( 8 , opPractice ) ; stmt . setInt ( 9 , raterNumber ) ; stmt . setDouble ( 10 , totalRating ) ; stmt . executeUpdate ( ) ; ResultSet rs = stmt . getGeneratedKeys ( ) ; rs . next ( ) ; <START_BUG> quizID = rs . getInt ( "qid" ) ; <END_BUG> rs . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } public static Quiz getQuizByQuizID ( int quizID ) { } public void updateCurrentQuiz ( ) { } public ArrayList < Question > getQuestions ( ) { } public ArrayList < QuizTakenRecord > getAllHistory ( ) { } public ArrayList < QuizTakenRecord > getUserHistory ( User user ) { } public ArrayList < QuizTakenRecord > getAllTopRecord ( ) { } public ArrayList < QuizTakenRecord > getAllTopRecord ( Timestamp time ) { } public ArrayList < QuizTakenRecord > getUserTopRecord ( User user ) { } public QuizSummary computeSummaryStats ( ) { } public double getTotalScore ( ) { } public double getScore ( ArrayList < Object > userAnswers ) { } public double getBestScore ( ) { } public double getUserBestScore ( User user ) { } public void addQuizRating ( double rating ) { } public double getQuizRating ( ) { } }

Fix:
quizID = rs . getInt ( "GENERATED_KEY" ) ;
Buggy code:
public class LambdaParenthesisViewController extends LambdaNodeViewController { private final TextureRegion front ; private final TextureRegion center ; private final TextureRegion back ; private final TextureRegion frontMask ; private final TextureRegion centerMask ; private final TextureRegion backMask ; public LambdaParenthesisViewController ( LambdaApplication linkedTerm , LambdaNodeViewController parent , LambdaTermViewController viewController ) { } @ Override public float getMinWidth ( ) { } @ Override public void draw ( Batch batch , float alpha ) { batch . draw ( back , getX ( ) , getY ( ) , BLOCK_WIDTH , BLOCK_HEIGHT ) ; batch . draw ( backMask , getX ( ) , getY ( ) , BLOCK_WIDTH , BLOCK_HEIGHT ) ; float x ; for ( x = ( getX ( ) ) + ( BLOCK_WIDTH ) ; x < ( ( ( ( getX ( ) ) + ( getWidth ( ) ) ) - ( BLOCK_WIDTH ) ) - ( EPSILON ) ) ; x += BLOCK_WIDTH ) { batch . draw ( center , x , getY ( ) , BLOCK_WIDTH , BLOCK_HEIGHT ) ; batch . draw ( centerMask , x , getY ( ) , BLOCK_WIDTH , BLOCK_HEIGHT ) ; } batch . draw ( front , x , getY ( ) , BLOCK_WIDTH , BLOCK_HEIGHT ) ; batch . draw ( frontMask , x , getY ( ) , BLOCK_WIDTH , BLOCK_HEIGHT ) ; <START_BUG> super . draw ( batch , alpha ) ; <END_BUG> } @ Override public boolean equals ( Object other ) { } }

Fix:
drawVanishAnimation ( batch , alpha ) ;
Buggy code:
final class WinBMPFileFormat extends FileFormat { static final int BMPFileHeaderSize = 14 ; static final int BMPHeaderFixedSize = 40 ; int importantColors ; Point pelsPerMeter = new Point ( 0 , 0 ) ; int compress ( int comp , byte [ ] src , int srcOffset , int numBytes , byte [ ] dest , boolean last ) { } int compressRLE4Data ( byte [ ] src , int srcOffset , int numBytes , byte [ ] dest , boolean last ) { } int compressRLE8Data ( byte [ ] src , int srcOffset , int numBytes , byte [ ] dest , boolean last ) { } void decompressData ( byte [ ] src , byte [ ] dest , int stride , int cmp ) { } int decompressRLE4Data ( byte [ ] src , int numBytes , int stride , byte [ ] dest , int destSize ) { } int decompressRLE8Data ( byte [ ] src , int numBytes , int stride , byte [ ] dest , int destSize ) { int sp = 0 ; int se = numBytes ; int dp = 0 ; int de = destSize ; int x = 0 ; int y = 0 ; while ( sp < se ) { int len = ( src [ sp ] ) & 255 ; sp ++ ; if ( len == 0 ) { len = ( src [ sp ] ) & 255 ; sp ++ ; switch ( len ) { case 0 : y ++ ; x = 0 ; dp = y * stride ; <START_BUG> if ( dp >= de ) <END_BUG> return - 1 ; break ; case 1 : return 1 ; case 2 : x += ( src [ sp ] ) & 255 ; sp ++ ; y += ( src [ sp ] ) & 255 ; sp ++ ; dp = ( y * stride ) + x ; if ( dp >= de ) return - 1 ; break ; default : if ( len > ( se - sp ) ) return - 1 ; if ( len > ( de - dp ) ) return - 1 ; for ( int i = 0 ; i < len ; i ++ ) { dest [ dp ] = src [ sp ] ; dp ++ ; sp ++ ; } if ( ( sp & 1 ) != 0 ) sp ++ ; x += len ; break ; } } else { byte theByte = src [ sp ] ; sp ++ ; if ( len > ( de - dp ) ) return - 1 ; for ( int i = 0 ; i < len ; i ++ ) { dest [ dp ] = theByte ; dp ++ ; } x += len ; } } return 1 ; } boolean isFileFormat ( LEDataInputStream stream ) { } byte [ ] loadData ( byte [ ] infoHeader ) { } byte [ ] loadData ( byte [ ] infoHeader , int stride ) { } int [ ] loadFileHeader ( ) { } ImageData [ ] loadFromByteStream ( ) { } PaletteData loadPalette ( byte [ ] infoHeader ) { } PaletteData paletteFromBytes ( byte [ ] bytes , int numColors ) { } static byte [ ] paletteToBytes ( PaletteData pal ) { } int unloadData ( ImageData image , OutputStream out , int comp ) { } int unloadDataNoCompression ( ImageData image , OutputStream out ) { } void unloadIntoByteStream ( ImageLoader loader ) { } void flipScanLines ( byte [ ] data , int stride , int height ) { } }

Fix:
if ( dp > de )
Buggy code:
public class CCUnCheckout extends ClearCase { public static final String FLAG_KEEPCOPY = "-keep" ; public static final String FLAG_RM = "-rm" ; private boolean m_Keep = false ; public void setKeepCopy ( boolean keep ) { } public boolean getKeepCopy ( ) { } public void execute ( ) throws BuildException { Commandline commandLine = new Commandline ( ) ; Project aProj = getProject ( ) ; int result = 0 ; if ( ( getViewPath ( ) ) == null ) { setViewPath ( aProj . getBaseDir ( ) . getPath ( ) ) ; } commandLine . setExecutable ( getClearToolCommand ( ) ) ; commandLine . createArgument ( ) . setValue ( COMMAND_UNCHECKOUT ) ; checkOptions ( commandLine ) ; result = run ( commandLine ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine . toString ( ) ) ; <START_BUG> throw new BuildException ( msg , location ) ; <END_BUG> } } private void checkOptions ( Commandline cmd ) { } }

Fix:
throw new BuildException ( msg ) ;
Buggy code:
public class GridiaMessageToClientBuilder { public Message addCreature ( Entity cre ) { } public Message renameCreature ( Entity cre ) { } public Message moveCreature ( Entity cre , int timeoffset , boolean isTeleport , boolean onRaft ) { } public Message removeCreature ( Entity cre ) { } public Message sectorRequest ( Sector sector ) throws IOException { List < Entity > creatures = new ArrayList ( ) ; Tile [ ] [ ] tiles = sector . _tiles ; BinaryMessageBuilder builder = new BinaryMessageBuilder ( ) . type ( "SectorData" ) . writeInt ( sector . sx ) . writeInt ( sector . sy ) . writeInt ( sector . sz ) ; for ( int x = 0 ; x < ( tiles . length ) ; x ++ ) { for ( int y = 0 ; y < ( tiles . length ) ; y ++ ) { builder . writeShort ( tiles [ x ] [ y ] . floor ) ; builder . writeShort ( tiles [ x ] [ y ] . item . getItem ( ) . id ) ; builder . writeShort ( tiles [ x ] [ y ] . item . getQuantity ( ) ) ; if ( ( tiles [ x ] [ y ] . cre ) != null ) { creatures . add ( tiles [ x ] [ y ] . cre ) ; } } } builder . writeInt ( creatures . size ( ) ) ; creatures . stream ( ) . forEach ( ( cre ) -> { <START_BUG> builder . writeShort ( cre . id ) . writeUTF ( ( ( String ) ( cre . getAttribute ( "name" ) ) ) ) . writeShort ( cre . location . x ) . writeShort ( cre . location . y ) . writeShort ( cre . location . z ) ; <END_BUG> CreatureImage image = ( ( CreatureImage ) ( cre . getAttribute ( "image" ) ) ) ; if ( image instanceof DefaultCreatureImage ) { DefaultCreatureImage defaultImage = ( ( DefaultCreatureImage ) ( image ) ) ; builder . writeShort ( 0 ) . writeShort ( defaultImage . spriteIndex ) . writeShort ( defaultImage . width ) . writeShort ( defaultImage . height ) ; } else if ( image instanceof CustomPlayerImage ) { CustomPlayerImage customImage = ( ( CustomPlayerImage ) ( image ) ) ; builder . writeShort ( 1 ) . writeShort ( customImage . head ) . writeShort ( customImage . chest ) . writeShort ( customImage . legs ) . writeShort ( customImage . arms ) . writeShort ( customImage . weapon ) . writeShort ( customImage . shield ) ; } } ) ; return builder . build ( ) ; } public Message setFocus ( int id , boolean isAdmin ) { } public Message initialize ( String version , String worldName , int size , int depth , int sectorSize ) { } public Message container ( Container container , int tabGfxItemId ) { } public Message chat ( String user , String text , Coord loc ) { } public Message chat ( String text , Coord loc ) { } public Message updateTile ( Coord loc , Tile tile ) { } public Message updateContainerSlot ( Container container , int slotIndex ) { } public Message itemUsePick ( List < ItemUse > uses ) { } public Message animation ( String name , Coord loc ) { } public Message updateCreatureImage ( Entity creature ) { } public Message genericEventHandler ( Object obj ) { } }

Fix:
builder . writeShort ( cre . id ) . writeUTF ( ( cre . hasAttribute ( "name" ) ? ( ( String ) ( cre . getAttribute ( "name" ) ) ) : "" ) ) . writeShort ( cre . location . x ) . writeShort ( cre . location . y ) . writeShort ( cre . location . z ) ;
Buggy code:
public class TstTinyOnKORE extends BaseTest { @ Test public void kore_imp_tiny ( ) throws IOException { } protected String convert ( DefinitionWithContext defWithContext ) { KILtoKORE kilToKore = new KILtoKORE ( defWithContext . context ) ; Module module = kilToKore . apply ( defWithContext . definition ) . getModule ( "TEST" ) . get ( ) ; Constructors cons = new Constructors ( module ) ; package$ tiny = package$ . MODULE$ ; <START_BUG> KApp program = cons . KApply ( cons . KLabel ( "'<top>" ) , cons . KApply ( cons . KLabel ( "'<k>" ) , cons . KApply ( cons . KLabel ( "'_//_" ) , cons . stringToId ( "x" ) , cons . stringToId ( "y" ) ) ) , cons . KApply ( cons . KLabel ( "'<state>" ) , cons . KApply ( cons . KLabel ( "'_Map_" ) , cons . KApply ( cons . KLabel ( "'_|->_" ) , cons . stringToId ( "x" ) , cons . intToToken ( 10 ) ) , cons . KApply ( cons . KLabel ( "'_|->_" ) , cons . stringToId ( "y" ) , cons . intToToken ( 0 ) ) ) ) ) ; <END_BUG> System . out . println ( ( "module<seq2seq4repair_space>=<seq2seq4repair_space>" + module ) ) ; Rewriter rewriter = new Rewriter ( module ) ; Set < K > results = rewriter . rewriteRepeat ( program ) ; return stream ( results ) . map ( ( r ) -> r . toString ( ) ) . collect ( Collections . toList ( ) ) . mkString ( "\n" ) ; } @ Override protected String expectedFilePostfix ( ) { } }

Fix:
KApp program = cons . KApply ( cons . KLabel ( "'<top>" ) , cons . KApply ( cons . KLabel ( "'<k>" ) , cons . KApply ( cons . KLabel ( "'_//_" ) , cons . stringToId ( "x" ) , cons . stringToId ( "y" ) ) ) , cons . KApply ( cons . KLabel ( "'<state>" ) , cons . KApply ( cons . KLabel ( "'_Map_" ) , cons . KApply ( cons . KLabel ( "'_|->_" ) , cons . stringToId ( "x" ) , cons . intToToken ( 10 ) ) , cons . KApply ( cons . KLabel ( "'_|->_" ) , cons . stringToId ( "y" ) , cons . intToToken ( 2 ) ) ) ) ) ;
Buggy code:
public class TestCompoundFile extends LuceneTestCase { private Directory dir ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } private void createRandomFile ( Directory dir , String name , int size ) throws IOException { } private void createSequenceFile ( Directory dir , String name , byte start , int size ) throws IOException { } private void assertSameStreams ( String msg , IndexInput expected , IndexInput test ) throws IOException { } private void assertSameStreams ( String msg , IndexInput expected , IndexInput actual , long seekTo ) throws IOException { } private void assertSameSeekBehavior ( String msg , IndexInput expected , IndexInput actual ) throws IOException { } private void assertEqualArrays ( String msg , byte [ ] expected , byte [ ] test , int start , int len ) { } public void testSingleFile ( ) throws IOException { } public void testTwoFiles ( ) throws IOException { } public void testRandomFiles ( ) throws IOException { } private void setUp_2 ( ) throws IOException { } public void testReadAfterClose ( ) throws IOException { } private void demo_FSIndexInputBug ( Directory fsdir , String file ) throws IOException { } public void testClonedStreamsClosing ( ) throws IOException { } public void testRandomAccess ( ) throws IOException { } public void testRandomAccessClones ( ) throws IOException { } public void testFileNotFound ( ) throws IOException { } public void testReadPastEOF ( ) throws IOException { } public void testLargeWrites ( ) throws IOException { } public void testAddExternalFile ( ) throws IOException { } public void testAppend ( ) throws IOException { } public void testAppendTwice ( ) throws IOException { } public void testEmptyCFS ( ) throws IOException { } public void testReadNestedCFP ( ) throws IOException { } public void testDoubleClose ( ) throws IOException { } public void testManySubFiles ( ) throws IOException { } public void testListAll ( ) throws Exception { Directory dir = newDirectory ( ) ; RandomIndexWriter riw = new RandomIndexWriter ( random ( ) , dir ) ; Document doc = new Document ( ) ; Field idField = newStringField ( "id" , "" , NO ) ; Field bodyField = newTextField ( "body" , "" , NO ) ; doc . add ( idField ) ; doc . add ( bodyField ) ; for ( int i = 0 ; i < 100 ; i ++ ) { idField . setStringValue ( Integer . toString ( i ) ) ; bodyField . setStringValue ( TestUtil . randomUnicodeString ( random ( ) ) ) ; riw . addDocument ( doc ) ; if ( ( random ( ) . nextInt ( 7 ) ) == 0 ) { riw . commit ( ) ; } } <START_BUG> riw . close ( ) ; <END_BUG> checkFiles ( dir ) ; dir . close ( ) ; } private void checkFiles ( Directory dir ) throws IOException { } }

Fix:
riw . shutdown ( ) ;
Buggy code:
public abstract class ChangeClasspathOperation extends JavaModelOperation { protected boolean canChangeResources ; public ChangeClasspathOperation ( IJavaElement [ ] elements , boolean canChangeResources ) { } protected boolean canModifyRoots ( ) { } protected void classpathChanged ( JavaProject project ) throws JavaModelException { project . resetCaches ( ) ; DeltaProcessingState state = JavaModelManager . getDeltaState ( ) ; DeltaProcessor deltaProcessor = state . getDeltaProcessor ( ) ; ClasspathChange change = ( ( ClasspathChange ) ( deltaProcessor . classpathChanges . get ( project . getProject ( ) ) ) ) ; if ( this . canChangeResources ) { if ( ( isTopLevelOperation ( ) ) && ( ! ( ResourcesPlugin . getWorkspace ( ) . isTreeLocked ( ) ) ) ) { new ClasspathValidation ( project ) . validate ( ) ; } new ProjectReferenceChange ( project , change . oldResolvedClasspath ) . updateProjectReferencesIfNecessary ( ) ; <START_BUG> new ExternalFolderChange ( project , change . oldResolvedClasspath ) . updateExternalFoldersIfNecessary ( null ) ; <END_BUG> } else { JavaElementDelta delta = new JavaElementDelta ( getJavaModel ( ) ) ; int result = change . generateDelta ( delta ) ; if ( ( result & ( ClasspathChange . HAS_DELTA ) ) != 0 ) { addDelta ( delta ) ; change . requestIndexing ( ) ; state . addClasspathValidation ( project ) ; } if ( ( result & ( ClasspathChange . HAS_PROJECT_CHANGE ) ) != 0 ) { state . addProjectReferenceChange ( project , change . oldResolvedClasspath ) ; } if ( ( result & ( ClasspathChange . HAS_LIBRARY_CHANGE ) ) != 0 ) { state . addExternalFolderChange ( project , change . oldResolvedClasspath ) ; } } } protected ISchedulingRule getSchedulingRule ( ) { } public boolean isReadOnly ( ) { } }

Fix:
new ExternalFolderChange ( project , change . oldResolvedClasspath ) . updateExternalFoldersIfNecessary ( true , null ) ;
Buggy code:
public abstract class AbstractSSOKey < V > implements Serializable , SSOKey { private static final long serialVersionUID = - 4838885706919457570L ; private String id ; AbstractSSOKey ( String id ) { } @ Override public String getId ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public int hashCode ( ) { <START_BUG> return ( this . id . hashCode ( ) ) ^ ( this . getClass ( ) . hashCode ( ) ) ; <END_BUG> } @ Override public String toString ( ) { } }

Fix:
return ( this . id . hashCode ( ) ) ^ ( this . getClass ( ) . getName ( ) . hashCode ( ) ) ;
Buggy code:
public class HangmanGameTest { private HangmanGame hangmanGame ; @ Before public void setUp ( ) throws Exception { } @ Test public void should_new_game ( ) throws Exception { } @ Test public void should_match_when_try_with_correct_letter ( ) throws Exception { hangmanGame . game ( "HANGMAN" ) ; boolean matched = hangmanGame . tryWith ( 'H' ) ; assertThat ( matched , is ( true ) ) ; assertThat ( hangmanGame . chance ( ) , is ( 12 ) ) ; <START_BUG> assertThat ( hangmanGame . used ( ) , is ( "AEIOU" ) ) ; <END_BUG> assertThat ( hangmanGame . display ( ) , is ( "HA___A_" ) ) ; } @ Test public void should_mismatch_when_try_with_incorrect_letter ( ) throws Exception { } @ Test public void should_game_win_when_all_match_before_chance_expired ( ) throws Exception { } @ Test public void should_game_over_after_chance_expired ( ) throws Exception { } @ Test public void should_give_answer ( ) throws Exception { } }

Fix:
assertThat ( hangmanGame . used ( ) , is ( "AEIOUH" ) ) ;
Buggy code:
public class LocalVariableLocator extends VariableLocator { public LocalVariableLocator ( LocalVariablePattern pattern ) { } public int match ( LocalDeclaration node , MatchingNodeSet nodeSet ) { } private LocalVariable getLocalVariable ( ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , Binding elementBinding , int accuracy , MatchLocator locator ) throws CoreException { } protected int matchContainer ( ) { } protected int matchLocalVariable ( LocalVariableBinding variable , boolean matchName ) { } protected int referenceType ( ) { } public int resolveLevel ( ASTNode possiblelMatchingNode ) { <START_BUG> if ( this . pattern . findReferences ) <END_BUG> if ( possiblelMatchingNode instanceof NameReference ) return resolveLevel ( ( ( NameReference ) ( possiblelMatchingNode ) ) ) ; if ( possiblelMatchingNode instanceof LocalDeclaration ) return matchLocalVariable ( ( ( LocalDeclaration ) ( possiblelMatchingNode ) ) . binding , true ) ; return PatternLocator . IMPOSSIBLE_MATCH ; } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( NameReference nameRef ) { } }

Fix:
if ( ( this . pattern . findReferences ) || ( ( this . pattern . fineGrain ) != 0 ) )
Buggy code:
public class WebValveParamAdd implements OperationStepHandler { static final WebValveParamAdd INSTANCE = new WebValveParamAdd ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode mimetypes = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . get ( Constants . PARAM ) ; if ( ( operation . hasDefined ( "param-name" ) ) && ( operation . hasDefined ( "param-value" ) ) ) { mimetypes . get ( operation . get ( "param-name" ) . asString ( ) ) . set ( operation . get ( "param-value" ) . asString ( ) ) ; } else { <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( WebMessages . MESSAGES . paramNameAndParamValueRequiredForAddParam ( ) ) ) ; <END_BUG> } if ( ( ! ( context . isBooting ( ) ) ) && ( context . isNormalServer ( ) ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . reloadRequired ( ) ; context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { context . revertReloadRequired ( ) ; } } ) ; } } , RUNTIME ) ; } context . stepCompleted ( ) ; } }

Fix:
throw new OperationFailedException ( WebMessages . MESSAGES . paramNameAndParamValueRequiredForAddParam ( ) ) ;
Buggy code:
public class AddAnnotationToPackageTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testAddAnnotationToPackage ( ) { try { assertNotNull ( annotation ) ; assertEquals ( XmlSchema . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IPackageDeclaration myPackage = source . getPackageDeclaration ( getPackageName ( ) ) ; assertNotNull ( myPackage ) ; textFileChange . addEdit ( AnnotationUtils . createAddAnnotationTextEdit ( myPackage , annotation ) ) ; <START_BUG> textFileChange . addEdit ( AnnotationUtils . createAddImportTextEdit ( myPackage , XmlSchema . class ) ) ; <END_BUG> assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( myPackage , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertTrue ( source . getImport ( XmlSchema . class . getCanonicalName ( ) ) . exists ( ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
textFileChange . addEdit ( AnnotationUtils . createAddImportTextEdit ( myPackage , XmlSchema . class . getCanonicalName ( ) ) ) ;
Buggy code:
@ AllowFailure ( message = "On<seq2seq4repair_space>JDK6<seq2seq4repair_space>Upgrade<seq2seq4repair_space>these<seq2seq4repair_space>tests<seq2seq4repair_space>are<seq2seq4repair_space>failing<seq2seq4repair_space>with<seq2seq4repair_space>wrong<seq2seq4repair_space>mapping.<seq2seq4repair_space>" + ( "Column<seq2seq4repair_space>PC_ID<seq2seq4repair_space>in<seq2seq4repair_space>ManagedInterfaceSup<seq2seq4repair_space>Table<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>created.<seq2seq4repair_space>getPC()<seq2seq4repair_space>is<seq2seq4repair_space>" + "defined<seq2seq4repair_space>as<seq2seq4repair_space>property<seq2seq4repair_space>in<seq2seq4repair_space>ManageIFace<seq2seq4repair_space>sub-interface" ) ) public class TestManagedInterfaces extends SingleEMFTestCase { @ Override public void setUp ( ) { } public void testEmbeddedMetaData ( ) { } public void testManagedInterface ( ) throws Exception { } public void testInterfaceOwner ( ) { } public void testCollection ( ) { } public void testCollectionPC ( ) { } public void testCollectionInterfaces ( ) { } public void testMixedQuery ( ) { } public void testQueryForMixedInterfaceImpls ( ) { } public void testMixedExtent ( ) { } private void createMixed ( ) { } public void testUnimplementedThrowsException ( ) { } public void testNonMappedCreateInstanceException ( ) { } public void testDetach ( ) { OpenJPAEntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; ManagedIface pc = createInstance ( em , 4 ) ; em . persist ( pc ) ; Object oid = em . getObjectId ( pc ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; em = emf . createEntityManager ( ) ; ManagedIface pcx = em . find ( ManagedIface . class , oid ) ; <START_BUG> pc = em . detach ( pcx ) ; <END_BUG> em . close ( ) ; assertTrue ( em . isDetached ( pc ) ) ; pc . setIntField ( 7 ) ; em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; em . merge ( pc ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; em = emf . createEntityManager ( ) ; pc = em . find ( ManagedIface . class , oid ) ; assertEquals ( 7 , pc . getIntField ( ) ) ; em . close ( ) ; } private ManagedIface createInstance ( OpenJPAEntityManager em , int i ) { } }

Fix:
pc = em . detachCopy ( pcx ) ;
Buggy code:
public class Feed { private final String title ; private final String name ; private final String link ; private final String description ; private final String language ; private final String copyright ; private final String pubDate ; private final int id ; private final RSSManager rssManager ; private List < FeedMessage > entries = new ArrayList < > ( ) ; private List < FeedMessage > newEntries = null ; public Feed ( RSSManager rssManager , String title , String name , String link , String description , String language , String copyright , String pubDate , int id ) { } public List < FeedMessage > getMessages ( ) { } public void setFeedMessages ( List < FeedMessage > entries ) { } private void markReadMessages ( ) { } public List < FeedMessage > getNewMessages ( ) { } public boolean hasNewMessages ( ) { } public List < FeedMessage > getTodaysMessages ( ) { markReadMessages ( ) ; LocalDate now = LocalDate . now ( ) ; List < FeedMessage > messages = getMessages ( ) . stream ( ) . filter ( ( message ) -> message . getPubDate ( ) . isEqual ( now ) ) . collect ( Collectors . toList ( ) ) ; if ( ( messages . size ( ) ) < 3 ) { LocalDate yesterday = now . minusDays ( 1 ) ; <START_BUG> messages . addAll ( getTodaysMessages ( ) . stream ( ) . filter ( ( message ) -> message . getPubDate ( ) . isEqual ( yesterday ) ) . filter ( ( message ) -> ( message . getPubDateTime ( ) . getHour ( ) ) >= 20 ) . collect ( Collectors . toList ( ) ) ) ; <END_BUG> } return messages ; } public String getTitle ( ) { } public String getLink ( ) { } public String getDescription ( ) { } public String getLanguage ( ) { } public Locale getLocale ( ) { } public String getCopyright ( ) { } public String getPubDate ( ) { } public int getId ( ) { } public String getName ( ) { } @ Override public String toString ( ) { } No newline ; at end ; of file ; }

Fix:
messages . addAll ( getMessages ( ) . stream ( ) . filter ( ( message ) -> message . getPubDate ( ) . isEqual ( yesterday ) ) . filter ( ( message ) -> ( message . getPubDateTime ( ) . getHour ( ) ) >= 20 ) . collect ( Collectors . toList ( ) ) ) ;