auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized StorageDomain getStorageDomainById(String id) { StorageDomain storageDomain = null; if (storageDomainMap.containsKey(id)) { return storageDomainMap.get(id); } try { storageDomain = loadObject(StorageDomain.class, id) != null ? (StorageDomain) loadObject(StorageDomain.class, id) : recoverStorageDomain(id); log.info("storageDomain restored from file, id: {}", id); } catch (RuntimeException e) { log.error("failed to fetch storageDomain by id, rewrite caches for DC {}", id); } finally { log.info("about to store storage domian object id {}", id, storageDomain); storageDomainMap.put(id, storageDomain); } return storageDomain; }

Target:
public synchronized StorageDomain getStorageDomainById(String id) { StorageDomain storageDomain = null; if (storageDomainMap.containsKey(id)) { return storageDomainMap.get(id); } storageDomain = (StorageDomain) loadObject(StorageDomain.class, id); if (storageDomain == null) { storageDomain = recoverStorageDomain(id); } return storageDomain; }
Source:
public static void load() { if (!LOCALES.isEmpty() || localeIDs != null) { LOCALES.clear(); localeIDs = null; currentLocale = null; Utils.gc(false); } final Pattern fileExt = Pattern.compile("(.+).(lang)$"); currentLocale = FALLBACK; try (JarFile opsu = Utils.getJarFile()) { Enumeration<JarEntry> entries = opsu.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String entryName = entry.getName(); if (fileExt.matcher(entryName).matches()) addLocale(new I18n(entryName)); } } catch (NullPointerException e) { for (File langFile : findRecursively(Utils.getRunningDirectory(), fileExt)) try { addLocale(new I18n(langFile)); } catch (Exception e2) { Log.error("Could not load translation: " + langFile.getName(), e2); } } catch (IOException e) { Log.error("Could not find resources for translation", e); } localeIDs = new String[LOCALES.size()]; for (int a = 0; a < localeIDs.length; a++) localeIDs[a] = LOCALES.get(a).toString(); }

Target:
public static void load() { LOCALES.clear(); localeIDs = null; currentLocale = FALLBACK; try (JarFile opsu = Utils.getJarFile()) { Enumeration<JarEntry> entries = opsu.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String entryName = entry.getName(); if (entryName.endsWith(LANG_FILE_EXT)) addLocale(new I18n(entryName)); } } catch (NullPointerException e) { for (File langFile : findLanguagesRecursively(Utils.getWorkingDirectory())) try { addLocale(new I18n(langFile)); } catch (Exception e2) { Log.error("Could not load translation: " + langFile.getName(), e2); } } catch (IOException e) { Log.error("Could not find resources for translation", e); } }
Source:
public PhoneHomeParameterCreator createParameters() { PhoneHomeParameterCreator parameterCreator = new PhoneHomeParameterCreator(); List<MetricsCollector> metricsCollectorList = new ArrayList<>(); metricsCollectorList.add(new BuildInfoCollector()); metricsCollectorList.add(new ClusterInfoCollector()); metricsCollectorList.add(new ClientInfoCollector()); metricsCollectorList.add(new MapInfoCollector()); metricsCollectorList.add(new OSInfoCollector()); metricsCollectorList.forEach((metricsCollector -> parameterCreator. addMap(metricsCollector.computeMetrics(hazelcastNode)))); return parameterCreator; }

Target:
public PhoneHomeParameterCreator createParameters() { PhoneHomeParameterCreator parameterCreator = new PhoneHomeParameterCreator(); metricsCollectorList.forEach((metricsCollector -> parameterCreator. addMap(metricsCollector.computeMetrics(hazelcastNode)))); return parameterCreator; }
Source:
public String toString() { return "NetatmoBindingConfig [userid=" + this.userid + ", deviceId=" + this.deviceId + ", moduleId=" + this.moduleId + ", measure=" + (this.measureType != null ? this.measureType.getMeasure() : null) + ", homeId=" + this.homeId + ", personId=" + this.personId + ", cameraId=" + this.cameraId + ", attribute=" + this.attribute + "]"; }

Target:
public String toString() { String sReturn = "NetatmoBindingConfig"; if (bWeather) { sReturn += " weather=true [userid=" + this.userid + ", deviceId=" + this.deviceId + ", moduleId=" + this.moduleId + ", measure=" + (this.measureType != null ? this.measureType.getMeasure() : null) + "]"; } if (bCamera) { sReturn += " camera=true [homeId=" + this.homeId + ", personId=" + this.personId + ", cameraId=" + this.cameraId + ", attribute=" + this.attribute + "]"; } return sReturn; }
Source:
public boolean generateLaborLedgerBenefitClearingPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper) { LOG.debug("started generateLaborLedgerBenefitClearingPendingEntries()"); String chartOfAccountsCode = SpringContext.getBean(ParameterService.class).getParameterValueAsString(SalaryExpenseTransferDocument.class, LaborParameterConstants.BENEFIT_CLEARING_CHART); String accountNumber = SpringContext.getBean(ParameterService.class).getParameterValueAsString(SalaryExpenseTransferDocument.class, LaborParameterConstants.BENEFIT_CLEARING_CHART); List<LaborLedgerPendingEntry> benefitClearingPendingEntries = CuLaborPendingEntryGenerator.generateBenefitClearingPendingEntries(this, sequenceHelper, accountNumber, chartOfAccountsCode); if (benefitClearingPendingEntries != null && !benefitClearingPendingEntries.isEmpty()) { return this.getLaborLedgerPendingEntries().addAll(benefitClearingPendingEntries); } return true; }

Target:
public boolean generateLaborLedgerBenefitClearingPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper) { LOG.debug("started generateLaborLedgerBenefitClearingPendingEntries()"); String chartOfAccountsCode = SpringContext.getBean(ParameterService.class).getParameterValueAsString(SalaryExpenseTransferDocument.class, LaborParameterConstants.BENEFIT_CLEARING_CHART); String accountNumber = SpringContext.getBean(ParameterService.class).getParameterValueAsString(SalaryExpenseTransferDocument.class, LaborParameterConstants.BENEFIT_CLEARING_ACCOUNT); List<LaborLedgerPendingEntry> benefitClearingPendingEntries = CuLaborPendingEntryGenerator.generateBenefitClearingPendingEntries(this, sequenceHelper, accountNumber, chartOfAccountsCode); if (benefitClearingPendingEntries != null && !benefitClearingPendingEntries.isEmpty()) { return this.getLaborLedgerPendingEntries().addAll(benefitClearingPendingEntries); } return true; }
Source:
void compact(CompactionDetails details) throws IOException, StoreException { checkStarted(); compactor.compact(details); checkCapacityAndUpdateWriteStatusDelegate(log.getCapacityInBytes(), index.getLogUsedCapacity()); logger.trace("One cycle of compaction is completed on the store: " + storeId); }

Target:
void compact(CompactionDetails details) throws IOException, StoreException { checkStarted(); compactor.compact(details); checkCapacityAndUpdateWriteStatusDelegate(log.getCapacityInBytes(), index.getLogUsedCapacity()); logger.trace("One cycle of compaction is completed on the store {}", storeId); }
Source:
public Long migrate(final HaWorkVO work) { long vmId = work.getInstanceId(); long srcHostId = work.getHostId(); VMInstanceVO vm = _instanceDao.findById(vmId); if (vm == null) { return null; } s_logger.info("Migration attempt: for VM " + vm.getUuid() + "from host id " + srcHostId + ". Retry count: " + work.getTimesTried() + "/" + _maxRetries + " times."); try { work.setStep(Step.Migrating); _haDao.update(work.getId(), work); _itMgr.migrateAway(vm.getUuid(), srcHostId); return null; } catch (InsufficientServerCapacityException e) { s_logger.warn("Migration attempt: Insufficient capacity for migrating a VM " + vm.getUuid() + " from source host id " + srcHostId + ". Exception: " + e.getMessage()); _resourceMgr.maintenanceFailed(srcHostId); return (System.currentTimeMillis() >> 10) + _migrateRetryInterval; } catch (Exception e) { s_logger.warn("Migration attempt: Unexpected exception occurred when attempting migration of " + vm.getUuid() + e.getMessage()); throw e; } }

Target:
public Long migrate(final HaWorkVO work) { long vmId = work.getInstanceId(); long srcHostId = work.getHostId(); VMInstanceVO vm = _instanceDao.findById(vmId); if (vm == null) { s_logger.info("Unable to find vm: " + vmId + ", skipping migrate."); return null; } s_logger.info("Migration attempt: for VM " + vm.getUuid() + "from host id " + srcHostId + ". Starting attempt: " + (1 + work.getTimesTried()) + "/" + _maxRetries + " times."); try { work.setStep(Step.Migrating); _haDao.update(work.getId(), work); _itMgr.migrateAway(vm.getUuid(), srcHostId); return null; } catch (InsufficientServerCapacityException e) { s_logger.warn("Migration attempt: Insufficient capacity for migrating a VM " + vm.getUuid() + " from source host id " + srcHostId + ". Exception: " + e.getMessage()); _resourceMgr.migrateAwayFailed(srcHostId, vmId); return (System.currentTimeMillis() >> 10) + _migrateRetryInterval; } catch (Exception e) { s_logger.warn("Migration attempt: Unexpected exception occurred when attempting migration of " + vm.getUuid() + e.getMessage()); throw e; } }
Source:
public void testConfigWrite() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, "origin"); remoteConfig.addURI( new URIish("<LINK_0>android")); remoteConfig.addFetchRefSpec( new RefSpec("+refs/heads }, output); PubSubConfig config = SubscribeDaemon.getConfig(); assertEquals(1, config.getPublishers().size()); Publisher pub = config.getPublisher("<LINK_0>"); assertTrue(pub != null); assertEquals( new URIish("<LINK_0>"), pub.getUri()); assertEquals(1, pub.getSubscribers().size()); Subscriber sub = pub.getSubscribers().iterator().next(); assertEquals("android", sub.getName()); assertEquals("origin", sub.getRemote()); assertEquals(1, sub.getSubscribeSpecs().size()); RefSpec spec = sub.getSubscribeSpecs().get(0); assertEquals("refs/heads/*", spec.getSource()); }

Target:
public void testConfigWrite() throws Exception { setupURIFetchConfig(); String[] output = execute("git subscribe origin"); assertArrayEquals("expected successful subscribe", new String[] { MessageFormat.format( CLIText.get().didSubscribe, "origin", "<LINK_0>"), "" }, output); PubSubConfig config = SubscribeDaemon.getConfig(); assertEquals(1, config.getPublishers().size()); Publisher pub = config.getPublisher("<LINK_0>"); assertTrue(pub != null); assertEquals( new URIish("<LINK_0>"), pub.getUri()); assertEquals(1, pub.getSubscribers().size()); Subscriber sub = pub.getSubscribers().iterator().next(); assertEquals("android", sub.getName()); assertEquals("origin", sub.getRemote()); assertEquals(1, sub.getSubscribeSpecs().size()); RefSpec spec = sub.getSubscribeSpecs().get(0); assertEquals("refs/heads/*", spec.getSource()); }
Source:
public void testDefault() throws Exception { final String[] expected = { "42:40: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), "71:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), }; verify(checkConfig, getPath("InputWhitespaceAfterSimple.java"), expected); }

Target:
public void testDefault() throws Exception { final String[] expected = { "42:40: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), "71:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), }; verify(checkConfig, getPath("InputWhitespaceAfterDefaultConfig.java"), expected); }
Source:
public void publish(LogRecord record) { Iterator<ExtensionProxy> iter = getExtensions().iterator(); while (iter.hasNext()) { ExtensionProxy extension = iter.next(); extension.invoke(new ExtMap() .mput(Base.InvokeKeys.COMMAND, Logger.InvokeCommands.PUBLISH) .mput(Logger.InvokeKeys.LOG_RECORD, record)); } }

Target:
public void publish(LogRecord record) { initRefreshThread(); for (ExtensionProxy extension : getExtensions()) { extension.invoke(new ExtMap() .mput(Base.InvokeKeys.COMMAND, Logger.InvokeCommands.PUBLISH) .mput(Logger.InvokeKeys.LOG_RECORD, record)); } }
Source:
public void checkHoveringFeature() { editor.moveCursorToText("Greeter"); editor.waitTextInHoverPopUpEqualsTo( "class Greeter", "Known permanent failure: i<LINK_0>"); }

Target:
public void checkHoveringFeature() { editor.moveCursorToText("Greeter"); try { editor.waitHoverPopupAppearance(); } catch (TimeoutException ex) { fail("Known permanent failure <LINK_0>"); } }
Source:
protected void remoteGetBeforeWrite(InvocationContext ctx, WriteCommand command, RecipientGenerator keygen) throws Throwable { if ((isNeedReliableReturnValues(command) || command.isConditional()) && !command.isIgnorePreviousValue()) { for (Object k : keygen.getKeys()) { if (!ctx.isInTxScope() && !cdl.localNodeIsPrimaryOwner(k)) { continue; } Object returnValue = remoteGetBeforeWrite(ctx, command, k); if (returnValue == null && cdl.localNodeIsPrimaryOwner(k)) { localGetCacheEntry(ctx, k, true, command); } } } }

Target:
protected void remoteGetBeforeWrite(InvocationContext ctx, WriteCommand command, RecipientGenerator keygen) throws Throwable { if ((isNeedReliableReturnValues(command) || command.isConditional()) && !command.isIgnorePreviousValue()) { for (Object k : keygen.getKeys()) { if (cdl.localNodeIsPrimaryOwner(k)) { localGetCacheEntry(ctx, k, true, command); } } } }
Source:
void createTableDuplicateName() { String tableName = testResourceNamer.randomName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); createTable(tableName); String requestId = testResourceNamer.randomUuid(); StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) .verify(); }

Target:
void createTableDuplicateName() { String tableName = testResourceNamer.randomName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); createTable(tableName); String requestId = testResourceNamer.randomUuid(); StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) .expectError(TableServiceErrorException.class) .verify(); }
Source:
public void testGetRootsWithGenerics() throws IOException { final GenericsMatchInputData mockModel = new GenericsMatchInputData(); final Resource leftResource = mockModel.getLeft(); final Resource rightResource = mockModel.getRight(); assertNotNull(leftResource); assertNotNull(rightResource); final Iterator<EObject> leftContent = EcoreUtil.getAllProperContents(leftResource, false); final Iterator<EObject> rightContent = EcoreUtil.getAllProperContents(leftResource, false); final Iterator<EObject> originContent = EcoreUtil.getAllProperContents(leftResource, false); while (leftContent.hasNext() && rightContent.hasNext() && originContent.hasNext()) { final EObject left = leftContent.next(); final EObject right = rightContent.next(); final EObject origin = originContent.next(); final IComparisonScope eObjectScope = new DefaultComparisonScope(left, right, origin); assertSame(left, eObjectScope.getLeft()); assertSame(right, eObjectScope.getRight()); assertSame(origin, eObjectScope.getOrigin()); } final IComparisonScope resourceScope = new DefaultComparisonScope(leftResource, rightResource, null); assertSame(leftResource, resourceScope.getLeft()); assertSame(rightResource, resourceScope.getRight()); final ResourceSet leftRS = newResourceSet(leftResource); final ResourceSet rightRS = newResourceSet(rightResource); final IComparisonScope resourceSetScope = new DefaultComparisonScope(leftRS, rightRS, null); assertSame(leftRS, resourceSetScope.getLeft()); assertSame(rightRS, resourceSetScope.getRight()); }

Target:
public void testGetRootsWithGenerics() throws IOException { final GenericsMatchInputData mockModel = new GenericsMatchInputData(); final Resource leftResource = mockModel.getLeft(); final Resource rightResource = mockModel.getRight(); assertNotNull(leftResource); assertNotNull(rightResource); final Iterator<EObject> leftContent = EcoreUtil.getAllProperContents(leftResource, false); final Iterator<EObject> rightContent = EcoreUtil.getAllProperContents(rightResource, false); while (leftContent.hasNext() && rightContent.hasNext()) { final EObject left = leftContent.next(); final EObject right = rightContent.next(); final IComparisonScope eObjectScope = new DefaultComparisonScope(left, right, null); assertSame(left, eObjectScope.getLeft()); assertSame(right, eObjectScope.getRight()); } final IComparisonScope resourceScope = new DefaultComparisonScope(leftResource, rightResource, null); assertSame(leftResource, resourceScope.getLeft()); assertSame(rightResource, resourceScope.getRight()); final ResourceSet leftRS = newResourceSet(leftResource); final ResourceSet rightRS = newResourceSet(rightResource); final IComparisonScope resourceSetScope = new DefaultComparisonScope(leftRS, rightRS, null); assertSame(leftRS, resourceSetScope.getLeft()); assertSame(rightRS, resourceSetScope.getRight()); }
Source:
public ByteBuffer getPoolableBuffer(ByteBuffer buffer) { ByteBuffer result = buffer; Class clazz = buffer.getClass(); try { Method method = clazz.getMethod("attachment"); method.setAccessible(true); Object attachment = method.invoke(buffer); if (attachment instanceof ByteBuffer) { result = (ByteBuffer) attachment; } else if (attachment != null) { throw new InternalGemFireException( "direct byte buffer attachment was not a byte buffer but a " + attachment.getClass().getName()); } } catch (Exception e) { throw new InternalGemFireException("unable to retrieve underlying byte buffer", e); } return result; }

Target:
public ByteBuffer getPoolableBuffer(ByteBuffer buffer) { ByteBuffer result = buffer; if (parentOfSliceMethod == null) { Class clazz = buffer.getClass(); try { Method method = clazz.getMethod("attachment"); method.setAccessible(true); parentOfSliceMethod = method; } catch (Exception e) { throw new InternalGemFireException("unable to retrieve underlying byte buffer", e); } } try { Object attachment = parentOfSliceMethod.invoke(buffer); if (attachment instanceof ByteBuffer) { result = (ByteBuffer) attachment; } else if (attachment != null) { throw new InternalGemFireException( "direct byte buffer attachment was not a byte buffer but a " + attachment.getClass().getName()); } } catch (Exception e) { throw new InternalGemFireException("unable to retrieve underlying byte buffer", e); } return result; }
Source:
public DefaultRequirementsCollector(Configuration configuration) { this.collectors = ImmutableList.of( new RequirementsFromAnnotationCollector(configuration), new CommandRequirementsCollector(configuration)); }

Target:
public DefaultRequirementsCollector(Configuration configuration) { this.collectors = ImmutableList.of( new RequirementsFromAnnotationCollector(configuration), new CommandRequirementsFromConfigurationCollector(configuration)); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("RassXmlDocumentWrapper: [ extractDate:").append(extractDate); if (CollectionUtils.isNotEmpty(awards)) { for (RassXmlAgencyEntry agency : agencies) { sb.append(KFSConstants.SQUARE_BRACKET_LEFT).append(awards.toString()).append(KFSConstants.SQUARE_BRACKET_RIGHT); } } else { sb.append(KFSConstants.SQUARE_BRACKET_LEFT).append("NO AWAWRDS").append(KFSConstants.SQUARE_BRACKET_RIGHT); } if (CollectionUtils.isNotEmpty(agencies)) { for (RassXmlAgencyEntry agency : agencies) { sb.append(KFSConstants.SQUARE_BRACKET_LEFT).append(agency.toString()).append(KFSConstants.SQUARE_BRACKET_RIGHT); } } else { sb.append(KFSConstants.SQUARE_BRACKET_LEFT).append("NO AGENCIES").append(KFSConstants.SQUARE_BRACKET_RIGHT); } sb.append(KFSConstants.SQUARE_BRACKET_RIGHT); return sb.toString(); }

Target:
public String toString() { return ToStringBuilder.reflectionToString(this); }
Source:
public void afterSuite() { driver.quit(); }

Target:
public void afterSuite() { loginPage.CloseWindow(); }
Source:
public void shouldFailWithoutClientJaasEntry() throws Exception { final Cluster cluster = TestClientFactory.build().protocol(kdcServer.serverPrincipalName) .addContactPoint(kdcServer.hostname).create(); final Client client = cluster.connect(); try { client.submit("1+1").all().get(); fail("This should not succeed as the client config does not contain a JaasEntry"); } catch(Exception ex) { final Throwable root = ExceptionUtils.getRootCause(ex); assertTrue(root instanceof TimeoutException); } finally { cluster.close(); } }

Target:
public void shouldFailWithoutClientJaasEntry() throws Exception { final Cluster cluster = TestClientFactory.build().protocol(kdcServer.serverPrincipalName) .addContactPoint(kdcServer.hostname).create(); final Client client = cluster.connect(); try { client.submit("1+1").all().get(); fail("This should not succeed as the client config does not contain a JaasEntry"); } catch(Exception ex) { final Throwable root = ExceptionUtils.getRootCause(ex); assertTrue(root instanceof ResponseException || root instanceof NoHostAvailableException); } finally { cluster.close(); } }
Source:
public void resourceOffers(SchedulerDriver schedulerDriver, List<Offer> offers) { offers.forEach(offer -> { final String offerId = offer.getId().getValue(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Received offerId={}: {}", offerId, flattenProtobufString(offer.toString())); } final OfferStrategy.OfferResult result = offerStrategy.evaluate(clusterState, offer); if (result.acceptable()) { LOGGER.info("Accepting offer offerId={}", offerId); TaskInfo taskInfo = taskInfoBuilder.buildTask(offer); schedulerDriver.launchTasks( singletonList(offer.getId()), singletonList(taskInfo)); clusterState.addTask(taskInfo); } else { LOGGER.info("Declined offer: " + flattenProtobufString(offer.toString()) + "\n complaints: " + result.complaints.stream().collect(Collectors.joining("; "))); schedulerDriver.declineOffer(offer.getId()); } }); }

Target:
public void resourceOffers(SchedulerDriver schedulerDriver, List<Offer> offers) { offers.forEach(offer -> { final String offerId = offer.getId().getValue(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Received offerId={}: {}", offerId, flattenProtobufString(offer.toString())); } final OfferStrategy.OfferResult result = offerStrategy.evaluate(clusterState, offer); if (result.acceptable()) { LOGGER.info("Accepting offer offerId={}", offerId); TaskInfo taskInfo = taskInfoBuilder.buildTask(offer); schedulerDriver.launchTasks( singletonList(offer.getId()), singletonList(taskInfo)); clusterState.addTask(taskInfo); } else { LOGGER.debug("Declined offer offerId={} because: " + result.complaints.stream().collect(Collectors.joining("; "))); schedulerDriver.declineOffer(offer.getId()); } }); }
Source:
private void processServerError(ReplicaId replica, ServerErrorCode serverErrorCode) { if (replica != null && serverErrorCode != null) { switch (serverErrorCode) { case No_Error: logger.trace("The delete request was successful."); operationTracker.onResponse(replica, true); break; case Blob_Deleted: logger.trace("Blob has already been deleted."); operationTracker.onResponse(replica, true); break; case Blob_Not_Found: resolveRouterError(RouterErrorCode.BlobDoesNotExist); operationTracker.onResponse(replica, false); break; case Blob_Expired: updateOperationStatus(replica, RouterErrorCode.BlobExpired); break; case Disk_Unavailable: updateOperationStatus(replica, RouterErrorCode.AmbryUnavailable); break; case IO_Error: updateOperationStatus(replica, RouterErrorCode.UnexpectedInternalError); break; case Partition_Unknown: updateOperationStatus(replica, RouterErrorCode.BlobDoesNotExist); break; case Partition_ReadOnly: updateOperationStatus(replica, RouterErrorCode.UnexpectedInternalError); break; default: logger.trace("Server returned an error: ", serverErrorCode); updateOperationStatus(replica, RouterErrorCode.UnexpectedInternalError); break; } } else { logger.error("Both Replica and ServerErrorCode cannot be null to handle."); updateOperationStatus(replica, RouterErrorCode.UnexpectedInternalError); } }

Target:
private void processServerError(ReplicaId replica, ServerErrorCode serverErrorCode) { switch (serverErrorCode) { case No_Error: logger.trace("The delete request was successful."); operationTracker.onResponse(replica, true); break; case Blob_Deleted: logger.trace("Blob has already been deleted."); operationTracker.onResponse(replica, true); break; case Blob_Expired: updateOperationState(replica, RouterErrorCode.BlobExpired); break; case Blob_Not_Found: case Partition_Unknown: updateOperationState(replica, RouterErrorCode.BlobDoesNotExist); break; case Disk_Unavailable: updateOperationState(replica, RouterErrorCode.AmbryUnavailable); break; default: logger.trace("Server returned an error: ", serverErrorCode); updateOperationState(replica, RouterErrorCode.UnexpectedInternalError); break; } }
Source:
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String path = req.getRestOfPath(); if (path.charAt(0)=='/') path = path.substring(1); if(!allowedResources.containsKey(path)) { if(!allowResourceToBeServed(path)) { rsp.sendError(SC_FORBIDDEN); return; } allowedResources.putIfAbsent(path,path); } URL res = classLoader.getResource(path); if(res==null) { throw HttpResponses.error(SC_NOT_FOUND,new IllegalArgumentException("No such adjunct found: "+path)); } else { long expires = MetaClass.NO_CACHE ? 0 : expiration; rsp.serveFile(req,res,expires); } }

Target:
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String path = req.getRestOfPath(); if (path.charAt(0)=='/') path = path.substring(1); if(!allowedResources.contains(path)) { if(!allowResourceToBeServed(path)) { rsp.sendError(SC_FORBIDDEN); return; } allowedResources.add(path); } URL res = classLoader.getResource(path); if(res==null) { throw HttpResponses.error(SC_NOT_FOUND,new IllegalArgumentException("No such adjunct found: "+path)); } else { long expires = MetaClass.NO_CACHE ? 0 : expiration; rsp.serveFile(req,res,expires); } }
Source:
public Boolean evaluate(final EObject source, final IParameterValueList2 parameterValues, final IFacetManager facetManager, final DerivedTypedElement feature) throws DerivedTypedElementException { boolean result = false; if (parameterValues.size() == 0) { throw new DerivedTypedElementException( "parameterValues must not be empty"); } final Object paramValue = parameterValues.get(0).getValue(); if (paramValue instanceof EStructuralFeature) { final EStructuralFeature eStructFeature = (EStructuralFeature) paramValue; result = !eStructFeature.isDerived(); } else if (paramValue == null) { result = true; } else { final String message = String .format("Unexpected parameter type (%s instead of EStructuralFeature)", paramValue.getClass().getName()); throw new DerivedTypedElementException(message); } if (result) { try { result &= facetManager.getSuperValueOf(feature, source, parameterValues, Boolean.class).booleanValue(); } catch (FacetManagerException e) { throw new DerivedTypedElementException(e); } catch (SuperInvokeException e) { throw new DerivedTypedElementException(e); } } return Boolean.valueOf(result); }

Target:
public Boolean evaluate(final EObject source, final IParameterValueList2 parameterValues, final IFacetManager facetManager, final DerivedTypedElement feature) throws DerivedTypedElementException { boolean result = false; if (parameterValues.size() == 0) { throw new DerivedTypedElementException( "parameterValues must not be empty"); } final Object paramValue = parameterValues.get(0).getValue(); if (paramValue instanceof EStructuralFeature) { final EStructuralFeature eStructFeature = (EStructuralFeature) paramValue; result = !eStructFeature.isDerived(); } else if (paramValue == null) { result = true; } else { final String message = String .format("Unexpected parameter type (%s instead of EStructuralFeature)", paramValue.getClass().getName()); throw new DerivedTypedElementException(message); } if (result) { try { result = result && facetManager.getSuperValueOf(feature, source, parameterValues, Boolean.class).booleanValue(); } catch (Exception e) { throw new DerivedTypedElementException(e); } } return Boolean.valueOf(result); }
Source:
public RowExpression rewriteSpecialForm(SpecialFormExpression node, Boolean isRoot, RowExpressionTreeRewriter<Boolean> treeRewriter) { if (BooleanType.BOOLEAN.equals(node.getType()) && isConjunctiveDisjunctive(node.getForm())) { return rewriteBooleanExpression(node, isRoot); } if (isRoot) { return treeRewriter.rewrite(node, false); } return null; }

Target:
public RowExpression rewriteSpecialForm(SpecialFormExpression node, Boolean isRoot, RowExpressionTreeRewriter<Boolean> treeRewriter) { if (isConjunctiveDisjunctive(node.getForm())) { checkState(BooleanType.BOOLEAN.equals(node.getType()), "AND/OR must be boolean function"); return rewriteBooleanExpression(node, isRoot); } if (isRoot) { return treeRewriter.rewrite(node, false); } return null; }
Source:
public void addListToArguments(String variablesToAdd, String flag) { if (variablesToAdd == null) { return; } String[] splittedVariabledToAdd = variablesToAdd.split(","); addListToArguments(new ArrayList<String>(Arrays.asList(splittedVariabledToAdd)), flag); }

Target:
public void addListToArguments(String variablesToAdd, String flag) { if (variablesToAdd == null) { return; } String[] splittedVariablesToAdd = variablesToAdd.split(","); addListToArguments(new ArrayList<String>(Arrays.asList(splittedVariablesToAdd)), flag); }
Source:
public void startElement(TagNode node) { if ((isImgTag(node) && !node.hasProperty("ALT")) || ((isImageInput(node) || isAreaTag(node)) && (!node.hasProperty("ALT") || StringUtils.trim(node.getPropertyValue("ALT")).isEmpty()))) { createViolation(node.getStartLinePosition(), "Add an \"alt\" attribute to this image."); } }

Target:
public void startElement(TagNode node) { if ((isImgTag(node) && !hasAltAttribute(node)) || ((isImageInput(node) || isAreaTag(node)) && hasInvalidAltAttribute(node))) { createViolation(node.getStartLinePosition(), "Add an \"alt\" attribute to this image."); } }
Source:
public Plan(TableFilter[] filters, int count, Expression condition) { this.filters = new TableFilter[count]; System.arraycopy(filters, 0, this.filters, 0, count); final ArrayList<Expression> allCond = new ArrayList<>(count/2); final ArrayList<TableFilter> all = new ArrayList<>(count); if (condition != null) { allCond.add(condition); } for (int i = 0; i < count; i++) { TableFilter f = filters[i]; f.visit(new TableFilterVisitor() { @Override public void accept(TableFilter f) { all.add(f); if (f.getJoinCondition() != null) { allCond.add(f.getJoinCondition()); } } }); } allConditions = allCond.toArray(new Expression[0]); allFilters = all.toArray(new TableFilter[0]); }

Target:
public Plan(TableFilter[] filters, int count, Expression condition) { this.filters = new TableFilter[count]; System.arraycopy(filters, 0, this.filters, 0, count); final ArrayList<Expression> allCond = new ArrayList<>(); final ArrayList<TableFilter> all = new ArrayList<>(); if (condition != null) { allCond.add(condition); } for (int i = 0; i < count; i++) { TableFilter f = filters[i]; f.visit(new TableFilterVisitor() { @Override public void accept(TableFilter f) { all.add(f); if (f.getJoinCondition() != null) { allCond.add(f.getJoinCondition()); } } }); } allConditions = allCond.toArray(new Expression[0]); allFilters = all.toArray(new TableFilter[0]); }
Source:
public void whenLightStatsOnNotInitializedSubscriptionThenCorrectResponse() throws IOException { final String et = createEventType().getName(); final Subscription s = createSubscriptionForEventType(et); final Response response = when().get("/subscriptions?show_status=true").thenReturn(); final ItemsWrapper<Subscription> subsItems = MAPPER.readValue(response.print(), new TypeReference<ItemsWrapper<Subscription>>(){}); for (final Subscription subscription: subsItems.getItems()) { if (subscription.getId().equals(s.getId())) { Assert.assertNotNull(subscription.getStats()); Assert.assertEquals("unassigned", subscription.getStats().get(0).getPartitions().get(0).getState()); Assert.assertEquals("", subscription.getStats().get(0).getPartitions().get(0).getStreamId()); return; } } Assert.assertTrue(false); }

Target:
public void whenLightStatsOnNotInitializedSubscriptionThenCorrectResponse() throws IOException { final String et = createEventType().getName(); final Subscription s = createSubscriptionForEventType(et); final String owningApplication = s.getOwningApplication(); final Response response = when() .get("/subscriptions?show_status=true&owning_application=" + owningApplication) .thenReturn(); final ItemsWrapper<Subscription> subsItems = MAPPER.readValue(response.print(), new TypeReference<ItemsWrapper<Subscription>>(){}); for (final Subscription subscription: subsItems.getItems()) { if (subscription.getId().equals(s.getId())) { Assert.assertNotNull(subscription.getStatus()); Assert.assertEquals("unassigned", subscription.getStatus().get(0).getPartitions().get(0).getState()); Assert.assertEquals("", subscription.getStatus().get(0).getPartitions().get(0).getStreamId()); return; } } Assert.assertTrue(false); }
Source:
public void noMessageSentWhenSecondConflictWithinConflictInterval() { mockExistingActivity(gamblingGoal, nowInAmsterdam()); Set<String> conflictCategories = new HashSet<>(Arrays.asList("lotto")); service.analyze(userAnonId, new NetworkActivityDto(conflictCategories, "http://localhost/test1", Optional.empty())); ArgumentCaptor<MessageDestination> messageDestination = ArgumentCaptor.forClass(MessageDestination.class); verify(mockMessageService, never()).sendMessage(any(), messageDestination.capture()); }

Target:
public void noMessageSentWhenSecondConflictWithinConflictInterval() { mockExistingActivity(gamblingGoal, nowInAmsterdam()); Set<String> conflictCategories = new HashSet<>(Arrays.asList("lotto")); service.analyze(userAnonId, new NetworkActivityDto(conflictCategories, "http://localhost/test1", Optional.empty())); verifyNoMessagesCreated(); }
Source:
public void testFinishInitializeWhenFromCatroidThenRemoveSaveNavigationItems() { when(model.isOpenedFromCatroid()).thenReturn(true); presenter.removeMoreOptionsItems(menu); verify(topBarViewHolder).removeItem(R.id.pocketpaint_nav_save_image); verify(topBarViewHolder).removeItem(R.id.pocketpaint_nav_save_duplicate); }

Target:
public void testFinishInitializeWhenFromCatroidThenRemoveSaveNavigationItems() { when(model.isOpenedFromCatroid()).thenReturn(true); presenter.removeMoreOptionsItems(menu); verify(topBarViewHolder).removeStandaloneMenuItems(menu); }
Source:
public DomainCommandBuilder addHostControllerJavaOption(final String arg) { if (arg != null) { hostControllerJavaOpts.add(arg); } return this; }

Target:
public DomainCommandBuilder addHostControllerJavaOption(final String arg) { if (arg != null && !arg.trim().isEmpty()) { final Argument argument = Arguments.parse(arg); if (argument.getKey().equals(DOMAIN_BASE_DIR)) { if (argument.getValue() != null) { setBaseDirectory(argument.getValue()); } } else if (argument.getKey().equals(DOMAIN_CONFIG_DIR)) { if (argument.getValue() != null) { setConfigurationDirectory(argument.getValue()); } } else if (argument.getKey().equals(DOMAIN_LOG_DIR)) { if (argument.getValue() != null) { setLogDirectory(argument.getValue()); } } else { hostControllerJavaOpts.add(argument); } } return this; }
Source:
long caretProc (long clientData) { caretId = 0; if (currentCaret == null) { return 0; } if (currentCaret.blinkCaret()) { int blinkRate = currentCaret.blinkRate; if (blinkRate == 0) return 0; currentCaret.getParent().setBlink(true); caretId = OS.g_timeout_add (blinkRate, caretProc, 0); } else { currentCaret = null; } return 0; }

Target:
long caretProc (long clientData) { caretId = 0; if (currentCaret == null) { return 0; } if (currentCaret.blinkCaret()) { int blinkRate = currentCaret.blinkRate; if (blinkRate == 0) return 0; currentCaret.getParent().blink = true; caretId = OS.g_timeout_add (blinkRate, caretProc, 0); } else { currentCaret = null; } return 0; }
Source:
private boolean isFeedbackPathParticipantAnInstructor(String participant) { int instructorParticipantTypeIndex = getInstructorParticipantTypeIndex(participant); return FEEDBACK_PARTICIPANT_TYPE_INSTRUCTOR.equals( participant.substring(instructorParticipantTypeIndex)); }

Target:
private boolean isFeedbackPathParticipantAnInstructor(String participant) { return participant.endsWith(FEEDBACK_PARTICIPANT_TYPE_INSTRUCTOR); }
Source:
public void writeBytes(byte[] data, int off, int len) throws IOException { user.writeBytes(data, off, len); }

Target:
public void writeBytes(byte[] data, int off, int len) throws IOException { currentWriter.writeBytes(data, off, len); }
Source:
protected void init() { super.init(); casper.setEthereum(ethereum); if (Boolean.TRUE.equals(((CasperProperties) config).getCasperValidatorEnabled())) { casperValidatorService.start(); } }

Target:
protected void init() { super.init(); casper.setEthereum(ethereum); casperValidatorService.init(); }
Source:
public static <E> PCollection<E> partition(PCollection<E> collection, View<E> view, int numWriters, int numPartitionWriters) { int writers = Math.max(numPartitionWriters, numWriters); DatasetDescriptor descriptor = view.getDataset().getDescriptor(); if (descriptor.isPartitioned()) { GetStorageKey<E> getKey = new GetStorageKey<E>(view, numPartitionWriters > 0 ? numPartitionWriters : 1); PTable<Pair<GenericData.Record, Integer>, E> table = collection .by(getKey, Avros.pairs(Avros.generics(getKey.schema()), Avros.ints())); PGroupedTable<Pair<GenericData.Record, Integer>, E> grouped = writers > 0 ? table.groupByKey(writers) : table.groupByKey(); return grouped.ungroup().values(); } else { return partition(collection, numWriters); } }

Target:
public static <E> PCollection<E> partition(PCollection<E> collection, View<E> view, int numWriters, int numPartitionWriters) { DatasetDescriptor descriptor = view.getDataset().getDescriptor(); if (descriptor.isPartitioned()) { GetStorageKey<E> getKey = new GetStorageKey<E>(view, numPartitionWriters > 0 ? numPartitionWriters : 1); PTable<Pair<GenericData.Record, Integer>, E> table = collection .by(getKey, Avros.pairs(Avros.generics(getKey.schema()), Avros.ints())); PGroupedTable<Pair<GenericData.Record, Integer>, E> grouped = numWriters > 0 ? table.groupByKey(numWriters) : table.groupByKey(); return grouped.ungroup().values(); } else { return partition(collection, numWriters); } }
Source:
private static void dataTableHeaderMayOnlyContainVariableNames(ASTNode stat) throws InvalidSpecCompileException { throw new InvalidSpecCompileException(stat, "Header of data table may only contain variable names"); }

Target:
private static InvalidSpecCompileException dataTableHeaderMayOnlyContainVariableNames(ASTNode stat) { return new InvalidSpecCompileException(stat, "Header of data table may only contain variable names"); }
Source:
protected void contextualizeTooltip() { if (this.selectedDifferences.size() > 1) { setMultipleTooltip(this.selectedMode); } else if (this.selectedDifferences.isEmpty()) { initToolTipAndImage(this.selectedMode); } else { Diff diff = this.selectedDifferences.get(0); Adapter tooltipAdapter = EcoreUtil.getAdapter(diff.eAdapters(), ITooltipLabelProvider.class); if (tooltipAdapter == null) { tooltipAdapter = adapterFactory.adapt(diff, ITooltipLabelProvider.class); } if (tooltipAdapter instanceof ITooltipLabelProvider) { String tooltip = ((ITooltipLabelProvider)tooltipAdapter).getTooltip(this.selectedMode); setToolTipText(tooltip); } else { initToolTipAndImage(this.selectedMode); } } }

Target:
protected void contextualizeTooltip() { if (this.selectedDifferences.size() > 1) { setMultipleTooltip(this.selectedMode); } else if (this.selectedDifferences.isEmpty()) { initToolTipAndImage(this.selectedMode); } else { Diff diff = this.selectedDifferences.get(0); Object adapter = adapterFactory.adapt(diff, ITooltipLabelProvider.class); if (adapter instanceof ITooltipLabelProvider) { String tooltip = ((ITooltipLabelProvider)adapter).getTooltip(this.selectedMode); setToolTipText(tooltip); } else { initToolTipAndImage(this.selectedMode); } } }
Source:
private Page processPageSource() { while (!finishing && !currentOutput.hasNext() && pageSource.isBlocked().isDone()) { Page page = pageSource.getNextPage(); finishing = pageSource.isFinished(); pageSourceMemoryContext.setBytes(pageSource.getSystemMemoryUsage()); if (page != null) { long endCompletedBytes = pageSource.getCompletedBytes(); long endReadTimeNanos = pageSource.getReadTimeNanos(); operatorContext.recordGeneratedInput(endCompletedBytes - completedBytes, page.getPositionCount(), endReadTimeNanos - readTimeNanos); completedBytes = endCompletedBytes; readTimeNanos = endReadTimeNanos; PageProcessorOutput output = pageProcessor.process(operatorContext.getSession().toConnectorSession(), page); currentOutput.accept(output); } if (finishing) { currentOutput.flush(); } pageBuilderMemoryContext.setBytes(currentOutput.getRetainedSizeInBytes()); if (page == null) { break; } } Page result = null; if (currentOutput.hasNext()) { result = currentOutput.next(); pageBuilderMemoryContext.setBytes(currentOutput.getRetainedSizeInBytes()); } return result; }

Target:
private Page processPageSource() { DriverYieldSignal yieldSignal = operatorContext.getDriverContext().getYieldSignal(); if (!finishing && mergingOutput.needsInput() && !yieldSignal.isSet()) { Page page = pageSource.getNextPage(); finishing = pageSource.isFinished(); pageSourceMemoryContext.setBytes(pageSource.getSystemMemoryUsage()); if (page != null) { long endCompletedBytes = pageSource.getCompletedBytes(); long endReadTimeNanos = pageSource.getReadTimeNanos(); operatorContext.recordGeneratedInput(endCompletedBytes - completedBytes, page.getPositionCount(), endReadTimeNanos - readTimeNanos); completedBytes = endCompletedBytes; readTimeNanos = endReadTimeNanos; PageProcessorOutput output = pageProcessor.process(operatorContext.getSession().toConnectorSession(), yieldSignal, page); mergingOutput.addInput(output); } if (finishing) { mergingOutput.finish(); } } Page result = mergingOutput.getOutput(); pageBuilderMemoryContext.setBytes(mergingOutput.getRetainedSizeInBytes()); return result; }
Source:
private void notifyNeighbors() { getWorld().notifyBlockOfStateChange(getPos(), RailcraftBlocks.getBlockTrack()); getWorld().notifyBlockOfStateChange(getPos().down(), RailcraftBlocks.getBlockTrack()); sendUpdateToClient(); }

Target:
private void notifyNeighbors() { getWorld().notifyNeighborsOfStateChange(getPos(), RailcraftBlocks.getBlockTrack()); getWorld().notifyNeighborsOfStateChange(getPos().down(), RailcraftBlocks.getBlockTrack()); sendUpdateToClient(); }
Source:
private void afterResponseSent(CacheRpcCommand command, Response resp) { if (command instanceof TotalOrderCommitCommand || command instanceof TotalOrderVersionedCommitCommand || command instanceof TotalOrderRollbackCommand || (command instanceof TotalOrderPrepareCommand && (((PrepareCommand) command).isOnePhaseCommit() || resp instanceof ExceptionResponse))) { totalOrderExecutorService.checkForReadyTasks(); remoteCommandsExecutor.checkForReadyTasks(); } }

Target:
private void afterResponseSent(CacheRpcCommand command, Response resp) { if (command instanceof TotalOrderCommitCommand || command instanceof TotalOrderVersionedCommitCommand || command instanceof TotalOrderRollbackCommand || (command instanceof TotalOrderPrepareCommand && (((PrepareCommand) command).isOnePhaseCommit() || resp instanceof ExceptionResponse))) { totalOrderExecutorService.checkForReadyTasks(); } }
Source:
public <M, R> R toRest(M modelObject, Projection projection) { M transformedModel = projection.transformModel(modelObject); DSpaceConverter<M, R> converter = requireConverter(modelObject.getClass()); R restObject = converter.convert(transformedModel, projection); if (restObject instanceof BaseObjectRest) { if (!dSpacePermissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), restObject, "READ")) { log.info("Access denied on " + restObject.getClass()); return null; } } if (restObject instanceof RestModel) { return (R) projection.transformRest((RestModel) restObject); } return restObject; }

Target:
public <M, R> R toRest(M modelObject, Projection projection) { M transformedModel = projection.transformModel(modelObject); DSpaceConverter<M, R> converter = requireConverter(modelObject.getClass()); R restObject = converter.convert(transformedModel, projection); if (restObject instanceof BaseObjectRest) { if (!dSpacePermissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), restObject, "READ")) { log.debug("Access denied on " + restObject.getClass() + " with id: " + ((BaseObjectRest) restObject).getId()); return null; } } if (restObject instanceof RestModel) { return (R) projection.transformRest((RestModel) restObject); } return restObject; }
Source:
public void initialize(final String endPointId) { this.localEndPointId = endPointId; this.evalPrefix = endPointId.split("-")[0]; LOG.log(Level.INFO, "Initialize router with localEndPointId: {0}", localEndPointId); for (int partitionId = 0; partitionId < numPartitions; partitionId++) { final int initialEvalId = partitionId % numInitialEvals; partitionIdToEvalId[partitionId] = initialEvalId; } }

Target:
public void initialize(final String endPointId) { this.localEndPointId = endPointId; this.evalPrefix = endPointId.split("-")[0]; LOG.log(Level.INFO, "Initialize router with localEndPointId: {0}", localEndPointId); for (int partitionId = 0; partitionId < numPartitions; partitionId++) { final int evalId = partitionId % numInitialEvals; partitionIdToEvalId[partitionId] = evalId; } }
Source:
private void logServerWarnings(List<String> warnings) { if (!Boolean.getBoolean(RequestHandler.DISABLE_QUERY_WARNING_LOGS)) { StringBuilder warningString = new StringBuilder(); for (String warning : warnings) { warningString.append(warning).append(", "); } final String queryString = statement.toString(); logger.warn( "Query '{}' generated server side warning(s): {}", queryString.subSequence(0, Math.min(queryString.length(), MAX_QUERY_LOG_LENGTH)), warningString.substring(0, warningString.length() - ", ".length())); } }

Target:
private void logServerWarnings(List<String> warnings) { final String queryString = QUERY_LOGGER.statementAsString(statement); for (String warning : warnings) { logger.warn("Query '{}' generated server side warning(s): {}", queryString, warning); } }
Source:
public Map<String, String> getMetaDataQualifiedNames() { return metaDataQualifiedNames; }

Target:
public Map<String, String> getMetaDataQualifiedNames() { return Collections.unmodifiableMap(metaDataQualifiedNames); }
Source:
public final void removeGraph(final String graphName) { graphs.remove(graphName); }

Target:
public final Graph removeGraph(final String graphName) throws Exception { Graph graph = graphs.remove(graphName); graph.close(); return graph; }
Source:
protected abstract Password engineGeneratePassword(String algorithm, KeySpec keySpec) throws InvalidKeySpecException; protected abstract <S extends KeySpec> S engineGetKeySpec(String algorithm, Password password, Class<S> keySpecType) throws InvalidKeySpecException; protected abstract boolean engineIsTranslatablePassword(final String algorithm, final Password password); protected abstract Password engineTranslatePassword(String algorithm, Password password) throws InvalidKeyException; protected abstract boolean engineVerify(String algorithm, Password password, final char[] guess) throws InvalidKeyException; protected boolean engineVerify(String algorithm, Password password, final char[] guess, Charset hashCharset) throws InvalidKeyException { throw new InvalidKeyException(); }

Target:
protected abstract Password engineGeneratePassword(String algorithm, KeySpec keySpec) throws InvalidKeySpecException; protected abstract <S extends KeySpec> S engineGetKeySpec(String algorithm, Password password, Class<S> keySpecType) throws InvalidKeySpecException; protected abstract boolean engineIsTranslatablePassword(final String algorithm, final Password password); protected abstract Password engineTranslatePassword(String algorithm, Password password) throws InvalidKeyException; protected abstract boolean engineVerify(String algorithm, Password password, final char[] guess) throws InvalidKeyException; protected boolean engineVerify(String algorithm, Password password, final char[] guess, Charset hashCharset) throws InvalidKeyException{ throw new UnsupportedOperationException(); }