auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void copyTextureIntoArrayTexture (Texture texture, int slot) { copyFramebuffer.bind(); Gdx.gl30.glFramebufferTexture2D(GL30.GL_READ_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL30.GL_TEXTURE_2D, texture.getTextureObjectHandle(), 0); Gdx.gl30.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); Gdx.gl30.glBindTexture(GL30.GL_TEXTURE_2D_ARRAY, arrayTextureHandle); Gdx.gl30.glCopyTexSubImage3D(GL30.GL_TEXTURE_2D_ARRAY, 0, 0, 0, slot, 0, 0, copyFramebuffer.getWidth(), copyFramebuffer.getHeight()); <START> FrameBuffer.unbind(); <END> if (useMipMaps) { mipMapsDirty = true; } }</code><technical_language>this break custom framebuffers</technical_language>

Target:
private void copyTextureIntoArrayTexture (Texture texture, int slot) { int previousFrameBufferHandle = 0; if (!isWebGL) { Gdx.gl30.glGetIntegerv(GL30.GL_FRAMEBUFFER_BINDING, FBO_READ_INTBUFF); previousFrameBufferHandle = FBO_READ_INTBUFF.get(0); } copyFramebuffer.bind(); Gdx.gl30.glFramebufferTexture2D(GL30.GL_READ_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL30.GL_TEXTURE_2D, texture.getTextureObjectHandle(), 0); Gdx.gl30.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); Gdx.gl30.glBindTexture(GL30.GL_TEXTURE_2D_ARRAY, arrayTextureHandle); Gdx.gl30.glCopyTexSubImage3D(GL30.GL_TEXTURE_2D_ARRAY, 0, 0, 0, slot, 0, 0, copyFramebuffer.getWidth(), copyFramebuffer.getHeight()); if (!isWebGL) { Gdx.gl30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, previousFrameBufferHandle); } if (useMipMaps) { mipMapsDirty = true; } }
Source:
<code>public Constituent getCanonicalEntityViaRelation(Constituent c) { List<Relation> incomingRelations = getFilteredIncomingRelations(c); if (incomingRelations.isEmpty()) return c; if (incomingRelations.size() > 1) <START> logger.info("Warning: constituent belongs to more than one cluster; we returned only one of them.\n" <END> + "If you are deadline with overlapping clusters, and want to get all of the canonical elements, " + "\"getCanonicalEntitySetViaRelation\" function. "); return incomingRelations.get(0).source; }</code><technical_language>this is a warning, please logger.warn() instead of logger.info()</technical_language>

Target:
public Constituent getCanonicalEntityViaRelation(Constituent c) { List<Relation> incomingRelations = getFilteredIncomingRelations(c); if (incomingRelations.isEmpty()) return c; if (incomingRelations.size() > 1) logger.warn("Warning: constituent belongs to more than one cluster; we returned only one of them.\n" + "If you are deadline with overlapping clusters, and want to get all of the canonical elements, " + "\"getCanonicalEntitySetViaRelation\" function. "); return incomingRelations.get(0).source; }
Source:
<code><START> public static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) { <END> if (cacheManager == null) { throw new IllegalArgumentException("cacheManager cannot be null"); } ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); if (metadataManager == null) { throw new IllegalStateException("ProtobufMetadataManager not initialised yet!"); } return metadataManager; }</code><technical_language>This private again</technical_language>

Target:
private static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) { if (cacheManager == null) { throw new IllegalArgumentException("cacheManager cannot be null"); } ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); if (metadataManager == null) { throw new IllegalStateException("ProtobufMetadataManager not initialised yet!"); } return metadataManager; }
Source:
<code>public void testJoinCourseForInstructor_invalidInstituteMac_shouldFail() throws EntityDoesNotExistException { InstructorAttributes instructor = dataBundle.instructors.get("instructorNotYetJoinCourse"); String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: institute signature does not match institute provided"); InvalidParametersException ipe = assertThrows(InvalidParametersException.class, () -> accountsLogic.joinCourseForInstructor( encryptedKey[0], loggedInGoogleId, institute, StringHelper.generateSignature("NUS"))); assertEquals("Institute authentication failed.", ipe.getMessage()); <START> } <END></code><technical_language>verify account is in database</technical_language>

Target:
public void testJoinCourseForInstructor_invalidInstituteMac_shouldFail() throws EntityDoesNotExistException { InstructorAttributes instructor = dataBundle.instructors.get("instructorNotYetJoinCourse"); String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: institute signature does not match institute provided"); InvalidParametersException ipe = assertThrows(InvalidParametersException.class, () -> accountsLogic.joinCourseForInstructor( encryptedKey[0], loggedInGoogleId, institute, StringHelper.generateSignature("NUS"))); assertEquals("Institute authentication failed.", ipe.getMessage()); AccountAttributes accountCreated = accountsLogic.getAccount(loggedInGoogleId); assertNull(accountCreated); }
Source:
<code>protected long resolveIterationValue() { if (iterationAttribute != null) { <START> Object result = Utils.getField(StressTestStage.class, iterationAttribute, this); <END> if (result != null && result instanceof Number) { return ((Number) result).longValue(); } else { throw new IllegalStateException("Unable to resolve iteration value from " + getClass().getName() + "." + iterationAttribute); } } return -1; }</code><technical_language>I correct field name - PropertyHelper retrieve of a Property name (using dash syntax) (field name != property name)</technical_language>

Target:
protected String resolveIterationValue() { if (iterationProperty != null) { Map<String, Path> properties = PropertyHelper.getProperties(getClass(), true, false); String propertyString = PropertyHelper.getPropertyString(properties.get(iterationProperty), this); if (propertyString == null) { throw new IllegalStateException("Unable to resolve iteration property '" + iterationProperty + "'."); } return propertyString; } return null; }
Source:
<code><START> private ITestNGMethod[] clone(ITestNGMethod[] sources) { <END> return Arrays.stream(sources) .map(ITestNGMethod::clone) .toArray(ITestNGMethod[]::new); }</code><technical_language>static</technical_language>

Target:
private static ITestNGMethod[] clone(ITestNGMethod[] sources) { return Arrays.stream(sources) .map(ITestNGMethod::clone) .toArray(ITestNGMethod[]::new); }
Source:
<code>public static String buildConjunctiveClause(String fieldName, Collection<String> values){ String orQuery = fieldName+":("; <START> for(String value: values){ <END> orQuery = orQuery + value + " OR "; } return orQuery.substring(0, orQuery.length()-4)+")"; }</code><technical_language>cleaner [Joiner](<LINK_0> verbose do extra substring end</technical_language>

Target:
public static String buildConjunctiveClause(String fieldName, Collection<String> values){ Joiner conjunctiveJoiner = Joiner.on(" OR ").skipNulls(); return fieldName + ":(" + conjunctiveJoiner.join(values) + ")"; }
Source:
<code>void updateSwitches(JSONObject nodeRoot) { synchronized (switchMap) { removeAllSwitches(); JSONArray sPoints = nodeRoot.getJSONArray("switchPoints"); <START> logger.debug("sPoints: {}", nodeRoot.toString()); <END> for (int i = 0; i < sPoints.length(); i++) { JSONObject subJSON = sPoints.getJSONObject(i); String day = subJSON.getString("dayOfWeek"); String setpoint = subJSON.getString("setpoint"); Integer time = subJSON.getInt("time"); if (positiveSwitch == null) { positiveSwitch = setpoint; logger.debug("positiveSwitch: {}", positiveSwitch); setpoints.add(positiveSwitch); } else if (negativeSwitch == null && !setpoint.equals(positiveSwitch)) { negativeSwitch = setpoint; logger.debug("negativeSwitch: {}", negativeSwitch); setpoints.add(negativeSwitch); } addSwitch(day, setpoint, time); } } }</code><technical_language>need call .toString() logger arguments not, leave logger call .toString() java.lang.Object needed. Some .toString() methods expensive, create short-lived objects add burden Java garbage collection</technical_language>

Target:
void updateSwitches(JSONObject nodeRoot) { synchronized (switchMap) { removeAllSwitches(); JSONArray sPoints = nodeRoot.getJSONArray("switchPoints"); logger.debug("sPoints: {}", nodeRoot); for (int i = 0; i < sPoints.length(); i++) { JSONObject subJSON = sPoints.getJSONObject(i); String day = subJSON.getString("dayOfWeek"); String setpoint = subJSON.getString("setpoint"); Integer time = subJSON.getInt("time"); if (positiveSwitch == null) { positiveSwitch = setpoint; logger.debug("positiveSwitch: {}", positiveSwitch); setpoints.add(positiveSwitch); } else if (negativeSwitch == null && !setpoint.equals(positiveSwitch)) { negativeSwitch = setpoint; logger.debug("negativeSwitch: {}", negativeSwitch); setpoints.add(negativeSwitch); } addSwitch(day, setpoint, time); } } }
Source:
<code>protected java.util.logging.Level toJulLevel() { <START> return java.util.logging.Level.OFF; <END> }</code><technical_language>this a constructor parameter</technical_language>

Target:
public java.util.logging.Level toJulLevel() { return julLevel; }
Source:
<code>public void setLevel(String loggerName, String newLevel) { <START> getLogger(loggerName).setLevel(Level.valueOf(newLevel.toUpperCase(Locale.US)).toJulLevel()); <END> }</code><technical_language>java logging.setLevel(loggerName, Level.valueOf(newLevel.toUpperCase(Locale.US)));</technical_language>

Target:
public void setLevel(String loggerName, String newLevel) { logging.setLevel(loggerName, Level.valueOf(newLevel.toUpperCase(Locale.US))); }
Source:
<code>final void refreshStablePartitionList(Map<String, IdealState> idealStateMap) { _stablePartitionListCache.keySet().retainAll(idealStateMap.keySet()); for (String resourceName : idealStateMap.keySet()) { Set<String> newPartitionSet = idealStateMap.get(resourceName).getPartitionSet(); List<String> cachedPartitionList = getStablePartitionList(resourceName); if (cachedPartitionList.size() != newPartitionSet.size() || !newPartitionSet <START> .containsAll(cachedPartitionList)) { <END> _stablePartitionListCache.put(resourceName, new ArrayList<>(newPartitionSet)); } } }</code><technical_language>in mind "newPartitionSet.containsAll(cachedPartitionList))" a performance (delay) issue, operation is O(N^2), if large number of partitions</technical_language>

Target:
final void refreshStablePartitionList(Map<String, IdealState> idealStateMap) { _stablePartitionListCache.keySet().retainAll(idealStateMap.keySet()); for (String resourceName : idealStateMap.keySet()) { Set<String> newPartitionSet = idealStateMap.get(resourceName).getPartitionSet(); List<String> cachedPartitionList = getStablePartitionList(resourceName); if (cachedPartitionList == null || cachedPartitionList.size() != newPartitionSet.size() || !newPartitionSet.containsAll(cachedPartitionList)) { _stablePartitionListCache.put(resourceName, new ArrayList<>(newPartitionSet)); } } }
Source:
<code>public WarningEntry(Throwable throwable) { <START> requireNonNull(throwable, "warning is null"); <END> assertTrue(throwable instanceof SQLWarning); SQLWarning warning = (SQLWarning) throwable; this.vendorCode = warning.getErrorCode(); this.sqlState = requireNonNull(warning.getSQLState(), "SQLState is null"); this.message = requireNonNull(warning.getMessage(), "message is null"); }</code><technical_language>throwable is null</technical_language>

Target:
public WarningEntry(Throwable throwable) { requireNonNull(throwable, "throwable is null"); assertTrue(throwable instanceof SQLWarning); SQLWarning warning = (SQLWarning) throwable; this.vendorCode = warning.getErrorCode(); this.sqlState = requireNonNull(warning.getSQLState(), "SQLState is null"); this.message = requireNonNull(warning.getMessage(), "message is null"); }
Source:
<code>protected void executeQueryCommand() { String suggestedDiskName = null; if (getParameters().getVmId() == null) { getQueryReturnValue().setReturnValue(suggestedDiskName); } else { <START> VM vm = DbFacade.getInstance().getVmDAO().getById(getParameters().getVmId()); <END> suggestedDiskName = ImagesHandler.getDefaultDiskAlias(vm.getvm_name(), VmHandler.getCorrectDriveForDisk(vm)); } getQueryReturnValue().setReturnValue(suggestedDiskName); }</code><technical_language>need check vm != null well</technical_language>

Target:
protected void executeQueryCommand() { String suggestedDiskName = null; if (getParameters().getVmId() == null) { getQueryReturnValue().setReturnValue(suggestedDiskName); } else { VM vm = DbFacade.getInstance().getVmDAO().getById(getParameters().getVmId()); if (vm != null) { suggestedDiskName = ImagesHandler.getDefaultDiskAlias(vm.getvm_name(), VmHandler.getCorrectDriveForDisk(vm)); } getQueryReturnValue().setReturnValue(suggestedDiskName); } }
Source:
<code><START> public List<KijiRegion> getRegions() throws IOException { <END> throw new UnsupportedOperationException("Not yet implemented to work with AsyncHBase"); }</code><technical_language>This permanently unsupported</technical_language>

Target:
public List<KijiRegion> getRegions() throws IOException { throw new UnsupportedOperationException("Not supported by AsyncKijiTable"); }
Source:
<code>public synchronized void setCapacity(int newNumExecutors, int newWaitQueueSize) { if (newNumExecutors > configuredMaxExecutors) { throw new IllegalArgumentException("Requested newNumExecutors=" + newNumExecutors + " is greater than the configured maximum=" + configuredMaxExecutors); } if (newWaitQueueSize > configuredWaitingQueueSize) { throw new IllegalArgumentException("Requested newWaitQueueSize=" + newWaitQueueSize + " is greater than the configured maximum=" + configuredWaitingQueueSize); } if (newNumExecutors < 0) { throw new IllegalArgumentException("Negative numExecutors is not allowed. Requested " + "newNumExecutors=" + newNumExecutors); } if (newWaitQueueSize < 0) { throw new IllegalArgumentException("Negative waitQueueSize is not allowed. Requested " + "newWaitQueueSize=" + newWaitQueueSize); } numSlotsAvailable.addAndGet(newNumExecutors - maxParallelExecutors); maxParallelExecutors = newNumExecutors; waitQueue.setWaitQueueSize(newWaitQueueSize); <START> if (metrics != null) { <END> metrics.setNumExecutorsEnabled(newNumExecutors); metrics.setWaitQueueSizeEnabled(newWaitQueueSize); } LOG.info("TaskExecutorService is setting capacity to: numExecutors=" + newNumExecutors + ", waitQueueSize=" + newWaitQueueSize); }</code><technical_language>I case (test) metrics passed in a null. So, I if sense mock metrics in test assume/verify metrics passed in</technical_language>

Target:
public synchronized void setCapacity(int newNumExecutors, int newWaitQueueSize) { if (newNumExecutors > configuredMaxExecutors) { throw new IllegalArgumentException("Requested newNumExecutors=" + newNumExecutors + " is greater than the configured maximum=" + configuredMaxExecutors); } if (newWaitQueueSize > configuredWaitingQueueSize) { throw new IllegalArgumentException("Requested newWaitQueueSize=" + newWaitQueueSize + " is greater than the configured maximum=" + configuredWaitingQueueSize); } if (newNumExecutors < 0) { throw new IllegalArgumentException("Negative numExecutors is not allowed. Requested " + "newNumExecutors=" + newNumExecutors); } if (newWaitQueueSize < 0) { throw new IllegalArgumentException("Negative waitQueueSize is not allowed. Requested " + "newWaitQueueSize=" + newWaitQueueSize); } numSlotsAvailable.addAndGet(newNumExecutors - maxParallelExecutors); maxParallelExecutors = newNumExecutors; waitQueue.setWaitQueueSize(newWaitQueueSize); metrics.setNumExecutors(newNumExecutors); metrics.setWaitQueueSize(newWaitQueueSize); LOG.info("TaskExecutorService is setting capacity to: numExecutors=" + newNumExecutors + ", waitQueueSize=" + newWaitQueueSize); }
Source:
<code><START> protected AuthorityValidationMetadataCache() { <END> }</code><technical_language>a utility class need a protected constructor</technical_language>

Target:
private AuthorityValidationMetadataCache() { }
Source:
<code>public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { Integer cpu = KernelEventHandlerUtils.getCpu(event); if (cpu == null) { return; } Integer softIrqId = ((Long) event.getContent().getField(getLayout().fieldVec()).getValue()).intValue(); int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss); int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeSoftIRQs(cpu, ss), softIrqId.toString()); long timestamp = KernelEventHandlerUtils.getTimestamp(event); <START> if (!isSoftIrqRaised(ss.queryOngoingState(quark))) { <END> ss.modifyAttribute(timestamp, TmfStateValue.nullValue(), quark); } else { ss.modifyAttribute(timestamp, StateValues.SOFT_IRQ_RAISED_VALUE, quark); } List<@NonNull Integer> softIrqs = ss.getSubAttributes(ss.getQuarkAbsolute(Attributes.CPUS, Integer.toString(cpu), Attributes.SOFT_IRQS), false); boolean nestedSoftIrqs = false; for (Integer softIrq : softIrqs) { if (!ss.queryOngoingState(softIrq).isNull()) { nestedSoftIrqs = true; break; } } if (!nestedSoftIrqs) { KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss); KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss); } }</code><technical_language>do added complexity of a negative check if else. remove "!" swap clauses</technical_language>

Target:
public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { Integer cpu = KernelEventHandlerUtils.getCpu(event); if (cpu == null) { return; } Integer softIrqId = ((Long) event.getContent().getField(getLayout().fieldVec()).getValue()).intValue(); int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss); int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeSoftIRQs(cpu, ss), softIrqId.toString()); long timestamp = KernelEventHandlerUtils.getTimestamp(event); if (isSoftIrqRaised(ss.queryOngoingState(quark))) { ss.modifyAttribute(timestamp, StateValues.SOFT_IRQ_RAISED_VALUE, quark); } else { ss.modifyAttribute(timestamp, TmfStateValue.nullValue(), quark); } List<Integer> softIrqs = ss.getSubAttributes(ss.getParentAttributeQuark(quark), false); for (Integer softIrq : softIrqs) { if (!ss.queryOngoingState(softIrq).isNull()) { return; } } KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss); KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss); }
Source:
<code>public RelOptPredicateList getAllPredicates(Calc calc, RelMetadataQuery mq) { final RexProgram rexProgram = calc.getProgram(); <START> List<RexNode> condition = new ArrayList<>(); <END> if (rexProgram.getCondition() != null) { condition = Util.transform(ImmutableList.of(rexProgram.getCondition()), rexProgram::expandLocalRef); } else { return mq.getAllPredicates(calc.getInput()); } assert condition.size() == 1; return getAllFilterPredicates(calc, mq, condition.get(0)); }</code><technical_language>Extract -> Extracts</technical_language>

Target:
public RelOptPredicateList getAllPredicates(Calc calc, RelMetadataQuery mq) { final RexProgram rexProgram = calc.getProgram(); if (rexProgram.getCondition() != null) { final RexNode condition = rexProgram.expandLocalRef(rexProgram.getCondition()); return getAllFilterPredicates(calc.getInput(), mq, condition); } else { return mq.getAllPredicates(calc.getInput()); } }
Source:
<code>public void dispose() { if (treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()) { treeViewer.getTree().removeFocusListener(this.focusListener); <START> } <END> treeViewer.removeTreeListener(tableViewerListener); tableViewerListener = null; descriptionFileChangedNotifier.dispose(); descriptionFileChangedNotifier = null; tableUIUpdater.dispose(); tableUIUpdater = null; selectTableElementsListener.dispose(); selectTableElementsListener = null; dTableContentProvider.dispose(); dTableContentProvider = null; super.dispose(); createLineMenu.dispose(); createLineMenu = null; createTargetColumnMenu.dispose(); createTargetColumnMenu = null; }</code><technical_language>add "focusListener = null;"</technical_language>

Target:
public void dispose() { if (treeViewer.getTree() != null && !treeViewer.getTree().isDisposed() && this.focusListener != null) { treeViewer.getTree().removeFocusListener(this.focusListener); this.focusListener = null; } treeViewer.removeTreeListener(tableViewerListener); tableViewerListener = null; descriptionFileChangedNotifier.dispose(); descriptionFileChangedNotifier = null; tableUIUpdater.dispose(); tableUIUpdater = null; selectTableElementsListener.dispose(); selectTableElementsListener = null; dTableContentProvider.dispose(); dTableContentProvider = null; super.dispose(); createLineMenu.dispose(); createLineMenu = null; createTargetColumnMenu.dispose(); createTargetColumnMenu = null; }
Source:
<code>private synchronized void broadcastMsg(final RoutingTableUpdateMsg routingTableUpdateMsg, final TraceInfo parentTraceInfo) { for (final String workerId : activeWorkerIds) { Span detached = null; <START> try (final TraceScope traceScope = Trace.startSpan("send_routing_table_update_msg. workerId: " + workerId, <END> parentTraceInfo)) { detached = traceScope.detach(); final TraceInfo traceInfo = TraceInfo.fromSpan(detached); final AvroPSMsg updateMsg = AvroPSMsg.newBuilder() .setType(Type.RoutingTableUpdateMsg) .setRoutingTableUpdateMsg(routingTableUpdateMsg) .setTraceInfo(HTraceUtils.toAvro(traceInfo)) .build(); sender.get().send(workerId, updateMsg); } finally { Trace.continueSpan(detached).close(); } } }</code><technical_language>snake case, workerId worker_id</technical_language>

Target:
private synchronized void broadcastMsg(final RoutingTableUpdateMsg routingTableUpdateMsg, final TraceInfo parentTraceInfo) { for (final String workerId : activeWorkerIds) { Span detached = null; try (final TraceScope traceScope = Trace.startSpan("send_routing_table_update_msg. worker_id: " + workerId, parentTraceInfo)) { detached = traceScope.detach(); final TraceInfo traceInfo = TraceInfo.fromSpan(detached); final AvroPSMsg updateMsg = AvroPSMsg.newBuilder() .setType(Type.RoutingTableUpdateMsg) .setRoutingTableUpdateMsg(routingTableUpdateMsg) .setTraceInfo(HTraceUtils.toAvro(traceInfo)) .build(); sender.get().send(workerId, updateMsg); } finally { Trace.continueSpan(detached).close(); } } }
Source:
<code>public void shutdown() { <START> fsWatchServices.keySet().forEach(jGitFileSystemWatchServices -> this.close(jGitFileSystemWatchServices)); <END> if (jGitEventsBroadcast != null) { jGitEventsBroadcast.close(); } }</code><technical_language>@adrielparedes this call is redundant right? if if (fsManager.allTheFSAreClosed()) {</technical_language>

Target:
public void shutdown() { if (jGitEventsBroadcast != null) { jGitEventsBroadcast.close(); } }
Source:
<code>public boolean appliesTo(final Object selection) { boolean appliedConstraint = false; if (selection instanceof EStructuralFeature && UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(selection)) { appliedConstraint = true; } else if (selection instanceof ValueSpecification) { final ValueSpecification valueSpecification = (ValueSpecification) selection; if <START> (null != valueSpecification.eContainer() && <END> valueSpecification.eContainer() instanceof MultiplicityElement) { final EObject parent = valueSpecification.eContainer(); final Object upperValue = parent.eGet(UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue()); appliedConstraint = upperValue.equals(valueSpecification); } } return appliedConstraint; }</code><technical_language>verification, if variable is null, is "instanceof" statement this</technical_language>

Target:
public boolean appliesTo(final Object selection) { boolean appliedConstraint = false; if (selection instanceof EStructuralFeature && UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(selection)) { appliedConstraint = true; } else if (selection instanceof ValueSpecification) { final ValueSpecification valueSpecification = (ValueSpecification) selection; if (valueSpecification.eContainer() instanceof MultiplicityElement) { final EObject parent = valueSpecification.eContainer(); final Object upperValue = parent.eGet(UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue()); appliedConstraint = upperValue.equals(valueSpecification); } } return appliedConstraint; }
Source:
<code>private static CompletableFuture<Exception> publishItem( final Producer<String, String> producer, final String topicId, final BatchItem item) throws EventPublishingException { try { final CompletableFuture<Exception> result = new CompletableFuture<>(); final ProducerRecord<String, String> kafkaRecord = new ProducerRecord<>( topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); producer.send(kafkaRecord, ((metadata, exception) -> { if (null != exception) { <START> LOG.warn("Failed to publish to kafka topic " + topicId, exception); <END> item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); result.complete(exception); } else { item.updateStatusAndDetail(EventPublishingStatus.SUBMITTED, ""); result.complete(null); } })); return result; } catch (final InterruptException e) { Thread.currentThread().interrupt(); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } catch (final RuntimeException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }</code><technical_language>LOG.warn("Failed publish kafka topic {}", topicId, exception);</technical_language>

Target:
private static CompletableFuture<Exception> publishItem( final Producer<String, String> producer, final String topicId, final BatchItem item) throws EventPublishingException { try { final CompletableFuture<Exception> result = new CompletableFuture<>(); final ProducerRecord<String, String> kafkaRecord = new ProducerRecord<>( topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); producer.send(kafkaRecord, ((metadata, exception) -> { if (null != exception) { LOG.warn("Failed to publish to kafka topic {}", topicId, exception); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); result.complete(exception); } else { item.updateStatusAndDetail(EventPublishingStatus.SUBMITTED, ""); result.complete(null); } })); return result; } catch (final InterruptException e) { Thread.currentThread().interrupt(); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } catch (final RuntimeException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }
Source:
<code><START> public String getTmpString() { <END> return this.tmp; }</code><technical_language>static</technical_language>

Target:
public static String getTmpString() { return tmp; }
Source:
<code>private void deleteObject(String path) { <START> boolean folder = path.substring(path.length() - 1).equals("/"); <END> if (!exists(path)) { if (folder) { throw new RuntimeException("Folder does not exist - could not remove folder: " + path); } else { throw new RuntimeException("File does not exist - could not remove file: " + path); } } client.deleteObject(bucketName, path); }</code><technical_language>determining if path points folder file exception is worth effort. Drop that. exception message Object exist. other question is do want fail deleteObject method if remove inexistent object. This of method in cleanup procedures problematic</technical_language>

Target:
private void deleteObject(String path) { client.deleteObject(bucketName, path); }
Source:
<code>private static TimeType convertToTimeType(Duration duration) { <START> return Stream.of(DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS, MICROSECONDS, NANOSECONDS) <END> .filter(unit -> duration.equals(Duration.of(unit.convert(duration.toNanos(), NANOSECONDS), jucTimeUnitToTemporalUnit(unit)))) .findFirst() .map(unit -> new TimeType() .withValue(BigInteger.valueOf(unit.convert(duration.toNanos(), NANOSECONDS))) .withUnit(convertToXmlTimeUnit(unit)) ).orElseThrow(AssertionError::new); }</code><technical_language>hardcoding units? pull legal unit set jaxb</technical_language>

Target:
private static TimeType convertToTimeType(Duration duration) { return Stream.of(java.util.concurrent.TimeUnit.values()) .sorted(comparing(unit -> unit.convert(duration.toNanos(), NANOSECONDS))) .filter(unit -> duration.equals(Duration.of(unit.convert(duration.toNanos(), NANOSECONDS), jucTimeUnitToTemporalUnit(unit)))) .findFirst() .map(unit -> new TimeType() .withValue(BigInteger.valueOf(unit.convert(duration.toNanos(), NANOSECONDS))) .withUnit(convertToXmlTimeUnit(unit)) ).orElseThrow(AssertionError::new); }
Source:
<code>public static List<String> getClaimValues(Map<ClaimMapping, List<String>> attributeMap, String claimUri, String userStoreDomainName) { List<String> claimValues = new ArrayList<>(); for (Map.Entry<ClaimMapping, List<String>> entry : attributeMap.entrySet()) { ClaimMapping mapping = entry.getKey(); if (mapping.getLocalClaim() != null && claimUri.equals(mapping.getLocalClaim().getClaimUri())) { claimValues = entry.getValue(); break; } } if (userStoreDomainName != null) { List<String> modifiedClaimValues = new ArrayList<>(); for (Iterator<String> iterator = claimValues.iterator(); iterator.hasNext(); ) { String claimValue = iterator.next(); <START> if (claimValue != null && claimValue.contains("/")) { <END> claimValue = claimValue.substring(claimValue.indexOf("/") + 1); } claimValue = userStoreDomainName + "/" + claimValue; modifiedClaimValues.add(claimValue); } claimValues = modifiedClaimValues; } return claimValues; }</code><technical_language>StringUtils.contains() method</technical_language>

Target:
public static List<String> getClaimValues(Map<ClaimMapping, List<String>> attributeMap, String claimUri, String userStoreDomainName) { List<String> claimValues = new ArrayList<>(); for (Map.Entry<ClaimMapping, List<String>> entry : attributeMap.entrySet()) { ClaimMapping mapping = entry.getKey(); if (mapping.getLocalClaim() != null && claimUri.equals(mapping.getLocalClaim().getClaimUri())) { claimValues = entry.getValue(); break; } } if (userStoreDomainName != null) { List<String> modifiedClaimValues = new ArrayList<>(); for (Iterator<String> iterator = claimValues.iterator(); iterator.hasNext(); ) { String claimValue = iterator.next(); if (StringUtils.contains(claimValue, "/")) { claimValue = claimValue.substring(claimValue.indexOf("/") + 1); } claimValue = userStoreDomainName + "/" + claimValue; modifiedClaimValues.add(claimValue); } claimValues = modifiedClaimValues; } return claimValues; }
Source:
<code>private boolean checkForJournalFlush() { <START> if ( QueueBatchSize == 0 ) <END> return true ; if ( queue.size() >= QueueBatchSize ) return true ; boolean journalSizeFlush = (JournalThresholdSize > 0 && journal.size() > JournalThresholdSize ) ; if ( journalSizeFlush ) return true ; return false ; }</code><technical_language>missing something, this is part of next case (isn't queue.size() >= 0 invariant?). Is this called out emphasize setting 0 => "no queuing"</technical_language>

Target:
private boolean checkForJournalFlush() { if ( queue.size() >= QueueBatchSize ) return true ; boolean journalSizeFlush = (JournalThresholdSize > 0 && journal.size() > JournalThresholdSize ) ; if ( journalSizeFlush ) return true ; return false ; }
Source:
<code>protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "port"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "scheme"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "app"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "owner"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "username"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "password"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout"); <START> IntegrationNamespaceUtils.setValueIfAttributeDefined( builder, element, "testOnBorrow" ); <END> }</code><technical_language>tabs. I this name - checkServiceOnBorrow</technical_language>

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "port"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "scheme"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "app"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "owner"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "username"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "password"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout"); IntegrationNamespaceUtils.setValueIfAttributeDefined( builder, element, "checkServiceOnBorrow" ); }
Source:
<code>public void setAbsolutePath(String absolutePath) { this.absolutePath = ZipSourceFileHelper.addLeadingSlashIfNecessary((absolutePath)); <START> if (this.absolutePath.equals(absolutePath)) { <END> LOG.warn("Absolute path workaround used, this should be fixed at some point"); } }</code><technical_language>this equals</technical_language>

Target:
public void setAbsolutePath(String absolutePath) { this.absolutePath = ZipSourceFileHelper.addLeadingSlashIfNecessary((absolutePath)); if (!this.absolutePath.equals(absolutePath)) { LOG.warn("Absolute path workaround used, this should be fixed at some point"); } }
Source:
<code>public void verifyMapOpenedForDeleteMapTests() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); driver.switchTo().defaultContent(); PageObjectLogging.log("verifyMapOpenedForDeleteMapTests", "Map was opened", true); <START> } <END></code><technical_language>switching? if element is present</technical_language>

Target:
public void verifyMapOpenedForDeleteMapTests() { waitForElementVisibleByElement(mapFrame); PageObjectLogging.log("verifyMapOpenedForDeleteMapTests", "Map was opened", true); }
Source:
<code>public void deleteUnauthorized() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, TEST_NAME, TEST_NAMESPACE) <START> .build(); <END> getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); getClient() .perform(delete("/api/core/metadataschemas/" + metadataSchema.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); }</code><technical_language>turn auth system creating test data</technical_language>

Target:
public void deleteUnauthorized() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, TEST_NAME, TEST_NAMESPACE) .build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); getClient() .perform(delete("/api/core/metadataschemas/" + metadataSchema.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); }
Source:
<code>private void startEslintBridgeServerProcess() { <START> port = findOpenPort(); <END> ProcessBuilder processBuilder = new ProcessBuilder(nodeExecutable, startServerScript, String.valueOf(port)); try { LOG.debug("Starting node process to start eslint-bridge server at port " + port); process = processBuilder.start(); setProcessStreamConsumers(); if (!waitServerToStart("localhost", port, timeoutSec * 1000)) { LOG.error("Timeout error: failed to start server"); clean(); return; } LOG.debug("Server is started"); } catch (IOException e) { String command = String.join(" ", processBuilder.command()); LOG.error("Failed to start eslint-bridge server process: " + command, e); } }</code><technical_language>I avoid port Java side server print port stdout Java side read connect it. port is printed server is listening it. do this in another PR</technical_language>

Target:
private void startEslintBridgeServerProcess() { try { port = findOpenPort(); } catch (IOException e) { LOG.error("Failed to find open port", e); return; } ProcessBuilder processBuilder = new ProcessBuilder(nodeExecutable, startServerScript, String.valueOf(port)); try { LOG.debug("Starting node process to start eslint-bridge server at port " + port); process = processBuilder.start(); setProcessStreamConsumers(); if (!waitServerToStart("localhost", port, timeoutSec * 1000)) { LOG.error("Timeout error: failed to start server"); clean(); return; } LOG.debug("Server is started"); } catch (IOException e) { String command = String.join(" ", processBuilder.command()); LOG.error("Failed to start eslint-bridge server process: " + command, e); } }
Source:
<code>private void computeClusters(List<Cluster> clusters) { Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; <START> for (Probe probe : probes_) <END> { if (prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if (sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if (!IsWithinClusterBounds(sendDeltaMs, current)) { if (current.count >= kMinClusterSize) { addCluster(clusters, current); } current = new Cluster(); } current.sendMeanMs += sendDeltaMs; current.recvMeanMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if (current.count >= kMinClusterSize) addCluster(clusters, current); }</code><technical_language>is naming of probes_? convention</technical_language>

Target:
private void computeClusters(List<Cluster> clusters) { Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; for (Probe probe : probes) { if (prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if (sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if (!IsWithinClusterBounds(sendDeltaMs, current)) { if (current.count >= kMinClusterSize) { addCluster(clusters, current); } current = new Cluster(); } current.sendMeanMs += sendDeltaMs; current.recvMeanMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if (current.count >= kMinClusterSize) addCluster(clusters, current); }
Source:
<code>public void testCompartmentCreationInHorizontalStack() { compartmentCreationTest(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, <START> 400)); <END> }</code><technical_language>replace 400, 400 400, 350 Indeed, in some configuration, this point editor (for children creation)</technical_language>

Target:
public void testCompartmentCreationInHorizontalStack() { compartmentCreationTest(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, 350)); }
Source:
<code>public void keyspaceStats_sunionstoreCommand_existingKey() { jedis.sunionstore("New_Set", EXISTING_SET_KEY_1, EXISTING_SET_KEY_2, "Nonexistent_Set"); jedis.close(); GeodeAwaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted( () -> { assertThat(server.getServer().getStats().getKeyspaceHits()) .isEqualTo(initialKeyspaceHits + 2); assertThat(server.getServer().getStats().getKeyspaceMisses()) <START> .isEqualTo(initialKeyspaceMisses + 1); <END> }); }</code><technical_language>this misses</technical_language>

Target:
public void keyspaceStats_sunionstoreCommand_existingKey() { jedis.sunionstore( "New_Set", EXISTING_SET_KEY_1, EXISTING_SET_KEY_2, "Nonexistent_Set"); assertThat(redisStats.getKeyspaceHits()) .isEqualTo(0 + 2); assertThat(redisStats.getKeyspaceMisses()) .isEqualTo(1); }
Source:
<code>private void setupSSLSocket() throws NoSuchAlgorithmException, IOException, KeyManagementException, KeyStoreException { <START> String tmfAlgorithm <END> = TrustManagerFactory.getDefaultAlgorithm(); TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm); tmf.init(mKeyStore); SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, tmf.getTrustManagers(), new SecureRandom()); mSslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(); mSslSocket.setSoTimeout(TCP_TIMEOUT); if (!TextUtils.isEmpty(mHostname)) { List<SNIServerName> names = new ArrayList<SNIServerName>(); names.add(new SNIHostName(mHostname)); SSLParameters params = mSslSocket.getSSLParameters(); params.setServerNames(names); mSslSocket.setSSLParameters(params); } }</code><technical_language>final (or inline) locals : final</technical_language>

Target:
private SSLSocket setupSSLSocket() throws NoSuchAlgorithmException, IOException, KeyManagementException, KeyStoreException { final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init((KeyStore) null); final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null , tmf.getTrustManagers(), new SecureRandom()); final int oldTag = TrafficStats.getAndSetThreadStatsTag( TrafficStatsConstants.TAG_SYSTEM_PROBE); SSLSocket sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(); sslSocket.setSoTimeout(TCP_TIMEOUT); TrafficStats.setThreadStatsTag(oldTag); if (!TextUtils.isEmpty(mHostname)) { final List<SNIServerName> names = Collections.singletonList(new SNIHostName(mHostname)); SSLParameters params = sslSocket.getSSLParameters(); params.setServerNames(names); sslSocket.setSSLParameters(params); } return sslSocket; }
Source:
<code>public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { Activator.getDefault().logError("Error writing the file <START> "+file+" due to ", e); <END> } finally { fLock.readLock().unlock(); } }</code><technical_language>necessary add "due to"</technical_language>

Target:
public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { Activator.getDefault().logError("Error writing the file "+file+" ", e); } finally { fLock.readLock().unlock(); } }
Source:
<code>public Map<DocumentReference, List<String>> groupAnchorsByUserReference(List<MacroBlock> mentions, WikiReference wikiReference) { Map<DocumentReference, List<String>> ret = new HashMap<>(); for (MacroBlock block : mentions) { <START> String macroReference = block.getParameter(REFERENCE_PARAM_NAME); <END> DocumentReference reference = this.documentReferenceResolver.resolve(macroReference, wikiReference); String anchor = block.getParameter(ANCHORID_PARAM_NAME); ret.merge(reference, new ArrayList<>(Collections.singletonList(anchor)), (l1, l2) -> { l1.addAll(l2); return l1; }); } return ret; }</code><technical_language>This variable is badly name if supposed serializedUserReference</technical_language>

Target:
public Map<DocumentReference, List<String>> groupAnchorsByUserReference(List<MacroBlock> mentions, WikiReference wikiReference) { Map<DocumentReference, List<String>> ret = new HashMap<>(); for (MacroBlock block : mentions) { String serializedUserReference = block.getParameter(REFERENCE_PARAM_NAME); DocumentReference reference = this.documentReferenceResolver.resolve(serializedUserReference, wikiReference); String anchor = block.getParameter(ANCHORID_PARAM_NAME); ret.merge(reference, new ArrayList<>(Collections.singletonList(anchor)), (l1, l2) -> { l1.addAll(l2); return l1; }); } return ret; }
Source:
<code>public static boolean registryValueExists(HKEY root, String key, String value) { <START> return registryValueExists(root, key, value, WinNT.REG_NONE); <END> }</code><technical_language>Please WinNT.REG_NONE for this use-case. WinNT.REG_NONE is a type, access level. is "NONE" access level for registry. I 0 here. I invent a constant</technical_language>

Target:
public static boolean registryValueExists(HKEY root, String key, String value) { return registryValueExists(root, key, value, 0); }
Source:
<code>private static boolean calculateRegression(double[] coefficient, List<Integer> validColumnIndices, OLSMultipleLinearRegression mlr) { if (coefficient.length != validColumnIndices.size()) { <START> LOG.warn("There are " + coefficient.length + <END> " coefficients, but " + validColumnIndices.size() + " valid columns in the regression"); } double[] beta = mlr.estimateRegressionParameters(); Arrays.fill(coefficient, 0); for (int i = 0; i < validColumnIndices.size(); ++i) { coefficient[validColumnIndices.get(i)] = beta[i]; } coefficient[5] = beta[validColumnIndices.size()]; return true; }</code><technical_language>this a LOG.info. remove this if block add info log actually. If want if, remove "but" logline :-)</technical_language>

Target:
private static boolean calculateRegression(double[] coefficient, List<Integer> validColumnIndices, OLSMultipleLinearRegression mlr) { if (coefficient.length != validColumnIndices.size()) { LOG.info("There are " + coefficient.length + " coefficients, and " + validColumnIndices.size() + " valid columns in the regression"); } double[] beta = mlr.estimateRegressionParameters(); Arrays.fill(coefficient, 0); for (int i = 0; i < validColumnIndices.size(); ++i) { coefficient[validColumnIndices.get(i)] = beta[i]; } coefficient[5] = beta[validColumnIndices.size()]; return true; }
Source:
<code>public Optional<Feature> get(String name) { <START> return featureManager.getFeatures().stream().filter(f -> name.equals(f.name())).findFirst(); <END> }</code><technical_language>TogglzEndpoint.java:[58,63] lambda expressions supported in -source 1.7 <LINK_0></technical_language>

Target:
public TogglzFeature get(String name) { Feature feature = getFeature(name); if (feature == null) { return null; } else { return new TogglzFeature(feature, featureManager.getFeatureState(feature)); } }