nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PlayStatus { private final MediaFile mediaFile ; private final Player player ; private final Date time ; private static final long TTL_MILLIS = ( ( 6L * 60L ) * 60L ) * 1000L ; public PlayStatus ( MediaFile mediaFile , Player player , Date time ) { } public MediaFile getMediaFile ( ) { } public Player getPlayer ( ) { } public Date getTime ( ) { } public boolean isExpired ( ) { <START_BUG> return ( ( time . getTime ( ) ) + ( PlayStatus . TTL_MILLIS ) ) > ( System . currentTimeMillis ( ) ) ; <END_BUG> } public long getMinutesAgo ( ) { } }

Fix:
return ( System . currentTimeMillis ( ) ) > ( ( time . getTime ( ) ) + ( PlayStatus . TTL_MILLIS ) ) ;
Buggy code:
@ Controller public class RecordController { private static final Logger LOG = LoggerFactory . getLogger ( RecordController . class ) ; @ RequestMapping ( value = "new_record" , method = RequestMethod . GET ) public String showRecordPage ( ) { } @ ResponseBody <START_BUG> @ RequestMapping ( value = "record//new" , produces = MediaType . APPLICATION_JSON_VALUE , method = RequestMethod . POST , headers = HttpConstants . REST_REQUEST_HEADERS ) <END_BUG> public ResponseEntity < String > newRecord ( @ RequestBody String jsonObj ) { RecordController . LOG . debug ( jsonObj ) ; return new ResponseEntity < String > ( "{\"status\":\"ok\"}" , HttpStatus . OK ) ; } }

Fix:
@ RequestMapping ( value = "record//new" , produces = MediaType . APPLICATION_JSON_VALUE , method = RequestMethod . POST , headers = HttpConstants . REST_REQUEST_HEADERS_MEDIA_TYPES )
Buggy code:
public class UUIDTypeTest { private static final Logger logger = Logger . getLogger ( UUIDTypeTest . class ) ; UUIDType uuidType = new UUIDType ( ) ; @ Test public void testCompare ( ) { } public UUID newTimeBasedUUID ( ) { } public static int compareUnsigned ( long n1 , long n2 ) { } public static int compareUUID ( UUID u1 , UUID u2 ) { } public String describeCompare ( UUID u1 , UUID u2 , int c ) { } public int sign ( int i ) { } public static ByteBuffer bytebuffer ( UUID uuid ) { } public void logJdkUUIDCompareToVariance ( UUID u1 , UUID u2 , int expC ) { } public void testCompare ( UUID u1 , UUID u2 , int expC ) { int c = sign ( uuidType . compare ( UUIDTypeTest . bytebuffer ( u1 ) , UUIDTypeTest . bytebuffer ( u2 ) ) ) ; expC = sign ( expC ) ; assertEquals ( ( ( ( "Expected<seq2seq4repair_space>" + ( describeCompare ( u1 , u2 , expC ) ) ) + ",<seq2seq4repair_space>got<seq2seq4repair_space>" ) + ( describeCompare ( u1 , u2 , c ) ) ) , expC , c ) ; <START_BUG> if ( ( u1 . version ( ) ) == 1 ) <END_BUG> assertEquals ( c , sign ( instance . compare ( UUIDTypeTest . bytebuffer ( u1 ) , UUIDTypeTest . bytebuffer ( u2 ) ) ) ) ; logJdkUUIDCompareToVariance ( u1 , u2 , c ) ; } @ Test public void testTimeEquality ( ) { } @ Test public void testTimeSmaller ( ) { } @ Test public void testTimeBigger ( ) { } @ Test public void testTimestampComparison ( ) { } }

Fix:
if ( ( ( u1 . version ( ) ) == 1 ) && ( ( u2 . version ( ) ) == 1 ) )
Buggy code:
public class CoordinateConverter { private static BufferedImage image ; private static double du ; private static double [ ] [ ] directions ; private static double [ ] [ ] startDirections ; private static double M ; public static BoardCoordinate pixelToBoardCoordinate ( PixelCoordinate ac ) throws PixelCoordinateNotOnBoardException { } public static int [ ] getPixel ( PixelCoordinate ac ) { } public static BoardCoordinate pixelToBoardCoordinate ( int x , int y ) throws PixelCoordinateNotOnBoardException { } public static PixelCoordinate boardToPixelCoordinate ( BoardCoordinate bc ) { double width = 96.0 // ( Math . sqrt ( 3.0 ) ) ; int x = ( ( int ) ( Math . round ( ( ( ( ( ( bc . c ) + 7 ) * 0.75 ) * width ) + ( 0.5 * width ) ) ) ) ) ; <START_BUG> return new PixelCoordinate ( x , 360 ) ; <END_BUG> } public static PixelCoordinate boardToPixelCoordinate ( int a , int b , int i ) { } private static void normalize ( double [ ] vec ) { } }

Fix:
return new PixelCoordinate ( x , 24 ) ;
Buggy code:
public class HttpSessionStore extends AbstractHttpSessionStore { public void setAttribute ( Request request , String name , Object value ) { if ( Application . get ( ) . getDebugSettings ( ) . getSerializeSessionAttributes ( ) ) { if ( value instanceof Page ) { <START_BUG> ( ( Page ) ( value ) ) . internalDetach ( ) ; <END_BUG> } String valueTypeName = ( value != null ) ? value . getClass ( ) . getName ( ) : "null" ; try { final ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; new ObjectOutputStream ( out ) . writeObject ( value ) ; log . debug ( ( ( ( ( ( "Stored<seq2seq4repair_space>attribute<seq2seq4repair_space>" + name ) + "{<seq2seq4repair_space>" ) + valueTypeName ) + "}<seq2seq4repair_space>with<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( Bytes . bytes ( out . size ( ) ) ) ) ) ; } catch ( Exception e ) { throw new WicketRuntimeException ( ( "Internal<seq2seq4repair_space>error<seq2seq4repair_space>cloning<seq2seq4repair_space>object.<seq2seq4repair_space>Make<seq2seq4repair_space>sure<seq2seq4repair_space>all<seq2seq4repair_space>dependent<seq2seq4repair_space>objects<seq2seq4repair_space>implement<seq2seq4repair_space>Serializable.<seq2seq4repair_space>Class:<seq2seq4repair_space>" + valueTypeName ) , e ) ; } } WebRequest webRequest = toWebRequest ( request ) ; HttpSession httpSession = getHttpSession ( webRequest ) ; if ( httpSession != null ) { IRequestLogger logger = application . getRequestLogger ( ) ; String attributeName = ( getSessionAttributePrefix ( webRequest ) ) + name ; if ( logger != null ) { if ( ( httpSession . getAttribute ( attributeName ) ) == null ) { logger . objectCreated ( value ) ; } else { logger . objectUpdated ( value ) ; } } httpSession . setAttribute ( attributeName , value ) ; } } public Object getAttribute ( Request request , String name ) { } public void removeAttribute ( Request request , String name ) { } public List < String > getAttributeNames ( Request request ) { } private String getSessionAttributePrefix ( final WebRequest request ) { } public IPageMap createPageMap ( String name , Session session ) { } }

Fix:
( ( Page ) ( value ) ) . detach ( ) ;
Buggy code:
@ Library ( "Photos" ) @ NativeClass public class PHContentEditingInput extends NSObject { public static class PHContentEditingInputPtr extends Ptr < PHContentEditingInput , PHContentEditingInput . PHContentEditingInputPtr > { } public PHContentEditingInput ( ) { } protected PHContentEditingInput ( SkipInit skipInit ) { } @ Property ( selector = "mediaType" ) public native PHAssetMediaType getMediaType ( ) { } @ Property ( selector = "mediaSubtypes" ) public native PHAssetMediaSubtype getMediaSubtypes ( ) { } @ Property ( selector = "creationDate" ) public native NSDate getCreationDate ( ) { } @ Property ( selector = "location" ) public native CLLocation getLocation ( ) { } @ Property ( selector = "uniformTypeIdentifier" ) public native String getUniformTypeIdentifier ( ) { } @ Property ( selector = "adjustmentData" ) public native PHAdjustmentData getAdjustmentData ( ) { } @ Property ( selector = "displaySizeImage" ) public native UIImage getDisplaySizeImage ( ) { } @ Property ( selector = "fullSizeImageURL" ) public native NSURL getFullSizeImageURL ( ) { } @ Property ( selector = "fullSizeImageOrientation" ) <START_BUG> public native int getFullSizeImageOrientation ( ) ; <END_BUG> @ Property ( selector = "avAsset" ) public native AVAsset getAvAsset ( ) { } }

Fix:
public native CGImagePropertyOrientation getFullSizeImageOrientation ( ) ;
Buggy code:
public class ProxyPublisher extends Recorder implements DependecyDeclarer { private final String projectName ; @ DataBoundConstructor public ProxyPublisher ( String projectName ) { } public String getProjectName ( ) { } public AbstractProject < ? , ? > getProject ( ) { <START_BUG> return ( ( AbstractProject < ? , ? > ) ( Hudson . getInstance ( ) . getItem ( projectName ) ) ) ; <END_BUG> } public BuildStepMonitor getRequiredMonitorService ( ) { } @ Override public boolean needsToRunAfterFinalized ( ) { } @ Override public boolean prebuild ( AbstractBuild < ? , ? > build , BuildListener listener ) { } @ Override public boolean perform ( AbstractBuild < ? , ? > build , Launcher launcher , BuildListener listener ) throws IOException , InterruptedException { } @ Override public Collection < ? extends Action > getProjectActions ( AbstractProject < ? , ? > project ) { } public void buildDependencyGraph ( AbstractProject project , DependencyGraph graph ) { } @ Extension public static class DescriptorImpl extends BuildStepDescriptor < Publisher > { @ Override public String getDisplayName ( ) { } @ Override public boolean isApplicable ( Class < ? extends AbstractProject > jobType ) { } public FormValidation doCheckProjectName ( @ AncestorInPath AccessControlled anc , @ QueryParameter String value ) { } } }

Fix:
return ( ( AbstractProject < ? , ? > ) ( Hudson . getInstance ( ) . getItemByFullName ( projectName ) ) ) ;
Buggy code:
public class PrateekAndHisFriends implements Closeable { private PrateekAndHisFriends . InputReader in = new PrateekAndHisFriends . InputReader ( System . in ) ; private PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) , true ) ; public void solve ( ) { } String findContiguosGroup ( long x , long [ ] f ) { String result = "NO" ; long [ ] prefix = new long [ f . length ] ; prefix [ 0 ] = f [ 0 ] ; for ( int i = 1 ; i < ( f . length ) ; i ++ ) { prefix [ i ] = ( prefix [ ( i - 1 ) ] ) + ( f [ i ] ) ; } <START_BUG> for ( int i = 1 ; i < ( f . length ) ; i ++ ) { <END_BUG> if ( ( prefix [ i ] ) == x ) return "YES" ; if ( ( prefix [ i ] ) > x ) { int left = 0 ; int right = i - 1 ; while ( left <= right ) { int mid = ( left + right ) // 2 ; if ( ( ( prefix [ i ] ) - ( prefix [ mid ] ) ) == x ) return "YES" ; else if ( ( ( prefix [ i ] ) - ( prefix [ mid ] ) ) < x ) { right = mid - 1 ; } else { left = mid + 1 ; } } } } return result ; } @ Override public void close ( ) throws IOException { } static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ; public InputReader ( InputStream stream ) { } public String next ( ) { } public int ni ( ) { } public long nl ( ) { } public void close ( ) throws IOException { } } public static void main ( String [ ] args ) { } }

Fix:
for ( int i = 0 ; i < ( f . length ) ; i ++ ) {
Buggy code:
public class Interpreter { private Domain selectedDomain ; private int TOTAL_DATA = 50 ; private static List < String > columnFromQuery = new ArrayList < String > ( ) ; public Interpreter ( Domain selectedDomain ) { } public static List < String > getColumnFromQuery ( ) { } public List < Path > interpret ( MyExprParser . ConditionContext context , List < Path > inputPath ) throws IOException { String field = context . condtn ( ) . field ( ) . getText ( ) ; String operatorType = context . condtn ( ) . operator . getText ( ) ; Column column = this . getColumnFromField ( field ) ; if ( ( context . condtn ( ) . value ( ) . INT ( ) ) != null ) { IntegerGenerator integerGenerator = new IntegerGenerator ( ) ; System . out . println ( "\t\tinteger<seq2seq4repair_space>data" ) ; Integer value = Integer . valueOf ( context . condtn ( ) . value ( ) . getText ( ) ) ; switch ( context . condtn ( ) . operator . getType ( ) ) { case MyExprParser . EQUAL : inputPath = integerGenerator . equalTo ( column , value , inputPath , TOTAL_DATA ) ; break ; case MyExprParser . NOTEQUAL : inputPath = integerGenerator . notEqualTo ( column , value , inputPath , TOTAL_DATA ) ; break ; case MyExprParser . GT : inputPath = integerGenerator . greaterThan ( column , value , inputPath , TOTAL_DATA ) ; break ; case MyExprParser . LT : inputPath = integerGenerator . lessThan ( column , value , inputPath , TOTAL_DATA ) ; break ; case MyExprParser . GTE : break ; case MyExprParser . LTE : break ; default : break ; } } else if ( ( context . condtn ( ) . value ( ) . DOUBLE ( ) ) != null ) { System . out . println ( "\t\tdouble<seq2seq4repair_space>data" ) ; Double value = Double . valueOf ( context . condtn ( ) . value ( ) . getText ( ) ) ; switch ( context . condtn ( ) . operator . getType ( ) ) { case MyExprParser . EQUAL : break ; case MyExprParser . GT : break ; case MyExprParser . LT : break ; case MyExprParser . GTE : break ; case MyExprParser . LTE : break ; default : break ; } } else if ( ( context . condtn ( ) . value ( ) . pattern ( ) ) != null ) { StringGenerator stringGenerator = new StringGenerator ( ) ; System . out . println ( "\t\tstring<seq2seq4repair_space>data" ) ; <START_BUG> String value = context . condtn ( ) . value ( ) . getText ( ) ; <END_BUG> System . out . println ( ( "\t\t\tstring<seq2seq4repair_space>value:" + value ) ) ; inputPath = stringGenerator . generate ( column , value , inputPath , TOTAL_DATA ) ; } else if ( ( context . condtn ( ) . value ( ) . field ( ) ) != null ) { System . out . println ( "\t\tfield<seq2seq4repair_space>data" ) ; } else { System . out . println ( "\t\tunknown<seq2seq4repair_space>data" ) ; } return inputPath ; } public Column getColumnFromField ( String field ) { } }

Fix:
String value = context . condtn ( ) . value ( ) . pattern ( ) . regex ( ) . getText ( ) ;
Buggy code:
public final class TextValueEncoderTest extends MahoutTestCase { @ Test public void testAddToVector ( ) { } @ Test public void testAsString ( ) { } @ Test public void testLuceneEncoding ( ) throws Exception { LuceneTextValueEncoder enc = new LuceneTextValueEncoder ( "text" ) ; <START_BUG> enc . setAnalyzer ( new org . apache . lucene . analysis . core . WhitespaceAnalyzer ( Version . LUCENE_41 ) ) ; <END_BUG> Vector v1 = new DenseVector ( 200 ) ; enc . addToVector ( "test1<seq2seq4repair_space>and<seq2seq4repair_space>more" , v1 ) ; enc . flush ( 1 , v1 ) ; assertEquals ( 6.0 , v1 . norm ( 1 ) , 0 ) ; assertEquals ( 1.0 , v1 . maxValue ( ) , 0 ) ; v1 = new DenseVector ( 200 ) ; enc . addToVector ( "" , v1 ) ; enc . flush ( 1 , v1 ) ; assertEquals ( 0.0 , v1 . norm ( 1 ) , 0 ) ; assertEquals ( 0.0 , v1 . maxValue ( ) , 0 ) ; v1 = new DenseVector ( 200 ) ; StringBuilder builder = new StringBuilder ( 5000 ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { builder . append ( "token_" ) . append ( i ) . append ( '<seq2seq4repair_space>' ) ; } enc . addToVector ( builder . toString ( ) , v1 ) ; enc . flush ( 1 , v1 ) ; assertEquals ( 2000.0 , v1 . norm ( 1 ) , 0 ) ; assertEquals ( 19.0 , v1 . maxValue ( ) , 0 ) ; } }

Fix:
enc . setAnalyzer ( new org . apache . lucene . analysis . core . WhitespaceAnalyzer ( Version . LUCENE_42 ) ) ;
Buggy code:
public class OSQLHelper { public static final String NAME = "sql" ; public static final String VALUE_NOT_PARSED = "_NOT_PARSED_" ; public static final String NOT_NULL = "_NOT_NULL_" ; public static final String DEFINED = "_DEFINED_" ; private static ClassLoader orientClassLoader = OSQLFilterItemAbstract . class . getClassLoader ( ) ; public static Object parseValue ( String iValue , final OCommandContext iContext ) { } public static Object parseStringNumber ( final String iValue ) { } public static Object parseValue ( final OSQLPredicate iSQLFilter , final OBaseParser iCommand , final String iWord , final OCommandContext iContext ) { } public static Object parseValue ( final OBaseParser iCommand , final String iWord , final OCommandContext iContext ) { } public static OSQLFunctionRuntime getFunction ( final OBaseParser iCommand , final String iWord ) { } public static Object getValue ( final Object iObject ) { } public static Object getValue ( final Object iObject , final ORecordInternal < ? > iRecord , final OCommandContext iContext ) { if ( iObject == null ) return null ; if ( iObject instanceof OSQLFilterItem ) return ( ( OSQLFilterItem ) ( iObject ) ) . getValue ( iRecord , null , iContext ) ; else if ( iObject instanceof String ) { final String s = ( ( String ) ( iObject ) ) . trim ( ) ; <START_BUG> if ( ( ( ! ( s . isEmpty ( ) ) ) && ( ! ( OIOUtils . isStringContent ( iObject ) ) ) ) && ( ! ( Character . isDigit ( s . charAt ( 0 ) ) ) ) ) <END_BUG> return ODocumentHelper . getFieldValue ( iRecord , s , iContext ) ; } return iObject ; } public static Object resolveFieldValue ( final ODocument iDocument , final String iFieldName , final Object iFieldValue , final OCommandParameters iArguments , final OCommandContext iContext ) { } public static ODocument bindParameters ( final ODocument iDocument , final Map < String , Object > iFields , final OCommandParameters iArguments , final OCommandContext iContext ) { } }

Fix:
if ( ( ( ( iRecord != null ) & ( ! ( s . isEmpty ( ) ) ) ) && ( ! ( OIOUtils . isStringContent ( iObject ) ) ) ) && ( ! ( Character . isDigit ( s . charAt ( 0 ) ) ) ) )
Buggy code:
public class Comment implements Comparable < Comment > { private long timestamp ; private int ticket ; private int id ; private String name ; private String comment ; public Comment ( long timestamp , int ticket , int id , String name , String comment ) { } public long getTimestamp ( ) { } public int getTicket ( ) { } public int getId ( ) { } public String getName ( ) { } public String getComment ( ) { } public void setTimestamp ( long timestamp ) { } public void setTicket ( int ticket ) { } public void setId ( int id ) { } public void setName ( String name ) { } public void setComment ( String comment ) { } @ Override public int compareTo ( Comment comment ) { int id = comment . getId ( ) ; <START_BUG> return ( comment . getId ( ) ) - id ; <END_BUG> } }

Fix:
return ( this . getId ( ) ) - id ;
Buggy code:
public class StringICacheTest { private static final ILogger log = Logger . getLogger ( StringICacheTest . class ) ; public int writePercentage = 10 ; public int threadCount = 10 ; public int keyLength = 10 ; public int valueLength = 10 ; public int keyCount = 10000 ; public int valueCount = 10000 ; public int logFrequency = 10000 ; public int performanceUpdateFrequency = 10000 ; public boolean useGetAndPut = true ; public String basename = "stringicache" ; public KeyLocality keyLocality = KeyLocality . Random ; public int minNumberOfMembers = 0 ; public IntervalProbe putLatency ; public IntervalProbe getLatency ; private Cache < String , String > cache ; private String [ ] keys ; private String [ ] values ; private final AtomicLong operations = new AtomicLong ( ) ; private TestContext testContext ; private HazelcastInstance targetInstance ; @ Setup public void setup ( TestContext testContext ) throws Exception { } @ Teardown public void teardown ( ) throws Exception { } @ Warmup ( global = false ) public void warmup ( ) throws InterruptedException { } @ Run public void run ( ) { ThreadSpawner spawner = new ThreadSpawner ( testContext . getTestId ( ) ) ; for ( int k = 0 ; k < ( threadCount ) ; k ++ ) { spawner . spawn ( new StringICacheTest . Worker ( ) ) ; } spawner . awaitCompletion ( ) ; } @ Performance public long getOperationCount ( ) { } private class Worker implements Runnable { private final Random random = new Random ( ) ; @ Override public void run ( ) { long iteration = 0 ; while ( ! ( testContext . isStopped ( ) ) ) { String key = randomKey ( ) ; if ( shouldWrite ( iteration ) ) { putLatency . started ( ) ; String value = randomValue ( ) ; if ( useGetAndPut ) { cache . getAndPut ( key , value ) ; } else { cache . put ( key , value ) ; } putLatency . done ( ) ; } else { getLatency . started ( ) ; cache . get ( key ) ; <START_BUG> getLatency . started ( ) ; <END_BUG> } iteration ++ ; if ( ( iteration % ( logFrequency ) ) == 0 ) { StringICacheTest . log . info ( ( ( ( Thread . currentThread ( ) . getName ( ) ) + "<seq2seq4repair_space>At<seq2seq4repair_space>iteration:<seq2seq4repair_space>" ) + iteration ) ) ; } if ( ( iteration % ( performanceUpdateFrequency ) ) == 0 ) { operations . addAndGet ( performanceUpdateFrequency ) ; } } operations . addAndGet ( ( iteration % ( performanceUpdateFrequency ) ) ) ; } private String randomValue ( ) { } private String randomKey ( ) { } private boolean shouldWrite ( long iteration ) { } } public static void main ( String [ ] args ) throws Throwable { } }

Fix:
getLatency . done ( ) ;
Buggy code:
public abstract class CBFragmentMvpRecyclerViewPtr < AD , D , V extends MvpLceView < D > , P extends MvpPresenter < V > , A extends CBAdapterRecyclerView < AD , List < AD > > > extends CBFragmentMvpRecyclerView < AD , D , V , P , A > { protected SwipeRefreshLayout swipeRefreshLayout ; @ Override protected int getLayoutRes ( ) { } @ Override protected void onMvpViewCreated ( View view , Bundle savedInstanceState ) { <START_BUG> swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( view . findViewById ( pull_to_refresh ) ) ) ; <END_BUG> if ( ( swipeRefreshLayout ) == null ) { throw new IllegalStateException ( ( "The<seq2seq4repair_space>swipe<seq2seq4repair_space>refresh<seq2seq4repair_space>layout<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>specified.<seq2seq4repair_space>" + "You<seq2seq4repair_space>have<seq2seq4repair_space>to<seq2seq4repair_space>provide<seq2seq4repair_space>a<seq2seq4repair_space>View<seq2seq4repair_space>with<seq2seq4repair_space>R.id.pull_to_refresh<seq2seq4repair_space>in<seq2seq4repair_space>your<seq2seq4repair_space>inflated<seq2seq4repair_space>xml<seq2seq4repair_space>layout" ) ) ; } swipeRefreshLayout . setOnRefreshListener ( new SwipeRefreshLayout . OnRefreshListener ( ) { @ Override public void onRefresh ( ) { onRefreshStarted ( ) ; } } ) ; } @ Override public void showContent ( ) { } @ Override public void showLoading ( boolean isContentVisible ) { } @ Override public void showError ( Throwable e , boolean isContentVisible ) { } protected void onRefreshStarted ( ) { } }

Fix:
swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( view . findViewById ( pullToRefresh ) ) ) ;
Buggy code:
public class Parser { private static final Logger logger = Log . getLogger ( Parser . class . getName ( ) ) ; private String taskDetails ; public Task parse ( String taskDetails ) { } private Task parseInput ( Task parsedTask , String taskDetails ) { } private Task parseDateTime ( String [ ] param , int num ) { } private DateTime parseDate ( String word , DateTime d ) { if ( word . equals ( "next" ) ) { <START_BUG> d . plusWeeks ( 1 ) ; <END_BUG> } else if ( ( determineDay ( word ) ) != ( - 1 ) ) { d = d . withDayOfWeek ( determineDay ( word ) ) ; } else if ( isValidDate ( word ) ) { d = getDate ( word , d ) ; } else if ( isWordToday ( word ) ) { d = parseDay ( d , 0 ) ; } else if ( isWordTomorrow ( word ) ) { d = parseDay ( d , 1 ) ; } if ( d . isBefore ( initializeDateTime ( ) ) ) { d = d . plusWeeks ( 1 ) ; } return d ; } private boolean isValidDayDate ( String word ) { } private boolean isWordToday ( String word ) { } private boolean isWordTomorrow ( String word ) { } private DateTime parseDay ( DateTime d , int days ) { } private DateTime initializeDateTime ( ) { } private int determineDay ( String day ) { } private boolean isValidDate ( String date ) { } private DateTime getDate ( String date , DateTime d ) { } private boolean isValidTime ( String time ) { } private DateTime getTime ( String taskDetails , DateTime d ) { } private String [ ] tokenize ( String taskDetails ) { } private String getFirstWord ( String details ) { } private String getWord ( String details , int index ) { } private String removeFirstWord ( String details ) { } }

Fix:
d = d . plusWeeks ( 1 ) ;
Buggy code:
@ WebServlet ( "//LoginServlet" ) public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public LoginServlet ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { AccountManager am = ( ( AccountManager ) ( getServletContext ( ) . getAttribute ( "accunt<seq2seq4repair_space>manager" ) ) ) ; String username = request . getParameter ( "username" ) ; String password = request . getParameter ( "password" ) ; if ( am . accountMatch ( username , password ) ) { <START_BUG> RequestDispatcher dispatch = request . getRequestDispatcher ( "welcome.jsp" ) ; <END_BUG> dispatch . forward ( request , response ) ; } else { RequestDispatcher dispatch = request . getRequestDispatcher ( "tryAgain.html" ) ; dispatch . forward ( request , response ) ; } } }

Fix:
RequestDispatcher dispatch = request . getRequestDispatcher ( "Welcome.jsp" ) ;
Buggy code:
public abstract class AbstractTree extends Panel { private TreeState treeState ; public AbstractTree ( final String id , final TreeModel model ) { } public AbstractTree ( final String id , final TreeState treeState ) { } public final TreeState getTreeState ( ) { } public final boolean isExpanded ( DefaultMutableTreeNode node ) { } public final boolean isExpanded ( TreePath path ) { } public final boolean isRootVisible ( ) { } public TreeState newTreeState ( final TreeModel model ) { } public final void setExpandedState ( final DefaultMutableTreeNode node ) { } public final void setExpandedState ( final TreePath selection , final boolean expanded ) { } public final void setRootVisible ( final boolean rootVisible ) { } public final void setSelected ( final DefaultMutableTreeNode node ) { } public final void setTreeState ( final TreeState treeState ) { } public final String toString ( ) { } protected final TreeState newTreeState ( final TreeModel treeModel , final boolean rootVisible ) { final TreeState treeState = new TreeState ( ) ; final TreeSelectionModel treeSelectionModel = new DefaultTreeSelectionModel ( ) ; <START_BUG> treeSelectionModel . setSelectionMode ( TreeSelectionModel . SINGLE_TREE_SELECTION ) ; <END_BUG> treeState . setModel ( treeModel ) ; treeState . setSelectionModel ( treeSelectionModel ) ; treeState . setRootVisible ( rootVisible ) ; treeModel . addTreeModelListener ( treeState ) ; return treeState ; } }

Fix:
treeSelectionModel . setSelectionMode ( TreeSelectionModel . DISCONTIGUOUS_TREE_SELECTION ) ;
Buggy code:
public class PrependContextPathHandlerTest extends WicketTestCase { public PrependContextPathHandlerTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> application . getMarkupSettings ( ) . setMarkupParserFactory ( new wicket . markup . MarkupParserFactory ( application . getMarkupSettings ( ) , new PrependContextPathHandler ( ) ) ) ; <END_BUG> } public final void testBasics ( ) throws Exception { } }

Fix:
application . getMarkupSettings ( ) . setMarkupParserFactory ( new wicket . markup . MarkupParserFactory ( application , new PrependContextPathHandler ( ) ) ) ;
Buggy code:
public class RuntimeUtils { public enum OS { WIN32 , MACOSX , MACOSCLASSIC , LINUX , BSD , RISCOS , BEOS , UNKNOWN ; } public static RuntimeUtils . OS currentOs = null ; public static RuntimeUtils . OS determineOS ( ) { } public static boolean isRunningWindows ( ) { } public static boolean isRunningMacOsX ( ) { } public static boolean isRunningLinux ( ) { } public static boolean isRunningUnix ( ) { } public static String getSupportFolder ( ) { String homedir = System . getProperty ( "user.home" ) ; <START_BUG> String dirName = "PLG" ; <END_BUG> if ( RuntimeUtils . isRunningWindows ( ) ) { new File ( ( ( homedir + "\\" ) + dirName ) ) . mkdirs ( ) ; return ( ( homedir + "\\" ) + dirName ) + "\\" ; } else if ( RuntimeUtils . isRunningMacOsX ( ) ) { new File ( ( ( homedir + "//Library//Application<seq2seq4repair_space>Support//" ) + dirName ) ) . mkdirs ( ) ; return ( ( homedir + "//Library//Application<seq2seq4repair_space>Support//" ) + dirName ) + "//" ; } else { new File ( ( ( homedir + "//." ) + dirName ) ) . mkdirs ( ) ; return ( ( homedir + "//." ) + dirName ) + "//" ; } } }

Fix:
String dirName = "ProcessesLogsGenerator" ;
Buggy code:
public class MetadataHelper { public static final SimpleDateFormat LAST_UPDATED_FIELD_FORMATTER = new SimpleDateFormat ( "yyyyMMddHHmmss" ) ; public static void setLastUpdated ( Versioning versioning ) { } public static void setLatest ( Metadata metadata ) { } public static void setLatest ( Metadata metadata , String currentLatest ) { } public static void setRelease ( Metadata metadata ) { } public static void setRelease ( Metadata metadata , String currentRelease ) { } private static void sortVersions ( List < String > versions ) { } public static SnapshotVersion createSnapshotVersion ( String groupId , String artifactId , String version , String classifier , String extension ) { } public static SnapshotVersion createSnapshotVersion ( Artifact artifact , String extension ) { SnapshotVersion snapshotVersion = new SnapshotVersion ( ) ; snapshotVersion . setVersion ( artifact . getVersion ( ) ) ; <START_BUG> snapshotVersion . setExtension ( FilenameUtils . getExtension ( extension ) ) ; <END_BUG> snapshotVersion . setUpdated ( MetadataHelper . LAST_UPDATED_FIELD_FORMATTER . format ( Calendar . getInstance ( ) . getTime ( ) ) ) ; if ( ( artifact . getClassifier ( ) ) != null ) { snapshotVersion . setClassifier ( artifact . getClassifier ( ) ) ; } return snapshotVersion ; } public static void setupSnapshotVersioning ( Versioning snapshotVersioning ) { } public static boolean containsTimestampedSnapshotVersion ( Metadata metadata , String timestampedSnapshotVersion ) { } public static boolean containsTimestampedSnapshotVersion ( Metadata metadata , String timestampedSnapshotVersion , String classifier ) { } public static boolean containsVersion ( Metadata metadata , String version ) { } public static File getMetadataFile ( Path artifactBasePath ) throws FileNotFoundException { } public static File getArtifactMetadataFile ( Path artifactBasePath ) { } public static File getSnapshotMetadataFile ( Path artifactBasePath , String version ) { } public static File getPluginMetadataFile ( Path artifactBasePath ) { } public static File getMetadataFile ( Path artifactBasePath , String version , MetadataType metadataType ) { } public static Path getMetadataPath ( Path artifactBasePath , String version , MetadataType metadataType ) { } }

Fix:
snapshotVersion . setExtension ( extension ) ;
Buggy code:
public class OverlapSolver { public List < Room > solve ( OverlapSolverConfig osc , List < Room > prects ) { } public List < Room > solve ( OverlapSolverConfig osc , List < Room > testRects , List < Room > outputLayout ) { List < Room > rects = new LinkedList < Room > ( ) ; for ( Room r : testRects ) { rects . add ( new Room ( ( ( r . position . x ) * ( osc . resolution ) ) , ( ( r . position . y ) * ( osc . resolution ) ) , ( ( r . size . x ) * ( osc . resolution ) ) , ( ( r . size . y ) * ( osc . resolution ) ) ) ) ; } boolean overlap = true ; while ( overlap ) { overlap = false ; for ( Room r1 : rects ) { if ( ( outputLayout == null ) || ( ! ( outputLayout . contains ( r1 ) ) ) ) { Vec2 push = new Vec2 ( 0 , 0 ) ; boolean thisOverlap = false ; for ( Room r2 : rects ) { if ( ( r1 != r2 ) && ( r1 . collideWith ( r2 ) ) ) { overlap = true ; thisOverlap = true ; Vec2 normal = r1 . position . sub ( r2 . position ) ; push . x += normal . x ; push . y += normal . y ; } } if ( thisOverlap ) { float sepPar = osc . separationParameter ; if ( osc . enableTweakNearSeparation ) { sepPar = ( osc . separationParameter ) * ( ( r1 . size . x ) + ( r1 . size . y ) ) ; } if ( ( ( push . x ) != 0 ) || ( ( push . y ) != 0 ) ) { if ( osc . enableRandomDisplacement ) { push . x += ( rng . nextFloat ( ) ) // 5 ; push . y += ( rng . nextFloat ( ) ) // 5 ; } repulse ( r1 , push , sepPar ) ; } else if ( osc . enableRandomPushIfZero ) { repulse ( r1 , new Vec2 ( nonZeroRnd ( ( - 1 ) , 1 ) , nonZeroRnd ( ( - 1 ) , 1 ) ) , sepPar ) ; } if ( ( r1 . position . x ) < ( ( osc . enclosingLeft ( ) ) * ( osc . resolution ) ) ) r1 . position . x = - 400 ; if ( ( r1 . position . x ) > ( ( osc . enclosingRight ( ) ) * ( osc . resolution ) ) ) r1 . position . x = 400 ; if ( ( r1 . position . y ) < ( ( osc . enclosingTop ( ) ) * ( osc . resolution ) ) ) r1 . position . y = - 400 ; if ( ( r1 . position . y ) > ( ( osc . enclosingBottom ( ) ) * ( osc . resolution ) ) ) r1 . position . y = 400 ; } } } if ( osc . interactive ) { new com . alesegdia . troidgen . renderer . RectDebugger ( rects , 400 , 400 ) . Show ( ) ; try { System . in . read ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } <START_BUG> for ( Rect r : rects ) { <END_BUG> r . position . x = ( ( float ) ( Math . round ( ( ( r . position . x ) // ( osc . resolution ) ) ) ) ) ; r . position . y = ( ( float ) ( Math . round ( ( ( r . position . y ) // ( osc . resolution ) ) ) ) ) ; r . size . x //= osc . resolution ; r . size . y //= osc . resolution ; } return rects ; } private float nonZeroRnd ( int min , int max ) { } private void repulse ( Rect r1 , Vec2 push , float separationParameter ) { } }

Fix:
for ( Rect r : testRects ) {
Buggy code:
public class Controller { public Controller ( ) { } @ FXML private void initialize ( ) { } private ArrayList < News > newsList ; private List < Stock > stockList ; private List < Weather > WeatherList ; @ FXML private Accordion newsAccordion ; @ FXML private VBox stockPane ; @ FXML private VBox WeatherPane ; @ FXML protected void updateWeather ( ) { } @ FXML protected void updateNews ( ) { } @ FXML protected void updateStocks ( ) { stockList = Stock . createStockObject ( ) ; if ( ( stockPane . getChildren ( ) . size ( ) ) > 0 ) { stockPane . getChildren ( ) . remove ( 0 , stockList . size ( ) ) ; } stockList . stream ( ) . forEach ( ( stock ) -> { VBox v = new VBox ( ) ; v . setMinHeight ( 30 ) ; BorderPane b = new BorderPane ( ) ; b . setPadding ( new Insets ( 10 ) ) ; Label symbl = new Label ( stock . getSymbl ( ) . toUpperCase ( ) ) ; Label lastTrade = new Label ( Double . toString ( stock . getLastTrade ( ) ) ) ; b . setLeft ( symbl ) ; b . setRight ( lastTrade ) ; v . getChildren ( ) . add ( b ) ; <START_BUG> stockPane . getChildren ( ) . addAll ( v , new Line ( 0 , 0 , 190 , 0 ) ) ; <END_BUG> } ) ; } }

Fix:
stockPane . getChildren ( ) . addAll ( v ) ;
Buggy code:
public class FastCosineTransformer implements RealTransformer { public FastCosineTransformer ( ) { } public double [ ] transform ( double [ ] f ) throws IllegalArgumentException { } public double [ ] transform ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } public double [ ] transform2 ( double [ ] f ) throws IllegalArgumentException { } public double [ ] transform2 ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } public double [ ] inverseTransform ( double [ ] f ) throws IllegalArgumentException { } public double [ ] inverseTransform ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } public double [ ] inverseTransform2 ( double [ ] f ) throws IllegalArgumentException { } public double [ ] inverseTransform2 ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } protected double [ ] fct ( double [ ] f ) throws IllegalArgumentException { final double [ ] transformed = new double [ f . length ] ; final int n = ( f . length ) - 1 ; if ( ! ( FastFourierTransformer . isPowerOf2 ( n ) ) ) { throw MathRuntimeException . createIllegalArgumentException ( NOT_POWER_OF_TWO_PLUS_ONE , f . length ) ; } if ( n == 1 ) { transformed [ 0 ] = 0.5 * ( ( f [ 0 ] ) + ( f [ 1 ] ) ) ; transformed [ 1 ] = 0.5 * ( ( f [ 0 ] ) - ( f [ 1 ] ) ) ; return transformed ; } final double [ ] x = new double [ n ] ; x [ 0 ] = 0.5 * ( ( f [ 0 ] ) + ( f [ n ] ) ) ; x [ ( n > > 1 ) ] = f [ ( n > > 1 ) ] ; double t1 = 0.5 * ( ( f [ 0 ] ) - ( f [ n ] ) ) ; for ( int i = 1 ; i < ( n > > 1 ) ; i ++ ) { final double a = 0.5 * ( ( f [ i ] ) + ( f [ ( n - i ) ] ) ) ; final double b = ( FastMath . sin ( ( ( i * ( FastMath . PI ) ) // n ) ) ) * ( ( f [ i ] ) - ( f [ ( n - i ) ] ) ) ; final double c = ( FastMath . cos ( ( ( i * ( FastMath . PI ) ) // n ) ) ) * ( ( f [ i ] ) - ( f [ ( n - i ) ] ) ) ; x [ i ] = a - b ; x [ ( n - i ) ] = a + b ; t1 += c ; } <START_BUG> FastFourierTransformer transformer = new FastFourierTransformer ( ) ; <END_BUG> Complex [ ] y = transformer . transform ( x ) ; transformed [ 0 ] = y [ 0 ] . getReal ( ) ; transformed [ 1 ] = t1 ; for ( int i = 1 ; i < ( n > > 1 ) ; i ++ ) { transformed [ ( 2 * i ) ] = y [ i ] . getReal ( ) ; transformed [ ( ( 2 * i ) + 1 ) ] = ( transformed [ ( ( 2 * i ) - 1 ) ] ) - ( y [ i ] . getImaginary ( ) ) ; } transformed [ n ] = y [ ( n > > 1 ) ] . getReal ( ) ; return transformed ; } }

Fix:
FastFourierTransformer transformer = FastFourierTransformer . create ( ) ;
Buggy code:
public class JavadocQualifiedTypeReference extends QualifiedTypeReference { public int tagSourceStart ; public int tagSourceEnd ; public PackageBinding packageBinding ; public JavadocQualifiedTypeReference ( char [ ] [ ] sources , long [ ] pos , int tagStart , int tagEnd ) { } protected void reportInvalidType ( Scope scope ) { } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } private TypeBinding internalResolveType ( Scope scope , boolean checkBounds ) { this . constant = Constant . NotAConstant ; if ( ( this . resolvedType ) != null ) return this . resolvedType . isValidBinding ( ) ? this . resolvedType : null ; this . resolvedType = getTypeBinding ( scope ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { Binding binding = scope . getTypeOrPackage ( this . tokens ) ; if ( binding instanceof PackageBinding ) { this . packageBinding = ( ( PackageBinding ) ( binding ) ) ; } else { reportInvalidType ( scope ) ; } return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) reportDeprecatedType ( this . resolvedType , scope ) ; if ( ( this . resolvedType ) instanceof ParameterizedTypeBinding ) { <START_BUG> this . resolvedType = ( ( ParameterizedTypeBinding ) ( this . resolvedType ) ) . type ; <END_BUG> } return this . resolvedType ; } public TypeBinding resolveType ( BlockScope blockScope , boolean checkBounds ) { } public TypeBinding resolveType ( ClassScope classScope ) { } }

Fix:
this . resolvedType = ( ( ParameterizedTypeBinding ) ( this . resolvedType ) ) . genericType ( ) ;
Buggy code:
public interface Validator { <START_BUG> ValidateResults validate ( Object model , List < String > properties ) ; <END_BUG> }

Fix:
ValidationResults validate ( Object model , List < String > properties ) ;
Buggy code:
public class AcceptRulesListener implements Listener { @ EventHandler public void onPlayerCommandPreprocess ( PlayerCommandPreprocessEvent event ) { Player player = event . getPlayer ( ) ; String [ ] args = event . getMessage ( ) . split ( "<seq2seq4repair_space>" ) ; if ( args [ 0 ] . equalsIgnoreCase ( RulesCmd ) ) { if ( ! ( readed . contains ( player ) ) ) { readed . add ( player ) ; } } else { <START_BUG> if ( ( AcceptRulesMain . BlockCmds ) && ( ! ( args [ 0 ] . equalsIgnoreCase ( "//acceptrules" ) ) ) ) { <END_BUG> player . sendMessage ( ( ( ChatColor . DARK_RED ) + ( AcceptRulesMain . InformMsg ) ) ) ; event . setCancelled ( true ) ; } } } @ EventHandler public void onPlayerJoin ( PlayerJoinEvent event ) { } @ EventHandler public void onBlockPlace ( BlockPlaceEvent event ) { } @ EventHandler public void onBlockBreak ( BlockBreakEvent event ) { } @ EventHandler public void onPlayerMove ( PlayerMoveEvent event ) { } }

Fix:
if ( ( ( AcceptRulesMain . BlockCmds ) && ( ! ( args [ 0 ] . equalsIgnoreCase ( "//acceptrules" ) ) ) ) && ( ! ( players . contains ( event . getPlayer ( ) . getName ( ) ) ) ) ) {
Buggy code:
public class BodyContentImpl extends BodyContent { private char [ ] cb ; protected int bufferSize = Constants . DEFAULT_BUFFER_SIZE ; private int nextChar ; static String lineSeparator = System . getProperty ( "line.separator" ) ; public BodyContentImpl ( JspWriter writer ) { } public void write ( int c ) throws IOException { } private void reAllocBuff ( int len ) { char [ ] tmp = null ; if ( len <= ( Constants . DEFAULT_BUFFER_SIZE ) ) { tmp = new char [ ( bufferSize ) + ( Constants . DEFAULT_BUFFER_SIZE ) ] ; <START_BUG> bufferSize += Constants . DEFAULT_BUFFER_SIZE ; <END_BUG> } else { tmp = new char [ ( bufferSize ) + len ] ; bufferSize += len ; } System . arraycopy ( cb , 0 , tmp , 0 , cb . length ) ; cb = tmp ; tmp = null ; } public void write ( char [ ] cbuf , int off , int len ) throws IOException { } public void write ( char [ ] buf ) throws IOException { } public void write ( String s , int off , int len ) throws IOException { } public void write ( String s ) throws IOException { } public void newLine ( ) throws IOException { } public void print ( boolean b ) throws IOException { } public void print ( char c ) throws IOException { } public void print ( int i ) throws IOException { } public void print ( long l ) throws IOException { } public void print ( float f ) throws IOException { } public void print ( double d ) throws IOException { } public void print ( char [ ] s ) throws IOException { } public void print ( String s ) throws IOException { } public void print ( Object obj ) throws IOException { } public void println ( ) throws IOException { } public void println ( boolean x ) throws IOException { } public void println ( char x ) throws IOException { } public void println ( int x ) throws IOException { } public void println ( long x ) throws IOException { } public void println ( float x ) throws IOException { } public void println ( double x ) throws IOException { } public void println ( char [ ] x ) throws IOException { } public void println ( String x ) throws IOException { } public void println ( Object x ) throws IOException { } public void clear ( ) throws IOException { } public void clearBuffer ( ) throws IOException { } public void close ( ) throws IOException { } public int getRemaining ( ) { } public Reader getReader ( ) { } public String getString ( ) { } public void writeOut ( Writer out ) throws IOException { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
bufferSize = ( bufferSize ) * 2 ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class OpenProjectAction extends AbstractAction { private String lastDir ; private File file ; public OpenProjectAction ( ) { } public OpenProjectAction ( File file ) { } public void actionPerformed ( ActionEvent e ) { SCXMLGraphEditor editor = SCXMLGraphEditor . getEditor ( e ) ; String wd = "" ; if ( ( lastDir ) != null ) { wd = lastDir ; } else { if ( ( ( editor . getCurrentFile ( ) ) != null ) && ( ( editor . getCurrentFile ( ) . getParent ( ) ) != null ) ) { wd = editor . getCurrentFile ( ) . getParent ( ) ; } else { String dirOfLastOpenedFile = editor . menuBar . getLastOpenedDir ( ) ; if ( dirOfLastOpenedFile != null ) { wd = dirOfLastOpenedFile ; } else { wd = System . getProperty ( "user.dir" ) ; } } } if ( ( file ) == null ) { JFileChooser fc = new JFileChooser ( wd ) ; FileNameExtensionFilter filter = new FileNameExtensionFilter ( mxResources . get ( "azProjectFilterDescription" ) , mxResources . get ( "azProjectFileExtension" ) ) ; fc . setFileFilter ( filter ) ; int rc = fc . showOpenDialog ( null ) ; if ( rc == ( JFileChooser . APPROVE_OPTION ) ) { <START_BUG> File file = fc . getSelectedFile ( ) ; <END_BUG> } } if ( ( file ) != null ) { editor . getProjectModel ( ) . loadProjectFile ( file ) ; lastDir = file . getParent ( ) ; } } }

Fix:
file = fc . getSelectedFile ( ) ;
Buggy code:
public class RecoveredField extends RecoveredElement { public FieldDeclaration fieldDeclaration ; boolean alreadyCompletedFieldInitialization ; public RecoveredType [ ] anonymousTypes ; public int anonymousTypeCount ; public RecoveredField ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance ) { } public RecoveredField ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { } public AstNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { StringBuffer buffer = new StringBuffer ( tabString ( tab ) ) ; buffer . append ( "Recovered<seq2seq4repair_space>field:\n" ) ; <START_BUG> buffer . append ( fieldDeclaration . toString ( ( tab + 1 ) ) ) ; <END_BUG> if ( ( this . anonymousTypes ) != null ) { for ( int i = 0 ; i < ( this . anonymousTypeCount ) ; i ++ ) { buffer . append ( "\n" ) ; buffer . append ( anonymousTypes [ i ] . toString ( ( tab + 1 ) ) ) ; } } return buffer . toString ( ) ; } public FieldDeclaration updatedFieldDeclaration ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { } public RecoveredElement updateOnOpeningBrace ( int currentPosition ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { } }

Fix:
buffer . append ( fieldDeclaration . print ( ( tab + 1 ) , buffer ) ) ;
Buggy code:
public class Geo { public static boolean isLocal ( String path ) { } public static boolean isOwnPublication ( String childPath ) { Assert . isNotNull ( childPath ) ; Assert . isTrue ( ( ( childPath . length ( ) ) > ( ROOT . length ( ) ) ) ) ; String [ ] parts = childPath . split ( _ZOODISCOVERYID_ ) ; String id = parts [ 1 ] ; <START_BUG> return id . equals ( INSTANCE . getID ( ) . toString ( ) ) ; <END_BUG> } public static URI getLocation ( ) { } public static String getHost ( ) { } public static String getNodeHost ( ) { } }

Fix:
return id . equals ( INSTANCE . getID ( ) . getName ( ) ) ;
Buggy code:
public class WebBundleParserTestCase { @ Test public void testWarDeployment ( ) throws Exception { Manifest manifest = WebBundleURIParser . parse ( "webbundle:////foo?Bundle-SymbolicName=com.example" ) ; OSGiMetaData metadata = OSGiMetaDataBuilder . load ( manifest ) ; Assert . assertEquals ( "com.example" , metadata . getBundleSymbolicName ( ) ) ; <START_BUG> Assert . assertEquals ( "foo" , metadata . getHeader ( WEB_CONTEXT_PATH ) ) ; <END_BUG> } }

Fix:
Assert . assertEquals ( "foo" , metadata . getHeader ( WEB_CONTEXTPATH ) ) ;
Buggy code:
public final class GUIMacOSX { private static final String C_APPLICATION = "com.apple.eawt.Application" ; private static final String C_APPLICATION_LISTENER = "com.apple.eawt.ApplicationListener" ; private static final String C_APPLICATION_EVENT = "com.apple.eawt.ApplicationEvent" ; private static final String P_ABOUT_NAME = "com.apple.mrj.application.apple.menu.about.name" ; private static final String P_SCREEN_MENU_BAR = "apple.laf.useScreenMenuBar" ; private static final Class < ? > [ ] EC = new Class < ? > [ ] { } ; private static final Object [ ] EO = new Object [ ] { } ; GUI main ; private final Object appObj ; public GUIMacOSX ( ) throws Exception { } public void init ( final GUI gui ) { } private void addDockIcon ( ) throws Exception { } public void setBadge ( final String value ) throws Exception { } class AppInvocationHandler implements InvocationHandler { @ Override public Object invoke ( final Object proxy , final Method method , final Object [ ] args ) throws Throwable { } public void handleAbout ( ) { <START_BUG> C_ABOUT . execute ( main ) ; <END_BUG> } public void handleOpenApplication ( ) { } public void handleOpenFile ( @ SuppressWarnings ( "unused" ) final Object obj ) { } public void handlePreferences ( ) { } public void handlePrintFile ( ) { } public void handleQuit ( ) { } public void handleReOpenApplication ( ) { } } static Object invoke ( final Object obj , final String method ) throws Exception { } static Object invoke ( final Object obj , final String method , final boolean arg ) throws Exception { } static Object invoke ( final Object obj , final String method , final Class < ? > argClass , final Object argObject ) throws Exception { } private static Object invoke ( final Class < ? > clazz , final Object obj , final String method , final Class < ? > [ ] argClasses , final Object [ ] argObjects ) throws Exception { } }

Fix:
( ( GUICommand ) ( C_ABOUT ) ) . execute ( main ) ;
Buggy code:
public class Node { int x ; int y ; int sum = 0 ; ArrayList < Rabbit > rabbitArrayList = new ArrayList < > ( ) ; public Node ( int x , int y ) { } public void delete ( ) { <START_BUG> rabbitArrayList . set ( ( ( rabbitArrayList . size ( ) ) - 1 ) , null ) ; <END_BUG> rabbitArrayList . trimToSize ( ) ; ( sum ) -- ; } public void add ( Rabbit temp ) { } }

Fix:
rabbitArrayList . remove ( ( ( rabbitArrayList . size ( ) ) - 1 ) ) ;