auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<PageHeaderWithOffset> writeToFileWriter(ParquetFileWriter writer) throws IOException { final List<PageHeaderWithOffset> allPageHeaders = new ArrayList<PageHeaderWithOffset>(); writer.startColumn(path, totalValueCount, compressor.getCodecName()); if (dictionaryPage != null) { allPageHeaders.add(writer.writeDictionaryPage(dictionaryPage)); encodings.add(dictionaryPage.getEncoding()); } <START> long pageOffset = writer.getPos(); <END> for (PageHeaderWithOffset pageHeaderWithOffset: pageHeaderWithOffsets) { final long headerSize = pageHeaderWithOffset.getHeaderByteSize(); pageOffset += headerSize; final long pageSize = pageHeaderWithOffset.getPageHeader().getCompressed_page_size(); allPageHeaders.add(new PageHeaderWithOffset(pageHeaderWithOffset.getPageHeader(), pageOffset)); pageOffset += pageSize; } writer.writeDataPages(buf, uncompressedLength, compressedLength, totalStatistics, new ArrayList<Encoding>(encodings)); writer.endColumn(); if (INFO) { LOG.info( String.format( "written %,dB for %s: %,d values, %,dB raw, %,dB comp, %d pages, encodings: %s", buf.size(), path, totalValueCount, uncompressedLength, compressedLength, pageCount, encodings) + (dictionaryPage != null ? String.format( ", dic { %,d entries, %,dB raw, %,dB comp}", dictionaryPage.getDictionarySize(), dictionaryPage.getUncompressedSize(), dictionaryPage.getDictionarySize()) : "")); } encodings.clear(); pageCount = 0; return allPageHeaders; }</code><technical_language>if position relative 1st datapage above, need add this PageHeaderWithOffset</technical_language>

Target:
public List<PageHeaderWithOffset> writeToFileWriter(ParquetFileWriter writer) throws IOException { if (dictionaryPage == null) { return writeBufferedPages(writer, null); } SortedDictionary sortedDictionary = new SortedDictionary(dictionaryPage, path, parquetProperties.getAllocator(), parquetProperties.getDictionaryPageSizeThreshold()); for (PageHolder pageHolder : bufferedPages) { final BytesInput data = pageHolder.getData(); final Encoding valuesEncoding = pageHolder.getValuesEncoding(); final ValuesReader dictionaryBasedValuesReader = valuesEncoding.getDictionaryBasedValuesReader(path, ValuesType.VALUES, sortedDictionary.getDictionary()); dictionaryBasedValuesReader.initFromPage(pageHolder.getValueCount(), data.toByteBuffer(), 0); final DictionaryValuesWriter valuesWriter = parquetProperties.dictionaryWriter(path, (int)data.size()); final IntList encodedValues = new IntList(); for (int i = 0; i < pageHolder.getValueCount(); ++i) { final int oldDictionaryId = dictionaryBasedValuesReader.readValueDictionaryId(); encodedValues.add(sortedDictionary.getNewId(oldDictionaryId)); } BytesInput newData = valuesWriter.getBytes(encodedValues); pageHolder.setData(newData); } return writeBufferedPages(writer, sortedDictionary.getSortedDictionaryPage()); }
Source:
<code><START> public Collection<String> getColumnNames() { <END> final ImmutableSet<String> names = storageFields.keySet(); final List<String> list = newLinkedList(names); Collections.sort(list); return list; }</code><technical_language>Collection is returned in cases. Also, sorting time this method is invoked is efficient. find implementation of storageFields, keys sorted automatically</technical_language>

Target:
public Set<String> getColumnNames() { return storageFields.keySet(); }
Source:
<code>private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); <START> if (asyncTask != null) { <END> List<Step> stepsList = getStepDao().getStepsByExternalId(asyncTask.getTaskId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } } return entity; }</code><technical_language>null check done for asyncTask.getTaskId()</technical_language>

Target:
private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null) { Guid taskId = asyncTask.getTaskId(); if (taskId != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(taskId); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } } } return entity; }
Source:
<code>void dispose() { if (semanticResourcesUpdater != null) { semanticResourcesUpdater.dispose(); semanticResourcesUpdater = null; <START> } <END> }</code><technical_language>session set null dispose()</technical_language>

Target:
void dispose() { session = null; if (semanticResourcesUpdater != null) { semanticResourcesUpdater.dispose(); semanticResourcesUpdater = null; } }
Source:
<code>Object loadFromPersistence(String key) { File file = getMapStoreFilePath(key).toFile(); if (!file.exists()) { return null; } InputStream inputStream = null; try { <START> inputStream = new FileInputStream(Paths.get(persistencePath.toString(), key + SER).toFile()); <END> InputStream buffer = new BufferedInputStream(inputStream); try (ObjectInput input = new ObjectInputStream(buffer)) { return input.readObject(); } } catch (IOException e) { LOGGER.info("Unable to read object.", e); } catch (ClassNotFoundException e) { LOGGER.info("Class for object being read from stream does not exist.", e); } finally { IOUtils.closeQuietly(inputStream); } return null; }</code><technical_language>do persistencePath.resolve(key + SER) instead</technical_language>

Target:
private Object loadFromPersistence(String key) { File file = getMapStoreFile(key); if (!file.exists()) { return null; } try (ObjectInput input = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) { return input.readObject(); } catch (IOException e) { LOGGER.info("Unable to read object.", e); } catch (ClassNotFoundException e) { LOGGER.info("Class for object being read from stream does not exist.", e); FileUtils.deleteQuietly(file); } return null; }
Source:
<code>public void test_json_support() throws Exception { Fs fs = startCrawlerDefinition() .setJsonSupport(true) .build(); startCrawler(getCrawlerName(), fs, endCrawlerDefinition(getCrawlerName()), null); assertThat("We should have 0 doc for tweet in text field...", awaitBusy(() -> { try { <START> SearchResponse response = elasticsearchClient.search(getCrawlerName(), null, "json_content.text:tweet"); <END> return response.getHits().getTotal() == 2; } catch (IOException e) { logger.warn("Caught exception while running the test", e); return false; } }), equalTo(true)); }</code><technical_language>object</technical_language>

Target:
public void test_json_support() throws Exception { Fs fs = startCrawlerDefinition() .setJsonSupport(true) .build(); startCrawler(getCrawlerName(), fs, endCrawlerDefinition(getCrawlerName()), null); assertThat("We should have 2 doc for tweet in text field...", awaitBusy(() -> { try { SearchResponse response = elasticsearchClient.search(getCrawlerName(), null, "text:tweet"); return response.getHits().getTotal() == 2; } catch (IOException e) { logger.warn("Caught exception while running the test", e); return false; } }), equalTo(true)); }
Source:
<code>public void render(DefaultRenderingProcess.StereoRenderState stereoRenderState) { resetStats(); switch (stereoRenderState) { case MONO: currentRenderingStage = WorldRenderingStage.DEFAULT; isFirstRenderingStageForCurrentFrame = true; break; case OCULUS_LEFT_EYE: currentRenderingStage = WorldRenderingStage.OCULUS_LEFT_EYE; playerCamera.updateFrustum(); isFirstRenderingStageForCurrentFrame = true; break; case OCULUS_RIGHT_EYE: currentRenderingStage = WorldRenderingStage.OCULUS_RIGHT_EYE; playerCamera.updateFrustum(); isFirstRenderingStageForCurrentFrame = false; break; } renderableWorld.updateAndQueueVisibleChunks(isFirstRenderingStageForCurrentFrame); renderShadowMap(); renderWorldReflection(); <START> toggleWireFrameON(); END> DefaultRenderingProcess.getInstance().clear(); DefaultRenderingProcess.getInstance().beginRenderSceneOpaque(); renderSky(); try (Activity ignored = PerformanceMonitor.startActivity("Render World")) { renderObjectsOpaque(); renderChunksOpaque(); renderChunksAlphaReject(); renderOverlays(); renderFirstPersonView(); DefaultRenderingProcess.getInstance().endRenderSceneOpaque(); PerformanceMonitor.startActivity("Render Light Geometry"); renderLightGeometry(); PerformanceMonitor.endActivity(); renderChunksRefractiveReflective(); } toggleWireFrameOFF(); combineRefractiveReflectiveAndOpaquePasses(); renderSimpleBlendMaterialsIntoCombinedPass(); renderFinalPostProcessedScene(stereoRenderState); playerCamera.updatePrevViewProjectionMatrix(); }</code><technical_language>I tempted put code for enabling wire frame mode, next lines some flavor of prepareForRendering() method. Methods check do a bit awkward. setWireFrameState() checkAndActivateWireFrameMode() clearer. 'toggleWireFrameON()' 'toggleWireFrameOn()' is initialisation/acronym. for OFF. names bad do reflect method does</technical_language>

Target:
public void render(DefaultRenderingProcess.StereoRenderState stereoRenderState) { resetStats(); preRenderUpdate(stereoRenderState); renderShadowMap(); renderWorldReflection(); preRenderSetup(); DefaultRenderingProcess.getInstance().beginRenderSceneOpaque(); renderSky(); try (Activity ignored = PerformanceMonitor.startActivity("Render World")) { renderObjectsOpaque(); renderChunksOpaque(); renderChunksAlphaReject(); renderOverlays(); renderFirstPersonView(); DefaultRenderingProcess.getInstance().endRenderSceneOpaque(); renderLightGeometry(); renderChunksRefractiveReflective(); } postRenderCleanup(); combineRefractiveReflectiveAndOpaquePasses(); renderSimpleBlendMaterialsIntoCombinedPass(); renderFinalPostProcessedScene(stereoRenderState); playerCamera.updatePrevViewProjectionMatrix(); }
Source:
<code>public void testMetadataUpdaterBinary() throws Exception { context.getRouteDefinition("FcrepoSerializationBinaryUpdater").adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { replaceFromWith("direct:start"); mockEndpointsAndSkip("*"); } }); context.start(); getMockEndpoint("mock:file:mock:direct:binary_file").expectedMessageCount(1); <START> getMockEndpoint("mock:file:mock:direct:binary_file").expectedHeaderReceived(Exchange.FILE_NAME, "foo"); <END> final String body = IOUtils.toString(ObjectHelper.loadResourceAsStream("binary.rdf"), "UTF-8"); final Map<String, Object> headers = ImmutableMap.of( BASE_URL, baseURL, FCREPO_IDENTIFIER, "foo"); template.sendBodyAndHeaders(body, headers); assertMockEndpointsSatisfied(); }</code><technical_language>While this work, is a strange formulation. I expect mock components -- mocking file component mocking direct component, both</technical_language>

Target:
public void testMetadataUpdaterBinary() throws Exception { context.getRouteDefinition("FcrepoSerializationBinaryUpdater").adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { replaceFromWith("direct:start"); mockEndpointsAndSkip("*"); } }); context.start(); getMockEndpoint("mock:file:binary_file").expectedMessageCount(1); getMockEndpoint("mock:file:binary_file").expectedHeaderReceived(Exchange.FILE_NAME, "foo"); final String body = IOUtils.toString(ObjectHelper.loadResourceAsStream("binary.rdf"), "UTF-8"); final Map<String, Object> headers = ImmutableMap.of( BASE_URL, baseURL, FCREPO_IDENTIFIER, "foo"); template.sendBodyAndHeaders(body, headers); assertMockEndpointsSatisfied(); }
Source:
<code>private static void zipFile(Path rootPath, File file, ZipOutputStream zos) throws IOException { ZipEntry ze = new ZipEntry(rootPath.relativize(file.toPath()).toString()); zos.putNextEntry(ze); try (FileInputStream fis = new FileInputStream(file)) { <START> byte[] buffer = new byte[1024]; <END> int len; while ((len = fis.read(buffer)) > 0) { zos.write(buffer, 0, len); } } zos.closeEntry(); }</code><technical_language>spring's io utils</technical_language>

Target:
private static void zipFile(Path rootPath, File file, ZipOutputStream zos) throws IOException { ZipEntry ze = new ZipEntry(rootPath.relativize(file.toPath()).toString()); zos.putNextEntry(ze); try (FileInputStream fis = new FileInputStream(file)) { StreamUtils.copy(fis, zos); } zos.closeEntry(); }
Source:
<code>public void execute(DiagnosticContext context) { try { DiagConfig diagConfig = context.getDiagsConfig(); <START> List<RestEntry> entries = new ArrayList(); <END> entries.addAll(context.getElasticRestCalls().values()); runQueries(context.getEsRestClient(), entries, context.getTempDir(), diagConfig.getCallRetries(), diagConfig.getPauseRetries()); } catch (Throwable t) { logger.log(SystemProperties.DIAG, "Error executing REST queries", t); throw new DiagnosticException(String.format("Unrecoverable REST Query Execution error - exiting. %s", Constants.CHECK_LOG)); } }</code><technical_language>suggestion List<RestEntry> entries = new ArrayList<>();</technical_language>

Target:
public void execute(DiagnosticContext context) { try { DiagConfig diagConfig = context.getDiagsConfig(); List<RestEntry> entries = new ArrayList<>(); entries.addAll(context.getElasticRestCalls().values()); runQueries(context.getEsRestClient(), entries, context.getTempDir(), diagConfig.getCallRetries(), diagConfig.getPauseRetries()); } catch (Throwable t) { logger.log(SystemProperties.DIAG, "Error executing REST queries", t); throw new DiagnosticException(String.format("Unrecoverable REST Query Execution error - exiting. %s", Constants.CHECK_LOG)); } }
Source:
<code>public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new CellInventoryHandler( new FluidCellInventory( o, container2 ), AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) ); } <START> catch( final AppEngException e ) <END> { return null; } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') log rethrow this exception. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new FluidCellInventoryHandler( new FluidCellInventory( o, container2 ) ); } catch( final AppEngException e ) { return null; } }
Source:
<code>public static LigerNavigatorFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerNavigatorFragment navigator = new LigerNavigatorFragment(); Bundle bundle = new Bundle(); JSONArray pages = new JSONArray(); if (pageName != null) { bundle.putString("pageName", pageName); } if (pageTitle != null) { bundle.putString("pageTitle", pageTitle); } try { if (pageOptions != null) { bundle.putString("pageOptions", pageOptions); JSONObject jsonPageOptions = new JSONObject(pageOptions); <START> if (jsonPageOptions.has("cached")) { <END> navigator.mCached = jsonPageOptions.getBoolean("cached"); } } if (pageArgs != null) { bundle.putString("pageArgs", pageArgs); JSONObject jsonPageArgs = new JSONObject(pageArgs); if (jsonPageArgs.has("pages")) { pages = jsonPageArgs.getJSONArray("pages"); } else { pages.put(jsonPageArgs); } } for (int i = 0; i < pages.length(); i++) { JSONObject page = pages.getJSONObject(i); PageFragment newPage = LigerFragmentFactory.openPage(page.getString("page"), page.getString("title"), page.optJSONObject("args"), page.optJSONObject("options")); if (newPage != null) { if (navigator.mCached) { navigator.mFragCache.put(page.getString("page"), newPage); } navigator.mFragDeck.addLast(newPage); newPage.mContainer = navigator; } } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } navigator.setArguments(bundle); return navigator; }</code><technical_language>If set interpreted true. } else { navigator.mCached = true; }</technical_language>

Target:
public static LigerNavigatorFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerNavigatorFragment navigator = new LigerNavigatorFragment(); Bundle bundle = new Bundle(); JSONArray pages = new JSONArray(); if (pageName != null) { bundle.putString("pageName", pageName); } if (pageTitle != null) { bundle.putString("pageTitle", pageTitle); } try { if (pageOptions != null) { bundle.putString("pageOptions", pageOptions); JSONObject jsonPageOptions = new JSONObject(pageOptions); if (jsonPageOptions.has("cached")) { navigator.mCached = jsonPageOptions.getBoolean("cached"); } else { navigator.mCached = true; } } if (pageArgs != null) { bundle.putString("pageArgs", pageArgs); JSONObject jsonPageArgs = new JSONObject(pageArgs); if (jsonPageArgs.has("pages")) { pages = jsonPageArgs.getJSONArray("pages"); } else { pages.put(jsonPageArgs); } } for (int i = 0; i < pages.length(); i++) { JSONObject page = pages.getJSONObject(i); PageFragment newPage = LigerFragmentFactory.openPage(page.getString("page"), page.getString("title"), page.optJSONObject("args"), page.optJSONObject("options")); if (newPage != null) { if (navigator.mCached) { navigator.mFragCache.put(page.getString("page"), newPage); } navigator.mFragDeck.addLast(newPage); newPage.mContainer = navigator; } } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } navigator.setArguments(bundle); return navigator; }
Source:
<code>public void add(final VmNic iface, CompensationContext compensationContext, boolean reserveExistingMac, int osId, Version clusterCompatibilityVersion) { if (reserveExistingMac) { <START> final MacPoolManagerStrategy macPoolManager = getMacPoolManager(iface.getVmId()); <END> final String ifaceMacAddress = iface.getMacAddress(); if (FeatureSupported.hotPlug(clusterCompatibilityVersion) && getOsRepository().hasNicHotplugSupport(osId, clusterCompatibilityVersion)) { macPoolManager.forceAddMac(ifaceMacAddress); } else if (!macPoolManager.addMac(ifaceMacAddress)) { auditLogMacInUse(iface); throw new VdcBLLException(VdcBllErrors.MAC_ADDRESS_IS_IN_USE); } } getVmNicDao().save(iface); getVmNetworkStatisticsDao().save(iface.getStatistics()); compensationContext.snapshotNewEntity(iface); compensationContext.snapshotNewEntity(iface.getStatistics()); }</code><technical_language>named macPool. need extract variable</technical_language>

Target:
public void add(final VmNic iface, CompensationContext compensationContext, boolean reserveExistingMac, int osId, Version clusterCompatibilityVersion) { if (reserveExistingMac) { if (FeatureSupported.hotPlug(clusterCompatibilityVersion) && getOsRepository().hasNicHotplugSupport(osId, clusterCompatibilityVersion)) { macPool.forceAddMac(iface.getMacAddress()); } else if (!macPool.addMac(iface.getMacAddress())) { auditLogMacInUse(iface); throw new VdcBLLException(VdcBllErrors.MAC_ADDRESS_IS_IN_USE); } } getVmNicDao().save(iface); getVmNetworkStatisticsDao().save(iface.getStatistics()); compensationContext.snapshotNewEntity(iface); compensationContext.snapshotNewEntity(iface.getStatistics()); }
Source:
<code>protected void eventHandle(@NonNull ITmfEvent event) { Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu == null) { return; } ITmfStateSystemBuilder ssb = getStateSystemBuilder(); if (ssb == null) { return; } Integer cpuQuark = fCpuNumToQuark.get(cpu); if (cpuQuark == null) { try { String cpuAttributeName = NonNullUtils.nullToEmptyString(cpu); cpuQuark = ssb.getQuarkAbsoluteAndAdd(cpuAttributeName); fCpuNumToQuark.put(cpu, cpuQuark); } catch <START> (StateValueTypeException e) <END> { throw new IllegalStateException(e); } } if (!event.getName().equals(fSchedSwitch)) { return; } try { int nextTid = ((Long) event.getContent().getField(fNextTid).getValue()).intValue(); final TmfStateValue value = TmfStateValue.newValueInt(nextTid); ssb.modifyAttribute(event.getTimestamp().toNanos(), value, cpuQuark); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } }</code><technical_language>longer thrown modifyAttribute() removed</technical_language>

Target:
protected void eventHandle(@NonNull ITmfEvent event) { Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu == null) { return; } ITmfStateSystemBuilder ssb = getStateSystemBuilder(); if (ssb == null) { return; } Integer cpuQuark = fCpuNumToQuark.get(cpu); if (cpuQuark == null) { String cpuAttributeName = NonNullUtils.nullToEmptyString(cpu); cpuQuark = ssb.getQuarkAbsoluteAndAdd(cpuAttributeName); fCpuNumToQuark.put(cpu, cpuQuark); } if (!event.getName().equals(fSchedSwitch)) { return; } try { int nextTid = ((Long) event.getContent().getField(fNextTid).getValue()).intValue(); final TmfStateValue value = TmfStateValue.newValueInt(nextTid); ssb.modifyAttribute(event.getTimestamp().toNanos(), value, cpuQuark); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } }
Source:
<code>public void onStarted(Run build, TaskListener listener) { if (PluginImpl.shouldScan(build) && build.getParent().getProperty(ScannerJobProperty.class) == null) { try { build.getParent().addProperty(new ScannerJobProperty(false)); } catch (IOException e) { logger.log(Level.WARNING, "Failed to add a ScannerJobProperty to " + build.getParent().getFullDisplayName(), e); <START> listener.getLogger().println("WARNING! Failed to add the scanner property to this job."); <END> } } }</code><technical_language>This prefix is logging in "correct way" actual build log. double logging here, build log scan log</technical_language>

Target:
public void onStarted(Run build, TaskListener listener) { if (PluginImpl.shouldScan(build) && build.getParent().getProperty(ScannerJobProperty.class) == null) { try { build.getParent().addProperty(new ScannerJobProperty(false)); } catch (IOException e) { logger.log(Level.WARNING, "Failed to add a ScannerJobProperty to " + build.getParent().getFullDisplayName(), e); listener.getLogger().println("[BFA] WARNING! Failed to add the scanner property to this job."); } } }
Source:
<code>private void postAdd(Change change, List<PatchSetApproval> added) throws OrmException, EmailException { if (added.isEmpty()) { return; } PatchSet patchSet = dbProvider.get().patchSets().get(change.currentPatchSetId()); for (PatchSetApproval psa : added) { Account account = accountCache.get(psa.getAccountId()).getAccount(); hooks.doReviewerAddedHook(change, account, patchSet, dbProvider.get()); } List<Account.Id> toMail = Lists.newArrayListWithCapacity(added.size()); <START> IdentifiedUser idenitifiedUser = (IdentifiedUser)currentUser.get(); <END> for (PatchSetApproval psa : added) { if (!psa.getAccountId().equals(idenitifiedUser.getAccountId())) { toMail.add(psa.getAccountId()); } } if (!toMail.isEmpty()) { try { AddReviewerSender cm = addReviewerSenderFactory.create(change); cm.setFrom(idenitifiedUser.getAccountId()); cm.addReviewers(toMail); cm.send(); } catch (Exception err) { log.error("Cannot send email to new reviewers of change " + change.getId(), err); } } }</code><technical_language>nit: space cast</technical_language>

Target:
private void postAdd(Change change, List<PatchSetApproval> added) throws OrmException, EmailException { if (added.isEmpty()) { return; } PatchSet patchSet = dbProvider.get().patchSets().get(change.currentPatchSetId()); for (PatchSetApproval psa : added) { Account account = accountCache.get(psa.getAccountId()).getAccount(); hooks.doReviewerAddedHook(change, account, patchSet, dbProvider.get()); } List<Account.Id> toMail = Lists.newArrayListWithCapacity(added.size()); IdentifiedUser identifiedUser = (IdentifiedUser) currentUser.get(); for (PatchSetApproval psa : added) { if (!psa.getAccountId().equals(identifiedUser.getAccountId())) { toMail.add(psa.getAccountId()); } } if (!toMail.isEmpty()) { try { AddReviewerSender cm = addReviewerSenderFactory.create(change); cm.setFrom(identifiedUser.getAccountId()); cm.addReviewers(toMail); cm.send(); } catch (Exception err) { log.error("Cannot send email to new reviewers of change " + change.getId(), err); } } }
Source:
<code>public void checkNotifyElementUpdatedAndListenerUpdated() { canvasHandler.addRegistrationListener(updateListener); <START> final List<Element> updatedElements = new ArrayList<>(); updatedElements.add(mock(Element.class)); <END> canvasHandler.doBatchUpdate(updatedElements); verify(updateListener, times(1)).updateBatch(any()); }</code><technical_language>this is single element list use: java final List<Element> updatedElements = Collections.singletoneList(mock(Element.class));</technical_language>

Target:
public void checkNotifyElementUpdatedAndListenerUpdated() { canvasHandler.addRegistrationListener(updateListener); final List<Element> updatedElements = Collections.singletonList(mock(Element.class)); canvasHandler.doBatchUpdate(updatedElements); verify(updateListener, times(1)).updateBatch(any()); }
Source:
<code>public Map<String, String> getJobMessageProperties() { List<storage_domains> storageDomains = getStorageDomainDAO().getAllForStorageDomain(getParameters().getSourceDomainId().getValue()); String sourceSDName = StringUtils.EMPTY; if (storageDomains.size() > 0) { sourceSDName = storageDomains.get(0).getstorage_name(); } if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put("sourcesd", sourceSDName); <START> jobProperties.put("targetsd", getStorageDomainName()); <END> if (ImageOperation.Move.equals(getParameters().getOperation())) { jobProperties.put("action", "Moving"); } else { jobProperties.put("action", "Copying"); } } return jobProperties; }</code><technical_language>please == comparing enums</technical_language>

Target:
public Map<String, String> getJobMessageProperties() { List<storage_domains> storageDomains = getStorageDomainDAO().getAllForStorageDomain(getParameters().getSourceDomainId().getValue()); String sourceSDName = StringUtils.EMPTY; if (storageDomains.size() > 0) { sourceSDName = storageDomains.get(0).getstorage_name(); } if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put("sourcesd", sourceSDName); jobProperties.put("targetsd", getStorageDomainName()); if (ImageOperation.Move == getParameters().getOperation()) { jobProperties.put("action", "Moving"); } else { jobProperties.put("action", "Copying"); } } return jobProperties; }
Source:
<code>private String key(final CreateContainerResponse container) throws IOException { final StringWriter writer = new StringWriter(); <START> IOUtil.copy( <END> this.client.copyFileFromContainerCmd( container.getId(), "/root/.ssh/id_rsa" ).exec(), writer ); final String key = writer.toString(); return key.substring(key.indexOf('-'), key.lastIndexOf('-') + 1); }</code><technical_language>@original-brownbear need IOUtil plexus? some special property need</technical_language>

Target:
private String key(final CreateContainerResponse container) throws IOException { final StringWriter writer = new StringWriter(); IOUtils.copy( this.client.copyFileFromContainerCmd( container.getId(), "/root/.ssh/id_rsa" ).exec(), writer ); final String key = writer.toString(); return key.substring(key.indexOf('-'), key.lastIndexOf('-') + 1); }
Source:
<code>protected void populateMileage(CuDisbursementVoucherDocument dvDocument, DisbursementVoucherNonEmployeeTravelXml nonEmployeeTravel) { dvDocument.getDvNonEmployeeTravel().setDisbVchrAutoRoundTripCode(convertStringToBoolean(nonEmployeeTravel.getRoundTripCode())); dvDocument.getDvNonEmployeeTravel().setDvPersonalCarMileageAmount(nonEmployeeTravel.getPersonalCarMileageAmount().intValue()); <START> KualiDecimal caluclatedMilageAmount = disbursementVoucherTravelService.calculateMileageAmount(dvDocument.getDvNonEmployeeTravel().getDvPersonalCarMileageAmount(), <END> dvDocument.getDvNonEmployeeTravel().getDvPerdiemStartDttmStamp()); dvDocument.getDvNonEmployeeTravel().setDisbVchrMileageCalculatedAmt(caluclatedMilageAmount); if (ObjectUtils.isNotNull(nonEmployeeTravel.getPersonalCarAmount())) { dvDocument.getDvNonEmployeeTravel().setDisbVchrPersonalCarAmount(nonEmployeeTravel.getPersonalCarAmount()); } else { dvDocument.getDvNonEmployeeTravel().setDisbVchrPersonalCarAmount(caluclatedMilageAmount); } }</code><technical_language>2 typos Milage => Mileage caluclated => calculated</technical_language>

Target:
protected void populateMileage(CuDisbursementVoucherDocument dvDocument, DisbursementVoucherNonEmployeeTravelXml nonEmployeeTravel) { dvDocument.getDvNonEmployeeTravel().setDisbVchrAutoRoundTripCode(convertStringToBoolean(nonEmployeeTravel.getRoundTripCode())); dvDocument.getDvNonEmployeeTravel().setDvPersonalCarMileageAmount(nonEmployeeTravel.getPersonalCarMileageAmount().intValue()); KualiDecimal calculatedMileageAmount = disbursementVoucherTravelService.calculateMileageAmount(dvDocument.getDvNonEmployeeTravel().getDvPersonalCarMileageAmount(), dvDocument.getDvNonEmployeeTravel().getDvPerdiemStartDttmStamp()); dvDocument.getDvNonEmployeeTravel().setDisbVchrMileageCalculatedAmt(calculatedMileageAmount); if (ObjectUtils.isNotNull(nonEmployeeTravel.getPersonalCarAmount())) { dvDocument.getDvNonEmployeeTravel().setDisbVchrPersonalCarAmount(nonEmployeeTravel.getPersonalCarAmount()); } else { dvDocument.getDvNonEmployeeTravel().setDisbVchrPersonalCarAmount(calculatedMileageAmount); } }
Source:
<code>public List<Partition> subPartitions(boolean refresh) { try { List<Partition> partitions; if (!refresh) { partitions = partitionInfoCache.getIfPresent(tableName); if (partitions != null) { return partitions; } } List<HRegionLocation> tableLocations = ((ClusterConnection) connection).locateRegions(tableName, !refresh, false); if (outdated(tableLocations)) { <START> tableLocations = ((ClusterConnection) connection).locateRegions(tableName, refresh, false); <END> } partitions = new ArrayList<>(tableLocations.size()); for (HRegionLocation location : tableLocations){ if (location.getServerName() == null) { continue; } HRegionInfo regionInfo = location.getRegionInfo(); partitions.add(new RangedClientPartition(this, regionInfo, new RLServer(location))); } partitionInfoCache.put(tableName, partitions); return partitions; } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>Is "false" explicitly variable "refresh" force cache</technical_language>

Target:
public List<Partition> subPartitions(boolean refresh) { try { List<Partition> partitions; if (!refresh) { partitions = partitionInfoCache.getIfPresent(tableName); if (partitions != null) { return partitions; } } List<HRegionLocation> tableLocations = ((ClusterConnection) connection).locateRegions(tableName, !refresh, false); if (outdated(tableLocations)) { tableLocations = ((ClusterConnection) connection).locateRegions(tableName, false, false); } partitions = new ArrayList<>(tableLocations.size()); for (HRegionLocation location : tableLocations){ if (location.getServerName() == null) { continue; } HRegionInfo regionInfo = location.getRegionInfo(); partitions.add(new RangedClientPartition(this, regionInfo, new RLServer(location))); } partitionInfoCache.put(tableName, partitions); return partitions; } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>private void createTopic(final String topic, final int partitionsNum, final int replicaFactor, final long retentionMs, final long rotationMs) throws TopicCreationException { try { doWithZkUtils(zkUtils -> { final Properties topicConfig = new Properties(); topicConfig.setProperty("retention.ms", Long.toString(retentionMs)); topicConfig.setProperty("segment.ms", Long.toString(rotationMs)); AdminUtils.createTopic(zkUtils, topic, partitionsNum, replicaFactor, topicConfig, <START> RackAwareMode.Enforced$.MODULE$); <END> }); } catch (final TopicExistsException e) { throw new TopicCreationException("Topic with name " + topic + " already exists (or wasn't completely removed yet)", e); } catch (final Exception e) { throw new TopicCreationException("Unable to create topic " + topic, e); } }</code><technical_language>reading this part of client code <LINK_0> understand change in behaviour RackAwareMode.Enforced. Do understand difference Safe, Disabled Enforced? clear for me</technical_language>

Target:
private void createTopic(final String topic, final int partitionsNum, final int replicaFactor, final long retentionMs, final long rotationMs) throws TopicCreationException { try { doWithZkUtils(zkUtils -> { final Properties topicConfig = new Properties(); topicConfig.setProperty("retention.ms", Long.toString(retentionMs)); topicConfig.setProperty("segment.ms", Long.toString(rotationMs)); AdminUtils.createTopic(zkUtils, topic, partitionsNum, replicaFactor, topicConfig, RackAwareMode.Enforced$.MODULE$); }); } catch (final TopicExistsException e) { throw new TopicCreationException("Topic with name " + topic + " already exists (or wasn't completely removed yet)", e); } catch (final Exception e) { throw new TopicCreationException("Unable to create topic " + topic, e); } final long timeoutMillis = TimeUnit.SECONDS.toMillis(5); final Boolean allowsConsumption = Retryer.executeWithRetry(() -> { try (Consumer<byte[], byte[]> consumer = kafkaFactory.getConsumer()) { return null != consumer.partitionsFor(topic); } }, new RetryForSpecifiedTimeStrategy<Boolean>(timeoutMillis) .withWaitBetweenEachTry(100L) .withResultsThatForceRetry(Boolean.FALSE)); if (!Boolean.TRUE.equals(allowsConsumption)) { throw new TopicCreationException("Failed to confirm topic creation within " + timeoutMillis + " millis"); } }
Source:
<code>public static String ingest(String data, String mimeType) { return given() .body(data) <START> .header("Content-Type", mimeType) <END> .expect() .statusCode(201) .when() .post(REST_PATH.getUrl()) .getHeader("id"); }</code><technical_language>Do constants need removed? TestCatalogValidation.java appears similar constants. Is in this test impacting classloader</technical_language>

Target:
public static String ingest(String data, String mimeType) { return given() .body(data) .header(HttpHeaders.CONTENT_TYPE, mimeType) .expect() .statusCode(HttpStatus.SC_CREATED) .when() .post(REST_PATH.getUrl()) .getHeader("id"); }
Source:
<code>public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; <START> return value != null ? value.equals(name.value) : name.value == null; <END> }</code><technical_language>Objects.equals(value, name.value)</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; return Objects.equals(value, name.value); }
Source:
<code>void fragmentAndReassembleData() { <START> System.out.println("original"); <END> ByteBuf frame = PayloadFrameFlyweight.encodeNextComplete(allocator, 2, DefaultPayload.create(data)); System.out.println(FrameUtil.toString(frame)); Publisher<ByteBuf> fragments = FrameFragmenter.fragmentFrame( allocator, 64, frame, FrameHeaderFlyweight.frameType(frame), false); FrameReassembler reassembler = new FrameReassembler(allocator); ByteBuf assembled = Flux.from(fragments) .doOnNext(byteBuf -> System.out.println(FrameUtil.toString(byteBuf))) .handle(reassembler::reassembleFrame) .blockLast(); System.out.println("assembled"); String s = FrameUtil.toString(assembled); System.out.println(s); Assert.assertEquals( FrameHeaderFlyweight.frameType(frame), FrameHeaderFlyweight.frameType(assembled)); Assert.assertEquals(frame.readableBytes(), assembled.readableBytes()); Assert.assertEquals(PayloadFrameFlyweight.data(frame), PayloadFrameFlyweight.data(assembled)); }</code><technical_language>delete</technical_language>

Target:
void fragmentAndReassembleData() { ByteBuf frame = PayloadFrameFlyweight.encodeNextComplete(allocator, 2, DefaultPayload.create(data)); System.out.println(FrameUtil.toString(frame)); Publisher<ByteBuf> fragments = FrameFragmenter.fragmentFrame( allocator, 64, frame, FrameHeaderFlyweight.frameType(frame), false); FrameReassembler reassembler = new FrameReassembler(allocator); ByteBuf assembled = Flux.from(fragments) .doOnNext(byteBuf -> System.out.println(FrameUtil.toString(byteBuf))) .handle(reassembler::reassembleFrame) .blockLast(); System.out.println("assembled"); String s = FrameUtil.toString(assembled); System.out.println(s); Assert.assertEquals( FrameHeaderFlyweight.frameType(frame), FrameHeaderFlyweight.frameType(assembled)); Assert.assertEquals(frame.readableBytes(), assembled.readableBytes()); Assert.assertEquals(PayloadFrameFlyweight.data(frame), PayloadFrameFlyweight.data(assembled)); }
Source:
<code>public Optional<AttributeValidationReport> validate(Attribute attribute) { if (attribute == null || CollectionUtils.isEmpty(validators)) { return Optional.empty(); } <START> List<Serializable> serializables = attribute.getValues(); <END> List<Optional<AttributeValidationReport>> resultValidationReportList = new ArrayList<>(); for (Serializable serializable : serializables) { List<Optional<AttributeValidationReport>> validationReportList = validateAttributeSerializable(attribute.getName(), serializable); if (validationReportList.size() == validators.size()) { resultValidationReportList.addAll(validationReportList); } } return generateValidationReports(resultValidationReportList); }</code><technical_language>nit: serializables? is attributeValues values something..</technical_language>

Target:
public Optional<AttributeValidationReport> validate(Attribute attribute) { if (attribute == null || CollectionUtils.isEmpty(validators)) { return Optional.empty(); } List<Serializable> attributeValues = attribute.getValues(); List<AttributeValidationReport> resultValidationReportList = new ArrayList<>(); for (Serializable serializable : attributeValues) { List<AttributeValidationReport> validationReportList = validateAttributeSerializable(attribute.getName(), serializable); if (validationReportList.size() == validators.size()) { resultValidationReportList.addAll(validationReportList); } } return generateValidationReports(resultValidationReportList); }
Source:
<code>public void setEnabled(Object evaluationContext) { if (evaluationContext instanceof IEvaluationContext) { IEvaluationContext ctx = (IEvaluationContext) evaluationContext; Object selection = getSelection(ctx); if (selection instanceof ISelection) { <START> Repository repo = extractRepository((ISelection) selection, getActiveEditorInput(ctx)); <END> if (repo != null) { boolean enabled = isEnabledForState(repo, repo.getRepositoryState()); setBaseEnabled(enabled); } else setBaseEnabled(false); return; } } setBaseEnabled(true); }</code><technical_language>style nit: replace tab "selection," a space</technical_language>

Target:
public void setEnabled(Object evaluationContext) { if (evaluationContext instanceof IEvaluationContext) { IEvaluationContext ctx = (IEvaluationContext) evaluationContext; Object selection = getSelection(ctx); if (selection instanceof ISelection) { Repository repo = getRepository((ISelection) selection, getActiveEditorInput(ctx)); if (repo != null) { boolean enabled = isEnabledForState(repo, repo.getRepositoryState()); setBaseEnabled(enabled); } else setBaseEnabled(false); return; } } setBaseEnabled(true); }
Source:
<code>public boolean add(long pageId) { assert pageId != 0L; if (size >= MAX_SIZE) return false; <START> int stripeIdx = (int)pageId & (STRIPES_COUNT - 1); <END> synchronized (stripeLocks[stripeIdx]) { if (size >= MAX_SIZE) return false; GridLongList stripe = stripes[stripeIdx]; if (stripe == null) stripes[stripeIdx] = stripe = new GridLongList(MAX_SIZE / STRIPES_COUNT); if (stripe.size() >= MAX_SIZE / STRIPES_COUNT) return false; else { stripe.add(pageId); sizeUpdater.incrementAndGet(this); return true; } } }</code><technical_language>a redundant check. exists a stripe size check lock</technical_language>

Target:
public boolean add(long pageId) { assert pageId != 0L; if (size >= MAX_SIZE) return false; int stripeIdx = (int)pageId & (STRIPES_COUNT - 1); synchronized (stripeLocks[stripeIdx]) { GridLongList stripe = stripes[stripeIdx]; if (stripe == null) stripes[stripeIdx] = stripe = new GridLongList(MAX_SIZE / STRIPES_COUNT); if (stripe.size() >= MAX_SIZE / STRIPES_COUNT) return false; else { stripe.add(pageId); sizeUpdater.incrementAndGet(this); return true; } } }
Source:
<code>protected void replaceAttributeExpressionWithValue(final StringBuilder container, final String attributeName, final String value) { <START> final Pattern patternWithAttributeName = Pattern.compile("\\[" + ATTRIBUTE_KEY + "." + attributeName + "\\]"); <END> final Matcher matcher = patternWithAttributeName.matcher(container.toString()); while (matcher.find()) { container.replace(matcher.start(), matcher.end(), value); } }</code><technical_language>@nahuel-soldevilla Thanks for reviewing this! I agree, Pattern.compile a performance impact if is called multiple times. I decided improve code do literal replacements instead of regex avoid creating Pattern Matcher objects</technical_language>

Target:
protected void replaceAttributeExpressionWithValue(final StringBuilder container, final String attributeName, final String value) { final String key = "[" + ATTRIBUTE_KEY + "." + attributeName + "]"; int start = container.indexOf(key, 0); while (start > -1) { int end = start + key.length(); int nextSearchStart = start + value.length(); container.replace(start, end, value); start = container.indexOf(key, nextSearchStart); } }
Source:
<code>private void calculateSuffix() { try { fValue = getLiteral(); switch (fKind) { case lk_float_constant: case lk_integer_constant: { int offset = (fValue[0] == '.' ? afterDecimalPoint(0) : integerLiteral()); if (offset == 0) { fHasNumericalSuffix = true; } else { fSuffix = CharArrayUtils.subarray(fValue, offset, -1); switch <START> (new String(fSuffix).toLowerCase()) { <END> case "u": case "f": case "l": case "ul": case "lu": case "ll": case "ull": case "llu": fHasNumericalSuffix = true; break; } if (!fHasNumericalSuffix) { fValue = CharArrayUtils.subarray(fValue, 0, offset); } } } break; case lk_string_literal: { final int offset = CharArrayUtils.lastIndexOf('"', fValue, CharArrayUtils.indexOf('"', fValue) + 1); if (offset > 0) { fSuffix = CharArrayUtils.subarray(fValue, offset + 1, -1); fValue = CharArrayUtils.subarray(fValue, 0, fValue.length - fSuffix.length); } } break; case lk_char_constant: { final int offset = CharArrayUtils.lastIndexOf('\'', fValue, CharArrayUtils.indexOf('\'', fValue) + 1); if (offset > 0) { fSuffix = CharArrayUtils.subarray(fValue, offset + 1, -1); fValue = CharArrayUtils.subarray(fValue, 0, fValue.length - fSuffix.length); } } break; } } catch (ArrayIndexOutOfBoundsException e) { } }</code><technical_language>Instead of creating additional objects, is preferable case-insensitive comparison</technical_language>

Target:
private void calculateSuffix() { try { fValue = getRawValue(); int offset = 0; switch (fKind) { case lk_float_constant: case lk_integer_constant: offset = (fValue[0] == '.' ? afterDecimalPoint(0) : integerLiteral()); break; case lk_string_literal: offset = CharArrayUtils.lastIndexOf('"', fValue, CharArrayUtils.indexOf('"', fValue) + 1) + 1; break; case lk_char_constant: offset = CharArrayUtils.lastIndexOf('\'', fValue, CharArrayUtils.indexOf('\'', fValue) + 1) + 1; break; } if (offset > 0) { fSuffix = CharArrayUtils.subarray(fValue, offset, -1); fValue = CharArrayUtils.subarray(fValue, 0, fValue.length - fSuffix.length); } } catch (ArrayIndexOutOfBoundsException e) { } }
Source:
<code>public boolean processReconfig(QuorumVerifier qv, Long suggestedLeaderId, Long zxid, boolean restartLE) { InetSocketAddress oldClientAddr = getClientAddress(); boolean isReconfigEnabled = QuorumPeerConfig.isReconfigEnabled(); <START> QuorumVerifier prevQV = setQuorumVerifier(qv, isReconfigEnabled); <END> if (!isReconfigEnabled) { return false; } initConfigInZKDatabase(); if (prevQV.getVersion() < qv.getVersion() && !prevQV.equals(qv)) { Map<Long, QuorumServer> newMembers = qv.getAllMembers(); updateRemotePeerMXBeans(newMembers); if (restartLE) restartLeaderElection(prevQV, qv); QuorumServer myNewQS = newMembers.get(getId()); if (myNewQS != null && myNewQS.clientAddr != null && !myNewQS.clientAddr.equals(oldClientAddr)) { cnxnFactory.reconfigure(myNewQS.clientAddr); updateThreadName(); } boolean roleChange = updateLearnerType(qv); boolean leaderChange = false; if (suggestedLeaderId != null) { leaderChange = updateVote(suggestedLeaderId, zxid); } else { long currentLeaderId = getCurrentVote().getId(); QuorumServer myleaderInCurQV = prevQV.getVotingMembers().get(currentLeaderId); QuorumServer myleaderInNewQV = qv.getVotingMembers().get(currentLeaderId); leaderChange = (myleaderInCurQV == null || myleaderInCurQV.addr == null || myleaderInNewQV == null || !myleaderInCurQV.addr.equals(myleaderInNewQV.addr)); reconfigFlagClear(); } if (roleChange || leaderChange) { return true; } } return false; }</code><technical_language>server acts config in quorum verifier, if this line is executed server syncs leader, setting quorum verifier overwrites config file settings leader's settings</technical_language>

Target:
public boolean processReconfig(QuorumVerifier qv, Long suggestedLeaderId, Long zxid, boolean restartLE) { if (!QuorumPeerConfig.isReconfigEnabled()) { LOG.debug("Reconfig feature is disabled, skip reconfig processing."); return false; } InetSocketAddress oldClientAddr = getClientAddress(); QuorumVerifier prevQV = setQuorumVerifier(qv, true); initConfigInZKDatabase(); if (prevQV.getVersion() < qv.getVersion() && !prevQV.equals(qv)) { Map<Long, QuorumServer> newMembers = qv.getAllMembers(); updateRemotePeerMXBeans(newMembers); if (restartLE) restartLeaderElection(prevQV, qv); QuorumServer myNewQS = newMembers.get(getId()); if (myNewQS != null && myNewQS.clientAddr != null && !myNewQS.clientAddr.equals(oldClientAddr)) { cnxnFactory.reconfigure(myNewQS.clientAddr); updateThreadName(); } boolean roleChange = updateLearnerType(qv); boolean leaderChange = false; if (suggestedLeaderId != null) { leaderChange = updateVote(suggestedLeaderId, zxid); } else { long currentLeaderId = getCurrentVote().getId(); QuorumServer myleaderInCurQV = prevQV.getVotingMembers().get(currentLeaderId); QuorumServer myleaderInNewQV = qv.getVotingMembers().get(currentLeaderId); leaderChange = (myleaderInCurQV == null || myleaderInCurQV.addr == null || myleaderInNewQV == null || !myleaderInCurQV.addr.equals(myleaderInNewQV.addr)); reconfigFlagClear(); } if (roleChange || leaderChange) { return true; } } return false; }
Source:
<code>public void processMessageShouldNotSendFirmwareFileRequestWhenFirmwareFileAvailable() throws JMSException { final String firmwareIdentification = "unavailable"; final ObjectMessage message = new ObjectMessageBuilder().withObject(firmwareIdentification).build(); when(this.firmwareService.isFirmwareFileAvailable(firmwareIdentification)).thenReturn(true); this.processor.processMessage(message); <START> verify(this.osgpRequestMessageSender, times(0)).send(any(RequestMessage.class), any(String.class), <END> any(MessageMetadata.class)); }</code><technical_language>times(0) -></technical_language>

Target:
public void processMessageShouldNotSendFirmwareFileRequestWhenFirmwareFileAvailable() throws JMSException { final String firmwareIdentification = "unavailable"; final ObjectMessage message = new ObjectMessageBuilder().withObject(firmwareIdentification).build(); when(this.firmwareService.isFirmwareFileAvailable(firmwareIdentification)).thenReturn(true); this.processor.processMessage(message); verify(this.osgpRequestMessageSender, never()).send(any(RequestMessage.class), any(String.class), any(MessageMetadata.class)); }
Source:
<code>public void start(BundleContext context) throws Exception { super.start(context); setDefault(this); <START> TmfAnalysisManager.initializeModuleSources(); <END> }</code><technical_language>this in tmf.core.Activator now. this plugin depends tmf.core, loaded. Is this necessary call this again</technical_language>

Target:
public void start(BundleContext context) throws Exception { super.start(context); setDefault(this); }