nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ThrowsDataSource { private static final String TAG = ThrowsDataSource . class . getSimpleName ( ) ; private SQLiteDatabase database ; private DBHelper dbHelper ; private String [ ] allColumns = new String [ ] { DBHelper . COLUMN_THROW_ID , DBHelper . COLUMN_GAME_ID , DBHelper . COLUMN_INITIAL_DIRECTION , DBHelper . COLUMN_FINAL_DIRECTION , DBHelper . COLUMN_TOTAL_DISTANCE , DBHelper . COLUMN_THROW_QUALITY , DBHelper . COLUMN_TOTAL_TIME , DBHelper . COLUMN_SYNC_TIME } ; private String [ ] totalsColumns = new String [ ] { DBHelper . COLUMN_GAME_ID , DBHelper . COLUMN_AVERAGE_DISTANCE , DBHelper . COLUMN_AVERAGE_ANGLE , DBHelper . COLUMN_AVERAGE_TIME , DBHelper . COLUMN_THROW_COUNT } ; public ThrowsDataSource ( Context context ) { } public void open ( ) throws SQLException { } public void close ( ) { } public void createThrow ( double initial_direction , double final_direction , double total_distance , double throw_quality , double total_time ) { } private String getCurrentTime ( ) { } public void deleteThrow ( RawThrowData t ) { } public void deleteAllThrows ( ) { } public List < ThrowData > getAllThrows ( long gameId ) { } public void loadTotalsData ( ) { Cursor c = database . query ( TABLE_TOTALS , totalsColumns , null , null , null , null , null ) ; c . moveToFirst ( ) ; if ( ( c . getCount ( ) ) > 0 ) { TotalsData . setGameId ( c . getLong ( 0 ) ) ; TotalsData . setAverageDistance ( c . getDouble ( 1 ) ) ; TotalsData . setAverageAngle ( c . getDouble ( 2 ) ) ; TotalsData . setAverageTime ( c . getDouble ( 3 ) ) ; TotalsData . setThrowCount ( c . getInt ( 4 ) ) ; } else { Log . e ( ThrowsDataSource . TAG , "Cursor<seq2seq4repair_space>empty" ) ; TotalsData . setGameId ( 1 ) ; <START_BUG> TotalsData . setAverageDistance ( 0 ) ; <END_BUG> TotalsData . setAverageAngle ( 0 ) ; TotalsData . setAverageTime ( 0 ) ; TotalsData . setThrowCount ( 0 ) ; } c . close ( ) ; } public void writeTotalsData ( ) { } private ThrowData cursorToThrow ( Cursor cursor ) { } public long getMaxThrowId ( ) { } }

Fix:
TotalsData . setAverageDistance ( 10 ) ;
Buggy code:
public class ManagementUtil { static boolean isSecurityRealmReloadRequired ( final OperationContext context , final ModelNode operation ) { } static boolean isSecurityRealmReloadRequired ( final OperationContext context , final ServiceController < ? > controller ) { } static ServiceController < ? > getSecurityRealmService ( final OperationContext context , final ModelNode operation , final boolean forUpdate ) { } static String getSecurityRealmName ( final ModelNode operation ) { } static void updateUserDomainCallbackHandler ( final OperationContext context , final ModelNode operation , final boolean forRollback ) { UserDomainCallbackHandler cbh = ManagementUtil . getUserDomainCallbackHandler ( context , operation ) ; if ( cbh != null ) { PathAddress authAddress = ManagementUtil . getXmlAuthenticationAddress ( operation ) ; <START_BUG> Resource root = ( forRollback ) ? context . getOriginalRootResource ( ) : context . getRootResource ( ) ; <END_BUG> ModelNode userMap ; try { Resource authResource = root . navigate ( authAddress ) ; userMap = context . resolveExpressions ( Tools . readModel ( authResource ) ) ; } catch ( Exception e ) { userMap = new ModelNode ( ) . setEmptyObject ( ) ; } cbh . setUserDomain ( userMap ) ; } } private static PathAddress getXmlAuthenticationAddress ( ModelNode operation ) { } private static UserDomainCallbackHandler getUserDomainCallbackHandler ( final OperationContext context , final ModelNode operation ) { } private ManagementUtil ( ) { } }

Fix:
Resource root = ( forRollback ) ? context . getOriginalRootResource ( ) : context . readResourceFromRoot ( EMPTY_ADDRESS ) ;
Buggy code:
public class Login extends Activity implements LoaderCallbacks < Cursor > { private static final String [ ] DUMMY_CREDENTIALS = new String [ ] { "user:pass" } ; private Login . UserLoginTask mAuthTask = null ; private AutoCompleteTextView mEmailView ; private EditText mPasswordView ; private View mProgressView ; private View mLoginFormView ; private Toast mLoginStatus ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void populateAutoComplete ( ) { } public void attemptLogin ( ) { } private boolean isEmailValid ( String email ) { } private boolean isPasswordValid ( String password ) { } @ TargetApi ( VERSION_CODES . HONEYCOMB_MR2 ) public void showProgress ( final boolean show ) { } @ Override public Loader < Cursor > onCreateLoader ( int i , Bundle bundle ) { } @ Override public void onLoadFinished ( Loader < Cursor > cursorLoader , Cursor cursor ) { } @ Override public void onLoaderReset ( Loader < Cursor > cursorLoader ) { } private interface ProfileQuery { String [ ] PROJECTION = new String [ ] { Email . ADDRESS , Email . IS_PRIMARY } ; int ADDRESS = 0 ; int IS_PRIMARY = 1 ; } private void addEmailsToAutoComplete ( List < String > emailAddressCollection ) { } private void proceedToHome ( View view ) { } public class UserLoginTask extends AsyncTask < Void , Void , Boolean > { private final String mEmail ; private final String mPassword ; UserLoginTask ( String email , String password ) { } @ Override protected Boolean doInBackground ( Void ... params ) { } protected boolean isInSystem ( String user , String pass ) { String TAG = Register . class . getSimpleName ( ) ; <START_BUG> String link = ( ( "http:////sandbox.artineer.com//getuser.php?username=" + user ) + "&password=" ) + pass ; <END_BUG> try { URL url = new URL ( link ) ; HttpClient client = new DefaultHttpClient ( ) ; HttpGet request = new HttpGet ( ) ; request . setURI ( new URI ( link ) ) ; HttpResponse response = client . execute ( request ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( response . getEntity ( ) . getContent ( ) ) ) ; StringBuffer sb = new StringBuffer ( "" ) ; String line = "" ; while ( ( line = in . readLine ( ) ) != null ) { sb . append ( line ) ; break ; } in . close ( ) ; Log . e ( TAG , sb . toString ( ) ) ; return ! ( sb . toString ( ) . equals ( "*NOSUCHUSER" ) ) ; } catch ( Exception e ) { Log . e ( TAG , "EXCEPTION>>>>" , e ) ; return false ; } } @ Override protected void onPostExecute ( final Boolean success ) { } @ Override protected void onCancelled ( ) { } } }

Fix:
String link = ( ( "http:////sandbox.artineer.com//getuserlogin.php?username=" + user ) + "&password=" ) + pass ;
Buggy code:
public class IndexManager extends JobManager implements IIndexConstants { public static int MAX_FILES_IN_MEMORY = 0 ; public IWorkspace workspace ; Map indexes = new HashMap ( 5 ) ; private Map monitors = new HashMap ( 5 ) ; private boolean needToSave = false ; private static final CRC32 checksumCalculator = new CRC32 ( ) ; private IPath javaPluginLocation = null ; public void activateProcessing ( ) { } public void addSource ( IFile resource , IPath indexedContainer ) { } public void addBinary ( IFile resource , IPath indexedContainer ) { } public void indexSourceFolder ( JavaProject javaProject , IPath sourceFolder ) { } public void checkIndexConsistency ( ) { } private String computeIndexName ( String pathString ) { } public void deleting ( IProject project ) { } public synchronized void discardJobsUntilNextProjectAddition ( String jobFamily ) { } public IIndex getIndex ( IPath path ) { } public synchronized IIndex getIndex ( IPath path , boolean mustCreate ) { } private IPath getJavaPluginWorkingLocation ( ) { } public ReadWriteMonitor getMonitorFor ( IIndex index ) { } public void indexAll ( IProject project ) { if ( ( ( JavaCore . getPlugin ( ) ) == null ) || ( ( this . workspace ) == null ) ) return ; try { <START_BUG> IJavaModel model = JavaModelManager . getJavaModel ( this . workspace ) ; <END_BUG> IJavaProject javaProject = ( ( JavaModel ) ( model ) ) . getJavaProject ( project ) ; IClasspathEntry [ ] entries ; if ( javaProject . isOpen ( ) ) { entries = javaProject . getResolvedClasspath ( true ) ; } else { entries = javaProject . getRawClasspath ( ) ; } for ( int i = 0 ; i < ( entries . length ) ; i ++ ) { IClasspathEntry entry = entries [ i ] ; if ( ( entry . getEntryKind ( ) ) == ( IClasspathEntry . CPE_LIBRARY ) ) { this . indexLibrary ( entry . getPath ( ) , project ) ; } } } catch ( JavaModelException e ) { } this . request ( new IndexAllProject ( project , this ) ) ; } protected synchronized void moveToNextJob ( ) { } protected void notifyIdle ( long idlingTime ) { } public String processName ( ) { } public synchronized IIndex recreateIndex ( IPath path ) { } public void remove ( String resourceName , IPath indexedContainer ) { } public synchronized void removeIndex ( IPath path ) { } public void removeSourceFolderFromIndex ( JavaProject javaProject , IPath sourceFolder ) { } public void reset ( ) { } public void saveIndexes ( ) { } public void shutdown ( ) { } public void indexLibrary ( IPath path , IProject referingProject ) { } }

Fix:
IJavaModel model = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ;
Buggy code:
public class GameComponent extends JComponent { Player player ; Player treasure ; Player treasure1 ; Player treasure2 ; private ArrayList < BufferedImage > tiles ; private ArrayList < Character > tileTypes ; protected static String message = "" ; private int tilesWidth ; private int tilesHeight ; messageRunnable mThread = new messageRunnable ( ) ; public void paintComponent ( Graphics g ) { for ( int i = 0 ; i < ( tilesHeight ) ; i ++ ) { for ( int j = 0 ; j < ( tilesWidth ) ; j ++ ) { g . drawImage ( tiles . get ( ( ( ( tilesWidth ) * i ) + j ) ) , ( j * 50 ) , ( i * 50 ) , null ) ; } } g . drawImage ( treasure . getCurrentImage ( ) , treasure . getXPos ( ) , treasure . getYPos ( ) , null ) ; g . drawImage ( player . getCurrentImage ( ) , player . getXPos ( ) , player . getYPos ( ) , null ) ; Graphics2D g2 = ( ( Graphics2D ) ( g ) ) ; if ( ! ( GameComponent . message . equals ( "" ) ) ) { Color transBlack = new Color ( 0 , 0 , 0 , 128 ) ; g2 . setColor ( transBlack ) ; <START_BUG> g2 . fillRect ( 185 , 25 , 220 , 30 ) ; <END_BUG> g2 . setFont ( new Font ( "Arial" , Font . BOLD , 20 ) ) ; g2 . setColor ( Color . RED ) ; g2 . drawString ( GameComponent . message , 192 , 47 ) ; } } public void updatePlayer ( ) { } public void loadMap ( String name ) { } public void checkMove ( int xTile , int yTile ) { } public void loadPlayer ( Player player , String name ) { } }

Fix:
g2 . fillRect ( 185 , 25 , 250 , 30 ) ;
Buggy code:
public class InterpretedIRMethod extends DynamicMethod { private static final Logger LOG = LoggerFactory . getLogger ( "InterpretedIRMethod" ) ; private final IRMethod method ; boolean displayedCFG = false ; public InterpretedIRMethod ( IRMethod method , RubyModule implementationClass ) { } public InterpretedIRMethod ( IRMethod method , Visibility visibility , RubyModule implementationClass ) { } @ Override public Arity getArity ( ) { } @ Override public IRubyObject call ( ThreadContext context , IRubyObject self , RubyModule clazz , String name , IRubyObject [ ] args , Block block ) { if ( Interpreter . isDebug ( ) ) { String realName = ( ( name == null ) || ( "" . equals ( name ) ) ) ? method . getName ( ) : name ; InterpretedIRMethod . LOG . info ( ( ( "Executing<seq2seq4repair_space>'" + realName ) + "'" ) ) ; } CFG cfg = method . getCFG ( ) ; if ( cfg == null ) { method . prepareForInterpretation ( ) ; cfg = method . getCFG ( ) ; } if ( ( Interpreter . isDebug ( ) ) && ( ( displayedCFG ) == false ) ) { InterpretedIRMethod . LOG . info ( ( "CFG:\n" + ( cfg . getGraph ( ) ) ) ) ; InterpretedIRMethod . LOG . info ( ( "\nInstructions:\n" + ( cfg . toStringInstrs ( ) ) ) ) ; displayedCFG = true ; } context . pushScope ( DynamicScope . newDynamicScope ( method . getStaticScope ( ) ) ) ; RubyModule currentModule = getImplementationClass ( ) ; context . preMethodFrameOnly ( currentModule , name , self , block ) ; context . getCurrentScope ( ) . getStaticScope ( ) . setModule ( clazz ) ; context . setCurrentVisibility ( getVisibility ( ) ) ; InterpreterContext interp = new org . jruby . interpreter . NaiveInterpreterContext ( context , method , currentModule , self , name , args , block , null ) ; try { <START_BUG> return Interpreter . INTERPRET_METHOD ( context , method , interp , self , name , getImplementationClass ( ) , false ) ; <END_BUG> } finally { context . popFrame ( ) ; context . postMethodScopeOnly ( ) ; } } @ Override public DynamicMethod dup ( ) { } }

Fix:
return Interpreter . INTERPRET_METHOD ( context , method , interp , self , name , currentModule , false ) ;
Buggy code:
public class SimpleFragmentsBuilderTest extends AbstractTestCase { public void test1TermIndex ( ) throws Exception { } public void test2Frags ( ) throws Exception { } public void test3Frags ( ) throws Exception { } public void testTagsAndEncoder ( ) throws Exception { } private FieldFragList ffl ( Query query , String indexValue ) throws Exception { } public void test1PhraseShortMV ( ) throws Exception { } public void test1PhraseLongMV ( ) throws Exception { } public void test1PhraseLongMVB ( ) throws Exception { } public void testUnstoredField ( ) throws Exception { } protected void makeUnstoredIndex ( ) throws Exception { } public void test1StrMV ( ) throws Exception { } public void testMVSeparator ( ) throws Exception { makeIndexShortMV ( ) ; FieldQuery fq = new FieldQuery ( tq ( "d" ) , true , true ) ; FieldTermStack stack = new FieldTermStack ( reader , 0 , F , fq ) ; FieldPhraseList fpl = new FieldPhraseList ( stack , fq ) ; SimpleFragListBuilder sflb = new SimpleFragListBuilder ( ) ; FieldFragList ffl = sflb . createFieldFragList ( fpl , 100 ) ; SimpleFragmentsBuilder sfb = new SimpleFragmentsBuilder ( ) ; sfb . setMultiValuedSeparator ( '//' ) ; <START_BUG> assertEquals ( "<seq2seq4repair_space>b<seq2seq4repair_space>c////<b>d<//b><seq2seq4repair_space>e" , sfb . createFragment ( reader , 0 , F , ffl ) ) ; <END_BUG> } }

Fix:
assertEquals ( "////a<seq2seq4repair_space>b<seq2seq4repair_space>c////<b>d<//b><seq2seq4repair_space>e" , sfb . createFragment ( reader , 0 , F , ffl ) ) ;
Buggy code:
public class FrameProcessor extends Processor { private final Studio studio_ ; private final LogManager log_ ; private final String processorAlgo_ ; private final int numerOfImagesToProcess_ ; private final boolean enableDuringAcquisition_ ; private final boolean enableDuringLive_ ; private final List < Integer > channelsToAvoid_ ; private int newIntendedTime ; private HashMap < Coords , SingleCombinationProcessor > singleAquisitions ; public FrameProcessor ( Studio studio , String processorAlgo , int numerOfImagesToProcess , boolean enableDuringAcquisition , boolean enableDuringLive , String channelsToAvoidString ) { } @ Override public void processImage ( Image image , ProcessorContext context ) { if ( ! ( isProcessorEnable ( ) ) ) { context . outputImage ( image ) ; return ; } Coords coords = image . getCoords ( ) . copy ( ) . time ( 0 ) . build ( ) ; SingleCombinationProcessor singleAcquProc ; if ( ! ( singleAquisitions . containsKey ( coords ) ) ) { boolean processCombinations = true ; if ( ( channelsToAvoid_ . contains ( coords . getChannel ( ) ) ) && ( ! ( studio_ . live ( ) . getIsLiveModeOn ( ) ) ) ) { processCombinations = false ; } <START_BUG> singleAcquProc = new SingleCombinationProcessor ( coords , studio_ , processorAlgo_ , numerOfImagesToProcess_ , processCombinations ) ; <END_BUG> singleAquisitions . put ( coords , singleAcquProc ) ; } else { singleAcquProc = singleAquisitions . get ( coords ) ; } singleAcquProc . addImage ( image , context ) ; } @ Override public SummaryMetadata processSummaryMetadata ( SummaryMetadata summary ) { } public final boolean isProcessorEnable ( ) { } @ Override public void cleanup ( ProcessorContext context ) { } public static Boolean isValidIntRangeInput ( String channelToAvoidString ) { } public static List < Integer > convertToList ( String channelToAvoidString ) { } }

Fix:
singleAcquProc = new SingleCombinationProcessor ( coords , studio_ , processorAlgo_ , numerOfImagesToProcess_ , processCombinations , ( ! ( channelsToAvoid_ . isEmpty ( ) ) ) ) ;
Buggy code:
public class NonCachingImage extends Image { private static final long serialVersionUID = 1L ; public NonCachingImage ( String id , IModel model ) { } public NonCachingImage ( String id , Resource imageResource ) { } public NonCachingImage ( String id , ResourceReference resourceReference , ValueMap resourceParameters ) { } public NonCachingImage ( String id , ResourceReference resourceReference ) { } public NonCachingImage ( String id , String string ) { } public NonCachingImage ( String id ) { } protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; String url = tag . getAttributes ( ) . getString ( "src" ) ; url = url + ( ( url . indexOf ( "?" ) ) >= 0 ? "&" : "?" ) ; <START_BUG> url = ( url + "wicket:rand=" ) + ( Math . random ( ) ) ; <END_BUG> tag . put ( "src" , url ) ; } }

Fix:
url = ( url + "wicket:antiCache=" ) + ( Math . random ( ) ) ;
Buggy code:
public class AbstractSensitivity { private final boolean defaultRequiresAccessPermission ; private final boolean defaultRequiresReadPermission ; private final boolean defaultRequiresWritePermission ; private volatile Boolean configuredRequiresAccessPermission ; private volatile Boolean configuredRequiresReadPermission ; private volatile Boolean configuredRequiresWritePermission ; protected AbstractSensitivity ( boolean defaultRequiresAccessPermission , boolean defaultRequiresReadPermission , boolean defaultRequiresWritePermission ) { } public boolean isDefaultRequiresAccessPermission ( ) { } public boolean isDefaultRequiresReadPermission ( ) { } public boolean isDefaultRequiresWritePermission ( ) { } public boolean getRequiresAccessPermission ( ) { } public Boolean getConfiguredRequiresAccessPermission ( ) { } public void setConfiguredRequiresAccessPermission ( Boolean requiresAccessPermission ) { } public boolean getRequiresReadPermission ( ) { } public Boolean getConfiguredRequiresReadPermission ( ) { } public void setConfiguredRequiresReadPermission ( Boolean requiresReadPermission ) { } public boolean getRequiresWritePermission ( ) { } public Boolean getConfiguredRequiresWritePermission ( ) { } public boolean isSensitive ( Action . ActionEffect actionEffect ) { <START_BUG> if ( actionEffect == ( ActionEffect . ACCESS ) ) { <END_BUG> return getRequiresAccessPermission ( ) ; } else if ( ( actionEffect == ( ActionEffect . READ_CONFIG ) ) || ( actionEffect == ( ActionEffect . READ_RUNTIME ) ) ) { return getRequiresReadPermission ( ) ; } else { return getRequiresWritePermission ( ) ; } } public void setConfiguredRequiresWritePermission ( Boolean requiresWritePermission ) { } protected boolean isCompatibleWith ( AbstractSensitivity other ) { } }

Fix:
if ( actionEffect == ( ActionEffect . ADDRESS ) ) {
Buggy code:
public class NoopOutputTransformerContainer extends AbstractOutputTransformerContainer { private static final long serialVersionUID = 1L ; public NoopOutputTransformerContainer ( final String id ) { } public NoopOutputTransformerContainer ( final String id , final IModel model ) { } <START_BUG> protected String transform ( final String output ) { <END_BUG> return output ; } }

Fix:
protected CharSequence transform ( final String output ) {
Buggy code:
class Roster { Roster ( ) { } void addOperation ( Roster . Operation op ) { } public Roster . Operation getOperation ( int i ) { } int getOperationCount ( ) { } boolean isEmpty ( ) { } boolean performOperations ( PluginManagerProgress progress ) { } private Vector operations ; static interface Operation { boolean perform ( PluginManagerProgress progress ) ; boolean equals ( Object o ) { } int getMaximum ( ) { } } static class Remove implements Roster . Operation { Remove ( String plugin ) { } public int getMaximum ( ) { } public boolean perform ( PluginManagerProgress progress ) { progress . removing ( MiscUtilities . getFileName ( plugin ) ) ; EditPlugin . JAR jar = jEdit . getPluginJAR ( plugin ) ; if ( jar != null ) <START_BUG> jar . getClassLoader ( ) . closeZipFile ( ) ; <END_BUG> File jarFile = new File ( plugin ) ; File srcFile = new File ( plugin . substring ( 0 , ( ( plugin . length ( ) ) - 4 ) ) ) ; boolean ok = true ; Log . log ( NOTICE , this , ( ( "Deleting<seq2seq4repair_space>" + jarFile ) + "<seq2seq4repair_space>recursively" ) ) ; ok &= jarFile . delete ( ) ; if ( srcFile . exists ( ) ) ok &= deleteRecursively ( srcFile ) ; String [ ] args = new String [ ] { plugin } ; if ( ! ok ) GUIUtilities . error ( progress , "plugin-manager.remove-failed" , args ) ; return ok ; } public boolean equals ( Object o ) { } private String plugin ; private boolean deleteRecursively ( File file ) { } } static class Install implements Roster . Operation { int size ; Install ( String url , String installDirectory , int size ) { } public int getMaximum ( ) { } public boolean perform ( final PluginManagerProgress progress ) { try { String fileName = MiscUtilities . getFileName ( url ) ; progress . downloading ( fileName ) ; String path = download ( progress , fileName , url ) ; if ( path == null ) { return false ; } progress . installing ( fileName ) ; install ( progress , path , installDirectory ) ; return true ; } catch ( InterruptedIOException iio ) { return false ; } catch ( final IOException io ) { Log . log ( ERROR , this , io ) ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { String [ ] args = new String [ ] { io . getMessage ( ) } ; GUIUtilities . error ( null , "ioerror" , args ) ; } } ) ; return false ; } catch ( Exception e ) { Log . log ( ERROR , this , e ) ; return false ; } } public boolean equals ( Object o ) { } private String url ; private String installDirectory ; private String download ( PluginManagerProgress progress , String fileName , String url ) throws Exception { } private boolean install ( PluginManagerProgress progress , String path , String dir ) throws Exception { } private boolean copy ( PluginManagerProgress progress , InputStream in , OutputStream out , boolean canStop , boolean doProgress ) throws Exception { } static File downloadDir ; static String getDownloadDir ( ) { } } }

Fix:
jar . closeZipFile ( ) ;
Buggy code:
public class User { public static enum Gender { FEMALE , MALE , UNKNOWN ; @ Override public String toString ( ) { } public String toSQL ( ) { switch ( this ) { case FEMALE : return "F" ; case MALE : return "M" ; case UNKNOWN : <START_BUG> return null ; <END_BUG> default : throw new IllegalStateException ( "Unknown<seq2seq4repair_space>enumerator." ) ; } } } private final int userId ; private final String userName ; private final int age ; private final User . Gender gender ; private final String occupation ; private final String zipCode ; public User ( final int userId , final String userName , final int age , final User . Gender gender , final String occupation , final String zipCode ) { } public int getUserID ( ) { } public String getUserName ( ) { } public int getAge ( ) { } public User . Gender getGender ( ) { } public String getOccupation ( ) { } public String getZipCode ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( final Object o ) { } @ Override public String toString ( ) { } }

Fix:
return "U" ;
Buggy code:
public class TableDataModel extends GraphModel implements TableModel { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.gui" ) ; List urlList = new ArrayList ( ) ; public TableDataModel ( ) { } public Class getGuiClass ( ) { } public void clear ( ) { } public String getClassLabel ( ) { } public Sample addNewSample ( long time , long timeStamp , boolean success , String url ) { } public Sample addSample ( SampleResult e ) { } public int getRowCount ( ) { } public int getColumnCount ( ) { } public String getColumnName ( int columnIndex ) { } public Class getColumnClass ( int columnIndex ) { } public boolean isCellEditable ( int rowIndex , int columnIndex ) { } public Object getValueAt ( int rowIndex , int columnIndex ) { if ( columnIndex == 0 ) { if ( ( rowIndex >= 0 ) && ( rowIndex < ( getSampleCount ( ) ) ) ) { <START_BUG> return new Integer ( rowIndex ) ; <END_BUG> } } else if ( columnIndex == 1 ) { TableDataModel . log . info ( ( "rowIndex<seq2seq4repair_space>=<seq2seq4repair_space>" + rowIndex ) ) ; if ( ( rowIndex >= 0 ) && ( rowIndex < ( urlList . size ( ) ) ) ) { TableDataModel . log . info ( ( "<seq2seq4repair_space>url<seq2seq4repair_space>=<seq2seq4repair_space>" + ( urlList . get ( rowIndex ) ) ) ) ; return urlList . get ( rowIndex ) ; } } else if ( columnIndex == 2 ) { if ( ( rowIndex >= 0 ) && ( rowIndex < ( getSampleCount ( ) ) ) ) { return new Long ( ( ( Sample ) ( getSamples ( ) . get ( rowIndex ) ) ) . data ) ; } } else if ( columnIndex == 3 ) { if ( ( rowIndex >= 0 ) && ( rowIndex < ( urlList . size ( ) ) ) ) { return new Boolean ( ( ! ( ( ( Sample ) ( getSamples ( ) . get ( rowIndex ) ) ) . error ) ) ) ; } } return null ; } public void setValueAt ( Object aValue , int rowIndex , int columnIndex ) { } public void addTableModelListener ( TableModelListener l ) { } public void removeTableModelListener ( TableModelListener l ) { } }

Fix:
return new Integer ( ( rowIndex + 1 ) ) ;
Buggy code:
public class DateDecrypter { private Integer firstDate = null ; private Integer numDecrypted = 0 ; private byte [ ] buffer1 = new byte [ 4 ] ; private byte [ ] buffer2 = new byte [ 4 ] ; private int len ; private DecompressStream datesStream = null ; public DateDecrypter ( DecompressStream datesStream ) { } public Integer getFirstDate ( ) { } public Integer getNextDate ( ) { <START_BUG> len = datesStream . readRecord ( buffer2 , ( ( numDecrypted ) + 4 ) , 4 ) ; <END_BUG> if ( ( len ) != 1 ) { throw new IllegalArgumentException ( "Error:<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>read<seq2seq4repair_space>in<seq2seq4repair_space>another<seq2seq4repair_space>byte." ) ; } else { numDecrypted += 1 ; return ( firstDate ) + ( ByteBuffer . wrap ( buffer2 ) . getInt ( ) ) ; } } }

Fix:
len = datesStream . readRecord ( buffer2 , 0 , 4 ) ;
Buggy code:
public class GUISETTINGS extends JFrame { public GUISETTINGS ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void bracketDephtOrSubstitutionDropdownActionPerformed ( ActionEvent evt ) { int subs = Integer . parseInt ( substitutionDropdown . getSelectedItem ( ) . toString ( ) ) ; int brackets = Integer . parseInt ( bracketDephtDropdown . getSelectedItem ( ) . toString ( ) ) ; int minBrackets = ( ( int ) ( Math . ceil ( ( ( ( Math . log ( subs ) ) // ( Math . log ( 2 ) ) ) + 1 ) ) ) ) ; int maxBrackets = subs ; int minSubs = brackets ; <START_BUG> int maxSubs = ( ( int ) ( Math . pow ( 2 , brackets ) ) ) - 1 ; <END_BUG> if ( brackets < minBrackets ) { bracketDephtError . setText ( ( "Mindestklammertiefe:<seq2seq4repair_space>" + minBrackets ) ) ; } else if ( brackets > maxBrackets ) { bracketDephtError . setText ( ( "Maximalklammertiefe:<seq2seq4repair_space>" + maxBrackets ) ) ; } else { bracketDephtError . setText ( "" ) ; } if ( subs > maxSubs ) { substitutionsError . setText ( ( "Maximaloperanten:<seq2seq4repair_space>" + maxSubs ) ) ; } else if ( subs < minSubs ) { substitutionsError . setText ( ( "Mindestoperanten:<seq2seq4repair_space>" + minSubs ) ) ; } else { substitutionsError . setText ( "" ) ; } } private void generateButtonActionPerformed ( ActionEvent evt ) { } public static void main ( String [ ] args ) { } private JCheckBox addCheckbox ; private JComboBox bracketDephtDropdown ; private JLabel bracketDephtError ; private JComboBox digitsDropdown ; private JCheckBox divideCheckbox ; private JCheckBox fractionCheckbox ; private JButton generateButton ; private JButton generateCancelButton ; private JDesktopPane jDesktopPane1 ; private JInternalFrame jInternalFrame1 ; private JLabel jLabel1 ; private JLabel jLabel13 ; private JLabel jLabel2 ; private JLabel jLabel5 ; private JLabel jLabel7 ; private JLabel jLabel8 ; private JCheckBox multiplyCheckbox ; private JLabel operanten ; private JLabel operationError ; private JCheckBox positiveCheckbox ; private JComboBox substitutionDropdown ; private JLabel substitutionsError ; private JCheckBox subtractCheckbox ; }

Fix:
int maxSubs = ( ( int ) ( Math . pow ( 2 , ( brackets - 1 ) ) ) ) ;
Buggy code:
@ Local public interface OrderManagementBeanLocal { public ReturnHelper createSalesConfirmationOrder ( String salesConfirmationOrderNumber , Date salesConfirmationOrderDate , Long customerID , Long contactID , Long salesStaffID , Integer terms ) { } <START_BUG> public ReturnHelper updateSalesConfirmationOrder ( Long salesConfirmationOrderID , String newSalesConfirmationOrderNumber , Date newSalesConfirmationOrderDate , Long newCustomerID , Long newSalesStaffID , String status , Integer newTerms , Boolean adminOverwrite ) ; <END_BUG> public ReturnHelper updateSalesConfirmationOrderCustomerContactDetails ( Long salesConfirmationOrderID , String customerName , String contactName , String email , String officeNo , String mobileNo , String faxNo , String address , Boolean adminOverwrite ) { } public ReturnHelper updateSalesConfirmationOrderCustomerContactDetails ( Long salesConfirmationOrderID , Long customerID , Long contactID , Boolean adminOverwrite ) { } public ReturnHelper updateSalesConfirmationOrderRemarks ( Long salesConfirmationOrderID , String remarks , Boolean adminOverwrite ) { } public ReturnHelper updateSalesConfirmationOrderNotes ( Long salesConfirmationOrderID , String notes , Boolean adminOverwrite ) { } public ReturnHelper updateSalesConfirmationOrderStatus ( Long salesConfirmationOrderID , String status ) { } public ReturnHelper deleteSalesConfirmationOrder ( Long salesConfirmationOrderID , Boolean adminOverwrite ) { } public ReturnHelper checkIfSCOisEditable ( Long salesConfirmationOrderID , Boolean adminOverwrite ) { } public ReturnHelper checkIfSCOnumberIsUnique ( String salesConfirmationNumber ) { } public SalesConfirmationOrder getSalesConfirmationOrder ( Long salesConfirmationOrderID ) { } public List < SalesConfirmationOrder > listAllSalesConfirmationOrder ( Long staffID ) { } public List < SalesConfirmationOrder > listCustomerSalesConfirmationOrder ( Long customerID ) { } public ReturnHelper addSCOlineItem ( Long salesConfirmationOrderID , String itemName , String itemDescription , Integer itemQty , Double itemUnitPrice , Boolean adminOverwrite ) { } public ReturnHelper updateSCOlineItem ( Long salesConfirmationOrderID , Long lineItemID , String newItemName , String newItemDescription , Integer newItemQty , Double newItemUnitPrice , Boolean adminOverwrite ) { } public ReturnHelper deleteSCOlineItem ( Long salesConfirmationOrderID , Long lineItemID , Boolean adminOverwrite ) { } public ReturnHelper deleteSCOallLineItem ( Long salesConfirmationOrderID , Boolean adminOverwrite ) { } public List < LineItem > listSCOlineItems ( Long salesConfirmationOrderID ) { } }

Fix:
public ReturnHelper updateSalesConfirmationOrder ( Long salesConfirmationOrderID , String newSalesConfirmationOrderNumber , Date newSalesConfirmationOrderDate , Long newCustomerID , String status , Integer newTerms , Boolean adminOverwrite ) ;
Buggy code:
public class AlgorithmUCB_BV1 implements Algorithm { private static final double COST = SupplyChainDriver . COST ; private int time = 0 ; private double [ ] armIndexes ; @ Override public int getNextArm ( AgentSupplier agent ) { ( time ) ++ ; if ( ( time ) <= ( agent . getAgentMemory ( ) . size ( ) ) ) { return ArmPullRequest . get ( ( ( time ) - 1 ) , false ) ; } else { if ( ( armIndexes ) == null ) armIndexes = new double [ agent . getAgentMemory ( ) . size ( ) ] ; for ( int i = 0 ; i < ( armIndexes . length ) ; i ++ ) { ArmMemory arm = agent . getAgentMemory ( ) . indexedList . get ( i ) ; double averageReward = 1 // ( arm . getMeanTime ( ) ) ; int pulls = arm . getPulls ( ) ; double term = Math . sqrt ( ( ( Math . log ( ( ( time ) - 1 ) ) ) // pulls ) ) ; <START_BUG> double armIndex = averageReward + ( ( 1 + term ) // ( 1 - term ) ) ; <END_BUG> armIndexes [ i ] = armIndex ; } int maxIndex = 0 ; for ( int i = 1 ; i < ( armIndexes . length ) ; i ++ ) { if ( ( armIndexes [ i ] ) > ( armIndexes [ maxIndex ] ) ) { maxIndex = i ; } } return ArmPullRequest . get ( maxIndex , false ) ; } } @ Override public Algorithm duplicate ( ) { } @ Override public boolean requiresInitialBudget ( ) { } }

Fix:
double armIndex = averageReward + ( ( 2 * term ) // ( 1 - term ) ) ;
Buggy code:
public class UnaryExpression extends OperatorExpression { public Expression expression ; public Constant optimizedBooleanConstant ; public UnaryExpression ( Expression expression , int operator ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public Constant optimizedBooleanConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , Label trueLabel , Label falseLabel , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding expressionType = this . expression . resolveType ( scope ) ; if ( expressionType == null ) { this . constant = NotAConstant ; return null ; } int expressionId = expressionType . id ; if ( expressionId > 15 ) { this . constant = NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , expressionType ) ; return null ; } int tableId ; switch ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) { case OperatorIds . NOT : tableId = OperatorIds . AND_AND ; break ; case OperatorIds . TWIDDLE : tableId = OperatorIds . LEFT_SHIFT ; break ; default : tableId = OperatorIds . MINUS ; } <START_BUG> int result = ResolveTypeTables [ tableId ] [ ( ( expressionId << 4 ) + expressionId ) ] ; <END_BUG> this . expression . implicitConversion = result > > > 12 ; this . bits |= result & 15 ; switch ( result & 15 ) { case TypeIds . T_boolean : this . resolvedType = BooleanBinding ; break ; case TypeIds . T_byte : this . resolvedType = ByteBinding ; break ; case TypeIds . T_char : this . resolvedType = CharBinding ; break ; case TypeIds . T_double : this . resolvedType = DoubleBinding ; break ; case TypeIds . T_float : this . resolvedType = FloatBinding ; break ; case TypeIds . T_int : this . resolvedType = IntBinding ; break ; case TypeIds . T_long : this . resolvedType = LongBinding ; break ; default : this . constant = Constant . NotAConstant ; if ( expressionId != ( TypeIds . T_undefined ) ) scope . problemReporter ( ) . invalidOperator ( this , expressionType ) ; return null ; } if ( ( this . expression . constant ) != ( Constant . NotAConstant ) ) { this . constant = Constant . computeConstantOperation ( this . expression . constant , expressionId , ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) ) ; } else { this . constant = Constant . NotAConstant ; if ( ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) == ( OperatorIds . NOT ) ) { Constant cst = expression . optimizedBooleanConstant ( ) ; if ( cst != ( Constant . NotAConstant ) ) this . optimizedBooleanConstant = Constant . fromValue ( ( ! ( cst . booleanValue ( ) ) ) ) ; } } return this . resolvedType ; } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
int result = OperatorExpression . OperatorSignatures [ tableId ] [ ( ( expressionId << 4 ) + expressionId ) ] ;
Buggy code:
public class PatchElementBuilder extends AbstractModificationBuilderTarget < PatchElementBuilder > implements PatchBuilder . PatchElementHolder { private final String patchId ; private final PatchElementImpl element ; private PatchElementProvider provider ; protected PatchElementBuilder ( final String patchId , final String layerName , final boolean addOn ) { } public PatchElementProvider getProvider ( ) { } @ Override public PatchElementBuilder addContentModification ( ContentModification modification ) { } public PatchElement createElement ( Patch . PatchType patchType ) { assert ( patchId ) != null ; assert ( provider ) != null ; if ( ( element . getPatchType ( ) ) == null ) { <START_BUG> if ( patchType == ( PatchType . CUMULATIVE ) ) { <END_BUG> element . setUpgrade ( "unknown" ) ; } else { element . setNoUpgrade ( ) ; } } return element ; } @ Override protected PatchElementBuilder returnThis ( ) { } }

Fix:
if ( patchType == ( PatchType . UPGRADE ) ) {
Buggy code:
public class SingleResultsActivity extends Activity { private SharedPreferences prefs ; private Editor editor ; private EditText playerName ; private TextView playerScore ; private TextView newHighScore ; private String lastScoreDeck ; private boolean isHighScore ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private boolean isNewHighScore ( String lastScoreDeck ) { String highScoreDeck = prefs . getString ( "highScoreDeck" , "" ) ; <START_BUG> if ( ( lastScoreDeck . isEmpty ( ) ) || ( ( lastScoreDeck . compareTo ( highScoreDeck ) ) < 0 ) ) { <END_BUG> return true ; } else { return false ; } } public void saveResult ( View view ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
if ( ( highScoreDeck . isEmpty ( ) ) || ( ( lastScoreDeck . compareTo ( highScoreDeck ) ) < 0 ) ) {
Buggy code:
public class ModelControllerClientTestCase { Logger log = Logger . getLogger ( ModelControllerClientTestCase . class ) ; private final ModelControllerClientTestCase . DelegatingChannelHandler handler = new ModelControllerClientTestCase . DelegatingChannelHandler ( ) ; private RemoteChannelPairSetup channels ; @ Before public void start ( ) throws Exception { } @ After public void stop ( ) throws Exception { } private ModelControllerClient createTestClient ( ) { final Channel clientChannel = channels . getClientChannel ( ) ; <START_BUG> final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient ( clientChannel ) ; <END_BUG> clientChannel . receiveMessage ( ManagementChannelReceiver . createDelegating ( client ) ) ; return client ; } @ Test @ Ignore ( "OperationMessageHandlerProxy<seq2seq4repair_space>turned<seq2seq4repair_space>off<seq2seq4repair_space>temporarily" ) public void testSynchronousOperationMessageHandler ( ) throws Exception { } @ Test public void testSynchronousAttachmentInputStreams ( ) throws Exception { } @ Test @ Ignore ( "OperationMessageHandlerProxy<seq2seq4repair_space>turned<seq2seq4repair_space>off<seq2seq4repair_space>temporarily" ) public void testAsynchronousOperationWithMessageHandler ( ) throws Exception { } @ Test public void testCancelAsynchronousOperation ( ) throws Exception { } private void assertArrays ( byte [ ] expected , byte [ ] actual ) { } private abstract static class MockModelController implements ModelController { protected volatile ModelNode operation ; ModelNode getOperation ( ) { } @ Override public ModelControllerClient createClient ( Executor executor ) { } } static class DelegatingChannelHandler implements ManagementMessageHandler { private ManagementMessageHandler delegate ; @ Override public synchronized void handleMessage ( Channel channel , DataInput input , ManagementProtocolHeader header ) throws IOException { } public synchronized void setDelegate ( ManagementMessageHandler delegate ) { } @ Override public void shutdown ( ) { } @ Override public boolean awaitCompletion ( long timeout , TimeUnit unit ) throws InterruptedException { } @ Override public void shutdownNow ( ) { } } }

Fix:
final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient ( clientChannel , channels . getExecutorService ( ) ) ;
Buggy code:
public class BehaviorRequestTest extends TestCase { private WicketTester tester ; private BehaviorRequestTest . TestPage page ; @ Override protected void setUp ( ) throws Exception { } public void testEnabledBehaviorRequest ( ) { } public void testDisabledBehaviorRequest ( ) { } private String urlForBehavior ( IBehavior behaviorUnderTest ) { <START_BUG> int index = page . container . getBehaviorsRawList ( ) . indexOf ( behaviorUnderTest ) ; <END_BUG> String enabledBehaviorUrl = tester . urlFor ( new org . apache . wicket . request . handler . ListenerInterfaceRequestHandler ( new org . apache . wicket . request . handler . PageAndComponentProvider ( page , page . container ) , IBehaviorListener . INTERFACE , index ) ) . toString ( ) ; return enabledBehaviorUrl ; } public static class TestPage extends WebPage implements IMarkupResourceStreamProvider { private WebMarkupContainer container ; private BehaviorRequestTest . TestCallbackBehavior enabledBehavior ; private BehaviorRequestTest . TestCallbackBehavior disabledBehavior ; public TestPage ( ) { } public IResourceStream getMarkupResourceStream ( MarkupContainer container , Class < ? > containerClass ) { } } private static class TestCallbackBehavior extends AbstractBehavior implements IBehaviorListener { private boolean enabled ; private boolean called ; @ Override public void onComponentTag ( Component component , ComponentTag tag ) { } public void onRequest ( ) { } public void setEnabled ( boolean enabled ) { } @ Override public boolean isEnabled ( Component component ) { } public boolean isCalled ( ) { } } }

Fix:
int index = page . container . getBehaviorId ( behaviorUnderTest ) ;
Buggy code:
class Collaborator implements Serializable , InvocationHandler { private static final long serialVersionUID = - 58189302118314469L ; private static final Logger LOGGER = LoggerFactory . getLogger ( Collaborator . class ) ; final InvocationHandler delegate ; final Object object ; private transient List < Interceptor > interceptors = null ; private transient ComponentMetadata cm = null ; private transient boolean sorted = false ; Collaborator ( ComponentMetadata cm , List < Interceptor > interceptors , final Object delegateObj ) { } private void preCallInterceptor ( List < Interceptor > interceptorList , ComponentMetadata cm , Method m , Object [ ] parameters , Stack < Collaborator . StackElement > calledInterceptors ) throws Throwable { } public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { Object toReturn = null ; <START_BUG> if ( ( method . getName ( ) . equals ( "getWrappedObject" ) ) && ( ( method . getDeclaringClass ( ) ) == ( WrapperedObject . class ) ) ) { <END_BUG> toReturn = object ; } else if ( ( method . getName ( ) . equals ( "equals" ) ) && ( ( method . getDeclaringClass ( ) ) == ( Object . class ) ) ) { if ( ( args [ 0 ] ) instanceof WrapperedObject ) { args [ 0 ] = ( ( WrapperedObject ) ( args [ 0 ] ) ) . unwrapObject ( ) ; } toReturn = delegate . invoke ( proxy , method , args ) ; } else { Stack < Collaborator . StackElement > calledInterceptors = new Stack < Collaborator . StackElement > ( ) ; boolean inInvoke = false ; try { preCallInterceptor ( interceptors , cm , method , args , calledInterceptors ) ; inInvoke = true ; toReturn = delegate . invoke ( proxy , method , args ) ; inInvoke = false ; postCallInterceptorWithReturn ( cm , method , toReturn , calledInterceptors ) ; } catch ( Exception e ) { Collaborator . LOGGER . error ( "invoke" , e ) ; Exception exceptionToRethrow = null ; if ( ! inInvoke ) { exceptionToRethrow = e ; } else { if ( ! ( e instanceof RuntimeException ) ) { exceptionToRethrow = e ; } } try { postCallInterceptorWithException ( cm , method , e , calledInterceptors ) ; } catch ( Exception f ) { if ( exceptionToRethrow == null ) { exceptionToRethrow = f ; } } if ( exceptionToRethrow == null ) { exceptionToRethrow = e ; } throw exceptionToRethrow ; } } return toReturn ; } private void postCallInterceptorWithReturn ( ComponentMetadata cm , Method method , Object returnType , Stack < Collaborator . StackElement > calledInterceptors ) throws Throwable { } private void postCallInterceptorWithException ( ComponentMetadata cm , Method method , Exception exception , Stack < Collaborator . StackElement > calledInterceptors ) throws Throwable { } private static class StackElement { private Interceptor interceptor ; private Object preCallToken ; private StackElement ( Interceptor i ) { } private void setPreCallToken ( Object preCallToken ) { } private Object getPreCallToken ( ) { } } }

Fix:
if ( ( method . getName ( ) . equals ( "unwrapObject" ) ) && ( ( method . getDeclaringClass ( ) ) == ( WrapperedObject . class ) ) ) {
Buggy code:
public class TimeoutTest { public static class FailureWithTimeoutTest { @ Test ( timeout = 1000 ) public void failure ( ) { } } @ Test public void failureWithTimeout ( ) throws Exception { } public static class FailureWithTimeoutRunTimeExceptionTest { @ Test ( timeout = 1000 ) public void failure ( ) { } } @ Test public void failureWithTimeoutRunTimeException ( ) throws Exception { } public static class SuccessWithTimeoutTest { @ Test ( timeout = 1000 ) public void success ( ) { } } @ Test public void successWithTimeout ( ) throws Exception { } public static class TimeoutFailureTest { @ Test ( timeout = 100 ) public void success ( ) throws InterruptedException { <START_BUG> Thread . sleep ( 200 ) ; <END_BUG> } } @ Test public void timeoutFailure ( ) throws Exception { } public static class InfiniteLoopTest { @ Test ( timeout = 100 ) public void failure ( ) { } private void infiniteLoop ( ) { } } @ Test public void infiniteLoop ( ) throws Exception { } @ Ignore ( "We<seq2seq4repair_space>would<seq2seq4repair_space>like<seq2seq4repair_space>this<seq2seq4repair_space>behavior<seq2seq4repair_space>to<seq2seq4repair_space>work<seq2seq4repair_space>but<seq2seq4repair_space>it<seq2seq4repair_space>may<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>possible" ) @ Test public void stalledThreadAppearsInStackTrace ( ) throws Exception { } @ Test public void compatibility ( ) { } public static Test suite ( ) { } }

Fix:
Thread . sleep ( 40000 ) ;
Buggy code:
public class Draw extends TransformOperation { protected int xloc = 0 ; protected int yloc = 0 ; public void setXloc ( int x ) { } public void setYloc ( int y ) { } public void addRectangle ( Rectangle rect ) { } public void addText ( Text text ) { } public void addEllipse ( Ellipse elip ) { } public void addArc ( Arc arc ) { } public PlanarImage executeTransformOperation ( PlanarImage image ) { BufferedImage bi = image . getAsBufferedImage ( ) ; Graphics2D graphics = ( ( Graphics2D ) ( bi . getGraphics ( ) ) ) ; for ( int i = 0 ; i < ( instructions . size ( ) ) ; i ++ ) { ImageOperation instr = ( ( ImageOperation ) ( instructions . elementAt ( i ) ) ) ; if ( instr instanceof DrawOperation ) { PlanarImage op = ( ( DrawOperation ) ( instr ) ) . executeDrawOperation ( ) ; log ( ( ( ( "\tDrawing<seq2seq4repair_space>to<seq2seq4repair_space>x=" + ( xloc ) ) + "<seq2seq4repair_space>y=" ) + ( yloc ) ) ) ; graphics . drawImage ( op . getAsBufferedImage ( ) , null , xloc , yloc ) ; } else if ( instr instanceof TransformOperation ) { PlanarImage op = ( ( TransformOperation ) ( instr ) ) . executeTransformOperation ( null ) ; BufferedImage child = op . getAsBufferedImage ( ) ; log ( ( ( ( "\tDrawing<seq2seq4repair_space>to<seq2seq4repair_space>x=" + ( xloc ) ) + "<seq2seq4repair_space>y=" ) + ( yloc ) ) ) ; graphics . drawImage ( child , null , xloc , yloc ) ; <START_BUG> PlanarImage test = PlanarImage . wrapRenderedImage ( bi ) ; <END_BUG> } } image = PlanarImage . wrapRenderedImage ( bi ) ; return image ; } }

Fix:
PlanarImage . wrapRenderedImage ( bi ) ;