nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class MetaDataKey implements Serializable { private static final long serialVersionUID = 1L ; private Class type ; public MetaDataKey ( final Class type ) { } public boolean equals ( Object obj ) { } Serializable get ( MetaDataEntry [ ] metaData ) { } MetaDataEntry [ ] set ( MetaDataEntry [ ] metaData , final Serializable object ) { } void checkType ( final Object object ) { <START_BUG> if ( ( object != null ) && ( type . isAssignableFrom ( object . getClass ( ) ) ) ) { <END_BUG> throw new IllegalArgumentException ( ( ( ( ( ( "MetaDataKey<seq2seq4repair_space>" + ( getClass ( ) ) ) + "<seq2seq4repair_space>requires<seq2seq4repair_space>argument<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( type ) ) + ",<seq2seq4repair_space>not<seq2seq4repair_space>" ) + ( object . getClass ( ) ) ) ) ; } } }

Fix:
if ( ( object != null ) && ( ! ( type . isAssignableFrom ( object . getClass ( ) ) ) ) ) {
Buggy code:
public class StatusBar extends JPanel implements Runnable { protected JLabel _msg = new JLabel ( ) ; protected JProgressBar _progress = new JProgressBar ( ) ; protected String _statusText ; public StatusBar ( ) { } public void showStatus ( String s ) { } public void showProgress ( int percent ) { } public synchronized void doFakeProgress ( String s , int work ) { _statusText = s ; <START_BUG> showStatus ( ( ( _statusText ) + "..." ) ) ; <END_BUG> _progress . setMaximum ( work ) ; _progress . setValue ( 0 ) ; Thread t = new Thread ( this ) ; t . start ( ) ; } public synchronized void run ( ) { } }

Fix:
showStatus ( ( ( _statusText ) + "...<seq2seq4repair_space>not<seq2seq4repair_space>implemented<seq2seq4repair_space>yet<seq2seq4repair_space>..." ) ) ;
Buggy code:
public class SetupActivity extends AppIntro2 { @ Override public void init ( Bundle bundle ) { } @ Override public void onDonePressed ( ) { } @ Override public void onNextPressed ( ) { } @ Override public void onSlideChanged ( ) { <START_BUG> setSwipeLock ( ( ( pager . getCurrentItem ( ) ) == 2 ) ) ; <END_BUG> } }

Fix:
setSwipeLock ( ( ( pager . getCurrentItem ( ) ) == 1 ) ) ;
Buggy code:
public class Rpm extends Task { private static final String PATH1 = "PATH=" ; private static final String PATH2 = "Path=" ; private static final String PATH3 = "path=" ; private static final int PATH_LEN = Rpm . PATH1 . length ( ) ; private String specFile ; private File topDir ; private String command = "-bb" ; private String rpmBuildCommand = null ; private boolean cleanBuildDir = false ; private boolean removeSpec = false ; private boolean removeSource = false ; private File output ; private File error ; private boolean failOnError = false ; private boolean quiet = false ; public void execute ( ) throws BuildException { } public void setTopDir ( File td ) { } public void setCommand ( String c ) { } public void setSpecFile ( String sf ) { <START_BUG> if ( ( sf == null ) || ( sf . trim ( ) . equals ( "" ) ) ) { <END_BUG> throw new BuildException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>specify<seq2seq4repair_space>a<seq2seq4repair_space>spec<seq2seq4repair_space>file" , getLocation ( ) ) ; } this . specFile = sf ; } public void setCleanBuildDir ( boolean cbd ) { } public void setRemoveSpec ( boolean rs ) { } public void setRemoveSource ( boolean rs ) { } public void setOutput ( File output ) { } public void setError ( File error ) { } public void setRpmBuildCommand ( String c ) { } public void setFailOnError ( boolean value ) { } public void setQuiet ( boolean value ) { } protected String guessRpmBuildCommand ( ) { } protected Execute getExecute ( Commandline toExecute , ExecuteStreamHandler streamhandler ) { } }

Fix:
if ( ( sf == null ) || ( ( sf . trim ( ) . length ( ) ) == 0 ) ) {
Buggy code:
public class AttachmentPathRule extends BaseRule { public AttachmentPathRule ( Digester digester , String state ) { } public void body ( String text ) throws Exception { } protected void doInsertionAtBody ( String text ) throws Exception { Attachment attachment = ( ( Attachment ) ( digester . pop ( ) ) ) ; <START_BUG> attachment . setFilePath ( text ) ; <END_BUG> digester . push ( attachment ) ; } protected void doValidationAtBody ( String text ) { } }

Fix:
attachment . setFileName ( text ) ;
Buggy code:
public class LogicalOperatorsTest extends TestCase { public void test_0 ( ) throws Exception { } public void test_1 ( ) throws Exception { } public void test_2 ( ) throws Exception { } public void test_3 ( ) throws Exception { } public void test_4 ( ) throws Exception { } public void test_5 ( ) throws Exception { } public void test_6 ( ) throws Exception { } public void test_7 ( ) throws Exception { String sql = "SELECT<seq2seq4repair_space>!<seq2seq4repair_space>1+1;" ; SQLStatementParser parser = new MySqlStatementParser ( sql ) ; List < SQLStatement > stmtList = parser . parseStatementList ( ) ; String text = output ( stmtList ) ; <START_BUG> Assert . assertEquals ( "SELECT<seq2seq4repair_space>!(1<seq2seq4repair_space>+<seq2seq4repair_space>1);" , text ) ; <END_BUG> } public void test_8 ( ) throws Exception { } public void test_9 ( ) throws Exception { } public void test_10 ( ) throws Exception { } public void test_11 ( ) throws Exception { } public void test_12 ( ) throws Exception { } public void test_13 ( ) throws Exception { } private String output ( List < SQLStatement > stmtList ) { } }

Fix:
Assert . assertEquals ( "SELECT<seq2seq4repair_space>!1<seq2seq4repair_space>+<seq2seq4repair_space>1;" , text ) ;
Buggy code:
} if ( data . isEmpty ( ) ) { <START_BUG> return new Leaf ( ( - 1 ) ) ; <END_BUG>

Fix:
return new Leaf ( Double . NaN ) ;
Buggy code:
public class CustomGame extends Game implements GameEventHandler { int x = 0 ; int y = 0 ; int stage = 1 ; int texture = - 1 ; public CustomGame ( String [ ] args ) { } @ Override public void onCharInput ( char c ) { } @ Override public void onCursorMove ( double x , double y ) { } @ Override public void onGameOpen ( ) { } @ Override public void onGameClose ( ) { } @ Override public void onTick ( ) { } @ Override public void onWindowResize ( int w , int h ) { } @ Override public void onWindowOpen ( ) { <START_BUG> setBackgroundImage ( new File ( "assets//textures//background.jpg" ) ) ; <END_BUG> } @ Override public void render ( ) { } private void setupInputFunctions ( ) { } public static void main ( String [ ] args ) { } }

Fix:
setBackgroundImage ( new File ( "assets//textures//background.png" ) ) ;
Buggy code:
public class ProgressMonitor { private static final Logger LOG = LoggerFactory . getLogger ( ProgressMonitor . class ) ; private static final String PERIOD = "." ; private SecorConfig mConfig ; private ZookeeperConnector mZookeeperConnector ; private KafkaClient mKafkaClient ; private MessageParser mMessageParser ; public ProgressMonitor ( SecorConfig config ) throws Exception { } private void makeRequest ( String body ) throws IOException { } private void exportToTsdb ( ProgressMonitor . Stat stat ) throws IOException { } public void exportStats ( ) throws Exception { } private void exportToStatsD ( List < ProgressMonitor . Stat > stats ) { HostAndPort hostPort = HostAndPort . fromString ( mConfig . getStatsDHostPort ( ) ) ; NonBlockingStatsDClient client = new NonBlockingStatsDClient ( mConfig . getKafkaGroup ( ) , hostPort . getHostText ( ) , hostPort . getPort ( ) ) ; for ( ProgressMonitor . Stat stat : stats ) { @ SuppressWarnings ( "unchecked" ) Map < String , String > tags = ( ( Map < String , String > ) ( stat . get ( ProgressMonitor . Stat . STAT_KEYS . TAGS . getName ( ) ) ) ) ; String aspect = new StringBuilder ( ( ( String ) ( stat . get ( ProgressMonitor . Stat . STAT_KEYS . METRIC . getName ( ) ) ) ) ) . append ( ProgressMonitor . PERIOD ) . append ( tags . get ( ProgressMonitor . Stat . STAT_KEYS . TOPIC . getName ( ) ) ) . append ( ProgressMonitor . PERIOD ) . append ( tags . get ( ProgressMonitor . Stat . STAT_KEYS . PARTITION . getName ( ) ) ) . toString ( ) ; <START_BUG> client . recordGaugeValue ( aspect , ( ( Long ) ( stat . get ( ProgressMonitor . Stat . STAT_KEYS . VALUE . getName ( ) ) ) ) ) ; <END_BUG> } } private List < ProgressMonitor . Stat > getStats ( ) throws Exception { } private long getTimestamp ( Message message ) throws Exception { } private static class Stat extends JSONObject { public enum STAT_KEYS { METRIC ( "metric" ) , TAGS ( "tags" ) , VALUE ( "value" ) , TIMESTAMP ( "timestamp" ) , TOPIC ( "topic" ) , PARTITION ( "partition" ) ; STAT_KEYS ( String name ) { } private final String mName ; public String getName ( ) { } } public static ProgressMonitor . Stat createInstance ( String metric , Map < String , String > tags , String value , long timestamp ) { } public Stat ( Map < String , Object > map ) { } } }

Fix:
client . recordGaugeValue ( aspect , Long . parseLong ( ( ( String ) ( stat . get ( ProgressMonitor . Stat . STAT_KEYS . VALUE . getName ( ) ) ) ) ) ) ;
Buggy code:
public class Player { protected static int numHuman = 0 ; protected static int numCPUs = 0 ; protected static int numPlayers = 0 ; private static ArrayList < String > suits ; protected boolean human ; protected ArrayList < Card > hand ; protected ArrayList < Card > facedown ; protected ArrayList < Card > faceup ; protected String name ; protected ConsoleIO cio = new ConsoleIO ( "That's<seq2seq4repair_space>not<seq2seq4repair_space>right" , 0 , 100 , 0 ) ; public Player ( ) { } public Player ( boolean isHuman , String n , Deck d ) { } public int move ( Pile currP , Deck d ) { } public int firstMove ( Pile currP , Deck d ) { } public boolean canMove ( Pile p ) { if ( ( p . isEmpty ( ) ) || ( ( ( hand . get ( 0 ) ) == null ) && ( ( faceup . get ( 0 ) ) == null ) ) ) { return true ; } else { System . out . println ( ( "Hand:<seq2seq4repair_space>" + ( hand . isEmpty ( ) ) ) ) ; <START_BUG> if ( ! ( hand . isEmpty ( ) ) ) { <END_BUG> for ( Card c : hand ) { if ( p . validMove ( c ) ) { return true ; } cio . typeln ( ( ( c . value ) + "<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ) ; } } else { for ( Card c : faceup ) { if ( p . validMove ( c ) ) { return true ; } } } } return false ; } public void sort ( ArrayList < Card > cards ) { } public String toString ( ) { } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
if ( ! ( ( hand . get ( 0 ) ) == null ) ) {
Buggy code:
public class InitClosureExpressionTest { @ Test public void testParameterBinding ( ) { } @ Test public void testLocalVariableBinding ( ) { } @ Test public void testFdcPropagation ( ) { final BackendTypesystem ts = new CompositeTypesystem ( ) ; final FunctionDefContextInternal fdc = new org . eclipse . xtend . backend . functions . FunctionDefContextFactory ( ts ) . create ( ) ; fdc . register ( new NamedFunction ( "myFunction" , new Function ( ) { public ExpressionBase getGuard ( ) { return null ; } public List < ? extends BackendType > getParameterTypes ( ) { return new ArrayList < BackendType > ( ) ; } public Object invoke ( ExecutionContext ctx , Object [ ] params ) { return "myResult" ; } public boolean isCached ( ) { return false ; } } ) ) ; <START_BUG> final ExecutionContext initCtx = BackendFacade . createExecutionContext ( fdc , ts ) ; <END_BUG> final ExpressionBase body = new InvocationOnObjectExpression ( "myFunction" , new ArrayList < ExpressionBase > ( ) , false , SOURCE_POS ) ; final Function closure = ( ( Function ) ( new InitClosureExpression ( new ArrayList < String > ( ) , new ArrayList < BackendType > ( ) , body , SOURCE_POS ) . evaluate ( initCtx ) ) ) ; assertEquals ( "myResult" , closure . invoke ( createEmptyExecutionContext ( ) , new Object [ ] { } ) ) ; } }

Fix:
final ExecutionContext initCtx = BackendFacade . createExecutionContext ( fdc , ts , true ) ;
Buggy code:
public class ServiceReferenceTest extends AbstractRemoteServiceTestCase { protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected Object createService ( ) { } public void testGetServiceReference ( ) throws Exception { final IRemoteServiceContainerAdapter [ ] adapters = getRemoteServiceAdapters ( ) ; final Dictionary props = new Hashtable ( ) ; props . put ( SERVICE_REGISTRATION_TARGETS , getClients ( ) [ 1 ] . getConnectedID ( ) ) ; props . put ( LOCAL_SERVICE_REGISTRATION , "true" ) ; adapters [ 0 ] . registerRemoteService ( new String [ ] { IConcatService . class . getName ( ) } , createService ( ) , props ) ; sleep ( 1500 ) ; final BundleContext bc = Activator . getDefault ( ) . getContext ( ) ; assertNotNull ( bc ) ; final ServiceReference ref = bc . getServiceReference ( IConcatService . class . getName ( ) ) ; assertNotNull ( ref ) ; final IConcatService concatService = ( ( IConcatService ) ( bc . getService ( ref ) ) ) ; assertNotNull ( concatService ) ; System . out . println ( "proxy<seq2seq4repair_space>call<seq2seq4repair_space>start" ) ; final String result = concatService . concat ( "OSGi<seq2seq4repair_space>" , "is<seq2seq4repair_space>cool" ) ; <START_BUG> System . out . println ( ( "CLIENT.proxy<seq2seq4repair_space>end.<seq2seq4repair_space>result=" + result ) ) ; <END_BUG> sleep ( 1500 ) ; } }

Fix:
System . out . println ( ( "proxy<seq2seq4repair_space>call<seq2seq4repair_space>end.<seq2seq4repair_space>result=" + result ) ) ;
Buggy code:
public abstract class Graph { public abstract boolean adjacent ( Node < ? > from , Node < ? > to ) { } public abstract Vector < Node < ? > > neighbors ( Node < ? > n ) { } <START_BUG> public abstract boolean addEdge ( Node < ? > from , Node < ? > to ) ; <END_BUG> public abstract void removeEdge ( Node < ? > from , Node < ? > to ) { } public abstract Graph dfs ( Graph g , Node < ? > head ) { } public abstract Graph bfs ( Graph g , Node < ? > head ) { } public abstract Vector < Node < ? > > getNodes ( ) { } }

Fix:
public abstract void addEdge ( Node < ? > from , Node < ? > to ) ;
Buggy code:
public class ForbiddenApisPlugin implements Plugin < Project > { public static final String PLUGIN_INIT_SCRIPT = "plugin-init.groovy" ; public static final String FORBIDDEN_APIS_TASK_NAME = "forbiddenApis" ; public static final String FORBIDDEN_APIS_EXTENSION_NAME = "forbiddenApis" ; public void apply ( final Project project ) { final String scriptText ; try { final URL scriptUrl = ForbiddenApisPlugin . class . getResource ( ForbiddenApisPlugin . PLUGIN_INIT_SCRIPT ) ; if ( scriptUrl == null ) { throw new PluginInstantiationException ( ( ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>resource<seq2seq4repair_space>with<seq2seq4repair_space>" + ( ForbiddenApisPlugin . PLUGIN_INIT_SCRIPT ) ) + "<seq2seq4repair_space>script." ) ) ; } scriptText = ResourceGroovyMethods . getText ( scriptUrl , "UTF-8" ) ; } catch ( IOException ioe ) { <START_BUG> throw new PluginInstantiationException ( ( ( "Cannot<seq2seq4repair_space>execute<seq2seq4repair_space>" + ( ForbiddenApisPlugin . PLUGIN_INIT_SCRIPT ) ) + "<seq2seq4repair_space>script." ) , ioe ) ; <END_BUG> } final ImportCustomizer importCustomizer = new ImportCustomizer ( ) . addStarImports ( ForbiddenApisPlugin . class . getPackage ( ) . getName ( ) ) ; final CompilerConfiguration configuration = new CompilerConfiguration ( ) . addCompilationCustomizers ( importCustomizer ) ; configuration . setScriptBaseClass ( DelegatingScript . class . getName ( ) ) ; final GroovyShell shell = new GroovyShell ( ForbiddenApisPlugin . class . getClassLoader ( ) , new groovy . lang . Binding ( Collections . singletonMap ( "project" , project ) ) , configuration ) ; final DelegatingScript script = ( ( DelegatingScript ) ( shell . parse ( scriptText , ForbiddenApisPlugin . PLUGIN_INIT_SCRIPT ) ) ) ; script . setDelegate ( this ) ; script . run ( ) ; } }

Fix:
throw new PluginInstantiationException ( ( ( "Cannot<seq2seq4repair_space>load<seq2seq4repair_space>" + ( ForbiddenApisPlugin . PLUGIN_INIT_SCRIPT ) ) + "<seq2seq4repair_space>script." ) , ioe ) ;
Buggy code:
public class FormatterCommentParser extends JavadocParser implements IJavaDocTagConstants { char [ ] [ ] htmlTags ; int htmlTagsPtr = - 1 ; private boolean invalidTagName ; public FormatterCommentParser ( long sourceLevel ) { } public boolean parse ( int start , int end ) { } protected Object createArgumentReference ( char [ ] name , int dim , boolean isVarargs , Object ref , long [ ] dimPositions , long argNamePos ) throws InvalidInputException { } protected Object createFieldReference ( Object receiver ) throws InvalidInputException { } protected Object createMethodReference ( Object receiver , List arguments ) throws InvalidInputException { } protected void createTag ( ) { } protected Object createTypeReference ( int primitiveToken ) { } private int getHtmlTagIndex ( char [ ] htmlTag ) { } protected char [ ] getTagName ( int previousPosition , int currentPosition ) { this . invalidTagName = false ; if ( currentPosition != ( this . scanner . startPosition ) ) { this . invalidTagName = true ; return null ; } if ( ( this . index ) >= ( this . scanner . eofPosition ) ) { this . invalidTagName = true ; return null ; } <START_BUG> this . tagSourceStart = this . scanner . getCurrentTokenStartPosition ( ) ; <END_BUG> this . tagSourceEnd = this . scanner . getCurrentTokenEndPosition ( ) ; char [ ] tagName = this . scanner . getCurrentIdentifierSource ( ) ; return tagName ; } protected boolean parseHtmlTag ( int previousPosition , int endTextPosition ) throws InvalidInputException { } protected boolean parseParam ( ) throws InvalidInputException { } protected boolean parseReference ( ) throws InvalidInputException { } protected boolean parseReturn ( ) { } protected boolean parseTag ( int previousPosition ) throws InvalidInputException { } protected boolean parseThrows ( ) { } protected boolean pushParamName ( boolean isTypeParam ) { } protected boolean pushSeeRef ( Object statement ) { } protected void pushText ( int start , int end ) { } private void pushText ( int start , int end , int htmlIndex , int htmlDepth ) { } protected boolean pushThrowName ( Object typeRef ) { } protected void refreshInlineTagPosition ( int previousPosition ) { } public String toString ( ) { } public String toDebugString ( ) { } protected void updateDocComment ( ) { } protected boolean verifyEndLine ( int textPosition ) { } protected boolean verifySpaceOrEndComment ( ) { } }

Fix:
this . tagSourceStart = previousPosition ;
Buggy code:
public class JsonPathAssertionTests { private MockMvc mockMvc ; @ Before public void setup ( ) { <START_BUG> this . mockMvc = standaloneSetup ( new JsonPathAssertionTests . MusicController ( ) ) . defaultRequest ( get ( "//" ) . accept ( APPLICATION_JSON ) ) . alwaysExpect ( status ( ) . isOk ( ) ) . alwaysExpect ( content ( ) . mimeType ( "application//json;charset=UTF-8" ) ) . build ( ) ; <END_BUG> } @ Test public void testExists ( ) throws Exception { } @ Test public void testDoesNotExist ( ) throws Exception { } @ Test public void testEqualTo ( ) throws Exception { } @ Test public void testHamcrestMatcher ( ) throws Exception { } @ Test public void testHamcrestMatcherWithParameterizedJsonPath ( ) throws Exception { } @ Controller private class MusicController { @ RequestMapping ( "//music//people" ) @ ResponseBody public MultiValueMap < String , Person > get ( ) { } } }

Fix:
this . mockMvc = standaloneSetup ( new JsonPathAssertionTests . MusicController ( ) ) . defaultRequest ( get ( "//" ) . accept ( APPLICATION_JSON ) ) . alwaysExpect ( status ( ) . isOk ( ) ) . alwaysExpect ( content ( ) . contentType ( "application//json;charset=UTF-8" ) ) . build ( ) ;
Buggy code:
public class RemoveColumnFamilyWithFlush1Test extends CleanupHelper { @ Test public void testRemoveColumnFamilyWithFlush1 ( ) throws IOException , InterruptedException , ExecutionException { Table table = Table . open ( "Keyspace1" ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( "Standard1" ) ; RowMutation rm ; DecoratedKey dk = Util . dk ( "key1" ) ; rm = new RowMutation ( "Keyspace1" , dk . key ) ; rm . add ( new QueryPath ( "Standard1" , null , "Column1" . getBytes ( ) ) , "asdf" . getBytes ( ) , new TimestampClock ( 0 ) ) ; rm . add ( new QueryPath ( "Standard1" , null , "Column2" . getBytes ( ) ) , "asdf" . getBytes ( ) , new TimestampClock ( 0 ) ) ; rm . apply ( ) ; store . forceBlockingFlush ( ) ; rm = new RowMutation ( "Keyspace1" , dk . key ) ; rm . delete ( new QueryPath ( "Standard1" ) , new TimestampClock ( 1 ) ) ; rm . apply ( ) ; ColumnFamily retrieved = store . getColumnFamily ( QueryFilter . getIdentityFilter ( dk , new QueryPath ( "Standard1" ) ) ) ; assert retrieved . isMarkedForDelete ( ) ; Assert . assertNull ( retrieved . getColumn ( "Column1" . getBytes ( ) ) ) ; <START_BUG> Assert . assertNull ( ColumnFamilyStore . removeDeleted ( retrieved , Integer . MAX_VALUE ) ) ; <END_BUG> } }

Fix:
Assert . assertNull ( Util . cloneAndRemoveDeleted ( retrieved , Integer . MAX_VALUE ) ) ;
Buggy code:
public class UnCommonNamesAdapter { public static final String DATABASE_TABLE_2 = "un_common_names" ; public static final String UN_COMMON_NAME_ROWID = "_id" ; public static final String UN_COMMON_NAME = "un_common_name" ; public static final String UN_COMMON_NAME_MEANING = "un_common_name_meaning" ; private SQLiteDatabase database ; public static final String TAG = "UN_COMMON_NAMES_TABLE" ; private BabyNamesDBHelper baby_names_db_helper ; public UnCommonNamesAdapter ( Context context ) { } public UnCommonNamesAdapter open ( Context context ) throws SQLException { } public void close ( ) { } public long createUnCommonName ( String uncommonName , String unCommonNameMeaning ) { } public boolean deleteUnCommonName ( long rowId ) { } public Cursor fetchAllUnCommonNames ( ) { <START_BUG> return database . query ( UnCommonNamesAdapter . DATABASE_TABLE_2 , new String [ ] { UnCommonNamesAdapter . UN_COMMON_NAME_ROWID , UnCommonNamesAdapter . UN_COMMON_NAME , UnCommonNamesAdapter . UN_COMMON_NAME_MEANING } , null , null , null , null , null ) ; <END_BUG> } public Cursor fetchUnCommonName ( long uncommonNameId ) throws SQLException { } public boolean updateUnCommonName ( int uncommonNameId , String uncommonName , String unCommonNameMeaning ) { } }

Fix:
return database . query ( UnCommonNamesAdapter . DATABASE_TABLE_2 , new String [ ] { UnCommonNamesAdapter . UN_COMMON_NAME_ROWID , UnCommonNamesAdapter . UN_COMMON_NAME , UnCommonNamesAdapter . UN_COMMON_NAME_MEANING } , null , null , null , null , UnCommonNamesAdapter . UN_COMMON_NAME ) ;
Buggy code:
public class MarkupComponentBorder implements IComponentBorder { private static final long serialVersionUID = 1L ; public void renderAfter ( Component < ? > component ) { } public void renderBefore ( Component < ? > component ) { } @ SuppressWarnings ( "unchecked" ) private MarkupFragment findMarkup ( final String extension ) { final IResourceStreamFactory locator = Application . get ( ) . getResourceSettings ( ) . getResourceStreamFactory ( ) ; final Session session = Session . get ( ) ; final String style = session . getStyle ( ) ; final Locale locale = session . getLocale ( ) ; MarkupResourceStream markupResourceStream = null ; Class containerClass = getClass ( ) ; while ( containerClass != ( MarkupComponentBorder . class ) ) { String path = containerClass . getName ( ) . replace ( '.' , '//' ) ; <START_BUG> IResourceStream resourceStream = locator . locate ( containerClass , path , style , locale , extension ) ; <END_BUG> if ( resourceStream != null ) { ContainerInfo ci = new ContainerInfo ( containerClass , locale , style , null , extension , null ) ; markupResourceStream = new MarkupResourceStream ( resourceStream , ci , containerClass ) ; } containerClass = containerClass . getSuperclass ( ) ; } MarkupFragment markup ; try { markup = Application . get ( ) . getMarkupSettings ( ) . getMarkupParserFactory ( ) . newMarkupParser ( markupResourceStream ) . readAndParse ( ) ; } catch ( Exception e ) { throw new WicketRuntimeException ( e ) ; } return markup ; } }

Fix:
IResourceStream resourceStream = locator . newResourceStream ( containerClass , path , style , locale , extension ) ;
Buggy code:
public class RuntimeConfigurable2 extends RuntimeConfigurable { private String elementTag = null ; private Vector children = new Vector ( ) ; private Object wrappedObject = null ; private Attributes attributes ; private StringBuffer characters = new StringBuffer ( ) ; private boolean proxyConfigured = false ; Project project ; protected Location location = Location . UNKNOWN_LOCATION ; public RuntimeConfigurable2 ( Project project , Location location , Object proxy , String elementTag ) { } Project getProject ( ) { } Location getLocation ( ) { } public void setProxy ( Object proxy ) { } public Object getProxy ( ) { } public void setAttributes ( AttributeList attributes ) { } public void setAttributes2 ( Attributes attributes ) { } public AttributeList getAttributes ( ) { } public Attributes getAttributes2 ( ) { } public static AttributeList sax1Attributes ( Attributes sax2Att ) { } public void addChild ( RuntimeConfigurable child ) { } public RuntimeConfigurable getChild ( int index ) { } public void addText ( String data ) { } public void addText ( char [ ] buf , int start , int count ) { } public String getElementTag ( ) { } public void maybeConfigure ( Project p ) throws BuildException { } public void maybeConfigure ( Project p , boolean configureChildren ) throws BuildException { String id = null ; if ( proxyConfigured ) { return ; } <START_BUG> PropertyHelper ph = PropertyHelper . getPropertyHelper ( p ) ; <END_BUG> if ( ( attributes ) != null ) { ph . configure ( wrappedObject , attributes , p ) ; id = attributes . getValue ( "id" ) ; } if ( ( characters . length ( ) ) != 0 ) { ProjectHelper . addText ( p , wrappedObject , characters . toString ( ) ) ; } Enumeration = children . elements ( ) ; } }

Fix:
PropertyHelper2 ph = PropertyHelper2 . getPropertyHelper ( p ) ;
Buggy code:
public class Assignment extends Expression { public Expression lhs ; public Expression expression ; public Assignment ( Expression lhs , Expression expression , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { LocalVariableBinding local = this . lhs . localVariableBinding ( ) ; int nullStatus = this . expression . nullStatus ( flowInfo ) ; if ( ( local != null ) && ( ( ( local . type . tagBits ) & ( TagBits . IsBaseType ) ) == 0 ) ) { if ( nullStatus == ( FlowInfo . NULL ) ) { <START_BUG> flowContext . recordUsingNullReference ( currentScope , local , this . lhs , FlowContext . CAN_ONLY_NULL , flowInfo ) ; <END_BUG> } } flowInfo = ( ( Reference ) ( lhs ) ) . analyseAssignment ( currentScope , flowContext , flowInfo , this , false ) . unconditionalInits ( ) ; if ( ( local != null ) && ( ( ( local . type . tagBits ) & ( TagBits . IsBaseType ) ) == 0 ) ) { switch ( nullStatus ) { case FlowInfo . NULL : flowInfo . markAsDefinitelyNull ( local ) ; break ; case FlowInfo . NON_NULL : flowInfo . markAsDefinitelyNonNull ( local ) ; break ; default : flowInfo . markAsDefinitelyUnknown ( local ) ; } if ( ( flowContext . initsOnFinally ) != null ) { switch ( nullStatus ) { case FlowInfo . NULL : flowContext . initsOnFinally . markAsDefinitelyNull ( local ) ; break ; case FlowInfo . NON_NULL : flowContext . initsOnFinally . markAsDefinitelyNonNull ( local ) ; break ; default : flowContext . initsOnFinally . markAsDefinitelyUnknown ( local ) ; } } } return flowInfo ; } void checkAssignment ( BlockScope scope , TypeBinding lhsType , TypeBinding rhsType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public static Binding getDirectBinding ( Expression someExpression ) { } FieldBinding getLastField ( Expression someExpression ) { } public int nullStatus ( FlowInfo flowInfo ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public LocalVariableBinding localVariableBinding ( ) { } }

Fix:
flowContext . recordUsingNullReference ( currentScope , local , this . lhs , ( ( FlowContext . CAN_ONLY_NULL ) | ( FlowContext . IN_ASSIGNMENT ) ) , flowInfo ) ;
Buggy code:
public class TypicalActivity extends AppCompatActivity { @ Override protected void onCreate ( @ Nullable Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_typical ) ; PhysicsLinearLayout layout = ( ( PhysicsLinearLayout ) ( findViewById ( physics_layout ) ) ) ; <START_BUG> layout . getPhysicsHelper ( ) . enablePhysics ( ) ; <END_BUG> } }

Fix:
layout . getPhysicsDelegate ( ) . enablePhysics ( ) ;
Buggy code:
public class VariableSymbol extends Symbol { public enum Type { INT , FLOAT , INT_POINTER , FLOAT_POINTER , INT_ARRAY , FLOAT_ARRAY ; } public VariableSymbol . Type type ; public String address ; @ Override public String toString ( ) { <START_BUG> return ( ( type ) + "<seq2seq4repair_space>" ) + ( name ) ; <END_BUG> } }

Fix:
return ( ( ( ( ( type ) + "<seq2seq4repair_space>" ) + ( name ) ) + "<" ) + ( address ) ) + ">" ;
Buggy code:
public class ConverterUtil { public static String getFileNameWithoutExtension ( File file ) { } public static String getFileExtension ( File file ) { } public static File createAndCheckFolder ( String path ) { } public static BufferedImage loadImage ( String filePath ) throws Exception { } public static String runWebP ( File target , String [ ] additionalArgs , File outFile ) { } public static String runPngCrush ( File target , String [ ] additionalArgs ) { } private static String runCmd ( String [ ] cmdArray ) { } public static < T > T [ ] concat ( T [ ] first , T [ ] second ) { } public static List < File > compressToFile ( File targetFile , List < ECompression > compressionList , BufferedImage bufferedImage , Dimension targetDimension , float compressionQuality , boolean skipIfExists ) throws Exception { } public static void compressJpeg ( File targetFile , BufferedImage bufferedImage , float quality ) throws IOException { } public static BufferedImage scale ( BufferedImage imageToScale , int dWidth , int dHeight , ECompression compression , Color background ) { BufferedImage scaledImage = null ; if ( imageToScale != null ) { <START_BUG> int imageType = imageToScale . getType ( ) ; <END_BUG> if ( ( ( compression == ( ECompression . PNG ) ) || ( compression == ( ECompression . GIF ) ) ) || ( imageType == 0 ) ) { imageType = BufferedImage . TYPE_INT_ARGB ; } scaledImage = new BufferedImage ( dWidth , dHeight , imageType ) ; Graphics2D graphics2D = scaledImage . createGraphics ( ) ; graphics2D . setRenderingHint ( RenderingHints . KEY_INTERPOLATION , RenderingHints . VALUE_INTERPOLATION_BICUBIC ) ; graphics2D . setRenderingHint ( RenderingHints . KEY_ALPHA_INTERPOLATION , RenderingHints . VALUE_ALPHA_INTERPOLATION_QUALITY ) ; graphics2D . setRenderingHint ( RenderingHints . KEY_COLOR_RENDERING , RenderingHints . VALUE_COLOR_RENDER_QUALITY ) ; graphics2D . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; graphics2D . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; if ( compression == ( ECompression . JPG ) ) { graphics2D . drawImage ( imageToScale , 0 , 0 , dWidth , dHeight , null ) ; } else { graphics2D . drawImage ( imageToScale , 0 , 0 , dWidth , dHeight , null ) ; } graphics2D . dispose ( ) ; } return scaledImage ; } }

Fix:
int imageType = BufferedImage . TYPE_INT_RGB ;
Buggy code:
public class XaDataSourceService extends AbstractDataSourceService { private final InjectedValue < ModifiableXaDataSource > dataSourceConfig = new InjectedValue < ModifiableXaDataSource > ( ) ; public XaDataSourceService ( final String dsName , final String jndiName , final ClassLoader classLoader ) { } public XaDataSourceService ( final String dsName , final String jndiName ) { } @ Override protected synchronized void stopService ( ) { } @ Override public AS7DataSourceDeployer getDeployer ( ) throws ValidateException { <START_BUG> return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) . getUnModifiableInstance ( ) , dataSourceConfig . getValue ( ) . getProfile ( ) ) ; <END_BUG> } public Injector < ModifiableXaDataSource > getDataSourceConfigInjector ( ) { } }

Fix:
return new AS7DataSourceDeployer ( dataSourceConfig . getValue ( ) . getUnModifiableInstance ( ) ) ;
Buggy code:
public class ReportPageGui extends AbstractReportGui { private static final long serialVersionUID = 240L ; private JLabeledTextField pageTitle = new JLabeledTextField ( JMeterUtils . getResString ( "report_page_title" ) ) ; private JCheckBox makeIndex = new JCheckBox ( JMeterUtils . getResString ( "report_page_index" ) ) ; private JLabeledTextField cssURL = new JLabeledTextField ( JMeterUtils . getResString ( "report_page_style_url" ) ) ; private JLabeledTextField headerURL = new JLabeledTextField ( JMeterUtils . getResString ( "report_page_header" ) ) ; private JLabeledTextField footerURL = new JLabeledTextField ( JMeterUtils . getResString ( "report_page_footer" ) ) ; private JLabeledTextArea introduction = new JLabeledTextArea ( JMeterUtils . getResString ( "report_page_intro" ) ) ; public ReportPageGui ( ) { } private void init ( ) { } @ Override public JPopupMenu createPopupMenu ( ) { JPopupMenu pop = new JPopupMenu ( ) ; <START_BUG> JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "Add" ) ) ; <END_BUG> addMenu . add ( ReportMenuFactory . makeMenuItem ( new TableGui ( ) . getStaticLabel ( ) , TableGui . class . getName ( ) , "Add" ) ) ; addMenu . add ( ReportMenuFactory . makeMenuItem ( new BarChartGui ( ) . getStaticLabel ( ) , BarChartGui . class . getName ( ) , "Add" ) ) ; addMenu . add ( ReportMenuFactory . makeMenuItem ( new LineGraphGui ( ) . getStaticLabel ( ) , LineGraphGui . class . getName ( ) , "Add" ) ) ; pop . add ( addMenu ) ; ReportMenuFactory . addFileMenu ( pop ) ; ReportMenuFactory . addEditMenu ( pop , true ) ; return pop ; } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement element ) { } @ Override public void configure ( TestElement element ) { } }

Fix:
JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "add" ) ) ;
Buggy code:
public class Scale extends Control { boolean ignoreResize ; static final int TrackBarProc ; static final TCHAR TrackBarClass = new TCHAR ( 0 , OS . TRACKBAR_CLASS , true ) ; public Scale ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } int defaultForeground ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public int getSelection ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setBackgroundImage ( int hImage ) { } void setBackgroundPixel ( int pixel ) { } public void setIncrement ( int increment ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int pageIncrement ) { } public void setSelection ( int value ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { boolean fixPaint = ( findBackgroundControl ( ) ) != null ; if ( ! fixPaint ) { if ( ( ( OS . COMCTL32_MAJOR ) >= 6 ) && ( OS . IsAppThemed ( ) ) ) { Control control = findThemeControl ( ) ; fixPaint = control != null ; } } if ( fixPaint ) { boolean redraw = ( ( drawCount ) == 0 ) && ( OS . IsWindowVisible ( handle ) ) ; if ( redraw ) OS . SendMessage ( handle , WM_SETREDRAW , 0 , 0 ) ; ignoreResize = true ; OS . SendMessage ( handle , WM_SIZE , 0 , 0 ) ; ignoreResize = false ; if ( redraw ) { OS . SendMessage ( handle , WM_SETREDRAW , 1 , 0 ) ; <START_BUG> OS . InvalidateRect ( handle , null , true ) ; <END_BUG> } } return super . WM_PAINT ( wParam , lParam ) ; } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT wmScrollChild ( int wParam , int lParam ) { } }

Fix:
OS . InvalidateRect ( handle , null , false ) ;
Buggy code:
public class RemoteChannelPairSetup implements RemotingChannelPairSetup { static final String ENDPOINT_NAME = "endpoint" ; static final String URI_SCHEME = "test123" ; static final String TEST_CHANNEL = "Test-Channel" ; static final int PORT = 32123 ; static final int EXECUTOR_MAX_THREADS = 20 ; private static final long EXECUTOR_KEEP_ALIVE_TIME = 60000 ; ChannelServer channelServer ; protected ExecutorService executorService ; protected Channel serverChannel ; protected Channel clientChannel ; protected Connection connection ; final CountDownLatch clientConnectedLatch = new CountDownLatch ( 1 ) ; public Channel getServerChannel ( ) { } public Channel getClientChannel ( ) { } public ExecutorService getExecutorService ( ) { } public void setupRemoting ( final ManagementMessageHandler handler ) throws IOException { } public void startChannels ( ) throws IOException , URISyntaxException { ProtocolChannelClient . Configuration configuration = new ProtocolChannelClient . Configuration ( ) ; configuration . setEndpointName ( RemoteChannelPairSetup . ENDPOINT_NAME ) ; configuration . setUriScheme ( RemoteChannelPairSetup . URI_SCHEME ) ; configuration . setUri ( new URI ( ( ( ( ( "" + ( RemoteChannelPairSetup . URI_SCHEME ) ) + ":////127.0.0.1:" ) + ( RemoteChannelPairSetup . PORT ) ) + "" ) ) ) ; configuration . setOptionMap ( OptionMap . create ( SASL_POLICY_NOANONYMOUS , Boolean . FALSE ) ) ; ProtocolChannelClient client = ProtocolChannelClient . create ( configuration ) ; <START_BUG> connection = client . connect ( new PasswordClientCallbackHandler ( "TestUser" , "localhost.localdomain" , "TestUserPassword" . toCharArray ( ) ) ) . get ( ) ; <END_BUG> clientChannel = connection . openChannel ( RemoteChannelPairSetup . TEST_CHANNEL , EMPTY ) . get ( ) ; try { clientConnectedLatch . await ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } public void stopChannels ( ) { } public void shutdownRemoting ( ) throws IOException , InterruptedException { } }

Fix:
connection = client . connectSync ( new PasswordClientCallbackHandler ( "TestUser" , "localhost.localdomain" , "TestUserPassword" . toCharArray ( ) ) ) ;
Buggy code:
public class PlaylistFragment extends ListFragment { private List < PlayList > mPlaylists ; private PlaylistAdapter adapter ; private EditText incrementalSearch ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup parent , Bundle savedInstanceState ) { } @ Override public void onListItemClick ( ListView l , View v , int position , long id ) { PlayList c = ( ( PlaylistAdapter ) ( getListAdapter ( ) ) ) . getItem ( position ) ; <START_BUG> Log . d ( ( "PlayList<seq2seq4repair_space>" + ( Constants . LOG_TAG ) ) , ( ( c . getName ( ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>clicked" ) ) ; <END_BUG> Intent i = new Intent ( getActivity ( ) , SongListActivity . class ) ; i . putExtra ( PLAYLIST_ID , position ) ; startActivity ( i ) ; } @ Override public void onResume ( ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } No newline ; at end ; of file ; }

Fix:
Log . d ( LOG_TAG , ( ( "PlayList<seq2seq4repair_space>" + ( c . getName ( ) ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>clicked" ) ) ;
Buggy code:
public class Base64InputStream extends FilterInputStream { private final boolean doEncode ; private final Base64 base64 ; private final byte [ ] singleByte = new byte [ 1 ] ; public Base64InputStream ( InputStream in ) { } public Base64InputStream ( InputStream in , boolean doEncode ) { } public Base64InputStream ( InputStream in , boolean doEncode , int lineLength , byte [ ] lineSeparator ) { } public int read ( ) throws IOException { } public int read ( byte [ ] b , int offset , int len ) throws IOException { if ( b == null ) { throw new NullPointerException ( ) ; } else <START_BUG> if ( ( ( offset < 0 ) || ( len < 0 ) ) || ( ( offset + len ) < 0 ) ) { <END_BUG> throw new IndexOutOfBoundsException ( ) ; } else if ( ( offset > ( b . length ) ) || ( ( offset + len ) > ( b . length ) ) ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return 0 ; } else { if ( ! ( base64 . hasData ( ) ) ) { byte [ ] buf = new byte [ doEncode ? 4096 : 8192 ] ; int c = in . read ( buf ) ; if ( ( c > 0 ) && ( ( b . length ) == len ) ) { base64 . setInitialBuffer ( b , offset , len ) ; } if ( doEncode ) { base64 . encode ( buf , 0 , c ) ; } else { base64 . decode ( buf , 0 , c ) ; } } return base64 . readResults ( b , offset , len ) ; } } public boolean markSupported ( ) { } }

Fix:
if ( ( offset < 0 ) || ( len < 0 ) ) {
Buggy code:
public class NonCachingImage extends Image { private static final long serialVersionUID = 1L ; public NonCachingImage ( String id , IModel model ) { } public NonCachingImage ( String id , Resource imageResource ) { } public NonCachingImage ( String id , ResourceReference resourceReference , ValueMap resourceParameters ) { } public NonCachingImage ( String id , ResourceReference resourceReference ) { } public NonCachingImage ( String id , String string ) { } public NonCachingImage ( String id ) { } protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; <START_BUG> String url = tag . getAttributes ( ) . getKey ( "src" ) ; <END_BUG> url = url + ( ( url . indexOf ( "?" ) ) >= 0 ? "&" : "?" ) ; url = ( url + "wicket:rand=" ) + ( Math . random ( ) ) ; tag . put ( "src" , url ) ; } }

Fix:
String url = tag . getAttributes ( ) . getString ( "src" ) ;
Buggy code:
public class MainActivity extends Activity implements OnClickListener { private String tag = "MyTag" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onClick ( View v ) { } private String My_Table = "bash_table" ; private void writeToDataBase ( BufferedWriter bw ) { DBHelper dbHelper = new DBHelper ( this ) ; SQLiteDatabase db = dbHelper . getWritableDatabase ( ) ; Cursor c = db . query ( My_Table , null , null , null , null , null , null ) ; if ( c . moveToFirst ( ) ) { int idColIndex = c . getColumnIndex ( "id" ) ; int markColIndex = c . getColumnIndex ( "mark" ) ; int sarcColIndex = c . getColumnIndex ( "sarcasm" ) ; do { try { <START_BUG> bw . write ( ( ( ( ( ( ( Integer . toString ( c . getInt ( idColIndex ) ) ) + "<seq2seq4repair_space>" ) + ( Integer . toString ( c . getInt ( markColIndex ) ) ) ) + "<seq2seq4repair_space>" ) + ( Integer . toString ( c . getInt ( sarcColIndex ) ) ) ) + "\n" ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } } while ( c . moveToNext ( ) ) ; } c . close ( ) ; } }

Fix:
bw . write ( ( ( ( ( ( ( Integer . toString ( c . getInt ( idColIndex ) ) ) + "<seq2seq4repair_space>" ) + ( Integer . toString ( c . getInt ( markColIndex ) ) ) ) + "<seq2seq4repair_space>" ) + ( Integer . toString ( c . getInt ( sarcColIndex ) ) ) ) + "<seq2seq4repair_space>" ) ) ;
Buggy code:
public class StringID extends BaseID { private static final long serialVersionUID = 3256437019155446068L ; public static class Creator implements IDInstantiator { public ID makeInstance ( Namespace ns , Class [ ] argTypes , Object [ ] args ) throws IDInstantiationException { } } public static final String STRINGID_INSTANTIATOR_CLASS = StringID . Creator . class . getName ( ) ; public static final String STRINGID_NAME = StringID . class . getName ( ) ; protected String value ; protected StringID ( Namespace n , String s ) { } public int compareTo ( Object o ) { } public boolean equals ( Object o ) { } public String getName ( ) { } public int hashCode ( ) { } public Namespace getNamespace ( ) { } public String toString ( ) { } public URI toURI ( ) throws URISyntaxException { } protected int namespaceCompareTo ( BaseID obj ) { } protected boolean namespaceEquals ( BaseID obj ) { } protected String namespaceGetName ( ) { } protected int namespaceHashCode ( ) { } protected URI namespaceToURI ( ) throws URISyntaxException { } protected synchronized void setEmptyNamespace ( ) { if ( ( namespace ) == null ) { <START_BUG> namespace = IDFactory . getNamespaceByName ( StringID . class . getName ( ) ) ; <END_BUG> } } }

Fix:
namespace = IDFactory . getDefault ( ) . getNamespaceByName ( StringID . class . getName ( ) ) ;
Buggy code:
public class PackageFragmentRoot extends Openable implements IPackageFragmentRoot { protected IResource fResource ; protected PackageFragmentRoot ( IResource resource , IJavaProject project ) { } protected PackageFragmentRoot ( IResource resource , IJavaProject project , String path ) { } public void attachSource ( IPath zipPath , IPath rootPath , IProgressMonitor monitor ) throws JavaModelException { } protected boolean computeChildren ( OpenableElementInfo info ) throws JavaModelException { } protected void computeFolderChildren ( IContainer folder , String prefix , ArrayList vChildren ) throws JavaModelException { } protected OpenableElementInfo createElementInfo ( ) { } public IPackageFragment createPackageFragment ( String name , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected int determineKind ( IResource underlyingResource ) throws JavaModelException { } public boolean equals ( Object o ) { } public boolean exists ( ) { } public boolean exists0 ( ) { } protected boolean generateInfos ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } protected char getHandleMementoDelimiter ( ) { } public int getKind ( ) throws JavaModelException { } public Object [ ] getNonJavaResources ( ) throws JavaModelException { } public IPackageFragment getPackageFragment ( String packageName ) { } protected String getPackageName ( IFolder folder ) throws JavaModelException { } public IPath getPath ( ) { } public IPath getSourceAttachmentPath ( ) throws JavaModelException { } public IPath getSourceAttachmentRootPath ( ) throws JavaModelException { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isArchive ( ) { } public boolean isExternal ( ) { } protected boolean isOnClasspath ( ) { IJavaProject project = this . getJavaProject ( ) ; if ( ( this . getElementType ( ) ) == ( IJavaElement . JAVA_PROJECT ) ) { return true ; } IPath path = this . getPath ( ) ; try { if ( ( ! ( USING_NEW_BUILDER ) ) && ( project . getOutputLocation ( ) . isPrefixOf ( path ) ) ) { return true ; } IClasspathEntry [ ] classpath = project . getResolvedClasspath ( true ) ; for ( int i = 0 , length = classpath . length ; i < length ; i ++ ) { IClasspathEntry entry = classpath [ i ] ; <START_BUG> if ( entry . getPath ( ) . isPrefixOf ( path ) ) { <END_BUG> return true ; } } } catch ( JavaModelException e ) { } return false ; } protected void openWhenClosed ( IProgressMonitor pm , IBuffer buffer ) throws JavaModelException { } public void refreshChildren ( ) { } public IJavaElement rootedAt ( IJavaProject project ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
if ( entry . getPath ( ) . equals ( path ) ) {