nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AutomaticIndexStatisticsMultiTest extends BaseJDBCTestCase { private static final String TAB = "MTSEL" ; private static final int _100K = 100000 ; public AutomaticIndexStatisticsMultiTest ( String name ) { } public void testMTSelect ( ) throws Exception { } public void testMTSelectWithDDL ( ) throws Exception { } private void verifyStatistics ( ) throws SQLException { <START_BUG> IndexStatsUtil stats = new IndexStatsUtil ( getConnection ( ) , 2000 ) ; <END_BUG> IdxStats [ ] myStats = stats . getStatsTable ( AutomaticIndexStatisticsMultiTest . TAB , 2 ) ; for ( int i = 0 ; i < ( myStats . length ) ; i ++ ) { IdxStats s = myStats [ i ] ; assertEquals ( AutomaticIndexStatisticsMultiTest . _100K , s . rows ) ; switch ( s . lcols ) { case 1 : assertEquals ( 10 , s . card ) ; break ; case 2 : assertEquals ( AutomaticIndexStatisticsMultiTest . _100K , s . card ) ; break ; default : fail ( ( "unexpected<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>leading<seq2seq4repair_space>columns:<seq2seq4repair_space>" + ( s . lcols ) ) ) ; } } } private void prepareTable ( boolean dropIfExists ) throws SQLException { } public static Test suite ( ) { } private static class MTCompileThread implements Runnable { private final Random rand = new Random ( ) ; private final Connection con ; private final long runTime ; private int count ; private int errorCount ; public MTCompileThread ( Connection con , long runTime ) throws SQLException { } public void run ( ) { } public int getCount ( ) { } public int getErrorCount ( ) { } } private static class MTCreateDropThread implements Runnable { private final Connection con ; private final long runTime ; private long creates ; public MTCreateDropThread ( Connection con , long runTime ) throws SQLException { } public void run ( ) { } public long getCreates ( ) { } } }

Fix:
IndexStatsUtil stats = new IndexStatsUtil ( getConnection ( ) , 5000 ) ;
Buggy code:
public final class ThreadFactoryAdd extends AbstractThreadsSubsystemUpdate < Void > { private static final long serialVersionUID = 1935521612404501853L ; private final Map < String , String > properties = new HashMap < String , String > ( ) ; private final String name ; private String groupName ; private String threadNamePattern ; private Integer priority ; public ThreadFactoryAdd ( final String name ) { } public ThreadFactoryRemove getCompensatingUpdate ( final ThreadsSubsystemElement original ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { final ThreadFactoryService service = new ThreadFactoryService ( ) ; service . setNamePattern ( threadNamePattern ) ; service . setPriority ( priority ) ; service . setThreadGroupName ( groupName ) ; final UpdateResultHandler . ServiceStartListener < P > listener = new UpdateResultHandler . ServiceStartListener < P > ( handler , param ) ; <START_BUG> final BatchBuilder batchBuilder = updateContext . batchBuilder ( ) ; <END_BUG> final BatchServiceBuilder < ThreadFactory > builder = batchBuilder . addService ( Services . threadFactoryName ( name ) , service ) ; builder . addListener ( listener ) ; builder . setInitialMode ( IMMEDIATE ) ; try { batchBuilder . install ( ) ; } catch ( ServiceRegistryException e ) { handler . handleFailure ( e , param ) ; } } protected void applyUpdate ( final ThreadsSubsystemElement element ) throws UpdateFailedException { } public String getGroupName ( ) { } public void setGroupName ( final String groupName ) { } public String getThreadNamePattern ( ) { } public void setThreadNamePattern ( final String threadNamePattern ) { } public Integer getPriority ( ) { } public void setPriority ( final Integer priority ) { } public Map < String , String > getProperties ( ) { } }

Fix:
final BatchBuilder batchBuilder = updateContext . getBatchBuilder ( ) ;
Buggy code:
public class UnboundedQueueThreadPoolService implements Service < ManagedJBossThreadPoolExecutorService > { private final InjectedValue < ThreadFactory > threadFactoryValue = new InjectedValue < ThreadFactory > ( ) ; private ManagedJBossThreadPoolExecutorService executor ; private int maxThreads ; private TimeSpec keepAlive ; public UnboundedQueueThreadPoolService ( int maxThreads , TimeSpec keepAlive ) { } public synchronized void start ( final StartContext context ) throws StartException { } public synchronized void stop ( final StopContext context ) { } public synchronized ManagedJBossThreadPoolExecutorService getValue ( ) throws IllegalStateException { final ManagedJBossThreadPoolExecutorService value = this . executor ; if ( value == null ) { <START_BUG> throw ROOT_LOGGER . unboundedQueueThreadPoolExecutorUninitialized ( ) ; <END_BUG> } return value ; } public Injector < ThreadFactory > getThreadFactoryInjector ( ) { } public synchronized void setMaxThreads ( final int maxThreads ) { } public synchronized void setKeepAlive ( final TimeSpec keepAlive ) { } public int getActiveCount ( ) { } public long getCompletedTaskCount ( ) { } public int getCurrentThreadCount ( ) { } public int getLargestPoolSize ( ) { } public int getLargestThreadCount ( ) { } public int getRejectedCount ( ) { } public long getTaskCount ( ) { } public int getQueueSize ( ) { } TimeUnit getKeepAliveUnit ( ) { } }

Fix:
throw MESSAGES . unboundedQueueThreadPoolExecutorUninitialized ( ) ;
Buggy code:
@ ServiceProvider ( service = Renderer . class , position = 200 ) public class ArrowRenderer implements Renderer { protected final float BASE_RATIO = 0.5F ; protected float defaultArrowSize = 3.0F ; public void preProcess ( PreviewModel previewModel ) { } public void render ( Item item , RenderTarget target , PreviewProperties properties ) { float size = properties . getFloatValue ( ARROW_SIZE ) ; if ( size > 0 ) { Item sourceItem = item . getData ( SOURCE ) ; Item targetItem = item . getData ( TARGET ) ; Float weight = item . getData ( WEIGHT ) ; EdgeColor edgeColor = ( ( EdgeColor ) ( properties . getValue ( EDGE_COLOR ) ) ) ; Color color = edgeColor . getColor ( ( ( Color ) ( item . getData ( COLOR ) ) ) , ( ( Color ) ( sourceItem . getData ( NodeItem . COLOR ) ) ) , ( ( Color ) ( targetItem . getData ( NodeItem . COLOR ) ) ) ) ; int alpha = ( ( int ) ( ( ( properties . getFloatValue ( EDGE_OPACITY ) ) // 100.0F ) * 255.0F ) ) ; color = new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , alpha ) ; float radius = properties . getFloatValue ( EDGE_RADIUS ) ; size *= weight ; <START_BUG> radius = - ( ( radius + ( ( ( Float ) ( targetItem . getData ( SIZE ) ) ) // 2.0F ) ) + ( properties . getFloatValue ( NODE_BORDER_WIDTH ) ) ) ; <END_BUG> if ( radius > 0 ) { radius = 0 ; } Float x1 = sourceItem . getData ( X ) ; Float x2 = targetItem . getData ( X ) ; Float y1 = sourceItem . getData ( Y ) ; Float y2 = targetItem . getData ( Y ) ; if ( properties . getBooleanValue ( EDGE_CURVED ) ) { } else { renderStraight ( target , item , x1 , y1 , x2 , y2 , radius , size , color ) ; } } } public void renderStraight ( RenderTarget target , Item item , float x1 , float y1 , float x2 , float y2 , float radius , float size , Color color ) { } public PreviewProperty [ ] getProperties ( ) { } public boolean isRendererForitem ( Item item , PreviewProperties properties ) { } }

Fix:
radius = - ( ( radius + ( ( ( Float ) ( targetItem . getData ( SIZE ) ) ) // 2.0F ) ) + ( Math . max ( 0 , properties . getFloatValue ( NODE_BORDER_WIDTH ) ) ) ) ;
Buggy code:
public class AuthenticatedWebPage extends WicketExamplePage { private Border border ; public MarkupContainer add ( final Component child ) { } public void removeAll ( ) { } public MarkupContainer replace ( Component child ) { } public LibrarySession getLibrarySession ( ) { } protected boolean checkAccess ( ) { if ( getLibrarySession ( ) . isSignedIn ( ) ) { return true ; } else { <START_BUG> getRequestCycle ( ) . redirectToInterceptPage ( SignIn . class ) ; <END_BUG> return false ; } } }

Fix:
redirectToInterceptPage ( newPage ( SignIn . class ) ) ;
Buggy code:
public class Panel extends HtmlContainer { private static final long serialVersionUID = - 5449444447932560536L ; public Panel ( final String componentName ) { } protected final void handleRender ( final RequestCycle cycle ) { final MarkupStream markupStream = findMarkupStream ( ) ; if ( ! ( markupStream . atOpenCloseTag ( ) ) ) { markupStream . throwMarkupException ( "A<seq2seq4repair_space>panel<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>referenced<seq2seq4repair_space>by<seq2seq4repair_space>an<seq2seq4repair_space>openclose<seq2seq4repair_space>tag." ) ; } renderTag ( cycle , markupStream ) ; <START_BUG> renderAssociatedMarkup ( cycle , "panel" , "Markup<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>panel<seq2seq4repair_space>component<seq2seq4repair_space>must<seq2seq4repair_space>begin<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>'<wicket:panel>'" ) ; <END_BUG> } }

Fix:
renderAssociatedMarkup ( cycle , "panel" , "Markup<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>panel<seq2seq4repair_space>component<seq2seq4repair_space>must<seq2seq4repair_space>begin<seq2seq4repair_space>with<seq2seq4repair_space>'<wicket:panel>'" ) ;
Buggy code:
public class IntegrationJSONTest extends MorcTestBuilder { public void configure ( ) { } protected EtlExecutor newEtlExecutor ( ) { } <START_BUG> protected ConfigurationEl loadConfiguration ( final String path ) { <END_BUG> ConfigurationFactory cf = new ConfigurationFactory ( ) ; final URL resource = this . getClass ( ) . getClassLoader ( ) . getResource ( path ) ; if ( resource == null ) { throw new IllegalStateException ( ( ( "Resource<seq2seq4repair_space>" + path ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; } cf . setResourceURL ( resource ) ; return cf . createConfiguration ( ) ; } }

Fix:
protected ConfigurationEl loadConfiguration ( String path ) {
Buggy code:
public class TestUltrasonic extends Command { public TestUltrasonic ( ) { } protected void initialize ( ) { } protected void execute ( ) { ( foo ) ++ ; if ( ( foo ) == 5 ) { <START_BUG> System . out . println ( ( "Test<seq2seq4repair_space>Ultrasonic:<seq2seq4repair_space>Distance<seq2seq4repair_space>to<seq2seq4repair_space>target:<seq2seq4repair_space>" + ( UltrasonicSensor . getInstance ( ) . getDistance ( ) ) ) ) ; <END_BUG> foo = 0 ; } } protected boolean isFinished ( ) { } protected void end ( ) { } protected void interrupted ( ) { } int foo = 0 ; }

Fix:
System . out . println ( ( "Test<seq2seq4repair_space>Ultrasonic:<seq2seq4repair_space>Distance<seq2seq4repair_space>to<seq2seq4repair_space>target:<seq2seq4repair_space>" + ( UltrasonicSensor . getInstance ( ) . getDistanceDouble ( ) ) ) ) ;
Buggy code:
public class ComponentStringResourceLoader implements IStringResourceLoader { private static final Log log = LogFactory . getLog ( Page . class ) ; private Map resourceCache ; public ComponentStringResourceLoader ( ) { } public final String loadStringResource ( final Component component , final String key , final Locale locale , final String style ) { } private synchronized ValueMap loadResources ( final Component component , final String style , final Locale locale , final String id ) { ValueMap strings = ( ( ValueMap ) ( resourceCache . get ( id ) ) ) ; if ( strings != null ) { return strings ; } final Properties properties = new Properties ( ) ; <START_BUG> final IResourceStream resource = component . getApplication ( ) . getResourceLocator ( ) . locate ( component . getClass ( ) , style , locale , "properties" ) ; <END_BUG> if ( resource != null ) { try { try { properties . load ( new BufferedInputStream ( resource . getInputStream ( ) ) ) ; strings = new ValueMap ( properties ) ; } finally { resource . close ( ) ; } } catch ( ResourceStreamNotFoundException e ) { ComponentStringResourceLoader . log . warn ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>resource<seq2seq4repair_space>" + resource ) , e ) ; strings = ValueMap . EMPTY_MAP ; } catch ( IOException e ) { ComponentStringResourceLoader . log . warn ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>resource<seq2seq4repair_space>" + resource ) , e ) ; strings = ValueMap . EMPTY_MAP ; } } else { strings = ValueMap . EMPTY_MAP ; } resourceCache . put ( id , strings ) ; return strings ; } private String createCacheId ( final Component component , final String style , final Locale locale ) { } }

Fix:
final IResourceStream resource = component . getApplication ( ) . getResourceStreamLocator ( ) . locate ( component . getClass ( ) , style , locale , "properties" ) ;
Buggy code:
public abstract class Annotation extends Expression implements IExtendedModifier { abstract ChildPropertyDescriptor internalTypeNameProperty ( ) { } static final ChildPropertyDescriptor internalTypeNamePropertyFactory ( Class nodeClass ) { } Name typeName = null ; Annotation ( AST ast ) { } public boolean isModifier ( ) { } public boolean isAnnotation ( ) { } public Name getTypeName ( ) { if ( ( this . typeName ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . typeName ) == null ) { preLazyInit ( ) ; this . typeName = new SimpleName ( this . ast ) ; postLazyInit ( this . typeName , internalTypeNameProperty ( ) ) ; } } } return this . typeName ; } public void setTypeName ( Name typeName ) { } public boolean isNormalAnnotation ( ) { } public boolean isMarkerAnnotation ( ) { } public boolean isSingleMemberAnnotation ( ) { } int memSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class MySQLDatabase { private Connection connect ; private Statement statement ; private ResultSet returnSet ; private PreparedStatement preparedStatement ; private final int maxInsertsInBatch ; private final int maxInsertsToCommit ; private int currentInserts ; private List < Map < String , Object > > insertCache ; private final Map < String , String > tableLayout ; private final List < String > columns ; private final String tableName ; private boolean running ; public MySQLDatabase ( String [ ] settings , Map < String , String > tableLayout ) { } private void connect ( String [ ] settings ) throws SQLException { String host = settings [ 0 ] ; String user = settings [ 1 ] ; String password = settings [ 2 ] ; <START_BUG> connect = DriverManager . getConnection ( host , user , password ) ; <END_BUG> } private void prepareInsertStatement ( int inserts ) throws SQLException { } private void storeInsertInCache ( Map < String , Object > values ) { } private int getNumberOfItemsInCache ( ) { } private Map < String , Object > getItemFromCache ( int position ) { } private void resetCache ( ) { } private void writeCacheToStatement ( ) throws SQLException { } private void sendQuery ( ) throws SQLException { } public void insert ( Map < String , Object > values ) { } public void close ( ) { } public boolean doesTableExist ( String tableName ) { } public void createTable ( String tableName ) { } public void deleteTable ( String tableName ) { } private Collection < String > getAllTables ( ) { } public void resetTable ( String tableName ) { } }

Fix:
connect = DriverManager . getConnection ( ( host + "?useUnicode=yes&characterEncoding=UTF-8" ) , user , password ) ;
Buggy code:
public class POP3HeaderCache extends AbstractHeaderCache { protected POP3Server server ; public POP3HeaderCache ( POP3Server server ) { } public StatusObservable getObservable ( ) { } public void load ( ) throws Exception { } public void save ( ) throws Exception { if ( ! ( isHeaderCacheLoaded ( ) ) ) return ; log . info ( ( "saving<seq2seq4repair_space>header-cache=" + ( headerFile ) ) ) ; try { writer = new org . columba . mail . folder . headercache . ObjectWriter ( headerFile ) ; } catch ( Exception e ) { if ( MainInterface . DEBUG ) e . printStackTrace ( ) ; } int count = headerList . count ( ) ; if ( count == 0 ) return ; writer . writeObject ( new Integer ( count ) ) ; ColumbaHeader h ; for ( Enumeration e = headerList . keys ( ) ; e . hasMoreElements ( ) ; ) { String str = ( ( String ) ( e . nextElement ( ) ) ) ; <START_BUG> h = ( ( ColumbaHeader ) ( headerList . getHeader ( str ) ) ) ; <END_BUG> saveHeader ( h ) ; } writer . close ( ) ; } protected void loadHeader ( HeaderInterface h ) throws Exception { } protected void saveHeader ( HeaderInterface h ) throws Exception { } }

Fix:
h = ( ( ColumbaHeader ) ( headerList . get ( str ) ) ) ;
Buggy code:
public class MersenneTwisterTest extends RandomGeneratorAbstractTest { @ Override protected RandomGenerator makeGenerator ( ) { <START_BUG> return new MersenneTwister ( 100 ) ; <END_BUG> } @ Test public void testMakotoNishimura ( ) { } }

Fix:
return new MersenneTwister ( 111 ) ;
Buggy code:
public class AdobeJpegDescriptor extends TagDescriptor < AdobeJpegDirectory > { public AdobeJpegDescriptor ( AdobeJpegDirectory directory ) { } @ Override public String getDescription ( int tagType ) { } @ Nullable private String getDctEncodeVersionDescription ( ) { <START_BUG> Integer value = _directory . getInteger ( TAG_COLOR_TRANSFORM ) ; <END_BUG> return value == null ? null : value == 100 ? "100" : Integer . toString ( value ) ; } @ Nullable private String getColorTransformDescription ( ) { } }

Fix:
Integer value = _directory . getInteger ( TAG_DCT_ENCODE_VERSION ) ;
Buggy code:
public class DuplicateUserCheckStateTestCase extends PropertyTestHelper { @ Test public void newUser ( ) throws IOException { values . setExistingUser ( false ) ; values . setGroups ( ROLES ) ; PreModificationState userCheckState = new PreModificationState ( consoleMock , values ) ; <START_BUG> AssertConsoleBuilder consoleBuilder = new AssertConsoleBuilder ( ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . aboutToAddUser ( values . getUserName ( ) , values . getRealm ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( ( ( ( ( ( ( DomainManagementMessages . MESSAGES . isCorrectPrompt ( ) ) + "<seq2seq4repair_space>" ) + ( DomainManagementMessages . MESSAGES . yes ( ) ) ) + "//" ) + ( DomainManagementMessages . MESSAGES . no ( ) ) ) + "?" ) ) . expectedDisplayText ( "<seq2seq4repair_space>" ) . expectedInput ( "yes" ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedUser ( values . getUserName ( ) , values . getUserFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedGroups ( values . getUserName ( ) , values . getGroups ( ) , values . getGroupFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) ; <END_BUG> consoleMock . setResponses ( consoleBuilder ) ; State nextState = userCheckState . execute ( ) ; assertTrue ( ( nextState instanceof ConfirmationChoice ) ) ; nextState = nextState . execute ( ) ; assertTrue ( ( nextState instanceof AddUserState ) ) ; nextState . execute ( ) ; consoleBuilder . validate ( ) ; } @ Test public void existingUSer ( ) throws IOException { } }

Fix:
AssertConsoleBuilder consoleBuilder = new AssertConsoleBuilder ( ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . aboutToAddUser ( values . getUserName ( ) , values . getRealm ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( ( ( ( ( ( ( DomainManagementMessages . MESSAGES . isCorrectPrompt ( ) ) + "<seq2seq4repair_space>" ) + ( DomainManagementMessages . MESSAGES . yes ( ) ) ) + "//" ) + ( DomainManagementMessages . MESSAGES . no ( ) ) ) + "?" ) ) . expectedDisplayText ( "<seq2seq4repair_space>" ) . expectedInput ( DomainManagementMessages . MESSAGES . yes ( ) ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedUser ( values . getUserName ( ) , values . getUserFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedGroups ( values . getUserName ( ) , values . getGroups ( ) , values . getGroupFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) ;
Buggy code:
public class State implements Cloneable { public static final int NCARDS_PER_COLOR = 12 ; public static final int INITIAL_HAND_SIZE = 4 ; public static final int INITIAL_MISSION_COUNT = 3 ; public static final int OPEN_DECK_SIZE = 5 ; public static final CardBag INITIAL_DECK = new CardBag ( ) { } ; public MersenneTwisterFast random = new MersenneTwisterFast ( 0 ) ; private PlayerState [ ] players ; private int current_player ; public Map < Railway , Integer > owner_by_railway = new EnumMap < Railway , Integer > ( Railway . class ) ; public CardBag deck = new CardBag ( ) ; public CardBag open_deck = new CardBag ( ) ; public CardBag discarded = new CardBag ( ) ; public Set < Mission > missions = EnumSet . noneOf ( Mission . class ) ; private boolean game_over = false ; private int last_player = - 1 ; private static final Color [ ] colors = new Color [ ] { Color . BLUE , Color . RED , Color . GREEN , Color . YELLOW , Color . BLACK } ; private int next_color_index = 0 ; public State ( State that ) { } public State ( String [ ] player_names , long seed ) { } public static State fromConfiguration ( String configuration , String ... player_names ) { } @ Override public State clone ( ) { } @ Override public boolean equals ( Object o ) { } public String toString ( ) { } public void setup ( ) { deck = State . INITIAL_DECK . clone ( ) ; open_deck . addAll ( deck . remove_sample ( State . OPEN_DECK_SIZE , random ) ) ; missions . addAll ( Arrays . asList ( Mission . values ( ) ) ) ; for ( PlayerState p : players ) { p . hand . addAll ( deck . remove_sample ( State . INITIAL_HAND_SIZE , random ) ) ; <START_BUG> p . missions . addAll ( Util . remove_sample ( missions , State . INITIAL_MISSION_COUNT , random , EnumSet . noneOf ( Mission . class ) ) ) ; <END_BUG> } } public void switchTurns ( ) { } public void unswitchTurns ( ) { } public void switchToPlayer ( int handle ) { } public int [ ] players ( ) { } public List < PlayerState > playerStates ( ) { } public int currentPlayer ( ) { } public PlayerState currentPlayerState ( ) { } public PlayerState playerState ( int handle ) { } public boolean gameOver ( ) { } public boolean isDraw ( ) { } public int winner ( ) { } public int aheadness ( int i ) { } public boolean isClaimed ( Railway r ) { } public Set < Railway > usableRailwaysFor ( int player ) { } public CardBag openCards ( ) { } public final Deque < CardBag > deck_restorations = new LinkedList < CardBag > ( ) ; public final Deque < CardBag > discardeds = new LinkedList < CardBag > ( ) ; public void restoreDecks ( ) { } public void unrestoreDecks ( ) { } public AppliedDecision applyDecision ( Decision d ) throws IllegalDecisionException { } public Set < Decision > allPossibleDecisions ( ) { } public Set < Decision > allPossibleDecisionsFor ( int player ) { } }

Fix:
p . receiveMissions ( Util . remove_sample ( missions , State . INITIAL_MISSION_COUNT , random , EnumSet . noneOf ( Mission . class ) ) ) ;
Buggy code:
public class MessageController implements MouseListener , CaretListener , HyperlinkListener , CharsetListener , FocusOwner { private Folder folder ; private Object uid ; private MessageMenu menu ; private JButton button ; private String activeCharset ; private MessageView view ; private URLObservable urlObservable ; protected AbstractMailFrameController abstractFrameController ; protected AttachmentController attachmentController ; public MessageController ( AbstractMailFrameController abstractFrameController , AttachmentController attachmentController ) { } public MessageView getView ( ) { } public void createPopupMenu ( ) { } public JPopupMenu getPopupMenu ( ) { } public void setViewerFont ( Font font ) { } public Object getUid ( ) { } public Folder getFolder ( ) { } public void setFolder ( Folder f ) { } public void setUid ( Object o ) { } public void showMessage ( ColumbaHeader header , MimePart bodyPart , MimeTree mimePartTree ) throws Exception { } public void setPGPMessage ( int value , String message ) { } public void hyperlinkUpdate ( HyperlinkEvent e ) { } public void mousePressed ( MouseEvent event ) { } public void mouseReleased ( MouseEvent event ) { } public void mouseEntered ( MouseEvent event ) { } public void mouseExited ( MouseEvent event ) { } public void mouseClicked ( MouseEvent event ) { } protected URL extractURL ( MouseEvent event ) { } protected void processPopup ( MouseEvent ev ) { final URL url = extractURL ( ev ) ; final MouseEvent event = ev ; if ( url == null ) { urlObservable . setUrl ( null ) ; } else { urlObservable . setUrl ( url ) ; } SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { <START_BUG> getPopupMenu ( ) . show ( getView ( ) , event . getX ( ) , event . getY ( ) ) ; <END_BUG> } } ) ; } public FrameMediator getFrameController ( ) { } public void charsetChanged ( CharsetEvent e ) { } public void copy ( ) { } public void cut ( ) { } public void delete ( ) { } public JComponent getComponent ( ) { } public boolean isCopyActionEnabled ( ) { } public boolean isCutActionEnabled ( ) { } public boolean isDeleteActionEnabled ( ) { } public boolean isPasteActionEnabled ( ) { } public boolean isRedoActionEnabled ( ) { } public boolean isSelectAllActionEnabled ( ) { } public boolean isUndoActionEnabled ( ) { } public void paste ( ) { } public void redo ( ) { } public void selectAll ( ) { } public void undo ( ) { } public void caretUpdate ( CaretEvent arg0 ) { } public URLObservable getUrlObservable ( ) { } }

Fix:
getPopupMenu ( ) . show ( event . getComponent ( ) , event . getX ( ) , event . getY ( ) ) ;
Buggy code:
public abstract class JRubyScriptUtils { public static Object createJRubyObject ( String scriptSource , Class [ ] interfaces ) throws JumpException { } public static Object createJRubyObject ( String scriptSource , Class [ ] interfaces , ClassLoader classLoader ) { } private static Ruby initializeRuntime ( ) { } private static String findClassName ( Node rootNode ) { } private static ClassNode findClassNode ( Node node ) { } private static class RubyObjectInvocationHandler implements InvocationHandler { private final IRubyObject rubyObject ; private final Ruby ruby ; public RubyObjectInvocationHandler ( IRubyObject rubyObject , Ruby ruby ) { } public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { if ( ReflectionUtils . isEqualsMethod ( method ) ) { <START_BUG> return isProxyForSameRubyObject ( args [ 0 ] ) ? Boolean . TRUE : Boolean . FALSE ; <END_BUG> } else if ( ReflectionUtils . isHashCodeMethod ( method ) ) { return this . rubyObject . hashCode ( ) ; } else if ( ReflectionUtils . isToStringMethod ( method ) ) { String toStringResult = this . rubyObject . toString ( ) ; if ( ! ( StringUtils . hasText ( toStringResult ) ) ) { toStringResult = ObjectUtils . identityToString ( this . rubyObject ) ; } return ( "JRuby<seq2seq4repair_space>object<seq2seq4repair_space>[" + toStringResult ) + "]" ; } try { IRubyObject [ ] rubyArgs = convertToRuby ( args ) ; IRubyObject rubyResult = this . rubyObject . callMethod ( this . ruby . getCurrentContext ( ) , method . getName ( ) , rubyArgs ) ; return convertFromRuby ( rubyResult , method . getReturnType ( ) ) ; } catch ( RaiseException ex ) { throw new JRubyScriptUtils . JRubyExecutionException ( ex ) ; } } private boolean isProxyForSameRubyObject ( Object other ) { } private IRubyObject [ ] convertToRuby ( Object [ ] javaArgs ) { } private Object convertFromRuby ( IRubyObject rubyResult , Class returnType ) { } private Object convertFromRubyArray ( IRubyObject [ ] rubyArray , Class returnType ) { } } public static class JRubyExecutionException extends NestedRuntimeException { public JRubyExecutionException ( RaiseException ex ) { } private static String buildMessage ( RaiseException ex ) { } } }

Fix:
return isProxyForSameRubyObject ( args [ 0 ] ) ;
Buggy code:
@ Service ( "com.cm.service.coinService" ) @ Transactional public class CoinServiceImpl implements CoinService { private static final Logger LOGGER = LoggerFactory . getLogger ( CoinServiceImpl . class ) ; @ Autowired private CoinRepositoryJPA coinRepositoryJPA ; @ Autowired private CoinPriceRuleHelper priceRuleRunner ; public CoinServiceImpl ( ) { } @ Override public void checkCoinParameters ( Coin coin ) throws CmGenericException { Assert . notNull ( coin , "method<seq2seq4repair_space>was<seq2seq4repair_space>invoked<seq2seq4repair_space>with<seq2seq4repair_space>null<seq2seq4repair_space>arg" ) ; if ( ( coin . getComposition ( ) ) == null ) { CoinServiceImpl . LOGGER . warn ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>new<seq2seq4repair_space>coin<seq2seq4repair_space>-<seq2seq4repair_space>required<seq2seq4repair_space>field<seq2seq4repair_space>'Composition'<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Skipping..." ) ; throw new CmGenericException ( ) ; } else <START_BUG> if ( coin . getCountry ( ) . isEmpty ( ) ) { <END_BUG> CoinServiceImpl . LOGGER . warn ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>new<seq2seq4repair_space>coin<seq2seq4repair_space>-<seq2seq4repair_space>required<seq2seq4repair_space>field<seq2seq4repair_space>'Country'<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Skipping..." ) ; throw new CmGenericException ( ) ; } else if ( ( coin . getYear ( ) ) == 0L ) { CoinServiceImpl . LOGGER . warn ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>new<seq2seq4repair_space>coin<seq2seq4repair_space>-<seq2seq4repair_space>required<seq2seq4repair_space>field<seq2seq4repair_space>'Year'<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Skipping..." ) ; throw new CmGenericException ( ) ; } else if ( ( coin . getGrade ( ) ) == null ) { CoinServiceImpl . LOGGER . warn ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>processing<seq2seq4repair_space>new<seq2seq4repair_space>coin<seq2seq4repair_space>-<seq2seq4repair_space>required<seq2seq4repair_space>field<seq2seq4repair_space>'Grade'<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Skipping..." ) ; throw new CmGenericException ( ) ; } } @ Override public boolean calculatePrice ( Coin coin ) throws CmGenericException { } @ Override public void saveCoin ( Coin coin ) { } private void calculateByGrade ( Coin coin ) throws CmGenericException { } }

Fix:
if ( ( ( coin . getCountry ( ) ) == null ) || ( coin . getCountry ( ) . isEmpty ( ) ) ) {
Buggy code:
public class Snippet239 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setText ( "Text<seq2seq4repair_space>spans<seq2seq4repair_space>two<seq2seq4repair_space>columns<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>TableItem" ) ; shell . setLayout ( new FillLayout ( ) ) ; final Table table = new Table ( shell , ( ( SWT . MULTI ) | ( SWT . FULL_SELECTION ) ) ) ; table . setHeaderVisible ( true ) ; int columnCount = 4 ; for ( int i = 0 ; i < columnCount ; i ++ ) { TableColumn column = new TableColumn ( table , SWT . NONE ) ; column . setText ( ( "Column<seq2seq4repair_space>" + i ) ) ; } int itemCount = 8 ; for ( int i = 0 ; i < itemCount ; i ++ ) { TableItem item = new TableItem ( table , SWT . NONE ) ; item . setText ( 0 , ( ( "item<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>a" ) ) ; item . setText ( 3 , ( ( "item<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>d" ) ) ; } final String string = "text<seq2seq4repair_space>that<seq2seq4repair_space>spans<seq2seq4repair_space>two<seq2seq4repair_space>columns" ; GC gc = new GC ( table ) ; final Point extent = gc . stringExtent ( string ) ; gc . dispose ( ) ; final Color red = display . getSystemColor ( COLOR_RED ) ; Listener paintListener = new Listener ( ) { public void handleEvent ( Event event ) { switch ( event . type ) { case SWT . MeasureItem : { if ( ( ( event . index ) == 1 ) || ( ( event . index ) == 2 ) ) { event . width = ( extent . x ) // 2 ; event . height = Math . max ( event . height , ( ( extent . y ) + 2 ) ) ; } break ; } case SWT . PaintItem : { if ( ( ( event . index ) == 1 ) || ( ( event . index ) == 2 ) ) { int offset = 0 ; if ( ( event . index ) == 2 ) { TableColumn column1 = table . getColumn ( 1 ) ; offset = column1 . getWidth ( ) ; } event . gc . setForeground ( red ) ; int y = ( event . y ) + ( ( ( event . height ) - ( extent . y ) ) // 2 ) ; <START_BUG> event . gc . drawString ( string , ( ( event . x ) - offset ) , y ) ; <END_BUG> } break ; } } } } ; table . addListener ( MeasureItem , paintListener ) ; table . addListener ( PaintItem , paintListener ) ; for ( int i = 0 ; i < columnCount ; i ++ ) { table . getColumn ( i ) . pack ( ) ; } shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
event . gc . drawString ( string , ( ( event . x ) - offset ) , y , true ) ;
Buggy code:
public class Xpand3NodeParserTest extends TestCase { private Node parse ( String s ) throws Exception { } public void testname ( ) throws Exception { } public void testFoo ( ) throws Exception { } public void testXpandXtendCheckMixedUp1 ( ) throws Exception { } public void testPerf ( ) throws Exception { <START_BUG> String s = "foo.bar.honolulu('lola',[true,false,45]).collect(e|2.minor<seq2seq4repair_space>+<seq2seq4repair_space>34<seq2seq4repair_space>//<seq2seq4repair_space>(x<seq2seq4repair_space>-<seq2seq4repair_space>2))" ; <END_BUG> for ( int i = 0 ; i < 10 ; i ++ ) { s = ( s + "<seq2seq4repair_space>-><seq2seq4repair_space>" ) + s ; } Xpand3Parser parser = createParser ( s ) ; long n = System . currentTimeMillis ( ) ; parser . r_expression ( ) ; long after = System . currentTimeMillis ( ) ; System . out . println ( ( ( ( "Time<seq2seq4repair_space>:<seq2seq4repair_space>" + ( ( after - n ) // 1000.0 ) ) + "<seq2seq4repair_space>Expressionlength<seq2seq4repair_space>was<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( s . length ( ) ) ) ) ; } private Xpand3NodeParser createParser ( String s ) { } }

Fix:
String s = "foo.bar.honolulu('lola',{true,false,45}).collect(e|2.minor<seq2seq4repair_space>+<seq2seq4repair_space>34<seq2seq4repair_space>//<seq2seq4repair_space>(x<seq2seq4repair_space>-<seq2seq4repair_space>2))" ;
Buggy code:
public class RemoteUrl { public static String urlToString ( String url , List < AuthorizationValue > auths ) throws Exception { InputStream is = null ; URLConnection conn = null ; BufferedReader br = null ; try { if ( auths != null ) { StringBuilder queryString = new StringBuilder ( ) ; for ( AuthorizationValue auth : auths ) { if ( "query" . equals ( auth . getType ( ) ) ) { if ( ( queryString . toString ( ) . length ( ) ) == 0 ) queryString . append ( "?" ) ; else queryString . append ( "&" ) ; queryString . append ( URLEncoder . encode ( auth . getKeyName ( ) , "UTF-8" ) ) . append ( "=" ) . append ( URLEncoder . encode ( auth . getValue ( ) , "UTF-8" ) ) ; } } if ( ( queryString . toString ( ) . length ( ) ) != 0 ) url = url + ( queryString . toString ( ) ) ; conn = new URL ( url ) . openConnection ( ) ; for ( AuthorizationValue auth : auths ) { if ( "header" . equals ( auth . getType ( ) ) ) { conn . setRequestProperty ( auth . getKeyName ( ) , auth . getValue ( ) ) ; } } } else { conn = new URL ( url ) . openConnection ( ) ; } StringBuilder sb = new StringBuilder ( ) ; String line ; is = conn . getInputStream ( ) ; br = new BufferedReader ( new InputStreamReader ( is ) ) ; while ( ( line = br . readLine ( ) ) != null ) { <START_BUG> sb . append ( line ) ; <END_BUG> } return sb . toString ( ) ; } catch ( SSLProtocolException e ) { System . out . println ( "there<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>problem<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>target<seq2seq4repair_space>SSL<seq2seq4repair_space>certificate" ) ; System . out . println ( "****<seq2seq4repair_space>you<seq2seq4repair_space>may<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>with<seq2seq4repair_space>-Djsse.enableSNIExtension=false\n\n" ) ; e . printStackTrace ( ) ; throw e ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw e ; } finally { if ( is != null ) is . close ( ) ; if ( br != null ) br . close ( ) ; } } }

Fix:
sb . append ( line ) . append ( "\n" ) ;
Buggy code:
public class ClockSource extends BasicComponent { long clockIndex ; public ClockSource ( BasicComponent cs ) { } public ClockSource ( String cName , String iName , String ver , SopcComponentDescription scd ) { } public void setClockIndex ( long idx ) { } public long getClockIndex ( ) { } protected DTNode createClockOutputNode ( Interface cm , long idx , String lbl ) { } public static String freq2String ( long freq ) { } public DTNode toDTNode ( BoardInfo bi , Connection conn ) { Vector < Interface > vClkMasters = getInterfaces ( CLOCK , true ) ; if ( ( vClkMasters . size ( ) ) == 1 ) { return createClockOutputNode ( vClkMasters . get ( 0 ) , clockIndex , getInstanceName ( ) ) ; } else { DTNode node = new DTNode ( ( ( ( getScd ( ) . getGroup ( ) ) + "@0x" ) + ( clockIndex ) ) , getInstanceName ( ) ) ; long subIdx = 0 ; node . addProperty ( new DTProperty ( "compatible" , getScd ( ) . getCompatibles ( version ) . toArray ( new String [ ] { } ) ) ) ; node . addProperty ( new DTProperty ( "#clock-cells" , 1L ) ) ; for ( Interface clkIf : vClkMasters ) { <START_BUG> node . addChild ( createClockOutputNode ( clkIf , ( subIdx ++ ) , ( ( ( getInstanceName ( ) ) + "-" ) + ( clkIf . getName ( ) ) ) ) ) ; <END_BUG> } return node ; } } }

Fix:
node . addChild ( createClockOutputNode ( clkIf , ( subIdx ++ ) , ( ( ( getInstanceName ( ) ) + "_" ) + ( clkIf . getName ( ) ) ) ) ) ;
Buggy code:
public class ReduxCommandBlockTileEntity extends TileEntity { protected volatile Block reduxBlock = null ; protected int lastSuccessCount = 0 ; protected Type lastResultType = Type . SUCCESS_COUNT ; protected int lastResultAmount = 0 ; @ SuppressWarnings ( "all" ) protected final List < ReduxCommandBlockTileEntity . ReduxBlockEventReceiver > eventReceivers = new ArrayList < ReduxCommandBlockTileEntity . ReduxBlockEventReceiver > ( ) ; protected final Set < ReduxCommandBlockTileEntity . ReduxBlockEventReceiver > tickEventReceivers = new HashSet < ReduxCommandBlockTileEntity . ReduxBlockEventReceiver > ( ) ; public ReduxCommandBlockTileEntity ( ) { } public synchronized void setupTileEntity ( Block reduxBlock ) { } public int getLastSuccessCount ( ) { } public void writeToNBT ( NBTTagCompound compound ) { } public void readFromNBT ( NBTTagCompound compound ) { super . readFromNBT ( compound ) ; this . lastSuccessCount = compound . getInteger ( "lastSuccessCount" ) ; <START_BUG> if ( ( reduxBlock ) == null ) { <END_BUG> setupTileEntity ( ( ( ReduxBlock ) ( this . getWorld ( ) . getBlockState ( this . pos ) . getBlock ( ) ) ) . getReduxBlock ( ) ) ; } } public Packet getDescriptionPacket ( ) { } public void addTickEventReceiver ( ReduxCommandBlockTileEntity . ReduxBlockEventReceiver receiver ) { } protected class ReduxBlockEventReceiver implements ICommandSender { private final Trigger triggerScript ; private int successCount ; public ReduxBlockEventReceiver ( Trigger triggerScript ) throws IllegalAccessException , NoSuchMethodException , InvocationTargetException { } @ Override public String getName ( ) { } @ Override public IChatComponent getDisplayName ( ) { } @ Override public void addChatMessage ( IChatComponent message ) { } @ Override public boolean canUseCommand ( int permLevel , String commandName ) { } @ Override public BlockPos getPosition ( ) { } @ Override public Vec3 getPositionVector ( ) { } @ Override public World getEntityWorld ( ) { } @ Override public Entity getCommandSenderEntity ( ) { } @ Override public boolean sendCommandFeedback ( ) { } @ Override public void setCommandStat ( CommandResultStats . Type type , int amount ) { } @ SubscribeEvent @ SuppressWarnings ( "all" ) public void receiveEvent ( Event ignored ) { } } }

Fix:
if ( ( ( reduxBlock ) == null ) && ( ! ( ( ( worldObj ) == null ) || ( worldObj . isRemote ) ) ) ) {
Buggy code:
public class CarsAdapter extends ArrayAdapter < Car > { private LayoutInflater mInflater ; public CarsAdapter ( Context context , List < Car > objects ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { View view ; if ( convertView == null ) { view = mInflater . inflate ( item_car , parent , false ) ; CarsAdapter . ViewHolder holder = new CarsAdapter . ViewHolder ( ) ; holder . name = ( ( TextView ) ( view . findViewById ( text_car ) ) ) ; <START_BUG> holder . name = ( ( TextView ) ( view . findViewById ( text_vin ) ) ) ; <END_BUG> view . setTag ( holder ) ; } else { view = convertView ; } CarsAdapter . ViewHolder holder = ( ( CarsAdapter . ViewHolder ) ( view . getTag ( ) ) ) ; Car car = getItem ( position ) ; holder . name . setText ( car . name ) ; holder . vin . setText ( car . vin ) ; return view ; } static class ViewHolder { TextView name ; TextView vin ; } }

Fix:
holder . vin = ( ( TextView ) ( view . findViewById ( text_vin ) ) ) ;
Buggy code:
public class GenUtils { public static Mat convertBitmapToMat ( Bitmap image ) { } public static Bitmap convertMatToBitmap ( Mat mat ) { } public static Point intersectingPoint ( LineSegment l1 , LineSegment l2 ) { } public static < T > String print2dArray ( T [ ] [ ] arr ) { } public static Mat invertMat ( Mat src ) { } public static double getAngleFromradians ( double radians ) { } public static void printBoard ( int [ ] [ ] digits ) { String text = "" ; for ( int i = 0 ; i < ( digits . length ) ; i ++ ) { text += ( Arrays . toString ( digits [ i ] ) ) + "\n" ; } <START_BUG> Logg . d ( "BOARD" , text ) ; <END_BUG> } }

Fix:
Logg . d ( "BOARD" , ( "=\n" + text ) ) ;
Buggy code:
public final class Color extends Resource { public int handle ; Color ( ) { } public Color ( Device device , int red , int green , int blue ) { } public Color ( Device device , RGB rgb ) { } public void dispose ( ) { } public boolean equals ( Object object ) { } public int getBlue ( ) { } public int getGreen ( ) { } public int getRed ( ) { } public RGB getRGB ( ) { } public int hashCode ( ) { } void init ( Device device , int red , int green , int blue ) { if ( ( ( ( ( ( red > 255 ) || ( red < 0 ) ) || ( green > 255 ) ) || ( green < 0 ) ) || ( blue > 255 ) ) || ( blue < 0 ) ) { SWT . error ( ERROR_INVALID_ARGUMENT ) ; } this . device = device ; <START_BUG> handle = ( ( 33554432 | ( red & 255 ) ) | ( ( green & 255 ) << 8 ) ) | ( ( blue & 255 ) << 16 ) ; <END_BUG> int hPal = device . hPalette ; if ( hPal == 0 ) return ; int [ ] colorRefCount = device . colorRefCount ; int index = OS . GetNearestPaletteIndex ( hPal , handle ) ; byte [ ] entry = new byte [ 4 ] ; OS . GetPaletteEntries ( hPal , index , 1 , entry ) ; if ( ( ( ( entry [ 0 ] ) == ( ( byte ) ( red ) ) ) && ( ( entry [ 1 ] ) == ( ( byte ) ( green ) ) ) ) && ( ( entry [ 2 ] ) == ( ( byte ) ( blue ) ) ) ) { ( colorRefCount [ index ] ) ++ ; return ; } int i = 0 ; while ( i < ( colorRefCount . length ) ) { if ( ( colorRefCount [ i ] ) == 0 ) { index = i ; break ; } i ++ ; } if ( i == ( colorRefCount . length ) ) { handle = ( ( ( entry [ 0 ] ) & 255 ) | ( ( ( entry [ 1 ] ) & 255 ) << 8 ) ) | ( ( ( entry [ 2 ] ) & 255 ) << 16 ) ; } else { entry = new byte [ ] { ( ( byte ) ( red & 255 ) ) , ( ( byte ) ( green & 255 ) ) , ( ( byte ) ( blue & 255 ) ) , 0 } ; OS . SetPaletteEntries ( hPal , index , 1 , entry ) ; } ( colorRefCount [ index ] ) ++ ; } public boolean isDisposed ( ) { } public String toString ( ) { } public static Color win32_new ( Device device , int handle ) { } }

Fix:
handle = ( ( red & 255 ) | ( ( green & 255 ) << 8 ) ) | ( ( blue & 255 ) << 16 ) ;
Buggy code:
public class EntryResult { private char [ ] word ; private HashtableOfObject [ ] documentTables ; private SimpleSet documentNames ; public EntryResult ( char [ ] word , HashtableOfObject table ) { } public void addDocumentName ( String documentName ) { if ( ( this . documentNames ) == null ) <START_BUG> this . documentNames = new SimpleSet ( ) ; <END_BUG> this . documentNames . add ( documentName ) ; } public void addDocumentTable ( HashtableOfObject table ) { } public char [ ] getWord ( ) { } public String [ ] getDocumentNames ( Index index ) throws IOException { } public boolean isEmpty ( ) { } }

Fix:
this . documentNames = new SimpleSet ( 3 ) ;
Buggy code:
public class TldParsingDeploymentProcessor implements DeploymentUnitProcessor { 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" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( final DeploymentUnit context ) { } private void processTlds ( VirtualFile root , List < VirtualFile > files , Map < String , TldMetaData > tlds , final List < TldMetaData > uniqueTlds ) throws DeploymentUnitProcessingException { } private TldMetaData parseTLD ( VirtualFile tld ) throws DeploymentUnitProcessingException { if ( TldParsingDeploymentProcessor . IMPLICIT_TLD . equals ( tld . getName ( ) ) ) { return new TldMetaData ( ) ; } InputStream is = null ; try { is = tld . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXMLResolver . create ( ) ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; return TldMetaDataParser . parse ( xmlReader ) ; } catch ( XMLStreamException e ) { <START_BUG> throw new DeploymentUnitProcessingException ( ROOT_LOGGER . failToParseXMLDescriptor ( tld , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) ) ; <END_BUG> } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( ROOT_LOGGER . failToParseXMLDescriptor ( tld ) , e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } }

Fix:
throw new DeploymentUnitProcessingException ( ROOT_LOGGER . failToParseXMLDescriptor ( tld , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) , e ) ;
Buggy code:
class TestModelControllerService7_1_2 extends ModelTestModelControllerService { private final InjectedValue < ContentRepository > injectedContentRepository = new InjectedValue < ContentRepository > ( ) ; private final TestModelType type ; private final RunningModeControl runningModeControl ; private final PathManagerService pathManagerService ; private final ModelInitializer modelInitializer ; private final ExtensionRegistry extensionRegistry ; TestModelControllerService7_1_2 ( ProcessType processType , RunningModeControl runningModeControl , StringConfigurationPersister persister , boolean validateOps , TestModelType type , ModelInitializer modelInitializer , DescriptionProvider rootDescriptionProvider , ControlledProcessState processState , ExtensionRegistry extensionRegistry ) { } @ Override protected void initCoreModel ( Resource rootResource , ManagementResourceRegistration rootRegistration ) { } @ Override public void stop ( StopContext context ) { } @ Override protected void boot ( BootContext context ) throws ConfigurationPersistenceException { try { super . boot ( context ) ; } finally { <START_BUG> bootThreadDone ( ) ; <END_BUG> } } private HostControllerEnvironment createHostControllerEnvironment ( ) { } InjectedValue < ContentRepository > getContentRepositoryInjector ( ) { } private LocalHostControllerInfoImpl createLocalHostControllerInfo ( HostControllerEnvironment env ) { } private HostFileRepository createHostFileRepository ( ) { } private DomainController createDomainController ( final HostControllerEnvironment env , final LocalHostControllerInfoImpl info ) { } private void delete ( File file ) { } }

Fix:
countdownDoneLatch ( ) ;