auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void processClassesForSchema() { try { final JAXBContext context = JAXBContext.newInstance(schemaClasses.toArray(new Class[schemaClasses.size()])); final List<StreamResult> results = new ArrayList<>(); context.generateSchema(new SchemaOutputResolver() { int counter = 0; @Override public Result createOutput(final String namespaceUri, final String suggestedFileName) { final StreamResult result = new StreamResult(new CharArrayWriter()); String systemId = "xsd" + (counter++) + ".xsd"; result.setSystemId(systemId); results.add(result); return result; } }); if (grammars != null) { Iterator<Include> iter = grammars.getInclude().iterator(); while (iter.hasNext()) { for (Doc doc : iter.next().getDoc()) { if ("Generated".equals(doc.getTitle())) ; iter.remove(); } } } addGrammars(new Grammars()); for (final StreamResult result : results) { final CharArrayWriter writer = (CharArrayWriter) result.getWriter(); final byte[] contents = writer.toString().getBytes("UTF8"); generatedSchemas.put( result.getSystemId(), contents); Include inc = new Include(); inc.setHref(result.getSystemId()); Doc doc = new Doc(); doc.setTitle("Generated"); doc.setLang("en"); inc.getDoc().add(doc); this.grammars.getInclude().add(inc); } } catch (JAXBException e) { e.printStackTrace(); } catch (IOException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>do for exception handling here? (at proper logging)</technical_language>

Target:
private void processClassesForSchema() { try { final JAXBContext context = JAXBContext.newInstance(schemaClasses.toArray(new Class[schemaClasses.size()])); final List<StreamResult> results = new ArrayList<>(); context.generateSchema(new SchemaOutputResolver() { int counter = 0; @Override public Result createOutput(final String namespaceUri, final String suggestedFileName) { final StreamResult result = new StreamResult(new CharArrayWriter()); String systemId = "xsd" + (counter++) + ".xsd"; result.setSystemId(systemId); results.add(result); return result; } }); if (grammars != null) { Iterator<Include> iter = grammars.getInclude().iterator(); while (iter.hasNext()) { for (Doc doc : iter.next().getDoc()) { if ("Generated".equals(doc.getTitle())) ; iter.remove(); } } } addGrammars(new Grammars()); for (final StreamResult result : results) { final CharArrayWriter writer = (CharArrayWriter) result.getWriter(); final byte[] contents = writer.toString().getBytes("UTF8"); generatedSchemas.put( result.getSystemId(), contents); Include inc = new Include(); inc.setHref(result.getSystemId()); Doc doc = new Doc(); doc.setTitle("Generated"); doc.setLang("en"); inc.getDoc().add(doc); this.grammars.getInclude().add(inc); } } catch (JAXBException e) { LogMessages.LOGGER.error(Messages.MESSAGES.cantProcessWadl()); } catch (IOException e) { LogMessages.LOGGER.error(Messages.MESSAGES.cantProcessWadl()); } }
Source:
<code><START> void fireActivity(final TextSelectionActivity activity) { <END> checkSWTAccess(); if (currentSelectionActivity == null) { currentSelectionActivity = activity; display.timerExec(DELAY, this::flushCurrentSelectionActivity); } else if (currentSelectionActivity.getPath().equals(activity.getPath())) { currentSelectionActivity = activity; } else { flushCurrentSelectionActivity(); currentSelectionActivity = activity; display.timerExec(DELAY, this::flushCurrentSelectionActivity); } }</code><technical_language>behavior of other fireActivity(...) methods change in future? Otherwise, consider fireActivity(IActivity) method differentiate activity types internally. This allow avoid code duplication for other methods</technical_language>

Target:
void fireActivity(final TextSelectionActivity activity) { if (!checkThreadAccess(activity)) return; if (currentSelectionActivity == null) { currentSelectionActivity = activity; display.timerExec(DELAY, this::flushCurrentSelectionActivity); } else if (currentSelectionActivity.getPath().equals(activity.getPath())) { currentSelectionActivity = activity; } else { flushCurrentSelectionActivity(); currentSelectionActivity = activity; display.timerExec(DELAY, this::flushCurrentSelectionActivity); } }
Source:
<code>protected Object unwrapCachedValue(Object cached) { if (currentKey instanceof EnhancerKey) { <START> return ((WeakReference<EnhancerFactoryData>) cached).get(); <END> } return super.unwrapCachedValue(cached); }</code><technical_language>Please revert this policy: > Please refrain modifying classes org.springframework.asm, org.springframework.cglib, org.springframework.objenesis. include repackaged forks of third-party libraries ASM, CGLIB, Objenesis. refactoring classes place upstream in originating repository. Spring Framework pick changes syncing official updates of forked third-party libraries</technical_language>

Target:
protected Object unwrapCachedValue(Object cached) { if (currentKey instanceof EnhancerKey) { EnhancerFactoryData data = ((WeakReference<EnhancerFactoryData>) cached).get(); return data; } return super.unwrapCachedValue(cached); }
Source:
<code>public Job numberGeneratorNotifierJob(JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory, @Qualifier("NotificationStep") Step notificationStep ) { int[] billableData = {11, -2, -3}; Step dataProviderStep = numberGeneratorStep(stepBuilderFactory, billableData, "Second Dataset Processor"); return jobBuilderFactory.get("Number generator - second dataset") .start(dataProviderStep) <START> .on("NOTIFY").to(notificationStep) <END> .end() .build(); }</code><technical_language>consider a constant for "NOTIFY" is repeated times</technical_language>

Target:
public Job numberGeneratorNotifierJob(JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory, @Qualifier("NotificationStep") Step notificationStep) { int[] billableData = { 11, -2, -3 }; Step dataProviderStep = numberGeneratorStep(stepBuilderFactory, billableData, "Second Dataset Processor"); return jobBuilderFactory.get("Number generator - second dataset") .start(dataProviderStep) .on(NOTIFY) .to(notificationStep) .end() .build(); }
Source:
<code>public String evaluate(String url) throws HiveException { RefererClassification kind = Webrequest.classifyReferer(url); switch (kind) { <START> case UNKNOWN: return "UNK"; <END> case INTERNAL: return "INT"; case EXTERNAL: return "EXT"; } return "UNK"; }</code><technical_language>I short names necessary. full titles here? Also, is a need for capitalizing them. So, 'unknown', 'internal', 'external' fine, ja? talk this. If return a string, do RefererClassifaction enum, declare some constants in Webrequest for this, eh</technical_language>

Target:
public String evaluate(String url) throws HiveException { return Webrequest.getInstance().classifyReferer(url); }
Source:
<code>public void start() { try { Map<String, MonitorConfig> monitorConfigs = getMonitorConfigs(config); for (Map.Entry<String, MonitorConfig> entry : monitorConfigs.entrySet()) { String monitorName = entry.getKey(); MonitorConfig monitorConfig = entry.getValue(); if (!Strings.isNullOrEmpty(monitorConfig.getMonitorFactoryClass())) { int schedulingIntervalInMs = monitorConfig.getSchedulingIntervalInMs(); int monitorSchedulingJitterInMs = (int) (RANDOM.nextInt(schedulingIntervalInMs + 1) * (monitorConfig.getSchedulingJitterPercent() / 100.0)); schedulingIntervalInMs += monitorSchedulingJitterInMs; LOGGER.info("Scheduling the monitor: to run every ms.", monitorName, schedulingIntervalInMs); <START> getScheduler() <END> .scheduleAtFixedRate(getRunnable(instantiateMonitor(monitorName, monitorConfig, metricsRegistry)), 0, schedulingIntervalInMs, TimeUnit.MILLISECONDS); } else { LOGGER.warn("Not scheduling the monitor: to run, since monitor factory class is not set in config.", monitorName); } } } catch (InstantiationException e) { LOGGER.error("Exception when instantiating the monitor : ", e); throw new SamzaException(e); } }</code><technical_language>s/getScheduler/createScheduler</technical_language>

Target:
public void start() { try { Map<String, MonitorConfig> monitorConfigs = getMonitorConfigs(config); for (Map.Entry<String, MonitorConfig> entry : monitorConfigs.entrySet()) { String monitorName = entry.getKey(); MonitorConfig monitorConfig = entry.getValue(); if (!Strings.isNullOrEmpty(monitorConfig.getMonitorFactoryClass())) { int schedulingIntervalInMs = monitorConfig.getSchedulingIntervalInMs(); int monitorSchedulingJitterInMs = (int) (RANDOM.nextInt(schedulingIntervalInMs + 1) * (monitorConfig.getSchedulingJitterPercent() / 100.0)); schedulingIntervalInMs += monitorSchedulingJitterInMs; LOGGER.info("Scheduling the monitor: to run every ms.", monitorName, schedulingIntervalInMs); createSchedulerAndScheduleMonitor(monitorName, monitorConfig, schedulingIntervalInMs); } else { LOGGER.warn("Not scheduling the monitor: to run, since monitor factory class is not set in config.", monitorName); } } } catch (InstantiationException e) { LOGGER.error("Exception when instantiating the monitor : ", e); throw new SamzaException(e); } }
Source:
<code>public void emitStats( String tier, MasterStats stats, List<ServerHolder> serverHolderList ) { <START> return; <END> }</code><technical_language>this needed</technical_language>

Target:
public void emitStats( String tier, MasterStats stats, List<ServerHolder> serverHolderList ) { }
Source:
<code>void addClassLoadingMetrics(List<MetricFamilySamples> sampleFamilies) { sampleFamilies.add( new MetricFamilySamples( <START> "jvm_classloading_loaded_current", <END> Type.GAUGE, "The number of classes that are currently loaded in the JVM", Collections.singletonList( new MetricFamilySamples.Sample( "jvm_classloading_loaded_current", EMPTY_LABEL, EMPTY_LABEL, clBean.getLoadedClassCount())))); sampleFamilies.add( new MetricFamilySamples( "jvm_classloading_loaded_total", Type.COUNTER, "The total number of classes that have been loaded since the JVM has started execution", Collections.singletonList( new MetricFamilySamples.Sample( "jvm_classloading_loaded_total", EMPTY_LABEL, EMPTY_LABEL, clBean.getTotalLoadedClassCount())))); sampleFamilies.add( new MetricFamilySamples( "jvm_classloading_unloaded_total", Type.COUNTER, "The total number of classes that have been unloaded since the JVM has started execution", Collections.singletonList( new MetricFamilySamples.Sample( "jvm_classloading_unloaded_total", EMPTY_LABEL, EMPTY_LABEL, clBean.getUnloadedClassCount())))); }</code><technical_language>drop _current I jmv_classes_... read here</technical_language>

Target:
void addClassLoadingMetrics(List<MetricFamilySamples> sampleFamilies) { sampleFamilies.add( new MetricFamilySamples( "jvm_classes_loaded", Type.GAUGE, "The number of classes that are currently loaded in the JVM", Collections.singletonList( new MetricFamilySamples.Sample( "jvm_classes_loaded", EMPTY_LABEL, EMPTY_LABEL, clBean.getLoadedClassCount())))); sampleFamilies.add( new MetricFamilySamples( "jvm_classes_loaded_total", Type.COUNTER, "The total number of classes that have been loaded since the JVM has started execution", Collections.singletonList( new MetricFamilySamples.Sample( "jvm_classes_loaded_total", EMPTY_LABEL, EMPTY_LABEL, clBean.getTotalLoadedClassCount())))); sampleFamilies.add( new MetricFamilySamples( "jvm_classes_unloaded_total", Type.COUNTER, "The total number of classes that have been unloaded since the JVM has started execution", Collections.singletonList( new MetricFamilySamples.Sample( "jvm_classes_unloaded_total", EMPTY_LABEL, EMPTY_LABEL, clBean.getUnloadedClassCount())))); }
Source:
<code>public void processEvent(GlusterEvent event) { if (event == null) { return; } GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid(Guid.createGuidFromString(event.getNodeId())); if (glusterServer == null) { return; } VDS host = vdsDao.get(glusterServer.getId()); if (host == null) { return; } GlusterVolumeEntity vol = glusterVolumeDao.getByName(host.getClusterId(), (String)event.getMessage().get("volume")); if (vol == null) { return; } if (event.getEvent().equalsIgnoreCase("BRICK_DISCONNECTED") || event.getEvent().equalsIgnoreCase("BRICK_CONNECTED") ) { GlusterStatus status = event.getEvent().equalsIgnoreCase("BRICK_DISCONNECTED") ? GlusterStatus.DOWN : GlusterStatus.UP; String path = (String) event.getMessage().get("brick"); String peer = (String) event.getMessage().get("peer"); List<VDS> vdsList = vdsDao.getAllForCluster(host.getClusterId()); VDS vds = vdsList.stream() .filter(v -> <START> v.getName().equals(peer) <END> || v.getInterfaces().stream().anyMatch(iface -> iface.getIpv4Address().equals(peer))) .findFirst() .orElse(null); GlusterBrickEntity brick = vds != null ? glusterBrickDao.getBrickByServerIdAndDirectory(vds.getId(), path) : null; if (brick != null) { glusterBrickDao.updateBrickStatus(brick.getId(), status); } else { backend.runInternalAction(VdcActionType.RefreshGlusterVolumeDetails, new GlusterVolumeParameters(vol.getId())); } logBrickStatusChange(vol, status, brick); } }</code><technical_language>if name is some other FQDN resolves someIP/Gluster network IP in system?. I resolve name IP address match IP address in GlusterVolumesListReturnForXmlRpc.isSameNetworkAddress()</technical_language>

Target:
public void processEvent(GlusterEvent event) { if (event == null) { return; } GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid(Guid.createGuidFromString(event.getNodeId())); if (glusterServer == null) { return; } VDS host = vdsDao.get(glusterServer.getId()); if (host == null) { return; } GlusterVolumeEntity vol = glusterVolumeDao.getByName(host.getClusterId(), (String) event.getMessage().get("volume")); if (vol == null) { return; } if (event.getEvent().equalsIgnoreCase("BRICK_DISCONNECTED") || event.getEvent().equalsIgnoreCase("BRICK_CONNECTED")) { GlusterStatus status = event.getEvent().equalsIgnoreCase("BRICK_DISCONNECTED") ? GlusterStatus.DOWN : GlusterStatus.UP; String path = (String) event.getMessage().get("brick"); String peer = (String) event.getMessage().get("peer"); List<VDS> vdsList = vdsDao.getAllForCluster(host.getClusterId()); VDS vds = vdsList.stream() .filter(v -> v.getName().equals(peer) || v.getInterfaces().stream().anyMatch(iface -> iface.getIpv4Address().equals(peer))) .findFirst() .orElse(null); GlusterBrickEntity brick = vds != null ? glusterBrickDao.getBrickByServerIdAndDirectory(vds.getId(), path) : null; if (brick != null) { glusterBrickDao.updateBrickStatus(brick.getId(), status); logBrickStatusChange(vol, status, brick); } else { log.debug("Forcing sync as brick event '{}' received that could not be resolved to brick", event); backend.runInternalAction(VdcActionType.RefreshGlusterVolumeDetails, new GlusterVolumeParameters(vol.getId())); } } }
Source:
<code>public Builder disablePagination() { <START> this.limit = null; <END> return (Builder) this; }</code><technical_language>this be: this.limit = Integer.MAX_VALUE? default page size (25) 25 users returned</technical_language>

Target:
public Builder disablePagination() { this.limit = Integer.MAX_VALUE; return (Builder) this; }
Source:
<code>public String[] getOptionValues(final String optionName) { final String[] values = this.cmd.getOptionValues(optionName); <START> if ((values == null) || (values.length == 0)) { <END> return null; } return values; }</code><technical_language>This replaced a guard method</technical_language>

Target:
public String[] getOptionValues(final String optionName) { final String[] values = this.cmd.getOptionValues(optionName); if (values == null || values.length == 0) { return null; } return values; }
Source:
<code>@Test public void startingFormMap_doesNotZoom_ifThereAreNoInstanceMarkers_andLocationIsUnavailable() { ActivityController controller = RobolectricHelpers.buildThemedActivity(FormMapActivity.class); FormMapActivity activity = (FormMapActivity) controller.get(); TestInstancesRepository testInstancesRepository = new TestInstancesRepository(new ArrayList<>()); FormMapViewModel viewModel = new FormMapViewModel(FormMapViewModelTest.testForm1, testInstancesRepository); activity.viewModelFactory = new TestFactory(viewModel); activity.map = new TestMapFragment(); <START> controller.setup().visible().start().resume(); <END> TestMapFragment map = (TestMapFragment) activity.map; assertThat(map.getZoomCount(), is(0)); }</code><technical_language>setup runs method calls (unless meaning lifecycle twice). I wrote method</technical_language>

Target:
@Test public void startingFormMap_doesNotZoom_ifThereAreNoInstanceMarkers_andLocationIsUnavailable() { ActivityController controller = RobolectricHelpers.buildThemedActivity(FormMapActivity.class); FormMapActivity activity = (FormMapActivity) controller.get(); TestInstancesRepository testInstancesRepository = new TestInstancesRepository(new ArrayList<>()); FormMapViewModel viewModel = new FormMapViewModel(FormMapViewModelTest.TEST_FORM_1, testInstancesRepository); activity.viewModelFactory = new TestFactory(viewModel); activity.map = new TestMapFragment(); controller.setup(); TestMapFragment map = (TestMapFragment) activity.map; assertThat(map.getZoomCount(), is(0)); }
Source:
<code>public String resolveDeploymentContextBasedVipAddresses(String vipAddressMacro) { String result = vipAddressMacro; <START> if (vipAddressMacro == null) { <END> return null; } Matcher matcher = VIP_ATTRIBUTES_PATTERN.matcher(result); while (matcher.find()) { String key = matcher.group(1); String value = config.getString(key, ""); logger.debug("att:" + matcher.group()); logger.debug(", att key:" + key); logger.debug(", att value:" + value); logger.debug(""); result = result.replaceAll("\\$\\{" + key + "\\}", value); matcher = VIP_ATTRIBUTES_PATTERN.matcher(result); } return result; }</code><technical_language>Feels this check initializing result</technical_language>

Target:
public String resolveDeploymentContextBasedVipAddresses(String vipAddressMacro) { if (vipAddressMacro == null) { return null; } String result = vipAddressMacro; Matcher matcher = VIP_ATTRIBUTES_PATTERN.matcher(result); while (matcher.find()) { String key = matcher.group(1); String value = config.getString(key, ""); logger.debug("att:" + matcher.group()); logger.debug(", att key:" + key); logger.debug(", att value:" + value); logger.debug(""); result = result.replaceAll("\\$\\{" + key + "\\}", value); matcher = VIP_ATTRIBUTES_PATTERN.matcher(result); } return result; }
Source:
<code>protected boolean deleteViews(Collection<? extends View> views) { for (View view : views) { <START> ViewUtil.destroy(view); <END> } return !views.isEmpty(); }</code><technical_language>ViewUtil.destroy(View) GMF CrossReferenceAdapter removed</technical_language>

Target:
protected boolean deleteViews(Collection<? extends View> views) { for (View view : views) { EcoreUtil.remove(view); } return !views.isEmpty(); }
Source:
<code>private JsonNode readCacheFile() { <START> try (BufferedReader br = new BufferedReader(new FileReader(file))) { <END> return new JsonNode(br.readLine()); } catch (IOException | JSONException e) { Slimefun.getLogger().log(Level.WARNING, "Failed to read Github cache file: {0}", file.getName()); return null; } }</code><technical_language>Reader StandardCharsets.UTF_8 here</technical_language>

Target:
private JsonNode readCacheFile() { try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) { return new JsonNode(br.readLine()); } catch (IOException | JSONException e) { Slimefun.getLogger().log(Level.WARNING, "Failed to read Github cache file: {0}", file.getName()); return null; } }
Source:
<code>public Map<String, DeviceGroupDto> findDeviceGroup( @PathVariable("id") Long id) { final Map<String, DeviceGroupDto> response = new HashMap<String, DeviceGroupDto>(); <START> DeviceGroup s = deviceGroupDao.getByKey(id); <END> DeviceGroupDto dto = null; if (s != null) { dto = marshallToDto(s); } response.put("device_group", dto); return response; }</code><technical_language>a small detail referring DeviceGroup s (in POST PUT methods) threw a little. I expecting a survey I in line marshallToDto(s)</technical_language>

Target:
public Map<String, DeviceGroupDto> findDeviceGroup( @PathVariable("id") Long id) { final Map<String, DeviceGroupDto> response = new HashMap<String, DeviceGroupDto>(); DeviceGroup dg = deviceGroupDao.getByKey(id); DeviceGroupDto dto = null; if (dg != null) { dto = marshallToDto(dg); } response.put("device_group", dto); return response; }
Source:
<code>public void makeTextView(FormEntryPrompt prompt) { mStringAnswer = new TextView(getContext()); mStringAnswer.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mAnswerFontsize); mStringAnswer.setGravity(Gravity.CENTER); String s = prompt.getAnswerText(); if (s != null) { launchIntentButton.setText(StringUtils.getStringSpannableRobust(getContext(), R.string.intent_callout_button_update)); mStringAnswer.setText(s); } <START> addView(mStringAnswer); <END> if(s == null && "quick".equals(ic.getAppearance()) && !ic.getCancelled()){ performCallout(); } else if (ic.getCancelled()) { ic.setCancelled(false); } }</code><technical_language>If bug is this is null startup, applies condition (s != null, results in a direct dereference), cleaned this is accepted</technical_language>

Target:
public void makeTextView(FormEntryPrompt prompt) { mStringAnswer = new TextView(getContext()); mStringAnswer.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mAnswerFontsize); mStringAnswer.setGravity(Gravity.CENTER); String s = prompt.getAnswerText(); if (s != null) { mStringAnswer.setText(s); } addView(mStringAnswer); if(s == null && "quick".equals(ic.getAppearance()) && !ic.getCancelled()){ performCallout(); } else if (ic.getCancelled()) { ic.setCancelled(false); } }
Source:
<code>public void import_report() { orchestrator.resetData(); orchestrator.getServer().provisionProject(PROJECT, PROJECT); orchestrator.getServer().associateProjectToQualityProfile(PROJECT, "py", "no_rule"); orchestrator.executeBuild( SonarScanner.create() <START> .setDebugLogs(true) <END> .setProjectDir(new File("projects/bandit_project"))); assertThat(issues()).hasSize(1); }</code><technical_language>is debug logging necessary</technical_language>

Target:
public void import_report() { orchestrator.resetData(); orchestrator.getServer().provisionProject(PROJECT, PROJECT); orchestrator.getServer().associateProjectToQualityProfile(PROJECT, "py", "no_rule"); orchestrator.executeBuild( SonarScanner.create() .setProjectDir(new File("projects/bandit_project"))); List<Issues.Issue> issues = issues(); boolean externalIssuesSupported = orchestrator.getServer().version().isGreaterThanOrEquals(7, 2); if (externalIssuesSupported) { assertThat(issues).hasSize(1); Issues.Issue issue = issues.get(0); assertThat(issue.getComponent()).isEqualTo("bandit_project:src/file1.py"); assertThat(issue.getRule()).isEqualTo("external_bandit:B107"); assertThat(issue.getMessage()).isEqualTo("Possible hardcoded password: 'secret'"); assertThat(issue.getType()).isEqualTo(Common.RuleType.VULNERABILITY); assertThat(issue.getSeverity()).isEqualTo(Common.Severity.MINOR); assertThat(issue.getEffort()).isEqualTo("5min"); } else { assertThat(issues).hasSize(0); } }
Source:
<code>private static List<MarkerMetadataSet> buildMarkerMetadataSet(final Dataset dataset, final Map<String, Marker> markerMap) { <START> List<MarkerMetadataSet> markerMetadataSetList = new ArrayList<>(); <END> for (final Marker marker : markerMap.values()) { final MarkerMetadataSet mdb = new MarkerMetadataSet(); mdb.setDataset(dataset); mdb.setMarkerId(marker.getMarkerId()); mdb.setMarkerSampleId(1); markerMetadataSetList.add(mdb); } return markerMetadataSetList; }</code><technical_language>Please add final</technical_language>

Target:
private static List<MarkerMetadataSet> buildMarkerMetadataSet(final Dataset dataset, final Map<String, Marker> markerMap) { final List<MarkerMetadataSet> markerMetadataSetList = new ArrayList<>(); for (final Marker marker : markerMap.values()) { final MarkerMetadataSet mdb = new MarkerMetadataSet(); mdb.setDataset(dataset); mdb.setMarkerId(marker.getMarkerId()); mdb.setMarkerSampleId(1); markerMetadataSetList.add(mdb); } return markerMetadataSetList; }
Source:
<code>public void addBasePeerConfigsIfNotPresent(Configuration conf) { String basePeerConfigs = conf.get(HBASE_REPLICATION_PEER_BASE_CONFIG, ""); Map<String,String> receivedPeerConfigMap = this.getConfiguration(); if (basePeerConfigs.length() != 0) { Map<String, String> basePeerConfigMap = Splitter.on(';').trimResults().omitEmptyStrings() .withKeyValueSeparator("=").split(basePeerConfigs); for (Map.Entry<String,String> entry : basePeerConfigMap.entrySet()) { String configName = entry.getKey(); String configValue = entry.getValue(); <START> if (!receivedPeerConfigMap.containsKey(configName)) { <END> receivedPeerConfigMap.put(configName, configValue); } } } }</code><technical_language>nit: this.configuration directly</technical_language>

Target:
public void addBasePeerConfigsIfNotPresent(Configuration conf) { String basePeerConfigs = conf.get(HBASE_REPLICATION_PEER_BASE_CONFIG, ""); if (basePeerConfigs.length() != 0) { Map<String, String> basePeerConfigMap = Splitter.on(';').trimResults().omitEmptyStrings() .withKeyValueSeparator("=").split(basePeerConfigs); for (Map.Entry<String,String> entry : basePeerConfigMap.entrySet()) { String configName = entry.getKey(); String configValue = entry.getValue(); if (!this.getConfiguration().containsKey(configName)) { this.getConfiguration().put(configName, configValue); } } } }
Source:
<code>public List<RowMap> jsonMaps() { ArrayList<RowMap> list = new ArrayList<>(); Object value; for ( Iterator<Row> ri = filteredRows().iterator() ; ri.hasNext(); ) { Row r = ri.next(); RowMap rowMap = new RowMap( getType(), getDatabase().getName(), getTable().getName(), getHeader().getTimestamp() / 1000, <START> table.getPKList(), <END> this.getNextBinlogPosition()); if ( this.txCommit && !ri.hasNext() ) rowMap.setTXCommit(); Iterator<Column> colIter = r.getColumns().iterator(); Iterator<ColumnDef> defIter = table.getColumnList().iterator(); while ( colIter.hasNext() && defIter.hasNext() ) { Column c = colIter.next(); ColumnDef d = defIter.next(); if (c instanceof DatetimeColumn) { value = ((DatetimeColumn) c).getLongValue(); } else { value = c.getValue(); } if ( value != null ) value = d.asJSON(value); rowMap.putData(d.getName(), value); } list.add(rowMap); } return list; }</code><technical_language>setting this</technical_language>

Target:
public List<RowMap> jsonMaps() { ArrayList<RowMap> list = new ArrayList<>(); Object value; for ( Iterator<Row> ri = filteredRows().iterator() ; ri.hasNext(); ) { Row r = ri.next(); RowMap rowMap = new RowMap( getType(), getDatabase().getName(), getTable().getName(), getHeader().getTimestamp() / 1000, table.getPKList(), this.getNextBinlogPosition()); Iterator<Column> colIter = r.getColumns().iterator(); Iterator<ColumnDef> defIter = table.getColumnList().iterator(); while ( colIter.hasNext() && defIter.hasNext() ) { Column c = colIter.next(); ColumnDef d = defIter.next(); if (c instanceof DatetimeColumn) { value = ((DatetimeColumn) c).getLongValue(); } else { value = c.getValue(); } if ( value != null ) value = d.asJSON(value); rowMap.putData(d.getName(), value); } list.add(rowMap); } return list; }
Source:
<code>public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.Calypso_AlertDialog); builder.setTitle(R.string.role); builder.setNegativeButton(R.string.cancel, null); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (mListener != null) { String role = mRoleListAdapter.getSelectedRole(); Bundle args = getArguments(); if (args != null) { long personID = args.getLong(PERSON_ID_TAG); int localTableBlogId = args.getInt(PERSON_LOCAL_TABLE_BLOG_ID_TAG); mListener.onRoleChanged(personID, localTableBlogId, role); } } } }); if (mRoleListAdapter == null) { final String[] roles = getResources().getStringArray(R.array.roles); mRoleListAdapter = new RoleListAdapter(getActivity(), R.layout.role_list_row, roles); } Bundle args = getArguments(); if (args != null) { String role = args.getString(ROLE_TAG); <START> mRoleListAdapter.setSelectedRole(role); <END> } builder.setAdapter(mRoleListAdapter, null); return builder.create(); }</code><technical_language>cover case device is rotating dialog open. In usual drill, savedInstanceState pass currently selected Role. Cheers</technical_language>

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.Calypso_AlertDialog); builder.setTitle(R.string.role); builder.setNegativeButton(R.string.cancel, null); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (mListener != null) { String role = mRoleListAdapter.getSelectedRole(); Bundle args = getArguments(); if (args != null) { long personID = args.getLong(PERSON_ID_TAG); int localTableBlogId = args.getInt(PERSON_LOCAL_TABLE_BLOG_ID_TAG); mListener.onRoleChanged(personID, localTableBlogId, role); } } } }); if (mRoleListAdapter == null) { final String[] roles = getResources().getStringArray(R.array.roles); mRoleListAdapter = new RoleListAdapter(getActivity(), R.layout.role_list_row, roles); } if (savedInstanceState != null) { String savedRole = savedInstanceState.getString(ROLE_TAG); mRoleListAdapter.setSelectedRole(savedRole); } else { Bundle args = getArguments(); if (args != null) { String role = args.getString(ROLE_TAG); mRoleListAdapter.setSelectedRole(role); } } builder.setAdapter(mRoleListAdapter, null); return builder.create(); }
Source:
<code>public List<Subscription> listSubscriptions(final Set<String> eventTypes, final Optional<String> owningApplication, final int offset, final int limit) throws ServiceTemporarilyUnavailableException { final StringBuilder queryBuilder = new StringBuilder("SELECT s_subscription_object FROM zn_data.subscription "); final List<String> clauses = Lists.newArrayList(); final List<Object> params = Lists.newArrayList(); owningApplication.ifPresent(owningApp -> { clauses.add(" s_subscription_object->>'owning_application' = ? "); params.add(owningApp); }); if (!eventTypes.isEmpty()) { final String clause = eventTypes.stream() .map(et -> " s_subscription_object->'event_types' @> ?::jsonb") .collect(Collectors.joining(" AND ")); clauses.add(clause); eventTypes.stream() .map(et -> format("\"{0}\"", et)) .forEach(params::add); } if (!clauses.isEmpty()) { queryBuilder.append(" WHERE "); queryBuilder.append(StringUtils.join(clauses, " AND ")); } queryBuilder.append(" ORDER BY s_subscription_object->>'created_at' DESC LIMIT ? OFFSET ? "); <START> if (limit >= 0) { <END> params.add(limit); } else { params.add("NULL"); } params.add(offset); try { return jdbcTemplate.query(queryBuilder.toString(), params.toArray(), rowMapper); } catch (final DataAccessException e) { LOG.error("Database error when listing subscriptions", e); throw new ServiceTemporarilyUnavailableException("Error occurred when running database request"); } }</code><technical_language>change is clear, is a default passed of 20 is a check in SubscriptionService</technical_language>

Target:
public List<Subscription> listSubscriptions(final Set<String> eventTypes, final Optional<String> owningApplication, final int offset, final int limit) throws ServiceTemporarilyUnavailableException { final StringBuilder queryBuilder = new StringBuilder("SELECT s_subscription_object FROM zn_data.subscription "); final List<String> clauses = Lists.newArrayList(); final List<Object> params = Lists.newArrayList(); owningApplication.ifPresent(owningApp -> { clauses.add(" s_subscription_object->>'owning_application' = ? "); params.add(owningApp); }); if (!eventTypes.isEmpty()) { final String clause = eventTypes.stream() .map(et -> " s_subscription_object->'event_types' @> ?::jsonb") .collect(Collectors.joining(" AND ")); clauses.add(clause); eventTypes.stream() .map(et -> format("\"{0}\"", et)) .forEach(params::add); } if (!clauses.isEmpty()) { queryBuilder.append(" WHERE "); queryBuilder.append(StringUtils.join(clauses, " AND ")); } queryBuilder.append(" ORDER BY s_subscription_object->>'created_at' DESC LIMIT ? OFFSET ? "); params.add(limit); params.add(offset); try { return jdbcTemplate.query(queryBuilder.toString(), params.toArray(), rowMapper); } catch (final DataAccessException e) { LOG.error("Database error when listing subscriptions", e); throw new ServiceTemporarilyUnavailableException("Error occurred when running database request"); } }
Source:
<code>private void saveVmGuestAgentNetworkDevices() { if (!vmGuestAgentNics.isEmpty()) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { for (Guid vmId : vmGuestAgentNics.keySet()) { getDbFacade().getVmGuestAgentInterfaceDao().removeAllForVm(vmId); } for (List<VmGuestAgentInterface> nics : vmGuestAgentNics.values()) { <START> if (nics != null && !nics.isEmpty()) { <END> for (VmGuestAgentInterface nic : nics) { getDbFacade().getVmGuestAgentInterfaceDao().save(nic); } } } return null; } }); } }</code><technical_language>reason check 'is empty'</technical_language>

Target:
private void saveVmGuestAgentNetworkDevices() { if (!vmGuestAgentNics.isEmpty()) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { for (Guid vmId : vmGuestAgentNics.keySet()) { getDbFacade().getVmGuestAgentInterfaceDao().removeAllForVm(vmId); } for (List<VmGuestAgentInterface> nics : vmGuestAgentNics.values()) { if (nics != null) { for (VmGuestAgentInterface nic : nics) { getDbFacade().getVmGuestAgentInterfaceDao().save(nic); } } } return null; } }); } }
Source:
<code>public void testWaitForViewInstallationDisconnectDS() { InternalDistributedSystem system = getSystem(); ClusterDistributionManager dm = (ClusterDistributionManager) system.getDM(); MembershipView<InternalDistributedMember> view = dm.getDistribution().getView(); AtomicBoolean waitForViewInstallationDone = new AtomicBoolean(); executorService.submit(() -> { try { dm.waitForViewInstallation(view.getViewId() + 1); waitForViewInstallationDone.set(true); } catch (InterruptedException e) { errorCollector.addError(e); } }); <START> await().timeout(2000, TimeUnit.MILLISECONDS); <END> system.disconnect(); await() .untilAsserted(() -> assertThat(waitForViewInstallationDone.get()).isTrue()); }</code><technical_language>pauses this tests periodically fail in CI. Waiting for a semaphore triggered executor thread better</technical_language>

Target:
public void testWaitForViewInstallationDisconnectDS() throws InterruptedException, TimeoutException, BrokenBarrierException, ExecutionException { InternalDistributedSystem system = getSystem(); ClusterDistributionManager dm = (ClusterDistributionManager) system.getDM(); MembershipView<InternalDistributedMember> view = dm.getDistribution().getView(); CyclicBarrier cyclicBarrier = new CyclicBarrier(2); Future future = executorService.submit(() -> { try { cyclicBarrier.await(getTimeout().toMillis(), TimeUnit.MILLISECONDS); dm.waitForViewInstallation(view.getViewId() + 1); } catch (InterruptedException | BrokenBarrierException | TimeoutException e) { errorCollector.addError(e); } }); cyclicBarrier.await(getTimeout().toMillis(), TimeUnit.MILLISECONDS); system.disconnect(); future.get(getTimeout().toMillis(), TimeUnit.MILLISECONDS); }
Source:
<code>public void Case2() { assertEquals(ImmutableList.of(4, 4, 4, 4, 4, 4), query().from(cat) .select(Expressions.cases().when(cat.toes.eq(2)).then(cat.id.multiply(2)) .when(cat.toes.eq(3)).then(cat.id.multiply(3)) .otherwise(4)).fetch()); List<Integer> rv = query().from(cat) <START> .select(Expressions.cases().when(cat.toes.eq(2)).then(cat.id.multiply(2)) <END> .when(cat.toes.eq(3)).then(cat.id.multiply(3)) .otherwise(4)).fetch(); assertInstancesOf(Integer.class, rv); }</code><technical_language>This query is run [statement above](<LINK_0> right</technical_language>

Target:
public void Case2() { assertEquals(ImmutableList.of(4, 4, 4, 4, 4, 4), query().from(cat) .select(Expressions.cases().when(cat.toes.eq(2)).then(cat.id.multiply(2)) .when(cat.toes.eq(3)).then(cat.id.multiply(3)) .otherwise(4)).fetch()); }
Source:
<code>private SpanId getNewSpanId() { <START> Span parentSpan = spanAndEndpoint().state().getCurrentLocalSpan(); <END> if (null == parentSpan) parentSpan = spanAndEndpoint().state().getCurrentServerSpan().getSpan(); long newSpanId = randomGenerator().nextLong(); SpanId.Builder builder = SpanId.builder().spanId(newSpanId); if (parentSpan == null) return builder.build(); return builder.traceId(parentSpan.getTrace_id()).parentId(parentSpan.getId()).build(); }</code><technical_language>If do this, parity logic in ClientTracer, copy/pasting here: java Span parentSpan = spanAndEndpoint().state().getCurrentLocalSpan(); if (parentSpan == null) { ServerSpan serverSpan = spanAndEndpoint().state().getCurrentServerSpan(); if (serverSpan != null) { parentSpan = serverSpan.getSpan(); } } for example, addresses null pointer</technical_language>

Target:
private SpanId getNewSpanId() { Span parentSpan = spanAndEndpoint().state().getCurrentLocalSpan(); if (parentSpan == null) { ServerSpan serverSpan = spanAndEndpoint().state().getCurrentServerSpan(); if (serverSpan != null) { parentSpan = serverSpan.getSpan(); } } long newSpanId = randomGenerator().nextLong(); SpanId.Builder builder = SpanId.builder().spanId(newSpanId); if (parentSpan == null) return builder.build(); return builder.traceId(parentSpan.getTrace_id()).parentId(parentSpan.getId()).build(); }
Source:
<code>public List<Service> getServicesBlockedOnDestination(int destinationId) { <START> return jdbc <END> .query("select " + ServicesManagerImpl.serviceMappingSelectQuery + " from services left join service_denials on service_denials.service_id = services.id where service_denials.destination_id = ?", ServicesManagerImpl.SERVICE_MAPPER, destinationId); }</code><technical_language>Please wrap calls of jdbc in try/catch do in other methods of ServicesManagerImpl. java try { // jdbc.query() jdbc.update() logic } catch(RuntimeException ex) { throw new InternalErrorException(ex); } want throw exception sql other runtime exceptions of Perun. If catch some exception, add this catch block last, more specific exceptions handled catch block rest of falls this generic block</technical_language>

Target:
public List<Service> getServicesBlockedOnDestination(int destinationId) throws InternalErrorException { try { return jdbc .query("select " + ServicesManagerImpl.serviceMappingSelectQuery + " from services left join service_denials on service_denials.service_id = services.id where service_denials.destination_id = ?", ServicesManagerImpl.SERVICE_MAPPER, destinationId); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
<code><START> public C convert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType) { <END> return filterAndConvert(key, oldValue, oldMetadata, newValue, newMetadata, eventType); }</code><technical_language>useful mark methods final</technical_language>

Target:
public final C convert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType) { return filterAndConvert(key, oldValue, oldMetadata, newValue, newMetadata, eventType); }
Source:
<code>public boolean readAndDispatch () { checkDevice (); runSkin (); runDeferredLayouts (); boolean events = false; events |= runSettings (); events |= runPopups (); OS.gdk_threads_leave(); events |= OS.g_main_context_iteration (0, false); <START> if (events && eventQueue != null) { <END> runDeferredEvents (); return true; } return isDisposed () || runAsyncMessages (false); }</code><technical_language>This is suspicious check runDeferredEvents check decide do anything</technical_language>

Target:
public boolean readAndDispatch () { checkDevice (); runSkin (); runDeferredLayouts (); boolean events = false; events |= runSettings (); events |= runPopups (); OS.gdk_threads_leave(); events |= OS.g_main_context_iteration (0, false); if (events && eventQueue != null) { if (runDeferredEvents ()) return true; } return isDisposed () || runAsyncMessages (false); }
Source:
<code>private void parse() throws URISyntaxException { if (string.trim().length() == 0) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_Blank, MENU_SCHEME, TABBAR_SCHEME)); } String[] locationsURI = string.split("\\" + LOCATION_SEPARATOR); if (locationsURI.length > 2) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_MoreThanTwoLocations, LOCATION_SEPARATOR, locationsURI.length)); } for (int i = 0; i < locationsURI.length; i++) { <START> if (locationsURI[i].startsWith(MENU_SCHEME)) { parseMenuURI(locationsURI[i]); } else if (locationsURI[i].startsWith(TABBAR_SCHEME)) { parseTabbarURI(locationsURI[i]); } else { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_WrongScheme, MENU_SCHEME, TABBAR_SCHEME)); } <END> } }</code><technical_language>String trimmedURI= locationsURI[i].trim(); if (trimmedURI.startsWith(MENU_SCHEME)) { parseMenuURI(trimmedURI); } else if (trimmedURI.startsWith(TABBAR_SCHEME)) { parseTabbarURI(trimmedURI); } else { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_WrongScheme, MENU_SCHEME, TABBAR_SCHEME)); }</technical_language>

Target:
private void parse() throws URISyntaxException { if (string.trim().length() == 0) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_Blank, MENU_SCHEME, TABBAR_SCHEME)); } String[] locationsURI = string.split("\\" + LOCATION_SEPARATOR); if (locationsURI.length > 2) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_MoreThanTwoLocations, LOCATION_SEPARATOR, locationsURI.length)); } for (int i = 0; i < locationsURI.length; i++) { String trimmedURI = locationsURI[i].trim(); if (trimmedURI.startsWith(MENU_SCHEME)) { parseMenuURI(trimmedURI); } else if (trimmedURI.startsWith(TABBAR_SCHEME)) { parseTabbarURI(trimmedURI); } else { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_WrongScheme, MENU_SCHEME, TABBAR_SCHEME)); } } }
Source:
<code>public int complete(CommandContext ctx, String buffer, int cursor, List<String> candidates) { this.ctx = ctx; this.buffer = buffer; final ValueTypeCallbackHandler handler; try { handler = parse(buffer); } catch (CommandFormatException e) { if (LOG.isEnabled(Level.WARN)) { LOG.log(Level.WARN, e.getLocalizedMessage(), e); } return -1; } try { final Collection<String> foundCandidates = handler.getCandidates(propDescr); if (foundCandidates.isEmpty()) { return -1; } candidates.addAll(foundCandidates); return handler.getCompletionIndex(); <START> } catch (Throwable th) { <END> if (LOG.isEnabled(Level.WARN)) { LOG.log(Level.WARN, th.getLocalizedMessage(), th); } return -1; } }</code><technical_language>this RuntimeException? recover Error if changes try block throws a non-Runtime Exception this catch logic is want. a big deal, fixed (or introduced myself!!) a fair number of bugs pop due code catch (Exception) catch (Throwable)</technical_language>

Target:
public int complete(CommandContext ctx, String buffer, int cursor, List<String> candidates) { this.ctx = ctx; this.buffer = buffer; final ValueTypeCallbackHandler handler; try { handler = parse(buffer); } catch (CommandFormatException e) { if (LOG.isEnabled(Level.WARN)) { LOG.log(Level.WARN, e.getLocalizedMessage(), e); } return -1; } try { final Collection<String> foundCandidates = handler.getCandidates(propDescr); if (foundCandidates.isEmpty()) { return -1; } candidates.addAll(foundCandidates); return handler.getCompletionIndex(); } catch (RuntimeException ex) { if (LOG.isEnabled(Level.WARN)) { LOG.log(Level.WARN, ex.getLocalizedMessage(), ex); } return -1; } }
Source:
<code>private static String trimSqlForDisplay(String sql) { <START> return Pattern.compile(TRIM_SQL_PATTERN_STRING).matcher(sql).replaceAll(" "); <END> }</code><technical_language>write this return sql.replaceAll(TRIM_SQL_PATTERN_STRING, " ");</technical_language>

Target:
private static String trimSqlForDisplay(String sql) { return sql.replaceAll("[\\s]*\\n+[\\s]*", " "); }
Source:
<code>public static <T extends Enum<T>> WmiResult<T> queryWMI(WmiQuery<T> query) { WmiResult<T> result = WbemcliUtil.INSTANCE.new WmiResult<>(query.getPropertyEnum()); if (failedWmiClassNames.contains(query.getWmiClassName())) { return result; } try { if (!isComInitialized()) { initCOM(); } result = query.execute(wmiTimeout); } catch (COMException e) { if (!OHM_NAMESPACE.equals(query.getNameSpace())) { <START> if (e.getHresult() == null) { <END> LOG.warn("COM exception (HRESULT == null): {}", e.getMessage()); } else { switch (e.getHresult().intValue()) { case Wbemcli.WBEM_E_INVALID_NAMESPACE: LOG.warn("COM exception: Invalid Namespace {}", query.getNameSpace()); break; case Wbemcli.WBEM_E_INVALID_CLASS: LOG.warn("COM exception: Invalid Class {}", query.getWmiClassName()); break; case Wbemcli.WBEM_E_INVALID_QUERY: LOG.warn("COM exception: Invalid Query: {}", queryToString(query)); break; default: LOG.warn( "COM exception querying {}, which might not be on your system. Will not attempt to query it again. Error was: {}:", query.getWmiClassName(), e.getMessage()); } } failedWmiClassNames.add(query.getWmiClassName()); } } catch (TimeoutException e) { LOG.error("WMI query timed out after ms: {}", wmiTimeout, queryToString(query)); } return result; }</code><technical_language>I create a temp int variable assign 0 if getHresult() returns null. this integer in switch, get existing longer/verbose default log message</technical_language>

Target:
public static <T extends Enum<T>> WmiResult<T> queryWMI(WmiQuery<T> query) { WmiResult<T> result = WbemcliUtil.INSTANCE.new WmiResult<>(query.getPropertyEnum()); if (failedWmiClassNames.contains(query.getWmiClassName())) { return result; } try { if (!isComInitialized()) { initCOM(); } result = query.execute(wmiTimeout); } catch (COMException e) { if (!OHM_NAMESPACE.equals(query.getNameSpace())) { final int hresult = e.getHresult() == null ? -1 : e.getHresult().intValue(); switch (hresult) { case Wbemcli.WBEM_E_INVALID_NAMESPACE: LOG.warn("COM exception: Invalid Namespace {}", query.getNameSpace()); break; case Wbemcli.WBEM_E_INVALID_CLASS: LOG.warn("COM exception: Invalid Class {}", query.getWmiClassName()); break; case Wbemcli.WBEM_E_INVALID_QUERY: LOG.warn("COM exception: Invalid Query: {}", queryToString(query)); break; default: LOG.warn( "COM exception querying {}, which might not be on your system. Will not attempt to query it again. Error was: {}:", query.getWmiClassName(), e.getMessage()); } failedWmiClassNames.add(query.getWmiClassName()); } } catch (TimeoutException e) { LOG.error("WMI query timed out after ms: {}", wmiTimeout, queryToString(query)); } return result; }
Source:
<code>public void testPhiroMoveMotorForwardBrick() { List<Integer> spinnerValuesResourceIds = Arrays.asList( R.string.phiro_motor_right, R.string.phiro_motor_left, <START> R.string.phiro_motor_both); <END> checkIfBrickAtPositionShowsString(0, R.string.brick_when_started); checkIfBrickAtPositionShowsString(brickPosition, R.string.brick_phiro_motor_forward_action); checkIfValuesAvailableInSpinnerOnBrick(spinnerValuesResourceIds, R.id.brick_phiro_motor_forward_action_spinner, brickPosition); enterValueInFormulaTextFieldOnBrickAtPosition(SET_SPEED, R.id.brick_phiro_motor_forward_action_speed_edit_text, brickPosition); }</code><technical_language>please instantiate list right check is used</technical_language>

Target:
public void testPhiroMoveMotorForwardBrick() { checkIfBrickAtPositionShowsString(0, R.string.brick_when_started); checkIfBrickAtPositionShowsString(brickPosition, R.string.brick_phiro_motor_forward_action); List<Integer> spinnerValuesResourceIds = Arrays.asList( R.string.phiro_motor_right, R.string.phiro_motor_left, R.string.phiro_motor_both); checkIfValuesAvailableInSpinnerOnBrick(spinnerValuesResourceIds, R.id.brick_phiro_motor_forward_action_spinner, brickPosition); enterValueInFormulaTextFieldOnBrickAtPosition(setSpeed, R.id.brick_phiro_motor_forward_action_speed_edit_text, brickPosition); }