auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Order cloneForRevisionHelper(Order target) { if (getAction() == Action.DISCONTINUE) { target.setAction(Action.DISCONTINUE); target.setPreviousOrder(getPreviousOrder()); target.setDateActivated(getDateActivated()); } else { target.setAction(Action.REVISE); target.setPreviousOrder(this); target.setAutoExpireDate(getAutoExpireDate()); } target.setCareSetting(getCareSetting()); target.setConcept(getConcept()); target.setPatient(getPatient()); target.setOrderType(getOrderType()); target.setScheduledDate(getScheduledDate()); target.setInstructions(getInstructions()); target.setUrgency(getUrgency()); target.setCommentToFulfiller(getCommentToFulfiller()); target.setOrderReason(getOrderReason()); target.setOrderReasonNonCoded(getOrderReasonNonCoded()); target.setOrderReasonNonCoded(getOrderReasonNonCoded()); target.setOrderGroup(getOrderGroup()); target.setSortWeight(getSortWeight()); target.setFulfillerStatus(getFulfillerStatus()); target.setFulfillerComment(getFulfillerComment()); return target; }

Target:
protected Order cloneForRevisionHelper(Order target) { if (getAction() == Action.DISCONTINUE) { target.setAction(Action.DISCONTINUE); target.setPreviousOrder(getPreviousOrder()); target.setDateActivated(getDateActivated()); } else { target.setAction(Action.REVISE); target.setPreviousOrder(this); target.setAutoExpireDate(getAutoExpireDate()); } target.setCareSetting(getCareSetting()); target.setConcept(getConcept()); target.setPatient(getPatient()); target.setOrderType(getOrderType()); target.setScheduledDate(getScheduledDate()); target.setInstructions(getInstructions()); target.setUrgency(getUrgency()); target.setCommentToFulfiller(getCommentToFulfiller()); target.setOrderReason(getOrderReason()); target.setOrderReasonNonCoded(getOrderReasonNonCoded()); target.setOrderGroup(getOrderGroup()); target.setSortWeight(getSortWeight()); target.setFulfillerStatus(getFulfillerStatus()); target.setFulfillerComment(getFulfillerComment()); return target; }
Source:
private void pollDataFromKafka() { if (eventConsumer == null) { TracingService.logErrorInSpan(getContext().getCurrentSpan(), "Illegal state: kafkaConsumer should not be null when calling pollDataFromKafka method"); throw new IllegalStateException("kafkaConsumer should not be null when calling pollDataFromKafka method"); } if (!isConnectionReady()) { shutdownGracefully("Hila connection closed via crutch"); return; } if (isSubscriptionConsumptionBlocked()) { final String message = "Consumption is blocked"; sendMetadata(message); shutdownGracefully(message); return; } if (eventConsumer.getAssignment().isEmpty() || pollPaused) { scheduleTask(this::pollDataFromKafka, getKafkaPollTimeout(), TimeUnit.MILLISECONDS); return; } final List<ConsumedEvent> events = eventConsumer.readEvents(); events.forEach(this::rememberEvent); if (!events.isEmpty()) { addTask(this::streamToOutput); } addTask(this::pollDataFromKafka); }

Target:
private void pollDataFromKafka() { if (eventConsumer == null) { throw new IllegalStateException("kafkaConsumer should not be null when calling pollDataFromKafka method"); } if (!isConnectionReady()) { shutdownGracefully("Hila connection closed via crutch"); return; } if (isSubscriptionConsumptionBlocked()) { final String message = "Consumption is blocked"; sendMetadata(message); shutdownGracefully(message); return; } if (eventConsumer.getAssignment().isEmpty() || pollPaused) { scheduleTask(this::pollDataFromKafka, getKafkaPollTimeout(), TimeUnit.MILLISECONDS); return; } final List<ConsumedEvent> events = eventConsumer.readEvents(); events.forEach(this::rememberEvent); if (!events.isEmpty()) { addTask(this::streamToOutput); } addTask(this::pollDataFromKafka); }
Source:
public List getExtensions() { return ImmutableList.of( PropertyDefinition.builder(XmlPlugin.FILE_SUFFIXES_KEY) .name("File suffixes") .description("Comma-separated list of suffixes for files to analyze.") .defaultValue(".xml") .category("XML") .onQualifiers(Qualifiers.PROJECT) .build(), Xml.class, XmlRulesDefinition.class, XmlSonarWayProfile.class, XmlSensor.class, LineCounter.class, XmlCodeColorizerFormat.class); }

Target:
public List getExtensions() { return ImmutableList.of( PropertyDefinition.builder(XmlPlugin.FILE_SUFFIXES_KEY) .name("File suffixes") .description("Comma-separated list of suffixes for files to analyze.") .defaultValue(".xml") .category("XML") .onQualifiers(Qualifiers.PROJECT) .build(), Xml.class, XmlRulesDefinition.class, XmlSonarWayProfile.class, XmlSensor.class); }
Source:
public boolean hasNext() { if (queue == null) { advance(); } return !(queue == null); }

Target:
public boolean hasNext() { if (queue == null) { advance(); } return queue != null; }
Source:
public <T extends Document> DocumentSearchResponse<T> search(final Query query, final Integer start, final Integer size, final Class<T> documentClass) { return search(query, start, size, documentClass, null); }

Target:
public <T extends Document> DocumentSearchResponse<T> search(final Query query, final Integer start, final Integer size, final Class<T> documentClass) { return search(query, start, size, documentClass, SortOrder.DEFAULT); }
Source:
public JsonRpcResult getComputedStyleForNode(JsonRpcPeer peer, JSONObject params) { final GetComputedStyleForNodeRequest request = mObjectMapper.convertValue( params, GetComputedStyleForNodeRequest.class); final GetComputedStyleForNodeResult result = new GetComputedStyleForNodeResult(); result.computedStyle = new ArrayList<>(); mDocument.postAndWait(new Runnable() { @Override public void run() { mDocument.getElementStyles( mDocument.getElementForNodeId(request.nodeId), new StyleAccumulator() { @Override public void store(String name, String value, boolean isDefault) { if (!isDefault) { CSSComputedStyleProperty property = new CSSComputedStyleProperty(); property.name = name; property.value = value; result.computedStyle.add(property); } } }); } }); return result; }

Target:
public JsonRpcResult getComputedStyleForNode(JsonRpcPeer peer, JSONObject params) { final GetComputedStyleForNodeRequest request = mObjectMapper.convertValue( params, GetComputedStyleForNodeRequest.class); final GetComputedStyleForNodeResult result = new GetComputedStyleForNodeResult(); result.computedStyle = new ArrayList<>(); mDocument.postAndWait(new Runnable() { @Override public void run() { Object element = mDocument.getElementForNodeId(request.nodeId); if (element == null) { LogUtil.e("Tried to get the style of an element that does not exist, using nodeid=" + request.nodeId); return; } mDocument.getElementStyles( element, new StyleAccumulator() { @Override public void store(String name, String value, boolean isDefault) { if (!isDefault) { CSSComputedStyleProperty property = new CSSComputedStyleProperty(); property.name = name; property.value = value; result.computedStyle.add(property); } } }); } }); return result; }
Source:
public static ServiceAccountJwtAccessCredentials fromPkcs8( String clientId, String clientEmail, String privateKeyPkcs8, String privateKeyId, URI defaultAudience, String quotaProjectId) throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(privateKeyPkcs8); return new ServiceAccountJwtAccessCredentials( clientId, clientEmail, privateKey, privateKeyId, defaultAudience, quotaProjectId); }

Target:
static ServiceAccountJwtAccessCredentials fromPkcs8( String clientId, String clientEmail, String privateKeyPkcs8, String privateKeyId, URI defaultAudience, String quotaProjectId) throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(privateKeyPkcs8); return new ServiceAccountJwtAccessCredentials( clientId, clientEmail, privateKey, privateKeyId, defaultAudience, quotaProjectId); }
Source:
@Override public SingleEnvironment bindSingle(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { if(workspace==null) return new SingleEnvironment(""); FileCredentials credentials = getCredentials(build); FilePath secrets = secretsDir(workspace); String dirName = UUID.randomUUID().toString(); final FilePath dir = secrets.child(dirName); dir.mkdirs(); secrets.chmod( 448); FilePath secret = dir.child(credentials.getFileName()); copy(secret, credentials); if (secret.isDirectory()) { secret.chmod(0700); } else { secret.chmod(0400); } return new SingleEnvironment(secret.getRemote(), new UnbinderImpl(dirName)); }

Target:
@Override public SingleEnvironment bindSingle(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { FileCredentials credentials = getCredentials(build); FilePath secrets = secretsDir(workspace); String dirName = UUID.randomUUID().toString(); final FilePath dir = secrets.child(dirName); dir.mkdirs(); secrets.chmod( 448); FilePath secret = dir.child(credentials.getFileName()); copy(secret, credentials); if (secret.isDirectory()) { secret.chmod(0700); } else { secret.chmod(0400); } return new SingleEnvironment(secret.getRemote(), new UnbinderImpl(dirName)); }
Source:
public void testCreateDecoratedTwoRequestsToGetEquallyDecoratedSamePoolUseSameLock() { DecoratedMacPoolFactory factory = new DecoratedMacPoolFactory(lockedObjectFactorySpy); MacPool decoratedPool1 = factory.createDecoratedPool(poolId, macPool, singletonList(macPoolDecoratorA)); MacPool decoratedPool2 = factory.createDecoratedPool(poolId, macPool, singletonList(macPoolDecoratorA)); assertThat(decoratedPool1, is(macPoolDecoratorA)); assertThat(decoratedPool2, is(macPoolDecoratorA)); verify(lockedObjectFactorySpy, times(2)).createLockingInstance(eq(macPool), eq(MacPool.class), any()); }

Target:
public void testCreateDecoratedTwoRequestsToGetEquallyDecoratedSamePoolUseSameLock() { multipleDecoratorsUsesSameLock(macPoolDecoratorA, macPoolDecoratorA); }
Source:
public void testDefaultOptions() { Map<String, String> options = getAllOptions(); CanalJsonDeserializationSchema expectedDeser = CanalJsonDeserializationSchema .builder(ROW_TYPE, InternalTypeInfo.of(ROW_TYPE)) .setIgnoreParseErrors(false) .setTimestampFormat(TimestampFormat.SQL) .build(); DeserializationSchema<RowData> actualDeser = createDeserializationSchema(options); assertEquals(expectedDeser, actualDeser); CanalJsonSerializationSchema expectedSer = new CanalJsonSerializationSchema( ROW_TYPE, TimestampFormat.SQL); SerializationSchema<RowData> actualSer = createSerializationSchema(options); assertEquals(expectedSer, actualSer); }

Target:
public void testDefaultOptions() { Map<String, String> options = getAllOptions(); CanalJsonDeserializationSchema expectedDeser = CanalJsonDeserializationSchema .builder(ROW_TYPE, ROW_TYPE_INFO) .setIgnoreParseErrors(false) .setTimestampFormat(TimestampFormat.SQL) .build(); DeserializationSchema<RowData> actualDeser = createDeserializationSchema(options); assertEquals(expectedDeser, actualDeser); CanalJsonSerializationSchema expectedSer = new CanalJsonSerializationSchema( ROW_TYPE, TimestampFormat.SQL); SerializationSchema<RowData> actualSer = createSerializationSchema(options); assertEquals(expectedSer, actualSer); }
Source:
protected String getStackTraceString(Throwable throwable) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { throwable.printStackTrace(pw); return sw.toString().trim(); } finally { try { pw.close(); sw.close(); } catch (IOException e) { } } }

Target:
protected String getStackTraceString(Throwable throwable) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { throwable.printStackTrace(pw); return sw.toString().trim(); } finally { pw.close(); } }
Source:
public K keyToStorage(Object key) { return (K) wrapper.wrapKey(encoder.keyToStorage(key)); }

Target:
public K keyToStorage(Object key) { return (K) keyWrapper.wrap(keyEncoder.toStorage(key)); }
Source:
public boolean equals(Object obj) { if (obj instanceof WindowAggNode) { WindowAggNode other = (WindowAggNode) obj; boolean eq = super.equals(other); eq = eq && TUtil.checkEquals(partitionKeys, other.partitionKeys); eq = eq && TUtil.checkEquals(windowFuncs, other.windowFuncs); eq = eq && TUtil.checkEquals(targets, other.targets); return eq; } else { return false; } }

Target:
public boolean equals(Object obj) { if (obj instanceof WindowAggNode) { WindowAggNode other = (WindowAggNode) obj; boolean eq = super.equals(other); eq = eq && TUtil.checkEquals(partitionKeys, other.partitionKeys); eq = eq && TUtil.checkEquals(sortSpecs, other.sortSpecs); eq = eq && TUtil.checkEquals(windowFuncs, other.windowFuncs); eq = eq && TUtil.checkEquals(targets, other.targets); eq = eq && TUtil.checkEquals(hasDistinct, other.hasDistinct); return eq; } else { return false; } }
Source:
public void testNetworks() throws Exception { requireDockerApiVersionAtLeast("1.21", "createNetwork and listNetworks"); assumeFalse(CIRCLECI); final String networkName = randomName(); final IpamConfig ipamConfig = IpamConfig.create("192.168.0.0/24", "192.168.0.0/24", "192.168.0.1"); final Ipam ipam = Ipam.builder() .config(singletonList(ipamConfig)) .build(); final NetworkConfig networkConfig = NetworkConfig.builder().name(networkName).driver("bridge").checkDuplicate(true).ipam(ipam) .internal(false).enableIPv6(false) .build(); final NetworkCreation networkCreation = sut.createNetwork(networkConfig); assertThat(networkCreation.id(), is(notNullValue())); assertThat(networkCreation.warnings(), is(nullValue())); final List<Network> networks = sut.listNetworks(); assertTrue(networks.size() > 0); Network network = null; for (final Network n : networks) { if (n.name().equals(networkName)) { network = n; } } assertThat(network, is(notNullValue())); assertThat(network.id(), is(notNullValue())); assertThat(sut.inspectNetwork(network.id()).name(), is(networkName)); assertThat(network.ipam(), equalTo(ipam)); if (dockerApiVersionAtLeast("1.23")) { assertThat(network.internal(), is(false)); assertThat(network.enableIPv6(), is(false)); } sut.removeNetwork(network.id()); exception.expect(NetworkNotFoundException.class); sut.inspectNetwork(network.id()); }

Target:
public void testNetworks() throws Exception { requireDockerApiVersionAtLeast("1.21", "createNetwork and listNetworks"); assumeFalse(CIRCLECI); final String networkName = randomName(); final IpamConfig ipamConfig = IpamConfig.create("192.168.0.0/24", "192.168.0.0/24", "192.168.0.1"); final Ipam ipam = Ipam.builder() .driver("default") .config(singletonList(ipamConfig)) .build(); final NetworkConfig networkConfig = NetworkConfig.builder().name(networkName).driver("bridge").checkDuplicate(true).ipam(ipam) .internal(false).enableIPv6(false) .build(); final NetworkCreation networkCreation = sut.createNetwork(networkConfig); assertThat(networkCreation.id(), is(notNullValue())); assertThat(networkCreation.warnings(), is(nullValue())); final List<Network> networks = sut.listNetworks(); assertTrue(networks.size() > 0); Network network = null; for (final Network n : networks) { if (n.name().equals(networkName)) { network = n; } } assertThat(network, is(notNullValue())); assertThat(network.id(), is(notNullValue())); assertThat(sut.inspectNetwork(network.id()).name(), is(networkName)); assertThat(network.ipam(), equalTo(ipam)); if (dockerApiVersionAtLeast("1.23")) { assertThat(network.internal(), is(false)); assertThat(network.enableIPv6(), is(false)); } sut.removeNetwork(network.id()); exception.expect(NetworkNotFoundException.class); sut.inspectNetwork(network.id()); }
Source:
public void testBatch() throws Exception { doTestBatch(basicConf()); }

Target:
public void testBatch() throws Exception { doTestBatch(batchConf()); }
Source:
protected static String truncateValueToMaxLength(String inputValue, int maxLength) { if (StringUtils.length(inputValue) <= maxLength) { return inputValue; } else { return inputValue.substring(0, maxLength); } }

Target:
protected String truncateValueToMaxLength(String inputValue, int maxLength) { return StringUtils.substring(inputValue, 0, maxLength); }
Source:
public DocumentModel run(DocumentModel document) { if (!rule.hasFacet(RetentionConstants.RETENTION_RULE_FACET)) { throw new NuxeoException(String.format("Document is not a rule")); } RetentionRule rr = rule.getAdapter(RetentionRule.class); if (!rr.isManual()) { throw new IllegalArgumentException("Only manual rule can be manually attached"); } document = retentionManager.attachRule(document, rr, session); return document; }

Target:
public DocumentModel run(DocumentModel document) { if (!rule.hasFacet(RetentionConstants.RETENTION_RULE_FACET)) { throw new NuxeoException("Document is not a rule: " + document); } RetentionRule rr = rule.getAdapter(RetentionRule.class); if (!rr.isManual()) { throw new IllegalArgumentException("Only manual rule can be manually attached"); } document = retentionManager.attachRule(document, rr, session); return document; }
Source:
public void parameterizedRebuild(Run currentBuild, StaplerResponse response) throws IOException { Job project = getProject(); if (project == null) { return; } System.out.println("rbx: " + (currentBuild == build)); project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { List<Action> actions = constructRebuildActions(build, currentBuild.getAction(ParametersAction.class)); Hudson.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); response.sendRedirect("../../"); } }

Target:
public void parameterizedRebuild(Run currentBuild, StaplerResponse response) throws IOException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { List<Action> actions = constructRebuildActions(build, currentBuild.getAction(ParametersAction.class)); Hudson.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); response.sendRedirect("../../"); } }
Source:
private boolean isEquivalentOutboundRelationship(final Multimap<Concept, Concept> equivalentConcepts, Relationship relationshipToRemove, Relationship relationshipToKeep) { Concept destinationToKeep = relationshipToKeep.getDestination(); Concept destinationToRemove = relationshipToRemove.getDestination(); equivalentConcepts.get(destinationToKeep); return relationshipToRemove.getType().equals(relationshipToKeep.getType()) && (destinationToRemove.equals(destinationToKeep) || equivalentConcepts.get(destinationToKeep).contains(destinationToRemove)) && relationshipToRemove.getCharacteristicType().equals(relationshipToKeep.getCharacteristicType()) && relationshipToRemove.getModifier().equals(relationshipToKeep.getModifier()); }

Target:
private boolean isEquivalentOutboundRelationship(final Multimap<Concept, Concept> equivalentConcepts, Relationship relationshipToRemove, Relationship relationshipToKeep) { Concept destinationToKeep = relationshipToKeep.getDestination(); Concept destinationToRemove = relationshipToRemove.getDestination(); return relationshipToRemove.getType().equals(relationshipToKeep.getType()) && (destinationToRemove.equals(destinationToKeep) || equivalentConcepts.get(destinationToKeep).contains(destinationToRemove)) && relationshipToRemove.getCharacteristicType().equals(relationshipToKeep.getCharacteristicType()) && relationshipToRemove.getModifier().equals(relationshipToKeep.getModifier()); }
Source:
public String fetchApiVersionFromServer(String baseUrl, ApacheHttpClientDelegate delegate) throws IOException { HttpGet get = new HttpGet(baseUrl + "/version"); get.addHeader(HttpHeaders.ACCEPT, "*/*"); get.addHeader(HttpHeaders.CONTENT_TYPE, "application/json"); CloseableHttpResponse response = delegate.getHttpClient().execute(get); return response.getFirstHeader("Api-Version") != null ? response.getFirstHeader("Api-Version").getValue() : null; }

Target:
public String fetchApiVersionFromServer(String baseUrl, ApacheHttpClientDelegate delegate) throws IOException { HttpGet get = new HttpGet(baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "version"); get.addHeader(HttpHeaders.ACCEPT, "*/*"); get.addHeader(HttpHeaders.CONTENT_TYPE, "application/json"); CloseableHttpResponse response = delegate.getHttpClient().execute(get); return response.getFirstHeader("Api-Version") != null ? response.getFirstHeader("Api-Version").getValue() : null; }
Source:
Long countByCoordinatesAndAlleles(String chromosome, int start, String reference, String alternate) { if (alternate != null) { return variantEntityRepository.countByChromosomeAndStartAndReferenceAndAlternate(chromosome, start, reference, alternate); } else { return variantEntityRepository.countByChromosomeAndStartAndReference(chromosome, start, reference); } }

Target:
private Long countByCoordinatesAndAlleles(String chromosome, int start, String reference, String alternate) { if (alternate != null) { return variantEntityRepository.countByChromosomeAndStartAndReferenceAndAlternate(chromosome, start, reference, alternate); } else { return variantEntityRepository.countByChromosomeAndStartAndReference(chromosome, start, reference); } }
Source:
public void onSelectionChanged(SelectionChangedEvent event) { final String isLinkedWithEditor = preferencesManager.getValue(LinkWithEditorAction.LINK_WITH_EDITOR); if (isNullOrEmpty(isLinkedWithEditor) || !Boolean.parseBoolean(isLinkedWithEditor)) { return; } final Selection<?> selection = event.getSelection(); if (selection instanceof Selection.NoSelectionProvided) { return; } Resource currentResource = null; if (selection == null || selection.getHeadElement() == null || selection.getAllElements().size() > 1) { return; } final Object headObject = selection.getHeadElement(); if (headObject instanceof HasDataObject) { Object data = ((HasDataObject)headObject).getData(); if (data instanceof Resource) { currentResource = (Resource)data; } } else if (headObject instanceof Resource) { currentResource = (Resource)headObject; } EditorPartStack activePartStack = editorMultiPartStack.getActivePartStack(); if (currentResource == null || activePartStack == null || activeEditor == null) { return; } if (!(activePart instanceof ProjectExplorerPresenter) && currentResource.getLocation().equals(activeEditor.getEditorInput().getFile().getLocation())) { return; } PartPresenter partPresenter = activePartStack.getPartByPath(currentResource.getLocation()); if (partPresenter != null) { workspaceAgent.setActivePart(partPresenter, EDITING); } }

Target:
public void onSelectionChanged(SelectionChangedEvent event) { final String isLinkedWithEditor = preferencesManager.getValue(LinkWithEditorAction.LINK_WITH_EDITOR); if (!parseBoolean(isLinkedWithEditor)) { return; } final Selection<?> selection = event.getSelection(); if (selection instanceof Selection.NoSelectionProvided) { return; } Resource currentResource = null; if (selection == null || selection.getHeadElement() == null || selection.getAllElements().size() > 1) { return; } final Object headObject = selection.getHeadElement(); if (headObject instanceof HasDataObject) { Object data = ((HasDataObject)headObject).getData(); if (data instanceof Resource) { currentResource = (Resource)data; } } else if (headObject instanceof Resource) { currentResource = (Resource)headObject; } EditorPartStack activePartStack = editorMultiPartStack.getActivePartStack(); if (currentResource == null || activePartStack == null || activeEditor == null) { return; } final Path locationOfActiveOpenedFile = activeEditor.getEditorInput().getFile().getLocation(); final Path selectedResourceLocation = currentResource.getLocation(); if (!(activePart instanceof ProjectExplorerPresenter) && selectedResourceLocation.equals(locationOfActiveOpenedFile)) { return; } PartPresenter partPresenter = activePartStack.getPartByPath(selectedResourceLocation); if (partPresenter != null) { workspaceAgent.setActivePart(partPresenter, EDITING); } }
Source:
private VDSExceptionBase createException() { VDSExceptionBase outEx; final String errorMessage = String.format("Failed to %1$s, error = %2$s", getCommandName(), getReturnStatus().mMessage); outEx = createDefaultConcreteException(errorMessage); return outEx; }

Target:
private VDSExceptionBase createException() { final String errorMessage = String.format("Failed to %1$s, error = %2$s", getCommandName(), getReturnStatus().mMessage); return createDefaultConcreteException(errorMessage); }
Source:
void processEvents(LockWatchEvents events, UUID versionId) { if (events.events().isEmpty()) { return; } Preconditions.checkArgument(events.versionRange().isPresent(), "Cannot have an empty range of versions with non-zero number of events"); events.events().forEach(event -> event.accept(visitor)); snapshotVersion = Optional.of( LockWatchVersion.of(versionId, events.versionRange().map(Range::upperEndpoint).get())); }

Target:
void processEvents(LockWatchEvents events, UUID versionId) { if (events.events().isEmpty()) { return; } events.events().forEach(event -> event.accept(visitor)); snapshotVersion = Optional.of( LockWatchVersion.of(versionId, events.versionRange().map(Range::upperEndpoint).get())); }
Source:
private static Exception refineException(B2Error error, Exception exception) { if ("bad_json".equals(error.code())) { return new IllegalArgumentException(error.message(), exception); } else { return exception; } }

Target:
private static Exception refineException(B2Error error, Exception exception) { if ("bad_bucket_id".equals(error.code())) { return new ContainerNotFoundException(exception); } else if ("bad_json".equals(error.code())) { return new IllegalArgumentException(error.message(), exception); } else { return exception; } }
Source:
protected Response performRemove(String id) { throw new MethodNotAllowedException("No resource method found for DELETE quota element"); }

Target:
protected Response performRemove(String id) { throw new UnsupportedOperationException(); }
Source:
protected String generateVmConfiguration(VM vm) { ArrayList<DiskImage> allVmImages = new java.util.ArrayList<DiskImage>(); if (vm.getInterfaces() == null || vm.getInterfaces().isEmpty()) { vm.setInterfaces(DbFacade.getInstance().getVmNetworkInterfaceDAO().getAllForVm(vm.getId())); } for (DiskImage diskImage : getDiskImageDao().getAllForVm(vm.getId())) { allVmImages.addAll(ImagesHandler.getAllImageSnapshots(diskImage.getId(), diskImage.getit_guid())); } if (StringHelper.isNullOrEmpty(vm.getvmt_name())) { VmTemplate t = DbFacade.getInstance().getVmTemplateDAO().get(vm.getvmt_guid()); vm.setvmt_name(t.getname()); } RefObject<String> tempRefObject = new RefObject<String>(""); new OvfManager().ExportVm(tempRefObject, vm, allVmImages); return tempRefObject.argvalue; }

Target:
protected String generateVmConfiguration(VM vm) { ArrayList<DiskImage> allVmImages = new java.util.ArrayList<DiskImage>(); if (vm.getInterfaces() == null || vm.getInterfaces().isEmpty()) { vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId())); } for (DiskImage diskImage : getDiskImageDao().getAllForVm(vm.getId())) { allVmImages.addAll(ImagesHandler.getAllImageSnapshots(diskImage.getId(), diskImage.getit_guid())); } if (StringHelper.isNullOrEmpty(vm.getvmt_name())) { VmTemplate t = getVmTemplateDao().get(vm.getvmt_guid()); vm.setvmt_name(t.getname()); } RefObject<String> tempRefObject = new RefObject<String>(""); new OvfManager().ExportVm(tempRefObject, vm, allVmImages); return tempRefObject.argvalue; }
Source:
public void doTest() throws URISyntaxException, IOException { for (File localeFile: getMessagesPropertiesFiles(".")) { Properties properties = loadProperties(localeFile); compareMethodsToProperties(messagesMethods, properties, localeFile); } assertTrue(format(errors), errors.isEmpty()); }

Target:
public void doTest() throws URISyntaxException, IOException { File messageFileDir = new File( this.getClass().getResource(".").toURI().toASCIIString().replaceAll("file:", "")); List<String> errors = GwtMessagesValidator.validateClass(CommonApplicationMessages.class, messageFileDir); assertTrue(GwtMessagesValidator.format(errors), errors.isEmpty()); }
Source:
public ByteBuffer toByteBuffer( final EntityWrapper wrapper ) { if ( wrapper == null ) { return null; } FieldBufferBuilder builder = new FieldBufferBuilder( 3 ); builder.addByte( VERSION ); builder.addUUID( wrapper.version ); if ( !wrapper.entity.isPresent() ) { builder.addByte( STATE_DELETED ); return FIELD_BUFFER_SERIALIZER.toByteBuffer( builder.build() ); } if ( wrapper.status != MvccEntity.Status.COMPLETE ) { throw new UnsupportedOperationException( "Only states " + MvccEntity.Status.DELETED + " and " + MvccEntity.Status.COMPLETE + " are supported" ); } builder.addByte( STATE_COMPLETE ); final Entity entity = wrapper.entity.get(); final EntityMap entityMap = EntityMap.fromEntity( entity ); final String entityString; try { entityString = MAPPER.writeValueAsString( entityMap ); } catch ( Exception e ) { throw new RuntimeException( "Unable to serialize entity", e ); } final int maxEntrySize = serializationFig.getMaxEntitySize(); if ( entityString.length() > maxEntrySize ) { throw new EntityTooLargeException( entity, maxEntrySize, entityString.length(), "Your entity cannot exceed " + maxEntrySize + " bytes. The entity you tried to save was " + entityString.length() + " bytes" ); } if( log.isDebugEnabled() ){ log.debug("Entity(" + entityString + ") Version("+wrapper.version+") State("+wrapper.status+")"); } builder.addString(entityString); return FIELD_BUFFER_SERIALIZER.toByteBuffer( builder.build() ); }

Target:
public ByteBuffer toByteBuffer( final EntityWrapper wrapper ) { if ( wrapper == null ) { return null; } wrapper.setSerailizationVersion(VERSION); if ( wrapper.getEntity() == null ) { try { return ByteBuffer.wrap(MAPPER.writeValueAsBytes(wrapper)); }catch (JsonProcessingException jpe){ throw new RuntimeException( "Unable to serialize entity", jpe ); } } if ( wrapper.getStatus() != MvccEntity.Status.COMPLETE ) { throw new UnsupportedOperationException( "Only states " + MvccEntity.Status.DELETED + " and " + MvccEntity.Status.COMPLETE + " are supported" ); } wrapper.setStatus(MvccEntity.Status.COMPLETE); final byte[] wrapperBytes; try { wrapperBytes = MAPPER.writeValueAsBytes(wrapper); final int maxEntrySize = serializationFig.getMaxEntitySize(); if (wrapperBytes.length > maxEntrySize) { throw new EntityTooLargeException(Entity.fromMap(wrapper.getEntity()), maxEntrySize, wrapperBytes.length, "Your entity cannot exceed " + maxEntrySize + " bytes. The entity you tried to save was " + wrapperBytes.length + " bytes"); } } catch ( JsonProcessingException jpe ) { throw new RuntimeException( "Unable to serialize entity", jpe ); } return ByteBuffer.wrap(wrapperBytes); }
Source:
public void testArtifactUniqueness() throws Exception { JobExecution jobExecution = JsrTestUtils.runJob("jsrUniqueInstanceTests", new Properties(), 10000L); String exitStatus = jobExecution.getExitStatus(); assertEquals("listener3listener2listener1listener0listener7listener6listener5listener4", exitStatus); }

Target:
public void testArtifactUniqueness() throws Exception { JobExecution jobExecution = JsrTestUtils.runJob("jsrUniqueInstanceTests", new Properties(), 10000L); String exitStatus = jobExecution.getExitStatus(); assertTrue("Exit status must contain listener3", exitStatus.contains("listener3")); exitStatus = exitStatus.replace("listener3", ""); assertTrue("Exit status must contain listener2", exitStatus.contains("listener2")); exitStatus = exitStatus.replace("listener2", ""); assertTrue("Exit status must contain listener1", exitStatus.contains("listener1")); exitStatus = exitStatus.replace("listener1", ""); assertTrue("Exit status must contain listener0", exitStatus.contains("listener0")); exitStatus = exitStatus.replace("listener0", ""); assertTrue("Exit status must contain listener7", exitStatus.contains("listener7")); exitStatus = exitStatus.replace("listener7", ""); assertTrue("Exit status must contain listener6", exitStatus.contains("listener6")); exitStatus = exitStatus.replace("listener6", ""); assertTrue("Exit status must contain listener5", exitStatus.contains("listener5")); exitStatus = exitStatus.replace("listener5", ""); assertTrue("Exit status must contain listener4", exitStatus.contains("listener4")); exitStatus = exitStatus.replace("listener4", ""); assertTrue("exitStatus must be empty", "".equals(exitStatus)); }
Source:
public void checkMainFeaturesTypeScriptLS() { String intitTypeScriptLanguageServerMessage = format("Finished language servers initialization, file path '/%s'", PATH_TO_GREETER_FILE); consoles.waitExpectedTextIntoConsole(intitTypeScriptLanguageServerMessage); checkCodeValidation(); checkCodeAssistant(); checkGoToDefinition(); }

Target:
public void checkMainFeaturesTypeScriptLS() { String initTypeScriptLanguageServerMessage = format("Finished language servers initialization, file path '/%s'", PATH_TO_GREETER_FILE); consoles.waitExpectedTextIntoConsole(initTypeScriptLanguageServerMessage); checkCodeValidation(); checkCodeAssistant(); checkGoToDefinition(); }
Source:
public Storage newStorage(Config config) { com.google.cloud.storage.Storage storage; if (config.has("creadentials.json_key")) { storage = getStorageFromJsonKey(config); } else { storage = StorageOptions.getDefaultInstance().getService(); } String bucket = config.get("bucket", String.class); return new GCSStorage(config, storage, bucket); }

Target:
public Storage newStorage(Config config) { com.google.cloud.storage.Storage storage; if (config.has(PATH_KEY)) { storage = getStorageFromJsonKey(config, PATH_KEY); } else if (config.has(CONTENT_KEY)) { storage = getStorageFromJsonKey(config, CONTENT_KEY); } else { storage = StorageOptions.getDefaultInstance().getService(); } String bucket = config.get("bucket", String.class); return new GCSStorage(config, storage, bucket); }
Source:
public FluentProtocol executeTasks() { Condition.Result result = condition.getResult(); if (result.isValid) { if (setup.getTimeoutSec() > 0) { tradeProtocol.startTimeout(setup.getTimeoutSec()); } NodeAddress peer = condition.getPeer(); if (peer != null) { tradeProtocol.processModel.setTempTradingPeerNodeAddress(peer); } TradeMessage message = condition.getMessage(); if (message != null) { tradeProtocol.processModel.setTradeMessage(message); } TradeTaskRunner taskRunner = setup.getTaskRunner(message, condition.getEvent()); taskRunner.addTasks(setup.getTasks()); taskRunner.run(); } else if (resultHandler != null) { resultHandler.accept(result); } return this; }

Target:
public FluentProtocol executeTasks() { Condition.Result result = condition.getResult(); if (!result.isValid) { if (resultHandler != null) { resultHandler.accept(result); } return this; } if (setup.getTimeoutSec() > 0) { tradeProtocol.startTimeout(setup.getTimeoutSec()); } NodeAddress peer = condition.getPeer(); if (peer != null) { tradeProtocol.processModel.setTempTradingPeerNodeAddress(peer); } TradeMessage message = condition.getMessage(); if (message != null) { tradeProtocol.processModel.setTradeMessage(message); } TradeTaskRunner taskRunner = setup.getTaskRunner(message, condition.getEvent()); taskRunner.addTasks(setup.getTasks()); taskRunner.run(); return this; }
Source:
private boolean doDispatch(Message<?> message) { if (tryOptimizedDispatch(message)) { return true; } boolean success = false; Iterator<MessageHandler> handlerIterator = this.getHandlerIterator(message); if (!handlerIterator.hasNext()) { throw new MessageDispatchingException(message, "Dispatcher has no subscribers"); } List<RuntimeException> exceptions = new ArrayList<>(); while (!success && handlerIterator.hasNext()) { MessageHandler handler = handlerIterator.next(); try { handler.handleMessage(message); success = true; } catch (Exception ex) { RuntimeException runtimeException = IntegrationUtils.wrapInDeliveryExceptionIfNecessary(message, () -> "Dispatcher failed to deliver Message", ex); exceptions.add(runtimeException); boolean isLast = !handlerIterator.hasNext(); if (!isLast && this.failover && this.logger.isInfoEnabled()) { this.logger.info("An exception thrown from the '" + handler + "' for the '" + message + "'. " + "Will be in a failover for the next subscriber.", ex); } handleExceptions(exceptions, message, isLast); } } return success; }

Target:
private boolean doDispatch(Message<?> message) { if (tryOptimizedDispatch(message)) { return true; } boolean success = false; Iterator<MessageHandler> handlerIterator = getHandlerIterator(message); if (!handlerIterator.hasNext()) { throw new MessageDispatchingException(message, "Dispatcher has no subscribers"); } List<RuntimeException> exceptions = null; while (!success && handlerIterator.hasNext()) { MessageHandler handler = handlerIterator.next(); try { handler.handleMessage(message); success = true; } catch (Exception ex) { RuntimeException runtimeException = IntegrationUtils.wrapInDeliveryExceptionIfNecessary(message, () -> "Dispatcher failed to deliver Message", ex); if (exceptions == null) { exceptions = new ArrayList<>(); } exceptions.add(runtimeException); boolean isLast = !handlerIterator.hasNext(); if (!isLast && this.failover) { logExceptionBeforeFailOver(ex, handler, message); } handleExceptions(exceptions, message, isLast); } } return success; }
Source:
private void updateSetting(String key, String value) { if (getServer().version().isGreaterThanOrEquals("6.1")) { newAdminWsClient().settingsService().set(SetRequest.builder().setKey(key).setValue(value).build()); } else { server.getAdminWsClient().update(new PropertyUpdateQuery(key, value)); } }

Target:
private void updateSetting(String key, String value) { if (getServer().version().isGreaterThanOrEquals("6.1")) { server.adminWsClient().post("api/settings/set", ImmutableMap.of("key", key, "value", value)); } else { server.getAdminWsClient().update(new PropertyUpdateQuery(key, value)); } }
Source:
protected T getProxyInternal() { try { final InetSocketAddress rmAddress = rmProxy.getRMAddress(conf, protocol); return rmProxy.getProxy(conf, protocol, rmAddress); } catch (IOException ioe) { LOG.error("Unable to create proxy to the ResourceManager ", ioe); return null; } }

Target:
protected T getProxyInternal() { try { final InetSocketAddress rmAddress = rmProxy.getRMAddress(conf, protocol); return rmProxy.getProxy(conf, protocol, rmAddress); } catch (IOException ioe) { LOG.error("Unable to create proxy to the ResourceManager", ioe.getMessage()); return null; } }
Source:
public ModelPlotConfig(StreamInput in) throws IOException { enabled = in.readBoolean(); terms = in.readOptionalString(); if (in.getVersion().onOrAfter(Version.V_7_9_0)) { annotationsEnabled = in.readBoolean(); } else { annotationsEnabled = enabled; } }

Target:
public ModelPlotConfig(StreamInput in) throws IOException { enabled = in.readBoolean(); terms = in.readOptionalString(); annotationsEnabled = in.readBoolean(); }
Source:
public String toString() { if (dateUploaded != null) { return "UploadResult{" + "errorCode='" + errorCode + '\'' + ", resultStatus='" + resultStatus + '\'' + ", dateUploaded='" + dateUploaded.toString() + '\'' + ", imageUrl='" + imageUrl + '\'' + ", canonicalFilename='" + canonicalFilename + '\'' + '}'; } return "Server is in read only mode"; }

Target:
public String toString() { return "UploadResult{" + "errorCode='" + errorCode + '\'' + ", resultStatus='" + resultStatus + '\'' + ", dateUploaded='" + (dateUploaded != null ? dateUploaded.toString() : "") + '\'' + ", imageUrl='" + imageUrl + '\'' + ", canonicalFilename='" + canonicalFilename + '\'' + '}'; }
Source:
private ExecutableElement getValidationAppliesToMethod(Element annotation) { for ( Element e : annotation.getEnclosedElements() ) { ExecutableElement method = e.accept( new ElementKindVisitor6<ExecutableElement, Void>() { @Override public ExecutableElement visitExecutableAsMethod(ExecutableElement e, Void p) { if ( e.getSimpleName().contentEquals( "validationAppliesTo" ) ) { return e; } return super.visitExecutableAsMethod( e, p ); } }, null ); if ( method != null ) { return method; } } return null; }

Target:
private ExecutableElement getValidationAppliesToMethod(Element annotation) { for ( Element e : annotation.getEnclosedElements() ) { ExecutableElement method = e.accept( new ElementKindVisitor6<ExecutableElement, Void>() { @Override public ExecutableElement visitExecutableAsMethod(ExecutableElement e, Void p) { if ( e.getSimpleName().contentEquals( "validationAppliesTo" ) ) { return e; } return null; } }, null ); if ( method != null ) { return method; } } return null; }
Source:
public void setChannelTypeRegistry(ChannelTypeRegistry registry) { this.channelTypeRegistry = registry; }

Target:
protected void setChannelTypeRegistry(ChannelTypeRegistry registry) { this.channelTypeRegistry = registry; }
Source:
public void testToCalendarWithDateNull() { try { DateUtils.toCalendar(null, zone); fail("Expected NullPointerException to be thrown when Date is null"); } catch(final NullPointerException npe) { } }

Target:
public void testToCalendarWithDateNull() { DateUtils.toCalendar(null, zone); }
Source:
public void shouldReturnIdImmediatelyAfterRecordIdOnlyOnce() throws Exception { PrepareIdSequence idSequence = new SecondaryUnitPrepareIdSequence(); IdSequence actual = mock( IdSequence.class ); long recordId = 10; IdSequence prepared = idSequence.apply( actual ).apply( recordId ); long nextRecordId = prepared.nextId(); assertEquals( 10 + 1, nextRecordId ); verifyNoMoreInteractions( actual ); try { prepared.nextId(); fail( "Shoul've failed" ); } catch ( IllegalStateException e ) { } recordId = 20; prepared = idSequence.apply( actual ).apply( recordId ); nextRecordId = prepared.nextId(); assertEquals( 20 + 1, nextRecordId ); verifyNoMoreInteractions( actual ); }

Target:
public void shouldReturnIdImmediatelyAfterRecordIdOnlyOnce() throws Exception { PrepareIdSequence idSequence = new SecondaryUnitPrepareIdSequence(); IdSequence actual = mock( IdSequence.class ); long recordId = 10; IdSequence prepared = idSequence.apply( actual ).apply( recordId ); long nextRecordId = prepared.nextId(); assertEquals( 10 + 1, nextRecordId ); verifyNoMoreInteractions( actual ); try { prepared.nextId(); fail( "Should've failed" ); } catch ( IllegalStateException e ) { } recordId = 20; prepared = idSequence.apply( actual ).apply( recordId ); nextRecordId = prepared.nextId(); assertEquals( 20 + 1, nextRecordId ); verifyNoMoreInteractions( actual ); }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("_name", _name) .add("_alignSampling", _alignSampling) .add("_alignStartTime", _alignStartTime) .add("_alignEndTime", _alignEndTime) .add("_sampling", _sampling) .add("_otherArgs", _otherArgs) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("name", _name) .add("alignSampling", _alignSampling) .add("alignStartTime", _alignStartTime) .add("alignEndTime", _alignEndTime) .add("sampling", _sampling) .add("otherArgs", _otherArgs) .toString(); }
Source:
public SslContextBuilder trustManager(TrustManager trustManager) { trustCertCollection = null; try { this.trustManagerFactory = new TrustManagerFactoryWrapper(trustManager); } catch (Exception e) { throw new Error(e.toString()); } return this; }

Target:
public SslContextBuilder trustManager(TrustManager trustManager) { this.trustManagerFactory = new TrustManagerFactoryWrapper(trustManager); trustCertCollection = null; return this; }
Source:
public void testDeleteRoot() throws Exception { Path srcDir = new Path("/"); fileSys = DFSTestUtil.getFileSystemAs(user1, conf); boolean result = fileSys.delete(srcDir, true); fileSys.close(); assertTrue(result == false); String aceDeletePattern = ".*allowed=false.*ugi=theDoctor.*cmd=delete.*"; verifyAuditLogs(aceDeletePattern); }

Target:
public void testDeleteRoot() throws Exception { Path srcDir = new Path("/"); fileSys = DFSTestUtil.getFileSystemAs(user1, conf); boolean result = fileSys.delete(srcDir, true); fileSys.close(); assertFalse(result); String aceDeletePattern = ".*allowed=false.*ugi=theDoctor.*cmd=delete.*"; verifyAuditLogs(aceDeletePattern); }
Source:
public void shouldNotSendEventIfPasswordReminderIsDisabled() throws Exception { List<MotechUser> users = prepareMotechUsersOne(); when(settingService.isPasswordResetReminderEnabled()).thenReturn(false); when(allUsers.retrieveAll()).thenReturn(users); eventHandler.handleEvent(event); verify(allUsers, times(0)).retrieveAll(); verify(eventRelay, times(0)).sendEventMessage(any(MotechEvent.class)); verify(settingService, times(1)).isPasswordResetReminderEnabled(); verify(settingService, times(0)).getNumberOfDaysForReminder(); verify(settingService, times(0)).getNumberOfDaysToChangePassword(); }

Target:
public void shouldNotSendEventIfPasswordReminderIsDisabled() throws Exception { List<MotechUser> users = prepareMotechUsersOne(); when(settingService.isPasswordResetReminderEnabled()).thenReturn(false); when(allUsers.retrieveAll()).thenReturn(users); eventHandler.handleEvent(event); verify(allUsers, never()).retrieveAll(); verify(eventRelay, never()).sendEventMessage(any(MotechEvent.class)); verify(settingService, times(1)).isPasswordResetReminderEnabled(); verify(settingService, never()).getNumberOfDaysForReminder(); verify(settingService, never()).getNumberOfDaysToChangePassword(); }
Source:
public void run() { try { ConnectedChannel channel1 = connectionPool.checkOutConnection("localhost", 6667, 1000); channelCount.get("localhost" + 6667).incrementAndGet(); ConnectedChannel channel2 = connectionPool.checkOutConnection("localhost", 6668, 1000); channelCount.get("localhost" + 6668).incrementAndGet(); ConnectedChannel channel3 = connectionPool.checkOutConnection("localhost", 6669, 1000); channelCount.get("localhost" + 6669).incrementAndGet(); releaseConnection.await(); if (destroyConnection) { connectionPool.destroyConnection(channel1); } else { connectionPool.checkInConnection(channel1); } if (destroyConnection) { connectionPool.destroyConnection(channel2); } else { connectionPool.checkInConnection(channel2); } if (destroyConnection) { connectionPool.destroyConnection(channel3); } else { connectionPool.checkInConnection(channel3); } } catch (Exception e) { exception.set(e); e.printStackTrace(); Assert.assertFalse(true); } }

Target:
public void run() { try { ConnectedChannel channel1 = connectionPool.checkOutConnection("localhost", 6667, 1000); channelCount.get("localhost" + 6667).incrementAndGet(); ConnectedChannel channel2 = connectionPool.checkOutConnection("localhost", 6668, 1000); channelCount.get("localhost" + 6668).incrementAndGet(); ConnectedChannel channel3 = connectionPool.checkOutConnection("localhost", 6669, 1000); channelCount.get("localhost" + 6669).incrementAndGet(); releaseConnection.await(); if (destroyConnection) { connectionPool.destroyConnection(channel1); } else { connectionPool.checkInConnection(channel1); } if (destroyConnection) { connectionPool.destroyConnection(channel2); } else { connectionPool.checkInConnection(channel2); } if (destroyConnection) { connectionPool.destroyConnection(channel3); } else { connectionPool.checkInConnection(channel3); } } catch (Exception e) { exception.set(e); e.printStackTrace(); } }
Source:
public Slice getStripeFooterSlice(OrcDataSource orcDataSource, StripeId stripeId, long footerOffset, int footerLength, HiveFileContext hiveFileContext) throws IOException { try { return footerSliceCache.get(stripeId, () -> delegate.getStripeFooterSlice(orcDataSource, stripeId, footerOffset, footerLength, hiveFileContext)); } catch (ExecutionException | UncheckedExecutionException e) { throwIfInstanceOf(e.getCause(), IOException.class); throw new IOException("Unexpected error in stripe footer reading after footerSliceCache miss", e.getCause()); } }

Target:
public Slice getStripeFooterSlice(OrcDataSource orcDataSource, StripeId stripeId, long footerOffset, int footerLength, HiveFileContext hiveFileContext) throws IOException { try { if (!hiveFileContext.isCacheable()) { return delegate.getStripeFooterSlice(orcDataSource, stripeId, footerOffset, footerLength, hiveFileContext); } return footerSliceCache.get(stripeId, () -> delegate.getStripeFooterSlice(orcDataSource, stripeId, footerOffset, footerLength, hiveFileContext)); } catch (ExecutionException | UncheckedExecutionException e) { throwIfInstanceOf(e.getCause(), IOException.class); throw new IOException("Unexpected error in stripe footer reading after footerSliceCache miss", e.getCause()); } }