nus-yam/ex-repair huggingface dataset:
Buggy code:
public class WapUserCleanForSoft extends BaseRichBolt { private static final long serialVersionUID = 1L ; OutputCollector collector ; Set < String > userSet = new HashSet < String > ( ) ; Set < String > ipSet = new HashSet < String > ( ) ; static Logger log = Logger . getLogger ( WapUserCleanForSoft . class ) ; public void prepare ( Map stormConf , TopologyContext context , OutputCollector collector ) { } public void execute ( Tuple input ) { try { String msisdn = input . getStringByField ( MSISDN . name ( ) ) ; String remoteip = input . getStringByField ( REMOTEIP . name ( ) ) ; String terminal = input . getStringByField ( TERMINAL . name ( ) ) ; Boolean accType = input . getStringByField ( ACCESSTYPE . name ( ) ) . trim ( ) . equalsIgnoreCase ( "16" ) ; Boolean isMM = ismm ( terminal ) ; <START_BUG> if ( accType && ( ! isMM ) ) { <END_BUG> String firstNum = msisdn . substring ( 0 , 1 ) ; Boolean isvisited ; if ( ! ( firstNum . equalsIgnoreCase ( "9" ) ) ) { isvisited = isVisted ( msisdn ) ; if ( ! isvisited ) { userSet . add ( msisdn ) ; collector . emit ( new Values ( msisdn ) ) ; } } else { isvisited = isIPVisted ( remoteip ) ; if ( ! isvisited ) { ipSet . add ( remoteip ) ; collector . emit ( new Values ( remoteip ) ) ; } } } } catch ( IllegalArgumentException e ) { if ( input . getSourceStreamId ( ) . equals ( SIGNAL24H . name ( ) ) ) { WapUserCleanForSoft . log . info ( "24Hour<seq2seq4repair_space>is<seq2seq4repair_space>coming." ) ; userSet . clear ( ) ; ipSet . clear ( ) ; } } collector . ack ( input ) ; } private Boolean ismm ( String s ) { } private Boolean isIPVisted ( String remoteip ) { } private Boolean isVisted ( String msisdn ) { } public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } public void cleanup ( ) { } }

Fix:
if ( ( accType && ( ! isMM ) ) && ( ( msisdn . length ( ) ) >= 1 ) ) {
Buggy code:
public abstract class StatCalculator < T extends Number & Comparable < T > > { private final List < T > values = new ArrayList < T > ( ) ; private double sum = 0 ; private double sumOfSquares = 0 ; private double mean = 0 ; private double deviation = 0 ; private int count = 0 ; private long bytes = 0 ; private final T ZERO ; private final T MAX_VALUE ; private final T MIN_VALUE ; public StatCalculator ( T zero , T min , T max ) { } public void clear ( ) { } public void addBytes ( long newValue ) { } public void addAll ( StatCalculator < T > calc ) { } <START_BUG> public Number getMedian ( ) { <END_BUG> if ( ( count ) > 0 ) { return values . get ( ( ( int ) ( ( values . size ( ) ) * 0.5 ) ) ) ; } return ZERO ; } public long getTotalBytes ( ) { } public T getPercentPoint ( float percent ) { } public T getPercentPoint ( double percent ) { } public synchronized HashMap < Number , Number [ ] > getDistribution ( ) { } public double getMean ( ) { } public double getStandardDeviation ( ) { } public T getMin ( ) { } public T getMax ( ) { } public int getCount ( ) { } public void addValue ( T val ) { } private void addSortedValue ( T val ) { } }

Fix:
public T getMedian ( ) {
Buggy code:
public class Decorations extends Canvas { String label ; Image image ; Image [ ] images = new Image [ 0 ] ; int dialogHandle ; boolean minimized ; boolean maximized ; Menu menuBar ; Menu [ ] menus ; Control savedFocus ; Button defaultButton ; Button saveDefault ; Decorations ( ) { } public Decorations ( Composite parent , int style ) { } void _setImages ( Image [ ] images ) { } void add ( Menu menu ) { } void bringToTop ( boolean force ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } int compare ( ImageData data1 , ImageData data2 ) { } Control computeTabGroup ( ) { } Control computeTabRoot ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( int index ) { <START_BUG> state |= ( HANDLE ) | ( CANVAS ) ; <END_BUG> createHandle ( index , handle , true ) ; } void createWidget ( int index ) { } int dialogHandle ( ) { } public Button getDefaultButton ( ) { } public Image getImage ( ) { } public Image [ ] getImages ( ) { } public boolean getMaximized ( ) { } public Menu getMenuBar ( ) { } public boolean getMinimized ( ) { } String getNameText ( ) { } public String getText ( ) { } boolean isTabGroup ( ) { } boolean isTabItem ( ) { } Decorations menuShell ( ) { } void propagateWidget ( boolean enabled ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } boolean restoreFocus ( ) { } void remove ( Menu menu ) { } public void setDefaultButton ( Button button ) { } void setDefaultButton ( Button button , boolean save ) { } public void setImage ( Image image ) { } public void setImages ( Image [ ] images ) { } public void setMaximized ( boolean maximized ) { } public void setMenuBar ( Menu menu ) { } public void setMinimized ( boolean minimized ) { } void setSavedFocus ( Control control ) { } public void setText ( String string ) { } void sort ( Image [ ] images ) { } boolean translateAccelerator ( char key , int keysym , XKeyEvent xEvent , boolean doit ) { } boolean traverseItem ( boolean next ) { } boolean traverseReturn ( ) { } }

Fix:
state |= CANVAS ;
Buggy code:
public class ReportLoad implements Command { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; XStream loadService = new XStream ( ) ; private static final Set < String > commands = new HashSet < String > ( ) ; public ReportLoad ( ) { } public Set < String > getActionNames ( ) { } public void doAction ( ActionEvent e ) { boolean merging = e . getActionCommand ( ) . equals ( "merge" ) ; if ( ! merging ) { ReportActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , "close" ) ) ; } JFileChooser chooser = ReportFileDialoger . promptToOpenFile ( new String [ ] { ".jmr" } ) ; if ( chooser == null ) { return ; } boolean isTestPlan = false ; InputStream reader = null ; File f = null ; try { f = chooser . getSelectedFile ( ) ; if ( f != null ) { if ( merging ) { ReportLoad . log . info ( ( "Merging<seq2seq4repair_space>file:<seq2seq4repair_space>" + f ) ) ; } else { ReportLoad . log . info ( ( "Loading<seq2seq4repair_space>file:<seq2seq4repair_space>" + f ) ) ; <START_BUG> FileServer . getFileServer ( ) . setBasedir ( f . getAbsolutePath ( ) ) ; <END_BUG> } reader = new FileInputStream ( f ) ; HashTree tree = SaveService . loadTree ( reader ) ; isTestPlan = insertLoadedTree ( e . getID ( ) , tree ) ; } } catch ( NoClassDefFoundError ex ) { String msg = ex . getMessage ( ) ; if ( msg == null ) { msg = "Missing<seq2seq4repair_space>jar<seq2seq4repair_space>file<seq2seq4repair_space>-<seq2seq4repair_space>see<seq2seq4repair_space>log<seq2seq4repair_space>for<seq2seq4repair_space>details" ; ReportLoad . log . warn ( "Missing<seq2seq4repair_space>jar<seq2seq4repair_space>file" , ex ) ; } JMeterUtils . reportErrorToUser ( msg ) ; } catch ( Exception ex ) { String msg = ex . getMessage ( ) ; if ( msg == null ) { msg = "Unexpected<seq2seq4repair_space>error<seq2seq4repair_space>-<seq2seq4repair_space>see<seq2seq4repair_space>log<seq2seq4repair_space>for<seq2seq4repair_space>details" ; ReportLoad . log . warn ( "Unexpected<seq2seq4repair_space>error" , ex ) ; } JMeterUtils . reportErrorToUser ( msg ) ; } finally { JOrphanUtils . closeQuietly ( reader ) ; ReportGuiPackage . getInstance ( ) . updateCurrentGui ( ) ; ReportGuiPackage . getInstance ( ) . getMainFrame ( ) . repaint ( ) ; } if ( ( ( ! merging ) && isTestPlan ) && ( f != null ) ) { ReportGuiPackage . getInstance ( ) . setReportPlanFile ( f . getAbsolutePath ( ) ) ; } } public boolean insertLoadedTree ( int id , HashTree tree ) throws Exception , IllegalUserActionException { } }

Fix:
FileServer . getFileServer ( ) . setBaseForScript ( f ) ;
Buggy code:
public class PackageTest extends TestCase { public PackageTest ( String name ) { } public void testAdd1 ( ) throws Exception { } public void testEqualsAndHashCode1 ( ) throws Exception { } public void testAddObjectAndTree ( ) throws Exception { } public void testEqualsAndHashCode2 ( ) throws Exception { } public void testSearch ( ) throws Exception { ListedHashTree tree = new ListedHashTree ( ) ; SearchByClass < Integer > searcher = new SearchByClass < Integer > ( Integer . class ) ; String one = "one" ; String two = "two" ; <START_BUG> Integer o = new Integer ( 1 ) ; <END_BUG> tree . add ( one , o ) ; tree . getTree ( one ) . add ( o , two ) ; tree . traverse ( searcher ) ; assertEquals ( 1 , searcher . getSearchResults ( ) . size ( ) ) ; } }

Fix:
Integer o = Integer . valueOf ( 1 ) ;
Buggy code:
public abstract class Mob extends CollisionObject { protected Texture icon ; protected boolean inAir ; protected String type ; protected boolean dealsDmg ; public Mob ( int x , int y , float width , float height , Texture icon ) { } public Texture getIcon ( ) { } public String getType ( ) { } public void update ( float Delta ) { CollisionSide colSide = CollisionSide . NONE ; CollisionObject playerFoundation = null ; for ( CollisionObject obj : World . rectList ) { colSide = this . collisionSide ( obj ) ; if ( colSide != ( CollisionSide . NONE ) ) { if ( inAir ) { if ( colSide == ( CollisionSide . TOP ) ) { yForce = 1 ; y = ( obj . getY ( ) ) - ( this . getHeight ( ) ) ; Sounds . playHitTop ( ) ; } if ( colSide == ( CollisionSide . BOTTOM ) ) { inAir = false ; yForce = 0 ; y = ( obj . getY ( ) ) + ( obj . getHeight ( ) ) ; playerFoundation = obj ; } if ( colSide == ( CollisionSide . RIGHT ) ) { } } if ( colSide == ( CollisionSide . RIGHT ) ) { xForce = 0 ; x = ( obj . getX ( ) ) - ( this . getWidth ( ) ) ; } if ( colSide == ( CollisionSide . LEFT ) ) { xForce = 0 ; x = ( obj . getX ( ) ) + ( obj . getWidth ( ) ) ; } } } if ( inAir ) { <START_BUG> yForce -= 15.0F * ( World . gravity ) ; <END_BUG> y += ( yForce ) * Delta ; } if ( playerFoundation != null ) { x += ( playerFoundation . xForce ) * 2 ; } x += ( xForce ) * Delta ; } No newline ; at end ; of file ; }

Fix:
yForce -= ( 700.0F * ( World . gravity ) ) * Delta ;
Buggy code:
public class MainActivity extends ActionBarActivity { private Button mBPaste ; private Button mBStart ; private Button mBEnd ; private PunchRecord mRecordToday ; private PunchRecord mRecordSelected ; private PunchRecord mRecordCopied ; private Calendar mCalendar ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onPause ( ) { } private void setToday ( ) { } private int delete ( long baseTime ) { } private PunchRecord query ( long baseTime ) { } private void saveRecord ( ) { } public void onPunchClick ( View view ) { } public void onCopyClick ( View view ) { } public void onPasteClick ( View view ) { } public void onStartClick ( View view ) { } public void onEndClick ( View view ) { } public void onMonthClick ( View view ) { saveRecord ( ) ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTimeInMillis ( mCalendar . getTimeInMillis ( ) ) ; calendar . set ( Calendar . DAY_OF_MONTH , 1 ) ; String firstDay = String . valueOf ( calendar . getTimeInMillis ( ) ) ; calendar . add ( Calendar . MONTH , 1 ) ; String lastDay = String . valueOf ( calendar . getTimeInMillis ( ) ) ; <START_BUG> int hours = PunchDb . getInstance ( ) . querySum ( PunchRecord . class , "hours" , "baseTime>=?<seq2seq4repair_space>and<seq2seq4repair_space>baseTime<?" , new String [ ] { firstDay , lastDay } ) ; <END_BUG> Toast . makeText ( this , String . valueOf ( hours ) , LENGTH_LONG ) . show ( ) ; } public void onAddLocationClick ( View view ) { } public void onRemoveLocationClick ( View view ) { } private void updateHours ( PunchRecord record ) { } }

Fix:
int hours = PunchDb . getInstance ( ) . querySum ( PunchRecord . class , "hours" , "base_time>=?<seq2seq4repair_space>and<seq2seq4repair_space>base_time<?" , new String [ ] { firstDay , lastDay } ) ;
Buggy code:
final class CSVLexer extends Lexer { CSVLexer ( final CSVFormat format , final ExtendedBufferedReader in ) { } @ Override Token nextToken ( final Token token ) throws IOException { int lastChar = in . getLastChar ( ) ; int c = in . read ( ) ; boolean eol = readEndOfLine ( c ) ; if ( ignoreEmptyLines ) { while ( eol && ( isStartOfLine ( lastChar ) ) ) { lastChar = c ; c = in . read ( ) ; eol = readEndOfLine ( c ) ; if ( isEndOfFile ( c ) ) { token . type = Type . EOF ; return token ; } } } if ( ( isEndOfFile ( lastChar ) ) || ( ( ! ( isDelimiter ( lastChar ) ) ) && ( isEndOfFile ( c ) ) ) ) { token . type = Type . EOF ; return token ; } if ( ( isStartOfLine ( lastChar ) ) && ( isCommentStart ( c ) ) ) { <START_BUG> String line = in . readLine ( ) ; <END_BUG> if ( line == null ) { token . type = Type . EOF ; return token ; } final String comment = line . trim ( ) ; token . content . append ( comment ) ; token . type = Type . COMMENT ; return token ; } while ( ( token . type ) == ( Type . INVALID ) ) { if ( ignoreSurroundingSpaces ) { while ( ( isWhitespace ( c ) ) && ( ! eol ) ) { c = in . read ( ) ; eol = readEndOfLine ( c ) ; } } if ( isDelimiter ( c ) ) { token . type = Type . TOKEN ; } else if ( eol ) { token . type = Type . EORECORD ; } else if ( isQuoteChar ( c ) ) { parseEncapsulatedToken ( token ) ; } else if ( isEndOfFile ( c ) ) { token . type = Type . EOF ; token . isReady = true ; } else { parseSimpleToken ( token , c ) ; } } return token ; } private Token parseSimpleToken ( final Token token , int ch ) throws IOException { } private Token parseEncapsulatedToken ( final Token token ) throws IOException { } }

Fix:
final String line = in . readLine ( ) ;
Buggy code:
public class PostRequest { public static String HOST = "localhost" ; public static void main ( String [ ] args ) throws Exception { } private static void postJsonItem ( JsonNode jsonNode ) { String id = jsonNode . get ( "id" ) . asText ( ) ; String title = jsonNode . get ( "title" ) . asText ( ) ; String flag = jsonNode . get ( "flag" ) . asText ( ) ; Future < HttpResponse < String > > httpResponseFuture = Unirest . post ( ( ( "http:////" + ( PostRequest . HOST ) ) + ":9000//item" ) ) . field ( "body" , jsonNode . toString ( ) ) . asStringAsync ( ) ; try { <START_BUG> Thread . sleep ( 1 ) ; <END_BUG> } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } private static void postJsonData ( JsonNode json ) { } private static synchronized void printResponse ( HttpResponse < ? > response ) { } }

Fix:
Thread . sleep ( 2 ) ;
Buggy code:
public class JSDTTernCompletionProposal extends JSTernCompletionProposal implements IJavaCompletionProposal { public JSDTTernCompletionProposal ( TernCompletionProposalRec proposal ) { } @ Override public int getRelevance ( ) { <START_BUG> return 10000 ; <END_BUG> } }

Fix:
return JSDTTernCompletionCollector . TERN_RELEVANT ;
Buggy code:
public class Othello extends BoardModel { private ArrayList < Integer > possibleMoves ; private Player player ; public Othello ( Player player ) { } @ Override public boolean playMove ( int move ) { } public void flipTiles ( ArrayList < Integer > tilesToFlip ) { } @ Override protected boolean isValidMove ( int move ) { } @ Override public int isAWin ( ) { } private boolean boardIsFull ( ) { } private boolean playerHasTiles ( int PLAYER ) { } public int getPossessedTiles ( int player ) { } public boolean hasWon ( ArrayList < Integer > player ) { } private HashMap < Integer , ArrayList < Integer > > findPossibleMoves ( int possition , int stappen , ArrayList < Integer > possiblemoves , int player , int first ) { int posSide = player ; ArrayList < Integer > moves = possiblemoves ; HashMap < Integer , ArrayList < Integer > > flippableMoves = new HashMap < Integer , ArrayList < Integer > > ( ) ; if ( first == 1 ) { return findPossibleMoves ( ( possition + stappen ) , stappen , moves , posSide , 2 ) ; } if ( ( possition >= 0 ) && ( possition < 64 ) ) { if ( ( first == 2 ) && ( ( board [ possition ] ) == ( EMPTY ) ) ) { return null ; } if ( ( ( board [ possition ] ) == ( EMPTY ) ) && ( ( moves . size ( ) ) > 0 ) ) { flippableMoves . put ( possition , moves ) ; return flippableMoves ; } <START_BUG> if ( ( ( ( ( ( ( ( possition // 8 ) >= 0 ) && ( ( possition // 8 ) <= 7 ) ) && ( ( possition % 8 ) <= 7 ) ) && ( ( possition % 8 ) >= 0 ) ) && ( ( stappen % 8 ) == 0 ) ) || ( ( ( ( ( possition // 8 ) > 0 ) && ( ( possition // 8 ) < 7 ) ) && ( ( possition % 8 ) < 7 ) ) && ( ( possition % 8 ) > 0 ) ) ) || ( ( ( ( ( ( possition // 8 ) == 7 ) || ( ( possition // 8 ) == 0 ) ) && ( ( possition % 8 ) <= 7 ) ) && ( ( possition % 8 ) >= 0 ) ) && ( ( stappen == 1 ) || ( stappen == ( - 1 ) ) ) ) ) { <END_BUG> if ( ( board [ possition ] ) == ( getOpponent ( posSide ) ) ) { if ( ! ( moves . contains ( possition ) ) ) { moves . add ( possition ) ; } } else return null ; first ++ ; return findPossibleMoves ( ( possition + stappen ) , stappen , moves , posSide , first ) ; } } return null ; } public int getOpponent ( int side ) { } public HashMap < Integer , ArrayList < Integer > > possibleMoves ( int side ) { } public ArrayList < Integer > getTilesToFlip ( int move ) { } public ArrayList < Integer > getPossibleMoves ( ) { } public void playEmpty ( int i ) { } @ Override public void setActivePlayer ( boolean b ) { } @ Override protected void processAction ( int move ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( ( ( ( ( possition // 8 ) >= 0 ) && ( ( possition // 8 ) <= 7 ) ) && ( ( possition % 8 ) <= 7 ) ) && ( ( possition % 8 ) >= 0 ) ) && ( ( stappen % 8 ) == 0 ) ) || ( ( ( ( ( possition // 8 ) > 0 ) && ( ( possition // 8 ) < 7 ) ) && ( ( possition % 8 ) < 7 ) ) && ( ( possition % 8 ) > 0 ) ) ) || ( ( ( ( ( ( possition // 8 ) == 7 ) || ( ( possition // 8 ) == 0 ) ) && ( ( possition % 8 ) < 7 ) ) && ( ( possition % 8 ) > 0 ) ) && ( ( stappen == 1 ) || ( stappen == ( - 1 ) ) ) ) ) {
Buggy code:
public class QualifiedThisReference extends ThisReference { public TypeReference qualification ; ReferenceBinding currentCompatibleType ; public QualifiedThisReference ( TypeReference name , int pos , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } protected boolean checkAccess ( MethodScope methodScope , TypeBinding targetType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { if ( ( ( bits ) & ( ASTNode . DepthMASK ) ) != 0 ) { Object [ ] emulationPath = currentScope . getExactEmulationPath ( currentCompatibleType ) ; if ( emulationPath == null ) { currentScope . problemReporter ( ) . needImplementation ( ) ; } else { codeStream . generateOuterAccess ( emulationPath , this , currentScope ) ; } } else { codeStream . aload_0 ( ) ; } } <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope ) { } public TypeBinding resolveType ( BlockScope scope ) { } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class TarOutputStream extends FilterOutputStream { public static final int LONGFILE_ERROR = 0 ; public static final int LONGFILE_TRUNCATE = 1 ; public static final int LONGFILE_GNU = 2 ; protected boolean debug ; protected long currSize ; protected String currName ; protected long currBytes ; protected byte [ ] oneBuf ; protected byte [ ] recordBuf ; protected int assemLen ; protected byte [ ] assemBuf ; protected TarBuffer buffer ; protected int longFileMode = TarOutputStream . LONGFILE_ERROR ; private boolean closed = false ; public TarOutputStream ( OutputStream os ) { } public TarOutputStream ( OutputStream os , int blockSize ) { } public TarOutputStream ( OutputStream os , int blockSize , int recordSize ) { } public void setLongFileMode ( int longFileMode ) { } public void setDebug ( boolean debugF ) { } public void setBufferDebug ( boolean debug ) { } public void finish ( ) throws IOException { } public void close ( ) throws IOException { } public int getRecordSize ( ) { } public void putNextEntry ( TarEntry entry ) throws IOException { } public void closeEntry ( ) throws IOException { } public void write ( int b ) throws IOException { } public void write ( byte [ ] wBuf ) throws IOException { } public void write ( byte [ ] wBuf , int wOffset , int numToWrite ) throws IOException { if ( ( ( currBytes ) + numToWrite ) > ( currSize ) ) { throw new IOException ( ( ( ( ( ( ( "request<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>'" + numToWrite ) + "'<seq2seq4repair_space>bytes<seq2seq4repair_space>exceeds<seq2seq4repair_space>size<seq2seq4repair_space>in<seq2seq4repair_space>header<seq2seq4repair_space>of<seq2seq4repair_space>'" ) + ( currSize ) ) + "'<seq2seq4repair_space>bytes<seq2seq4repair_space>for<seq2seq4repair_space>entry<seq2seq4repair_space>'" ) + ( currName ) ) + "'" ) ) ; } if ( ( assemLen ) > 0 ) { if ( ( ( assemLen ) + numToWrite ) >= ( recordBuf . length ) ) { int aLen = ( recordBuf . length ) - ( assemLen ) ; System . arraycopy ( assemBuf , 0 , recordBuf , 0 , assemLen ) ; System . arraycopy ( wBuf , wOffset , recordBuf , assemLen , aLen ) ; buffer . writeRecord ( recordBuf ) ; currBytes += recordBuf . length ; wOffset += aLen ; numToWrite -= aLen ; assemLen = 0 ; } else { System . arraycopy ( wBuf , wOffset , assemBuf , assemLen , numToWrite ) ; wOffset += numToWrite ; assemLen += numToWrite ; <START_BUG> numToWrite -= numToWrite ; <END_BUG> } } while ( numToWrite > 0 ) { if ( numToWrite < ( recordBuf . length ) ) { System . arraycopy ( wBuf , wOffset , assemBuf , assemLen , numToWrite ) ; assemLen += numToWrite ; break ; } buffer . writeRecord ( wBuf , wOffset ) ; int num = recordBuf . length ; currBytes += num ; numToWrite -= num ; wOffset += num ; } } private void writeEOFRecord ( ) throws IOException { } }

Fix:
numToWrite = 0 ;
Buggy code:
public abstract class CreateElementInCUOperation extends JavaModelOperation { protected IDOMCompilationUnit fCUDOM ; protected static final int INSERT_LAST = 1 ; protected static final int INSERT_AFTER = 2 ; protected static final int INSERT_BEFORE = 3 ; protected int fInsertionPolicy = CreateElementInCUOperation . INSERT_LAST ; protected IJavaElement fAnchorElement = null ; protected boolean fCreationOccurred = true ; protected DOMNode fCreatedElement ; protected int fInsertionPosition = - 1 ; protected int fReplacementLength = - 1 ; public CreateElementInCUOperation ( IJavaElement parentElement ) { } protected void checkCanceled ( ) { } public void createAfter ( IJavaElement sibling ) { } public void createBefore ( IJavaElement sibling ) { } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( getMainTaskName ( ) , getMainAmountOfWork ( ) ) ; JavaElementDelta delta = newJavaElementDelta ( ) ; ICompilationUnit unit = getCompilationUnit ( ) ; generateNewCompilationUnitDOM ( unit ) ; if ( fCreationOccurred ) { IBuffer buffer = unit . getBuffer ( ) ; if ( buffer == null ) return ; char [ ] bufferContents = buffer . getCharacters ( ) ; if ( bufferContents == null ) return ; char [ ] elementContents = org . eclipse . jdt . internal . core . Util . normalizeCRs ( fCreatedElement . getCharacters ( ) , bufferContents ) ; switch ( fReplacementLength ) { case - 1 : buffer . append ( elementContents ) ; break ; case 0 : buffer . replace ( fInsertionPosition , 0 , elementContents ) ; break ; default : buffer . replace ( fInsertionPosition , fReplacementLength , elementContents ) ; } unit . save ( null , false ) ; boolean isWorkingCopy = unit . isWorkingCopy ( ) ; if ( ! isWorkingCopy ) <START_BUG> this . setAttribute ( "hasModifiedResource" , "true" ) ; <END_BUG> worked ( 1 ) ; fResultElements = generateResultHandles ( ) ; if ( ( ( ! isWorkingCopy ) && ( ! ( Util . isExcluded ( unit ) ) ) ) && ( unit . getParent ( ) . exists ( ) ) ) { for ( int i = 0 ; i < ( fResultElements . length ) ; i ++ ) { delta . added ( fResultElements [ i ] ) ; } addDelta ( delta ) ; } } } finally { done ( ) ; } } protected abstract IDOMNode generateElementDOM ( ) throws JavaModelException { } protected void generateNewCompilationUnitDOM ( ICompilationUnit cu ) throws JavaModelException { } protected abstract IJavaElement generateResultHandle ( ) { } protected IJavaElement [ ] generateResultHandles ( ) throws JavaModelException { } protected ICompilationUnit getCompilationUnit ( ) { } protected int getMainAmountOfWork ( ) { } public abstract String getMainTaskName ( ) { } public IJavaElement [ ] getResultElements ( ) { } protected void initializeDefaultPosition ( ) { } protected void insertDOMNode ( IDOMNode parent , IDOMNode child ) { } protected void setAlteredName ( String newName ) { } protected void setRelativePosition ( IJavaElement sibling , int policy ) throws IllegalArgumentException { } public IJavaModelStatus verify ( ) { } }

Fix:
this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ;
Buggy code:
public class Wildcard extends SingleTypeReference { public static final int UNBOUND = 0 ; public static final int EXTENDS = 1 ; public static final int SUPER = 2 ; public TypeReference bound ; public int kind ; public Wildcard ( int kind ) { } public char [ ] [ ] getParameterizedTypeName ( ) { } public char [ ] [ ] getTypeName ( ) { } private TypeBinding internalResolveType ( Scope scope , ReferenceBinding genericType , int rank ) { TypeBinding boundType = null ; if ( ( this . bound ) != null ) { <START_BUG> boundType = ( ( scope . kind ) == ( Scope . CLASS_SCOPE ) ) ? this . bound . resolveType ( ( ( ClassScope ) ( scope ) ) ) : this . bound . resolveType ( ( ( BlockScope ) ( scope ) ) ) ; <END_BUG> if ( boundType == null ) { return null ; } } WildcardBinding wildcard = scope . environment ( ) . createWildcard ( genericType , rank , boundType , this . kind ) ; return this . resolvedType = wildcard ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveTypeArgument ( BlockScope blockScope , ReferenceBinding genericType , int rank ) { } public TypeBinding resolveTypeArgument ( ClassScope classScope , ReferenceBinding genericType , int rank ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
boundType = ( ( scope . kind ) == ( Scope . CLASS_SCOPE ) ) ? this . bound . resolveType ( ( ( ClassScope ) ( scope ) ) ) : this . bound . resolveType ( ( ( BlockScope ) ( scope ) ) , true ) ;
Buggy code:
String subKey = null ; <START_BUG> if ( ( splittedKey . split ( "_" ) . length ) > 2 ) { <END_BUG>

Fix:
if ( ( splittedKey . split ( "_|\\." ) . length ) > 2 ) {
Buggy code:
public class BlockLockManager { private static final Logger LOG = LoggerFactory . getLogger ( LOGGER_TYPE ) ; private static final int NUM_LOCKS = 100 ; private static final AtomicLong LOCK_ID_GEN = new AtomicLong ( 0 ) ; private final BlockMetadataManager mMetaManager ; private final List < ClientRWLock > mLockArray = new ArrayList < ClientRWLock > ( BlockLockManager . NUM_LOCKS ) ; private final Map < Long , Set < Long > > mUserIdToLockIdsMap = new HashMap < Long , Set < Long > > ( ) ; private final Map < Long , BlockLockManager . LockRecord > mLockIdToRecordMap = new HashMap < Long , BlockLockManager . LockRecord > ( ) ; private final Object mSharedMapsLock = new Object ( ) ; private class LockRecord { private final long mUserId ; private final long mBlockId ; private final Lock mLock ; LockRecord ( long userId , long blockId , Lock lock ) { } long userId ( ) { } long blockId ( ) { } Lock lock ( ) { } } public BlockLockManager ( BlockMetadataManager metaManager ) { } public Optional < Long > lockBlock ( long userId , long blockId , BlockLockType blockLockType ) { int hashValue = ( ( int ) ( blockId % ( ( long ) ( BlockLockManager . NUM_LOCKS ) ) ) ) ; ClientRWLock blockLock = mLockArray . get ( hashValue ) ; Lock lock = null ; if ( blockLockType == ( BlockLockType . READ ) ) { lock = blockLock . readLock ( ) ; } else if ( blockLockType == ( BlockLockType . WRITE ) ) { lock = blockLock . writeLock ( ) ; } lock . lock ( ) ; <START_BUG> if ( mMetaManager . hasBlockMeta ( blockId ) ) { <END_BUG> lock . unlock ( ) ; return Optional . absent ( ) ; } long lockId = BlockLockManager . LOCK_ID_GEN . getAndIncrement ( ) ; synchronized ( mSharedMapsLock ) { mLockIdToRecordMap . put ( lockId , new BlockLockManager . LockRecord ( userId , blockId , lock ) ) ; Set < Long > userLockIds = mUserIdToLockIdsMap . get ( userId ) ; if ( null == userLockIds ) { mUserIdToLockIdsMap . put ( userId , Sets . newHashSet ( lockId ) ) ; } else { userLockIds . add ( lockId ) ; } } return Optional . of ( lockId ) ; } public boolean unlockBlock ( long lockId ) { } public boolean unlockBlock ( long userId , long blockId ) { } public boolean validateLockId ( long userId , long blockId , long lockId ) { } public void cleanupUser ( long userId ) { } }

Fix:
if ( ! ( mMetaManager . hasBlockMeta ( blockId ) ) ) {
Buggy code:
public interface SightingEntryListener { public void onCreateGetLocation ( DialogFragment dialog ) { } <START_BUG> public void onSightingEntryPositiveClick ( DialogFragment dialog ) ; <END_BUG> public void onSightingEntryNeutralClick ( DialogFragment dialog ) { } public void onCameraSpeciesClick ( DialogFragment dialog ) { } public void onCameraLocationClick ( DialogFragment dialog ) { } }

Fix:
public boolean onSightingEntryPositiveClick ( DialogFragment dialog ) ;
Buggy code:
public class PlanningForInterval { private final HashMap < Integer , Physician > physicians ; private final List < PositionConstraintBase > positionsConstraints ; private final HashBasedTable < LocalDate , String , Position > positions ; private final LinkedList < Double > previousWorkLoads = new LinkedList < > ( ) ; private Solution solution = null ; public PlanningForInterval ( final IntervalDate intervalDate , final HashMap < Integer , Physician > physicians , final List < PositionCode > positionsDefinitions , final List < PositionConstraintBase > positionsConstraints ) { } public boolean findNewSolution ( ) { final PlanningForIntervalSolver solver = new PlanningForIntervalSolver ( physicians , positions , positionsConstraints , solution , previousWorkLoads ) ; final Solution newSolution = solver . findSolution ( ) ; if ( newSolution == null ) { return false ; } else { <START_BUG> if ( ( ( ( solution ) != null ) && ( ( previousWorkLoads . size ( ) ) > 0 ) ) && ( ( newSolution . getWorkLoadSD ( ) ) <= ( previousWorkLoads . getLast ( ) ) ) ) { <END_BUG> previousWorkLoads . addFirst ( newSolution . getWorkLoadSD ( ) ) ; this . solution = newSolution ; } else if ( ( solution ) == null ) { previousWorkLoads . addFirst ( newSolution . getWorkLoadSD ( ) ) ; this . solution = newSolution ; } return true ; } } public LinkedList < Double > getWorkLoadSDs ( ) { } public Solution getSolution ( ) { } }

Fix:
if ( ( ( ( solution ) != null ) && ( ( previousWorkLoads . size ( ) ) > 0 ) ) && ( ( newSolution . getWorkLoadSD ( ) ) <= ( previousWorkLoads . getFirst ( ) ) ) ) {
Buggy code:
public class ZKExecutionCleanup implements ExecutionCleanup { public void cleanup ( Execution exec , Execution parent , List errs ) throws Exception { <START_BUG> if ( ( errs . size ( ) ) > 0 ) { <END_BUG> ZKExceptionHandler . getInstance ( ) . setExceptions ( errs ) ; } } }

Fix:
if ( ( errs != null ) && ( ( errs . size ( ) ) > 0 ) ) {
Buggy code:
public class DetailedProgressViewer extends AbstractProgressViewer { Composite control ; private ScrolledComposite scrolled ; private Composite noEntryArea ; public DetailedProgressViewer ( Composite parent , int style ) { } public void add ( Object [ ] elements ) { } private void updateForShowingProgress ( ) { } private ProgressInfoItem createNewItem ( JobTreeElement info ) { } protected void selectPrevious ( ProgressInfoItem item ) { } protected void selectNext ( ProgressInfoItem item ) { } protected Widget doFindInputItem ( Object element ) { } protected Widget doFindItem ( Object element ) { } protected void doUpdateItem ( Widget item , Object element , boolean fullMap ) { } public Control getControl ( ) { } protected List getSelectionFromWidget ( ) { } protected void inputChanged ( Object input , Object oldInput ) { } protected void internalRefresh ( Object element ) { } public void remove ( Object [ ] elements ) { for ( int i = 0 ; i < ( elements . length ) ; i ++ ) { <START_BUG> if ( ( ( ( JobTreeElement ) ( elements [ i ] ) ) . isJobInfo ( ) ) && ( FinishedJobs . getInstance ( ) . isFinished ( ( ( JobInfo ) ( elements [ i ] ) ) ) ) ) { <END_BUG> Widget item = doFindItem ( elements [ i ] ) ; if ( item != null ) { ( ( ProgressInfoItem ) ( item ) ) . refresh ( ) ; } } else { Widget item = doFindItem ( elements [ i ] ) ; if ( item != null ) { unmapElement ( elements [ i ] ) ; item . dispose ( ) ; } } } Control [ ] existingChildren = control . getChildren ( ) ; for ( int i = 0 ; i < ( existingChildren . length ) ; i ++ ) { ProgressInfoItem item = ( ( ProgressInfoItem ) ( existingChildren [ i ] ) ) ; item . setColor ( i ) ; } control . layout ( true ) ; updateForShowingProgress ( ) ; } public void reveal ( Object element ) { } protected void setSelectionToWidget ( List l , boolean reveal ) { } public void cancelSelection ( ) { } public void setFocus ( ) { } private void refreshAll ( ) { } private void updateVisibleItems ( ) { } }

Fix:
if ( ( ( ( JobTreeElement ) ( elements [ i ] ) ) . isJobInfo ( ) ) && ( FinishedJobs . getInstance ( ) . isKept ( ( ( JobInfo ) ( elements [ i ] ) ) ) ) ) {
Buggy code:
public class QualifiedAllocationExpression extends AllocationExpression { public Expression enclosingInstance ; public TypeDeclaration anonymousType ; public ReferenceBinding superTypeBinding ; public QualifiedAllocationExpression ( ) { } public QualifiedAllocationExpression ( TypeDeclaration anonymousType ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( ( enclosingInstance ) != null ) { flowInfo = enclosingInstance . analyseCode ( currentScope , flowContext , flowInfo ) ; } ReferenceBinding allocatedType = ( ( this . superTypeBinding ) == null ) ? this . binding . declaringClass : this . superTypeBinding ; checkCapturedLocalInitializationIfNecessary ( ( ( ReferenceBinding ) ( allocatedType . erasure ( ) ) ) , currentScope , flowInfo ) ; if ( ( arguments ) != null ) { for ( int i = 0 , count = arguments . length ; i < count ; i ++ ) { flowInfo = arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) ; } } if ( ( anonymousType ) != null ) { flowInfo = anonymousType . analyseCode ( currentScope , flowContext , flowInfo ) ; } ReferenceBinding [ ] thrownExceptions ; if ( ( ( thrownExceptions = binding . thrownExceptions ) . length ) != 0 ) { <START_BUG> flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo , currentScope ) ; <END_BUG> } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public Expression enclosingInstance ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public boolean isSuperAccess ( ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo . unconditionalCopy ( ) , currentScope ) ;
Buggy code:
public class TKEYRecord extends Record { private static TKEYRecord member = new TKEYRecord ( ) ; private Name alg ; private Date timeInception ; private Date timeExpire ; private short mode ; private short error ; private byte [ ] key ; private byte [ ] other ; public static final short SERVERASSIGNED = 1 ; public static final short DIFFIEHELLMAN = 2 ; public static final short GSSAPI = 3 ; public static final short RESOLVERASSIGNED = 4 ; public static final short DELETE = 5 ; private TKEYRecord ( ) { } private TKEYRecord ( Name name , short dclass , int ttl ) { } static TKEYRecord getMember ( ) { } public TKEYRecord ( Name name , short dclass , int ttl , Name alg , Date timeInception , Date timeExpire , short mode , short error , byte [ ] key , byte [ ] other ) { } Record rrFromWire ( Name name , short type , short dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } Record rdataFromString ( Name name , short dclass , int ttl , Tokenizer st , Name origin ) throws IOException { <START_BUG> throw new TextParseException ( "no<seq2seq4repair_space>text<seq2seq4repair_space>format<seq2seq4repair_space>defined<seq2seq4repair_space>for<seq2seq4repair_space>TKEY" ) ; <END_BUG> } protected String modeString ( ) { } public String rdataToString ( ) { } public Name getAlgorithm ( ) { } public Date getTimeInception ( ) { } public Date getTimeExpire ( ) { } public short getMode ( ) { } public short getError ( ) { } public byte [ ] getKey ( ) { } public byte [ ] getOther ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
throw st . exception ( "no<seq2seq4repair_space>text<seq2seq4repair_space>format<seq2seq4repair_space>defined<seq2seq4repair_space>for<seq2seq4repair_space>TKEY" ) ;
Buggy code:
public class DweetingPreferenceManager extends VehiclePreferenceManager { private static final String TAG = "DweetPreferenceManager" ; private VehicleDataSink mDweeter ; public DweetingPreferenceManager ( Context context ) { } public void close ( ) { } protected PreferenceListener createPreferenceListener ( ) { } private void setDweetingStatus ( boolean enabled ) { Log . i ( DweetingPreferenceManager . TAG , ( "Setting<seq2seq4repair_space>dweet<seq2seq4repair_space>to<seq2seq4repair_space>" + enabled ) ) ; SharedPreferences . Editor editor = getPreferences ( ) . edit ( ) ; String thingname = getPreferenceString ( dweeting_thingname_key ) ; <START_BUG> if ( thingname . equals ( "" ) ) { <END_BUG> thingname = DweetLib . getInstance ( getContext ( ) ) . getRandomThingName ( ) ; editor . putString ( getString ( dweeting_thingname_key ) , thingname ) ; editor . putString ( getString ( dweeting_thingname_default ) , thingname ) ; editor . apply ( ) ; } if ( enabled ) { if ( ( mDweeter ) != null ) { stopDweeting ( ) ; } try { mDweeter = new com . openxc . sinks . DweetSink ( getContext ( ) , thingname ) ; } catch ( Exception e ) { Log . w ( DweetingPreferenceManager . TAG , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>dweet<seq2seq4repair_space>sink" , e ) ; return ; } getVehicleManager ( ) . addSink ( mDweeter ) ; } else { stopDweeting ( ) ; } } private void stopDweeting ( ) { } }

Fix:
if ( ( thingname == null ) || ( thingname . equals ( "" ) ) ) {
Buggy code:
@ WebService ( name = "RS" , endpointInterface = "eu.wisebed.api.v3.rs.RS" , portName = "RSPort" , serviceName = "RSService" , targetNamespace = "http:////wisebed.eu//api//v3//rs" ) public class SingleUrnPrefixRSService extends AbstractService implements de . uniluebeck . itm . tr . rs . RSService { private final RS reservationSystem ; private final ServicePublisher servicePublisher ; private ServicePublisherService jaxWsService ; @ Inject public SingleUrnPrefixRSService ( final ServicePublisher servicePublisher , final RS rs ) { } @ Override public List < ConfidentialReservationData > getReservation ( final List < SecretReservationKey > secretReservationKeys ) throws RSFault_Exception , UnknownSecretReservationKeyFault { } @ Override public void cancelReservation ( final List < SecretAuthenticationKey > secretAuthenticationKeys , final List < SecretReservationKey > secretReservationKeys ) throws AuthenticationFault , AuthorizationFault , RSFault_Exception , UnknownSecretReservationKeyFault { } @ Override public List < SecretReservationKey > makeReservation ( final List < SecretAuthenticationKey > secretAuthenticationKeys , final List < NodeUrn > nodeUrns , final DateTime from , final DateTime to , final String description , final List < KeyValuePair > options ) throws AuthenticationFault , AuthorizationFault , RSFault_Exception , ReservationConflictFault_Exception { } @ Override public List < PublicReservationData > getReservations ( final DateTime from , final DateTime to , final Integer offset , final Integer amount , final Boolean showCancelled ) throws RSFault_Exception { } @ Override public List < ConfidentialReservationData > getConfidentialReservations ( final List < SecretAuthenticationKey > secretAuthenticationKey , final DateTime from , final DateTime to , final Integer offset , final Integer amount , final Boolean showCancelled ) throws AuthenticationFault , AuthorizationFault , RSFault_Exception { } @ Override protected void doStart ( ) { } @ Override protected void doStop ( ) { try { if ( ( jaxWsService ) != null ) { <START_BUG> jaxWsService . startAsync ( ) . awaitRunning ( ) ; <END_BUG> } notifyStopped ( ) ; } catch ( Exception e ) { notifyFailed ( e ) ; } } }

Fix:
jaxWsService . stopAsync ( ) . awaitTerminated ( ) ;
Buggy code:
public class InputView extends RelativeLayout implements OnDateSetListener , OnClickListener , RadioGroup . OnCheckedChangeListener { private Context context ; private static final String [ ] COLUMN_NAMES = new String [ ] { "@@útF" , "@@àeF" , "JeSF" , "@@àzF" } ; private static final String [ ] TABLE = new String [ ] { "ûü" , "xo" } ; private TextView [ ] labels ; private EditText [ ] fields ; private TextView [ ] checker ; private RadioGroup radioGroup ; private RadioButton [ ] radioButtons ; private Button OK ; private Button cancel ; public static final int SUCCESS = 0 ; public static final int ERROR_EMPTY = 1 ; public static final int ERROR_FORMAT = 2 ; public InputView ( Context context ) { } private void createColumn ( String label , int ID ) { } private void createRadioButtons ( ) { } private void createButtons ( ) { } public void setup ( ) { } public void setup ( String [ ] columns ) { } public void noticeError ( int column ) { } @ Override public void onClick ( View view ) { } @ Override public void onCheckedChanged ( RadioGroup group , int checkedId ) { } @ Override public void onDateSet ( DatePicker view , int year , int month , int day ) { <START_BUG> String monthOfStr = ( month < 10 ) ? "0" + ( ++ month ) : "" + ( ++ month ) ; <END_BUG> String dayOfStr = ( day < 10 ) ? "0" + day : "" + day ; fields [ 0 ] . setText ( ( ( ( ( year + "-" ) + monthOfStr ) + "-" ) + dayOfStr ) ) ; } }

Fix:
String monthOfStr = ( month < 9 ) ? "0" + ( ++ month ) : "" + ( ++ month ) ;
Buggy code:
public interface EvaluationSubmitterView extends IsWidget , SynapseView { void setPresenter ( EvaluationSubmitterView . Presenter presenter ) { } void showModal1 ( boolean showEntityFinder , List < Evaluation > evaluations ) { } void hideModal1 ( ) { } void showModal2 ( ) { } void hideModal2 ( ) { } void showSubmissionAcceptedDialogs ( String receiptMessage ) { } void addEligibleContributor ( String principalId ) { } void addInEligibleContributor ( String principalId , String reason ) { } void setTeamInEligibleErrorVisible ( boolean isVisible , String error ) { } void clearContributors ( ) { } void showRegisterTeamDialog ( String challengeId ) { } void setTeamComboBoxEnabled ( boolean isEnabled ) { } void showEmptyTeams ( ) { } void clearTeams ( ) { } void showTeams ( List < Team > registeredTeams ) { } void setContributorsLoading ( boolean isVisible ) { } void setNextButtonLoading ( ) { } void resetNextButton ( ) { } public interface Presenter { void onNextClicked ( Reference selectedEntity , String submissionName , Evaluation evaluation ) { } void onDoneClicked ( ) { } <START_BUG> void onTeamSelected ( String teamName ) ; <END_BUG> void teamAdded ( ) { } void onRegisterTeamClicked ( ) { } void onNewTeamClicked ( ) { } void onIndividualSubmissionOptionClicked ( ) { } void onTeamSubmissionOptionClicked ( ) { } } }

Fix:
void onTeamSelected ( int index ) ;
Buggy code:
@ Repository public class SuccessStoryDaoImpl implements SuccessStoryDao { @ Autowired private SessionFactory session ; @ Override public void add ( SuccessStory s ) { } @ Override public void edit ( SuccessStory s ) { } @ Override public void delete ( int storyId ) { } @ Override public SuccessStory getSuccesStory ( int storyId ) { } @ Override public List < SuccessStory > getAllSuccessStories ( ) { <START_BUG> List < SuccessStory > list = ( ( List < SuccessStory > ) ( session . getCurrentSession ( ) . createQuery ( "from<seq2seq4repair_space>SuccessStories" ) . list ( ) ) ) ; <END_BUG> return list ; } }

Fix:
List < SuccessStory > list = ( ( List < SuccessStory > ) ( session . getCurrentSession ( ) . createQuery ( "from<seq2seq4repair_space>SuccessStory" ) . list ( ) ) ) ;
Buggy code:
public class FonctionSinusoidale extends FonctionPeriodique { public FonctionSinusoidale ( ) { } public FonctionSinusoidale ( double amplitude , double frequence , double phase ) { } @ Override public Nombre getValeur ( double param ) { <START_BUG> double valeur = ( amplitude ) * ( Math . sin ( ( ( ( ( 2 * ( Math . PI ) ) * ( frequence ) ) * param ) - ( phase ) ) ) ) ; <END_BUG> return new Nombre ( valeur , 0.0 ) ; } }

Fix:
double valeur = ( amplitude ) * ( Math . sin ( ( ( ( ( 2 * ( Math . PI ) ) * ( frequence ) ) * param ) + ( phase ) ) ) ) ;
Buggy code:
public class NumberFormatTransformer extends Transformer { private static final Pattern localeRegex = Pattern . compile ( "^([a-z]{2})-([A-Z]{2})$" ) ; @ SuppressWarnings ( "unchecked" ) public Object transformRow ( Map < String , Object > row , Context context ) { for ( Map < String , String > fld : context . getAllEntityFields ( ) ) { String style = context . replaceTokens ( fld . get ( NumberFormatTransformer . FORMAT_STYLE ) ) ; if ( style != null ) { String column = fld . get ( COLUMN ) ; String srcCol = fld . get ( SRC_COL_NAME ) ; Locale locale = null ; String localeStr = context . replaceTokens ( fld . get ( NumberFormatTransformer . LOCALE ) ) ; if ( srcCol == null ) srcCol = column ; if ( localeStr != null ) { Matcher matcher = NumberFormatTransformer . localeRegex . matcher ( localeStr ) ; if ( ( matcher . find ( ) ) && ( ( matcher . groupCount ( ) ) == 2 ) ) { locale = new Locale ( matcher . group ( 1 ) , matcher . group ( 2 ) ) ; } else { throw new DataImportHandlerException ( DataImportHandlerException . SEVERE , ( "Invalid<seq2seq4repair_space>Locale<seq2seq4repair_space>specified<seq2seq4repair_space>for<seq2seq4repair_space>field:<seq2seq4repair_space>" + fld ) ) ; } } else { locale = Locale . getDefault ( ) ; } Object val = row . get ( srcCol ) ; <START_BUG> String styleSmall = style . toLowerCase ( ) ; <END_BUG> if ( val instanceof List ) { List < String > inputs = ( ( List ) ( val ) ) ; List results = new ArrayList ( ) ; for ( String input : inputs ) { try { results . add ( process ( input , styleSmall , locale ) ) ; } catch ( ParseException e ) { throw new DataImportHandlerException ( DataImportHandlerException . SEVERE , ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>apply<seq2seq4repair_space>NumberFormat<seq2seq4repair_space>on<seq2seq4repair_space>column:<seq2seq4repair_space>" + column ) , e ) ; } } row . put ( column , results ) ; } else { if ( ( val == null ) || ( val . toString ( ) . trim ( ) . equals ( "" ) ) ) continue ; try { row . put ( column , process ( val . toString ( ) , styleSmall , locale ) ) ; } catch ( ParseException e ) { throw new DataImportHandlerException ( DataImportHandlerException . SEVERE , ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>apply<seq2seq4repair_space>NumberFormat<seq2seq4repair_space>on<seq2seq4repair_space>column:<seq2seq4repair_space>" + column ) , e ) ; } } } } return row ; } private Number process ( String val , String style , Locale locale ) throws ParseException { } private Number parseNumber ( String val , NumberFormat numFormat ) throws ParseException { } public static final String FORMAT_STYLE = "formatStyle" ; public static final String LOCALE = "locale" ; public static final String NUMBER = "number" ; public static final String PERCENT = "percent" ; public static final String INTEGER = "integer" ; public static final String CURRENCY = "currency" ; }

Fix:
String styleSmall = style . toLowerCase ( Locale . ENGLISH ) ;