auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static List<AndroidEmulator> listAvailableAvds() throws AndroidDeviceException { List<AndroidEmulator> avds = Lists.newArrayList(); <START> String avdParam = "avds"; <END> File clu = null; if(AndroidSdk.getAndroidVersionNumber() >= SDK_VERSION_FOR_AVD_MANAGER ){ clu = AndroidSdk.avdManager(); avdParam = "avd"; } else { clu = AndroidSdk.android(); } CommandLine getAVDCommand = new CommandLine(clu); getAVDCommand.addArgument("list", false); getAVDCommand.addArgument(avdParam, false); log.info("Executing command for avd: "+getAVDCommand.toString()); String output = null; try { output = ShellCommand.exec(getAVDCommand, 20000); } catch (ShellCommandException e) { throw new AndroidDeviceException(e); } Map<String, Integer> startedDevices = mapDeviceNamesToSerial(); String[] avdsOutput = StringUtils.splitByWholeSeparator(output, "---------"); if (avdsOutput != null && avdsOutput.length > 0) { for (String element : avdsOutput) { if (!element.contains("Name:")) { continue; } DefaultAndroidEmulator emulator = new DefaultAndroidEmulator(element); if (startedDevices.containsKey(emulator.getAvdName())) { emulator.setSerial(startedDevices.get(emulator.getAvdName())); } avds.add(emulator); } } return avds; }</code><technical_language>avds instead of avd AFAIK, this avd</technical_language>

Target:
public static List<AndroidEmulator> listAvailableAvds() throws AndroidDeviceException { List<AndroidEmulator> avds = Lists.newArrayList(); File clu = null; if (AndroidSdk.getAndroidVersionNumber() >= SDK_VERSION_FOR_AVD_MANAGER ) { clu = AndroidSdk.avdManager(); } else { clu = AndroidSdk.android(); } CommandLine getAVDCommand = new CommandLine(clu); getAVDCommand.addArgument("list", false); getAVDCommand.addArgument("avd", false); String output = null; try { output = ShellCommand.exec(getAVDCommand, 20000); } catch (ShellCommandException e) { throw new AndroidDeviceException(e); } Map<String, Integer> startedDevices = mapDeviceNamesToSerial(); String[] avdsOutput = StringUtils.splitByWholeSeparator(output, "---------"); if (avdsOutput != null && avdsOutput.length > 0) { for (String element : avdsOutput) { if (!element.contains("Name:")) { continue; } DefaultAndroidEmulator emulator = new DefaultAndroidEmulator(element); if (startedDevices.containsKey(emulator.getAvdName())) { emulator.setSerial(startedDevices.get(emulator.getAvdName())); } avds.add(emulator); } } return avds; }
Source:
<code>private void initMigrationMode() { ArrayList<EntityModel> migrationModes = new ArrayList<EntityModel>(); Constants constants = ConstantsManager.getInstance().getConstants(); <START> MIGRATABLE_ENTITY.setTitle(constants.autoAndManMigration()); <END> IMPLICITLY_NON_MIGRATABLE_ENTITY.setTitle(constants.manualMigrationOnly()); PINNED_TO_HOST_ENTITY.setTitle(constants.noMigration()); migrationModes.add(MIGRATABLE_ENTITY); migrationModes.add(IMPLICITLY_NON_MIGRATABLE_ENTITY); migrationModes.add(PINNED_TO_HOST_ENTITY); getMigrationMode().setItems(migrationModes); }</code><technical_language>EnumRenderer in view instead of localization in model (and modify Enums.properties...)</technical_language>

Target:
private void initMigrationMode() { getMigrationMode().setItems(Arrays.asList(MigrationSupport.values())); }
Source:
<code>public void startCluster() throws IOException { conf = new Configuration(); conf.set(String.format(FS_IMPL_PATTERN_KEY, HDFS_SCHEME), ViewFsOverloadScheme.class.getName()); conf.set(String.format( FsConstants.FS_VIEWFS_OVERLOAD_SCHEME_TARGET_ABSTRACTFS_IMPL_PATTERN, HDFS_SCHEME), Hdfs.class.getName()); <START> cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); <END> cluster.waitClusterUp(); defaultFSURI = URI.create(conf.get(CommonConfigurationKeys.FS_DEFAULT_NAME_KEY)); localTargetDir = new File(TEST_ROOT_DIR, "/root/"); Assert.assertEquals(HDFS_SCHEME, defaultFSURI.getScheme()); }</code><technical_language>I remember I this tests starts cluster once. improve tests time, want a ViewFileSystemOverloadScheme test class now</technical_language>

Target:
public void startCluster() throws IOException { conf = new Configuration(cluster.getConfiguration(0)); conf.set(String.format(FS_IMPL_PATTERN_KEY, HDFS_SCHEME), ViewFsOverloadScheme.class.getName()); conf.set(String.format( FsConstants.FS_VIEWFS_OVERLOAD_SCHEME_TARGET_ABSTRACTFS_IMPL_PATTERN, HDFS_SCHEME), Hdfs.class.getName()); defaultFSURI = URI.create(conf.get(CommonConfigurationKeys.FS_DEFAULT_NAME_KEY)); localTargetDir = new File(TEST_ROOT_DIR, "/root/"); Assert.assertEquals(HDFS_SCHEME, defaultFSURI.getScheme()); }
Source:
<code>public void createsInstance() throws Exception { final MultiSelectFacet<String> facet = MultiSelectFacetBuilder.of(KEY, LABEL, OPTIONS, true) <START> .setThreshold(3L) <END> .setLimit(10L) .build(); assertThat(facet.getKey()).isEqualTo(KEY); assertThat(facet.getLabel()).isEqualTo(LABEL); assertThat(facet.getAllOptions()).isEqualTo(OPTIONS); assertThat(facet.matchesAll()).isTrue(); assertThat(facet.getThreshold()).contains(3L); assertThat(facet.getLimit()).contains(10L); }</code><technical_language>is this setThreshold threshold? is a builder method a bean setter</technical_language>

Target:
public void createsInstance() throws Exception { final MultiSelectFacet<String> facet = MultiSelectFacetBuilder.of(KEY, LABEL, OPTIONS, true) .threshold(3L) .limit(10L) .build(); assertThat(facet.getKey()).isEqualTo(KEY); assertThat(facet.getLabel()).isEqualTo(LABEL); assertThat(facet.getAllOptions()).isEqualTo(OPTIONS); assertThat(facet.matchesAll()).isTrue(); assertThat(facet.getThreshold()).contains(3L); assertThat(facet.getLimit()).contains(10L); }
Source:
<code>public boolean updateHaLocalMaintenanceMode(VDS vds, boolean localMaintenance){ boolean setHaMaintenanceFailed; SetHaMaintenanceModeVDSCommandParameters param = new SetHaMaintenanceModeVDSCommandParameters(vds, HaMaintenanceMode.LOCAL, localMaintenance); setHaMaintenanceFailed <START> = !vdsBroker.runVdsCommand(VDSCommandType.SetHaMaintenanceMode, <END> param).getSucceeded(); return setHaMaintenanceFailed; }</code><technical_language>a bit unclear returned boolean is inverted. function called updateHaLocalMaintenanceMode() returns true failure</technical_language>

Target:
public boolean updateHaLocalMaintenanceMode(VDS vds, boolean localMaintenance){ boolean setHaMaintenanceSucceeds; SetHaMaintenanceModeVDSCommandParameters param = new SetHaMaintenanceModeVDSCommandParameters(vds, HaMaintenanceMode.LOCAL, localMaintenance); setHaMaintenanceSucceeds = vdsBroker.runVdsCommand(VDSCommandType.SetHaMaintenanceMode, param).getSucceeded(); return setHaMaintenanceSucceeds; }
Source:
<code>public void init(KieServerImpl kieServer, KieServerRegistry registry) { KieServerExtension droolsExtension = registry.getServerExtension( "Drools" ); if ( droolsExtension == null ) { logger.warn( "No Drools extension available, quiting..." ); return; } this.registry = registry; this.threadPool = new ThreadPoolExecutor(2, Runtime.getRuntime().availableProcessors(), 120, TimeUnit.SECONDS, <START> new ArrayBlockingQueue<Runnable>(Runtime.getRuntime().availableProcessors())); END> this.solverServiceBase = new SolverServiceBase( registry, threadPool ); this.services.add( solverServiceBase ); }</code><technical_language>experience, I 'd recommend a more conservative number for threadpool size: threadPoolSize = (availableProcessors < 4 ? availableProcessors : availableProcessors - 1); Why? If 8 processors 8 solver threads running in parallel, 100% of processor (remember do IO, block), REST request coming in need rely JVM's round-robin thread scheduling park 1 of running solver threads get some time handled (and for OS for EAP threads). I this affect response time (= latency). If 4 more processors, I tradeoff is worth reserve 1 processor optimize latency throughput (note a reservation is virtual solver threads jump another cpu time, total cpu time maxed out). In benchmarks, I more conservative, of processorSize default. This is hardware hyper-threading, stressing more of CPU's reduces average speed CPU. In case: in long run thread pool size need configurable for SysOps (through JMX I suppose)</technical_language>

Target:
public void init(KieServerImpl kieServer, KieServerRegistry registry) { KieServerExtension droolsExtension = registry.getServerExtension( "Drools" ); if ( droolsExtension == null ) { logger.warn( "No Drools extension available, quiting..." ); return; } this.registry = registry; int poolSize = Runtime.getRuntime().availableProcessors(); if (poolSize >= 4) { poolSize--; } this.threadPool = new ThreadPoolExecutor(2, poolSize, 120, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(poolSize)); this.solverServiceBase = new SolverServiceBase( registry, threadPool ); this.services.add( solverServiceBase ); }
Source:
<code><START> private Set<DataObject> findDataObjects() { <END> Iterable<Node> nodes = canvasSessionManager.getCurrentSession() .getCanvasHandler() .getDiagram() .getGraph() .nodes(); final Set<String> parentIds = getParentIds(); return StreamSupport.stream(nodes.spliterator(), false) .filter(this::isBPMNDefinition) .map(elm -> (Node<View<BPMNDefinition>, Edge>) elm) .filter(elm -> { if (elm.getContent().getDefinition() instanceof DataObject) { final Element parent = getParentElement(elm); if (parent == null) { return true; } return parentIds.contains(parent.getUUID()); } return false; }) .map(elm -> ((DataObject) elm.getContent().getDefinition())) .collect(Collectors.toSet()); }</code><technical_language>move this method some helper class static method well, in BPMN modules, receives diagram canvasHandler argument, call passing instance returned sessionManager.getCurrentSession()</technical_language>

Target:
private Set<DataObject> findDataObjects() { Iterable<Node> nodes = canvasSessionManager.getCurrentSession() .getCanvasHandler() .getDiagram() .getGraph() .nodes(); final Set<String> parentIds = getParentIds(); return StreamSupport.stream(nodes.spliterator(), false) .filter(this::isBPMNDefinition) .map(elm -> (Node<View<BPMNDefinition>, Edge>) elm) .filter(elm -> { if (elm.getContent().getDefinition() instanceof DataObject) { final Element parent = graphUtils.getParent(elm); if (parent == null) { return true; } return parentIds.contains(parent.getUUID()); } return false; }) .map(elm -> ((DataObject) elm.getContent().getDefinition())) .collect(Collectors.toSet()); }
Source:
<code>public void run() { try { EventLogger.LOG.asyncFire(metadata, observer); new RunInRequest(contextId) { @Override protected void execute() { final ThreadLocalStackReference<EventMetadata> stack = currentEventMetadata.pushIfNotNull(metadata); try { Observers.notify(observer, event, metadata); } finally { stack.pop(); } } }.run(); } catch (Exception e) { String stackTrace; <START> if (e.getCause().getMessage() != null) { <END> stackTrace = "StackTrace: " + e.getCause().getMessage(); } else { stackTrace = "No stack trace to show, the exception's message was empty."; } EventLogger.LOG.asyncObserverFailure(observer, metadata, stackTrace); EventLogger.LOG.catchingDebug(e); } }</code><technical_language>e.getCause() return null</technical_language>

Target:
public void run() { try { EventLogger.LOG.asyncFire(metadata, observer); new RunInRequest(contextId) { @Override protected void execute() { final ThreadLocalStackReference<EventMetadata> stack = currentEventMetadata.pushIfNotNull(metadata); try { Observers.notify(observer, event, metadata); } finally { stack.pop(); } } }.run(); } catch (Exception e) { EventLogger.LOG.asyncObserverFailure(observer, metadata, e.getCause() != null ? e.getCause() : e); EventLogger.LOG.catchingDebug(e); } }
Source:
<code><START> public void updateDataSourceListModel() { <END> getDataSourceListModel().removeAllElements(); for (String dsName : getDataSourceArray()) { getDataSourceListModel().addElement(dsName); } setComponentsEnabled(); firePropertyChange(Bundle.DropdownListSearchPanel_selected(), null, null); }</code><technical_language>This need public</technical_language>

Target:
void updateDataSourceListModel() { getDataSourceListModel().removeAllElements(); for (String dsName : getDataSourceArray()) { getDataSourceListModel().addElement(dsName); } setComponentsEnabled(); firePropertyChange(Bundle.DropdownListSearchPanel_selected(), null, null); }
Source:
<code>public String getNetworkMode(Map<String, Object> instanceData) { Map<String, Object> labels = CollectionUtils.toMap(instanceData.get(InstanceConstants.FIELD_LABELS)); String mode = ObjectUtils.toString(labels.get(SystemLabels.LABEL_CNI_NETWORK)); if(mode == null) { String dataMode = ObjectUtils.toString(instanceData.get(DockerInstanceConstants.FIELD_NETWORK_MODE)); if (inAllowedModes(dataMode) && "true".equals(labels.get(SystemLabels.LABEL_RANCHER_NETWORK))) { mode = NetworkConstants.NETWORK_MODE_MANAGED; } else { <START> mode = dataMode; <END> } } return mode; }</code><technical_language>fine assigning mode=dataMode if dataMode !inAllowedModes? falls this else condition</technical_language>

Target:
public String getNetworkMode(Map<String, Object> instanceData) { Map<String, Object> labels = CollectionUtils.toMap(instanceData.get(InstanceConstants.FIELD_LABELS)); String mode = ObjectUtils.toString(labels.get(SystemLabels.LABEL_CNI_NETWORK)); if(mode == null) { String dataMode = ObjectUtils.toString(instanceData.get(DockerInstanceConstants.FIELD_NETWORK_MODE)); if (inAllowedModesForManaged(dataMode) && "true".equals(labels.get(SystemLabels.LABEL_RANCHER_NETWORK))) { mode = NetworkConstants.NETWORK_MODE_MANAGED; } else { mode = dataMode; } } return mode; }
Source:
<code>public String toString() { final String from = new Throwable().getStackTrace()[1].toString(); <START> LOGGER.warning("Use of toString() on hudson.util.Secret from "+from+". Prefer getPlainText() or getEncryptedValue() depending your needs."); <END> return value; }</code><technical_language>This message proposing creating issue plugin developer IMHO</technical_language>

Target:
public String toString() { final String from = new Throwable().getStackTrace()[1].toString(); LOGGER.warning("Use of toString() on hudson.util.Secret from "+from+". Prefer getPlainText() or getEncryptedValue() depending your needs. see <LINK_0>"); return value; }
Source:
<code>protected Map<String, Pair<String, String>> getExclusiveLocks() { <START> return Collections.singletonMap(getStorageDomain().getId().toString(), LockMessagesMatchUtil.STORAGE); <END> }</code><technical_language>lock storage domain? if want lock (though needed here) - connection</technical_language>

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getConnection().getconnection(), LockMessagesMatchUtil.STORAGE_CONNECTION); }
Source:
<code>public void packageApk(File apk, File manifest) { String buildRoot = <START> System.getenv().get("ANDROID_BUILD_TOP"); <END> String androidJarPath; if (com.google.common.base.Strings.isNullOrEmpty(buildRoot)) { androidJarPath = "prebuilts/sdk/current/android.jar"; } else { androidJarPath = buildRoot + "/prebuilts/sdk/current/android.jar"; } List<String> aapt = new ArrayList<String>(Arrays.asList("aapt", "package", "-F", apk.getPath(), "-M", manifest.getPath(), "-I", androidJarPath)); new Command(log, aapt).execute(); }</code><technical_language>This is improvement. assume developers running vogar Android source tree (see code "where dx"). do here</technical_language>

Target:
public void packageApk(File apk, File manifest) { List<String> aapt = new ArrayList<String>(Arrays.asList("aapt", "package", "-F", apk.getPath(), "-M", manifest.getPath(), "-I", androidJarPath)); new Command(log, aapt).execute(); }
Source:
<code>public void addStateTo(StateDumpCollector dump) { PlatformConfiguration platformConfiguration = this.platformConfiguration; if (platformConfiguration != null) { Collection<Object> configurations = platformConfiguration.getExtendedConfiguration(Object.class); dump.addState("server", platformConfiguration.getServerName()); <START> dump.addState("configurationCount", String.valueOf(configurations)); <END> Map<String, List<Object>> pluginsByType = configurations .stream() .collect(Collectors.groupingBy(o -> o.getClass().getName())); for (Map.Entry<String, List<Object>> entry : pluginsByType.entrySet()) { StateDumpCollector typeDump = dump.subStateDumpCollector(entry.getKey()); typeDump.addState("configurationCount", String.valueOf(entry.getValue().size())); for (Object plugin : entry.getValue()) { StateDumpCollector pluginDump = typeDump.subStateDumpCollector(String.valueOf(plugin.hashCode())); pluginDump.addState("manageable", String.valueOf(plugin instanceof ManageableServerComponent)); if (plugin instanceof StateDumpable) { ((StateDumpable) plugin).addStateTo(pluginDump); } } } } TopologyService topologyService = this.topologyService; if (topologyService != null) { dump.addState("cluster", topologyService.getClusterCopy().toMap().toString()); } }</code><technical_language>String.valueOf(configurations) give a count, it? give depending Collection implementation. I guess meant configurations.size()</technical_language>

Target:
public void addStateTo(StateDumpCollector dump) { PlatformConfiguration platformConfiguration = this.platformConfiguration; if (platformConfiguration != null) { Collection<Object> configurations = platformConfiguration.getExtendedConfiguration(Object.class); dump.addState("server", platformConfiguration.getServerName()); dump.addState("configurationCount", String.valueOf(configurations.size())); Map<String, List<Object>> pluginsByType = configurations .stream() .collect(Collectors.groupingBy(o -> o.getClass().getName())); for (Map.Entry<String, List<Object>> entry : pluginsByType.entrySet()) { StateDumpCollector typeDump = dump.subStateDumpCollector(entry.getKey()); typeDump.addState("configurationCount", String.valueOf(entry.getValue().size())); int plugin_idx = 0; for (Object plugin : entry.getValue()) { StateDumpCollector pluginDump = typeDump.subStateDumpCollector(String.valueOf(plugin_idx++)); pluginDump.addState("manageable", String.valueOf(plugin instanceof ManageableServerComponent)); if (plugin instanceof StateDumpable) { ((StateDumpable) plugin).addStateTo(pluginDump); } } } } TopologyService topologyService = this.topologyService; if (topologyService != null) { dump.addState("cluster", topologyService.getClusterCopy().toMap().toString()); } }
Source:
<code>public void showFetchingErrorCharges(String s) { if (mApiRestCounter == 1) { ll_error.setVisibility(View.VISIBLE); <START> mNoChargesText.setText(s + "\n" + getString(R.string.click_to_refresh)); <END> } Toaster.show(rootView, s); }</code><technical_language>remove "\n" click_to_refresh consisting \n</technical_language>

Target:
public void showFetchingErrorCharges(String s) { if (mApiRestCounter == 1) { ll_error.setVisibility(View.VISIBLE); mNoChargesText.setText(s + getString(R.string.click_to_refresh)); } Toaster.show(rootView, s); }
Source:
<code>public void addExtraData(String variable, Object variableValue) { if (this.data == null) { <START> this.data = new HashMap<String, Object>(); <END> } this.data.put(variable, variableValue); }</code><technical_language><String, Object> needed</technical_language>

Target:
public void addExtraData(String variable, Object variableValue) { if (this.data == null) { this.data = new HashMap<>(); } this.data.put(variable, variableValue); }
Source:
<code><START> boolean canConnect(VDS vds) { <END> boolean returnValue = true; if (vds.getVdsType() == VDSType.VDS && Config.<Boolean> GetValue(ConfigValues.InstallVds)) { SSHClient sshclient = null; try { Long timeout = TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds)); sshclient = getSSHClient(); sshclient.setHardTimeout(timeout); sshclient.setSoftTimeout(timeout); sshclient.setHost(vds.getHostName()); sshclient.setUser(USER_NAME); sshclient.setPassword(getParameters().getRootPassword()); sshclient.connect(); sshclient.authenticate(); } catch (AuthenticationException e) { log.errorFormat( "Failed to authenticate session with host {0}", vds.getName(), e ); addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_AUTHENTICATE_TO_SERVER); returnValue = false; } catch (Exception e) { log.errorFormat( "Failed to establish session with host {0}", vds.getName(), e ); addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_CONNECT_TO_SERVER); returnValue = false; } finally { if (sshclient != null) { sshclient.disconnect(); } } } return returnValue; }</code><technical_language>please set a modifier - protected suitable</technical_language>

Target:
protected boolean canConnect(VDS vds) { boolean returnValue = true; if (vds.getVdsType() == VDSType.VDS && Config.<Boolean> GetValue(ConfigValues.InstallVds)) { SSHClient sshclient = null; try { Long timeout = TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds)); sshclient = getSSHClient(); sshclient.setHardTimeout(timeout); sshclient.setSoftTimeout(timeout); sshclient.setHost(vds.getHostName()); sshclient.setUser(USER_NAME); sshclient.setPassword(getParameters().getRootPassword()); sshclient.connect(); sshclient.authenticate(); } catch (AuthenticationException e) { log.errorFormat( "Failed to authenticate session with host {0}", vds.getName(), e ); addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_AUTHENTICATE_TO_SERVER); returnValue = false; } catch (Exception e) { log.errorFormat( "Failed to establish session with host {0}", vds.getName(), e ); addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_CONNECT_TO_SERVER); returnValue = false; } finally { if (sshclient != null) { sshclient.disconnect(); } } } return returnValue; }
Source:
<code>public void testInitializeDatastream() throws Exception { String sourceRegex = "\\w+Event"; StringMap metadata = new StringMap(); metadata.put(DatastreamMetadataConstants.REUSE_EXISTING_DESTINATION_KEY, Boolean.FALSE.toString()); Datastream ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream", _broker, sourceRegex, metadata); KafkaMirrorMakerConnector connector = new KafkaMirrorMakerConnector("testInitializeDatastream", <START> KafkaMirrorMakerConnectorTestUtils.getDefaultConfig(Optional.empty()), "testCluster"); <END> connector.initializeDatastream(ds, Collections.emptyList()); sourceRegex = "SpecificTopic"; ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream2", _broker, sourceRegex, metadata); connector.initializeDatastream(ds, Collections.emptyList()); sourceRegex = "(\\w+Event)|^(Topic)"; ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream3", _broker, sourceRegex, metadata); connector.initializeDatastream(ds, Collections.emptyList()); sourceRegex = "^(?!__)\\w+"; ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream4", _broker, sourceRegex, metadata); connector.initializeDatastream(ds, Collections.emptyList()); Assert.assertTrue(DatastreamUtils.isConnectorManagedDestination(ds)); }</code><technical_language>avoid fully qualify getDefaultConfig() this file a static import. java import static com.linkedin.datastream.connectors.kafka.mirrormaker.KafkaMirrorMakerConnectorTestUtils.getDefaultConfig;</technical_language>

Target:
public void testInitializeDatastream() throws Exception { String sourceRegex = "\\w+Event"; StringMap metadata = new StringMap(); metadata.put(DatastreamMetadataConstants.REUSE_EXISTING_DESTINATION_KEY, Boolean.FALSE.toString()); Datastream ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream", _broker, sourceRegex, metadata); KafkaMirrorMakerConnector connector = new KafkaMirrorMakerConnector("testInitializeDatastream", getDefaultConfig(Optional.empty()), "testCluster"); connector.initializeDatastream(ds, Collections.emptyList()); sourceRegex = "SpecificTopic"; ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream2", _broker, sourceRegex, metadata); connector.initializeDatastream(ds, Collections.emptyList()); sourceRegex = "(\\w+Event)|^(Topic)"; ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream3", _broker, sourceRegex, metadata); connector.initializeDatastream(ds, Collections.emptyList()); sourceRegex = "^(?!__)\\w+"; ds = KafkaMirrorMakerConnectorTestUtils.createDatastream("testInitializeDatastream4", _broker, sourceRegex, metadata); connector.initializeDatastream(ds, Collections.emptyList()); Assert.assertTrue(DatastreamUtils.isConnectorManagedDestination(ds)); }
Source:
<code>private void onYield() { if (logger.isLoggable(java.util.logging.Level.FINE)) { logger.fine("Yielding AsyncQueueHandler associated with " <START> + "AsyncQueueHandler with ID = " + id); <END> } synchronized (syncRoot) { cancel(false); readerFuture = executor.submit(reader); } }</code><technical_language>this log "Yielding AsyncQueueHandler ID " + id</technical_language>

Target:
private void onYield() { if (logger.isLoggable(java.util.logging.Level.FINE)) { logger.fine("Yielding AsyncQueueHandler with ID = " + id); } rescheduleReader(); }
Source:
<code>public void close() { assertIsOpen(); LOGGER.debug().setMessage("Closing DatabaseAlertExecutionRepository").log(); <START> assert _partitionCreator != null : "partitionCreator should be non-null when open"; <END> try { DailyPartitionCreator.stop(_partitionCreator, Duration.ofSeconds(5)); _partitionCreator = null; } catch (final ExecutionException | InterruptedException e) { throw new RuntimeException("Failed to shutdown partition creator", e); } _isOpen.set(false); }</code><technical_language>generally avoid of assert conditional based JVM arguments</technical_language>

Target:
public void close() { assertIsOpen(); LOGGER.debug().setMessage("Closing DatabaseAlertExecutionRepository").log(); if (_partitionCreator == null) { throw new IllegalStateException("partitionCreator should be non-null when open"); } try { Patterns.gracefulStop(_partitionCreator, ACTOR_STOP_TIMEOUT) .toCompletableFuture() .get(ACTOR_STOP_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); _partitionCreator = null; } catch (final TimeoutException | ExecutionException | InterruptedException e) { throw new RuntimeException("Failed to shutdown partition creator", e); } _isOpen.set(false); }
Source:
<code>public void processLeftWatermark(final MistWatermarkEvent input) { outputEmitter.emitWatermark(input); if (input.isCheckpoint()) { latestCheckpointTimestamp = input.getTimestamp(); final Map<String, Object> stateMap = new HashMap<>(); <START> stateMap.put("applyStatefulFunctionState", applyStatefulFunction.getCurrentState()); <END> checkpointMap.put(input.getTimestamp(), stateMap); } }</code><technical_language>state deep copied if want store state this time</technical_language>

Target:
public void processLeftWatermark(final MistWatermarkEvent input) { if (isEarlierThanRecoveredTimestamp(input)) { return; } updateLatestEventTimestamp(input.getTimestamp()); outputEmitter.emitWatermark(input); }
Source:
<code>private static SslContextBuilder createGrpcSslBuilder() { try { SslContextBuilder sslBuilder = GrpcSslContexts.forClient(); sslBuilder.ciphers(null); return sslBuilder; } catch (IllegalArgumentException e) { LOG.error("Could not initialize GrpcSslContexts", e); <START> return null; <END> } }</code><technical_language>is this null handled is returned here</technical_language>

Target:
private static SslContextBuilder createGrpcSslBuilder() { SslContextBuilder sslBuilder = GrpcSslContexts.forClient(); sslBuilder.ciphers(null); return sslBuilder; }
Source:
<code>public int presentAsFile(final File file, final List<CertifiedProductSearchDetails> cpList) { int numRows = 0; try { <START> try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); <END> CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL);) { csvPrinter.printRecord(generateHeaderValues()); for (CertifiedProductSearchDetails currListing : cpList) { List<List<String>> rows = generateRows(currListing); if (rows != null) { for(List<String> row : rows) { csvPrinter.printRecord(row); numRows++; } } } } } catch (final IOException ex) { LOGGER.error("Could not write file " + file.getName(), ex); } return numRows; }</code><technical_language>Wait, is this a try { try () { } } structure? in try</technical_language>

Target:
public int presentAsFile(final File file, final List<CertifiedProductSearchDetails> cpList) { int numRows = 0; try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL)) { csvPrinter.printRecord(generateHeaderValues()); for (CertifiedProductSearchDetails currListing : cpList) { List<List<String>> rows = generateRows(currListing); if (rows != null) { for(List<String> row : rows) { csvPrinter.printRecord(row); numRows++; } } } } catch (final IOException ex) { LOGGER.error("Could not write file " + file.getName(), ex); } return numRows; }
Source:
<code>public void setConfiguration(String key, String value) { <START> if (value == null) { <END> removeConfiguration(key); } else { configuration.put(key, value); } }</code><technical_language>a removeConfiguration allow null here</technical_language>

Target:
public void setConfiguration(String key, String value) { configuration.put(key, Objects.requireNonNull(value)); }
Source:
<code>public Iterator<Message> iterator() { try { final ByteArrayDataInput input = ByteStreams.newDataInput( Compression.create(messageSet.getCompression()).decompress(messageSet.getMessages())); return new Iterator<Message>() { private int messageCount = messageSet.getNumMessages(); @Override public boolean hasNext() { return messageCount > 0; } @Override public Message next() { Message m = new Message(); try { m.readFields(input); --messageCount; return m; } catch (Exception e) { <START> log.error("Exception while iterating MessageSet:" + e.getMessage(), e); <END> messageCount = 0; return null; } } @Override public void remove() { throw new UnsupportedOperationException("remove is not supported"); } }; } catch (Exception e) { log.error("Exception while reading: " + e.getMessage(), e); return new Iterator<Message>() { @Override public boolean hasNext() { return false; } @Override public Message next() { return null; } @Override public void remove() { throw new UnsupportedOperationException("remove is not supported"); } }; } }</code><technical_language>Record dropped message count? Message count inaccurate if message is corrupted, recording count of dropped message sets helpful too</technical_language>

Target:
public Iterator<Message> iterator() { try { final ByteArrayDataInput input = ByteStreams.newDataInput( Compression.create(messageSet.getCompression()).decompress(messageSet.getMessages())); return new Iterator<Message>() { private int messageCount = messageSet.getNumMessages(); @Override public boolean hasNext() { return messageCount > 0; } @Override public Message next() { Message m = new Message(); try { m.readFields(input); --messageCount; return m; } catch (Exception e) { log.error("Exception while iterating MessageSet:" + e.getMessage(), e); DynamicCounter.increment( MonitorConfig.builder(TagKey.DROPPED_COUNT) .withTag("reason", "MessageSetReaderError").build(), messageCount); messageCount = 0; return null; } } @Override public void remove() { throw new UnsupportedOperationException("remove is not supported"); } }; } catch (Exception e) { log.error("Exception while reading: " + e.getMessage(), e); return new Iterator<Message>() { @Override public boolean hasNext() { return false; } @Override public Message next() { return null; } @Override public void remove() { throw new UnsupportedOperationException("remove is not supported"); } }; } }
Source:
<code>public Pair<List<? extends UsageVO>, Integer> getUsageRecordsPendingQuotaAggregation(final long accountId, final long domainId) { if (s_logger.isDebugEnabled()){ s_logger.debug("Getting usage records for account: " + accountId + ", domainId: " + domainId); } final short opendb = TransactionLegacy.currentTxn().getDatabaseId(); Pair<List<UsageVO>, Integer> usageRecords = new Pair<List<UsageVO>, Integer>(new ArrayList<UsageVO>(), 0); try { TransactionLegacy.open(TransactionLegacy.USAGE_DB).close(); Filter usageFilter = new Filter(UsageVO.class, "startDate", true, 0L, 10000L); SearchCriteria<UsageVO> sc = createSearchCriteria(); if (accountId != -1) { sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); } if (domainId != -1) { sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); } sc.addAnd("quotaCalculated", SearchCriteria.Op.NULL); sc.addOr("quotaCalculated", SearchCriteria.Op.EQ, 0); if (s_logger.isDebugEnabled()){ s_logger.debug("Getting usage records" + usageFilter.getOrderBy()); } usageRecords = searchAndCountAllRecords(sc, usageFilter); <START> } catch (Exception e) { <END> s_logger.error("getUsageRecordsPendingQuotaAggregation failed due to: " + e.getMessage()); } finally { TransactionLegacy.open(opendb).close(); } return new Pair<List<? extends UsageVO>, Integer>(usageRecords.first(), usageRecords.second()); }</code><technical_language>catching ignoring checked unchecked exceptions</technical_language>

Target:
public Pair<List<? extends UsageVO>, Integer> getUsageRecordsPendingQuotaAggregation(final long accountId, final long domainId) { if (s_logger.isDebugEnabled()) { s_logger.debug("Getting usage records for account: " + accountId + ", domainId: " + domainId); } return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<Pair<List<? extends UsageVO>, Integer>>() { @Override public Pair<List<? extends UsageVO>, Integer> doInTransaction(final TransactionStatus status) { Pair<List<UsageVO>, Integer> usageRecords = new Pair<List<UsageVO>, Integer>(new ArrayList<UsageVO>(), 0); Filter usageFilter = new Filter(UsageVO.class, "startDate", true, 0L, Long.MAX_VALUE); QueryBuilder<UsageVO> qb = QueryBuilder.create(UsageVO.class); if (accountId != -1) { qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId); } if (domainId != -1) { qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId); } qb.and(qb.entity().getQuotaCalculated(), SearchCriteria.Op.NEQ, 1); qb.and(qb.entity().getRawUsage(), SearchCriteria.Op.GT, 0); if (s_logger.isDebugEnabled()) { s_logger.debug("Getting usage records" + usageFilter.getOrderBy()); } usageRecords = searchAndCountAllRecords(qb.create(), usageFilter); return new Pair<List<? extends UsageVO>, Integer>(usageRecords.first(), usageRecords.second()); } }); }
Source:
<code>private void <START> setupRestrictedNotification() <END> { final Resources res = getResources(mContext, mActiveDataSubId); final String title = res.getString(R.string.disable_tether_notification_title); final String message = res.getString(R.string.disable_tether_notification_message); showNotification(R.drawable.stat_sys_tether_general, title, message, ""); }</code><technical_language>do synchronized protection this function, If protect mUpdateLock of this function, I need add a note remind caller in future remember protect it</technical_language>

Target:
void setupRestrictedNotification() { final Resources res = getResources(mContext, mActiveDataSubId); final String title = res.getString(R.string.disable_tether_notification_title); final String message = res.getString(R.string.disable_tether_notification_message); showNotification(R.drawable.stat_sys_tether_general, title, message, ""); }
Source:
<code>private ExportPanelForm(ConfigurationPanel confPanel, FormsTable formsTable) { this.confPanel = confPanel; this.confPanelForm = confPanel.getForm(); this.formsTable = formsTable; this.formsTableForm = formsTable.getView(); $$$setupUI$$$(); <START> exportingLabel.setMinimumSize(exportingLabel.getPreferredSize()); <END> exportingLabel.setPreferredSize(exportingLabel.getPreferredSize()); selectAllButton.addActionListener(__ -> formsTable.selectAll()); clearAllButton.addActionListener(__ -> formsTable.clearAll()); exporting = false; }</code><technical_language>Please, set params IntelliJ's UI Designer</technical_language>

Target:
private ExportPanelForm(ConfigurationPanel confPanel, FormsTable formsTable) { this.confPanel = confPanel; this.confPanelForm = confPanel.getForm(); this.formsTable = formsTable; this.formsTableForm = formsTable.getView(); $$$setupUI$$$(); selectAllButton.addActionListener(__ -> formsTable.selectAll()); clearAllButton.addActionListener(__ -> formsTable.clearAll()); exporting = false; }
Source:
<code><START> public CompositeMessageConverter getMessageConverterForTargetType(MimeType targetMimeType) { <END> List<MessageConverter> targetMimeTypeConverters = new ArrayList<MessageConverter>(); for (MessageConverter converter : converters) { if (converter instanceof TargetTypeMessageConverter) { TargetTypeMessageConverter targetTypeMessageConverter = (TargetTypeMessageConverter) converter; if (targetTypeMessageConverter.supportsTargetMimeType(targetMimeType)) { targetMimeTypeConverters.add(converter); } } } if (CollectionUtils.isEmpty(targetMimeTypeConverters)) { throw new ConversionException("No message converter is registered for " + targetMimeType.toString()); } return new CompositeMessageConverter(targetMimeTypeConverters); }</code><technical_language>rename: getMessageConverterForTarget_Mime_Type</technical_language>

Target:
public CompositeMessageConverter getMessageConverterForTargetType(MimeType targetMimeType) { List<MessageConverter> targetMimeTypeConverters = new ArrayList<MessageConverter>(); for (MessageConverter converter : converters) { if (converter instanceof TargetMimeTypeMessageConverter) { TargetMimeTypeMessageConverter targetTypeMessageConverter = (TargetMimeTypeMessageConverter) converter; if (!ObjectUtils.isEmpty(targetTypeMessageConverter.getSupportedJavaTypes(targetMimeType))) { targetMimeTypeConverters.add(converter); } } } if (CollectionUtils.isEmpty(targetMimeTypeConverters)) { throw new ConversionException("No message converter is registered for " + targetMimeType.toString()); } return new CompositeMessageConverter(targetMimeTypeConverters); }
Source:
<code><START> public boolean restartInErrorTask(final JobId jobId, final String taskName) <END> throws UnknownJobException, UnknownTaskException { try { if (status.isUnusable()) { return false; } Boolean result = infrastructure.getClientOperationsThreadPool().submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { jobs.restartInErrorTask(jobId, taskName); wakeUpSchedulingThread(); return Boolean.TRUE; } }).get(); return result; } catch (ExecutionException e) { if (e.getCause() instanceof UnknownTaskException) { throw (UnknownTaskException) e.getCause(); } else if (e.getCause() instanceof UnknownJobException) { throw (UnknownJobException) e.getCause(); } else { throw launderThrowable(e.getCause()); } } catch (Exception e) { throw launderThrowable(e); } }</code><technical_language>![MAJOR](<LINK_1> Cyclomatic Complexity of this method "restartInErrorTask" is 13 is greater 10 authorized. [![rule](<LINK_2>](<LINK_3> ![MAJOR](<LINK_1> Refactor this method throw checked exception instead of: org.ow2.proactive.scheduler.common.exception.UnknownJobException, org.ow2.proactive.scheduler.common.exception.UnknownTaskException [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public boolean restartInErrorTask(final JobId jobId, final String taskName) throws UnknownJobException, UnknownTaskException { try { if (status.isUnusable()) { return false; } return infrastructure.getClientOperationsThreadPool().submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { jobs.restartInErrorTask(jobId, taskName); wakeUpSchedulingThread(); return Boolean.TRUE; } }).get(); } catch (ExecutionException e) { if (e.getCause() instanceof UnknownTaskException) { throw (UnknownTaskException) e.getCause(); } else if (e.getCause() instanceof UnknownJobException) { throw (UnknownJobException) e.getCause(); } else { throw launderThrowable(e.getCause()); } } catch (Exception e) { throw launderThrowable(e); } }
Source:
<code>private static Observable<Integer> createSource(int numItems) { <START> return Observable.fromPublisher(publisher -> { <END> for (int i = 1; i <= numItems; i++) { publisher.onNext(i); } }); }</code><technical_language>Observable.range(1, numItems) better</technical_language>

Target:
private static Observable<Integer> createSource(int numItems) { return Observable.range(1, numItems) .concatWith(Observable.never()); }
Source:
<code>public void test_presentValue_formula_shift() { CurrencyAmount computedCaplet = PRICER.presentValue(CAPLET_LONG, RATES, SHIFTED_VOLS); CurrencyAmount computedFloorlet = PRICER.presentValue(FLOORLET_SHORT, RATES, SHIFTED_VOLS); double forward = RATES.iborIndexRates(EUR_EURIBOR_3M).rate(RATE_COMP.getObservation()); double expiry = SHIFTED_VOLS.relativeTime(CAPLET_LONG.getFixingDateTime()); double volatility = SHIFTED_VOLS.volatility(expiry, STRIKE, forward); double df = RATES.discountFactor(EUR, CAPLET_LONG.getPaymentDate()); double shift = IborCapletFloorletDataSet.SHIFT; double expectedCaplet = NOTIONAL * df * CAPLET_LONG.getYearFraction() * BlackFormulaRepository.price(forward + shift, STRIKE + shift, expiry, volatility, true); <START> double expectedFloorlet = -NOTIONAL * df * CAPLET_LONG.getYearFraction() * <END> BlackFormulaRepository.price(forward + shift, STRIKE + shift, expiry, volatility, false); assertEquals(computedCaplet.getCurrency(), EUR); assertEquals(computedCaplet.getAmount(), expectedCaplet, NOTIONAL * TOL); assertEquals(computedFloorlet.getCurrency(), EUR); assertEquals(computedFloorlet.getAmount(), expectedFloorlet, NOTIONAL * TOL); }</code><technical_language>FLOORLET_SHORT.getYearFraction(). if year fractions is more readable Floorlet version</technical_language>

Target:
public void test_presentValue_formula_shift() { CurrencyAmount computedCaplet = PRICER.presentValue(CAPLET_LONG, RATES, SHIFTED_VOLS); CurrencyAmount computedFloorlet = PRICER.presentValue(FLOORLET_SHORT, RATES, SHIFTED_VOLS); double forward = RATES.iborIndexRates(EUR_EURIBOR_3M).rate(RATE_COMP.getObservation()); double expiry = SHIFTED_VOLS.relativeTime(CAPLET_LONG.getFixingDateTime()); double volatility = SHIFTED_VOLS.volatility(expiry, STRIKE, forward); double df = RATES.discountFactor(EUR, CAPLET_LONG.getPaymentDate()); double shift = IborCapletFloorletDataSet.SHIFT; double expectedCaplet = NOTIONAL * df * CAPLET_LONG.getYearFraction() * BlackFormulaRepository.price(forward + shift, STRIKE + shift, expiry, volatility, true); double expectedFloorlet = -NOTIONAL * df * FLOORLET_SHORT.getYearFraction() * BlackFormulaRepository.price(forward + shift, STRIKE + shift, expiry, volatility, false); assertEquals(computedCaplet.getCurrency(), EUR); assertEquals(computedCaplet.getAmount(), expectedCaplet, NOTIONAL * TOL); assertEquals(computedFloorlet.getCurrency(), EUR); assertEquals(computedFloorlet.getAmount(), expectedFloorlet, NOTIONAL * TOL); }
Source:
<code>public static File findIndex(final File samFile) { File indexFile; final String fileName = samFile.getName(); if (fileName.endsWith(BamFileIoUtils.BAM_FILE_EXTENSION)) { final String bai = fileName.substring(0, fileName.length() - BamFileIoUtils.BAM_FILE_EXTENSION.length()) + BAMIndex.BAMIndexSuffix; indexFile = new File(samFile.getParent(), bai); if (indexFile.isFile()) return indexFile; } else if (fileName.endsWith(CramIO.CRAM_FILE_EXTENSION)) { final String crai = fileName.substring(0, fileName.length() - CramIO.CRAM_FILE_EXTENSION.length()) + CRAIIndex.CRAIIndexSuffix; indexFile = new File(samFile.getParent(), crai); if (indexFile.isFile()) return indexFile; indexFile = new File(samFile.getParent(), samFile.getName() + CRAIIndex.CRAIIndexSuffix); if (indexFile.isFile()) return indexFile; } indexFile = new File(samFile.getParent(), samFile.getName() + BAMIndex.BAMIndexSuffix); <START> if (indexFile.isFile()) <END> return indexFile; return null; }</code><technical_language>Move a single line switch if ... {</technical_language>

Target:
public static File findIndex(final File samFile) { File indexFile; final String fileName = samFile.getName(); if (fileName.endsWith(BamFileIoUtils.BAM_FILE_EXTENSION)) { final String bai = fileName.substring(0, fileName.length() - BamFileIoUtils.BAM_FILE_EXTENSION.length()) + BAMIndex.BAMIndexSuffix; indexFile = new File(samFile.getParent(), bai); if (indexFile.isFile()) { return indexFile; } } else if (fileName.endsWith(CramIO.CRAM_FILE_EXTENSION)) { final String crai = fileName.substring(0, fileName.length() - CramIO.CRAM_FILE_EXTENSION.length()) + CRAIIndex.CRAI_INDEX_SUFFIX; indexFile = new File(samFile.getParent(), crai); if (indexFile.isFile()) { return indexFile; } indexFile = new File(samFile.getParent(), samFile.getName() + CRAIIndex.CRAI_INDEX_SUFFIX); if (indexFile.isFile()) { return indexFile; } } indexFile = new File(samFile.getParent(), samFile.getName() + BAMIndex.BAMIndexSuffix); if (indexFile.isFile()) { return indexFile; } return null; }
Source:
<code>protected Image getCachedImage(final String key, Rectangle clientArea, Graphics graphics) { Image result = <START> AbstractCachedSVGFigure.SVG_IMG_CACHE.getIfPresent(key); <END> if (result == null) { Document document = getDocument(); if (document == null) { return null; } getTranscoder().setCanvasSize(getSpecifyCanvasWidth() ? clientArea.width : -1, getSpecifyCanvasHeight() ? clientArea.height : -1); updateRenderingHints(graphics); BufferedImage awtImage = getTranscoder().getBufferedImage(); if (awtImage != null) { result = toSWT(Display.getCurrent(), awtImage); SVG_IMG_CACHE.put(key, result); } } return result; }</code><technical_language>SVG_IMG_CACHE in line 173 change others calls</technical_language>

Target:
protected Image getCachedImage(final String key, Rectangle clientArea, Graphics graphics) { Image result = AbstractCachedSVGFigure.SVG_IMG_CACHE.getIfPresent(key); if (result == null) { Document document = getDocument(); if (document == null) { return null; } getTranscoder().setCanvasSize(getSpecifyCanvasWidth() ? clientArea.width : -1, getSpecifyCanvasHeight() ? clientArea.height : -1); updateRenderingHints(graphics); BufferedImage awtImage = getTranscoder().getBufferedImage(); if (awtImage != null) { result = toSWT(Display.getCurrent(), awtImage); AbstractCachedSVGFigure.SVG_IMG_CACHE.put(key, result); } } return result; }
Source:
<code>private void generateActionDoc(Method method, Predicate<Parameter> predicate) { buffer.startComment(); if (method.getDoc() != null) { generateDocText(method); buffer.addLine(); } if (method.parameters().filter(predicate).findFirst().orElse(null) != null) { List<String> lines = method.parameters() .filter(predicate) .filter(p -> p.getDoc() != null) .map(p -> String.format("`%s`:: %s", pythonNames.getMemberStyleName(p.getName()), p.getDoc())) .collect(toList()); if (!lines.isEmpty()) { buffer.addLine("This method supports the following parameters:"); buffer.addLine(); lines.forEach(this::generateDocText); buffer.addLine("`headers`:: Additional HTTP headers."); buffer.addLine(); buffer.addLine("`query`:: Additional URL query parameters."); buffer.addLine(); buffer.addLine("`wait`:: If <START> true wait <END> for the response."); } } buffer.endComment(); }</code><technical_language>True, capital T</technical_language>

Target:
private void generateActionDoc(Method method, Predicate<Parameter> predicate) { buffer.startComment(); if (method.getDoc() != null) { generateDocText(method); buffer.addLine(); } if (method.parameters().filter(predicate).findFirst().orElse(null) != null) { List<String> lines = method.parameters() .filter(predicate) .filter(p -> p.getDoc() != null) .map(p -> String.format("`%s`:: %s", pythonNames.getMemberStyleName(p.getName()), p.getDoc())) .collect(toList()); if (!lines.isEmpty()) { buffer.addLine("This method supports the following parameters:"); buffer.addLine(); lines.forEach(this::generateDocText); buffer.addLine("`headers`:: Additional HTTP headers."); buffer.addLine(); buffer.addLine("`query`:: Additional URL query parameters."); buffer.addLine(); buffer.addLine("`wait`:: If `True` wait for the response."); } } buffer.endComment(); }