nus-yam/ex-repair huggingface dataset:
Buggy code:
public class OrderController extends HttpServlet { private static final long serialVersionUID = 1L ; static final Logger logger = Logger . getLogger ( OrderController . class ) ; private CityService cityService = new com . tsystems . javaschool . timber . logiweb . service . impl . CityServiceImpl ( new CityDaoJpa ( City . class ) ) ; private TruckService truckService = new com . tsystems . javaschool . timber . logiweb . service . impl . TruckServiceImpl ( new TruckDaoJpa ( Truck . class ) ) ; private DriverService driverService = new com . tsystems . javaschool . timber . logiweb . service . impl . DriverServiceImpl ( new DriverDaoJpa ( Driver . class ) ) ; public OrderController ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } private void clearAttributes ( HttpSession session , List < RoutePoint > route , Order orderToCreate , List < Truck > suitableTrucks , List < Driver > suitableDrivers , List < City > cities , List < Cargo > loadedCargos ) { } private void setAddOrderSessionAttributes ( HttpSession session , List < RoutePoint > route , Order orderToCreate , List < Truck > suitableTrucks , List < Driver > suitableDrivers , List < City > cities , List < Cargo > loadedCargos ) { } private void retrieveAddOrderSessionAttributes ( HttpSession session , List < RoutePoint > route , Order orderToCreate , List < Truck > suitableTrucks , List < Driver > suitableDrivers , List < City > cities , List < Cargo > loadedCargos ) { } private RoutePoint parseRoutePoint ( HttpServletRequest request ) throws CargoNameException , CargoWeightOutOfRangeException { String name = "" ; int weight = 0 ; try { <START_BUG> InputParser . parseLettersOnlyString ( request . getParameter ( "cargoName" ) ) ; <END_BUG> weight = InputParser . parseNumber ( request . getParameter ( "cargoWeight" ) , 1 , 40000 ) ; } catch ( PatternSyntaxException ex ) { throw new CargoNameException ( ) ; } catch ( IntegerOutOfRangeException ex ) { throw new CargoWeightOutOfRangeException ( ) ; } Cargo cargo = new Cargo ( name , weight ) ; int cityId = Integer . valueOf ( request . getParameter ( "pointCity" ) ) ; RoutePointType pointType = RoutePointType . valueOf ( request . getParameter ( "pointType" ) ) ; City city = cityService . findById ( cityId ) ; RoutePoint routePoint = new RoutePoint ( city , cargo , pointType ) ; return routePoint ; } private RoutePoint parseUnloadRoutePoint ( HttpServletRequest request , List < Cargo > loadedCargos ) { } private int parseOrderId ( HttpServletRequest request ) { } boolean isValidRoute ( List < RoutePoint > route ) { } }

Fix:
name = InputParser . parseLettersOnlyString ( request . getParameter ( "cargoName" ) ) ;
Buggy code:
public class Slider extends Control { boolean dragging ; int minimum ; int maximum ; int thumb ; int increment = 1 ; int pageIncrement = 10 ; public Slider ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void enableWidget ( boolean enabled ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public int getSelection ( ) { } public int getThumb ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void sendSelection ( ) { Event event = new Event ( ) ; int hitPart = ( ( int ) ( ( ( NSScroller ) ( view ) ) . hitPart ( ) ) ) ; int value = getSelection ( ) ; switch ( hitPart ) { case OS . NSScrollerDecrementLine : event . detail = SWT . ARROW_UP ; value -= increment ; break ; case OS . NSScrollerDecrementPage : value -= pageIncrement ; event . detail = SWT . PAGE_UP ; break ; case OS . NSScrollerIncrementLine : value += increment ; event . detail = SWT . ARROW_DOWN ; break ; case OS . NSScrollerIncrementPage : value += pageIncrement ; event . detail = SWT . PAGE_DOWN ; break ; case OS . NSScrollerKnob : event . detail = SWT . DRAG ; break ; } if ( ( event . detail ) != ( SWT . DRAG ) ) { setSelection ( value ) ; } <START_BUG> sendEvent ( Selection , event ) ; <END_BUG> } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } public void setSelection ( int value ) { } void setSmallSize ( ) { } void updateBar ( int selection , int minimum , int maximum , int thumb ) { } public void setThumb ( int value ) { } public void setValues ( int selection , int minimum , int maximum , int thumb , int increment , int pageIncrement ) { } }

Fix:
sendSelectionEvent ( Selection , event , true ) ;
Buggy code:
public class DirectoryDialog extends Dialog { String message = "" ; String filterPath = "" ; public DirectoryDialog ( Shell parent ) { } public DirectoryDialog ( Shell parent , int style ) { } public String getFilterPath ( ) { } public String getMessage ( ) { } public String open ( ) { String directoryPath = null ; NSOpenPanel panel = NSOpenPanel . openPanel ( ) ; OS . objc_msgSend ( panel . id , sel_setShowsHiddenFiles_ , true ) ; panel . setCanCreateDirectories ( true ) ; panel . setAllowsMultipleSelection ( ( ( ( style ) & ( SWT . MULTI ) ) != 0 ) ) ; panel . setTitle ( NSString . stringWith ( ( ( title ) != null ? title : "" ) ) ) ; panel . setMessage ( NSString . stringWith ( ( ( message ) != null ? message : "" ) ) ) ; panel . setCanChooseFiles ( false ) ; panel . setCanChooseDirectories ( true ) ; NSApplication application = NSApplication . sharedApplication ( ) ; if ( ( ( parent ) != null ) && ( ( ( style ) & ( SWT . SHEET ) ) != 0 ) ) { <START_BUG> application . beginSheet ( panel , window , null , 0 , 0 ) ; <END_BUG> } Display display = ( ( parent ) != null ) ? parent . getDisplay ( ) : Display . getCurrent ( ) ; display . setModalDialog ( this ) ; NSString dir = ( ( filterPath ) != null ) ? NSString . stringWith ( filterPath ) : null ; int response = panel . runModalForDirectory ( dir , null ) ; if ( ( ( parent ) != null ) && ( ( ( style ) & ( SWT . SHEET ) ) != 0 ) ) { application . endSheet ( panel , 0 ) ; } display . setModalDialog ( null ) ; if ( response == ( OS . NSFileHandlingPanelOKButton ) ) { NSString filename = panel . filename ( ) ; directoryPath = filterPath = filename . getString ( ) ; } return directoryPath ; } public void setMessage ( String string ) { } public void setFilterPath ( String string ) { } }

Fix:
application . beginSheet ( panel , view . window ( ) , null , 0 , 0 ) ;
Buggy code:
public class ProbModelsHandler implements Serializable { static final long serialVersionUID = - 4813820170237218194L ; ProbModelBasicCreator m_probModelInitializer ; private List < Attribute > m_attributesToBuildFrom ; private int [ ] m_attributesToBuildFromIndexes ; private boolean m_built ; private Map < Attribute , Classifier > m_probabilisticModels ; private void initializeAttributesIndexes ( ) { } public ProbModelsHandler ( List < Attribute > attributesToBuildFrom , ProbModelBasicCreator probModelInitializer ) { } public ProbModelsHandler ( List < Attribute > attributesToBuildFrom ) { } private Remove getRemoveFilter ( ) { } private void buildModelsEx ( Instances instances ) throws Exception { } public void buildModels ( Instances instances ) throws Exception { } public double calculateLValueForSingleInstance ( Instance currentInstance ) throws Exception { } private double calculateLValueForSingleInstanceEx ( Instances allInstances , Instance currentInstance ) throws Exception { double toReturn = 0 ; if ( ! ( this . m_built ) ) { this . buildModels ( allInstances ) ; } for ( Map . Entry < Attribute , Classifier > entry : this . m_probabilisticModels . entrySet ( ) ) { Attribute currentAttribute = entry . getKey ( ) ; Classifier currentClassifier = entry . getValue ( ) ; allInstances . setClass ( currentAttribute ) ; double [ ] dist = currentClassifier . distributionForInstance ( currentInstance ) ; System . out . println ( ( ( "********<seq2seq4repair_space>dist<seq2seq4repair_space>is<seq2seq4repair_space>" + ( Arrays . toString ( dist ) ) ) + "********<seq2seq4repair_space>" ) ) ; System . out . println ( Arrays . toString ( dist ) ) ; System . out . println ( currentAttribute ) ; System . out . println ( currentInstance ) ; System . out . println ( currentAttribute . index ( ) ) ; System . out . println ( currentInstance . stringValue ( currentAttribute ) ) ; int valueIndex = currentAttribute . indexOfValue ( currentInstance . stringValue ( currentAttribute ) ) ; toReturn += Math . log10 ( dist [ valueIndex ] ) ; } <START_BUG> return Math . abs ( toReturn ) ; <END_BUG> } public double calculateLValueForSingleInstance ( Instances allInstances , Instance currentInstance ) throws Exception { } }

Fix:
return toReturn ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class SessionConnectedEvent extends ApplicationEvent { private final Message < byte [ ] > message ; public SessionConnectedEvent ( Object source , Message < byte [ ] > message ) { } public Message < byte [ ] > getMessage ( ) { } @ Override public String toString ( ) { <START_BUG> return "SessionConnectedEvent:<seq2seq4repair_space>message=" + ( message ) ; <END_BUG> } }

Fix:
return "SessionConnectedEvent" + ( this . message ) ;
Buggy code:
public class TestSolrXMLSerializer extends LuceneTestCase { private static final XPathFactory xpathFactory = XPathFactory . newInstance ( ) ; private static final String defaultCoreNameKey = "defaultCoreName" ; private static final String defaultCoreNameVal = "collection1" ; private static final String peristentKey = "persistent" ; private static final String persistentVal = "true" ; private static final String sharedLibKey = "sharedLib" ; private static final String sharedLibVal = "true" ; private static final String adminPathKey = "adminPath" ; private static final String adminPathVal = "//admin" ; private static final String shareSchemaKey = "admin" ; private static final String shareSchemaVal = "true" ; private static final String instanceDirKey = "instanceDir" ; private static final String instanceDirVal = "core1" ; @ Test public void basicUsageTest ( ) throws Exception { SolrXMLSerializer serializer = new SolrXMLSerializer ( ) ; SolrXMLDef solrXMLDef = getTestSolrXMLDef ( TestSolrXMLSerializer . defaultCoreNameKey , TestSolrXMLSerializer . defaultCoreNameVal , TestSolrXMLSerializer . peristentKey , TestSolrXMLSerializer . persistentVal , TestSolrXMLSerializer . sharedLibKey , TestSolrXMLSerializer . sharedLibVal , TestSolrXMLSerializer . adminPathKey , TestSolrXMLSerializer . adminPathVal , TestSolrXMLSerializer . shareSchemaKey , TestSolrXMLSerializer . shareSchemaVal , TestSolrXMLSerializer . instanceDirKey , TestSolrXMLSerializer . instanceDirVal ) ; Writer w = new StringWriter ( ) ; try { serializer . persist ( w , solrXMLDef ) ; } finally { w . close ( ) ; } assertResults ( ( ( StringWriter ) ( w ) ) . getBuffer ( ) . toString ( ) . getBytes ( "UTF-8" ) ) ; <START_BUG> File tmpFile = _TestUtil . getTempDir ( "solr.xml" ) ; <END_BUG> serializer . persistFile ( tmpFile , solrXMLDef ) ; assertResults ( FileUtils . readFileToString ( tmpFile , "UTF-8" ) . getBytes ( "UTF-8" ) ) ; tmpFile . delete ( ) ; } private void assertResults ( byte [ ] bytes ) throws IOException , ParserConfigurationException , XPathExpressionException , SAXException { } private SolrXMLDef getTestSolrXMLDef ( String defaultCoreNameKey , String defaultCoreNameVal , String peristentKey , String persistentVal , String sharedLibKey , String sharedLibVal , String adminPathKey , String adminPathVal , String shareSchemaKey , String shareSchemaVal , String instanceDirKey , String instanceDirVal ) { } public static boolean exists ( String xpathStr , Node node ) throws XPathExpressionException { } }

Fix:
File tmpFile = _TestUtil . createTempFile ( "solr.xml" , null , TEMP_DIR ) ;
Buggy code:
@ Repository public class WithdrawRequestDetailDaoImpl extends AbstractBaseDaoImpl < WithdrawRequestDetail > implements WithdrawRequestDetailDao { @ Override public List < WithdrawRequestDetail > getWithdrawRequestList ( ) throws UserException { } @ Override public List < WithdrawRequestDetailDto > getWithdrawRequestList ( final WithdrawRequestDetailDto withdrawRequestDetailDto , final PaginationDataDTO paginationDataDto , final String associatedCycles ) throws UserException { } @ Override public int withdrawRequestCountForUser ( final String firstName , final String lastName , final Date dob , final GdeUser user ) { } @ Override public String findWithdrawlUserReason ( final long userId ) { <START_BUG> StringBuffer queryString = new StringBuffer ( "select<seq2seq4repair_space>withdraw_reason<seq2seq4repair_space>from<seq2seq4repair_space>withdraw_request_details" ) . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>user_id<seq2seq4repair_space>=" ) . append ( userId ) . append ( "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>id<seq2seq4repair_space>asc" ) . append ( userId ) ; <END_BUG> Query query = this . createQuery ( queryString . toString ( ) , true ) ; List < Object > list = query . getResultList ( ) ; if ( ! ( CollectionUtils . isEmpty ( list ) ) ) { return list . get ( ( ( list . size ( ) ) - 1 ) ) . toString ( ) ; } else { return "" ; } } }

Fix:
StringBuffer queryString = new StringBuffer ( "select<seq2seq4repair_space>withdraw_reason<seq2seq4repair_space>from<seq2seq4repair_space>withdraw_request_details" ) . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>user_id<seq2seq4repair_space>=" ) . append ( userId ) . append ( "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>id<seq2seq4repair_space>asc" ) ;
Buggy code:
public class ShellSpout implements ISpout { public static Logger LOG = LoggerFactory . getLogger ( ShellSpout . class ) ; private SpoutOutputCollector _collector ; private String [ ] _command ; private ShellProcess _process ; private TopologyContext _context ; private SpoutMsg _spoutMsg ; public ShellSpout ( ShellComponent component ) { } public ShellSpout ( String ... command ) { } public void open ( Map stormConf , TopologyContext context , SpoutOutputCollector collector ) { } public void close ( ) { } public void nextTuple ( ) { } public void ack ( Object msgId ) { } public void fail ( Object msgId ) { } private void handleMetrics ( ShellMsg shellMsg ) { String name = shellMsg . getMetricName ( ) ; if ( name . isEmpty ( ) ) { throw new RuntimeException ( "Receive<seq2seq4repair_space>Metrics<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ; } IMetric iMetric = _context . getRegisteredMetricByName ( name ) ; if ( iMetric == null ) { <START_BUG> throw new RuntimeException ( ( ( "Not<seq2seq4repair_space>find<seq2seq4repair_space>metric<seq2seq4repair_space>by<seq2seq4repair_space>name[" + name ) + "]<seq2seq4repair_space>" ) ) ; <END_BUG> } if ( ! ( iMetric instanceof IShellMetric ) ) { throw new RuntimeException ( ( ( "Metric[" + name ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>IShellMetric,<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>call<seq2seq4repair_space>by<seq2seq4repair_space>RPC" ) ) ; } IShellMetric iShellMetric = ( ( IShellMetric ) ( iMetric ) ) ; Object paramsObj = shellMsg . getMetricParams ( ) ; try { iShellMetric . updateMetricFromRPC ( paramsObj ) ; } catch ( RuntimeException re ) { throw re ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } private void querySubprocess ( ) { } @ Override public void activate ( ) { } @ Override public void deactivate ( ) { } }

Fix:
throw new RuntimeException ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>metric<seq2seq4repair_space>by<seq2seq4repair_space>name[" + name ) + "]<seq2seq4repair_space>" ) ) ;
Buggy code:
public class MPAct { private String mpId ; private String nickName ; private String appId ; private String appSecert ; private String token ; private String AESKey ; private String mpType ; private boolean pass ; private String accessToken ; private long expiresIn ; private String preAuthCode ; private long preAuthExpiresIn ; public String getMpId ( ) { } public void setMpId ( String mpId ) { } public String getNickName ( ) { } public void setNickName ( String nickName ) { } public String getAppId ( ) { } public void setAppId ( String appId ) { } public String getAppSecert ( ) { } public void setAppSecert ( String appSecert ) { } public String getToken ( ) { } public void setToken ( String token ) { } public String getAESKey ( ) { } public void setAESKey ( String AESKey ) { } public String getMpType ( ) { } public void setMpType ( String mpType ) { } public boolean isPass ( ) { } public void setPass ( boolean pass ) { } public String getAccessToken ( ) { } public void setAccessToken ( String accessToken ) { } public long getExpiresIn ( ) { } public void setExpiresIn ( long expiresIn ) { } public void createAccessToken ( String result ) { JSONObject tmp = JSON . parseObject ( result ) ; <START_BUG> if ( result . contains ( "accessToken" ) ) { <END_BUG> setAccessToken ( tmp . getString ( "access_token" ) ) ; } else { setAccessToken ( tmp . getString ( "component_access_token" ) ) ; } setExpiresIn ( ( ( ( tmp . getLong ( "expires_in" ) ) - 60 ) * 1000 ) ) ; } public String getPreAuthCode ( ) { } public void setPreAuthCode ( String preAuthCode ) { } public long getPreAuthExpiresIn ( ) { } public void setPreAuthExpiresIn ( long preAuthExpiresIn ) { } public void createPreAuthCode ( String result ) { } @ Override public String toString ( ) { } }

Fix:
if ( result . contains ( "access_token" ) ) {
Buggy code:
public class Server { public static final int STARTKARTEN = 7 ; private Karte offen ; private ArrayList < Karte > verdeckt ; private Spieler [ ] spieler ; private int spielerzahl ; private int richtung ; private int aktuellerSpielerIndex ; public int neueFarbe ; private int alterSpielerIndex ; private String servername ; private ServerListener listener ; private MoepServer serverVerwaltung ; public Server ( String _servername , MoepServer _serverVerwaltung ) { } private ArrayList < Karte > kartenSet ( ) { } public void spielerHinzufuegen ( Spieler neu , int position ) { } public void spielerEntfernen ( Spieler entf ) { for ( int i = 0 ; i < 4 ; i ++ ) { <START_BUG> if ( spieler [ i ] . spielername . equals ( entf . spielername ) ) { <END_BUG> spieler [ i ] = null ; ( spielerzahl ) -- ; } } MoepLogger . log ( Level . INFO , ( ( ( ( ( "[" + ( servername ) ) + "]<seq2seq4repair_space>" ) + "Spieler<seq2seq4repair_space>" ) + ( entf . spielername ) ) + "<seq2seq4repair_space>wurde<seq2seq4repair_space>vom<seq2seq4repair_space>Server<seq2seq4repair_space>entfernt" ) ) ; for ( int i = 0 ; i < 4 ; i ++ ) { if ( ( spieler [ i ] ) != null ) { spieler [ i ] . spielerServerAktion ( entf . spielername , 1 , 0 , i ) ; spieler [ i ] . amZug ( false ) ; kartenzahlUpdate ( spieler [ i ] ) ; spieler [ i ] . textSenden ( ( ( "Spieler<seq2seq4repair_space>" + ( entf . spielername ) ) + "<seq2seq4repair_space>hat<seq2seq4repair_space>das<seq2seq4repair_space>Spiel<seq2seq4repair_space>verlassen" ) ) ; spieler [ i ] . textSenden ( "Das<seq2seq4repair_space>Spiel<seq2seq4repair_space>wurde<seq2seq4repair_space>beendet" ) ; spieler [ i ] . textSenden ( "Spielneustart,<seq2seq4repair_space>sobald<seq2seq4repair_space>wieder<seq2seq4repair_space>4<seq2seq4repair_space>Spieler<seq2seq4repair_space>online<seq2seq4repair_space>sind" ) ; spieler [ i ] . spielEnde ( false ) ; } } spielBeenden ( ) ; } public void spielGewonnen ( Spieler p ) { } private void deckeErsteKarteAuf ( ) { } public Karte gibOffen ( ) { } public Karte gibZufaelligeKarte ( ) { } public Spieler [ ] gibSpieler ( ) { } public Spieler gibAktuellenSpieler ( ) { } private void erzeugeHand ( Spieler sp ) { } private boolean kannGelegtWerdenAuf ( Karte legen , Karte liegt ) { } protected void karteZiehenEvent ( ) { } protected void spielerzugEvent ( Karte karte ) { } protected void moep ( Spieler s ) { } private String karteZuMeldung ( Karte karte ) { } public void broadcast ( String text ) { } private void spielBeenden ( ) { } private String intZuFarbe ( int farbeInt ) { } private void kartenzahlUpdate ( Spieler sp ) { } public void beenden ( ) { } private boolean spielernameVorhanden ( String name ) { } public boolean istVoll ( ) { } }

Fix:
if ( ( spieler [ i ] . spielername ) == ( entf . spielername ) ) {
Buggy code:
@ Service ( "eventService" ) @ Transactional public class MyBatisEventService implements EventService { private static final Logger LOGGER = LogManager . getLogger ( ) ; @ Inject private EventDao eventDao ; @ Override public void addEvent ( Event event ) { } @ Override public Event getEvent ( int id ) { } @ Override public List < Event > getAllEvents ( ) { } @ Override public void assignUserToEvent ( User user , Event event ) { } @ Override public void unassignUserFromEvent ( User user , Event event , Date unassignDate , String unassignReason ) { } @ Override public List < Event > getEventsByUser ( User user ) { } @ Override public Event getFutureEvent ( int eventId ) { Event event = getEvent ( eventId ) ; <START_BUG> if ( ! ( new Date ( ) . after ( event . getEventDate ( ) ) ) ) { <END_BUG> String message = String . format ( "Try<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>event<seq2seq4repair_space>id=%s<seq2seq4repair_space>with<seq2seq4repair_space>date<seq2seq4repair_space>%s<seq2seq4repair_space>as<seq2seq4repair_space>future<seq2seq4repair_space>event" , eventId , event . getEventDate ( ) . toString ( ) ) ; MyBatisEventService . LOGGER . error ( message ) ; throw new TimeCollisionServiceException ( message ) ; } return event ; } @ Override public List < Event > getFilteredEvents ( Filter filter ) { } @ Override public List < Event > getFilteredEventsWithRating ( Filter filter ) { } private boolean isAssigned ( User user , Event event ) { } No newline ; at end ; of file ; }

Fix:
if ( ! ( event . getEventDate ( ) . after ( new Date ( ) ) ) ) {
Buggy code:
@ Component public class ScheduleTasks { @ Autowired private PollsRepository pollrepo ; @ Autowired private ModeratorsRepository modrepo ; @ Scheduled ( fixedRate = 50000 ) public void pollLookUp ( ) { String expiryDate = null ; System . out . println ( "Scheduler<seq2seq4repair_space>Started!!" ) ; if ( ( ( modrepo ) != null ) && ( ( pollrepo ) != null ) ) { System . out . println ( "Inside<seq2seq4repair_space>if<seq2seq4repair_space>condition" ) ; List poll_list = pollrepo . findAll ( ) ; List mod_list = modrepo . findAll ( ) ; for ( int count = 0 ; count < ( poll_list . size ( ) ) ; count ++ ) { DateFormat date = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.ms'Z'" ) ; String currentDate = date . format ( new Date ( ) ) ; Polls p_handle = ( ( Polls ) ( poll_list . get ( count ) ) ) ; expiryDate = p_handle . getExpired_at ( ) ; if ( ! ( p_handle . isPollClosed ( ) ) ) { try { Date currentTime = date . parse ( currentDate ) ; Date expiryTime = date . parse ( expiryDate ) ; if ( currentTime . after ( expiryTime ) ) { System . out . println ( ( ( "Mod<seq2seq4repair_space>ID:" + ( p_handle . getModerator_id ( ) ) ) + "---><seq2seq4repair_space>Poll<seq2seq4repair_space>Expired!!!<---" ) ) ; for ( int mod_count = 0 ; mod_count < ( mod_list . size ( ) ) ; mod_count ++ ) { String mod_email = null ; String poll_result = null ; Moderators m_handle = ( ( Moderators ) ( mod_list . get ( mod_count ) ) ) ; if ( m_handle . getId ( ) . equals ( p_handle . getModerator_id ( ) ) ) { mod_email = m_handle . getEmail ( ) ; Integer [ ] result = p_handle . getResults ( ) ; StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( "Poll<seq2seq4repair_space>Result<seq2seq4repair_space>[" ) ; for ( int i = 0 ; i < ( p_handle . getChoice ( ) . length ) ; i ++ ) { if ( i == ( ( p_handle . getChoice ( ) . length ) - 1 ) ) { stringBuilder . append ( p_handle . getChoice ( ) [ i ] ) ; stringBuilder . append ( "=" ) ; stringBuilder . append ( p_handle . getResults ( ) [ i ] ) ; } else { stringBuilder . append ( p_handle . getChoice ( ) [ i ] ) ; stringBuilder . append ( "=" ) ; stringBuilder . append ( p_handle . getResults ( ) [ i ] ) ; stringBuilder . append ( "," ) ; } } stringBuilder . append ( "]" ) ; poll_result = stringBuilder . toString ( ) ; System . out . println ( ( ( mod_email + ":010052224:" ) + poll_result ) ) ; <START_BUG> SimpleProducer producer = null ; <END_BUG> producer . sendEmail ( mod_email , poll_result ) ; } } p_handle . setPollClosed ( true ) ; pollrepo . save ( p_handle ) ; } } catch ( ParseException e ) { e . printStackTrace ( ) ; } } } } } }

Fix:
SimpleProducer producer = new SimpleProducer ( ) ;
Buggy code:
class NewWebSubsystemAdd implements ModelAddOperationHandler , BootOperationHandler { static final NewWebSubsystemAdd INSTANCE = new NewWebSubsystemAdd ( ) ; private static final String DEFAULT_HOST = "localhost" ; private NewWebSubsystemAdd ( ) { } public Cancellable execute ( NewOperationContext updateContext , ModelNode operation , ResultHandler resultHandler ) { final ModelNode config = operation . get ( REQUEST_PROPERTIES , CONTAINER_CONFIG ) ; final ModelNode compensatingOperation = new ModelNode ( ) ; compensatingOperation . get ( OP ) . set ( REMOVE ) ; compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; if ( updateContext instanceof NewBootOperationContext ) { final NewBootOperationContext ctx = ( ( NewBootOperationContext ) ( updateContext ) ) ; final String defaultHost = ( operation . get ( REQUEST_PROPERTIES ) . has ( CommonAttributes . DEFAULT_HOST ) ) ? operation . get ( REQUEST_PROPERTIES ) . get ( CommonAttributes . DEFAULT_HOST ) . asString ( ) : NewWebSubsystemAdd . DEFAULT_HOST ; final NewSharedWebMetaDataBuilder sharedWebBuilder = new NewSharedWebMetaDataBuilder ( config . clone ( ) ) ; final NewSharedTldsMetaDataBuilder sharedTldsBuilder = new NewSharedTldsMetaDataBuilder ( config . clone ( ) ) ; ctx . addDeploymentProcessor ( STRUCTURE , STRUCTURE_WAR_DEPLOYMENT_INIT , new WarDeploymentInitializingProcessor ( ) ) ; <START_BUG> ctx . addDeploymentProcessor ( STRUCTURE , STRUCTURE_WAR_DEPLOYMENT , new org . jboss . as . web . deployment . WarStructureDeploymentProcessor ( sharedWebBuilder . create ( ) , sharedTldsBuilder . create ( ) ) ) ; <END_BUG> ctx . addDeploymentProcessor ( PARSE , PARSE_WEB_DEPLOYMENT , new WebParsingDeploymentProcessor ( ) ) ; ctx . addDeploymentProcessor ( PARSE , PARSE_WEB_DEPLOYMENT_FRAGMENT , new WebFragmentParsingDeploymentProcessor ( ) ) ; ctx . addDeploymentProcessor ( PARSE , PARSE_JBOSS_WEB_DEPLOYMENT , new JBossWebParsingDeploymentProcessor ( ) ) ; ctx . addDeploymentProcessor ( PARSE , PARSE_TLD_DEPLOYMENT , new TldParsingDeploymentProcessor ( ) ) ; ctx . addDeploymentProcessor ( DEPENDENCIES , DEPENDENCIES_WAR_MODULE , new WarClassloadingDependencyProcessor ( ) ) ; ctx . addDeploymentProcessor ( POST_MODULE , POST_MODULE_ANNOTATION_WAR , new WarAnnotationDeploymentProcessor ( ) ) ; ctx . addDeploymentProcessor ( INSTALL , INSTALL_SERVLET_INIT_DEPLOYMENT , new ServletContainerInitializerDeploymentProcessor ( ) ) ; ctx . addDeploymentProcessor ( INSTALL , INSTALL_WAR_METADATA , new WarMetaDataProcessor ( ) ) ; ctx . addDeploymentProcessor ( INSTALL , INSTALL_WAR_DEPLOYMENT , new WarDeploymentProcessor ( defaultHost ) ) ; } updateContext . getSubModel ( ) . get ( CONTAINER_CONFIG ) . set ( config ) ; resultHandler . handleResultComplete ( compensatingOperation ) ; return Cancellable . NULL ; } }

Fix:
ctx . addDeploymentProcessor ( STRUCTURE , STRUCTURE_WAR , new org . jboss . as . web . deployment . WarStructureDeploymentProcessor ( sharedWebBuilder . create ( ) , sharedTldsBuilder . create ( ) ) ) ;
Buggy code:
public abstract class SignInPanel extends Panel { private TextField username ; private PasswordTextField password ; public SignInPanel ( String componentName ) { } public String getUsername ( ) { } public String getPassword ( ) { } public void setPersistent ( boolean enable ) { } public abstract String signIn ( final RequestCycle cycle , final String username , final String password ) { } public final class SignInForm extends Form { private static final long serialVersionUID = 303695648327317416L ; private final ValueMap properties = new ValueMap ( ) ; public SignInForm ( final String componentName , final IValidationErrorHandler feedback ) { } public final void handleSubmit ( final RequestCycle cycle ) { final String error = signIn ( cycle , getUsername ( ) , getPassword ( ) ) ; if ( error == null ) { if ( cycle . continueToOriginalDestination ( ) ) { cycle . setPage ( ( ( Page ) ( null ) ) ) ; } else { cycle . setPage ( getApplicationSettings ( ) . getPageFactory ( ) . newPage ( getApplicationSettings ( ) . getHomePage ( ) ) ) ; } } else { <START_BUG> handleError ( new ValidationErrorMessage ( null , this , error ) ) ; <END_BUG> } } } }

Fix:
handleError ( new ValidationErrorMessage ( this , error ) ) ;
Buggy code:
public class FileMaker { private int id = 0 ; public FileMaker ( ) { } public File createFile ( int id ) { } public File getTempFile ( ) { } private File getOutputMediaFile ( ) { } private File getDir ( ) { } private String fileNameFromId ( ) { } public int getNextId ( ) { <START_BUG> return ++ ( id ) ; <END_BUG> } }

Fix:
return ( id ) ++ ;
Buggy code:
public class DeclarationOfReferencedTypesPattern extends TypeReferencePattern { HashSet knownTypes ; IJavaElement enclosingElement ; public DeclarationOfReferencedTypesPattern ( IJavaElement enclosingElement ) { } protected void matchReportImportRef ( ImportReference importRef , Binding binding , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { if ( accuracy == ( IJavaSearchResultCollector . POTENTIAL_MATCH ) ) return ; while ( ( element != null ) && ( ! ( this . enclosingElement . equals ( element ) ) ) ) { element = element . getParent ( ) ; } if ( element == null ) return ; int maxType = - 1 ; TypeBinding typeBinding = null ; if ( reference instanceof TypeReference ) { <START_BUG> typeBinding = ( ( TypeReference ) ( reference ) ) . binding ; <END_BUG> maxType = Integer . MAX_VALUE ; } else if ( reference instanceof QualifiedNameReference ) { QualifiedNameReference qNameRef = ( ( QualifiedNameReference ) ( reference ) ) ; Binding binding = qNameRef . binding ; maxType = ( qNameRef . tokens . length ) - 1 ; switch ( ( qNameRef . bits ) & ( AstNode . RestrictiveFlagMASK ) ) { case BindingIds . FIELD : typeBinding = qNameRef . actualReceiverType ; int otherBindingsCount = ( ( qNameRef . otherBindings ) == null ) ? 0 : qNameRef . otherBindings . length ; maxType -= otherBindingsCount + 1 ; break ; case BindingIds . TYPE : typeBinding = ( ( TypeBinding ) ( binding ) ) ; break ; case BindingIds . VARIABLE : case ( BindingIds . TYPE ) | ( BindingIds . VARIABLE ) : if ( binding instanceof ProblemBinding ) { ProblemBinding pbBinding = ( ( ProblemBinding ) ( binding ) ) ; typeBinding = pbBinding . searchType ; char [ ] partialQualifiedName = pbBinding . name ; maxType = ( CharOperation . occurencesOf ( '.' , partialQualifiedName ) ) - 1 ; if ( ( typeBinding == null ) || ( maxType < 0 ) ) return ; } break ; } } else if ( reference instanceof SingleNameReference ) { typeBinding = ( ( TypeBinding ) ( ( ( SingleNameReference ) ( reference ) ) . binding ) ) ; maxType = 1 ; } if ( ( typeBinding == null ) || ( typeBinding instanceof BaseTypeBinding ) ) return ; if ( typeBinding instanceof ArrayBinding ) { typeBinding = ( ( ArrayBinding ) ( typeBinding ) ) . leafComponentType ; } this . reportDeclaration ( typeBinding , maxType , locator ) ; } private void reportDeclaration ( TypeBinding typeBinding , int maxType , MatchLocator locator ) throws CoreException { } }

Fix:
typeBinding = ( ( TypeReference ) ( reference ) ) . resolvedType ;
Buggy code:
@ RunWith ( Arquillian . class ) public class CollectionsBeansTestCase { @ Deployment ( name = "collections-beans" ) public static JavaArchive getCycleBeansJar ( ) { JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "collections-beans.jar" ) ; archive . addPackage ( TFactory . class . getPackage ( ) ) ; <START_BUG> archive . addAsManifestResource ( "pojo//collections-jboss-beans.xml" , "collections-jboss-beans.xml" ) ; <END_BUG> return archive ; } @ Test @ OperateOnDeployment ( "collections-beans" ) public void testCycleBeans ( ) throws Exception { } }

Fix:
archive . addAsManifestResource ( CollectionsBeansTestCase . class . getPackage ( ) , "collections-jboss-beans.xml" , "collections-jboss-beans.xml" ) ;
Buggy code:
@ Getter public class TimedPeriods implements Serializable { private final class CompareByStartDate implements Serializable , Comparator < TimedPeriod > { private static final long serialVersionUID = 2437492556492244229L ; @ Override public int compare ( TimedPeriod thiz , TimedPeriod that ) { } } private static final long serialVersionUID = 1306367033533807140L ; private static final String FILE_NAME = "periods.dat" ; @ Setter private int defaultHoursPerDay ; private SortedSet < TimedPeriod > periods ; public TimedPeriods ( ) { } public static TimedPeriods readOrCreate ( ) { } public void save ( ) { } public boolean add ( TimedPeriod period ) { } private boolean validatePeriods ( ) { } public boolean remove ( Integer i ) { try { <START_BUG> periods . remove ( CollectionUtils . get ( periods , i ) ) ; <END_BUG> return true ; } catch ( ArrayIndexOutOfBoundsException ex ) { return false ; } } }

Fix:
CollectionUtils . remove ( periods , i ) ;
Buggy code:
public class Native2Ascii extends MatchingTask { private boolean reverse = false ; private String encoding = null ; private File srcDir = null ; private File destDir = null ; private String extension = null ; private Mapper mapper ; public void setDest ( File destDir ) { } public void setEncoding ( String encoding ) { } public void setExt ( String ext ) { } public void setReverse ( boolean reverse ) { } public void setSrc ( File srcDir ) { } public Mapper createMapper ( ) throws TaskException { if ( ( mapper ) != null ) { throw new TaskException ( "Cannot<seq2seq4repair_space>define<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>mapper" ) ; } <START_BUG> mapper = new Mapper ( getProject ( ) ) ; <END_BUG> return mapper ; } public void execute ( ) throws TaskException { } private void convert ( String srcName , String destName ) throws TaskException { } private class ExtMapper implements FileNameMapper { public void setFrom ( String s ) { } public void setTo ( String s ) { } public String [ ] mapFileName ( String fileName ) { } } }

Fix:
mapper = new Mapper ( ) ;
Buggy code:
public class TempFile extends Task { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private String property ; private File destDir = null ; private String prefix ; private String suffix = "" ; private boolean deleteOnExit ; private boolean createFile ; public void setProperty ( String property ) { } public void setDestDir ( File destDir ) { } public void setPrefix ( String prefix ) { } public void setSuffix ( String suffix ) { } public void setDeleteOnExit ( boolean deleteOnExit ) { } public boolean isDeleteOnExit ( ) { } public void setCreateFile ( boolean createFile ) { <START_BUG> this . createFile = deleteOnExit ; <END_BUG> } public boolean isCreateFile ( ) { } public void execute ( ) throws BuildException { } }

Fix:
this . createFile = createFile ;
Buggy code:
public class GameBrowserHelper { public static Game createGame ( CreateGameRequest request ) { } public static GameLobby getGameList ( GetGameListinLobbyRequest request ) { } public static String deleteGame ( DeleteGameRequest request ) { } public static AddPlayerResponse addPlayertoGame ( AddPlayerRequest request ) { } public static String removePlayerFromGame ( RemovePlayerRequest request ) { } public static ArrayList < Player > getPlayersinGame ( GetPlayersinGameRequest request ) { } public static String launchGame ( LaunchGameRequest request ) { } public static ArrayList < Card > getCards ( GetCardsRequest request ) { } public static GetSingleCardResponse getNextCardFromDeck ( GetNextCardFromDeckRequest request ) { GetSingleCardResponse response = new GetSingleCardResponse ( ) ; GameLobby lobby = RummyArena . getInstance ( ) . getLobby ( request . getLobbyName ( ) ) ; Game game = UtilityHelper . getGamefromLobby ( lobby , request . getGameInstanceID ( ) , request . getGameType ( ) ) ; Card card = game . getCurrentGameRound ( ) . getNextCardFromDeck ( ) ; response . setCard ( card ) ; <START_BUG> response . setCard ( card ) ; <END_BUG> response . setCardtype ( CARDTYPE_NEXTFROMDECK ) ; return response ; } public static GetSingleCardResponse getJokerForGame ( GetJokerRequest request ) { } public static GetSingleCardResponse getOpenCard ( GetOpenCardRequest request ) { } }

Fix:
response . setAvaialble ( true ) ;
Buggy code:
@ Service public class ConceptStats implements IConceptStats { private String conceptId ; private String description ; private String lemma ; private Integer count ; public ConceptStats ( String conceptId , String description , String lemma , Integer count ) { } public ConceptStats ( ) { } @ Override public Integer getCount ( ) { } @ Override public void setCount ( Integer count ) { } @ Override public String getConceptId ( ) { } @ Override public void setConceptId ( String conceptId ) { } @ Override public String getDescription ( ) { } @ Override public void setDescription ( String description ) { } @ Override public String getLemma ( ) { } @ Override public void setLemma ( String lemma ) { } @ Override public boolean equals ( Object obj ) { } @ Override public List < IConceptStats > getSortedList ( List < IConceptStats > csList ) { Collections . sort ( csList , new Comparator < IConceptStats > ( ) { public int compare ( IConceptStats o1 , IConceptStats o2 ) { if ( ( o1 . getCount ( ) ) == ( o2 . getCount ( ) ) ) return 0 ; <START_BUG> return ( o1 . getCount ( ) ) < ( o2 . getCount ( ) ) ? - 1 : 1 ; <END_BUG> } } ) ; return csList ; } }

Fix:
return ( o1 . getCount ( ) ) < ( o2 . getCount ( ) ) ? 1 : - 1 ;
Buggy code:
public class QualifiedThisReference extends ThisReference { public TypeReference qualification ; ReferenceBinding currentCompatibleType ; public QualifiedThisReference ( TypeReference name , int pos , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } protected boolean checkAccess ( MethodScope methodScope , TypeBinding targetType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; TypeBinding qualificationTb = qualification . resolveType ( scope ) ; if ( qualificationTb == null ) return null ; int depth = 0 ; currentCompatibleType = scope . referenceType ( ) . binding ; while ( ( ( currentCompatibleType ) != null ) && ( ( currentCompatibleType ) != qualificationTb ) ) { depth ++ ; currentCompatibleType = ( currentCompatibleType . isStatic ( ) ) ? null : currentCompatibleType . enclosingType ( ) ; } bits &= ~ ( ASTNode . DepthMASK ) ; bits |= ( depth & 255 ) << ( ASTNode . DepthSHIFT ) ; if ( ( currentCompatibleType ) == null ) { scope . problemReporter ( ) . incorrectEnclosingInstanceReference ( this , qualificationTb ) ; return null ; } if ( depth == 0 ) { if ( ! ( checkAccess ( scope . methodScope ( ) , qualificationTb ) ) ) return null ; } else { MethodScope methodScope = scope . methodScope ( ) ; while ( methodScope != null ) { if ( ( methodScope . enclosingSourceType ( ) ) == ( currentCompatibleType ) ) { if ( ! ( this . checkAccess ( methodScope , qualificationTb ) ) ) return null ; break ; } methodScope = methodScope . parent . methodScope ( ) ; } } <START_BUG> return qualificationTb ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . expressionType = qualificationTb ;
Buggy code:
public class StrTokenizerTest extends TestCase { private static final String CSV_SIMPLE_FIXTURE = "A,b,c" ; private static final String TSV_SIMPLE_FIXTURE = "A\tb\tc" ; public static void main ( String [ ] args ) { } public static Test suite ( ) { } public StrTokenizerTest ( String name ) { } private void checkClone ( StrTokenizer tokenizer ) { } public void test1 ( ) { } public void test2 ( ) { } public void test3 ( ) { } public void test4 ( ) { } public void test5 ( ) { } public void test6 ( ) { } public void test7 ( ) { } public void test8 ( ) { } public void testBasic1 ( ) { } public void testBasic2 ( ) { } public void testBasic3 ( ) { } public void testBasic4 ( ) { } public void testBasic5 ( ) { } public void testBasicDelim1 ( ) { } public void testBasicDelim2 ( ) { } public void testBasicEmpty1 ( ) { } public void testBasicEmpty2 ( ) { } public void testBasicQuoted1 ( ) { } public void testBasicQuoted2 ( ) { } public void testBasicQuoted3 ( ) { } public void testBasicQuoted4 ( ) { } public void testBasicQuoted5 ( ) { } public void testBasicQuoted6 ( ) { } public void testBasicQuoted7 ( ) { } public void testBasicQuotedTrimmed1 ( ) { } public void testBasicTrimmed1 ( ) { } public void testBasicTrimmed2 ( ) { } public void testBasicIgnoreTrimmed1 ( ) { } public void testBasicIgnoreTrimmed2 ( ) { } public void testBasicIgnoreTrimmed3 ( ) { } public void testBasicIgnoreTrimmed4 ( ) { } public void testCSV ( String data ) { } public void testCSVEmpty ( ) { } public void testCSVSimple ( ) { } public void testCSVSimpleNeedsTrim ( ) { } void testEmpty ( StrTokenizer tokenizer ) { } public void testGetContent ( ) { } public void testChaining ( ) { } public void testCloneNotSupportedException ( ) { Object notCloned = new StrTokenizer ( ) { <START_BUG> public Object cloneReset ( ) throws CloneNotSupportedException { <END_BUG> throw new CloneNotSupportedException ( "test" ) ; } } . clone ( ) ; assertNull ( notCloned ) ; } public void testCloneNull ( ) { } public void testCloneReset ( ) { } public void testConstructor_String ( ) { } public void testConstructor_String_char ( ) { } public void testConstructor_String_char_char ( ) { } public void testConstructor_charArray ( ) { } public void testConstructor_charArray_char ( ) { } public void testConstructor_charArray_char_char ( ) { } public void testReset ( ) { } public void testReset_String ( ) { } public void testReset_charArray ( ) { } public void testTSV ( ) { } public void testTSVEmpty ( ) { } void testXSVAbc ( StrTokenizer tokenizer ) { } public void testIteration ( ) { } }

Fix:
Object cloneReset ( ) throws CloneNotSupportedException {
Buggy code:
public final class FeaturesInitializer implements DataInitializer { private ContentService contentService ; private ExportService exportService ; private final Logger LOG = LoggerFactory . getLogger ( FeaturesInitializer . class ) ; @ Override public void initialize ( ) throws Exception { } private void logImport ( final NodeImportResult nodeImportResult ) { LOG . info ( "-------------------" ) ; LOG . info ( "Imported<seq2seq4repair_space>nodes:" ) ; <START_BUG> for ( final NodePath nodePath : nodeImportResult . getImportedNodes ( ) ) { <END_BUG> LOG . info ( nodePath . toString ( ) ) ; } LOG . info ( "-------------------" ) ; LOG . info ( "Binaries:" ) ; for ( final String binaryRef : nodeImportResult . getExportedBinaries ( ) ) { LOG . info ( binaryRef ) ; } LOG . info ( "-------------------" ) ; LOG . info ( "Errors:" ) ; for ( final NodeImportResult . ImportError importError : nodeImportResult . getImportErrors ( ) ) { LOG . info ( importError . getMessage ( ) , importError . getException ( ) ) ; } } private CreateContentParams makeFolder ( ) { } private boolean hasContent ( final ContentPath path ) { } @ SuppressWarnings ( "UnusedDeclaration" ) public void setExportService ( final ExportService exportService ) { } }

Fix:
for ( final NodePath nodePath : nodeImportResult . getAddedNodes ( ) ) {
Buggy code:
public class LoginFragment extends Fragment { MyFragmentManager fm = MyFragmentManager . getInstance ( ) ; Button loginButton ; Button registerButton ; public LoginFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View rootView = inflater . inflate ( fragment_login , container , false ) ; loginButton = ( ( Button ) ( rootView . findViewById ( R . id . loginButton ) ) ) ; registerButton = ( ( Button ) ( rootView . findViewById ( R . id . registerButton ) ) ) ; final EditText loginField = ( ( EditText ) ( rootView . findViewById ( loginField ) ) ) ; final EditText passwordField = ( ( EditText ) ( rootView . findViewById ( passwordField ) ) ) ; final CheckBox autologin = ( ( CheckBox ) ( rootView . findViewById ( autologinCheckBox ) ) ) ; final SettingsManager preferences = SettingsManager . getInstance ( ) ; final SettingsManager globalPreferences = new SettingsManager ( ) ; globalPreferences . init ( getActivity ( ) , "com.keepsolid.tuule.todolist_preferences" ) ; fm . init ( getActivity ( ) ) ; getActivity ( ) . setTitle ( "Login" ) ; if ( globalPreferences . getBoolean ( "autoLogin" ) ) { Fragment fragment_main = new MainFragment ( ) ; fm . insertFragment ( fragment_main , fragment_main , "firstFragment" ) ; } registerButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Fragment fragment_register = new RegisterFragment ( ) ; fm . insertFragment ( fragment_register , fragment_main , "fragment_register" ) ; } } ) ; loginButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( ( loginField . getText ( ) . toString ( ) . equals ( "" ) ) || ( passwordField . getText ( ) . toString ( ) . equals ( "" ) ) ) Toast . makeText ( getActivity ( ) , "Some<seq2seq4repair_space>fields<seq2seq4repair_space>are<seq2seq4repair_space>empty" , LENGTH_SHORT ) . show ( ) ; globalPreferences . commitString ( "currentUser" , loginField . getText ( ) . toString ( ) ) ; preferences . init ( getActivity ( ) , loginField . getText ( ) . toString ( ) ) ; if ( autologin . isChecked ( ) ) globalPreferences . commitBoolean ( "autoLogin" , true ) ; else globalPreferences . commitBoolean ( "autoLogin" , false ) ; <START_BUG> if ( preferences . getString ( "Password" ) . equals ( passwordField . getText ( ) . toString ( ) ) ) { <END_BUG> globalPreferences . commitString ( "currentUser" , loginField . getText ( ) . toString ( ) ) ; Fragment fragment_main = new MainFragment ( ) ; fm . insertFragment ( fragment_main , fragment_main , "firstFragment" ) ; } else { Toast . makeText ( getActivity ( ) , "Wrong<seq2seq4repair_space>username<seq2seq4repair_space>or<seq2seq4repair_space>password" , LENGTH_SHORT ) . show ( ) ; } } } ) ; return rootView ; } }

Fix:
if ( ( preferences . getString ( "Password" ) . equals ( passwordField . getText ( ) . toString ( ) ) ) & ( ! ( preferences . getString ( "Password" ) . equals ( "" ) ) ) ) {