nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CurrencyField extends FieldType implements ResourceLoaderAware , SchemaAware { protected static final String PARAM_DEFAULT_CURRENCY = "defaultCurrency" ; protected static final String PARAM_RATE_PROVIDER_CLASS = "providerClass" ; protected static final Object PARAM_PRECISION_STEP = "precisionStep" ; protected static final String DEFAULT_RATE_PROVIDER_CLASS = "solr.FileExchangeRateProvider" ; protected static final String DEFAULT_DEFAULT_CURRENCY = "USD" ; protected static final String DEFAULT_PRECISION_STEP = "0" ; protected static final String FIELD_SUFFIX_AMOUNT_RAW = "_amount_raw" ; protected static final String FIELD_SUFFIX_CURRENCY = "_currency" ; private IndexSchema schema ; protected FieldType fieldTypeCurrency ; protected FieldType fieldTypeAmountRaw ; private String exchangeRateProviderClass ; private String defaultCurrency ; private ExchangeRateProvider provider ; public static Logger log = LoggerFactory . getLogger ( CurrencyField . class ) ; @ Override protected void init ( IndexSchema schema , Map < String , String > args ) { } @ Override public boolean isPolyField ( ) { } @ Override public void checkSchemaField ( final SchemaField field ) throws SolrException { } @ Override public IndexableField [ ] createFields ( SchemaField field , Object externalVal , float boost ) { } private SchemaField getAmountField ( SchemaField field ) { } private SchemaField getCurrencyField ( SchemaField field ) { } private void createDynamicCurrencyField ( String suffix , FieldType type ) { } public void inform ( IndexSchema indexSchema ) { } public void inform ( ResourceLoader resourceLoader ) { } @ Override public Query getFieldQuery ( QParser parser , SchemaField field , String externalVal ) { } @ Override public Query getRangeQuery ( QParser parser , SchemaField field , String part1 , String part2 , final boolean minInclusive , final boolean maxInclusive ) { } public Query getRangeQuery ( QParser parser , SchemaField field , final CurrencyValue p1 , final CurrencyValue p2 , final boolean minInclusive , final boolean maxInclusive ) { } @ Override public SortField getSortField ( SchemaField field , boolean reverse ) { } public void write ( XMLWriter xmlWriter , String name , IndexableField field ) throws IOException { } @ Override public void write ( TextResponseWriter writer , String name , IndexableField field ) throws IOException { <START_BUG> writer . writeStr ( name , field . stringValue ( ) , false ) ; <END_BUG> } public ExchangeRateProvider getProvider ( ) { } class CurrencyValueSource extends ValueSource { private static final long serialVersionUID = 1L ; private String targetCurrencyCode ; private ValueSource currencyValues ; private ValueSource amountValues ; private final SchemaField sf ; public CurrencyValueSource ( SchemaField sfield , String targetCurrencyCode , QParser parser ) { } public FunctionValues getValues ( Map context , AtomicReaderContext reader ) throws IOException { } public String name ( ) { } @ Override public String description ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } } }

Fix:
writer . writeStr ( name , field . stringValue ( ) , true ) ;
Buggy code:
public class Snippet252 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . addListener ( Paint , new Listener ( ) { public void handleEvent ( Event event ) { GC gc = event . gc ; gc . setLineAttributes ( new LineAttributes ( 10 , SWT . CAP_FLAT , SWT . JOIN_MITER , SWT . LINE_SOLID , null , 0 , 10 ) ) ; gc . drawPolyline ( new int [ ] { 50 , 100 , 50 , 20 , 60 , 30 , 50 , 45 } ) ; <START_BUG> gc . setLineAttributes ( new LineAttributes ( ( 1 // 2 ) , SWT . CAP_FLAT , SWT . JOIN_MITER , SWT . LINE_DOT , null , 0 , 10 ) ) ; <END_BUG> gc . drawPolyline ( new int [ ] { 100 , 100 , 100 , 20 , 110 , 30 , 100 , 45 } ) ; } } ) ; shell . setSize ( 170 , 170 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
gc . setLineAttributes ( new LineAttributes ( ( 1 // 2.0F ) , SWT . CAP_FLAT , SWT . JOIN_MITER , SWT . LINE_DOT , null , 0 , 10 ) ) ;
Buggy code:
public abstract class UserAPI { interface TASKID { String TASK_GET_LOGIN = "login" ; } <START_BUG> @ Path ( "http:////www.baidu.com" ) <END_BUG> @ TaskId ( UserAPI . TASKID . TASK_GET_LOGIN ) @ GET public abstract void login ( OnResponseListener l , String username , String password ) ; }

Fix:
@ Path ( "http:////api.segmentfault.com//question//newest?page=1" )
Buggy code:
public class GenericStoredProcedureTests extends AbstractJdbcTests { private final boolean debugEnabled = LogFactory . getLog ( JdbcTemplate . class ) . isDebugEnabled ( ) ; private CallableStatement mockCallable ; private BeanFactory bf ; @ Before protected void setUp ( ) throws Exception { super . setUp ( ) ; mockCallable = createMock ( CallableStatement . class ) ; <START_BUG> bf = new org . springframework . beans . factory . xml . XmlBeanFactory ( new ClassPathResource ( "org//springframework//jdbc//support//GenericStoredProcedureTests-context.xml" ) ) ; <END_BUG> TestDataSourceWrapper testDataSource = ( ( TestDataSourceWrapper ) ( bf . getBean ( "dataSource" ) ) ) ; testDataSource . setTarget ( mockDataSource ) ; } @ After protected void tearDown ( ) throws Exception { } protected void replay ( ) { } @ Test public void testAddInvoices ( ) throws Exception { } private void testAddInvoice ( final int amount , final int custid ) throws Exception { } }

Fix:
bf = new org . springframework . beans . factory . xml . XmlBeanFactory ( new ClassPathResource ( "org//springframework//jdbc//object//GenericStoredProcedureTests-context.xml" ) ) ;
Buggy code:
public interface LoggerRepository { public void addLoggerRepositoryEventListener ( LoggerRepositoryEventListener listener ) { } public void removeLoggerRepositoryEventListener ( LoggerRepositoryEventListener listener ) { } public void addLoggerEventListener ( LoggerEventListener listener ) { } public void removeLoggerEventListener ( LoggerEventListener listener ) { } boolean isDisabled ( int level ) { } public String getName ( ) { } public void setName ( String repoName ) { } public void setThreshold ( Level level ) { } public void setThreshold ( String val ) { } <START_BUG> public void emitNoAppenderWarning ( Category cat ) ; <END_BUG> public Level getThreshold ( ) { } public Logger getLogger ( String name ) { } public Logger getLogger ( String name , LoggerFactory factory ) { } public Logger getRootLogger ( ) { } public boolean isPristine ( ) { } public void setPristine ( boolean state ) { } public abstract Logger exists ( String name ) { } public abstract void shutdown ( ) { } public Enumeration getCurrentLoggers ( ) { } public Enumeration getCurrentCategories ( ) { } public abstract void resetConfiguration ( ) { } public abstract void fireAddAppenderEvent ( Logger logger , Appender appender ) { } public abstract void fireRemoveAppenderEvent ( Logger logger , Appender appender ) { } public abstract void fireLevelChangedEvent ( Logger logger ) { } public abstract void fireConfigurationChangedEvent ( ) { } public PluginRegistry getPluginRegistry ( ) { } public Map getProperties ( ) { } public String getProperty ( String key ) { } public void setProperty ( String key , String value ) { } }

Fix:
public void emitNoAppenderWarning ( Logger logger ) ;
Buggy code:
class StyledTextTab extends ScrollableTab { StyledText styledText ; Group styledTextGroup ; Group styledTextStyleGroup ; Button wrapButton ; Button readOnlyButton ; Button fullSelectionButton ; Button boldButton ; Button italicButton ; Button redButton ; Button yellowButton ; Button underlineButton ; Button strikeoutButton ; Image boldImage ; Image italicImage ; Image redImage ; Image yellowImage ; Image underlineImage ; Image strikeoutImage ; StyleRange [ ] styleRanges ; StyledTextTab ( ControlExample instance ) { } Image createBitmapImage ( Display display , String name ) { } void createControlWidgets ( ) { } void createExampleGroup ( ) { super . createExampleGroup ( ) ; styledTextGroup = new Group ( exampleGroup , SWT . NONE ) ; styledTextGroup . setLayout ( new GridLayout ( ) ) ; <START_BUG> styledTextGroup . setLayoutData ( new GridData ( ( ( ( GridData . GRAB_HORIZONTAL ) | ( GridData . HORIZONTAL_ALIGN_FILL ) ) | ( GridData . VERTICAL_ALIGN_FILL ) ) ) ) ; <END_BUG> styledTextGroup . setText ( "StyledText" ) ; } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } void createStyledTextStyleGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } void disposeExampleWidgets ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String getTabText ( ) { } void setExampleWidgetState ( ) { } }

Fix:
styledTextGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ;
Buggy code:
public class UserBaseTest extends AppiumParallelTest { @ BeforeMethod public void startApp ( Method name ) throws Exception { } @ AfterMethod public void killServer ( ITestResult result ) throws IOException , InterruptedException { endLogTestResults ( result ) ; <START_BUG> getDriver ( ) . resetApp ( ) ; <END_BUG> } public AppiumDriver < MobileElement > getDriver ( ) { } @ BeforeClass public void beforeClass ( ) throws Exception { } @ AfterClass public void afterClass ( ) throws IOException , InterruptedException { } }

Fix:
getDriver ( ) . quit ( ) ;
Buggy code:
public class DeletePackageFragmentRootOperation extends JavaModelOperation { int updateResourceFlags ; int updateModelFlags ; public DeletePackageFragmentRootOperation ( IPackageFragmentRoot root , int updateResourceFlags , int updateModelFlags ) { } protected void executeOperation ( ) throws JavaModelException { } protected void deleteResource ( IPackageFragmentRoot root , IClasspathEntry rootEntry ) throws JavaModelException { final char [ ] [ ] exclusionPatterns = ( ( ClasspathEntry ) ( rootEntry ) ) . fullExclusionPatternChars ( ) ; IResource rootResource = root . getResource ( ) ; if ( ( ( rootEntry . getEntryKind ( ) ) != ( IClasspathEntry . CPE_SOURCE ) ) || ( exclusionPatterns == null ) ) { try { rootResource . delete ( this . updateResourceFlags , progressMonitor ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } else { final IPath [ ] nestedFolders = getNestedFolders ( root ) ; IResourceProxyVisitor visitor = new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) throws CoreException { if ( ( proxy . getType ( ) ) == ( IResource . FOLDER ) ) { IPath path = proxy . requestFullPath ( ) ; if ( prefixesOneOf ( path , nestedFolders ) ) { return ! ( equalsOneOf ( path , nestedFolders ) ) ; } else { proxy . requestResource ( ) . delete ( updateResourceFlags , progressMonitor ) ; return false ; } } else { proxy . requestResource ( ) . delete ( updateResourceFlags , progressMonitor ) ; return false ; } } } ; try { rootResource . accept ( visitor , IResource . NONE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } <START_BUG> this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ; <END_BUG> } protected void updateReferringProjectClasspaths ( IPath rootPath , IJavaProject projectOfRoot , Map oldRoots ) throws JavaModelException { } protected void updateProjectClasspath ( IPath rootPath , IJavaProject project , Map oldRoots ) throws JavaModelException { } protected IJavaModelStatus verify ( ) { } }

Fix:
JavaModelOperation . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ;
Buggy code:
public class QueryHandler { private static QueryHandler instance_ = null ; private List < WOWCharacter > characters_ = null ; MySQLManager manager_ ; private QueryHandler ( ) { } public static void saveToDatabase ( ) { } public static void loadFromDatabase ( ) { } public static void clearDatabase ( ) { } public static QueryHandler getInstance ( ) { } public static List < WOWCharacter > getAllCharacters ( ) { } public static void addCharacter ( WOWCharacter c ) { } public static void deleteCharacter ( WOWCharacter c ) { } public static void weeklyDecay ( ) { int totalScore ; int decayScore ; for ( WOWCharacter c : QueryHandler . getInstance ( ) . characters_ ) { totalScore = c . getTotalDKP ( ) ; decayScore = QueryHandler . calcDecayScore ( totalScore ) ; <START_BUG> DKPEvent e = new DKPEvent ( decayScore , DKPEventType . WEEKLY_DECAY , c , null , null ) ; <END_BUG> try { c . addDKPEvent ( e ) ; } catch ( NotEnoughDKPException e1 ) { e1 . printStackTrace ( ) ; } } } private static int calcDecayScore ( int score ) { } }

Fix:
DKPEvent e = new DKPEvent ( decayScore , DKPEventType . WEEKLY_DECAY , c , null , Difficulty . NOT_APPLICABLE ) ;
Buggy code:
public enum JavaVersion { JAVA_0_9 ( 1.5F , "0.9" ) , JAVA_1_1 ( 1.1F , "1.1" ) , JAVA_1_2 ( 1.2F , "1.2" ) , JAVA_1_3 ( 1.3F , "1.3" ) , JAVA_1_4 ( 1.4F , "1.4" ) , JAVA_1_5 ( 1.5F , "1.5" ) , JAVA_1_6 ( 1.6F , "1.6" ) , JAVA_1_7 ( 1.7F , "1.7" ) ; private float value ; private String name ; JavaVersion ( final float value , final String name ) { } public boolean atLeast ( JavaVersion requiredVersion ) { } static JavaVersion getJavaVersion ( final String nom ) { <START_BUG> return JavaVersion . getJavaVersion ( nom ) ; <END_BUG> } static JavaVersion get ( final String nom ) { } }

Fix:
return JavaVersion . get ( nom ) ;
Buggy code:
public class Hex implements BinaryDecoder , BinaryEncoder { private static final char [ ] DIGITS_LOWER = new char [ ] { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' } ; private static final char [ ] DIGITS_UPPER = new char [ ] { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' } ; public static byte [ ] decodeHex ( char [ ] data ) throws DecoderException { } protected static int toDigit ( char ch , int index ) throws DecoderException { } public static char [ ] encodeHex ( byte [ ] data ) { } public static char [ ] encodeHex ( byte [ ] data , boolean toLowerCase ) { } protected static char [ ] encodeHex ( byte [ ] data , char [ ] toDigits ) { } public byte [ ] decode ( byte [ ] array ) throws DecoderException { } public Object decode ( Object object ) throws DecoderException { } public byte [ ] encode ( byte [ ] array ) { } public Object encode ( Object object ) throws EncoderException { try { byte [ ] byteArray = ( object instanceof String ) ? ( ( String ) ( object ) ) . getBytes ( ) : ( ( byte [ ] ) ( object ) ) ; return Hex . encodeHex ( byteArray ) ; } catch ( ClassCastException e ) { <START_BUG> throw new EncoderException ( e . getMessage ( ) ) ; <END_BUG> } } }

Fix:
throw new EncoderException ( e . getMessage ( ) , e ) ;
Buggy code:
public class DefaultMaze implements Maze { private Room [ ] [ ] mMap ; public DefaultMaze ( int width , int height ) { } @ Override public int getHeight ( ) { } @ Override public int getWidth ( ) { } @ Override public Set < Point > getPoints ( ) { } @ Override public Iterable < Room > getRooms ( ) { } @ Override public Room getRoom ( Point point ) { } @ Override public void putRoom ( Room room ) { } @ Override public Iterable < Room > getRoomsContaining ( final Class < ? extends Sprite > type ) { } @ Override public Iterable < Room > getRoomsOfType ( final Class < ? extends Sprite > type ) { } @ Override public DefaultMaze clone ( ) { DefaultMaze clone = new DefaultMaze ( getWidth ( ) , getHeight ( ) ) ; for ( int y = 0 ; y < ( getHeight ( ) ) ; y ++ ) <START_BUG> System . arraycopy ( mMap , 0 , clone . mMap , 0 , getWidth ( ) ) ; <END_BUG> return clone ; } }

Fix:
System . arraycopy ( mMap [ y ] , 0 , clone . mMap [ y ] , 0 , getWidth ( ) ) ;
Buggy code:
public class update { Message query ; Message response ; Resolver res ; String server = null ; Name origin ; Name zone ; int defaultTTL ; short defaultClass = DClass . IN ; PrintStream log = null ; void print ( Object o ) { } public update ( InputStream in ) throws IOException { } void sendUpdate ( ) throws IOException { } Record parseRR ( MyStringTokenizer st , short classValue , int TTLValue ) throws IOException { } Record parseSet ( MyStringTokenizer st , short classValue ) throws IOException { } Record parseName ( MyStringTokenizer st , short classValue ) throws IOException { } void doRequire ( MyStringTokenizer st ) throws IOException { } void doProhibit ( MyStringTokenizer st ) throws IOException { } void doAdd ( MyStringTokenizer st ) throws IOException { } void doDelete ( MyStringTokenizer st ) throws IOException { } void doGlue ( MyStringTokenizer st ) throws IOException { } void doQuery ( MyStringTokenizer st ) throws IOException { Record rec ; Name name = null ; short type = Type . A ; short dclass = defaultClass ; <START_BUG> name = new Name ( st . nextToken ( ) ) ; <END_BUG> if ( st . hasMoreTokens ( ) ) { type = Type . value ( st . nextToken ( ) ) ; if ( type < 0 ) throw new IOException ( "Invalid<seq2seq4repair_space>type" ) ; if ( st . hasMoreTokens ( ) ) { dclass = DClass . value ( st . nextToken ( ) ) ; if ( dclass < 0 ) throw new IOException ( "Invalid<seq2seq4repair_space>class" ) ; } } rec = Record . newRecord ( name , type , dclass ) ; Message newQuery = Message . newQuery ( rec ) ; if ( ( res ) == null ) res = new SimpleResolver ( server ) ; if ( ( rec . getType ( ) ) == ( Type . AXFR ) ) response = res . sendAXFR ( newQuery ) ; else response = res . send ( newQuery ) ; print ( response ) ; } void doFile ( MyStringTokenizer st , Vector inputs , Vector istreams ) { } void doLog ( MyStringTokenizer st ) { } boolean doAssert ( MyStringTokenizer st ) { } static void helpResolver ( ) { } static void helpAttributes ( ) { } static void helpData ( ) { } static void helpOperations ( ) { } static void help ( String topic ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
name = new Name ( st . nextToken ( ) , origin ) ;
Buggy code:
public class MatchingOpenable { static final CompilationUnitDeclaration ALREADY_RESOLVED = new CompilationUnitDeclaration ( null , null , 0 ) ; private MatchLocator locator ; public IResource resource ; public Openable openable ; private CompilationUnitDeclaration parsedUnit ; private char [ ] source ; private MatchSet matchSet ; public MatchingOpenable ( MatchLocator locator , IResource resource , Openable openable ) { } public MatchingOpenable ( MatchLocator locator , IResource resource , Openable openable , CompilationUnitDeclaration parsedUnit , MatchSet matchSet ) { } public void buildTypeBindings ( ) { } private void buildTypeBindings ( final char [ ] source ) { } public boolean equals ( Object obj ) { } private char [ ] getQualifiedName ( ) { } public char [ ] getSource ( ) { } public int hashCode ( ) { } public boolean hasAlreadyDefinedType ( ) { } public void locateMatches ( ) throws CoreException { } private void locateMatchesInClassFile ( ) throws CoreException , JavaModelException { } private void locateMatchesInCompilationUnit ( char [ ] source ) throws CoreException { if ( ( this . parsedUnit ) == null ) { this . matchSet = new MatchSet ( this . locator ) ; this . locator . parser . matchSet = this . matchSet ; char [ ] qualifiedName = this . getQualifiedName ( ) ; if ( ( qualifiedName == null ) || ( ( this . parsedUnit = ( ( CompilationUnitDeclaration ) ( this . locator . parsedUnits . get ( qualifiedName ) ) ) ) == null ) ) { this . parsedUnit = this . locator . dietParse ( source ) ; } } <START_BUG> if ( ( this . parsedUnit ) != null ) { <END_BUG> try { this . locator . parser . matchSet = this . matchSet ; this . locator . parser . scanner . setSource ( source ) ; this . locator . parser . parseBodies ( this . parsedUnit ) ; this . matchSet . cuHasBeenResolved = false ; this . matchSet . reportMatching ( parsedUnit ) ; if ( ( this . matchSet . needsResolve ( ) ) && ( ( this . parsedUnit . types ) != null ) ) { if ( ! ( this . locator . compilationAborted ) ) { try { if ( ( this . parsedUnit . scope ) == null ) { MatchingOpenable [ ] openables = this . locator . matchingOpenables . getMatchingOpenables ( this . openable . getJavaProject ( ) . getPackageFragmentRoots ( ) ) ; this . locator . createAndResolveBindings ( openables ) ; } if ( ( this . parsedUnit . scope ) != null ) { this . parsedUnit . scope . faultInTypes ( ) ; this . parsedUnit . resolve ( ) ; } this . matchSet . cuHasBeenResolved = true ; this . matchSet . reportMatching ( this . parsedUnit ) ; } catch ( AbortCompilation e ) { this . matchSet . cuHasBeenResolved = true ; this . matchSet . reportMatching ( this . parsedUnit ) ; if ( ! ( e instanceof AbortCompilationUnit ) ) { throw e ; } } } else { this . matchSet . cuHasBeenResolved = true ; this . matchSet . reportMatching ( this . parsedUnit ) ; } } } finally { this . locator . parser . matchSet = null ; } } } public void reset ( ) { } public String toString ( ) { } }

Fix:
if ( ( ( this . parsedUnit ) != null ) && ( ( this . parsedUnit ) != ( MatchingOpenable . ALREADY_RESOLVED ) ) ) {
Buggy code:
public class DefaultLogger implements BuildLogger { private static int LEFT_COLUMN_SIZE = 12 ; protected PrintStream out ; protected PrintStream err ; protected int msgOutputLevel ; private long startTime = System . currentTimeMillis ( ) ; protected static String lSep = System . getProperty ( "line.separator" ) ; protected boolean emacsMode = false ; public void setMessageOutputLevel ( int level ) { } public void setOutputPrintStream ( PrintStream output ) { } public void setErrorPrintStream ( PrintStream err ) { } public void setEmacsMode ( boolean emacsMode ) { } public void buildStarted ( BuildEvent event ) { } public void buildFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { <START_BUG> if ( ( msgOutputLevel ) <= ( Project . MSG_INFO ) ) { <END_BUG> out . println ( ( ( ( DefaultLogger . lSep ) + ( event . getTarget ( ) . getName ( ) ) ) + ":" ) ) ; } } public void targetFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { } protected static String formatTime ( long millis ) { } }

Fix:
if ( ( Project . MSG_INFO ) <= ( msgOutputLevel ) ) {
Buggy code:
public abstract class Pickup extends AbstractEnvironmentObject { private boolean onGround ; private boolean isActive ; private boolean toRemove ; private int tickCount ; public Pickup ( Image image , float locX , float locY ) { } @ Override public void render ( GameContainer container , Graphics graphics ) throws SlickException { } @ Override public < T extends Modifiable > void update ( T container , int delta ) throws SlickException { } protected int getTickCount ( ) { } protected void setTickCount ( int tick ) { } protected boolean isOnGround ( ) { } public void setOnGround ( boolean onGround ) { } public boolean willBeRemoved ( ) { } public void toRemove ( ) { } public boolean isActive ( ) { } public void setActive ( boolean active ) { } public static Pickup generateRandomPickup ( int random , float locX , float locY ) { if ( random < 4 ) { int randomWeaponNr = Helpers . randInt ( 1 , 4 ) ; switch ( randomWeaponNr ) { case 1 : return new RegularWeapon ( locX , locY ) ; case 2 : return new DoubleWeapon ( locX , locY ) ; case 3 : return new StickyWeapon ( locX , locY ) ; case 4 : return new FlowerWeapon ( locX , locY ) ; default : return new RegularWeapon ( locX , locY ) ; } } else if ( random < 7 ) { <START_BUG> int randomPowerupNr = Helpers . randInt ( 6 , 10 ) ; <END_BUG> if ( randomPowerupNr == 11 ) { return new LifePowerup ( locX , locY ) ; } else if ( randomPowerupNr > 9 ) { return new MoneyPowerup ( locX , locY ) ; } else if ( randomPowerupNr > 8 ) { return new InvinciblePowerup ( locX , locY ) ; } else if ( randomPowerupNr > 6 ) { return new ShieldPowerup ( locX , locY ) ; } else if ( randomPowerupNr > 4 ) { return new SpeedPowerup ( locX , locY ) ; } else { return new PointsPowerup ( locX , locY ) ; } } else { int randomUtilNr = Helpers . randInt ( 1 , 20 ) ; if ( randomUtilNr == 20 ) { return new LevelWonUtility ( locX , locY ) ; } else if ( randomUtilNr > 16 ) { return new SplitUtility ( locX , locY ) ; } else if ( randomUtilNr > 11 ) { return new SlowUtility ( locX , locY ) ; } else if ( randomUtilNr > 6 ) { return new FreezeUtility ( locX , locY ) ; } else { return new TimeUtility ( locX , locY ) ; } } } }

Fix:
int randomPowerupNr = Helpers . randInt ( 6 , 11 ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class WebAppTestCase { @ Inject public BundleContext context ; @ Inject public Bundle bundle ; @ Deployment public static WebArchive createdeployment ( ) { final WebArchive archive = ShrinkWrap . create ( WebArchive . class , "example-webapp" ) ; archive . addClasses ( EndpointServlet . class ) ; archive . addResource ( "osgi//webapp//message.txt" , "message.txt" ) ; <START_BUG> archive . addResource ( "osgi//webapp//web.xml" , "WEB-INF//web.xml" ) ; <END_BUG> archive . add ( new Asset ( ) { public InputStream openStream ( ) { OSGiManifestBuilder builder = OSGiManifestBuilder . newInstance ( ) ; builder . addBundleSymbolicName ( archive . getName ( ) ) ; builder . addBundleManifestVersion ( 2 ) ; builder . addManifestHeader ( BUNDLE_CLASSPATH , ".,WEB-INF//classes" ) ; builder . addManifestHeader ( "Web-ContextPath" , "example-webapp" ) ; builder . addImportPackages ( HttpServiceCapability . class ) ; builder . addImportPackages ( HttpServlet . class , Servlet . class ) ; return builder . openStream ( ) ; } } , JarFile . MANIFEST_NAME ) ; return archive ; } @ Test public void testServletAccess ( ) throws Exception { } @ Test public void testServletInitProps ( ) throws Exception { } @ Test public void testResourceAccess ( ) throws Exception { } private String getHttpResponse ( String reqPath , int timeout ) throws IOException { } }

Fix:
archive . addResource ( "osgi//webapp//webA.xml" , "WEB-INF//web.xml" ) ;
Buggy code:
public class HelpController { private int currentItem ; private Help helpModel ; public HelpController ( Help helpModel ) { } public HelpItem getCurrentItem ( ) { } public HelpItem getPreviousItem ( ) { } public HelpItem getNextItem ( ) { <START_BUG> return helpModel . getItemAt ( ( ( currentItem ) -- ) ) ; <END_BUG> } public HelpItem getItemAt ( int index ) { } }

Fix:
return helpModel . getItemAt ( ( ( currentItem ) ++ ) ) ;
Buggy code:
class FieldNotEditableResult implements BindingResult { private String property ; private Object sourceValue ; private MessageSource messageSource ; public FieldNotEditableResult ( String property , Object sourceValue , MessageSource messageSource ) { } public String getFieldName ( ) { } public Object getSubmittedValue ( ) { } public boolean isFailure ( ) { } public Alert getAlert ( ) { return new Alert ( ) { public String getCode ( ) { <START_BUG> return "propertyNotWriteable" ; <END_BUG> } public Severity getSeverity ( ) { return Severity . WARNING ; } public String getMessage ( ) { MessageBuilder builder = new MessageBuilder ( messageSource ) ; builder . code ( "bindSuccess" ) ; builder . arg ( "label" , new ResolvableArgument ( property ) ) ; builder . arg ( "value" , sourceValue ) ; builder . defaultMessage ( ( ( ( ( "Successfully<seq2seq4repair_space>bound<seq2seq4repair_space>user<seq2seq4repair_space>value<seq2seq4repair_space>" + ( StylerUtils . style ( sourceValue ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>property<seq2seq4repair_space>'" ) + ( property ) ) + "'" ) ) ; return builder . build ( ) ; } } ; } public String toString ( ) { } }

Fix:
return "fieldNotEditable" ;
Buggy code:
abstract class RFC1522Codec { protected static final char SEP = '?' ; protected static final String POSTFIX = "?=" ; protected static final String PREFIX = "=?" ; protected String encodeText ( final String text , final String charset ) throws UnsupportedEncodingException , EncoderException { } protected String decodeText ( final String text ) throws UnsupportedEncodingException , DecoderException { if ( text == null ) { return null ; } if ( ( ! ( text . startsWith ( RFC1522Codec . PREFIX ) ) ) || ( ! ( text . endsWith ( RFC1522Codec . POSTFIX ) ) ) ) { throw new DecoderException ( "RFC<seq2seq4repair_space>1522<seq2seq4repair_space>violation:<seq2seq4repair_space>malformed<seq2seq4repair_space>encoded<seq2seq4repair_space>content" ) ; } int termnator = ( text . length ( ) ) - 2 ; int from = 2 ; int to = text . indexOf ( RFC1522Codec . SEP , from ) ; if ( to == termnator ) { throw new DecoderException ( "RFC<seq2seq4repair_space>1522<seq2seq4repair_space>violation:<seq2seq4repair_space>charset<seq2seq4repair_space>token<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } String charset = text . substring ( from , to ) ; if ( charset . equals ( "" ) ) { throw new DecoderException ( "RFC<seq2seq4repair_space>1522<seq2seq4repair_space>violation:<seq2seq4repair_space>charset<seq2seq4repair_space>not<seq2seq4repair_space>specified" ) ; } from = to + 1 ; to = text . indexOf ( RFC1522Codec . SEP , from ) ; <START_BUG> if ( ( to == ( - 1 ) ) || ( to == termnator ) ) { <END_BUG> throw new DecoderException ( "RFC<seq2seq4repair_space>1522<seq2seq4repair_space>violation:<seq2seq4repair_space>encoding<seq2seq4repair_space>token<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } String encoding = text . substring ( from , to ) ; if ( ! ( getEncoding ( ) . equalsIgnoreCase ( encoding ) ) ) { throw new DecoderException ( ( ( "This<seq2seq4repair_space>codec<seq2seq4repair_space>cannot<seq2seq4repair_space>decode<seq2seq4repair_space>" + encoding ) + "<seq2seq4repair_space>encoded<seq2seq4repair_space>content" ) ) ; } from = to + 1 ; to = text . indexOf ( RFC1522Codec . SEP , from ) ; byte [ ] data = StringUtils . getBytesUsAscii ( text . substring ( from , to ) ) ; data = doDecoding ( data ) ; return new String ( data , charset ) ; } protected abstract String getEncoding ( ) { } protected abstract byte [ ] doEncoding ( byte [ ] bytes ) throws EncoderException { } protected abstract byte [ ] doDecoding ( byte [ ] bytes ) throws DecoderException { } }

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

Fix:
return bundleContext . createFilter ( ( ( ( ( ( ( "(|(" + ( Constants . OBJECTCLASS ) ) + "=" ) + ( IHello . class . getName ( ) ) ) + ")(" ) + ( SERVICE_IMPORTED ) ) + "=*))" ) ) ;
Buggy code:
@ Command ( "complete" ) public class CompleteCommand extends ProjectCommand { public static class CompletionResultInfo { public final List < CompletionInfo < ? > > completions ; public final Problems problems ; private CompletionResultInfo ( List < CompletionInfo < ? > > completions , Problems problems ) { } } @ Required @ Inject PsiFile file ; @ Required int offset ; String prefix ; public CompleteCommand ( Project project , String filePath , int offset ) { } @ Override public Result execute ( ) { } public LookupElement [ ] performCompletion ( final CompletionParameters parameters , final String prefix , final Consumer < CompletionResult > consumer ) { } public static void getVariantsFromContributors ( final CompletionParameters parameters , final String prefix , final CompletionContributor from , final Consumer < CompletionResult > consumer ) { } static CompletionResultSet createResultSet ( final CompletionParameters parameters , final String userPrefix , final Consumer < CompletionResult > consumer , final CompletionContributor contributor ) { final PsiElement position = parameters . getPosition ( ) ; final String prefix = ( userPrefix != null ) ? userPrefix : CompleteCommand . findPrefix ( position , parameters . getOffset ( ) ) ; final int lengthOfTextBeforePosition = parameters . getOffset ( ) ; <START_BUG> final CamelHumpMatcher matcher = new CamelHumpMatcher ( prefix ) ; <END_BUG> final CompletionSorter sorter = CompletionService . getCompletionService ( ) . defaultSorter ( parameters , matcher ) ; return new CompletionResultSetImpl ( consumer , lengthOfTextBeforePosition , matcher , contributor , parameters , sorter , null ) ; } @ SuppressWarnings ( "deprecation" ) static String findPrefix ( PsiElement position , int offset ) { } }

Fix:
final CamelHumpMatcher matcher = new CamelHumpMatcher ( prefix , false ) ;
Buggy code:
public class main { public static void main ( String [ ] args ) { String input = "" ; String output = "" ; <START_BUG> input = main . readFile ( "C:\\Users\\Felix\\Desktop\\Gradeadministration\\Gradeadministration\\datenUndSchema\\tx_gradeadministration_subject.sql" ) ; <END_BUG> output = main . prepareCSV ( input ) ; System . out . println ( output ) ; } private static String readFile ( String pfad ) { } private static String prepareCSV ( String input ) { } }

Fix:
input = main . readFile ( "C:\\Users\\Felix\\Desktop\\Gradeadministration\\Gradeadministration\\datenUndSchema\\tx_gradeadministration_grades.sql" ) ;
Buggy code:
public interface Filter { <START_BUG> FolderCommandReference [ ] filter ( MessageFolder folder , Object uid ) throws Exception ; <END_BUG> }

Fix:
FolderCommandReference filter ( MessageFolder folder , Object uid ) throws Exception ;
Buggy code:
public class PointcutDesignatorHandlerTests extends TestCase { public void testParseWithoutHandler ( ) { try { PointcutParser . getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution ( ) . parsePointcutExpression ( "bean(service.*" ) ; fail ( "should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>able<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>bean(service.*)" ) ; } catch ( IllegalArgumentException ex ) { <START_BUG> assertTrue ( "contains<seq2seq4repair_space>bean" , ex . getMessage ( ) . contains ( "bean" ) ) ; <END_BUG> } } public void testParseWithHandler ( ) { } public void testStaticMatch ( ) throws Exception { } public void testDynamicMatch ( ) throws Exception { } private class BeanDesignatorHandler implements PointcutDesignatorHandler { private String askedToParse ; public boolean simulateDynamicTest = false ; public String getDesignatorName ( ) { } public ContextBasedMatcher parse ( String expression ) { } public String getExpressionLastAskedToParse ( ) { } } private class BeanPointcutExpression implements ContextBasedMatcher { private final String beanNamePattern ; private final boolean simulateDynamicTest ; public BeanPointcutExpression ( String beanNamePattern , boolean simulateDynamicTest ) { } public boolean couldMatchJoinPointsInType ( Class aClass ) { } public boolean mayNeedDynamicTest ( ) { } public FuzzyBoolean matchesStatically ( MatchingContext matchContext ) { } public boolean matchesDynamically ( MatchingContext matchContext ) { } } }

Fix:
assertTrue ( "contains<seq2seq4repair_space>bean" , ( ( ex . getMessage ( ) . indexOf ( "bean" ) ) != ( - 1 ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class EJBWebServicesTestCase { @ Deployment public static JavaArchive deployment ( ) { } @ Test public void testSingleton ( ) throws Exception { <START_BUG> final String message = "<soapenv:Envelope<seq2seq4repair_space>xmlns:soapenv=\"http:////schemas.xmlsoap.org//soap//envelope//\"<seq2seq4repair_space>xmlns:test=\"http:////wsejb.integration.testsuite.as.jboss.org//\">" + ( ( ( ( ( ( "<seq2seq4repair_space><soapenv:Header//>" + "<seq2seq4repair_space><soapenv:Body>" ) + "<seq2seq4repair_space><test:setState>" ) + "<seq2seq4repair_space><arg0>Foo<//arg0>" ) + "<seq2seq4repair_space><//test:setState>" ) + "<seq2seq4repair_space><//soapenv:Body>" ) + "<//soapenv:Envelope>" ) ; <END_BUG> String result = HttpRequest . post ( "http:////localhost:8080//ejbws-example//SingletonEndpoint" , message , 10 , TimeUnit . SECONDS ) ; System . out . println ( result ) ; } @ Test public void testSingletonWSDL ( ) throws Exception { } }

Fix:
final String message = "<soapenv:Envelope<seq2seq4repair_space>xmlns:soapenv=\"http:////schemas.xmlsoap.org//soap//envelope//\"<seq2seq4repair_space>xmlns:test=\"http:////ejb.ws.integration.testsuite.as.jboss.org//\">" + ( ( ( ( ( ( "<seq2seq4repair_space><soapenv:Header//>" + "<seq2seq4repair_space><soapenv:Body>" ) + "<seq2seq4repair_space><test:setState>" ) + "<seq2seq4repair_space><arg0>Foo<//arg0>" ) + "<seq2seq4repair_space><//test:setState>" ) + "<seq2seq4repair_space><//soapenv:Body>" ) + "<//soapenv:Envelope>" ) ;
Buggy code:
public class FileAppender extends WriterAppender { protected boolean fileAppend = true ; protected String fileName = null ; protected boolean bufferedIO = false ; protected int bufferSize = 8 * 1024 ; public FileAppender ( ) { } public FileAppender ( Layout layout , String filename , boolean append , boolean bufferedIO , int bufferSize ) throws IOException { } public FileAppender ( Layout layout , String filename , boolean append ) throws IOException { } public FileAppender ( Layout layout , String filename ) throws IOException { } public void setFile ( String file ) { } public boolean getAppend ( ) { } public String getFile ( ) { } public void activateOptions ( ) { } protected void closeFile ( ) { } public boolean getBufferedIO ( ) { } public int getBufferSize ( ) { } public void setAppend ( boolean flag ) { } public void setBufferedIO ( boolean bufferedIO ) { } public void setBufferSize ( int bufferSize ) { } public synchronized void setFile ( String filename , boolean append , boolean bufferedIO , int bufferSize ) throws IOException { <START_BUG> getLogger ( ) . debug ( "setFile<seq2seq4repair_space>called:<seq2seq4repair_space>{},<seq2seq4repair_space>{}" , fileName , Boolean . toString ( append ) ) ; <END_BUG> if ( bufferedIO ) { setImmediateFlush ( false ) ; } closeWriter ( ) ; Writer fw = createWriter ( new FileOutputStream ( filename , append ) ) ; if ( bufferedIO ) { fw = new BufferedWriter ( fw , bufferSize ) ; } this . setQWForFiles ( fw ) ; this . fileAppend = append ; this . bufferedIO = bufferedIO ; this . fileName = filename ; this . bufferSize = bufferSize ; writeHeader ( ) ; getLogger ( ) . debug ( "setFile<seq2seq4repair_space>ended" ) ; } protected void setQWForFiles ( Writer writer ) { } }

Fix:
getLogger ( ) . debug ( "setFile<seq2seq4repair_space>called:<seq2seq4repair_space>{},<seq2seq4repair_space>{}" , fileName , ( append ? "true" : "false" ) ) ;
Buggy code:
public class ArchiveCommand extends TaskRestorableCommand { public ArchiveCommand ( TasmaUserInterface userInterface , TaskCollection collection , List < Task > state , int number ) { } @ Override public void execute ( ) throws Exception { task . setArchived ( true ) ; collection . update ( task ) ; <START_BUG> userInterface . displayMessage ( String . format ( COMMAND_ARCHIVE_SUCCESS ) ) ; <END_BUG> ListCommand listCommand = new ListCommand ( userInterface , collection , state ) ; listCommand . execute ( ) ; } }

Fix:
userInterface . displayMessage ( String . format ( COMMAND_ARCHIVE_SUCCESS , task . getDetails ( ) ) ) ;
Buggy code:
public abstract class AbstractRemoveStepHandler implements OperationStepHandler { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode model = Tools . readModel ( context . readResource ( EMPTY_ADDRESS ) ) ; performRemove ( context , operation , model ) ; if ( requiresRuntime ( context ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { performRuntime ( context , operation , model ) ; context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { try { recoverServices ( context , operation , model ) ; } catch ( Exception e ) { ControllerLogger . MGMT_OP_LOGGER . errorRevertingOperation ( e , getClass ( ) . getSimpleName ( ) , operation . require ( OP ) . asString ( ) , PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ) ; } } } ) ; } } , RUNTIME ) ; } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } protected void performRemove ( OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected boolean requireNoChildResources ( ) { } protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected void recoverServices ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { } private List < PathElement > getChildren ( Resource resource ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class MainTestFragment extends Fragment { private LatLng startingPoint = new LatLng ( 51.0F , 0.0F ) ; private MapView mv ; private String satellite = "brunosan.map-cyglrrfu" ; private String street = "examples.map-i87786ca" ; private String terrain = "examples.map-zgrqqx0w" ; private String currentLayer = "" ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } final String [ ] availableLayers = new String [ ] { "OpenStreetMap" , "OpenSeaMap" , "mapquest" , "open-streets-dc.mbtiles" , "test.MBTiles" } ; protected void replaceMapView ( String layer ) { ITileLayer source ; BoundingBox box ; if ( layer . equalsIgnoreCase ( "OpenStreetMap" ) ) { source = new WebSourceTileLayer ( "openstreetmap" , "http:////tile.openstreetmap.org//{z}//{x}//{y}.png" ) . setName ( "OpenStreetMap" ) . setAttribution ( "©<seq2seq4repair_space>OpenStreetMap<seq2seq4repair_space>Contributors" ) . setMinimumZoomLevel ( 1 ) . setMaximumZoomLevel ( 18 ) ; } else if ( layer . equalsIgnoreCase ( "OpenSeaMap" ) ) { source = new WebSourceTileLayer ( "openstreetmap" , "http:////tile.openstreetmap.org//seamark//{z}//{x}//{y}.png" ) . setName ( "OpenStreetMap" ) . setAttribution ( "©<seq2seq4repair_space>OpenStreetMap<seq2seq4repair_space>Contributors" ) . setMinimumZoomLevel ( 1 ) . setMaximumZoomLevel ( 18 ) ; } else if ( layer . equalsIgnoreCase ( "mapquest" ) ) { source = new WebSourceTileLayer ( "mapquest" , "http:////otile1.mqcdn.com//tiles//1.0.0//osm//{z}//{x}//{y}.png" ) . setName ( "MapQuest<seq2seq4repair_space>Open<seq2seq4repair_space>Aerial" ) . setAttribution ( "Tiles<seq2seq4repair_space>courtesy<seq2seq4repair_space>of<seq2seq4repair_space>MapQuest<seq2seq4repair_space>and<seq2seq4repair_space>OpenStreetMap<seq2seq4repair_space>contributors." ) . setMinimumZoomLevel ( 1 ) . setMaximumZoomLevel ( 18 ) ; } else { <START_BUG> source = new MapboxTileLayer ( layer ) ; <END_BUG> } mv . setTileSource ( source ) ; box = source . getBoundingBox ( ) ; mv . setScrollableAreaLimit ( box ) ; mv . setMinZoomLevel ( mv . getTileProvider ( ) . getMinimumZoomLevel ( ) ) ; mv . setMaxZoomLevel ( mv . getTileProvider ( ) . getMaximumZoomLevel ( ) ) ; mv . setCenter ( mv . getTileProvider ( ) . getCenterCoordinate ( ) ) ; mv . setZoom ( 0 ) ; Log . d ( "MainActivity" , ( "zoomToBoundingBox<seq2seq4repair_space>" + ( box . toString ( ) ) ) ) ; } private void addLine ( ) { } private Button changeButtonTypeface ( Button button ) { } public LatLng getMapCenter ( ) { } public void setMapCenter ( ILatLng center ) { } public void showSettingsAlert ( ) { } }

Fix:
source = new com . mapbox . mapboxsdk . tileprovider . tilesource . MapboxTileLayer ( getActivity ( ) , layer ) ;
Buggy code:
public class SegmentTypeBox extends Box { private String majorBrand ; private int minorVersion ; private Collection < String > compBrands = new LinkedList < String > ( ) ; public static String fourcc ( ) { } public SegmentTypeBox ( String majorBrand , int minorVersion , Collection < String > compBrands ) { } public SegmentTypeBox ( ) { } public void parse ( ByteBuffer input ) { majorBrand = NIOUtils . readString ( input , 4 ) ; minorVersion = input . getInt ( ) ; String brand ; <START_BUG> while ( ( brand = NIOUtils . readString ( input , 4 ) ) != null ) { <END_BUG> compBrands . add ( brand ) ; } } public String getMajorBrand ( ) { } public Collection < String > getCompBrands ( ) { } public void doWrite ( ByteBuffer out ) { } No newline ; at end ; of file ; }

Fix:
while ( ( input . hasRemaining ( ) ) && ( ( brand = NIOUtils . readString ( input , 4 ) ) != null ) ) {
Buggy code:
public final class PluginContextRegistry extends AbstractContextRegistry { private final class PluginRegistryReader extends RegistryReader { protected boolean readElement ( IConfigurationElement element ) { } } private static final String TAG_ROOT = Persistence . PACKAGE_BASE ; private List contextDefinitions ; private IPluginRegistry pluginRegistry ; private PluginContextRegistry . PluginRegistryReader pluginRegistryReader ; public PluginContextRegistry ( IPluginRegistry pluginRegistry ) { } public void load ( ) throws IOException { if ( ( contextDefinitions ) == null ) contextDefinitions = new ArrayList ( ) ; else contextDefinitions . clear ( ) ; if ( ( pluginRegistryReader ) == null ) pluginRegistryReader = new PluginContextRegistry . PluginRegistryReader ( ) ; pluginRegistryReader . readRegistry ( pluginRegistry , PLUGIN_ID , PluginContextRegistry . TAG_ROOT ) ; boolean contextRegistryChanged = false ; <START_BUG> if ( ! ( contextDefinitions . equals ( this . contextDefinitions ) ) ) { <END_BUG> super . contextDefinitions = Collections . unmodifiableList ( contextDefinitions ) ; contextRegistryChanged = true ; } if ( contextRegistryChanged ) fireContextRegistryChanged ( ) ; } private String getPluginId ( IConfigurationElement element ) { } private boolean readContextDefinition ( IConfigurationElement element ) { } }

Fix:
if ( ! ( contextDefinitions . equals ( super . contextDefinitions ) ) ) {
Buggy code:
public class JDICHTMLViewerPlugin extends JPanel implements IHTMLViewerPlugin { private static final Logger LOG = Logger . getLogger ( "org.columba.core.gui.htmlviewer" ) ; private WebBrowser browser ; public JDICHTMLViewerPlugin ( ) { } public void view ( String htmlSource ) { } public JComponent getComponent ( ) { } public String getSelectedText ( ) { } public boolean initialized ( ) { <START_BUG> return true ; <END_BUG> } public JComponent getContainer ( ) { } }

Fix:
return browser . isInitialized ( ) ;