auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void initVmTemplate() { VmTemplate vmFromConfiguration; ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); <START> OvfHelper ovfHelper = new OvfHelper(); <END> if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmFromConfiguration); getParameters().setVmTemplate(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); } catch (OvfReaderException e) { log.errorFormat("failed to parse a given ovf configuration: \n" + ovfEntityData.getOvfData(), e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }</code><technical_language>move deceleration line up.</technical_language>

Target:
private void initVmTemplate() { VmTemplate vmFromConfiguration = null; OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); } catch (OvfReaderException e) { log.errorFormat("failed to parse a given ovf configuration: \n" + ovfEntityData.getOvfData(), e); } vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmFromConfiguration); getParameters().setVmTemplate(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }
Source:
<code>public void testConvertFunctionAndBigDecimal() throws Exception { final String resourcePath = "dtables/src/main/resources/guvnor/feature/dtables/FunctionAndBigDecimalTable.xls"; final ConversionResult conversionResult = convertResource(resourcePath); final List<ConversionMessage> messages = conversionResult.getMessages(); Assertions.assertThat(messages).hasSize(1); final String message = messages.get(0).getMessage(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(message).startsWith("Created Guided Decision Table 'FunctionAndBigDecimalTable (converted on"); softly.assertThat(message).endsWith(").gdst'"); <START> softly.assertAll(); <END> }); }</code><technical_language>below</technical_language>

Target:
public void testConvertFunctionAndBigDecimal() throws Exception { final String resourcePath = "dtables/src/main/resources/guvnor/feature/dtables/FunctionAndBigDecimalTable.xls"; final ConversionResult conversionResult = convertResource(resourcePath); final List<ConversionMessage> messages = conversionResult.getMessages(); Assertions.assertThat(messages).hasSize(1); final String message = messages.get(0).getMessage(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(message).startsWith("Created Guided Decision Table 'FunctionAndBigDecimalTable (converted on"); softly.assertThat(message).endsWith(").gdst'"); }); }
Source:
<code>static XContentBuilder buildMapping(Class clazz, String indexType, String idFieldName, String parentType) throws IOException { XContentBuilder mapping = jsonBuilder().startObject().startObject(indexType); if (clazz.isAnnotationPresent(DynamicTemplates.class)){ String mappingPath = ((DynamicTemplates) clazz.getAnnotation(DynamicTemplates.class)).mappingPath(); if (isNotBlank(mappingPath)) { String jsonString = ElasticsearchTemplate.readFileFromClasspath(mappingPath); if (isNotBlank(jsonString)) { <START> addDynamicTemplatesMapping(mapping, jsonString); <END> } } } if (hasText(parentType)) { mapping.startObject(FIELD_PARENT).field(FIELD_TYPE, parentType).endObject(); } XContentBuilder xContentBuilder = mapping.startObject(FIELD_PROPERTIES); mapEntity(xContentBuilder, clazz, true, idFieldName, "", false, FieldType.Auto, null); return xContentBuilder.endObject().endObject().endObject(); }</code><technical_language>change. I move this addDynamicTemplatesMapping(), call this method pass XContentBuilder class. java private static void addDynamicTemplatesMapping(XContentBuilder xContentBuilder, Class claszz) throws IOException</technical_language>

Target:
static XContentBuilder buildMapping(Class clazz, String indexType, String idFieldName, String parentType) throws IOException { XContentBuilder mapping = jsonBuilder().startObject().startObject(indexType); addDynamicTemplatesMapping(mapping, clazz); if (hasText(parentType)) { mapping.startObject(FIELD_PARENT).field(FIELD_TYPE, parentType).endObject(); } XContentBuilder xContentBuilder = mapping.startObject(FIELD_PROPERTIES); mapEntity(xContentBuilder, clazz, true, idFieldName, "", false, FieldType.Auto, null); return xContentBuilder.endObject().endObject().endObject(); }
Source:
<code>public List<Attribute> getAttributes(PerunSession sess, Member member, Group group, List<String> attrNames) throws InternalErrorException { MapSqlParameterSource parameters = new MapSqlParameterSource(); parameters.addValue("mId", member.getId()); parameters.addValue("gId", group.getId()); parameters.addValue("nSO", AttributesManager.NS_MEMBER_GROUP_ATTR_OPT); parameters.addValue("nSD", AttributesManager.NS_MEMBER_GROUP_ATTR_DEF); parameters.addValue("nSV", AttributesManager.NS_MEMBER_GROUP_ATTR_VIRT); parameters.addValue("attrNames", attrNames); try { <START> return namedParameterJdbcTemplate.query("select " + getAttributeMappingSelectQuery("mem") + " from attr_names " + <END> "left join member_group_attr_values mem on id=mem.attr_id and member_id=:mId and group_id=:gId " + "where namespace in ( :nSO,:nSD,:nSV ) and attr_names.attr_name in ( :attrNames )", parameters, new AttributeRowMapper(sess, this, member, group)); } catch(EmptyResultDataAccessException ex) { return new ArrayList<Attribute>(); } catch(RuntimeException ex) { throw new InternalErrorException(ex); } }</code><technical_language>problem name above</technical_language>

Target:
public List<Attribute> getAttributes(PerunSession sess, Member member, Group group, List<String> attrNames) throws InternalErrorException { MapSqlParameterSource parameters = new MapSqlParameterSource(); parameters.addValue("mId", member.getId()); parameters.addValue("gId", group.getId()); parameters.addValue("nSO", AttributesManager.NS_MEMBER_GROUP_ATTR_OPT); parameters.addValue("nSD", AttributesManager.NS_MEMBER_GROUP_ATTR_DEF); parameters.addValue("nSV", AttributesManager.NS_MEMBER_GROUP_ATTR_VIRT); parameters.addValue("attrNames", attrNames); try { return namedParameterJdbcTemplate.query("select " + getAttributeMappingSelectQuery("mem_gr") + " from attr_names " + "left join member_group_attr_values mem_gr on id=mem_gr.attr_id and member_id=:mId and group_id=:gId " + "where namespace in ( :nSO,:nSD,:nSV ) and attr_names.attr_name in ( :attrNames )", parameters, new AttributeRowMapper(sess, this, member, group)); } catch(EmptyResultDataAccessException ex) { return new ArrayList<Attribute>(); } catch(RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
<code>private boolean indexIsLatestVersion() { <START> return ! Boolean.parseBoolean(Framework.getProperty(AbstractSession.DISABLED_ISLATESTVERSION_PROPERTY, "false")); <END> }</code><technical_language>space !. Framework#isBooleanPropertyTrue(DISABLED_ISLATESTVERSION_PROPERTY)</technical_language>

Target:
private boolean indexIsLatestVersion() { return !Framework.isBooleanPropertyTrue(AbstractSession.DISABLED_ISLATESTVERSION_PROPERTY); }
Source:
<code><START> public RangeColumnStatistics( <END> Optional<Object> lowValue, Optional<Object> highValue, Estimate fraction, Estimate dataSize, Estimate distinctValuesCount) { this.lowValue = requireNonNull(lowValue, "lowValue can not be null"); this.highValue = requireNonNull(highValue, "highValue can not be null"); requireNonNull(fraction, "fraction can not be null"); requireNonNull(dataSize, "dataSize can not be null"); requireNonNull(distinctValuesCount, "distinctValuesCount can not be null"); this.statistics = createStatisticsMap(dataSize, fraction, distinctValuesCount); }</code><technical_language>I do public. IMO called Builder</technical_language>

Target:
private RangeColumnStatistics( Optional<Object> lowValue, Optional<Object> highValue, Estimate fraction, Estimate dataSize, Estimate distinctValuesCount) { this.lowValue = requireNonNull(lowValue, "lowValue can not be null"); this.highValue = requireNonNull(highValue, "highValue can not be null"); this.fraction = requireNonNull(fraction, "fraction can not be null"); this.dataSize = requireNonNull(dataSize, "dataSize can not be null"); this.distinctValuesCount = requireNonNull(distinctValuesCount, "distinctValuesCount can not be null"); }
Source:
<code>public void connectionLost(Throwable cause) { TRACE.log(TraceLevel.WARN, "Connection Lost: " + brokerUri); <START> nConnectionLost.incrementValue(1L); <END> isConnected.setValue(0); for (Iterator iterator = callBackListeners.iterator(); iterator.hasNext();) { MqttCallback callbackListener = (MqttCallback) iterator.next(); callbackListener.connectionLost(cause); } }</code><technical_language>a bump() method use</technical_language>

Target:
public void connectionLost(Throwable cause) { TRACE.log(TraceLevel.WARN, "Connection Lost: " + brokerUri); nConnectionLost.increment();; isConnected.setValue(0); for (Iterator iterator = callBackListeners.iterator(); iterator.hasNext();) { MqttCallback callbackListener = (MqttCallback) iterator.next(); callbackListener.connectionLost(cause); } }
Source:
<code>public void testACNVSexChrs() { final File tDir = IOUtils.tempDir("Test", "Plotting"); ACNVPlotter.writeSegmentedAlleleFractionPlot(SAMPLE_NAME, TUMOR_ALLELIC_COUNTS_FILE, <START> TANGENT_NORMALIZED_COVERAGE_FILE, SEGMENTS_FILE, tDir.getAbsolutePath()+"/", true); <END> Assert.assertTrue(new File(tDir, SAMPLE_NAME + "_ACNV.png").exists()); Assert.assertTrue(new File(tDir, SAMPLE_NAME + "_ACNV.png").length() > 0); }</code><technical_language>spaces +</technical_language>

Target:
public void testACNVSexChrs() { final File tDir = IOUtils.tempDir("Test", "Plotting"); ACNVPlotter.writeSegmentedAlleleFractionPlot(SAMPLE_NAME, TUMOR_ALLELIC_COUNTS_FILE, TANGENT_NORMALIZED_COVERAGE_FILE, SEGMENTS_FILE, tDir.getAbsolutePath() + "/", OUTPUT_PREFIX, true); Assert.assertTrue(new File(tDir, OUTPUT_PREFIX + "_ACNV.png").exists()); Assert.assertTrue(new File(tDir, OUTPUT_PREFIX + "_ACNV.png").length() > 0); }
Source:
<code><START> public void createSpaceRequest(final SpaceRequest jobRequest) { <END> final Map<String, Object> params = getContext(jobRequest); params.put("Operation", "createOrgUnit"); scheduleJob(jobRequest, new CreateOrgUnitCmd(jobRequestHelper, jobResultManager, params)); }</code><technical_language>Is in this method right operation? In this method is call command create Org unit</technical_language>

Target:
public void createSpaceRequest(final SpaceRequest jobRequest) { final Map<String, Object> params = getContext(jobRequest); params.put("Operation", "createOrgUnit"); scheduleJob(jobRequest, new CreateSpaceCmd(jobRequestHelper, jobResultManager, params)); }
Source:
<code>List<ProbeInstance> getSortedProbeInstances() { long modCountLocal = modCount.get(); final SortedProbeInstances sortedInstancesOld = this.sortedProbeInstances.get(); final SortedProbeInstances sortedInstances; if (sortedInstancesOld.mod < modCountLocal) { List<ProbeInstance> sorted = new ArrayList<>(probeInstances.values()); Collections.sort(sorted, COMPARATOR); sortedInstances = new SortedProbeInstances(modCountLocal, sorted); <START> this.sortedProbeInstances.compareAndSet(sortedInstancesOld, sortedInstancesOld); <END> } else { sortedInstances = sortedInstancesOld; } return sortedInstances.probeInstances; }</code><technical_language>I update of CAS sortedInstances</technical_language>

Target:
List<ProbeInstance> getSortedProbeInstances() { long modCountLocal = modCount.get(); final SortedProbeInstances sortedInstancesOld = this.sortedProbeInstances.get(); final SortedProbeInstances sortedInstances; if (sortedInstancesOld.mod < modCountLocal) { List<ProbeInstance> sorted = new ArrayList<>(probeInstances.values()); Collections.sort(sorted, COMPARATOR); sortedInstances = new SortedProbeInstances(modCountLocal, sorted); this.sortedProbeInstances.compareAndSet(sortedInstancesOld, sortedInstances); } else { sortedInstances = sortedInstancesOld; } return sortedInstances.probeInstances; }
Source:
<code>protected void handleResourceChanged(IResourceChangeEvent event) { ActionContext context = getContext(); if (context == null) { return; } final IStructuredSelection selection = (IStructuredSelection) context .getSelection(); if (ResourceSelectionUtil.allResourcesAreOfType(selection, IResource.PROJECT) == false) { return; } List sel = selection.toList(); IResourceDelta delta = event.getDelta(); if (delta == null) { return; } <START> <END> for (IResourceDelta projDelta : delta.getAffectedChildren(IResourceDelta.CHANGED)) { if ((projDelta.getFlags() & (IResourceDelta.OPEN | IResourceDelta.DESCRIPTION)) != 0) { if (sel.contains(projDelta.getResource())) { getNavigator().getSite().getShell().getDisplay().syncExec( () -> { addTaskAction.selectionChanged(selection); gotoGroup.updateActionBars(); refactorGroup.updateActionBars(); workspaceGroup.updateActionBars(); }); } } } }</code><technical_language>remove empty line</technical_language>

Target:
protected void handleResourceChanged(IResourceChangeEvent event) { ActionContext context = getContext(); if (context == null) { return; } final IStructuredSelection selection = (IStructuredSelection) context .getSelection(); if (ResourceSelectionUtil.allResourcesAreOfType(selection, IResource.PROJECT) == false) { return; } List sel = selection.toList(); IResourceDelta delta = event.getDelta(); if (delta == null) { return; } for (IResourceDelta projectDelta : delta.getAffectedChildren(IResourceDelta.CHANGED)) { if ((projectDelta.getFlags() & (IResourceDelta.OPEN | IResourceDelta.DESCRIPTION)) != 0) { if (sel.contains(projectDelta.getResource())) { getNavigator().getSite().getShell().getDisplay().syncExec( () -> { addTaskAction.selectionChanged(selection); gotoGroup.updateActionBars(); refactorGroup.updateActionBars(); workspaceGroup.updateActionBars(); }); } } } }
Source:
<code>public boolean hasStemTable() { <START> for (Table table : this.getSourceDatabase().getTables()) { <END> if (table.isStem()) { return true; } } return false; }</code><technical_language>FYI this replaced a liner: java getSourceDatabase().getTables().stream() .anyMatch(Table::isStem)</technical_language>

Target:
public boolean hasStemTable() { return getSourceDatabase().getTables().stream().anyMatch(Table::isStem); }
Source:
<code>protected void configure() { bind(ApplicationInfoManager.class).asEagerSingleton(); <START> bind(EurekaInstanceConfig.class).toProvider(KillbillEurekaInstanceConfigProvider.class).in(Scopes.SINGLETON); <END> bind(EurekaClientConfig.class).toProvider(DefaultEurekaClientConfigProvider.class).in(Scopes.SINGLETON); bind(InstanceInfo.class).toProvider(KillbillEurekaInstanceInfoProvider.class).in(Scopes.SINGLETON); bind(EurekaClient.class).to(DiscoveryClient.class).in(Scopes.SINGLETON); bind(AbstractDiscoveryClientOptionalArgs.class).to(EurekaClientOptionalArgs.class).in(Scopes.SINGLETON); Multibinder<ServiceRegistry> serviceRegistryBinder = Multibinder.newSetBinder(binder(), ServiceRegistry.class); serviceRegistryBinder.addBinding().to(EurekaServiceRegistry.class); }</code><technical_language>Nit: I asEagerSingleton catch errors early on</technical_language>

Target:
protected void configure() { bind(ApplicationInfoManager.class).asEagerSingleton(); bind(EurekaInstanceConfig.class).toProvider(KillbillEurekaInstanceConfigProvider.class).asEagerSingleton(); bind(EurekaClientConfig.class).toProvider(DefaultEurekaClientConfigProvider.class).asEagerSingleton(); bind(InstanceInfo.class).toProvider(KillbillEurekaInstanceInfoProvider.class).asEagerSingleton(); bind(EurekaClient.class).to(DiscoveryClient.class).asEagerSingleton(); bind(AbstractDiscoveryClientOptionalArgs.class).to(EurekaClientOptionalArgs.class).asEagerSingleton(); Multibinder<ServiceRegistry> serviceRegistryBinder = Multibinder.newSetBinder(binder(), ServiceRegistry.class); serviceRegistryBinder.addBinding().to(EurekaServiceRegistry.class); }
Source:
<code><START> public AlertHandler() { <END> }</code><technical_language>please don' do this, private need create instance of this class invoke method, static</technical_language>

Target:
private AlertHandler() { }
Source:
<code>protected IProgressMonitor getSubProgressMonitor(int workAmount) { return <START> SubMonitor.convert(null, workAmount); <END> }</code><technical_language>original code creating a new SubProgressMonitor fMonitor, this SubMonitor functionality</technical_language>

Target:
protected IProgressMonitor getSubProgressMonitor(int workAmount) { return SubMonitor.convert(fMonitor, workAmount); }
Source:
<code><START> private boolean isNestedCopyfile( <END> CopyFile copyfile, List<RepoProject> sortedProjects) { if (copyfile.dest.indexOf('/') == -1) return false; for (RepoProject proj : sortedProjects) { if (proj.getPath().compareTo(copyfile.dest) > 0) return false; if (proj.isAncestorOf(copyfile.dest)) return true; } return false; }</code><technical_language>this static</technical_language>

Target:
private static boolean isNestedCopyfile( CopyFile copyfile, List<RepoProject> sortedProjects) { if (copyfile.dest.indexOf('/') == -1) return false; for (RepoProject proj : sortedProjects) { if (proj.getPath().compareTo(copyfile.dest) > 0) return false; if (proj.isAncestorOf(copyfile.dest)) return true; } return false; }
Source:
<code>public void canSupportGuaranteedSize() throws InterruptedException, CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; Preview preview = new Preview.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync(() -> { preview.setPreviewSurfaceProvider( mPreviewSurfaceProviderWithFrameAvailableListener); CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing( lensFacing).build(); <START> CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, preview); <END> mLifecycleOwner.startAndResume(); }); assertThat(mSurfaceFutureSemaphore.tryAcquire(10, TimeUnit.SECONDS)).isTrue(); assertEquals(GUARANTEED_RESOLUTION, mPreviewResolution); } }</code><technical_language>this pass presubmit. unbind usecases binding a new new lens facing</technical_language>

Target:
public void canSupportGuaranteedSize() throws InterruptedException, CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (!CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; Preview preview = new Preview.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync(() -> { preview.setPreviewSurfaceProvider( mPreviewSurfaceProviderWithFrameAvailableListener); CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing( lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, preview); mLifecycleOwner.startAndResume(); }); assertThat(mSurfaceFutureSemaphore.tryAcquire(10, TimeUnit.SECONDS)).isTrue(); assertEquals(GUARANTEED_RESOLUTION, mPreviewResolution); mInstrumentation.runOnMainSync(() -> { CameraX.unbindAll(); mLifecycleOwner.pauseAndStop(); }); } }
Source:
<code>private void <START> parseIDBBlock(int blockLength, ByteBuffer pcapNgBlockHeader) { <END> long dataLinkType = ConversionHelper.unsignedIntToLong(pcapNgBlockHeader.getShort()); setDataLinkTypeNg(fInterfaceID, dataLinkType); pcapNgBlockHeader.getShort(); long snapShotLength = ConversionHelper.unsignedIntToLong(pcapNgBlockHeader.getInt()); setSnapshotLengthNg(fInterfaceID, snapShotLength); int tsResolution = getTsValue(pcapNgBlockHeader, blockLength, PcapFileValues.PCAPNG_IFTSRESOL_CODE); setTsResolNg(fInterfaceID, tsResolution); int tsOffset = getTsValue(pcapNgBlockHeader, blockLength,PcapFileValues.PCAPNG_IFTSRESOL_CODE); setTsOffsetNg(fInterfaceID, tsOffset); fInterfaceID++; }</code><technical_language>receive IDB PcapNgBlock parameter</technical_language>

Target:
private void parseIDBBlock(int blockLength, ByteBuffer pcapNgBlockHeader) { int dataLinkType = pcapNgBlockHeader.getShort(); setDataLinkTypeNg(fInterfaceID, dataLinkType); pcapNgBlockHeader.getShort(); long snapShotLength = ConversionHelper.unsignedIntToLong(pcapNgBlockHeader.getInt()); setSnapshotLengthNg(fInterfaceID, snapShotLength); int tsResolution = getTsValue(pcapNgBlockHeader, blockLength, PcapFileValues.PCAPNG_IFTSRESOL_CODE); setTsResolNg(fInterfaceID, tsResolution); int tsOffset = getTsValue(pcapNgBlockHeader, blockLength, PcapFileValues.PCAPNG_IFTSOFFSET_CODE); setTsOffsetNg(fInterfaceID, tsOffset); fInterfaceID++; }
Source:
<code>public INDArray getGradient(INDArray gradient, int iteration) { if (m == null || u == null) throw new IllegalStateException("Updater has not been initialized with view state"); INDArray oneMinusBeta1Grad = gradient.mul(1.0 - beta1); m.muli(beta1).addi(oneMinusBeta1Grad); <START> u.assign(Transforms.max(u.muli(beta2), Transforms.abs(gradient))); <END> double beta1t = FastMath.pow(beta1, iteration + 1); double beta2t = FastMath.pow(beta2, iteration + 1); double alphat = learningRate * FastMath.sqrt(1 - beta2t) / (1 - beta1t); if (Double.isNaN(alphat) || alphat == 0.0) alphat = epsilon; gradient.assign(m).muli(alphat).divi(u); return gradient; }</code><technical_language>I do following, avoid working arrays (results of abs, max) + assign op u.muli(beta2); Transforms.abs(gradient,false); //In-place OK here, original gradient values Nd4j.getExecutioner().exec(new Max(u,gradient,u))</technical_language>

Target:
public INDArray getGradient(INDArray gradient, int iteration) { if (m == null || u == null) throw new IllegalStateException("Updater has not been initialized with view state"); u.muli(beta2); Transforms.abs(gradient,false); Nd4j.getExecutioner().exec(new Max(u,gradient,u,u.length())); double beta1t = FastMath.pow(beta1, iteration + 1); double alphat = learningRate / (1 - beta1t); if (Double.isNaN(alphat) || alphat == 0.0) alphat = epsilon; gradient.assign(m).muli(alphat).divi(u); return gradient; }
Source:
<code>public ClusterParticipant getClusterParticipant() throws IOException { if (clusterParticipant == null) { clusterParticipant = new ClusterParticipant() { private final List<PartitionStateChangeListener> listeners = new LinkedList<>(); @Override public void participate(List<AmbryHealthReport> ambryHealthReports) { for (PartitionStateChangeListener listener : listeners) { for (String partitionName : partitionLayout.getAllPartitionNames()) { <START> listener.onPartitionLeadFromStandby(partitionName); <END> } } } @Override public void close() { } @Override public boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { return false; } @Override public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { return false; } @Override public List<String> getSealedReplicas() { return Collections.emptyList(); } @Override public List<String> getStoppedReplicas() { return Collections.emptyList(); } @Override public void registerPartitionStateChangeListener(PartitionStateChangeListener partitionStateChangeListener) { listeners.add(partitionStateChangeListener); } }; } return clusterParticipant; }</code><technical_language>Do a standby participate called</technical_language>

Target:
public ClusterParticipant getClusterParticipant() throws IOException { if (clusterParticipant == null) { clusterParticipant = new ClusterParticipant() { private final List<PartitionStateChangeListener> listeners = new LinkedList<>(); @Override public void participate(List<AmbryHealthReport> ambryHealthReports) { for (PartitionStateChangeListener listener : listeners) { for (String partitionName : partitionLayout.getAllPartitionNames()) { listener.onPartitionStateChangeToLeaderFromStandby(partitionName); } } } @Override public void close() { } @Override public boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { return false; } @Override public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { return false; } @Override public List<String> getSealedReplicas() { return Collections.emptyList(); } @Override public List<String> getStoppedReplicas() { return Collections.emptyList(); } @Override public void registerPartitionStateChangeListener(PartitionStateChangeListener partitionStateChangeListener) { listeners.add(partitionStateChangeListener); } }; } return clusterParticipant; }
Source:
<code>public Cluster apply(Cluster original) { requireNonNull(original); for (Node node : getStripe().getNodes()) { if (original.containsNode(node.getNodeAddress())) { throw new IllegalArgumentException("Node with address: " + node.getNodeAddress() + " already exists in cluster: " + original); } } Cluster updated = original.clone(); <START> updated.addStripe(getStripe()); <END> return updated; }</code><technical_language>cluster.attachStripe(...); in this case: some logic apply nodes grab cluster-wide parameters validated</technical_language>

Target:
public Cluster apply(Cluster original) { requireNonNull(original); if (original.getStripes().contains(getStripe())) { throw new IllegalArgumentException("Stripe :" + getStripe() + " already exists in cluster: " + original); } Cluster updated = original.clone(); updated.addStripe(getStripe().clone()); return updated; }
Source:
<code>public void accept(final Socket socket) throws IOException { try ( InputStream input = socket.getInputStream(); <START> BufferedOutputStream output = new BufferedOutputStream( <END> socket.getOutputStream() ) ) { while (true) { this.print( BkBasic.addSocketHeaders( new RqLive(input), socket ), output ); if (input.available() <= 0) { break; } } } }</code><technical_language>@rui-castro removing final</technical_language>

Target:
public void accept(final Socket socket) throws IOException { try ( final InputStream input = socket.getInputStream(); final BufferedOutputStream output = new BufferedOutputStream( socket.getOutputStream() ) ) { while (true) { this.print( BkBasic.addSocketHeaders( new RqLive(input), socket ), output ); if (input.available() <= 0) { break; } } } }
Source:
<code>protected void handleAutoLogin(AutoLoginData autoLoginData) { final DbUser loggedUser = autoLoginData.getDbUser(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { lockInteractionManager.showLoadingIndicator(); getLoginModel().autoLogin(loggedUser); } }); <START> SSOTokenChangeEvent.fire(eventBus, SSOTokenData.instance().getSsoToken()); <END> user.setAutoLogin(true); }</code><technical_language>check if SSO token is available</technical_language>

Target:
protected void handleAutoLogin(AutoLoginData autoLoginData) { final DbUser loggedUser = autoLoginData.getDbUser(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { lockInteractionManager.showLoadingIndicator(); getLoginModel().autoLogin(loggedUser); } }); SSOTokenChangeEvent.fire(eventBus, SSOTokenData.instance().getToken()); user.setAutoLogin(true); }
Source:
<code>public void cancelInsertIntoTest() throws SQLException <START> { <END> query(format("CREATE TABLE %s " + "(orderkey BIGINT, partkey BIGINT, shipinstruct VARCHAR(25)) ", tableName)); query(format("INSERT INTO %s " + "VALUES(1, 2, 'first_row')", tableName)); String sql = format("INSERT INTO %s " + "SELECT orderkey, partkey, shipinstruct FROM tpch.sf1.lineitem", tableName); doCancelTest(sql); QueryResult queryResult = query(format("SELECT * from %s", tableName)); assertThat(queryResult).containsExactly( row(1L, 2L, "first_row")); }</code><technical_language>is this needed? assert end query rows</technical_language>

Target:
public void cancelInsertIntoTest() throws Exception { String tableName = format("cancel_insertinto_%s", randomUUID().toString().replace("-", "")); query(format("CREATE TABLE %s " + "(orderkey BIGINT, partkey BIGINT, shipinstruct VARCHAR(25)) ", tableName)); String sql = format("INSERT INTO %s " + "SELECT orderkey, partkey, shipinstruct FROM tpch.sf1.lineitem", tableName); doCancelTest(sql); assertThat(query(format("SELECT * from %s", tableName))).hasNoRows(); query(format("DROP TABLE IF EXISTS %s", tableName)); }
Source:
<code>public boolean isValid() { <START> return canUnlock(); <END> }</code><technical_language>canUnlock throws SecureException if gnome-keyring is is handled error. changed implmentation be: try { return canUnlock(); } catch (SecurityException e) { return false; } this lead provider disabled for some reason</technical_language>

Target:
public boolean isValid() { try { return canUnlock(); } catch (SecurityException e) { return false; } }
Source:
<code>public void sawOpcode(int seen) { if (seen == Constants.INVOKEVIRTUAL && ( getNameConstantOperand().equals("sendBroadcast") || getNameConstantOperand().equals("sendBroadcastAsUser") || getNameConstantOperand().equals("sendOrderedBroadcast") || getNameConstantOperand().equals("sendOrderedBroadcastAsUser") ) <START> && !getClassConstantOperand().endsWith("LocalBroadcastManager") END> ) { bugReporter.reportBug(new BugInstance(this, ANDROID_BROADCAST_TYPE, Priorities.NORMAL_PRIORITY) .addClass(this).addMethod(this).addSourceLine(this)); } }</code><technical_language>I InterfaceUtils.isSubtype() a main method confirm is a LocalBroadcastManager. check !getClassConstantOperand().endsWith("LocalBroadcastManager") present. useful fallback complete class hierarchy loaded (aka missing classes scan)</technical_language>

Target:
public void sawOpcode(int seen) { if (seen == Constants.INVOKEVIRTUAL && ( getNameConstantOperand().equals("sendBroadcast") || getNameConstantOperand().equals("sendBroadcastAsUser") || getNameConstantOperand().equals("sendOrderedBroadcast") || getNameConstantOperand().equals("sendOrderedBroadcastAsUser") )) { if (!InterfaceUtils.isSubtype(getClassConstantOperand(), "android.support.v4.content.LocalBroadcastManager") && !getClassConstantOperand().endsWith("LocalBroadcastManager")) { bugReporter.reportBug(new BugInstance(this, ANDROID_BROADCAST_TYPE, Priorities.NORMAL_PRIORITY) .addClass(this).addMethod(this).addSourceLine(this)); } } }
Source:
<code>public void testSaveGame() { String playerName = "Henk"; State.setPlayerName(playerName); int coins = 45; State.setCoins(coins); double score = 34567; State.setScore(score); <START> boolean soundEnabled = false; <END> State.setSoundEnabled(soundEnabled); SaveGameWriter.saveGame("testWriteRead.json"); SaveGameParser.loadGame("testWriteRead.json"); assertEquals(playerName, State.getPlayerName()); assertEquals(coins, State.getCoins()); assertEquals(score, State.getScore(), DELTA); assertEquals(soundEnabled, State.isSoundEnabled()); }</code><technical_language>local fields declared final. <layout,review</technical_language>

Target:
public void testSaveGame() { final String playerName = "Henk"; State.setPlayerName(playerName); final int coins = 45; State.setCoins(coins); final int score = 34567; State.setHighscore(score); final boolean soundEnabled = false; State.setSoundEnabled(soundEnabled); SaveGameWriter.saveGame(fileFolder + "saveGameWriterTest.json"); SaveGameParser.loadGame(fileFolder + "saveGameWriterTest.json"); assertEquals(playerName, State.getPlayerName()); assertEquals(coins, State.getCoins()); assertEquals(score, State.getHighscore()); assertEquals(soundEnabled, State.isSoundEnabled()); }
Source:
<code>private List<UserDto> findUsers(DbSession dbSession, PermissionQuery query) { <START> List<Integer> orderedIds = new ArrayList<>(dbClient.userPermissionDao().selectUserIdsByQuery(dbSession, query)); <END> return Ordering.explicit(orderedIds).onResultOf(UserDto::getId).immutableSortedCopy(dbClient.userDao().selectByIds(dbSession, orderedIds)); }</code><technical_language>create a new list immutable</technical_language>

Target:
private List<UserDto> findUsers(DbSession dbSession, PermissionQuery query) { List<Integer> orderedIds = dbClient.userPermissionDao().selectUserIdsByQuery(dbSession, query); return Ordering.explicit(orderedIds).onResultOf(UserDto::getId).immutableSortedCopy(dbClient.userDao().selectByIds(dbSession, orderedIds)); }
Source:
<code>public void testMap_toProto() { MapExample mapExample = new MapExample(); mapExample.put("test", null); mapExample.put("foo", "bar"); ProtobufMapExample protoMapExample; try { protoMapExample = mapper.map(mapExample, ProtobufMapExample.class); fail("Should have thrown MappingException"); } catch (MappingException e) { assertEquals("Could not call map setter method putAllValue", e.getMessage()); } mapExample.put("test", "value"); <START> protoMapExample = mapper.map(mapExample, ProtobufMapExample.class); <END> assertEquals(mapExample.getValue(), protoMapExample.getValueMap()); }</code><technical_language>In opinion test method execute test subject more once. I recommend split this method two. applies testMap_fromProto method. I suggest ExpectedException JUnit rule instead of manual processing of exceptions</technical_language>

Target:
public void testMap_toProto() { MapExample mapExample = new MapExample(); mapExample.put("test", "value"); ProtobufMapExample protoMapExample = mapper.map(mapExample, ProtobufMapExample.class); assertEquals(mapExample.getValue(), protoMapExample.getValueMap()); }
Source:
<code>public OsgpException ensureOsgpOrTechnicalException(final Exception e) { if (e instanceof OsgpException) { return (OsgpException) e; } if (e instanceof ConnectionException) { <START> return new FunctionalException(FunctionalExceptionType.CONNECTION_ERROR, ComponentType.PROTOCOL_DLMS); <END> } return new TechnicalException(ComponentType.PROTOCOL_DLMS, "Unexpected exception while handling protocol request/response message", new OsgpException(ComponentType.PROTOCOL_DLMS, e.getMessage())); }</code><technical_language>In code this change original exception (or message) preserved in OsgpException returned. reason information ConnectionException in FunctionalException is returned</technical_language>

Target:
public OsgpException ensureOsgpOrTechnicalException(final Exception e) { if (e instanceof OsgpException) { return (OsgpException) e; } if (e instanceof ConnectionException) { return new FunctionalException(FunctionalExceptionType.CONNECTION_ERROR, ComponentType.PROTOCOL_DLMS, e); } return new TechnicalException(ComponentType.PROTOCOL_DLMS, "Unexpected exception while handling protocol request/response message", new OsgpException(ComponentType.PROTOCOL_DLMS, e.getMessage())); }
Source:
<code>public EquipmentSlot getEquipmentSlot() { <START> return EquipmentSlot.values()[hand]; <END> }</code><technical_language>I do this instead: <LINK_0> if client sends incorrect hand ID, default main hand</technical_language>

Target:
public EquipmentSlot getEquipmentSlot() { return hand == 1 ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND; }
Source:
<code>private String extractChecksText(String testsURL) { StringBuilder builder = new StringBuilder(); if (summary.getFailCount() > 0) { List<CaseResult> failedTests = action.getResult().getFailedTests(); if (failedTests.size() > 10) { failedTests = failedTests.subList(0, 9); } failedTests.forEach(failedTest -> mapFailedTestToTestReport(builder, failedTest)); if (summary.getFailCount() > 10) { builder.append("\n") .append(summary.getFailCount() - 10) .append(" more test results are not shown here, view them on [Jenkins](") <START> .append(testsURL).append(")"); <END> } } return builder.toString(); }</code><technical_language>this testsURL links JUnit summary page? If so, I links for detailsURL, build page links for detailsURL</technical_language>

Target:
private String extractChecksText(String testsURL) { StringBuilder builder = new StringBuilder(); if (summary.getFailCount() > 0) { List<CaseResult> failedTests = action.getResult().getFailedTests(); if (failedTests.size() > MAX_RESULTS_TO_SEND_TO_CHECKS_API) { failedTests = failedTests.subList(0, MAX_RESULTS_TO_SEND_TO_CHECKS_API - 1); } failedTests.forEach(failedTest -> mapFailedTestToTestReport(builder, failedTest)); if (summary.getFailCount() > MAX_RESULTS_TO_SEND_TO_CHECKS_API) { builder.append("\n") .append(summary.getFailCount() - MAX_RESULTS_TO_SEND_TO_CHECKS_API) .append(" more test results are not shown here, view them on [Jenkins](") .append(testsURL).append(")"); } } return builder.toString(); }
Source:
<code>public void createAccounts(Collection<AccountAttributes> accountsToAdd, boolean updateAccount) throws InvalidParametersException { List<StudentProfileAttributes> profilesToAdd = new LinkedList<StudentProfileAttributes>(); for (AccountAttributes accountToAdd : accountsToAdd) { profilesToAdd.add(accountToAdd.studentProfile); } profilesDb.createEntities(profilesToAdd); List<AccountAttributes> accountsToUpdate = createEntities(accountsToAdd); if (updateAccount) { for (AccountAttributes entity : accountsToUpdate) { <START> AccountAttributes account = entity; <END> try { updateAccount(account, true); } catch (EntityDoesNotExistException e) { Assumption.fail("Entity found be already existing and not existing simultaneously"); } } } }</code><technical_language>AccountAttributes account : accountsToUpdate in for loop? This line removed that</technical_language>

Target:
public void createAccounts(Collection<AccountAttributes> accountsToAdd, boolean updateAccount) throws InvalidParametersException { List<StudentProfileAttributes> profilesToAdd = new LinkedList<>(); for (AccountAttributes accountToAdd : accountsToAdd) { profilesToAdd.add(accountToAdd.studentProfile); } profilesDb.createEntities(profilesToAdd); List<AccountAttributes> accountsToUpdate = createEntities(accountsToAdd); if (updateAccount) { for (AccountAttributes account : accountsToUpdate) { try { updateAccount(account, true); } catch (EntityDoesNotExistException e) { Assumption.fail("Account found to be already existing and not existing simultaneously"); } } } }
Source:
<code>public static URI getStartReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType) throws URISyntaxException { <START> return new URI(StringUtil.join("/", StringUtils <END> .chomp(controllerURI.getScheme() + "://" + controllerURI.getHost() + ":" + controllerURI.getPort(), "/"), OLD_SEGMENT_PATH, rawTableName + START_REPLACE_SEGMENTS_PATH + TYPE_DELIMITER + tableType)); }</code><technical_language>suggestion return getURI(controllerURI.getScheme(), controllerURI.getHost(), controllerURI.getPort(), OLD_SEGMENT_PATH + '/' + rawTableName + START_REPLACE_SEGMENTS_PATH + TYPE_DELIMITER + tableType);</technical_language>

Target:
public static URI getStartReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType) throws URISyntaxException { return new URI(StringUtil.join("/", StringUtils .chomp(controllerURI.getScheme() + "://" + controllerURI.getHost() + ":" + controllerURI.getPort()), OLD_SEGMENT_PATH, rawTableName + START_REPLACE_SEGMENTS_PATH + TYPE_DELIMITER + tableType)); }
Source:
<code>public void configure(Binder binder) { super.configure(binder); <START> JsonConfigProvider.bind(binder, "druid.metadata.postgres", PostgreSQLConnectorConfig.class); <END> PolyBind .optionBinder(binder, Key.get(MetadataStorageProvider.class)) .addBinding(TYPE) .to(NoopMetadataStorageProvider.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(SQLMetadataConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind.optionBinder(binder, Key.get(MetadataStorageActionHandlerFactory.class)) .addBinding(TYPE) .to(PostgreSQLMetadataStorageActionHandlerFactory.class) .in(LazySingleton.class); }</code><technical_language>is this change intended</technical_language>

Target:
public void configure(Binder binder) { super.configure(binder); JsonConfigProvider.bind(binder, "druid.metadata.postgres.ssl", PostgreSQLConnectorConfig.class); JsonConfigProvider.bind(binder, "druid.metadata.postgres", PostgreSQLTablesConfig.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageProvider.class)) .addBinding(TYPE) .to(NoopMetadataStorageProvider.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(SQLMetadataConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind.optionBinder(binder, Key.get(MetadataStorageActionHandlerFactory.class)) .addBinding(TYPE) .to(PostgreSQLMetadataStorageActionHandlerFactory.class) .in(LazySingleton.class); }
Source:
<code>public Subscription anonymizePassword() { if (getEndpoint().containsCredentials()) { return new Subscription( topicName, name, endpoint.anonymizePassword(), state, description, <START> deliveryType == DeliveryType.SERIAL ? serialSubscriptionPolicy : batchSubscriptionPolicy, <END> trackingEnabled, supportTeam, contact, contentType, deliveryType ); } return this; }</code><technical_language>I SERIAL delivery is a default BATCH enabled explicitly in cases..</technical_language>

Target:
public Subscription anonymizePassword() { if (getEndpoint().containsCredentials()) { return new Subscription( topicName, name, endpoint.anonymizePassword(), state, description, deliveryType == DeliveryType.BATCH ? batchSubscriptionPolicy : serialSubscriptionPolicy, trackingEnabled, supportTeam, contact, contentType, deliveryType ); } return this; }
Source:
<code>private List<SPTarget> getTargetList() { List<SPTarget> targetList = new ArrayList<>(); Option<ObsContext> ctxOpt = _iw.getObsContext(); if (ctxOpt.isEmpty()) return targetList; ObsContext ctx = ctxOpt.getValue(); TargetEnvironment env = ctx.getTargets(); GuideGroup group = env.getOrCreatePrimaryGuideGroup(); guideProbeType = null; int oiwfsCount = 0; int aowfsCount = 0; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); if (t == GuideProbe.Type.OIWFS || t == GuideProbe.Type.AOWFS) { if (t == GuideProbe.Type.OIWFS) { oiwfsCount++; } else { aowfsCount++; } <START> } <END> } if ("Flamingos2".equals(ctx.getInstrument().getNarrowType())) { guideProbeType = GuideProbe.Type.AOWFS; } else if (oiwfsCount > 1 && aowfsCount > 1) { message = TpeMessage.warningMessage("Strehl: Error: Both ODGW and CWFS guide stars defined"); targetListError = true; return new ArrayList<>(); } else if (oiwfsCount > 1) { guideProbeType = GuideProbe.Type.OIWFS; } else { guideProbeType = GuideProbe.Type.AOWFS; } message = null; targetListError = false; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); if (t == guideProbeType) { Option<SPTarget> primary = group.get(gp).getValue().getPrimary(); if (!primary.isEmpty()) { SPTarget target = primary.getValue(); targetList.add(target); target.addWatcher(this); } } } return targetList; }</code><technical_language>java switch (t) { case OIWFS: ++oiwfsCount; break; case AOWFS: ++aowfsCount; break; } something. reason check I guess</technical_language>

Target:
private List<SPTarget> getTargetList() { List<SPTarget> targetList = new ArrayList<>(); Option<ObsContext> ctxOpt = _iw.getObsContext(); if (ctxOpt.isEmpty()) return targetList; ObsContext ctx = ctxOpt.getValue(); TargetEnvironment env = ctx.getTargets(); GuideGroup group = env.getOrCreatePrimaryGuideGroup(); guideProbeType = null; int oiwfsCount = 0; int aowfsCount = 0; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); switch (t) { case OIWFS: oiwfsCount++; break; case AOWFS: aowfsCount++; break; default: } } if ("Flamingos2".equals(ctx.getInstrument().getNarrowType())) { guideProbeType = GuideProbe.Type.AOWFS; } else if (oiwfsCount > 1 && aowfsCount > 1) { message = TpeMessage.warningMessage("Strehl: Error: Both ODGW and CWFS guide stars defined"); targetListError = true; return new ArrayList<>(); } else if (oiwfsCount > 1) { guideProbeType = GuideProbe.Type.OIWFS; } else { guideProbeType = GuideProbe.Type.AOWFS; } message = null; targetListError = false; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); if (t == guideProbeType) { Option<SPTarget> primary = group.get(gp).getValue().getPrimary(); if (!primary.isEmpty()) { SPTarget target = primary.getValue(); targetList.add(target); target.addWatcher(this); } } } return targetList; }
Source:
<code>protected boolean callEventExist(final Object container, final Operation operation) { boolean exist = false; if (container instanceof org.eclipse.uml2.uml.Package) { EList<Element> containment = ((org.eclipse.uml2.uml.Package) container).getOwnedElements(); Iterator<Element> elements = containment.iterator(); while (!exist && elements.hasNext()) { Element element = elements.next(); if ((element instanceof CallEvent) && <START> (operation != null)) <END> { exist = exist || (operation.equals(((CallEvent) element).getOperation())); } } } return exist; }</code><technical_language>constant variable</technical_language>

Target:
protected boolean callEventExist(final Object container, final Operation operation) { boolean exist = false; if (container instanceof org.eclipse.uml2.uml.Package) { EList<Element> containment = ((org.eclipse.uml2.uml.Package) container).getOwnedElements(); Iterator<Element> elements = containment.iterator(); while (!exist && elements.hasNext()) { Element element = elements.next(); if ((element instanceof CallEvent) && (null != operation)) { exist = (operation.equals(((CallEvent) element).getOperation())); } } } return exist; }
Source:
<code>private Object[] getCompressedRoots() { if (compressedRoots == null) { List<Object> compressedRootList = new ArrayList<Object>(); compressedFolders = getCompressedFolders(); <START> for (StagingFolderEntry compressedFolder : compressedFolders) { <END> compressedRootList.add(compressedFolder); } for (StagingEntry rootFile : rootFiles) { compressedRootList.add(rootFile); } compressedRoots = new Object[compressedRootList.size()]; compressedRootList.toArray(compressedRoots); } return compressedRoots; }</code><technical_language>style nit: braces</technical_language>

Target:
private Object[] getCompressedRoots() { if (compressedRoots == null) { List<Object> compressedRootList = new ArrayList<Object>(); compressedFolders = getCompressedFolders(); for (StagingFolderEntry compressedFolder : compressedFolders) compressedRootList.add(compressedFolder); for (StagingEntry rootFile : rootFiles) compressedRootList.add(rootFile); compressedRoots = new Object[compressedRootList.size()]; compressedRootList.toArray(compressedRoots); } return compressedRoots; }