auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String[] getMechanismNames(Map<String, ?> properties) { Set<String> mechanismNames = new LinkedHashSet<>(); for (Provider current : providers.get()) { boolean containFactory = false; Set<Service> services = current.getServices(); if (services != null) { for (Service currentService : services) { if (SERVICE_TYPE.equals(currentService.getType())) { containFactory = true; try { String[] serviceMechNames = ((HttpServerAuthenticationMechanismFactory) currentService.newInstance(null)).getMechanismNames(properties); Collections.addAll(mechanismNames, serviceMechNames); } catch (NoSuchAlgorithmException e) { log.debug(e); } } } } if ( ! containFactory) { log.noHttpServerAuthenticationMechanismFactoryProvidedByProvider(current); } } return mechanismNames.toArray(new String[mechanismNames.size()]); }

Target:
public String[] getMechanismNames(Map<String, ?> properties) { Set<String> names = new LinkedHashSet<>(); for (Provider current : providerSupplier.get()) { Set<Service> services = current.getServices(); if (services != null) { for (Service currentService : services) { if (SERVICE_TYPE.equals(currentService.getType())) { try { String[] serviceMechNames = ((HttpServerAuthenticationMechanismFactory) currentService.newInstance(null)).getMechanismNames(properties); Collections.addAll(names, serviceMechNames); } catch (NoSuchAlgorithmException e) { log.debug(e); } } } } } if (names.size() == 0 && log.isTraceEnabled()) { log.tracef("No %s provided by service loader in %s: %s", SERVICE_TYPE, getClass().getSimpleName(), Arrays.toString(providerSupplier.get())); } return names.toArray(new String[names.size()]); }
Source:
private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } if (!isAuthenticated) { response = handleUnAuthenticatedCommand(command); writeToChannel(response); return; } if (!(command.isSupported() || allowUnsupportedCommands())) { writeToChannel(RedisResponse.error(RedisConstants.ERROR_UNSUPPORTED_COMMAND)); return; } response = command.execute(this); logResponse(response); moveSubscribeToNewEventLoopGroup(ctx, command); if (response == null) { writeToChannel(command.getResponse()); } else if (response != null) { writeToChannel(response); } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }

Target:
private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (!isAuthenticated) { response = handleUnAuthenticatedCommand(command); writeToChannel(response); return; } if (!(command.isSupported() || allowUnsupportedCommands())) { writeToChannel(RedisResponse.error(RedisConstants.ERROR_UNSUPPORTED_COMMAND)); return; } if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } response = command.execute(this); logResponse(response); moveSubscribeToNewEventLoopGroup(ctx, command); if (response == null) { writeToChannel(command.getResponse()); } else if (response != null) { writeToChannel(response); } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }
Source:
public Result query(String cypher, Map<String, ?> parameters, boolean readOnly) { validateQuery(cypher, parameters, readOnly); RestModelRequest request = new DefaultRestModelRequest(cypher, parameters); ResponseMapper mapper = new RestModelMapper(new GraphEntityMapper(session.metaData(), session.context()), session.metaData()); return session.doInTransaction(transaction -> { try (Response<RestModel> response = session.requestHandler().execute(request)) { Iterable<RestStatisticsModel> mappedModel = mapper.map(null, response); RestStatisticsModel restStatisticsModel = mappedModel.iterator().next(); if (readOnly) { return new QueryResultModel(restStatisticsModel.getResult(), null); } else { return new QueryResultModel(restStatisticsModel.getResult(), restStatisticsModel.getStatistics()); } } }, Transaction.Type.READ_WRITE); }

Target:
public Result query(String cypher, Map<String, ?> parameters, boolean readOnly) { validateQuery(cypher, parameters, readOnly); RestModelRequest request = new DefaultRestModelRequest(cypher, parameters); ResponseMapper mapper = new RestModelMapper(new GraphEntityMapper(session.metaData(), session.context()), session.metaData()); return session.doInTransaction( () -> { try (Response<RestModel> response = session.requestHandler().execute(request)) { Iterable<RestStatisticsModel> mappedModel = mapper.map(null, response); RestStatisticsModel restStatisticsModel = mappedModel.iterator().next(); if (readOnly) { return new QueryResultModel(restStatisticsModel.getResult(), null); } else { return new QueryResultModel(restStatisticsModel.getResult(), restStatisticsModel.getStatistics()); } } }, Transaction.Type.READ_WRITE); }
Source:
private Map setupPySparkEnv() throws IOException{ Map env = EnvironmentUtils.getProcEnvironment(); SparkConf conf = getSparkConf(); if (!env.containsKey("PYTHONPATH")) { String pythonPath = "../interpreter/lib/python"; try { pythonPath += ":" + conf.get("spark.submit.pyFiles").replaceAll(",", ":"); } catch (NoSuchElementException e) { LOG.error("spark.submit.pyFiles property is not set in spark config.") } env.put("PYTHONPATH", pythonPath); } if (SparkInterpreter.useSparkSubmit() && !getSparkInterpreter().isYarnMode()) { String sparkSubmitJars = conf.get("spark.jars").replace(",", ":"); if (!"".equals(sparkSubmitJars)) { env.put("PYTHONPATH", env.get("PYTHONPATH") + sparkSubmitJars); } } return env; }

Target:
private Map setupPySparkEnv() throws IOException{ Map env = EnvironmentUtils.getProcEnvironment(); SparkConf conf = getSparkConf(); if (!env.containsKey("PYTHONPATH")) { env.put("PYTHONPATH", conf.get("spark.submit.pyFiles").replaceAll(",", ":") + ":../interpreter/lib/python"); } if (SparkInterpreter.useSparkSubmit() && !getSparkInterpreter().isYarnMode()) { String sparkSubmitJars = conf.get("spark.jars").replace(",", ":"); if (!"".equals(sparkSubmitJars)) { env.put("PYTHONPATH", env.get("PYTHONPATH") + sparkSubmitJars); } } logger.debug("PYTHONPATH: " + env.get("PYTHONPATH")); return env; }
Source:
public HttpWebResponse sendPost(URL url, Map<String, String> headers, byte[] content, String contentType) throws IOException { mRequestUrl = url; mRequestHeaders = headers; if (content != null) { try { mRequestContent = new String(content, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); Assert.fail("Encoding"); } } if (mReturnException != null) { throw new IllegalArgumentException(mReturnException); } return mReturnResponse; }

Target:
public HttpWebResponse sendPost(URL url, Map<String, String> headers, byte[] content, String contentType) throws IOException { mRequestUrl = url; mRequestHeaders = headers; if (content != null) { try { mRequestContent = new String(content, "UTF-8"); } catch (final IOException e) { Assert.fail("IOException"); } } if (mReturnException != null) { throw new IllegalArgumentException(mReturnException); } return mReturnResponse; }
Source:
public AttributeDefinition[] getValueTypes() { return valueTypes; }

Target:
AttributeDefinition[] getValueTypes() { return valueTypes; }
Source:
protected JComponent getWindowContent() { final String datastoreName = getDatastoreName(); String bannerTitle = "Analysis results"; if (!StringUtils.isNullOrEmpty(datastoreName)) { bannerTitle = bannerTitle + " | " + datastoreName; if (_jobFilename != null) { bannerTitle = bannerTitle + " | " + _jobFilename.getName().getBaseName(); } } final DCBannerPanel banner = new DCBannerPanel(imageManager.getImage("images/window/banner-results.png"), bannerTitle); _tabbedPane.addListener(new VerticalTabbedPane.Listener() { @Override public void stateChanged(int newIndex, Tab<?> newTab) { banner.setTitle2(newTab.getTitle()); banner.updateUI(); } }); for (JComponent pluggableButton : _pluggableButtons) { banner.add(pluggableButton); } banner.add(_cancelButton); banner.add(Box.createHorizontalStrut(10)); final DCPanel panel = new DCPersistentSizedPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND, _windowSizePreference); panel.setLayout(new BorderLayout()); panel.add(banner, BorderLayout.NORTH); panel.add(_tabbedPane, BorderLayout.CENTER); return panel; }

Target:
protected JComponent getWindowContent() { final String datastoreName = getDatastoreName(); String bannerTitle = "Analysis results"; if (!StringUtils.isNullOrEmpty(datastoreName)) { bannerTitle = bannerTitle + " | " + datastoreName; if (_jobFilename != null) { bannerTitle = bannerTitle + " | " + _jobFilename.getName().getBaseName(); } } final DCBannerPanel banner = new DCBannerPanel(imageManager.getImage("images/window/banner-results.png"), bannerTitle); _tabbedPane.addListener(new VerticalTabbedPane.Listener() { @Override public void stateChanged(int newIndex, Tab<?> newTab) { banner.setTitle2(newTab.getTitle()); banner.updateUI(); } }); final DCPanel panel = new DCPersistentSizedPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND, _windowSizePreference); panel.setLayout(new BorderLayout()); panel.add(banner, BorderLayout.NORTH); panel.add(_tabbedPane, BorderLayout.CENTER); return panel; }
Source:
public void downloadForm(ServerFormDetails form, @Nullable ProgressReporter progressReporter, @Nullable Supplier<Boolean> isCancelled) throws FormDownloadException, InterruptedException { Form formOnDevice = formsRepository.get(form.getFormId(), form.getFormVersion()); if (formOnDevice != null) { if (formOnDevice.isDeleted()) { formsRepository.restore(formOnDevice.getId()); } else if (!(form.getHash().equals(formOnDevice.getMD5Hash()))) { String formIdentifier = formOnDevice.getDisplayName() + " " + formOnDevice.getId(); String formIdHash = FileUtils.getMd5Hash(new ByteArrayInputStream(formIdentifier.getBytes())); analytics.logFormEvent(DOWNLOAD_SAME_FORMID_VERSION, formIdHash); throw new FormDownloadException("You've already downloaded a form with the same ID and version but with different contents. " + "Before downloading, please send all data you have collected with the existing form and delete the data and blank form."); } } File tempDir = new File(cacheDir, "download-" + UUID.randomUUID().toString()); tempDir.mkdirs(); try { FormDownloaderListener stateListener = new ProgressReporterAndSupplierStateListener(progressReporter, isCancelled); boolean result = multiFormDownloader.processOneForm(form, stateListener, tempDir, formsDirPath, formMetadataParser); if (!result) { throw new FormDownloadException(); } } finally { try { deleteDirectory(tempDir); } catch (IOException ignored) { } } }

Target:
public void downloadForm(ServerFormDetails form, @Nullable ProgressReporter progressReporter, @Nullable Supplier<Boolean> isCancelled) throws FormDownloadException, InterruptedException { Form formOnDevice = formsRepository.getOneByFormIdAndVersion(form.getFormId(), form.getFormVersion()); if (formOnDevice != null) { String remoteFormHash = form.getHash().startsWith("md5:") ? form.getHash().substring("md5:".length()) : form.getHash(); if (formOnDevice.isDeleted()) { formsRepository.restore(formOnDevice.getId()); } else if (!remoteFormHash.equals(formOnDevice.getMD5Hash())) { String formIdentifier = formOnDevice.getDisplayName() + " " + formOnDevice.getId(); String formIdHash = FileUtils.getMd5Hash(new ByteArrayInputStream(formIdentifier.getBytes())); analytics.logFormEvent(DOWNLOAD_SAME_FORMID_VERSION, formIdHash); throw new FormDownloadException(FormDownloadException.Type.DUPLICATE_FORMID_VERSION); } } File tempDir = new File(cacheDir, "download-" + UUID.randomUUID().toString()); tempDir.mkdirs(); try { FormDownloaderListener stateListener = new ProgressReporterAndSupplierStateListener(progressReporter, isCancelled); boolean result = multiFormDownloader.processOneForm(form, stateListener, tempDir, formsDirPath, formMetadataParser); if (!result) { throw new FormDownloadException(); } } finally { try { deleteDirectory(tempDir); } catch (IOException ignored) { } } }
Source:
public void testNotConfiguredFactoryClass() { final Configuration config = new Configuration(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); final PluginManager testingPluginManagerPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManagerPluginManager); assertThat(externalResourceDrivers.entrySet(), is(empty())); }

Target:
public void testNotConfiguredFactoryClass() { final Configuration config = new Configuration(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); final PluginManager testingPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManager); assertThat(externalResourceDrivers.entrySet(), is(empty())); }
Source:
public void handle(ZookeeperConfigRefreshEvent event) { if (this.ready.get()) { log.debug(contextName + " " + event.getEventDesc()); if (this.refresh != null) { String[] keys = this.refresh.refresh(); log.info("Refresh keys changed: " + Arrays.asList(keys)); } } }

Target:
public void handle(ZookeeperConfigRefreshEvent event) { if (this.ready.get()) { log.debug("Event received " + event.getEventDesc()); if (this.refresh != null) { String[] keys = this.refresh.refresh(); log.info("Refresh keys changed: " + Arrays.asList(keys)); } } }
Source:
public boolean doSomething(@NotNull PsiFile file, @NotNull Project project, @Nullable final VirtualFile virtualFile, @NotNull String groupId) throws ExecutionException { if (virtualFile == null || !virtualFile.isInLocalFileSystem()) return true; Document document = PsiDocumentManager.getInstance(project).getDocument(file); assert document != null; String filePath = virtualFile.getCanonicalPath(); assert filePath != null; String sdkHome = GoSdkService.getInstance(project).getSdkHomePath(ModuleUtilCore.findModuleForPsiElement(file)); if (StringUtil.isEmpty(sdkHome)) { warning(project, groupId, "Project sdk is not valid"); return true; } File executable = PathEnvironmentVariableUtil.findInPath(GoEnvironmentUtil.getBinaryFileNameForPath("goimports")); if (executable == null) { warning(project, groupId, "Looks like you haven't any goimports executable in your PATH"); return true; } FileDocumentManager.getInstance().saveDocument(document); GoExecutor goExecutor = GoExecutor. in(project). withCustomExecutable(executable). addParameters("-w", filePath). showOutputOnError(); goExecutor.addProcessListener(new ProcessAdapter() { @Override public void processTerminated(ProcessEvent event) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { virtualFile.refresh(false, false); } }); } }); } }); goExecutor.execute(); return false; }

Target:
public boolean doSomething(@NotNull PsiFile file, @NotNull Project project, @Nullable final VirtualFile virtualFile, @NotNull String groupId) throws ExecutionException { if (virtualFile == null || !virtualFile.isInLocalFileSystem()) return true; Document document = PsiDocumentManager.getInstance(project).getDocument(file); assert document != null; String filePath = virtualFile.getCanonicalPath(); assert filePath != null; File executable = GoEnvironmentUtil.getBinaryFilePathFromEnvironment("goimports"); if (executable == null) { warning(project, groupId, "Looks like you haven't any goimports executable in your PATH"); return true; } FileDocumentManager.getInstance().saveDocument(document); GoExecutor. in(project). withExePath(executable.getAbsolutePath()). addParameters("-w", filePath). showOutputOnError(). execute(); return false; }
Source:
private static boolean checkAndNoteChangeNetworkStateOperation(@NonNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException) { return Settings.checkAndNoteWriteSettingsOperation(context, uid, callingPackage, throwException); }

Target:
private static boolean checkAndNoteChangeNetworkStateOperation(@NonNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException) { return Settings.checkAndNoteChangeNetworkStateOperation(context, uid, callingPackage, throwException); }
Source:
public boolean append(@NonNull StreamInputPacketIndexEntry entry) throws CTFReaderException { if (entry.getTimestampBegin() > entry.getTimestampEnd()) { throw new CTFReaderException("Packet begin timestamp is after end timestamp"); } if (!fEntries.isEmpty() && (entry.getTimestampBegin() < fLastElement.getTimestampBegin())) { throw new CTFReaderException("Packets begin timestamp decreasing"); } fEntries.add(entry); fLastElement = fEntries.get(fEntries.size() - 1); return true; }

Target:
public boolean append(@NonNull StreamInputPacketIndexEntry entry) throws CTFReaderException { if (entry.getTimestampBegin() > entry.getTimestampEnd()) { throw new CTFReaderException("Packet begin timestamp is after end timestamp"); } if (!fEntries.isEmpty() && (entry.getTimestampBegin() < lastElement().getTimestampBegin())) { throw new CTFReaderException("Packets begin timestamp decreasing"); } fEntries.add(entry); return true; }
Source:
public void publish(String transcript) { File logDir = new File(ROOT_DIR, LOG_DIR); if(logDir.exists() && !logDir.isDirectory()) { if(!logDir.delete()) { logger.warn("Was not able to safe a transcript because" + "there is a file called " + ROOT_DIR + " which cannot" + "be deleted"); return; } } if(!logDir.exists()) { if(!logDir.mkdir()) { logger.warn("Was not able to safe a transcript because" + "unable to make a directory called" + ROOT_DIR); return; } } File t = new File(logDir, "transcript_" + Instant.now() + ".txt"); try(FileWriter writer = new FileWriter(t)) { writer.write(transcript); System.out.println(transcript); } catch(IOException e) { logger.warn("Unable to safe transcript", e); } }

Target:
public void publish(String transcript) { File logDir = new File(getLogDirPath()); if(logDir.exists() && !logDir.isDirectory()) { if(!logDir.delete()) { logger.warn("Was not able to safe a transcript because" + "there is a file called " + logDir + " which cannot" + "be deleted"); return; } } if(!logDir.exists()) { if(!logDir.mkdir()) { logger.warn("Was not able to safe a transcript because" + "unable to make a directory called " + logDir); return; } } File t = new File(logDir, "transcript_" + Instant.now() + ".txt"); try(FileWriter writer = new FileWriter(t)) { writer.write(transcript); logger.info("wrote final transcript to " + t); } catch(IOException e) { logger.warn("Unable to safe transcript", e); } }
Source:
private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) { DiskCache<DefaultIssue>.DiskAppender cacheAppender = issueCache.newAppender(); try { for (String deletedComponentUuid : deletedComponentUuids) { List<DefaultIssue> issues = issuesLoader.loadForComponentUuid(deletedComponentUuid, false); for (DefaultIssue issue : issues) { issue.setBeingClosed(true); issue.setOnDisabledRule(false); issueLifecycle.doAutomaticTransition(issue); cacheAppender.append(issue); } } } finally { cacheAppender.close(); } }

Target:
private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) { DiskCache<DefaultIssue>.DiskAppender cacheAppender = issueCache.newAppender(); try { for (String deletedComponentUuid : deletedComponentUuids) { List<DefaultIssue> issues = issuesLoader.loadForComponentUuid(deletedComponentUuid); for (DefaultIssue issue : issues) { issue.setBeingClosed(true); issue.setOnDisabledRule(false); issueLifecycle.doAutomaticTransition(issue); cacheAppender.append(issue); } } } finally { cacheAppender.close(); } }
Source:
protected void configure() { bind(SnapshotDao.class).to(DummySnapshotDao.class); bind(MachineService.class); Multibinder<String> exposedPortsMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_exposed_ports")); Multibinder<String> volumesMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_volumes")); install(new FactoryModuleBuilder() .implement(Instance.class, DockerInstance.class) .implement(InstanceMetadata.class, DockerInstanceMetadata.class) .implement(InstanceProcess.class, DockerProcess.class) .implement(DockerNode.class, LocalDockerNode.class) .build(DockerMachineFactory.class)); Multibinder.newSetBinder(binder(), InstanceProvider.class).addBinding().to(DockerInstanceProvider.class); if (SystemInfo.isWindows()) { bind(String.class).annotatedWith(Names.named("host.projects.folder")).toProvider(HostProjectsFolderProviderWinOS.class); } else { bind(String.class).annotatedWith(Names.named("host.projects.folder")).toProvider(HostProjectsFolderProviderUnix.class); } }

Target:
protected void configure() { bind(SnapshotDao.class).to(DummySnapshotDao.class); bind(MachineService.class); Multibinder<String> exposedPortsMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_exposed_ports")); Multibinder<String> volumesMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_volumes")); install(new FactoryModuleBuilder() .implement(Instance.class, DockerInstance.class) .implement(InstanceMetadata.class, DockerInstanceMetadata.class) .implement(InstanceProcess.class, DockerProcess.class) .implement(DockerNode.class, LocalDockerNode.class) .build(DockerMachineFactory.class)); Multibinder.newSetBinder(binder(), InstanceProvider.class).addBinding().to(DockerInstanceProvider.class); if (SystemInfo.isWindows()) { bind(String.class).annotatedWith(Names.named("host.projects.root")) .toProvider(org.eclipse.che.plugin.docker.machine.ext.HostProjectsFolderProviderWinOS.class); } else { bind(String.class).annotatedWith(Names.named("host.projects.root")) .toProvider(org.eclipse.che.plugin.docker.machine.ext.HostProjectsFolderProviderWinOS.class); } }
Source:
public LocalizableString mockLocalizeableString(String value) { LocalizableString mock2 = mock(LocalizableString.class); when(mock2.getString(any(Locale.class))).thenReturn(value); return mock2; }

Target:
protected LocalizableString mockLocalizeableString(String value) { LocalizableString mock2 = mock(LocalizableString.class); when(mock2.getString(any(Locale.class))).thenReturn(value); return mock2; }
Source:
protected boolean connectLunDisks(Guid hostId) { if (getVm().getDiskMap().isEmpty()) { VmHandler.updateDisksFromDb(getVm()); } List<LunDisk> lunDisks = ImagesHandler.filterDiskBasedOnLuns(getVm().getDiskMap().values()); for (LunDisk lunDisk : lunDisks) { LUNs lun = lunDisk.getLun(); lun.setLunConnections(new ArrayList<storage_server_connections>(DbFacade.getInstance() .getStorageServerConnectionDAO() .getAllForLun(lun.getLUN_id()))); if (!lun.getLunConnections().isEmpty()) { if (!StorageHelperDirector.getInstance().getItem(lun.getLunConnections().get(0).getstorage_type()) .ConnectStorageToLunByVdsId(null, hostId, lun, getVm().getstorage_pool_id())) { log.infoFormat("Failed to connect a lun disk to vdsm {0} skiping it", hostId); return false; } } } return true; }

Target:
protected boolean connectLunDisks(Guid hostId) { if (getVm().getDiskMap().isEmpty()) { VmHandler.updateDisksFromDb(getVm()); } List<LunDisk> lunDisks = ImagesHandler.filterDiskBasedOnLuns(getVm().getDiskMap().values()); for (LunDisk lunDisk : lunDisks) { LUNs lun = lunDisk.getLun(); lun.setLunConnections(new ArrayList<storage_server_connections>(DbFacade.getInstance() .getStorageServerConnectionDAO() .getAllForLun(lun.getLUN_id()))); if (!lun.getLunConnections().isEmpty() && !StorageHelperDirector.getInstance().getItem(lun.getLunConnections().get(0).getstorage_type()) .ConnectStorageToLunByVdsId(null, hostId, lun, getVm().getstorage_pool_id())) { log.infoFormat("Failed to connect a lun disk to vdsm {0} skiping it", hostId); return false; } } return true; }
Source:
protected void uploadConsent(ConsentSignatureBody consentSignatureBody) { DataProvider.getInstance() .uploadConsent(getContext(), consentSignatureBody) .compose(ObservableUtils.applyDefault()) .subscribe(dataResponse -> { hideLoadingDialog(); if(dataResponse.isSuccess()) { super.onComplete(); } else { showOkAlertDialog(dataResponse.getMessage()); } }, throwable -> { hideLoadingDialog(); showOkAlertDialog(throwable.getMessage()); }); }

Target:
protected void uploadConsent(ConsentSignatureBody consentSignatureBody) { Observable<DataResponse> uploadConsent = DataProvider.getInstance() .uploadConsent(getContext(), consentSignatureBody) .compose(ObservableUtils.applyDefault()); StepLayoutHelper.safePerformWithAlerts(uploadConsent, this, response -> super.onComplete() ); }
Source:
public CheckpointManager(String ownerId, PartitionContext partitionContext, PartitionManager partitionManager, String eTag) { this.ownerId = ownerId; this.partitionContext = partitionContext; this.partitionManager = partitionManager; this.eTag = new AtomicReference<>(eTag); }

Target:
public CheckpointManager(String ownerId, PartitionContext partitionContext, PartitionManager partitionManager, String eTag) { this.ownerId = Objects.requireNonNull(ownerId, "ownerId cannot be null"); this.partitionContext = Objects.requireNonNull(partitionContext, "partitionContext cannot be null"); this.partitionManager = Objects.requireNonNull(partitionManager, "partitionManager cannot be null"); this.eTag = new AtomicReference<>(eTag); }
Source:
private DeribitAuthentication authOverClientSignature(String clientId, String clientSecret) throws DeribitException, IOException { if (clientId == null || clientId.isEmpty()) { throw new ExchangeException("API key must not be empty."); } if (clientSecret == null || clientSecret.isEmpty()) { throw new ExchangeException("API secret must not be empty."); } Mac mac; try { mac = Mac.getInstance(BaseParamsDigest.HMAC_SHA_256); final SecretKey secretKey = new SecretKeySpec(clientSecret.getBytes("UTF-8"), BaseParamsDigest.HMAC_SHA_256); mac.init(secretKey); } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw new ExchangeException("Invalid API secret", e); } String timestamp = "" + System.currentTimeMillis(); String nonce = timestamp; String data = ""; String toSign = timestamp + "\n" + nonce + "\n" + data; String signature = DigestUtils.bytesToHex(mac.doFinal(toSign.getBytes("UTF-8"))).toLowerCase(); return deribit .auth( GrantType.client_signature, null, null, clientId, null, null, timestamp, signature, nonce, null, null) .getResult(); }

Target:
private DeribitAuthentication authOverClientSignature(String clientId, String clientSecret) throws DeribitException, IOException { if (clientId == null || clientId.isEmpty()) { throw new ExchangeSecurityException("API key must not be empty."); } if (clientSecret == null || clientSecret.isEmpty()) { throw new ExchangeException("API secret must not be empty."); } Mac mac; try { mac = Mac.getInstance(BaseParamsDigest.HMAC_SHA_256); final SecretKey secretKey = new SecretKeySpec(clientSecret.getBytes("UTF-8"), BaseParamsDigest.HMAC_SHA_256); mac.init(secretKey); } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw new ExchangeException("Invalid API secret", e); } String timestamp = "" + System.currentTimeMillis(); String nonce = timestamp; String data = ""; String toSign = timestamp + "\n" + nonce + "\n" + data; String signature = DigestUtils.bytesToHex(mac.doFinal(toSign.getBytes("UTF-8"))).toLowerCase(); return deribit .auth( GrantType.client_signature, null, null, clientId, null, null, timestamp, signature, nonce, null, null) .getResult(); }
Source:
public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final byte[] content) throws IOException { final Response resp = this.origin .send(req, home, method, headers, content); final int remaining = Integer.parseInt( resp.headers().get("X-RateLimit-Remaining").get(0) ); if (remaining < this.threshold) { final long reset = Long.parseLong( resp.headers().get("X-RateLimit-Reset").get(0) ); final long now = System.currentTimeMillis() / 1000L; if (reset > now) { final long length = reset - now; Logger.info( this, "Remaining number of requests per hour is less than %d. Waiting for %d seconds.", this.threshold, length ); try { Thread.sleep(length * 1000L); } catch (final InterruptedException ex) { throw new IOException(ex); } } } return resp; }

Target:
public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final byte[] content) throws IOException { final Response resp = this.origin .send(req, home, method, headers, content); final int remaining = Integer.parseInt( resp.headers().get("X-RateLimit-Remaining").get(0) ); if (remaining < this.threshold) { final long reset = Long.parseLong( resp.headers().get("X-RateLimit-Reset").get(0) ); final long now = TimeUnit.MILLISECONDS .toSeconds(System.currentTimeMillis()); if (reset > now) { final long length = reset - now; Logger.info( this, "Remaining number of requests per hour is less than %d. Waiting for %d seconds.", this.threshold, length ); try { TimeUnit.SECONDS.sleep(length); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } } } return resp; }
Source:
public void accept(PubSubMessage pubSubMessage, Context context) { OcrTranslateApiMessage ocrMessage = OcrTranslateApiMessage.fromPubsubData( pubSubMessage.getData().getBytes()); String targetLang = ocrMessage.getLang(); LOGGER.info("Translating text into " + targetLang); String text = ocrMessage.getText(); TranslateTextRequest request = TranslateTextRequest.newBuilder() .setParent(LOCATION_NAME.toString()) .setMimeType("text/plain") .setTargetLanguageCode(targetLang) .addContents(text) .build(); TranslateTextResponse response; try (TranslationServiceClient client = TranslationServiceClient.create()) { response = client.translateText(request); } catch (IOException e) { throw new RuntimeException(e); } if (response == null || response.getTranslationsCount() == 0) { return; } String translatedText = response.getTranslations(0).getTranslatedText(); LOGGER.info("Translated text: " + translatedText); String filename = ocrMessage.getFilename(); OcrTranslateApiMessage translateMessage = new OcrTranslateApiMessage( translatedText, filename, targetLang); try { ByteString byteStr = ByteString.copyFrom(translateMessage.toPubsubData()); PubsubMessage pubsubApiMessage = PubsubMessage.newBuilder().setData(byteStr).build(); publisher.publish(pubsubApiMessage).get(); LOGGER.info("Text translated to " + targetLang); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }

Target:
public void accept(PubSubMessage pubSubMessage, Context context) { OcrTranslateApiMessage ocrMessage = OcrTranslateApiMessage.fromPubsubData( pubSubMessage.getData().getBytes(StandardCharsets.UTF_8)); String targetLang = ocrMessage.getLang(); LOGGER.info("Translating text into " + targetLang); String text = ocrMessage.getText(); TranslateTextRequest request = TranslateTextRequest.newBuilder() .setParent(LOCATION_NAME.toString()) .setMimeType("text/plain") .setTargetLanguageCode(targetLang) .addContents(text) .build(); TranslateTextResponse response; try (TranslationServiceClient client = TranslationServiceClient.create()) { response = client.translateText(request); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error translating text: " + e.getMessage(), e); return; } if (response.getTranslationsCount() == 0) { return; } String translatedText = response.getTranslations(0).getTranslatedText(); LOGGER.info("Translated text: " + translatedText); String filename = ocrMessage.getFilename(); OcrTranslateApiMessage translateMessage = new OcrTranslateApiMessage( translatedText, filename, targetLang); try { ByteString byteStr = ByteString.copyFrom(translateMessage.toPubsubData()); PubsubMessage pubsubApiMessage = PubsubMessage.newBuilder().setData(byteStr).build(); publisher.publish(pubsubApiMessage).get(); LOGGER.info("Text translated to " + targetLang); } catch (InterruptedException | ExecutionException e) { LOGGER.log(Level.SEVERE, "Error publishing translation save request: " + e.getMessage(), e); } }
Source:
public String handledTypeMismatchException() { try { throw new TypeMismatchException("Test", String.class); } catch (TypeMismatchException ex) { bugsnag.notify(ex); } return "The exception was handled"; }

Target:
public void handledTypeMismatchException() { try { throw new TypeMismatchException("Test", String.class); } catch (TypeMismatchException ex) { bugsnag.notify(ex); } }
Source:
public void clean(String name, byte[] pattern) { Assert.notNull(name, "Name must not be null!"); Assert.notNull(pattern, "Pattern must not be null!"); execute(name, connection -> { boolean wasLocked = false; try { if (isLockingCacheWriter()) { doLock(name, connection); wasLocked = true; } List<byte[]> keys = new ArrayList<byte[]>(); Cursor<byte[]> cursor = connection.scan(new ScanOptions.ScanOptionsBuilder().match(new String(pattern)).build()); while (cursor.hasNext()) { byte[] bytes = cursor.next(); keys.add(bytes); } if (!keys.isEmpty()) { connection.del(keys.toArray(new byte[][]{})); } } finally { if (wasLocked && isLockingCacheWriter()) { doUnlock(name, connection); } } return "OK"; }); }

Target:
public void clean(String name, byte[] pattern) { Assert.notNull(name, "Name must not be null!"); Assert.notNull(pattern, "Pattern must not be null!"); execute(name, connection -> { boolean wasLocked = false; try { if (isLockingCacheWriter()) { doLock(name, connection); wasLocked = true; } Cursor<byte[]> cursor = connection.scan(new ScanOptions.ScanOptionsBuilder().match(new String(pattern)).build()); while (cursor.hasNext()) { connection.del(cursor.next()); } } finally { if (wasLocked && isLockingCacheWriter()) { doUnlock(name, connection); } } return "OK"; }); }
Source:
public static void main(String[] args) { System.out.println(" +----------------------------------------------+"); System.out.println(" | XBee Java Library Get/Set Remote DIO Sample |"); System.out.println(" +----------------------------------------------+\n"); XBeeDevice localDevice = new XBeeDevice(PORT, BAUD_RATE); Timer readADCTimer = new Timer(); try { localDevice.open(); RemoteXBeeDevice remoteDevice = new RemoteXBeeDevice(localDevice, REMOTE_64_BIT_ADDRESS); remoteDevice.setIOConfiguration(IOLINE_IN, IOMode.DIGITAL_IN); localDevice.setIOConfiguration(IOLINE_OUT, IOMode.DIGITAL_OUT_LOW); readADCTimer.schedule(new UpdateOutputTask(localDevice, remoteDevice), 0, READ_TIMEOUT); } catch (XBeeException e) { e.printStackTrace(); localDevice.close(); System.exit(1); } }

Target:
public static void main(String[] args) { System.out.println(" +----------------------------------------------+"); System.out.println(" | XBee Java Library Get/Set Remote DIO Sample |"); System.out.println(" +----------------------------------------------+\n"); XBeeDevice localDevice = new XBeeDevice(PORT, BAUD_RATE); Timer readDIOTimer = new Timer(); try { localDevice.open(); RemoteXBeeDevice remoteDevice = new RemoteXBeeDevice(localDevice, REMOTE_64_BIT_ADDRESS); remoteDevice.setIOConfiguration(IOLINE_IN, IOMode.DIGITAL_IN); localDevice.setIOConfiguration(IOLINE_OUT, IOMode.DIGITAL_OUT_LOW); readDIOTimer.schedule(new UpdateOutputTask(localDevice, remoteDevice), 0, READ_TIMEOUT); } catch (XBeeException e) { e.printStackTrace(); localDevice.close(); System.exit(1); } }
Source:
private void deleteNode2RpcAddressFromNode1() throws Exception { InetSocketAddress firstHost = ccm().addressOfNode(1); Cluster cluster = register( Cluster.builder() .addContactPoints(firstHost.getAddress()) .withPort(ccm().getBinaryPort()) .withLoadBalancingPolicy( new WhiteListPolicy( Policies.defaultLoadBalancingPolicy(), Lists.newArrayList(firstHost))) .build()); Session session = cluster.connect(); String deleteStmt; if (ccm().getCassandraVersion().nextStable().compareTo(VersionNumber.parse("4.0")) < 0) { deleteStmt = String.format( "DELETE rpc_address FROM system.peers WHERE peer = '%s'", ccm().addressOfNode(2).getHostName()); } else { deleteStmt = String.format( "DELETE native_address, native_port FROM system.peers_v2 WHERE peer = '%s' and peer_port = %d", ccm().addressOfNode(2).getHostName(), ccm().getStoragePort()); } session.execute(deleteStmt); session.close(); cluster.close(); }

Target:
private void deleteNode2RpcAddressFromNode1() throws Exception { InetSocketAddress firstHost = ccm().addressOfNode(1); Cluster cluster = register( Cluster.builder() .addContactPoints(firstHost.getAddress()) .withPort(ccm().getBinaryPort()) .withLoadBalancingPolicy( new WhiteListPolicy( Policies.defaultLoadBalancingPolicy(), Lists.newArrayList(firstHost))) .build()); Session session = cluster.connect(); String deleteStmt = String.format( "DELETE rpc_address FROM system.peers WHERE peer = '%s'", ccm().addressOfNode(2).getHostName()); session.execute(deleteStmt); if (ccm().getCassandraVersion().nextStable().compareTo(VersionNumber.parse("4.0")) >= 0) { deleteStmt = String.format( "DELETE native_address, native_port FROM system.peers_v2 WHERE peer = '%s' and peer_port = %d", ccm().addressOfNode(2).getHostName(), ccm().getStoragePort()); session.execute(deleteStmt); } session.close(); cluster.close(); }
Source:
private void mergeCategories(Installation entity) { if (entity.getCategories() != null) { if(!entity.getCategories().isEmpty()) { final List<String> categoryNames = convertToNames(entity.getCategories()); final List<Category> categories = categoryDao.findByNames(categoryNames); entity.getCategories().removeAll(categories); entity.getCategories().addAll(categories); } else { entity.getCategories().clear(); } } }

Target:
private void mergeCategories(Installation entity) { if (entity.getCategories() != null) { final List<String> categoryNames = convertToNames(entity.getCategories()); final List<Category> categories = categoryDao.findByNames(categoryNames); entity.getCategories().removeAll(categories); entity.getCategories().addAll(categories); } }
Source:
private @Nullable HostThread getCurrentHostThread(ITmfEvent event, long ts) { String hostId = event.getTrace().getHostId(); LttngKernelAnalysis module = TmfExperimentUtils.getAnalysisModuleOfClassForHost(getTrace(), hostId, LttngKernelAnalysis.class); if (module == null) { return null; } Integer cpu = null; Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class); for (TmfCpuAspect aspect : aspects) { if (!aspect.resolve(event).equals(TmfCpuAspect.CPU_UNAVAILABLE)) { cpu = aspect.resolve(event); break; } } if (cpu == null) { return null; } int currentTid = module.getThreadOnCpu(cpu, ts); if (currentTid == LttngKernelAnalysis.NO_TID) { return null; } HostThread ht = new HostThread(hostId, currentTid); return ht; }

Target:
private @Nullable HostThread getCurrentHostThread(ITmfEvent event, long ts) { String hostId = event.getTrace().getHostId(); LttngKernelAnalysis module = TmfExperimentUtils.getAnalysisModuleOfClassForHost(getTrace(), hostId, LttngKernelAnalysis.class); if (module == null) { return null; } Integer cpu = null; Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class); for (TmfCpuAspect aspect : aspects) { if (!aspect.resolve(event).equals(TmfCpuAspect.CPU_UNAVAILABLE)) { cpu = aspect.resolve(event); break; } } if (cpu == null) { return null; } Integer currentTid = LttngKernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts); if (currentTid == null) { return null; } return new HostThread(hostId, currentTid); }
Source:
private void setLeaderMigrationState(MigratePartitionLeaderMessage message) { if (message.isStatusReset()) { m_leaderMigrationState.set(LeaderMigrationState.TXN_DRAINED); m_newLeaderHSID = Long.MIN_VALUE; return; } if (m_leaderMigrationState.get() == LeaderMigrationState.NONE) { m_leaderMigrationState.compareAndSet(LeaderMigrationState.NONE ,LeaderMigrationState.TXN_DRAINED); } else if (m_leaderMigrationState.get() == LeaderMigrationState.TXN_RESTART) { m_leaderMigrationState.compareAndSet(LeaderMigrationState.TXN_RESTART ,LeaderMigrationState.NONE); } tmLog.info("MigratePartitionLeader new leader " + CoreUtils.hsIdToString(m_hsId) + " is notified by previous leader " + CoreUtils.hsIdToString(message.getPriorLeaderHSID()) + ". status:" + m_leaderMigrationState); }

Target:
private void setLeaderMigrationState(MigratePartitionLeaderMessage message) { if (message.isStatusReset()) { m_leaderMigrationState.set(LeaderMigrationState.TXN_DRAINED); m_newLeaderHSID.set(Long.MIN_VALUE); return; } if (m_leaderMigrationState.get() == LeaderMigrationState.NONE) { m_leaderMigrationState.compareAndSet(LeaderMigrationState.NONE ,LeaderMigrationState.TXN_DRAINED); } else if (m_leaderMigrationState.get() == LeaderMigrationState.TXN_RESTART) { m_leaderMigrationState.compareAndSet(LeaderMigrationState.TXN_RESTART ,LeaderMigrationState.NONE); } tmLog.info("MigratePartitionLeader new leader " + CoreUtils.hsIdToString(m_hsId) + " is notified by previous leader " + CoreUtils.hsIdToString(message.getPriorLeaderHSID()) + ". status:" + m_leaderMigrationState); }
Source:
public boolean process() { checkState(!finished); finished = prerequisite.process(); if (!finished) { return false; } result = transform.apply(prerequisite.getResult()); return true; }

Target:
public boolean process() { checkState(!finished); finished = work.process(); if (!finished) { return false; } result = transformation.apply(work.getResult()); return true; }
Source:
public void parse(String location, IScriptLocation entry) { final IRepositoryService repositoryService = PlatformUI.getWorkbench().getService(IRepositoryService.class); final Map<String, String> scripts = fetchRemoteScripts(location, entry.isRecursive()); final Iterator<Map.Entry<String, String>> iterator = scripts.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, String> script = iterator.next(); final String scriptUrl = getRawContentUrl(location, script.getValue()); repositoryService.updateLocation(entry, scriptUrl, new Date().getTime()); } }

Target:
public void parse(String location, IScriptLocation entry) { final IRepositoryService repositoryService = PlatformUI.getWorkbench().getService(IRepositoryService.class); final Map<String, String> scripts = fetchRemoteScripts(location, entry.isRecursive()); for (final Map.Entry<String, String> script : scripts.entrySet()) { final String scriptUrl = getRawContentUrl(location, script.getValue()).replaceAll(" ", "%20"); repositoryService.updateLocation(entry, scriptUrl, new Date().getTime()); } }
Source:
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { if (request.getRequestURI().equals("/favicon.ico")) { String faviconPath = brandingManager.getBrandedFaviconPath(); if (faviconPath == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); } else { ServletUtils.sendFile(request, response, getFile(brandingManager.getBrandingRootPath(), faviconPath), null); } } else { ServletUtils.sendFile(request, response, getFile(brandingManager.getBrandingRootPath(), request.getPathInfo()), null); } }

Target:
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { ServletUtils.sendFile(request, response, BrandingUtils.getFile(brandingManager.getBrandingRootPath(), request.getPathInfo()), null); }
Source:
public void testTokens() throws Exception { String partitionPath = "666"; InputStream input = this.getClass().getClassLoader().getResourceAsStream(tokenFileName); if (input == null) { throw new IllegalStateException("Could not find resource: " + tokenFileName); } byte[] tokenBytes = new byte[2000]; int tokensLength = input.read(tokenBytes, 0, 2000); tokenBytes = Arrays.copyOf(tokenBytes, tokensLength); InputStream tokenStream = new ByteArrayInputStream(tokenBytes); azureDest.persistTokens(partitionPath, tokenFileName, tokenStream); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(tokensLength); assertTrue("Retrieve tokens returned false", azureDest.retrieveTokens(partitionPath, tokenFileName, outputStream)); assertTrue("Retrieved token did not match sent", Arrays.equals(outputStream.toByteArray(), tokenBytes)); outputStream.reset(); assertFalse("Expected retrive to return false for nonexistent path", azureDest.retrieveTokens("unknown-path", tokenFileName, outputStream)); }

Target:
public void testTokens() throws Exception { String partitionPath = "666"; InputStream input = this.getClass().getClassLoader().getResourceAsStream(tokenFileName); if (input == null) { throw new IllegalStateException("Could not find resource: " + tokenFileName); } byte[] tokenBytes = new byte[2000]; int tokensLength = input.read(tokenBytes, 0, 2000); tokenBytes = Arrays.copyOf(tokenBytes, tokensLength); InputStream tokenStream = new ByteArrayInputStream(tokenBytes); azureDest.persistTokens(partitionPath, tokenFileName, tokenStream); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(tokensLength); assertTrue("Retrieve tokens returned false", azureDest.retrieveTokens(partitionPath, tokenFileName, outputStream)); assertTrue("Retrieved token did not match sent", Arrays.equals(outputStream.toByteArray(), tokenBytes)); outputStream.reset(); assertFalse("Expected retrieve to return false for nonexistent path", azureDest.retrieveTokens("unknown-path", tokenFileName, outputStream)); }
Source:
public int hashCode() { return Objects.hash(getName(), getFieldName(), getEstimator(), isVariancePop); }

Target:
public int hashCode() { return Objects.hash(name, fieldName, estimator, isVariancePop); }
Source:
public void run() { try { while (running.get()) { try { if (paused.get()) { synchronized (lock) { while (paused.get()) { try { lock.wait(); } catch (InterruptedException e) { logger.warn("InterruptedException thrown while hard delete is paused ", e); } } } } synchronized (lock) { if (!hardDelete()) { isCaughtUp = true; if (!running.get()) { break; } time.wait(lock, hardDeleterSleepTimeWhenCaughtUpMs); } else if (isCaughtUp) { isCaughtUp = false; logger.info("Resumed hard deletes for after having caught up", dataDir); } lock.notify(); } } catch (StoreException e) { if (e.getErrorCode() != StoreErrorCodes.Store_Shutting_Down) { logger.error("Caught store exception: ", e); } else { logger.trace("Caught exception during hard deletes", e); } } catch (InterruptedException e) { logger.trace("Caught exception during hard deletes", e); } } } finally { close(); } }

Target:
public void run() { try { while (enabled.get()) { hardDeleteLock.lock(); try { while (enabled.get() && isPaused()) { pauseCondition.await(); } if (enabled.get()) { if (!hardDelete()) { isCaughtUp = true; time.await(pauseCondition, HARD_DELETE_SLEEP_TIME_ON_CAUGHT_UP); } else if (isCaughtUp) { isCaughtUp = false; logger.info("Resumed hard deletes for after having caught up", dataDir); } } } catch (StoreException e) { if (e.getErrorCode() != StoreErrorCodes.Store_Shutting_Down) { logger.error("Caught store exception: ", e); } else { logger.trace("Caught exception during hard deletes", e); } } catch (InterruptedException e) { logger.trace("Caught exception during hard deletes", e); } finally { hardDeleteLock.unlock(); } } } finally { close(); } }