nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TankEntity extends BaseEntity { private final int TRACK_WIDTH = 5 ; private final int TRACK_HEIGHT = 27 ; protected int SHOT_SPEED = 600 ; protected int SHOT_COOLDOWN = 500 ; protected float TURN_RATE = 90.0F ; protected float TURRET_TURN_RATE = 90.0F ; protected float DRIVE_SPEED = 100.0F ; protected float DRIVE_SPEED_MULTIPLIER = 2.0F ; protected float ANIMATION_BASE_SPEED = 100.0F ; protected float turretAngle = 0 ; protected int shotCounter = 0 ; protected boolean readyToFire = true ; protected boolean speedMuliplied = false ; private final float [ ] DESTROYED_COLORS = new float [ ] { 0.5F , 0.5F , 0.5F } ; protected ArrayList < Bullet > bullets = null ; private final float SCALE = 2.0F ; private final float TURRET_Y_OFFSET = ( - 4.8F ) * ( SCALE ) ; private final float TURRET_END_Y_OFFSET = ( 12.0F * ( SCALE ) ) - ( TURRET_Y_OFFSET ) ; protected Image turret = null ; protected Image base = null ; protected CustomAnimation leftTrack = null ; protected CustomAnimation rightTrack = null ; protected ObjectRegister register = null ; public TankEntity ( float x , float y , float angle , ObjectRegister register ) { } @ Override protected void init ( float x , float y , float angle , Image image ) { } protected void addTurretAngle ( float deltaTurretAngle , int delta ) { float cleanDeltaTurret = Utils . wrapAngleDelta ( deltaTurretAngle ) ; <START_BUG> float turretRateCap = ( delta > 0 ) ? ( this . TURRET_TURN_RATE ) // ( 1000 // delta ) : 0 ; <END_BUG> this . turretAngle = Utils . wrapAngle ( this . turretAngle , Utils . clampFloat ( cleanDeltaTurret , ( - turretRateCap ) , turretRateCap ) ) ; } protected void updateAnimation ( float deltaAngle , int deltaTime ) { } protected void fire ( ) { } @ Override public void render ( ) { } public void renderProjectiles ( ) { } public CenteredRectangle getHitBox ( ) { } @ Override public void update ( Input input , int delta ) { } public void renderHelpers ( Graphics g ) { } public float getTurnRate ( ) { } public float getDriveSpeed ( ) { } public float getDriveSpeedMultiplier ( ) { } }

Fix:
float turretRateCap = ( delta > 0 ) ? ( ( this . TURRET_TURN_RATE ) // 1000 ) * delta : 0 ;
Buggy code:
public class AgentManagerImplTest { private AgentManager manager ; private DataSource dataSource ; @ Rule public ExpectedException expectedEx = ExpectedException . none ( ) ; @ Before public void setUp ( ) throws SQLException { } @ After public void tearDown ( ) throws SQLException { } @ Test public void createAgent ( ) { } @ Test public void createAgentNull ( ) { } @ Test public void createAgentWithNullName ( ) { } @ Test public void createAgentWithEmptyName ( ) { } @ Test public void createAgentNameWithIllegalSymbols ( ) { } @ Test public void createAgentBornMoreThan100yo ( ) { } @ Test public void createAgentNotBornYet ( ) { } private Agent makeAgent ( ) { } @ Test public void updateAgent ( ) { } @ Test public void updateAgentNull ( ) { Agent newAgent = makeAgent ( ) ; <START_BUG> newAgent . setId ( Long . MAX_VALUE ) ; <END_BUG> expectedEx . expect ( IllegalArgumentException . class ) ; manager . updateAgent ( newAgent ) ; } @ Test public void updateAgentWithWrongId ( ) { } @ Test public void updateAgentWithNullName ( ) { } @ Test public void updateAgentWithEmptyName ( ) { } @ Test public void updateAgentNameWithIllegalSymbols ( ) { } @ Test public void updateAgentBornMoreThan100yo ( ) { } @ Test public void updateAgentNotBornYet ( ) { } @ Test public void deleteAgent ( ) { } }

Fix:
newAgent . setId ( null ) ;
Buggy code:
public final class BufferControl extends ChunkControl { private final Node collisionNode = new Node ( ( "HexGridcollisionNode@" + ( getClass ( ) . getSimpleName ( ) ) ) ) ; private final Node bufferFXNode = new Node ( ( "HexGridFXNode@" + ( getClass ( ) . getSimpleName ( ) ) ) ) ; private final List < ChunkCoordinate > persistantBufferList ; private Camera cam ; private final int bufferRadius = 1 ; private GridRayCastControl rayControl ; private Vector3f oldCamPosition = new Vector3f ( ) ; private ArrayList < BufferListener > listeners = new ArrayList < BufferListener > ( ) ; private boolean initialise ; private final Application app ; public BufferControl ( Application app , MapData mapData , HexGrid system , ChunkBuilder builder ) { } private final TileChangeListener tileChangeListener ; private List < ChunkCoordinate > getBufferedChunk ( int bufferRadius ) { } @ Override public void setSpatial ( Spatial spatial ) { } private void usewater ( ) { <START_BUG> bufferFXNode . attachChild ( SkyFactory . createSky ( app . getAssetManager ( ) , "Textures//BrightSky.dds" , false ) ) ; <END_BUG> SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor ( app . getAssetManager ( ) ) ; waterProcessor . setReflectionScene ( collisionNode . getParent ( ) . getParent ( ) ) ; Vector3f waterLocation = new Vector3f ( 0 , 0 , 0 ) ; waterProcessor . setPlane ( new com . jme3 . math . Plane ( Vector3f . UNIT_Y , waterLocation . dot ( UNIT_Y ) ) ) ; app . getViewPort ( ) . addProcessor ( waterProcessor ) ; waterProcessor . setWaterDepth ( ( - 4 ) ) ; waterProcessor . setDistortionScale ( 0.05F ) ; waterProcessor . setWaveSpeed ( 0.01F ) ; waterProcessor . setWaterTransparency ( 0.2F ) ; waterProcessor . setRenderSize ( 256 , 256 ) ; Quad quad = new Quad ( 200 , 200 ) ; quad . scaleTextureCoordinates ( new Vector2f ( 6.0F , 6.0F ) ) ; Geometry water = new Geometry ( "water" , quad ) ; water . setLocalRotation ( new Quaternion ( ) . fromAngleAxis ( ( - ( FastMath . HALF_PI ) ) , UNIT_X ) ) ; water . setLocalTranslation ( ( - 100 ) , 0.01F , 125 ) ; water . setMaterial ( waterProcessor . getMaterial ( ) ) ; bufferFXNode . attachChild ( water ) ; ( ( Node ) ( spatial ) ) . attachChild ( bufferFXNode ) ; } public void registerListener ( BufferListener listener ) { } public boolean removeListener ( BufferListener listener ) { } @ Override protected void controlUpdate ( float tpf ) { } private void updateBufferPosition ( ) { } private void updateListeners ( ) { } public void updateCulling ( ) { } private void updateCulling ( ChunkCoordinate coord , boolean isCull ) { } private void generateBufferedChunk ( ) { } @ Override public void hideVoidTile ( boolean hide ) { } private boolean hasInRange ( ChunkCoordinate testedCoord ) { } No newline ; at end ; of file ; }

Fix:
bufferFXNode . attachChild ( SkyFactory . createSky ( app . getAssetManager ( ) , "org//hexgridapi//assets//Textures//BrightSky.dds" , false ) ) ;
Buggy code:
public class MatrixIndexExceptionTest extends TestCase { public void testConstructorMessage ( ) { String msg = "message" ; <START_BUG> MatrixIndexException ex = new MatrixIndexException ( msg ) ; <END_BUG> assertEquals ( msg , ex . getMessage ( ) ) ; } }

Fix:
MatrixIndexException ex = new MatrixIndexException ( msg , new Object [ 0 ] ) ;
Buggy code:
public class ModelPanel extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void changeDisplayToCreateModel ( View view ) { <START_BUG> Intent intent = new Intent ( this , ModelPanel . class ) ; <END_BUG> startActivity ( intent ) ; } }

Fix:
Intent intent = new Intent ( this , CreateModel . class ) ;
Buggy code:
public class Form extends WebMarkupContainer implements IFormSubmitListener { private static final long serialVersionUID = 1L ; private static Log log = LogFactory . getLog ( Form . class ) ; private Bytes maxSize = Bytes . MAX ; private boolean multiPart = false ; private String javascriptId ; public Form ( final String id ) { } public Form ( final String id , IModel model ) { } public Bytes getMaxSize ( ) { } public final void loadPersistentFormComponentValues ( ) { } public final void onFormSubmitted ( ) { } public void removePersistentFormComponentValues ( final boolean disablePersistence ) { } public void setMaxSize ( final Bytes maxSize ) { } public void setMultiPart ( boolean multiPart ) { } public final Component setVersioned ( final boolean isVersioned ) { } public boolean isVersioned ( ) { } public final void visitFormComponents ( final FormComponent . IVisitor visitor ) { } protected void beforeUpdateFormComponentModels ( ) { } protected void delegateSubmit ( Button submittingButton ) { } protected final Button findSubmittingButton ( ) { } protected IValuePersister getValuePersister ( ) { } protected final boolean hasError ( ) { } protected void internalOnModelChanged ( ) { } protected final void markFormComponentsInvalid ( ) { } protected final void markFormComponentsValid ( ) { } protected final String getHiddenFieldId ( ) { } protected final String getJavascriptId ( ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onError ( ) { } protected void onRender ( final MarkupStream markupStream ) { } protected void onSubmit ( ) { } public boolean process ( ) { } protected final void updateFormComponentModels ( ) { visitFormComponents ( new FormComponent . IVisitor ( ) { public void formComponent ( final FormComponent formComponent ) { <START_BUG> if ( ( formComponent . isVisibleInHierarchy ( ) ) && ( formComponent . isValid ( ) ) ) { <END_BUG> formComponent . updateModel ( ) ; } } } ) ; } protected void clearInput ( ) { } protected void validate ( ) { } private boolean anyFormComponentError ( ) { } private final boolean handleMultiPart ( ) { } private void persistFormComponentData ( ) { } private void dispatchEvent ( final Page page , final String url ) { } private void registerNewUserInput ( ) { } public final String getJsForInterfaceUrl ( String url ) { } }

Fix:
if ( ( ( formComponent . isVisibleInHierarchy ( ) ) && ( formComponent . isEnabled ( ) ) ) && ( formComponent . isValid ( ) ) ) {
Buggy code:
public class SimulationController { private double tickTime = 50 ; private int spawnRate = 5 ; private int maxCars = 25 ; private int maxCarSpeed = 50 ; private double carTruckRatio = 0.7 ; private double recklessNormalRatio = 0.3 ; private int recklessCount = 0 ; private int truckCount = 0 ; private int ambulanceCount = 0 ; private boolean debugFlag = false ; private Map map = new Map ( ) ; private File lastLoadedMap ; private SimulationController . AnimationThread animationThread ; private static SimulationController instance ; public static SimulationController getInstance ( ) { } private SimulationController ( ) { } public void startSimulation ( ) { } public void stopSimulation ( ) { } public void resetSimulation ( boolean reloadMap ) { if ( reloadMap ) { map . stopChildThreads ( ) ; map = new Map ( ) ; map . loadMap ( lastLoadedMap ) ; } animationThread . interrupt ( ) ; MainApp . getInstance ( ) . resetCanvas ( ) ; MainApp . getInstance ( ) . getControlsController ( ) . resetCharts ( ) ; MainApp . getInstance ( ) . getControlsController ( ) . resetSettings ( ) ; truckCount = 0 ; recklessCount = 0 ; ambulanceCount = 0 ; animationThread = new SimulationController . AnimationThread ( ) ; <START_BUG> map . drawMap ( ) ; <END_BUG> if ( debugFlag ) map . showAllIntersectionPaths ( ) ; } private class AnimationThread extends Thread { @ Override public void run ( ) { } public AnimationThread ( ) { } } public Thread getAnimationThread ( ) { } public static void init ( ) { } public void removeVehicle ( Vehicle v ) { } public void spawnAmbulance ( ) { } public boolean isDebug ( ) { } public void setDebugFlag ( boolean debugFlag ) { } public double getTickTime ( ) { } public void setTickTime ( double tickTime ) { } public int getSpawnRate ( ) { } public void setSpawnRate ( int spawnRate ) { } public int getMaxCars ( ) { } public void setMaxCars ( int maxCars ) { } public int getMaxCarSpeed ( ) { } public void setMaxCarSpeed ( int maxCarSpeed ) { } public double getCarTruckRatio ( ) { } public void setCarTruckRatio ( double carTruckRatio ) { } public void setRecklessNormalRatio ( double recklessNormalRatio ) { } public Map getMap ( ) { } public void setMap ( Map map ) { } public void setLastLoadedMap ( File mapFile ) { } public File getLastLoadedMap ( ) { } }

Fix:
map . drawMap ( MainApp . getInstance ( ) . getCanvas ( ) ) ;
Buggy code:
public class PropertiesFactory implements IPropertiesFactory { private static final Logger log = LoggerFactory . getLogger ( PropertiesFactory . class ) ; private final Map < String , Properties > propertiesCache = new HashMap < String , Properties > ( ) ; private final List < IPropertiesReloadListener > afterReloadListeners = new ArrayList < IPropertiesReloadListener > ( ) ; private final IResourceSettings resourceSettings ; public PropertiesFactory ( final Application application ) { } public void addListener ( final IPropertiesReloadListener listener ) { } public Properties get ( final Class clazz , final String style , final Locale locale ) { final String key = createResourceKey ( clazz , locale , style ) ; Properties props = propertiesCache . get ( key ) ; if ( ( props == null ) && ( ( propertiesCache . containsKey ( key ) ) == false ) ) { <START_BUG> final IResourceStream resource = resourceSettings . getResourceStreamFactory ( ) . locate ( clazz , clazz . getName ( ) . replace ( '.' , '//' ) , style , locale , "properties,xml" ) ; <END_BUG> if ( resource != null ) { props = loadPropertiesFileAndWatchForChanges ( key , resource , clazz , style , locale ) ; } synchronized ( propertiesCache ) { propertiesCache . put ( key , props ) ; } } return props ; } protected final Map getCache ( ) { } public final void clearCache ( ) { } public final String createResourceKey ( final Class componentClass , final Locale locale , final String style ) { } private synchronized Properties loadPropertiesFile ( final String key , final IResourceStream resourceStream , final Class componentClass , final String style , final Locale locale ) { } private final Properties loadPropertiesFileAndWatchForChanges ( final String key , final IResourceStream resourceStream , final Class componentClass , final String style , final Locale locale ) { } }

Fix:
final IResourceStream resource = resourceSettings . getResourceStreamFactory ( ) . newResourceStream ( clazz , clazz . getName ( ) . replace ( '.' , '//' ) , style , locale , "properties,xml" ) ;
Buggy code:
public class TldParsingDeploymentProcessor implements DeploymentUnitProcessor { public static final long PRIORITY = PARSE_DESCRIPTORS . plus ( 330L ) ; private static final String TLD = ".tld" ; private static final String META_INF = "META-INF" ; private static final String WEB_INF = "WEB-INF" ; private static final String CLASSES = "classes" ; private static final String LIB = "lib" ; private static final String IMPLICIT_TLD = "implicit.tld" ; public void processDeployment ( DeploymentUnitContext context ) throws DeploymentUnitProcessingException { } private void processTlds ( VirtualFile root , List < VirtualFile > files , Map < String , TldMetaData > tlds ) throws DeploymentUnitProcessingException { } private TldMetaData parseTLD ( VirtualFile tld ) throws DeploymentUnitProcessingException { if ( TldParsingDeploymentProcessor . IMPLICIT_TLD . equals ( tld . getName ( ) ) ) { return new TldMetaData ( ) ; } InputStream is = null ; long time = System . currentTimeMillis ( ) ; try { is = tld . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; return TldMetaDataParser . parse ( xmlReader ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + tld ) , e ) ; } finally { <START_BUG> Logger . getLogger ( "org.jboss.web" ) . info ( ( "parse<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - time ) ) ) ; <END_BUG> try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } }

Fix:
Logger . getLogger ( "org.jboss.web.TldParsingDeploymentProcessor" ) . info ( ( ( ( ( "parse<seq2seq4repair_space>" + ( tld . getName ( ) ) ) + ":<seq2seq4repair_space>" ) + ( ( System . currentTimeMillis ( ) ) - time ) ) + "ms" ) ) ;
Buggy code:
public class SocketAppender extends AppenderSkeleton { public static final int DEFAULT_PORT = 4560 ; static final int DEFAULT_RECONNECTION_DELAY = 30000 ; private static final int RESET_FREQUENCY = 1 ; String remoteHost ; InetAddress address ; int port = SocketAppender . DEFAULT_PORT ; ObjectOutputStream oos ; int reconnectionDelay = SocketAppender . DEFAULT_RECONNECTION_DELAY ; boolean locationInfo = false ; private SocketAppender . Connector connector ; int counter = 0 ; String hostname ; String application ; public SocketAppender ( ) { } public SocketAppender ( InetAddress address , int port ) { } public SocketAppender ( String host , int port ) { } public void activateOptions ( ) { } public synchronized void close ( ) { } public void cleanUp ( ) { } void connect ( InetAddress address , int port ) { if ( ( this . address ) == null ) { return ; } try { cleanUp ( ) ; oos = new ObjectOutputStream ( new Socket ( address , port ) . getOutputStream ( ) ) ; } catch ( IOException e ) { String msg = ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>remote<seq2seq4repair_space>log4j<seq2seq4repair_space>server<seq2seq4repair_space>at<seq2seq4repair_space>[" + ( address . getHostName ( ) ) ) + "]." ; if ( ( reconnectionDelay ) > 0 ) { msg += "<seq2seq4repair_space>We<seq2seq4repair_space>will<seq2seq4repair_space>try<seq2seq4repair_space>again<seq2seq4repair_space>later." ; fireConnector ( ) ; } <START_BUG> LogLog . error ( ( ( ( msg + "(" ) + e ) + ")" ) ) ; <END_BUG> } } public void append ( LoggingEvent event ) { } void fireConnector ( ) { } static InetAddress getAddressByName ( String host ) { } public boolean requiresLayout ( ) { } public void setRemoteHost ( String host ) { } public String getRemoteHost ( ) { } public void setPort ( int port ) { } public int getPort ( ) { } public void setLocationInfo ( boolean locationInfo ) { } public boolean getLocationInfo ( ) { } public void setApplication ( String lapp ) { } public String getApplication ( ) { } public void setReconnectionDelay ( int delay ) { } public int getReconnectionDelay ( ) { } class Connector extends Thread { boolean interrupted = false ; public void run ( ) { } } }

Fix:
LogLog . error ( ( ( ( msg + "(" ) + ( e . getMessage ( ) ) ) + ")" ) ) ;
Buggy code:
public class OdlInterfaceChangeListener extends AbstractDataChangeListener < Interface > implements AutoCloseable { private static final Logger LOG = LoggerFactory . getLogger ( OdlInterfaceChangeListener . class ) ; private ListenerRegistration < DataChangeListener > listenerRegistration ; private final DataBroker broker ; private NexthopManager nexthopManager ; private IInterfaceManager interfaceManager ; public OdlInterfaceChangeListener ( final DataBroker db , NexthopManager nhm , IInterfaceManager ifManager ) { } @ Override public void close ( ) throws Exception { } private void registerListener ( final DataBroker db ) { } @ Override protected void add ( InstanceIdentifier < Interface > identifier , Interface intrf ) { } private InstanceIdentifier < Interface > getWildCardPath ( ) { } @ Override protected void remove ( InstanceIdentifier < Interface > identifier , Interface intrf ) { OdlInterfaceChangeListener . LOG . trace ( ( ( ( "Removing<seq2seq4repair_space>interface<seq2seq4repair_space>:<seq2seq4repair_space>key:<seq2seq4repair_space>" + identifier ) + ",<seq2seq4repair_space>value=" ) + intrf ) ) ; if ( intrf . getType ( ) . equals ( L3tunnel . class ) ) { <START_BUG> BigInteger dpnId = interfaceManager . getDpnForInterface ( intrf . getName ( ) ) ; <END_BUG> IfL3tunnel intfData = intrf . getAugmentation ( IfL3tunnel . class ) ; IpAddress gatewayIp = intfData . getGatewayIp ( ) ; IpAddress remoteIp = ( gatewayIp == null ) ? intfData . getRemoteIp ( ) : gatewayIp ; nexthopManager . removeRemoteNextHop ( dpnId , intrf . getName ( ) , remoteIp . getIpv4Address ( ) . getValue ( ) ) ; } } @ Override protected void update ( InstanceIdentifier < Interface > identifier , Interface original , Interface update ) { } No newline ; at end ; of file ; }

Fix:
BigInteger dpnId = interfaceManager . getDpnForInterface ( intrf ) ;
Buggy code:
public class ExtensionAddHandler extends AbstractAddStepHandler implements DescriptionProvider { public static final String OPERATION_NAME = ADD ; public static ModelNode getAddExtensionOperation ( ModelNode address ) { } private final ExtensionContext extensionContext ; private final boolean parallelBoot ; public ExtensionAddHandler ( final ExtensionContext extensionContext , final boolean parallelBoot ) { } protected void populateModel ( final OperationContext context , final ModelNode operation , final Resource resource ) throws OperationFailedException { } protected void populateModel ( final ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { } void initializeExtension ( String module ) throws OperationFailedException { try { for ( Extension extension : Module . loadServiceFromCallerModuleLoader ( ModuleIdentifier . fromString ( module ) , Extension . class ) ) { ClassLoader oldTccl = SecurityActions . setThreadContextClassLoader ( extension . getClass ( ) ) ; try { <START_BUG> extension . initialize ( extensionContext . createWrapper ( module ) ) ; <END_BUG> } finally { SecurityActions . setThreadContextClassLoader ( oldTccl ) ; } } } catch ( ModuleLoadException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . toString ( ) ) ) ; } } protected boolean requiresRuntime ( OperationContext context ) { } }

Fix:
extension . initialize ( extensionContext . createTracking ( module ) ) ;
Buggy code:
public class TotalAmountCountingBolt extends BaseRichBolt { private static final Logger log = LoggerFactory . getLogger ( TotalAmountCountingBolt . class ) ; private final int emitFrequencySeconds ; private final Map < String , Map < String , TotalAmountCountingBolt . CurrencyStats > > currenciesByCountry = Maps . newHashMap ( ) ; private OutputCollector collector ; public TotalAmountCountingBolt ( int emitFrequencySeconds ) { } @ Override public void prepare ( Map stormConf , TopologyContext context , OutputCollector collector ) { } @ Override public void execute ( Tuple input ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } @ Override public Map < String , Object > getComponentConfiguration ( ) { } private void trackTransaction ( String country , String currencySell , Double amountSell , String currencyBuy , Double amountBuy ) { getStats ( country , currencySell ) . addSell ( amountSell ) ; <START_BUG> getStats ( country , currencyBuy ) . addSell ( amountBuy ) ; <END_BUG> } private TotalAmountCountingBolt . CurrencyStats getStats ( String country , String currency ) { } private class CurrencyStats { final String currency ; BigDecimal totalSell = BigDecimal . ZERO ; BigDecimal totalBuy = BigDecimal . ZERO ; private CurrencyStats ( String currency ) { } public void addSell ( double amount ) { } public void addBuy ( double amount ) { } } }

Fix:
getStats ( country , currencyBuy ) . addBuy ( amountBuy ) ;
Buggy code:
public class MonthDayDV extends AbstractDateTimeDV { private static final int MONTHDAY_SIZE = 7 ; public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { } protected String dateToString ( DateTimeData date ) { } protected XMLGregorianCalendar getXMLGregorianCalendar ( DateTimeData date ) { <START_BUG> return factory . newXMLGregorianCalendar ( DatatypeConstants . FIELD_UNDEFINED , date . unNormMonth , date . unNormDay , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newXMLGregorianCalendar ( DatatypeConstants . FIELD_UNDEFINED , date . unNormMonth , date . unNormDay , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ;
Buggy code:
public class Main2Activity extends AppCompatActivity { public String insertTxtCopy ; public EditText qrTextField ; public ImageLoader imgLoader ; public ImageView qrImg ; public TextView qrTxt ; public ClipboardManager clipboard ; public ClipData clip ; public CharSequence clipTxt ; String BASE_QR_URL = "http:////chart.apis.google.com//chart?cht=qr&chs=400x400&chld=M&choe=UTF-8&chl=" ; String fullUrl = BASE_QR_URL ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void buttonOK ( View v ) { } public void buttonQR ( View v ) { clipTxt = clipboard . getPrimaryClip ( ) . getItemAt ( 0 ) . getText ( ) ; if ( ( null != ( clipTxt ) ) && ( ( clipTxt . length ( ) ) > 0 ) ) { try { qrTxt . setText ( clipTxt ) ; String copiedStr = clipTxt . toString ( ) ; <START_BUG> fullUrl += URLEncoder . encode ( copiedStr , "UTF-8" ) ; <END_BUG> imgLoader . displayImage ( fullUrl , qrImg ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } } else { AlertDialog . Builder builder = new AlertDialog . Builder ( this ) ; builder . setTitle ( "QRMaker" ) . setCancelable ( true ) . setMessage ( "There<seq2seq4repair_space>was<seq2seq4repair_space>no<seq2seq4repair_space>data<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>clipboard!<seq2seq4repair_space>Go<seq2seq4repair_space>copy<seq2seq4repair_space>something<seq2seq4repair_space>and<seq2seq4repair_space>come<seq2seq4repair_space>back" ) . setNeutralButton ( "Okay" , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface arg0 , int arg1 ) { finish ( ) ; } } ) ; AlertDialog diag = builder . create ( ) ; diag . show ( ) ; } } }

Fix:
fullUrl = ( BASE_QR_URL ) + ( URLEncoder . encode ( copiedStr , "UTF-8" ) ) ;
Buggy code:
public class AjConstructorDeclaration extends ConstructorDeclaration { public AjConstructorDeclaration ( CompilationResult compilationResult ) { } protected int generateInfoAttributes ( ClassFile classFile ) { List extras = new ArrayList ( ) ; addDeclarationStartLineAttribute ( extras , classFile ) ; <START_BUG> return classFile . generateMethodInfoAttribute ( binding , extras ) ; <END_BUG> } protected void addDeclarationStartLineAttribute ( List extraAttributeList , ClassFile classFile ) { } }

Fix:
return classFile . generateMethodInfoAttribute ( binding , false , extras ) ;
Buggy code:
public abstract class AbstractBatchTestCase { static final String ENCODING = "utf-8" ; public static WebArchive createDefaultWar ( final String warName , final Package pkg , final String jobXml ) { } protected static String performCall ( final String url ) throws IOException , ExecutionException , TimeoutException { <START_BUG> return HttpRequest . get ( url , 10 , TimeUnit . SECONDS ) ; <END_BUG> } public static class UrlBuilder { private final URL url ; private final String [ ] paths ; private final Map < String , String > params ; private UrlBuilder ( final URL url , final String ... paths ) { } public static AbstractBatchTestCase . UrlBuilder of ( final URL url , final String ... paths ) { } public AbstractBatchTestCase . UrlBuilder addParameter ( final String key , final int value ) { } public AbstractBatchTestCase . UrlBuilder addParameter ( final String key , final String value ) { } public String build ( ) throws UnsupportedEncodingException { } } public static class LoggingSetup implements ServerSetupTask { static final ModelNode WELD_BOOTSTRAP_LOGGER_ADDRESS ; @ Override public void setup ( final ManagementClient managementClient , final String containerId ) throws Exception { } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } static ModelNode execute ( final ModelControllerClient client , final ModelNode op ) throws IOException { } } }

Fix:
return HttpRequest . get ( url , 10 , TimeUnit . MINUTES ) ;
Buggy code:
public class VideoCameraInput extends JPanel { private static final int [ ] START_BYTES = new int [ ] { 255 , 216 } ; private static final int [ ] END_BYTES = new int [ ] { 255 , 217 } ; private boolean ipChanged ; private String ipString ; private long lastFPSCheck ; private int lastFPS ; private int fpsCounter ; private BufferedImage imageToDraw ; private VideoCameraInput . BGThread bgThread ; public VideoCameraInput ( ) { } public void init ( ) { } @ Override protected void paintComponent ( final Graphics g ) { } public class BGThread extends Thread { boolean destroyed ; long lastRepaint ; public BGThread ( ) { } @ Override public void run ( ) { URLConnection connection ; InputStream stream ; final ByteArrayOutputStream imageBuffer = new ByteArrayOutputStream ( ) ; while ( ! ( this . destroyed ) ) { System . out . println ( "Connecting..." ) ; out_of_try : try { ipChanged = false ; final URL url = new URL ( ( ( "http:////" + ( ipString ) ) + "//mjpg//video.mjpg" ) ) ; connection = url . openConnection ( ) ; connection . setReadTimeout ( 250 ) ; try { stream = connection . getInputStream ( ) ; } catch ( IOException ex ) { System . err . printf ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>`%s`:<seq2seq4repair_space>%s%n" , url , ex ) ; break out_of_try ; } while ( ( ! ( this . destroyed ) ) && ( ! ( ipChanged ) ) ) { while ( ( ( System . currentTimeMillis ( ) ) - ( this . lastRepaint ) ) < 10L ) { stream . skip ( stream . available ( ) ) ; Thread . sleep ( 1L ) ; } stream . skip ( stream . available ( ) ) ; imageBuffer . reset ( ) ; int i = 0 ; while ( i < ( VideoCameraInput . START_BYTES . length ) ) { final int b = stream . read ( ) ; if ( b == ( VideoCameraInput . START_BYTES [ i ] ) ) { ++ i ; } else { i = 0 ; } } for ( i = 0 ; i < ( VideoCameraInput . START_BYTES . length ) ; ++ i ) { imageBuffer . write ( VideoCameraInput . START_BYTES [ i ] ) ; } i = 0 ; while ( i < ( VideoCameraInput . END_BYTES . length ) ) { final int b = stream . read ( ) ; imageBuffer . write ( b ) ; if ( b == ( VideoCameraInput . END_BYTES [ i ] ) ) { ++ i ; } else { i = 0 ; } } ( fpsCounter ) ++ ; if ( ( ( System . currentTimeMillis ( ) ) - ( lastFPSCheck ) ) > 500L ) { lastFPSCheck = System . currentTimeMillis ( ) ; lastFPS = ( fpsCounter ) * 2 ; fpsCounter = 0 ; } this . lastRepaint = System . currentTimeMillis ( ) ; final ByteArrayInputStream tmpStream = new ByteArrayInputStream ( imageBuffer . toByteArray ( ) ) ; imageToDraw = ImageIO . read ( tmpStream ) ; repaint ( ) ; } } catch ( Exception e ) { imageToDraw = null ; repaint ( ) ; e . printStackTrace ( ) ; } if ( ! ( ipChanged ) ) { try { <START_BUG> Thread . sleep ( 1000L ) ; <END_BUG> } catch ( InterruptedException ex ) { } } } } } }

Fix:
Thread . sleep ( 5000L ) ;
Buggy code:
public class DiscoveryStartup { public static final String DISCOVERY_CONTAINER = "org.eclipse.ecf.provider.jmdns.container.JmDNS" ; public static final String TCPSERVER_DISCOVERY_TYPE = "_ecftcp._tcp.local." ; public static final String PROP_PROTOCOL_NAME = "protocol" ; public static final String PROP_CONTAINER_TYPE_NAME = "containertype" ; public static final String PROP_CONTAINER_TYPE_VALUE = Client . GENERIC_CONTAINER_CLIENT_NAME ; public static final String PROP_PW_REQ_NAME = "pwrequired" ; public static final String PROP_PW_REQ_VALUE = "false" ; public static final String PROP_DEF_USER_NAME = "defaultuser" ; public static final String PROP_DEF_USER_VALUE = "guest" ; public static final String PROP_PATH_NAME = "path" ; public static final int SVC_DEF_WEIGHT = 0 ; public static final int SVC_DEF_PRIORITY = 0 ; static IDiscoveryContainer discovery = null ; static ISharedObjectContainer socontainer = null ; protected DiscoveryView discoveryView = null ; static String [ ] serviceTypes = new String [ ] { DiscoveryStartup . TCPSERVER_DISCOVERY_TYPE } ; public DiscoveryStartup ( ) { } public void dispose ( ) { } protected void setupDiscovery ( ) { } protected void connectToServiceFromInfo ( IServiceInfo svcInfo ) { ClientConnectAction action = new ClientConnectAction ( ) ; Map props = svcInfo . getProperties ( ) ; String type = ( ( String ) ( props . get ( DiscoveryStartup . PROP_CONTAINER_TYPE_NAME ) ) ) ; if ( ( type == null ) || ( type . equals ( "" ) ) ) { action . setContainerType ( GENERIC_CONTAINER_CLIENT_NAME ) ; } else { action . setContainerType ( type ) ; } String username = System . getProperty ( "user.name" ) ; action . setUsername ( username ) ; ID targetID = null ; String targetString = null ; try { targetString = svcInfo . getServiceURI ( ) . toString ( ) ; <START_BUG> targetID = IDFactory . makeStringID ( targetString ) ; <END_BUG> } catch ( Exception e ) { ClientPlugin . log ( ( "cannot<seq2seq4repair_space>create<seq2seq4repair_space>target<seq2seq4repair_space>id<seq2seq4repair_space>for<seq2seq4repair_space>" + targetString ) , e ) ; } action . setTargetID ( targetID ) ; action . setProject ( ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ) ; action . run ( null ) ; } protected void setupDiscoveryContainer ( final IDiscoveryContainer dc ) { } public static void unregisterServerType ( ) { } public static void registerService ( URI uri ) { } public static void unregisterServer ( ISharedObjectContainer container ) { } public static void registerServiceTypes ( ) { } }

Fix:
targetID = IDFactory . getDefault ( ) . makeStringID ( targetString ) ;
Buggy code:
public class PhraseQuery extends Query { private String field ; private ArrayList terms = new ArrayList ( 4 ) ; private ArrayList positions = new ArrayList ( 4 ) ; private int slop = 0 ; public PhraseQuery ( ) { } public void setSlop ( int s ) { } public int getSlop ( ) { } public void add ( Term term ) { } public void add ( Term term , int position ) { } public Term [ ] getTerms ( ) { } public int [ ] getPositions ( ) { } private class PhraseWeight implements Weight { private Similarity similarity ; private float value ; private float idf ; private float queryNorm ; private float queryWeight ; public PhraseWeight ( Searcher searcher ) throws IOException { } public String toString ( ) { } public Query getQuery ( ) { } public float getValue ( ) { } public float sumOfSquaredWeights ( ) { } public void normalize ( float queryNorm ) { } public Scorer scorer ( IndexReader reader ) throws IOException { } public Explanation explain ( IndexReader reader , int doc ) throws IOException { } } protected Weight createWeight ( Searcher searcher ) throws IOException { } public void extractTerms ( Set queryTerms ) { } public String toString ( String f ) { StringBuffer buffer = new StringBuffer ( ) ; <START_BUG> if ( ! ( field . equals ( f ) ) ) { <END_BUG> buffer . append ( field ) ; buffer . append ( ":" ) ; } buffer . append ( "\"" ) ; for ( int i = 0 ; i < ( terms . size ( ) ) ; i ++ ) { buffer . append ( ( ( Term ) ( terms . get ( i ) ) ) . text ( ) ) ; if ( i != ( ( terms . size ( ) ) - 1 ) ) buffer . append ( "<seq2seq4repair_space>" ) ; } buffer . append ( "\"" ) ; if ( ( slop ) != 0 ) { buffer . append ( "~" ) ; buffer . append ( slop ) ; } buffer . append ( ToStringUtils . boost ( getBoost ( ) ) ) ; return buffer . toString ( ) ; } public boolean equals ( Object o ) { } public int hashCode ( ) { } }

Fix:
if ( ( ( field ) != null ) && ( ! ( field . equals ( f ) ) ) ) {
Buggy code:
public class ObjectHandler { private ArrayList < DrawingObject > m_objects ; private ArrayList < DrawingObject > m_objectHistory ; private DrawingObject m_copyObject ; private int m_selectedObjectIndex ; private boolean m_hasSelected ; private Graphics m_graphics ; public ObjectHandler ( ) { } public void add ( DrawingObject obj ) { } public int size ( ) { } public void updateAll ( Graphics g , int x , int y ) { } public void updateAll ( Graphics g ) { } public void select ( int x , int y ) { <START_BUG> for ( int i = this . size ( ) ; i >= 0 ; i -- ) { <END_BUG> if ( m_objects . get ( i ) . inRegion ( x , y ) ) { select ( i ) ; break ; } } } public void select ( int index ) { } public void drag ( Graphics g , int mouse_x , int mouse_y , int x_disp , int y_disp ) { } public void copy ( ) throws Exception { } public void cut ( ) throws Exception { } public void paste ( ) { } public DrawingObject getSelected ( ) throws Exception { } public void undo ( ) { } public void redo ( ) { } }

Fix:
for ( int i = ( this . size ( ) ) - 1 ; i >= 0 ; i -- ) {
Buggy code:
public class AddStudentView extends JFrame { private static final String NAME_OF_PAGE = "New<seq2seq4repair_space>Student" ; private static MainView home = new MainView ( ) ; public void NewStudentViewStart ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void submitActionPerformed ( ActionEvent evt ) { String tuID = tuIDEntry . getText ( ) ; String firstName = firstNameEntry . getText ( ) ; String lastName = lastNameEntry . getText ( ) ; String email = emailEntry . getText ( ) ; boolean validEmailAdr = true ; if ( ( ( ( tuID . equals ( "" ) ) || ( firstName . equals ( "" ) ) ) || ( lastName . equals ( "" ) ) ) || ( email . equals ( "" ) ) ) { JOptionPane . showMessageDialog ( this , "Cannot<seq2seq4repair_space>save<seq2seq4repair_space>with<seq2seq4repair_space>empty<seq2seq4repair_space>fields!" ) ; } else if ( ! ( email . isEmpty ( ) ) ) { try { new InternetAddress ( email ) . validate ( ) ; } catch ( AddressException e ) { System . out . println ( e ) ; JOptionPane . showMessageDialog ( this , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>email<seq2seq4repair_space>address" ) ; validEmailAdr = false ; } if ( validEmailAdr ) { if ( UtilController . isNumeric ( tuID ) ) { if ( ( UtilController . addUser ( tuID , firstName , lastName , email ) ) > 0 ) { JOptionPane . showMessageDialog ( this , "Updating<seq2seq4repair_space>student<seq2seq4repair_space>data." ) ; dispose ( ) ; <START_BUG> AddStudentView . home . resetAdminMode ( ) ; <END_BUG> } else { JOptionPane . showMessageDialog ( this , "Error<seq2seq4repair_space>updating<seq2seq4repair_space>student<seq2seq4repair_space>info<seq2seq4repair_space>database." ) ; } } else { tuIDEntry . setText ( "" ) ; JOptionPane . showMessageDialog ( this , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>numerical<seq2seq4repair_space>TUID." ) ; } } } } private void emailEntryActionPerformed ( ActionEvent evt ) { } private void tuIDEntryActionPerformed ( ActionEvent evt ) { } private void backButtonActionPerformed ( ActionEvent evt ) { } private JMenu EditMenu ; private JButton backButton ; private JTextField emailEntry ; private JLabel emailExtension ; private JLabel errorLabel ; private JLabel firstName ; private JTextField firstNameEntry ; private JLabel jLabel1 ; private JMenuBar jMenuBar1 ; private JSeparator jSeparator1 ; private JLabel lastName ; private JTextField lastNameEntry ; private JLabel netID ; private JLabel newStudentLabel ; private JButton submit ; private JLabel tuID ; private JTextField tuIDEntry ; }

Fix:
AddStudentView . home . setVisible ( true ) ;
Buggy code:
public class GegenstandTabelleDialog extends JDialog implements ActionListener { private static final long serialVersionUID = 1L ; private static final String [ ] tabelleColNames = new String [ ] { "Typ" , "Name" , "NumGen" , "Beschreibung" , "Eigenschaften" } ; private WeltObjekt welt ; private JTable tabelle ; private DefaultTableModel model ; private JScrollPane scroll ; private JButton neu ; private JButton loeschen ; GegenstandTabelleDialog ( WeltObjekt welt ) { } void updateTabelle ( ) { model = new DefaultTableModel ( GegenstandTabelleDialog . tabelleColNames , 0 ) ; tabelle = new JTable ( model ) ; Gegenstand [ ] gegenstaende = welt . getGegenstaende ( ) ; for ( Gegenstand g : gegenstaende ) { String typ = "" ; String eigenschaften = "" ; <START_BUG> model . addRow ( new Object [ ] { typ , g , g . getNumGen ( ) . toString ( ) , g . getDescription ( ) , eigenschaften } ) ; <END_BUG> } if ( ( scroll ) != null ) remove ( scroll ) ; scroll = new JScrollPane ( tabelle ) ; add ( scroll , BorderLayout . CENTER ) ; } @ Override public void actionPerformed ( ActionEvent arg0 ) { } }

Fix:
model . addRow ( new Object [ ] { typ , g , g . getNumGen ( ) . toString ( ) , g . getBeschreibung ( ) , eigenschaften } ) ;
Buggy code:
public class HelloConsumerApplication implements IDistributionConstants , IApplication , ServiceTrackerCustomizer { public static final String CONSUMER_NAME = "org.eclipse.ecf.examples.remoteservices.hello.consumer" ; private BundleContext bundleContext ; private ServiceTracker containerFactoryServiceTracker ; private String containerType = "ecf.r_osgi.peer" ; private final Object appLock = new Object ( ) ; private boolean done = false ; private ServiceTracker helloServiceTracker ; public Object start ( IApplicationContext appContext ) throws Exception { } private void startLocalDiscoveryIfPresent ( ) { } private Filter createRemoteFilter ( ) throws InvalidSyntaxException { <START_BUG> return bundleContext . createFilter ( ( ( ( ( ( ( "(|(" + ( Constants . OBJECTCLASS ) ) + "=" ) + ( IHello . class . getName ( ) ) ) + ")(" ) + ( SERVICE_IMPORTED ) ) + "=*))" ) ) ; <END_BUG> } public void stop ( ) { } private IContainerFactory getContainerFactory ( ) { } private void processArgs ( IApplicationContext appContext ) { } private void waitForDone ( ) { } public Object addingService ( ServiceReference reference ) { } public void modifiedService ( ServiceReference reference , Object service ) { } public void removedService ( ServiceReference reference , Object service ) { } }

Fix:
return bundleContext . createFilter ( ( ( ( ( ( ( "(&(" + ( Constants . OBJECTCLASS ) ) + "=" ) + ( IHello . class . getName ( ) ) ) + ")(" ) + ( SERVICE_IMPORTED ) ) + "=*))" ) ) ;
Buggy code:
public class DataImportHandler extends RequestHandlerBase implements SolrCoreAware { private static final Logger LOG = LoggerFactory . getLogger ( DataImportHandler . class ) ; private DataImporter importer ; private boolean debugEnabled = true ; private String myName = "dataimport" ; @ Override @ SuppressWarnings ( "unchecked" ) public void init ( NamedList args ) { } @ Override @ SuppressWarnings ( "unchecked" ) public void inform ( SolrCore core ) { try { for ( Map . Entry < String , SolrRequestHandler > e : core . getRequestHandlers ( ) . entrySet ( ) ) { SolrRequestHandler handler = e . getValue ( ) ; if ( ( this ) == handler ) { String name = e . getKey ( ) ; if ( name . startsWith ( "//" ) ) { myName = name . substring ( 1 ) ; } myName = myName . replaceAll ( "//" , "_" ) ; } } debugEnabled = StrUtils . parseBool ( ( ( String ) ( initArgs . get ( DataImportHandler . ENABLE_DEBUG ) ) ) , true ) ; importer = new DataImporter ( core , myName ) ; <START_BUG> } catch ( Throwable e ) { <END_BUG> DataImportHandler . LOG . error ( LOAD_EXP , e ) ; throw new org . apache . solr . common . SolrException ( ErrorCode . SERVER_ERROR , MSG . LOAD_EXP , e ) ; } } @ Override @ SuppressWarnings ( "unchecked" ) public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } private Map < String , Object > getParamsMap ( SolrParams params ) { } private SolrWriter getSolrWriter ( final UpdateRequestProcessor processor , final SolrResourceLoader loader , final RequestInfo requestParams , SolrQueryRequest req ) { } @ Override @ SuppressWarnings ( "unchecked" ) public NamedList getStatistics ( ) { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } public static final String ENABLE_DEBUG = "enableDebug" ; }

Fix:
} catch ( Exception e ) {
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; int lastSelected = - 1 ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { } void createItem ( TabItem item , int index ) { } void createWidget ( ) { } void destroyItem ( TabItem item ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } Rect getInset ( ) { } int kEventControlApplyBackground ( int nextHandler , int theEvent , int userData ) { } int kEventControlHit ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { super . removeControl ( control ) ; <START_BUG> int count = getItemCount ( ) ; <END_BUG> for ( int i = 0 ; i < count ; i ++ ) { TabItem item = items [ i ] ; if ( ( item . control ) == control ) item . setControl ( null ) ; } } public void removeSelectionListener ( SelectionListener listener ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setSelection ( TabItem [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } boolean traversePage ( boolean next ) { } }

Fix:
int count = OS . GetControl32BitMaximum ( handle ) ;
Buggy code:
public abstract class AbstractClosureTest { @ Test public void closureSanityTests ( ) throws Exception { <START_BUG> Closure < ? > closure = generateClosure ( ) ; <END_BUG> Assert . assertNotNull ( closure ) ; } protected abstract < T > Closure < T > generateClosure ( ) { } }

Fix:
final Closure < ? > closure = generateClosure ( ) ;
Buggy code:
public class DatabasesCollector { private final AbstractMeta meta ; private final Repository repository ; private List < String > dbNames ; private Map < String , DatabaseMeta > names2metas ; public DatabasesCollector ( AbstractMeta meta , Repository repository ) { } public void collectDatabases ( ) throws KettleException { } public List < String > getDatabaseNames ( ) { } public DatabaseMeta getMetaFor ( String dbName ) { if ( ( names2metas ) == null ) { throw DatabasesCollector . exception ( ) ; } <START_BUG> return names2metas . get ( dbName . toLowerCase ( ) ) ; <END_BUG> } private static IllegalStateException exception ( ) { } }

Fix:
return names2metas . get ( dbName ) ;