auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public final synchronized JaxRsClientFactory addFeatureToGroup(JaxRsFeatureGroup group, Class<? extends Feature>... features) { Preconditions.checkState(!started, "Already started building clients"); classFeatureMap.putAll(group, Arrays.asList(features)); <START> LOG.trace("Group registers feature {}", group, features); <END> return this; }</code><technical_language>"registers feature**s**", maybe</technical_language>

Target:
public final synchronized JaxRsClientFactory addFeatureToGroup(JaxRsFeatureGroup group, Class<? extends Feature>... features) { Preconditions.checkState(!started, "Already started building clients"); classFeatureMap.putAll(group, Arrays.asList(features)); LOG.trace("Group registers features {}", group, features); return this; }
Source:
<code>public Mono<Void> send(Flux<?> flux) { MonoProcessor<Void> sendResult = MonoProcessor.create(); <START> disposable = flux <END> .doOnError(e -> this.log.error("Error during processing: ", e)) .retry() .subscribe( consumer, sendResult::onError, sendResult::onComplete); return sendResult; }</code><technical_language>this. Checkstyle is in charge this project not</technical_language>

Target:
public Mono<Void> send(Flux<?> flux) { MonoProcessor<Void> sendResult = MonoProcessor.create(); this.disposable = flux .doOnError(e -> this.log.error("Error during processing: ", e)) .retry() .subscribe( this.consumer, sendResult::onError, sendResult::onComplete); return sendResult; }
Source:
<code>public void testClassicComparisonVsRange() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("classicComparisonVsRange.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "Drawing 1"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); <START> Random random = new Random(); <END> for (int i = 1; i <= 100; i++) { BigDecimal value = new BigDecimal(random.nextInt(101)); BigDecimal threshold = new BigDecimal(random.nextInt(101)); String expectedResult = value.compareTo(threshold) >= 0 ? "At or Above threshold" : "Lower than threshold"; LOG.info("Execution value threshold expectedResult {}", i, value, threshold, expectedResult); final DMNContext context = DMNFactory.newContext(); context.set("value", value); context.set("threshold", threshold); final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("classic comparison").getResult(), is(expectedResult)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("using range").getResult(), is(expectedResult)); } }</code><technical_language>This bring inconsistencies test in case of a potential bug. I some bug related some specific similar</technical_language>

Target:
public void testClassicComparisonVsRange() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("classicComparisonVsRange.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "Drawing 1"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); for (int i = 1; i <= 10; i++) { for (int j = 1; j <= 10; j++) { BigDecimal value = new BigDecimal(i); BigDecimal threshold = new BigDecimal(j); String expectedResult = value.compareTo(threshold) >= 0 ? "At or Above threshold" : "Lower than threshold"; LOG.info("Execution value threshold expectedResult {}", i, value, threshold, expectedResult); final DMNContext context = DMNFactory.newContext(); context.set("value", value); context.set("threshold", threshold); final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("classic comparison").getResult(), is(expectedResult)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("using range").getResult(), is(expectedResult)); } } }
Source:
<code>public RequestIdPolicy() { <START> requestIdSupplier = null; <END> }</code><technical_language>Instead of setting this null insert a default supplier replicates current functionality? need do initial null check applying policy</technical_language>

Target:
public RequestIdPolicy() { requestIdSupplier = () -> new HttpHeaders().put(REQUEST_ID_HEADER, UUID.randomUUID().toString()); }
Source:
<code>public RemoteInvocationAwareMessageConverterAdapter(MessageConverter delegate) { Assert.notNull(delegate, "'delegate' converter cannot be null"); <START> this.delegate = delegate; <END> }</code><technical_language>defaultMessageConverter is needed constructing this provided converter. a boolean field instead, setBeanClassLoader works if default converter</technical_language>

Target:
public RemoteInvocationAwareMessageConverterAdapter(MessageConverter delegate) { Assert.notNull(delegate, "'delegate' converter cannot be null"); this.delegate = delegate; this.shouldSetClassLoader = false; }
Source:
<code>public String toString() { <START> return "TransactionImp{" + <END> "xid=" + xid + ", status=" + Util.transactionStatusToString(status) + '}'; }</code><technical_language>Missing l</technical_language>

Target:
public String toString() { return "TransactionImpl{" + "xid=" + xid + ", status=" + Util.transactionStatusToString(status) + '}'; }
Source:
<code>public void run() { long startTime = System.currentTimeMillis(); try { mimeMsg = mailSender.createMimeMessage(); msg = new MimeMessageHelper(mimeMsg, MimeMessageHelper.MULTIPART_MODE_MIXED); } catch (MessagingException e) { log.error("Failed to send email to " + userEmail + " for update " + importFile.getAbsolutePath(), e); } try { initializeXMLReader(); processUpdates(); log.info("Finished metadata import for objects in {}ms for user {}", new Object[] {objectCount, System.currentTimeMillis() - startTime, username}); sendCompletedEmail(updated, failed); <START> } catch (FileNotFoundException | XMLStreamException e) { <END> log.info("Errors reading XML during update " + username, e); failed.put(importFile.getAbsolutePath(), "The import file contains XML errors"); sendValidationFailureEmail(failed); } catch (UpdateException e) { log.error("Submitted document is not a bulk-metadata-update doc"); failed.put(importFile.getAbsolutePath(), "File is not a bulk-metadata-update doc"); sendValidationFailureEmail(failed); } finally { close(); cleanup(); } }</code><technical_language>I FileNotFoundException grouped (I before). If file found, some kind of server error, temp file deleted. get logged log.error level</technical_language>

Target:
public void run() { long startTime = System.currentTimeMillis(); try { mimeMsg = mailSender.createMimeMessage(); msg = new MimeMessageHelper(mimeMsg, MimeMessageHelper.MULTIPART_MODE_MIXED); } catch (MessagingException e) { log.error("Failed to send email to " + userEmail + " for update " + importFile.getAbsolutePath(), e); } try { initializeXMLReader(); processUpdates(); log.info("Finished metadata import for objects in {}ms for user {}", new Object[] {objectCount, System.currentTimeMillis() - startTime, username}); sendCompletedEmail(updated, failed); } catch (XMLStreamException e) { log.info("Errors reading XML during update " + username, e); failed.put(importFile.getAbsolutePath(), "The import file contains XML errors"); sendValidationFailureEmail(failed); } catch (UpdateException e) { log.error("Submitted document is not a bulk-metadata-update doc"); failed.put(importFile.getAbsolutePath(), "File is not a bulk-metadata-update doc"); sendValidationFailureEmail(failed); } catch (FileNotFoundException e) { log.error("The import file could not be found on the server"); failed.put(importFile.getAbsolutePath(), "Import file could not be found on the server"); sendValidationFailureEmail(failed); } finally { close(); cleanup(); } }
Source:
<code>private void activateActionHandler(String actionDefinitionID) { if (PlatformUI.isWorkbenchRunning()) { setActionDefinitionId(actionDefinitionID); @SuppressWarnings("cast") IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage().getActivePart().getSite() .getService(IHandlerService.class); if (handlerService != null) { <START> handlerService.activateHandler(actionDefinitionID, new ActionHandler(this)); <END> } } }</code><technical_language>Handlers activated need manually deactivated. Please a reference token this returns call deactivateHandler dispose time</technical_language>

Target:
private void activateActionHandler(String actionDefinitionID) { if (PlatformUI.isWorkbenchRunning()) { setActionDefinitionId(actionDefinitionID); final IHandlerService handlerService = getHandlerService(); if (handlerService != null) { activatedHandler = handlerService.activateHandler(actionDefinitionID, new ActionHandler(this)); } } }
Source:
<code><START> private void openFileSystemsInBackground() throws CaseActionCancelledException { <END> if (backgroundOpenFileSystemsFuture != null && !backgroundOpenFileSystemsFuture.isDone()) { backgroundOpenFileSystemsFuture.cancel(true); } BackgroundOpenFileSystemsTask backgroundTask = new BackgroundOpenFileSystemsTask(this.caseDb, new LoggingProgressIndicator()); backgroundOpenFileSystemsFuture = startIngestJobsExecutor.submit(backgroundTask); }</code><technical_language>This method throw type of exceptions</technical_language>

Target:
private void openFileSystemsInBackground() { if (backgroundOpenFileSystemsFuture != null && !backgroundOpenFileSystemsFuture.isDone()) { backgroundOpenFileSystemsFuture.cancel(true); } BackgroundOpenFileSystemsTask backgroundTask = new BackgroundOpenFileSystemsTask(this.caseDb, new LoggingProgressIndicator()); backgroundOpenFileSystemsFuture = openFileSystemsExecutor.submit(backgroundTask); }
Source:
<code>public CachePartitionFullCountersMap(CachePartitionFullCountersMap other) { if(other.initialUpdCntrs != null) initialUpdCntrs = Arrays.copyOf(other.initialUpdCntrs, other.initialUpdCntrs.length); <START> if(updCntrs != null) <END> updCntrs = Arrays.copyOf(other.updCntrs, other.updCntrs.length); }</code><technical_language>other.updCntrs</technical_language>

Target:
public CachePartitionFullCountersMap(CachePartitionFullCountersMap other) { if (other.initialUpdCntrs != null) initialUpdCntrs = Arrays.copyOf(other.initialUpdCntrs, other.initialUpdCntrs.length); if (other.updCntrs != null) updCntrs = Arrays.copyOf(other.updCntrs, other.updCntrs.length); }
Source:
<code>public O compute2(final I kernel, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); <START> final Interval kernelConvolutionInterval = ops().filter() <END> .paddingIntervalCentered(kernel, paddedFFTMethodsInputDimensions); final Interval kernelConvolutionIntervalOrigin = ops().filter() .paddingIntervalOrigin(kernel, kernelConvolutionInterval); return (O) Views.interval(Views.extendPeriodic(Views.interval(Views .extendValue(kernel, Util.getTypeFromInterval(kernel).createVariable()), kernelConvolutionInterval)), kernelConvolutionIntervalOrigin); }</code><technical_language>initialize</technical_language>

Target:
public O compute2(final I kernel, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); final Interval kernelConvolutionInterval = paddingIntervalCentered.compute2( kernel, paddedFFTMethodsInputDimensions); final Interval kernelConvolutionIntervalOrigin = paddingIntervalOrigin .compute2(kernel, kernelConvolutionInterval); return (O) Views.interval(Views.extendPeriodic(Views.interval(Views .extendValue(kernel, Util.getTypeFromInterval(kernel).createVariable()), kernelConvolutionInterval)), kernelConvolutionIntervalOrigin); }
Source:
<code>public void testEnsureSize() { assertEquals(ensureSize(null, 42).length(), 42); Slice fourBytes = wrappedBuffer(new byte[] {1, 2, 3, 4}); assertSame(ensureSize(fourBytes, 3), fourBytes); Slice slice = ensureSize(fourBytes, 8); assertEquals(slice.length(), 8); assertEquals(slice.getBytes(), new byte[] {1, 2, 3, 4, 0, 0, 0, 0}); slice = ensureSize(fourBytes, 5); assertEquals(slice.length(), 8); assertEquals(slice.getBytes(), new byte[] {1, 2, 3, 4, 0, 0, 0, 0}); <START> slice = ensureSize(allocate(Integer.MAX_VALUE - 100), Integer.MAX_VALUE - 50); <END> assertEquals(slice.length(), Slices.MAX_ARRAY_SIZE); }</code><technical_language>Integer.MAX_VALUE / SLICE_ALLOW_SKEW + 100 instead of allocate(Integer.MAX_VALUE - 100). pass (but not)</technical_language>

Target:
public void testEnsureSize() { Slice fourBytes = wrappedBuffer(new byte[] {1, 2, 3, 4}); assertEquals(ensureSize(null, 42).length(), 42); assertSame(ensureSize(fourBytes, 3), fourBytes); assertEquals(ensureSize(fourBytes, 8), wrappedBuffer(new byte[] {1, 2, 3, 4, 0, 0, 0, 0})); assertEquals(ensureSize(fourBytes, 5), wrappedBuffer(new byte[] {1, 2, 3, 4, 0, 0, 0, 0})); double initialSize = Integer.MAX_VALUE + 100L; while (initialSize > 50_000_000 && initialSize / SLICE_ALLOW_SKEW > SLICE_ALLOC_THRESHOLD) { initialSize /= SLICE_ALLOW_SKEW; } assertEquals(ensureSize(allocate((int) initialSize), Integer.MAX_VALUE - 50).length(), MAX_ARRAY_SIZE); }
Source:
<code>public TestProject(final boolean remove, String path, boolean insidews, File workspaceSupplement) throws CoreException { this.workspaceSupplement = workspaceSupplement; IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProjectDescription description = createDescription(path, insidews, root); project = root.getProject(description.getName()); if (remove) { deleteProject(); } IPath locationBefore = null; URI locationURI = description.getLocationURI(); if (locationURI != null) { locationBefore = URIUtil.toPath(locationURI); } if (locationBefore == null) { locationBefore = root.getRawLocation().append(path); } location = locationBefore.toOSString(); project.create(description, null); project.open(null); <START> javaProject = JavaCore.create(project); <END> binFolder = createBinFolder(); setJavaNature(); javaProject.setRawClasspath(new IClasspathEntry[0], null); createOutputFolder(binFolder); addSystemLibraries(); }</code><technical_language>Oh. This creates a Java project. JavaProjectTester. Note other places Java projects switch autobuilding. this project need a Java project? tests need that</technical_language>

Target:
public TestProject(final boolean remove, String path, boolean insidews, File workspaceSupplement) throws CoreException { this.workspaceSupplement = workspaceSupplement; IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProjectDescription description = createDescription(path, insidews, root); project = root.getProject(description.getName()); if (remove) { TestUtils.deleteProject(project); } IPath locationBefore = null; URI locationURI = description.getLocationURI(); if (locationURI != null) { locationBefore = URIUtil.toPath(locationURI); } if (locationBefore == null) { locationBefore = root.getRawLocation().append(path); } location = locationBefore.toOSString(); project.create(description, null); project.open(null); javaProject = JavaCore.create(project); binFolder = createBinFolder(); setJavaNature(); javaProject.setRawClasspath(new IClasspathEntry[0], null); createOutputFolder(binFolder); addSystemLibraries(); }
Source:
<code><START> public MetricsEndpoint(MeterRegistryService meterRegistryService) { <END> LOGGER.debug("Starting Metrics endpoint..."); if (meterRegistryService == null) { LOGGER.warn("MeterRegistryService is null!"); } this.meterRegistryService = meterRegistryService; }</code><technical_language>meterRegistryService annotated @Nullable</technical_language>

Target:
public MetricsEndpoint(MeterRegistryService meterRegistryService) { LOGGER.debug("Starting Metrics endpoint..."); Validate.notNull(meterRegistryService, "Argument meterRegistryService cannot be null"); this.meterRegistryService = meterRegistryService; }
Source:
<code>private List<Pipeline> fetchHydratedPipelines() { List<Pipeline> rawPipelines = front50.getPipelines(); if (rawPipelines == null) { return Collections.EMPTY_LIST; } <START> Map<Boolean, List<Pipeline>> partitionedByTemplated = rawPipelines.stream() <END> .collect(Collectors.partitioningBy(p -> p.getType() != null && p.getType().equals("templatedPipeline"))); List<Pipeline> templatedPipelines = partitionedByTemplated.get(Boolean.TRUE); Map<Boolean, List<Pipeline>> partitionedByV2Schema = templatedPipelines.stream() .filter(p -> p.getSchema() != null) .collect(Collectors.partitioningBy(p -> p.getSchema().equals("v2"))); List<Pipeline> v2Templated = partitionedByV2Schema.get(Boolean.TRUE); List<Pipeline> v1Templated = partitionedByV2Schema.get(Boolean.FALSE); List<Pipeline> plannedV1Templated = v1Templated.stream().filter(Objects::nonNull) .map(p -> orca.plan(objectMapper.convertValue(p, Map.class), false)) .map(m -> objectMapper.convertValue(m, Pipeline.class)) .collect(Collectors.toList()); List<Pipeline> plannedV2Templated = v2Templated.stream().filter(Objects::nonNull) .map(p -> orca.v2Plan(objectMapper.convertValue(p, Map.class))) .map(m -> objectMapper.convertValue(m, Pipeline.class)) .collect(Collectors.toList()); rawPipelines = partitionedByTemplated.get(Boolean.FALSE); rawPipelines.addAll(plannedV1Templated); rawPipelines.addAll(plannedV2Templated); return rawPipelines; }</code><technical_language>clearer avoid partitioning write a pipeline hydrator is a no-op for non-templated pipelines, correctly handles v1 v2 templated pipelines. This is effectively that, harder follow logic, dropping some pipelines</technical_language>

Target:
private List<Pipeline> fetchHydratedPipelines() { List<Map<String, Object>> rawPipelines = front50.getPipelines(); if (rawPipelines == null) { return Collections.emptyList(); } Predicate<Map<String, Object>> isV2Pipeline = p -> { return p.getOrDefault("type", "").equals("templatedPipeline") && p.getOrDefault("schema", "").equals("v2"); }; return rawPipelines.stream() .map((Map<String, Object> p) -> { if (isV2Pipeline.test(p)) { try { return orca.v2Plan(p); } catch (Exception e) { log.error("Caught exception while planning templated pipeline: {}", p, e); return Collections.emptyMap(); } } else { return p; } }) .filter(m -> !m.isEmpty()) .map(m -> objectMapper.convertValue(m, Pipeline.class)) .collect(Collectors.toList()); }
Source:
<code>public Long getPeerRouterId(String publicMacAddress, final long routerId) { final SearchCriteria<NicVO> sc = PeerRouterSearch.create(); sc.setParameters("instanceId", routerId); sc.setParameters("macAddress", publicMacAddress); sc.setParameters("vmType", VirtualMachine.Type.DomainRouter); NicVO nicVo = findOneBy(sc); if (nicVo != null) { <START> return (new Long(nicVo.getInstanceId())); <END> } return null; }</code><technical_language>auto-boxing auto-unboxing do this for you. do this manually pool of String/numbers of java used. need return nicVo.getInstanceId()</technical_language>

Target:
public Long getPeerRouterId(String publicMacAddress, final long routerId) { final SearchCriteria<NicVO> sc = PeerRouterSearch.create(); sc.setParameters("instanceId", routerId); sc.setParameters("macAddress", publicMacAddress); sc.setParameters("vmType", VirtualMachine.Type.DomainRouter); NicVO nicVo = findOneBy(sc); if (nicVo != null) { return nicVo.getInstanceId(); } return null; }
Source:
<code>public SemanticApiReporter(SemanticMetricRegistry registry) { final MetricId base = MetricId.build().tagged("component", COMPONENT); sliQueryLatencyForSmallQueries = registry.histogram( <START> base.tagged("what", "sli-query-latency-for-small-queries", "unit", Units.MILLISECOND)); <END> }</code><technical_language>this is a bit of a handful, small-query-latency</technical_language>

Target:
public SemanticApiReporter(SemanticMetricRegistry registry) { final MetricId base = MetricId.build().tagged("component", COMPONENT); smallQueryLatency = registry.histogram( base.tagged("what", "small-query-latency", "unit", Units.MILLISECOND)); }
Source:
<code><START> public B setRyaPrefix(String prefix) { <END> Preconditions.checkNotNull(prefix, "Rya prefix cannot be null."); this.prefix = prefix; return confBuilder(); }</code><technical_language>a consistent method naming paradigm class. I this is setter "set" start. of set, of them. This a good opportunity change "rya prefix" "rya instance name" prefix is Accumulo specific</technical_language>

Target:
public B setRyaPrefix(String prefix) { this.prefix = prefix; return confBuilder(); }
Source:
<code>public ServiceBuilder<RemoteCacheContainer> build(ServiceTarget target) { <START> Function<RemoteCacheManager, RemoteCacheContainer> mapper = remoteCacheManager -> new ManagedRemoteCacheContainer(this.name, remoteCacheManager); <END> Supplier<RemoteCacheManager> supplier = () -> { Configuration configuration = this.configuration.getValue(); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration); remoteCacheManager.start(); InfinispanLogger.ROOT_LOGGER.debugf("%s remote cache container started", this.name); return remoteCacheManager; }; Consumer<RemoteCacheManager> destroyer = remoteCacheManager -> { remoteCacheManager.stop(); InfinispanLogger.ROOT_LOGGER.debugf("%s remote cache container stopped", this.name); }; Service<RemoteCacheContainer> service = new SuppliedValueService<>(mapper, supplier, destroyer); ServiceBuilder<RemoteCacheContainer> builder = target.addService(this.getServiceName(), service) .setInitialMode(ServiceController.Mode.ON_DEMAND) ; return this.configuration.register(builder); }</code><technical_language>remove this lambda RemoteCacheContainerBuilder implement Function<RemoteCacheManager, RemoteCacheContainer></technical_language>

Target:
public ServiceBuilder<RemoteCacheContainer> build(ServiceTarget target) { Service<RemoteCacheContainer> service = new SuppliedValueService<>(this, this, this); ServiceBuilder<RemoteCacheContainer> builder = new AsynchronousServiceBuilder<>(this.getServiceName(), service).build(target) .setInitialMode(ServiceController.Mode.ON_DEMAND); return this.configuration.register(builder); }
Source:
<code>private boolean removeMemoryVolumes(String memVols) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() != NUM_OF_UUIDS_IN_MEMORY_STATE) { log.warn("Cannot remove memory volumes, invalid format '{}'", memVols); return true; } Guid memoryImageRemovalTaskId = removeMemoryImage(guids); if (memoryImageRemovalTaskId == null) { return false; } Guid confImageRemovalTaskId = removeConfImage(guids); if (startPollingTasks) { if (!Guid.Empty.equals(memoryImageRemovalTaskId)) { <START> enclosingCommand.getCommandCoordinatorUtil().startPollingTask(memoryImageRemovalTaskId); <END> } if (confImageRemovalTaskId != null && !Guid.Empty.equals(confImageRemovalTaskId)) { enclosingCommand.getCommandCoordinatorUtil().startPollingTask(confImageRemovalTaskId); } } return confImageRemovalTaskId != null; }</code><technical_language>inject util this command, please pass commands</technical_language>

Target:
private boolean removeMemoryVolumes(String memVols) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() != NUM_OF_UUIDS_IN_MEMORY_STATE) { log.warn("Cannot remove memory volumes, invalid format '{}'", memVols); return true; } Guid memoryImageRemovalTaskId = removeMemoryImage(guids); if (memoryImageRemovalTaskId == null) { return false; } Guid confImageRemovalTaskId = removeConfImage(guids); if (startPollingTasks) { if (!Guid.Empty.equals(memoryImageRemovalTaskId)) { commandCoordinatorUtil.startPollingTask(memoryImageRemovalTaskId); } if (confImageRemovalTaskId != null && !Guid.Empty.equals(confImageRemovalTaskId)) { commandCoordinatorUtil.startPollingTask(confImageRemovalTaskId); } } return confImageRemovalTaskId != null; }
Source:
<code>public boolean hasNamedParameter() { <START> for (ParameterBinding binding : bindings) { <END> if (binding.getName() != null) { return true; } } return false; }</code><technical_language>bindings.stream( ).anyMatch( )</technical_language>

Target:
public boolean hasNamedParameter() { return bindings.stream() .anyMatch(b -> b.getName() != null); }
Source:
<code>private void initializeHandler(final Thing thing) { ThingType thingType = thingTypeRegistry.getThingType(thing.getThingTypeUID()); <START> ThingFactoryHelper.applyDefaultConfiguration(thing.getConfiguration(), thingType, configDescriptionRegistry); <END> if (isInitializable(thing, thingType)) { ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.INITIALIZING, ThingStatusDetail.NONE); setThingStatus(thing, statusInfo); initializeHandler(thing, thing.getHandler()); } else { logger.debug("Thing '{}' not initializable, check required configuration parameters.", thing.getUID()); ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_CONFIGURATION_PENDING); setThingStatus(thing, statusInfo); } }</code><technical_language>This call lead NPE if type is for thing</technical_language>

Target:
private void initializeHandler(final Thing thing) { ThingType thingType = thingTypeRegistry.getThingType(thing.getThingTypeUID()); if (thingType != null) { ThingFactoryHelper.applyDefaultConfiguration(thing.getConfiguration(), thingType, configDescriptionRegistry); } if (isInitializable(thing, thingType)) { ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.INITIALIZING, ThingStatusDetail.NONE); setThingStatus(thing, statusInfo); initializeHandler(thing, thing.getHandler()); } else { logger.debug("Thing '{}' not initializable, check required configuration parameters.", thing.getUID()); ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_CONFIGURATION_PENDING); setThingStatus(thing, statusInfo); } }
Source:
<code>public void incrementProgressBy(final int increment) { if (isShowing()) { <START> dialog.incrementProgressBy(increment); <END> } this.progress += increment; }</code><technical_language>call dialog.setProgress(progress) incremented progress? This ensure progress Dialog.progress stay in sync</technical_language>

Target:
public void incrementProgressBy(final int increment) { setProgress(progress + increment); }
Source:
<code>public void setIdleStateRetentionTime(Time minTime, Time maxTime) { if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 && !(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) { throw new IllegalArgumentException( "Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() + " should be at least 5 minutes."); } minIdleStateRetentionTime = minTime.toMilliseconds(); <START> maxIdleStateRetentionTime = maxTime.toMilliseconds(); <END> setIdleStateRetentionDuration(Duration.ofMillis(minIdleStateRetentionTime)); }</code><technical_language>member variables minIdleStateRetentionTime, maxIdleStateRetentionTime removed</technical_language>

Target:
public void setIdleStateRetentionTime(Time minTime, Time maxTime) { if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 && !(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) { throw new IllegalArgumentException( "Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() + " should be at least 5 minutes."); } setIdleStateRetention(Duration.ofMillis(minTime.toMilliseconds())); }
Source:
<code><START> protected int checkAndGetUserInputQueryLimit( final Object userInputQueryLimit, final int reportQueryLimit ) { <END> int systemQueryLimit = 0; final IPluginManager pm = PentahoSystem.get( IPluginManager.class ); if ( pm != null ) { systemQueryLimit = NumberUtils.toInt( (String) pm.getPluginSetting( "reporting", "settings/query-limit", "0" ), 0 ); } final int userQueryLimit = NumberUtils.toInt( (String) userInputQueryLimit, -1 ); if ( userQueryLimit > 0 ) { return systemQueryLimit > 0 ? Math.min( userQueryLimit, systemQueryLimit ) : userQueryLimit; } else { if ( systemQueryLimit > 0 ) { return reportQueryLimit > 0 ? Math.min( reportQueryLimit, systemQueryLimit ) : systemQueryLimit; } return -1; } }</code><technical_language>thing: If - URL - I pass in a user-limit is higher limit is hard-coded report, this code give precedence hard-coded limit. if I a top-10 report, I happily extend a Top-1000 report, data I supposed access. This is a great download a list of customers, do other evil things</technical_language>

Target:
int checkAndGetUserInputQueryLimit( final Object userInputQueryLimit, final int reportQueryLimit ) { int systemQueryLimit = 0; final IPluginManager pm = PentahoSystem.get( IPluginManager.class ); if ( pm != null ) { systemQueryLimit = NumberUtils.toInt( (String) pm.getPluginSetting( "reporting", "settings/query-limit", "0" ), 0 ); } if ( reportQueryLimit > 0 ) { if ( reportQueryLimit > 0 && systemQueryLimit > 0 ) { return Math.min( reportQueryLimit, systemQueryLimit ); } else { return reportQueryLimit; } } else { final int userLimit = NumberUtils.toInt( (String) userInputQueryLimit, -1 ); if ( userLimit > 0 && systemQueryLimit > 0 ) { return Math.min( userLimit, systemQueryLimit ); } else if ( systemQueryLimit > 0 ) { return systemQueryLimit; } else { return userLimit; } } }
Source:
<code>Mono<Response<Boolean>> existsWithResponse(Context context) { return this.getPropertiesWithResponse(null, context) .map(cp -> (Response<Boolean>) new SimpleResponse<>(cp, true)) .onErrorResume(t -> <START> (t instanceof ShareStorageException && ((ShareStorageException) t).getStatusCode() == 404) || (t instanceof HttpResponseException && ((HttpResponseException) t).getResponse().getStatusCode() == 404), <END> t -> { HttpResponse response = t instanceof ShareStorageException ? ((ShareStorageException) t).getResponse() : ((HttpResponseException) t).getResponse(); return Mono.just(new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), false)); }); }</code><technical_language>Gotcha, is interesting know, if this is a gap of functionality in de-serialization logic close gap on. If a quick repo hand mind filing issue this</technical_language>

Target:
Mono<Response<Boolean>> existsWithResponse(Context context) { return this.getPropertiesWithResponse(null, context) .map(cp -> (Response<Boolean>) new SimpleResponse<>(cp, true)) .onErrorResume(this::checkDoesNotExistStatusCode, t -> { HttpResponse response = t instanceof ShareStorageException ? ((ShareStorageException) t).getResponse() : ((HttpResponseException) t).getResponse(); return Mono.just(new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), false)); }); }
Source:
<code>public Boolean isImageOnPage(String fileName) { <START> wait.forElementVisible(By.cssSelector(MW_CONTENT_TEXT_IMG)); <END> for (int i = 0; i < 2; i++) { for (WebElement image : imagesNewFiles) { if (image.getAttribute("src").contains(fileName)) { return true; } } try { Thread.sleep(5000); } catch (InterruptedException e) { PageObjectLogging.logInfo("Sleep interrupted"); } driver.navigate().refresh(); } return false; }</code><technical_language>wait.forElementVisible(mwContentTextImgBy);</technical_language>

Target:
public Boolean isImageOnPage(String fileName) { wait.forElementVisible(mwContentTextImgBy); for (int i = 0; i < 2; i++) { for (WebElement image : imagesNewFiles) { if (image.getAttribute("src").contains(fileName)) { return true; } } try { Thread.sleep(5000); } catch (InterruptedException e) { PageObjectLogging.logInfo("Sleep interrupted"); } driver.navigate().refresh(); } return false; }
Source:
<code>public void technical_error_should_add_error_to_context() { thrown.expect(AnalysisException.class); JavaScriptCheck check = new ExceptionRaisingCheck(new NullPointerException("NPE forcibly raised by check class")); <START> createSensor().analyseFiles(context, ImmutableList.of((TreeVisitor)check), ImmutableList.of(new CompatibleInputFile(inputFile("file.js"))), progressReport); <END> assertThat(context.allAnalysisErrors()).hasSize(1); }</code><technical_language>@janos-ss change inputFilemethod defined in this class return a CompatibleInputFile</technical_language>

Target:
public void technical_error_should_add_error_to_context() { thrown.expect(AnalysisException.class); JavaScriptCheck check = new ExceptionRaisingCheck(new NullPointerException("NPE forcibly raised by check class")); createSensor().analyseFiles(context, ImmutableList.of((TreeVisitor)check), ImmutableList.of(inputFile("file.js")), progressReport); assertThat(context.allAnalysisErrors()).hasSize(1); }
Source:
<code>public void deleteGallery(int index) { selectGallery(index); wait.forElementVisible(focusedHighlight); <START> if ("CHROME".equalsIgnoreCase(Configuration.getBrowser())) { <END> Actions actions2 = new Actions(driver); actions2.sendKeys(Keys.DELETE).build().perform(); } else { editArea.sendKeys(Keys.DELETE); } }</code><technical_language>Browser.CHROME</technical_language>

Target:
public void deleteGallery(int index) { selectGallery(index); wait.forElementVisible(focusedHighlight); if (Browser.CHROME.equalsIgnoreCase(Configuration.getBrowser())) { Actions actions2 = new Actions(driver); actions2.sendKeys(Keys.DELETE).build().perform(); } else { editArea.sendKeys(Keys.DELETE); } }
Source:
<code>public boolean isBasedOn(final MixinDefinitionId mixinId) { for (SClass cls : getSuperclassAndMixins()) { if (cls.isBasedOn(mixinId)) { return true; } } return false; <START> } <END></code><technical_language>add a call VM.callerNeedsToBeOptimized("Result of isBasedOn cached") loop</technical_language>

Target:
public boolean isBasedOn(final MixinDefinitionId mixinId) { VM.callerNeedsToBeOptimized("Result of isBasedOn should be cached"); for (SClass cls : getSuperclassAndMixins()) { if (cls.isBasedOn(mixinId)) { return true; } } return false; }
Source:
<code>private List<Person> makeDirectors(Element cast) { <START> List<Person> people = new ArrayList<>(); <END> Elements directors = cast.getChildElements("actor"); for (int i = 0; i < directors.size(); i++) { Element director = directors.get(i); people.add(makeDirector(director)); } return people; }</code><technical_language>Guava lists for consistency + code</technical_language>

Target:
private List<Person> makeDirectors(Element cast) { List<Person> people = Lists.newArrayList(); Elements directors = cast.getChildElements(ACTOR); for (int i = 0; i < directors.size(); i++) { Element director = directors.get(i); people.add(makeDirector(director)); } return people; }
Source:
<code>public void start(FeaturesRunner runner) { try { RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); storageConfiguration.init(); for (String bundle : storageConfiguration.getExternalBundles()) { harness.deployBundle(bundle); } URL blobContribUrl = storageConfiguration.getBlobManagerContrib(runner); harness.getContext().deploy(new URLStreamRef(blobContribUrl)); URL repoContribUrl = storageConfiguration.getRepositoryContrib(runner); harness.getContext().deploy(new URLStreamRef(repoContribUrl)); <START> } catch (Exception e) { <END> throw new NuxeoException(e); } }</code><technical_language>catch Exception, if (due stupid deployBundle signature) do right incriminated method</technical_language>

Target:
public void start(FeaturesRunner runner) { try { RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); storageConfiguration.init(); for (String bundle : storageConfiguration.getExternalBundles()) { try { harness.deployBundle(bundle); } catch (Exception e) { throw new NuxeoException(e); } } URL blobContribUrl = storageConfiguration.getBlobManagerContrib(runner); harness.getContext().deploy(new URLStreamRef(blobContribUrl)); URL repoContribUrl = storageConfiguration.getRepositoryContrib(runner); harness.getContext().deploy(new URLStreamRef(repoContribUrl)); } catch (IOException e) { throw new NuxeoException(e); } }
Source:
<code>public Boolean call() throws LauncherException, PackingException { SchedulerStateManagerAdaptor statemgr = Runtime.schedulerStateManagerAdaptor(runtime); TopologyAPI.Topology topology = Runtime.topology(runtime); String topologyName = Context.topologyName(config); PackingPlan packedPlan = LauncherUtils.getInstance().createPackingPlan(config, runtime); launcher.initialize(config, runtime); Boolean result; result = statemgr.setTopology(trimTopology(topology), topologyName); if (result == null || !result) { throw new LauncherException("Failed to set topology definition", topologyName); } result = statemgr.setPackingPlan(createPackingPlan(packedPlan), topologyName); if (result == null || !result) { statemgr.deleteTopology(topologyName); throw new LauncherException("Failed to set packing plan", topologyName); } ExecutionEnvironment.ExecutionState executionState = createExecutionState(); result = statemgr.setExecutionState(executionState, topologyName); if (result == null || !result) { statemgr.deletePackingPlan(topologyName); statemgr.deleteTopology(topologyName); throw new LauncherException("Failed to set execution state", topologyName); } if (!launcher.launch(packedPlan)) { statemgr.deleteExecutionState(topologyName); statemgr.deletePackingPlan(topologyName); statemgr.deleteTopology(topologyName); throw new LauncherException("Failed to launch topology", topologyName); } <START> return true; <END> }</code><technical_language>return void</technical_language>

Target:
public void call() throws LauncherException, PackingException { SchedulerStateManagerAdaptor statemgr = Runtime.schedulerStateManagerAdaptor(runtime); TopologyAPI.Topology topology = Runtime.topology(runtime); String topologyName = Context.topologyName(config); PackingPlan packedPlan = LauncherUtils.getInstance().createPackingPlan(config, runtime); launcher.initialize(config, runtime); Boolean result; result = statemgr.setTopology(trimTopology(topology), topologyName); if (result == null || !result) { throw new LauncherException(String.format( "Failed to set topology definition for topology '%s'", topologyName)); } result = statemgr.setPackingPlan(createPackingPlan(packedPlan), topologyName); if (result == null || !result) { statemgr.deleteTopology(topologyName); throw new LauncherException(String.format( "Failed to set packing plan for topology '%s'", topologyName)); } ExecutionEnvironment.ExecutionState executionState = createExecutionState(); result = statemgr.setExecutionState(executionState, topologyName); if (result == null || !result) { statemgr.deletePackingPlan(topologyName); statemgr.deleteTopology(topologyName); throw new LauncherException(String.format( "Failed to set execution state for topology '%s'", topologyName)); } if (!launcher.launch(packedPlan)) { statemgr.deleteExecutionState(topologyName); statemgr.deletePackingPlan(topologyName); statemgr.deleteTopology(topologyName); throw new LauncherException(String.format( "Failed to launch topology '%s'", topologyName)); } }
Source:
<code>public static Map<String, String> getRESTAPIScopesFromConfig(JSONObject scopesConfig, JSONObject roleMappings) { Map<String, String> scopes = new HashMap<String, String>(); JSONArray scopesArray = (JSONArray) scopesConfig.get("Scope"); for (Object scopeObj : scopesArray) { JSONObject scope = (JSONObject) scopeObj; String scopeName = scope.get(APIConstants.REST_API_SCOPE_NAME).toString(); String scopeRoles = scope.get(APIConstants.REST_API_SCOPE_ROLE).toString(); if (roleMappings != null) { if (log.isDebugEnabled()) { log.debug("REST API scope role mappings exist. Hence proceeding to swap original scope roles " + "for mapped scope roles."); } List<String> originalRoles = Arrays.asList(scopeRoles.split("\\s*,\\s*")); List<String> mappedRoles = new ArrayList<String>(); for (String role : originalRoles) { String mappedRole = (String) roleMappings.get(role); if (mappedRole != null) { if (log.isDebugEnabled()) { log.debug(role + " was mapped to " + mappedRole); } mappedRoles.add(mappedRole); } else { mappedRoles.add(role); } } <START> scopeRoles = mappedRoles.toString().replace("[", "").replace("]", "").replace(" ", ""); <END> } scopes.put(scopeName, scopeRoles); } return scopes; }</code><technical_language>do below? scopeRoles = String.join(",", mappedRoles);</technical_language>

Target:
public static Map<String, String> getRESTAPIScopesFromConfig(JSONObject scopesConfig, JSONObject roleMappings) { Map<String, String> scopes = new HashMap<String, String>(); JSONArray scopesArray = (JSONArray) scopesConfig.get("Scope"); for (Object scopeObj : scopesArray) { JSONObject scope = (JSONObject) scopeObj; String scopeName = scope.get(APIConstants.REST_API_SCOPE_NAME).toString(); String scopeRoles = scope.get(APIConstants.REST_API_SCOPE_ROLE).toString(); if (roleMappings != null) { if (log.isDebugEnabled()) { log.debug("REST API scope role mappings exist. Hence proceeding to swap original scope roles " + "for mapped scope roles."); } List<String> originalRoles = Arrays.asList(scopeRoles.split("\\s*,\\s*")); List<String> mappedRoles = new ArrayList<String>(); for (String role : originalRoles) { String mappedRole = (String) roleMappings.get(role); if (mappedRole != null) { if (log.isDebugEnabled()) { log.debug(role + " was mapped to " + mappedRole); } mappedRoles.add(mappedRole); } else { mappedRoles.add(role); } } scopeRoles = String.join(",", mappedRoles); } scopes.put(scopeName, scopeRoles); } return scopes; }
Source:
<code>public IntervalList toIntervalList(final boolean includeFiltered) { <START> return fromVcf(this, includeFiltered); <END> }</code><technical_language>@yfarjoun actually... a bit confused deprecations. intending deprecate fromVCF methods confusingly named? 2 name</technical_language>

Target:
public IntervalList toIntervalList(final boolean includeFiltered) { return toIntervalList(this, includeFiltered); }
Source:
<code>public PortableInfoboxObject clickNextImageArrow(int childIndex) { <START> wait.forElementClickable(By.cssSelector(".pi-image:nth-child(" + childIndex + ") .action-next")).click(); <END> return this; }</code><technical_language>extract this By.cssSelector separate variable this line is more readable</technical_language>

Target:
public PortableInfoboxObject clickNextImageArrow(int childIndex) { By nextImageArrow = By.cssSelector(".pi-image:nth-child(" + childIndex + ") .action-next"); wait.forElementClickable(nextImageArrow) .click(); return this; }
Source:
<code>public PerformanceResult call() throws Exception { final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(getClient()); final int numberOfFiles = Integer.valueOf(this.numberOfFiles); final long sizeOfFiles = Integer.valueOf(this.sizeOfFiles); try { try { final PutBucketRequest request = new PutBucketRequest(bucketName); getClient().putBucket(request); } catch(final FailedRequestException e) { this.doNotDelete = true; if (e.getStatusCode() == 409) { <START> throw new CommandException("Bucket " + bucketName + " already exists. To avoid any conflict please use a non-existent bucket."); <END> } throw new CommandException("Encountered a DS3 Error", e); } final List<Ds3Object> objList = getDs3Objects(numberOfFiles, sizeOfFiles); transfer(helpers, numberOfFiles, sizeOfFiles, objList, true); transfer(helpers, numberOfFiles, sizeOfFiles, objList, false); } finally { if (!doNotDelete) deleteAllContents(getClient(), this.bucketName); } return new PerformanceResult("Done!"); }</code><technical_language>conflict conflicts</technical_language>

Target:
public PerformanceResult call() throws Exception { final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(getClient()); final int numberOfFiles = Integer.valueOf(this.numberOfFiles); final long sizeOfFiles = Integer.valueOf(this.sizeOfFiles); try { try { final PutBucketRequest request = new PutBucketRequest(bucketName); getClient().putBucket(request); } catch(final FailedRequestException e) { this.doNotDelete = true; if (e.getStatusCode() == 409) { throw new CommandException("Bucket " + bucketName + " already exists. To avoid any conflicts please use a non-existent bucket."); } throw new CommandException("Encountered a DS3 Error", e); } final List<Ds3Object> objList = getDs3Objects(numberOfFiles, sizeOfFiles); transfer(helpers, numberOfFiles, sizeOfFiles, objList, true); transfer(helpers, numberOfFiles, sizeOfFiles, objList, false); } finally { if (!doNotDelete) deleteAllContents(getClient(), this.bucketName); } return new PerformanceResult("Done!"); }
Source:
<code>public boolean nextKeyValue() throws IOException, InterruptedException { while (true) { if (pos_ > end_) { reader_.markNoMoreNewBlocks(); } ByteString bs = reader_.readNextProtoByteString(); if(bs == null) { return false; } errorTracker.incRecords(); M decoded = null; try { decoded = deserializer_.fromBytes(bs.toByteArray()); } catch (Throwable e) { errorTracker.incErrors(e); HadoopCompat.incrementCounter(recordErrorsCounter, 1); continue; } if (decoded != null) { <START> if (updatePosition) { <END> pos_ = getLzoFilePos(); updatePosition = false; } key_.set(pos_); value_.set(decoded); pos_ = getLzoFilePos(); HadoopCompat.incrementCounter(recordsReadCounter, 1); return true; } else { HadoopCompat.incrementCounter(recordsSkippedCounter, 1); } } }</code><technical_language>I updatePosition depend decoded, outside</technical_language>

Target:
public boolean nextKeyValue() throws IOException, InterruptedException { while (true) { if (pos_ > end_) { reader_.markNoMoreNewBlocks(); } byte[] byteArray = reader_.readNextProtoBytes(); if(byteArray == null) { return false; } errorTracker.incRecords(); M decoded = null; try { decoded = deserializer_.fromBytes(byteArray); } catch (DecodeException e) { errorTracker.incErrors(e); HadoopCompat.incrementCounter(recordErrorsCounter, 1); continue; } if (updatePosition) { pos_ = getLzoFilePos(); updatePosition = false; } if (decoded != null) { key_.set(pos_); value_.set(decoded); pos_ = getLzoFilePos(); HadoopCompat.incrementCounter(recordsReadCounter, 1); return true; } else { HadoopCompat.incrementCounter(recordsSkippedCounter, 1); } } }
Source:
<code>public void startWatch(final IProject project) { ConcurrentMap<String, IWatcher> kindMap = new ConcurrentHashMap<>(); if(watches.putIfAbsent(project, kindMap) == null){ <START> final Connection conn = ConnectionsRegistryUtil.getConnectionFor(project); <END> for (String kind: KINDS) { WatchListener listener = new WatchListener(project, conn, kind, 0, 0); startWatch(project, 0, 0, listener); } } }</code><technical_language>conn null point</technical_language>

Target:
public void startWatch(final IProject project) { ConcurrentMap<String, IWatcher> kindMap = new ConcurrentHashMap<>(); if(watches.putIfAbsent(project, kindMap) == null){ final Connection conn = ConnectionsRegistryUtil.getConnectionFor(project); if(conn == null) return; for (String kind: KINDS) { WatchListener listener = new WatchListener(project, conn, kind, 0, 0); startWatch(project, 0, 0, listener); } } }