output: #fixed code
                               public void removeWorkitem(String uniqueID) throws PluginException {
  		IndexWriter awriter = null;
  
  		try {
  			awriter = createIndexWriter();
  			Term term = new Term("$uniqueid", uniqueID);
  			awriter.deleteDocuments(term);
  		} catch (CorruptIndexException e) {
  			throw new PluginException(LucenePlugin.class.getSimpleName(), INVALID_INDEX,
  					"Unable to remove workitem '" + uniqueID + "' from search index", e);
  		} catch (LockObtainFailedException e) {
  			throw new PluginException(LucenePlugin.class.getSimpleName(), INVALID_INDEX,
  					"Unable to remove workitem '" + uniqueID + "' from search index", e);
  		} catch (IOException e) {
  			throw new PluginException(LucenePlugin.class.getSimpleName(), INVALID_INDEX,
  					"Unable to remove workitem '" + uniqueID + "' from search index", e);
  		}
  
  	}
input: #vulnerable code 
                               public void removeWorkitem(String uniqueID) throws PluginException {
  		IndexWriter awriter = null;
  		Properties prop = propertyService.getProperties();
  		if (!prop.isEmpty()) {
  			try {
  				awriter = createIndexWriter(prop);
  				Term term = new Term("$uniqueid", uniqueID);
  				awriter.deleteDocuments(term);
  			} catch (CorruptIndexException e) {
  				throw new PluginException(LucenePlugin.class.getSimpleName(), INVALID_INDEX,
  						"Unable to remove workitem '" + uniqueID + "' from search index", e);
  			} catch (LockObtainFailedException e) {
  				throw new PluginException(LucenePlugin.class.getSimpleName(), INVALID_INDEX,
  						"Unable to remove workitem '" + uniqueID + "' from search index", e);
  			} catch (IOException e) {
  				throw new PluginException(LucenePlugin.class.getSimpleName(), INVALID_INDEX,
  						"Unable to remove workitem '" + uniqueID + "' from search index", e);
  			}
  		}
  	} 
                              #location 8 
                              #vulnerability type RESOURCE_LEAK