auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addRecords(List<CheckstyleRecord> newRecords, String filename) { if (!newRecords.isEmpty()) { <START> newRecords.sort(new PositionOrderComparator()); <END> final List<CheckstyleRecord> popped = records.put(filename, newRecords); if (popped != null) { final List<CheckstyleRecord> diff = produceDiff(popped, newRecords); if (diff.isEmpty()) { records.remove(filename); } else { records.put(filename, diff); } } } }</code><technical_language>review this code thoroughly, is a code works</technical_language>

Target:
public void addRecords(List<CheckstyleRecord> newRecords, String filename) { if (!newRecords.isEmpty()) { if (threadingMode == ThreadingMode.SINGLE) { addNewRecords(newRecords, filename); } else { asyncTasks.add(CompletableFuture.runAsync(() -> { addNewRecords(newRecords, filename); })); } } }
Source:
<code>public boolean isTestingData(String email){ boolean isTestingAccount = false; <START> if(email.contains("tmt")){ <END> isTestingAccount = true; } return isTestingAccount; }</code><technical_language>test stronger. .endsWith(".tmt")</technical_language>

Target:
public boolean isTestingData(String email){ boolean isTestingAccount = false; if(email.endsWith(".tmt")){ isTestingAccount = true; } return isTestingAccount; }
Source:
<code>private boolean promptUser(PromptBehavior prompt) { return prompt == PromptBehavior.Always || prompt == PromptBehavior.REFRESH_SESSION <START> || PromptBehavior.FORCE_PROMPT == prompt; <END> }</code><technical_language>nit: flip comparison prompt == ..</technical_language>

Target:
private boolean promptUser(PromptBehavior prompt) { return prompt == PromptBehavior.Always || prompt == PromptBehavior.REFRESH_SESSION || prompt == PromptBehavior.FORCE_PROMPT; }
Source:
<code>public ImmutableSet<E> getSubgraphContaining(E element, ImmutableSet<E> endPoints) { final ImmutableSet.Builder<E> builder = ImmutableSet.builder(); builder.addAll(graph.getSubgraphContaining(element, endPoints)); <START> return builder.build(); <END> }</code><technical_language>question</technical_language>

Target:
public ImmutableSet<E> getSubgraphContaining(E element, ImmutableSet<E> endPoints) { return ImmutableSet.copyOf(graph.getSubgraphContaining(element, endPoints)); }
Source:
<code>public void notifyRemoteServersOfCorruption() { <START> corruptionNotifiers.forEach(this::submitTask); <END> }</code><technical_language>suggestion corruptionNotifiers.forEach(this::reportCorruptionToRemote);</technical_language>

Target:
public void notifyRemoteServersOfCorruption() { corruptionNotifiers.forEach(this::reportCorruptionToRemote); }
Source:
<code>public void testBuilderAppend() { CallerContext.Builder builder = new CallerContext.Builder("context1"); CallerContext context = <START> builder.append("context2").append("key3", "value3", ":").build(); <END> Assert.assertEquals(true, context.getContext().contains(CallerContext.ITEM_SEPARATOR)); String[] items = context.getContext().split(CallerContext.ITEM_SEPARATOR); Assert.assertEquals(3, items.length); Assert.assertEquals(true, items[2].equals("key3:value3")); }</code><technical_language>pass separator for key is weird</technical_language>

Target:
public void testBuilderAppend() { Configuration conf = new Configuration(); conf.set(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY, "$"); CallerContext.Builder builder = new CallerContext.Builder(null, conf); CallerContext context = builder.append("context1") .append("context2").append("key3", "value3").build(); Assert.assertEquals(true, context.getContext().contains("$")); String[] items = context.getContext().split("\\$"); Assert.assertEquals(3, items.length); Assert.assertEquals("key3:value3", items[2]); builder.append("$$"); Assert.assertEquals("context1$context2$key3:value3$$$", builder.build().getContext()); }
Source:
<code>public SolrLoggerUsageEventListener() { <START> solrLoggerService = new DSpace().getServiceManager().getServiceByName("solrLoggerService", SolrLoggerService.class); <END> }</code><technical_language>retrieve this solr logger service factory call: StatisticsServiceFactory.getInstance().getSolrLoggerService();</technical_language>

Target:
public SolrLoggerUsageEventListener() { solrLoggerService = StatisticsServiceFactory.getInstance().getSolrLoggerService(); }
Source:
<code>public Response updateState(NodeState state) throws WebApplicationException { requireNonNull(state, "state is null"); switch (state) { case SHUTTING_DOWN: shutdownHandler.requestShutdown(); return Response.ok().build(); <START> case CANCELLING_SHUTDOWN: <END> shutdownHandler.requestCancelShutdown(); return Response.ok().build(); case ACTIVE: case INACTIVE: throw new WebApplicationException(Response .status(BAD_REQUEST) .type(MediaType.TEXT_PLAIN) .entity(format("Invalid state transition to %s", state)) .build()); default: return Response.status(BAD_REQUEST) .type(TEXT_PLAIN) .entity(format("Invalid state %s", state)) .build(); } }</code><technical_language>Instead of creating this new state, handle state transition SHUTTING_DOWN ACTIVE, cancel shutdown transition</technical_language>

Target:
public Response updateState(NodeState state) throws WebApplicationException { requireNonNull(state, "state is null"); switch (state) { case SHUTTING_DOWN: synchronized (shutdownHandler) { shutdownHandler.requestShutdown(); } return Response.ok().build(); case ACTIVE: synchronized (shutdownHandler) { if (shutdownHandler.isShutdownRequested()) { shutdownHandler.cancelShutdown(); return Response.ok().build(); } } throw new WebApplicationException(Response .status(BAD_REQUEST) .type(MediaType.TEXT_PLAIN) .entity(format("Invalid state transition to %s", state)) .build()); case INACTIVE: throw new WebApplicationException(Response .status(BAD_REQUEST) .type(MediaType.TEXT_PLAIN) .entity(format("Invalid state transition to %s", state)) .build()); default: return Response.status(BAD_REQUEST) .type(TEXT_PLAIN) .entity(format("Invalid state %s", state)) .build(); } }
Source:
<code>static List<StartIdentifiedAtlasDbTransactionResponse> split(StartTransactionResponseV4 batchedResponse) { <START> LockImmutableTimestampResponse immutableTsAndLock = batchedResponse.immutableTimestamp(); <END> long[] startTimestamps = batchedResponse.timestamps().stream().toArray(); int partition = batchedResponse.timestamps().partition(); List<LockImmutableTimestampResponse> immutableTsAndLocks = LockTokenShare.share(immutableTsAndLock.getLock(), startTimestamps.length).stream() .map(token -> LockImmutableTimestampResponse.of(immutableTsAndLock.getImmutableTimestamp(), token)) .collect(Collectors.toList()); return IntStream.range(0, startTimestamps.length) .mapToObj(i -> StartIdentifiedAtlasDbTransactionResponse.of( immutableTsAndLocks.get(i), TimestampAndPartition.of(startTimestamps[i], partition) )) .collect(Collectors.toList()); }</code><technical_language>tip: Guava's Streams.zip: java private static List<StartIdentifiedAtlasDbTransactionResponse> split(StartTransactionResponseV4 batchedResponse) { long immutableTimestamp = immutableTsAndLock.getImmutableTimestamp(); PartitionedTimestamps timestamps = immutableTsAndLock.timestamps(); Stream<LockImmutableTimestampResponse> immutableTsAndLocks = LockTokenShare.share(immutableTsAndLock.getLock(), timestamps.count()) .stream() .map(token -> LockImmutableTimestampResponse.of(immutableTimestamp, token)); Stream<TimestampAndPartition> startTimestampsAndPartitions = timestamps.stream() .mapToObj(timestamp -> TimestampAndPartition.of(timestamp, partition)); return Streams.zip(immutableTsAndLocks, startTimestampsAndPartitions, StartIdentifiedAtlasDbTransactionResponse::of) .collect(toList); }</technical_language>

Target:
static List<StartIdentifiedAtlasDbTransactionResponse> split(StartTransactionResponseV4 batchedResponse) { LockImmutableTimestampResponse immutableTsAndLock = batchedResponse.immutableTimestamp(); PartitionedTimestamps partitionedTimestamps = batchedResponse.timestamps(); int partition = partitionedTimestamps.partition(); Stream<LockImmutableTimestampResponse> immutableTsAndLocks = LockTokenShare.share(immutableTsAndLock.getLock(), partitionedTimestamps.count()).stream() .map(token -> LockImmutableTimestampResponse.of(immutableTsAndLock.getImmutableTimestamp(), token)); Stream<TimestampAndPartition> timestampAndPartitions = partitionedTimestamps.stream() .mapToObj(timestamp -> TimestampAndPartition.of(timestamp, partition)); return Streams.zip(immutableTsAndLocks, timestampAndPartitions, StartIdentifiedAtlasDbTransactionResponse::of) .collect(Collectors.toList()); }
Source:
<code>private void registerBuiltinLFS() { <START> Class<?> lfs; try { lfs = Class.forName("org.eclipse.jgit.lfs.BuiltinLFS"); if (lfs != null) { lfs.getMethod("register").invoke(null); } } catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e1) { } <END> }</code><technical_language>yes, log failures, bundle activator some methods for logging: Activator.logError()</technical_language>

Target:
private void registerBuiltinLFS() { Class<?> lfs; try { lfs = Class.forName("org.eclipse.jgit.lfs.BuiltinLFS"); if (lfs != null) { lfs.getMethod("register").invoke(null); } } catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e1) { logWarning(CoreText.Activator_noBuiltinLfsSupportDetected, e1); } }
Source:
<code>public Object toObject(byte[] bytes, int offset, int length, @SuppressWarnings("rawtypes") PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) { if (!actualType.isCoercibleTo(this)) { throwConstraintViolationException(actualType, this); } if (length == 0) { return null; <START> } <END> return getPhoenixJson(bytes, offset, length); }</code><technical_language>want call PVarchar get a String, call getPhoenixJson(String). This care of maxLength check inversion if necessary based sortOrder. String jsonStr = PVarChar.toObject(bytes, offset, length, actualType, sortOrder, maxLength, scale); return getPhoenixJson(jsonStr);</technical_language>

Target:
public Object toObject(byte[] bytes, int offset, int length, @SuppressWarnings("rawtypes") PDataType actualType, SortOrder sortOrder, Integer maxLength, Integer scale) { Object object = PVarchar.INSTANCE.toObject(bytes, offset, length, actualType, sortOrder, maxLength, scale); return object == null ? object : getPhoenixJson(object.toString()); }
Source:
<code>public RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Integer tryTimeout, Long retryDelayInMs, Long maxRetryDelayInMs, String secondaryHost) { this.retryPolicyType = retryPolicyType == null ? RetryPolicyType.EXPONENTIAL : retryPolicyType; if (maxTries != null) { Utility.assertInBounds("maxRetries", maxTries, 1, Integer.MAX_VALUE); this.maxTries = maxTries; } else { this.maxTries = 4; } if (tryTimeout != null) { <START> Utility.assertInBounds("getTryTimeout", tryTimeout, 1, Integer.MAX_VALUE); <END> this.tryTimeout = tryTimeout; } else { this.tryTimeout = Integer.MAX_VALUE; } if ((retryDelayInMs == null && maxRetryDelayInMs != null) || (retryDelayInMs != null && maxRetryDelayInMs == null)) { throw logger.logExceptionAsError( new IllegalArgumentException("Both retryDelay and maxRetryDelay must be null or neither can be null")); } if (retryDelayInMs != null) { Utility.assertInBounds("getMaxRetryDelayInMs", maxRetryDelayInMs, 1, Long.MAX_VALUE); Utility.assertInBounds("getRetryDelayInMs", retryDelayInMs, 1, maxRetryDelayInMs); this.maxRetryDelayInMs = maxRetryDelayInMs; this.retryDelayInMs = retryDelayInMs; } else { switch (this.retryPolicyType) { case EXPONENTIAL: this.retryDelayInMs = TimeUnit.SECONDS.toMillis(4); break; case FIXED: this.retryDelayInMs = TimeUnit.SECONDS.toMillis(30); break; default: throw logger.logExceptionAsError(new IllegalArgumentException("Invalid 'RetryPolicyType'.")); } this.maxRetryDelayInMs = TimeUnit.SECONDS.toMillis(120); } this.secondaryHost = secondaryHost; }</code><technical_language>need get prefix</technical_language>

Target:
public RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Integer tryTimeout, Long retryDelayInMs, Long maxRetryDelayInMs, String secondaryHost) { this.retryPolicyType = retryPolicyType == null ? RetryPolicyType.EXPONENTIAL : retryPolicyType; if (maxTries != null) { Utility.assertInBounds("maxRetries", maxTries, 1, Integer.MAX_VALUE); this.maxTries = maxTries; } else { this.maxTries = 4; } if (tryTimeout != null) { Utility.assertInBounds("tryTimeout", tryTimeout, 1, Integer.MAX_VALUE); this.tryTimeout = tryTimeout; } else { this.tryTimeout = Integer.MAX_VALUE; } if ((retryDelayInMs == null && maxRetryDelayInMs != null) || (retryDelayInMs != null && maxRetryDelayInMs == null)) { throw logger.logExceptionAsError( new IllegalArgumentException("Both retryDelay and maxRetryDelay must be null or neither can be null")); } if (retryDelayInMs != null) { Utility.assertInBounds("maxRetryDelayInMs", maxRetryDelayInMs, 1, Long.MAX_VALUE); Utility.assertInBounds("retryDelayInMs", retryDelayInMs, 1, maxRetryDelayInMs); this.maxRetryDelayInMs = maxRetryDelayInMs; this.retryDelayInMs = retryDelayInMs; } else { switch (this.retryPolicyType) { case EXPONENTIAL: this.retryDelayInMs = TimeUnit.SECONDS.toMillis(4); break; case FIXED: this.retryDelayInMs = TimeUnit.SECONDS.toMillis(30); break; default: throw logger.logExceptionAsError(new IllegalArgumentException("Invalid 'RetryPolicyType'.")); } this.maxRetryDelayInMs = TimeUnit.SECONDS.toMillis(120); } this.secondaryHost = secondaryHost; }
Source:
<code>public Object[][] intersectionTestCases() { final CRAIEntry basic = craiEntryForIntersectionTests(1, 1, 10); final CRAIEntry overlapBasic = craiEntryForIntersectionTests(1, 5, 10); final CRAIEntry insideBasic = craiEntryForIntersectionTests(1, 3, 5); final CRAIEntry otherSeq1 = craiEntryForIntersectionTests(2, 1, 10); final CRAIEntry otherSeq2 = craiEntryForIntersectionTests(2, 2, 10); final CRAIEntry zerospan = craiEntryForIntersectionTests(1, 1, 0); final CRAIEntry unmapped = craiEntryForIntersectionTests(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX, 1, 2); final CRAIEntry multi = craiEntryForIntersectionTests(ReferenceContext.MULTIPLE_REFERENCE_ID, 1, 2); return new Object[][]{ {basic, basic, true}, {basic, overlapBasic, true}, {basic, insideBasic, true}, {basic, otherSeq1, false}, {basic, otherSeq2, false}, {otherSeq1, otherSeq2, true}, {basic, zerospan, false}, {zerospan, zerospan, false}, {basic, unmapped, false}, <START> {basic, multi, false}, <END> {unmapped, multi, false}, {unmapped, unmapped, false}, {multi, multi, false}, }; }</code><technical_language>nice test cases</technical_language>

Target:
public Object[][] intersectionTestCases() { final CRAIEntry basic = craiEntryForIntersectionTests(1, 1, 10); final CRAIEntry overlapBasic = craiEntryForIntersectionTests(1, 5, 10); final CRAIEntry insideBasic = craiEntryForIntersectionTests(1, 3, 5); final CRAIEntry otherSeq1 = craiEntryForIntersectionTests(2, 1, 10); final CRAIEntry otherSeq2 = craiEntryForIntersectionTests(2, 2, 10); final CRAIEntry zerospan = craiEntryForIntersectionTests(1, 1, 0); final CRAIEntry unmapped = craiEntryForIntersectionTests(ReferenceContext.UNMAPPED_UNPLACED_ID, 1, 2); return new Object[][]{ {basic, basic, true}, {basic, overlapBasic, true}, {basic, insideBasic, true}, {basic, otherSeq1, false}, {basic, otherSeq2, false}, {otherSeq1, otherSeq2, true}, {basic, zerospan, false}, {zerospan, zerospan, false}, {basic, unmapped, false}, {unmapped, unmapped, false}, }; }
Source:
<code>public boolean isDone() { <START> lockHandlers(); <END> return future.isDone(); }</code><technical_language>I if lock handlers toCompletableFuture(), unsafe assume toCompletableFuture().isDone() => this.isDone(), necessary</technical_language>

Target:
public boolean isDone() { freezeHandlers(); return future.isDone(); }
Source:
<code>public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, PerHostMessages messages) { if <START> (!vm.getMigrationSupport().limitsMigration()) { <END> Map<Guid, VDS> candidateHosts = new HashMap<>(); for (VDS host: hosts) { candidateHosts.put(host.getId(), host); } Set<Guid> allowedHosts = new HashSet<>(); if (vm.getMigrationSupport().allowsMigration() || vm.getRunOnVds() == null) { allowedHosts.addAll(vm.getDedicatedVmForVdsList()); } else { allowedHosts.add(vm.getRunOnVds()); } if (vm.getDedicatedVmForVdsList().size() > 0) { for (Iterator<Map.Entry<Guid, VDS>> it = candidateHosts.entrySet().iterator(); it.hasNext();) { Guid candidateGuid = it.next().getKey(); if (!allowedHosts.contains(candidateGuid)) { it.remove(); } } } return new ArrayList<>(candidateHosts.values()); } else { return hosts; } }</code><technical_language>This is equivalent .migrateAnywhere(). I guess negation is</technical_language>

Target:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, PerHostMessages messages) { if (vm.getRunOnVds() == null || vm.getMigrationSupport().limitsMigration()) { Map<Guid, VDS> candidateHosts = new HashMap<>(); for (VDS host: hosts) { candidateHosts.put(host.getId(), host); } Set<Guid> allowedHosts = new HashSet<>(); if (vm.getMigrationSupport().allowsMigration() || vm.getRunOnVds() == null) { allowedHosts.addAll(vm.getDedicatedVmForVdsList()); } else { allowedHosts.add(vm.getRunOnVds()); } if (vm.getDedicatedVmForVdsList().size() > 0) { for (Iterator<Map.Entry<Guid, VDS>> it = candidateHosts.entrySet().iterator(); it.hasNext();) { Guid candidateGuid = it.next().getKey(); if (!allowedHosts.contains(candidateGuid)) { it.remove(); } } } return new ArrayList<>(candidateHosts.values()); } else { return hosts; } }
Source:
<code>public byte[] get() { byte[] byteArray = null; <START> synchronized (this) { <END> byteArray = freeBuffers.poll(); if (byteArray == null && numBuffersInUse < maxBuffersInUse) { byteArray = new byte[bufferSize]; } if (byteArray != null) { numBuffersInUse++; return byteArray; } } try { byteArray = freeBuffers.take(); synchronized (this) { numBuffersInUse++; return byteArray; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }</code><technical_language>instead of locking for counter, AtomicInteger</technical_language>

Target:
public byte[] get() { isPossibleToIssueNewBuffer(); byte[] byteArray = null; synchronized (this) { byteArray = freeBuffers.poll(); if (byteArray == null && isPossibleToIssueNewBuffer()) { byteArray = new byte[bufferSize]; } if (byteArray != null) { numBuffersInUse++; return byteArray; } } try { byteArray = freeBuffers.take(); synchronized (this) { numBuffersInUse++; return byteArray; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
Source:
<code>public static network map(Network model, network template) { network entity = template != null ? template : new network(); if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setname(model.getName()); } if (model.isSetDescription()) { entity.setdescription(model.getDescription()); } if (model.isSetStatus()) { entity.setStatus(map(NetworkStatus.fromValue(model.getStatus().getState()), null)); } if (model.isSetDataCenter() && model.getDataCenter().isSetId()) { entity.setstorage_pool_id(new Guid(model.getDataCenter().getId())); } if (model.isSetIp()) { if (model.getIp().isSetAddress()) { entity.setaddr(model.getIp().getAddress()); } if (model.getIp().isSetNetmask()) { entity.setsubnet(model.getIp().getNetmask()); } if (model.getIp().isSetGateway()) { entity.setgateway(model.getIp().getGateway()); } } if (model.isSetVlan() && model.getVlan().getId()!=null) { try { entity.setvlan_id(model.getVlan().getId()); } catch (NumberFormatException e) { } } if (model.isSetStp()) { entity.setstp(model.isStp()); } if (model.isSetDisplay()) { entity.setis_display(model.isDisplay()); } if (model.isSetUsages()) { entity.setVmNetwork(model.getUsages().contains(Usage.VM_NETWORK)); <START> entity.setis_display(model.getUsages().contains(Usage.DISPLAY)); <END> } return entity; }</code><technical_language>done mapper of string->enum</technical_language>

Target:
public static network map(Network model, network template) { network entity = template != null ? template : new network(); if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setname(model.getName()); } if (model.isSetDescription()) { entity.setdescription(model.getDescription()); } if (model.isSetStatus()) { entity.setStatus(map(NetworkStatus.fromValue(model.getStatus().getState()), null)); } if (model.isSetDataCenter() && model.getDataCenter().isSetId()) { entity.setstorage_pool_id(new Guid(model.getDataCenter().getId())); } if (model.isSetIp()) { if (model.getIp().isSetAddress()) { entity.setaddr(model.getIp().getAddress()); } if (model.getIp().isSetNetmask()) { entity.setsubnet(model.getIp().getNetmask()); } if (model.getIp().isSetGateway()) { entity.setgateway(model.getIp().getGateway()); } } if (model.isSetVlan() && model.getVlan().getId()!=null) { try { entity.setvlan_id(model.getVlan().getId()); } catch (NumberFormatException e) { } } if (model.isSetStp()) { entity.setstp(model.isStp()); } if (model.isSetUsages()) { List<NetworkUsage> networkUsages = new ArrayList<NetworkUsage>(); for (String usage : model.getUsages().getUsages()) { networkUsages.add(map(usage,null)); } entity.setis_display(networkUsages.contains(NetworkUsage.DISPLAY)); if (model.isSetDisplay()) { entity.setis_display(model.isDisplay()); } else { entity.setVmNetwork(networkUsages.contains(NetworkUsage.VM)); } } return entity; }
Source:
<code>private void checkClusterAdditionalFeaturesSupported(VDSGroup cluster, VDS vds) { Set<SupportedAdditionalClusterFeature> clusterSupportedFeatures = clusterFeatureDao.getSupportedFeaturesByClusterId(cluster.getId()); Set<String> hostSupportedFeatures = hostFeatureDao.getSupportedHostFeaturesByHostId(vds.getId()); for (SupportedAdditionalClusterFeature feature : clusterSupportedFeatures) { if (feature.isEnabled() && !hostSupportedFeatures.contains(feature.getFeature().getName())) { Map<String, String> customLogValues = new HashMap<>(); <START> customLogValues.put("{UnSupportedFeature", feature.getFeature().getName()); <END> reportNonOperationReason(NonOperationalReason.HOST_FEATURES_INCOMPATIBILE_WITH_CLUSTER, customLogValues); return; } } return; }</code><technical_language>leading { ? typo</technical_language>

Target:
private void checkClusterAdditionalFeaturesSupported(VDSGroup cluster, VDS vds) { Set<SupportedAdditionalClusterFeature> clusterSupportedFeatures = clusterFeatureDao.getSupportedFeaturesByClusterId(cluster.getId()); Set<String> hostSupportedFeatures = hostFeatureDao.getSupportedHostFeaturesByHostId(vds.getId()); for (SupportedAdditionalClusterFeature feature : clusterSupportedFeatures) { if (feature.isEnabled() && !hostSupportedFeatures.contains(feature.getFeature().getName())) { Map<String, String> customLogValues = new HashMap<>(); customLogValues.put("UnSupportedFeature", feature.getFeature().getName()); reportNonOperationReason(NonOperationalReason.HOST_FEATURES_INCOMPATIBILE_WITH_CLUSTER, customLogValues); return; } } return; }
Source:
<code>private static void upgradeFrom2_9_0(XMLConfiguration config) { <START> String old_key_name = ".markocurrences"; String new_key_name = ".markoccurrences"; <END> config.getKeys() .forEachRemaining( key -> { if (key.endsWith(old_key_name)) { config.setProperty( key.replace(old_key_name, new_key_name), config.getProperty(key)); config.clearProperty(key); } }); }</code><technical_language>sure, I of checking for unittests</technical_language>

Target:
static void upgradeFrom2_9_0(XMLConfiguration config) { String oldKeyName = ".markocurrences"; String newKeyName = ".markoccurrences"; config.getKeys() .forEachRemaining( key -> { if (key.endsWith(oldKeyName)) { config.setProperty( key.replace(oldKeyName, newKeyName), config.getProperty(key)); config.clearProperty(key); } }); }
Source:
<code>public Work find(String workId, State state) { return lookup(workId).filter((work) -> { State workState = work.getWorkInstanceState(); return state == null ? (workState == State.SCHEDULED || workState == State.RUNNING) : workState == state; <START> }).orElse(null); <END> }</code><technical_language>Sure, I put a method? static independent work queue, MemoryWorkQueuing right</technical_language>

Target:
public Work find(String workId, State state) { return lookup(workId).filter(work -> workHasState(work, state)).orElse(null); }
Source:
<code>public void saveGlobalProperty_shouldFailIfDefaultLocaleNotInAllowedLocaleList() { <START> <END> String localeList = "fr"; assertThat("localeList contains default locale but should not for this test case", localeList, not(containsString(LocaleUtility.getDefaultLocale().toString()))); expectedException.expect(APIException.class); expectedException.expectMessage("is not in allowed locales list"); adminService.saveGlobalProperty( new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE, localeList)); }</code><technical_language>almost, need change variable names assert (although I remove it) java @Test public void saveGlobalProperty_shouldFailIfGivenDefaultLocaleIsNotInAllowedLocales() { Locale defaultLocale = new Locale("fr"); expectedException.expect(APIException.class); expectedException.expectMessage("is in allowed locales list"); adminService.saveGlobalProperty( new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE, defaultLocale.toString())); }</technical_language>

Target:
public void saveGlobalProperty_shouldFailIfDefaultLocaleNotInAllowedLocaleList() { Locale defaultLocale = new Locale("fr"); expectedException.expect(APIException.class); expectedException.expectMessage("is not in allowed locales list"); adminService.saveGlobalProperty( new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE, defaultLocale.toString())); }
Source:
<code>public static JGitConfigServerTestData prepareClonedGitRepository(Collection<String> additionalProperties, Class... sources) throws Exception { String remoteUri = ConfigServerTestUtils.prepareLocalRepo(); File remoteRepoDir = ResourceUtils.getFile(remoteUri); Git remoteGit = Git.open(remoteRepoDir.getAbsoluteFile()); remoteGit.checkout().setName("master").call(); File clonedRepoDir = new File("target/repos/cloned"); if(clonedRepoDir.exists()) { <START> FileUtils.deleteDirectory(clonedRepoDir); <END> }else{ clonedRepoDir.mkdirs(); } Git clonedGit = Git.cloneRepository() .setURI( "file://" + remoteRepoDir.getAbsolutePath() ) .setDirectory( clonedRepoDir ) .setBranch("master") .setCloneAllBranches(true) .call(); String[] properties = additionalProperties.toArray(new String[0]); properties = ArrayUtils.add(properties, "spring.cloud.config.server.git.uri:" + "file://" + clonedRepoDir.getAbsolutePath()); ConfigurableApplicationContext context = new SpringApplicationBuilder(sources).web(WebApplicationType.NONE) .properties(properties) .run(); JGitEnvironmentRepository repository = context.getBean(JGitEnvironmentRepository.class); return new JGitConfigServerTestData( new JGitConfigServerTestData.LocalGit(remoteGit, remoteRepoDir), new JGitConfigServerTestData.LocalGit(clonedGit, clonedRepoDir), repository, context); }</code><technical_language>Please revert FileSystemUtils.deleteRecursively</technical_language>

Target:
public static JGitConfigServerTestData prepareClonedGitRepository(Collection<String> additionalProperties, Class... sources) throws Exception { String remoteUri = ConfigServerTestUtils.prepareLocalRepo(); File remoteRepoDir = ResourceUtils.getFile(remoteUri); Git remoteGit = Git.open(remoteRepoDir.getAbsoluteFile()); remoteGit.checkout().setName("master").call(); File clonedRepoDir = new File("target/repos/cloned"); if(clonedRepoDir.exists()) { FileSystemUtils.deleteRecursively(clonedRepoDir); } else { clonedRepoDir.mkdirs(); } Git clonedGit = Git.cloneRepository() .setURI( "file://" + remoteRepoDir.getAbsolutePath() ) .setDirectory( clonedRepoDir ) .setBranch("master") .setCloneAllBranches(true) .call(); Collection<String> properties = new ArrayList<>(additionalProperties); properties.add("spring.cloud.config.server.git.uri:" + "file://" + clonedRepoDir.getAbsolutePath()); ConfigurableApplicationContext context = new SpringApplicationBuilder(sources).web(WebApplicationType.NONE) .properties(properties.toArray(new String[0])) .run(); JGitEnvironmentRepository repository = context.getBean(JGitEnvironmentRepository.class); return new JGitConfigServerTestData( new JGitConfigServerTestData.LocalGit(remoteGit, remoteRepoDir), new JGitConfigServerTestData.LocalGit(clonedGit, clonedRepoDir), repository, context); }
Source:
<code>public Response statusByDate(@PathParam("date") String date) throws Exception { JSONObject object = new JSONObject(); List<BackupMetadata> metadataLinkedList = this.completedBkups.locate(date); if (metadataLinkedList != null && !metadataLinkedList.isEmpty()) { BackupMetadata bkupMetadata = metadataLinkedList.get(0); if (bkupMetadata == null ) { object.put("Snapshotstatus", false); } else { if (!bkupMetadata.getStatus().equals(Status.FINISHED) ){ object.put("Snapshotstatus", false); } else { <START> object.put("Snapshotstatus", true); <END> } } String token = bkupMetadata.getToken(); if (token != null && !token.isEmpty()) { object.put("token", bkupMetadata.getToken()); } else { object.put("token", "not available"); } if (bkupMetadata.getStart() != null) { object.put("starttime", DateUtil.formatyyyyMMddHHmm(bkupMetadata.getStart())); } else { object.put("starttime", "not available"); } if (bkupMetadata.getCompleted() != null) { object.put("completetime", DateUtil.formatyyyyMMddHHmm(bkupMetadata.getCompleted())); } else { object.put("completetime", "not_available"); } } else { object.put("Snapshotstatus", false); String token = SystemUtils.getDataFromUrl("http://localhost:8080/Priam/REST/v1/cassconfig/get_token"); if (token != null && !token.isEmpty()) { object.put("token", token); } else { object.put("token", "not available"); } } return Response.ok(object.toString(), MediaType.APPLICATION_JSON).build(); }</code><technical_language>Minor - Simplified version object.put("Snapshotstatus", bkupMetadata.getStatus().equals(Status.FINISHED))</technical_language>

Target:
public Response statusByDate(@PathParam("date") String date) throws Exception { JSONObject object = new JSONObject(); List<BackupMetadata> metadataLinkedList = this.completedBkups.locate(date); if (metadataLinkedList != null && !metadataLinkedList.isEmpty()) { BackupMetadata bkupMetadata = metadataLinkedList.get(0); object.put("Snapshotstatus", bkupMetadata.getStatus().equals(Status.FINISHED)); String token = bkupMetadata.getToken(); if (token != null && !token.isEmpty()) { object.put("token", bkupMetadata.getToken()); } else { object.put("token", "not available"); } if (bkupMetadata.getStart() != null) { object.put("starttime", DateUtil.formatyyyyMMddHHmm(bkupMetadata.getStart())); } else { object.put("starttime", "not available"); } if (bkupMetadata.getCompleted() != null) { object.put("completetime", DateUtil.formatyyyyMMddHHmm(bkupMetadata.getCompleted())); } else { object.put("completetime", "not_available"); } } else { object.put("Snapshotstatus", false); String token = SystemUtils.getDataFromUrl("http://localhost:8080/Priam/REST/v1/cassconfig/get_token"); if (token != null && !token.isEmpty()) { object.put("token", token); } else { object.put("token", "not available"); } } return Response.ok(object.toString(), MediaType.APPLICATION_JSON).build(); }
Source:
<code>private SearchResponse runSearch(String filename, String content) throws IOException { logger.info(" -> Testing if file has been indexed correctly{}.", filename, content == null ? "" : " and contains [" + content + "]"); String fullQuery = "+file.filename:\"" + filename + "\""; if (content != null) { fullQuery += " +content:" + content; } <START> SearchResponse response = elasticsearchClient.search("fscrawler_test_all_documents", null, fullQuery, 10, "*"); <END> assertThat(response.getHits().getTotal(), is(1L)); return response; }</code><technical_language>ElasticsearchClient.defaultSearchSize instead</technical_language>

Target:
private SearchResponse runSearch(String filename, String content) throws IOException { logger.info(" -> Testing if file has been indexed correctly{}.", filename, content == null ? "" : " and contains [" + content + "]"); String fullQuery = "+file.filename:\"" + filename + "\""; if (content != null) { fullQuery += " +content:" + content; } SearchResponse response = elasticsearchClient.search("fscrawler_test_all_documents", null, fullQuery, 10, null); assertThat(response.getHits().getTotal(), is(1L)); return response; }
Source:
<code>public int compress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) { int tableSize = computeTableSize(inputLength); Arrays.fill(table, 0, tableSize, 0); long inputAddress = ARRAY_BYTE_BASE_OFFSET + inputOffset; long outputAddress = ARRAY_BYTE_BASE_OFFSET + outputOffset; <START> return Lz4RawCompressor.compress(input, inputAddress, inputLength, output, outputAddress, maxOutputLength, table, tableSize); <END> }</code><technical_language>I find a bit strange calculate initialize table of compressor instead of leaving private details raw compressor code. is strange is a min table size is defined compressor logic</technical_language>

Target:
public int compress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) { long inputAddress = ARRAY_BYTE_BASE_OFFSET + inputOffset; long outputAddress = ARRAY_BYTE_BASE_OFFSET + outputOffset; return Lz4RawCompressor.compress(input, inputAddress, inputLength, output, outputAddress, maxOutputLength, table); }
Source:
<code>void submitPutBlobOperation(BlobProperties blobProperties, byte[] userMetaData, ReadableStreamChannel channel, FutureResult<String> futureResult, Callback<String> callback) { try { PutOperation putOperation = new PutOperation(routerConfig, routerMetrics, clusterMap, responseHandler, blobProperties, userMetaData, channel, futureResult, callback, time); putOperations.add(putOperation); } catch (RouterException e) { routerMetrics.operationDequeuingRate.mark(); <START> routerMetrics.operationAbortCount.inc(); <END> routerMetrics.putBlobErrorCount.inc(); routerMetrics.countError(e); operationCompleteCallback.completeOperation(futureResult, callback, null, e); } }</code><technical_language>incorrect</technical_language>

Target:
void submitPutBlobOperation(BlobProperties blobProperties, byte[] userMetaData, ReadableStreamChannel channel, FutureResult<String> futureResult, Callback<String> callback) { try { PutOperation putOperation = new PutOperation(routerConfig, routerMetrics, clusterMap, responseHandler, blobProperties, userMetaData, channel, futureResult, callback, time); putOperations.add(putOperation); } catch (RouterException e) { routerMetrics.operationDequeuingRate.mark(); routerMetrics.putBlobErrorCount.inc(); routerMetrics.countError(e); operationCompleteCallback.completeOperation(futureResult, callback, null, e); } }
Source:
<code>public float computeDistanceToOut(Transform xf, Vec2 p, int childIndex, Vec2 normalOut) { float xfqc = xf.q.c; float xfqs = xf.q.s; float xfpx = xf.p.x; float xfpy = xf.p.y; float v1x = (xfqc * m_vertex1.x - xfqs * m_vertex1.y) + xfpx; <START> float v1y = xfqs * m_vertex1.x + xfqc * m_vertex1.y + xfpy; <END> float v2x = (xfqc * m_vertex2.x - xfqs * m_vertex2.y) + xfpx; float v2y = xfqs * m_vertex2.x + xfqc * m_vertex2.y + xfpy; float dx = p.x - v1x; float dy = p.y - v1y; float sx = v2x - v1x; float sy = v2y - v1y; float ds = dx * sx + dy * sy; if (ds > 0) { float s2 = sx * sx + sy * sy; if (ds > s2) { dx = p.x - v2x; dy = p.y - v2y; } else { dx -= ds / s2 * sx; dy -= ds / s2 * sy; } } float d1 = JBoxUtils.sqrt(dx * dx + dy * dy); if (d1 > 0) { normalOut.x = 1 / d1 * dx; normalOut.y = 1 / d1 * dy; } else { normalOut.x = 0; normalOut.y = 0; } return d1; }</code><technical_language>Please revert equations consistent</technical_language>

Target:
public float computeDistanceToOut(Transform xf, Vec2 p, int childIndex, Vec2 normalOut) { float xfqc = xf.q.c; float xfqs = xf.q.s; float xfpx = xf.p.x; float xfpy = xf.p.y; float v1x = (xfqc * m_vertex1.x - xfqs * m_vertex1.y) + xfpx; float v1y = (xfqs * m_vertex1.x + xfqc * m_vertex1.y) + xfpy; float v2x = (xfqc * m_vertex2.x - xfqs * m_vertex2.y) + xfpx; float v2y = xfqs * m_vertex2.x + xfqc * m_vertex2.y + xfpy; float dx = p.x - v1x; float dy = p.y - v1y; float sx = v2x - v1x; float sy = v2y - v1y; float ds = dx * sx + dy * sy; if (ds > 0) { float s2 = sx * sx + sy * sy; if (ds > s2) { dx = p.x - v2x; dy = p.y - v2y; } else { dx -= ds / s2 * sx; dy -= ds / s2 * sy; } } float d1 = JBoxUtils.sqrt(dx * dx + dy * dy); if (d1 > 0) { normalOut.x = 1 / d1 * dx; normalOut.y = 1 / d1 * dy; } else { normalOut.x = 0; normalOut.y = 0; } return d1; }
Source:
<code>private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { int magic = in.readInt(); int fileVersionNumber = in.readInt(); if (magic != MAGIC_NUMBER) { fileVersionNumber = 0; } long lsb = in.readLong(); long msb = in.readLong(); worldUid = new UUID(msb, lsb); cx = in.readInt(); cz = in.readInt(); if (fileVersionNumber == CURRENT_VERSION) { int size; AtomicIntegerArray data = this.data = new AtomicIntegerArray(size = in.readInt()); worldHeight = size / PAGE_SIZE; for (int i = 0; i < size; i++) { data.set(i, in.readInt()); } } else { <START> boolean[][][] st = (boolean[][][]) in.readObject(); int wh; <END> this.data = new AtomicIntegerArray((wh = worldHeight = st[0][0].length) * PAGE_SIZE); for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { for (int y = 0; y < wh; y++) { set(x, y, z, st[x][z][y]); } } } } if (fileVersionNumber < 5) { fixArray(); dirty = true; } }</code><technical_language>Please avoid variable names of this nature, I prefer more verbose names</technical_language>

Target:
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { int magic = in.readInt(); int fileVersionNumber = in.readInt(); if (magic != MAGIC_NUMBER) { fileVersionNumber = 0; } long lsb = in.readLong(); long msb = in.readLong(); worldUid = new UUID(msb, lsb); cx = in.readInt(); cz = in.readInt(); if (fileVersionNumber == CURRENT_VERSION) { int size; AtomicIntegerArray data = this.data = new AtomicIntegerArray(size = in.readInt()); if ((size % PAGE_SIZE) != 0) throw new InvalidObjectException("Illegal data length"); worldHeight = size / PAGE_SIZE; for (int i = 0; i < size; i++) { data.set(i, in.readInt()); } } else { boolean[][][] st = (boolean[][][]) in.readObject(); int wh; this.data = new AtomicIntegerArray((wh = worldHeight = st[0][0].length) * PAGE_SIZE); for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { for (int y = 0; y < wh; y++) { set(x, y, z, st[x][z][y]); } } } } if (fileVersionNumber < 5) { fixArray(); dirty = true; } }
Source:
<code>protected void parseAsYaml(String fileURI, InputStream inputStream) { <START> Map<String, Object> parsed = getYamlParser().load(inputStream); <END> cache.put(fileURI, parsed); }</code><technical_language>Small - If in getYamlParser() is returning a new Yaml() this line new Yaml().load(...) eliminate extra method</technical_language>

Target:
protected void parseAsYaml(String fileURI, InputStream inputStream) { Map<String, Object> parsed = new Yaml().load(inputStream); cache.put(fileURI, parsed); }
Source:
<code>public QuotaBalanceVO findLaterBalanceEntry(final Long accountId, final Long domainId, final Date afterThis) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<QuotaBalanceVO>() { @Override <START> public QuotaBalanceVO doInTransaction(final TransactionStatus status) { <END> List<QuotaBalanceVO> quotaBalanceEntries = new ArrayList<>(); Filter filter = new Filter(QuotaBalanceVO.class, "updatedOn", true, 0L, 1L); SearchCriteria<QuotaBalanceVO> sc = createSearchCriteria(); sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); sc.addAnd("creditsId", SearchCriteria.Op.EQ, 0); sc.addAnd("updatedOn", SearchCriteria.Op.GT, afterThis); quotaBalanceEntries = search(sc, filter); return quotaBalanceEntries.size() > 0 ? quotaBalanceEntries.get(0) : null; } }); }</code><technical_language>This closure similar in findLastBalanceEntry. Extract a common static class accepts a filter search criteria in constructor</technical_language>

Target:
public QuotaBalanceVO findLaterBalanceEntry(final Long accountId, final Long domainId, final Date afterThis) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<QuotaBalanceVO>() { @Override public QuotaBalanceVO doInTransaction(final TransactionStatus status) { List<QuotaBalanceVO> quotaBalanceEntries = new ArrayList<>(); Filter filter = new Filter(QuotaBalanceVO.class, "updatedOn", true, 0L, 1L); QueryBuilder<QuotaBalanceVO> qb = QueryBuilder.create(QuotaBalanceVO.class); qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId); qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId); qb.and(qb.entity().getCreditsId(), SearchCriteria.Op.EQ, 0); qb.and(qb.entity().getUpdatedOn(), SearchCriteria.Op.GT, afterThis); quotaBalanceEntries = search(qb.create(), filter); return quotaBalanceEntries.size() > 0 ? quotaBalanceEntries.get(0) : null; } }); }
Source:
<code>public void invoke(KafkaTransactionState transaction, IN next, Context context) throws FlinkKafkaException { checkErroneous(); Long timestamp = context.timestamp(); int[] partitions = getPartitions(transaction); int partitionIndex; try { partitionIndex = KeyGroupRangeAssignment .assignKeyToParallelOperator(keySelector.getKey(next), partitions.length, partitions.length); } catch (Exception e) { throw new RuntimeException("Fail to assign a partition number to record"); } <START> ProducerRecord<byte[], byte[]> record = new ProducerRecord<>( <END> defaultTopicId, partitionIndex, timestamp, null, kafkaSerializer.serializeRecord(next, timestamp)); pendingRecords.incrementAndGet(); transaction.getProducer().send(record, callback); }</code><technical_language>explain again, store timestamp in ProducerRecord serialize it? redundant</technical_language>

Target:
public void invoke(KafkaTransactionState transaction, IN next, Context context) throws FlinkKafkaException { checkErroneous(); Long timestamp = context.timestamp(); int[] partitions = getPartitions(transaction); int partitionIndex; try { partitionIndex = KeyGroupRangeAssignment .assignKeyToParallelOperator(keySelector.getKey(next), partitions.length, partitions.length); } catch (Exception e) { throw new RuntimeException("Fail to assign a partition number to record", e); } ProducerRecord<byte[], byte[]> record = new ProducerRecord<>( defaultTopicId, partitionIndex, timestamp, null, kafkaSerializer.serializeRecord(next, timestamp)); pendingRecords.incrementAndGet(); transaction.getProducer().send(record, callback); }
Source:
<code>public boolean eval(Row row) { Object metricVal = row.getRaw(aggregationName); if (metricVal == null || value == null) { return metricVal == null && value == null; } <START> return HavingSpecMetricComparator.compare(row, aggregationName, value, aggregators) == 0; <END> }</code><technical_language>optimize perform row.getRaw() twice</technical_language>

Target:
public boolean eval(Row row) { Object metricVal = row.getRaw(aggregationName); if (metricVal == null || value == null) { return metricVal == null && value == null; } return HavingSpecMetricComparator.compare(aggregationName, value, aggregators, metricVal) == 0; }
Source:
<code>public PriorPaymentControlResult priorCall(final PaymentControlContext paymentControlContext, final Iterable<PluginProperty> pluginProperties) throws PaymentControlApiException { final TransactionType transactionType = paymentControlContext.getTransactionType(); Preconditions.checkArgument(paymentControlContext.getPaymentApiType() == PaymentApiType.PAYMENT_TRANSACTION); Preconditions.checkArgument(transactionType == TransactionType.PURCHASE || transactionType == TransactionType.REFUND || transactionType == TransactionType.CHARGEBACK); final InternalCallContext internalContext = internalCallContextFactory.createInternalCallContext(paymentControlContext.getAccountId(), paymentControlContext); switch (transactionType) { case PURCHASE: <START> return (paymentControlContext.getPaymentMethodId() != null) ? getPluginPurchaseResult(paymentControlContext, pluginProperties, internalContext) : <END> new DefaultPriorPaymentControlResult(true); case REFUND: return getPluginRefundResult(paymentControlContext, pluginProperties, internalContext); case CHARGEBACK: return new DefaultPriorPaymentControlResult(false, paymentControlContext.getAmount()); default: throw new IllegalStateException("Unexpected transactionType " + transactionType); } }</code><technical_language>@sbrossie automatically in AUTO_PAY_OFF today (unless account a payment method)</technical_language>

Target:
public PriorPaymentControlResult priorCall(final PaymentControlContext paymentControlContext, final Iterable<PluginProperty> pluginProperties) throws PaymentControlApiException { final TransactionType transactionType = paymentControlContext.getTransactionType(); Preconditions.checkArgument(paymentControlContext.getPaymentApiType() == PaymentApiType.PAYMENT_TRANSACTION); Preconditions.checkArgument(transactionType == TransactionType.PURCHASE || transactionType == TransactionType.REFUND || transactionType == TransactionType.CHARGEBACK); final InternalCallContext internalContext = internalCallContextFactory.createInternalCallContext(paymentControlContext.getAccountId(), paymentControlContext); switch (transactionType) { case PURCHASE: return getPluginPurchaseResult(paymentControlContext, pluginProperties, internalContext); case REFUND: return getPluginRefundResult(paymentControlContext, pluginProperties, internalContext); case CHARGEBACK: return new DefaultPriorPaymentControlResult(false, paymentControlContext.getAmount()); default: throw new IllegalStateException("Unexpected transactionType " + transactionType); } }
Source:
<code>public long getFilePageId( long pageRef ) { <START> long filePageId = UnsafeUtil.getLong( offFilePageId( pageRef ) ) >>> 24; <END> return filePageId == MAX_FILE_PAGE_ID ? PageCursor.UNBOUND_PAGE_ID : filePageId; }</code><technical_language>for mister 24</technical_language>

Target:
public long getFilePageId( long pageRef ) { long filePageId = UnsafeUtil.getLong( offFilePageId( pageRef ) ) >>> SHIFT_FILE_PAGE_ID; return filePageId == MAX_FILE_PAGE_ID ? PageCursor.UNBOUND_PAGE_ID : filePageId; }
Source:
<code><START> public ListOffsetsResultInfo(long offset, long timestamp, Optional<Integer> leaderEpoch) { <END> this.offset = offset; this.timestamp = timestamp; this.leaderEpoch = leaderEpoch; }</code><technical_language>Default access too</technical_language>

Target:
ListOffsetsResultInfo(long offset, long timestamp, Optional<Integer> leaderEpoch) { this.offset = offset; this.timestamp = timestamp; this.leaderEpoch = leaderEpoch; }