nus-yam/ex-repair huggingface dataset:
Buggy code:
public class FilesMatch implements Condition { private File file1 ; private File file2 ; private FileUtils fu = FileUtils . newFileUtils ( ) ; public void setFile1 ( File file1 ) { } public void setFile2 ( File file2 ) { } public boolean eval ( ) throws BuildException { if ( ( ( file1 ) == null ) || ( ( file2 ) == null ) ) { <START_BUG> throw new BuildException ( "both<seq2seq4repair_space>file1<seq2seq4repair_space>and<seq2seq4repair_space>file2<seq2seq4repair_space>are<seq2seq4repair_space>required<seq2seq4repair_space>in<seq2seq4repair_space>fileequals" ) ; <END_BUG> } boolean matches = false ; try { matches = fu . contentEquals ( file1 , file2 ) ; } catch ( IOException ioe ) { throw new BuildException ( "when<seq2seq4repair_space>comparing<seq2seq4repair_space>files" , ioe ) ; } return matches ; } }

Fix:
throw new BuildException ( "both<seq2seq4repair_space>file1<seq2seq4repair_space>and<seq2seq4repair_space>file2<seq2seq4repair_space>are<seq2seq4repair_space>required<seq2seq4repair_space>in<seq2seq4repair_space>filesmatch" ) ;
Buggy code:
public class ParticlePagerActivity extends ActionBarActivity implements CalculateFragment . MassViewHider , CalculateFragment . OnCalculateClickListener { public static final int CUSTOM_PARTICLES_ACTIVITY_REQUEST_CODE = 1 ; private ViewPager theViewPager ; private SlidingTabLayout slidingTabLayout ; private DrawerLayout drawerLayout ; private ListView drawerListView ; private Particle [ ] particles ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_element_pager ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; getSupportActionBar ( ) . setHomeButtonEnabled ( true ) ; slidingTabLayout = ( ( SlidingTabLayout ) ( findViewById ( sliding_tabs ) ) ) ; theViewPager = ( ( ViewPager ) ( findViewById ( view_pager ) ) ) ; drawerLayout = ( ( DrawerLayout ) ( findViewById ( drawer_layout ) ) ) ; drawerListView = ( ( ListView ) ( findViewById ( drawer_listView ) ) ) ; drawerLayout . setDrawerShadow ( drawer_shadow , START ) ; loadParticles ( ) ; setListViewAdapter ( ) ; drawerListView . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { drawerLayout . closeDrawer ( drawerListView ) ; theViewPager . setCurrentItem ( position , true ) ; } } ) ; <START_BUG> drawerListView . setBackgroundColor ( getResources ( ) . getColor ( background_dark ) ) ; <END_BUG> setUpViewPagerAndSlidingTabLayout ( ) ; theViewPager . setCurrentItem ( 0 ) ; } private void setListViewAdapter ( ) { } private void setUpViewPagerAndSlidingTabLayout ( ) { } private void loadParticles ( ) { } private String getFile ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void startCustomParticlesActivity ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public Particle onRequestParticle ( ) { } @ Override public boolean hideMassView ( ) { } No newline ; at end ; of file ; }

Fix:
drawerListView . setBackgroundColor ( getResources ( ) . getColor ( molu_background_color_drawer_list ) ) ;
Buggy code:
public class DeploymentOverlayDeploymentAdd extends AbstractAddStepHandler { private final DeploymentOverlayPriority priority ; public DeploymentOverlayDeploymentAdd ( final DeploymentOverlayPriority priority ) { } @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } static void installServices ( final OperationContext context , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers , final String name , final String deploymentOverlay , final boolean regularExpression , final DeploymentOverlayPriority priority ) { final DeploymentOverlayLinkService service = new DeploymentOverlayLinkService ( name , regularExpression , priority ) ; <START_BUG> final ServiceName serviceName = SERVICE_NAME . append ( name ) ; <END_BUG> ServiceBuilder < DeploymentOverlayLinkService > builder = context . getServiceTarget ( ) . addService ( serviceName , service ) . addDependency ( DeploymentOverlayIndexService . SERVICE_NAME , DeploymentOverlayIndexService . class , service . getDeploymentOverlayIndexServiceInjectedValue ( ) ) . addDependency ( DeploymentOverlayService . SERVICE_NAME . append ( deploymentOverlay ) , DeploymentOverlayService . class , service . getDeploymentOverlayServiceInjectedValue ( ) ) ; if ( verificationHandler != null ) { builder . addListener ( verificationHandler ) ; } final ServiceController < DeploymentOverlayLinkService > controller = builder . install ( ) ; if ( newControllers != null ) { newControllers . add ( controller ) ; } } }

Fix:
final ServiceName serviceName = SERVICE_NAME . append ( deploymentOverlay ) . append ( name ) ;
Buggy code:
public class MessageBox extends Dialog { String message = "" ; int handle ; public MessageBox ( Shell parent ) { } public MessageBox ( Shell parent , int style ) { } public String getMessage ( ) { } public void setMessage ( String string ) { } public int open ( ) { int parentHandle = ( ( parent ) != null ) ? parent . topHandle ( ) : 0 ; int dialogFlags = OS . GTK_DIALOG_DESTROY_WITH_PARENT ; if ( ( ( style ) & ( ( ( SWT . PRIMARY_MODAL ) | ( SWT . APPLICATION_MODAL ) ) | ( SWT . SYSTEM_MODAL ) ) ) != 0 ) { dialogFlags |= OS . GTK_DIALOG_MODAL ; } int messageType = OS . GTK_MESSAGE_INFO ; if ( ( ( style ) & ( SWT . ICON_WARNING ) ) != 0 ) messageType = OS . GTK_MESSAGE_WARNING ; if ( ( ( style ) & ( SWT . ICON_QUESTION ) ) != 0 ) messageType = OS . GTK_MESSAGE_QUESTION ; if ( ( ( style ) & ( SWT . ICON_ERROR ) ) != 0 ) messageType = OS . GTK_MESSAGE_ERROR ; byte [ ] buffer = Converter . wcsToMbcs ( null , fixPercent ( message ) , true ) ; handle = OS . gtk_message_dialog_new ( parentHandle , dialogFlags , messageType , 0 , buffer ) ; if ( ( handle ) == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; if ( parentHandle != 0 ) { int pixbufs = OS . gtk_window_get_icon_list ( parentHandle ) ; if ( pixbufs != 0 ) { OS . gtk_window_set_icon_list ( handle , pixbufs ) ; OS . g_list_free ( pixbufs ) ; } } createButtons ( ) ; buffer = Converter . wcsToMbcs ( null , title , true ) ; OS . gtk_window_set_title ( handle , buffer ) ; Display display = ( ( parent ) != null ) ? parent . getDisplay ( ) : Display . getCurrent ( ) ; display . addIdleProc ( ) ; Dialog oldModal = null ; if ( OS . gtk_window_get_modal ( handle ) ) { oldModal = display . getModalDialog ( ) ; display . setModalDialog ( this ) ; } int signalId = 0 ; int hookId = 0 ; if ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) { signalId = OS . g_signal_lookup ( map , OS . GTK_TYPE_WIDGET ( ) ) ; <START_BUG> hookId = OS . g_signal_add_emission_hook ( signalId , 0 , display . setDirectionProc , handle , 0 ) ; <END_BUG> } int response = OS . gtk_dialog_run ( handle ) ; if ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) { OS . g_signal_remove_emission_hook ( signalId , hookId ) ; } if ( OS . gtk_window_get_modal ( handle ) ) { display . setModalDialog ( oldModal ) ; } display . removeIdleProc ( ) ; OS . gtk_widget_destroy ( handle ) ; return response ; } private void createButtons ( ) { } private static int checkStyle ( int style ) { } static int checkStyle ( Shell parent , int style ) { } char [ ] fixPercent ( String string ) { } }

Fix:
hookId = OS . g_signal_add_emission_hook ( signalId , 0 , display . emissionProc , handle , 0 ) ;
Buggy code:
public class Benchmark { private PerfRunData runData ; private Algorithm algorithm ; private boolean executed ; public Benchmark ( Reader algReader ) throws Exception { } public synchronized void execute ( ) throws Exception { if ( executed ) { <START_BUG> throw new Exception ( "Benchmark<seq2seq4repair_space>was<seq2seq4repair_space>already<seq2seq4repair_space>executed" ) ; <END_BUG> } executed = true ; algorithm . execute ( ) ; } public static void main ( String [ ] args ) { } public Algorithm getAlgorithm ( ) { } public PerfRunData getRunData ( ) { } }

Fix:
throw new IllegalStateException ( "Benchmark<seq2seq4repair_space>was<seq2seq4repair_space>already<seq2seq4repair_space>executed" ) ;
Buggy code:
public class Game { private Team home ; private Team away ; private BoxScore boxscore ; public Game ( Team h , Team a ) { } public Team winner ( ) { <START_BUG> return ( home . getDoubStat ( "Points" ) ) > ( away . getDoubStat ( "Point" ) ) ? home : away ; <END_BUG> } public void end ( ) { } public Team onOffense ( ) { } public Team other ( Team t ) { } public StatLine statLine ( Team t ) { } public StatLine homeStatLine ( ) { } public StatLine awayStatLine ( ) { } public Team homeTeam ( ) { } public Team awayTeam ( ) { } public void tipoff ( ) { } }

Fix:
return ( boxscore . getHome ( ) . get ( "Points" ) ) > ( boxscore . getAway ( ) . get ( "Points" ) ) ? home : away ;
Buggy code:
public class DefaultCMSetter extends BaseInterceptor { public DefaultCMSetter ( ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void contextInit ( Context ctx ) throws TomcatException { } private void initURLs ( Context context ) { ServletLoader loader = context . getServletLoader ( ) ; if ( loader == null ) return ; String base = context . getDocBase ( ) ; File dir = new File ( ( base + "//WEB-INF//classes" ) ) ; if ( ! ( dir . isAbsolute ( ) ) ) { ContextManager cm = context . getContextManager ( ) ; dir = new File ( cm . getHome ( ) , ( base + "//WEB-INF//classes" ) ) ; } if ( dir . exists ( ) ) { loader . addRepository ( dir ) ; } File f = new File ( ( base + "//WEB-INF//lib" ) ) ; Vector jars = new Vector ( ) ; getJars ( jars , f ) ; for ( int i = 0 ; i < ( jars . size ( ) ) ; ++ i ) { String jarfile = ( ( String ) ( jars . elementAt ( i ) ) ) ; <START_BUG> loader . addRepository ( new File ( ( ( base + "//WEB-INF//" ) + jarfile ) ) ) ; <END_BUG> } } private void getJars ( Vector v , File f ) { } private void setWorkDir ( Context ctx ) { } private void setEngineHeader ( Context ctx ) { } }

Fix:
loader . addRepository ( new File ( ( ( base + "//WEB-INF//lib//" ) + jarfile ) ) ) ;
Buggy code:
public class WorkbenchAction extends ActionDelegate implements IWorkbenchWindowActionDelegate { public void run ( ) { IResource resource = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; <START_BUG> ClientConnectAction action = new ClientConnectAction ( ) ; <END_BUG> action . setProject ( resource ) ; } protected IWorkbench getWorkbench ( ) { } public void dispose ( ) { } public void init ( IWorkbenchWindow window ) { } public void run ( IAction action ) { } public void selectionChanged ( IAction action , ISelection selection ) { } }

Fix:
URIClientConnectAction action = new URIClientConnectAction ( ) ;
Buggy code:
public final class JDBCCustomFinderQuery implements JDBCQueryCommand { private final Logger log ; private final Method finderMethod ; private final JDBCReadAheadMetaData readAheadMetaData ; private final ReadAheadCache readAheadCache ; private final JDBCStoreManager manager ; public JDBCCustomFinderQuery ( JDBCStoreManager manager , Method finderMethod ) { } public JDBCStoreManager getSelectManager ( ) { } public Collection execute ( Method unused , Object [ ] args , CmpEntityBeanContext ctx , EntityProxyFactory factory ) throws FinderException { try { Object value ; final EntityBeanComponentInstance componentInstance = ctx . getComponent ( ) . getCache ( ) . get ( ctx . getPrimaryKey ( ) ) ; try { value = finderMethod . invoke ( componentInstance , args ) ; } finally { ctx . getComponent ( ) . getCache ( ) . release ( componentInstance , true ) ; } if ( value instanceof Enumeration ) { Enumeration enumeration = ( ( Enumeration ) ( value ) ) ; List result = new ArrayList ( ) ; while ( enumeration . hasMoreElements ( ) ) { result . add ( enumeration . nextElement ( ) ) ; } cacheResults ( result ) ; return Util . getEntityCollection ( factory , result ) ; } else if ( value instanceof Collection ) { List result ; if ( value instanceof List ) result = ( ( List ) ( value ) ) ; else result = new ArrayList ( ( ( Collection ) ( value ) ) ) ; cacheResults ( result ) ; return Util . getEntityCollection ( factory , result ) ; } else { return Collections . singleton ( ( value != null ? factory . getEntityObject ( value ) : null ) ) ; } } catch ( IllegalAccessException e ) { log . error ( ( "Error<seq2seq4repair_space>invoking<seq2seq4repair_space>custom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) , e ) ; throw new FinderException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>finder<seq2seq4repair_space>implementation:<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) ) ; } catch ( IllegalArgumentException e ) { log . error ( ( "Error<seq2seq4repair_space>invoking<seq2seq4repair_space>custom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) , e ) ; throw new FinderException ( ( ( "Illegal<seq2seq4repair_space>arguments<seq2seq4repair_space>for<seq2seq4repair_space>finder<seq2seq4repair_space>" + "implementation:<seq2seq4repair_space>" ) + ( finderMethod . getName ( ) ) ) ) ; } catch ( InvocationTargetException e ) { Throwable ex = e . getTargetException ( ) ; if ( ex instanceof FinderException ) { throw ( ( FinderException ) ( ex ) ) ; } else { <START_BUG> throw new FinderException ( ( ( ( "Errror<seq2seq4repair_space>invoking<seq2seq4repair_space>cutom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) + ":<seq2seq4repair_space>" ) + ex ) ) ; <END_BUG> } } } private void cacheResults ( List listOfPKs ) { } }

Fix:
throw new FinderException ( ( ( ( "Error<seq2seq4repair_space>invoking<seq2seq4repair_space>custom<seq2seq4repair_space>finder<seq2seq4repair_space>" + ( finderMethod . getName ( ) ) ) + ":<seq2seq4repair_space>" ) + ex ) ) ;
Buggy code:
public class VehicleBase extends Entity implements IEntityAdditionalSpawnData { public float length ; private OBB obb ; public VehicleBase ( World world ) { } @ Override protected void entityInit ( ) { } @ Override public void onUpdate ( ) { } @ Override protected void setSize ( float width , float height ) { } @ Override public void setPosition ( double x , double y , double z ) { } protected final void updateBoundingBox ( ) { } @ Override public AxisAlignedBB getBoundingBox ( ) { } @ Override public void applyEntityCollision ( Entity collider ) { <START_BUG> AWLog . logDebug ( ( "applyEntityCollision:<seq2seq4repair_space>" + collider ) ) ; <END_BUG> super . applyEntityCollision ( collider ) ; } @ Override public void onCollideWithPlayer ( EntityPlayer player ) { } @ Override public AxisAlignedBB getCollisionBox ( Entity entity ) { } @ Override public boolean canBeCollidedWith ( ) { } @ Override public boolean canBePushed ( ) { } @ Override protected void readEntityFromNBT ( NBTTagCompound var1 ) { } @ Override protected void writeEntityToNBT ( NBTTagCompound var1 ) { } @ Override public void writeSpawnData ( ByteBuf buffer ) { } @ Override public void readSpawnData ( ByteBuf additionalData ) { } }

Fix:
AWLog . logDebug ( ( ( ( "applyEntityCollision:<seq2seq4repair_space>" + collider ) + "<seq2seq4repair_space>collides:<seq2seq4repair_space>" ) + ( obb . collides ( collider . boundingBox ) ) ) ) ;
Buggy code:
public final class ThreadFactoryThreadNamePatternUpdate extends AbstractThreadsSubsystemUpdate < Void > { private static final long serialVersionUID = 4253625376544201028L ; private final String name ; private final String newNamePattern ; public ThreadFactoryThreadNamePatternUpdate ( final String name , final String newNamePattern ) { } public ThreadFactoryThreadNamePatternUpdate getCompensatingUpdate ( final ThreadsSubsystemElement original ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { <START_BUG> final ServiceController < ? > service = updateContext . getServiceContainer ( ) . getService ( ThreadsServices . threadFactoryName ( name ) ) ; <END_BUG> if ( service == null ) { handler . handleFailure ( notConfigured ( ) , param ) ; } else { try { final ThreadFactoryService threadFactoryService = ( ( ThreadFactoryService ) ( service . getValue ( ) ) ) ; threadFactoryService . setNamePattern ( newNamePattern ) ; handler . handleSuccess ( null , param ) ; } catch ( Throwable t ) { handler . handleFailure ( t , param ) ; } } } protected void applyUpdate ( final ThreadsSubsystemElement element ) throws UpdateFailedException { } public String getName ( ) { } public String getNewNamePattern ( ) { } private UpdateFailedException notConfigured ( ) { } }

Fix:
final ServiceController < ? > service = updateContext . getServiceRegistry ( ) . getService ( ThreadsServices . threadFactoryName ( name ) ) ;
Buggy code:
public class StoryStatistic { private int id ; private String storyId ; private Date startTime ; private Date endTime ; private long duration ; private int distance ; private boolean isSaved ; private List < Location > locations ; public StoryStatistic ( String storyId , Date startTime ) { } public int saveToDatebase ( Context context ) { } private void saveLocations ( Database database , int statisticId ) { } public String formatStatistic ( ) { } public boolean isSaved ( ) { } public void addLocation ( Location location ) { if ( ! ( locations . isEmpty ( ) ) ) { <START_BUG> distance += locations . get ( locations . size ( ) ) . distanceTo ( location ) ; <END_BUG> } locations . add ( location ) ; } public String getStoryId ( ) { } public List < Location > getLocations ( ) { } public double getLocationLatitude ( int index ) { } public double getLocationLongitude ( int index ) { } public void setDuration ( long duration ) { } public long getDuration ( ) { } public void setDistance ( int distance ) { } public int getDistance ( ) { } public void setSaved ( boolean saved ) { } public void sortLocations ( ) { } public int getId ( ) { } public void setId ( int id ) { } public boolean hasId ( ) { } }

Fix:
distance += locations . get ( ( ( locations . size ( ) ) - 1 ) ) . distanceTo ( location ) ;
Buggy code:
public class WebSocketServerSockJsSession extends AbstractSockJsSession implements DelegatingWebSocketSession < WebSocketSession > { private WebSocketSession wsSession ; public WebSocketServerSockJsSession ( String id , SockJsServiceConfig config , WebSocketHandler wsHandler , Map < String , Object > attributes ) { } @ Override public URI getUri ( ) { } @ Override public HttpHeaders getHandshakeHeaders ( ) { } @ Override public Principal getPrincipal ( ) { } @ Override public InetSocketAddress getLocalAddress ( ) { } @ Override public InetSocketAddress getRemoteAddress ( ) { } @ Override public String getAcceptedProtocol ( ) { } private void checkDelegateSessionInitialized ( ) { } @ Override public void afterSessionInitialized ( WebSocketSession session ) { } @ Override public boolean isActive ( ) { } public void handleMessage ( TextMessage message , WebSocketSession wsSession ) throws Exception { String payload = message . getPayload ( ) ; if ( StringUtils . isEmpty ( payload ) ) { logger . trace ( "Ignoring<seq2seq4repair_space>empty<seq2seq4repair_space>message" ) ; return ; } String [ ] messages ; try { messages = getSockJsServiceConfig ( ) . getMessageCodec ( ) . decode ( payload ) ; <START_BUG> } catch ( IOException ex ) { <END_BUG> logger . error ( "Broken<seq2seq4repair_space>data<seq2seq4repair_space>received.<seq2seq4repair_space>Terminating<seq2seq4repair_space>WebSocket<seq2seq4repair_space>connection<seq2seq4repair_space>abruptly" , ex ) ; tryCloseWithSockJsTransportError ( ex , BAD_DATA ) ; return ; } delegateMessages ( messages ) ; } @ Override public void sendMessageInternal ( String message ) throws SockJsTransportFailureException { } @ Override protected void writeFrameInternal ( SockJsFrame frame ) throws IOException { } @ Override protected void disconnect ( CloseStatus status ) throws IOException { } }

Fix:
} catch ( Throwable ex ) {
Buggy code:
public class MissingLanguageTagTest extends QSkosTestCase { private QSkos qSkosComponents ; private QSkos qSkosDeprecatedAndIllegal ; @ Before public void setUp ( ) throws IOException , OpenRDFException { } @ Test public void testMissingLangTagCount_1 ( ) throws OpenRDFException { Map < String , Set < Resource > > missingLangTags = qSkosComponents . findMissingLanguageTags ( ) ; <START_BUG> Assert . assertEquals ( 2 , missingLangTags . size ( ) ) ; <END_BUG> } @ Test public void testMissingLangTagCount_2 ( ) throws OpenRDFException { } }

Fix:
Assert . assertEquals ( 3 , missingLangTags . size ( ) ) ;
Buggy code:
public class MedianTest extends UnivariateStatisticAbstractTest { protected Median stat ; protected EstimationType estimationType = EstimationType . LEGACY ; @ Override public UnivariateStatistic getUnivariateStatistic ( ) { } private Median getTestMedian ( EstimationType type ) { NaNStrategy strategy = ( type == ( EstimationType . LEGACY ) ) ? NaNStrategy . FIXED : NaNStrategy . REMOVED ; <START_BUG> return new Median ( ) . withEstimationtype ( type ) . withNaNStrategy ( strategy ) ; <END_BUG> } @ Override public double expectedValue ( ) { } @ Before public void before ( ) { } @ Test public void testAllTechniquesSingleton ( ) { } @ Test public void testAllTechniquesMedian ( ) { } protected void testAssertMappedValues ( double [ ] d , Object [ ] [ ] map , Double tolerance ) { } }

Fix:
return new Median ( ) . withEstimationType ( type ) . withNaNStrategy ( strategy ) ;
Buggy code:
public class SSTableExportTest extends SchemaLoader { public String asHex ( String str ) { <START_BUG> return bytesToHex ( ByteBuffer . wrap ( str . getBytes ( ) ) ) ; <END_BUG> } @ Test public void testEnumeratekeys ( ) throws IOException { } @ Test public void testExportSimpleCf ( ) throws IOException { } @ Test public void testExportSuperCf ( ) throws IOException { } @ Test public void testRoundTripStandardCf ( ) throws IOException , ParseException { } }

Fix:
return bytesToHex ( ByteBufferUtil . bytes ( str ) ) ;
Buggy code:
public final class ProxyWeavingHook implements WeavingHook { public static final String WEAVING_ENABLED_CLASSES = "org.apache.aries.proxy.weaving.enabled" ; public static final String WEAVING_DISABLED_CLASSES = "org.apache.aries.proxy.weaving.disabled" ; public static final String WEAVING_ENABLED_CLASSES_DEFAULT = "*" ; public static final String WEAVING_DISABLED_CLASSES_DEFAULT = "org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*" ; private static final Logger LOGGER = LoggerFactory . getLogger ( ProxyWeavingHook . class ) ; private static final String IMPORT_A = "org.apache.aries.proxy.weaving" ; private static final String IMPORT_B = "org.apache.aries.proxy" ; private final List < Pattern > enabled ; private final List < Pattern > disabled ; public ProxyWeavingHook ( BundleContext context ) { } public final void weave ( WovenClass wovenClass ) { Bundle b = wovenClass . getBundleWiring ( ) . getBundle ( ) ; if ( ( ( ( b . getBundleId ( ) ) == 0 ) || ( b . getSymbolicName ( ) . startsWith ( "org.apache.aries.proxy" ) ) ) || ( b . getSymbolicName ( ) . startsWith ( "org.apache.aries.util" ) ) ) { return ; } if ( ( ! ( isEnabled ( wovenClass . getClassName ( ) ) ) ) || ( isDisabled ( wovenClass . getClassName ( ) ) ) ) { return ; } byte [ ] bytes = null ; try { <START_BUG> bytes = WovenProxyGenerator . getWovenProxy ( wovenClass . getBytes ( ) , wovenClass . getClassName ( ) , wovenClass . getBundleWiring ( ) . getClassLoader ( ) ) ; <END_BUG> } catch ( Exception e ) { if ( ( e instanceof RuntimeException ) && ( ( e . getCause ( ) ) instanceof UnableToProxyException ) ) { ProxyWeavingHook . LOGGER . trace ( MESSAGES . getMessage ( "cannot.weave" , wovenClass . getClassName ( ) ) , e ) ; } else { String failureMessage = MESSAGES . getMessage ( "fatal.weaving.failure" , wovenClass . getClassName ( ) ) ; ProxyWeavingHook . LOGGER . error ( failureMessage , e ) ; throw new WeavingException ( failureMessage , e ) ; } } if ( ( bytes != null ) && ( ( bytes . length ) != 0 ) ) { wovenClass . setBytes ( bytes ) ; List < String > imports = wovenClass . getDynamicImports ( ) ; imports . add ( ProxyWeavingHook . IMPORT_A ) ; imports . add ( ProxyWeavingHook . IMPORT_B ) ; } } private List < Pattern > parseMatchers ( String matchers , String def ) { } boolean isEnabled ( String className ) { } boolean isDisabled ( String className ) { } private boolean matches ( List < Pattern > patterns , String className ) { } }

Fix:
bytes = WovenProxyGenerator . getWovenProxy ( wovenClass . getBytes ( ) , wovenClass . getBundleWiring ( ) . getClassLoader ( ) ) ;
Buggy code:
public class DerbyDictionary extends AbstractDB2Dictionary { public boolean shutdownOnClose = true ; public DerbyDictionary ( ) { } public void closeDataSource ( DataSource dataSource ) { } @ Override protected Boolean matchErrorState ( int subtype , Set < String > errorStates , SQLException ex ) { Boolean recoverable = null ; String errorState = ex . getSQLState ( ) ; int errorCode = ex . getErrorCode ( ) ; if ( errorStates . contains ( errorState ) ) { recoverable = Boolean . FALSE ; <START_BUG> if ( ( subtype == ( StoreException . LOCK ) ) && ( errorCode < 30000 ) ) { <END_BUG> recoverable = Boolean . TRUE ; } } return recoverable ; } }

Fix:
if ( ( ( subtype == ( StoreException . LOCK ) ) || ( subtype == ( StoreException . QUERY ) ) ) && ( errorCode < 30000 ) ) {
Buggy code:
public class AssertionVisualizer extends AbstractVisualizer implements Clearable { private JTextArea textArea ; public AssertionVisualizer ( ) { } public String getStaticLabel ( ) { } public void add ( SampleResult sample ) { <START_BUG> textArea . append ( ( ( String ) ( sample . getSampleLabel ( ) ) ) ) ; <END_BUG> textArea . append ( getAssertionResult ( sample ) ) ; textArea . append ( "\n" ) ; } public void clear ( ) { } private String getAssertionResult ( SampleResult res ) { } private void init ( ) { } }

Fix:
textArea . append ( sample . getSamplerData ( ) . toString ( ) ) ;
Buggy code:
public abstract class AjaxSubmitLink extends AbstractSubmitLink { private static final long serialVersionUID = 1L ; public AjaxSubmitLink ( String id ) { } public AjaxSubmitLink ( String id , final Form form ) { } protected IAjaxCallDecorator getAjaxCallDecorator ( ) { } protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; if ( isLinkEnabled ( ) ) { <START_BUG> checkComponentTag ( tag , "a" ) ; <END_BUG> tag . put ( "href" , "#" ) ; } else { disableLink ( tag ) ; } } public final void onSubmit ( ) { } protected abstract void onSubmit ( AjaxRequestTarget target , Form form ) { } protected void onError ( AjaxRequestTarget target , Form form ) { } }

Fix:
if ( tag . getName ( ) . toLowerCase ( ) . equals ( "a" ) )
Buggy code:
public class P4Counter extends P4Base { public String counter = null ; public String property = null ; public boolean shouldSetValue = false ; public boolean shouldSetProperty = false ; public int value = 0 ; public void setName ( String counter ) { } public void setValue ( int value ) { } public void setProperty ( String property ) { } public void execute ( ) throws BuildException { if ( ( ( counter ) == null ) || ( ( counter . length ( ) ) == 0 ) ) { throw new BuildException ( "No<seq2seq4repair_space>counter<seq2seq4repair_space>specified<seq2seq4repair_space>to<seq2seq4repair_space>retrieve" ) ; } if ( ( shouldSetValue ) && ( shouldSetProperty ) ) { throw new BuildException ( "Cannot<seq2seq4repair_space>both<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>property<seq2seq4repair_space>and<seq2seq4repair_space>retrieve<seq2seq4repair_space>the<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>property." ) ; } String command = ( ( "counter<seq2seq4repair_space>" + ( P4CmdOpts ) ) + "<seq2seq4repair_space>" ) + ( counter ) ; if ( ! ( shouldSetProperty ) ) { command = "-s<seq2seq4repair_space>" + command ; } if ( shouldSetValue ) { command += "<seq2seq4repair_space>" + ( value ) ; } if ( shouldSetProperty ) { <START_BUG> final Project myProj = project ; <END_BUG> P4Handler handler = new P4HandlerAdapter ( ) { public void process ( String line ) { log ( ( ( "P4Counter<seq2seq4repair_space>retrieved<seq2seq4repair_space>line<seq2seq4repair_space>\"" + line ) + "\"" ) , MSG_VERBOSE ) ; try { value = Integer . parseInt ( line ) ; myProj . setProperty ( property , ( "" + ( value ) ) ) ; } catch ( NumberFormatException nfe ) { throw new BuildException ( "Perforce<seq2seq4repair_space>error.<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>retrieve<seq2seq4repair_space>counter<seq2seq4repair_space>value." ) ; } } } ; execP4Command ( command , handler ) ; } else { execP4Command ( command , new SimpleP4OutputHandler ( this ) ) ; } } }

Fix:
final Project myProj = getProject ( ) ;
Buggy code:
public class JSystemDataDrivenTask extends PropertyReaderTask { private static final String DELIMITER = ";" ; static Logger log = Logger . getLogger ( JSystemDataDrivenTask . class . getName ( ) ) ; private String type ; private String file ; private String param ; private String lineIndexes ; private boolean shuffle ; private long shuffleSeed ; private boolean reverseOrder ; private List < Map < String , Object > > data ; private int iterationNum = 0 ; public void execute ( ) throws BuildException { } private DataProvider initProvider ( ) { } private void shuffleData ( ) { } private void loadParameters ( ) { } private void filterData ( ) { } private void convertDataToLoop ( ) { final String paramName = data . get ( 0 ) . keySet ( ) . toArray ( new String [ ] { } ) [ 0 ] ; StringBuilder sb = new StringBuilder ( ) ; for ( Map < String , Object > dataRow : data ) { <START_BUG> sb . append ( JSystemDataDrivenTask . DELIMITER ) . append ( dataRow . get ( paramName ) ) ; <END_BUG> } setParam ( "unusedparam" ) ; setList ( sb . toString ( ) . replaceFirst ( JSystemDataDrivenTask . DELIMITER , "" ) ) ; } private static List < Integer > convertStringOfNumbersToList ( final String numbers ) { } @ Override protected void doSequentialIteration ( String val ) { } public String getFile ( ) { } public void setFile ( String file ) { } public String getLineIndexes ( ) { } public void setLineIndexes ( String lineIndexes ) { } }

Fix:
sb . append ( JSystemDataDrivenTask . DELIMITER ) . append ( ( ! ( StringUtils . isEmpty ( dataRow . get ( paramName ) . toString ( ) ) ) ? dataRow . get ( paramName ) : "<seq2seq4repair_space>" ) ) ;
Buggy code:
public class ModClusterDisableContext implements OperationStepHandler , DescriptionProvider { static final ModClusterDisableContext INSTANCE = new ModClusterDisableContext ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "disable-context:<seq2seq4repair_space>%s" , operation ) ; ContextHost contexthost = new ContextHost ( operation ) ; modcluster . disableContext ( contexthost . webhost , contexthost . webcontext ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class RunDetails implements RunListener { private static RunDetails singleton = new RunDetails ( ) ; private static DateFormat timeFormat = new SimpleDateFormat ( "MM-dd_HH-mm-ss-SSS" ) ; private List < Object [ ] > detailsList = new ArrayList < Object [ ] > ( 20 ) ; public static RunDetails instance ( ) { } private RunDetails ( ) { } private long startTime = System . currentTimeMillis ( ) ; public long getStartTime ( ) { } public void setStartTime ( ) { } public String getRootFolder ( ) { } @ Override public boolean beforeRun ( Device currentDevice , String runKey ) { } @ Override public void afterRun ( Device currentDevice , String runKey , boolean successful ) { } public synchronized void writeHTMLIndex ( File rootFolder ) { } public synchronized void writeDefinitionIndex ( File rootFolder ) { StringBuilder stringBuilder = new StringBuilder ( ) ; for ( int i = 0 ; i < ( detailsList . size ( ) ) ; i ++ ) { <START_BUG> String runKey = ( ( String ) ( detailsList . get ( i ) [ 0 ] ) ) . substring ( 25 ) ; <END_BUG> Device device = ( ( Device ) ( detailsList . get ( i ) [ 1 ] ) ) ; String location = ( ( runKey + "//" ) + ( device . getKey ( ) ) ) + "//" ; stringBuilder . append ( runKey ) . append ( "." ) . append ( device . getKey ( ) ) . append ( "=" ) . append ( location ) . append ( "executionDefinition.properties" ) . append ( "\r\n" ) ; } try { File useFile = new File ( rootFolder , ( ( ( getRootFolder ( ) ) + ( System . getProperty ( "file.separator" ) ) ) + "executionMap.properties" ) ) ; useFile . getParentFile ( ) . mkdirs ( ) ; FileWriter fileWriter = new FileWriter ( useFile ) ; fileWriter . write ( stringBuilder . toString ( ) ) ; fileWriter . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public File getIndex ( File rootFolder ) { } }

Fix:
String runKey = ( ( String ) ( detailsList . get ( i ) [ 0 ] ) ) + "" ;
Buggy code:
public class SortParam implements IClusterable { private static final long serialVersionUID = 1L ; private String property ; private boolean asc ; public SortParam ( String property , boolean asc ) { } public boolean isAscending ( ) { } public String getProperty ( ) { } public boolean equals ( Object rhs ) { } public String toString ( ) { <START_BUG> return new StringBuffer ( ) . append ( "[SortParam<seq2seq4repair_space>property=" ) . append ( getProperty ( ) ) . append ( "<seq2seq4repair_space>ascending=" ) . append ( asc ) . append ( "]" ) . toString ( ) ; <END_BUG> } }

Fix:
return new StringBuilder ( ) . append ( "[SortParam<seq2seq4repair_space>property=" ) . append ( getProperty ( ) ) . append ( "<seq2seq4repair_space>ascending=" ) . append ( asc ) . append ( "]" ) . toString ( ) ;
Buggy code:
public class HelloClientApplication implements IApplication { boolean done = false ; Object appLock = new Object ( ) ; public Object start ( IApplicationContext context ) throws Exception { } public void stop ( ) { synchronized ( appLock ) { done = true ; <START_BUG> notifyAll ( ) ; <END_BUG> } } }

Fix:
appLock . notifyAll ( ) ;
Buggy code:
public class ArgsPointcut extends NameBindingPointcut { TypePatternList arguments ; public ArgsPointcut ( TypePatternList arguments ) { } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { <START_BUG> arguments . resolveBindings ( scope , bindings , true ) ; <END_BUG> if ( ( arguments . ellipsisCount ) > 1 ) { scope . message ( ERROR , this , "uses<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>..<seq2seq4repair_space>in<seq2seq4repair_space>args<seq2seq4repair_space>(compiler<seq2seq4repair_space>limitation)" ) ; } } public void postRead ( ResolvedTypeX enclosingType ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { } private Test findResidueNoEllipsis ( Shadow shadow , ExposedState state , TypePattern [ ] patterns ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public String toString ( ) { } }

Fix:
arguments . resolveBindings ( scope , bindings , true , true ) ;
Buggy code:
public class StudyBenefitRiskAnalysisTest { private static final String NAME = "Je<seq2seq4repair_space>Moeder" ; private StudyBenefitRiskAnalysis d_analysis ; private Arm d_baseline ; private Arm d_subject ; @ Before public void setUp ( ) { } @ Test public void testInitialization ( ) { } private StudyBenefitRiskAnalysis buildOtherBaseline ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testBadInitialization ( ) { } @ Test public void testDependencies ( ) { } @ Test public void testCompareTo ( ) { } @ Test public void testDeepEquals ( ) { } @ Test public void testGetMeasurementForRateOutcome ( ) { } @ Test public void testGetMeasurementForContinuousOutcome ( ) { Indication indication = ExampleData . buildIndicationDepression ( ) ; Study study = ExampleData . buildStudyChouinard ( ) ; List < OutcomeMeasure > criteria = new ArrayList < OutcomeMeasure > ( ) ; Endpoint endpoint = ExampleData . buildEndpointCgi ( ) ; criteria . add ( endpoint ) ; criteria . add ( ExampleData . buildAdverseEventConvulsion ( ) ) ; List < Arm > alternatives = study . getArms ( ) ; d_analysis = new StudyBenefitRiskAnalysis ( StudyBenefitRiskAnalysisTest . NAME , indication , study , criteria , alternatives , AnalysisType . SMAA ) ; Arm arm = study . getArms ( ) . get ( 1 ) ; ContinuousMeasurement measurement = ( ( ContinuousMeasurement ) ( study . getMeasurement ( endpoint , arm ) ) ) ; <START_BUG> TransformedStudentTBase expected = new org . drugis . addis . entities . relativeeffect . TransformedStudentT ( measurement . getMean ( ) , measurement . getStdDev ( ) , ( ( measurement . getSampleSize ( ) ) - 1 ) ) ; <END_BUG> assertEquals ( expected , d_analysis . getMeasurement ( endpoint , arm ) ) ; } @ Test public void testLyndOBrienException ( ) throws IllegalArgumentException { } @ Test public void testRelativeEffectDistribution ( ) { } @ Test public void testCorrectedRelativeEffectDistribution ( ) { } @ Test public void testCorrectedRelativeEffectDistribution2 ( ) { } @ Test public void testNullIfRelativeEffectDistributionUncorrectable ( ) { } }

Fix:
TransformedStudentTBase expected = new org . drugis . addis . entities . relativeeffect . TransformedStudentT ( measurement . getMean ( ) , ( ( measurement . getStdDev ( ) ) // ( Math . sqrt ( measurement . getSampleSize ( ) ) ) ) , ( ( measurement . getSampleSize ( ) ) - 1 ) ) ;
Buggy code:
public class Transformer { public static void transform ( String in , String out , Filter [ ] filters ) throws FileNotFoundException , IOException , UnexpectedFormatException { Perl5Util util = new Perl5Util ( ) ; String line ; BufferedReader input = new BufferedReader ( new FileReader ( in ) ) ; <START_BUG> PrintStream output = new PrintStream ( new FileOutputStream ( out ) ) ; <END_BUG> while ( ( line = input . readLine ( ) ) != null ) { for ( int i = 0 ; i < ( filters . length ) ; i ++ ) { line = filters [ i ] . filter ( line ) ; } output . println ( line ) ; } } public static void transform ( String in , String out , Filter filter ) throws FileNotFoundException , IOException , UnexpectedFormatException { } }

Fix:
PrintStream output = new PrintStream ( new FileOutputStream ( out , false ) ) ;
Buggy code:
public class ToolBar extends Composite { int itemCount ; ToolItem [ ] items ; NSArray accessibilityAttributes = null ; public ToolBar ( Composite parent , int style ) { } int accessibilityAttributeNames ( int id , int sel ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { NSString nsAttributeName = new NSString ( arg0 ) ; if ( ( accessible ) != null ) { id returnObject = accessible . internal_accessibilityAttributeValue ( nsAttributeName , CHILDID_SELF ) ; if ( returnObject != null ) return returnObject . id ; } if ( ( nsAttributeName . isEqualToString ( NSAccessibilityRoleAttribute ) ) || ( nsAttributeName . isEqualToString ( NSAccessibilityRoleDescriptionAttribute ) ) ) { NSString role = OS . NSAccessibilityToolbarRole ; if ( nsAttributeName . isEqualToString ( NSAccessibilityRoleAttribute ) ) return role . id ; else { int roleDescription = OS . NSAccessibilityRoleDescription ( role . id , 0 ) ; return roleDescription ; } } else if ( nsAttributeName . isEqualToString ( NSAccessibilityEnabledAttribute ) ) { return NSNumber . numberWithBool ( isEnabled ( ) ) . id ; } else if ( nsAttributeName . isEqualToString ( NSAccessibilityFocusedAttribute ) ) { <START_BUG> boolean focused = ( view . id ) == ( view . window ( ) . firstResponder ( ) . id ) ; <END_BUG> return NSNumber . numberWithBool ( focused ) . id ; } return super . accessibilityAttributeValue ( id , sel , arg0 ) ; } boolean accessibilityIsIgnored ( int id , int sel ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createItem ( ToolItem item , int index ) { } void createWidget ( ) { } void destroyItem ( ToolItem item ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } void enableWidget ( boolean enabled ) { } Widget findTooltip ( NSPoint pt ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point pt ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } int [ ] layoutHorizontal ( int width , int height , boolean resize ) { } int [ ] layoutVertical ( int width , int height , boolean resize ) { } int [ ] layout ( int nWidth , int nHeight , boolean resize ) { } void relayout ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void removeControl ( Control control ) { } void resized ( ) { } void setFont ( NSFont font ) { } public void setRedraw ( boolean redraw ) { } }

Fix:
boolean focused = hasFocus ( ) ;
Buggy code:
public class ArquillianRunWithAnnotationProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final Index index = phaseContext . getAttachment ( ANNOTATION_INDEX ) ; if ( index == null ) return ; final DotName runWithName = DotName . createSimple ( RunWith . class . getName ( ) ) ; final List < AnnotationTarget > targets = index . getAnnotationTargets ( runWithName ) ; if ( ( targets == null ) || ( targets . isEmpty ( ) ) ) return ; <START_BUG> final DeploymentUnit deploymentUnitContext = phaseContext . getDeploymentUnitContext ( ) ; <END_BUG> ArquillianConfig arqConfig = new ArquillianConfig ( deploymentUnitContext ) ; deploymentUnitContext . putAttachment ( KEY , arqConfig ) ; for ( AnnotationTarget target : targets ) { if ( target instanceof ClassInfo ) { final ClassInfo classInfo = ( ( ClassInfo ) ( target ) ) ; final String testClassName = classInfo . name ( ) . toString ( ) ; arqConfig . addTestClass ( testClassName ) ; } } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final DeploymentUnit deploymentUnitContext = phaseContext . getDeploymentUnit ( ) ;
Buggy code:
public class MenuItem extends Item { Menu parent ; Menu menu ; int hBitmap ; 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 destroyWidget ( ) { } boolean 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 releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } 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 ) { checkWidget ( ) ; if ( ( ( style ) & ( SWT . SEPARATOR ) ) != 0 ) return ; super . setImage ( image ) ; if ( OS . IsWinCE ) { if ( ( ( OS . IsPPC ) || ( OS . IsSP ) ) && ( ( parent . hwndCB ) != 0 ) ) { int hwndCB = parent . hwndCB ; TBBUTTONINFO info = new TBBUTTONINFO ( ) ; info . cbSize = TBBUTTONINFO . sizeof ; info . dwMask = OS . TBIF_IMAGE ; info . iImage = parent . imageIndex ( image ) ; OS . SendMessage ( hwndCB , TB_SETBUTTONINFO , id , info ) ; } return ; } if ( ( OS . WIN32_VERSION ) < ( OS . VERSION ( 4 , 10 ) ) ) return ; MENUITEMINFO info = new MENUITEMINFO ( ) ; info . cbSize = MENUITEMINFO . sizeof ; info . fMask = OS . MIIM_BITMAP ; if ( ( parent . foreground ) != ( - 1 ) ) { info . hbmpItem = OS . HBMMENU_CALLBACK ; } else { if ( ( ! ( OS . IsWinCE ) ) && ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 6 , 0 ) ) ) ) { if ( ( hBitmap ) != 0 ) OS . DeleteObject ( hBitmap ) ; info . hbmpItem = hBitmap = ( image != null ) ? Display . create32bitDIB ( image ) : 0 ; } else { <START_BUG> info . hbmpItem = OS . HBMMENU_CALLBACK ; <END_BUG> } } int hMenu = parent . handle ; OS . SetMenuItemInfo ( hMenu , id , false , info ) ; parent . redraw ( ) ; } public void setMenu ( Menu menu ) { } void setMenu ( Menu menu , boolean dispose ) { } 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:
info . hbmpItem = ( image != null ) ? OS . HBMMENU_CALLBACK : 0 ;
Buggy code:
public class CompilerScript { public static void main ( String [ ] args ) { } private static boolean isSupportedJavaVersion ( String version ) { } private static String getJavaVersion ( ) { } private static boolean isEmpty ( String value ) { } private static boolean getBoolean ( String value ) { } private final String srcDir ; private final Set < String > sourceFilePaths ; private final File errorsPropertiesFile ; private CompilerScript ( ) { } private void invoke ( ) { } private void handleFilesWithError ( Set < String > errors , File errorsPropertiesFile ) { } private boolean handleExistingErrors ( ) { PropFile errorsProperties = PropFiles . load ( errorsPropertiesFile . getPath ( ) , false , false ) ; if ( errorsProperties . isEmpty ( ) ) { return false ; } for ( PropFile . Prop error : errorsProperties . props ( ) ) { <START_BUG> Output . print ( error . value ( ) ) ; <END_BUG> } return true ; } private List < String > getCompilerArgs ( ) { } private static String createClasspath ( String localPath , PropFile dependencies ) { } No newline ; at end ; of file ; }

Fix:
Output . print ( error . name ) ;