auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private CompiledQuery compileUsingModel(SqlExecutionContext executionContext) throws SqlException { lexer.unparse(); codeGenerator.clear(); ExecutionModel executionModel = compileExecutionModel(executionContext); switch (executionModel.getModelType()) { case ExecutionModel.QUERY: <START> LOG.info().$("Compiled model: ").$((QueryModel) executionModel).$(); <END> return compiledQuery.of(generate((QueryModel) executionModel, executionContext)); case ExecutionModel.CREATE_TABLE: return createTableWithRetries(executionModel, executionContext); case ExecutionModel.COPY: return executeCopy(executionContext, (CopyModel) executionModel); case ExecutionModel.RENAME_TABLE: final RenameTableModel rtm = (RenameTableModel) executionModel; engine.rename(executionContext.getCairoSecurityContext(), path, GenericLexer.unquote(rtm.getFrom().token), renamePath, GenericLexer.unquote(rtm.getTo().token)); return compiledQuery.ofRenameTable(); default: InsertModel insertModel = (InsertModel) executionModel; if (insertModel.getQueryModel() != null) { return executeWithRetries( insertAsSelectMethod, executionModel, configuration.getCreateAsSelectRetryCount(), executionContext ); } return insert(executionModel, executionContext); } }</code><technical_language>This is hard trace in multi-user environment. Compiled model for SQL? FD</technical_language>

Target:
private CompiledQuery compileUsingModel(SqlExecutionContext executionContext) throws SqlException { lexer.unparse(); codeGenerator.clear(); ExecutionModel executionModel = compileExecutionModel(executionContext); switch (executionModel.getModelType()) { case ExecutionModel.QUERY: LOG.info().$("compiled ").$((QueryModel) executionModel).$(" [fd=").$(executionContext.getRequestFd()).$(']').$(); return compiledQuery.of(generate((QueryModel) executionModel, executionContext)); case ExecutionModel.CREATE_TABLE: return createTableWithRetries(executionModel, executionContext); case ExecutionModel.COPY: return executeCopy(executionContext, (CopyModel) executionModel); case ExecutionModel.RENAME_TABLE: final RenameTableModel rtm = (RenameTableModel) executionModel; engine.rename(executionContext.getCairoSecurityContext(), path, GenericLexer.unquote(rtm.getFrom().token), renamePath, GenericLexer.unquote(rtm.getTo().token)); return compiledQuery.ofRenameTable(); default: InsertModel insertModel = (InsertModel) executionModel; if (insertModel.getQueryModel() != null) { return executeWithRetries( insertAsSelectMethod, executionModel, configuration.getCreateAsSelectRetryCount(), executionContext ); } return insert(executionModel, executionContext); } }
Source:
<code><START> public static ETwitterCardType getTwitterCardType(@Nullable String identifier) { <END> return ID_MAP.get(identifier).get(); }</code><technical_language>Optional return parameter in enums</technical_language>

Target:
public static Optional<ETwitterCardType> getTwitterCardType(@Nullable String identifier) { return ID_MAP.get(identifier); }
Source:
<code>public long getStartTimestamp() { <START> return startTimestamp; <END> }</code><technical_language>Add this stay consistent other getters here</technical_language>

Target:
public long getStartTimestamp() { return this.startTimestamp; }
Source:
<code>public static Configuration create(final HbaseConfig hbaseConfig) throws IOException { Configuration configuration = HBaseConfiguration.create(); if (isValidFile(hbaseConfig.getCoreSite())) { configuration.addResource(new File(hbaseConfig.getCoreSite()).toURI().toURL()); } if (isValidFile(hbaseConfig.getHdfsSite())) { configuration.addResource(new File(hbaseConfig.getHdfsSite()).toURI().toURL()); } if (isValidFile(hbaseConfig.getHbasePolicy())) { configuration.addResource(new File(hbaseConfig.getHbasePolicy()).toURI().toURL()); } if (isValidFile(hbaseConfig.getHbaseSite())) { configuration.addResource(new File(hbaseConfig.getHbaseSite()).toURI().toURL()); } if (hbaseConfig.isSecure() && isValidFile(hbaseConfig.getKeytabFileName())) { configuration.set("hbase.master.kerberos.principal", hbaseConfig.getAuthString()); configuration.set("hadoop.kerberos.kinit.command", hbaseConfig.getKinitPath()); UserGroupInformation.setConfiguration(configuration); System.setProperty("java.security.krb5.conf", hbaseConfig.getKerberosConfigFile()); <START> if (hbaseConfig.isSecure()) { <END> UserGroupInformation.loginUserFromKeytab( hbaseConfig.getAuthString(), hbaseConfig.getKeytabFileName()); logger.info("Logged into Hbase with User: " + UserGroupInformation.getLoginUser()); } } return configuration; }</code><technical_language>rechecking</technical_language>

Target:
public static Configuration create(final HbaseConfig hbaseConfig) throws IOException { Configuration configuration = HBaseConfiguration.create(); if (isValidFile(hbaseConfig.getCoreSite())) { configuration.addResource(new File(hbaseConfig.getCoreSite()).toURI().toURL()); } if (isValidFile(hbaseConfig.getHdfsSite())) { configuration.addResource(new File(hbaseConfig.getHdfsSite()).toURI().toURL()); } if (isValidFile(hbaseConfig.getHbasePolicy())) { configuration.addResource(new File(hbaseConfig.getHbasePolicy()).toURI().toURL()); } if (isValidFile(hbaseConfig.getHbaseSite())) { configuration.addResource(new File(hbaseConfig.getHbaseSite()).toURI().toURL()); } if (hbaseConfig.isSecure() && isValidFile(hbaseConfig.getKeytabFileName())) { configuration.set("hbase.master.kerberos.principal", hbaseConfig.getAuthString()); configuration.set("hadoop.kerberos.kinit.command", hbaseConfig.getKinitPath()); UserGroupInformation.setConfiguration(configuration); System.setProperty("java.security.krb5.conf", hbaseConfig.getKerberosConfigFile()); UserGroupInformation.loginUserFromKeytab( hbaseConfig.getAuthString(), hbaseConfig.getKeytabFileName()); logger.info("Logged into Hbase with User: " + UserGroupInformation.getLoginUser()); } return configuration; }
Source:
<code>private void addOrUpdateClusterServices(VDSGroup cluster, Map<ServiceType, GlusterServiceStatus> fetchedClusterServiceStatusMap) { Map<ServiceType, GlusterClusterService> existingClusterServiceMap = getClusterServiceMap(cluster); for (Entry<ServiceType, GlusterServiceStatus> entry : fetchedClusterServiceStatusMap.entrySet()) { ServiceType type = entry.getKey(); GlusterServiceStatus status = entry.getValue(); <START> GlusterClusterService foundService = existingClusterServiceMap.get(type); <END> if (foundService == null) { existingClusterServiceMap.put(type, mapServiceTypeToCluster(cluster, type, status)); } else if (foundService.getStatus() != status) { updateClusterServiceStatus(foundService, status); } } }</code><technical_language>foundService existingClusterService</technical_language>

Target:
private void addOrUpdateClusterServices(VDSGroup cluster, Map<ServiceType, GlusterServiceStatus> fetchedClusterServiceStatusMap) { Map<ServiceType, GlusterClusterService> existingClusterServiceMap = getClusterServiceMap(cluster); for (Entry<ServiceType, GlusterServiceStatus> entry : fetchedClusterServiceStatusMap.entrySet()) { ServiceType type = entry.getKey(); GlusterServiceStatus status = entry.getValue(); GlusterClusterService existingClusterService = existingClusterServiceMap.get(type); if (existingClusterService == null) { existingClusterServiceMap.put(type, addClusterServiceToDb(cluster, type, status)); } else if (existingClusterService.getStatus() != status) { updateClusterServiceStatus(existingClusterService, status); } } }
Source:
<code>public void testTimestampMillisStringifier() { PrimitiveStringifier stringifier = PrimitiveStringifier.TIMESTAMP_MILLIS_STRINGIFIER; assertEquals("1970-01-01T00:00:00.000", stringifier.stringify(0l)); <START> assertEquals("1970-01-01T00:00:00.000+0000", PrimitiveStringifier.TIMESTAMP_MILLIS_UTC_STRINGIFIER.stringify(0l)); <END> Calendar cal = Calendar.getInstance(UTC); cal.clear(); cal.set(2017, Calendar.DECEMBER, 15, 10, 9, 54); cal.set(Calendar.MILLISECOND, 120); assertEquals("2017-12-15T10:09:54.120", stringifier.stringify(cal.getTimeInMillis())); cal.clear(); cal.set(1948, Calendar.NOVEMBER, 23, 20, 19, 1); cal.set(Calendar.MILLISECOND, 9); assertEquals("1948-11-23T20:19:01.009", stringifier.stringify(cal.getTimeInMillis())); checkThrowingUnsupportedException(stringifier, Long.TYPE); }</code><technical_language>this more consistent? Currently stringifier is in a local variable, while other is referenced directly</technical_language>

Target:
public void testTimestampMillisStringifier() { for (PrimitiveStringifier stringifier : asList(TIMESTAMP_MILLIS_STRINGIFIER, TIMESTAMP_MILLIS_UTC_STRINGIFIER)) { String timezoneAmendment = (stringifier == TIMESTAMP_MILLIS_STRINGIFIER ? "" : "+0000"); assertEquals(withZoneString("1970-01-01T00:00:00.000", timezoneAmendment), stringifier.stringify(0l)); Calendar cal = Calendar.getInstance(UTC); cal.clear(); cal.set(2017, Calendar.DECEMBER, 15, 10, 9, 54); cal.set(Calendar.MILLISECOND, 120); assertEquals(withZoneString("2017-12-15T10:09:54.120", timezoneAmendment), stringifier.stringify(cal.getTimeInMillis())); cal.clear(); cal.set(1948, Calendar.NOVEMBER, 23, 20, 19, 1); cal.set(Calendar.MILLISECOND, 9); assertEquals(withZoneString("1948-11-23T20:19:01.009", timezoneAmendment), stringifier.stringify(cal.getTimeInMillis())); checkThrowingUnsupportedException(stringifier, Long.TYPE); } }
Source:
<code>public Factory<PaxosLearnerNetworkClient> learner() { return client -> { List<WithDedicatedExecutor<PaxosLearner>> remoteLearners = TimelockPaxosLearnerAdapters .create(useCase(), remoteClients(), useBatchedEndpoints(), client) .stream() .map(withExecutor -> withExecutor.transformService( remote -> metrics().instrument(PaxosLearner.class, remote, client))) .collect(Collectors.toList()); PaxosLearner localLearner = components().learner(client); <START> LocalAndRemotes<PaxosLearner> allLearners = LocalAndRemotes.of(localLearner, remoteLearners.stream().map(WithDedicatedExecutor::service).collect(Collectors.toList())); <END> Map<PaxosLearner, ExecutorService> executorMap = ImmutableMap.<PaxosLearner, ExecutorService>builder() .putAll(KeyedStream.of(remoteLearners) .mapKeys(WithDedicatedExecutor::service) .map(WithDedicatedExecutor::executor) .collectToMap()) .put(localLearner, MoreExecutors.newDirectExecutorService()) .build(); SingleLeaderLearnerNetworkClient uninstrumentedLearner = new SingleLeaderLearnerNetworkClient( allLearners.local(), allLearners.remotes(), quorumSize(), executorMap, PaxosConstants.CANCEL_REMAINING_CALLS); return metrics().instrument(PaxosLearnerNetworkClient.class, uninstrumentedLearner); }; }</code><technical_language>nit: This feel necessary - is a reason pass in local remote (mapping WithExecutor) constructor end</technical_language>

Target:
public Factory<PaxosLearnerNetworkClient> learner() { return client -> { List<WithDedicatedExecutor<PaxosLearner>> remoteLearners = TimelockPaxosLearnerAdapters .create(useCase(), remoteClients(), useBatchedEndpoints(), client) .stream() .map(withExecutor -> withExecutor.transformService( remote -> metrics().instrument(PaxosLearner.class, remote, client))) .collect(Collectors.toList()); PaxosLearner localLearner = components().learner(client); Map<PaxosLearner, ExecutorService> executorMap = ImmutableMap.<PaxosLearner, ExecutorService>builder() .putAll(KeyedStream.of(remoteLearners) .mapKeys(WithDedicatedExecutor::service) .map(WithDedicatedExecutor::executor) .collectToMap()) .put(localLearner, MoreExecutors.newDirectExecutorService()) .build(); SingleLeaderLearnerNetworkClient uninstrumentedLearner = new SingleLeaderLearnerNetworkClient( localLearner, remoteLearners.stream().map(WithDedicatedExecutor::service).collect(Collectors.toList()), quorumSize(), executorMap, PaxosConstants.CANCEL_REMAINING_CALLS); return metrics().instrument(PaxosLearnerNetworkClient.class, uninstrumentedLearner); }; }
Source:
<code>protected void checkStatus(BulkStatus status) { if (status.getState() == State.UNKNOWN || !getContext().getPrincipal().getName().equals(status.getUsername())) { throw new WebResourceNotFoundException("Bulk command with id=" + status.getCommandId() + " doesn't exist"); <START> } <END> }</code><technical_language>deny access admin user</technical_language>

Target:
protected void checkStatus(BulkStatus status) { if (status.getState() == State.UNKNOWN || !getContext().getPrincipal().isAdministrator() && !getContext().getPrincipal().getName().equals(status.getUsername())) { throw new WebResourceNotFoundException("Bulk command with id=" + status.getCommandId() + " doesn't exist"); } }
Source:
<code>public void testIsString() throws Exception { assertFalse(AvroUtils.isString(Schema.Type.INT)); <START> assertTrue(AvroUtils.isString(Schema.Type.STRING)); <END> }</code><technical_language>please add asserts for remained avro types</technical_language>

Target:
public void testIsString() throws Exception { assertFalse(AvroUtils.isString(Schema.Type.ARRAY)); assertFalse(AvroUtils.isString(Schema.Type.BOOLEAN)); assertFalse(AvroUtils.isString(Schema.Type.BYTES)); assertFalse(AvroUtils.isString(Schema.Type.DOUBLE)); assertFalse(AvroUtils.isString(Schema.Type.ENUM)); assertFalse(AvroUtils.isString(Schema.Type.FIXED)); assertFalse(AvroUtils.isString(Schema.Type.FLOAT)); assertFalse(AvroUtils.isString(Schema.Type.INT)); assertFalse(AvroUtils.isString(Schema.Type.LONG)); assertFalse(AvroUtils.isString(Schema.Type.MAP)); assertFalse(AvroUtils.isString(Schema.Type.NULL)); assertFalse(AvroUtils.isString(Schema.Type.RECORD)); assertTrue(AvroUtils.isString(Schema.Type.STRING)); assertFalse(AvroUtils.isString(Schema.Type.UNION)); }
Source:
<code>public Subscription schedulePeriodically(final Action0 action, long initialDelay, long period, TimeUnit unit) { final long periodInNanos = unit.toNanos(period); final long startInNanos = TimeUnit.MILLISECONDS.toNanos(now()) + unit.toNanos(initialDelay); final Action0 recursiveAction = new Action0() { long count = 0; @Override public void call() { if (!isUnsubscribed()) { action.call(); long nextTick = startInNanos + (++count * periodInNanos); schedule(this, nextTick - TimeUnit.MILLISECONDS.toNanos(now()), TimeUnit.NANOSECONDS); } } }; <START> return Subscriptions.from(this, schedule(recursiveAction, initialDelay, unit)); <END> }</code><technical_language>This cancel entire worker, recursive action. If a scheduler for general scheduling tasks (instead of Executor) this disrupt worker. This is step better, for 100% correct version, a new subscription type is required. java public Subscription schedulePeriodically(final Action0 action, long initialDelay, long period, TimeUnit unit) { final long periodInNanos = unit.toNanos(period); final long startInNanos = TimeUnit.MILLISECONDS.toNanos(now()) + unit.toNanos(initialDelay); final MultipleAssignmentSubscription mas = new MultipleAssignmentSubscription(); final Action0 recursiveAction = new Action0() { long count = 0; @Override public void call() { if (!mas.isUnsubscribed()) { action.call(); long nextTick = startInNanos + (++count * periodInNanos); mas.set(schedule(this, nextTick - TimeUnit.MILLISECONDS.toNanos(now()), TimeUnit.NANOSECONDS)); } } }; mas.set(schedule(recursiveAction, initialDelay, unit)); return mas; }</technical_language>

Target:
public Subscription schedulePeriodically(final Action0 action, long initialDelay, long period, TimeUnit unit) { final long periodInNanos = unit.toNanos(period); final long startInNanos = TimeUnit.MILLISECONDS.toNanos(now()) + unit.toNanos(initialDelay); final MultipleAssignmentSubscription mas = new MultipleAssignmentSubscription(); final Action0 recursiveAction = new Action0() { long count = 0; @Override public void call() { if (!mas.isUnsubscribed()) { action.call(); long nextTick = startInNanos + (++count * periodInNanos); mas.set(schedule(this, nextTick - TimeUnit.MILLISECONDS.toNanos(now()), TimeUnit.NANOSECONDS)); } } }; mas.set(schedule(recursiveAction, initialDelay, unit)); return mas; }
Source:
<code>public void testWithValidTokenDifferentClient(String opHost, String redirectUrl) throws Exception { DevelopersApi client = Tester.api(); RegisterSiteResponseData siteUnderTest = RegisterSiteTest.registerSite(client, opHost, redirectUrl); final RegisterSiteResponseData differentSite = Tester.getSetupData(); GetClientTokenResponseData tokenResponse = getGetClientTokenResponseData(opHost, client, differentSite); assertNotNull(tokenResponse); final String validHeader = Tester.getAuthorization(differentSite); IntrospectAccessTokenParams iatParams = new IntrospectAccessTokenParams(); iatParams.setAccessToken(tokenResponse.getAccessToken()); iatParams.setOxdId(siteUnderTest.getOxdId()); ApiResponse<IntrospectAccessTokenResponse> apiIatResponse = client.introspectAccessTokenWithHttpInfo(validHeader, iatParams); assertEquals(apiIatResponse.getStatusCode(), 200); assertNotNull(apiIatResponse.getData()); assertTrue("error".equalsIgnoreCase(apiIatResponse.getData().getStatus())); IntrospectAccessTokenResponseData responseData = apiIatResponse.getData().getData(); assertNotNull(responseData); <START> assertTrue(responseData.getError().equals(ErrorResponseCode.INVALID_ID_TOKEN_MISMATCHED_CLIENT_ID.getCode())); <END> }</code><technical_language>assertEquals(ErrorResponseCode.INVALID_ID_TOKEN_MISMATCHED_CLIENT_ID.getCode(), responseData.getError())</technical_language>

Target:
public void testWithValidTokenDifferentClient(String opHost, String redirectUrl) throws Exception { DevelopersApi client = Tester.api(); RegisterSiteResponseData siteUnderTest = RegisterSiteTest.registerSite(client, opHost, redirectUrl); final RegisterSiteResponseData differentSite = Tester.getSetupData(); GetClientTokenResponseData tokenResponse = getGetClientTokenResponseData(opHost, client, differentSite); assertNotNull(tokenResponse); final String validHeader = Tester.getAuthorization(differentSite); IntrospectAccessTokenParams iatParams = new IntrospectAccessTokenParams(); iatParams.setAccessToken(tokenResponse.getAccessToken()); iatParams.setOxdId(siteUnderTest.getOxdId()); ApiResponse<IntrospectAccessTokenResponse> apiIatResponse = client.introspectAccessTokenWithHttpInfo(validHeader, iatParams); assertEquals(apiIatResponse.getStatusCode(), 200); assertNotNull(apiIatResponse.getData()); assertTrue("error".equalsIgnoreCase(apiIatResponse.getData().getStatus())); assertNotNull(apiIatResponse.getData().getData()); assertTrue(apiIatResponse.getData().getData().getError().equals(ErrorResponseCode.INVALID_ACCESS_TOKEN_MISMATCHED_CLIENT_ID.getCode())); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { WikipediaApp app = WikipediaApp.getInstance(); int displayWidth = getDialogWidth(); int displayHeight = inflater.getContext().getResources().getDisplayMetrics().heightPixels; <START> int dialogHeight = (int) (dialogPeekHeight * app.getScreenDensity()); <END> rootView = (ViewGroup) inflater.inflate(R.layout.dialog_bottom_swipe, container); rootView.setLayoutParams(new FrameLayout.LayoutParams(displayWidth, displayHeight)); View emptyViewDismissTrigger = new View(inflater.getContext()); emptyViewDismissTrigger.setLayoutParams(new ListView.LayoutParams(displayWidth, 1)); View emptyViewTop = new View(inflater.getContext()); emptyViewTop.setLayoutParams(new ListView.LayoutParams(displayWidth, dialogHeight)); emptyViewTop.setClickable(true); setDismissOnClick(emptyViewTop); View emptyViewMiddle = new View(inflater.getContext()); emptyViewMiddle.setLayoutParams(new ListView.LayoutParams(displayWidth, displayHeight - dialogHeight)); emptyViewMiddle.setClickable(true); setDismissOnClick(emptyViewMiddle); View dialogView = inflateDialogView(inflater, container); dialogViews = new ArrayList<>(); dialogViews.add(emptyViewDismissTrigger); dialogViews.add(emptyViewTop); dialogViews.add(emptyViewMiddle); dialogViews.add(dialogView); dialogListView = (ListView) rootView.findViewById(R.id.bottom_swipe_container_list); dialogListView.setAdapter(new SwipeableAdapter()); dialogListView.setSelection(dialogViews.indexOf(emptyViewMiddle)); dialogView.post(new Runnable() { @Override public void run() { dialogListView.setOnScrollListener(onScrollListener); } }); return rootView; }</code><technical_language>a shame introduce a WikipediaApp dependency obtain screen density. Consider a small refactor of getContext().getResources().getDisplayMetrics().density; WikipediaApp a utility class</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { int displayWidth = getDialogWidth(); int displayHeight = inflater.getContext().getResources().getDisplayMetrics().heightPixels; int dialogHeight = (int) (dialogPeekHeight * WikipediaApp.getInstance().getScreenDensity()); rootView = (ViewGroup) inflater.inflate(R.layout.dialog_bottom_swipe, container); dialogViews.add(makeSpaceView(displayWidth, 1)); dialogViews.add(makeSpaceView(displayWidth, dialogHeight)); dialogViews.add(makeSpaceView(displayWidth, displayHeight - dialogHeight)); dialogViews.add(inflateDialogView(inflater, container)); dialogListView = (ListView) rootView.findViewById(R.id.bottom_swipe_container_list); dialogListView.setAdapter(new SwipeableAdapter()); dialogListView.setSelection(2); rootView.post(new Runnable() { @Override public void run() { dialogListView.setOnScrollListener(onScrollListener); } }); return rootView; }
Source:
<code>public void appendError(final FlatPushMessageInformation pushMessageInformation, final Variant variant, final String errorMessage) { final VariantErrorStatus ves = new VariantErrorStatus(pushMessageInformation, variant, errorMessage); pushMessageInformation.getErrors().add(ves); try { flatPushMessageInformationDao.update(pushMessageInformation); } catch (Exception e) { <START> logger.info("A VariantErrorStatus has been already added, for the given Variant in this push job"); <END> } }</code><technical_language>catch a generic exception here, reason for failure duplicate key. I change this error message I add exception well. like: java logger.info("Failed save pushMessageInformation: {}", e.getMessage()); logger.debug("Details:", e);</technical_language>

Target:
public void appendError(final FlatPushMessageInformation pushMessageInformation, final Variant variant, final String errorMessage) { final VariantErrorStatus ves = new VariantErrorStatus(pushMessageInformation, variant, errorMessage); pushMessageInformation.getErrors().add(ves); try { flatPushMessageInformationDao.update(pushMessageInformation); } catch (Exception e) { logger.info("Failed to save pushMessageInformation: {}", e.getMessage()); logger.debug("Details:", e); } }
Source:
<code>private void saveFeatures( @Nonnull final XWikiDocument docX, @Nonnull final BaseObject dataHolder, @Nonnull final Patient patient, @Nonnull final PatientData<Feature> features, @Nonnull final PatientWritePolicy policy, @Nonnull final XWikiContext context) { final Stream<Feature> featureStream = PatientWritePolicy.MERGE.equals(policy) ? buildFeaturesStream(load(patient), features) : StreamSupport.stream(features.spliterator(), false); clearFeatureData(docX, dataHolder, context); featureStream <START> .map(feature -> saveFeatureData(docX, feature, context)) <END> .collect(Collectors.groupingBy(this::getFeatureType, Collectors.mapping(Feature::getValue, Collectors.toList())) ).forEach( (type, ids) -> dataHolder.set(type, ids, context) ); }</code><technical_language>kind of debating here. hand, short&nice. other - this is essentially .forEach() masked map() intermediate operation instead of terminal operation. debate is: separating steps reading code easier results in couple extra lines. Personally, is concatenated chain of operations cool hard parse whats in code. Open discussion</technical_language>

Target:
private void saveFeatures( @Nonnull final XWikiDocument docX, @Nonnull final BaseObject dataHolder, @Nonnull final Patient patient, @Nonnull final PatientData<Feature> features, @Nonnull final PatientWritePolicy policy, @Nonnull final XWikiContext context) { final Stream<Feature> featureStream = PatientWritePolicy.MERGE.equals(policy) ? buildFeaturesStream(load(patient), features) : StreamSupport.stream(features.spliterator(), false); clearFeatureData(docX, dataHolder, context); featureStream .collect(Collectors.groupingBy(this::getFeatureType, Collectors.mapping(feature -> saveFeatureAndGetValue(docX, feature, context), Collectors.toList())) ).forEach( (type, ids) -> dataHolder.set(type, ids, context) ); }
Source:
<code><START> public void getRefundedAmount_shouldIncludeCreatedSubmittedAndRefundedRefunds() { <END> RefundEntity refund1 = RefundEntityFixture.aValidRefundEntity().withAmount(10L).withStatus(RefundStatus.CREATED).build(); RefundEntity refund2 = RefundEntityFixture.aValidRefundEntity().withAmount(20L).withStatus(RefundStatus.REFUND_SUBMITTED).build(); RefundEntity refund3 = RefundEntityFixture.aValidRefundEntity().withAmount(30L).withStatus(RefundStatus.REFUNDED).build(); RefundEntity refund4 = RefundEntityFixture.aValidRefundEntity().withAmount(30L).withStatus(RefundStatus.REFUND_ERROR).build(); ChargeEntity chargeEntity = ChargeEntityFixture.aValidChargeEntity() .withRefunds(Arrays.asList(refund1, refund2, refund3, refund4)) .build(); long actualAmount = RefundCalculator.getRefundedAmount(chargeEntity); long expectedAmount = refund1.getAmount() + refund2.getAmount() + refund3.getAmount(); assertThat(actualAmount, is(expectedAmount)); }</code><technical_language>readability of this test increased if named createdRefund, submittedRefund, refundedRefund, errorRefund similar</technical_language>

Target:
public void getRefundedAmount_shouldIncludeCreatedSubmittedAndRefundedRefunds() { RefundEntity createdRefund = RefundEntityFixture.aValidRefundEntity().withAmount(10L).withStatus(RefundStatus.CREATED).build(); RefundEntity submittedRefund = RefundEntityFixture.aValidRefundEntity().withAmount(20L).withStatus(RefundStatus.REFUND_SUBMITTED).build(); RefundEntity refundedRefund = RefundEntityFixture.aValidRefundEntity().withAmount(30L).withStatus(RefundStatus.REFUNDED).build(); RefundEntity errorRefund = RefundEntityFixture.aValidRefundEntity().withAmount(30L).withStatus(RefundStatus.REFUND_ERROR).build(); ChargeEntity chargeEntity = ChargeEntityFixture.aValidChargeEntity() .withRefunds(Arrays.asList(createdRefund, submittedRefund, refundedRefund, errorRefund)) .build(); long actualAmount = RefundCalculator.getRefundedAmount(chargeEntity); long expectedAmount = createdRefund.getAmount() + submittedRefund.getAmount() + refundedRefund.getAmount(); assertThat(actualAmount, is(expectedAmount)); }
Source:
<code>public boolean popAndRedirectMessage(String processorName, String storeName) throws Exception { try { return stub.popAndRedirectMessage(processorName, storeName); } catch (Exception e) { handleException(e); <START> return false; <END> } }</code><technical_language>cha change well</technical_language>

Target:
public boolean popAndRedirectMessage(String processorName, String storeName) throws Exception { try { return stub.popAndRedirectMessage(processorName, storeName); } catch (Exception e) { throw createException("Failed to redirect message to " + storeName, e); } }
Source:
<code>private static void writePart(OutputStream out, Map.Entry<String, TypedOutput> part) throws IOException { String name = part.getKey(); TypedOutput value = part.getValue(); out.write("Content-Disposition: form-data; name=\"".getBytes("UTF-8")); out.write(name.getBytes("UTF-8")); out.write('"'); out.write('\r'); out.write('\n'); out.write("Content-Type: ".getBytes("UTF-8")); out.write(value.mimeType().getBytes("UTF-8")); out.write('\r'); out.write('\n'); out.write("Content-Transfer-Encoding: binary".getBytes("UTF-8")); out.write('\r'); out.write('\n'); <START> out.write('\r'); <END> out.write('\n'); value.writeTo(out); }</code><technical_language>a lot more efficient writes. stream immediately writing is buffered</technical_language>

Target:
private static void writePart(OutputStream out, Map.Entry<String, TypedOutput> part) throws IOException { String name = part.getKey(); TypedOutput value = part.getValue(); StringBuilder headers = new StringBuilder(); headers.append("Content-Disposition: form-data; name=\""); headers.append(name); if (value instanceof TypedFile) { headers.append("; filename=\""); headers.append(((TypedFile) value).file().getName()); } headers.append("\"\r\nContent-Type: "); headers.append(value.mimeType()); headers.append("\r\nContent-Transfer-Encoding: binary\r\n\r\n"); out.write(headers.toString().getBytes("UTF-8")); value.writeTo(out); }
Source:
<code>private void checkLatestVersion() { try { logger.debug("----- Checking version --------------"); <START> <END> String currentVersion = getCurrentVersion(); String versionResponseJson = fetchArtifactVersion(); String latestArtifactVersion = extractVersion(versionResponseJson); Boolean isLatest = extractIsLatest(versionResponseJson); if (isLatest) { logger.info("You are using the latest version!"); } else { warnVersion(latestArtifactVersion, currentVersion); } logger.debug("----- Checking version: Success -----"); } catch (Exception e) { logger.getTreeLogger().log(DEBUG, "Exception caught", e); logger.debug("----- Checking version: Failure -----"); } }</code><technical_language>add this log well. This useful for some users. logger.debug("You disable this check adding this line GWT module:"); logger.debug(" <set-configuration-property name=\"verifyNewerVersion\" value=\"false\"/>");</technical_language>

Target:
private void checkLatestVersion() { try { logger.debug("----- Checking version --------------"); logger.debug("You can disable this check by adding this line to your GWT module:"); logger.debug("<set-configuration-property name=\"verifyNewerVersion\" value=\"false\"/>"); String currentVersion = getCurrentVersion(); String versionResponseJson = fetchArtifactVersion(); String latestArtifactVersion = extractVersion(versionResponseJson); Boolean isLatest = extractIsLatest(versionResponseJson); if (isLatest) { logger.info("You are using the latest version!"); } else { warnVersion(latestArtifactVersion, currentVersion); } logger.debug("----- Checking version: Success -----"); } catch (Exception e) { logger.getTreeLogger().log(DEBUG, "Exception caught", e); logger.debug("----- Checking version: Failure -----"); } }
Source:
<code>public void computationShouldNeverBlockDueToParamValue() throws InterruptedException { service.submit(createBuilder().build()); <START> for (String param : Arrays.asList(PARAM_SCHEMAS, PARAM_XPATHS, PARAM_LANG)) { <END> for (Serializable value : TestCSVProjectionComputation.getValues()) { service.submit(createBuilder().param(param, value).build()); } } assertTrue(service.await(Duration.ofSeconds(10))); }</code><technical_language>test parameters in submit</technical_language>

Target:
public void computationShouldNeverBlockDueToParamValue() throws InterruptedException { service.submit(createBuilder().build()); for (Serializable value : TestCSVProjectionComputation.getValues()) { BulkCommand.Builder builder = createBuilder(); for (String param : Arrays.asList(PARAM_SCHEMAS, PARAM_XPATHS, PARAM_LANG)) { builder.param(param, value); } service.submit(builder.build()); } assertTrue(service.await(Duration.ofSeconds(60))); }
Source:
<code>public void testParsingCombined() { for (DependencyParser parser : parsers) { { DependencyParser.DependencyInfo info = parser.parseDependencies("required:supermod3000@[1.2,)"); assertContainsSameToString(info.requirements, Sets.newHashSet("supermod3000@[1.2,)")); assertTrue(info.dependants.isEmpty()); assertTrue(info.dependencies.isEmpty()); assertTrue(info.softRequirements.isEmpty()); } { String dependencyString = "after:supermod2000@[1.3,);required-before:yetanothermod;softDepMod@[1.0,2.0);required:modW"; DependencyParser.DependencyInfo info = parser.parseDependencies(dependencyString); assertContainsSameToString(info.requirements, Sets.newHashSet("yetanothermod", "modW")); <START> assertContainsSameToString(info.softRequirements, Sets.newHashSet("softDepMod@[1.0,2.0)")); <END> assertContainsSameToString(info.dependencies, Sets.newHashSet("supermod2000@[1.3,)")); assertContainsSameToString(info.dependants, Sets.newHashSet("yetanothermod")); } } }</code><technical_language>lowercase, people reference this test for examples uppercase mod ids is isn't</technical_language>

Target:
public void testParsingCombined() { for (DependencyParser parser : parsers) { String dependencyString = "after:supermod2000@[1.3,);required-before:yetanothermod;required:modw"; DependencyParser.DependencyInfo info = parser.parseDependencies(dependencyString); assertContainsSameToString(info.requirements, Sets.newHashSet("yetanothermod", "modw")); assertContainsSameToString(info.dependencies, Sets.newHashSet("supermod2000@[1.3,)")); assertContainsSameToString(info.dependants, Sets.newHashSet("yetanothermod")); } }
Source:
<code>public static File getFileWithConfirmation(File currentFile, String extension, String description, DialogType type, boolean fixExtension) { File file = currentFile; if(file == null || type == DialogType.SAVEAS) file = FileChooserService.getSelectedFile(extension, description, type, fixExtension); <START> file = FileChooserService.confirmFileSave(file, currentFile); <END> return file; }</code><technical_language>drop "FileChooserService" method calls, methods visible this class</technical_language>

Target:
public static File getFileWithConfirmation(File currentFile, String extension, String description, DialogType type, boolean fixExtension) { File file = currentFile; if(file == null || type == DialogType.SAVEAS) file = getSelectedFile(extension, description, type, fixExtension); file = confirmFileSave(file, currentFile); return file; }
Source:
<code>public RsWithHeaders(final Response res, final Iterable<? extends CharSequence> headers) { super( <START> new RsOf( <END> () -> RsWithHeaders.extend(res, headers), res::body ) ); }</code><technical_language>@fanifieiev above</technical_language>

Target:
public RsWithHeaders(final Response res, final Iterable<? extends CharSequence> headers) { super( new ResponseOf( () -> RsWithHeaders.extend(res, headers), res::body ) ); }
Source:
<code><START> public static String getPreferredVideoUrlForDownloading(@NonNull VideoData video) { <END> String preferredVideoUrl = null; final VideoInfo preferredVideoInfo = video.encodedVideos.getPreferredVideoInfoForDownloading(); if (preferredVideoInfo == null || video.onlyOnWeb) { preferredVideoUrl = null; } else if (!videoHasFormat(preferredVideoInfo.url, VIDEO_FORMAT_M3U8)) { preferredVideoUrl = preferredVideoInfo.url; } if (TextUtils.isEmpty(preferredVideoUrl) && !new Config(MainApplication.instance()).isUsingVideoPipeline()) { for (String url : video.allSources) { if (VideoUtil.videoHasFormat(url, AppConstants.VIDEO_FORMAT_MP4)) { preferredVideoUrl = url; } } } return preferredVideoUrl; }</code><technical_language>code more clean java /** * preferred video url for downloading a {@link VideoData} object. * * @param video Data of video preferred download url is needed. * @return download url of video, return null if unable find suitable url for downloading. */ @Nullable public static String getPreferredVideoUrlForDownloading(@NonNull VideoData video) { String preferredVideoUrl = null; final VideoInfo preferredVideoInfo = video.encodedVideos.getPreferredVideoInfoForDownloading(); if (preferredVideoInfo == null || TextUtils.isEmpty(preferredVideoInfo.url) || video.onlyOnWeb) { preferredVideoUrl = null; } else if (!videoHasFormat(preferredVideoInfo.url, VIDEO_FORMAT_M3U8)) { return preferredVideoInfo.url; } if (!new Config(MainApplication.instance()).isUsingVideoPipeline()) { /** * If preferred video url for downloading HLS format * {@link Config#USING_VIDEO_PIPELINE} feature flag is disabled, try find some .mp4 * format url {@link VideoData#allSources} urls consider for download. */ for (String url : video.allSources) { if (VideoUtil.videoHasFormat(url, AppConstants.VIDEO_FORMAT_MP4)) { preferredVideoUrl = url; } } } return preferredVideoUrl; }</technical_language>

Target:
public static String getPreferredVideoUrlForDownloading(@NonNull VideoData video) { String preferredVideoUrl = null; final VideoInfo preferredVideoInfo = video.encodedVideos.getPreferredVideoInfoForDownloading(); if (preferredVideoInfo != null && !TextUtils.isEmpty(preferredVideoInfo.url) && !video.onlyOnWeb && !videoHasFormat(preferredVideoInfo.url, VIDEO_FORMAT_M3U8)) { return preferredVideoInfo.url; } if (!new Config(MainApplication.instance()).isUsingVideoPipeline()) { for (String url : video.allSources) { if (VideoUtil.videoHasFormat(url, AppConstants.VIDEO_FORMAT_MP4)) { preferredVideoUrl = url; } } } return preferredVideoUrl; }
Source:
<code>File moveTempFile() throws IOException { File parent = filename.getParentFile(); if(parent == null) parent = new File("."); File newTemp = File.createTempFile(filename.getName(), ".new.tmp", parent); if(File.separatorChar == '\\') <START> newTemp.delete(); END> if(tempFilename.renameTo(newTemp)) return newTemp; System.err.println("Unable to rename temporary file "+tempFilename+" to "+newTemp); throw new IOException("Unable to rename temporary file "+tempFilename+" to "+newTemp); }</code><technical_language>FileUtil.detectedOS.isWindows show Windows, need for separatorChar magic</technical_language>

Target:
synchronized File moveTempFile() throws IOException { if(movedTempFilename != null) return movedTempFilename; File parent = filename.getParentFile(); if(parent == null) parent = new File("."); File newTemp = File.createTempFile(filename.getName(), UPDATER_BACKUP_SUFFIX+FileUtil.getExtension(filename), parent); if(FileUtil.detectedOS.isWindows) newTemp.delete(); if(tempFilename.renameTo(newTemp)) { movedTempFilename = newTemp; return newTemp; } System.err.println("Unable to rename temporary file "+tempFilename+" to "+newTemp); throw new IOException("Unable to rename temporary file "+tempFilename+" to "+newTemp); }
Source:
<code>public void retryPubsub_handlesEmptyMsg() throws IOException { new RetryPubSub().accept(new PubSubMessage(), null); <START> String logMessage = logHandler.getStoredLogRecords().get(0).getMessage(); <END> assertThat("Not retrying...").isEqualTo(logMessage); }</code><technical_language>If this in a test, unhappy assuming a lot. Ok here, however</technical_language>

Target:
public void retryPubsub_handlesEmptyMsg() throws IOException { PubSubMessage pubsubMessage = new PubSubMessage(); pubsubMessage.setData(""); new RetryPubSub().accept(pubsubMessage, null); String logMessage = logHandler.getStoredLogRecords().get(0).getMessage(); assertThat("Not retrying...").isEqualTo(logMessage); }
Source:
<code>public static ServerResolver fromWriteServer(ServerResolver writeServerResolver, String readClusterVip, EurekaClientMetricFactory clientMetricFactory, EurekaRegistryMetricFactory registryMetricFactory) { return new EurekaServerResolverBuilder() .withBootstrapResolver(writeServerResolver) .withReadServerInterest(Interests.forVips(readClusterVip)) <START> .withMetricFactory(clientMetricFactory) <END> .withMetricFactory(registryMetricFactory) .build(); }</code><technical_language>withMetricFactory overload confusing, more specific type of metric factories</technical_language>

Target:
public static ServerResolver fromWriteServer(ServerResolver writeServerResolver, String readClusterVip, EurekaClientMetricFactory clientMetricFactory, EurekaRegistryMetricFactory registryMetricFactory) { return new EurekaServerResolverBuilder() .withBootstrapResolver(writeServerResolver) .withReadServerInterest(Interests.forVips(readClusterVip)) .withClientMetricFactory(clientMetricFactory) .withRegistryMetricFactory(registryMetricFactory) .build(); }
Source:
<code>public RuntimeInfo getRuntimeInfo(SimpleFileIODatasetProperties properties) { try { return new JarRuntimeInfo(new URL(SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, <START> SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME, false); <END> } catch (MalformedURLException e) { throw new ComponentException(e); } }</code><technical_language>some constant for boolean instead of true false ease readability of code please ? this static final boolean REUSABLE_CLASSLOADER = true; DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, - SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME); + SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME, !REUSABLE_CLASSLOADER);</technical_language>

Target:
public RuntimeInfo getRuntimeInfo(SimpleFileIODatasetProperties properties) { try { return new JarRuntimeInfo(new URL(SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME, IS_CLASSLOADER_REUSABLE); } catch (MalformedURLException e) { throw new ComponentException(e); } }
Source:
<code>private TokenResponse processTokens(String clientId, String clientSecret, String deviceCode) { TokenRequest tokenRequest = new TokenRequest(GrantType.DEVICE_CODE); tokenRequest.setAuthUsername(clientId); tokenRequest.setAuthPassword(clientSecret);; tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); tokenRequest.setDeviceCode(deviceCode); TokenClient tokenClient1 = newTokenClient(tokenRequest); <START> tokenClient1.setRequest(tokenRequest); <END> TokenResponse tokenResponse1 = tokenClient1.exec(); showClient(tokenClient1); return tokenResponse1; }</code><technical_language>This line is redundant, request passed in newTokenClient(tokenRequest);</technical_language>

Target:
private TokenResponse processTokens(String clientId, String clientSecret, String deviceCode) { TokenRequest tokenRequest = new TokenRequest(GrantType.DEVICE_CODE); tokenRequest.setAuthUsername(clientId); tokenRequest.setAuthPassword(clientSecret);; tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); tokenRequest.setDeviceCode(deviceCode); TokenClient tokenClient1 = newTokenClient(tokenRequest); TokenResponse tokenResponse1 = tokenClient1.exec(); showClient(tokenClient1); return tokenResponse1; }
Source:
<code>public void testComputeLabelsForOsRelease() throws Exception { PlatformDetailsTask details = new PlatformDetailsTask(); URL resource = getClass().getResource(lsbReleaseFileName); File lsbReleaseFile = new File(resource.toURI()); assertTrue("File not found " + lsbReleaseFile, lsbReleaseFile.exists()); LsbRelease release = new LsbRelease(lsbReleaseFile); PlatformDetails result = details.computeLabels("amd64", "linux", "xyzzy-abc", release); <START> assertThat(result.getArchitecture(), equalTo(expectedArch)); <END> assertThat(result.getName(), equalTo(expectedName)); assertThat(result.getVersion(), equalTo(expectedVersion)); assertThat(result.getArchitectureName(), equalTo(expectedArch + "-" + expectedName)); assertThat( result.getArchitectureNameVersion(), equalTo(expectedArch + "-" + expectedName + "-" + expectedVersion)); assertThat(result.getNameVersion(), equalTo(expectedName + "-" + expectedVersion)); }</code><technical_language>code in this plugin preferred is equalTo. this is comparing strings, switch is instead of equalTo? suggestion assertThat(result.getArchitecture(), equalTo(expectedArch));</technical_language>

Target:
public void testComputeLabelsForOsRelease() throws Exception { PlatformDetailsTask details = new PlatformDetailsTask(); URL resource = getClass().getResource(lsbReleaseFileName); File lsbReleaseFile = new File(resource.toURI()); assertTrue("File not found " + lsbReleaseFile, lsbReleaseFile.exists()); LsbRelease release = new LsbRelease(lsbReleaseFile); PlatformDetails result = details.computeLabels("amd64", "linux", "xyzzy-abc", release); assertThat(result.getArchitecture(), is(expectedArch)); assertThat(result.getName(), is(expectedName)); assertThat(result.getArchitectureName(), is(expectedArch + "-" + expectedName)); assertThat( result.getArchitectureNameVersion(), is(expectedArch + "-" + expectedName + "-" + expectedVersion)); assertThat(result.getNameVersion(), is(expectedName + "-" + expectedVersion)); }
Source:
<code>public void checkName(String origName) throws Failure { <START> if (StringUtils.isNotBlank(DEFAULT_PATTERN) && StringUtils.isNotBlank(origName)) { <END> if (!Pattern.matches(DEFAULT_PATTERN, origName)) { throw new Failure(Messages.Hudson_JobSinglesQuotesAreProhibited()); } } }</code><technical_language>check string contains</technical_language>

Target:
public void checkName(String origName) throws Failure { }
Source:
<code>public void getHTable(String table) throws IOException { final TableName tName = TableName.valueOf(table); <START> synchronized (TABLE_LOCK) { <END> this.currentTable = connection.getTable(tName); if (clientSideBuffering) { final BufferedMutatorParams p = new BufferedMutatorParams(tName); p.writeBufferSize(writeBufferSize); this.bufferedMutator = connection.getBufferedMutator(p); } } }</code><technical_language>#701 asked for this lock removed, if I reading correctly</technical_language>

Target:
public void getHTable(String table) throws IOException { final TableName tName = TableName.valueOf(table); this.currentTable = connection.getTable(tName); if (clientSideBuffering) { final BufferedMutatorParams p = new BufferedMutatorParams(tName); p.writeBufferSize(writeBufferSize); this.bufferedMutator = connection.getBufferedMutator(p); } }
Source:
<code>private MarshallableEntry<K, V> _load(Object key, boolean loadValue, boolean loadMetadata) { final FileEntry fe; resizeLock.readLock().lock(); try { synchronized (entries) { fe = entries.get(key); if (fe == null) return null; if (fe.isExpired(timeService.wallClockTime())) { return null; } else { fe.lock(); } } } finally { resizeLock.readLock().unlock(); } org.infinispan.commons.io.ByteBuffer valueBb = null; org.infinispan.commons.io.ByteBuffer metadataBb = null; if (!loadValue && !loadMetadata) { try { return entryFactory.create(key); } finally { fe.unlock(); } } final byte[] data; try { data = new byte[fe.keyLen + fe.dataLen + (loadMetadata ? fe.metadataLen : 0)]; channel.read(ByteBuffer.wrap(data), fe.offset + KEY_POS); } catch (Exception e) { throw new PersistenceException(e); } finally { fe.unlock(); } if (trace) log.tracef("Read entry %s at %d:%d", key, fe.offset, fe.actualSize()); ByteBufferFactory factory = ctx.getByteBufferFactory(); org.infinispan.commons.io.ByteBuffer keyBb = factory.newByteBuffer(data, 0, fe.keyLen); if (loadValue) { valueBb = factory.newByteBuffer(data, fe.keyLen, fe.dataLen); } if (loadMetadata && fe.metadataLen > 0) { metadataBb = factory.newByteBuffer(data, fe.keyLen + fe.dataLen, fe.metadataLen); } <START> return entryFactory.create(keyBb, valueBb, metadataBb, fe.expiryTime, fe.lastUsed); <END> }</code><technical_language>Need created timestamp instead of fe.expiryTime</technical_language>

Target:
private MarshallableEntry<K, V> _load(Object key, boolean loadValue, boolean loadMetadata) { final FileEntry fe; resizeLock.readLock().lock(); try { synchronized (entries) { fe = entries.get(key); if (fe == null) return null; if (fe.isExpired(timeService.wallClockTime())) { return null; } else { fe.lock(); } } } finally { resizeLock.readLock().unlock(); } org.infinispan.commons.io.ByteBuffer valueBb = null; org.infinispan.commons.io.ByteBuffer metadataBb = null; if (!loadValue && !loadMetadata) { try { return entryFactory.create(key); } finally { fe.unlock(); } } final byte[] data; try { data = new byte[fe.keyLen + fe.dataLen + (loadMetadata ? fe.metadataLen : 0)]; channel.read(ByteBuffer.wrap(data), fe.offset + KEY_POS); } catch (Exception e) { throw new PersistenceException(e); } finally { fe.unlock(); } if (trace) log.tracef("Read entry %s at %d:%d", key, fe.offset, fe.actualSize()); ByteBufferFactory factory = ctx.getByteBufferFactory(); org.infinispan.commons.io.ByteBuffer keyBb = factory.newByteBuffer(data, 0, fe.keyLen); if (loadValue) { valueBb = factory.newByteBuffer(data, fe.keyLen, fe.dataLen); } if (loadMetadata && fe.metadataLen > 0) { int metaLength = fe.metadataLen - TIMESTAMP_BYTES; metadataBb = factory.newByteBuffer(data, fe.keyLen + fe.dataLen, metaLength); ByteBuffer buffer = ByteBuffer.wrap(data, fe.keyLen + fe.dataLen + metaLength, TIMESTAMP_BYTES); long created = fe.expiryTime > 0 ? buffer.getLong() : -1; long lastUsed = fe.expiryTime > 0 ? buffer.getLong() : -1; return entryFactory.create(keyBb, valueBb, metadataBb, created, lastUsed); } return entryFactory.create(keyBb, valueBb); }