nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TestMultipleEntityProjection extends SingleEMFTestCase { private static boolean INNER_JOIN = true ; private static String [ ] [ ] MAGAZINE_PUBLISHER_NAME_PAIRS = new String [ ] [ ] { new String [ ] { "Times" , "Publisher-0" } , new String [ ] { "Times<seq2seq4repair_space>Life" , "Publisher-1" } , new String [ ] { "Times<seq2seq4repair_space>Kid" , null } , new String [ ] { "Newsweek" , "Publisher-3" } , new String [ ] { "People" , null } , new String [ ] { "Nature" , "Publisher-5" } , new String [ ] { "MIT<seq2seq4repair_space>Review" , "Publisher-6" } , new String [ ] { "Wired" , "Publisher-7" } } ; public void setUp ( ) { } void createData ( ) { EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; for ( int i = 0 ; i < ( TestMultipleEntityProjection . MAGAZINE_PUBLISHER_NAME_PAIRS . length ) ; i ++ ) { String magName = TestMultipleEntityProjection . MAGAZINE_PUBLISHER_NAME_PAIRS [ i ] [ 0 ] ; String pubName = TestMultipleEntityProjection . MAGAZINE_PUBLISHER_NAME_PAIRS [ i ] [ 1 ] ; Magazine mag = new Magazine ( ) ; mag . setName ( magName ) ; if ( pubName != null ) { Publisher pub = new Publisher ( ) ; pub . setName ( pubName ) ; mag . setPublisher ( pub ) ; try { DateFormat df = new SimpleDateFormat ( "yyyy-MM-dd" ) ; Date date = df . parse ( "2001-01-01" ) ; mag . setDatePublished ( date ) ; } catch ( ParseException e ) { mag . setDatePublished ( null ) ; } <START_BUG> mag . setTsPublished ( new Timestamp ( System . currentTimeMillis ( ) ) ) ; <END_BUG> em . persist ( pub ) ; } em . persist ( mag ) ; } em . getTransaction ( ) . commit ( ) ; } public void testMultipleEntitiesInProjectionUsingOuterJoin ( ) { } public void testMultipleEntitiesInProjectionUsingInnerJoin ( ) { } public void testAggregateExpressionInHavingExpression ( ) { } private int getExpecetedResultCount ( String key , boolean innerJoin ) { } }

Fix:
mag . setTsPublished ( new Timestamp ( ( ( System . currentTimeMillis ( ) ) - 100000 ) ) ) ;
Buggy code:
public class FileSet extends AbstractFileSet implements ResourceCollection { public FileSet ( ) { } protected FileSet ( FileSet fileset ) { } public Object clone ( ) { } public Iterator iterator ( ) { if ( isReference ( ) ) { return ( ( FileSet ) ( getRef ( getProject ( ) ) ) ) . iterator ( ) ; } <START_BUG> return new org . apache . tools . ant . types . resources . FileResourceIterator ( getDir ( getProject ( ) ) , getDirectoryScanner ( getProject ( ) ) . getIncludedFiles ( ) ) ; <END_BUG> } public int size ( ) { } public boolean isFilesystemOnly ( ) { } }

Fix:
return new org . apache . tools . ant . types . resources . FileResourceIterator ( getProject ( ) , getDir ( getProject ( ) ) , getDirectoryScanner ( getProject ( ) ) . getIncludedFiles ( ) ) ;
Buggy code:
class NewRemotingSubsystemAdd implements ModelAddOperationHandler { static final OperationHandler INSTANCE = new NewRemotingSubsystemAdd ( ) ; public Cancellable execute ( NewOperationContext context , ModelNode operation , ResultHandler resultHandler ) { <START_BUG> context . getSubModel ( ) . get ( CommonAttributes . THREAD_POOL ) . set ( operation . require ( REQUEST_PROPERTIES ) . require ( CommonAttributes . THREAD_POOL ) ) ; <END_BUG> context . getSubModel ( ) . get ( CommonAttributes . CONNECTOR ) . setEmptyObject ( ) ; final ModelNode compensating = new ModelNode ( ) ; compensating . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; compensating . get ( OP ) . set ( REMOVE ) ; resultHandler . handleResultComplete ( compensating ) ; return Cancellable . NULL ; } }

Fix:
context . getSubModel ( ) . get ( CommonAttributes . THREAD_POOL ) . set ( operation . require ( CommonAttributes . THREAD_POOL ) ) ;
Buggy code:
public class PatternWeaveTestCase extends WeaveTestCase { public PatternWeaveTestCase ( String name ) { } String [ ] none = new String [ 0 ] ; public void testPublic ( ) throws IOException { } private void checkPointcut ( String pointcutSource , String [ ] expectedHelloShadows , String [ ] expectedFancyShadows ) throws IOException { Pointcut sp = Pointcut . fromString ( pointcutSource ) ; Pointcut rp = sp . resolve ( new SimpleScope ( world , FormalBinding . NONE ) ) ; <START_BUG> Pointcut cp = rp . concretize ( MISSING , 0 ) ; <END_BUG> final List l = new ArrayList ( ) ; BcelAdvice p = new BcelAdvice ( null , cp , null , 0 , ( - 1 ) , ( - 1 ) , null , null ) { public void implementOn ( Shadow shadow ) { l . add ( shadow ) ; } } ; weaveTest ( new String [ ] { "HelloWorld" } , "PatternWeave" , p ) ; checkShadowSet ( l , expectedHelloShadows ) ; l . clear ( ) ; weaveTest ( new String [ ] { "FancyHelloWorld" } , "PatternWeave" , p ) ; checkShadowSet ( l , expectedFancyShadows ) ; checkSerialize ( rp ) ; } public void checkSerialize ( Pointcut p ) throws IOException { } }

Fix:
Pointcut cp = rp . concretize ( MISSING , MISSING , 0 ) ;
Buggy code:
public class MinecraftTime { private final long time ; private int faction ; private long main ; private long day ; private int hour ; private int minutes ; public MinecraftTime ( long time ) { } private void update ( ) { } @ Override public int hashCode ( ) { } public String getDay ( ) { } public String nicePrint ( ) { String day = ( this . day ) + "<seq2seq4repair_space>day" ; String hour = ( this . hour ) + "<seq2seq4repair_space>hour" ; String minute = ( this . minutes ) + "<seq2seq4repair_space>minute" ; if ( ( this . day ) == 0 ) day = "" ; else if ( ( this . day ) != 1 ) day += "s" ; if ( ( this . hour ) == 0 ) hour = "" ; else if ( ( this . hour ) != 1 ) hour += "s" ; <START_BUG> if ( ( this . hour ) != 0 ) <END_BUG> hour += "<seq2seq4repair_space>and<seq2seq4repair_space>" ; if ( ( ( this . hour ) != 0 ) && ( ( this . day ) != 0 ) ) day += ",<seq2seq4repair_space>" ; if ( ( this . minutes ) != 1 ) minute += "s" ; return ( day + hour ) + minute ; } @ Override public String toString ( ) { } }

Fix:
if ( ( ( this . hour ) != 0 ) || ( ( ( ( this . hour ) == 0 ) && ( ( this . day ) != 0 ) ) && ( ( this . minutes ) != 0 ) ) )
Buggy code:
public class StartScreenActivity extends ActionBarActivity implements IChromecastUser { private static String TAG = "com.emilochhektor.quizcous.StartScreenActivity" ; private static String APP_ID = "B7BD0161" ; private MediaRouter mediaRouter ; private MediaRouteSelector mediaRouteSelector ; private QuizcousMediaRouterCallback mediaRouterCallback ; private QuizcousCastListener castListener ; private GoogleApiClient apiClient ; private QuizcousConnectionCallbacks connectionCallbacks ; private void init ( ) { } private void initMediaRouter ( ) { } private void connectToChromecast ( CastDevice castDevice ) { } private void launchReceiverApplication ( ) { } private void startLobbyActivity ( ) { } public void onChromecastSelected ( CastDevice castDevice ) { } public void onChromecastUnselected ( ) { } public void onChromecastConnected ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; <START_BUG> setContentView ( activity_startScreen ) ; <END_BUG> this . init ( ) ; } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onStart ( ) { } @ Override protected void onStop ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } }

Fix:
setContentView ( activity_start_screen ) ;
Buggy code:
public class SimpleTypedResource extends TypedResource implements Cloneable { @ Override public TypeNames getTypeNames ( ) { } @ Override public PropertyNames getPropertyNames ( ) { } public int getID ( ) { } @ Override public Type getType ( ) { } @ Override public int hashCode ( ) { <START_BUG> return getID ( ) ; <END_BUG> } @ Override public boolean equals ( Object obj ) { } }

Fix:
return super . hashCode ( ) ;
Buggy code:
@ Controller public class AdminOrderHistoryController { <START_BUG> @ RequestMapping ( value = "//displayAdminOrder" , method = RequestMethod . GET ) <END_BUG> public String displayAdminOrderHistory ( ) { return "adminOrderHistory" ; } }

Fix:
@ RequestMapping ( value = "//displayAdminHistory" , method = RequestMethod . GET )
Buggy code:
public class AbstractNode implements IUpdate , IWorldPosition , ITileModule { private final ITileModuleProvider parent ; public AbstractNode ( ITileModuleProvider parent ) { } @ Override public boolean update ( ) { } @ Override public void onJoinWorld ( ) { } @ Override public void onParentChange ( ) { } @ Override public void onLeaveWorld ( ) { } public < N extends ITileModule > N getModule ( Class < ? extends N > nodeType , ForgeDirection from ) { } @ Override public ITileModuleProvider getParent ( ) { } @ Override public World world ( ) { } @ Override public double x ( ) { } @ Override public double y ( ) { } @ Override public double z ( ) { } @ Override public String toString ( ) { } public Location toLocation ( ) { } public Pos toPos ( ) { <START_BUG> return new Pos ( this ) ; <END_BUG> } }

Fix:
return new Pos ( x ( ) , y ( ) , z ( ) ) ;
Buggy code:
public class PersonQueueImpl implements PersonQueue { Person [ ] array ; public PersonQueueImpl ( ) { } public void insert ( Person person ) { } public Person retrieve ( ) { int iterator = ( array . length ) - 1 ; <START_BUG> while ( ( array [ iterator ] ) == null ) { <END_BUG> iterator -- ; } Person retrieved = array [ iterator ] ; array [ iterator ] = null ; return retrieved ; } No newline ; at end ; of file ; }

Fix:
while ( ( iterator > 0 ) && ( ( array [ iterator ] ) == null ) ) {
Buggy code:
public class Day { private ArrayList < Integer > resIDs ; private int doubAvail ; private int singAvail ; public Day ( ) { } public Day ( int numDoubRooms , int numSingRooms ) { } public ArrayList < Integer > getResIDs ( ) { } public int getDoubAvail ( ) { } public int getSingAvail ( ) { } public void decDoubAvail ( ) { } public void decSingAvail ( ) { } public void incDoubAvail ( ) { } public void incSingAvail ( ) { } public void addReservation ( int resID ) { } public void removeReservation ( int resID ) { <START_BUG> this . resIDs . remove ( resID ) ; <END_BUG> Framework . deleteReservation ( resID ) ; } }

Fix:
this . resIDs . remove ( ( ( Object ) ( resID ) ) ) ;
Buggy code:
public class Bucket implements Serializable { private static final long serialVersionUID = - 5661052358083159985L ; public static final int bucketSize = 4 ; private IndexElement [ ] contents = new IndexElement [ Bucket . bucketSize ] ; private int localDepth ; public Bucket ( int localDepth ) { } public void addToBucket ( String rid , String attribValue ) { } public void removeFromBucket ( String rid ) { for ( int i = 0 ; i < ( contents . length ) ; i ++ ) { <START_BUG> if ( ( contents [ i ] . rid ) == rid ) { <END_BUG> contents [ i ] = null ; return ; } } } public IndexElement [ ] getContents ( ) { } public void setContents ( IndexElement [ ] contents ) { } public int getLocalDepth ( ) { } public void incrementLocalDepth ( ) { } }

Fix:
if ( ( ( contents [ i ] ) != null ) && ( ( contents [ i ] . rid ) == rid ) ) {
Buggy code:
public class RewhisperCommand implements CommandExecutor { public boolean onCommand ( CommandSender sender , Command command , String label , String [ ] args ) { if ( ( args . length ) == 0 ) return false ; String message = StringHelper . join ( args , 0 ) ; WhisperChannel channel = WhisperManager . getLastSentWhisper ( ( ( Player ) ( sender ) ) ) ; if ( channel == null ) { channel = WhisperManager . getLastReceivedWhisper ( ( ( Player ) ( sender ) ) ) ; if ( channel == null ) { sender . sendMessage ( "You<seq2seq4repair_space>must<seq2seq4repair_space>whisper<seq2seq4repair_space>a<seq2seq4repair_space>player<seq2seq4repair_space>before<seq2seq4repair_space>you<seq2seq4repair_space>can<seq2seq4repair_space>rewhisper." ) ; return true ; } } if ( ! ( channel . target ( ) . isOnline ( ) ) ) { <START_BUG> sender . sendMessage ( MessageFormat . format ( "{0}<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>online." , channel . target ( ) ) ) ; <END_BUG> return true ; } channel . setDefault ( ) ; channel . broadcastExceptPlayer ( channel . getOwner ( ) , channel . getOwner ( ) , message ) ; channel . displayOutbound ( channel . target ( ) , channel . formatMessage ( channel . target ( ) , message ) ) ; return true ; } }

Fix:
sender . sendMessage ( MessageFormat . format ( "{0}<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>online." , channel . target ( ) . getName ( ) ) ) ;
Buggy code:
public class ModClusterDisableContext implements OperationStepHandler { static final ModClusterDisableContext INSTANCE = new ModClusterDisableContext ( ) ; static OperationDefinition getDefinition ( ResourceDescriptionResolver descriptionResolver ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( SERVICE_NAME ) ) != null ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( SERVICE_NAME ) ; final ModClusterServiceMBean service = ( ( ModClusterServiceMBean ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "disable-context:<seq2seq4repair_space>%s" , operation ) ; final String webHost = ModClusterSubsystemResourceDefinition . VIRTUAL_HOST . resolveModelAttribute ( context , operation ) . asString ( ) ; final String webContext = ModClusterSubsystemResourceDefinition . CONTEXT . resolveModelAttribute ( context , operation ) . asString ( ) ; try { service . disableContext ( webHost , webContext ) ; } catch ( IllegalArgumentException e ) { <START_BUG> throw new OperationFailedException ( ROOT_LOGGER . contextOrHostNotFound ( webHost , webContext ) ) ; <END_BUG> } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { service . enableContext ( webHost , webContext ) ; } } ) ; } } , RUNTIME ) ; } context . stepCompleted ( ) ; } }

Fix:
throw new OperationFailedException ( new ModelNode ( ) . set ( ROOT_LOGGER . contextOrHostNotFound ( webHost , webContext ) ) ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class CSVFileParserTest { private static final File BASE = new File ( "src//test//resources//CSVFileParser" ) ; private final BufferedReader testData ; private final String testName ; public CSVFileParserTest ( final File file ) throws FileNotFoundException { } private String readTestData ( ) throws IOException { } @ Parameters public static Collection < Object [ ] > generateData ( ) { } @ Test public void testCSVFile ( ) throws Exception { String line = readTestData ( ) ; assertNotNull ( "file<seq2seq4repair_space>must<seq2seq4repair_space>contain<seq2seq4repair_space>config<seq2seq4repair_space>line" , line ) ; final String [ ] split = line . split ( "<seq2seq4repair_space>" ) ; assertTrue ( ( ( testName ) + "<seq2seq4repair_space>require<seq2seq4repair_space>1<seq2seq4repair_space>param" ) , ( ( split . length ) >= 1 ) ) ; final BufferedReader csvFile = new BufferedReader ( new FileReader ( new File ( CSVFileParserTest . BASE , split [ 0 ] ) ) ) ; <START_BUG> CSVFormat fmt = PRISTINE . withDelimiter ( ',' ) . withQuoteChar ( '"' ) ; <END_BUG> boolean checkComments = false ; for ( int i = 1 ; i < ( split . length ) ; i ++ ) { final String option = split [ i ] ; final String [ ] option_parts = option . split ( "=" , 2 ) ; if ( "IgnoreEmpty" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = fmt . withIgnoreEmptyLines ( Boolean . parseBoolean ( option_parts [ 1 ] ) ) ; } else if ( "IgnoreSpaces" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = fmt . withIgnoreSurroundingSpaces ( Boolean . parseBoolean ( option_parts [ 1 ] ) ) ; } else if ( "CommentStart" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = fmt . withCommentStart ( option_parts [ 1 ] . charAt ( 0 ) ) ; } else if ( "CheckComments" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { checkComments = true ; } else { fail ( ( ( ( testName ) + "<seq2seq4repair_space>unexpected<seq2seq4repair_space>option:<seq2seq4repair_space>" ) + option ) ) ; } } line = readTestData ( ) ; assertEquals ( ( ( testName ) + "<seq2seq4repair_space>Expected<seq2seq4repair_space>format<seq2seq4repair_space>" ) , line , fmt . toString ( ) ) ; for ( final CSVRecord rec : fmt . parse ( csvFile ) ) { String parsed = rec . toString ( ) ; if ( checkComments ) { final String comment = rec . getComment ( ) . replace ( "\n" , "\\n" ) ; if ( comment != null ) { parsed += "#" + comment ; } } final int count = rec . size ( ) ; assertEquals ( testName , readTestData ( ) , ( ( count + ":" ) + parsed ) ) ; } } }

Fix:
CSVFormat fmt = new CSVFormat ( ',' ) . withQuoteChar ( '"' ) ;
Buggy code:
public class ApplicationClientStartService implements Service < ApplicationClientStartService > { public static final ServiceName SERVICE_NAME = ServiceName . of ( "appClientStart" ) ; private final InjectedValue < ApplicationClientDeploymentService > applicationClientDeploymentServiceInjectedValue = new InjectedValue < ApplicationClientDeploymentService > ( ) ; private final Method mainMethod ; private final String [ ] parameters ; private Thread thread ; private final Logger logger = Logger . getLogger ( ApplicationClientStartService . class ) ; public ApplicationClientStartService ( final Method mainMethod , final String [ ] parameters ) { } @ Override public synchronized void start ( final StartContext context ) throws StartException { thread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { applicationClientDeploymentServiceInjectedValue . getValue ( ) . getDeploymentCompleteLatch ( ) . await ( ) ; mainMethod . invoke ( null , new Object [ ] { parameters } ) ; } catch ( InvocationTargetException e ) { <START_BUG> logger . error ( e ) ; <END_BUG> } catch ( IllegalAccessException e ) { logger . error ( e ) ; } catch ( InterruptedException e ) { logger . error ( e ) ; } finally { CurrentServiceContainer . getServiceContainer ( ) . shutdown ( ) ; } } } ) ; thread . start ( ) ; } @ Override public synchronized void stop ( final StopContext context ) { } @ Override public ApplicationClientStartService getValue ( ) throws IllegalArgumentException , IllegalStateException { } public InjectedValue < ApplicationClientDeploymentService > getApplicationClientDeploymentServiceInjectedValue ( ) { } }

Fix:
logger . error ( e . getTargetException ( ) , e . getTargetException ( ) ) ;
Buggy code:
public class MultivariateMultiStartOptimizerTest { @ Test public void testRosenbrock ( ) { MultivariateMultiStartOptimizerTest . Rosenbrock rosenbrock = new MultivariateMultiStartOptimizerTest . Rosenbrock ( ) ; <START_BUG> SimplexOptimizer underlying = new SimplexOptimizer ( new SimpleScalarValueChecker ( ( - 1 ) , 0.001 ) ) ; <END_BUG> NelderMeadSimplex simplex = new NelderMeadSimplex ( new double [ ] [ ] { new double [ ] { - 1.2 , 1.0 } , new double [ ] { 0.9 , 1.2 } , new double [ ] { 3.5 , - 2.3 } } ) ; underlying . setSimplex ( simplex ) ; JDKRandomGenerator g = new JDKRandomGenerator ( ) ; g . setSeed ( 16069223052L ) ; RandomVectorGenerator generator = new UncorrelatedRandomVectorGenerator ( 2 , new org . apache . commons . math . random . GaussianRandomGenerator ( g ) ) ; MultivariateMultiStartOptimizer optimizer = new MultivariateMultiStartOptimizer ( underlying , 10 , generator ) ; PointValuePair optimum = optimizer . optimize ( 1100 , rosenbrock , MINIMIZE , new double [ ] { - 1.2 , 1.0 } ) ; Assert . assertEquals ( rosenbrock . getCount ( ) , optimizer . getEvaluations ( ) ) ; Assert . assertTrue ( ( ( optimizer . getEvaluations ( ) ) > 900 ) ) ; Assert . assertTrue ( ( ( optimizer . getEvaluations ( ) ) < 1200 ) ) ; Assert . assertTrue ( ( ( optimum . getValue ( ) ) < 8.0E-4 ) ) ; } private static class Rosenbrock implements MultivariateFunction { private int count ; public Rosenbrock ( ) { } public double value ( double [ ] x ) { } public int getCount ( ) { } } }

Fix:
SimplexOptimizer underlying = new SimplexOptimizer ( new SimpleValueChecker ( ( - 1 ) , 0.001 ) ) ;
Buggy code:
public class SwingTreeViewNode extends DefaultMutableTreeNode implements IStructureViewNode { private String relationshipName ; private IProgramElement programElement ; private AbstractIcon icon ; private Kind kind ; public SwingTreeViewNode ( IProgramElement programElement , AbstractIcon icon , List children ) { } public SwingTreeViewNode ( IRelationship relationship , AbstractIcon icon ) { } public SwingTreeViewNode ( IProgramElement programElement , AbstractIcon icon ) { } public IProgramElement getStructureNode ( ) { } public AbstractIcon getIcon ( ) { } public void add ( IStructureViewNode child ) { } public void add ( IStructureViewNode child , int position ) { } public void remove ( IStructureViewNode child ) { } public List getChildren ( ) { } public Kind getKind ( ) { } public String getRelationshipName ( ) { } public String toString ( ) { if ( ( kind ) == ( Kind . RELATIONSHIP ) ) { return relationshipName ; } else { <START_BUG> return programElement . getName ( ) ; <END_BUG> } } }

Fix:
return programElement . toLabelString ( ) ;
Buggy code:
public class StringResourceModelTest extends TestCase { private MockWebApplication application ; private WebPage page ; private StringResourceModelTest . WeatherStation ws ; private Model wsModel ; public StringResourceModelTest ( String name ) { } protected void setUp ( ) throws Exception { } public void testGetSimpleResource ( ) { } public void testNullResourceKey ( ) { } public void testGetSimpleResourceWithKeySubstitution ( ) { } public void testGetOGNLResource ( ) { } public void testSubstitutionParametersResource ( ) { } public void testUninitialisedLocalizer ( ) { } public void testSetObject ( ) { } public void testDetachAttachNormalModel ( ) throws Exception { } public void testDetachAttachDetachableModel ( ) throws Exception { IModel wsDetachModel = new AbstractReadOnlyDetachableModel ( ) { private static final long serialVersionUID = 1L ; private transient StringResourceModelTest . WeatherStation station ; protected void onAttach ( ) { station = new StringResourceModelTest . WeatherStation ( ) ; } protected void onDetach ( ) { station = null ; } protected Object onGetObject ( final Component component ) { return station ; } public IModel getNestedModel ( ) { return null ; } } ; StringResourceModel model = new StringResourceModel ( "simple.text" , page , wsDetachModel ) ; application . setupRequestAndResponse ( ) ; RequestCycle cycle = new wicket . protocol . http . WebRequestCycle ( application . getWicketSession ( ) , application . getWicketRequest ( ) , application . getWicketResponse ( ) ) ; model . attach ( ) ; <START_BUG> Assert . assertNotNull ( ( ( IModel ) ( model . getNestedModel ( ) ) ) . getObject ( page ) ) ; <END_BUG> Assert . assertNotNull ( model . getLocalizer ( ) ) ; model . detach ( ) ; Assert . assertNull ( model . getLocalizer ( ) ) ; } class WeatherStation implements Serializable { private static final long serialVersionUID = 1L ; private String currentStatus = "sunny" ; private double currentTemperature = 25.7 ; public String getCurrentStatus ( ) { } public void setCurrentStatus ( String currentStatus ) { } public double getCurrentTemperature ( ) { } public void setCurrentTemperature ( double currentTemperature ) { } public String getUnits ( ) { } } }

Fix:
Assert . assertNotNull ( model . getNestedModel ( ) . getObject ( page ) ) ;
Buggy code:
public class TestDocumentWriter extends BaseTokenStreamTestCase { private RAMDirectory dir ; public TestDocumentWriter ( String s ) { } protected void setUp ( ) throws Exception { } public void test ( ) { } public void testAddDocument ( ) throws Exception { } public void testPositionIncrementGap ( ) throws IOException { } public void testTokenReuse ( ) throws IOException { } public void testPreAnalyzedField ( ) throws IOException { } public void testMixedTermVectorSettingsSameField ( ) throws Exception { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( "f1" , "v1" , Store . YES , Index . NOT_ANALYZED , TermVector . NO ) ) ; doc . add ( new org . apache . lucene . document . Field ( "f1" , "v2" , Store . YES , Index . NOT_ANALYZED , TermVector . WITH_POSITIONS_OFFSETS ) ) ; doc . add ( new org . apache . lucene . document . Field ( "f2" , "v1" , Store . YES , Index . NOT_ANALYZED , TermVector . WITH_POSITIONS_OFFSETS ) ) ; doc . add ( new org . apache . lucene . document . Field ( "f2" , "v2" , Store . YES , Index . NOT_ANALYZED , TermVector . NO ) ) ; IndexWriter writer = new IndexWriter ( dir , new StandardAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; writer . addDocument ( doc ) ; writer . close ( ) ; _TestUtil . checkIndex ( dir ) ; <START_BUG> IndexReader reader = IndexReader . open ( dir ) ; <END_BUG> TermFreqVector tfv1 = reader . getTermFreqVector ( 0 , "f1" ) ; assertNotNull ( tfv1 ) ; assertEquals ( "the<seq2seq4repair_space>'with_tv'<seq2seq4repair_space>setting<seq2seq4repair_space>should<seq2seq4repair_space>rule!" , 2 , tfv1 . getTerms ( ) . length ) ; TermFreqVector tfv2 = reader . getTermFreqVector ( 0 , "f2" ) ; assertNotNull ( tfv2 ) ; assertEquals ( "the<seq2seq4repair_space>'with_tv'<seq2seq4repair_space>setting<seq2seq4repair_space>should<seq2seq4repair_space>rule!" , 2 , tfv2 . getTerms ( ) . length ) ; } public void testLUCENE_1590 ( ) throws Exception { } }

Fix:
IndexReader reader = IndexReader . open ( dir , true ) ;
Buggy code:
public class nChatCommand implements CommandExecutor { private final nChat plugin ; public nChatCommand ( nChat plugin ) { } public boolean onCommand ( CommandSender sender , Command cmd , String commandLabel , String [ ] args ) { if ( ( args . length ) < 1 ) { if ( ! ( plugin . getPermissionsHandler ( ) . hasPermission ( sender , "nChat.version" ) ) ) return true ; sender . sendMessage ( ( ( ( ( ChatColor . BLUE ) + "nChat<seq2seq4repair_space>" ) + ( plugin . getDescription ( ) . getVersion ( ) ) ) + "<seq2seq4repair_space>by<seq2seq4repair_space>niccholaspage" ) ) ; return true ; } if ( args [ 0 ] . equalsIgnoreCase ( "reload" ) ) { if ( ! ( plugin . getPermissionsHandler ( ) . hasPermission ( sender , "nChat.reload" ) ) ) return true ; <START_BUG> plugin . readConfig ( ) ; <END_BUG> sender . sendMessage ( ( ( ChatColor . BLUE ) + "The<seq2seq4repair_space>nChat<seq2seq4repair_space>configuration<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>reloaded." ) ) ; } return true ; } }

Fix:
plugin . loadConfig ( ) ;
Buggy code:
public class Selector { protected Selector . XPath fXPath ; protected IdentityConstraint fIdentityConstraint ; public Selector ( Selector . XPath xpath , IdentityConstraint identityConstraint ) { } public XPath getXPath ( ) { } public IdentityConstraint getIdentityConstraint ( ) { } public XPathMatcher createMatcher ( FieldActivator activator ) { } public String toString ( ) { } public static class XPath extends org . apache . xerces . validators . schema . identity . XPath { public XPath ( String xpath , StringPool stringPool , NamespacesScope context ) throws XPathException { } } protected class Matcher extends XPathMatcher { protected FieldActivator fFieldActivator ; protected int fElementDepth ; protected int fMatchedDepth ; public Matcher ( Selector . XPath xpath , FieldActivator activator ) { } public void startDocumentFragment ( StringPool stringPool , NamespacesScope namespacesScope ) throws Exception { } public void startElement ( QName element , XMLAttrList attributes , int handle ) throws Exception { super . startElement ( element , attributes , handle ) ; ( fElementDepth ) ++ ; <START_BUG> if ( isMatched ( ) ) { <END_BUG> fMatchedDepth = fElementDepth ; fFieldActivator . startValueScopeFor ( fIdentityConstraint ) ; int count = fIdentityConstraint . getFieldCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { Field field = fIdentityConstraint . getFieldAt ( i ) ; XPathMatcher matcher = fFieldActivator . activateField ( field ) ; matcher . startElement ( element , attributes , handle ) ; } } } public void endElement ( QName element ) throws Exception { } } }

Fix:
if ( ( ( fMatchedDepth ) == ( - 1 ) ) && ( isMatched ( ) ) ) {
Buggy code:
public class Business { public final int businessId ; private String businessName ; private String description ; private EmailAddress email ; private Address address ; private int telephone ; private int openingHours ; private ArrayList < Revenue > revenue ; private Database db ; public Business ( int businessId , String businessName , EmailAddress email , int telephone , int openingHours , String description , Address address , ArrayList < Revenue > revenue ) { } public String getBusinessnameDmp ( ) { } public String getBusinessName ( ) { } public boolean setBusinessName ( String businessName ) { <START_BUG> if ( db . updateBusiness ( businessId , "business_name" , businessName ) ) { <END_BUG> this . businessName = businessName ; return true ; } return false ; } public EmailAddress getEmail ( ) { } public boolean setEmail ( String email ) { } public int getTelephone ( ) { } public boolean setTelephone ( String telephone ) { } public int getOpeningHours ( ) { } public boolean setOpeningHours ( String openingHours ) { } public int getBusinessId ( ) { } public String getDescription ( ) { } public boolean setDescription ( String description ) { } public Address getAddress ( ) { } public boolean setAddress ( String address ) { } public boolean setZipcode ( String zipcode ) { } public ArrayList < Revenue > getRevenue ( ) { } @ Override public String toString ( ) { } }

Fix:
if ( db . executePreparedStatement ( ( "UPDATE<seq2seq4repair_space>business<seq2seq4repair_space>SET<seq2seq4repair_space>business_name<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>WHERE<seq2seq4repair_space>business_id<seq2seq4repair_space>=<seq2seq4repair_space>" + ( this . businessId ) ) ) ) {
Buggy code:
public class Caustic extends CausticCore { private static final String TAG = "Caustic" ; public Caustic ( ) { } @ Override public float SendOSCMessage ( String message ) { <START_BUG> if ( ! ( CaustkEngine . DEBUG_MESSAGES ) ) { <END_BUG> Log . d ( Caustic . TAG , ( "Message:<seq2seq4repair_space>" + message ) ) ; } return super . SendOSCMessage ( message ) ; } @ Override public String QueryOSC ( String message ) { } }

Fix:
if ( CaustkEngine . DEBUG_MESSAGES ) {
Buggy code:
public class TestICUFoldingFilter extends BaseTokenStreamTestCase { Analyzer a = new Analyzer ( ) { @ Override public TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testDefaults ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , a , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , a , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class FontDialog extends Dialog { FontData fontData ; RGB rgb ; public FontDialog ( Shell parent ) { } public FontDialog ( Shell parent , int style ) { } public FontData getFontData ( ) { } public FontData [ ] getFontList ( ) { } public RGB getRGB ( ) { } public FontData open ( ) { int handle ; byte [ ] titleBytes ; titleBytes = Converter . wcsToMbcs ( null , title , true ) ; Display display = ( ( parent ) != null ) ? parent . getDisplay ( ) : Display . getCurrent ( ) ; handle = OS . gtk_font_selection_dialog_new ( titleBytes ) ; if ( ( parent ) != null ) { int shellHandle = parent . topHandle ( ) ; OS . gtk_window_set_transient_for ( handle , shellHandle ) ; int pixbufs = OS . gtk_window_get_icon_list ( shellHandle ) ; if ( pixbufs != 0 ) { OS . gtk_window_set_icon_list ( handle , pixbufs ) ; OS . g_list_free ( pixbufs ) ; } } if ( ( fontData ) != null ) { Font font = new Font ( display , fontData ) ; int fontName = OS . pango_font_description_to_string ( font . handle ) ; int length = OS . strlen ( fontName ) ; byte [ ] buffer = new byte [ length + 1 ] ; OS . memmove ( buffer , fontName , length ) ; font . dispose ( ) ; OS . g_free ( fontName ) ; OS . gtk_font_selection_dialog_set_font_name ( handle , buffer ) ; } display . addIdleProc ( ) ; Dialog oldModal = null ; if ( OS . gtk_window_get_modal ( handle ) ) { oldModal = display . getModalDialog ( ) ; display . setModalDialog ( this ) ; } int signalId = 0 ; int hookId = 0 ; if ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) { signalId = OS . g_signal_lookup ( map , OS . GTK_TYPE_WIDGET ( ) ) ; <START_BUG> hookId = OS . g_signal_add_emission_hook ( signalId , 0 , display . setDirectionProc , handle , 0 ) ; <END_BUG> } int response = OS . gtk_dialog_run ( handle ) ; if ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) { OS . g_signal_remove_emission_hook ( signalId , hookId ) ; } if ( OS . gtk_window_get_modal ( handle ) ) { display . setModalDialog ( oldModal ) ; } boolean success = response == ( OS . GTK_RESPONSE_OK ) ; if ( success ) { int fontName = OS . gtk_font_selection_dialog_get_font_name ( handle ) ; int length = OS . strlen ( fontName ) ; byte [ ] buffer = new byte [ length + 1 ] ; OS . memmove ( buffer , fontName , length ) ; OS . g_free ( fontName ) ; int fontDesc = OS . pango_font_description_from_string ( buffer ) ; Font font = Font . gtk_new ( display , fontDesc ) ; fontData = font . getFontData ( ) [ 0 ] ; OS . pango_font_description_free ( fontDesc ) ; } display . removeIdleProc ( ) ; OS . gtk_widget_destroy ( handle ) ; if ( ! success ) return null ; return fontData ; } public void setFontData ( FontData fontData ) { } public void setFontList ( FontData [ ] fontData ) { } public void setRGB ( RGB rgb ) { } }

Fix:
hookId = OS . g_signal_add_emission_hook ( signalId , 0 , display . emissionProc , handle , 0 ) ;
Buggy code:
public class Utils { @ SuppressWarnings ( { "serial" , "rawtypes" } ) public static class PrintFilter implements Filter { @ Override public void prepare ( Map conf , TridentOperationContext context ) { } @ Override public void cleanup ( ) { } @ Override public boolean isKeep ( TridentTuple tuple ) { System . out . println ( tuple ) ; return true ; } } public static class ActorFilter implements Filter { String actor ; int partitionIndex ; public ActorFilter ( String actor ) { } @ Override public boolean isKeep ( TridentTuple tridentTuple ) { boolean filter = tridentTuple . getString ( 0 ) . equals ( actor ) ; if ( filter ) { System . err . println ( ( ( ( "I<seq2seq4repair_space>am<seq2seq4repair_space>partition<seq2seq4repair_space>" + ( partitionIndex ) ) + "<seq2seq4repair_space>actor<seq2seq4repair_space>" ) + ( actor ) ) ) ; } return filter ; } @ Override public void prepare ( Map map , TridentOperationContext tridentOperationContext ) { } @ Override public void cleanup ( ) { } } public static class LocationCount implements Filter { @ Override public boolean isKeep ( TridentTuple tridentTuple ) { <START_BUG> System . err . println ( tridentTuple . getString ( 0 ) ) ; <END_BUG> return true ; } @ Override public void prepare ( Map map , TridentOperationContext tridentOperationContext ) { } @ Override public void cleanup ( ) { } } public static class UpperCaseFuntion extends BaseFunction { @ Override public void execute ( TridentTuple tridentTuple , TridentCollector tridentCollector ) { } } public static class LocationAggregator extends BaseAggregator < Map < String , Integer > > { @ Override public Map < String , Integer > init ( Object o , TridentCollector tridentCollector ) { } @ Override public void aggregate ( Map < String , Integer > stringIntegerMap , TridentTuple tridentTuple , TridentCollector tridentCollector ) { } @ Override public void complete ( Map < String , Integer > stringIntegerMap , TridentCollector tridentCollector ) { } } public static final Map < String , Integer > getTopNOfMap ( Map < String , Integer > map , int n ) { } }

Fix:
System . err . println ( tridentTuple . get ( 0 ) . toString ( ) ) ;
Buggy code:
public class BorlandGenerateClient extends Task { static final String JAVA_MODE = "java" ; static final String FORK_MODE = "fork" ; boolean debug = false ; File ejbjarfile = null ; File clientjarfile = null ; Path classpath ; String mode = BorlandGenerateClient . FORK_MODE ; int version = BorlandDeploymentTool . BAS ; public void setVersion ( int version ) { } public void setMode ( String s ) { } public void setDebug ( boolean debug ) { } public void setEjbjar ( File ejbfile ) { } public void setClientjar ( File clientjar ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { if ( ( this . classpath ) == null ) { <START_BUG> this . classpath = new Path ( project ) ; <END_BUG> } return this . classpath . createPath ( ) ; } public void setClasspathRef ( Reference r ) { } public void execute ( ) throws BuildException { } protected void executeJava ( ) throws BuildException { } protected void executeFork ( ) throws BuildException { } protected void executeForkV4 ( ) throws BuildException { } protected void executeForkV5 ( ) throws BuildException { } }

Fix:
this . classpath = new Path ( getProject ( ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class RapidSortingApplet extends PApplet { private static final int width = 400 ; private static final int height = 540 ; private ControlP5 cp5 ; private int shape = 0 ; private int ans ; private int dir ; private int wrong ; private int score ; private int prevShape = 0 ; private float moveX = 0 ; private float moveY = 0 ; private int shapeState = 0 ; private float timeLimit = 300 ; private float time = 0 ; private boolean isFirst = true ; private int gameStart = 0 ; Random rand = new Random ( ) ; private HashMap < String , PImage > images = new HashMap < String , PImage > ( ) ; private String [ ] file = new String [ ] { "component//heartShape.png" , "component//starShape.png" , "component//circleShape.png" , "component//pusheentime.png" , "background//rapidsortingBackground.png" , "background//sorting_gameinfo.png" } ; public void setup ( ) { } public void draw ( ) { background ( 255 ) ; if ( ( gameStart ) == ( - 1 ) ) { image ( images . get ( "sorting_gameinfo.png" ) , 0 , 0 , 400 , 540 ) ; } else if ( ( this . gameStart ) == 0 ) { image ( images . get ( "rapidsortingBackground.png" ) , 0 , 0 , 400 , 540 ) ; } else if ( ( this . gameStart ) == 1 ) { if ( ( time ) == ( timeLimit ) ) { shapeState = 3 ; } else time += 0.1 ; if ( ( this . shape ) == 0 ) image ( images . get ( "heartShape.png" ) , ( 120 + ( moveX ) ) , ( ( - 190 ) + ( moveY ) ) , 150 , 150 ) ; else if ( ( this . shape ) == 1 ) image ( images . get ( "starShape.png" ) , ( 120 + ( moveX ) ) , ( ( - 190 ) + ( moveY ) ) , 150 , 150 ) ; else image ( images . get ( "circleShape.png" ) , ( 120 + ( moveX ) ) , ( ( - 190 ) + ( moveY ) ) , 150 , 150 ) ; if ( ( shapeState ) == 0 ) { moveY += 8 ; if ( ( ( - 190 ) + ( moveY ) ) >= 195 ) { this . shapeState = 2 ; } } else if ( ( shapeState ) == 1 ) { if ( ( this . dir ) == 1 ) moveX += 8 ; else moveX -= 8 ; if ( ( ( 80 + ( moveX ) ) >= 475 ) || ( ( 80 + ( moveX ) ) <= ( - 175 ) ) ) { genShape ( ) ; this . shapeState = 0 ; } } <START_BUG> if ( ( this . wrong ) == 1 ) { <END_BUG> this . fill ( 0 , 150 , 255 ) ; textSize ( 30 ) ; this . text ( "Wrong" , 150 , 220 ) ; this . fill ( 255 ) ; } image ( images . get ( "pusheentime.png" ) , ( 400 - ( ( this . time ) * 2 ) ) , 460 , 100 , 50 ) ; textSize ( 20 ) ; fill ( 0 ) ; text ( ( "Your<seq2seq4repair_space>Score:<seq2seq4repair_space>" + ( this . score ) ) , 10 , 40 ) ; } } public void keyPressed ( KeyEvent arg0 ) { } public void genShape ( ) { } public void startbutton ( ) { } public void howplay ( ) { } public void back ( ) { } }

Fix:
if ( ( ( this . wrong ) == 1 ) && ( ( this . isFirst ) == false ) ) {
Buggy code:
public final class VectorWritable extends Configured implements Writable { public static final int FLAG_DENSE = 1 ; public static final int FLAG_SEQUENTIAL = 2 ; public static final int FLAG_NAMED = 4 ; public static final int FLAG_LAX_PRECISION = 8 ; public static final int NUM_FLAGS = 4 ; private Vector vector ; private boolean writesLaxPrecision ; public VectorWritable ( ) { } public VectorWritable ( boolean writesLaxPrecision ) { } public VectorWritable ( Vector vector ) { } public VectorWritable ( Vector vector , boolean writesLaxPrecision ) { } public Vector get ( ) { } public void set ( Vector vector ) { } public boolean isWritesLaxPrecision ( ) { } public void setWritesLaxPrecision ( boolean writesLaxPrecision ) { } @ Override public void write ( DataOutput out ) throws IOException { } @ Override public void readFields ( DataInput in ) throws IOException { } public static void writeVector ( DataOutput out , Vector vector ) throws IOException { } public static void writeVector ( DataOutput out , Vector vector , boolean laxPrecision ) throws IOException { boolean dense = vector . isDense ( ) ; boolean sequential = vector . isSequentialAccess ( ) ; boolean named = vector instanceof NamedVector ; out . writeByte ( ( ( ( ( dense ? VectorWritable . FLAG_DENSE : 0 ) | ( sequential ? VectorWritable . FLAG_SEQUENTIAL : 0 ) ) | ( named ? VectorWritable . FLAG_NAMED : 0 ) ) | ( laxPrecision ? VectorWritable . FLAG_LAX_PRECISION : 0 ) ) ) ; Varint . writeUnsignedVarInt ( vector . size ( ) , out ) ; if ( dense ) { for ( Vector . Element element : vector . all ( ) ) { if ( laxPrecision ) { out . writeFloat ( ( ( float ) ( element . get ( ) ) ) ) ; } else { out . writeDouble ( element . get ( ) ) ; } } } else { <START_BUG> Varint . writeUnsignedVarInt ( vector . getNumNondefaultElements ( ) , out ) ; <END_BUG> Iterator < Element > iter = vector . nonZeroes ( ) . iterator ( ) ; if ( sequential ) { int lastIndex = 0 ; while ( iter . hasNext ( ) ) { Vector . Element element = iter . next ( ) ; int thisIndex = element . index ( ) ; Varint . writeUnsignedVarInt ( ( thisIndex - lastIndex ) , out ) ; lastIndex = thisIndex ; if ( laxPrecision ) { out . writeFloat ( ( ( float ) ( element . get ( ) ) ) ) ; } else { out . writeDouble ( element . get ( ) ) ; } } } else { while ( iter . hasNext ( ) ) { Vector . Element element = iter . next ( ) ; Varint . writeUnsignedVarInt ( element . index ( ) , out ) ; if ( laxPrecision ) { out . writeFloat ( ( ( float ) ( element . get ( ) ) ) ) ; } else { out . writeDouble ( element . get ( ) ) ; } } } } if ( named ) { String name = ( ( NamedVector ) ( vector ) ) . getName ( ) ; out . writeUTF ( ( name == null ? "" : name ) ) ; } } public static Vector readVector ( DataInput in ) throws IOException { } public static VectorWritable merge ( Iterator < VectorWritable > vectors ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
Varint . writeUnsignedVarInt ( vector . getNumNonZeroElements ( ) , out ) ;
Buggy code:
public class TrackDetails extends Fragment { private Button buttonMap ; private Button buttonSave ; private JSONObject jsonObj ; private Boolean isSaved ; private StatisticsCalculator calc ; public TrackDetails ( ) { } public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { container . removeAllViews ( ) ; View rootView = inflater . inflate ( fragment_track_details , container , false ) ; buttonMap = ( ( Button ) ( rootView . findViewById ( btn_map ) ) ) ; buttonSave = ( ( Button ) ( rootView . findViewById ( btn_save ) ) ) ; isSaved = getArguments ( ) . getBoolean ( "isSaved" ) ; try { jsonObj = new JSONObject ( getArguments ( ) . getString ( "json" ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } buttonSave . setEnabled ( ( ! ( isSaved ) ) ) ; buttonMap . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { TrackSummary summFragment = new TrackSummary ( ) ; FragmentTransaction transaction = getChildFragmentManager ( ) . beginTransaction ( ) ; Bundle b = new Bundle ( ) ; b . putString ( "json" , jsonObj . toString ( ) ) ; b . putBoolean ( "isSaved" , isSaved ) ; summFragment . setArguments ( b ) ; transaction . replace ( details_container , summFragment ) ; transaction . addToBackStack ( null ) ; transaction . commit ( ) ; } } ) ; buttonSave . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( ( jsonObj ) != null ) { calc = new StatisticsCalculator ( jsonObj ) ; try { if ( ( jsonObj . getJSONArray ( "points" ) . length ( ) ) > 0 ) { <START_BUG> new SaveTrack ( getActivity ( ) . getApplicationContext ( ) ) . execute ( "44" , "tour<seq2seq4repair_space>de<seq2seq4repair_space>Frącz" , jsonObj . toString ( ) , String . valueOf ( calc . getDistance ( ) ) , String . valueOf ( calc . getTravelTime ( ) ) , String . valueOf ( calc . avarageSpeed ( ) ) ) ; <END_BUG> Toast . makeText ( getActivity ( ) . getApplicationContext ( ) , "zapisano<seq2seq4repair_space>w<seq2seq4repair_space>bazie" , LENGTH_LONG ) . show ( ) ; } else Toast . makeText ( getActivity ( ) . getApplicationContext ( ) , "Nie<seq2seq4repair_space>zarejestrowano<seq2seq4repair_space>trasy" , LENGTH_LONG ) . show ( ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } else Toast . makeText ( getActivity ( ) . getApplicationContext ( ) , "Brak<seq2seq4repair_space>danych<seq2seq4repair_space>trasy" , LENGTH_LONG ) . show ( ) ; isSaved = true ; buttonSave . setEnabled ( ( ! ( isSaved ) ) ) ; } } ) ; return rootView ; } public void onResume ( ) { } public void onPause ( ) { } No newline ; at end ; of file ; }

Fix:
new SaveTrack ( getActivity ( ) . getApplicationContext ( ) ) . execute ( "44" , "tour<seq2seq4repair_space>de<seq2seq4repair_space>Frącz" , jsonObj . toString ( ) , String . valueOf ( calc . getDistance ( ) ) , String . valueOf ( calc . getTravelTime ( ) ) , String . valueOf ( calc . getAvarageSpeed ( ) ) ) ;
Buggy code:
public class LocalDataSourceService extends AbstractDataSourceService { private final InjectedValue < DataSource > dataSourceConfig = new InjectedValue < DataSource > ( ) ; public LocalDataSourceService ( final String jndiName ) { } public AS7DataSourceDeployer getDeployer ( ) { <START_BUG> return new AS7DataSourceDeployer ( log , dataSourceConfig . getValue ( ) ) ; <END_BUG> } public Injector < DataSource > getDataSourceConfigInjector ( ) { } }

Fix:
return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) ) ;
Buggy code:
public class JaversSqlRepository implements JaversRepository { private final CommitMetadataRepository commitRepository ; private final GlobalIdRepository globalIdRepository ; private final CdoSnapshotRepository cdoSnapshotRepository ; private final CdoSnapshotFinder finder ; public JaversSqlRepository ( CommitMetadataRepository commitRepository , GlobalIdRepository globalIdRepository , CdoSnapshotRepository cdoSnapshotRepository , CdoSnapshotFinder finder ) { } @ Override public List < CdoSnapshot > getStateHistory ( GlobalId globalId , int limit ) { } @ Override public Optional < CdoSnapshot > getLatest ( GlobalId globalId ) { } @ Override public void persist ( Commit commit ) { Optional < Long > primaryKey = commitRepository . getCommitPrimaryKey ( commit ) ; if ( primaryKey . isPresent ( ) ) { throw new org . javers . common . exception . JaversException ( JaversExceptionCode . CANT_SAVE_ALREADY_PERSISTED_COMMIT ) ; } long commitMetadataPk = commitRepository . save ( commit . getAuthor ( ) , commit . getCommitDate ( ) , commit . getId ( ) ) ; for ( CdoSnapshot cdoSnapshot : commit . getSnapshots ( ) ) { <START_BUG> long globalIdPk = globalIdRepository . save ( cdoSnapshot . getGlobalId ( ) ) ; <END_BUG> cdoSnapshotRepository . save ( globalIdPk , commitMetadataPk , cdoSnapshot ) ; } } @ Override public CommitId getHeadId ( ) { } @ Override public void setJsonConverter ( JsonConverter jsonConverter ) { } }

Fix:
long globalIdPk = globalIdRepository . getOrInsertId ( cdoSnapshot . getGlobalId ( ) ) ;