auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void setCurrentPacket(StreamInputPacketIndexEntry currentPacket) throws CTFReaderException { StreamInputPacketIndexEntry prevPacket = null; fCurrentPacket = currentPacket; if (fCurrentPacket != null) { ByteBuffer bb = null; try { bb = fStreamInputReader.getStreamInput().getByteBufferAt( fCurrentPacket.getOffsetBytes(), (fCurrentPacket.getPacketSizeBits() + 7) / 8); } catch (IOException e) { throw new CTFReaderException(e.getMessage(), e); } fBitBuffer = new BitBuffer(bb); if (fTracePacketHeaderDecl != null) { fCurrentTracePacketHeaderDef = getTracePacketHeaderDefinition(fBitBuffer); } if (fStreamPacketContextDecl != null) { fCurrentStreamPacketContextDef = getStreamPacketContextDefinition(fBitBuffer); if (getCurrentPacket().getTarget() != null) { fCurrentCpu = (int) getCurrentPacket().getTargetId(); } fLostEventsInThisPacket = (int) getCurrentPacket().getLostEvents(); if (fLostEventsInThisPacket != 0) { fHasLost = true; long lostEventsStartTime; int index = fStreamInputReader.getStreamInput().getIndex().getEntries().indexOf(currentPacket); if (index == 0) { lostEventsStartTime = currentPacket.getTimestampBegin() + 1; } else { prevPacket = fStreamInputReader.getStreamInput().getIndex().getEntries().get(index - 1); lostEventsStartTime = prevPacket.getTimestampEnd(); } fLostEventsDuration = Math.abs(lostEventsStartTime - currentPacket.getTimestampBegin()); } } fLastTimestamp = currentPacket.getTimestampBegin(); } else { <START> fBitBuffer = BitBuffer.EMPTY_BITBUFFER; <END> fLastTimestamp = 0; } }</code><technical_language>= null</technical_language>

Target:
void setCurrentPacket(StreamInputPacketIndexEntry currentPacket) throws CTFReaderException { StreamInputPacketIndexEntry prevPacket = null; fCurrentPacket = currentPacket; if (fCurrentPacket != null) { ByteBuffer bb = null; try { bb = fStreamInputReader.getStreamInput().getByteBufferAt( fCurrentPacket.getOffsetBytes(), (fCurrentPacket.getPacketSizeBits() + 7) / 8); } catch (IOException e) { throw new CTFReaderException(e.getMessage(), e); } BitBuffer bitBuffer = new BitBuffer(bb); fBitBuffer = bitBuffer; if (fTracePacketHeaderDecl != null) { fCurrentTracePacketHeaderDef = getTracePacketHeaderDefinition(bitBuffer); } if (fStreamPacketContextDecl != null) { fCurrentStreamPacketContextDef = getStreamPacketContextDefinition(bitBuffer); if (getCurrentPacket().getTarget() != null) { fCurrentCpu = (int) getCurrentPacket().getTargetId(); } fLostEventsInThisPacket = (int) getCurrentPacket().getLostEvents(); if (fLostEventsInThisPacket != 0) { fHasLost = true; long lostEventsStartTime; int index = fStreamInputReader.getStreamInput().getIndex().getEntries().indexOf(currentPacket); if (index == 0) { lostEventsStartTime = currentPacket.getTimestampBegin() + 1; } else { prevPacket = fStreamInputReader.getStreamInput().getIndex().getEntries().get(index - 1); lostEventsStartTime = prevPacket.getTimestampEnd(); } fLostEventsDuration = Math.abs(lostEventsStartTime - currentPacket.getTimestampBegin()); } } fLastTimestamp = currentPacket.getTimestampBegin(); } else { fBitBuffer = null; fLastTimestamp = 0; } }
Source:
<code>public static Integer strcmp(String s0, String s1) { return s0.compareTo(s1); <START> } <END></code><technical_language>I thin is return int instead of Integer</technical_language>

Target:
public static int strcmp(String s0, String s1) { return s0.compareTo(s1); }
Source:
<code>public void testExecutorsShutDown() throws Exception { Path scanPath = new Path(dir.getAbsolutePath()); mkdirs = fileSys.mkdirs(scanPath); Path[] dirs = new Path[] {scanPath}; final LocatedFileStatusFetcher fetcher = new LocatedFileStatusFetcher(conf, dirs, true, new PathFilter() { @Override public boolean accept(Path path) { return true; } }, true); Thread t = new Thread() { @Override public void run() { try { fetcher.getFileStatuses(); } catch (Exception e) { Assert.assertTrue(e instanceof InterruptedException); } } }; t.start(); Thread.sleep(TIME_FOR_SLEEP / 2); t.interrupt(); t.join(); <START> Assert.assertTrue(fetcher.getListeningExecutorService().isShutdown()); <END> }</code><technical_language>add error message for assertion</technical_language>

Target:
public void testExecutorsShutDown() throws Exception { Path scanPath = new Path(dir.getAbsolutePath()); mkdirs = fileSys.mkdirs(scanPath); Path[] dirs = new Path[] {scanPath}; final LocatedFileStatusFetcher fetcher = new LocatedFileStatusFetcher(conf, dirs, true, new PathFilter() { @Override public boolean accept(Path path) { return true; } }, true); Thread t = new Thread() { @Override public void run() { try { fetcher.getFileStatuses(); } catch (Exception e) { Assert.assertTrue(e instanceof InterruptedException); } } }; t.start(); LATCH.await(); t.interrupt(); t.join(); Assert.assertTrue("The executor service should have been shut down", fetcher.getListeningExecutorService().isShutdown()); }
Source:
<code>protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { <START> if (context.isResourceServiceRestartAllowed()) { <END> AccessLogAdd.INSTANCE.performRuntime(context, operation, model); } else { context.revertReloadRequired(); } }</code><technical_language>this check? This method get called performRuntime is called, performRuntime check</technical_language>

Target:
protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { AccessLogAdd.INSTANCE.performRuntime(context, operation, model); }
Source:
<code><START> public static void setChromeOptions(WebDriverConfiguration configuration, DesiredCapabilities capabilities) { <END> ChromeOptions chromeOptions = new ChromeOptions(); String browser = configuration.getBrowser().toLowerCase(); if (browser.equals("chromeheadless")) { chromeOptions.addArguments("--headless"); } CapabilitiesOptionsMapper.mapCapabilities(chromeOptions, capabilities, BROWSER_CAPABILITIES); String binary = (String) capabilities.getCapability("chrome.binary"); if (Validate.nonEmpty(binary)) { chromeOptions.setBinary(binary); } capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); String printChromeOptions = (String) capabilities.getCapability(CHROME_PRINT_OPTIONS); if (Validate.nonEmpty(printChromeOptions) && Boolean.valueOf(printChromeOptions.trim())) { try { StringBuffer chromeOptionsLog = new StringBuffer("\n"); chromeOptionsLog.append("======== Chrome options =========").append("\n"); chromeOptionsLog.append(chromeOptions.toJson().toString()).append("\n"); chromeOptionsLog.append("===== End of Chrome options ====="); log.info(chromeOptionsLog.toString()); } catch (IOException e) { log.warning("Something bad happened during printing chrome options: "); log.warning(e.getMessage()); } } }</code><technical_language>static - call new ChromeDriverFactory().setChromeOptions(configuration, desiredCapabilities);</technical_language>

Target:
public void setChromeOptions(WebDriverConfiguration configuration, DesiredCapabilities capabilities) { ChromeOptions chromeOptions = new ChromeOptions(); String browser = configuration.getBrowser().toLowerCase(); if (browser.equals("chromeheadless")) { chromeOptions.addArguments("--headless"); } CapabilitiesOptionsMapper.mapCapabilities(chromeOptions, capabilities, BROWSER_CAPABILITIES); String binary = (String) capabilities.getCapability("chrome.binary"); if (Validate.nonEmpty(binary)) { chromeOptions.setBinary(binary); } capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); String printChromeOptions = (String) capabilities.getCapability(CHROME_PRINT_OPTIONS); if (Validate.nonEmpty(printChromeOptions) && Boolean.valueOf(printChromeOptions.trim())) { try { StringBuffer chromeOptionsLog = new StringBuffer("\n"); chromeOptionsLog.append("======== Chrome options =========").append("\n"); chromeOptionsLog.append(chromeOptions.toJson().toString()).append("\n"); chromeOptionsLog.append("===== End of Chrome options ====="); log.info(chromeOptionsLog.toString()); } catch (IOException e) { log.warning("Something bad happened during printing chrome options: "); log.warning(e.getMessage()); } } }
Source:
<code><START> public void setStringValue(BaseElement element, String value) { <END> FeatureMap.Entry extension = extensionOf( DOCUMENT_ROOT__META_DATA, metaDataOf(value)); getExtensionElements(element).add(extension); }</code><technical_language>want ask public is purpose, in _ElementDefinition_ class is protected</technical_language>

Target:
protected void setStringValue(BaseElement element, String value) { FeatureMap.Entry extension = extensionOf( DOCUMENT_ROOT__META_DATA, metaDataOf(value)); getExtensionElements(element).add(extension); }
Source:
<code>private static HashMap<ResourceType, Double> getResourcePercentage( String val) throws AllocationConfigurationException { HashMap<ResourceType, Double> resourcePercentage = new HashMap<>(); String[] strings = val.split(","); if (strings.length == 1) { double percentage = findPercentage(strings[0], ""); for (ResourceType resourceType: ResourceType.values()) { resourcePercentage.put(resourceType, percentage/100); } } else { double memPercentage = findPercentage(val, "memory"); <START> double vcorePercentage = findPercentage(val, "vcore"); <END> resourcePercentage.put(ResourceType.MEMORY, memPercentage/100); resourcePercentage.put(ResourceType.CPU, vcorePercentage/100); } return resourcePercentage; }</code><technical_language>vcore is a unit of cpu. If memory instead of mb, cpu instead of vcore</technical_language>

Target:
private static double[] getResourcePercentage( String val) throws AllocationConfigurationException { double[] resourcePercentage = new double[ResourceType.values().length]; String[] strings = val.split(","); if (strings.length == 1) { double percentage = findPercentage(strings[0], ""); for (int i = 0; i < ResourceType.values().length; i++) { resourcePercentage[i] = percentage/100; } } else { resourcePercentage[0] = findPercentage(val, "memory")/100; resourcePercentage[1] = findPercentage(val, "cpu")/100; } return resourcePercentage; }
Source:
<code>protected void executeCommand() { List<Cluster> <START> clusters = <END> getClustersWithOvsSwitchType(getNetwork().getId()); checkValidDefaultProvider(clusters); List<Cluster> clustersWithOVS = getClustersWithValidDefaultProvider(clusters); createListOfClustersByProvider(clustersWithOVS); List<Guid> providerIds = new ArrayList<>(listOfClustersByProvider.keySet()); IntStream.range(0, providerIds.size()) .forEach(i -> runAutodefineForOneProvider(providerIds.get(i), i)); setSucceeded(true); }</code><technical_language>clustersWithOvs</technical_language>

Target:
protected void executeCommand() { List<Cluster> clustersWithOvs = getClustersWithOvsSwitchType(getNetwork().getId()); checkValidDefaultProvider(clustersWithOvs); List<Cluster> clustersWithProvider = getClustersWithValidDefaultProvider(clustersWithOvs); createListOfClustersByProvider(clustersWithProvider); List<Guid> providerIds = new ArrayList<>(clustersByProvider.keySet()); IntStream.range(0, providerIds.size()) .forEach(i -> runAutodefineForOneProvider(providerIds.get(i), i)); setSucceeded(true); }
Source:
<code>public ModelAndView contextJSONLD(@RequestParam(value = "callback", required = false) String callback) { String jsonld = null; <START> try { jsonld = com.github.jsonldjava.utils.JsonUtils.toString(jsonldContext); } catch (IOException e) { LOG.error("Error in Json serialization", e); } <END> return JsonUtils.toJson(jsonld, callback); }</code><technical_language>removed</technical_language>

Target:
public ModelAndView contextJSONLD(@RequestParam(value = "callback", required = false) String callback) throws IOException { String jsonld = com.github.jsonldjava.utils.JsonUtils.toString(jsonldContext); return JsonUtils.toJson(jsonld, callback); }
Source:
<code>protected Map<Object,Object> buildEntityConfig(Map<?, ?> config) { if (config==null) return ImmutableMap.of(); Map<Object, Object> orig = (Map<Object, Object>)config.get("brooklyn.config"); Map<Object, Object> result = Maps.newLinkedHashMap(); if (orig != null) { for (Map.Entry<?, ?> entry : orig.entrySet()) { Object key = entry.getKey(); if (key instanceof ConfigKey) result.put((ConfigKey)key, entry.getValue()); else if (key instanceof HasConfigKey) result.put((HasConfigKey)key, entry.getValue()); else result.put(ConfigKeys.newConfigKey(Object.class, key.toString()), entry.getValue()); } } <START> return (result == null) ? ImmutableMap.<Object,Object>of() : result; <END> }</code><technical_language>result null</technical_language>

Target:
protected Map<Object,Object> buildEntityConfig(Map<?, ?> config) { if (config==null) return ImmutableMap.of(); Map<Object, Object> orig = (Map<Object, Object>)config.get("brooklyn.config"); Map<Object, Object> result = Maps.newLinkedHashMap(); if (orig != null) { for (Map.Entry<?, ?> entry : orig.entrySet()) { Object key = entry.getKey(); if (key instanceof ConfigKey) result.put((ConfigKey)key, entry.getValue()); else if (key instanceof HasConfigKey) result.put((HasConfigKey)key, entry.getValue()); else result.put(ConfigKeys.newConfigKey(Object.class, key.toString()), entry.getValue()); } } return result; }
Source:
<code>public void testGetAll() throws Exception { assertMisses(0); assertHits(0); <START> assert 0 == advanced.getStats().getHits(); <END> assertAttributeValue("HitRatio", 0); cache.put("key", "value"); assertMisses(0); assertHits(0); assertAttributeValue("HitRatio", 0); Set<String> keySet = new HashSet<>(); keySet.add("key"); keySet.add("key1"); advanced.getAll(keySet); assertMisses(1); assertHits(1); assertAttributeValue("HitRatio", 0.5f); }</code><technical_language>I other methods asserts, move affected code org.testng.AssertJUnit.\* methods instead if could. Thanks</technical_language>

Target:
public void testGetAll() throws Exception { assertEquals(0, advanced.getStats().getMisses()); assertEquals(0, advanced.getStats().getHits()); String hitRatioString = server.getAttribute(mgmtInterceptor, "HitRatio").toString(); Float hitRatio = Float.parseFloat(hitRatioString); assertEquals(0f, hitRatio); cache.put("key", "value"); assertEquals(0, advanced.getStats().getMisses()); assertEquals(0, advanced.getStats().getHits()); hitRatioString = server.getAttribute(mgmtInterceptor, "HitRatio").toString(); hitRatio = Float.parseFloat(hitRatioString); assertEquals(0f, hitRatio); Set<String> keySet = new HashSet<>(); keySet.add("key"); keySet.add("key1"); advanced.getAll(keySet); assertEquals(1, advanced.getStats().getMisses()); assertEquals(1, advanced.getStats().getHits()); hitRatioString = server.getAttribute(mgmtInterceptor, "HitRatio").toString(); hitRatio = Float.parseFloat(hitRatioString); assertEquals(0.5f, hitRatio); }
Source:
<code>private static MetricRegistry createMetricRegistry() { LOG.info("Creating Metric Registry for Phoenix Global Metrics"); <START> MetricRegistryInfo registryInfo = new MetricRegistryInfo("PHOENIX", "Phoenix Global Metrics", <END> "phoenix", "Phoenix,sub=PHOENIX", true); return MetricRegistries.global().create(registryInfo); }</code><technical_language>"Global" in this context? Is "Phoenix Client Metrics" more reasonable? "Phoenix,sub=CLIENT" below</technical_language>

Target:
private static MetricRegistry createMetricRegistry() { LOG.info("Creating Metric Registry for Phoenix Global Metrics"); MetricRegistryInfo registryInfo = new MetricRegistryInfo("PHOENIX", "Phoenix Client Metrics", "phoenix", "Phoenix,sub=CLIENT", true); return MetricRegistries.global().create(registryInfo); }
Source:
<code>private boolean isSet(ReferenceChange diff, boolean mergeRightToLeft) { if (diff.getKind() != DifferenceKind.CHANGE) { return false; } final EObject container = getContainer(diff, mergeRightToLeft); boolean isSet = false; if (container != null && diff.getReference() != null) { <START> isSet = !ComparisonUtil.isEqualToDefault(container, diff.getReference()); <END> } return isSet; }</code><technical_language>need "isEqualToDefault" for references. default of a reference is "null" (and thus, simply rely "eIsUnset" in this case). This method reset "private" in ComparisonUtil</technical_language>

Target:
private boolean isSet(ReferenceChange diff, boolean mergeRightToLeft) { if (diff.getKind() != DifferenceKind.CHANGE) { return false; } boolean isSet = false; final Match match = diff.getMatch(); final EObject container; if (diff.getSource() == DifferenceSource.LEFT) { container = match.getLeft(); } else { container = match.getRight(); } if (container == null) { isSet = isRejecting(diff, mergeRightToLeft); } else { if (!ReferenceUtil.safeEIsSet(container, diff.getReference())) { isSet = isRejecting(diff, mergeRightToLeft); } else { if (isRejecting(diff, mergeRightToLeft)) { final EObject originContainer; if (match.getComparison().isThreeWay()) { originContainer = match.getOrigin(); } else if (mergeRightToLeft) { originContainer = match.getRight(); } else { originContainer = match.getLeft(); } isSet = originContainer != null && ReferenceUtil.safeEIsSet(originContainer, diff.getReference()); } else { isSet = true; } } } return isSet; }
Source:
<code>private void initCacheConfig(Map conf) { Preconditions.checkNotNull(conf.get("topology.monitoring.latencies.map.maxSize"), <START> "expected configuration to contain maxSize for latency map."); <END> Preconditions.checkNotNull(conf.get("topology.monitoring.latencies.map.maxTimeSeconds"), "expected configuration to contain maxTimeSeconds for latency map."); Preconditions.checkNotNull(conf.get("topology.monitoring.latencies.map.maxConcurrency"), "expected configuration to contain maxConcurrency for latency map."); maxSize = (long) conf.get("topology.monitoring.latencies.map.maxSize"); maxTime = (long) conf.get("topology.monitoring.latencies.map.maxTimeSeconds"); maxConcurrency = Ints.checkedCast((long) conf.get("topology.monitoring.latencies.map.maxConcurrency")); }</code><technical_language>Please configure topology.monitoring.latencies.map.maxSize maximum number of concurrent executing tuples bolt</technical_language>

Target:
private void initCacheConfig(Map conf) { Object maxSizeConf = conf.get("topology.monitoring.latencies.map.maxSize"); Object maxTimeConf = conf.get("topology.monitoring.latencies.map.maxTimeSeconds"); Object maxConcurrencyConf = conf.get("topology.monitoring.latencies.map.maxConcurrency"); maxSize = (maxSizeConf == null ? MAX_SIZE_DEFAULT : (long) maxConcurrencyConf); maxTime = (maxTimeConf == null ? MAX_TIME_DEFAULT : (long) maxConcurrencyConf); maxConcurrency = (maxConcurrencyConf == null ? MAX_CONCURRENCY_DEFAULT: Ints.checkedCast((long)maxConcurrencyConf)); }
Source:
<code><START> Set<String> listFilenames(RepositoryPath path) <END> throws IOException; default Set<String> getEntriesNames(final ArchiveInputStream archiveInputStream) throws IOException { final Set<String> result = new HashSet<>(); ArchiveEntry entry; while ((entry = archiveInputStream.getNextEntry()) != null) { result.add(entry.getName()); } return result; }</code><technical_language>please rename this listFilenames</technical_language>

Target:
Set<String> listFilenames(RepositoryPath path) throws IOException; default Set<String> getEntryNames(final ArchiveInputStream archiveInputStream) throws IOException { final Set<String> result = new HashSet<>(); ArchiveEntry entry; while ((entry = archiveInputStream.getNextEntry()) != null) { result.add(entry.getName()); } return result; }
Source:
<code>public NonConcurrentSingleton(Recorder recorder) throws InterruptedException { recorder.record(getClass()); <START> LOG.info("Child1 start"); <END> TimeUnit.SECONDS.sleep(1); LOG.info("Child1 end"); }</code><technical_language>trivial copy-and-paste typo</technical_language>

Target:
public NonConcurrentSingleton(Recorder recorder) throws InterruptedException { recorder.record(getClass()); LOG.info("NonConcurrentSingleton start"); TimeUnit.SECONDS.sleep(1); LOG.info("NonConcurrentSingleton end"); }
Source:
<code>public void createConfigurationSource(String dest) throws FileNotFoundException, UnsupportedEncodingException { StringBuilder source = new StringBuilder(""); source.append(PrivateFunctionalTemplates.include(RuntimeTemplates.RuntimeHeaderName)); source.append(PrivateFunctionalTemplates.include(GenerationNames.FileNames.TypesFilePath)); source.append("\n\n"); List<String> templateParams = new ArrayList<String>(); templateParams.add(ConfiguratedThreadedRuntimeName); source.append(GenerationTemplates.usingTemplateType(RuntimeTemplates.UsingRuntimePtr, RuntimeTemplates.RuntimePtrType, templateParams)); source.append(GenerationTemplates.usingTemplateType(RuntimeTemplates.UsingRuntimeType, RuntimeTemplates.RuntimeInterfaceName, templateParams)); source.append("\n\n"); source.append(GenerationTemplates.putNamespace( FunctionTemplates.simpleFunctionDecl(RuntimeTemplates.UsingRuntimePtr, CreatorFunction) + ";", NamespaceName)); CppExporterUtils.writeOutSource(dest, GenerationTemplates.headerName(ConfigurationFile), CppExporterUtils.format(HeaderTemplates.headerGuard(source.toString(), ConfigurationFile))); CppExporterUtils.writeOutSource(dest, GenerationTemplates.sourceName(ConfigurationFile), <START> CppExporterUtils.format(createDeplyomentFunctionDefinition())); <END> }</code><technical_language>Typo: createDeploymentFunctionDefinition</technical_language>

Target:
public void createConfigurationSource(String dest) throws FileNotFoundException, UnsupportedEncodingException { StringBuilder source = new StringBuilder(""); source.append(PrivateFunctionalTemplates.include(RuntimeTemplates.RuntimeHeaderName)); source.append(PrivateFunctionalTemplates.include(GenerationNames.FileNames.TypesFilePath)); source.append("\n\n"); List<String> templateParams = new ArrayList<String>(); templateParams.add(ConfiguratedThreadedRuntimeName); source.append(GenerationTemplates.usingTemplateType(RuntimeTemplates.UsingRuntimePtr, RuntimeTemplates.RuntimePtrType, templateParams)); source.append(GenerationTemplates.usingTemplateType(RuntimeTemplates.UsingRuntimeType, RuntimeTemplates.RuntimeInterfaceName, templateParams)); source.append("\n\n"); source.append(GenerationTemplates.putNamespace( FunctionTemplates.simpleFunctionDecl(RuntimeTemplates.UsingRuntimePtr, CreatorFunction) + ";", NamespaceName)); CppExporterUtils.writeOutSource(dest, GenerationTemplates.headerName(ConfigurationFile), CppExporterUtils.format(HeaderTemplates.headerGuard(source.toString(), ConfigurationFile))); CppExporterUtils.writeOutSource(dest, GenerationTemplates.sourceName(ConfigurationFile), CppExporterUtils.format(createDeploymentFunctionDefinition())); }
Source:
<code>public double priceFromCurvesWithZSpread( ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear) { ArgChecker.isTrue(settlementDate.isBefore(bill.getNotional().getDate()), "settlement date must be before maturity date"); ArgChecker.isTrue(!settlementDate.isBefore(provider.getValuationDate()), "settlement date must be on or after valuation date"); IssuerCurveDiscountFactors discountFactors = provider.issuerCurveDiscountFactors( bill.getLegalEntityId(), bill.getCurrency()); double dfMaturity = discountFactors.getDiscountFactors() .discountFactorWithSpread(bill.getNotional().getDate(), zSpread, compoundedRateType, periodsPerYear); RepoCurveDiscountFactors discountFactorsRepo = provider.repoCurveDiscountFactors(bill.getSecurityId(), bill.getLegalEntityId(), bill.getCurrency()); double dfRepoSettle = discountFactorsRepo.discountFactor(settlementDate); double price = dfMaturity / dfRepoSettle; <START> return price; <END> }</code><technical_language>Inline variable</technical_language>

Target:
public double priceFromCurvesWithZSpread( ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear) { ArgChecker.inOrderNotEqual(settlementDate, bill.getNotional().getDate(), "settlementDate", "endDate"); ArgChecker.inOrderOrEqual(provider.getValuationDate(), settlementDate, "valuationDate", "settlementDate"); IssuerCurveDiscountFactors discountFactors = provider.issuerCurveDiscountFactors( bill.getLegalEntityId(), bill.getCurrency()); double dfMaturity = discountFactors.getDiscountFactors() .discountFactorWithSpread(bill.getNotional().getDate(), zSpread, compoundedRateType, periodsPerYear); RepoCurveDiscountFactors discountFactorsRepo = provider.repoCurveDiscountFactors(bill.getSecurityId(), bill.getLegalEntityId(), bill.getCurrency()); double dfRepoSettle = discountFactorsRepo.discountFactor(settlementDate); return dfMaturity / dfRepoSettle; }
Source:
<code><START> private RequestModelGenerator<?> getTemplateModelGenerator(final Ds3Request ds3Request) { <END> if (isBulkRequest(ds3Request)) { return new BulkRequestGenerator(); } else if (isPhysicalPlacementRequest(ds3Request)) { return new PhysicalPlacementRequestGenerator(); } else if (isCreateObjectRequest(ds3Request)) { return new CreateObjectRequestGenerator(); } else if (isCreateNotificationRequest(ds3Request)) { return new CreateNotificationRequestGenerator(); } else if (isGetNotificationRequest(ds3Request) || isDeleteNotificationRequest(ds3Request)) { return new NotificationRequestGenerator(); } return new BaseRequestGenerator(); }</code><technical_language>This static</technical_language>

Target:
private static RequestModelGenerator<?> getTemplateModelGenerator(final Ds3Request ds3Request) { if (isBulkRequest(ds3Request)) { return new BulkRequestGenerator(); } else if (isPhysicalPlacementRequest(ds3Request)) { return new PhysicalPlacementRequestGenerator(); } else if (isCreateObjectRequest(ds3Request)) { return new CreateObjectRequestGenerator(); } else if (isCreateNotificationRequest(ds3Request)) { return new CreateNotificationRequestGenerator(); } else if (isGetNotificationRequest(ds3Request) || isDeleteNotificationRequest(ds3Request)) { return new NotificationRequestGenerator(); } return new BaseRequestGenerator(); }
Source:
<code>private void handleGetContainerAcl(HttpServletResponse response, BlobStore blobStore, String containerName) throws IOException, S3Exception { if (!blobStore.containerExists(containerName)) { throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET); <START> } <END> response.setCharacterEncoding(UTF_8); try (Writer writer = response.getWriter()) { response.setContentType(XML_CONTENT_TYPE); XMLStreamWriter xml = xmlOutputFactory.createXMLStreamWriter( writer); xml.writeStartDocument(); xml.writeStartElement("AccessControlPolicy"); xml.writeDefaultNamespace(AWS_XMLNS); writeOwnerStanza(xml); xml.writeStartElement("AccessControlList"); xml.writeStartElement("Grant"); xml.writeStartElement("Grantee"); xml.writeNamespace("xsi", "<LINK_1>"); xml.writeAttribute("xsi:type", "CanonicalUser"); writeSimpleElement(xml, "ID", FAKE_OWNER_ID); writeSimpleElement(xml, "DisplayName", FAKE_OWNER_DISPLAY_NAME); xml.writeEndElement(); writeSimpleElement(xml, "Permission", "FULL_CONTROL"); xml.writeEndElement(); if (ContainerAccess.PUBLIC_READ .equals(blobStore.getContainerAccess(containerName))) { xml.writeStartElement("Grant"); xml.writeStartElement("Grantee"); xml.writeNamespace("xsi", "<LINK_1>"); xml.writeAttribute("xsi:type", "Group"); writeSimpleElement(xml, "URI", "<LINK_0>"); xml.writeEndElement(); writeSimpleElement(xml, "Permission", "READ"); xml.writeEndElement(); } xml.writeEndElement(); xml.writeEndElement(); xml.flush(); } catch (XMLStreamException xse) { throw new IOException(xse); } }</code><technical_language>add getContainerAccess call containerExists? This minimizes diff avoids exceptions while writing response client</technical_language>

Target:
private void handleGetContainerAcl(HttpServletResponse response, BlobStore blobStore, String containerName) throws IOException, S3Exception { if (!blobStore.containerExists(containerName)) { throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET); } ContainerAccess access = blobStore.getContainerAccess(containerName); response.setCharacterEncoding(UTF_8); try (Writer writer = response.getWriter()) { response.setContentType(XML_CONTENT_TYPE); XMLStreamWriter xml = xmlOutputFactory.createXMLStreamWriter( writer); xml.writeStartDocument(); xml.writeStartElement("AccessControlPolicy"); xml.writeDefaultNamespace(AWS_XMLNS); writeOwnerStanza(xml); xml.writeStartElement("AccessControlList"); xml.writeStartElement("Grant"); xml.writeStartElement("Grantee"); xml.writeNamespace("xsi", "<LINK_1>"); xml.writeAttribute("xsi:type", "CanonicalUser"); writeSimpleElement(xml, "ID", FAKE_OWNER_ID); writeSimpleElement(xml, "DisplayName", FAKE_OWNER_DISPLAY_NAME); xml.writeEndElement(); writeSimpleElement(xml, "Permission", "FULL_CONTROL"); xml.writeEndElement(); if (access == ContainerAccess.PUBLIC_READ) { xml.writeStartElement("Grant"); xml.writeStartElement("Grantee"); xml.writeNamespace("xsi", "<LINK_1>"); xml.writeAttribute("xsi:type", "Group"); writeSimpleElement(xml, "URI", "<LINK_0>"); xml.writeEndElement(); writeSimpleElement(xml, "Permission", "READ"); xml.writeEndElement(); } xml.writeEndElement(); xml.writeEndElement(); xml.flush(); } catch (XMLStreamException xse) { throw new IOException(xse); } }
Source:
<code>public ImageData getImageDataFor(ImageDescriptor descriptor) { <START> if (descriptorToImageData.containsKey(descriptor)) { return descriptorToImageData.get(descriptor); } return null; <END> }</code><technical_language>return descriptorToImageData.get(descriptor);</technical_language>

Target:
public ImageData getImageDataFor(ImageDescriptor descriptor) { return descriptorToImageData.get(descriptor); }
Source:
<code>public JInterfaceInvokeExpr(Value base, SootMethodRef methodRef, List<? extends Value> args) { super(Jimple.v().newLocalBox(base), methodRef, new ValueBox[args.size()]); methodRef.declaringClass().checkLevelIgnoreResolving(SootClass.HIERARCHY); if (methodRef.isStatic()) { throw new IllegalArgumentException("Trying to create invokeinterface expression for " <START> + "static method \"" + methodRef.getSignature() + "\". Use invokestatic instead"); <END> } if (methodRef.name().equals(SootMethod.constructorName) || methodRef.name().equals(SootMethod.staticInitializerName)) { throw new IllegalArgumentException("Trying to create invokeinterface expression for " + "<init>/<clinit> method \"" + methodRef.getSignature() + "\". Use invokespecial instead"); } try { if (methodRef.resolve().isPrivate()) { throw new IllegalArgumentException("Trying to create invokeinterface expression for " + "private method \"" + methodRef.getSignature() + "\". Use invokespecial instead"); } } catch (SootMethodRefImpl.ClassResolutionFailedException exception) { } for (int i = 0; i < args.size(); i++) this.argBoxes[i] = Jimple.v().newImmediateBox(args.get(i)); }</code><technical_language>Here, allow methods declared interfaces normal classes well. Ist this correct? I understand language specification, this is illegal. craft example invokeinterface instruction invoke a class declared method</technical_language>

Target:
public JInterfaceInvokeExpr(Value base, SootMethodRef methodRef, List<? extends Value> args) { super(Jimple.v().newLocalBox(base), methodRef, new ValueBox[args.size()]); methodRef.declaringClass().checkLevelIgnoreResolving(SootClass.HIERARCHY); if(!methodRef.declaringClass().isInterface() && !methodRef.declaringClass().isPhantom()) { throw new RuntimeException("Trying to create interface invoke expression for non-interface type: " + methodRef.declaringClass() + " Use JVirtualInvokeExpr or JSpecialInvokeExpr instead!"); } for(int i = 0; i < args.size(); i++) this.argBoxes[i] = Jimple.v().newImmediateBox(args.get(i)); }
Source:
<code>public void render(com.google.gwt.cell.client.Cell.Context context, ForumMessage value, SafeHtmlBuilder builder) { if (value != null) { SafeHtml editButtonHtml = null; if (value.isTopic()) { editButtonHtml = QuoteTemplate.INSTANCE.topicEditButton(PageType.ForumEditTopicPageType.asHref().asString(), value.getTopicId()); } else { editButtonHtml = QuoteTemplate.INSTANCE.replyEditButton(PageType.ForumEditTopicPageType.asHref().asString(), value.getTopicId(), value.getId()); } String processedString = value.getContent(); try { processedString = MarkdownHelper.PROCESSOR.process(value.getContent()); } catch (IOException e) { new RuntimeException(e); } SafeUri link = UriUtils.fromSafeConstant(PageType.ForumThreadPageType.asHref("view", value.getTopicId().toString(), "view", Integer.toString(value.getIndex())).asString()); User author = value.getAuthor(); String companyName = ""; if (author != null) { <START> SafeHtmlUtils.htmlEscape(FormattingHelper.getCompanyName(author)); <END> } RENDERER.render(builder, FormattingHelper.getUserName(author), companyName, SafeHtmlUtils.fromTrustedString(processedString), FormattingHelper .getTimeSince(value.getCreated()), link, value.canFlag() ? " | " : "", value.canFlag() ? "Flag" : "", value.canEdit() ? " | " : "", value .canEdit() ? editButtonHtml : SafeHtmlUtils.EMPTY_SAFE_HTML, value.canQuote() ? " | " : "", value.canQuote() ? "Quote" : ""); } }</code><technical_language>companyName assigned escaped html</technical_language>

Target:
public void render(com.google.gwt.cell.client.Cell.Context context, ForumMessage value, SafeHtmlBuilder builder) { if (value != null) { SafeHtml editButtonHtml = null; if (value.isTopic()) { editButtonHtml = QuoteTemplate.INSTANCE.topicEditButton(PageType.ForumEditTopicPageType.asHref().asString(), value.getTopicId()); } else { editButtonHtml = QuoteTemplate.INSTANCE.replyEditButton(PageType.ForumEditTopicPageType.asHref().asString(), value.getTopicId(), value.getId()); } String processedString = value.getContent(); try { processedString = MarkdownHelper.PROCESSOR.process(value.getContent()); } catch (IOException e) { new RuntimeException(e); } SafeUri link = UriUtils.fromSafeConstant(PageType.ForumThreadPageType.asHref("view", value.getTopicId().toString(), "view", Integer.toString(value.getIndex())).asString()); User author = value.getAuthor(); String companyName = ""; if (author != null) { companyName = SafeHtmlUtils.htmlEscape(FormattingHelper.getCompanyName(author)); } RENDERER.render(builder, FormattingHelper.getUserName(author), companyName, SafeHtmlUtils.fromTrustedString(processedString), FormattingHelper .getTimeSince(value.getCreated()), link, value.canFlag() ? " | " : "", value.canFlag() ? "Flag" : "", value.canEdit() ? " | " : "", value .canEdit() ? editButtonHtml : SafeHtmlUtils.EMPTY_SAFE_HTML, value.canQuote() ? " | " : "", value.canQuote() ? "Quote" : ""); } }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) { UploadUrlResponse uploadUrl = (UploadUrlResponse) postParams.get("uploadUrl"); B2Object b2Object = (B2Object) postParams.get("b2Object"); <START> Preconditions.checkArgument(b2Object.fileId() == null, "fileId must be null, was %s", b2Object.fileId()); <END> Preconditions.checkArgument(b2Object.uploadTimestamp() == null, "uploadTimestamp must be null, was %s", b2Object.uploadTimestamp()); HttpRequest.Builder builder = request.toBuilder() .endpoint(uploadUrl.uploadUrl()) .replaceHeader(HttpHeaders.AUTHORIZATION, uploadUrl.authorizationToken()) .replaceHeader(B2Headers.FILE_NAME, escaper.escape(b2Object.fileName())) .replaceHeader(B2Headers.CONTENT_SHA1, b2Object.contentSha1()) .payload(b2Object.payload()); for (Map.Entry<String, String> entry : b2Object.fileInfo().entrySet()) { builder.replaceHeader(B2Headers.FILE_INFO_PREFIX + entry.getKey(), entry.getValue()); } return (R) builder.build(); }</code><technical_language>handle this (in Openstack providers) if 2 separate classes, is create object, is reading object. fields for updating reading incorrectly. AutoValue easier implement - implement a regular autovalue for "read" version of class, implement AutoValue AutoValue builder for create/update (update a separate class well). I client-side validation checks is largely empty work removing helps (sometimes completely) eliminate binders mappers. Thoughts</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) { UploadUrlResponse uploadUrl = (UploadUrlResponse) postParams.get("uploadUrl"); String fileName = (String) postParams.get("fileName"); Map<String, String> fileInfo = (Map<String, String>) postParams.get("fileInfo"); HttpRequest.Builder builder = request.toBuilder() .endpoint(uploadUrl.uploadUrl()) .replaceHeader(HttpHeaders.AUTHORIZATION, uploadUrl.authorizationToken()) .replaceHeader(B2Headers.FILE_NAME, escaper.escape(fileName)); for (Map.Entry<String, String> entry : fileInfo.entrySet()) { builder.replaceHeader(B2Headers.FILE_INFO_PREFIX + entry.getKey(), entry.getValue()); } return (R) builder.build(); }
Source:
<code>public void sendMessageToAllClients(VoidMessage message, Long... exclusions) { if (nodeRole != NodeRole.SHARD) throw new ND4JIllegalStateException("Only SHARD allowed to send messages to all Clients"); final DirectBuffer buffer = message.asUnsafeBuffer(); final AtomicInteger cnt = new AtomicInteger(0); clients.values().parallelStream().filter(rc -> { if (rc.getLongHash() == this.originatorId || rc.getLongHash() == 0) { return false; } if (exclusions != null && cnt.get() < exclusions.length) { for (Long exclude : exclusions) if (exclude.longValue() == rc.getLongHash()) { cnt.incrementAndGet(); return false; } } return true; }).forEach((rc)->{ RetransmissionHandler.TransmissionStatus res; long retr = 0; boolean delivered = false; while (!delivered) { synchronized (rc.locker) { res = RetransmissionHandler.getTransmissionStatus(rc.getPublication().offer(buffer)); } switch (res) { case NOT_CONNECTED: { if (!rc.getActivated().get()) { retr++; if (retr > 20) throw new ND4JIllegalStateException( "Can't connect to Shard: [" + rc.getPublication().channel() + "]"); try { <START> Thread.sleep(voidConfiguration.getRetransmitTimeout()); <END> } catch (Exception e) { } } else { throw new ND4JIllegalStateException("Shards reassignment is to be implemented yet"); } } break; case ADMIN_ACTION: case BACKPRESSURE: { try { Thread.sleep(voidConfiguration.getRetransmitTimeout()); } catch (Exception e) { } } break; case MESSAGE_SENT: delivered = true; rc.getActivated().set(true); break; } } }); }</code><technical_language>aeron's wait mechanisms instead of Thread.sleep</technical_language>

Target:
public void sendMessageToAllClients(VoidMessage message, Long... exclusions) { if (nodeRole != NodeRole.SHARD) throw new ND4JIllegalStateException("Only SHARD allowed to send messages to all Clients"); final DirectBuffer buffer = message.asUnsafeBuffer(); final AtomicInteger cnt = new AtomicInteger(0); clients.values().parallelStream().filter(rc -> { if (rc.getLongHash() == this.originatorId || rc.getLongHash() == 0) { return false; } if (exclusions != null && cnt.get() < exclusions.length) { for (Long exclude : exclusions) if (exclude.longValue() == rc.getLongHash()) { cnt.incrementAndGet(); return false; } } return true; }).forEach((rc)->{ RetransmissionHandler.TransmissionStatus res; long retr = 0; boolean delivered = false; while (!delivered) { synchronized (rc.locker) { res = RetransmissionHandler.getTransmissionStatus(rc.getPublication().offer(buffer)); } switch (res) { case NOT_CONNECTED: { if (!rc.getActivated().get()) { retr++; if (retr > 20) throw new ND4JIllegalStateException( "Can't connect to Shard: [" + rc.getPublication().channel() + "]"); try { LockSupport.parkNanos(voidConfiguration.getRetransmitTimeout() * 1000000); } catch (Exception e) { throw new RuntimeException(e); } } else { throw new ND4JIllegalStateException("Shards reassignment is to be implemented yet"); } } break; case ADMIN_ACTION: case BACKPRESSURE: { try { LockSupport.parkNanos(voidConfiguration.getRetransmitTimeout() * 1000000); } catch (Exception e) { throw new RuntimeException(e); } } break; case MESSAGE_SENT: delivered = true; rc.getActivated().set(true); break; } } }); }
Source:
<code>protected NameSpace getGeoJsonNameSpace() { <START> HashMap<Profile, NameSpace> profileMap = new HashMap<>(); <END> profileMap.put(Profile.SIMPLE_STATION, NameSpace.SIMPLE_STATION); profileMap.put(Profile.SUMMARY_STATION, NameSpace.SUMMARY_STATION); profileMap.put(Profile.SUMMARY_ORGANIZATION, NameSpace.SUMMARY_ORGANIZATION); NameSpace currentNameSpace = profileMap.get(getProfile()); return currentNameSpace; }</code><technical_language>Please a switch case gettJsonTransformer</technical_language>

Target:
protected NameSpace getGeoJsonNameSpace() { Profile currentProfile = getProfile(); if (currentProfile == null) { return null; } switch(currentProfile) { case SUMMARY_STATION: return NameSpace.SUMMARY_STATION; default: return NameSpace.SIMPLE_STATION; } }
Source:
<code>public Collection<MetamodelDescriptor> provides(final Collection<Viewpoint> enabledViewpoints) { final Collection<MetamodelDescriptor> result = <START> Lists.newArrayList(); <END> Collection<MetamodelDescriptorProvider> providersList = providers; for (MetamodelDescriptorProvider2 provider : Iterables.filter(providersList, MetamodelDescriptorProvider2.class)) { final Collection<MetamodelDescriptor> provided = provider.provides(enabledViewpoints); if (provided != null) { result.addAll(provided); } } for (Viewpoint vp : enabledViewpoints) { for (MetamodelDescriptorProvider provider : providersList) { if (!(provider instanceof MetamodelDescriptorProvider2)) { final Collection<MetamodelDescriptor> provided = provider.provides(vp); if (provided != null) { result.addAll(provided); } } } } return result; }</code><technical_language>a LinkedHashSet avoid duplicates providers provided extension point, if is currently duplicate in contributions done Sirius core dialect diagram types, this change due external contributions and/or changes in ours</technical_language>

Target:
public Collection<MetamodelDescriptor> provides(final Collection<Viewpoint> enabledViewpoints) { final Collection<MetamodelDescriptor> result = Sets.newLinkedHashSet(); for (MetamodelDescriptorProvider2 provider : Iterables.filter(providers, MetamodelDescriptorProvider2.class)) { final Collection<MetamodelDescriptor> provided = provider.provides(enabledViewpoints); if (provided != null) { result.addAll(provided); } } for (Viewpoint vp : enabledViewpoints) { for (MetamodelDescriptorProvider provider : providers) { if (!(provider instanceof MetamodelDescriptorProvider2)) { final Collection<MetamodelDescriptor> provided = provider.provides(vp); if (provided != null) { result.addAll(provided); } } } } return result; }
Source:
<code>public long estimateMemorySize() { long size = SIZE_OF_QUAD_TREE_IMPL + (m_extent != null ? m_extent.estimateMemorySize() : 0) + (m_data_extent != null ? m_data_extent.estimateMemorySize() : 0) + (m_quad_tree_nodes != null ? m_quad_tree_nodes.estimateMemorySize() : 0) + (m_element_nodes != null ? m_element_nodes.estimateMemorySize() : 0) + (m_free_data != null ? m_free_data.estimateMemorySize() : 0); if (m_data != null) { size += sizeOfObjectArray(m_data.size()); <START> for (Data data : m_data) { <END> size += data.estimateMemorySize(); } } return size; }</code><technical_language>m_data.size() * SIZE_OF_DATA in for loop</technical_language>

Target:
public long estimateMemorySize() { long size = SIZE_OF_QUAD_TREE_IMPL + (m_extent != null ? m_extent.estimateMemorySize() : 0) + (m_data_extent != null ? m_data_extent.estimateMemorySize() : 0) + (m_quad_tree_nodes != null ? m_quad_tree_nodes.estimateMemorySize() : 0) + (m_element_nodes != null ? m_element_nodes.estimateMemorySize() : 0) + (m_free_data != null ? m_free_data.estimateMemorySize() : 0); if (m_data != null) { size += sizeOfObjectArray(m_data.size()) + m_data.size() * SIZE_OF_DATA; } return size; }
Source:
<code>private void swapFragments(int index, boolean addToStack, Category category){ Fragment fragment = null; switch (index){ case CATEGORIES: if (mCategoriesFragment == null){ mCategoriesFragment = new MyPrioritiesCategoriesFragment(); } fragment = mCategoriesFragment; break; case GOALS: mGoalsFragment = new MyPrioritiesGoalsFragment(); fragment = mGoalsFragment; Bundle args = new Bundle(); args.putSerializable("category", category); fragment.setArguments(args); break; default: break; } if (fragment != null){ if (addToStack){ mFragmentStack.add(fragment); } if (index == CATEGORIES){ <START> mToolbar.setTitle("My Priorities"); <END> if (firstTransition){ getFragmentManager().beginTransaction() .setCustomAnimations(0, R.animator.fade_out_downwards) .replace(R.id.my_priorities_fragment_host, fragment) .commit(); firstTransition = false; } else{ getFragmentManager().beginTransaction() .setCustomAnimations(R.animator.fade_in, R.animator.fade_out_downwards) .replace(R.id.my_priorities_fragment_host, fragment) .commit(); } } else{ mToolbar.setTitle(category.getTitle()); getFragmentManager().beginTransaction() .setCustomAnimations(R.animator.fade_in_upwards, R.animator.fade_out) .replace(R.id.my_priorities_fragment_host, fragment) .commit(); } } }</code><technical_language>lets put this ("My Priorities") in strings.xml somewhere. a for this (e.g. title of nav drawer menu)</technical_language>

Target:
private void swapFragments(int index, boolean addToStack, Category category){ Fragment fragment = null; switch (index){ case CATEGORIES: if (mCategoriesFragment == null){ mCategoriesFragment = new MyPrioritiesCategoriesFragment(); } fragment = mCategoriesFragment; break; case GOALS: mGoalsFragment = new MyPrioritiesGoalsFragment(); fragment = mGoalsFragment; Bundle args = new Bundle(); args.putSerializable("category", category); fragment.setArguments(args); break; default: break; } if (fragment != null){ if (addToStack){ mFragmentStack.add(fragment); } if (index == CATEGORIES){ mToolbar.setTitle(R.string.my_priorities_title); if (firstTransition){ getFragmentManager().beginTransaction() .setCustomAnimations(0, R.animator.fade_out_downwards) .replace(R.id.my_priorities_fragment_host, fragment) .commit(); firstTransition = false; } else{ getFragmentManager().beginTransaction() .setCustomAnimations(R.animator.fade_in, R.animator.fade_out_downwards) .replace(R.id.my_priorities_fragment_host, fragment) .commit(); } } else{ mToolbar.setTitle(category.getTitle()); getFragmentManager().beginTransaction() .setCustomAnimations(R.animator.fade_in_upwards, R.animator.fade_out) .replace(R.id.my_priorities_fragment_host, fragment) .commit(); } } }
Source:
<code>private static Optional<FileStoreAttributes> readFromConfig( FileStore s) { StoredConfig userConfig = GlobalConfigCache.getInstance() <START> .getUserConfig(); <END> String key = getConfigKey(s); Duration resolution = Duration.ofNanos(userConfig.getTimeUnit( ConfigConstants.CONFIG_FILESYSTEM_SECTION, key, ConfigConstants.CONFIG_KEY_TIMESTAMP_RESOLUTION, UNDEFINED_DURATION.toNanos(), TimeUnit.NANOSECONDS)); if (UNDEFINED_DURATION.equals(resolution)) { return Optional.empty(); } Duration minRacyThreshold = Duration.ofNanos(userConfig.getTimeUnit( ConfigConstants.CONFIG_FILESYSTEM_SECTION, key, ConfigConstants.CONFIG_KEY_MIN_RACY_THRESHOLD, UNDEFINED_DURATION.toNanos(), TimeUnit.NANOSECONDS)); FileStoreAttributes c = new FileStoreAttributes(resolution); if (!UNDEFINED_DURATION.equals(minRacyThreshold)) { c.minimalRacyInterval = minRacyThreshold; } return Optional.of(c); }</code><technical_language>Throws RuntimeException if config read</technical_language>

Target:
private static Optional<FileStoreAttributes> readFromConfig( FileStore s) { StoredConfig userConfig; try { userConfig = GlobalConfigCache.getInstance().getUserConfig(); } catch (IOException | ConfigInvalidException e) { LOG.error(JGitText.get().readFileStoreAttributesFailed, e); return Optional.empty(); } String key = getConfigKey(s); Duration resolution = Duration.ofNanos(userConfig.getTimeUnit( ConfigConstants.CONFIG_FILESYSTEM_SECTION, key, ConfigConstants.CONFIG_KEY_TIMESTAMP_RESOLUTION, UNDEFINED_DURATION.toNanos(), TimeUnit.NANOSECONDS)); if (UNDEFINED_DURATION.equals(resolution)) { return Optional.empty(); } Duration minRacyThreshold = Duration.ofNanos(userConfig.getTimeUnit( ConfigConstants.CONFIG_FILESYSTEM_SECTION, key, ConfigConstants.CONFIG_KEY_MIN_RACY_THRESHOLD, UNDEFINED_DURATION.toNanos(), TimeUnit.NANOSECONDS)); FileStoreAttributes c = new FileStoreAttributes(resolution); if (!UNDEFINED_DURATION.equals(minRacyThreshold)) { c.minimalRacyInterval = minRacyThreshold; } return Optional.of(c); }