auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static CompositeRequirement allOf(List<Requirement> requirements) { <START> return new MultiCompositeRequirement(copyOf(wrapAsCompositeRequirements(requirements).stream().map(ImmutableSet::of).collect(Collectors.toList()))); <END> }</code><technical_language>collect toImmutableSet is need ImmutableSet.copyOf, static import. Add new line .map .collect</technical_language>

Target:
public static CompositeRequirement allOf(List<Requirement> requirements) { return new MultiCompositeRequirement(wrapAsCompositeRequirements(requirements).stream() .map(ImmutableSet::of) .collect(toImmutableSet())); }
Source:
<code>void should_fail_if_null() { List<SoftAssertions> softAssertions = new ArrayList<SoftAssertions>() {{ add(softlyNotAnnotated1); add(softlyNotAnnotated2); }}; ThrowingCallable code = () -> assertThat(softAssertions).doesNotContainNull(); assertThatAssertionErrorIsThrownBy(code).withMessage(ShouldNotContainNull.shouldNotContainNull(softAssertions).create()); <START> <END> }</code><technical_language>minor: remove empty lines</technical_language>

Target:
void should_fail_if_null() { ThrowingCallable code = () -> assertThat(softlyNotAnnotated).isNotNull(); assertThatAssertionErrorIsThrownBy(code).withMessage(ShouldNotBeNull.shouldNotBeNull().create()); }
Source:
<code>private String kaomojiify(String message) throws Exception { String[] words = splitWords(message); String kaomoji = ""; if (words.length <= 0 ){ return "ⓃⒶⓃⒾ(☉൧ ಠ ꐦ)"; } if (words.length >= 1 ){ if (words[0].equals("wat")){ words[0] = "confused"; } <START> else if (words[0].equals("nsfw") | words[0].equals("wtf")){ <END> kaomoji = "ⓃⒶⓃⒾ(☉൧ ಠ ꐦ)"; } else if (words[0].equals("vilebot")){ kaomoji = "( ͡° ͜ʖ ͡° )"; } else { kaomoji = getKaomoji(words[0]); } if (kaomoji.isEmpty()){ kaomoji = "щ(ಥдಥщ)"; } } return kaomoji; }</code><technical_language>I circuit-break || is intended instead of bitwise |. operands booleans, is this do additional equals call is needed</technical_language>

Target:
private String kaomojiify(String message) throws Exception { String[] words = splitWords(message); String kaomoji = ""; if (words.length <= 0 ){ return "ⓃⒶⓃⒾ(☉൧ ಠ ꐦ)"; } if (words.length >= 1 ){ if (words[0].equals("wat")){ words[0] = "confused"; } else if (words[0].equals("nsfw") || words[0].equals("wtf")){ kaomoji = "ⓃⒶⓃⒾ(☉൧ ಠ ꐦ)"; } else if (words[0].equals("vilebot")){ kaomoji = "( ͡° ͜ʖ ͡° )"; } else { kaomoji = getKaomoji(words[0]); } if (kaomoji.isEmpty()){ kaomoji = "щ(ಥдಥщ)"; } } return kaomoji; }
Source:
<code>public void addAJPListenerInGUI() throws Exception { ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", AJP_LISTENER_TBA); editor.text(SOCKET_BINDING, SOCKET_BINDING_AJP_TBA); boolean result = wizard.finishAndDismissReloadRequiredWindow(); Assert.assertTrue("Window should be closed", result); Assert.assertTrue("AJP listener should be present in table", config.resourceIsPresent(AJP_LISTENER_TBA)); new ResourceVerifier(AJP_LISTENER_ADDRESS_TBA, client).verifyExists(); <START> new ResourceVerifier(AJP_LISTENER_ADDRESS_TBA, client).verifyAttribute(SOCKET_BINDING, SOCKET_BINDING_AJP_TBA); <END> }</code><technical_language>chained (not necessary duplicated constructor call) I insist it</technical_language>

Target:
public void addAJPListenerInGUI() throws Exception { ConfigFragment config = page.getConfigFragment(); String socketBinding = undertowOps.createSocketBinding(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", AJP_LISTENER_TBA); editor.text(SOCKET_BINDING, socketBinding); boolean result = wizard.finishAndDismissReloadRequiredWindow(); Assert.assertTrue("Window should be closed", result); Assert.assertTrue("AJP listener should be present in table", config.resourceIsPresent(AJP_LISTENER_TBA)); new ResourceVerifier(AJP_LISTENER_ADDRESS_TBA, client) .verifyExists() .verifyAttribute(SOCKET_BINDING, socketBinding); }
Source:
<code>public static RetryIntervalType find(String value) { for (RetryIntervalType r : RetryIntervalType.values()) { if (r.type.equalsIgnoreCase(value)) { return r; } } <START> throw new ConfigException("Invalid retry_interval_type"); <END> }</code><technical_language>I show actual message this. do think? "Invalid retry_interval_type " +</technical_language>

Target:
public static RetryIntervalType find(String value) { for (RetryIntervalType r : RetryIntervalType.values()) { if (r.type.equalsIgnoreCase(value)) { return r; } } throw new ConfigException("Invalid retry_interval_type: " + value); }
Source:
<code>TreeDefinition(TreeBranchDefinition branch, String speciesName, String binomial, boolean dominant, EnumLeafType leafType, Color primary, Color secondary, IWoodType woodType) { String uid = Constants.MOD_ID + ".tree" + this; String unlocalizedDescription = "for.description.tree" + this; String unlocalizedName = "for.trees.species." + speciesName; this.branch = branch; ILeafSpriteProvider leafIconProvider = TreeManager.treeFactory.getLeafIconProvider(leafType, primary, secondary); IGermlingModelProvider germlingIconProvider = ModelProviderFactory.create(woodType, uid, leafIconProvider); IWoodProvider woodProvider = WoodProviderFactory.create(woodType); ILeafProvider leafProvider = new LeafProvider(); IAlleleTreeSpeciesBuilder speciesBuilder = TreeManager.treeFactory.createSpecies(uid, unlocalizedName, "Sengir", unlocalizedDescription, dominant, branch.getBranch(), binomial, Constants.MOD_ID, leafIconProvider, germlingIconProvider, woodProvider, this, leafProvider); setSpeciesProperties(speciesBuilder); this.species = speciesBuilder.build(); <START> leafProvider.init(this.species); <END> this.woodType = woodType; }</code><technical_language>call init manually called in build method of species. <LINK_0></technical_language>

Target:
TreeDefinition(TreeBranchDefinition branch, String speciesName, String binomial, boolean dominant, EnumLeafType leafType, Color primary, Color secondary, IWoodType woodType) { String uid = Constants.MOD_ID + ".tree" + this; String unlocalizedDescription = "for.description.tree" + this; String unlocalizedName = "for.trees.species." + speciesName; this.branch = branch; ILeafSpriteProvider leafIconProvider = TreeManager.treeFactory.getLeafIconProvider(leafType, primary, secondary); IGermlingModelProvider germlingIconProvider = ModelProviderFactory.create(woodType, uid, leafIconProvider); IWoodProvider woodProvider = WoodProviderFactory.create(woodType); ILeafProvider leafProvider = new LeafProvider(); IAlleleTreeSpeciesBuilder speciesBuilder = TreeManager.treeFactory.createSpecies(uid, unlocalizedName, "Sengir", unlocalizedDescription, dominant, branch.getBranch(), binomial, Constants.MOD_ID, leafIconProvider, germlingIconProvider, woodProvider, this, leafProvider); setSpeciesProperties(speciesBuilder); this.species = speciesBuilder.build(); this.woodType = woodType; }
Source:
<code>private CucumberTestContext() { <START> throw new AssertionError(); <END> }</code><technical_language>suggestion</technical_language>

Target:
private CucumberTestContext() { }
Source:
<code>public int compare(int i, int j) { float vi = a[i]; float vj = a[j]; <START> return (floatEquals(vi, vj)) ? 0 : (vi > vj) ? 1 : -1; <END> }</code><technical_language>This odd. vi>vj, vi<vj some special cases NaN handled instead? I do floatEquals buys here</technical_language>

Target:
public int compare(int i, int j) { float vi = a[i]; float vj = a[j]; return Float.compare(vi, vj); }
Source:
<code>public void testEquals() { ______TS("Different classes, should be different"); FeedbackQuestionDetails ftqd1 = new FeedbackTextQuestionDetails("text question"); FeedbackQuestionDetails ftqd2 = new FeedbackMcqQuestionDetails(); assertFalse(ftqd1.equals(ftqd2)); ______TS("Some attributes are different, should be different"); ftqd1 = new FeedbackTextQuestionDetails("first question"); ftqd2 = new FeedbackTextQuestionDetails("second question"); assertFalse(ftqd1.equals(ftqd2)); ftqd2 = new FeedbackTextQuestionDetails("first question"); ((FeedbackTextQuestionDetails) ftqd1).setRecommendedLength(50); assertFalse(ftqd1.equals(ftqd2)); <START> ______TS("All attributes are same, should be same"); <END> ((FeedbackTextQuestionDetails) ftqd2).setRecommendedLength(50); assertTrue(ftqd1.equals(ftqd2)); }</code><technical_language>Test case for references question details? - Test case for null input? Basically, try cover statement for equal() introduced</technical_language>

Target:
public void testEquals() { ______TS("Same object with different references, should be same"); FeedbackQuestionDetails ftqd1 = new FeedbackTextQuestionDetails("text question"); FeedbackQuestionDetails ftqd2 = ftqd1; assertEquals(ftqd1, ftqd2); ______TS("One input is null, should be different"); ftqd1 = new FeedbackTextQuestionDetails("text question"); ftqd2 = null; assertNotEquals(ftqd1, ftqd2); ______TS("Different classes, should be different"); ftqd1 = new FeedbackTextQuestionDetails("text question"); ftqd2 = new FeedbackMcqQuestionDetails(); assertNotEquals(ftqd1, ftqd2); ______TS("Some attributes are different, should be different"); ftqd1 = new FeedbackTextQuestionDetails("first question"); ftqd2 = new FeedbackTextQuestionDetails("second question"); assertNotEquals(ftqd1, ftqd2); ftqd2 = new FeedbackTextQuestionDetails("first question"); ((FeedbackTextQuestionDetails) ftqd1).setRecommendedLength(50); assertNotEquals(ftqd1, ftqd2); ______TS("All attributes are same, should be same"); ((FeedbackTextQuestionDetails) ftqd2).setRecommendedLength(50); assertEquals(ftqd1, ftqd2); }
Source:
<code>protected boolean validate() { boolean returnValue = true; Permission p = getPermissionDao().get(getParameters().getPermission().getId()); if (MultiLevelAdministrationHandler.isLastSuperUserPermission(p.getRoleId())) { getReturnValue().getValidationMessages() .add(EngineMessage.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE.toString()); returnValue = false; } else if (p.getRoleType().equals(RoleType.ADMIN) && !isSystemSuperUser()) { addValidationMessage(EngineMessage.PERMISSION_REMOVE_FAILED_ONLY_SYSTEM_SUPER_USER_CAN_REMOVE_ADMIN_ROLES); returnValue = false; } <START> if(getParameters().getTargetId() != null && !Objects.equals(p.getAdElementId(), getParameters().getTargetId())) { <END> addValidationMessage(EngineMessage.INHERITED_PERMISSION_CANT_BE_REMOVED); returnValue = false; } return returnValue; }</code><technical_language>Condition "getParameters().getTargetId() != null" is needed Objects.equals handles null values correctly</technical_language>

Target:
protected boolean validate() { boolean returnValue = true; Permission p = getPermissionDao().get(getParameters().getPermission().getId()); if (MultiLevelAdministrationHandler.isLastSuperUserPermission(p.getRoleId())) { getReturnValue().getValidationMessages() .add(EngineMessage.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE.toString()); returnValue = false; } else if (p.getRoleType().equals(RoleType.ADMIN) && !isSystemSuperUser()) { addValidationMessage(EngineMessage.PERMISSION_REMOVE_FAILED_ONLY_SYSTEM_SUPER_USER_CAN_REMOVE_ADMIN_ROLES); returnValue = false; } if(!Objects.equals(p.getAdElementId(), getParameters().getTargetId())) { addValidationMessage(EngineMessage.INHERITED_PERMISSION_CANT_BE_REMOVED); returnValue = false; } return returnValue; }
Source:
<code>public void should_create_mock_from_final_class_in_the_JDK() throws Exception { <START> assumeTrue(ClassFileVersion.ofThisVm().isLessThan(ClassFileVersion.JAVA_V9)); END> MockCreationSettings<Pattern> settings = settingsFor(Pattern.class); Pattern proxy = mockMaker.createMock(settings, new MockHandlerImpl<Pattern>(settings)); assertThat(proxy.pattern()).isEqualTo("bar"); }</code><technical_language>This a conflict current master: <LINK_0> choose another. I fine way, specific preference</technical_language>

Target:
public void should_create_mock_from_final_class_in_the_JDK() throws Exception { assumeTrue(ClassFileVersion.ofThisVm().isLessThan(JAVA_V9)); MockCreationSettings<Pattern> settings = settingsFor(Pattern.class); Pattern proxy = mockMaker.createMock(settings, new MockHandlerImpl<Pattern>(settings)); assertThat(proxy.pattern()).isEqualTo("bar"); }
Source:
<code>private void fitPartial( MultiDataSet dataSet, List<S.Builder> featureStatsBuilders, List<S.Builder> labelStatsBuilders <START> ) { <END> int numInputs = dataSet.getFeatures().length; int numOutputs = dataSet.getLabels().length; ensureStatsBuilders(featureStatsBuilders, numInputs); ensureStatsBuilders(labelStatsBuilders, numOutputs); for (int i = 0; i < numInputs; i++) { featureStatsBuilders.get(i).add(dataSet.getFeatures(i), dataSet.getFeaturesMaskArray(i)); } if (isFitLabel()) { for (int i = 0; i < numOutputs; i++) { labelStatsBuilders.get(i).add(dataSet.getLabels(i), dataSet.getLabelsMaskArray(i)); } } }</code><technical_language>Move this 1 line :D. I this is typical style in c - in java (at in code base)</technical_language>

Target:
private void fitPartial(MultiDataSet dataSet, List<S.Builder> featureStatsBuilders, List<S.Builder> labelStatsBuilders) { int numInputs = dataSet.numFeatureArrays(); int numOutputs = dataSet.numLabelsArrays(); ensureStatsBuilders(featureStatsBuilders, numInputs); ensureStatsBuilders(labelStatsBuilders, numOutputs); for (int i = 0; i < numInputs; i++) { featureStatsBuilders.get(i).add(dataSet.getFeatures(i), dataSet.getFeaturesMaskArray(i)); } if (isFitLabel()) { for (int i = 0; i < numOutputs; i++) { labelStatsBuilders.get(i).add(dataSet.getLabels(i), dataSet.getLabelsMaskArray(i)); } } }
Source:
<code>public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final QueryMetrics<? super Query<T>> queryMetrics = queryToolChest.makeMetrics(query); applyCustomDimensions.accept(queryMetrics); <START> final Query<T> queryWithMetrics = query.withQueryMetrics(queryMetrics); <END> return Sequences.wrap( new LazySequence<>(() -> queryRunner.run(queryWithMetrics, responseContext)), new SequenceWrapper() { private long startTimeNs; @Override public void before() { startTimeNs = System.nanoTime(); } @Override public void after(boolean isDone, Throwable thrown) { if (thrown != null) { queryMetrics.status("failed"); } else if (!isDone) { queryMetrics.status("short"); } long timeTakenNs = System.nanoTime() - startTimeNs; reportMetric.accept(queryMetrics, timeTakenNs); if (creationTimeNs > 0) { queryMetrics.reportWaitTime(startTimeNs - creationTimeNs); } queryMetrics.emit(emitter); } } ); }</code><technical_language>question, this need done if query a QueryMetrics set in it</technical_language>

Target:
public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final QueryMetrics<? super Query<T>> queryMetrics = queryToolChest.makeMetrics(query); applyCustomDimensions.accept(queryMetrics); return Sequences.wrap( new LazySequence<>(() -> queryRunner.run(query, responseContext)), new SequenceWrapper() { private long startTimeNs; @Override public void before() { startTimeNs = System.nanoTime(); } @Override public void after(boolean isDone, Throwable thrown) { if (thrown != null) { queryMetrics.status("failed"); } else if (!isDone) { queryMetrics.status("short"); } long timeTakenNs = System.nanoTime() - startTimeNs; reportMetric.accept(queryMetrics, timeTakenNs); if (creationTimeNs > 0) { queryMetrics.reportWaitTime(startTimeNs - creationTimeNs); } queryMetrics.emit(emitter); } } ); }
Source:
<code>private boolean isJobOnMinionType(Job job, String minionType) { Set<String> hostsWithTargetMinionType = new HashSet<String>(); List<HostState> hostStates = spawn.hostManager.listHostStatus(minionType); for (HostState hostState : hostStates) { hostsWithTargetMinionType.add(hostState.getHostUuid()); } for (JobTask jobTask : job.getCopyOfTasks()) { <START> if (!hostsWithTargetMinionType.contains(jobTask.getHostUUID())) { <END> return false; } List<JobTaskReplica> replicas = jobTask.getReplicas(); for (JobTaskReplica replica : replicas) { if (!hostsWithTargetMinionType.contains(replica.getHostUUID())) { return false; } } } return true; }</code><technical_language>Is jobTask.getHostUUID of jobTask.getReplicas</technical_language>

Target:
private boolean isJobOnMinionType(Job job, String minionType) { Set<String> hostsWithTargetMinionType = getHostsWithTargetMninionType(minionType); for (JobTask jobTask : job.getCopyOfTasks()) { if (!hostsWithTargetMinionType.contains(jobTask.getHostUUID())) { return false; } List<JobTaskReplica> replicas = jobTask.getReplicas(); for (JobTaskReplica replica : replicas) { if (!hostsWithTargetMinionType.contains(replica.getHostUUID())) { return false; } } } return true; }
Source:
<code>private static String getRoutingDataCacheKey(RoutingDataReaderType routingDataReaderType, String endpoint) { <START> return routingDataReaderType.name() + "_" + endpoint; <END> }</code><technical_language>If in resolveRoutingDataReader() assume routingDataReaderType null, a NullPointerExcpetion here</technical_language>

Target:
private static String getRoutingDataCacheKey(RoutingDataReaderType routingDataReaderType, String endpoint) { if (routingDataReaderType == null) { throw new MultiZkException("RoutingDataManager: RoutingDataReaderType cannot be null!"); } return routingDataReaderType.name() + "_" + endpoint; }
Source:
<code>private void rejoinModifies(ProgressMonitor pm) { HashMap<String, DiffEntry> nameMap = new HashMap<>(); ArrayList<DiffEntry> newAdded = new ArrayList<>(added.size()); pm.beginTask(JGitText.get().renamesRejoiningModifies, added.size() + deleted.size()); for (DiffEntry src : deleted) { if (pm.isCancelled()) { <START> break; <END> } nameMap.put(src.oldPath, src); pm.update(1); } for (DiffEntry dst : added) { if (pm.isCancelled()) { break; } DiffEntry src = nameMap.remove(dst.newPath); if (src != null) { if (sameType(src.oldMode, dst.newMode)) { entries.add(DiffEntry.pair(ChangeType.MODIFY, src, dst, src.score)); } else { nameMap.put(src.oldPath, src); newAdded.add(dst); } } else { newAdded.add(dst); } pm.update(1); } added = newAdded; deleted = new ArrayList<>(nameMap.values()); }</code><technical_language>throw? a method private void advanceOrCancel(ProgressMonitor pm) throws CanceledException { if (pm.isCancelled()) { throw new CanceledException(JGitText.get().renameCancelled); } pm.update(1); } instead of pm.update(1) help</technical_language>

Target:
private void rejoinModifies(ProgressMonitor pm) throws CanceledException { HashMap<String, DiffEntry> nameMap = new HashMap<>(); ArrayList<DiffEntry> newAdded = new ArrayList<>(added.size()); pm.beginTask(JGitText.get().renamesRejoiningModifies, added.size() + deleted.size()); for (DiffEntry src : deleted) { nameMap.put(src.oldPath, src); advanceOrCancel(pm); } for (DiffEntry dst : added) { DiffEntry src = nameMap.remove(dst.newPath); if (src != null) { if (sameType(src.oldMode, dst.newMode)) { entries.add(DiffEntry.pair(ChangeType.MODIFY, src, dst, src.score)); } else { nameMap.put(src.oldPath, src); newAdded.add(dst); } } else { newAdded.add(dst); } advanceOrCancel(pm); } added = newAdded; deleted = new ArrayList<>(nameMap.values()); }
Source:
<code><START> public static <END> boolean is(String name, Class<?> type) { while (type != null) { if (name.equals(type.getName())) { return true; } Class<?>[] interfaces = type.getInterfaces(); if (interfaces != null) { for (Class<?> i : interfaces) { if (is(name, i)) { return true; } } } type = type.getSuperclass(); } return false; }</code><technical_language>needed in this change</technical_language>

Target:
static boolean is(String name, Class<?> type) { while (type != null) { if (name.equals(type.getName())) { return true; } Class<?>[] interfaces = type.getInterfaces(); if (interfaces != null) { for (Class<?> i : interfaces) { if (is(name, i)) { return true; } } } type = type.getSuperclass(); } return false; }
Source:
<code>public Object[] factory() { <START> List<Object> tests = new ArrayList<>(3 * 3 * 2); <END> for (TransactionMode txMode : TransactionMode.values()) { if (txMode == NONE) { continue; } for (LockingMode lockingMode : LockingMode.values()) { tests.add(new TxFunctionalTest<byte[], byte[]>().keyValueGenerator(BYTE_ARRAY_GENERATOR).transactionMode(txMode).lockingMode(lockingMode)); tests.add(new TxFunctionalTest<String, String>().keyValueGenerator(STRING_GENERATOR).transactionMode(txMode).lockingMode(lockingMode)); tests.add(new TxFunctionalTest<Object[], Object[]>().keyValueGenerator(GENERIC_ARRAY_GENERATOR).transactionMode(txMode).javaSerialization().lockingMode(lockingMode)); } } return tests.toArray(); }</code><technical_language>re: flatMap</technical_language>

Target:
public Object[] factory() { return Arrays.stream(TransactionMode.values()) .filter(tMode -> tMode != NONE) .flatMap(txMode -> Arrays.stream(LockingMode.values()) .flatMap(lockingMode -> Stream.builder() .add(new TxFunctionalTest<byte[], byte[]>() .keyValueGenerator(BYTE_ARRAY_GENERATOR) .transactionMode(txMode) .lockingMode(lockingMode)) .add(new TxFunctionalTest<String, String>() .keyValueGenerator(STRING_GENERATOR) .transactionMode(txMode) .lockingMode(lockingMode)) .add(new TxFunctionalTest<Object[], Object[]>() .keyValueGenerator(GENERIC_ARRAY_GENERATOR).javaSerialization() .transactionMode(txMode) .lockingMode(lockingMode)) .build())).toArray(); }
Source:
<code>private void handleRequest(HttpRequest httpRequest) throws RestServiceException { if (request == null) { nettyMetrics.requestArrivalRate.mark(); request = new NettyRequest(httpRequest); responseChannel = new NettyResponseChannel(ctx, nettyMetrics); logger.trace("Channel now handling request {}", ctx.channel(), request.getUri()); <START> if (RestMethod.POST.equals(request.getRestMethod())) { <END> requestHandler.handleRequest(request, responseChannel); } } else { logger.warn("Discarding duplicate request on channel {}. Current request - {}. Duplicate request - {}", ctx.channel(), request.getUri(), httpRequest.getUri()); nettyMetrics.duplicateRequestError.inc(); } }</code><technical_language>reverse this well</technical_language>

Target:
private void handleRequest(HttpRequest httpRequest) throws RestServiceException { if (request == null) { nettyMetrics.requestArrivalRate.mark(); request = new NettyRequest(httpRequest); responseChannel = new NettyResponseChannel(ctx, nettyMetrics); logger.trace("Channel now handling request {}", ctx.channel(), request.getUri()); if (request.getRestMethod().equals(RestMethod.POST)) { requestHandler.handleRequest(request, responseChannel); } } else { logger.warn("Discarding duplicate request on channel {}. Current request - {}. Duplicate request - {}", ctx.channel(), request.getUri(), httpRequest.getUri()); nettyMetrics.duplicateRequestError.inc(); } }
Source:
<code>public static String getJavaLevel(IJavaProject project) throws Exception { IClasspathEntry[] classpathEntries = project.getRawClasspath(); for (IClasspathEntry classpathEntry : classpathEntries) { if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path = classpathEntry.getPath(); if (path == null || path.segmentCount() < 3) continue; if (PATH_JRE_CONTAINER.equals(path.segment(0)) && PATH_JRE_STANDARD_VM.equals(path.segment(1))) { String jreName = path.segment(2); <START> return EE.parse(jreName) <END> .getVersionLabel(); } } } throw new IllegalArgumentException("No standard JRE container found on project classpath"); }</code><technical_language>is a slight behavioral difference here. JavaLevel.fromLabel throw IllegalArgumentException if jre name unknown. EE.parse return null lead NPE getVersionLabel() is called. I need check for null EE.parse throw IllegalArgumentException preserve semantics of this method. java EE ee = EE.parse(jreName); if (ee == null) { throw new IllegalArgumentException("Unrecognized Java compliance level: " + jreName); } return ee.getVersionLabel();</technical_language>

Target:
public static String getJavaLevel(IJavaProject project) throws Exception { IClasspathEntry[] classpathEntries = project.getRawClasspath(); for (IClasspathEntry classpathEntry : classpathEntries) { if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path = classpathEntry.getPath(); if (path == null || path.segmentCount() < 3) continue; if (PATH_JRE_CONTAINER.equals(path.segment(0)) && PATH_JRE_STANDARD_VM.equals(path.segment(1))) { String jreName = path.segment(2); EE ee = EE.parse(jreName); if (ee == null) { throw new IllegalArgumentException("Unrecognized Java compliance level: " + jreName); } return ee.getVersionLabel(); } } } throw new IllegalArgumentException("No standard JRE container found on project classpath"); }
Source:
<code>public void onStreamProcessorLaunchSuccess(SamzaResource resource) { String containerId = resource.getContainerId(); String containerHost = resource.getHost(); String processorId = getPendingProcessorId(containerId); LOG.info("Successfully started Processor ID: on Container ID: on host: {}", processorId, containerId, containerHost); if (processorId != null) { LOG.info("Moving Processor ID: on Container ID: on host: from pending to running state.", processorId, containerId, containerHost); state.pendingProcessors.remove(processorId); state.runningProcessors.put(processorId, resource); if (jobConfig.getApplicationMasterHighAvailabilityEnabled()) { state.processorToExecutionId.put(processorId, containerId); } if (state.neededProcessors.decrementAndGet() == 0) { <START> state.jobHealthy.set(true); <END> } containerManager.handleContainerLaunchSuccess(processorId, containerHost); } else { LOG.warn("Did not find a pending Processor ID for Container ID: on host: {}. " + "Ignoring invalid/redundant notification.", containerId, containerHost); } }</code><technical_language>current flow set job healthy in event containers previous attempt is necessity spin a new one</technical_language>

Target:
public void onStreamProcessorLaunchSuccess(SamzaResource resource) { String containerId = resource.getContainerId(); String containerHost = resource.getHost(); String processorId = getPendingProcessorId(containerId); LOG.info("Successfully started Processor ID: on Container ID: on host: {}", processorId, containerId, containerHost); if (processorId != null) { LOG.info("Moving Processor ID: on Container ID: on host: from pending to running state.", processorId, containerId, containerHost); state.pendingProcessors.remove(processorId); state.runningProcessors.put(processorId, resource); if (state.neededProcessors.decrementAndGet() == 0) { state.jobHealthy.set(true); } containerManager.handleContainerLaunchSuccess(processorId, containerHost); } else { LOG.warn("Did not find a pending Processor ID for Container ID: on host: {}. " + "Ignoring invalid/redundant notification.", containerId, containerHost); } }
Source:
<code>public void correctHeaders() throws Exception { <START> refreshIndex(); <END> Entity testEntity=new Entity().chainPut("name", "Solitaire1"); WebResource.Builder builder = app().collection("games") .getResource(true, getAdminToken()) .type(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON); ClientResponse apiResponse=builder.post(ClientResponse.class, testEntity); assertEquals(200, apiResponse.getStatus()); MultivaluedMap<String, String> headers = apiResponse.getHeaders(); List<String> contentType = headers.get("Content-Type"); assertEquals(1, contentType.size()); assertEquals(MediaType.APPLICATION_JSON, contentType.get(0)); }</code><technical_language>Is a specific reason want start refreshing index</technical_language>

Target:
public void correctHeaders() throws Exception { Entity testEntity=new Entity().chainPut("name", "Solitaire1"); WebResource.Builder builder = app().collection("games") .getResource(true, getAdminToken()) .type(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON); ClientResponse apiResponse=builder.post(ClientResponse.class, testEntity); assertEquals(200, apiResponse.getStatus()); MultivaluedMap<String, String> headers = apiResponse.getHeaders(); List<String> contentType = headers.get("Content-Type"); assertEquals(1, contentType.size()); assertEquals(MediaType.APPLICATION_JSON, contentType.get(0)); }
Source:
<code>public static VView loadView(IFile file, Collection<String> registeredEcores) throws IOException { final String path = file.getLocation().toString(); VView view = loadView(path); if (!viewIsResolved(view)) { view = tryResolve(view, path, registeredEcores); if (viewIsResolved(view)) { <START> return null; <END> } } return view; }</code><technical_language>null returned view is resolved. new cases I more sense return view anyway, resolved unresolved, callers handle themselves</technical_language>

Target:
public static VView loadView(IFile file, Collection<String> registeredEcores) throws IOException { final String path = file.getLocation().toString(); final VView view = loadView(path); if (view != null && !viewIsResolved(view)) { return tryResolve(view, path, registeredEcores); } return view; }
Source:
<code>private static boolean submitDeviceReportRecord(DeviceReportRecord slr, String submissionUrl, DataSubmissionListener listener, int index, boolean forceLogs) { File f = new File(slr.getFilePath()); if (f.length() == 0) { return true; } listener.startSubmission(index, f.length()); CommcareRequestGenerator generator; User user; try { user = CommCareApplication.instance().getSession().getLoggedInUser(); } catch (SessionUnavailableException e) { return false; } generator = new CommcareRequestGenerator(user); List<MultipartBody.Part> parts = new ArrayList<>(); parts.add(FormUploadUtil.createEncryptedFilePart( "xml_submission_file", f, "text/xml", new SecretKeySpec(slr.getKey(), "AES"))); HashMap<String, String> queryParams = new HashMap<>(); queryParams.put(QUERY_PARAM_FORCE_LOGS, String.valueOf(forceLogs)); Response<ResponseBody> response = null; try { <START> response = generator.postMultipart(submissionUrl, parts, queryParams); <END> } catch (IOException e) { e.printStackTrace(); return false; } catch (IllegalStateException e) { e.printStackTrace(); return false; } finally { if (response != null && response.body() != null) { response.body().close(); } } int responseCode = response.code(); return (responseCode >= 200 && responseCode < 300); }</code><technical_language>Previously approach add semantic functions time need additional context for a request, I is a good pattern follow here. instead of changing postMultipart externally, a postLogs() method in generator adds relevant queryParams. lets "How do (what headers, in circumstances, etc) communicate XYZ HQ servers" logic live in central place</technical_language>

Target:
private static boolean submitDeviceReportRecord(DeviceReportRecord slr, String submissionUrl, DataSubmissionListener listener, int index, boolean forceLogs) { File f = new File(slr.getFilePath()); if (f.length() == 0) { return true; } listener.startSubmission(index, f.length()); CommcareRequestGenerator generator; User user; try { user = CommCareApplication.instance().getSession().getLoggedInUser(); } catch (SessionUnavailableException e) { return false; } generator = new CommcareRequestGenerator(user); List<MultipartBody.Part> parts = new ArrayList<>(); parts.add(FormUploadUtil.createEncryptedFilePart( "xml_submission_file", f, "text/xml", new SecretKeySpec(slr.getKey(), "AES"))); Response<ResponseBody> response = null; try { response = generator.postLogs(submissionUrl, parts, forceLogs); } catch (IOException e) { e.printStackTrace(); return false; } catch (IllegalStateException e) { e.printStackTrace(); return false; } finally { if (response != null && response.body() != null) { response.body().close(); } } int responseCode = response.code(); return (responseCode >= 200 && responseCode < 300); }
Source:
<code>protected CommandBase(T parameters, CommandContext cmdContext) { if (cmdContext == null) { cmdContext = new CommandContext(new EngineContext().withSessionId(parameters.getSessionId())) .withExecutionContext(new ExecutionContext()); } else if (cmdContext.getEngineContext().getSessionId() == null) { cmdContext.getEngineContext().withSessionId(parameters.getSessionId()); } this.context = cmdContext; _parameters = parameters; DbUser user = SessionDataContainer.getInstance().getUser(cmdContext.getEngineContext().getSessionId(), true); if (user != null) { setCurrentUser(user); } if (SessionDataContainer.getInstance().getPrincipalName(cmdContext.getEngineContext().getSessionId()) == null) { <START> setUserName("engine@internal"); <END> } else { setUserName(SessionDataContainer.getInstance().getUserName(cmdContext.getEngineContext().getSessionId())); } ExecutionContext executionContext = cmdContext.getExecutionContext(); if (executionContext.getJob() != null) { setJobId(executionContext.getJob().getId()); } else if (executionContext.getStep() != null) { setJobId(executionContext.getStep().getJobId()); } Guid commandIdFromParameters = parameters.getCommandId(); if (commandIdFromParameters == null) { commandIdFromParameters = Guid.newGuid(); getParameters().setCommandId(commandIdFromParameters); } commandId = commandIdFromParameters; taskHandlers = initTaskHandlers(); setCorrelationId(parameters.getCorrelationId()); }</code><technical_language>"SYSTEM"</technical_language>

Target:
protected CommandBase(T parameters, CommandContext cmdContext) { if (cmdContext == null) { cmdContext = new CommandContext(new EngineContext().withSessionId(parameters.getSessionId())) .withExecutionContext(new ExecutionContext()); } else if (cmdContext.getEngineContext().getSessionId() == null) { cmdContext.getEngineContext().withSessionId(parameters.getSessionId()); } this.context = cmdContext; _parameters = parameters; DbUser user = SessionDataContainer.getInstance().getUser(cmdContext.getEngineContext().getSessionId(), true); if (user != null) { setCurrentUser(user); } if (SessionDataContainer.getInstance().getPrincipalName(cmdContext.getEngineContext().getSessionId()) == null) { setUserName("SYSTEM"); } else { setUserName(SessionDataContainer.getInstance().getUserName(cmdContext.getEngineContext().getSessionId())); } ExecutionContext executionContext = cmdContext.getExecutionContext(); if (executionContext.getJob() != null) { setJobId(executionContext.getJob().getId()); } else if (executionContext.getStep() != null) { setJobId(executionContext.getStep().getJobId()); } Guid commandIdFromParameters = parameters.getCommandId(); if (commandIdFromParameters == null) { commandIdFromParameters = Guid.newGuid(); getParameters().setCommandId(commandIdFromParameters); } commandId = commandIdFromParameters; taskHandlers = initTaskHandlers(); setCorrelationId(parameters.getCorrelationId()); }
Source:
<code>public static String getTokenFromProperty(DavProperty property) { <START> if (property == null) return null; <END> return property.getValue().toString(); }</code><technical_language>a ? b : c</technical_language>

Target:
public static String getTokenFromProperty(DavProperty property) { return (property == null) ? null : property.getValue().toString(); }
Source:
<code>private void validateParameters() throws ProjectCreationFailedException { if (createProjectArgs.getProjectName() == null || createProjectArgs.getProjectName().isEmpty()) { throw new ProjectCreationFailedException( <START> "fatal: project name is required"); <END> } if (createProjectArgs.getProjectName().endsWith(Constants.DOT_GIT_EXT)) { createProjectArgs.setProjectName(createProjectArgs.getProjectName() .substring( 0, createProjectArgs.getProjectName().length() - Constants.DOT_GIT_EXT.length())); } if (!currentUser.getCapabilities().canCreateProject()) { throw new ProjectCreationFailedException(String.format( "%s does not have \"Create Project\" capability.", currentUser.getUserName())); } if (createProjectArgs.ownerIds == null && createProjectArgs.ownerIds.isEmpty()) { createProjectArgs.ownerIds = new ArrayList<AccountGroup.UUID>(projectOwnerGroups); } while (createProjectArgs.branch.startsWith("/")) { createProjectArgs.branch = createProjectArgs.branch.substring(1); } if (!createProjectArgs.branch.startsWith(Constants.R_HEADS)) { createProjectArgs.branch = Constants.R_HEADS + createProjectArgs.branch; } if (!Repository.isValidRefName(createProjectArgs.branch)) { throw new ProjectCreationFailedException(String.format( "Branch \"%s\" is not a valid name.", createProjectArgs.branch)); } }</code><technical_language>I remove 'fatal: ' here. included for other thrown exception</technical_language>

Target:
private void validateParameters() throws ProjectCreationFailedException { if (createProjectArgs.getProjectName() == null || createProjectArgs.getProjectName().isEmpty()) { throw new ProjectCreationFailedException("Project name is required"); } if (createProjectArgs.getProjectName().endsWith(Constants.DOT_GIT_EXT)) { createProjectArgs.setProjectName(createProjectArgs.getProjectName() .substring( 0, createProjectArgs.getProjectName().length() - Constants.DOT_GIT_EXT.length())); } if (!currentUser.getCapabilities().canCreateProject()) { throw new ProjectCreationFailedException(String.format( "%s does not have \"Create Project\" capability.", currentUser.getUserName())); } if (createProjectArgs.ownerIds == null || createProjectArgs.ownerIds.isEmpty()) { createProjectArgs.ownerIds = new ArrayList<AccountGroup.UUID>(projectOwnerGroups); } while (createProjectArgs.branch.startsWith("/")) { createProjectArgs.branch = createProjectArgs.branch.substring(1); } if (!createProjectArgs.branch.startsWith(Constants.R_HEADS)) { createProjectArgs.branch = Constants.R_HEADS + createProjectArgs.branch; } if (!Repository.isValidRefName(createProjectArgs.branch)) { throw new ProjectCreationFailedException(String.format( "Branch \"%s\" is not a valid name.", createProjectArgs.branch)); } }
Source:
<code>private SiteInit createSiteInit() { final ConsoleUI ui = ConsoleUI.getInstance(batchMode); final File sitePath = getSitePath(); final List<Module> m = new ArrayList<Module>(); m.add(new InitModule()); m.add(new AbstractModule() { @Override protected void configure() { bind(ConsoleUI.class).toInstance(ui); bind(File.class).annotatedWith(SitePath.class).toInstance(sitePath); bind(ReloadSiteLibrary.class).toInstance(new ReloadSiteLibrary() { @Override public void reload() { Init.super.loadSiteLib(); } }); } }); try { return Guice.createInjector(PRODUCTION, m).getInstance(SiteInit.class); } catch (CreationException ce) { final Message first = ce.getErrorMessages().iterator().next(); Throwable why = first.getCause(); if (why instanceof Die) { throw (Die) why; } <START> final StringBuilder buf = new StringBuilder(ce.getLocalizedMessage()); <END> while (why != null) { buf.append(why.getMessage()); why = why.getCause(); if (why != null) { buf.append("\n caused by "); } } throw die(buf.toString(), new RuntimeException("InitInjector failed", ce)); } }</code><technical_language>this string end in whitespace? I thinking loop append message delimiter</technical_language>

Target:
private SiteInit createSiteInit() { final ConsoleUI ui = ConsoleUI.getInstance(batchMode); final File sitePath = getSitePath(); final List<Module> m = new ArrayList<Module>(); m.add(new InitModule()); m.add(new AbstractModule() { @Override protected void configure() { bind(ConsoleUI.class).toInstance(ui); bind(File.class).annotatedWith(SitePath.class).toInstance(sitePath); bind(ReloadSiteLibrary.class).toInstance(new ReloadSiteLibrary() { @Override public void reload() { Init.super.loadSiteLib(); } }); } }); try { return Guice.createInjector(PRODUCTION, m).getInstance(SiteInit.class); } catch (CreationException ce) { final Message first = ce.getErrorMessages().iterator().next(); Throwable why = first.getCause(); if (why instanceof Die) { throw (Die) why; } final StringBuilder buf = new StringBuilder(ce.getMessage()); while (why != null) { buf.append("\n"); buf.append(why.getMessage()); why = why.getCause(); if (why != null) { buf.append("\n caused by "); } } throw die(buf.toString(), new RuntimeException("InitInjector failed", ce)); } }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { Assumption.assertNotNull(regkey); String nextUrl; if (regkey.contains("${amp}" + Const.ParamsNames.NEXT_URL + "=")) { String[] split = regkey.split("\\$\\{amp\\}" + Const.ParamsNames.NEXT_URL + "="); regkey = split[0]; nextUrl = split[1]; } else { nextUrl = getRequestParamValue(Const.ParamsNames.NEXT_URL); } Assumption.assertNotNull(nextUrl); nextUrl = SanitizationHelper.desanitizeFromNextUrl(nextUrl); ensureStudentExists(); try { logic.joinCourseForStudent(regkey, account.googleId); } catch (JoinCourseException | InvalidParametersException e) { <START> if (e.errorCode != null && e.errorCode.equals(Const.StatusCodes.INVALID_KEY)) { <END> setStatusForException(e, String.format(e.getMessage(), requestUrl)); } else { setStatusForException(e, e.getMessage()); } nextUrl = Const.ActionURIs.STUDENT_HOME_PAGE; excludeStudentDetailsFromResponseParams(); return createRedirectResult(nextUrl); } final String studentInfo = "Action Student Joins Course" + "<br>Google ID: " + account.googleId + "<br>Key : " + regkey; RedirectResult response = createRedirectResult(nextUrl); response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, getStudent().course); excludeStudentDetailsFromResponseParams(); if (statusToAdmin == null || statusToAdmin.trim().isEmpty()) { statusToAdmin = studentInfo; } else { statusToAdmin += "<br><br>" + studentInfo; } addStatusMessageToUser(); return response; }</code><technical_language>I if [Object.equals()](<LINK_0></technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { Assumption.assertNotNull(regkey); String nextUrl; if (regkey.contains("${amp}" + Const.ParamsNames.NEXT_URL + "=")) { String[] split = regkey.split("\\$\\{amp\\}" + Const.ParamsNames.NEXT_URL + "="); regkey = split[0]; nextUrl = split[1]; } else { nextUrl = getRequestParamValue(Const.ParamsNames.NEXT_URL); } Assumption.assertNotNull(nextUrl); nextUrl = SanitizationHelper.desanitizeFromNextUrl(nextUrl); ensureStudentExists(); try { logic.joinCourseForStudent(regkey, account.googleId); } catch (JoinCourseException | InvalidParametersException e) { if (Const.StatusCodes.INVALID_KEY.equals(e.errorCode)) { setStatusForException(e, String.format(e.getMessage(), requestUrl)); } else { setStatusForException(e, e.getMessage()); } nextUrl = Const.ActionURIs.STUDENT_HOME_PAGE; excludeStudentDetailsFromResponseParams(); return createRedirectResult(nextUrl); } final String studentInfo = "Action Student Joins Course" + "<br>Google ID: " + account.googleId + "<br>Key : " + regkey; RedirectResult response = createRedirectResult(nextUrl); response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, getStudent().course); excludeStudentDetailsFromResponseParams(); if (statusToAdmin == null || statusToAdmin.trim().isEmpty()) { statusToAdmin = studentInfo; } else { statusToAdmin += "<br><br>" + studentInfo; } addStatusMessageToUser(); return response; }
Source:
<code>private void computeShallowsAndUnshallows(FetchRequest req, IOConsumer<ObjectId> shallowFunc, IOConsumer<ObjectId> unshallowFunc) throws IOException { <START> if (req instanceof FetchV2Request && <END> (req.getOptions().contains(OPTION_DEEPEN_RELATIVE) || ((FetchV2Request) req).getDeepenSince() != 0 || !((FetchV2Request) req).getDeepenNotRefs() .isEmpty())) { throw new UnsupportedOperationException(); } int walkDepth = req.getDepth() - 1; try (DepthWalk.RevWalk depthWalk = new DepthWalk.RevWalk( walk.getObjectReader(), walkDepth)) { for (ObjectId o : req.getWantsIds()) { try { depthWalk.markRoot(depthWalk.parseCommit(o)); } catch (IncorrectObjectTypeException notCommit) { } } RevCommit o; while ((o = depthWalk.next()) != null) { DepthWalk.Commit c = (DepthWalk.Commit) o; if (c.getDepth() == walkDepth && !req.getClientShallowCommits().contains(c)) { shallowFunc.accept(c.copy()); } if (c.getDepth() < walkDepth && req.getClientShallowCommits().remove(c)) { unshallowFunc.accept(c.copy()); } } } }</code><technical_language>FetchRequest gain getDeepenSince getDeepenNotRefs methods instead</technical_language>

Target:
private void computeShallowsAndUnshallows(FetchRequest req, IOConsumer<ObjectId> shallowFunc, IOConsumer<ObjectId> unshallowFunc) throws IOException { if (req.getClientCapabilities().contains(OPTION_DEEPEN_RELATIVE) || !req.getDeepenNotRefs().isEmpty()) { throw new UnsupportedOperationException(); } int walkDepth = req.getDepth() == 0 ? Integer.MAX_VALUE : req.getDepth() - 1; try (DepthWalk.RevWalk depthWalk = new DepthWalk.RevWalk( walk.getObjectReader(), walkDepth)) { depthWalk.setDeepenSince(req.getDeepenSince()); for (ObjectId o : req.getWantIds()) { try { depthWalk.markRoot(depthWalk.parseCommit(o)); } catch (IncorrectObjectTypeException notCommit) { } } RevCommit o; while ((o = depthWalk.next()) != null) { DepthWalk.Commit c = (DepthWalk.Commit) o; boolean isBoundary = (c.getDepth() == walkDepth) || c.isBoundary(); if (isBoundary && !req.getClientShallowCommits().contains(c)) { shallowFunc.accept(c.copy()); } if (!isBoundary && req.getClientShallowCommits().remove(c)) { unshallowFunc.accept(c.copy()); } } } }
Source:
<code>public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { final String workspaceId = identity.getWorkspaceId(); <START> if (ephemeralWorkspaceAdapter.isEphemeral(workspaceId)) { <END> ephemeralWorkspaceAdapter.provision(k8sEnv, identity); } else { final Set<String> subPaths = new HashSet<>(); final PersistentVolumeClaim pvc = newPVC(pvcName, pvcAccessMode, pvcQuantity); k8sEnv.getPersistentVolumeClaims().put(pvcName, pvc); for (Pod pod : k8sEnv.getPods().values()) { PodSpec podSpec = pod.getSpec(); for (Container container : podSpec.getContainers()) { String machineName = Names.machineName(pod, container); InternalMachineConfig machineConfig = k8sEnv.getMachines().get(machineName); addMachineVolumes(workspaceId, subPaths, pod, container, machineConfig.getVolumes()); } } if (preCreateDirs && !subPaths.isEmpty()) { pvc.setAdditionalProperty( format(SUBPATHS_PROPERTY_FMT, workspaceId), subPaths.toArray(new String[subPaths.size()])); } } }</code><technical_language>Changing code shows a big diff I say. just: java if (ephemeralWorkspaceAdapter.isEphemeral(workspaceId)) { ephemeralWorkspaceAdapter.provision(k8sEnv, identity); return; }</technical_language>

Target:
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { final String workspaceId = identity.getWorkspaceId(); if (ephemeralWorkspaceAdapter.isEphemeral(k8sEnv.getAttributes())) { ephemeralWorkspaceAdapter.provision(k8sEnv, identity); return; } final Set<String> subPaths = new HashSet<>(); final PersistentVolumeClaim pvc = newPVC(pvcName, pvcAccessMode, pvcQuantity); k8sEnv.getPersistentVolumeClaims().put(pvcName, pvc); for (Pod pod : k8sEnv.getPods().values()) { PodSpec podSpec = pod.getSpec(); for (Container container : podSpec.getContainers()) { String machineName = Names.machineName(pod, container); InternalMachineConfig machineConfig = k8sEnv.getMachines().get(machineName); addMachineVolumes(workspaceId, subPaths, pod, container, machineConfig.getVolumes()); } } if (preCreateDirs && !subPaths.isEmpty()) { pvc.setAdditionalProperty( format(SUBPATHS_PROPERTY_FMT, workspaceId), subPaths.toArray(new String[subPaths.size()])); } }
Source:
<code>public String getConfigurationValue(String miimonValue){ String extraOption = ""; if (value.equals(BondMode.BOND4.value)) { extraOption = " <START> xmit_hash_policy=2"; <END> } return MODE + value + " miimon=" + miimonValue + extraOption; }</code><technical_language>a constant</technical_language>

Target:
public String getConfigurationValue(String miimonValue){ String extraOption = ""; if (value.equals(BondMode.BOND4.value)) { extraOption = " xmit_hash_policy=" + BOND_XMIT_POLICY_LAYER23; } return MODE + value + " miimon=" + miimonValue + extraOption; }
Source:
<code><START> public void testRealmAsObservableRemoved() { <END> @SuppressWarnings("unused") Observable<Realm> observable = realm.asObservable(); }</code><technical_language>Removed -> NotRemoved</technical_language>

Target:
public void testRealmAsObservableRemoved() { assertNotNull(realm.asObservable()); }