nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Config { public static String VERSION = "0.1b" ; private static XMLConfiguration config = null ; private static Class thisClass = new Object ( ) { } . getClass ( ) . getEnclosingClass ( ) ; private static Logger LOG = LoggerFactory . getLogger ( Config . thisClass ) ; public static void init ( String configFile ) throws ConfigurationException { } public static String getClientHost ( ) { } public static int getClientPort ( ) { } public static boolean getClientSSL ( ) { } public static String getClientNick ( ) { } public static String getClientPassword ( ) { } public static Map < String , String > getClientChannels ( ) { } public static List < String > getDefaultChannels ( ) { } public static List < Script > getScripts ( ) { } public static long getClientMessageDelay ( ) { <START_BUG> return Config . config . getLong ( "ircclient.server.messagedelay" , 250L ) ; <END_BUG> } public static String getCatHost ( ) { } public static int getCatPort ( ) { } }

Fix:
return Config . config . getLong ( "ircclient.server.messageDelay" , 250L ) ;
Buggy code:
class CurrentOfResultSet extends NoPutResultSetImpl implements CursorResultSet { private boolean next ; private RowLocation rowLocation ; private CursorResultSet cursor ; private CursorResultSet target ; private ExecRow sparseRow ; private final String cursorName ; CurrentOfResultSet ( String cursorName , Activation activation , int resultSetNumber ) { } public void openCore ( ) throws StandardException { } public ExecRow getNextRowCore ( ) throws StandardException { } private ExecRow getSparseRow ( ExecRow row , int [ ] indexCols ) throws StandardException { } public void close ( ) throws StandardException { } public void finish ( ) throws StandardException { } public long getTimeSpent ( int type ) { } public RowLocation getRowLocation ( ) { } public ExecRow getCurrentRow ( ) { } private void getCursor ( ) throws StandardException { if ( ( cursor ) != null ) { if ( cursor . isClosed ( ) ) { cursor = null ; target = null ; } } if ( ( cursor ) == null ) { LanguageConnectionContext lcc = getLanguageConnectionContext ( ) ; CursorActivation cursorActivation = lcc . lookupCursorActivation ( cursorName ) ; if ( cursorActivation != null ) { cursor = cursorActivation . getCursorResultSet ( ) ; target = cursorActivation . getTargetResultSet ( ) ; activation . setForUpdateIndexScan ( cursorActivation . getForUpdateIndexScan ( ) ) ; if ( ( cursorActivation . getHeapConglomerateController ( ) ) != null ) cursorActivation . getHeapConglomerateController ( ) . close ( ) ; cursorActivation . setHeapConglomerateController ( activation . getHeapConglomerateController ( ) ) ; } } if ( ( ( cursor ) == null ) || ( cursor . isClosed ( ) ) ) { <START_BUG> throw StandardException . newException ( LANG_CURSOR_CLOSED , cursorName ) ; <END_BUG> } } public void updateRow ( ExecRow row ) throws StandardException { } public void markRowAsDeleted ( ) throws StandardException { } }

Fix:
throw StandardException . newException ( LANG_CURSOR_NOT_FOUND , cursorName ) ;
Buggy code:
public class AuthenticatedWebPage extends WicketExamplePage implements IAlternateParentProvider { private Border border ; public AuthenticatedWebPage ( ) { } @ Override protected void init ( ) { super . init ( ) ; <START_BUG> border = new LibraryApplicationBorder ( this , "border" ) ; <END_BUG> } @ Override public LibrarySession getSession ( ) { } public MarkupContainer getAlternateParent ( final Class childClass , final String childId ) { } }

Fix:
this . border = new LibraryApplicationBorder ( this , "border" ) ;
Buggy code:
public class SysInfoLog { public SysInfoLog ( ) { } public void exec ( String jvmName , String javaCmd , String classpath , String framework , PrintWriter pw , boolean useprocess ) throws Exception { if ( useprocess == true ) { Process pr = null ; jvm javavm = null ; try { if ( ( jvmName == null ) || ( ( jvmName . length ( ) ) == 0 ) ) jvmName = "jdk13" ; else if ( jvmName . startsWith ( "jdk13" ) ) <START_BUG> jvmName = "jdk31" ; <END_BUG> javavm = jvm . getJvm ( jvmName ) ; if ( javaCmd != null ) javavm . setJavaCmd ( javaCmd ) ; if ( javavm == null ) System . out . println ( "WHOA,<seq2seq4repair_space>javavm<seq2seq4repair_space>is<seq2seq4repair_space>NULL" ) ; if ( javavm == null ) pw . println ( "WHOA,<seq2seq4repair_space>javavm<seq2seq4repair_space>is<seq2seq4repair_space>NULL" ) ; if ( ( classpath != null ) && ( ( classpath . length ( ) ) > 0 ) ) { javavm . setClasspath ( classpath ) ; } Vector v = javavm . getCommandLine ( ) ; v . addElement ( "org.apache.derby.tools.sysinfo" ) ; String [ ] sCmd = new String [ v . size ( ) ] ; for ( int i = 0 ; i < ( v . size ( ) ) ; i ++ ) { sCmd [ i ] = ( ( String ) ( v . elementAt ( i ) ) ) ; } pr = Runtime . getRuntime ( ) . exec ( sCmd ) ; BackgroundStreamDrainer stdout = new BackgroundStreamDrainer ( pr . getInputStream ( ) , null ) ; BackgroundStreamDrainer stderr = new BackgroundStreamDrainer ( pr . getErrorStream ( ) , null ) ; pr . waitFor ( ) ; String result = HandleResult . handleResult ( pr . exitValue ( ) , stdout . getData ( ) , stderr . getData ( ) , pw ) ; pw . flush ( ) ; if ( ( framework != null ) && ( ( framework . length ( ) ) > 0 ) ) { pw . println ( ( "Framework:<seq2seq4repair_space>" + framework ) ) ; } pr . destroy ( ) ; pr = null ; } catch ( Throwable t ) { if ( javavm == null ) System . out . println ( "WHOA,<seq2seq4repair_space>javavm<seq2seq4repair_space>is<seq2seq4repair_space>NULL" ) ; if ( javavm == null ) pw . println ( "WHOA,<seq2seq4repair_space>javavm<seq2seq4repair_space>is<seq2seq4repair_space>NULL" ) ; System . out . println ( ( "Process<seq2seq4repair_space>exception:<seq2seq4repair_space>" + t ) ) ; pw . println ( ( "Process<seq2seq4repair_space>exception:<seq2seq4repair_space>" + t ) ) ; t . printStackTrace ( pw ) ; if ( pr != null ) { pr . destroy ( ) ; pr = null ; } } } else { } } }

Fix:
jvmName = "jdk13" ;
Buggy code:
public abstract class FormComponentPanel < T > extends FormComponent < T > { private static final long serialVersionUID = 1L ; public FormComponentPanel ( String id ) { } public FormComponentPanel ( String id , IModel < T > model ) { } @ Override public boolean checkRequired ( ) { } @ Override protected IMarkupSourcingStrategy newMarkupSourcingStrategy ( ) { <START_BUG> return new PanelMarkupSourcingStrategy ( ) ; <END_BUG> } @ Override protected void onComponentTag ( final ComponentTag tag ) { } }

Fix:
return new PanelMarkupSourcingStrategy ( false ) ;
Buggy code:
public final class DeploymentReflectionIndex { private final Map < Class < ? > , ClassReflectionIndex < ? > > classes = new HashMap < Class < ? > , ClassReflectionIndex < ? > > ( ) ; DeploymentReflectionIndex ( ) { } private static final Permission DEPLOYMENT_REFLECTION_INDEX_PERMISSION = new RuntimePermission ( "createDeploymentReflectionIndex" ) ; public static DeploymentReflectionIndex create ( ) { } @ SuppressWarnings ( { "unchecked" } ) public synchronized < T > ClassReflectionIndex < T > getClassIndex ( Class < T > clazz ) { try { ClassReflectionIndex < T > index = ( ( ClassReflectionIndex < T > ) ( classes . get ( clazz ) ) ) ; if ( index == null ) { classes . put ( clazz , ( index = new ClassReflectionIndex < T > ( clazz , this ) ) ) ; } return index ; } catch ( Throwable e ) { <START_BUG> throw new RuntimeException ( ( "Error<seq2seq4repair_space>getting<seq2seq4repair_space>reflective<seq2seq4repair_space>information<seq2seq4repair_space>for<seq2seq4repair_space>class<seq2seq4repair_space>" + clazz ) , e ) ; <END_BUG> } } }

Fix:
throw new RuntimeException ( ( "Error<seq2seq4repair_space>getting<seq2seq4repair_space>reflective<seq2seq4repair_space>information<seq2seq4repair_space>for<seq2seq4repair_space>" + clazz ) , e ) ;
Buggy code:
public class MutableFloat { private float value ; public MutableFloat ( ) { } public MutableFloat ( float value ) { } public float get ( ) { } public void set ( float value ) { } public void setIfMax ( float value ) { } public void setIfMin ( float value ) { <START_BUG> if ( ( this . value ) < value ) { <END_BUG> this . value = value ; } } }

Fix:
if ( ( this . value ) > value ) {
Buggy code:
public class DatabaseDescriptorTest { @ Test public void testShouldHaveConfigFileNameAvailable ( ) { } @ Test public void testCFMetaDataSerialization ( ) throws IOException { } @ Test public void testKSMetaDataSerialization ( ) throws IOException { <START_BUG> for ( KSMetaData ksm : tables_ . values ( ) ) { <END_BUG> byte [ ] ser = KSMetaData . serialize ( ksm ) ; KSMetaData ksmDupe = KSMetaData . deserialize ( new ByteArrayInputStream ( ser ) ) ; assert ksmDupe != null ; assert ksmDupe . equals ( ksm ) ; } } }

Fix:
for ( KSMetaData ksm : tables . values ( ) ) {
Buggy code:
class NewLoggerRemove implements ModelRemoveOperationHandler , RuntimeOperationHandler { static final NewLoggerRemove INSTANCE = new NewLoggerRemove ( ) ; public Cancellable execute ( final NewOperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { final ModelNode address = operation . get ( OP_ADDR ) ; <START_BUG> final String name = address . get ( ( ( address . asInt ( ) ) - 1 ) ) . asString ( ) ; <END_BUG> final ModelNode subModel = context . getSubModel ( ) ; final ModelNode compensatingOperation = new ModelNode ( ) ; compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; compensatingOperation . get ( OP ) . set ( ADD ) ; compensatingOperation . get ( LEVEL ) . set ( subModel . get ( LEVEL ) ) ; compensatingOperation . get ( HANDLERS ) . set ( subModel . get ( HANDLERS ) ) ; if ( context instanceof NewRuntimeOperationContext ) { final NewRuntimeOperationContext runtimeContext = ( ( NewRuntimeOperationContext ) ( context ) ) ; final ServiceRegistry registry = runtimeContext . getServiceRegistry ( ) ; final ServiceController < ? > controller = runtimeContext . getServiceRegistry ( ) . getService ( LogServices . loggerName ( name ) ) ; if ( controller != null ) { controller . setMode ( REMOVE ) ; } if ( subModel . has ( HANDLERS ) ) { LogServices . uninstallLoggerHandlers ( registry , name , subModel . get ( HANDLERS ) ) ; } } resultHandler . handleResultComplete ( compensatingOperation ) ; return Cancellable . NULL ; } }

Fix:
final String name = address . get ( ( ( address . asInt ( ) ) - 1 ) ) . asProperty ( ) . getValue ( ) . asString ( ) ;
Buggy code:
public class ParameterizedType extends Type { int index ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( ParameterizedType . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( ParameterizedType . class , "typeArguments" , Type . class , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Type type = null ; private ASTNode . NodeList typeArguments = new ASTNode . NodeList ( ParameterizedType . TYPE_ARGUMENTS_PROPERTY ) ; ParameterizedType ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { ParameterizedType result = new ParameterizedType ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setType ( ( ( Type ) ( ( ( ASTNode ) ( getType ( ) ) ) . clone ( target ) ) ) ) ; result . typeArguments ( ) . addAll ( ASTNode . copySubtrees ( target , typeArguments ( ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getType ( ) { } public void setType ( Type type ) { } public List typeArguments ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class ExplicitTransformationDescriptionBuilder extends TransformationDescriptionBuilder { private ResourceTransformer resourceTransformer = ResourceTransformer . DEFAULT ; private OperationTransformer operationTransformer = OperationTransformer . DEFAULT ; private PathTransformation pathTransformation = PathTransformation . DEFAULT ; private final Map < String , OperationTransformer > operationTransformers = Collections . emptyMap ( ) ; public ExplicitTransformationDescriptionBuilder ( PathElement pathElement ) { } public ExplicitTransformationDescriptionBuilder setResourceTransformer ( ResourceTransformer resourceTransformer ) { } public ExplicitTransformationDescriptionBuilder setOperationTransformer ( OperationTransformer operationTransformer ) { } public ExplicitTransformationDescriptionBuilder redirectTo ( PathElement element ) { } @ Override public TransformationDescription build ( ) { return new AbstractDescription ( pathElement , pathTransformation ) { @ Override public void register ( TransformersSubRegistration parent ) { <START_BUG> parent . registerSubResource ( pathElement , resourceTransformer , operationTransformer ) ; <END_BUG> } } ; } }

Fix:
parent . registerSubResource ( pathElement , pathTransformation , resourceTransformer , operationTransformer ) ;
Buggy code:
public final class GuestBook extends WicketExamplePage { private static final List commentList = new ArrayList ( ) ; private final ListView commentListView ; public GuestBook ( ) { } public final class CommentForm extends Form { public CommentForm ( final String id ) { } public final void onSubmit ( ) { final Comment comment = ( ( Comment ) ( getRootModelObject ( ) ) ) ; final Comment newComment = new Comment ( comment ) ; newComment . setDate ( new Date ( ) ) ; <START_BUG> commentListView . modelChangeImpending ( ) ; <END_BUG> synchronized ( commentListView . getModelLock ( ) ) { GuestBook . commentList . add ( 0 , newComment ) ; } commentListView . modelChanged ( ) ; comment . setText ( "" ) ; } } }

Fix:
commentListView . modelChanging ( ) ;
Buggy code:
public class NewWizardMenu extends ContributionItem { private Action showDlgAction = new NewWizardAction ( ) ; private Action newProjectAction ; private Action newExampleAction ; private Map actions = new HashMap ( 21 ) ; private NewWizardsRegistryReader reader = new NewWizardsRegistryReader ( ) ; private boolean enabled = true ; private IWorkbenchWindow window ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; public NewWizardMenu ( IMenuManager innerMgr , IWorkbenchWindow window , boolean register ) { } public NewWizardMenu ( IWorkbenchWindow window ) { } private void fillMenu ( IContributionManager innerMgr ) { } private IAction getAction ( String id ) { IAction action = ( ( IAction ) ( actions . get ( id ) ) ) ; if ( action == null ) { WorkbenchWizardElement element = reader . findWizard ( id ) ; if ( element != null ) { <START_BUG> action = new NewWizardShortcutAction ( window . getWorkbench ( ) , element ) ; <END_BUG> actions . put ( id , action ) ; } } return action ; } public boolean isEnabled ( ) { } public boolean isDynamic ( ) { } public boolean isDirty ( ) { } public void setEnabled ( boolean enabledValue ) { } public void deregisterListeners ( ) { } public void fill ( Menu menu , int index ) { } private boolean hasExamples ( ) { } }

Fix:
action = new NewWizardShortcutAction ( window , element ) ;
Buggy code:
public class LuceneCarrot2StemmerFactory implements IStemmerFactory { static final Logger logger = LoggerFactory . getLogger ( LuceneCarrot2StemmerFactory . class ) ; @ Override public IStemmer getStemmer ( LanguageCode language ) { } private static final class SnowballStemmerFactory { private static HashMap < LanguageCode , Class < ? extends SnowballProgram > > snowballStemmerClasses ; private static class SnowballStemmerAdapter implements IStemmer { private final SnowballProgram snowballStemmer ; public SnowballStemmerAdapter ( SnowballProgram snowballStemmer ) { } @ Override public CharSequence stem ( CharSequence word ) { } } public static IStemmer createStemmer ( LanguageCode language ) { } } private static class ArabicStemmerFactory { private static class LuceneStemmerAdapter implements IStemmer { private final ArabicStemmer delegate ; private final ArabicNormalizer normalizer ; private char [ ] buffer = new char [ 0 ] ; private LuceneStemmerAdapter ( ) { } @ Override public CharSequence stem ( CharSequence word ) { } private boolean equals ( char [ ] buffer , int len , CharSequence word ) { } } public static IStemmer createStemmer ( ) { try { return new LuceneCarrot2StemmerFactory . ArabicStemmerFactory . LuceneStemmerAdapter ( ) ; <START_BUG> } catch ( Throwable e ) { <END_BUG> return LuceneCarrot2StemmerFactory . IdentityStemmer . INSTANCE ; } } } private static class IdentityStemmer implements IStemmer { private static final LuceneCarrot2StemmerFactory . IdentityStemmer INSTANCE = new LuceneCarrot2StemmerFactory . IdentityStemmer ( ) ; @ Override public CharSequence stem ( CharSequence word ) { } } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class RedirectViewTests { @ Test ( expected = IllegalArgumentException . class ) public void noUrlSet ( ) throws Exception { } @ Test public void http11 ( ) throws Exception { } @ Test public void explicitStatusCodeHttp11 ( ) throws Exception { } @ Test public void explicitStatusCodeHttp10 ( ) throws Exception { } @ Test public void attributeStatusCodeHttp11 ( ) throws Exception { } @ Test public void flashMap ( ) throws Exception { RedirectView rv = new RedirectView ( ) ; rv . setUrl ( "http:////url.somewhere.com//path" ) ; rv . setHttp10Compatible ( false ) ; MockHttpServletRequest request = new MockHttpServletRequest ( ) ; MockHttpServletResponse response = new MockHttpServletResponse ( ) ; FlashMap flashMap = new FlashMap ( ) ; flashMap . put ( "successMessage" , "yay!" ) ; <START_BUG> request . setAttribute ( CURRENT_FLASH_MAP_ATTRIBUTE , flashMap ) ; <END_BUG> rv . render ( new ModelMap ( "id" , "1" ) , request , response ) ; assertEquals ( 303 , response . getStatus ( ) ) ; assertEquals ( "http:////url.somewhere.com//path?id=1" , response . getHeader ( "Location" ) ) ; MockHttpServletRequest nextRequest = new MockHttpServletRequest ( "GET" , "//path" ) ; nextRequest . addParameter ( "id" , "1" ) ; assertTrue ( flashMap . matches ( nextRequest ) ) ; } @ Test public void emptyMap ( ) throws Exception { } @ Test public void emptyMapWithContextRelative ( ) throws Exception { } @ Test public void singleParam ( ) throws Exception { } @ Test public void singleParamWithoutExposingModelAttributes ( ) throws Exception { } @ Test public void paramWithAnchor ( ) throws Exception { } @ Test public void contextRelativeQueryParam ( ) throws Exception { } @ Test public void twoParams ( ) throws Exception { } @ Test public void arrayParam ( ) throws Exception { } @ Test public void collectionParam ( ) throws Exception { } @ Test public void objectConversion ( ) throws Exception { } private void doTest ( Map < String , ? > map , String url , boolean contextRelative , String expectedUrlForEncoding ) throws Exception { } private void doTest ( final Map < String , ? > map , final String url , final boolean contextRelative , final boolean exposeModelAttributes , String expectedUrlForEncoding ) throws Exception { } }

Fix:
request . setAttribute ( OUTPUT_FLASH_MAP_ATTRIBUTE , flashMap ) ;
Buggy code:
public class EjbJar extends MatchingTask { public static class DTDLocation extends org . apache . tools . ant . types . DTDLocation { } static class Config { public File srcDir ; public File descriptorDir ; public String baseNameTerminator = "-" ; public String baseJarName ; public boolean flatDestDir = false ; public Path classpath ; public List supportFileSets = new ArrayList ( ) ; public ArrayList dtdLocations = new ArrayList ( ) ; public EjbJar . NamingScheme namingScheme ; public File manifest ; public String analyzer ; } public static class NamingScheme extends EnumeratedAttribute { public static final String EJB_NAME = "ejb-name" ; public static final String DIRECTORY = "directory" ; public static final String DESCRIPTOR = "descriptor" ; public static final String BASEJARNAME = "basejarname" ; public String [ ] getValues ( ) { } } private EjbJar . Config config = new EjbJar . Config ( ) ; private File destDir ; private String genericJarSuffix = "-generic.jar" ; private ArrayList deploymentTools = new ArrayList ( ) ; protected void addDeploymentTool ( EJBDeploymentTool deploymentTool ) { } public WeblogicDeploymentTool createWeblogic ( ) { } public WebsphereDeploymentTool createWebsphere ( ) { } public BorlandDeploymentTool createBorland ( ) { } public IPlanetDeploymentTool createIplanet ( ) { } public JbossDeploymentTool createJboss ( ) { } public JonasDeploymentTool createJonas ( ) { } public WeblogicTOPLinkDeploymentTool createWeblogictoplink ( ) { } public Path createClasspath ( ) { if ( ( config . classpath ) == null ) { <START_BUG> config . classpath = new Path ( project ) ; <END_BUG> } return config . classpath . createPath ( ) ; } public EjbJar . DTDLocation createDTD ( ) { } public FileSet createSupport ( ) { } public void setManifest ( File manifest ) { } public void setSrcdir ( File inDir ) { } public void setDescriptordir ( File inDir ) { } public void setDependency ( String analyzer ) { } public void setBasejarname ( String inValue ) { } public void setNaming ( EjbJar . NamingScheme namingScheme ) { } public void setDestdir ( File inDir ) { } public void setClasspath ( Path classpath ) { } public void setFlatdestdir ( boolean inValue ) { } public void setGenericjarsuffix ( String inString ) { } public void setBasenameterminator ( String inValue ) { } private void validateConfig ( ) throws BuildException { } public void execute ( ) throws BuildException { } }

Fix:
config . classpath = new Path ( getProject ( ) ) ;
Buggy code:
public class testDateParser { @ Test public void test ( ) { DateParser dp = new DateParser ( ) ; Date output = null ; <START_BUG> output = dp . getDate ( "25-04-2014<seq2seq4repair_space>11:00<seq2seq4repair_space>am" ) ; <END_BUG> System . out . println ( output ) ; } }

Fix:
output = dp . getDate ( "tomorrow" ) ;
Buggy code:
public class OptionsItem implements CheckableItem { private String name ; private boolean selected ; private XmlElement element ; public OptionsItem ( XmlElement element ) { } public void setSelected ( boolean b ) { } public boolean isSelected ( ) { IDefaultItem item = new org . columba . core . config . DefaultItem ( element ) ; <START_BUG> return item . getBoolean ( "overwrite" , false ) ; <END_BUG> } public Icon getIcon ( ) { } public String toString ( ) { } public XmlElement getElement ( ) { } }

Fix:
return item . getBooleanWithDefault ( "overwrite" , false ) ;
Buggy code:
public class Composite extends Scrollable { Layout layout ; Control [ ] tabList ; int layoutCount ; int backgroundMode ; boolean keyInputHappened ; Composite ( ) { } public Composite ( Composite parent , int style ) { } Control [ ] _getChildren ( ) { } Control [ ] _getTabList ( ) { } boolean acceptsFirstResponder ( int id , int sel ) { } int accessibilityAttributeNames ( int id , int sel ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } public void changed ( Control [ ] changed ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } protected void checkSubclass ( ) { } Control [ ] computeTabList ( ) { } void setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void createHandle ( ) { } void doCommandBySelector ( int id , int sel , int selector ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect , boolean sendPaint ) { if ( ( ( state ) & ( CANVAS ) ) != 0 ) { if ( ( ( style ) & ( SWT . NO_BACKGROUND ) ) == 0 ) { <START_BUG> fillBackground ( view , context , rect ) ; <END_BUG> } } super . drawWidget ( id , context , rect , sendPaint ) ; } void flagsChanged ( int id , int sel , int theEvent ) { } Composite findDeferredControl ( ) { } Menu [ ] findMenus ( Control control ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } void fixTabList ( Control control ) { } public int getBackgroundMode ( ) { } public Control [ ] getChildren ( ) { } int getChildrenCount ( ) { } public Layout getLayout ( ) { } public boolean getLayoutDeferred ( ) { } public Control [ ] getTabList ( ) { } boolean hooksKeys ( ) { } boolean insertText ( int id , int sel , int string ) { } public boolean isLayoutDeferred ( ) { } boolean isOpaque ( int id , int sel ) { } boolean isTabGroup ( ) { } void keyDown ( int id , int sel , int theEvent ) { } public void layout ( ) { } public void layout ( boolean changed ) { } public void layout ( boolean changed , boolean all ) { } public void layout ( Control [ ] changed ) { } void markLayout ( boolean changed , boolean all ) { } Point minimumSize ( int wHint , int Hint , boolean changed ) { } void pageDown ( int id , int sel , int sender ) { } void pageUp ( int id , int sel , int sender ) { } void reflectScrolledClipView ( int id , int sel , int aClipView ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } void resized ( ) { } void scrollWheel ( int id , int sel , int theEvent ) { } public void setBackgroundMode ( int mode ) { } public boolean setFocus ( ) { } public void setLayout ( Layout layout ) { } public void setLayoutDeferred ( boolean defer ) { } boolean setMarkedText_selectedRange ( int id , int sel , int string , int range ) { } boolean setScrollBarVisible ( ScrollBar bar , boolean visible ) { } boolean setTabGroupFocus ( ) { } public void setTabList ( Control [ ] tabList ) { } int traversalCode ( int key , NSEvent theEvent ) { } void updateBackgroundMode ( ) { } void updateLayout ( boolean all ) { } }

Fix:
fillBackground ( view , context , rect , ( - 1 ) ) ;
Buggy code:
public class ScriptProcessor implements QueryEngineAware { private String language = "groovy" ; private ScriptEngine engine = null ; private String location ; private String content ; private static Logger log = Logger . getLogger ( ScriptProcessor . class ) ; private QueryEngine queryEngine ; public void initialize ( VisitorContext context , Object node ) { } public void visit ( Object node , VisitorContext ctx ) { initialize ( ctx , node ) ; Bindings bindings = engine . createBindings ( ) ; bindings . put ( "node" , node ) ; bindings . put ( "context" , ctx ) ; bindings . put ( "query" , getQueryEngine ( ) ) ; if ( ( content ) != null ) { try { engine . eval ( content , bindings ) ; } catch ( ScriptException e ) { ScriptProcessor . log . error ( ( ( ( ( ( "The<seq2seq4repair_space>file<seq2seq4repair_space>" + ( e . getFileName ( ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>at<seq2seq4repair_space>line:<seq2seq4repair_space>" ) + ( e . getLineNumber ( ) ) ) + ",<seq2seq4repair_space>column:<seq2seq4repair_space>" ) + ( e . getColumnNumber ( ) ) ) ) ; throw new WalkModException ( e ) ; } } else { if ( ( location ) != null ) { Reader reader = null ; <START_BUG> File file = new File ( location ) ; <END_BUG> if ( file . exists ( ) ) { try { reader = new FileReader ( file ) ; } catch ( FileNotFoundException e ) { throw new WalkModException ( e ) ; } } else { URL uri = ctx . getClassLoader ( ) . getResource ( location ) ; if ( uri != null ) { try { reader = new FileReader ( new File ( uri . getFile ( ) ) ) ; } catch ( FileNotFoundException e ) { throw new WalkModException ( e ) ; } } } if ( reader != null ) { try { engine . eval ( reader , bindings ) ; } catch ( ScriptException e ) { throw new WalkModException ( e ) ; } } } } } public void setLanguage ( String language ) { } public void setLocation ( String location ) { } public void setContent ( String content ) { } public void setQueryEngine ( QueryEngine queryEngine ) { } public QueryEngine getQueryEngine ( ) { } public Object query ( String query ) { } public Object query ( Object context , String query ) { } }

Fix:
File file = new File ( location ) . getAbsoluteFile ( ) ;
Buggy code:
public class IndexedSharedResourceCodingStrategyTest extends WicketTestCase { private static final String URL_PREFIX = "//WicketTester$DummyWebApplication//WicketTester$DummyWebApplication//" ; private static final String RESOURCE_NAME = "test" ; private IndexedSharedResourceCodingStrategyTest . TestResource resource ; @ Override protected void setUp ( ) throws Exception { } public void testEmptyRequest ( ) { } public void testRequestWithIndexedParams ( ) { } public void testRequestWithIndexedParamsAndQueryString ( ) { final WebRequestCycle cycle = tester . setupRequestAndResponse ( ) ; final PageParameters params = new PageParameters ( ) ; params . add ( "0" , "param0" ) ; params . add ( "1" , "param1" ) ; params . put ( "test" , new String [ ] { "testval1" , "testval2" } ) ; params . add ( "foo" , "fooval" ) ; final String url = cycle . urlFor ( new ResourceReference ( IndexedSharedResourceCodingStrategyTest . RESOURCE_NAME ) , params ) . toString ( ) ; <START_BUG> assertEquals ( "test//param0//param1?foo=fooval&test=testval1&test=testval2" , url ) ; <END_BUG> tester . getServletRequest ( ) . setURL ( ( ( IndexedSharedResourceCodingStrategyTest . URL_PREFIX ) + url ) ) ; tester . processRequestCycle ( cycle ) ; assertEquals ( 4 , resource . params . size ( ) ) ; assertEquals ( "fooval" , resource . params . getString ( "foo" ) ) ; final String [ ] arr = resource . params . getStringArray ( "test" ) ; assertEquals ( 2 , arr . length ) ; assertEquals ( "testval1" , arr [ 0 ] ) ; assertEquals ( "testval2" , arr [ 1 ] ) ; assertEquals ( "param0" , resource . params . getString ( "0" ) ) ; assertEquals ( "param1" , resource . params . getString ( "1" ) ) ; } private static class TestResource extends Resource { private static final long serialVersionUID = 6033856371536194742L ; public ValueMap params ; @ Override public IResourceStream getResourceStream ( ) { } } }

Fix:
assertEquals ( "test//param0//param1?test=testval1&test=testval2&foo=fooval" , url ) ;
Buggy code:
public class LoggerAdd extends AbstractLoggingSubsystemUpdate < Void > { private static final long serialVersionUID = 4230922005791983261L ; private final String name ; private Level level ; private boolean useParentHandlers = true ; private FilterType filter ; private String [ ] handlers ; public LoggerAdd ( final String name , final Level level , final boolean useParentHandlers ) { } public LoggerAdd ( final String name ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { final LoggerService service = new LoggerService ( name ) ; service . setLevel ( level ) ; service . setUseParentHandlers ( useParentHandlers ) ; final BatchServiceBuilder < Logger > builder = updateContext . getBatchBuilder ( ) . addService ( LogServices . getLoggerName ( name ) , service ) ; <START_BUG> builder . setInitialMode ( IMMEDIATE ) ; <END_BUG> } public LoggerRemove getCompensatingUpdate ( LoggingSubsystemElement original ) { } protected void applyUpdate ( LoggingSubsystemElement element ) throws UpdateFailedException { } public Level getLevel ( ) { } public void setLevel ( final Level level ) { } public boolean isUseParentHandlers ( ) { } public void setUseParentHandlers ( final boolean useParentHandlers ) { } public FilterType getFilter ( ) { } public void setFilter ( final FilterType filter ) { } public String [ ] getHandlers ( ) { } public void setHandlers ( final String ... handlers ) { } }

Fix:
builder . setInitialMode ( ACTIVE ) ;
Buggy code:
@ MessageEndpoint public class DeviceEventEndpoint { private static final Logger LOGGER = LoggerFactory . getLogger ( DeviceEventEndpoint . class ) ; private DeviceEventProcessor deviceEventProcessor ; @ Autowired public DeviceEventEndpoint ( DeviceEventProcessor deviceEventProcessor ) { } @ ServiceActivator ( inputChannel = "konkerMqttInputChannel" ) public void onEvent ( Message < String > message ) throws MessagingException { if ( DeviceEventEndpoint . LOGGER . isDebugEnabled ( ) ) DeviceEventEndpoint . LOGGER . debug ( ( "A<seq2seq4repair_space>message<seq2seq4repair_space>has<seq2seq4repair_space>arrived<seq2seq4repair_space>-><seq2seq4repair_space>" + ( message . toString ( ) ) ) ) ; Object topic = message . getHeaders ( ) . get ( TOPIC ) ; if ( ( topic == null ) || ( topic . toString ( ) . isEmpty ( ) ) ) { throw new MessagingException ( message , "Topic<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null<seq2seq4repair_space>or<seq2seq4repair_space>empty" ) ; } try { deviceEventProcessor . process ( topic . toString ( ) , message . getPayload ( ) ) ; } catch ( BusinessException be ) { <START_BUG> throw new MessagingException ( message , be ) ; <END_BUG> } } }

Fix:
DeviceEventEndpoint . LOGGER . error ( message . getPayload ( ) , be ) ;
Buggy code:
public class Question extends Node { private static final List < Class < ? extends Node > > parentsAllowed = new ArrayList ( Arrays . asList ( Form . class , IfStatement . class , ElseStatement . class , ElseIfStatement . class ) ) ; private List < String > customQuestionOptions = new ArrayList < > ( ) ; private static final String [ ] questionTypes = new String [ ] { "integer" , "string" , "boolean" , "custom" } ; private String identifier ; private String questionString ; private String questionType ; private Range questionRange ; public Question ( int lineNumber , String id ) { } public Optional < String > getIdentifier ( ) { } public String getQuestionString ( ) { } public Optional < Range > getQuestionRange ( ) { } public void setQuestionString ( String qs ) { } public void setQuestionType ( String qt ) { } public void setQuestionRange ( Range r ) { } @ Override public void printDebug ( int i ) { } @ Override public Optional < ? extends Pane > visualize ( Pane parent ) { } @ Override public void typeCheck ( ) throws TypeCheckingException { } @ Override public void addReference ( ReferenceMap referenceMap ) throws TypeCheckingException { if ( getIdentifier ( ) . isPresent ( ) ) { <START_BUG> if ( referenceMap . containsKey ( getIdentifier ( ) ) ) { <END_BUG> throw new TypeCheckingException . AlreadyDefinedTypeCheckingException ( this , getIdentifier ( ) . get ( ) ) ; } else { referenceMap . put ( getIdentifier ( ) . get ( ) , this ) ; } } else { throw new TypeCheckingException . NoIdentifierDefinedTypeCheckingException ( getLineNumber ( ) ) ; } } public boolean isQuestionTypeBoolean ( ) { } public boolean isQuestionTypeString ( ) { } public boolean isQuestionTypeInteger ( ) { } public boolean isQuestionTypeCustom ( ) { } public void setCustomQuestionOptions ( List < TerminalNode > options ) { } }

Fix:
if ( ( referenceMap . get ( getIdentifier ( ) . get ( ) ) ) != null ) {
Buggy code:
public class ReportPresenter extends Presenter < ReportPresenter . MyView , ReportPresenter . MyProxy > implements ReportUiHandlers { private final DispatchAsync dispatcher ; private final CurrentUser currentUser ; @ ProxyCodeSplit @ NameToken ( NameTokens . settingsPage ) @ TabInfo ( container = MainPagePresenter . class , label = "Report" , priority = 1 ) public interface MyProxy extends TabContentProxyPlace < ReportPresenter > { } public interface MyView extends HasUiHandlers < ReportUiHandlers > , View { void setAdmin ( boolean isAdmin ) { } void setUserName ( String username ) { } Tree getTree ( ) { } } @ Inject public ReportPresenter ( final EventBus eventBus , final ReportPresenter . MyView view , final ReportPresenter . MyProxy proxy , final DispatchAsync dispatcher , final CurrentUser currentUser ) { } @ Override protected void revealInParent ( ) { } @ Override protected void onReveal ( ) { } @ Override public void loadTree ( ) { final JSONTreeLoader loader = new JSONTreeLoader ( getView ( ) . getTree ( ) ) ; getDispatcher ( ) . execute ( new LoadTreeAction ( "//WEB-INF//tree-data.json" ) , new com . google . gwt . user . client . rpc . AsyncCallback < LoadTreeResult > ( ) { @ Override public void onFailure ( Throwable caught ) { if ( Log . isDebugEnabled ( ) ) <START_BUG> Log . debug ( ( "loaddTree()-Caught<seq2seq4repair_space>unexpected<seq2seq4repair_space>Error:\n" + ( caught . toString ( ) ) ) ) ; <END_BUG> loader . populateTreeError ( caught . getMessage ( ) ) ; } @ Override public void onSuccess ( LoadTreeResult result ) { if ( Log . isDebugEnabled ( ) ) Log . debug ( ( "loadTree()<seq2seq4repair_space>-OnSucces()-<seq2seq4repair_space>" + ( result . getResponse ( ) ) ) ) ; JSONValue jsonValue = JSONParser . parse ( result . getResponse ( ) ) ; loader . populateTree ( jsonValue ) ; } } ) ; } public DispatchAsync getDispatcher ( ) { } public CurrentUser getCurrentUser ( ) { } No newline ; at end ; of file ; }

Fix:
Log . debug ( ( "loadTree()-Caught<seq2seq4repair_space>unexpected<seq2seq4repair_space>Error:\n" + ( caught . toString ( ) ) ) ) ;
Buggy code:
getServlet ( ) . service ( request , response ) ; <START_BUG> assertEquals ( 200 , response . getStatus ( ) ) ; <END_BUG>

Fix:
assertEquals ( 302 , response . getStatus ( ) ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class ParaphraseTest { String chatbotAnswer ; String userAnswer ; public ParaphraseTest ( String chatbotAnswer , String userAnswer ) { } @ Parameterized . Parameters public static Collection < Object [ ] > data ( ) { } @ Test public void pharaprasizeTest ( ) throws Exception { Brain brain = new Brain ( ) ; User user = new User ( ) ; <START_BUG> user . setGender ( FEMALE ) ; <END_BUG> Chatbot chatbot = new Chatbot ( user ) ; chatbot . brain = brain ; chatbot . brain . setUpBrain ( ) ; PolishDictionary dictionary = new PolishDictionary ( ) ; Assertions . assertThat ( chatbot . pharaprasize ( userAnswer ) ) . contains ( chatbotAnswer ) ; } @ Test public void test ( ) throws Exception { } }

Fix:
user . setGender ( MALE ) ;
Buggy code:
public class ConversionServiceContextConfigTests { @ Test public void testConfigOk ( ) { <START_BUG> ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext ( "org//springframework//context//conversionservice//conversionservice.xml" ) ; <END_BUG> TestClient client = context . getBean ( "testClient" , TestClient . class ) ; assertEquals ( 2 , client . getBars ( ) . size ( ) ) ; assertEquals ( "value1" , client . getBars ( ) . get ( 0 ) . getValue ( ) ) ; assertEquals ( "value2" , client . getBars ( ) . get ( 1 ) . getValue ( ) ) ; assertTrue ( client . isBool ( ) ) ; } }

Fix:
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext ( "org//springframework//context//conversionservice//conversionService.xml" ) ;
Buggy code:
public class InMemoryTraceRepository implements TraceRepository { private int capacity = 100 ; private boolean reverse = true ; private final List < Trace > traces = new LinkedList < Trace > ( ) ; public void setReverse ( boolean reverse ) { } public void setCapacity ( int capacity ) { } @ Override public List < Trace > findAll ( ) { } @ Override public void add ( Map < String , Object > map ) { Trace trace = new Trace ( new Date ( ) , map ) ; synchronized ( this . traces ) { while ( ( this . traces . size ( ) ) >= ( this . capacity ) ) { <START_BUG> this . traces . remove ( ( ( this . capacity ) - 1 ) ) ; <END_BUG> } if ( this . reverse ) { this . traces . add ( 0 , trace ) ; } else { this . traces . add ( trace ) ; } } } }

Fix:
this . traces . remove ( ( this . reverse ? ( this . capacity ) - 1 : 0 ) ) ;
Buggy code:
public class GenericTaskList { private final int TASKLIST_SIZE = 1000 ; private ArrayList < GenericTask > taskArray = new ArrayList < GenericTask > ( TASKLIST_SIZE ) ; private enum SORT_TYPE { NAME , WORKLOAD , ID ; } private int numOfDisplayItems = 5 ; private ObservableList < GenericTask > observableGeneric = FXCollections . observableArrayList ( ) ; public GenericTaskList ( ) { } public GenericTask get ( int index ) { } public void add ( GenericTask task ) { } public void delete ( int index ) { <START_BUG> taskArray . remove ( index ) ; <END_BUG> } public void delete ( String name ) { } public int size ( ) { } public boolean isEmpty ( ) { } public GenericTaskList . SORT_TYPE getSortType ( String keyword ) { } public void sortBy ( GenericTaskList . SORT_TYPE type ) { } public ObservableList < GenericTask > getObservable ( ) { } private Comparator < GenericTask > taskNameComparator = new Comparator < GenericTask > ( ) { public int compare ( GenericTask t1 , GenericTask t2 ) { } } ; private Comparator < GenericTask > taskWorkloadComparator = new Comparator < GenericTask > ( ) { public int compare ( GenericTask t1 , GenericTask t2 ) { } } ; private Comparator < GenericTask > taskIdComparator = new Comparator < GenericTask > ( ) { public int compare ( GenericTask t1 , GenericTask t2 ) { } } ; }

Fix:
taskArray . remove ( ( index - 1 ) ) ;
Buggy code:
public class Skill { private String m_name ; private String m_description ; private boolean m_targetsEnemy ; private boolean m_targetsMultiple ; private int m_id ; private double m_accuracy ; private int m_value ; static int m_numOfSkills = 19 ; public static int getNumOfSkillsTotal ( ) { } public static Skill [ ] getSkills ( ) { <START_BUG> Skill [ ] skillSet = new Skill [ 8 ] ; <END_BUG> for ( int i = 0 ; i < ( skillSet . length ) ; i ++ ) { skillSet [ i ] = new Skill ( i ) ; } return skillSet ; } public Skill ( int skillNum ) { } public boolean Execute ( Actor User , Actor Target ) { } public int getValue ( ) { } public void setValue ( int value ) { } public String getName ( ) { } public void setName ( String name ) { } public String getDescription ( ) { } public void setDescription ( String description ) { } public boolean getTargetsEnemy ( ) { } public void setTargetsEnemy ( boolean targetsEnemy ) { } public boolean getTargetsMultiple ( ) { } public void setTargetsMultiple ( boolean targetsMultiple ) { } public int getId ( ) { } public void setId ( int id ) { } public double getAccuracy ( ) { } public void setAccuracy ( double accuracy ) { } }

Fix:
Skill [ ] skillSet = new Skill [ 19 ] ;
Buggy code:
public class TestPrefixRandom extends LuceneTestCase { private IndexSearcher searcher ; private IndexReader reader ; private Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) , MockTokenizer . KEYWORD , false ) ) . setMaxBufferedDocs ( TestUtil . nextInt ( random ( ) , 50 , 1000 ) ) ) ; Document doc = new Document ( ) ; Field field = newStringField ( "field" , "" , NO ) ; doc . add ( field ) ; int num = atLeast ( 1000 ) ; for ( int i = 0 ; i < num ; i ++ ) { field . setStringValue ( TestUtil . randomUnicodeString ( random ( ) , 10 ) ) ; writer . addDocument ( doc ) ; } reader = writer . getReader ( ) ; searcher = newSearcher ( reader ) ; <START_BUG> writer . close ( ) ; <END_BUG> } @ Override public void tearDown ( ) throws Exception { } private class DumbPrefixQuery extends MultiTermQuery { private final BytesRef prefix ; DumbPrefixQuery ( Term term ) { } @ Override protected TermsEnum getTermsEnum ( Terms terms , AttributeSource atts ) throws IOException { } private class SimplePrefixTermsEnum extends FilteredTermsEnum { private final BytesRef prefix ; private SimplePrefixTermsEnum ( TermsEnum tenum , BytesRef prefix ) { } @ Override protected AcceptStatus accept ( BytesRef term ) throws IOException { } } @ Override public String toString ( String field ) { } } public void testPrefixes ( ) throws Exception { } private void assertSame ( String prefix ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
final class MetaDataBuilderJAXRPC_EJB extends AbstractMetaDataBuilderEJB { @ Override protected void buildEnterpriseBeansMetaData ( final Deployment dep , final EJBArchiveMetaData ejbArchiveMD ) { final List < EJBMetaData > wsEjbsMD = new LinkedList < EJBMetaData > ( ) ; final JBossWebservicesMetaData jbossWebservicesMD = WSHelper . getOptionalAttachment ( dep , JBossWebservicesMetaData . class ) ; final JAXRPCDeployment jaxrpcDeployment = WSHelper . getRequiredAttachment ( dep , JAXRPCDeployment . class ) ; for ( final EJBEndpoint ejbEndpoint : jaxrpcDeployment . getEjbEndpoints ( ) ) { <START_BUG> this . buildEnterpriseBeanMetaData ( wsEjbsMD , ejbEndpoint , jbossWebservicesMD ) ; <END_BUG> } ejbArchiveMD . setEnterpriseBeans ( wsEjbsMD ) ; } }

Fix:
buildEnterpriseBeanMetaData ( wsEjbsMD , ejbEndpoint , jbossWebservicesMD ) ;
Buggy code:
public class JavaSearchNameEnvironment implements INameEnvironment , SuffixConstants { ClasspathLocation [ ] locations ; HashMap workingCopies ; public JavaSearchNameEnvironment ( IJavaProject javaProject , ICompilationUnit [ ] copies ) { } public void cleanup ( ) { } private void computeClasspathLocations ( IWorkspaceRoot workspaceRoot , JavaProject javaProject ) { IPackageFragmentRoot [ ] roots = null ; try { roots = javaProject . getAllPackageFragmentRoots ( ) ; } catch ( JavaModelException e ) { this . locations = new ClasspathLocation [ 0 ] ; return ; } int length = roots . length ; ClasspathLocation [ ] cpLocations = new ClasspathLocation [ length ] ; int index = 0 ; JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; for ( int i = 0 ; i < length ; i ++ ) { PackageFragmentRoot root = ( ( PackageFragmentRoot ) ( roots [ i ] ) ) ; IPath path = root . getPath ( ) ; try { if ( root . isArchive ( ) ) { ZipFile zipFile = manager . getZipFile ( path ) ; cpLocations [ ( index ++ ) ] = new ClasspathJar ( zipFile , ( ( ClasspathEntry ) ( root . getRawClasspathEntry ( ) ) ) . getAccessRuleSet ( ) ) ; } else { <START_BUG> Object target = JavaModel . getTarget ( workspaceRoot , path , false ) ; <END_BUG> if ( target == null ) { System . arraycopy ( cpLocations , 0 , ( cpLocations = new ClasspathLocation [ ( cpLocations . length ) - 1 ] ) , 0 , index ) ; } else if ( ( root . getKind ( ) ) == ( IPackageFragmentRoot . K_SOURCE ) ) { cpLocations [ ( index ++ ) ] = new ClasspathSourceDirectory ( ( ( IContainer ) ( target ) ) , root . fullExclusionPatternChars ( ) , root . fullInclusionPatternChars ( ) ) ; } else { cpLocations [ ( index ++ ) ] = ClasspathLocation . forBinaryFolder ( ( ( IContainer ) ( target ) ) , false , ( ( ClasspathEntry ) ( root . getRawClasspathEntry ( ) ) ) . getAccessRuleSet ( ) ) ; } } } catch ( CoreException e1 ) { System . arraycopy ( cpLocations , 0 , ( cpLocations = new ClasspathLocation [ ( cpLocations . length ) - 1 ] ) , 0 , index ) ; } } this . locations = cpLocations ; } private NameEnvironmentAnswer findClass ( String qualifiedTypeName , char [ ] typeName ) { } public NameEnvironmentAnswer findType ( char [ ] typeName , char [ ] [ ] packageName ) { } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName ) { } public boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { } public boolean isPackage ( String qualifiedPackageName ) { } }

Fix:
Object target = JavaModel . getTarget ( path , true ) ;