Buggy code:
private static void parseIUsArgument ( List < IQuery < IInstallableUnit > > vnames , String arg ) { } private static File processFileArgument ( String arg ) { } private IArtifactRepositoryManager artifactManager ; IMetadataRepositoryManager metadataManager ; private URI [ ] artifactReposForRemoval ; private URI [ ] metadataReposForRemoval ; private final List < URI > artifactRepositoryLocations = new ArrayList < URI > ( ) ; private final List < URI > metadataRepositoryLocations = new ArrayList < URI > ( ) ; private final List < IQuery < IInstallableUnit > > rootsToInstall = new ArrayList < IQuery < IInstallableUnit > > ( ) ; private final List < IQuery < IInstallableUnit > > rootsToUninstall = new ArrayList < IQuery < IInstallableUnit > > ( ) ; private final List < IQuery < IInstallableUnit > > rootsToList = new ArrayList < IQuery < IInstallableUnit > > ( ) ; private File bundlePool = null ; private File destination ; private File sharedLocation ; private String flavor ; private boolean printHelpInfo = false ; private boolean printIUList = false ; private boolean printRootIUList = false ; private boolean printTags = false ; private IUListFormatter listFormat ; private String revertToPreviousState = DirectorApplication . NOTHING_TO_REVERT_TO ; private static String NOTHING_TO_REVERT_TO = "-1" ; private static String REVERT_TO_PREVIOUS = "0" ; private boolean verifyOnly = false ; private boolean roamingProfile = false ; private boolean purgeRegistry = false ; private boolean stackTrace = false ; private boolean followReferences = false ; private boolean downloadOnly = false ; private String profileId ; private String profileProperties ; private String iuProfileProperties ; private String ws ; private String os ; private String arch ; private String nl ; private String tag ; private IEngine engine ; private boolean noProfileId = false ; private PackageAdmin packageAdmin ; private ServiceReference < PackageAdmin > packageAdminRef ; private IPlanner planner ; private ILog log = null ; private IProvisioningAgent targetAgent ; private boolean targetAgentIsSelfAndUp = false ; private boolean noArtifactRepositorySpecified = false ; protected ProfileChangeRequest buildProvisioningRequest ( IProfile profile , Collection < IInstallableUnit > installs , Collection < IInstallableUnit > uninstalls ) { } private Properties loadProperties ( File file ) { } private void buildIUProfileProperties ( IProfileChangeRequest request ) { } private void cleanupRepositories ( ) { } private IQueryResult < IInstallableUnit > collectRootIUs ( IQuery < IInstallableUnit > query ) { } private Collection < IInstallableUnit > collectRoots ( IProfile profile , List < IQuery < IInstallableUnit > > rootNames , boolean forInstall ) throws CoreException { } synchronized Bundle getBundle ( String symbolicName ) { } private String getEnvironmentProperty ( ) { } private IProfile getProfile ( ) { } private IProfile initializeProfile ( ) throws CoreException { } private void initializeRepositories ( ) throws CoreException { } private void initializeServices ( ) throws CoreException { } public void notify ( EventObject o ) { if ( ! ( o instanceof RepositoryEvent ) ) return ; RepositoryEvent event = ( ( RepositoryEvent ) ( o ) ) ; if ( ( RepositoryEvent . ADDED ) != ( event . getKind ( ) ) ) return ; int type = event . getRepositoryType ( ) ; URI location = event . getRepositoryLocation ( ) ; if ( ( ( IRepository . TYPE_ARTIFACT ) == type ) && ( ( artifactReposForRemoval ) != null ) ) { for ( int i = 0 ; i < ( artifactReposForRemoval . length ) ; i ++ ) { if ( ( ( artifactReposForRemoval [ i ] ) != null ) && ( URIUtil . sameURI ( artifactReposForRemoval [ i ] , location ) ) ) { artifactReposForRemoval [ i ] = null ; break ; } } return ; } <START_BUG> if ( ( IRepository . TYPE_METADATA ) == type ) { <END_BUG> for ( int i = 0 ; i < ( metadataReposForRemoval . length ) ; i ++ ) { if ( ( ( metadataReposForRemoval [ i ] ) != null ) && ( URIUtil . sameURI ( metadataReposForRemoval [ i ] , location ) ) ) { metadataReposForRemoval [ i ] = null ; break ; } } return ; } } private void logStatus ( IStatus status ) { } private void printMessage ( String message ) { } private void logFailure ( IStatus status ) { } private void markRoots ( IProfileChangeRequest request , Collection < IInstallableUnit > roots ) { } private void missingArgument ( String argumentName ) throws CoreException { } private void performList ( ) throws CoreException { } private void performProvisioningActions ( ) throws CoreException { } private void planAndExecute ( IProfile profile , ProvisioningContext context , ProfileChangeRequest request ) throws CoreException { } private void executePlan ( ProvisioningContext context , IProvisioningPlan result ) throws CoreException { } private boolean hasNoRepositoryFound ( IStatus status ) { } private void printRequest ( ProfileChangeRequest request ) { } public void processArguments ( String [ ] args ) throws CoreException { } private void putProperties ( String pairs , Map < String , String > properties ) { } private void cleanupServices ( ) { } public Object run ( String [ ] args ) { } private void purgeRegistry ( ) throws ProvisionException { } private void revertToPreviousState ( ) throws CoreException { } private long getTimestampToRevertTo ( IProfileRegistry profileRegistry , String profId ) { } private void setSystemProperty ( String key , String value ) { } private static void appendLevelPrefix ( PrintStream strm , int level ) { } IQueryResult < IInstallableUnit > getInstallableUnits ( URI location , IQuery < IInstallableUnit > query , IProgressMonitor monitor ) { } private void deeplyPrint ( CoreException ce , PrintStream strm , int level ) { } private void deeplyPrint ( IStatus status , PrintStream strm , int level ) { } private void deeplyPrint ( Throwable t , PrintStream strm , int level ) { } private void performHelpInfo ( ) { } private IStatus setRoaming ( IProfile profile ) { }

Fix:
if ( ( ( IRepository . TYPE_METADATA ) == type ) && ( ( metadataReposForRemoval ) != null ) ) {