nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MainActivityFragment extends Fragment { private ListView mListCities ; private MainActivityFragment . CityAdapter mAdapter ; public MainActivityFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } class CityAdapter extends BaseAdapter { Cities cities ; LayoutInflater inflater ; public CityAdapter ( Cities cities , LayoutInflater inflater ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int position ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { <START_BUG> int layoutId = 0 ; <END_BUG> if ( ( position % 2 ) == 0 ) { layoutId = layout . row_left_icon ; } else { layoutId = layout . row_right_icon ; } View row = inflater . inflate ( layoutId , parent , false ) ; TextView txtCityName = ( ( TextView ) ( row . findViewById ( city_name ) ) ) ; City city = this . cities . get ( position ) ; txtCityName . setText ( city . getName ( ) ) ; return row ; } } }

Fix:
int layoutId ;
Buggy code:
public class PlusSpeedListener implements ActionListener { private User user ; private JProgressBar maxSpeedBar ; private JFrame epix ; private JLabel menuCardCoinLabel ; private JPanel card ; public PlusSpeedListener ( User user , JProgressBar maxSpeedBar , JFrame epix , JLabel menuCardCoinLabel , JPanel card ) { } public void actionPerformed ( ActionEvent e ) { if ( ( user . getCoin ( ) ) >= 5 ) { user . setCoin ( ( ( user . getCoin ( ) ) - 5 ) ) ; user . setMaxMoveSpeed ( ( ( user . getMaxMoveSpeed ( ) ) + 0.1 ) ) ; user . setMoveSpeed ( ( ( user . getMoveSpeed ( ) ) + 0.1 ) ) ; <START_BUG> EpixController . getInstance ( ) . coinsUpdate ( user , ( ( user . getCoin ( ) ) - 5 ) ) ; <END_BUG> menuCardCoinLabel . setText ( ( "" + ( user . getCoin ( ) ) ) ) ; maxSpeedBar . setValue ( ( ( ( int ) ( ( ( user . getMoveSpeed ( ) ) * 10 ) - 32 ) ) * 5 ) ) ; System . out . println ( maxSpeedBar . getValue ( ) ) ; System . out . println ( user . getMoveSpeed ( ) ) ; CardLayout cardLayout = ( ( CardLayout ) ( getCard ( ) . getLayout ( ) ) ) ; cardLayout . show ( getCard ( ) , "upgradeCard" ) ; } } public User getUser ( ) { } public void setUser ( User user ) { } public JProgressBar getmaxSpeedBar ( ) { } public void setmaxSpeedBar ( JProgressBar maxSpeedBar ) { } public JFrame getEpix ( ) { } public void setEpix ( JFrame epix ) { } public JLabel getMenuCardCoinLabel ( ) { } public void setMenuCardCoinLabel ( JLabel menuCardCoinLabel ) { } public JPanel getCard ( ) { } public void setCard ( JPanel card ) { } }

Fix:
EpixController . getInstance ( ) . coinsUpdate ( user , user . getCoin ( ) ) ;
Buggy code:
public class ElasticSearchEngine { private final ElasticSearchEngineUnthreaded elasicSearchEngineUnthreaded = new ElasticSearchEngineUnthreaded ( ) ; public Claim [ ] getClaims ( ) { } public Claim [ ] getClaimsForGlobalClaimList ( Context context ) { Claim [ ] claimsUnfiltered = getClaims ( ) ; List < Claim > claims = new ArrayList < Claim > ( ) ; for ( Claim claim : claimsUnfiltered ) { <START_BUG> if ( ( ( ! ( claim . getSubmitterEmail ( ) . equals ( Controller . getUser ( context ) . getEmail ( ) ) ) ) && ( ( ( claim . getApproverEmail ( ) ) == null ) || ( claim . getApproverEmail ( ) . equals ( Controller . getUser ( context ) . getEmail ( ) ) ) ) ) && ( ( claim . getStatus ( ) ) == ( Claim . SUBMITTED ) ) ) { <END_BUG> claims . add ( claim ) ; } } return claims . toArray ( new Claim [ claims . size ( ) ] ) ; } public Claim getClaim ( UUID id ) { } public void submitClaim ( Context context , Claim claim ) { } public void deleteClaim ( UUID id ) { } public void approveClaim ( Context context , UUID id , String comments ) { } public void returnClaim ( Context context , UUID id , String comments ) { } }

Fix:
if ( ( ( ! ( claim . getSubmitterEmail ( ) . equals ( Controller . getUser ( context ) . getEmail ( ) ) ) ) && ( ( ( claim . getApproverEmail ( ) ) == null ) || ( claim . getApproverEmail ( ) . equals ( Controller . getUser ( context ) . getEmail ( ) ) ) ) ) && ( ( claim . getStatus ( ) ) != ( Claim . IN_PROGRESS ) ) ) {
Buggy code:
public class JCacheNamespaceDrivenTests extends AbstractJCacheAnnotationTests { @ Override protected ApplicationContext getApplicationContext ( ) { } @ Test public void cacheResolver ( ) { ConfigurableApplicationContext context = new GenericXmlApplicationContext ( "//org//springframework//cache//jcache//config//jCacheNamespaceDriven-resolver.xml" ) ; DefaultJCacheOperationSource ci = context . getBean ( DefaultJCacheOperationSource . class ) ; <START_BUG> assertSame ( context . getBean ( "cacheResolver" ) , ci . getCacheResolver ( ) ) ; <END_BUG> context . close ( ) ; } @ Test public void testCacheErrorHandler ( ) { } }

Fix:
assertSame ( context . getBean ( "cacheResolver" ) , ci . getDefaultCacheResolver ( ) ) ;
Buggy code:
public class CryptoFactory { private static volatile Crypto cyptoInstance ; public static synchronized Crypto getInstance ( Context context ) { if ( ( CryptoFactory . cyptoInstance ) == null ) { try { synchronized ( CryptoFactory . class ) { if ( ( CryptoFactory . cyptoInstance ) == null ) { Context applicationContext = context . getApplicationContext ( ) ; <START_BUG> if ( ( ! ( CryptoFactory . isVersionSmallerThenJellyBeanMr2 ( ) ) ) || ( SharedPreferencesCryptoImpl . isAlreadyInUse ( context ) ) ) { <END_BUG> CryptoFactory . cyptoInstance = new SharedPreferencesCryptoImpl ( applicationContext ) ; } else { CryptoFactory . cyptoInstance = new KeyStoreCryptoImpl ( applicationContext ) ; } } } } catch ( Exception e ) { throw new RuntimeException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>initialize<seq2seq4repair_space>" + ( CryptoFactory . class . getName ( ) ) ) , e ) ; } } return CryptoFactory . cyptoInstance ; } private static boolean isVersionSmallerThenJellyBeanMr2 ( ) { } }

Fix:
if ( ( CryptoFactory . isVersionSmallerThenJellyBeanMr2 ( ) ) || ( SharedPreferencesCryptoImpl . isAlreadyInUse ( context ) ) ) {
Buggy code:
public class MainGame extends Application { Snake snake = new Snake ( ) ; Apple apple = new Apple ( ) ; public static final int width = 200 ; public static final int height = 200 ; public static int score ; private Text tEat = new Text ( ) ; public void stopGame ( ) { } @ Override public void start ( Stage primaryStage ) { Pane layout = new Pane ( ) ; ObservableList < Node > components = layout . getChildren ( ) ; components . add ( snake ) ; components . add ( apple ) ; components . add ( tEat ) ; tEat . setText ( ( "Etienne" + ( MainGame . score ) ) ) ; <START_BUG> tEat . setFont ( Font . font ( Application . STYLESHEET_MODENA , 15 ) ) ; <END_BUG> tEat . setY ( ( ( MainGame . height ) // 2 ) ) ; tEat . setX ( ( ( ( MainGame . width ) // 2 ) - 40 ) ) ; tEat . setFill ( Color . GREEN ) ; tEat . setOpacity ( 0 ) ; Scene scene = new Scene ( layout , MainGame . width , MainGame . height ) ; primaryStage . setTitle ( "Snake" ) ; primaryStage . setScene ( scene ) ; primaryStage . setResizable ( false ) ; primaryStage . setOnCloseRequest ( ( event ) -> { stopGame ( ) ; } ) ; primaryStage . show ( ) ; Timeline timeline = new Timeline ( new KeyFrame ( Duration . millis ( 100 ) , ( ev ) -> { snake . move ( ) ; if ( snake . collides ( apple ) ) { ( MainGame . score ) ++ ; System . out . println ( MainGame . score ) ; fader ( tEat ) ; snake . eat ( apple ) ; components . remove ( apple ) ; apple = new Apple ( ) ; components . add ( apple ) ; } } ) ) ; timeline . setCycleCount ( Animation . INDEFINITE ) ; timeline . play ( ) ; primaryStage . addEventFilter ( KeyEvent . KEY_PRESSED , ( event ) -> { switch ( event . getCode ( ) ) { case LEFT : snake . directionOrders ( Direction . LEFT ) ; break ; case RIGHT : snake . directionOrders ( Direction . RIGHT ) ; break ; case UP : snake . directionOrders ( Direction . UP ) ; break ; case DOWN : snake . directionOrders ( Direction . DOWN ) ; break ; case ESCAPE : stopGame ( ) ; default : break ; } } ) ; } private FadeTransition fader ( Node node ) { } public static void main ( String [ ] args ) { } }

Fix:
tEat . setFont ( Font . font ( Application . STYLESHEET_MODENA , 20 ) ) ;
Buggy code:
public abstract class AbstractLocalFolder extends AbstractMessageFolder { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.folder" ) ; protected int nextMessageUid ; protected ColumbaMessage aktMessage ; protected IDataStorage dataStorage ; public AbstractLocalFolder ( FolderItem item , String path ) { } public AbstractLocalFolder ( String name , String type , String path ) { } public void removeFolder ( ) throws Exception { } protected Object generateNextMessageUid ( ) { } public void setNextMessageUid ( int next ) { } public abstract IDataStorage getDataStorageInstance ( ) { } public MimePart getMimePart ( Object uid , Integer [ ] address ) throws Exception { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } public void innerCopy ( IMailbox destFolder , Object [ ] uids ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { } public Object addMessage ( InputStream in , Attributes attributes , Flags flags ) throws Exception { } public boolean isInboxFolder ( ) { } public boolean isTrashFolder ( ) { } public boolean supportsAddFolder ( IMailFolder newFolder ) { } public boolean supportsMove ( ) { } protected ColumbaMessage getMessage ( Object uid ) throws Exception { } protected IColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public void save ( ) throws Exception { } protected void setFlags ( Object uid , Flags flags ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { <START_BUG> List cachedList = Arrays . asList ( CachedHeaderfields . getCachedHeaderfields ( ) ) ; <END_BUG> LinkedList keyList = new LinkedList ( Arrays . asList ( keys ) ) ; ListTools . substract ( keyList , cachedList ) ; if ( ( keyList . size ( ) ) == 0 ) { return getHeaderListStorage ( ) . getHeaderFields ( uid , keys ) ; } else { IColumbaMessage message = getMessage ( uid ) ; Header header = message . getHeader ( ) . getHeader ( ) ; Header subHeader = new Header ( ) ; String value ; for ( int i = 0 ; i < ( keys . length ) ; i ++ ) { value = header . get ( keys [ i ] ) ; if ( value != null ) { subHeader . set ( keys [ i ] , value ) ; } } return subHeader ; } } public void expungeFolder ( ) throws Exception { } public Header getAllHeaderFields ( Object uid ) throws Exception { } }

Fix:
List cachedList = Arrays . asList ( CachedHeaderfields . getDefaultHeaderfields ( ) ) ;
Buggy code:
public class FilterElement { private String classname ; public void setType ( FilterElement . FilterAttribute fa ) { } public void setClassName ( String name ) { } public Formatter createFilterFormatter ( Formatter f ) throws BuildException { } public static class FilterAttribute extends EnumeratedAttribute { private static final String [ ] VALUES = new String [ ] { "stack" } ; private static final String [ ] CLASSNAMES = new String [ ] { FilterStackFormatter . class . getName ( ) } ; public String [ ] getValues ( ) { } public String getClassName ( ) { <START_BUG> return FilterElement . FilterAttribute . CLASSNAMES [ index ] ; <END_BUG> } } }

Fix:
return FilterElement . FilterAttribute . CLASSNAMES [ getIndex ( ) ] ;
Buggy code:
public class CppCodeFormatter extends CodeFormatter { private CppStyleMessageConsole console = null ; private CppStyleConsolePatternMatchListener listener = null ; private MessageConsoleStream out = null ; private MessageConsoleStream err = null ; public CppCodeFormatter ( ) { } @ Override public String createIndentationString ( int indentationLevel ) { } @ Override public void setOptions ( Map < String , ? > arg0 ) { } @ Override public TextEdit format ( int kind , String source , int offset , int length , int arg4 , String lineSeparator ) { } @ Override public TextEdit [ ] format ( int kind , String source , IRegion [ ] regions , String lineSeparator ) { } public void formatAndApply ( ICEditor editor ) { } private TextEdit [ ] format ( String source , IEditorPart editor , IRegion [ ] regions ) { } private String getClangForamtConfigureFile ( String path ) { } public boolean checkClangFormat ( ) { } public void checkFileFormat ( IFile file ) { } private void parserCpplintOutput ( IFile file , BufferedReader reader ) { } public void createIssueMarker ( IResource resource , int line , String msg ) { } public void deleteAllMarkers ( IResource target ) { } private boolean enableCpplintOnSave ( IResource resource ) { } public boolean runCpplintOnSave ( IResource resource ) { } private boolean enableClangFormatOnSave ( IResource resource ) { } public boolean runClangFormatOnSave ( IResource resource ) { if ( ! ( enableClangFormatOnSave ( resource ) ) ) { return false ; } <START_BUG> String clangFormat = CppCodeFormatter . getCpplintPath ( ) ; <END_BUG> showConsoleView ( ) ; if ( clangFormat == null ) { err . println ( "clang-format<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>specified." ) ; return false ; } File file = new File ( clangFormat ) ; if ( ! ( file . exists ( ) ) ) { err . println ( ( ( "clang-format<seq2seq4repair_space>(" + clangFormat ) + ")<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ) ; return false ; } if ( ! ( file . canExecute ( ) ) ) { err . println ( ( ( "clang-format<seq2seq4repair_space>(" + clangFormat ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>executable." ) ) ; return false ; } return true ; } public static String getClangFormatPath ( ) { } public static String getCpplintPath ( ) { } private void setupConsoleStream ( ) { } private void showConsoleView ( ) { } }

Fix:
String clangFormat = CppCodeFormatter . getClangFormatPath ( ) ;
Buggy code:
@ Stateful public class JMSMessagingUtil { private ConnectionFactory connectionFactory ; private Connection connection ; private Session session ; @ PreDestroy protected void preDestroy ( ) throws JMSException { } @ PostConstruct protected void postConstruct ( ) throws JMSException { } <START_BUG> @ Resource ( mappedName = "java://JmsXA" ) <END_BUG> public void setConnectionFactory ( final ConnectionFactory connectionFactory ) { this . connectionFactory = connectionFactory ; } public void sendTextMessage ( final String msg , final Destination destination , final Destination replyDestination ) throws JMSException { } public void sendObjectMessage ( final Serializable msg , final Destination destination , final Destination replyDestination ) throws JMSException { } public void reply ( final Message message ) throws JMSException { } public Message receiveMessage ( final Destination destination , final long waitInMillis ) throws JMSException { } private void sendMessage ( final Message message , final Destination destination , final Destination replyDestination ) throws JMSException { } }

Fix:
@ Resource ( mappedName = "java://ConnectionFactory" )
Buggy code:
@ SuppressWarnings ( "boxing" ) public class TestSplitMapUtils extends BulkTest { private Map < String , Integer > backingMap ; private TransformedMap < String , String , String , Integer > transformedMap ; private Transformer < String , Integer > stringToInt = new Transformer < String , Integer > ( ) { public Integer transform ( String input ) { } } ; public TestSplitMapUtils ( String testName ) { } @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; backingMap = new HashMap < String , Integer > ( ) ; <START_BUG> transformedMap = TransformedMap . decorate ( backingMap , NOPTransformer . < String > getInstance ( ) , stringToInt ) ; <END_BUG> for ( int i = 0 ; i < 10 ; i ++ ) { transformedMap . put ( String . valueOf ( i ) , String . valueOf ( i ) ) ; } } public void testReadableMap ( ) { } public void testAlreadyReadableMap ( ) { } @ SuppressWarnings ( "unchecked" ) public void testWritableMap ( ) { } public void testAlreadyWritableMap ( ) { } private void attemptGetOperation ( Runnable r ) { } private void attemptPutOperation ( Runnable r ) { } private void attemptMapOperation ( String s , Runnable r ) { } }

Fix:
transformedMap = TransformedMap . transformingMap ( backingMap , org . apache . commons . collections . functors . NOPTransformer . < String > nopTransformer ( ) , stringToInt ) ;
Buggy code:
public class SalesforceIdRetrievalIT extends FunctionalTestCase { private static final String TEST_DIR = ".//src//test//resources" ; private static String REPLY ; private static String HTML ; @ BeforeClass public static void init ( ) throws IOException { } @ Override protected String getConfigResources ( ) { } @ Test public void testDisplayData ( ) throws Exception { } @ Test public void testGetData ( ) throws Exception { MuleClient client = new MuleClient ( muleContext ) ; Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( "http.method" , "POST" ) ; Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "object" , "user" ) ; <START_BUG> params . put ( "field" , "id" ) ; <END_BUG> params . put ( "searchKey" , "name" ) ; params . put ( "searchValue" , "mule" ) ; MuleMessage result = client . send ( "http:////localhost:8081//" , params , props ) ; assertEquals ( result . getPayloadAsString ( ) , SalesforceIdRetrievalIT . REPLY ) ; } }

Fix:
params . put ( "field" , "email" ) ;
Buggy code:
public class SpawnFixer { @ SubscribeEvent public void playerLoggedIn ( PlayerEvent . PlayerLoggedInEvent event ) { } @ SubscribeEvent public void playerRespawn ( PlayerEvent . PlayerRespawnEvent event ) { int x = ( ( int ) ( event . player . posX ) ) ; int y = ( ( int ) ( event . player . posY ) ) ; int z = ( ( int ) ( event . player . posZ ) ) ; <START_BUG> if ( y > 0 ) <END_BUG> return ; x -= x % 4 ; z -= z % 4 ; Chunk chunk = event . player . worldObj . getChunkFromBlockCoords ( x , z ) ; for ( y = Math . min ( ( ( chunk . getTopFilledSegment ( ) ) + 16 ) , spawnHeight ) ; y > 0 ; -- y ) { if ( chunk . getBlock ( ( x & 15 ) , ( y - 1 ) , ( z & 15 ) ) . getMaterial ( ) . blocksMovement ( ) ) break ; } event . player . setPositionAndUpdate ( ( x + 0.5 ) , y , ( z + 0.5 ) ) ; } }

Fix:
if ( ( y > 0 ) && ( y < ( Ref . spawnHeight ) ) )
Buggy code:
public class MainTest extends AjcTestCase { public void testMainbare ( ) { } public void testDashX ( ) { String xoptionText = ResourceBundle . getBundle ( "org.aspectj.ajdt.ajc.messages" ) . getString ( "xoption.usage" ) ; <START_BUG> xoptionText = xoptionText . substring ( "{compiler.name}" . length ( ) ) ; <END_BUG> CompilationResult result = ajc ( null , new String [ ] { "-X" } ) ; assertMessages ( result , "Expecting<seq2seq4repair_space>xoptions<seq2seq4repair_space>usage<seq2seq4repair_space>message" , new MessageSpec ( null , null , null , newMessageList ( new Message ( xoptionText ) ) , null ) ) ; } }

Fix:
xoptionText = "non-standard<seq2seq4repair_space>options:" ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20080603-1001" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20080617-1818" ;
Buggy code:
public final class DbUtils { public static final String LOG_TAG = DbUtils . class . getSimpleName ( ) ; public static Cursor queryMemo ( Context context ) { <START_BUG> return new DbOpenHelper ( context ) . getReadableDatabase ( ) . query ( TABLE_NAME , null , null , null , null , null , ( ( MemoEntry . COLUMN_TIMESTAMP ) + "<seq2seq4repair_space>DSC" ) , null ) ; <END_BUG> } public static long insertMemo ( Context context , ContentValues values ) throws SQLException { } public static long insertMemoBulk ( Context context , ContentValues [ ] values ) throws SQLException { } }

Fix:
return new DbOpenHelper ( context ) . getReadableDatabase ( ) . query ( TABLE_NAME , null , null , null , null , null , ( ( MemoEntry . COLUMN_TIMESTAMP ) + "<seq2seq4repair_space>DESC" ) , null ) ;
Buggy code:
@ Controller public class UsersController { private static Logger LOG = Logger . getLogger ( HomeController . class ) ; @ Autowired private UserService userService ; @ Autowired private UserCreateFormValidator userCreateFormValidator ; @ Autowired private RestorePasswordFormValidator restoreValidator ; @ Autowired private EmailService emailService ; @ Autowired private MessageSource messageSource ; @ InitBinder ( "form" ) public void initBinderSignupForm ( WebDataBinder binder ) { } @ InitBinder ( "resetForm" ) public void initBinderResetForm ( WebDataBinder binder ) { } @ RequestMapping ( value = "//signin" , method = RequestMethod . GET ) public ModelAndView handleLoginGet ( ) throws ServiceException { } @ RequestMapping ( value = "//signup" , method = RequestMethod . GET ) public ModelAndView handleRegistrationGet ( HttpSession session ) throws ServiceException { } @ RequestMapping ( value = "//signup" , method = RequestMethod . POST ) public ModelAndView handleRegistrationPost ( @ Valid @ ModelAttribute ( "form" ) UserCreateForm form , BindingResult bindingResult , HttpSession session ) { } @ RequestMapping ( value = "//resetpass" , method = RequestMethod . GET ) public ModelAndView resetPass ( String token , String email ) { boolean isEmptyInput = ( ( ( token == null ) || ( email == null ) ) || ( token . isEmpty ( ) ) ) || ( email . isEmpty ( ) ) ; if ( isEmptyInput ) { ModelAndView model = new ModelAndView ( "home//resetPass" ) ; <START_BUG> model . addObject ( "resetForm" , new UserCreateForm ( ) ) ; <END_BUG> return model ; } try { if ( token . equals ( userService . getToken ( email ) ) ) { ModelAndView model = new ModelAndView ( "home//newpass" , "token" , token ) ; model . addObject ( "resetForm" , new RestorePasswordForm ( ) ) ; model . addObject ( "email" , email ) ; return model ; } else { return new ModelAndView ( "home//errors" , "error" , messageSource . getMessage ( "message.resetpass.tokenerror" , null , LocaleContextHolder . getLocale ( ) ) ) ; } } catch ( ServiceException e ) { return new ModelAndView ( "home//errors" , "error" , e . getMessage ( ) ) ; } } @ RequestMapping ( value = "//resetpass" , method = RequestMethod . POST ) public ModelAndView resetPassInDB ( @ ModelAttribute UserCreateForm form ) { } @ RequestMapping ( value = "//updatepass" , method = RequestMethod . POST ) public ModelAndView updatePass ( @ ModelAttribute RestorePasswordForm form ) { } @ RequestMapping ( value = "//confirm" , method = RequestMethod . GET ) public ModelAndView confirmEmail ( String token , String email ) { } }

Fix:
model . addObject ( "form" , new UserCreateForm ( ) ) ;
Buggy code:
public class SelectionOptionsPlugin extends AbstractFolderOptionsPlugin { public SelectionOptionsPlugin ( MailFrameMediator mediator ) { } public void saveOptionsToXml ( MessageFolder folder ) { XmlElement parent = getConfigNode ( folder ) ; DefaultItem item = new DefaultItem ( parent ) ; TableController tableController = ( ( org . columba . mail . gui . frame . TableViewOwner ) ( getMediator ( ) ) ) . getTableController ( ) ; MessageNode node = tableController . getView ( ) . getSelectedNodes ( ) [ 0 ] ; <START_BUG> if ( node != null ) <END_BUG> folder . setLastSelection ( node ) ; } public void loadOptionsFromXml ( MessageFolder folder ) { } public XmlElement createDefaultElement ( boolean global ) { } }

Fix:
if ( ( node != null ) && ( folder != null ) )
Buggy code:
public class GcmRegisterIntentService extends IntentService { private static final Logger logger = LoggerFactory . getLogger ( GcmRegisterIntentService . class ) ; public static final String GCM_REGISTRATION_COMPLETE = "GCM_REGISTRATION_COMPLETE" ; private static final String TAG = "RegIntentService" ; private static final String [ ] TOPICS = new String [ ] { "global" } ; public GcmRegisterIntentService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { } private void sendRegistrationToServer ( String gcmToken ) throws IOException { GoogleSignInAccount signInAccount = new AndroidAuthenticator ( ) . blockingGetAccount ( this ) ; GcmRegistration content = new GcmRegistration ( gcmToken , Application . getVersion ( ) ) ; ApiPost apiPost = new ApiPost ( content ) ; Call call = apiPost . newCall ( signInAccount ) ; Response response = call . execute ( ) ; <START_BUG> if ( ( response . code ( ) ) == ( HttpURLConnection . HTTP_OK ) ) { <END_BUG> String msg = "Didn't<seq2seq4repair_space>sent<seq2seq4repair_space>GCM<seq2seq4repair_space>token" + ( response . message ( ) ) ; throw new IOException ( msg ) ; } } private void subscribeTopics ( String token ) throws IOException { } }

Fix:
if ( ( response . code ( ) ) != ( HttpURLConnection . HTTP_OK ) ) {
Buggy code:
public interface WorkflowService { public static final String STATE_CREATED = "created" ; public static final String STATE_STARTED = "started" ; public static final String STATE_IN_PROGRESS = "in-progress" ; public static final String STATE_COMPLETE = "complete" ; public static final String STATE_ENDED = "ended" ; WorkflowJob createJob ( String site , List < String > paths , String processName , Map < String , String > properties ) { } List < WorkflowJob > getActiveJobs ( ) { } List < WorkflowJob > getJobsInState ( Set < String > states ) { } WorkflowJob getJob ( String jobId ) { } WorkflowJob updateJob ( WorkflowJob job ) { } boolean deleteJob ( String jobId ) { } boolean startJob ( String jobId ) { } boolean transitionJobState ( String jobId , String state ) { } boolean endJob ( String jobId ) { } void submitToGoLive ( String site , List < String > paths , Date scheduledDate , boolean sendApprovedNotice , String submitter ) { } NotificationService getNotificationService ( ) { } <START_BUG> String getGoLiveItems ( String site , String sort , boolean ascending ) throws ServiceException ; <END_BUG> String getInProgressItems ( String site , String sort , boolean ascending , boolean inProgressOnly ) throws ServiceException { } public boolean removeFromWorkflow ( String site , String path , boolean cancelWorkflow ) { } public List < ContentItemTO > getWorkflowAffectedPaths ( String site , String path ) { } public void updateWorkflowSandboxes ( String site , String path ) { } }

Fix:
Map < String , Object > getGoLiveItems ( String site , String sort , boolean ascending ) throws ServiceException ;
Buggy code:
public class ThreePaneMailFrameController extends AbstractMailFrameController implements ContentPane , SelectionListener , TableViewOwner , TreeViewOwner { public TreeController treeController ; public TableController tableController ; public HeaderController headerController ; public FilterToolbar filterToolbar ; public JSplitPane mainSplitPane ; public JSplitPane rightSplitPane ; private JPanel tablePanel ; private JPanel messagePanel ; public FolderInfoPanel folderInfoPanel ; public ThreePaneMailFrameController ( ViewItem viewItem ) { } public void enableMessagePreview ( boolean enable ) { } public FilterToolbar getFilterToolbar ( ) { } public TreeController getTreeController ( ) { } public TableController getTableController ( ) { } public JComponent getComponent ( ) { } public void showFilterToolbar ( ) { } public void hideFilterToolbar ( ) { } public void savePositions ( ViewItem viewItem ) { } public FolderInfoPanel getFolderInfoPanel ( ) { } public String getString ( String sPath , String sName , String sID ) { } public ContentPane getContentPane ( ) { } public void selectionChanged ( SelectionChangedEvent e ) { TreeSelectionChangedEvent event = ( ( TreeSelectionChangedEvent ) ( e ) ) ; AbstractFolder [ ] selectedFolders = event . getSelected ( ) ; <START_BUG> if ( ( selectedFolders . length ) == 1 ) { <END_BUG> getContainer ( ) . getFrame ( ) . setTitle ( selectedFolders [ 0 ] . getName ( ) ) ; } } }

Fix:
if ( ( ( selectedFolders . length ) == 1 ) && ( ( selectedFolders [ 0 ] ) != null ) ) {
Buggy code:
class Density { public static int dp2px ( Context context , float dp ) { Resources r = context . getResources ( ) ; float px = TypedValue . applyDimension ( COMPLEX_UNIT_DIP , dp , r . getDisplayMetrics ( ) ) ; <START_BUG> return ( ( int ) ( px ) ) ; <END_BUG> } }

Fix:
return Math . round ( px ) ;
Buggy code:
public class CPU extends Player { private AI ai ; public CPU ( String n , Deck d , ArrayList < Player > players ) { } public int move ( Pile currP , Deck d ) { cio . type ( hand ) ; if ( canMove ( currP ) ) { Card c = ai . logical ( currP , facedown . size ( ) ) ; int index ; int numPlayable = 1 ; if ( ( hand . isEmpty ( ) ) || ( faceup . isEmpty ( ) ) ) { if ( ! ( hand . isEmpty ( ) ) ) { index = getIndex ( c , hand ) ; int currVal = c . value ; if ( ( ( c . value ) != 2 ) && ( ( c . value ) != 10 ) ) { for ( int i = index + 1 ; i < ( index + 3 ) ; i ++ ) { if ( ( hand . get ( i ) . value ) == currVal ) { numPlayable ++ ; } else { break ; } } } for ( int i = 0 ; i < numPlayable ; i ++ ) { currP . add ( hand . get ( index ) ) ; hand . remove ( index ) ; } <START_BUG> while ( ( hand . size ( ) ) < 3 ) { <END_BUG> hand . add ( d . draw ( ) ) ; } sort ( hand ) ; } else { index = getIndex ( c , faceup ) ; if ( ( ( c . value ) != 2 ) && ( ( c . value ) != 10 ) ) { for ( Card currC : faceup ) { if ( ( currC . value ) == ( c . value ) ) { numPlayable ++ ; } } } for ( int i = 0 ; i < numPlayable ; i ++ ) { currP . add ( faceup . get ( index ) ) ; faceup . remove ( 0 ) ; } cio . typeln ( currP ) ; } } else { if ( currP . validMove ( facedown . get ( 0 ) ) ) { currP . add ( facedown . get ( 0 ) ) ; facedown . remove ( 0 ) ; if ( ( hand . isEmpty ( ) ) && ( facedown . isEmpty ( ) ) ) { return 2 ; } } else { hand . addAll ( currP . pickup ( ) ) ; cio . typeln ( ( ( name ) + "<seq2seq4repair_space>picked<seq2seq4repair_space>up<seq2seq4repair_space>pile" ) ) ; sort ( hand ) ; return 0 ; } } cio . typeln ( ( ( ( ( "Played<seq2seq4repair_space>" + numPlayable ) + "<seq2seq4repair_space>" ) + ( c . value ) ) + "s" ) ) ; if ( ( hand . isEmpty ( ) ) && ( facedown . isEmpty ( ) ) ) { return 2 ; } if ( ( ( currP . checkTop ( ) . value ) != 10 ) && ( ! ( currP . fourKind ( ) ) ) ) { return 0 ; } else { currP . clear ( ) ; return 1 ; } } else { hand . addAll ( currP . pickup ( ) ) ; cio . typeln ( ( ( name ) + "<seq2seq4repair_space>picked<seq2seq4repair_space>up<seq2seq4repair_space>pile" ) ) ; sort ( hand ) ; return 0 ; } } public int getIndex ( Card c , ArrayList < Card > options ) { } public static void main ( String [ ] args ) { } }

Fix:
while ( ( ( hand . size ( ) ) < 3 ) && ( ! ( d . empty ( ) ) ) ) {
Buggy code:
public class UrlEncoder { public enum Type { QUERY , PATH , FULL_PATH ; } protected BitSet dontNeedEncoding ; private final char stopChar ; protected static final int caseDiff = 'a' - 'A' ; public static final UrlEncoder QUERY_INSTANCE = new UrlEncoder ( UrlEncoder . Type . QUERY , '' ) ; public static final UrlEncoder PATH_INSTANCE = new UrlEncoder ( UrlEncoder . Type . PATH , '' ) ; public static final UrlEncoder FULL_PATH_INSTANCE = new UrlEncoder ( UrlEncoder . Type . FULL_PATH , '?' ) ; protected UrlEncoder ( UrlEncoder . Type type , char stopChar ) { } public String encode ( String s , Charset enc ) { } public String encode ( String s , String enc ) { boolean needToChange = false ; StringBuilder out = new StringBuilder ( s . length ( ) ) ; Charset charset ; CharArrayWriter charArrayWriter = new CharArrayWriter ( ) ; if ( enc == null ) { throw new NullPointerException ( "charsetName" ) ; } try { charset = Charset . forName ( enc ) ; } catch ( IllegalCharsetNameException e ) { throw new RuntimeException ( new UnsupportedEncodingException ( enc ) ) ; } catch ( UnsupportedCharsetException e ) { throw new RuntimeException ( new UnsupportedEncodingException ( enc ) ) ; } boolean stopEncoding = false ; for ( int i = 0 ; i < ( s . length ( ) ) ; ) { int c = s . charAt ( i ) ; if ( ( stopEncoding == false ) && ( c == ( stopChar ) ) ) { stopEncoding = true ; } if ( ( stopEncoding == true ) || ( dontNeedEncoding . get ( c ) ) ) { if ( c == '<seq2seq4repair_space>' ) { c = '+' ; needToChange = true ; } out . append ( ( ( char ) ( c ) ) ) ; i ++ ; } else { do { charArrayWriter . write ( c ) ; if ( ( c >= 55296 ) && ( c <= 56319 ) ) { if ( ( i + 1 ) < ( s . length ( ) ) ) { int d = s . charAt ( ( i + 1 ) ) ; if ( ( d >= 56320 ) && ( d <= 57343 ) ) { charArrayWriter . write ( d ) ; i ++ ; } } } i ++ ; } while ( ( i < ( s . length ( ) ) ) && ( ! ( dontNeedEncoding . get ( ( c = s . charAt ( i ) ) ) ) ) ) ; charArrayWriter . flush ( ) ; String str = new String ( charArrayWriter . toCharArray ( ) ) ; <START_BUG> byte [ ] ba = new byte [ 0 ] ; <END_BUG> try { ba = str . getBytes ( charset . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } for ( byte b : ba ) { out . append ( '%' ) ; char ch = Character . forDigit ( ( ( b > > 4 ) & 15 ) , 16 ) ; if ( Character . isLetter ( ch ) ) { ch -= UrlEncoder . caseDiff ; } out . append ( ch ) ; ch = Character . forDigit ( ( b & 15 ) , 16 ) ; if ( Character . isLetter ( ch ) ) { ch -= UrlEncoder . caseDiff ; } out . append ( ch ) ; } charArrayWriter . reset ( ) ; needToChange = true ; } } return needToChange ? out . toString ( ) : s ; } }

Fix:
byte [ ] ba ;
Buggy code:
public abstract class Declare extends PatternNode { public static final byte ERROR_OR_WARNING = 1 ; public static final byte PARENTS = 2 ; public static final byte SOFT = 3 ; public static final byte DOMINATES = 4 ; public static Declare read ( DataInputStream s , ISourceContext context ) throws IOException { byte kind = s . readByte ( ) ; switch ( kind ) { case Declare . ERROR_OR_WARNING : return DeclareErrorOrWarning . read ( s , context ) ; case Declare . DOMINATES : <START_BUG> return DeclareDominates . read ( s , context ) ; <END_BUG> case Declare . PARENTS : return DeclareParents . read ( s , context ) ; case Declare . SOFT : return DeclareSoft . read ( s , context ) ; default : throw new RuntimeException ( "unimplemented" ) ; } } public abstract void resolve ( IScope scope ) { } public abstract boolean isAdviceLike ( ) { } }

Fix:
return DeclarePrecedence . read ( s , context ) ;
Buggy code:
public class Plugin extends Item { public static final Plugin FAVORITE = new Plugin ( "favorites" , drawable . ic_favorites ) ; public static final Plugin MY_APPS = new Plugin ( "myapps" , drawable . ic_my_apps ) ; private String name ; @ Override public String getName ( ) { } public Plugin setName ( String name ) { } private String icon ; public String getIcon ( ) { } public void setIcon ( String icon ) { } private int iconResource ; public int getIconResource ( ) { } public void setIconResource ( int iconResource ) { } private int weight ; public int getWeight ( ) { } public void setWeight ( int weight ) { } private String type ; public String getType ( ) { } public void setType ( String type ) { } public boolean isSearchable ( ) { } private Plugin ( String cmd , int iconResource ) { } public Plugin ( Map < String , String > record ) { } public static final Creator < Plugin > CREATOR = new Creator < Plugin > ( ) { public Plugin [ ] newArray ( int size ) { } public Plugin createFromParcel ( Parcel source ) { } } ; private Plugin ( Parcel source ) { } public void writeToParcel ( Parcel dest , int flags ) { } @ Override public String toString ( ) { <START_BUG> return ( ( "id=" + ( getId ( ) ) ) + ",<seq2seq4repair_space>name=" ) + ( name ) ; <END_BUG> } }

Fix:
return ( ( ( ( ( super . toStringOpen ( ) ) + "type:<seq2seq4repair_space>" ) + ( getType ( ) ) ) + ",<seq2seq4repair_space>weight:<seq2seq4repair_space>" ) + ( getWeight ( ) ) ) + "<seq2seq4repair_space>}" ;
Buggy code:
@ TypeCapability ( inputs = { "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence" , "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token" } , outputs = { "de.tudarmstadt.ukp.dkpro.core.sentiment.type.StanfordSentimentAnnotation" } ) public class StanfordSentimentAnalyzer extends JCasAnnotator_ImplBase { private StanfordCoreNLP pipeline ; @ Override public void initialize ( UimaContext context ) throws ResourceInitializationException { } @ Override public void process ( JCas jCas ) throws AnalysisEngineProcessException { for ( Sentence sentenceDKPro : JCasUtil . select ( jCas , Sentence . class ) ) { String sentenceText = sentenceDKPro . getCoveredText ( ) ; Annotation annotation = pipeline . process ( sentenceText ) ; for ( CoreMap sentence : annotation . get ( SentencesAnnotation . class ) ) { <START_BUG> Tree tree = sentence . get ( AnnotatedTree . class ) ; <END_BUG> SimpleMatrix sentimentCoefficients = RNNCoreAnnotations . getPredictions ( tree ) ; double veryNegative = sentimentCoefficients . get ( 0 ) ; double negative = sentimentCoefficients . get ( 1 ) ; double neutral = sentimentCoefficients . get ( 2 ) ; double positive = sentimentCoefficients . get ( 3 ) ; double veryPositive = sentimentCoefficients . get ( 4 ) ; StanfordSentimentAnnotation sentimentAnnotation = new StanfordSentimentAnnotation ( jCas ) ; sentimentAnnotation . setBegin ( sentenceDKPro . getBegin ( ) ) ; sentimentAnnotation . setEnd ( sentenceDKPro . getEnd ( ) ) ; sentimentAnnotation . setVeryNegative ( veryNegative ) ; sentimentAnnotation . setNegative ( negative ) ; sentimentAnnotation . setNeutral ( neutral ) ; sentimentAnnotation . setPositive ( positive ) ; sentimentAnnotation . setVeryPositive ( veryPositive ) ; sentimentAnnotation . addToIndexes ( ) ; } } } }

Fix:
Tree tree = sentence . get ( SentimentAnnotatedTree . class ) ;
Buggy code:
public class CompactionsTest extends CleanupHelper { public static final String TABLE1 = "Keyspace1" ; public static final String TABLE2 = "Keyspace2" ; public static final InetAddress LOCAL = FBUtilities . getLocalAddress ( ) ; @ Test public void testCompactions ( ) throws IOException , InterruptedException , ExecutionException { instance . disableAutoCompaction ( ) ; Table table = Table . open ( CompactionsTest . TABLE1 ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( "Standard1" ) ; final int ROWS_PER_SSTABLE = 10 ; Set < DecoratedKey > inserted = new HashSet < DecoratedKey > ( ) ; for ( int j = 0 ; j < ( ( ( DatabaseDescriptor . getIndexInterval ( ) ) * 3 ) // ROWS_PER_SSTABLE ) ; j ++ ) { for ( int i = 0 ; i < ROWS_PER_SSTABLE ; i ++ ) { DecoratedKey key = Util . dk ( String . valueOf ( ( i % 2 ) ) ) ; RowMutation rm = new RowMutation ( CompactionsTest . TABLE1 , key . key ) ; <START_BUG> rm . add ( new QueryPath ( "Standard1" , null , ByteBuffer . wrap ( String . valueOf ( ( i // 2 ) ) . getBytes ( ) ) ) , EMPTY_BYTE_BUFFER , ( ( j * ROWS_PER_SSTABLE ) + i ) ) ; <END_BUG> rm . apply ( ) ; inserted . add ( key ) ; } store . forceBlockingFlush ( ) ; Assert . assertEquals ( inserted . toString ( ) , inserted . size ( ) , Util . getRangeSlice ( store ) . size ( ) ) ; } while ( true ) { Future < Integer > ft = instance . submitMinorIfNeeded ( store ) ; if ( ( ft . get ( ) ) == 0 ) break ; } if ( ( store . getSSTables ( ) . size ( ) ) > 1 ) { instance . performMajor ( store ) ; } Assert . assertEquals ( inserted . size ( ) , Util . getRangeSlice ( store ) . size ( ) ) ; } @ Test public void testGetBuckets ( ) { } }

Fix:
rm . add ( new org . apache . cassandra . db . filter . QueryPath ( "Standard1" , null , ByteBufferUtil . bytes ( String . valueOf ( ( i // 2 ) ) ) ) , EMPTY_BYTE_BUFFER , ( ( j * ROWS_PER_SSTABLE ) + i ) ) ;
Buggy code:
public class ChoiceList implements IChoiceList { private final List list ; private class Choice implements IChoice { private final int index ; private final Object object ; public Choice ( final Object object , final int index ) { } public String getDisplayValue ( ) { } public String getId ( ) { } public Object getObject ( ) { } } public ChoiceList ( ) { } public ChoiceList ( final Collection choices ) { } public ChoiceList ( final int initialCapacity ) { } public void add ( final Object object ) { } public void addAll ( final Collection collection ) { attach ( ) ; <START_BUG> list . add ( collection ) ; <END_BUG> } public void attach ( ) { } public IChoice choiceForId ( String id ) { } public IChoice choiceForObject ( Object object ) { } public void clear ( ) { } public void detach ( ) { } public IChoice get ( final int index ) { } public List getList ( ) { } public int size ( ) { } protected IChoice newChoice ( final Object object , final int index ) { } }

Fix:
list . addAll ( collection ) ;
Buggy code:
public class LinearObjectiveFunction implements Serializable { private static final long serialVersionUID = - 4531815507568396090L ; private transient final RealVector coefficients ; private final double constantTerm ; public LinearObjectiveFunction ( double [ ] coefficients , double constantTerm ) { } public LinearObjectiveFunction ( RealVector coefficients , double constantTerm ) { } public RealVector getCoefficients ( ) { } public double getConstantTerm ( ) { } public double getValue ( final double [ ] point ) { <START_BUG> return ( coefficients . dotProduct ( point ) ) + ( constantTerm ) ; <END_BUG> } public double getValue ( final RealVector point ) { } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } private void writeObject ( ObjectOutputStream oos ) throws IOException { } private void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } }

Fix:
return ( coefficients . dotProduct ( new ArrayRealVector ( point , false ) ) ) + ( constantTerm ) ;
Buggy code:
public class TestOrderColumn extends SingleEMFTestCase { private Student [ ] students = new Student [ 12 ] ; public void setUp ( ) { <START_BUG> super . setUp ( Person . class , Player . class , BattingOrder . class , Trainer . class , Game . class , Inning . class , Course . class , Student . class , Owner . class , Bicycle . class , Car . class , Home . class , Widget . class , BiOrderMappedByEntity . class , BiOrderEntity . class ) ; <END_BUG> try { createQueryData ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } public void testOneToManyElementRemoval ( ) { } public void testOneToManyBiDirElementRemoval ( ) { } public void testElementCollectionElementRemoval ( ) { } public void testOneToManyElementInsert ( ) { } public void testElementCollectionElementInsert ( ) { } public void testOneToManyDefault ( ) { } public void testOneToManyNamed ( ) { } public void testManyToMany ( ) { } public void validateBiOrderedManyToMany ( ) { } public void testElementCollectionBasic ( ) { } public void testElementCollectionEmbeddables ( ) { } public void testOrderColumnInsertable ( ) { } public void testOrderColumnUpdateable ( ) { } public void testOrderColumnTable ( ) { } public void testOrderColumnPredicateQuery ( ) { } public void testOrderColumnProjectionQuery ( ) { } private void createQueryData ( ) { } private void validateIndexAndValues ( OpenJPAEntityManagerSPI em , String entity , String indexedCol , int base , Object [ ] objs , String idField , Object idValue ) { } private void validateCollIndexAndValues ( OpenJPAEntityManagerSPI em , String entity , String indexedCol , int base , Object [ ] objs , String idField , Object idValue ) { } private void validateOrderColumnName ( Class clazz , String fieldName , String columnName ) { } private Column getOrderColumn ( OpenJPAEntityManagerFactorySPI emf1 , Class clazz , String fieldName ) { } private void validateOrderColumnName ( OpenJPAEntityManagerFactorySPI emf1 , Class clazz , String fieldName , String columnName ) { } private void validateOrderColumnTable ( OpenJPAEntityManagerFactorySPI emf1 , Class clazz , String fieldName , String tableName , String columnName ) { } private void validateOrderColumnUpdatable ( OpenJPAEntityManagerFactorySPI emf1 , Class clazz , String fieldName , boolean updatable ) { } private void validateOrderColumnInsertable ( OpenJPAEntityManagerFactorySPI emf1 , Class clazz , String fieldName , boolean insertable ) { } private boolean tableAndColumnExists ( OpenJPAEntityManagerFactorySPI emf1 , OpenJPAEntityManagerSPI em , String tableName , String schemaName , String columnName ) { } }

Fix:
super . setUp ( CLEAR_TABLES , Person . class , Player . class , BattingOrder . class , Trainer . class , Game . class , Inning . class , Course . class , Student . class , Owner . class , Bicycle . class , Car . class , Home . class , Widget . class , BiOrderMappedByEntity . class , BiOrderEntity . class ) ;
Buggy code:
public class LearningView extends JPanel { private int cardId ; private JLabel labelStartLearning ; private JLabel labelFach ; private JComboBox < Integer > comboboxFach ; private JLabel labelFront ; private JButton buttonCardFront ; private JLabel labelBack ; private JButton buttonCardBack ; private JPanel panelAnswer ; private JButton buttonCorrect ; private JButton buttonWrong ; private GridBagConstraints gridBagContraints ; public LearningView ( ) { } public void paint ( ) { } public LearningView getLearningView ( ) { } public void initializeSettingsWithData ( ArrayList < Integer > boxes , Register register ) { } public void displayErrorMessage ( String message ) { } public void showAnswer ( ) { } public void ShowQuestion ( ArrayList < Integer > boxes , String front , String back , int cardId ) { this . cardId = cardId ; <START_BUG> this . comboboxFach . removeAll ( ) ; <END_BUG> Iterator < Integer > it = boxes . iterator ( ) ; while ( it . hasNext ( ) ) { this . comboboxFach . addItem ( ( ( Integer ) ( it . next ( ) ) ) ) ; } this . comboboxFach . setSelectedIndex ( 0 ) ; this . labelFront . setVisible ( true ) ; this . labelBack . setVisible ( false ) ; this . buttonCardFront . setText ( front ) ; this . buttonCardBack . setText ( back ) ; this . buttonCardFront . setVisible ( true ) ; this . buttonCardBack . setVisible ( false ) ; this . buttonCorrect . setVisible ( false ) ; this . buttonWrong . setVisible ( false ) ; } public void setButtonFrontBackListener ( MeinButtonActionListener l ) { } public void removeButtonFrontBackListener ( MeinButtonActionListener l ) { } public int getCardId ( ) { } public void setCardId ( int id ) { } public void refreshData ( ArrayList < Integer > boxes , ArrayList < Card > cardsOfABox ) { } }

Fix:
this . comboboxFach . removeAllItems ( ) ;
Buggy code:
abstract class BaseCellMapper < SourceT extends Cell > extends Mapper < SourceT , Element > implements CellMapper { private static final String BACKGROUND = "background" ; private static final String UNDERLINE_SUFFIX = "<seq2seq4repair_space>bottom<seq2seq4repair_space>repeat-x" ; private CellToDomContext myContext ; private Counters myCounters ; private List < Mapper < ? , ? > > myChildMappers = null ; private List < Node > myChildTargets = null ; private PopupManager myPopupManager ; private Color myAncestorBackground ; private boolean myWasPopup ; BaseCellMapper ( SourceT source , CellToDomContext ctx , Element target ) { } protected CellToDomContext getContext ( ) { } @ Override protected void onAttach ( MappingContext ctx ) { } @ Override protected void onDetach ( ) { } protected boolean isLeaf ( ) { } protected boolean isAutoChildManagement ( ) { } protected boolean isAutoPopupManagement ( ) { } @ Override public final int getCounter ( CounterSpec spec ) { } @ Override public final void changeCounter ( CounterSpec spec , int delta ) { } void childAdded ( int index , Cell child ) { } void childRemoved ( int index , Cell child ) { if ( ! ( isAutoChildManagement ( ) ) ) return ; myChildMappers . remove ( index ) ; <START_BUG> myChildMappers . remove ( index ) ; <END_BUG> } @ Override public final void onEvent ( PropertyChangeEvent < Cell > event ) { } @ Override public void setAncestorBackground ( Color background ) { } @ Override public void refreshProperties ( ) { } private void applyStyle ( boolean selected , boolean focusHighlighted , boolean hasError , boolean hasWarning , Color background ) { } protected final void updateCssStyle ( String cssStyle , boolean apply ) { } private void applyBackground ( String color , String underline ) { } List < Node > divWrappedElementChildren ( final Element e ) { } protected PopupManager createPopupManager ( ) { } No newline ; at end ; of file ; }

Fix:
myChildTargets . remove ( index ) ;