auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean initialized() { <START> return initialized.get() && config.featureStore.initialized(); <END> }</code><technical_language>need remove check featurestore here</technical_language>

Target:
public boolean initialized() { return initialized.get(); }
Source:
<code>void search(ProgressMonitor monitor, ObjectToPack[] toSearch, int off, int cnt) throws IOException { try { for (int end = off + cnt; off < end; off++) { res = window[resSlot]; if (0 < maxMemory) { clear(res); int tail = next(resSlot); final long need = estimateSize(toSearch[off]); while (maxMemory < loaded + need && tail != resSlot) { clear(window[tail]); tail = next(tail); } } res.set(toSearch[off]); <START> if (res.object.isEdge() || !res.object.isAttemptDelta()) { <END> keepInWindow(); } else { monitor.update(1); search(); } } } finally { if (deflater != null) deflater.end(); } }</code><technical_language>Rewrite this do negation of accessor method. faster test bits differently. :-)</technical_language>

Target:
void search(ProgressMonitor monitor, ObjectToPack[] toSearch, int off, int cnt) throws IOException { try { for (int end = off + cnt; off < end; off++) { res = window[resSlot]; if (0 < maxMemory) { clear(res); int tail = next(resSlot); final long need = estimateSize(toSearch[off]); while (maxMemory < loaded + need && tail != resSlot) { clear(window[tail]); tail = next(tail); } } res.set(toSearch[off]); if (res.object.isEdge() || res.object.doNotAttemptDelta()) { keepInWindow(); } else { monitor.update(1); search(); } } } finally { if (deflater != null) deflater.end(); } }
Source:
<code>public Request apply(RequestTemplate in) { in.insert(0, url()); List<Object> creds = ListCredentials.asList(credentials.get()); <START> in.body(format(SOAP_TEMPLATE, creds.get(0).toString(), creds.get(1).toString(), new String(in.body()))); <END> in.header("Host", URI.create(in.url()).getHost()); in.header("Content-Type", "application/xml"); return in.request(); }</code><technical_language>charset</technical_language>

Target:
public Request apply(RequestTemplate in) { in.insert(0, url()); List<Object> creds = ListCredentials.asList(credentials.get()); in.body(format(SOAP_TEMPLATE, creds.get(0).toString(), creds.get(1).toString(), new String(in.body(), UTF_8))); in.header("Host", URI.create(in.url()).getHost()); in.header("Content-Type", "application/xml"); return in.request(); }
Source:
<code>void put(String key, V value) { CacheEntry<V> entry = new CacheEntry<V>(key, value); final int hashCode = key.hashCode(); final int firstIndex = firstIndex(hashCode); final V firstValue = value(firstIndex, key); if (firstValue == null) { entries[firstIndex] = entry; } else { <START> entries[secondIndex(hashCode)] = entry; <END> } }</code><technical_language>done TBH choose search linearly a distance (effectively a linear probing) a collision</technical_language>

Target:
void put(String key, V value) { CacheEntry<V> entry = new CacheEntry<V>(key, value); final int hashCode = key.hashCode(); final int firstIndex = firstIndex(hashCode); final V firstValue = value(firstIndex, key); if (firstValue == null) { entries[firstIndex] = entry; } else { int secondIndex = secondIndex(hashCode); if (entries[secondIndex] != null && PlatformDependent.threadLocalRandom().nextBoolean()) { entries[firstIndex] = entry; } else { entries[secondIndex] = entry; } } }
Source:
<code>public static EC2HardwareBuilder m3_medium() { return new EC2HardwareBuilder(InstanceType.M3_MEDIUM) .ram(3840) .processors(ImmutableList.of(new Processor(1.0, 3.0))) .volumes( ImmutableList.<Volume> of(new VolumeImpl(10.0f, "/dev/sda1", true, false), new VolumeImpl(4.0f, <START> "/dev/sdb", false, false))); <END> }</code><technical_language>builder, new VolumeImpl? (minor) break line ...false),</technical_language>

Target:
public static EC2HardwareBuilder m3_medium() { return new EC2HardwareBuilder(InstanceType.M3_MEDIUM) .ram(3840) .processors(ImmutableList.of(new Processor(1.0, 3.0))) .volumes(ImmutableList.<Volume> of( new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(), new VolumeBuilder().type(LOCAL).size(4.0f).device("/dev/sdb").bootDevice(false).durable(false).build())); }
Source:
<code>public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; IValueProperty valueProperty; try { valueProperty = Activator.getDefault().getEMFFormsDatabinding() <START> .getValueProperty(control.getDomainModelReference(), viewModelContext.getDomainModel()); <END> } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return NOT_APPLICABLE; } catch (final IllegalArgumentException ex) { Activator.getDefault().getReportService().report(new AbstractReport(ex)); return NOT_APPLICABLE; } return isApplicable((EStructuralFeature) valueProperty.getValueType()); }</code><technical_language>check for null</technical_language>

Target:
public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; if (control.getDomainModelReference() == null) { return NOT_APPLICABLE; } IValueProperty valueProperty; try { valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference(), viewModelContext.getDomainModel()); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return NOT_APPLICABLE; } catch (final IllegalArgumentException ex) { Activator.getDefault().getReportService().report(new AbstractReport(ex)); return NOT_APPLICABLE; } return isApplicable((EStructuralFeature) valueProperty.getValueType()); }
Source:
<code>protected void doExecute() { final DDiagram diagram = getParentDiagram(); <START> RefreshIdsHolder factory = RefreshIdsHolder.getOrCreateHolder(diagram); <END> AbstractDNodeCandidate nodeCandidate = new AbstractDNodeCandidate(this.mapping, semantic, container, factory); Session session = SessionManager.INSTANCE.getSession(((DSemanticDiagram) diagram).getTarget()); DiagramMappingsManager mappingManager = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(session, diagram); final DDiagramSynchronizer diagramSync = new DDiagramSynchronizer(interpreter, diagram.getDescription(), accessor); diagramSync.setDiagram((DSemanticDiagram) diagram); final DDiagramElementSynchronizer elementSync = diagramSync.getElementSynchronizer(); if (nodeCandidate != null) { elementSync.createNewNode(mappingManager, nodeCandidate, isBorder()); } else if (edgeCandidate != null) { final Map<EdgeMapping, Collection<MappingBasedDecoration>> edgeToMappingBasedDecoration = new HashMap<EdgeMapping, Collection<MappingBasedDecoration>>(); final Map<String, Collection<SemanticBasedDecoration>> edgeToSemanticBasedDecoration = new HashMap<String, Collection<SemanticBasedDecoration>>(); final Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets = elementSync.computeMappingsToEdgeTargets(session.getSelectedViewpoints(false)); diagramSync.computeDecorations(mappingsToEdgeTargets, edgeToSemanticBasedDecoration, edgeToMappingBasedDecoration); elementSync.createNewEdge(mappingManager, edgeCandidate, mappingsToEdgeTargets, edgeToMappingBasedDecoration, edgeToSemanticBasedDecoration); } }</code><technical_language>do create this ? node candidate null, if command created edge constructor, execute edgeCandidate case l127 129</technical_language>

Target:
protected void doExecute() { final DDiagram diagram = getParentDiagram(); Session session = SessionManager.INSTANCE.getSession(((DSemanticDiagram) diagram).getTarget()); DiagramMappingsManager mappingManager = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(session, diagram); final DDiagramSynchronizer diagramSync = new DDiagramSynchronizer(interpreter, diagram.getDescription(), accessor); diagramSync.setDiagram((DSemanticDiagram) diagram); final DDiagramElementSynchronizer elementSync = diagramSync.getElementSynchronizer(); if (nodeCandidate != null) { elementSync.createNewNode(mappingManager, nodeCandidate, isBorder()); } else if (edgeCandidate != null) { final Map<EdgeMapping, Collection<MappingBasedDecoration>> edgeToMappingBasedDecoration = new HashMap<EdgeMapping, Collection<MappingBasedDecoration>>(); final Map<String, Collection<SemanticBasedDecoration>> edgeToSemanticBasedDecoration = new HashMap<String, Collection<SemanticBasedDecoration>>(); final Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets = elementSync.computeMappingsToEdgeTargets(session.getSelectedViewpoints(false)); diagramSync.computeDecorations(mappingsToEdgeTargets, edgeToSemanticBasedDecoration, edgeToMappingBasedDecoration); elementSync.createNewEdge(mappingManager, edgeCandidate, mappingsToEdgeTargets, edgeToMappingBasedDecoration, edgeToSemanticBasedDecoration); } }
Source:
<code>public void addQueueAndAssignPermission(String queueName, QueueRolePermission[] queueRolePermissionsDTO) throws BrokerManagerAdminException { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); org.wso2.carbon.andes.core.types.QueueRolePermission[] rolePermissions; try { <START> if (queueRolePermissionsDTO != null && queueRolePermissionsDTO.length > 0) { <END> rolePermissions = new org.wso2.carbon.andes.core.types.QueueRolePermission[queueRolePermissionsDTO.length]; for (int i=0; i < queueRolePermissionsDTO.length; i++) { rolePermissions[i] = queueRolePermissionsDTO[i].convertToAndesCoreRole(); } queueManagerService.addQueueAndAssignPermission(queueName, rolePermissions); } } catch (QueueManagerException e) { log.error("Unable to update permission of the queue.", e); throw new BrokerManagerAdminException("Unable to update permission of the queue.", e); } }</code><technical_language>flip</technical_language>

Target:
public void addQueueAndAssignPermission(String queueName, QueueRolePermission[] queueRolePermissionsDTO) throws BrokerManagerAdminException { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); org.wso2.carbon.andes.core.types.QueueRolePermission[] rolePermissions; try { if (null != queueRolePermissionsDTO && queueRolePermissionsDTO.length > 0) { rolePermissions = new org.wso2.carbon.andes.core.types.QueueRolePermission[queueRolePermissionsDTO.length]; for (int i = 0; i < queueRolePermissionsDTO.length; i++) { rolePermissions[i] = queueRolePermissionsDTO[i].convert(); } queueManagerService.addQueueAndAssignPermission(queueName, rolePermissions); } } catch (QueueManagerException e) { log.error("Unable to update permission of the queue.", e); throw new BrokerManagerAdminException("Unable to update permission of the queue.", e); } }
Source:
<code>protected boolean getPermissionToJoin() throws Exception { boolean gotPermission; if (distributionManager.isJoinComplete()) { throw new IllegalStateException("Join on " + getMyAddress() + " cannot be complete without rehash to finishing"); } chOld = retrieveOldConsistentHash(); gotPermission = true; if (chOld.getCaches().contains(self)) chNew = chOld; else chNew = createConsistentHash(configuration, chOld.getCaches(), distributionManager.getTopologyInfo(), self); <START> return gotPermission; <END> }</code><technical_language>this method return true throw exception, return false. A boolean return is required</technical_language>

Target:
protected void getPermissionToJoin() throws Exception { if (distributionManager.isJoinComplete()) { throw new IllegalStateException("Join on " + getMyAddress() + " cannot be complete without rehash to finishing"); } chOld = retrieveOldConsistentHash(); if (chOld.getCaches().contains(self)) chNew = chOld; else chNew = createConsistentHash(configuration, chOld.getCaches(), distributionManager.getTopologyInfo(), self); }
Source:
<code>public List<JobWorkerHealth> getAllWorkerHealth() throws IOException { return retryRPC(new RpcCallable<List<JobWorkerHealth>>() { public List<JobWorkerHealth> call() throws StatusRuntimeException { List<alluxio.grpc.JobWorkerHealth> workerHealthsList = mClient .getAllWorkerHealth(GetAllWorkerHealthPRequest.newBuilder().build()) .getWorkerHealthsList(); ArrayList<JobWorkerHealth> result = Lists.newArrayList(); for (alluxio.grpc.JobWorkerHealth workerHealth : workerHealthsList) { result.add(new JobWorkerHealth(workerHealth)); <START> } <END> return result; } }); }</code><technical_language>simpler streams API do this? workerHealthsList.stream().map(JobWorkerHealth::new).collect(Collectors.toList()) Additionally, initialize new ArrayList size of list size already</technical_language>

Target:
public List<JobWorkerHealth> getAllWorkerHealth() throws IOException { return retryRPC(new RpcCallable<List<JobWorkerHealth>>() { public List<JobWorkerHealth> call() throws StatusRuntimeException { List<alluxio.grpc.JobWorkerHealth> workerHealthsList = mClient .getAllWorkerHealth(GetAllWorkerHealthPRequest.newBuilder().build()) .getWorkerHealthsList(); return workerHealthsList.stream().map(JobWorkerHealth::new).collect(Collectors.toList()); } }); }
Source:
<code>public IStatus validate(final IProject project, final String path) { CTFTrace temp; IStatus validStatus; try { temp = new CTFTrace(path); } catch (CTFReaderException e) { <START> validStatus = new Status(IStatus.ERROR, "CTF", e.toString()); <END> return validStatus; } catch (NullPointerException e){ validStatus = new Status(IStatus.ERROR, "CTF", e.toString()); return validStatus; } String dom = temp.getEnvironment().get("domain"); temp.dispose(); if (dom != null && dom.equals("\"kernel\"")) { return Status.OK_STATUS; } validStatus = new Status(IStatus.ERROR, "CTF", "Domain mismatch, make sure the environment is 'kernel'"); return validStatus; }</code><technical_language>PLUGIN_ID Activator</technical_language>

Target:
public IStatus validate(final IProject project, final String path) { CTFTrace temp; IStatus validStatus; try { temp = new CTFTrace(path); } catch (CTFReaderException e) { validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); return validStatus; } catch (NullPointerException e){ validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); return validStatus; } String dom = temp.getEnvironment().get("domain"); temp.dispose(); if (dom != null && dom.equals("\"kernel\"")) { return Status.OK_STATUS; } validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfKernelTrace_DomainError); return validStatus; }
Source:
<code>public <KIn, VIn, KOut, VOut> Set<KOut> mapAndCombineForDistributedReduction( MapCombineCommand<KIn, VIn, KOut, VOut> mcc) throws InterruptedException { Set<KIn> keys = mcc.getKeys(); final boolean inputKeysSpecified = keys != null && !keys.isEmpty(); if (!inputKeysSpecified) { try { return mapAndCombine(mcc); } catch (Exception e) { throw new CacheException(e); } } else { <START> CollectableCollector<KOut, VOut> collector = map(mcc); <END> try { return combine(mcc, collector); } catch (Exception e) { throw new CacheException(e); } } }</code><technical_language>input keys specified, necessarily intermediary values (or small). remove this branch completely</technical_language>

Target:
public <KIn, VIn, KOut, VOut> Set<KOut> mapAndCombineForDistributedReduction( MapCombineCommand<KIn, VIn, KOut, VOut> mcc) throws InterruptedException { try { return mapAndCombine(mcc); } catch (Exception e) { throw new CacheException(e); } }
Source:
<code>private RateCalculation parseInflation( XmlElement legEl, XmlElement calcEl, XmlElement inflationEl, PeriodicSchedule accrualSchedule, FpmlDocument document) { document.validateNotPresent(inflationEl, "spreadSchedule"); document.validateNotPresent(inflationEl, "rateTreatment"); document.validateNotPresent(inflationEl, "capRateSchedule"); document.validateNotPresent(inflationEl, "floorRateSchedule"); document.validateNotPresent(legEl, "stubCalculationPeriodAmount"); InflationRateCalculation.Builder builder = InflationRateCalculation.builder(); builder.index(document.parsePriceIndex(inflationEl)); builder.lag(document.parsePeriod(inflationEl.getChild("inflationLag"))); String interpStr = inflationEl.getChild("interpolationMethod").getContent(); <START> builder.interpolated(interpStr.toLowerCase(Locale.ENGLISH).contains("linear") ? true : false); <END> inflationEl.findChild("floatingRateMultiplierSchedule").ifPresent(el -> { builder.gearing(parseSchedule(el, document)); }); return builder.build(); }</code><technical_language>condition a boolean expression</technical_language>

Target:
private RateCalculation parseInflation( XmlElement legEl, XmlElement calcEl, XmlElement inflationEl, PeriodicSchedule accrualSchedule, FpmlDocument document) { document.validateNotPresent(inflationEl, "spreadSchedule"); document.validateNotPresent(inflationEl, "rateTreatment"); document.validateNotPresent(inflationEl, "capRateSchedule"); document.validateNotPresent(inflationEl, "floorRateSchedule"); document.validateNotPresent(legEl, "stubCalculationPeriodAmount"); InflationRateCalculation.Builder builder = InflationRateCalculation.builder(); builder.index(document.parsePriceIndex(inflationEl)); builder.lag(document.parsePeriod(inflationEl.getChild("inflationLag"))); String interpStr = inflationEl.getChild("interpolationMethod").getContent(); builder.interpolated(interpStr.toLowerCase(Locale.ENGLISH).contains("linear")); inflationEl.findChild("floatingRateMultiplierSchedule").ifPresent(el -> { builder.gearing(parseSchedule(el, document)); }); return builder.build(); }
Source:
<code>private boolean isWeldProxy(Class<?> type) { try{ <START> Class<?> weldProxyClass = Class.forName("org.jboss.weld.bean.proxy.ProxyObject"); <END> return weldProxyClass.isAssignableFrom(type); }catch(ClassNotFoundException e){ logger.debug("Weld not found, cannot determine if class is a proxy or not.", type); } return false; }</code><technical_language>put in a static block, call this line time</technical_language>

Target:
private boolean isWeldProxy(Class<?> type) { if(weldProxyClass != null){ return weldProxyClass.isAssignableFrom(type); }else{ logger.debug("Weld not found, cannot determine if class is a proxy or not.", type); return false; } }
Source:
<code>public void testProfileFilesExist() { profileListCommand.doExecute(applicationService, featuresService, bundleService); assertThat(out.toString().contains("standard"), is(true)); assertThat(out.toString().contains("devProfile"), is(true)); assertThat(out.toString().contains("profileWithDuplicates"), is(true)); <START> assertThat(out.toString().contains(".json"), is(false)); <END> }</code><technical_language>PROFILE_EXTENSION instead of ".json"</technical_language>

Target:
public void testProfileFilesExist() { profileListCommand.doExecute(applicationService, featuresService, bundleService); assertThat(out.toString().contains("standard"), is(true)); assertThat(out.toString().contains("devProfile"), is(true)); assertThat(out.toString().contains("profileWithDuplicates"), is(true)); assertThat(out.toString().contains(PROFILE_EXTENSION), is(false)); }
Source:
<code>public <T> BeanMetaData<T> getBeanMetaData(Class<T> beanClass) { Contracts.assertNotNull( beanClass, MESSAGES.beanTypeCannotBeNull() ); BeanMetaData<T> beanMetaData = (BeanMetaData<T>) beanMetaDataCache.get( beanClass ); if ( beanMetaData != null ) { return beanMetaData; } beanMetaData = (BeanMetaData<T>) beanMetaDataCache.computeIfAbsent( beanClass, <START> bc -> createBeanMetaData( bc ) ); <END> return beanMetaData; }</code><technical_language>hmm... ConcurrentReferenceHashMap for this cache is default impl of computeIfAbsent. default synchronised blocks. I if change this line like: java BeanMetaDataImpl<T> beanMetaData = createBeanMetaData( beanClass ); beanMetaDataCache.putIfAbsent( beanClass, beanMetaData ); return beanMetaData;</technical_language>

Target:
public <T> BeanMetaData<T> getBeanMetaData(Class<T> beanClass) { Contracts.assertNotNull( beanClass, MESSAGES.beanTypeCannotBeNull() ); BeanMetaData<T> beanMetaData = (BeanMetaData<T>) beanMetaDataCache.get( beanClass ); if ( beanMetaData != null ) { return beanMetaData; } beanMetaData = createBeanMetaData( beanClass ); BeanMetaData<T> previousBeanMetaData = (BeanMetaData<T>) beanMetaDataCache.putIfAbsent( beanClass, beanMetaData ); if ( previousBeanMetaData != null ) { return previousBeanMetaData; } return beanMetaData; }
Source:
<code>private void testTransformers_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception { KernelServicesBuilder builder = createKernelServicesBuilder(DEFAULT_ADDITIONAL_INITIALIZATION) .setSubsystemXmlResource("remoting-with-expressions-and-good-legacy-protocol.xml"); ModelVersion oldVersion = controllerVersion.getSubsystemModelVersion(getMainSubsystemName()); builder.createLegacyKernelServicesBuilder(null, controllerVersion) .addMavenResourceURL( <START> String.format("%s:%s%s:%s", <END> controllerVersion.getCoreMavenGroupId(), controllerVersion.getArtifactIdPrefix(),"remoting", controllerVersion.getMavenGavVersion())) .skipReverseControllerCheck(); KernelServices mainServices = builder.build(); assertTrue(mainServices.isSuccessfulBoot()); KernelServices legacyServices = mainServices.getLegacyServices(oldVersion); assertNotNull(legacyServices); assertTrue(legacyServices.isSuccessfulBoot()); checkSubsystemModelTransformation(mainServices, oldVersion, null, false); checkRejectOutboundConnectionProtocolNotRemote(mainServices, oldVersion, CommonAttributes.REMOTE_OUTBOUND_CONNECTION, "remote-conn1"); checkRejectHttpConnector(mainServices, oldVersion); checkRejectEndpointConfiguration(mainServices, oldVersion); }</code><technical_language>need do this now, this a convenience method - controllerVersion.getMavenGav("remoting")</technical_language>

Target:
private void testTransformers_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception { KernelServicesBuilder builder = createKernelServicesBuilder(DEFAULT_ADDITIONAL_INITIALIZATION) .setSubsystemXmlResource("remoting-transformers.xml"); ModelVersion oldVersion = controllerVersion.getSubsystemModelVersion(getMainSubsystemName()); builder.createLegacyKernelServicesBuilder(null, controllerVersion) .addMavenResourceURL(controllerVersion.getMavenGav("remoting", true)) .skipReverseControllerCheck(); KernelServices mainServices = builder.build(); assertTrue(mainServices.isSuccessfulBoot()); KernelServices legacyServices = mainServices.getLegacyServices(oldVersion); assertNotNull(legacyServices); assertTrue(legacyServices.isSuccessfulBoot()); checkSubsystemModelTransformation(mainServices, oldVersion, null, false); checkRejectOutboundConnectionProtocolNotRemote(mainServices, oldVersion, CommonAttributes.REMOTE_OUTBOUND_CONNECTION, "remote-conn1"); checkRejectHttpConnector(mainServices, oldVersion); checkRejectEndpointConfiguration(mainServices, oldVersion); }
Source:
<code>private void markJobStarted(Job job, String correlationId) { statusIcon.addStyleName(PatternflyConstants.PF_SPINNER); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_XS); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_INLINE); jobProgress.setActive(true); jobProgress.setType(ProgressType.STRIPED); jobProgressBar.setPercent(100); <START> String startTime = job.getStartTime() == null ? constants.notAvailableLabel() : DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM).format(job.getStartTime()); jobProgressBar.setText(constants.startedTask() + ": " + startTime); END> if (job.getSteps().isEmpty()) { model.updateSingleTask(correlationId); } else { job.getSteps().forEach(step -> { container.add(createStep(step)); }); } }</code><technical_language>this is 1 long line, logic appears required fix bug in 2 places. Suggestion: create "private static String formatDateToString(Date)" method this logic inside</technical_language>

Target:
private void markJobStarted(Job job, String correlationId) { statusIcon.addStyleName(PatternflyConstants.PF_SPINNER); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_XS); statusIcon.addStyleName(PatternflyConstants.PF_SPINNER_INLINE); jobProgress.setActive(true); jobProgress.setType(ProgressType.STRIPED); jobProgressBar.setPercent(100); String startTime = formatDatetoString(job.getStartTime()); jobProgressBar.setText(constants.startedTask() + ": " + startTime); if (job.getSteps().isEmpty()) { model.updateSingleTask(correlationId); } else { job.getSteps().forEach(step -> { container.add(createStep(step)); }); } }
Source:
<code>public Widget getWidget(Sitemap sitemap, String id) { if (id.length() > 0) { Widget w = getWidget(id); if (w == null) { w = getDefaultWidget(null, id); } if (w != null) { w.setItem(id); } else { try { w = sitemap.getChildren().get(Integer.valueOf(id.substring(0, 2))); for (int i = 2; i < id.length(); i += 2) { w = ((LinkableWidget) w).getChildren().get(Integer.valueOf(id.substring(i, i + 2))); } } catch (NumberFormatException e) { } } <START> if (w instanceof Default) { <END> w = resolveDefault(w, null); } return w; } logger.warn("Cannot find page for id '{}'.", id); return null; }</code><technical_language>removed</technical_language>

Target:
public Widget getWidget(Sitemap sitemap, String id) { if (id.length() > 0) { Widget w = getWidget(id); if (w == null) { w = getDefaultWidget(null, id); } if (w != null) { w.setItem(id); } else { try { w = sitemap.getChildren().get(Integer.valueOf(id.substring(0, 2))); for (int i = 2; i < id.length(); i += 2) { w = ((LinkableWidget) w).getChildren().get(Integer.valueOf(id.substring(i, i + 2))); } } catch (NumberFormatException e) { } } return resolveDefault(w); } logger.warn("Cannot find page for id '{}'.", id); return null; }
Source:
<code>private void removeSegment(final Sink sink, final File target) { if (target.exists()) { try { log.info("Deleting Index File[%s]", target); FileUtils.deleteDirectory(target); } catch (Exception e) { <START> log.makeAlert(e, "Unable to remove merged segment for dataSource[%s]", schema.getDataSource()) <END> .addData("interval", sink.getInterval()) .emit(); } } }</code><technical_language>This alert message is longer accurate</technical_language>

Target:
private void removeSegment(final Sink sink, final File target) { if (target.exists()) { try { log.info("Deleting Index File[%s]", target); FileUtils.deleteDirectory(target); } catch (Exception e) { log.makeAlert(e, "Unable to remove file for dataSource[%s]", schema.getDataSource()) .addData("file", target) .addData("interval", sink.getInterval()) .emit(); } } }
Source:
<code>private static void assertCorrectGetAllResult(List<VM> result) { assertNotNull(result); assertFalse(result.isEmpty()); assertEquals(VM_COUNT, result.size()); for (VM vm : result) { <START> assertTrue("Vm db generation wasn't loaded as expected", vm.getDbGeneration() == 1); <END> } }</code><technical_language>Wait, this is worse previous version. happened assertEquals()</technical_language>

Target:
private static void assertCorrectGetAllResult(List<VM> result) { assertNotNull(result); assertFalse(result.isEmpty()); assertEquals(VM_COUNT, result.size()); for (VM vm : result) { assertEquals("Vm db generation wasn't loaded as expected", 1, vm.getDbGeneration()); } }
Source:
<code>public void testObservableInMap() { HashMap<String, IObservableValue<String>> hashMap = new HashMap<>(); WritableValue<String> writableValue = new WritableValue<>(); writableValue.setValue("Simon"); hashMap.put("Simon", writableValue); ISideEffect.create(() -> { IObservableValue<String> observableValue = hashMap.get("Simon"); <START> System.out.println(observableValue.getValue()); <END> sideEffectInvocations++; }); assertEquals(1, sideEffectInvocations); writableValue.setValue("Stefan"); runAsync(); assertEquals(2, sideEffectInvocations); }</code><technical_language>I this sysout removed</technical_language>

Target:
public void testObservableInMap() { HashMap<String, IObservableValue<String>> hashMap = new HashMap<>(); IObservableValue<String> observableValue = new WritableValue<>(); observableValue.setValue("Simon"); hashMap.put("Simon", observableValue); ISideEffect.create(() -> { IObservableValue<String> observable = hashMap.get("Simon"); observable.getValue(); sideEffectInvocations++; }); assertEquals(1, sideEffectInvocations); observableValue.setValue("Stefan"); runAsync(); assertEquals(2, sideEffectInvocations); }
Source:
<code>public void processTerminateEventWithParallelTasks() { ProcessInstance process = processBaseRuntime.startProcessWithProcessDefinitionKey(TASK_PROCESS_TERMINATE_EVENT); List<Task> taskList = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskList).isNotEmpty(); <START> assertThat(taskList.size()).isEqualTo(2); <END> Task task1 = taskList.get(0); taskBaseRuntime.completeTask(task1.getId()); List<Task> taskAfterCompleted = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskAfterCompleted).isEmpty(); assertThat(taskAfterCompleted.size()).isEqualTo(0); }</code><technical_language>Detail: shortcut "assertThat(taskList).hasSize(2)"</technical_language>

Target:
public void processTerminateEventWithParallelTasks() { ProcessInstance process = processBaseRuntime.startProcessWithProcessDefinitionKey(TASK_PROCESS_TERMINATE_EVENT); List<Task> taskList = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskList).isNotEmpty(); assertThat(taskList).hasSize(2); Task task1 = taskList.get(0); taskBaseRuntime.completeTask(task1.getId()); List<Task> taskAfterCompleted = taskBaseRuntime.getTasksByProcessInstanceId(process.getId()); assertThat(taskAfterCompleted).hasSize(0); }
Source:
<code>public File getMediaFilesFromFormManagerOrig(String fileLink) { File file = null; RestTemplate restTemplate = new RestTemplate(); try { file = restTemplate.getForObject(fileLink, File.class); } catch (Exception e) { <START> System.out.println(e.getMessage()); <END> } return file; }</code><technical_language>Do do sysouts. Log messages</technical_language>

Target:
public File getMediaFilesFromFormManagerOrig(String fileLink) { File file = null; RestTemplate restTemplate = new RestTemplate(); try { file = restTemplate.getForObject(fileLink, File.class); } catch (Exception e) { logger.info(e.getMessage()); } return file; }
Source:
<code>public void onAttach(Context activity) { super.onAttach(activity); mActivity = (Activity) activity; setHasOptionsMenu(true); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mClearSelectionReceiver, <START> new IntentFilter("recent-list-clear-selection")); <END> LocalBroadcastManager.getInstance(mActivity).registerReceiver(mRemoveSelectedReceiver, new IntentFilter("recent-list-remove-selected")); }</code><technical_language>intent action a constant is access in adapter? put in Util created. public static final String RECENT_LIST_CLEAR_SELECTION = "recent-list-clear-selection";</technical_language>

Target:
public void onAttach(Context activity) { super.onAttach(activity); mActivity = (Activity) activity; setHasOptionsMenu(true); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mClearSelectionReceiver, new IntentFilter(RecentListActionModeUtil.ACTION_CLEAR_SELECTION)); LocalBroadcastManager.getInstance(mActivity).registerReceiver(mRemoveSelectedReceiver, new IntentFilter(RecentListActionModeUtil.ACTION_REMOVE_SELECTED)); }
Source:
<code>public void testPomlessBuildExtension() throws Exception { Verifier verifier = getVerifier("testsetversionpomless", false); <START> verifier.addCliOption("-Dp2.repo=" + <END> new File("repositories/kepler").getAbsoluteFile().toURI().toString()); verifier.addCliOption("-DnewVersion=2.0.0"); verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + getTychoVersion() + ":set-version"); verifier.verifyErrorFreeLog(); File baseDir = new File(verifier.getBasedir()); String rootPom = readFileToString(new File(baseDir, "pom.xml")).toString(); Assert.assertTrue("Root pom version does not match 2.0.0!", rootPom.contains("<version>2.0.0</version>")); String bundleManifest = readFileToString(new File(baseDir, "bundle1/META-INF/MANIFEST.MF")).toString(); Assert.assertTrue("Bundles MANIFEST.MF version does not match 2.0.0!", bundleManifest.contains("Bundle-Version: 2.0.0")); String testBundleManifest = readFileToString(new File(baseDir, "bundle1.tests/META-INF/MANIFEST.MF")) .toString(); Assert.assertTrue("Test-bundles MANIFEST.MF version does not match 2.0.0!", testBundleManifest.contains("Bundle-Version: 2.0.0")); String featureXml = readFileToString(new File(baseDir, "feature/feature.xml")).toString(); Assert.assertTrue("feature.xml version does not match 2.0.0!", featureXml.contains("version=\"2.0.0\"")); }</code><technical_language>remove p2 repo</technical_language>

Target:
public void testPomlessBuildExtension() throws Exception { Verifier verifier = getVerifier("testsetversionpomless", false); String newVersion = "2.0.0"; verifier.addCliOption("-DnewVersion=" + newVersion); verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + getTychoVersion() + ":set-version"); verifier.verifyErrorFreeLog(); File baseDir = new File(verifier.getBasedir()); PomFile rootPom = PomFile.read(new File(baseDir, "pom.xml"), false); Assert.assertEquals(newVersion, rootPom.getVersion()); DefaultBundleReader reader = new DefaultBundleReader(); OsgiManifest bundleManifest = reader.loadManifest(new File(baseDir, "bundle1/META-INF/MANIFEST.MF")); Assert.assertEquals(newVersion, bundleManifest.getBundleVersion()); OsgiManifest testBundleManifest = reader.loadManifest(new File(baseDir, "bundle1.tests/META-INF/MANIFEST.MF")); Assert.assertEquals(newVersion, testBundleManifest.getBundleVersion()); Feature feature = Feature.read(new File(baseDir, "feature/feature.xml")); Assert.assertEquals(newVersion, feature.getVersion()); }
Source:
<code>private static InputStream getInlineResourceStream(VaadinRequest request, String file) { VaadinService service = request.getService(); ResourceProvider resourceProvider = service.getContext() .getAttribute(Lookup.class).lookup(ResourceProvider.class); URL appResource = resourceProvider.getApplicationResource(service, file); InputStream stream = null; try { stream = appResource == null ? null : appResource.openStream(); } catch (IOException e) { throw new IllegalStateException(String.format( "Couldn't open application resource '%s' for inline resource", <START> file, e)); <END> } if (stream == null) { throw new IllegalStateException(String.format( "Application resource '%s' for inline resource is not available", file)); } return stream; }</code><technical_language>suggestion file), e);</technical_language>

Target:
private static InputStream getInlineResourceStream(VaadinRequest request, String file) { VaadinService service = request.getService(); ResourceProvider resourceProvider = service.getContext() .getAttribute(Lookup.class).lookup(ResourceProvider.class); URL appResource = resourceProvider.getApplicationResource(service, file); InputStream stream = null; try { stream = appResource == null ? null : appResource.openStream(); } catch (IOException e) { throw new IllegalStateException(String.format( "Couldn't open application resource '%s' for inline resource", file), e); } if (stream == null) { throw new IllegalStateException(String.format( "Application resource '%s' for inline resource is not available", file)); } return stream; }
Source:
<code>public void testEqualValuesDifferentWeights() { FixedDoubleBreakdownHistogram histogram = new FixedDoubleBreakdownHistogram(200, 3.0, 4.0); histogram.add(3.5, 0.2, 1); histogram.add(3.5, 0.4, 1); histogram.add(3.5, 0.3, 2); <START> Streams.stream(histogram.iterator()).forEach(c -> { <END> assertTrue(c.getLeft() <= 3.5); assertTrue(c.getRight() >= 3.5); assertTrue(c.getLeft() < c.getRight()); }); assertEquals( Streams.stream(histogram.iterator()).mapToLong(c -> 1).sum(), 3); assertEquals( Streams.stream(histogram.iterator()).mapToDouble(c -> c.getWeight()).sum(), 0.9); assertEquals( Streams.stream(histogram.iterator()).mapToLong(c -> c.getCount()).sum(), 4); }</code><technical_language>nit: for-loop</technical_language>

Target:
public void testEqualValuesDifferentWeights() { FixedDoubleBreakdownHistogram histogram = new FixedDoubleBreakdownHistogram(200, 3.0, 4.0); histogram.add(3.5, 0.2, 1); histogram.add(3.5, 0.4, 1); histogram.add(3.5, 0.3, 2); Streams.stream(histogram.iterator()).forEach(bucketWeight -> { assertTrue(bucketWeight.getLeft() <= 3.5); assertTrue(bucketWeight.getRight() >= 3.5); assertTrue(bucketWeight.getLeft() < bucketWeight.getRight()); }); assertEquals( Streams.stream(histogram.iterator()).count(), 3); assertEquals( Streams.stream(histogram.iterator()).mapToDouble(FixedDoubleBreakdownHistogram.BucketWeight::getWeight).sum(), 0.9); assertEquals( Streams.stream(histogram.iterator()).mapToLong(FixedDoubleBreakdownHistogram.BucketWeight::getCount).sum(), 4); }
Source:
<code>public static void setUpOnce() throws IOException, RDFParseException { <START> validator <END> = new WikibaseDataModelValidator(); goodDataset = openTestDatasetStream(GOOD_DATASET_FILE_NAME); goodParsedDataset = Rio.parse(goodDataset, BASE_URI, RDF_FORMAT); badDataset = openTestDatasetStream(BAD_DATASET_FILE_NAME); badParsedDataset = Rio.parse(badDataset, BASE_URI, RDF_FORMAT); }</code><technical_language>streams of setUpOnce() method closed (try-with-resources)</technical_language>

Target:
public static void setUpOnce() throws RDFParseException, IOException { validator = new WikibaseDataModelValidator(); try (InputStream is = openTestDatasetStream(GOOD_DATASET_FILE_NAME)) { goodDataset = is; goodParsedDataset = Rio.parse(goodDataset, BASE_URI, RDF_FORMAT); } try (InputStream is = openTestDatasetStream(BAD_DATASET_FILE_NAME)) { badDataset = is; badParsedDataset = Rio.parse(badDataset, BASE_URI, RDF_FORMAT); } }
Source:
<code><START> private void afterInvocation() throws Exception { <END> ActionContext.setContext(null); }</code><technical_language>here, protected allows users re-implementing this class easily</technical_language>

Target:
protected void afterInvocation() throws Exception { ActionContext.setContext(null); }
Source:
<code>public static Slice lineInterpolatePoint(@SqlType(GEOMETRY_TYPE_NAME) Slice lineSlice, @SqlType(DOUBLE) double fraction) { if (!(0.0 <= fraction && fraction <= 1.0)) { <START> throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Fraction must be between 0 and 1, but is %s", fraction)); <END> } Geometry geometry = JtsGeometrySerde.deserialize(lineSlice); validateType("line_interpolate_point", geometry, ImmutableSet.of(LINE_STRING)); LineString line = (LineString) geometry; if (line.isEmpty()) { return JtsGeometrySerde.serialize(makeJtsEmptyPoint()); } org.locationtech.jts.geom.Coordinate coordinate = new LengthIndexedLine(line).extractPoint(fraction * line.getLength()); return JtsGeometrySerde.serialize(makeJtsPoint(coordinate)); }</code><technical_language>Consider including function name in error message. Otherwise, challenging for user figure out part of a complex query is causing this error</technical_language>

Target:
public static Slice lineInterpolatePoint(@SqlType(GEOMETRY_TYPE_NAME) Slice lineSlice, @SqlType(DOUBLE) double fraction) { if (!(0.0 <= fraction && fraction <= 1.0)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("line_interpolate_point: Fraction must be between 0 and 1, but is %s", fraction)); } Geometry geometry = JtsGeometrySerde.deserialize(lineSlice); validateType("line_interpolate_point", geometry, ImmutableSet.of(LINE_STRING)); LineString line = (LineString) geometry; if (line.isEmpty()) { return JtsGeometrySerde.serialize(makeJtsEmptyPoint()); } org.locationtech.jts.geom.Coordinate coordinate = new LengthIndexedLine(line).extractPoint(fraction * line.getLength()); return JtsGeometrySerde.serialize(makeJtsPoint(coordinate)); }
Source:
<code>public double priceFromYield(double yield, LocalDate settlementDate) { <START> double accrualFactor = dayCount.relativeYearFraction(settlementDate, notional.getDate()); <END> if (yieldConvention.equals(DISCOUNT)) { double price = 1.0d - accrualFactor * yield; return price; } if (yieldConvention.equals(INTEREST_AT_MATURITY) || yieldConvention.equals(FRANCE_CD) || yieldConvention.equals(JAPAN_BILLS)) { double price = 1.0d / (1.0d + accrualFactor * yield); return price; } throw new UnsupportedOperationException("The convention " + yieldConvention.name() + " is not supported."); }</code><technical_language>Logic convention</technical_language>

Target:
public double priceFromYield(double yield, LocalDate settlementDate) { double accrualFactor = dayCount.relativeYearFraction(settlementDate, notional.getDate()); return yieldConvention.priceFromYield(yield, accrualFactor); }
Source:
<code>public static String createJWT(HttpServletRequest request, SsoSession ssoSession, String clientId) throws NoSuchAlgorithmException, JOSEException { String serverName = request.getServerName(); String issuer = String.format("%s://%s:%s", request.getScheme(), InetAddressUtils.isIPv6Address(serverName) ? String.format("[%s]", serverName) : serverName, request.getServerPort()); JWTClaimsSet jwtClaims = (new JWTClaimsSet.Builder()) .jwtID(ssoSession.getPrincipalRecord().get(Authz.PrincipalRecord.ID)) .issueTime(new Date(System.currentTimeMillis())) .issuer(issuer) .subject(String.format("%s@%s", ssoSession.getUserId(), ssoSession.getProfile())) <START> .audience(Collections.singletonList(clientId)) <END> .claim("sub", String.format("%s@%s", ssoSession.getUserId(), ssoSession.getProfile())) .claim("preferred_username", String.format("%s@%s", ssoSession.getUserId(), ssoSession.getProfile())) .claim("email", ssoSession.getPrincipalRecord().<String>get(Authz.PrincipalRecord.EMAIL)) .claim("name", ssoSession.getPrincipalRecord().<String>get(Authz.PrincipalRecord.FIRST_NAME)) .build(); JWSSigner signer = new MACSigner(sharedSecret); SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), jwtClaims); signedJWT.sign(signer); return signedJWT.serialize(); }</code><technical_language>audience(String) method instead of audience(List<String>)</technical_language>

Target:
public static String createJWT(HttpServletRequest request, SsoSession ssoSession, String clientId) throws NoSuchAlgorithmException, JOSEException { String serverName = request.getServerName(); String issuer = String.format("%s://%s:%s", request.getScheme(), InetAddressUtils.isIPv6Address(serverName) ? String.format("[%s]", serverName) : serverName, request.getServerPort()); JWTClaimsSet jwtClaims = (new JWTClaimsSet.Builder()) .jwtID(ssoSession.getPrincipalRecord().get(Authz.PrincipalRecord.ID)) .issueTime(new Date(System.currentTimeMillis())) .issuer(issuer) .subject(String.format("%s@%s", ssoSession.getUserId(), ssoSession.getProfile())) .audience(clientId) .claim("sub", String.format("%s@%s", ssoSession.getUserId(), ssoSession.getProfile())) .claim("preferred_username", String.format("%s@%s", ssoSession.getUserId(), ssoSession.getProfile())) .claim("email", ssoSession.getPrincipalRecord().<String>get(Authz.PrincipalRecord.EMAIL)) .claim("name", ssoSession.getPrincipalRecord().<String>get(Authz.PrincipalRecord.FIRST_NAME)) .build(); JWSSigner signer = new MACSigner(sharedSecret); SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), jwtClaims); signedJWT.sign(signer); return signedJWT.serialize(); }
Source:
<code>public void testInspectSwarm() throws Exception { requireDockerApiVersionAtLeast("1.24", "swarm support"); final Swarm swarm = sut.inspectSwarm(); <START> assertThat(swarm.createdAt(), is(not(isEmptyOrNullString()))); <END> assertThat(swarm.updatedAt(), is(not(isEmptyOrNullString()))); assertThat(swarm.joinTokens().worker(), is(not(isEmptyOrNullString()))); assertThat(swarm.joinTokens().manager(), is(not(isEmptyOrNullString()))); }</code><technical_language>check null for other fields? check for ID least</technical_language>

Target:
public void testInspectSwarm() throws Exception { requireDockerApiVersionAtLeast("1.24", "swarm support"); final Swarm swarm = sut.inspectSwarm(); assertThat(swarm.createdAt(), is(notNullValue())); assertThat(swarm.updatedAt(), is(notNullValue())); assertThat(swarm.id(), is(not(isEmptyOrNullString()))); assertThat(swarm.joinTokens().worker(), is(not(isEmptyOrNullString()))); assertThat(swarm.joinTokens().manager(), is(not(isEmptyOrNullString()))); }
Source:
<code>public void merge(BuildPlan source) { Assert.isNotNull(source); @SuppressWarnings("serial") EcoreUtil.Copier copier = new EcoreUtil.Copier() { @Override protected EObject createCopy(EObject source) { return BuildPlan.this; }; @Override protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject) { super.copyAttribute(eAttribute, eObject, copyEObject); } @Override protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) { } }; copier.copy(source); getParameterDefinitions().clear(); getParameterDefinitions().addAll(EcoreUtil.copyAll(source.getParameterDefinitions())); getFlags().clear(); getFlags().addAll(source.getFlags()); getHealthReports().clear(); getHealthReports().addAll(EcoreUtil.copyAll(source.getHealthReports())); getAttributes().clear(); getAttributes().putAll(source.getAttributes()); getChildren().clear(); getChildren().addAll(source.getChildren()); <START> getChildren().forEach(child -> { <END> if (child.getServer() == null && child.getParent() != null) { child.setServer(child.getParent().getServer()); child.setRefreshDate(refreshDate); } IBuild build = child.getLastBuild(); if (build != null) { build.setServer(child.getServer()); build.setRefreshDate(refreshDate); build.setPlan(child); } }); if (getParent() != null) { if (server == null && getParent().getServer() != null) { setServer(getParent().getServer()); } } }</code><technical_language>matrix build functionality yield builds level of children. is more layers of children. builds organized a tree I reason traverse properly in cases</technical_language>

Target:
public void merge(BuildPlan source) { Assert.isNotNull(source); @SuppressWarnings("serial") EcoreUtil.Copier copier = new EcoreUtil.Copier() { @Override protected EObject createCopy(EObject source) { return BuildPlan.this; }; @Override protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject) { super.copyAttribute(eAttribute, eObject, copyEObject); } @Override protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) { } }; copier.copy(source); getParameterDefinitions().clear(); getParameterDefinitions().addAll(EcoreUtil.copyAll(source.getParameterDefinitions())); getFlags().clear(); getFlags().addAll(source.getFlags()); getHealthReports().clear(); getHealthReports().addAll(EcoreUtil.copyAll(source.getHealthReports())); getAttributes().clear(); getAttributes().putAll(source.getAttributes()); getChildren().clear(); getChildren().addAll(source.getChildren()); getChildren().forEach(child -> { child.setParent(this); child.setSelected(isSelected()); if (child.getServer() == null) { child.setServer(getServer()); child.setRefreshDate(refreshDate); } IBuild build = child.getLastBuild(); if (build != null) { build.setServer(child.getServer()); build.setRefreshDate(refreshDate); build.setPlan(child); } }); if (getParent() != null) { if (server == null && getParent().getServer() != null) { setServer(getParent().getServer()); } } }