nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Menu extends Table { public static String n = System . getProperty ( "line.separator" ) ; KeyTextButton [ ] entries ; int length ; private Skin skin ; public Menu ( Skin skin ) { } @ SuppressWarnings ( "rawtypes" ) @ Override public Cell add ( ) { } public Cell < KeyTextButton > add ( KeyTextButton entry ) { } public void updateMenu ( final PhilosopherGame game ) { entries = new KeyTextButton [ 6 ] ; reset ( ) ; for ( int i = 0 ; i < ( game . player . attacks . length ) ; i ++ ) { final int finali = i ; if ( ( game . player . attacks [ i ] ) != null ) { add ( new KeyTextButton ( game . player . attacks [ i ] . name , skin ) ) ; entries [ i ] . addListener ( new ChangeListener ( ) { @ Override public void changed ( ChangeEvent event , final Actor actor ) { game . fightscreen . menu . setVisible ( false ) ; game . fightscreen . infoText . setVisible ( true ) ; <START_BUG> game . fightscreen . handleAttack ( game . player . attacks [ finali ] ) ; <END_BUG> } } ) ; } else { add ( ) ; } } } }

Fix:
game . fightscreen . handleAttack ( game . player . attacks [ finali ] , game . opponent ) ;
Buggy code:
public class MenuItem extends Item { Menu parent ; Menu menu ; int id ; int accelerator ; static final int MARGIN_WIDTH = ( OS . IsWin95 ) ? 2 : 1 ; static final int MARGIN_HEIGHT = ( OS . IsWin95 ) ? 2 : 1 ; public MenuItem ( Menu parent , int style ) { } public MenuItem ( Menu parent , int style , int index ) { } MenuItem ( Menu parent , Menu menu , int style , int index ) { } public void addArmListener ( ArmListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } protected void checkSubclass ( ) { } static int checkStyle ( int style ) { } void fillAccel ( ACCEL accel ) { } void fixMenus ( Decorations newParent ) { } public int getAccelerator ( ) { } Rectangle getBounds ( ) { } public boolean getEnabled ( ) { } public Menu getMenu ( ) { } String getNameText ( ) { } public Menu getParent ( ) { } public boolean getSelection ( ) { } public boolean isEnabled ( ) { } void releaseChild ( ) { } void releaseMenu ( ) { } void releaseWidget ( ) { if ( ( menu ) != null ) menu . releaseResources ( ) ; menu = null ; super . releaseWidget ( ) ; <START_BUG> if ( ( ( accelerator ) != 0 ) && ( ( parent ) != null ) ) { <END_BUG> parent . destroyAccelerators ( ) ; } accelerator = 0 ; display . removeMenuItem ( this ) ; parent = null ; } public void removeArmListener ( ArmListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAccelerator ( int accelerator ) { } public void setEnabled ( boolean enabled ) { } public void setImage ( Image image ) { } public void setMenu ( Menu menu ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } int widgetStyle ( ) { } LRESULT wmCommandChild ( int wParam , int lParam ) { } LRESULT wmDrawChild ( int wParam , int lParam ) { } LRESULT wmMeasureChild ( int wParam , int lParam ) { } }

Fix:
if ( ( accelerator ) != 0 ) {
Buggy code:
public class CookieTest extends TestCase { private MockHttpApplication application ; private SignInPanel panel ; private Form form ; private Cookie cookieUsername ; private Cookie cookiePassword ; private Cookie [ ] cookies ; private HtmlPage page ; private HttpRequestCycle cycle ; public CookieTest ( String name ) { } protected void setUp ( ) throws Exception { } public void testSetCookieOnForm ( ) throws IOException , ServletException { } public void testSetCookieOnPage ( ) throws IOException , ServletException { } public void testPersistCookieWithPersistenceDisabled ( ) throws IOException , ServletException { } public void testPersistCookie ( ) throws IOException , ServletException { panel . setPersistent ( true ) ; this . form . formSubmitted ( cycle ) ; Collection cookies = application . getServletResponse ( ) . getCookies ( ) ; <START_BUG> Assert . assertEquals ( 2 , cookies . size ( ) ) ; <END_BUG> Iterator iter = cookies . iterator ( ) ; while ( iter . hasNext ( ) ) { Cookie cookie = ( ( Cookie ) ( iter . next ( ) ) ) ; Assert . assertNotNull ( page . get ( cookie . getName ( ) ) ) ; if ( ( page . get ( cookie . getName ( ) ) . getModelObjectAsString ( ) ) != "" ) { Assert . assertEquals ( cookie . getValue ( ) , page . get ( cookie . getName ( ) ) . getModelObjectAsString ( ) ) ; } } } public void testRemoveFromPage ( ) throws IOException , ServletException { } }

Fix:
Assert . assertEquals ( 4 , cookies . size ( ) ) ;
Buggy code:
public class EntityBeanComponentDescription extends EJBComponentDescription { private PersistenceType persistenceType ; private boolean reentrant ; private String primaryKeyType ; private String poolConfigName ; public EntityBeanComponentDescription ( final String componentName , final String componentClassName , final EjbJarDescription ejbJarDescription , final ServiceName deploymentUnitServiceName , final EntityBeanMetaData descriptorData ) { } protected void addRemoveInterceptor ( ) { } @ Override protected void addCurrentInvocationContextFactory ( ) { this . getConfigurators ( ) . add ( new ComponentConfigurator ( ) { @ Override public void configure ( DeploymentPhaseContext context , ComponentDescription description , ComponentConfiguration configuration ) throws DeploymentUnitProcessingException { configuration . addPostConstructInterceptor ( FACTORY , EJB_SESSION_CONTEXT_INTERCEPTOR ) ; configuration . addPreDestroyInterceptor ( FACTORY , InterceptorOrder . ComponentPreDestroy . EJB_SESSION_CONTEXT_INTERCEPTOR ) ; <START_BUG> configuration . getAllChainedContextHandleFactory ( ) . add ( INSTANCE ) ; <END_BUG> } } ) ; } @ Override protected void addCurrentInvocationContextFactory ( ViewDescription view ) { } @ Override public final ComponentConfiguration createConfiguration ( final ClassIndex classIndex , final ClassLoader moduleClassLoader , final ModuleLoader moduleLoader ) { } protected ComponentConfiguration createEntityBeanConfiguration ( final ClassIndex classIndex , final ClassLoader moduleClassLoader , final ModuleLoader moduleLoader ) { } @ Override protected void setupViewInterceptors ( EJBViewDescription view ) { } @ Override public boolean isEntity ( ) { } protected EntityBeanObjectViewConfigurator getObjectViewConfigurator ( ) { } protected EntityBeanHomeViewConfigurator getHomeViewConfigurator ( ) { } protected ViewInstanceFactory getRemoteViewInstanceFactory ( final String applicationName , final String moduleName , final String distinctName , final String componentName ) { } protected void addSynchronizationInterceptor ( ) { } protected InterceptorFactory getSynchronizationInterceptorFactory ( ) { } public String getPrimaryKeyType ( ) { } public void setPrimaryKeyType ( final String primaryKeyType ) { } public boolean isReentrant ( ) { } public void setReentrant ( final boolean reentrant ) { } public PersistenceType getPersistenceType ( ) { } public void setPersistenceType ( final PersistenceType persistenceType ) { } @ Override public boolean isTimerServiceApplicable ( ) { } public String getPoolConfigName ( ) { } public void setPoolConfigName ( final String poolConfigName ) { } private class ConfigInjectingConfigurator implements DependencyConfigurator < Service < Component > > { private final EntityBeanComponentDescription entityComponentDescription ; ConfigInjectingConfigurator ( final EntityBeanComponentDescription entityComponentDescription ) { } @ Override public void configureDependency ( ServiceBuilder < ? > serviceBuilder , Service < Component > service ) throws DeploymentUnitProcessingException { } } }

Fix:
configuration . getConcurrentContext ( ) . addFactory ( INSTANCE ) ;
Buggy code:
@ ManagedBean @ ViewScoped public class AddAirportBean { public AddAirportBean ( ) { } private String name ; private String code ; private String country ; private int city ; @ Autowired @ ManagedProperty ( "#{countryService}" ) private CountryService countryService ; @ Autowired @ ManagedProperty ( "#{cityService}" ) private CityService cityService ; @ Autowired @ ManagedProperty ( "#{airportService}" ) private AirportService airportService ; private List < CountryEntity > countries ; private List < CityEntity > cities ; public String getName ( ) { } public void setName ( String name ) { } public String getCode ( ) { } public void setCode ( String code ) { } public String getCountry ( ) { } public void setCountry ( String country ) { } public List < CountryEntity > getCountries ( ) { } public void setCountries ( List < CountryEntity > countries ) { } public List < CityEntity > getCities ( ) { } public void setCities ( List < CityEntity > cities ) { } public int getCity ( ) { } public void setCity ( int city ) { } public CountryService getCountryService ( ) { } public void setCountryService ( CountryService countryService ) { } public CityService getCityService ( ) { } public void setCityService ( CityService cityService ) { } public AirportService getAirportService ( ) { } public void setAirportService ( AirportService airportService ) { } public String addAirportAction ( ) { try { AirportEntity airport = this . airportService . addAirport ( this . name , this . code , Utils . getCountryFromList ( this . country , this . countries ) , Utils . getCityFromList ( this . city , this . cities ) ) ; if ( airport != null ) { } else { } } catch ( Exception e ) { System . out . println ( e . getMessage ( ) ) ; } <START_BUG> return "airport" ; <END_BUG> } }

Fix:
return "//airport//index?faces-redirect=true" ;
Buggy code:
public class TestMe { public Integer add ( Integer a , Integer b ) { <START_BUG> return ( a + b ) + 1 ; <END_BUG> } }

Fix:
return a + b ;
Buggy code:
public class MoveMethodAuthorization extends WebDAVMethodAuthorization { private static final Logger log = LoggerFactory . getLogger ( MoveMethodAuthorization . class ) ; public MoveMethodAuthorization ( ) { } @ Override public AuthorizationStatus isUserAuthorized ( HttpServletRequest request , HttpServletResponse response , UserCredentials user ) { HttpHelper httpHelper = new HttpHelper ( request , response ) ; if ( ! ( httpHelper . hasDestinationHeader ( ) ) ) { return AuthorizationStatus . NOTAUTHORIZED ( SC_BAD_REQUEST , "No<seq2seq4repair_space>destination<seq2seq4repair_space>header<seq2seq4repair_space>found" ) ; } String srcPath = this . stripContext ( httpHelper . getRequestURI ( ) . getRawPath ( ) ) ; String destPath = this . stripContext ( httpHelper . getDestinationURI ( ) . getRawPath ( ) ) ; if ( srcPath . equals ( destPath ) ) { <START_BUG> return AuthorizationStatus . NOTAUTHORIZED ( SC_PRECONDITION_FAILED , "The<seq2seq4repair_space>source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>URIs<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same!" ) ; <END_BUG> } StorageArea srcSA = getMatchingSA ( srcPath ) ; MoveMethodAuthorization . log . debug ( "srcPath<seq2seq4repair_space>{}<seq2seq4repair_space>matches<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>{}" , srcPath , srcSA . getName ( ) ) ; StorageArea destSA = getMatchingSA ( destPath ) ; MoveMethodAuthorization . log . debug ( "destPath<seq2seq4repair_space>{}<seq2seq4repair_space>matches<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>{}" , destPath , destSA . getName ( ) ) ; AuthorizationStatus status = super . isAuthorized ( request . getScheme ( ) , srcSA , READWRITE , user ) ; if ( ! ( status . isAuthorized ( ) ) ) { return status ; } if ( destSA . getName ( ) . equals ( srcSA . getName ( ) ) ) { MoveMethodAuthorization . log . debug ( "source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same" ) ; return status ; } MoveMethodAuthorization . log . debug ( "source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>are<seq2seq4repair_space>different" ) ; return super . isAuthorized ( request . getScheme ( ) , destSA , READWRITE , user ) ; } No newline ; at end ; of file ; }

Fix:
return AuthorizationStatus . NOTAUTHORIZED ( SC_FORBIDDEN , "The<seq2seq4repair_space>source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>URIs<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same!" ) ;
Buggy code:
public class XMLCatalog extends DataType implements Cloneable , EntityResolver { private FileUtils fileUtils = FileUtils . newFileUtils ( ) ; private Vector elements = new Vector ( ) ; private Vector getElements ( ) { } private void setElements ( Vector aVector ) { } private void addElement ( DTDLocation aDTD ) { } public void addDTD ( DTDLocation dtd ) throws BuildException { } public void addEntity ( DTDLocation dtd ) throws BuildException { } public void setRefid ( Reference r ) throws BuildException { if ( ! ( elements . isEmpty ( ) ) ) { throw tooManyAttributes ( ) ; } Object o = r . getReferencedObject ( getProject ( ) ) ; if ( o instanceof XMLCatalog ) { XMLCatalog catalog = ( ( XMLCatalog ) ( o ) ) ; setElements ( catalog . getElements ( ) ) ; } else { <START_BUG> String msg = ( r . getRefId ( ) ) + "<seq2seq4repair_space>doesn\'t<seq2seq4repair_space>refer<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>XCatalog" ; <END_BUG> throw new BuildException ( msg ) ; } super . setRefid ( r ) ; } public InputSource resolveEntity ( String publicId , String systemId ) throws IOException , SAXException { } private DTDLocation findMatchingDTD ( String publicId ) { } }

Fix:
String msg = ( r . getRefId ( ) ) + "<seq2seq4repair_space>doesn\'t<seq2seq4repair_space>refer<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>XMLCatalog" ;
Buggy code:
public class TestBluePlaquesKMLParser extends InstrumentationTestCase { private static final String WANAMAKER = "51.50805700012604-0.09657699988338207" ; private static final String GAINSBOROUGH = "51.50587100027157-0.1362019998878026" ; private static final String HOLST = "51.49613193889098-0.2216046653199584" ; private static final String NICHOLSON = "51.55502299983695-0.1724799999779625" ; private static final String MCMILLAN = "51.408840999931140.01513800008473787" ; private static final String TAIT = "51.56953535360053-0.1815846874911598" ; private static final String HUTCHINSON = "51.54615000003784-0.1591900000075996" ; private static final String MANN = "51.551910999706-0.2066150000297029" ; private static final String PEVSNER = "51.56859400014348-0.1821930000271832" ; private static final String TAYLOR = "51.53885100036625-0.1508040000021182" ; private static final String WALTON = "51.49705000054198-0.1539939998990136" ; private static final String POPPER = "51.63527499996276-0.1592689998720098" ; private static final String HAZLITT = "51.51438100024222-0.1321030000283372" ; private static final String ADAM = "51.50897606853864-0.1226314713386643" ; private static final String SHELLEY = "51.51462099986226-0.1370979999471302" ; private static final String MOORE = "51.51716200008351-0.1571309999538215" ; private static final String PELHAM = "51.50705700003604-0.1409309999618671" ; private static final String HANCOCK = "51.49675315496057-0.1808973543618675" ; public void testLoadMapData ( ) { BluePlaquesKMLParser parser = new BluePlaquesKMLParser ( ) ; parser . loadMapData ( getInstrumentation ( ) . getContext ( ) ) ; List < Placemark > placemarks = parser . getPlacemarks ( ) ; List < Placemark > massagedPlacemarks = parser . getMassagedPlacemarks ( ) ; <START_BUG> assertTrue ( ( ( placemarks . size ( ) ) == 1010 ) ) ; <END_BUG> assertTrue ( ( ( massagedPlacemarks . size ( ) ) == 926 ) ) ; } public void testNames ( ) { } public void testOccupations ( ) { } public void testAddress ( ) { } public void testNote ( ) { } private Placemark getPlacemark ( BluePlaquesKMLParser parser , String key ) { } No newline ; at end ; of file ; }

Fix:
assertTrue ( ( ( placemarks . size ( ) ) == 1009 ) ) ;
Buggy code:
public class ConnectorAdd extends AbstractAddStepHandler { static final ConnectorAdd INSTANCE = new ConnectorAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } void launchServices ( OperationContext context , String connectorName , ModelNode fullModel , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { <START_BUG> OptionMap optionMap = ConnectorResource . getFullOptions ( fullModel ) ; <END_BUG> final ServiceTarget target = context . getServiceTarget ( ) ; final ServiceName socketBindingName = JBOSS_BINDING_NAME . append ( SOCKET_BINDING . resolveModelAttribute ( context , fullModel ) . asString ( ) ) ; RemotingServices . installConnectorServicesForSocketBinding ( target , SUBSYSTEM_ENDPOINT , connectorName , socketBindingName , optionMap , verificationHandler , newControllers ) ; } }

Fix:
OptionMap optionMap = ConnectorResource . getFullOptions ( context , fullModel ) ;
Buggy code:
public class RemoteOutboundConnectionService extends AbstractOutboundConnectionService < RemoteOutboundConnectionService > { public static final ServiceName REMOTE_OUTBOUND_CONNECTION_BASE_SERVICE_NAME = SUBSYSTEM_ENDPOINT . append ( "remote-outbound-connection" ) ; private static final String JBOSS_LOCAL_USER = "JBOSS-LOCAL-USER" ; private static final String HTTP_REMOTING = "http-remoting" ; private static final String HTTPS_REMOTING = "https-remoting" ; private final InjectedValue < OutboundSocketBinding > destinationOutboundSocketBindingInjectedValue = new InjectedValue < OutboundSocketBinding > ( ) ; private final InjectedValue < SecurityRealm > securityRealmInjectedValue = new InjectedValue < SecurityRealm > ( ) ; private final String username ; private final String protocol ; private URI connectionURI ; public RemoteOutboundConnectionService ( final String connectionName , final OptionMap connectionCreationOptions , final String username , final String protocol ) { } @ Override public IoFuture < Connection > connect ( ) throws IOException { } @ Override public String getProtocol ( ) { } Injector < OutboundSocketBinding > getDestinationOutboundSocketBindingInjector ( ) { } Injector < SecurityRealm > getSecurityRealmInjector ( ) { } private synchronized URI getConnectionURI ( ) throws IOException , URISyntaxException { if ( ( this . connectionURI ) != null ) { return this . connectionURI ; } final OutboundSocketBinding destinationOutboundSocket = this . destinationOutboundSocketBindingInjectedValue . getValue ( ) ; <START_BUG> final InetAddress destinationAddress = destinationOutboundSocket . getDestinationAddress ( ) ; <END_BUG> final int port = destinationOutboundSocket . getDestinationPort ( ) ; this . connectionURI = new URI ( ( ( ( ( ( protocol ) + ":////" ) + ( NetworkUtils . formatPossibleIpv6Address ( destinationAddress . getHostAddress ( ) ) ) ) + ":" ) + port ) ) ; return this . connectionURI ; } @ Override public RemoteOutboundConnectionService getValue ( ) throws IllegalArgumentException , IllegalStateException { } }

Fix:
final InetAddress destinationAddress = destinationOutboundSocket . getResolvedDestinationAddress ( ) ;
Buggy code:
public final class WebEventProcessorStrategy implements IEventProcessorStrategy { public WebEventProcessorStrategy ( ) { } public final void processEvents ( final RequestCycle requestCycle ) { } protected final void invokeInterface ( final Component component , final Method method , final Page page ) { if ( page instanceof WebPage ) { ( ( WebPage ) ( page ) ) . beforeCallComponent ( component , method ) ; } try { method . invoke ( component , new Object [ ] { } ) ; } catch ( Exception e ) { <START_BUG> throw new wicket . WicketRuntimeException ( ( ( ( ( ( ( "ethod<seq2seq4repair_space>" + ( method . getName ( ) ) ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( method . getDeclaringClass ( ) ) ) + "targetted<seq2seq4repair_space>at<seq2seq4repair_space>component<seq2seq4repair_space>" ) + component ) + "<seq2seq4repair_space>threw<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) , e ) ; <END_BUG> } finally { if ( page instanceof WebPage ) { ( ( WebPage ) ( page ) ) . afterCallComponent ( component , method ) ; } } } public final void dispatchEvent ( final Page page , final String url ) { } private String getInterfaceName ( final WebRequest webRequest ) { } }

Fix:
throw new wicket . WicketRuntimeException ( ( ( ( ( ( ( "method<seq2seq4repair_space>" + ( method . getName ( ) ) ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( method . getDeclaringClass ( ) ) ) + "targetted<seq2seq4repair_space>at<seq2seq4repair_space>component<seq2seq4repair_space>" ) + component ) + "<seq2seq4repair_space>threw<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) , e ) ;
Buggy code:
public class TestThreaded extends AbstractDataImportHandlerTestCase { @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Before public void setupData ( ) { } @ After public void verify ( ) { } private < T > List < T > shuffled ( List < T > rows ) { } @ Test public void testCachedThreadless_FullImport ( ) throws Exception { } @ Test public void testCachedSingleThread_FullImport ( ) throws Exception { } @ Test public void testCachedThread_FullImport ( ) throws Exception { <START_BUG> int numThreads = ( random . nextInt ( 9 ) ) + 1 ; <END_BUG> String config = getCachedConfig ( random . nextBoolean ( ) , random . nextBoolean ( ) , numThreads ) ; runFullImport ( config ) ; } private String getCachedConfig ( boolean parentCached , boolean childCached , int numThreads ) { } }

Fix:
int numThreads = ( random . nextInt ( 8 ) ) + 2 ;
Buggy code:
public abstract class PneumaticCraftPlugins extends TemplateRecipeHandler { public class MultipleInputOutputRecipe extends CachedRecipe { private final List < PositionedStack > input = new ArrayList < PositionedStack > ( ) ; private final List < PositionedStack > output = new ArrayList < PositionedStack > ( ) ; public void addIngredient ( PositionedStack stack ) { } public void addIngredient ( PositionedStack [ ] stacks ) { } public void addOutput ( PositionedStack stack ) { } @ Override public PositionedStack getResult ( ) { } @ Override public List < PositionedStack > getIngredients ( ) { <START_BUG> return input ; <END_BUG> } @ Override public List < PositionedStack > getOtherStacks ( ) { } } @ Override public int recipiesPerPage ( ) { } public void drawAnimatedPressureGauge ( int x , int y , float minPressure , float minWorkingPressure , float dangerPressure , float maxPressure , float progress ) { } }

Fix:
return getCycledIngredients ( ( ( cycleticks ) // 20 ) , input ) ;
Buggy code:
public final class TagTypeHandler extends AbstractMarkupFilter { private final ArrayListStack < ComponentTag > stack = new ArrayListStack < ComponentTag > ( ) ; private static final Map < String , Boolean > requireOpenBodyCloseTag = new HashMap < String , Boolean > ( ) ; public TagTypeHandler ( final IMarkupFilter parent ) { } public MarkupElement nextTag ( ) throws ParseException { while ( ( stack . size ( ) ) > 0 ) { final ComponentTag top = stack . pop ( ) ; return top ; } <START_BUG> final ComponentTag tag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ; <END_BUG> if ( tag == null ) { return tag ; } if ( tag . isOpenClose ( ) ) { String name = tag . getName ( ) ; if ( ( tag . getNamespace ( ) ) != null ) { name = ( ( tag . getNamespace ( ) ) + ":" ) + ( tag . getName ( ) ) ; } if ( TagTypeHandler . requiresOpenBodyCloseTag ( name ) ) { tag . setType ( OPEN ) ; XmlTag closeTag = new XmlTag ( ) ; closeTag . setType ( CLOSE ) ; closeTag . setName ( tag . getName ( ) ) ; closeTag . setNamespace ( tag . getNamespace ( ) ) ; closeTag . closes ( tag ) ; stack . push ( new ComponentTag ( closeTag ) ) ; } } return tag ; } public static boolean requiresOpenBodyCloseTag ( final String name ) { } }

Fix:
final ComponentTag tag = nextComponentTag ( ) ;
Buggy code:
public abstract class Container extends Component { private static final Log log = LogFactory . getLog ( Container . class ) ; private static final Map markupCache = new HashMap ( ) ; private static final int MINIMAP_MAX_ENTRIES = 8 ; private static final boolean optimizeChildMapsForSpace = false ; private Map childForName ; private transient MarkupStream markupStream ; public Container ( final String name ) { } public Container ( String name , IModel model ) { } public Container ( String name , IModel model , String expression ) { } public Container ( String name , Serializable object ) { } public Container ( String name , Serializable object , String expression ) { } public Container add ( final Component child ) { } public final Component get ( final String path ) { } public final Iterator iterator ( ) { } public void removeAll ( ) { } public Container replace ( final Component child ) { } public final int size ( ) { } public String toString ( ) { } public final Object visitChildren ( final Class c , final IVisitor visitor ) { } public final Object visitChildren ( final IVisitor visitor ) { } protected final MarkupStream findMarkupStream ( ) { } protected final MarkupStream getMarkupStream ( ) { } protected String getMarkupType ( ) { } protected void handleBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected void handleRender ( ) { } protected final void renderAssociatedMarkup ( final String openTagName , final String exceptionMessage ) { } protected final void renderBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected boolean resolveComponent ( final MarkupStream markupStream , final ComponentTag tag ) { } protected final void setMarkupStream ( final MarkupStream markupStream ) { } final MarkupStream getAssociatedMarkupStream ( ) { } final void renderAll ( final MarkupStream markupStream ) { } private Markup loadMarkup ( final Application application , final String key , final Resource markupResource ) throws IOException , ParseException , ResourceNotFoundException { <START_BUG> final Markup markup = application . getMarkupParser ( ) . read ( markupResource ) ; <END_BUG> Container . markupCache . put ( key , markup ) ; return markup ; } private Markup loadMarkupAndWatchForChanges ( final String key , final Resource markupResource ) { } private void optimize ( ) { } private void renderNext ( final MarkupStream markupStream ) { } }

Fix:
final Markup markup = application . getMarkupParser ( ) . readAndParse ( markupResource ) ;
Buggy code:
public class UnsubscribeMessageDispatcher extends MessageDispatcher { private final WebSocketService service ; private PollingService pollingService ; private Session session ; private final MessageType type ; public UnsubscribeMessageDispatcher ( WebSocketService service , PollingService pollingService , Session session , MessageType type ) { } @ Override boolean setRequest ( MessageRequest request ) throws Exception { } @ Override void setParameters ( ArrayList < Object > parameters ) throws Exception { } @ Override boolean process ( ) throws Exception { if ( ( ( this . service . getSessions ( ) ) != null ) && ( ! ( this . service . getSessions ( ) . isEmpty ( ) ) ) ) { <START_BUG> if ( this . service . getSessions ( ) . contains ( session ) ) { <END_BUG> session . close ( new javax . websocket . CloseReason ( CloseCodes . NORMAL_CLOSURE , "Close<seq2seq4repair_space>requested" ) ) ; this . service . getSessions ( ) . remove ( session ) ; Logger . getLogger ( WebSocketService . class . getName ( ) ) . log ( Level . INFO , "{0}:<seq2seq4repair_space>{1}" , new Object [ ] { session . getId ( ) , "Client<seq2seq4repair_space>unsubscribed" } ) ; } else { Logger . getLogger ( WebSocketService . class . getName ( ) ) . log ( Level . INFO , "{0}:<seq2seq4repair_space>{1}" , new Object [ ] { session . getId ( ) , "Client<seq2seq4repair_space>session<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>subscribers<seq2seq4repair_space>list" } ) ; } } if ( ( ( ( this . service . getSessions ( ) ) != null ) && ( this . service . getSessions ( ) . isEmpty ( ) ) ) && ( ( this . pollingService ) != null ) ) { this . pollingService . stop ( ) ; Logger . getLogger ( WebSocketService . class . getName ( ) ) . log ( Level . INFO , "Polling<seq2seq4repair_space>service<seq2seq4repair_space>stopped" ) ; } return true ; } @ Override void respond ( Session session , MessageResponse response ) { } @ Override void respondAll ( MessageResponse response ) { } }

Fix:
if ( ( this . service . getSessions ( ) . contains ( session ) ) && ( session . isOpen ( ) ) ) {
Buggy code:
public class ServerGroupDeploymentRedeployHandler implements OperationStepHandler { public static final String OPERATION_NAME = REDEPLOY ; public static final ServerGroupDeploymentRedeployHandler INSTANCE = new ServerGroupDeploymentRedeployHandler ( ) ; private ServerGroupDeploymentRedeployHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class PackageReferencePattern extends AndPattern implements IIndexConstants { protected char [ ] pkgName ; protected char [ ] [ ] segments ; protected int currentSegment ; protected static char [ ] [ ] CATEGORIES = new char [ ] [ ] { IIndexConstants . REF } ; public PackageReferencePattern ( char [ ] pkgName , int matchRule ) { } PackageReferencePattern ( int matchRule ) { } public void decodeIndexKey ( char [ ] key ) { } public SearchPattern getBlankPattern ( ) { } public char [ ] getIndexKey ( ) { if ( ( this . currentSegment ) >= 0 ) <START_BUG> return encodeIndexKey ( this . segments [ this . currentSegment ] , getMatchMode ( ) ) ; <END_BUG> return null ; } public char [ ] [ ] getMatchCategories ( ) { } protected boolean hasNextQuery ( ) { } public boolean matchesDecodedKey ( SearchPattern decodedPattern ) { } protected void resetQuery ( ) { } public String toString ( ) { } }

Fix:
return this . segments [ this . currentSegment ] ;
Buggy code:
public abstract class PropPanelClassifier extends PropPanelNamespace { protected JPanel _modifiersPanel ; protected JScrollPane extendsScroll ; protected JScrollPane implementsScroll ; protected JScrollPane derivedScroll ; protected JScrollPane opsScroll ; protected JScrollPane attrScroll ; protected JScrollPane connectScroll ; protected JScrollPane innerScroll ; public PropPanelClassifier ( String name , int columns ) { } public PropPanelClassifier ( String name , ImageIcon icon , int columns ) { } public void addOperation ( ) { } public void addAttribute ( ) { } public void addAssociation ( ) { } public void addGeneralization ( ) { } public void removeElement ( ) { Object target = getTarget ( ) ; if ( target instanceof MClassifier ) { MClassifier cls = ( ( MClassifier ) ( target ) ) ; Object newTarget = cls . getNamespace ( ) ; <START_BUG> UmlFactory . getFactory ( ) . getCore ( ) . removeClassifier ( cls ) ; <END_BUG> if ( newTarget != null ) { navigateTo ( newTarget ) ; } TheInstance . getNavPane ( ) . forceUpdate ( ) ; } } protected boolean isAcceptibleBaseMetaClass ( String baseClass ) { } }

Fix:
cls . remove ( ) ;
Buggy code:
public class MyImageView extends ImageView { private Location targetLocation ; private Handler handler = new Handler ( ) ; private Runnable runnable ; public MyImageView ( Context context ) { } public MyImageView ( Context context , AttributeSet attrs ) { } public void addHandler ( ) { runnable = new Runnable ( ) { @ Override public void run ( ) { Data modelData = DirectionsApplication . getInstance ( ) . getModel ( ) . getData ( ) ; final float angle = ( ( ( - 1 ) * ( modelData . getPositiveBearing ( ) ) ) + ( modelData . getDestinationBearing ( targetLocation ) ) ) - ( modelData . getDeclination ( ) ) ; Matrix matrix = new Matrix ( ) ; setScaleType ( MATRIX ) ; matrix . postRotate ( angle , ( ( getDrawable ( ) . getIntrinsicWidth ( ) ) // 2 ) , ( ( getDrawable ( ) . getIntrinsicHeight ( ) ) // 2 ) ) ; setImageMatrix ( matrix ) ; handler . postDelayed ( this , 1000 ) ; } } ; <START_BUG> handler . postDelayed ( runnable , 1000 ) ; <END_BUG> } public void removeHandler ( ) { } @ Override protected void onDraw ( Canvas canvas ) { } public void setTargetLocation ( Location targetLocation ) { } No newline ; at end ; of file ; }

Fix:
handler . postDelayed ( runnable , 100 ) ;
Buggy code:
public class ServiceDeploymentTestCase extends AbstractSarDeploymentTest { private static final ServiceName TEST_SERVICE_NAME = JBOSS . append ( "mbean" , "service" , "jboss:name=test,type=service" ) ; private static final ServiceName TEST_TWO_SERVICE_NAME = JBOSS . append ( "mbean" , "service" , "jboss:name=testTwo,type=service" ) ; private static final ServiceName TEST_THREE_SERVICE_NAME = JBOSS . append ( "mbean" , "service" , "jboss:name=testThree,type=service" ) ; @ Override protected void setupServices ( BatchBuilder batchBuilder ) throws Exception { super . setupServices ( batchBuilder ) ; batchBuilder . addService ( SERVICE_NAME , new MBeanServerService ( ) ) . install ( ) ; final DeploymentChain deploymentChain = new DeploymentChainImpl ( ) ; batchBuilder . addService ( DeploymentChain . SERVICE_NAME , new DeploymentChainService ( deploymentChain ) ) . install ( ) ; deploymentChain . addProcessor ( new ManifestAttachmentProcessor ( ) , PARSE_MANIFEST ) ; deploymentChain . addProcessor ( new AnnotationIndexProcessor ( ) , PARSE_ANNOTATION_INDEX ) ; deploymentChain . addProcessor ( new ModuleDependencyProcessor ( ) , DEPENDENCIES_MODULE ) ; deploymentChain . addProcessor ( new ModuleConfigProcessor ( ) , MODULARIZE_CONFIG ) ; <START_BUG> deploymentChain . addProcessor ( new DeploymentModuleLoaderProcessor ( new DeploymentModuleLoaderImpl ( ) ) , MODULARIZE_DEPLOYMENT_MODULE_LOADER ) ; <END_BUG> deploymentChain . addProcessor ( new ModuleDeploymentProcessor ( ) , MODULARIZE_DEPLOYMENT ) ; deploymentChain . addProcessor ( new ServiceDeploymentParsingProcessor ( ) , PARSE_SERVICE_DEPLOYMENT ) ; deploymentChain . addProcessor ( new ParsedServiceDeploymentProcessor ( ) , INSTALL_SERVICE_DEPLOYMENT ) ; } @ Test public void testDeployment ( ) throws Exception { } private VirtualFile initializeDeployment ( final String path ) throws Exception { } }

Fix:
deploymentChain . addProcessor ( new DeploymentModuleLoaderProcessor ( new org . jboss . as . server . deployment . module . DeploymentModuleLoaderImpl ( mainModuleLoader ) ) , MODULARIZE_DEPLOYMENT_MODULE_LOADER ) ;
Buggy code:
public class ElementImpl extends NodeContainer implements Element { static final long serialVersionUID = 3717253516652722278L ; protected NamedNodeMapImpl attributes ; public ElementImpl ( DocumentImpl ownerDoc , String name ) { } protected ElementImpl ( ) { } public short getNodeType ( ) { } public String getNodeValue ( ) { } public void setNodeValue ( String value ) throws DOMException { } public NamedNodeMap getAttributes ( ) { } public Node cloneNode ( boolean deep ) { if ( syncData ) { synchronizeData ( ) ; } ElementImpl newnode = ( ( ElementImpl ) ( super . cloneNode ( deep ) ) ) ; <START_BUG> newnode . attributes = attributes . cloneMap ( ) ; <END_BUG> return newnode ; } void setOwnerDocument ( DocumentImpl doc ) { } public String getAttribute ( String name ) { } public Attr getAttributeNode ( String name ) { } public NodeList getElementsByTagName ( String tagname ) { } public String getTagName ( ) { } public void normalize ( ) { } public void removeAttribute ( String name ) { } public Attr removeAttributeNode ( Attr oldAttr ) throws DOMException { } public void setAttribute ( String name , String value ) { } public Attr setAttributeNode ( Attr newAttr ) throws DOMException { } public String getAttributeNS ( String namespaceURI , String localName ) { } public void setAttributeNS ( String namespaceURI , String localName , String value ) { } public void removeAttributeNS ( String namespaceURI , String localName ) { } public Attr getAttributeNodeNS ( String namespaceURI , String localName ) { } public Attr setAttributeNodeNS ( Attr newAttr ) throws DOMException { } public NodeList getElementsByTagNameNS ( String namespaceURI , String localName ) { } public void setReadOnly ( boolean readOnly , boolean deep ) { } protected void synchronizeData ( ) { } protected void setupDefaultAttributes ( ) { } }

Fix:
newnode . attributes = attributes . cloneMap ( newnode ) ;
Buggy code:
public class ItemsService extends FileService { public ItemsService ( IEventListener onSuccess , IEventListener onFail ) { } public ItemsService ( ) { } protected void handleSuccess ( XingCloudEvent evt ) { } public void applyService ( Object content ) { } protected int checkDB ( ) { } public boolean sendable ( ) { if ( XingCloud . enableCache ) { String dbFile = ( ( ( Service . ITEMS ) + ( md5 ) ) + ( XingCloud . instance ( ) . appVersionCode ) ) + ".db" ; String fileName = ( ( ( type ) + "?" ) + ( md5 ) ) + ( XingCloud . instance ( ) . appVersionCode ) ; int checkdb = checkDB ( ) ; <START_BUG> if ( ( ( FileHelper . exist ( fileName ) ) || ( FileHelper . exist ( dbFile ) ) ) && ( checkdb == 2 ) ) { <END_BUG> return false ; } else if ( ( checkdb == 1 ) || ( ! ( FileHelper . exist ( dbFile ) ) ) ) { AssetManager assetManager = XingCloud . instance ( ) . getContext ( ) . getAssets ( ) ; try { InputStream is = assetManager . open ( ( ( ( "xingcloud//language//" + ( Config . languageType ( ) ) ) + "//" ) + dbFile ) ) ; byte [ ] content = readFile ( is ) ; FileHelper . save ( dbFile , content ) ; return false ; } catch ( IOException e ) { if ( checkdb == 1 ) { FileHelper . delete ( fileName ) ; } if ( ! ( super . sendable ( ) ) ) { return false ; } checkOldCache ( ) ; return true ; } } checkOldCache ( ) ; return true ; } else { checkOldCache ( ) ; return true ; } } private byte [ ] readFile ( InputStream inputStream ) { } }

Fix:
if ( ( ( FileHelper . exist ( fileName ) ) || ( FileHelper . exist ( dbFile ) ) ) && ( checkdb != 1 ) ) {
Buggy code:
public class TimeDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { try { return parse ( content , null ) ; } catch ( Exception ex ) { <START_BUG> throw new InvalidDatatypeValueException ( "not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>time" ) ; <END_BUG> } } protected int [ ] parse ( String str , int [ ] date ) throws SchemaDateTimeException { } protected String dateToString ( int [ ] date ) { } }

Fix:
throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "time" } ) ;
Buggy code:
public class MenuItem extends Item { Menu parent ; Menu menu ; int groupHandle ; int accelerator ; public MenuItem ( Menu parent , int style ) { } public MenuItem ( Menu parent , int style , int index ) { } void addAccelerator ( int accelGroup ) { } void addAccelerators ( int accelGroup ) { } public void addArmListener ( ArmListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { } void fixMenus ( Decorations newParent ) { } public int getAccelerator ( ) { } int getAccelGroup ( ) { Menu menu = parent ; <START_BUG> while ( ( menu != null ) && ( ( menu . cascade ) != null ) ) { <END_BUG> menu = menu . cascade . parent ; } Decorations shell = menu . parent ; return ( shell . menuBar ) == menu ? shell . accelGroup : 0 ; } public boolean getEnabled ( ) { } public Menu getMenu ( ) { } public Menu getParent ( ) { } public boolean getSelection ( ) { } int gtk_activate ( int widget ) { } int gtk_select ( int item ) { } int gtk_show_help ( int widget , int helpType ) { } void hookEvents ( ) { } public boolean isEnabled ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } void removeAccelerator ( int accelGroup ) { } void removeAccelerators ( int accelGroup ) { } public void removeArmListener ( ArmListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAccelerator ( int accelerator ) { } public void setEnabled ( boolean enabled ) { } public void setImage ( Image image ) { } public void setMenu ( Menu menu ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } void updateAccelerator ( int accelGroup , boolean add ) { } }

Fix:
while ( ( menu . cascade ) != null ) {
Buggy code:
public class LWQQuoteControllerBrainyQuoteImpl implements LWQQuoteController { static int MAX_PAGE_QUERY = 40 ; BrainyQuoteManager brainyQuoteManager ; public LWQQuoteControllerBrainyQuoteImpl ( ) { } @ Override public void fetchCategories ( final Callback < List < Category > > callback ) { } @ Override public void fetchNewQuotes ( final Category category , final Callback < List < Quote > > callback ) { } @ Override public void fetchUnusedQuotes ( final Category category , final Callback < List < Quote > > callback ) { } @ Override public void fetchUnusedQuotesBy ( final Author author , final Callback < List < Quote > > callback ) { final List < Wallpaper > allWallpapers = Select . from ( Wallpaper . class ) . list ( ) ; Condition [ ] conditions = new Condition [ ( allWallpapers . size ( ) ) + 1 ] ; for ( int i = 0 ; i < ( allWallpapers . size ( ) ) ; i ++ ) { <START_BUG> conditions [ i ] = Condition . prop ( "id" ) . notEq ( allWallpapers . get ( i ) . quote . author . getId ( ) ) ; <END_BUG> } conditions [ ( ( conditions . length ) - 1 ) ] = Condition . prop ( StringUtil . toSQLName ( "author" ) ) . eq ( author . getId ( ) ) ; final List < Quote > unusedQuotesFromAuthor = Select . from ( Quote . class ) . where ( conditions ) . list ( ) ; if ( ( unusedQuotesFromAuthor != null ) && ( ! ( unusedQuotesFromAuthor . isEmpty ( ) ) ) ) { callback . onSuccess ( unusedQuotesFromAuthor ) ; return ; } new Thread ( new Runnable ( ) { @ Override public void run ( ) { int page = 1 ; List < Quote > recoveredQuotes = new ArrayList < > ( ) ; while ( ( page <= ( LWQQuoteControllerBrainyQuoteImpl . MAX_PAGE_QUERY ) ) && ( ( recoveredQuotes . size ( ) ) == 0 ) ) { final Object returnObject = brainyQuoteManager . getQuotesBy ( author . name , page ) ; if ( returnObject instanceof String ) { callback . onError ( ( ( String ) ( returnObject ) ) , null ) ; return ; } List < BrainyQuoteManager . BrainyQuote > brainyQuotes = ( ( List < BrainyQuoteManager . BrainyQuote > ) ( returnObject ) ) ; for ( BrainyQuoteManager . BrainyQuote brainyQuote : brainyQuotes ) { Quote quote = Quote . find ( brainyQuote . quote , author ) ; if ( quote != null ) { continue ; } Category category = Category . findWithName ( brainyQuote . topic . name ) ; if ( category == null ) { category = new Category ( brainyQuote . topic . name , Source . BRAINY_QUOTE ) ; category . save ( ) ; } quote = new Quote ( brainyQuote . quote , author , category ) ; quote . save ( ) ; recoveredQuotes . add ( quote ) ; } page ++ ; } callback . onSuccess ( recoveredQuotes ) ; } } ) . start ( ) ; } @ Override public void fetchQuotes ( final String searchQuery , final Callback < List < Object > > callback ) { } }

Fix:
conditions [ i ] = Condition . prop ( "id" ) . notEq ( allWallpapers . get ( i ) . quote . getId ( ) ) ;
Buggy code:
public final class DomainParser implements XMLStreamConstants , XMLElementReader < ParseResult < Domain > > { public void readElement ( final XMLExtendedStreamReader reader , final ParseResult < Domain > value ) throws XMLStreamException { final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( ( reader . getAttributeNamespace ( i ) ) != null ) { reader . handleAttribute ( value , i ) ; } else { switch ( Attribute . forName ( reader . getAttributeLocalName ( i ) ) ) { default : throw DomainParser . unexpectedAttribute ( reader , i ) ; } } } <START_BUG> final Domain domain = new Domain ( null ) ; <END_BUG> while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case XMLStreamConstants . END_ELEMENT : { break ; } case XMLStreamConstants . START_ELEMENT : { if ( NAMESPACES . contains ( reader . getNamespaceURI ( ) ) ) { switch ( Element . forName ( reader . getLocalName ( ) ) ) { case SERVER_GROUPS : { readServerGroupsElement ( reader , domain ) ; break ; } default : throw DomainParser . unexpectedElement ( reader ) ; } } else { reader . handleAny ( domain ) ; } break ; } default : throw new IllegalStateException ( ) ; } } value . setResult ( domain ) ; } private void readServerGroupsElement ( final XMLExtendedStreamReader reader , final Domain domain ) throws XMLStreamException { } private static XMLStreamException unexpectedElement ( final XMLExtendedStreamReader reader ) { } private static XMLStreamException unexpectedAttribute ( final XMLExtendedStreamReader reader , final int i ) { } }

Fix:
final Domain domain = new Domain ( ) ;
Buggy code:
public class AddEditChoreActivity extends AddEditModelTypeActivityBase < Chore > { private long lastTimeDone ; @ Override protected void onStop ( ) { } @ Override protected int getLayoutId ( ) { } @ Override protected Parcelable parcel ( Chore chore ) { } @ Override protected Chore unparcel ( Parcelable parcelable ) { } @ Override protected String getExtra ( ) { } @ Override protected void persist ( Chore chore ) throws DatabaseException { } @ Override protected boolean validate ( Chore chore ) { } @ Override protected void setModel ( Chore chore ) { } private void fillLastDoneText ( int daysUntilDue ) { } @ Override protected Chore getModel ( ) { } public void onDoneClicked ( @ SuppressWarnings ( "unused" ) View view ) { lastTimeDone = new Date ( ) . getTime ( ) ; <START_BUG> fillLastDoneText ( 0 ) ; <END_BUG> } @ Override protected void delete ( Chore model ) throws DatabaseException { } }

Fix:
fillLastDoneText ( getModel ( ) . getCycleDays ( ) ) ;
Buggy code:
public class Problem3 { public static void main ( String [ ] args ) { } public static boolean isPrime ( long num ) { <START_BUG> for ( long i = 3 ; i < num ; i += 2 ) <END_BUG> if ( ( num % i ) == 0 ) return false ; return true ; } }

Fix:
for ( long i = 3 ; i < ( Math . sqrt ( num ) ) ; i += 2 )
Buggy code:
public class DbHistoryActivityInstance extends DbObject { public int createEntry ( int id , String state ) { } public int createNewActivityEntry ( int id ) { } public Map < Integer , Map < String , Object > > getLogEntriesForScenarioInstance ( int scenarioInstanceId ) { String sql = "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>historyactivityinstance<seq2seq4repair_space>WHERE<seq2seq4repair_space>scenarioinstance_id<seq2seq4repair_space>=<seq2seq4repair_space>" + scenarioInstanceId ; <START_BUG> return this . executeStatementReturnsMapWithMapWithKeys ( sql , "activityinstance_id" , "timestamp" , "oldstate" , "newstate" , "scenarioinstance_id" , "role_id" , "user_id" , "comment" ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return this . executeStatementReturnsMapWithMapWithKeys ( sql , "activityinstance_id" , "label" , "timestamp" , "oldstate" , "newstate" , "scenarioinstance_id" , "role_id" , "user_id" , "comment" ) ;
Buggy code:
public class LongLiteral extends NumberLiteral { long value ; static final Constant FORMAT_ERROR = new DoubleConstant ( ( 1.0 // 0.0 ) ) ; public LongLiteral ( char [ ] token , int s , int e ) { } public LongLiteral ( char [ ] token , int s , int e , long value ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { } public final boolean mayRepresentMIN_VALUE ( ) { } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding tb = super . resolveType ( scope ) ; if ( ( constant ) == ( LongLiteral . FORMAT_ERROR ) ) { <START_BUG> constant = NotAConstant ; <END_BUG> scope . problemReporter ( ) . constantOutOfFormat ( this ) ; this . resolvedType = null ; return null ; } return tb ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
constant = Constant . NotAConstant ;