nus-yam/ex-repair huggingface dataset:
Buggy code:
@ SpringBootApplication public class Application { private static final Logger LOGGER = LoggerFactory . getLogger ( Application . class ) ; public static void main ( String [ ] args ) throws Exception { } @ Bean public Application . DockerConfiguration dockerConfiguration ( ) { } @ Bean public RestTemplate restTemplate ( ) throws Exception { } @ Bean public HttpClient httpClient ( ) { } @ Bean public ShaPasswordEncoder shaPasswordEncoder ( ) { } @ Bean public SaltSource saltSource ( ) { ReflectionSaltSource saltSource = new ReflectionSaltSource ( ) ; <START_BUG> saltSource . setUserPropertyToUse ( "username" ) ; <END_BUG> return saltSource ; } @ Bean public Application . MongoConfiguration mongoConfiguration ( ) { } @ Bean public MongoTemplate mongoTemplate ( ) throws Exception { } @ Bean public Mongo mongo ( ) throws Exception { } @ ConfigurationProperties ( prefix = "bluefairy.docker" ) public static class DockerConfiguration { private String remoteApi = "http:////localhost:2376//" ; public String getRemoteApi ( ) { } public void setRemoteApi ( String remoteApi ) { } } @ ConfigurationProperties ( prefix = "bluefairy.mongo" ) public static class MongoConfiguration { private String uri = "mongodb:////localhost:27017//" ; private String database = "bluefairy" ; private String username = "admin" ; private String password = "password" ; public String getUri ( ) { } public void setUri ( String uri ) { } public String getDatabase ( ) { } public void setDatabase ( String database ) { } public String getUsername ( ) { } public void setUsername ( String username ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } } }

Fix:
saltSource . setUserPropertyToUse ( "salt" ) ;
Buggy code:
public class ImportService extends IntentService { public ImportService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { } private String appendF ( String url , int i ) { String [ ] ss = url . split ( "//" ) ; ss [ i ] += "-f" ; <START_BUG> return Arrays . asList ( ss ) . toString ( ) . replaceAll ( "(^\\[|\\]$)" , "" ) . replace ( ",<seq2seq4repair_space>" , "//" ) ; <END_BUG> } private void importBooks ( ) { } private void unzip ( String name ) { } private void response ( final String msg ) { } public static final String DZJ_NAME = "dzj-f" ; public static final String DICT_NAME = "dict" ; }

Fix:
return ( ( ImportService . DZJ_NAME ) + "//" ) + ( Arrays . asList ( ss ) . toString ( ) . replaceAll ( "(^\\[|\\]$)" , "" ) . replace ( ",<seq2seq4repair_space>" , "//" ) ) ;
Buggy code:
public class BeiderMorseEncoderTest extends StringEncoderAbstractTest { private static final char [ ] TEST_CHARS = new char [ ] { 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'o' , 'u' } ; private void assertNotEmpty ( BeiderMorseEncoder bmpm , final String value ) throws EncoderException { } private BeiderMorseEncoder createGenericApproxEncoder ( ) { } @ Override protected StringEncoder createStringEncoder ( ) { } @ Test public void testAllChars ( ) throws EncoderException { } @ Test public void testAsciiEncodeNotEmpty1Letter ( ) throws EncoderException { } @ Test public void testAsciiEncodeNotEmpty2Letters ( ) throws EncoderException { } @ Test public void testEncodeAtzNotEmpty ( ) throws EncoderException { } @ Test public void testEncodeGna ( ) throws EncoderException { } @ Test ( expected = IllegalArgumentException . class ) public void testInvalidLangIllegalArgumentException ( ) { } @ Test ( expected = IllegalStateException . class ) public void testInvalidLangIllegalStateException ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testInvalidLanguageIllegalArgumentException ( ) { } @ Test ( timeout = 10000L ) public void testLongestEnglishSurname ( ) throws EncoderException { } @ Test ( expected = IndexOutOfBoundsException . class ) public void testNegativeIndexForRuleMatchIndexOutOfBoundsException ( ) { } @ Test public void testOOM ( ) throws EncoderException { } @ Test public void testSetConcat ( ) { } @ Test public void testSetNameTypeAsh ( ) { } @ Test public void testSetRuleTypeExact ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSetRuleTypeToRulesIllegalArgumentException ( ) { } @ Test public void testSpeedCheck ( ) throws EncoderException { BeiderMorseEncoder bmpm = this . createGenericApproxEncoder ( ) ; <START_BUG> StringBuffer stringBuffer = new StringBuffer ( ) ; <END_BUG> stringBuffer . append ( BeiderMorseEncoderTest . TEST_CHARS [ 0 ] ) ; for ( int i = 0 , j = 1 ; i < 40 ; i ++ , j ++ ) { if ( j == ( BeiderMorseEncoderTest . TEST_CHARS . length ) ) { j = 0 ; } bmpm . encode ( stringBuffer . toString ( ) ) ; stringBuffer . append ( BeiderMorseEncoderTest . TEST_CHARS [ j ] ) ; } } @ Test public void testSpeedCheck2 ( ) throws EncoderException { } @ Test public void testSpeedCheck3 ( ) throws EncoderException { } }

Fix:
StringBuilder stringBuffer = new StringBuilder ( ) ;
Buggy code:
public class PropertyTest extends BuildFileTest { public PropertyTest ( String name ) { } public void setUp ( ) { } public void test1 ( ) { } public void test2 ( ) { } public void test3 ( ) { } public void test4 ( ) { } public void test5 ( ) { } public void testPrefixSuccess ( ) { } public void testPrefixFailure ( ) { } public void testCircularReference ( ) { } public void testThisIsNotACircularReference ( ) { <START_BUG> expectLog ( "thisIsNotACircularReference" , "b<seq2seq4repair_space>is<seq2seq4repair_space>A//A" ) ; <END_BUG> } }

Fix:
expectLog ( "thisIsNotACircularReference" , "b<seq2seq4repair_space>is<seq2seq4repair_space>A//A//A" ) ;
Buggy code:
public class ChannelOpenListenerService implements Service < Void > , OpenListener { private final Logger log = Logger . getLogger ( "org.jboss.as.remoting" ) ; private final InjectedValue < Endpoint > endpointValue = new InjectedValue < Endpoint > ( ) ; private final InjectedValue < ManagementOperationHandlerFactory > operationHandlerFactoryValue = new InjectedValue < ManagementOperationHandlerFactory > ( ) ; private final String channelName ; private final OptionMap optionMap ; private volatile Registration registration ; public ChannelOpenListenerService ( final String channelName , OptionMap optionMap ) { } public ServiceName getServiceName ( ) { } public InjectedValue < Endpoint > getEndpointInjector ( ) { } public InjectedValue < ManagementOperationHandlerFactory > getOperationHandlerInjector ( ) { } @ Override public Void getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public void start ( StartContext context ) throws StartException { try { log . debugf ( "Registering<seq2seq4repair_space>channel<seq2seq4repair_space>listener<seq2seq4repair_space>for<seq2seq4repair_space>%s" , channelName ) ; <START_BUG> endpointValue . getValue ( ) . registerService ( channelName , this , optionMap ) ; <END_BUG> } catch ( Exception e ) { throw new StartException ( e ) ; } } @ Override public void stop ( StopContext context ) { } @ Override public void channelOpened ( Channel channel ) { } @ Override public void registrationTerminated ( ) { } }

Fix:
registration = endpointValue . getValue ( ) . registerService ( channelName , this , optionMap ) ;
Buggy code:
public class TestBooleanScorer extends LuceneTestCase { public TestBooleanScorer ( String name ) { } private static final String FIELD = "category" ; public void testMethod ( ) { RAMDirectory directory = new RAMDirectory ( ) ; String [ ] values = new String [ ] { "1" , "2" , "3" , "4" } ; try { IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( TestBooleanScorer . FIELD , values [ i ] , Store . YES , Index . NOT_ANALYZED ) ) ; writer . addDocument ( doc ) ; } writer . close ( ) ; BooleanQuery booleanQuery1 = new BooleanQuery ( ) ; booleanQuery1 . add ( new TermQuery ( new Term ( TestBooleanScorer . FIELD , "1" ) ) , SHOULD ) ; booleanQuery1 . add ( new TermQuery ( new Term ( TestBooleanScorer . FIELD , "2" ) ) , SHOULD ) ; BooleanQuery query = new BooleanQuery ( ) ; query . add ( booleanQuery1 , MUST ) ; query . add ( new TermQuery ( new Term ( TestBooleanScorer . FIELD , "9" ) ) , MUST_NOT ) ; <START_BUG> IndexSearcher indexSearcher = new IndexSearcher ( directory ) ; <END_BUG> ScoreDoc [ ] hits = indexSearcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>matched<seq2seq4repair_space>documents" , 2 , hits . length ) ; } catch ( IOException e ) { fail ( e . getMessage ( ) ) ; } } public void testEmptyBucketWithMoreDocs ( ) throws Exception { } }

Fix:
IndexSearcher indexSearcher = new IndexSearcher ( directory , true ) ;
Buggy code:
public class FunctionalArrayList extends ArrayList implements FunctionalList { @ Override public ReturnObject head ( ) { } @ Override public FunctionalList rest ( ) { FunctionalArrayList mynewList = new FunctionalArrayList ( ) ; for ( int i = 1 ; i < ( this . size ( ) ) ; i ++ ) { <START_BUG> mynewList . add ( i , this . get ( 1 ) ) ; <END_BUG> } return mynewList ; } }

Fix:
mynewList . add ( this . get ( i ) . getReturnValue ( ) ) ;
Buggy code:
public abstract class WorkbenchPreferenceExtensionNode extends WorkbenchPreferenceExpressionNode { private static final String TAG_KEYWORD_REFERENCE = "keywordReference" ; private Collection keywordReferences ; private IConfigurationElement configurationElement ; private ImageDescriptor imageDescriptor ; private Image image ; private Collection keywordLabelCache ; public WorkbenchPreferenceExtensionNode ( String id , IConfigurationElement configurationElement ) { } public Collection getKeywordReferences ( ) { } public Collection getKeywordLabels ( ) { } public void clearKeywords ( ) { } public void disposeResources ( ) { } public Image getLabelImage ( ) { } public String getLabelText ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public IConfigurationElement getConfigurationElement ( ) { } public String getLocalId ( ) { } public String getPluginId ( ) { <START_BUG> return getConfigurationElement ( ) . getNamespace ( ) ; <END_BUG> } }

Fix:
return null ;
Buggy code:
public final class ServiceVerificationHandler extends AbstractServiceListener < Object > implements OperationStepHandler , ServiceListener < Object > { private final Set < ServiceController < ? > > set = new HashSet < ServiceController < ? > > ( ) ; private final Set < ServiceController < ? > > failed = new HashSet < ServiceController < ? > > ( ) ; private final Set < ServiceController < ? > > problem = new HashSet < ServiceController < ? > > ( ) ; private int outstanding ; public synchronized void execute ( final OperationContext context , final ModelNode operation ) { long start = 0 ; long settleTime = 100 ; while ( ( ( outstanding ) > 0 ) || ( ( settleTime > 0 ) && ( ! ( problem . isEmpty ( ) ) ) ) ) { try { long wait = ( ( outstanding ) > 0 ) ? 0 : settleTime ; wait ( wait ) ; if ( ( outstanding ) == 0 ) { if ( start == 0 ) { start = System . currentTimeMillis ( ) ; } else { settleTime -= ( System . currentTimeMillis ( ) ) - start ; } } else { start = 0 ; settleTime = 100 ; } } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; context . getFailureDescription ( ) . set ( "Operation<seq2seq4repair_space>cancelled" ) ; context . completeStep ( ) ; return ; } } if ( ( ! ( failed . isEmpty ( ) ) ) || ( ! ( problem . isEmpty ( ) ) ) ) { final ModelNode failureDescription = context . getFailureDescription ( ) ; ModelNode failedList = null ; for ( ServiceController < ? > controller : failed ) { if ( failedList == null ) { failedList = failureDescription . get ( "Failed<seq2seq4repair_space>services" ) ; } failedList . get ( controller . getName ( ) . getCanonicalName ( ) ) . set ( controller . getStartException ( ) . toString ( ) ) ; } ModelNode problemList = null ; for ( ServiceController < ? > controller : problem ) { if ( ! ( controller . getImmediateUnavailableDependencies ( ) . isEmpty ( ) ) ) { if ( problemList == null ) { problemList = failureDescription . get ( "Services<seq2seq4repair_space>with<seq2seq4repair_space>missing//unavailable<seq2seq4repair_space>dependencies" ) ; } final StringBuilder problem = new StringBuilder ( ) ; problem . append ( controller . getName ( ) . getCanonicalName ( ) ) ; problem . append ( "<seq2seq4repair_space>missing<seq2seq4repair_space>[<seq2seq4repair_space>" ) ; for ( Iterator < ServiceName > i = controller . getImmediateUnavailableDependencies ( ) . iterator ( ) ; i . hasNext ( ) ; ) { ServiceName missing = i . next ( ) ; problem . append ( missing . getCanonicalName ( ) ) ; if ( i . hasNext ( ) ) { problem . append ( ",<seq2seq4repair_space>" ) ; } } problem . append ( "<seq2seq4repair_space>]" ) ; problemList . add ( problem . toString ( ) ) ; } } if ( context . isRollbackOnRuntimeFailure ( ) ) { context . setRollbackOnly ( ) ; } } for ( ServiceController < ? > controller : set ) { controller . removeListener ( this ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } public synchronized void listenerAdded ( final ServiceController < ? > controller ) { } public synchronized void transition ( final ServiceController < ? > controller , final ServiceController . Transition transition ) { } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class BitInputStream implements Closeable { private static final int MAXIMUM_CACHE_SIZE = 31 ; private static final int [ ] MASKS = new int [ ( BitInputStream . MAXIMUM_CACHE_SIZE ) + 1 ] ; private final InputStream in ; private final ByteOrder byteOrder ; private int bitsCached = 0 ; private int bitsCachedSize = 0 ; public BitInputStream ( final InputStream in , final ByteOrder byteOrder ) { } public void close ( ) throws IOException { } public void clearBitCache ( ) { } public int readBits ( final int count ) throws IOException { if ( ( count < 0 ) || ( count > ( BitInputStream . MAXIMUM_CACHE_SIZE ) ) ) { <START_BUG> throw new IllegalArgumentException ( ( "count<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>between<seq2seq4repair_space>0<seq2seq4repair_space>and<seq2seq4repair_space>" + ( BitInputStream . MAXIMUM_CACHE_SIZE ) ) ) ; <END_BUG> } while ( ( bitsCachedSize ) < count ) { final int nextByte = in . read ( ) ; if ( nextByte < 0 ) { return nextByte ; } if ( ( byteOrder ) == ( ByteOrder . LITTLE_ENDIAN ) ) { bitsCached |= nextByte << ( bitsCachedSize ) ; } else { bitsCached <<= 8 ; bitsCached |= nextByte ; } bitsCachedSize += 8 ; } final int bitsOut ; if ( ( byteOrder ) == ( ByteOrder . LITTLE_ENDIAN ) ) { bitsOut = ( bitsCached ) & ( BitInputStream . MASKS [ count ] ) ; bitsCached >>>= count ; } else { bitsOut = ( ( bitsCached ) > > ( ( bitsCachedSize ) - count ) ) & ( BitInputStream . MASKS [ count ] ) ; } bitsCachedSize -= count ; return bitsOut ; } }

Fix:
throw new IllegalArgumentException ( ( "count<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>negative<seq2seq4repair_space>or<seq2seq4repair_space>bigger<seq2seq4repair_space>than<seq2seq4repair_space>" + ( BitInputStream . MAXIMUM_CACHE_SIZE ) ) ) ;
Buggy code:
public class MultiplexAppenderTest extends TestCase { private Logger root ; private Logger logger = Logger . getLogger ( MultiplexAppenderTest . class ) ; public void setUp ( ) { } public void testIllegalStates ( ) { MultiplexAppender appender = null ; appender = new MultiplexAppender ( ) ; try { <START_BUG> appender . activateOptions ( ) ; <END_BUG> fail ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>IllegalStateException<seq2seq4repair_space>because<seq2seq4repair_space>it<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>configured<seq2seq4repair_space>correctly" ) ; } catch ( Exception e ) { } appender = null ; } protected void tearDown ( ) throws Exception { } public void testMDCSelector ( ) throws Exception { } public void testcreateMDCAndDailyRollingAppenderFactory ( ) { } }

Fix:
appender . activate ( ) ;
Buggy code:
@ ThreadSafeAndProhibitedFromDsfExecutor ( "fSession.getExecutor()" ) public class TriggerCellModifier implements ICellModifier { private final DsfSession fSession ; @ ThreadSafe private ServiceTracker fServiceTracker ; public TriggerCellModifier ( DsfSession session ) { } @ Override public boolean canModify ( Object element , String property ) { } @ Override public Object getValue ( Object element , String property ) { } @ Override public void modify ( Object element , String property , Object value ) { if ( ! ( COL_VALUE . equals ( property ) ) ) return ; TriggerDMContext dmc = getAlarmDMC ( element ) ; if ( dmc == null ) return ; DsfSession session = DsfSession . getSession ( dmc . getSessionId ( ) ) ; if ( session == null ) return ; Shell shell = getShell ( ) ; if ( shell == null ) return ; <START_BUG> Integer intValue = null ; <END_BUG> if ( value instanceof String ) { try { intValue = new Integer ( ( ( String ) ( value ) ) . trim ( ) ) ; } catch ( NumberFormatException e ) { MessageDialog . openError ( shell , "Invalid<seq2seq4repair_space>Value" , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>positive<seq2seq4repair_space>integer" ) ; return ; } if ( ( intValue . intValue ( ) ) <= 0 ) { MessageDialog . openError ( shell , "Invalid<seq2seq4repair_space>Value" , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>positive<seq2seq4repair_space>integer" ) ; return ; } } TriggerCellModifier . SetValueQuery query = new TriggerCellModifier . SetValueQuery ( dmc , intValue ) ; try { session . getExecutor ( ) . execute ( query ) ; } catch ( RejectedExecutionException e ) { } try { query . get ( ) . toString ( ) ; } catch ( InterruptedException e ) { assert false ; } catch ( ExecutionException e ) { } } @ ThreadSafe public synchronized void dispose ( ) { } private Shell getShell ( ) { } private TriggerDMContext getAlarmDMC ( Object element ) { } @ ThreadSafe private synchronized AlarmService getService ( TriggerDMContext dmc ) { } private class GetValueQuery extends Query < Integer > { final TriggerDMContext fDmc ; private GetValueQuery ( TriggerDMContext dmc ) { } @ Override protected void execute ( final DataRequestMonitor < Integer > rm ) { } } private class SetValueQuery extends Query < Object > { TriggerDMContext fDmc ; int fValue ; SetValueQuery ( TriggerDMContext dmc , int value ) { } @ Override protected void execute ( final DataRequestMonitor < Object > rm ) { } } }

Fix:
Integer intValue = 0 ;
Buggy code:
public class StandardWebSocketHandlerAdapterTests { private StandardWebSocketHandlerAdapter adapter ; private WebSocketHandler webSocketHandler ; private StandardWebSocketSession webSocketSession ; private Session session ; @ Before public void setup ( ) { this . session = mock ( Session . class ) ; this . webSocketHandler = mock ( WebSocketHandler . class ) ; <START_BUG> this . webSocketSession = new StandardWebSocketSession ( null , null , null ) ; <END_BUG> this . adapter = new StandardWebSocketHandlerAdapter ( this . webSocketHandler , this . webSocketSession ) ; } @ Test public void onOpen ( ) throws Throwable { } @ Test public void onClose ( ) throws Throwable { } @ Test public void onError ( ) throws Throwable { } }

Fix:
this . webSocketSession = new StandardWebSocketSession ( null , null , null , null ) ;
Buggy code:
public final class QueryParserUtil { public static Query parse ( String [ ] queries , String [ ] fields , Analyzer analyzer ) throws QueryNodeException { } public static Query parse ( String query , String [ ] fields , BooleanClause [ ] flags , Analyzer analyzer ) throws QueryNodeException { } public static Query parse ( String [ ] queries , String [ ] fields , BooleanClause [ ] flags , Analyzer analyzer ) throws QueryNodeException { } public static String escape ( String s ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < ( s . length ( ) ) ; i ++ ) { char c = s . charAt ( i ) ; <START_BUG> if ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( c == '\\' ) || ( c == '+' ) ) || ( c == '-' ) ) || ( c == '!' ) ) || ( c == '(' ) ) || ( c == ')' ) ) || ( c == ':' ) ) || ( c == '^' ) ) || ( c == '[' ) ) || ( c == ']' ) ) || ( c == '\"' ) ) || ( c == '{' ) ) || ( c == '}' ) ) || ( c == '~' ) ) || ( c == '*' ) ) || ( c == '?' ) ) || ( c == '|' ) ) || ( c == '&' ) ) { <END_BUG> sb . append ( '\\' ) ; } sb . append ( c ) ; } return sb . toString ( ) ; } }

Fix:
if ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( c == '\\' ) || ( c == '+' ) ) || ( c == '-' ) ) || ( c == '!' ) ) || ( c == '(' ) ) || ( c == ')' ) ) || ( c == ':' ) ) || ( c == '^' ) ) || ( c == '[' ) ) || ( c == ']' ) ) || ( c == '\"' ) ) || ( c == '{' ) ) || ( c == '}' ) ) || ( c == '~' ) ) || ( c == '*' ) ) || ( c == '?' ) ) || ( c == '|' ) ) || ( c == '&' ) ) || ( c == '//' ) ) {
Buggy code:
public class OctalUnescaper extends CharSequenceTranslator { private static int OCTAL_MAX = 377 ; @ Override public int translate ( final CharSequence input , final int index , final Writer out ) throws IOException { if ( ( ( ( input . charAt ( index ) ) == '\\' ) && ( index < ( ( input . length ( ) ) - 1 ) ) ) && ( Character . isDigit ( input . charAt ( ( index + 1 ) ) ) ) ) { <START_BUG> int start = index + 1 ; <END_BUG> int end = index + 2 ; while ( ( end < ( input . length ( ) ) ) && ( Character . isDigit ( input . charAt ( end ) ) ) ) { end ++ ; if ( ( Integer . parseInt ( input . subSequence ( start , end ) . toString ( ) , 10 ) ) > ( OctalUnescaper . OCTAL_MAX ) ) { end -- ; break ; } } out . write ( Integer . parseInt ( input . subSequence ( start , end ) . toString ( ) , 8 ) ) ; return ( 1 + end ) - start ; } return 0 ; } }

Fix:
final int start = index + 1 ;
Buggy code:
public class GameView extends View { long lastUpdate = 0 ; long sleepTime = 0 ; Game game ; SurfaceHolder surfaceHolder ; public Context context ; Paint drawPaint ; public int [ ] pixels ; void init ( ) { } public GameView ( Context context , AttributeSet attrs , int defStyle ) { } public GameView ( Context context , AttributeSet attrs ) { } private boolean first = true ; private float scale ; private float ww ; private float hh ; int xo ; int yo ; private int height ; public void setDimensions ( int width , int height ) { <START_BUG> scale = Math . max ( ( height // ( ( float ) ( Game . HEIGHT ) ) ) , ( width // ( ( float ) ( Game . WIDTH ) ) ) ) ; <END_BUG> ww = ( Game . WIDTH ) * ( this . scale ) ; hh = ( Game . HEIGHT ) * ( this . scale ) ; xo = ( ( int ) ( width - ( ww ) ) ) // 2 ; yo = ( ( int ) ( height - ( hh ) ) ) // 2 ; first = false ; System . out . println ( ( ( ( ( width + "x" ) + height ) + ":" ) + ( scale ) ) ) ; } private Runnable doInvalidate = new Runnable ( ) { public void run ( ) { } } ; public void repaint ( ) { } @ Override protected void onDraw ( Canvas c ) { } }

Fix:
scale = Math . min ( ( height // ( ( float ) ( Game . HEIGHT ) ) ) , ( width // ( ( float ) ( Game . WIDTH ) ) ) ) ;
Buggy code:
public class DetailActivity extends ActionBarActivity implements View . OnClickListener { private TextView mStartDate ; private TextView mEndDate ; private TextView mStartTime ; private TextView mEndTime ; private TextView mLocation ; private TextView mDetails ; private TextView mContactInfo ; private TextView mTitle ; private TextView mCategory ; private LinearLayout layout ; private String imageUrl ; private String titleString ; private String startDateStr ; private String endDateStr ; private String startTimeStr ; private String endTimeStr ; private String locationStr ; private String descStr ; private boolean isRSVPtoEvent ; private ImageView mImage ; private static final String LOG_TAG = "EventList" ; private Firebase ref ; private EventItem thisEvent ; private GestureDetectorCompat mLeftDetector ; private OnTouchListener mListener ; private SwipeListener mFlinglistener ; private ShareActionProvider mShare ; private String eventNum ; private Toolbar toolbar ; private SearchView mSearch ; private Button mCalendarButton ; private Button mRSVPButton ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public void rsvpToEvent ( ) { } public void callCalendarIntent ( ) { Calendar beginTime = Calendar . getInstance ( ) ; Calendar endTime = Calendar . getInstance ( ) ; int [ ] beg = parseDateTime ( startDateStr , startTimeStr ) ; int [ ] end = parseDateTime ( endDateStr , endTimeStr ) ; beginTime . set ( beg [ 0 ] , beg [ 1 ] , beg [ 2 ] , beg [ 3 ] , beg [ 4 ] ) ; endTime . set ( end [ 0 ] , end [ 1 ] , end [ 2 ] , end [ 3 ] , end [ 4 ] ) ; Intent calendarIntent = new Intent ( Intent . ACTION_INSERT ) ; <START_BUG> calendarIntent . setData ( CONTENT_URI ) . putExtra ( EXTRA_EVENT_BEGIN_TIME , beginTime . getTimeInMillis ( ) ) . putExtra ( EXTRA_EVENT_END_TIME , endTime . getTimeInMillis ( ) ) . putExtra ( TITLE , titleString ) . putExtra ( DESCRIPTION , ( ( ( descStr ) + "<seq2seq4repair_space>" ) + ( mContactInfo ) ) ) . putExtra ( EVENT_LOCATION , locationStr ) . putExtra ( AVAILABILITY , AVAILABILITY_BUSY ) ; <END_BUG> startActivity ( calendarIntent ) ; } public int [ ] parseDateTime ( String date , String time ) { } private Intent getDefaultIntent ( ) { } @ Override public void onBackPressed ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onClick ( View v ) { } }

Fix:
calendarIntent . setData ( CONTENT_URI ) . putExtra ( EXTRA_EVENT_BEGIN_TIME , beginTime . getTimeInMillis ( ) ) . putExtra ( EXTRA_EVENT_END_TIME , endTime . getTimeInMillis ( ) ) . putExtra ( TITLE , titleString ) . putExtra ( DESCRIPTION , ( ( ( descStr ) + "<seq2seq4repair_space>" ) + ( mContactInfo . getText ( ) ) ) ) . putExtra ( EVENT_LOCATION , locationStr ) . putExtra ( AVAILABILITY , AVAILABILITY_BUSY ) ;
Buggy code:
@ Singleton public class Publish implements RestModifyView < RevisionResource , Publish . Input > , UiAction < RevisionResource > { public static class Input { } private final Provider < ReviewDb > dbProvider ; private final Factory updateFactory ; private final PatchSetNotificationSender sender ; private final ChangeHooks hooks ; private final ChangeIndexer indexer ; private final boolean allowDrafts ; @ Inject public Publish ( Provider < ReviewDb > dbProvider , ChangeUpdate . Factory updateFactory , PatchSetNotificationSender sender , ChangeHooks hooks , ChangeIndexer indexer , @ GerritServerConfig Config cfg ) { } @ Override public Response < ? > apply ( RevisionResource rsrc , Publish . Input input ) throws AuthException , ResourceConflictException , ResourceNotFoundException , OrmException , IOException { if ( ! ( rsrc . getPatchSet ( ) . isDraft ( ) ) ) { throw new ResourceConflictException ( "Patch<seq2seq4repair_space>set<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>draft" ) ; } if ( ! ( rsrc . getControl ( ) . canPublish ( dbProvider . get ( ) ) ) ) { throw new AuthException ( "Cannot<seq2seq4repair_space>publish<seq2seq4repair_space>this<seq2seq4repair_space>draft<seq2seq4repair_space>patch<seq2seq4repair_space>set" ) ; } if ( ! ( allowDrafts ) ) { <START_BUG> throw new ResourceConflictException ( "Draft<seq2seq4repair_space>workflow<seq2seq4repair_space>is<seq2seq4repair_space>disabled." ) ; <END_BUG> } PatchSet updatedPatchSet = updateDraftPatchSet ( rsrc ) ; Change updatedChange = updateDraftChange ( rsrc ) ; ChangeUpdate update = updateFactory . create ( rsrc . getControl ( ) , updatedChange . getLastUpdatedOn ( ) ) ; if ( ( ! ( updatedPatchSet . isDraft ( ) ) ) || ( ( updatedChange . getStatus ( ) ) == ( Status . NEW ) ) ) { CheckedFuture < ? , IOException > indexFuture = indexer . indexAsync ( updatedChange . getId ( ) ) ; sender . send ( rsrc . getNotes ( ) , update , ( ( rsrc . getChange ( ) . getStatus ( ) ) == ( Status . DRAFT ) ) , rsrc . getUser ( ) , updatedChange , updatedPatchSet , rsrc . getControl ( ) . getLabelTypes ( ) ) ; indexFuture . checkedGet ( ) ; hooks . doDraftPublishedHook ( updatedChange , updatedPatchSet , dbProvider . get ( ) ) ; } return Response . none ( ) ; } private Change updateDraftChange ( RevisionResource rsrc ) throws OrmException { } private PatchSet updateDraftPatchSet ( RevisionResource rsrc ) throws OrmException { } @ Override public Description getDescription ( RevisionResource rsrc ) { } public static class CurrentRevision implements RestModifyView < ChangeResource , Publish . Input > { private final Provider < ReviewDb > dbProvider ; private final Publish publish ; @ Inject CurrentRevision ( Provider < ReviewDb > dbProvider , Publish publish ) { } @ Override public Response < ? > apply ( ChangeResource rsrc , Publish . Input input ) throws AuthException , ResourceConflictException , ResourceNotFoundException , OrmException , IOException { } } }

Fix:
throw new ResourceConflictException ( "Draft<seq2seq4repair_space>workflow<seq2seq4repair_space>is<seq2seq4repair_space>disabled" ) ;
Buggy code:
public class CSVParser implements Iterable < CSVRecord > { private final Lexer lexer ; private final Map < String , Integer > headerMap ; private long recordNumber ; private final List < String > record = new ArrayList < String > ( ) ; private final Token reusableToken = new Token ( ) ; public CSVParser ( final Reader input ) throws IOException { } public CSVParser ( final Reader input , final CSVFormat format ) throws IOException { } public CSVParser ( final String input , final CSVFormat format ) throws IOException { } public Map < String , Integer > getHeaderMap ( ) { } <START_BUG> public int getLineNumber ( ) { <END_BUG> return lexer . getLineNumber ( ) ; } public long getRecordNumber ( ) { } CSVRecord getRecord ( ) throws IOException { } public List < CSVRecord > getRecords ( ) throws IOException { } private Map < String , Integer > initializeHeader ( final CSVFormat format ) throws IOException { } public Iterator < CSVRecord > iterator ( ) { } }

Fix:
public long getLineNumber ( ) {
Buggy code:
public class BundleActivateProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit depUnit = phaseContext . getDeploymentUnit ( ) ; XBundle bundle = depUnit . getAttachment ( BUNDLE_KEY ) ; <START_BUG> if ( ( ( bundle == null ) || ( bundle . isFragment ( ) ) ) || ( ! ( bundle . isResolved ( ) ) ) ) <END_BUG> return ; ServiceController < XBundle > controller = BundleActivateProcessor . BundleActivateService . addService ( phaseContext . getServiceTarget ( ) , depUnit , bundle ) ; phaseContext . addDependency ( controller . getName ( ) , AttachmentKey . create ( XBundle . class ) ) ; } @ Override public void undeploy ( final DeploymentUnit depUnit ) { } static class BundleActivateService implements Service < XBundle > { private final InjectedValue < XBundle > injectedBundle = new InjectedValue < XBundle > ( ) ; private final InjectedValue < Component > injectedComponent = new InjectedValue < Component > ( ) ; private final DeploymentUnit depUnit ; static ServiceController < XBundle > addService ( ServiceTarget serviceTarget , DeploymentUnit depUnit , XBundle bundle ) { } private BundleActivateService ( DeploymentUnit depUnit ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public XBundle getValue ( ) { } } }

Fix:
if ( ( bundle == null ) || ( bundle . isFragment ( ) ) )
Buggy code:
public abstract class Inode { private final long mCreationTimeMs ; protected final boolean mIsFolder ; private long mId ; private String mName ; private long mParentId ; private boolean mPinned = false ; private long mLastModificationTimeMs ; protected Inode ( String name , long id , long parentId , boolean isFolder , long creationTimeMs ) { } @ Override public synchronized boolean equals ( Object o ) { } public abstract ClientFileInfo generateClientFileInfo ( String path ) { } public long getCreationTimeMs ( ) { } public synchronized long getId ( ) { } public synchronized String getName ( ) { } public synchronized long getParentId ( ) { } public synchronized boolean isPinned ( ) { } public synchronized long getLastModificationTimeMs ( ) { } @ Override public synchronized int hashCode ( ) { } public boolean isDirectory ( ) { } public boolean isFile ( ) { } public synchronized void reverseId ( ) { } public synchronized void setName ( String name ) { } <START_BUG> public synchronized void setParentId ( int parentId ) { <END_BUG> mParentId = parentId ; } public synchronized void setPinned ( boolean pinned ) { } public synchronized void setLastModificationTimeMs ( long lastModificationTimeMs ) { } @ Override public synchronized String toString ( ) { } }

Fix:
public synchronized void setParentId ( long parentId ) {
Buggy code:
public class NamingDependencyProcessor implements DeploymentUnitProcessor { private static ModuleIdentifier NAMING_ID = ModuleIdentifier . create ( "org.jboss.as.naming" ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; <START_BUG> moduleSpecification . addDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , NamingDependencyProcessor . NAMING_ID , false , false , false ) ) ; <END_BUG> } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , NamingDependencyProcessor . NAMING_ID , false , false , false ) ) ;
Buggy code:
public class Glicko2 { private static final File CONFIG_FILE = new File ( "ranking.conf" ) ; private double tau ; private int default_rating ; private int default_rd ; private double default_vol ; private Glicko2 ( ) { } private static Glicko2 INSTANCE ; public static Glicko2 getInstance ( ) { } public GlickoRank defaultRank ( ) { } public double getTau ( ) { } <START_BUG> public double getDefaultRating ( ) { <END_BUG> return default_rating ; } public double getDefaultRd ( ) { } public double getDefaultVol ( ) { } }

Fix:
public int getDefaultRating ( ) {
Buggy code:
public class Base64BinaryDV extends TypeValidator { public short getAllowedFacets ( ) { } public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { String decoded = Base64 . decode ( content ) ; if ( decoded == null ) <START_BUG> throw new InvalidDatatypeValueException ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>encoded<seq2seq4repair_space>in<seq2seq4repair_space>base64" ) ) ; <END_BUG> return decoded ; } }

Fix:
throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "base64Binary" } ) ;
Buggy code:
public final class DomainControllerDeploymentItem implements Serializable , DeploymentItem { private static final long serialVersionUID = 4835276878814763612L ; <START_BUG> public void install ( final BatchBuilder builder ) { <END_BUG> } }

Fix:
public void install ( final DeploymentItemContext context ) {
Buggy code:
@ Controller public class StudentHomeController { @ RequestMapping ( value = "//student**" , method = RequestMethod . GET ) public ModelAndView adminPage ( ) { ModelAndView model = new ModelAndView ( ) ; model . addObject ( "title" , "Spring<seq2seq4repair_space>Security<seq2seq4repair_space>Login<seq2seq4repair_space>Form<seq2seq4repair_space>-<seq2seq4repair_space>Database<seq2seq4repair_space>Authentication" ) ; model . addObject ( "message" , "This<seq2seq4repair_space>page<seq2seq4repair_space>is<seq2seq4repair_space>for<seq2seq4repair_space>ROLE_STUDENT<seq2seq4repair_space>only!" ) ; model . setViewName ( "student" ) ; <START_BUG> LogWrapper logWrapper = new LogWrapper ( Home . class ) ; <END_BUG> logWrapper . info ( "student<seq2seq4repair_space>Logged" ) ; return model ; } }

Fix:
LogWrapper logWrapper = new LogWrapper ( StudentHomeController . class ) ;
Buggy code:
@ Component public class ANCVisitFormHandler implements FormPublishHandler { private final Logger log = LoggerFactory . getLogger ( this . getClass ( ) ) ; @ Autowired MotherVisitService visitService ; @ Autowired FacilityService facilityService ; @ Autowired private StaffService staffService ; @ Autowired private PatientService patientService ; @ Override @ MotechListener ( subjects = "form.validation.successful.NurseDataEntry.ancVisit" ) @ LoginAsAdmin @ ApiSession public void handleFormEvent ( MotechEvent event ) { try { ANCVisitForm form = ( ( ANCVisitForm ) ( event . getParameters ( ) . get ( FORM_BEAN ) ) ) ; ANCVisit ancVisit = createANCVisit ( form ) ; visitService . registerANCVisit ( ancVisit ) ; <START_BUG> if ( StringUtils . isEmpty ( ancVisit . getTtdose ( ) ) ) { <END_BUG> visitService . receivedTT ( TTVaccineDosage . byValue ( Integer . parseInt ( ancVisit . getTtdose ( ) ) ) , ancVisit . getPatient ( ) , ancVisit . getStaff ( ) , ancVisit . getFacility ( ) , DateUtil . today ( ) ) ; } } catch ( Exception e ) { log . error ( "Encountered<seq2seq4repair_space>error<seq2seq4repair_space>while<seq2seq4repair_space>saving<seq2seq4repair_space>ANC<seq2seq4repair_space>visit<seq2seq4repair_space>details" , e ) ; } } private ANCVisit createANCVisit ( ANCVisitForm form ) { } }

Fix:
if ( ! ( StringUtils . isEmpty ( ancVisit . getTtdose ( ) ) ) ) {
Buggy code:
public class RobotParticle { private Fiducial [ ] fiducials ; private double worldWidth ; private double worldHeight ; private double botLeftX ; private double botLeftY ; private double x ; private double y ; private double theta ; private double transNoise ; private double rotNoise ; private double sensorNoise ; private Random random ; public RobotParticle ( Fiducial [ ] fiducials , double worldWidth , double worldHeight , double botLeftX , double botLeftY , double transNoise , double rotNoise , double sensorNoise ) { } protected void motionUpdate ( double translation , double rotation ) { theta += rotation + ( ( random . nextGaussian ( ) ) * ( this . rotNoise ) ) ; theta %= 2 * ( Math . PI ) ; double transDist = translation + ( ( random . nextGaussian ( ) ) * ( this . transNoise ) ) ; x += ( Math . cos ( theta ) ) * transDist ; y += ( Math . sin ( theta ) ) * transDist ; x = Math . max ( botLeftX , Math . min ( x , ( ( worldWidth ) + ( botLeftX ) ) ) ) ; <START_BUG> y = Math . max ( botLeftY , Math . min ( y , ( ( worldWidth ) + ( botLeftY ) ) ) ) ; <END_BUG> } protected double probX ( double mean , double stdDev , double x ) { } protected double measurementProb ( ArrayList < Integer > measuredFiducials , HashMap < Integer , Double > measuredDists ) { } @ Override public String toString ( ) { } public double getX ( ) { } public double getY ( ) { } No newline ; at end ; of file ; }

Fix:
y = Math . max ( botLeftY , Math . min ( y , ( ( worldHeight ) + ( botLeftY ) ) ) ) ;
Buggy code:
public class ThroughputControllerGui extends AbstractControllerGui { private JComboBox styleBox ; private int style ; private JTextField throughput ; private JCheckBox perthread ; private boolean isPerThread = true ; private String BYNUMBER_LABEL = JMeterUtils . getResString ( "throughput_control_bynumber_label" ) ; private String BYPERCENT_LABEL = JMeterUtils . getResString ( "throughput_control_bypercent_label" ) ; private String THROUGHPUT_LABEL = JMeterUtils . getResString ( "throughput_control_tplabel" ) ; private String THROUGHPUT = "Througput<seq2seq4repair_space>Field" ; private String PERTHREAD_LABEL = JMeterUtils . getResString ( "throughput_control_perthread_label" ) ; public ThroughputControllerGui ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement tc ) { } public void clear ( ) { } public void configure ( TestElement el ) { } public String getLabelResource ( ) { } private void init ( ) { <START_BUG> setLayout ( new VerticalLayout ( 5 , VerticalLayout . LEFT , VerticalLayout . TOP ) ) ; <END_BUG> setBorder ( makeBorder ( ) ) ; add ( makeTitlePanel ( ) ) ; DefaultComboBoxModel styleModel = new DefaultComboBoxModel ( ) ; styleModel . addElement ( BYNUMBER_LABEL ) ; styleModel . addElement ( BYPERCENT_LABEL ) ; styleBox = new JComboBox ( styleModel ) ; styleBox . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { if ( ( ( String ) ( styleBox . getSelectedItem ( ) ) ) . equals ( BYNUMBER_LABEL ) ) { style = ThroughputController . BYNUMBER ; } else { style = ThroughputController . BYPERCENT ; } } } ) ; add ( styleBox ) ; JPanel tpPanel = new JPanel ( ) ; JLabel tpLabel = new JLabel ( THROUGHPUT_LABEL ) ; tpPanel . add ( tpLabel ) ; throughput = new JTextField ( 5 ) ; tpPanel . add ( throughput ) ; throughput . setName ( THROUGHPUT ) ; throughput . setText ( "1" ) ; tpPanel . add ( throughput ) ; add ( tpPanel ) ; perthread = new JCheckBox ( PERTHREAD_LABEL , isPerThread ) ; perthread . addItemListener ( new ItemListener ( ) { public void itemStateChanged ( ItemEvent event ) { if ( ( event . getStateChange ( ) ) == ( ItemEvent . SELECTED ) ) { isPerThread = true ; } else { isPerThread = false ; } } } ) ; add ( perthread ) ; } }

Fix:
setLayout ( new VerticalLayout ( 5 , VerticalLayout . BOTH , VerticalLayout . TOP ) ) ;
Buggy code:
class FailFast implements Iterator { private static final WeakHashMap MAP = new WeakHashMap ( ) ; static synchronized void invalidate ( Object o ) { } private static synchronized void add ( FailFast f ) { } private static synchronized void remove ( FailFast f ) { } private static synchronized void failFast ( FailFast f ) { <START_BUG> Set s = ( ( Set ) ( map . get ( f . parent ) ) ) ; <END_BUG> if ( ! ( s . contains ( f ) ) ) { throw new ConcurrentModificationException ( ) ; } } private Object parent ; private Iterator wrapped ; FailFast ( Object o , Iterator i ) { } public boolean hasNext ( ) { } public Object next ( ) { } public void remove ( ) { } }

Fix:
Set s = ( ( Set ) ( FailFast . MAP . get ( f . parent ) ) ) ;
Buggy code:
public class JGroupsSubsystemAddHandler extends AbstractAddStepHandler { JGroupsSubsystemAddHandler ( AttributeDefinition ... attributes ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > controllers ) throws OperationFailedException { } static Collection < ServiceController < ? > > installRuntimeServices ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler ) throws OperationFailedException { ServiceTarget target = context . getServiceTarget ( ) ; Collection < ServiceController < ? > > controllers = new LinkedList < > ( ) ; controllers . add ( ProtocolDefaultsService . build ( target ) . setInitialMode ( ON_DEMAND ) . install ( ) ) ; InjectedValueServiceBuilder builder = new InjectedValueServiceBuilder ( target ) ; String defaultChannel = ModelNodes . asString ( DEFAULT_CHANNEL . resolveModelAttribute ( context , model ) ) ; if ( ( defaultChannel != null ) && ( ! ( defaultChannel . equals ( DEFAULT ) ) ) ) { controllers . add ( builder . build ( ChannelService . getServiceName ( DEFAULT ) , ChannelService . getServiceName ( defaultChannel ) , Channel . class ) . install ( ) ) ; controllers . add ( builder . build ( ConnectedChannelService . getServiceName ( DEFAULT ) , ConnectedChannelService . getServiceName ( defaultChannel ) , Channel . class ) . install ( ) ) ; <START_BUG> controllers . add ( builder . build ( ChannelService . getFactoryServiceName ( DEFAULT ) , ChannelService . getFactoryServiceName ( defaultChannel ) , ChannelFactory . class ) . install ( ) ) ; <END_BUG> for ( GroupServiceInstaller installer : ServiceLoader . load ( ClusteredGroupServiceInstaller . class , ClusteredGroupServiceInstaller . class . getClassLoader ( ) ) ) { Iterator < ServiceName > names = installer . getServiceNames ( defaultChannel ) . iterator ( ) ; for ( ServiceName name : installer . getServiceNames ( DEFAULT ) ) { controllers . add ( builder . build ( name , names . next ( ) , Object . class ) . install ( ) ) ; } } } String defaultStack = ModelNodes . asString ( DEFAULT_STACK . resolveModelAttribute ( context , model ) ) ; if ( ( defaultStack != null ) && ( ! ( defaultStack . equals ( ChannelFactoryService . DEFAULT ) ) ) ) { controllers . add ( builder . build ( ChannelFactoryService . getServiceName ( ChannelFactoryService . DEFAULT ) , ChannelFactoryService . getServiceName ( defaultStack ) , ChannelFactory . class ) . install ( ) ) ; } return controllers ; } }

Fix:
controllers . add ( builder . build ( ChannelService . getStackServiceName ( DEFAULT ) , ChannelService . getStackServiceName ( defaultChannel ) , ChannelFactory . class ) . install ( ) ) ;
Buggy code:
public class FrameView extends JFrame implements WindowListener { FrameController frameController ; public FrameView ( FrameController frameController ) { } public void maximize ( ) { } public void saveWindowPosition ( ViewItem viewItem ) { } public void loadWindowPosition ( ViewItem viewItem ) { int x = viewItem . getInteger ( "window" , "width" ) ; int y = viewItem . getInteger ( "window" , "height" ) ; <START_BUG> boolean maximized = viewItem . getBoolean ( "window" , "maximized" ) ; <END_BUG> if ( maximized ) maximize ( ) ; else { Dimension dim = new Dimension ( x , y ) ; setSize ( dim ) ; validate ( ) ; } } public void windowActivated ( WindowEvent arg0 ) { } public void windowClosed ( WindowEvent arg0 ) { } public void windowClosing ( WindowEvent arg0 ) { } public void windowDeactivated ( WindowEvent arg0 ) { } public void windowDeiconified ( WindowEvent arg0 ) { } public void windowIconified ( WindowEvent arg0 ) { } public void windowOpened ( WindowEvent arg0 ) { } }

Fix:
boolean maximized = viewItem . getBoolean ( "window" , "maximized" , true ) ;
Buggy code:
public class BlockItemRegistry { public static HashMap < String , Short > blockItemIdMap = new HashMap < String , Short > ( ) ; private static HashMap < String , Item > items = new HashMap < String , Item > ( ) ; private static HashMap < String , Block > blocks = new HashMap < String , Block > ( ) ; private static HashMap < String , ItemStack > stacks = new HashMap < String , ItemStack > ( ) ; public static String currentMod = "" ; public static void setMod ( String name ) { } public static String texPath ( ) { } public static void registerBlock ( Block block , String id , Class < ? extends ItemBlock > item , Object ... par ) { BlockItemRegistry . blocks . put ( id , block ) ; GameRegistry . registerBlock ( block , item , id , par ) ; <START_BUG> if ( item . equals ( ItemBlock . class ) ) <END_BUG> BlockItemRegistry . registerItemStack ( new ItemStack ( block ) , block . getUnlocalizedName ( ) ) ; } public static void registerItem ( Item item , String id ) { } @ SideOnly ( Side . CLIENT ) public static void registerItemRender ( String id ) { } @ SideOnly ( Side . CLIENT ) public static void registerItemRender ( Item item , ItemMeshDefinition def ) { } @ SideOnly ( Side . CLIENT ) public static void registerBlockRender ( String id ) { } @ SideOnly ( Side . CLIENT ) public static void registerBlockRender ( String id , ItemMeshDefinition def ) { } @ SideOnly ( Side . CLIENT ) public static void registerModels ( String id , String ... models ) { } @ SideOnly ( Side . CLIENT ) public static void registerModels ( Block block , String ... models ) { } @ SideOnly ( Side . CLIENT ) public static void registerModels ( Item item , String ... models ) { } public static void registerItemStack ( ItemStack item , String name ) { } public static void registerMetadataItemStacks ( ItemStack startItem , String ... names ) { } public static Block getBlock ( String name ) { } public static Item getItem ( String name ) { } public static Block blockId ( String name ) { } public static Item itemId ( String name ) { } public static ItemStack stack ( String name , int n ) { } public static ItemStack stack ( String name , int n , int m ) { } }

Fix:
if ( ( item != null ) && ( item . equals ( ItemBlock . class ) ) )