nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BuildContext extends CompilationParticipantResult { public BuildContext ( SourceFile sourceFile ) { } public char [ ] getContents ( ) { } public IFile getFile ( ) { } public boolean hasAnnotations ( ) { } public void recordAddedGeneratedFiles ( IFile [ ] addedGeneratedFiles ) { } public void recordDeletedGeneratedFiles ( IFile [ ] deletedGeneratedFiles ) { } public void recordDependencies ( String [ ] typeNameDependencies ) { } public void recordNewProblems ( CategorizedProblem [ ] newProblems ) { int length2 = newProblems . length ; if ( length2 == 0 ) return ; int length1 = ( ( this . problems ) == null ) ? 0 : this . problems . length ; <START_BUG> IProblem [ ] merged = new IProblem [ length1 + length2 ] ; <END_BUG> if ( length1 > 0 ) System . arraycopy ( this . problems , 0 , merged , 0 , length1 ) ; System . arraycopy ( newProblems , 0 , merged , length1 , length2 ) ; this . problems = merged ; } }

Fix:
CategorizedProblem [ ] merged = new CategorizedProblem [ length1 + length2 ] ;
Buggy code:
public class TextEditor { Shell shell ; ToolBar toolBar ; StyledText text ; Images images = new Images ( ) ; Vector cachedStyles = new Vector ( ) ; Color RED = null ; Color BLUE = null ; Color GREEN = null ; Font font = null ; ToolItem boldButton ; ToolItem italicButton ; ToolItem underlineButton ; ToolItem strikeoutButton ; static ResourceBundle resources = ResourceBundle . getBundle ( "examples_texteditor" ) ; Menu createEditMenu ( ) { } Menu createFileMenu ( ) { } void setStyle ( Widget widget ) { } void clear ( ) { Point sel = text . getSelectionRange ( ) ; <START_BUG> if ( ( sel != null ) && ( ( sel . y ) != 0 ) ) { <END_BUG> StyleRange style ; style = new StyleRange ( sel . x , sel . y , null , null , SWT . NORMAL ) ; text . setStyleRange ( style ) ; } text . setSelectionRange ( ( ( sel . x ) + ( sel . y ) ) , 0 ) ; } void fgColor ( Color fg ) { } void createMenuBar ( ) { } void createShell ( Display display ) { } void createStyledText ( ) { } void createToolBar ( ) { } void handleCutCopy ( ) { } void handleExtendedModify ( ExtendedModifyEvent event ) { } public static void main ( String [ ] args ) { } public Shell open ( Display display ) { } void setFont ( ) { } void initializeColors ( ) { } }

Fix:
if ( ( sel . y ) != 0 ) {
Buggy code:
public class IntroAction extends Action implements ActionFactory . IWorkbenchAction { private IWorkbenchWindow workbenchWindow ; public IntroAction ( IWorkbenchWindow window ) { } public void dispose ( ) { } public void run ( ) { <START_BUG> workbenchWindow . getWorkbench ( ) . showIntro ( workbenchWindow ) ; <END_BUG> } }

Fix:
workbenchWindow . getWorkbench ( ) . showIntro ( workbenchWindow , false ) ;
Buggy code:
public class RemarkNode extends Node { public static final String REMARK_NODE_FILTER = "-r" ; String tagContents ; public RemarkNode ( int tagBegin , int tagEnd , String tagContents ) { } public String getText ( ) { } public String toPlainTextString ( ) { } public String toHtml ( ) { } public String toString ( ) { } public void collectInto ( NodeList collectionList , String filter ) { <START_BUG> if ( filter == ( RemarkNode . REMARK_NODE_FILTER ) ) <END_BUG> collectionList . add ( this ) ; } public void accept ( NodeVisitor visitor ) { } }

Fix:
if ( filter . equals ( RemarkNode . REMARK_NODE_FILTER ) )
Buggy code:
public class PemReader extends BufferedReader { private static final String BEGIN = "-----BEGIN<seq2seq4repair_space>" ; private static final String END = "-----END<seq2seq4repair_space>" ; public PemReader ( Reader reader ) { } public PemObject readPemObject ( ) throws IOException { } private PemObject loadObject ( String type ) throws IOException { String line ; String endMarker = ( PemReader . END ) + type ; <START_BUG> StringBuffer buf = new StringBuffer ( ) ; <END_BUG> List headers = new ArrayList ( ) ; while ( ( line = readLine ( ) ) != null ) { if ( ( line . indexOf ( ":" ) ) >= 0 ) { int index = line . indexOf ( ':' ) ; String hdr = line . substring ( 0 , index ) ; String value = line . substring ( ( index + 1 ) ) . trim ( ) ; headers . add ( new PemHeader ( hdr , value ) ) ; continue ; } if ( ( line . indexOf ( endMarker ) ) != ( - 1 ) ) { break ; } buf . append ( line . trim ( ) ) ; } if ( line == null ) { throw new IOException ( ( endMarker + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; } return new PemObject ( type , headers , Base64 . decode ( buf . toString ( ) ) ) ; } }

Fix:
StringBuilder buf = new StringBuilder ( ) ;
Buggy code:
class MeteredFlusher implements Runnable { private static Logger logger = LoggerFactory . getLogger ( MeteredFlusher . class ) ; public void run ( ) { Memtable activelyMeasuring = Memtable . activelyMeasuring ; long flushingBytes = ( activelyMeasuring == null ) ? 0 : activelyMeasuring . getLiveSize ( ) ; flushingBytes += countFlushingBytes ( ) ; long liveBytes = 0 ; try { for ( ColumnFamilyStore cfs : ColumnFamilyStore . all ( ) ) { long size = cfs . getTotalMemtableLiveSize ( ) ; int maxInFlight = ( ( int ) ( Math . ceil ( ( ( ( double ) ( ( ( 1 + 1 ) + ( DatabaseDescriptor . getFlushWriters ( ) ) ) + ( DatabaseDescriptor . getFlushQueueSize ( ) ) ) ) // ( 1 + ( cfs . getIndexedColumns ( ) . size ( ) ) ) ) ) ) ) ; if ( size > ( ( ( ( DatabaseDescriptor . getTotalMemtableSpaceInMB ( ) ) * 1048576L ) - flushingBytes ) // maxInFlight ) ) { MeteredFlusher . logger . info ( "flushing<seq2seq4repair_space>high-traffic<seq2seq4repair_space>column<seq2seq4repair_space>family<seq2seq4repair_space>{}" , cfs ) ; cfs . forceFlush ( ) ; } else { liveBytes += size ; } } if ( ( flushingBytes + liveBytes ) <= ( ( DatabaseDescriptor . getTotalMemtableSpaceInMB ( ) ) * 1048576L ) ) return ; MeteredFlusher . logger . info ( "estimated<seq2seq4repair_space>{}<seq2seq4repair_space>bytes<seq2seq4repair_space>used<seq2seq4repair_space>by<seq2seq4repair_space>all<seq2seq4repair_space>memtables<seq2seq4repair_space>pre-flush" , liveBytes ) ; List < ColumnFamilyStore > sorted = new ArrayList < ColumnFamilyStore > ( ) ; Iterables . addAll ( sorted , ColumnFamilyStore . all ( ) ) ; Collections . sort ( sorted , new Comparator < ColumnFamilyStore > ( ) { public int compare ( ColumnFamilyStore o1 , ColumnFamilyStore o2 ) { long size1 = o1 . getTotalMemtableLiveSize ( ) ; long size2 = o2 . getTotalMemtableLiveSize ( ) ; if ( size1 < size2 ) return - 1 ; if ( size1 > size2 ) return 1 ; return 0 ; } } ) ; while ( true ) { flushingBytes = countFlushingBytes ( ) ; if ( ( ( liveBytes + flushingBytes ) <= ( ( DatabaseDescriptor . getTotalMemtableSpaceInMB ( ) ) * 1048576L ) ) || ( sorted . isEmpty ( ) ) ) break ; ColumnFamilyStore cfs = sorted . remove ( ( ( sorted . size ( ) ) - 1 ) ) ; long size = cfs . getTotalMemtableLiveSize ( ) ; MeteredFlusher . logger . info ( "flushing<seq2seq4repair_space>{}<seq2seq4repair_space>to<seq2seq4repair_space>free<seq2seq4repair_space>up<seq2seq4repair_space>{}<seq2seq4repair_space>bytes" , cfs , size ) ; liveBytes -= size ; cfs . forceFlush ( ) ; } } finally { <START_BUG> MeteredFlusher . logger . debug ( "memtable<seq2seq4repair_space>memory<seq2seq4repair_space>usage<seq2seq4repair_space>is<seq2seq4repair_space>{}<seq2seq4repair_space>bytes<seq2seq4repair_space>with<seq2seq4repair_space>{}<seq2seq4repair_space>live" , ( liveBytes + flushingBytes ) , liveBytes ) ; <END_BUG> } } private long countFlushingBytes ( ) { } }

Fix:
MeteredFlusher . logger . trace ( "memtable<seq2seq4repair_space>memory<seq2seq4repair_space>usage<seq2seq4repair_space>is<seq2seq4repair_space>{}<seq2seq4repair_space>bytes<seq2seq4repair_space>with<seq2seq4repair_space>{}<seq2seq4repair_space>live" , ( liveBytes + flushingBytes ) , liveBytes ) ;
Buggy code:
public class WebMethodNoStaticModifierRuleTest extends AbstractWebMethodPublicStaticFinalRuleTest { @ Override public IMethod getMethodToTeset ( ) { } @ Override public String getErrorMessage ( ) { <START_BUG> return JAXWSCoreMessages . WEBMETHOD_NO_STATIC_MODIFIER_ALLOWED_MESSAGE ; <END_BUG> } }

Fix:
return JAXWSCoreMessages . WEBMETHOD_NO_STATIC_MODIFIER_ALLOWED ;
Buggy code:
public class VaoMember { public int mLocation ; public int mCompNum ; public int mType ; public boolean mNormalize ; public int mStride = - 1 ; public int mOffset = - 1 ; public VaoMember ( ) { } public VaoMember ( int location , int compNum , int type , boolean normalize ) { } public VaoMember ( int location , int compNum , int type , boolean normalize , int stride , int offset ) { } public void enable ( GL2ES2 gl ) { } public void disable ( GL2ES2 gl ) { gl . glVertexAttribPointer ( mLocation , mCompNum , mType , mNormalize , mStride , mOffset ) ; <START_BUG> gl . glEnableVertexAttribArray ( mLocation ) ; <END_BUG> } }

Fix:
gl . glDisableVertexAttribArray ( mLocation ) ;
Buggy code:
public class JavaSampler extends AbstractSampler implements TestListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 232L ; public static final String CLASSNAME = "classname" ; public static final String ARGUMENTS = "arguments" ; private transient JavaSamplerClient javaClient = null ; private transient JavaSamplerContext context = null ; private static final Set < JavaSampler > allSamplers = new HashSet < JavaSampler > ( ) ; public JavaSampler ( ) { } public void setArguments ( Arguments args ) { } public Arguments getArguments ( ) { } private void releaseJavaClient ( ) { } public void setClassname ( String classname ) { } public String getClassname ( ) { } public SampleResult sample ( Entry entry ) { } private JavaSamplerClient createJavaClient ( ) { } private String whoAmI ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> sb . append ( Thread . currentThread ( ) . getName ( ) ) ; sb . append ( "@" ) ; sb . append ( Integer . toHexString ( hashCode ( ) ) ) ; sb . append ( "-" ) ; sb . append ( getName ( ) ) ; return sb . toString ( ) ; } public void testStarted ( ) { } public void testStarted ( String host ) { } public void testEnded ( ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } class ErrorSamplerClient extends AbstractJavaSamplerClient { public SampleResult runTest ( JavaSamplerContext p_context ) { } } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class TransformedQueue < E > extends TransformedCollection < E > implements Queue < E > { private static final long serialVersionUID = - 7901091318986132033L ; public static < E > TransformedQueue < E > transformingQueue ( final Queue < E > queue , final Transformer < ? super E , ? extends E > transformer ) { } public static < E > TransformedQueue < E > transformedQueue ( final Queue < E > queue , final Transformer < ? super E , ? extends E > transformer ) { } protected TransformedQueue ( final Queue < E > queue , final Transformer < ? super E , ? extends E > transformer ) { } protected Queue < E > getQueue ( ) { <START_BUG> return ( ( Queue < E > ) ( collection ) ) ; <END_BUG> } public boolean offer ( final E obj ) { } public E poll ( ) { } public E peek ( ) { } public E element ( ) { } public E remove ( ) { } }

Fix:
return ( ( Queue < E > ) ( TransformedQueue . decorated ( ) ) ) ;
Buggy code:
public class CS56ProjectDump { public static String readAllBytes ( String filename ) throws Exception { } public static void main ( String [ ] args ) { try { String oauthToken = Demo1 . readAllBytes ( "tokens//MostPrivileges.txt" ) ; System . out . println ( ( "Read<seq2seq4repair_space>oauthToken--length<seq2seq4repair_space>is<seq2seq4repair_space>" + ( oauthToken . length ( ) ) ) ) ; <START_BUG> URL url = new URL ( "https:////api.github.com//orgs//UCSB-CS56-Projects//repos" ) ; <END_BUG> HttpURLConnection conn = ( ( HttpURLConnection ) ( url . openConnection ( ) ) ) ; conn . setRequestMethod ( "GET" ) ; conn . setRequestProperty ( "Accept" , "application//json" ) ; if ( ( conn . getResponseCode ( ) ) != 200 ) { throw new RuntimeException ( ( "Failed<seq2seq4repair_space>:<seq2seq4repair_space>HTTP<seq2seq4repair_space>error<seq2seq4repair_space>code<seq2seq4repair_space>:<seq2seq4repair_space>" + ( conn . getResponseCode ( ) ) ) ) ; } BufferedReader br = new BufferedReader ( new InputStreamReader ( conn . getInputStream ( ) ) ) ; String apiOutput = br . readLine ( ) ; System . out . println ( apiOutput ) ; conn . disconnect ( ) ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } }

Fix:
URL url = new URL ( "https:////api.github.com//orgs//UCSB-CS56-Projects//repos?per_page=100" ) ;
Buggy code:
public abstract class AbstractDataSourceAdd extends AbstractAddStepHandler { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final Resource resource = createResource ( context ) ; populateModel ( context , operation , resource ) ; final ModelNode model = resource . getModel ( ) ; <START_BUG> boolean enabled = ( ! ( operation . hasDefined ( Constants . ENABLED . getName ( ) ) ) ) || ( Constants . ENABLED . resolveModelAttribute ( context , model ) . asBoolean ( ) ) ; <END_BUG> if ( requiresRuntime ( context ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final List < ServiceController < ? > > controllers = new ArrayList < ServiceController < ? > > ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; performRuntime ( context , operation , resource , model , verificationHandler , controllers ) ; if ( requiresRuntimeVerification ( ) ) { context . addStep ( verificationHandler , VERIFY ) ; } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { rollbackRuntime ( context , operation , model , controllers ) ; } } ) ; } } , RUNTIME ) ; } if ( enabled ) { context . addStep ( new DataSourceEnable ( ( ( this ) instanceof XaDataSourceAdd ) ) , MODEL ) ; } context . stepCompleted ( ) ; } @ Override protected final void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private void performRuntime ( final OperationContext context , final ModelNode operation , final Resource resource , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > controllers ) throws OperationFailedException { } protected abstract void startConfigAndAddDependency ( ServiceBuilder < ? > dataSourceServiceBuilder , AbstractDataSourceService dataSourceService , String jndiName , ServiceTarget serviceTarget , final ModelNode operation , final ServiceVerificationHandler serviceVerificationHandler ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected abstract AbstractDataSourceService createDataSourceService ( final String dsName , final String jndiName ) throws OperationFailedException { } static void populateAddModel ( final ModelNode operation , final ModelNode modelNode , final String connectionPropertiesProp , final SimpleAttributeDefinition [ ] attributes , PropertiesAttributeDefinition [ ] properties ) throws OperationFailedException { } }

Fix:
boolean enabled = ( ! ( operation . hasDefined ( Constants . ENABLED . getName ( ) ) ) ) || ( operation . get ( Constants . ENABLED . getName ( ) ) . asBoolean ( ) ) ;
Buggy code:
public class PerformanceTest { private final int max = 10 ; private BufferedReader getBufferedReader ( ) throws IOException { } private long parse ( Reader in ) throws IOException { <START_BUG> CSVFormat format = DEFAULT . withSurroundingSpacesIgnored ( false ) ; <END_BUG> long count = 0 ; for ( Object record : format . parse ( in ) ) { count ++ ; } return count ; } private void println ( ) { } private void println ( String s ) { } private long readAll ( BufferedReader in ) throws IOException { } @ Test @ Ignore public void testParseBigFile ( ) throws Exception { } @ Test @ Ignore public void testParseBigFileRepeat ( ) throws Exception { } @ Test @ Ignore public void testReadBigFile ( ) throws Exception { } }

Fix:
CSVFormat format = DEFAULT . withIgnoreSurroundingSpaces ( false ) ;
Buggy code:
public class WebMethodNoFinalModifierRuleTest extends AbstractWebMethodPublicStaticFinalRuleTest { @ Override public IMethod getMethodToTeset ( ) { } @ Override public String getErrorMessage ( ) { <START_BUG> return JAXWSCoreMessages . WEBMETHOD_NO_FINAL_MODIFIER_ALLOWED_MESSAGE ; <END_BUG> } }

Fix:
return JAXWSCoreMessages . WEBMETHOD_NO_FINAL_MODIFIER_ALLOWED ;
Buggy code:
public class UserBetValidator { public List < ValidationFault > validateAddUserBet ( String amountOfUserBet ) { List < ValidationFault > validationFaults = new ArrayList < ValidationFault > ( ) ; String amountName = "amount" ; <START_BUG> if ( ( ( amountOfUserBet == null ) || ( amountOfUserBet . isEmpty ( ) ) ) || ( ( UserBetValidator . isNumeric ( amountOfUserBet ) ) && ( ( Integer . parseInt ( amountOfUserBet ) ) <= 0 ) ) ) { <END_BUG> validationFaults . add ( new ValidationFault ( amountName , ValidationFault . EMTPY_CODE ) ) ; } else if ( ! ( UserBetValidator . isNumeric ( amountOfUserBet ) ) ) { validationFaults . add ( new ValidationFault ( amountName , ValidationFault . INCORRECT_CHAR_CODE ) ) ; } else if ( ( Double . parseDouble ( amountOfUserBet ) ) > ( SessionBean . getUser ( ) . getSaldo ( ) ) ) { validationFaults . add ( new ValidationFault ( amountName , ValidationFault . TO_SHORT_CODE ) ) ; } return validationFaults ; } private static boolean isNumeric ( String stringToCheck ) { } }

Fix:
if ( ( ( amountOfUserBet == null ) || ( amountOfUserBet . isEmpty ( ) ) ) || ( ( UserBetValidator . isNumeric ( amountOfUserBet ) ) && ( ( Double . parseDouble ( amountOfUserBet ) ) <= 0.0 ) ) ) {
Buggy code:
public class TestStressIndexing extends LuceneTestCase { private static final Analyzer ANALYZER = new SimpleAnalyzer ( ) ; private static final Random RANDOM = new Random ( ) ; private abstract static class TimedThread extends Thread { boolean failed ; int count ; private static int RUN_TIME_SEC = 6 ; private TestStressIndexing . TimedThread [ ] allThreads ; public abstract void doWork ( ) throws Throwable { } TimedThread ( TestStressIndexing . TimedThread [ ] threads ) { } public void run ( ) { } private boolean anyErrors ( ) { } } private static class IndexerThread extends TestStressIndexing . TimedThread { IndexWriter writer ; public int count ; int nextID ; public IndexerThread ( IndexWriter writer , TestStressIndexing . TimedThread [ ] threads ) { } public void doWork ( ) throws Exception { } } private static class SearcherThread extends TestStressIndexing . TimedThread { private Directory directory ; public SearcherThread ( Directory directory , TestStressIndexing . TimedThread [ ] threads ) { } public void doWork ( ) throws Throwable { } } public void runStressTest ( Directory directory , boolean autoCommit , MergeScheduler mergeScheduler ) throws Exception { <START_BUG> IndexWriter modifier = new IndexWriter ( directory , autoCommit , TestStressIndexing . ANALYZER , true , MaxFieldLength . LIMITED ) ; <END_BUG> modifier . setMaxBufferedDocs ( 10 ) ; TestStressIndexing . TimedThread [ ] threads = new TestStressIndexing . TimedThread [ 4 ] ; int numThread = 0 ; if ( mergeScheduler != null ) modifier . setMergeScheduler ( mergeScheduler ) ; TestStressIndexing . IndexerThread indexerThread = new TestStressIndexing . IndexerThread ( modifier , threads ) ; threads [ ( numThread ++ ) ] = indexerThread ; indexerThread . start ( ) ; TestStressIndexing . IndexerThread indexerThread2 = new TestStressIndexing . IndexerThread ( modifier , threads ) ; threads [ ( numThread ++ ) ] = indexerThread2 ; indexerThread2 . start ( ) ; TestStressIndexing . SearcherThread searcherThread1 = new TestStressIndexing . SearcherThread ( directory , threads ) ; threads [ ( numThread ++ ) ] = searcherThread1 ; searcherThread1 . start ( ) ; TestStressIndexing . SearcherThread searcherThread2 = new TestStressIndexing . SearcherThread ( directory , threads ) ; threads [ ( numThread ++ ) ] = searcherThread2 ; searcherThread2 . start ( ) ; for ( int i = 0 ; i < numThread ; i ++ ) threads [ i ] . join ( ) ; modifier . close ( ) ; for ( int i = 0 ; i < numThread ; i ++ ) assertTrue ( ( ! ( ( ( TestStressIndexing . TimedThread ) ( threads [ i ] ) ) . failed ) ) ) ; } public void testStressIndexAndSearching ( ) throws Exception { } }

Fix:
IndexWriter modifier = new IndexWriter ( directory , autoCommit , TestStressIndexing . ANALYZER , true ) ;
Buggy code:
public class Matrix { public static int numberOfMatrices ; private final int id ; private final int diagDim ; private double [ ] [ ] A ; Matrix ( int rows , int cols ) { } Matrix ( int rows , int cols , boolean random ) { } Matrix ( int rows , int cols , int diagEl ) { } Matrix ( double [ ] [ ] array ) { } Matrix ( Matrix B ) { } public static Matrix parseMatrixFile ( String path ) throws IOException { } public void setElement ( int row , int col , double value ) { } public int getId ( ) { } public int getRows ( ) { } public int getCols ( ) { } private int getPosAbsRowMax ( int row , int fromcol ) { } private int getPosAbsColMax ( int col , int fromrow ) { } private double getAbsColMax ( int col , int fromrow ) { } private double getAbsRowMax ( int row , int fromcol ) { } private void makeTopLeftCornerNotZero ( int diagEl ) { } public void switchRows ( int row1 , int row2 ) { } public void switchCols ( int col1 , int col2 ) { } public void rowSubtract ( int row1 , int row2 ) { } public void rowTimesScalar ( int row , double scalar ) { } public void triangularise ( ) { } public int getRank ( ) { Matrix tempMatrix = new Matrix ( this ) ; tempMatrix . triangularise ( ) ; int Rank = 0 ; for ( int i = 0 ; i < ( tempMatrix . diagDim ) ; i ++ ) { <START_BUG> if ( ( tempMatrix . A [ i ] [ i ] ) != 0 ) { <END_BUG> Rank ++ ; } } return Rank ; } public String toString ( ) { } }

Fix:
if ( ( ( tempMatrix . A [ i ] [ i ] ) > 1.0E-4 ) || ( ( tempMatrix . A [ i ] [ i ] ) < ( - 1.0E-4 ) ) ) {
Buggy code:
public class WorkbenchPresentationFactory_33 extends WorkbenchPresentationFactory { private static int viewTabPosition = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) . getInt ( VIEW_TAB_POSITION ) ; public WorkbenchPresentationFactory_33 ( ) { } public StackPresentation createViewPresentation ( Composite parent , IStackPresentationSite site ) { DefaultTabFolder folder = new DefaultTabFolder ( parent , ( ( WorkbenchPresentationFactory_33 . viewTabPosition ) | ( SWT . BORDER ) ) , site . supportsState ( STATE_MINIMIZED ) , site . supportsState ( STATE_MAXIMIZED ) ) ; final IPreferenceStore store = PlatformUI . getPreferenceStore ( ) ; final int minimumCharacters = store . getInt ( VIEW_MINIMUM_CHARACTERS ) ; if ( minimumCharacters >= 0 ) { folder . setMinimumCharacters ( minimumCharacters ) ; } PresentablePartFolder partFolder = new PresentablePartFolder ( folder ) ; folder . setUnselectedCloseVisible ( false ) ; <START_BUG> folder . setUnselectedImageVisible ( false ) ; <END_BUG> TabbedStackPresentation result = new TabbedStackPresentation ( site , partFolder , new org . eclipse . ui . internal . presentations . util . StandardViewSystemMenu ( site ) ) ; DefaultThemeListener themeListener = new DefaultThemeListener ( folder , result . getTheme ( ) ) ; result . getTheme ( ) . addListener ( themeListener ) ; new DefaultSimpleTabListener ( result . getApiPreferences ( ) , IWorkbenchPreferenceConstants . SHOW_TRADITIONAL_STYLE_TABS , folder ) ; return result ; } }

Fix:
folder . setUnselectedImageVisible ( true ) ;
Buggy code:
public class DefaultCfNats implements CfNats { private final Nats nats ; private final ObjectMapper mapper ; public DefaultCfNats ( Nats nats ) { } @ Override public boolean isConnected ( ) { } @ Override public void publish ( MessageBody message ) { } @ Override public Registration publish ( MessageBody message , long period , TimeUnit timeUnit ) { } @ Override public < R extends MessageBody < Void > > Request request ( MessageBody < R > message , long timeout , TimeUnit unit , final RequestResponseHandler < R > handler ) { } private String getPublishSubject ( MessageBody message ) { } @ Override public < T extends MessageBody < R > , R > Subscription subscribe ( Class < T > type , PublicationHandler < T , R > handler ) { } @ Override public < T extends MessageBody < R > , R > Subscription subscribe ( Class < T > type , Integer maxMessages , PublicationHandler < T , R > handler ) { } @ Override public < T extends MessageBody < R > , R > Subscription subscribe ( Class < T > type , String queueGroup , PublicationHandler < T , R > handler ) { } @ Override public < T extends MessageBody < R > , R > Subscription subscribe ( Class < T > type , String queueGroup , Integer maxMessages , PublicationHandler < T , R > handler ) { } private < T extends MessageBody < R > , R > MessageHandler createMessageHandler ( final Class < T > type , final PublicationHandler < T , R > handler ) { final ObjectReader reader = ( JsonObject . class . isAssignableFrom ( type ) ) ? mapper . reader ( type ) : null ; return new MessageHandler ( ) { @ Override public void onMessage ( final Message message ) { final String body = message . getBody ( ) ; try { final T cfMessage ; if ( reader == null ) { final Constructor < T > defaultConstructor = type . getConstructor ( ) ; defaultConstructor . setAccessible ( true ) ; cfMessage = defaultConstructor . newInstance ( ) ; } else { cfMessage = reader . < T > readValue ( body ) ; } handler . onMessage ( new Publication < T , R > ( ) { @ Override public Message getNatsMessage ( ) { return message ; } @ Override public T getMessageBody ( ) { return cfMessage ; } @ Override public void reply ( R replyMessage ) { message . reply ( encode ( replyMessage ) ) ; } @ Override public void reply ( R replyMessage , long delay , TimeUnit unit ) { message . reply ( encode ( replyMessage ) , delay , unit ) ; } } ) ; } catch ( Exception e ) { <START_BUG> throw new NatsException ( String . format ( "Error<seq2seq4repair_space>marshaling<seq2seq4repair_space>object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>%s<seq2seq4repair_space>with<seq2seq4repair_space>body<seq2seq4repair_space>%s" , type . getName ( ) , body ) , e ) ; <END_BUG> } } } ; } public Nats getNats ( ) { } private String encode ( Object value ) { } private String getSubject ( Class < ? > type ) { } }

Fix:
throw new NatsException ( String . format ( "Error<seq2seq4repair_space>unmarshaling<seq2seq4repair_space>to<seq2seq4repair_space>object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>%s<seq2seq4repair_space>from<seq2seq4repair_space>body<seq2seq4repair_space>%s" , type . getName ( ) , body ) , e ) ;
Buggy code:
public class Game { private Player _player ; private Level _level ; private Input _ih ; public int offX ; public int offY ; private long _ticks ; private Menu _menu ; public Settings settings ; public boolean shouldRender = false ; public boolean loading = false ; public boolean hasDisplayedLoading = false ; public boolean ticking = false ; public boolean paused = false ; public int score ; public int levelNumber = 0 ; public Game ( Input ih ) { } public void start ( ) { } public void start ( int n ) { } public void loadGame ( ) { } public void tick ( ) { <START_BUG> if ( _ih . pause ) <END_BUG> pause ( ) ; if ( ( ticking ) && ( ! ( paused ) ) ) { _level . tick ( ( ( _ticks ) ++ ) ) ; if ( _player . removed ) lose ( ) ; else if ( _level . won ( ) ) win ( ) ; else _player . lookAt ( ( ( _ih . mouseX ) + ( offX ) ) , ( ( _ih . mouseY ) + ( offY ) ) ) ; playAll ( _level . getSounds ( ) ) ; } if ( ( _menu ) != null ) _menu . tick ( ) ; if ( ( loading ) && ( hasDisplayedLoading ) ) loadGame ( ) ; } public void render ( Renderer r ) { } private void renderGui ( Renderer r ) { } public void playAll ( List < Sound > sounds ) { } public void playSound ( Sound s ) { } public void win ( ) { } public void lose ( ) { } public void setMenu ( Menu m ) { } public void pause ( ) { } public void unPause ( ) { } public boolean hasMenu ( ) { } public void setOffset ( int x , int y ) { } public Player getPlayer ( ) { } public long getTicks ( ) { } public void setPlayer ( Player p ) { } public Level getLevel ( ) { } }

Fix:
if ( ( _ih . pause ) && ( ( this . _menu ) == null ) )
Buggy code:
public class Selection < T > extends AbstractOptions < T > { private static final long serialVersionUID = 1L ; public Selection ( String id , Palette < T > palette ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; IValueMap attrs = tag . getAttributes ( ) ; String onFocus = Selection . getPalette ( ) . getSelectionOnFocusJS ( ) ; if ( onFocus != null ) { <START_BUG> attrs . put ( "onFocus" , onFocus ) ; <END_BUG> } tag . getAttributes ( ) . put ( "ondblclick" , Selection . getPalette ( ) . getRemoveOnClickJS ( ) ) ; } @ Override protected Iterator < T > getOptionsIterator ( ) { } }

Fix:
attrs . put ( "onfocus" , onFocus ) ;
Buggy code:
public class ValueMetaDataImpl implements ValueMetaData { private static final Localizer _loc = Localizer . forPackage ( ValueMetaDataImpl . class ) ; private final FieldMetaData _owner ; private Class _decType = Object . class ; private int _decCode = JavaTypes . OBJECT ; private ClassMetaData _decTypeMeta = null ; private Class _type = null ; private int _code = JavaTypes . OBJECT ; private ClassMetaData _typeMeta = null ; private Class _typeOverride = null ; private int _delete = CASCADE_NONE ; private int _persist = CASCADE_AUTO ; private int _attach = CASCADE_IMMEDIATE ; private int _refresh = CASCADE_AUTO ; private boolean _serialized = false ; private Boolean _embedded = null ; private ClassMetaData _embeddedMeta = null ; private int _resMode = MODE_NONE ; private String _mappedBy = null ; private FieldMetaData _mappedByMeta = null ; protected ValueMetaDataImpl ( FieldMetaData owner ) { } public FieldMetaData getFieldMetaData ( ) { } public MetaDataRepository getRepository ( ) { } public Class getType ( ) { } public void setType ( Class type ) { } public int getTypeCode ( ) { } public void setTypeCode ( int code ) { } public boolean isTypePC ( ) { } public ClassMetaData getTypeMetaData ( ) { } public Class getDeclaredType ( ) { } public void setDeclaredType ( Class type ) { } public int getDeclaredTypeCode ( ) { } public void setDeclaredTypeCode ( int code ) { } public boolean isDeclaredTypePC ( ) { } public ClassMetaData getDeclaredTypeMetaData ( ) { } public boolean isEmbedded ( ) { } public void setEmbedded ( boolean embedded ) { } public boolean isEmbeddedPC ( ) { } public ClassMetaData getEmbeddedMetaData ( ) { } public ClassMetaData addEmbeddedMetaData ( ) { } public int getCascadeDelete ( ) { } public void setCascadeDelete ( int delete ) { } public int getCascadePersist ( ) { } public void setCascadePersist ( int persist ) { } public int getCascadeAttach ( ) { } public void setCascadeAttach ( int attach ) { } public int getCascadeRefresh ( ) { } public void setCascadeRefresh ( int refresh ) { } public boolean isSerialized ( ) { } public void setSerialized ( boolean serialized ) { } public String getValueMappedBy ( ) { } public void setValueMappedBy ( String mapped ) { } public FieldMetaData getValueMappedByMetaData ( ) { } public Class getTypeOverride ( ) { } public void setTypeOverride ( Class val ) { } public String toString ( ) { <START_BUG> String ret = _owner . getFullName ( ) ; <END_BUG> if ( ( this ) == ( _owner . getKey ( ) ) ) return ( ( ret + "<key:" ) + ( _decType ) ) + ">" ; if ( ( this ) == ( _owner . getElement ( ) ) ) { if ( ( _owner . getTypeCode ( ) ) == ( JavaTypes . MAP ) ) return ( ( ret + "<value:" ) + ( _decType ) ) + ">" ; return ( ( ret + "<element:" ) + ( _decType ) ) + ">" ; } return ( ( ret + "<" ) + ( _decType ) ) + ">" ; } public int getResolve ( ) { } public void setResolve ( int mode ) { } public void setResolve ( int mode , boolean on ) { } public boolean resolve ( int mode ) { } private void resolveDeclaredType ( Class type ) { } public void copy ( ValueMetaData vmd ) { } }

Fix:
String ret = _owner . getFullName ( true ) ;
Buggy code:
public class Starter { public static void main ( String [ ] args ) { } public Starter ( ) { } public void run ( String botName ) { try { <START_BUG> Runtime . getRuntime ( ) . exec ( ( ( "cmd.exe<seq2seq4repair_space>//C<seq2seq4repair_space>start<seq2seq4repair_space>.//js//" + botName ) + ".bat" ) ) ; <END_BUG> } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } }

Fix:
Runtime . getRuntime ( ) . exec ( ( ( "cmd.exe<seq2seq4repair_space>//C<seq2seq4repair_space>start<seq2seq4repair_space>js\\" + botName ) + ".bat" ) ) ;
Buggy code:
public class PerspectiveRegistry implements IPerspectiveRegistry , IConfigurationElementAdditionHandler , IConfigurationElementRemovalHandler { private String defaultPerspID ; private static final String EXT = "_persp.xml" ; private static final String ID_DEF_PERSP = "PerspectiveRegistry.DEFAULT_PERSP" ; private static final String PERSP = "_persp" ; private static final char SPACE_DELIMITER = '<seq2seq4repair_space>' ; private List perspectives = new ArrayList ( 10 ) ; private ArrayList perspToRemove = new ArrayList ( 5 ) ; public PerspectiveRegistry ( ) { } public void addPerspective ( PerspectiveDescriptor desc ) { } private void add ( PerspectiveDescriptor desc ) { perspectives . add ( desc ) ; IConfigurationElement element = desc . getConfigElement ( ) ; if ( element != null ) { <START_BUG> Workbench . getInstance ( ) . getConfigurationElementTracker ( ) . registerObject ( element , desc ) ; <END_BUG> } } public PerspectiveDescriptor createPerspective ( String label , PerspectiveDescriptor originalDescriptor ) { } public void revertPerspectives ( ArrayList perspToRevert ) { } public void deletePerspectives ( ArrayList perspToDelete ) { } public void deletePerspective ( IPerspectiveDescriptor in ) { } private void internalDeletePerspective ( PerspectiveDescriptor desc ) { } void deleteCustomDefinition ( PerspectiveDescriptor desc ) { } boolean hasCustomDefinition ( PerspectiveDescriptor desc ) { } public IPerspectiveDescriptor findPerspectiveWithId ( String id ) { } public IPerspectiveDescriptor findPerspectiveWithLabel ( String label ) { } public String getDefaultPerspective ( ) { } public IPerspectiveDescriptor [ ] getPerspectives ( ) { } public void load ( ) { } private void loadCustom ( ) { } private void unableToLoadPerspective ( IStatus status ) { } public void saveCustomPersp ( PerspectiveDescriptor desc , XMLMemento memento ) throws IOException { } public IMemento getCustomPersp ( String id ) throws IOException , WorkbenchException { } private void loadPredefined ( ) { } public void setDefaultPerspective ( String id ) { } public boolean validateLabel ( String label ) { } private void verifyDefaultPerspective ( ) { } public IPerspectiveDescriptor clonePerspective ( String id , String label , IPerspectiveDescriptor originalDescriptor ) { } public void revertPerspective ( IPerspectiveDescriptor perspToRevert ) { } public void dispose ( ) { } public void removeInstance ( IConfigurationElement source , Object object ) { } public void addInstance ( IConfigurationElementTracker tracker , IConfigurationElement element ) { } }

Fix:
Workbench . getInstance ( ) . getConfigurationElementTracker ( ) . registerObject ( element , desc , REF_WEAK ) ;
Buggy code:
public class SetOutputLocationOperation extends JavaModelOperation { protected IPath fOutputLocation ; public SetOutputLocationOperation ( IJavaProject project , IPath outputLocation ) { } protected void collectAllSubfolders ( IFolder folder , Vector collection ) throws JavaModelException { } protected Vector determineAffectedPackageFragments ( IPath location ) throws JavaModelException { } protected void executeOperation ( ) throws JavaModelException { beginTask ( Util . bind ( "classpath.settingOutputLocationProgress" ) , 2 ) ; JavaProject project = ( ( JavaProject ) ( getElementsToProcess ( ) [ 0 ] ) ) ; IPath oldLocation = project . getOutputLocation ( ) ; IPath newLocation = fOutputLocation ; boolean deltaToFire = false ; JavaElementDelta delta = newJavaElementDelta ( ) ; Vector added = determineAffectedPackageFragments ( oldLocation ) ; Enumeration pkgs = added . elements ( ) ; while ( pkgs . hasMoreElements ( ) ) { IPackageFragment frag = ( ( IPackageFragment ) ( pkgs . nextElement ( ) ) ) ; ( ( IPackageFragmentRoot ) ( frag . getParent ( ) ) ) . close ( ) ; delta . added ( frag ) ; deltaToFire = true ; } Vector removed = determineAffectedPackageFragments ( newLocation ) ; pkgs = removed . elements ( ) ; while ( pkgs . hasMoreElements ( ) ) { IPackageFragment frag = ( ( IPackageFragment ) ( pkgs . nextElement ( ) ) ) ; ( ( IPackageFragmentRoot ) ( frag . getParent ( ) ) ) . close ( ) ; delta . removed ( frag ) ; deltaToFire = true ; } project . setOutputLocation0 ( fOutputLocation ) ; if ( deltaToFire ) { addDelta ( delta ) ; } worked ( 1 ) ; <START_BUG> project . saveClasspath ( ) ; <END_BUG> worked ( 1 ) ; JavaModelManager . getJavaModelManager ( ) . setLastBuiltState ( project . getProject ( ) , null ) ; done ( ) ; } public IJavaModelStatus verify ( ) { } }

Fix:
project . saveClasspath ( false ) ;
Buggy code:
class EditCommand implements Command { Task newTask ; Task oldTask ; private static final Logger logger = Logger . getLogger ( EditCommand . class . getName ( ) ) ; public EditCommand ( Task _newTask ) { } @ Override public String execute ( Storage storage ) { } @ Override public Command makeUndo ( ) { } private Task makeShallowCopyOfOriginalTask ( Storage storage , int TaskId ) { } @ Override public boolean isToBeAddedToHistory ( ) { <START_BUG> return false ; <END_BUG> } }

Fix:
return true ;
Buggy code:
public class ItemTableViewController implements ViewController { public JPanel table ; private JTable itemsTable ; private JScrollPane scrollPane ; public ItemTableViewController ( ) { } @ Override public JPanel getView ( ) { <START_BUG> return Table ; <END_BUG> } }

Fix:
return table ;
Buggy code:
public class MSVSSCHECKIN extends MSVSS { private String m_LocalPath = null ; private boolean m_Recursive = false ; private boolean m_Writable = false ; private String m_AutoResponse = null ; private String m_Comment = "-" ; public final void setWritable ( boolean argWritable ) { } public void setAutoresponse ( String response ) { } public void setComment ( String comment ) { } public void setLocalpath ( Path localPath ) { } public void setRecursive ( boolean recursive ) { } public void getAutoresponse ( Commandline cmd ) { } public String getComment ( ) { } public void getLocalpathCommand ( Commandline cmd ) throws TaskException { if ( ( m_LocalPath ) == null ) { return ; } else { File dir = resolveFile ( m_LocalPath ) ; if ( ! ( dir . exists ( ) ) ) { boolean done = dir . mkdirs ( ) ; if ( done == false ) { String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; throw new TaskException ( msg ) ; } <START_BUG> project . log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; <END_BUG> } cmd . createArgument ( ) . setValue ( ( ( FLAG_OVERRIDE_WORKING_DIR ) + ( m_LocalPath ) ) ) ; } } public void getRecursiveCommand ( Commandline cmd ) { } public void getWritableCommand ( Commandline cmd ) { } public void execute ( ) throws TaskException { } }

Fix:
log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class AnonymousClassCodePiece extends NamedCodePiece { private CodePiece classDef ; private int number ; public AnonymousClassCodePiece ( CodePiece classDef , int number ) { } public StringBuffer getText ( ) { } public int getStartPosition ( ) { } public int getEndPosition ( ) { } public int getStartLine ( ) { } public int getEndLine ( ) { } public void write ( Writer writer , Stack parseStateStack , int column ) throws Exception { ParseState parseState = ( ( ParseState ) ( parseStateStack . peek ( ) ) ) ; MClass mClass = ( ( MClass ) ( parseState . newClassifier ( new Integer ( number ) . toString ( ) ) ) ) ; if ( mClass == null ) { <START_BUG> mClass = UmlFactory . getFactory ( ) . getCore ( ) . createClass ( ) ; <END_BUG> writer . write ( "REMOVED<seq2seq4repair_space>" ) ; } parseStateStack . push ( new ParseState ( mClass ) ) ; writer . write ( classDef . getText ( ) . toString ( ) ) ; } }

Fix:
mClass = UmlFactory . getFactory ( ) . getCore ( ) . buildClass ( ) ;
Buggy code:
public class MessageSend extends Expression implements InvocationSite { public Expression receiver ; public char [ ] selector ; public Expression [ ] arguments ; public MethodBinding binding ; protected MethodBinding codegenBinding ; MethodBinding syntheticAccessor ; public TypeBinding expectedType ; public long nameSourcePosition ; public TypeBinding actualReceiverType ; public TypeBinding valueCast ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { boolean nonStatic = ! ( binding . isStatic ( ) ) ; flowInfo = receiver . analyseCode ( currentScope , flowContext , flowInfo , nonStatic ) . unconditionalInits ( ) ; if ( nonStatic ) { <START_BUG> receiver . checkNPE ( currentScope , flowContext , flowInfo , true ) ; <END_BUG> } if ( ( arguments ) != null ) { int length = arguments . length ; for ( int i = 0 ; i < length ; i ++ ) { flowInfo = arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } } ReferenceBinding [ ] thrownExceptions ; if ( ( thrownExceptions = binding . thrownExceptions ) != ( Binding . NO_EXCEPTIONS ) ) { flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo . copy ( ) , currentScope ) ; } manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public int nullStatus ( FlowInfo flowInfo ) { } public TypeBinding postConversionType ( Scope scope ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setExpectedType ( TypeBinding expectedType ) { } public void setFieldIndex ( int depth ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
receiver . checkNPE ( currentScope , flowContext , flowInfo ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( TwoModulesFlatTestCase . ModuleAcDeploymentTestCaseSetup . class ) public class TwoModulesFlatTestCase extends TwoRaFlatTestCase { static class ModuleAcDeploymentTestCaseSetup extends AbstractModuleDeploymentTestCaseSetup { public static ModelNode address1 ; @ Override public void doSetup ( ManagementClient managementClient ) throws Exception { } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { super . tearDown ( managementClient , containerId ) ; remove ( TwoModulesFlatTestCase . ModuleAcDeploymentTestCaseSetup . address1 ) ; <START_BUG> removeModule ( "org//jboss//ironjacamar//ra16out1" ) ; <END_BUG> } @ Override protected String getSlot ( ) { } } @ Test @ RunAsClient public void testConnection2 ( ) throws Exception { } @ Override protected ModelNode getAddress ( ) { } }

Fix:
removeModule ( "org//jboss//ironjacamar//ra16out1" , true ) ;
Buggy code:
public class Chert extends Rock { private final String name = "chert" ; public Chert ( ) { } @ Override public Item getItemDropped ( IBlockState bs , Random prng , int p_149650_3_ ) { } @ Override public int quantityDropped ( Random prng ) { <START_BUG> return ( prng . nextInt ( 4 ) ) | 1 ; <END_BUG> } }

Fix:
return 1 ;
Buggy code:
public class IndexView extends BaseView { private final TaskDAO taskdao ; private final TimeDAO timedao ; public IndexView ( User user , EntityManagerFactory emf , HttpContext context , HttpSession session ) { } public TaskDescriptorList getTasks ( ) throws SQLException { } public TimeDescriptorList getTodaysTimes ( ) { } public TimeDescriptorList getMonthsTimes ( ) { } public TimeDescriptorList getYearsTimes ( ) { DateTime start = DateTime . now ( ) . withMonthOfYear ( 1 ) . withDayOfMonth ( 1 ) . withTimeAtStartOfDay ( ) ; <START_BUG> DateTime stop = start . plusMonths ( 1 ) . minusDays ( 1 ) . withTime ( 23 , 59 , 59 , 0 ) ; <END_BUG> return rootItems ( timedao . getTimes ( user , start , stop ) ) ; } private TimeDescriptorList rootItems ( TimeDescriptorList times ) { } }

Fix:
DateTime stop = start . withMonthOfYear ( 12 ) . withDayOfMonth ( 31 ) . withTime ( 23 , 59 , 59 , 0 ) ;
Buggy code:
public abstract class RatingPanel extends Panel { private final class RatingStarBar extends Loop { private static final long serialVersionUID = 1L ; private RatingStarBar ( String id , IModel < Integer > model ) { } @ Override protected void populateItem ( LoopItem item ) { AjaxFallbackLink < Void > link = new AjaxFallbackLink < Void > ( "link" ) { private static final long serialVersionUID = 1L ; @ Override public void onClick ( AjaxRequestTarget target ) { LoopItem item = ( ( LoopItem ) ( getParent ( ) ) ) ; onRated ( ( ( item . getIndex ( ) ) + 1 ) , target ) ; if ( target != null ) { <START_BUG> target . addComponent ( RatingPanel . this . get ( "rater" ) ) ; <END_BUG> } } @ Override public boolean isEnabled ( ) { return ! ( hasVoted . getObject ( ) ) ; } } ; int iteration = item . getIndex ( ) ; link . add ( new WebMarkupContainer ( "star" ) . add ( new SimpleAttributeModifier ( "src" , ( onIsStarActive ( iteration ) ? getActiveStarUrl ( iteration ) : getInactiveStarUrl ( iteration ) ) ) ) ) ; item . add ( link ) ; } } private static final long serialVersionUID = 1L ; public static final ResourceReference STAR0 = new PackageResourceReference ( RatingPanel . class , "star0.gif" ) ; public static final ResourceReference STAR1 = new PackageResourceReference ( RatingPanel . class , "star1.gif" ) ; private IModel < Integer > nrOfStars = new org . apache . wicket . model . Model < Integer > ( 5 ) ; private final IModel < Integer > nrOfVotes ; private final IModel < Boolean > hasVoted ; private Component ratingLabel ; private final boolean addDefaultCssStyle ; public RatingPanel ( String id ) { } public RatingPanel ( String id , IModel < ? extends Number > rating ) { } public RatingPanel ( String id , int nrOfStars ) { } public RatingPanel ( String id , IModel < ? extends Number > rating , int nrOfStars , boolean addDefaultCssStyle ) { } public RatingPanel ( String id , IModel < ? extends Number > rating , int nrOfStars , IModel < Integer > nrOfVotes , boolean addDefaultCssStyle ) { } public RatingPanel ( String id , IModel < ? extends Number > rating , IModel < Integer > nrOfStars , IModel < Integer > nrOfVotes , IModel < Boolean > hasVoted , boolean addDefaultCssStyle ) { } @ Override public void renderHead ( IHeaderResponse response ) { } protected Component newRatingStarBar ( String id , IModel < Integer > nrOfStars ) { } protected Component newRatingLabel ( String id , IModel < ? extends Number > rating , IModel < Integer > nrOfVotes ) { } protected String getActiveStarUrl ( int iteration ) { } protected String getInactiveStarUrl ( int iteration ) { } public RatingPanel setRatingLabelVisible ( boolean visible ) { } protected abstract boolean onIsStarActive ( int star ) { } protected abstract void onRated ( int rating , AjaxRequestTarget target ) { } }

Fix:
target . add ( RatingPanel . this . get ( "rater" ) ) ;