auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Mask parseFromInput(String input, ParserContext context) throws InputParseException { if (!input.startsWith("$")) { return null; } Set<BaseBiome> biomes = new HashSet<>(); String[] biomesList = input.substring(1).split(","); <START> BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); <END> List<BaseBiome> knownBiomes = biomeRegistry.getBiomes(); for (String biomeName : biomesList) { BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry); if (biome == null) { throw new InputParseException("Unknown biome '" + biomeName + '\''); } biomes.add(biome); } return Masks.asMask(new BiomeMask2D(context.requireExtent(), biomes)); }</code><technical_language>This feel a BiomeTypes ItemTypes above. Possibly another PR</technical_language>

Target:
public Mask parseFromInput(String input, ParserContext context) throws InputParseException { if (!input.startsWith("$")) { return null; } Set<BaseBiome> biomes = new HashSet<>(); BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); List<BaseBiome> knownBiomes = biomeRegistry.getBiomes(); for (String biomeName : Splitter.on(",").split(input.substring(1))) { BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry); if (biome == null) { throw new InputParseException("Unknown biome '" + biomeName + '\''); } biomes.add(biome); } return Masks.asMask(new BiomeMask2D(context.requireExtent(), biomes)); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Post)) <START> return false; <END> Post post = (Post) o; return getId().equals(post.getId()); }</code><technical_language>{} applies</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Post)) { return false; } Post post = (Post) o; return getId().equals(post.getId()); }
Source:
<code>public void run(final int iteration) { LOG.log(Level.INFO, "Iteration Started"); int numSampledDocuments = 0; int miniBatchCount = 0; Map<Long, Document> workLoadMap = trainingDataProvider.getNextTrainingData(); <START> while (!workLoadMap.isEmpty()) { <END> final List<Document> workLoad = new ArrayList<>(workLoadMap.values()); final int batchSize = workLoad.size(); sampler.sample(workLoad); numSampledDocuments += batchSize; miniBatchCount++; LOG.log(Level.INFO, "{0} documents have been sampled, mini-batch count is {1}", new Object[]{numSampledDocuments, miniBatchCount}); workLoadMap = trainingDataProvider.getNextTrainingData(); } LOG.log(Level.INFO, "Start computing log likelihood"); final List<int[]> wordTopicCounts = parameterWorker.pull(vocabList); final int[] wordTopicCountsSummary = wordTopicCounts.remove(numVocabs); final Map<Long, Document> totalWorkloadMap = memoryStore.getAll(); final List<Document> totalWorkLoad = new ArrayList<>(totalWorkloadMap.values()); LOG.log(Level.INFO, "App metric log: {0}", buildAppMetrics(statCalculator.computeDocLLH(totalWorkLoad), statCalculator.computeWordLLH(wordTopicCounts, wordTopicCountsSummary))); LOG.log(Level.INFO, "Iteration Ended"); }</code><technical_language>workLoad -> workload</technical_language>

Target:
public void run(final int iteration) { final long iterationBeginMs = System.currentTimeMillis(); resetTracers(); final int numEMBlocks = memoryStore.getNumBlocks(); int miniBatchIdx = 0; int numDocumentsSampled = 0; final List<Document> totalDocumentsSampled = new LinkedList<>(); Map<Long, Document> nextTrainingData = trainingDataProvider.getNextTrainingData(); while (!nextTrainingData.isEmpty()) { final List<Document> documents = new ArrayList<>(nextTrainingData.values()); final int numDocumentsToSample = documents.size(); sampler.sample(documents.subList(numDocumentsSampled, numDocumentsSampled + numDocumentsToSample), computeTracer, pushTracer, pullTracer); numDocumentsSampled += numDocumentsToSample; totalDocumentsSampled.addAll(nextTrainingData.values()); LOG.log(Level.INFO, "{0} documents have been sampled until mini-batch {1}", new Object[]{numDocumentsSampled, miniBatchIdx}); miniBatchIdx++; nextTrainingData = trainingDataProvider.getNextTrainingData(); } final double elapsedTimeSec = (System.currentTimeMillis() - iterationBeginMs) / 1000.0D; LOG.log(Level.INFO, "Start computing log likelihood"); final List<int[]> wordTopicCounts = parameterWorker.pull(vocabList); final int[] wordTopicCountsSummary = wordTopicCounts.remove(numVocabs); final Metrics appMetrics = buildAppMetrics(statCalculator.computeDocLLH(totalDocumentsSampled), statCalculator.computeWordLLH(wordTopicCounts, wordTopicCountsSummary)); final WorkerMetrics workerMetrics = buildMetricsMsg(iteration, appMetrics, miniBatchIdx - 1, numEMBlocks, totalDocumentsSampled.size(), elapsedTimeSec); LOG.log(Level.INFO, "WorkerMetrics {0}", workerMetrics); sendMetrics(workerMetrics); }
Source:
<code>private void prepareTheme() { <START> String[] themeOptionsNames = {"Default", "Dark", "Light"}; <END> themeListPreference.setEntries(themeOptionsNames); themeListPreference.setEntryValues(themeOptionsNames); String currentTheme = getCurrentTheme(); if (currentTheme.equals("")){ themeListPreference.setSummary(themeOptionsNames[0]); themeListPreference.setValue(themeOptionsNames[0]); } else { int prefIndex = themeListPreference.findIndexOfValue(currentTheme); themeListPreference.setSummary(themeListPreference.getEntries()[prefIndex]); themeListPreference.setValue(currentTheme); } themeListPreference.setOnPreferenceChangeListener((preference, newValue) -> { String userSelectedValue = (String) newValue; int prefIndex = themeListPreference.findIndexOfValue(userSelectedValue); themeListPreference.setSummary(themeListPreference.getEntries()[prefIndex]); saveThemeValue(userSelectedValue); getActivity().recreate(); return true; }); }</code><technical_language>is separation UI data representation. strings untranslatable</technical_language>

Target:
private void prepareTheme() { themeListPreference.setSummary(getThemeSummary(getCurrentTheme())); themeListPreference.setOnPreferenceChangeListener((preference, newValue) -> { getActivity().recreate(); return true; }); }
Source:
<code>public void testValidReport() throws IOException, URISyntaxException { final Report report = OBJECT_MAPPER.readValue(loadResource("testValidReport"), Report.class); <START> assertEquals(new URI("<LINK_0>"), ((ChromeScreenshotReportSource) report.getSource()).getUri()); <END> assertTrue(report.getSchedule() instanceof OneOffSchedule); assertEquals(1, report.getRecipients().size()); assertEquals("nobody@example.com", report.getRecipients().get(0).getAddress()); }</code><technical_language>build entire bean do .equals for validation</technical_language>

Target:
public void testValidReport() throws IOException { final Report expected = new Report(); expected.setId(UUID.fromString("11111111-1111-1111-1111-111111111111")); expected.setName("My Report Name"); final ChromeScreenshotReportSource expectedSource = new ChromeScreenshotReportSource(); expectedSource.setId(UUID.fromString("22222222-2222-2222-2222-222222222222")); expectedSource.setUri(URI.create("<LINK_0>")); expectedSource.setTitle("My Report Title"); expectedSource.setIgnoreCertificateErrors(false); expectedSource.setTriggeringEventName("myTriggeringEventName"); expected.setSource(expectedSource); final OneOffSchedule expectedSchedule = new OneOffSchedule(); expectedSchedule.setRunAtAndAfter(Instant.parse("2019-01-01T00:00:00Z")); expected.setSchedule(expectedSchedule); final Recipient expectedRecipient = new Recipient(); expectedRecipient.setType(RecipientType.EMAIL); expectedRecipient.setId(UUID.fromString("33333333-3333-3333-3333-333333333333")); expectedRecipient.setAddress("nobody@example.com"); expectedRecipient.setFormat(new HtmlReportFormat()); expected.setRecipients(Lists.newArrayList(expectedRecipient)); final Report actual = loadResourceAs("testValidReport", Report.class); assertEquals(expected, actual); }
Source:
<code>public SpoutEntitySnapshot(Entity e) { if (e.isRemoved()) { throw new IllegalArgumentException("Can not take a snapshot of a removed entity"); } this.entity = new WeakReference<>(e); this.entityId = e.getId(); this.uniqueId = e.getUID(); this.location = e.getPhysics().getTransform(); this.worldName = e.getWorld().getName(); this.worldId = e.getWorld().getUID(); final NetworkComponent network = e.get(NetworkComponent.class); <START> this.viewDistance = network.getSyncDistance(); <END> this.observer = network.isObserver(); this.savable = e.isSavable(); if (e.getData().size() > 0) { this.dataMap = e.getData().deepCopy(); } else { this.dataMap = new ManagedHashMap(); } components = new ArrayList<>(); for (Component c : e.values()) { if (c.isDetachable()) { this.components.add(c.getClass()); } } }</code><technical_language>more naming</technical_language>

Target:
public SpoutEntitySnapshot(Entity e) { if (e.isRemoved()) { throw new IllegalArgumentException("Can not take a snapshot of a removed entity"); } this.entity = new WeakReference<>(e); this.entityId = e.getId(); this.uniqueId = e.getUID(); this.location = e.getPhysics().getTransform(); this.worldName = e.getWorld().getName(); this.worldId = e.getWorld().getUID(); final NetworkComponent network = e.get(NetworkComponent.class); this.syncDistance = network.getSyncDistance(); this.observer = network.isObserver(); this.savable = e.isSavable(); if (e.getData().size() > 0) { this.dataMap = e.getData().deepCopy(); } else { this.dataMap = new ManagedHashMap(); } components = new ArrayList<>(); for (Component c : e.values()) { if (c.isDetachable()) { this.components.add(c.getClass()); } } }
Source:
<code><START> public static int[] getWeekendDays(Locale locale) { <END> if (THU_FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.THURSDAY, Calendar.FRIDAY}; } else if (FRY_SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SUNDAY}; } else if (FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY}; } else if (SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.SUNDAY}; } else if (FRY_SAT_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SATURDAY}; } else { return new int[]{Calendar.SATURDAY, Calendar.SUNDAY}; } }</code><technical_language>this private</technical_language>

Target:
private static int[] getWeekendDays(Locale locale) { if (THU_FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.THURSDAY, Calendar.FRIDAY}; } else if (FRY_SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SUNDAY}; } else if (FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY}; } else if (SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.SUNDAY}; } else if (FRY_SAT_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SATURDAY}; } else { return new int[]{Calendar.SATURDAY, Calendar.SUNDAY}; } }
Source:
<code>private void copyResourcesToWorkerId(String workerId) throws IOException { final String testSuiteId = agent.getTestSuite().id; <START> if (!new File(WORKERS_PATH + testSuiteId + "/upload/").exists()) { <END> log.info("Skipping copy, since no copy file at the agent"); return; } String cpCommand = format("cp -rfv %s/%s/upload/* %s/%s/%s/", WORKERS_PATH, testSuiteId, WORKERS_PATH, testSuiteId, workerId); bash.execute(cpCommand); log.info(format("Finished copying resources file '%s' to worker", WORKERS_PATH)); }</code><technical_language>I a potential bug include a file seperator. test feature in a real environment</technical_language>

Target:
private void copyResourcesToWorkerId(String workerId) throws IOException { final String testSuiteId = agent.getTestSuite().id; File uploadDirectory = new File(WORKERS_PATH + "/" + testSuiteId + "/upload/"); if (!uploadDirectory.exists()) { log.debug("Skip copying upload directory to workers since no upload directory was found"); return; } String cpCommand = format("cp -rfv %s/%s/upload/* %s/%s/%s/", WORKERS_PATH, testSuiteId, WORKERS_PATH, testSuiteId, workerId); bash.execute(cpCommand); log.info(format("Finished copying '+%s+' to worker", WORKERS_PATH)); }
Source:
<code>public void launch() { List<String> commands = Lists.newLinkedList(); if (isPackageInstall()) { commands.add(addSbinPathCommand()); commands.add(sudo("service riak start")); } else { commands.add("ulimit -n 65536 || true"); commands.add(format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd())); } ScriptHelper launchScript = newScript(LAUNCHING) .body.append(commands); if (!isRiakOnPath()) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); launchScript.environmentVariablesReset(newPathVariable); } launchScript.failOnNonZeroResultCode().execute(); <START> final String mainUri = String.format("http://%s:%s/admin", entity.getAttribute(Attributes.HOSTNAME), entity.getAttribute(RiakNode.RIAK_WEB_PORT)); <END> entity.setAttribute(Attributes.MAIN_URI, URI.create(mainUri)); }</code><technical_language>need final</technical_language>

Target:
public void launch() { List<String> commands = Lists.newLinkedList(); if (isPackageInstall()) { commands.add(addSbinPathCommand()); commands.add(sudo("service riak start")); } else { commands.add("ulimit -n 65536 || true"); commands.add(format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd())); } ScriptHelper launchScript = newScript(LAUNCHING) .body.append(commands); if (!isRiakOnPath()) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); launchScript.environmentVariablesReset(newPathVariable); } launchScript.failOnNonZeroResultCode().execute(); String mainUri = String.format("http://%s:%s/admin", entity.getAttribute(Attributes.HOSTNAME), entity.getAttribute(RiakNode.RIAK_WEB_PORT)); entity.setAttribute(Attributes.MAIN_URI, URI.create(mainUri)); }
Source:
<code>public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPortsMirroring()) { entity.setPortMirroring(model.getPortsMirroring().isSetPortMirroring() && <START> model.getPortsMirroring().getPortMirroring().getNetwork().getName().equals(entity.getNetworkName())); <END> } return entity; }</code><technical_language>potential NPE .getNetwork().getName(), check if network is set</technical_language>

Target:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPortsMirroring() && model.getPortsMirroring().isSetPortMirroring()) { entity.setPortMirroring(model.getPortsMirroring().getPortMirroring().isSetNetwork()); } return entity; }
Source:
<code>public SplitOperator(Map<String, SerializablePredicate<R>> splitFns) { this.splitFns = splitFns; <START> for (String stream: splitFns.keySet()) { <END> StreamletUtils.checkNotBlank(stream, "Stream id can not be empty"); } }</code><technical_language>This is checked upper level</technical_language>

Target:
public SplitOperator(Map<String, SerializablePredicate<R>> splitFns) { this.splitFns = splitFns; }
Source:
<code>public InputStream getInputStream(RepoObject repoObject) throws RepoException { try{ return s3Client.getObject(repoObject.getBucketName(), repoObject.getChecksum()).getObjectContent(); <START> } catch (Exception e) { <END> throw new RepoException(e); } }</code><technical_language>Replace specific exception types</technical_language>

Target:
public InputStream getInputStream(RepoObject repoObject) throws RepoException { try{ return s3Client.getObject(repoObject.getBucketName(), repoObject.getChecksum()).getObjectContent(); } catch (AmazonClientException e) { throw new RepoException(e); } }
Source:
<code>protected boolean shouldSkipAuthentication(HttpServletRequest request, String token) { if (token == null) { if (request.getRequestURI() != null && request.getRequestURI().endsWith("api/keycloak/OIDCKeycloak.js")) { return true; } return false; } try { jwtParser.parse(token); return false; } catch (ExpiredJwtException | MalformedJwtException | SignatureException ex) { return false; } catch (JwtException e) { <START> return true; <END> } }</code><technical_language>For me, strange if exception parsing of jwttoken failed - authentication skipped. Is supposed this token validated next authentication filter</technical_language>

Target:
boolean shouldSkipAuthentication(HttpServletRequest request, String token) { if (token == null) { return request.getRequestURI() != null && request.getRequestURI().endsWith("api/keycloak/OIDCKeycloak.js"); } try { jwtParser.parse(token); return false; } catch (MachineTokenJwtException e) { return true; } }
Source:
<code>public static long getVirtualSize(InputStream inputStream) throws IOException { byte[] b = new byte[8]; if (inputStream.skip(VIRTUALSIZE_HEADER_LOCATION) != VIRTUALSIZE_HEADER_LOCATION) { throw new IOException("Unable to skip to the virtual size header"); } <START> if (inputStream.read(b) != 8) { <END> throw new IOException("Unable to properly read the size"); } return NumbersUtil.bytesToLong(b); }</code><technical_language>VIRTUALSIZE_HEADER_LENGTH here</technical_language>

Target:
public static long getVirtualSize(InputStream inputStream) throws IOException { byte[] bytes = new byte[VIRTUALSIZE_HEADER_LENGTH]; if (inputStream.skip(VIRTUALSIZE_HEADER_LOCATION) != VIRTUALSIZE_HEADER_LOCATION) { throw new IOException("Unable to skip to the virtual size header"); } if (inputStream.read(bytes) != VIRTUALSIZE_HEADER_LENGTH) { throw new IOException("Unable to properly read the size"); } return NumbersUtil.bytesToLong(bytes); }
Source:
<code>protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout = new GridLayout(1, false); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); container.setLayout(layout); Label label = new Label(container, 0); label.setText(this.bodyMsg); widgetButtonList = new ArrayList<>(); <START> int ButtonCount = 1; <END> for (Entry<String, String> usrbutton : userButtonList) { Button tmpButton = new Button(container, SWT.RADIO); tmpButton.setText(usrbutton.getValue()); if (ButtonCount == 1) { tmpButton.setSelection(true); ButtonCount++; } widgetButtonList.add(tmpButton); } return area; }</code><technical_language>Stick java naming convention - variable starts lowercase</technical_language>

Target:
protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout = new GridLayout(1, false); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); container.setLayout(layout); Label label = new Label(container, 0); label.setText(this.bodyMsg); widgetButtonList = new ArrayList<>(); int buttonCount = 1; for (Entry<String, String> usrbutton : userButtonList) { Button tmpButton = new Button(container, SWT.RADIO); tmpButton.setText(usrbutton.getValue()); if (buttonCount == 1) { tmpButton.setSelection(true); buttonCount++; } widgetButtonList.add(tmpButton); } return area; }
Source:
<code>private static String toPatch(String type, PatchSet.Id diffBase, PatchSet.Id revision, String fileName) { Change.Id c = revision.getParentKey(); StringBuilder p = new StringBuilder(); p.append("/c/").append(c).append("/"); if (diffBase != null) { p.append(diffBase.get()).append(".."); } <START> p.append(revision.get()).append("/").append(fileName); <END> if (type != null && !type.isEmpty()) { p.append(",").append(type); } return p.toString(); }</code><technical_language>This KeyUtil.encode()</technical_language>

Target:
private static String toPatch(String type, PatchSet.Id diffBase, PatchSet.Id revision, String fileName) { Change.Id c = revision.getParentKey(); StringBuilder p = new StringBuilder(); p.append("/c/").append(c).append("/"); if (diffBase != null) { p.append(diffBase.get()).append(".."); } p.append(revision.get()).append("/").append(KeyUtil.encode(fileName)); if (type != null && !type.isEmpty()) { p.append(",").append(type); } return p.toString(); }
Source:
<code>protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModules.isEmpty()) { return; } double[] xAxis = getXAxis(start, end, nb); setXAxis(xAxis); for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : fQuarks) { try { double[] steps = new double[nb]; ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < nb; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } setSeries(createSeriesName(ss, quark), steps); } catch (StateSystemDisposedException e) { <START> e.printStackTrace(); <END> } } } updateDisplay(); }</code><technical_language>This caught ignored. happen if trace is closed while update job is ongoing</technical_language>

Target:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModules.isEmpty()) { return; } double[] xAxis = getXAxis(start, end, nb); setXAxis(xAxis); for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : fQuarks) { try { double[] steps = new double[nb]; ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < nb; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } setSeries(createSeriesName(ss, quark), steps); } catch (StateSystemDisposedException e) { } } } updateDisplay(); }
Source:
<code>private long[] sketchOutTransactionStartOffsets() throws IOException { long[] offsets = new long[10_000]; int offsetCursor = 0; long startOffset = channel.position(); while ( transactionCursor.next() ) { if ( offsetCursor == offsets.length ) { offsets = Arrays.copyOf( offsets, offsetCursor * 2 ); } offsets[offsetCursor++] = startOffset; long nextStartOffset = channel.position(); assert nextStartOffset > startOffset : "It looks like this channel moved over to another version"; <START> startOffset = channel.position(); <END> } offsetsLength = offsetCursor; chunkStartOffsetIndex = offsetCursor; totalSize = channel.position(); return offsets; }</code><technical_language>Is a reason for nextStartOffset reassigning startOffset? channel.position() changed? Also, assert, is a sanity check while testing</technical_language>

Target:
private long[] sketchOutTransactionStartOffsets() throws IOException { long[] offsets = new long[10_000]; int offsetCursor = 0; long logVersion = channel.getVersion(); long startOffset = channel.position(); while ( transactionCursor.next() ) { if ( offsetCursor == offsets.length ) { offsets = Arrays.copyOf( offsets, offsetCursor * 2 ); } offsets[offsetCursor++] = startOffset; startOffset = channel.position(); } if ( channel.getVersion() != logVersion ) { throw new IllegalArgumentException( "The channel which was passed in bridged multiple log versions, it started at version " + logVersion + ", but continued through to version " + channel.getVersion() + ". This isn't supported" ); } offsetsLength = offsetCursor; chunkStartOffsetIndex = offsetCursor; totalSize = channel.position(); return offsets; }
Source:
<code>public <M> OutputStream<M> getOutputStream(String streamId, Serde<M> serde) { StreamSpec streamSpec = runner.getStreamSpec(streamId); Preconditions.checkNotNull(serde, "serde must not be null for an output stream."); Preconditions.checkState(!outputStreams.containsKey(streamSpec), "getOutputStream must not be called multiple times with the same streamId: " + streamId); KV<Serde, Serde> kvSerdes = getKVSerdes(streamId, serde); if (inputOperators.containsKey(streamSpec)) { InputOperatorSpec inputOperatorSpec = inputOperators.get(streamSpec); Serde keySerde = inputOperatorSpec.getKeySerde(); Serde valueSerde = inputOperatorSpec.getValueSerde(); Preconditions.checkState(kvSerdes.getKey().equals(keySerde) && kvSerdes.getValue().equals(valueSerde), String.format("Stream %s is being used both as an input and an output stream. Serde in Samza happens at " + "stream level, so the same key and message Serde must be used for both.", streamId)); } <START> boolean isKeyedOutput = serde instanceof KVSerde; <END> outputStreams.put(streamSpec, new OutputStreamImpl<>(streamSpec, kvSerdes.getKey(), kvSerdes.getValue(), isKeyedOutput)); return outputStreams.get(streamSpec); }</code><technical_language>Minor: s/isKeyedOutput/isKeyed Output appears redundant class is OutputStream</technical_language>

Target:
public <M> OutputStream<M> getOutputStream(String streamId, Serde<M> serde) { StreamSpec streamSpec = runner.getStreamSpec(streamId); Preconditions.checkNotNull(serde, "serde must not be null for an output stream."); Preconditions.checkState(!outputStreams.containsKey(streamSpec), "getOutputStream must not be called multiple times with the same streamId: " + streamId); KV<Serde, Serde> kvSerdes = getKVSerdes(streamId, serde); if (inputOperators.containsKey(streamSpec)) { InputOperatorSpec inputOperatorSpec = inputOperators.get(streamSpec); Serde keySerde = inputOperatorSpec.getKeySerde(); Serde valueSerde = inputOperatorSpec.getValueSerde(); Preconditions.checkState(kvSerdes.getKey().equals(keySerde) && kvSerdes.getValue().equals(valueSerde), String.format("Stream %s is being used both as an input and an output stream. Serde in Samza happens at " + "stream level, so the same key and message Serde must be used for both.", streamId)); } boolean isKeyed = serde instanceof KVSerde; outputStreams.put(streamSpec, new OutputStreamImpl<>(streamSpec, kvSerdes.getKey(), kvSerdes.getValue(), isKeyed)); return outputStreams.get(streamSpec); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { final List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (!StringUtils.isEmpty(getParameters().getCustomProperties())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } final Guid destinationVdsId = getParameters().getDestinationVdsId(); <START> if (destinationVdsId != null && !destinationVdsId.equals(getVm().getDedicatedVmForVds())) { <END> permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.EDIT_VM_PROPERTIES)); } return permissionList; }</code><technical_language>please check getVm() != null, this code runs canDoAction assume vm user exist</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { final List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (!StringUtils.isEmpty(getParameters().getCustomProperties())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } if (getVm() != null) { final Guid destinationVdsId = getParameters().getDestinationVdsId(); if (destinationVdsId != null && !destinationVdsId.equals(getVm().getDedicatedVmForVds())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.EDIT_VM_PROPERTIES)); } } return permissionList; }
Source:
<code>public void testTableTablesWithoutUpgrading() { long tableId = dao.insertTable("schema1", "table1", true, false, null, 0, false); <START> assertNotNull(tableId); <END> }</code><technical_language>need create tableId assign/assert it. code reach this point</technical_language>

Target:
public void testTableTablesWithoutUpgrading() { dao.insertTable("schema1", "table1", true, false, null, 0, false); }
Source:
<code>public void set(String name, Property property) throws PropertyException { try { int index = Integer.parseInt(name); children.set(index, property); setIsModified(); } catch (NumberFormatException e) { <START> throw new UnsupportedOperationException("Property name: " + name + " can not be used on property: " + this); <END> } }</code><technical_language>> Chid name instead of Property name</technical_language>

Target:
public void set(String name, Property property) throws PropertyException { try { int index = Integer.parseInt(name); children.set(index, property); setIsModified(); } catch (NumberFormatException e) { throw new UnsupportedOperationException("Child name: " + name + " cannot be used on property: " + this); } }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Object input) { List<String> blockIds = (List<String>)input; StringBuilder latestIds = new StringBuilder(); for (String id : blockIds) { latestIds.append("<Latest>").append(id).append("</Latest>"); } <START> final String content = String.format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + <END> "<BlockList>%s</BlockList>", latestIds); request.setPayload(content); return request; }</code><technical_language>build this String.format, appending prologue first</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { List<String> blockIds = (List<String>)input; StringBuilder content = new StringBuilder(); content.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); content.append("<BlockList>"); for (String id : blockIds) { content.append("<Latest>").append(id).append("</Latest>"); } content.append("</BlockList>"); request.setPayload(content.toString()); return request; }
Source:
<code>public static Message updatingRipeMaintainerSSOForbidden() { <START> return new Message(Type.ERROR, "You cannot update sso attributes as maintainer is synchronized in LIR portal"); <END> }</code><technical_language>re-word text 'You update SSO auth attribute(s), maintainer is synchronised LIR Portal'</technical_language>

Target:
public static Message updatingRipeMaintainerSSOForbidden() { return new Message(Type.ERROR, "You cannot update SSO auth attribute(s), because the maintainer is synchronised from the LIR Portal"); }
Source:
<code>public DIR.ServiceSet.Builder getOSDs(DIR.ServiceSet.Builder allOSDs) { List<DIR.Service> allServices = allOSDs.getServicesList(); List<DIR.Service> nonPreferredServices = new LinkedList<DIR.Service>(); DIR.Service preferredService = null; for (DIR.Service osd : allServices) { String currentUUID = new ServiceUUID(osd.getUuid()).toString(); if (currentUUID.equals(preferredUUID)) { preferredService = osd; } else { nonPreferredServices.add(osd); } } <START> Collections.shuffle(nonPreferredServices); <END> List<DIR.Service> OSDsInCorrectOrder = new LinkedList<DIR.Service>(); if (preferredService != null) { OSDsInCorrectOrder.add(0, preferredService); } OSDsInCorrectOrder.addAll(nonPreferredServices); return DIR.ServiceSet.newBuilder().addAllServices(OSDsInCorrectOrder); }</code><technical_language>Is is necessary shuffle non-preferred services? cost much, introduce unnecessary randomness system</technical_language>

Target:
public DIR.ServiceSet.Builder getOSDs(DIR.ServiceSet.Builder allOSDs) { List<DIR.Service> allServices = allOSDs.getServicesList(); List<DIR.Service> nonPreferredServices = new LinkedList<DIR.Service>(); DIR.Service preferredService = null; for (DIR.Service osd : allServices) { String currentUUID = new ServiceUUID(osd.getUuid()).toString(); if (currentUUID.equals(preferredUUID)) { preferredService = osd; } else { nonPreferredServices.add(osd); } } List<DIR.Service> OSDsInCorrectOrder = new LinkedList<DIR.Service>(); if (preferredService != null) { OSDsInCorrectOrder.add(0, preferredService); } OSDsInCorrectOrder.addAll(nonPreferredServices); return DIR.ServiceSet.newBuilder().addAllServices(OSDsInCorrectOrder); }
Source:
<code>protected Guid getUpServerId() { if (brick == null) { <START> return super.getUpServerId(clusterId); <END> } VDS brickServer = getVdsDao().get(brick.getServerId()); if (brickServer.getStatus() == VDSStatus.Up) { return brickServer.getId(); } return super.getUpServerId(clusterId); }</code><technical_language>super ref needed here</technical_language>

Target:
protected Guid getUpServerId() { if (brick == null) { return getUpServerId(clusterId); } VDS brickServer = getVdsDao().get(brick.getServerId()); if (brickServer.getStatus() == VDSStatus.Up) { return brickServer.getId(); } return super.getUpServerId(clusterId); }
Source:
<code>private boolean isIsoFileValid(String isoFile, OVirtNodeInfo[] Info) { boolean result = false; String pathRepo = null; if (StringUtils.isNotBlank(isoFile)) { for (OVirtNodeInfo infoData: Info) { <START> pathRepo = infoData.path + "/" + isoFile; <END> File path = new File(pathRepo); log.infoFormat("Validating ISOs path: {0}", pathRepo); if (path.exists()) { _isoFullPath = pathRepo; result = true; log.infoFormat("ISO found: {0}", pathRepo); break; } else { log.infoFormat("{0} is not a valid ISO path!", pathRepo); } } } return result; }</code><technical_language>new File(base, extra)</technical_language>

Target:
private boolean isIsoFileValid(String isoFile, OVirtNodeInfo[] Info) { boolean result = false; if (StringUtils.isNotBlank(isoFile)) { for (OVirtNodeInfo infoData: Info) { if (infoData.path != null) { File path = new File(infoData.path, isoFile); log.infoFormat("Validating ISOs path: {0}", path); if (path.exists()) { _isoFullPath = path.getAbsolutePath(); result = true; log.infoFormat("ISO found: {0}", path); break; } else { log.infoFormat("{0} is not a valid ISO path!", path); } } } } return result; }
Source:
<code>public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { if (!this.delegate.tryLock(time, unit)) { return false; } try { <START> return doLock(); <END> } catch (Exception e) { this.delegate.unlock(); throw e; } }</code><technical_language>This reflect tryLock(long time, TimeUnit unit) contract. obtain local lock wait for result DB desired time. for time is left local tryLock. transaction timeout</technical_language>

Target:
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { if (!this.delegate.tryLock(time, unit)) { return false; } try { return doLock(); } catch (RuntimeException e) { this.delegate.unlock(); throw e; } }
Source:
<code>public void putAll(final Map<? extends K, ? extends V> entries) throws BulkCacheWritingException { putAllObserver.begin(); statusTransitioner.checkAvailable(); checkNonNull(entries); if(entries.isEmpty()) { putAllObserver.end(PutAllOutcome.SUCCESS); return; } final Map<K, V> entriesToRemap = new HashMap<K, V>(); for (Map.Entry<? extends K, ? extends V> entry: entries.entrySet()) { if (entry.getKey() == null || entry.getValue() == null) { throw new NullPointerException(); } entriesToRemap.put(entry.getKey(), entry.getValue()); } <START> PutAllFunction<K, V> putAllFunction = new PutAllFunction<K, V>(logger, entriesToRemap, runtimeConfiguration.getExpiry()); <END> try { store.bulkCompute(entries.keySet(), putAllFunction); addBulkMethodEntriesCount(BulkOps.PUT_ALL, putAllFunction.getActualPutCount().get()); putAllObserver.end(PutAllOutcome.SUCCESS); } catch (StoreAccessException e) { try { resilienceStrategy.putAllFailure(entries, e); } finally { putAllObserver.end(PutAllOutcome.FAILURE); } } }</code><technical_language>I declare this variable try / catch block of it</technical_language>

Target:
public void putAll(final Map<? extends K, ? extends V> entries) throws BulkCacheWritingException { putAllObserver.begin(); statusTransitioner.checkAvailable(); checkNonNull(entries); if(entries.isEmpty()) { putAllObserver.end(PutAllOutcome.SUCCESS); return; } final Map<K, V> entriesToRemap = new HashMap<K, V>(); for (Map.Entry<? extends K, ? extends V> entry: entries.entrySet()) { if (entry.getKey() == null || entry.getValue() == null) { throw new NullPointerException(); } entriesToRemap.put(entry.getKey(), entry.getValue()); } try { PutAllFunction<K, V> putAllFunction = new PutAllFunction<K, V>(logger, entriesToRemap, runtimeConfiguration.getExpiry()); store.bulkCompute(entries.keySet(), putAllFunction); addBulkMethodEntriesCount(BulkOps.PUT_ALL, putAllFunction.getActualPutCount().get()); putAllObserver.end(PutAllOutcome.SUCCESS); } catch (StoreAccessException e) { try { resilienceStrategy.putAllFailure(entries, e); } finally { putAllObserver.end(PutAllOutcome.FAILURE); } } }
Source:
<code>public void testDataInfo() throws IOException, TasteException { <START> MovieRecommender recommender = new MovieRecommender("/Users/alonso/Documents/big-data-exercises/movies.txt.gz"); <END> assertEquals(7911684, recommender.getTotalReviews()); assertEquals(253059, recommender.getTotalProducts()); assertEquals(889176, recommender.getTotalUsers()); List<String> recommendations = recommender.getRecommendationsForUser("A141HP4LYPWMSR"); assertThat(recommendations, hasItem("B0002O7Y8U")); assertThat(recommendations, hasItem("B00004CQTF")); assertThat(recommendations, hasItem("B000063W82")); }</code><technical_language>hard coded paths good</technical_language>

Target:
public void testDataInfo() throws IOException, TasteException { MovieRecommender recommender = new MovieRecommender("movies.txt.gz"); assertEquals(7911684, recommender.getTotalReviews()); assertEquals(253059, recommender.getTotalProducts()); assertEquals(889176, recommender.getTotalUsers()); List<String> recommendations = recommender.getRecommendationsForUser("A141HP4LYPWMSR"); assertThat(recommendations, hasItem("B0002O7Y8U")); assertThat(recommendations, hasItem("B00004CQTF")); assertThat(recommendations, hasItem("B000063W82")); }
Source:
<code>public void testMdbUsable(Control control) throws Exception { InitialContext ctx = new InitialContext(); QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory"); QueueConnection connection = factory.createQueueConnection(); QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); <START> Queue queue = (Queue) ctx.lookup("java:jboss/exported/jms/queue/test"); <END> QueueSender sender = session.createSender(queue); sender.send(session.createTextMessage(MESSAGE)); control.getLatch().await(); Assert.assertTrue(control.isMessageDelivered()); Assert.assertTrue(control.isContextSet()); }</code><technical_language>Is safe a hard-coded JNDI name? I name of test queue change in next WildFly version able run tests multiple WildFly versions..</technical_language>

Target:
public void testMdbUsable(Control control) throws Exception { InitialContext ctx = new InitialContext(); QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory"); QueueConnection connection = factory.createQueueConnection(); QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = (Queue) ctx.lookup(WildFly8EEResourceManager.TEST_QUEUE_DESTINATION); QueueSender sender = session.createSender(queue); sender.send(session.createTextMessage(MESSAGE)); control.getLatch().await(); Assert.assertTrue(control.isMessageDelivered()); Assert.assertTrue(control.isContextSet()); }
Source:
<code>private SchemaTableName parseTableName(String schemaTableName) { try { checkArgument(!isNullOrEmpty(schemaTableName), "schemaTableName is null or is empty"); List<String> parts = Splitter.on('.').splitToList(schemaTableName); checkArgument(parts.size() == 2, "Invalid schemaTableName: %s", schemaTableName); return new SchemaTableName(parts.get(0), parts.get(1)); } <START> catch (IllegalArgumentException iae) { <END> return new SchemaTableName(defaultSchema, schemaTableName); } }</code><technical_language>Name exception argument clear reader IntelliJ intentionally ignoring it</technical_language>

Target:
private SchemaTableName parseTableName(String schemaTableName) { try { checkArgument(!isNullOrEmpty(schemaTableName), "schemaTableName is null or is empty"); List<String> parts = Splitter.on('.').splitToList(schemaTableName); checkArgument(parts.size() == 2, "Invalid schemaTableName: %s", schemaTableName); return new SchemaTableName(parts.get(0), parts.get(1)); } catch (IllegalArgumentException ignored) { return new SchemaTableName(defaultSchema, schemaTableName); } }
Source:
<code>public List<ContainerUUID> getContainersUUID(TemplateLayout layout) { final List<ContainerUUID> containerUUIDS = new ArrayList<>(); if (layout == null) { <START> return containerUUIDS; <END> } final List<TemplateLayoutRow> rows = layout.getBody().getRows(); for (final TemplateLayoutRow row : rows) { final List<TemplateLayoutColumn> columns = row.getColumns(); for (final TemplateLayoutColumn column : columns) { final List<ContainerUUID> columnContainers = column.getContainers(); containerUUIDS.addAll(columnContainers); } } Sidebar sidebar = layout.getSidebar(); if (sidebar != null && sidebar.getContainers() != null) { containerUUIDS.addAll(sidebar.getContainers()); } return containerUUIDS; }</code><technical_language>I change Collections.emptyList(); give memory containerUUIDS</technical_language>

Target:
public List<ContainerUUID> getContainersUUID(TemplateLayout layout) { final List<ContainerUUID> containerUUIDS = new ArrayList<>(); final List<TemplateLayoutRow> rows = layout.getBody().getRows(); for (final TemplateLayoutRow row : rows) { final List<TemplateLayoutColumn> columns = row.getColumns(); for (final TemplateLayoutColumn column : columns) { final List<ContainerUUID> columnContainers = column.getContainers(); containerUUIDS.addAll(columnContainers); } } Sidebar sidebar = layout.getSidebar(); if (sidebar != null && sidebar.getContainers() != null) { containerUUIDS.addAll(sidebar.getContainers()); } return containerUUIDS; }
Source:
<code>public void doPost(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { if (!UPLOAD_PACK_REQUEST_TYPE.equals(req.getContentType())) { rsp.sendError(SC_UNSUPPORTED_MEDIA_TYPE); return; } <START> if (ClientVersionUtil.hasChunkedRequestBug(req)) { <END> GitSmartHttpTools.sendError(req, rsp, SC_BAD_REQUEST, "\n\n" + HttpServerText.get().clientHas175ChunkedEncodingBug); return; } SmartOutputStream out = new SmartOutputStream(req, rsp) { @Override public void flush() throws IOException { doFlush(); } }; UploadPack up = (UploadPack) req.getAttribute(ATTRIBUTE_HANDLER); try { up.setBiDirectionalPipe(false); rsp.setContentType(UPLOAD_PACK_RESULT_TYPE); up.upload(getInputStream(req), out, null); out.close(); } catch (ServiceMayNotContinueException e) { if (e.isOutput()) { consumeRequestBody(req); out.close(); } else if (!rsp.isCommitted()) { rsp.reset(); sendError(req, rsp, SC_FORBIDDEN, e.getMessage()); } return; } catch (UploadPackInternalServerErrorException e) { getServletContext().log( HttpServerText.get().internalErrorDuringUploadPack, e.getCause()); consumeRequestBody(req); out.close(); } catch (Throwable e) { getServletContext().log(HttpServerText.get().internalErrorDuringUploadPack, e); if (!rsp.isCommitted()) { rsp.reset(); sendError(req, rsp, SC_INTERNAL_SERVER_ERROR); } return; } }</code><technical_language>Worth factoring this block GitSmartHttpTools</technical_language>

Target:
public void doPost(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { if (!UPLOAD_PACK_REQUEST_TYPE.equals(req.getContentType())) { rsp.sendError(SC_UNSUPPORTED_MEDIA_TYPE); return; } int[] version = parseVersion(req.getHeader(HDR_USER_AGENT)); if (hasChunkedEncodingRequestBug(version, req)) { GitSmartHttpTools.sendError(req, rsp, SC_BAD_REQUEST, "\n\n" + HttpServerText.get().clientHas175ChunkedEncodingBug); return; } SmartOutputStream out = new SmartOutputStream(req, rsp) { @Override public void flush() throws IOException { doFlush(); } }; UploadPack up = (UploadPack) req.getAttribute(ATTRIBUTE_HANDLER); try { up.setBiDirectionalPipe(false); rsp.setContentType(UPLOAD_PACK_RESULT_TYPE); up.upload(getInputStream(req), out, null); out.close(); } catch (ServiceMayNotContinueException e) { if (e.isOutput()) { consumeRequestBody(req); out.close(); } else if (!rsp.isCommitted()) { rsp.reset(); sendError(req, rsp, SC_FORBIDDEN, e.getMessage()); } return; } catch (UploadPackInternalServerErrorException e) { getServletContext().log( HttpServerText.get().internalErrorDuringUploadPack, e.getCause()); consumeRequestBody(req); out.close(); } catch (Throwable e) { getServletContext().log(HttpServerText.get().internalErrorDuringUploadPack, e); if (!rsp.isCommitted()) { rsp.reset(); sendError(req, rsp, SC_INTERNAL_SERVER_ERROR); } return; } }
Source:
<code>public VisualEditorPageObject clickInsertInfoboxFromInsertToolMenu() { <START> for (int i=0; i<insertMenuTools.size(); i++) { <END> if (insertMenuTools.get(i).getText().contentEquals("Infobox")) { insertMenuTools.get(i).click(); } } return this; }</code><technical_language>is this loop necessary? need click a single element? However, I wrong 100% is checked</technical_language>

Target:
public VisualEditorPageObject clickInsertInfoboxFromInsertToolMenu() { wait.forElementVisible(infoboxInDropdownMenu); infoboxInDropdownMenu.click(); return this; }