auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void main(String[] args) throws Exception { GrobidProperties.getInstance(); AcknowledgmentTrainer trainer = new AcknowledgmentTrainer(); AbstractTrainer.runTraining(trainer); <START> AbstractTrainer.runEvaluation(trainer); <END> System.exit(0); }</code><technical_language>yes, link in AbstractTrainer is a method called evaluateNFold (I'm remember)</technical_language>

Target:
public static void main(String[] args) throws Exception { GrobidProperties.getInstance(); AcknowledgmentTrainer trainer = new AcknowledgmentTrainer(); AbstractTrainer.runTraining(trainer); System.out.println(AbstractTrainer.runEvaluation(trainer)); System.exit(0); }
Source:
<code>protected void setActionMessageParameters() { if (getVdsGroup().supportsGlusterService() || getVdsGroup(getParameters().getClusterId()).supportsGlusterService()) { <START> addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MOVE); <END> addCanDoActionMessage(VdcBllMessages.VAR__TYPE__HOST); } }</code><technical_language>set messages cluster supports gluster? This a generic "Move Host" command, setting messages (VAR__ACTION__MOVE VAR__TYPE__HOST) ok irrespective of cluster supports gluster not</technical_language>

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MOVE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__HOST); }
Source:
<code>public boolean addJobToQueue(Job job) { <START> return Optional.of(job).map(scheduledJobs::add).isPresent(); <END> }</code><technical_language>This do this PR code smaller, unreadable. takes a minutes understand previous code straightforward understand. please revert this method? I 100% before..</technical_language>

Target:
public boolean addJobToQueue(Job job) { if (job != null) { return scheduledJobs.add(job); } return false; }
Source:
<code>public void testReadAttribute() throws Exception { CLIWrapper cli = new CLIWrapper(true); { assertTrue("Failed to read attribute: " + cli.readOutput(), <START> cli.sendLine("read-attribute namespaces", false)); <END> } { assertFalse("Expected command to fail on invalid node", cli.sendLine("read-attribute --node=subsystem=request-controller namespaces", true)); String output = cli.readOutput(); assertTrue(output.matches("WFLYCTL0201.*namespaces.*")); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute active-requests --node=subsystem=request-controller", false)); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute --node=subsystem=request-controller active-requests", false)); } cli.quit(); }</code><technical_language>I test, true passed sendLine method call in order ignore error return true if error, false is error occurred</technical_language>

Target:
public void testReadAttribute() throws Exception { CLIWrapper cli = new CLIWrapper(true); { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute namespaces", true)); } { assertFalse("Expected command to fail on invalid node", cli.sendLine("read-attribute --node=subsystem=request-controller namespaces", true)); String output = cli.readOutput(); assertTrue(output.matches("WFLYCTL0201.*namespaces.*")); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute active-requests --node=subsystem=request-controller", true)); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute --node=subsystem=request-controller active-requests", true)); } cli.quit(); }
Source:
<code>public WriteContext init(final Configuration configuration) { <START> schema = MessageTypeParser.parseMessageType(configuration.get("parquet.hive.schema")); <END> return new WriteContext(schema, new HashMap<>()); }</code><technical_language>static import parseMessageType</technical_language>

Target:
public WriteContext init(final Configuration configuration) { schema = parseMessageType(configuration.get("parquet.hive.schema")); return new WriteContext(schema, new HashMap<>()); }
Source:
<code>public void untrackedFileNotIncluded() throws Exception { String trackedPath = "tracked.txt"; writeTrashFile(trackedPath, "content2"); git.add().addFilepattern(trackedPath).call(); RevCommit stashed = git.stashCreate().call(); <START> assertNotNull(stashed); <END> validateStashedCommit(stashed); assertTrue("untracked file should be left untouched.", untrackedFile.exists()); assertEquals("content", read(untrackedFile)); }</code><technical_language>this is included in validateCoreStashedCommit()</technical_language>

Target:
public void untrackedFileNotIncluded() throws Exception { String trackedPath = "tracked.txt"; writeTrashFile(trackedPath, "content2"); git.add().addFilepattern(trackedPath).call(); RevCommit stashed = git.stashCreate().call(); validateStashedCommit(stashed); assertTrue("untracked file should be left untouched.", untrackedFile.exists()); assertEquals("content", read(untrackedFile)); }
Source:
<code>private Composite createFixedComp(Composite parent) { Composite comp = createComposite(parent); comp.setLayout(GridLayoutFactory.fillDefaults().create()); Label l = createLabel(comp, shortText); <START> l.setLayoutData(GridDataFactory.swtDefaults().create()); <END> return comp; }</code><technical_language>Avoid of swtDefaults(). fillDefaults() explicit alignment layout logic easier for others read. applyTo() is preferred create(...) attaching a control easy generate a ClassCastException if mistype this omit ".create()". applyTo version is shorter. Change this to: GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(l);</technical_language>

Target:
private Composite createFixedComp(Composite parent) { Composite comp = createComposite(parent); GridLayoutFactory.fillDefaults().applyTo(comp); Label l = createLabel(comp, shortText); GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(l); return comp; }
Source:
<code>public boolean childNodeAdded(String name, NodeState after) { <START> if(name.equals(FulltextIndexConstants.PROP_FACETS)) { <END> return true; } return super.childNodeAdded(name, after); }</code><technical_language>While I a good idea atm, I assumption change facets nodes requires a refresh. Yes, true for currently supported properties in future if add else requires reindexing slip caught. happier if adding facets/foo reindexes while adding facets/topChildren refreshes</technical_language>

Target:
public boolean childNodeAdded(String name, NodeState after) { if(name.equals(FulltextIndexConstants.PROP_FACETS)) { for(PropertyState property : after.getProperties()) { if(!ignorableFacetConfigProps.contains(property.getName())) return super.childNodeAdded(name, after); } return true; } return super.childNodeAdded(name, after); }
Source:
<code>private Clip getClip() throws LineUnavailableException { if (closingThreads > 0) return null; for (Iterator<Clip> iter = clips.iterator(); iter.hasNext();) { Clip c = iter.next(); if (!c.isRunning() && !c.isActive()) { iter.remove(); clips.add(c); return c; } } Clip c = null; if (extraClips >= MAX_CLIPS) { Log.debug("Stopping an existing clip"); if (clips.isEmpty()) return null; c = clips.removeFirst(); c.stop(); clips.add(c); } else { <START> Log.debug("creating a new clip"); <END> DataLine.Info info = new DataLine.Info(Clip.class, format); c = (Clip) AudioSystem.getLine(info); if (format != null) c.open(format, audioData, 0, audioData.length); if (c.getClass().getSimpleName().equals("PulseAudioClip")) { c.addLineListener(new PulseAudioFixerListener(c)); } clips.add(c); if (clips.size() != 1) extraClips++; } return c; }</code><technical_language>get rid of these? :P</technical_language>

Target:
private Clip getClip() throws LineUnavailableException { if (closingThreads > 0) return null; for (Iterator<Clip> iter = clips.iterator(); iter.hasNext();) { Clip c = iter.next(); if (!c.isRunning() && !c.isActive()) { iter.remove(); clips.add(c); return c; } } Clip c = null; if (extraClips >= MAX_CLIPS) { if (clips.isEmpty()) return null; c = clips.removeFirst(); c.stop(); clips.add(c); } else { DataLine.Info info = new DataLine.Info(Clip.class, format); c = (Clip) AudioSystem.getLine(info); if (format != null) c.open(format, audioData, 0, audioData.length); if (c.getClass().getSimpleName().equals("PulseAudioClip")) { c.addLineListener(new PulseAudioFixerListener(c)); } clips.add(c); if (clips.size() != 1) extraClips++; } return c; }
Source:
<code>@Override public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException { BPlusIO<?> io = PageIO.getBPlusIO(pageAddr); int cnt0 = io.getCount(pageAddr); <START> assert cnt0 == cnt + itemsCnt : "unexpected count: cnt0=" + cnt0 + ", cnt=" + cnt + ", itemsCnt=" + itemsCnt; <END> for (int i = 0; i < itemsCnt; ++i) { int idx = items[i]; io.copyItems(pageAddr, pageAddr, idx + 1, idx, cnt0 - idx, false); } io.setCount(pageAddr, cnt); }</code><technical_language>assert pageAddr points expected page type</technical_language>

Target:
@Override public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException { BPlusIO<?> io = PageIO.getBPlusIO(pageAddr); int cnt0 = io.getCount(pageAddr); if (cnt0 != cnt + itemsCnt) { throw new DeltaApplicationException("Count is wrong [expCnt=" + (cnt + itemsCnt) + ", actual=" + cnt0 + ']'); } io.purge(pageAddr, items, itemsCnt); }
Source:
<code>public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { HttpSession session = req.getSession(false); if(session!=null) session.invalidate(); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.clearContext(); String contextPath = req.getContextPath().length() > 0 ? req.getContextPath() : "/"; <START> { <END> Cookie cookie = new Cookie(ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, ""); cookie.setMaxAge(0); cookie.setSecure(req.isSecure()); cookie.setHttpOnly(true); cookie.setPath(contextPath); rsp.addCookie(cookie); } for (Cookie cookie : req.getCookies()) { if (!cookie.getName().startsWith("JSESSIONID.")) continue; String cookieContextPath = cookie.getPath(); if (cookieContextPath == null) { if (!contextPath.equals("/")) continue; } else if (!cookieContextPath.equals(contextPath)) { continue; } cookie.setMaxAge(0); cookie.setValue(""); rsp.addCookie(cookie); } rsp.sendRedirect2(getPostLogOutUrl(req,auth)); }</code><technical_language>block</technical_language>

Target:
public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { HttpSession session = req.getSession(false); if(session!=null) session.invalidate(); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.clearContext(); String contextPath = req.getContextPath().length() > 0 ? req.getContextPath() : "/"; resetRememberMeCookie(req, rsp, contextPath); clearStaleSessionCookies(req, rsp, contextPath); rsp.sendRedirect2(getPostLogOutUrl(req,auth)); }
Source:
<code>private void sleepOnReboot(final VDSStatus status) { long sleepInterval = TimeUnit.SECONDS.toMillis( Config.<Integer> getValue(ConfigValues.ServerRebootTimeout)); log.info("Waiting <START> seconds, for <END> server to finish reboot process.", sleepInterval); ThreadUtils.sleep(sleepInterval); setVdsStatus(status); }</code><technical_language>this is longer units of sleepInterval, change milliseconds divide cache Config.<Integer> getValue(ConfigValues.ServerRebootTimeout) print (i'd prefer keeping units in seconds)</technical_language>

Target:
private void sleepOnReboot(final VDSStatus status) { int sleepTimeInSec = Config.<Integer> getValue(ConfigValues.ServerRebootTimeout); log.info("Waiting seconds, for server to finish reboot process.", sleepTimeInSec); ThreadUtils.sleep(TimeUnit.SECONDS.toMillis(sleepTimeInSec)); setVdsStatus(status); }
Source:
<code>private long getExpiry() { String expiry = addActionConfig.expiry; <START> if (expiry != null && !expiry.isEmpty()) { <END> try { return Long.parseLong(expiry); } catch (NumberFormatException e) { } DateTime dt = new DateTime(expiry); return dt.getMillis(); } return 0; }</code><technical_language>expiry.isEmpty() throw error, means caller passed --expiry='' is incorrect fail</technical_language>

Target:
private long getExpiry() { String expiry = addActionConfig.expiry; if (expiry != null) { try { return Long.parseLong(expiry); } catch (NumberFormatException e) { } DateTime dt = new DateTime(expiry); return dt.getMillis(); } return 0; }
Source:
<code>public void onFinish(Map<PageTitle, LinkPreviewContents> result) { if (!isAdded()) { return; } <START> if (result.size() > 0) { <END> progressBar.setVisibility(View.GONE); contents = (LinkPreviewContents) result.values().toArray()[0]; layoutPreview(); } else { loadContentFromCache(); } }</code><technical_language>!result.isEmpty() instead</technical_language>

Target:
public void onFinish(Map<PageTitle, LinkPreviewContents> result) { if (!isAdded()) { return; } if (!result.isEmpty()) { progressBar.setVisibility(View.GONE); contents = (LinkPreviewContents) result.values().toArray()[0]; layoutPreview(); } else { loadContentFromCache(); } }
Source:
<code>private void setTrackingIdsFromTransaction(final Iterable<InvoiceModelDao> invoices, final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory, final InternalTenantContext context) { final InvoiceTrackingSqlDao invoiceTrackingidSqlDao = entitySqlDaoWrapperFactory.become(InvoiceTrackingSqlDao.class); final List<InvoiceTrackingModelDao> trackingIds = invoiceTrackingidSqlDao.getByAccountRecordId(context); <START> final Map<UUID, List<InvoiceTrackingModelDao>> invoiceTrackingIdsPerInvoiceId = new HashMap<UUID, List<InvoiceTrackingModelDao>>(); <END> for (InvoiceTrackingModelDao cur : trackingIds) { if (invoiceTrackingIdsPerInvoiceId.get(cur.getInvoiceId()) == null) { invoiceTrackingIdsPerInvoiceId.put(cur.getInvoiceId(), new LinkedList<>()); } invoiceTrackingIdsPerInvoiceId.get(cur.getInvoiceId()).add(cur); } for (final InvoiceModelDao invoice : invoices) { if (invoiceTrackingIdsPerInvoiceId.get(invoice.getId()) != null) { final List<InvoiceTrackingModelDao> perInvoiceTrackingIds = invoiceTrackingIdsPerInvoiceId.get(invoice.getId()); final Iterable<String> transform = Iterables.transform(perInvoiceTrackingIds, new Function<InvoiceTrackingModelDao, String>() { @Override public String apply(final InvoiceTrackingModelDao input) { return input.getTrackingId(); } }); invoice.addTrackingIds(ImmutableSet.<String>copyOf(transform)); } } }</code><technical_language>A MultiMap helped here</technical_language>

Target:
private void setTrackingIdsFromTransaction(final Iterable<InvoiceModelDao> invoices, final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory, final InternalTenantContext context) { final Set<String> invoiceIds = ImmutableSet.<String>copyOf(Iterables.transform(invoices, new Function<InvoiceModelDao, String>() { @Override public String apply(final InvoiceModelDao input) { return input.getId().toString(); } })); final InvoiceTrackingSqlDao invoiceTrackingidSqlDao = entitySqlDaoWrapperFactory.become(InvoiceTrackingSqlDao.class); final List<InvoiceTrackingModelDao> trackingIds = invoiceTrackingidSqlDao.getTrackingsForInvoices(invoiceIds, context); final Map<UUID, List<InvoiceTrackingModelDao>> invoiceTrackingIdsPerInvoiceId = new HashMap<UUID, List<InvoiceTrackingModelDao>>(); for (InvoiceTrackingModelDao cur : trackingIds) { if (invoiceTrackingIdsPerInvoiceId.get(cur.getInvoiceId()) == null) { invoiceTrackingIdsPerInvoiceId.put(cur.getInvoiceId(), new LinkedList<>()); } invoiceTrackingIdsPerInvoiceId.get(cur.getInvoiceId()).add(cur); } for (final InvoiceModelDao invoice : invoices) { if (invoiceTrackingIdsPerInvoiceId.get(invoice.getId()) != null) { final List<InvoiceTrackingModelDao> perInvoiceTrackingIds = invoiceTrackingIdsPerInvoiceId.get(invoice.getId()); final Iterable<String> transform = Iterables.transform(perInvoiceTrackingIds, new Function<InvoiceTrackingModelDao, String>() { @Override public String apply(final InvoiceTrackingModelDao input) { return input.getTrackingId(); } }); invoice.addTrackingIds(ImmutableSet.<String>copyOf(transform)); } } }
Source:
<code>public void checkImmutableTsLockAfterReadsForConservativeIfFlagIsSet() { TimelockService timelockService = spy(new LegacyTimelockService(timestampService, lockService, lockClient)); long transactionTs = timelockService.getFreshTimestamp(); LockImmutableTimestampResponse res = timelockService.lockImmutableTimestamp(); setTransactionConfig(ImmutableTransactionConfig.builder() .lockImmutableTsOnReadOnlyTransactions(true) .build()); SnapshotTransaction transaction = getSnapshotTransactionWith( timelockService, () -> transactionTs, res, PreCommitConditions.NO_OP, true); transaction.get(TABLE_SWEPT_CONSERVATIVE, ImmutableSet.of(TEST_CELL)); transaction.commit(); <START> timelockService.unlock(ImmutableSet.of(res.getLock())); <END> verify(timelockService).refreshLockLeases(ImmutableSet.of(res.getLock())); }</code><technical_language>commit currently checks locks, expect refreshes. confirm call explicitly get commit calls</technical_language>

Target:
public void checkImmutableTsLockAfterReadsForConservativeIfFlagIsSet() { TimelockService timelockService = spy(new LegacyTimelockService(timestampService, lockService, lockClient)); long transactionTs = timelockService.getFreshTimestamp(); LockImmutableTimestampResponse res = timelockService.lockImmutableTimestamp(); setTransactionConfig(ImmutableTransactionConfig.builder() .lockImmutableTsOnReadOnlyTransactions(true) .build()); SnapshotTransaction transaction = getSnapshotTransactionWith( timelockService, () -> transactionTs, res, PreCommitConditions.NO_OP, true); transaction.get(TABLE_SWEPT_CONSERVATIVE, ImmutableSet.of(TEST_CELL)); verify(timelockService).refreshLockLeases(ImmutableSet.of(res.getLock())); transaction.commit(); timelockService.unlock(ImmutableSet.of(res.getLock())); }
Source:
<code>private void addUrlParams(DetailedLink link, Action action) { if (action.getRequest().getUrlparams() != null && !action.getRequest().getUrlparams().isEmpty()) { link.getRequest().setUrl(new Url()); ParametersSet ps = new ParametersSet(); for (Object key : action.getRequest().getUrlparams().keySet()) { Parameter param = new Parameter(); param.setName(key.toString()); Object value = action.getRequest().getUrlparams().get(key); if (value != null) { ParamData urlParamData = (ParamData)value; param.setType(urlParamData.getType()); param.setContext(urlParamData.getContext()); param.setValue(urlParamData.getValue()); <START> param.setRequired(urlParamData.getRequired()==null ? new Boolean(false) : urlParamData.getRequired()); <END> } ps.getParameters().add(param); } link.getRequest().getUrl().getParametersSets().add(ps); } }</code><technical_language>Boolean.FALSE</technical_language>

Target:
private void addUrlParams(DetailedLink link, Action action) { if (action.getRequest().getUrlparams() != null && !action.getRequest().getUrlparams().isEmpty()) { link.getRequest().setUrl(new Url()); ParametersSet ps = new ParametersSet(); for (Object key : action.getRequest().getUrlparams().keySet()) { Parameter param = new Parameter(); param.setName(key.toString()); Object value = action.getRequest().getUrlparams().get(key); if (value != null) { ParamData urlParamData = (ParamData)value; param.setType(urlParamData.getType()); param.setContext(urlParamData.getContext()); param.setValue(urlParamData.getValue()); param.setRequired(urlParamData.getRequired()==null ? Boolean.FALSE : urlParamData.getRequired()); } ps.getParameters().add(param); } link.getRequest().getUrl().getParametersSets().add(ps); } }
Source:
<code>protected void handleMessage(Message<?> message) { boolean executorInterceptorPresent = false; if (this.channelInterceptors != null) { for (ChannelInterceptor interceptor : this.channelInterceptors) { if (interceptor instanceof ExecutorChannelInterceptor) { <START> executorInterceptorPresent = true; <END> break; } } } Deque<ExecutorChannelInterceptor> interceptorStack = null; try { if (executorInterceptorPresent) { interceptorStack = new ArrayDeque<ExecutorChannelInterceptor>(); message = applyBeforeHandle(message, interceptorStack); if (message == null) { return; } } this.handler.handleMessage(message); if (!CollectionUtils.isEmpty(interceptorStack)) { triggerAfterMessageHandled(message, null, interceptorStack); } } catch (Exception ex) { if (!CollectionUtils.isEmpty(interceptorStack)) { triggerAfterMessageHandled(message, ex, interceptorStack); } if (ex instanceof MessagingException) { throw (MessagingException) ex; } String description = "Failed to handle " + message + " to " + this + " in " + this.handler; throw new MessageDeliveryException(message, description, ex); } catch (Error ex) { if (!CollectionUtils.isEmpty(interceptorStack)) { String description = "Failed to handle " + message + " to " + this + " in " + this.handler; triggerAfterMessageHandled(message, new MessageDeliveryException(message, description, ex), interceptorStack); } throw ex; } }</code><technical_language>I need optimization avoid iterating interceptors if exec interceptor message. a interface of CIA - ExecutorChannelInterceptorAware.hasExecInterceptor() ? get list front, instead of iterating, check boolean</technical_language>

Target:
protected void handleMessage(Message<?> message) { Deque<ExecutorChannelInterceptor> interceptorStack = null; try { if (this.channelInterceptors != null && ((ExecutorChannelInterceptorAware) this.inputChannel).hasExecutorInterceptors()) { interceptorStack = new ArrayDeque<ExecutorChannelInterceptor>(); message = applyBeforeHandle(message, interceptorStack); if (message == null) { return; } } this.handler.handleMessage(message); if (!CollectionUtils.isEmpty(interceptorStack)) { triggerAfterMessageHandled(message, null, interceptorStack); } } catch (Exception ex) { if (!CollectionUtils.isEmpty(interceptorStack)) { triggerAfterMessageHandled(message, ex, interceptorStack); } if (ex instanceof MessagingException) { throw (MessagingException) ex; } String description = "Failed to handle " + message + " to " + this + " in " + this.handler; throw new MessageDeliveryException(message, description, ex); } catch (Error ex) { if (!CollectionUtils.isEmpty(interceptorStack)) { String description = "Failed to handle " + message + " to " + this + " in " + this.handler; triggerAfterMessageHandled(message, new MessageDeliveryException(message, description, ex), interceptorStack); } throw ex; } }
Source:
<code>public MapFeederForkJoin(StreamMapper task, TaskDataSource source, int parallelism) { this.source = source; this.task = task; this.parallelism = parallelism; <START> this.mapperPool = new ForkJoinPool(parallelism); <END> this.enqueuePermits = new Semaphore(QUEUE_DEPTH); }</code><technical_language>hand constructor uncaught exception handler save a lot of try/finally</technical_language>

Target:
public MapFeederForkJoin(StreamMapper task, TaskDataSource source, int parallelism) { this.source = source; this.task = task; this.parallelism = parallelism; this.mapperPool = new ForkJoinPool(parallelism, ForkJoinPool.defaultForkJoinWorkerThreadFactory, (Thread t, Throwable e) -> handleUncaughtThrowable(e), true); this.enqueuePermits = new Semaphore(QUEUE_DEPTH); }
Source:
<code>final ExecutionPlan getExecutionPlan(StreamApplication app) throws Exception { StreamGraphImpl streamGraph = new StreamGraphImpl(this, config); app.init(streamGraph, config); <START> ExecutionPlanner planner = new ExecutionPlanner(config, streamManager); <END> return planner.plan(streamGraph); }</code><technical_language>A side note: Is planner class loadable config? good consider option in long-run</technical_language>

Target:
final ExecutionPlan getExecutionPlan(StreamApplication app) throws Exception { StreamGraphImpl streamGraph = new StreamGraphImpl(this, config); app.init(streamGraph, config); return planner.plan(streamGraph); }
Source:
<code>public String telnet(Channel channel, String message) throws RemotingException { String prompt = channel.getUrl().getParameterAndDecoded(Constants.PROMPT_KEY, Constants.DEFAULT_PROMPT); boolean noprompt = message.contains("--no-prompt"); message = message.replace("--no-prompt", ""); StringBuilder buf = new StringBuilder(); message = message.trim(); String command; if (message.length() > 0) { int i = message.indexOf(' '); if (i > 0) { command = message.substring(0, i).trim(); message = message.substring(i + 1).trim(); } else { command = message; message = ""; } } else { command = ""; } <START> if (command.length() > 0) { <END> if (extensionLoader.hasExtension(command)) { if (commandEnabled(channel.getUrl(), command)) { try { String result = extensionLoader.getExtension(command).telnet(channel, message); if (result == null) { return null; } buf.append(result); } catch (Throwable t) { buf.append(t.getMessage()); } } else { buf.append("Command: "); buf.append(command); buf.append(" disabled"); } } else { buf.append("Unsupported command: "); buf.append(command); } } if (buf.length() > 0) { buf.append("\r\n"); } if (prompt != null && prompt.length() > 0 && !noprompt) { buf.append(prompt); } return buf.toString(); }</code><technical_language>This code a bit indented</technical_language>

Target:
public String telnet(Channel channel, String message) throws RemotingException { String prompt = channel.getUrl().getParameterAndDecoded(Constants.PROMPT_KEY, Constants.DEFAULT_PROMPT); boolean noprompt = message.contains("--no-prompt"); message = message.replace("--no-prompt", ""); StringBuilder buf = new StringBuilder(); message = message.trim(); String command; if (message.length() > 0) { int i = message.indexOf(' '); if (i > 0) { command = message.substring(0, i).trim(); message = message.substring(i + 1).trim(); } else { command = message; message = ""; } } else { command = ""; } if (command.length() > 0) { if (extensionLoader.hasExtension(command)) { try { String result = extensionLoader.getExtension(command).telnet(channel, message); if (result == null) { return null; } buf.append(result); } catch (Throwable t) { buf.append(t.getMessage()); } } else { buf.append("Unsupported command: "); buf.append(command); } } if (buf.length() > 0) { buf.append("\r\n"); } if (prompt != null && prompt.length() > 0 && !noprompt) { buf.append(prompt); } return buf.toString(); }
Source:
<code>public boolean isArray() { try { JSONArray.fromObject(value); return true; } catch (JSONException e) { <START> LOGGER.debug("This json is not an object: {}", e.getMessage()); <END> return false; } }</code><technical_language>object->array</technical_language>

Target:
public boolean isArray() { try { JSONArray.fromObject(value); return true; } catch (JSONException e) { LOGGER.debug("This json is not an Array: {}", e.getMessage()); return false; } }
Source:
<code>public static String moduleToJsonString(Module module) throws IOException { JsonFactory jsonFactory = createJsonFactory(); StringWriter writer = new StringWriter(); JsonGenerator jsonGenerator = jsonFactory.createJsonGenerator(writer); jsonGenerator.useDefaultPrettyPrinter(); jsonGenerator.writeObject(module); <START> String result = writer.getBuffer().toString(); <END> return result; }</code><technical_language>suggestion return writer.getBuffer().toString();</technical_language>

Target:
public static String moduleToJsonString(Module module) throws IOException { JsonFactory jsonFactory = createJsonFactory(); StringWriter writer = new StringWriter(); JsonGenerator jsonGenerator = jsonFactory.createJsonGenerator(writer); jsonGenerator.useDefaultPrettyPrinter(); jsonGenerator.writeObject(module); return writer.getBuffer().toString(); }
Source:
<code>private void handleConnections(final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder, final Node<View<?>, Edge> node, final Supplier<Connection> connectionSupplier, final Supplier<CanvasCommand<AbstractCanvasHandler>> commandSupplier) { final Connection connection = connectionSupplier.get(); if (Objects.isNull(connection) || !(connection instanceof MagnetConnection)) { return; } final MagnetConnection magnetConnection = (MagnetConnection) connection; magnetConnection.getMagnetIndex().ifPresent(index -> { final Shape shape = canvasHandler.getCanvas().getShape(node.getUUID()); Optional.ofNullable(WiresUtils.isWiresShape(shape.getShapeView()) ? (WiresShape) shape.getShapeView() : null) .ifPresent(wiresShape -> { final WiresMagnet magnet = wiresShape.getMagnets().getMagnet(index); <START> if (Objects.nonNull(magnetConnection.getLocation())) { <END> magnetConnection.getLocation().setX(magnet.getX()); magnetConnection.getLocation().setY(magnet.getY()); } else { magnetConnection.setLocation(new Point2D(magnet.getX(), magnet.getY())); } commandBuilder.addCommand(commandSupplier.get()); }); }); }</code><technical_language>@tiagodolphine, I guess instead of if statement java magnetConnection.setLocation(new Point2D(magnet.getX(), magnet.getY())); I missing something</technical_language>

Target:
private void handleConnections(final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder, final Node<View<?>, Edge> node, final Supplier<Connection> connectionSupplier, final Supplier<CanvasCommand<AbstractCanvasHandler>> commandSupplier) { final Connection connection = connectionSupplier.get(); if (Objects.isNull(connection) || !(connection instanceof MagnetConnection)) { return; } final MagnetConnection magnetConnection = (MagnetConnection) connection; magnetConnection.getMagnetIndex().ifPresent(index -> { final Shape shape = canvasHandler.getCanvas().getShape(node.getUUID()); Optional.ofNullable(WiresUtils.isWiresShape(shape.getShapeView()) ? (WiresShape) shape.getShapeView() : null) .ifPresent(wiresShape -> { final WiresMagnet magnet = wiresShape.getMagnets().getMagnet(index); magnetConnection.setLocation(new Point2D(magnet.getX(), magnet.getY())); commandBuilder.addCommand(commandSupplier.get()); }); }); }
Source:
<code>private void showRemoveSelfHostedSiteDialog(@NonNull final SiteModel site) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); dialogBuilder.setTitle(getResources().getText(R.string.remove_account)); dialogBuilder.setMessage(getResources().getText(R.string.sure_to_remove_account)); dialogBuilder.setPositiveButton(getResources().getText(R.string.yes), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mDispatcher.dispatch(SiteActionBuilder.newRemoveSiteAction(site)); <START> getAdapter().loadSites(); <END> } }); dialogBuilder.setNegativeButton(getResources().getText(R.string.no), null); dialogBuilder.setCancelable(false); dialogBuilder.create().show(); }</code><technical_language>This of public void onSiteRemoved(OnSiteRemoved event) { instead of remove site action is async</technical_language>

Target:
private void showRemoveSelfHostedSiteDialog(@NonNull final SiteModel site) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); dialogBuilder.setTitle(getResources().getText(R.string.remove_account)); dialogBuilder.setMessage(getResources().getText(R.string.sure_to_remove_account)); dialogBuilder.setPositiveButton(getResources().getText(R.string.yes), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mDispatcher.dispatch(SiteActionBuilder.newRemoveSiteAction(site)); } }); dialogBuilder.setNegativeButton(getResources().getText(R.string.no), null); dialogBuilder.setCancelable(false); dialogBuilder.create().show(); }
Source:
<code>private static List<? extends Expression> matchMethodParameterTypes(boolean varArgs, Class[] parameterTypes, List<? extends Expression> arguments) { <START> if (varArgs) { <END> if (arguments.size() < parameterTypes.length - 1) { return null; } } else { if (parameterTypes.length != arguments.size()) { return null; } } final List<Expression> typeMatchedArguments = new ArrayList<>(); for (int i = 0; i < arguments.size(); i++) { Class parameterType = !varArgs || i < parameterTypes.length - 1 ? parameterTypes[i] : Object.class; final Expression typeMatchedArgument = matchMethodParameterType(arguments.get(i), parameterType); if (typeMatchedArgument == null) { return null; } typeMatchedArguments.add(typeMatchedArgument); } return typeMatchedArguments; }</code><technical_language>minor: simplify this piece of code unifying a single 'if'? if ( (varArgs && arguments.size() < parameterTypes.length - 1) || (!varArgs && arguments.size() != parameterTypes.length) ) { return null; }</technical_language>

Target:
private static List<? extends Expression> matchMethodParameterTypes(boolean varArgs, Class[] parameterTypes, List<? extends Expression> arguments) { if ((varArgs && arguments.size() < parameterTypes.length - 1) || (!varArgs && arguments.size() != parameterTypes.length)) { return null; } final List<Expression> typeMatchedArguments = new ArrayList<>(); for (int i = 0; i < arguments.size(); i++) { Class parameterType = !varArgs || i < parameterTypes.length - 1 ? parameterTypes[i] : Object.class; final Expression typeMatchedArgument = matchMethodParameterType(arguments.get(i), parameterType); if (typeMatchedArgument == null) { return null; } typeMatchedArguments.add(typeMatchedArgument); } return typeMatchedArguments; }
Source:
<code>protected void onBind() { super.onBind(); <START> Scheduler.get().scheduleDeferred(() -> addPluginActionButtons( <END> actionButtonPluginHandler.getButtons(getProxy().getTargetHistoryToken()), false)); Scheduler.get().scheduleDeferred(() -> addPluginActionButtons( actionButtonPluginHandler.getMenuItems(getProxy().getTargetHistoryToken()), false)); registerHandler(getEventBus().addHandler(AddActionButtonEvent.getType(), event -> { if (getProxy().getTargetHistoryToken().equals(event.getHistoryToken())) { List<ActionButtonDefinition<?>> pluginActionButtonList = new ArrayList<>(); pluginActionButtonList.add(event.getButtonDefinition()); addPluginActionButtons(pluginActionButtonList, false); } })); registerHandler(getEventBus().addHandler(AddKebabMenuListItemEvent.getType(), event -> { if (getProxy().getTargetHistoryToken().equals(event.getHistoryToken())) { List<ActionButtonDefinition<?>> pluginActionButtonList = new ArrayList<>(); pluginActionButtonList.add(event.getButtonDefinition()); addPluginActionButtons(pluginActionButtonList, true); } })); }</code><technical_language>Nit-pick: prefer of operations a single deferred command: Scheduler.get().scheduleDeferred(() -> { addPluginActionButtons( .. ); addPluginActionButtons( .. ); });</technical_language>

Target:
protected void onBind() { super.onBind(); Scheduler.get().scheduleDeferred(() -> { addPluginActionButtons( actionButtonPluginHandler.getButtons(getProxy().getTargetHistoryToken()), false); addPluginActionButtons( actionButtonPluginHandler.getMenuItems(getProxy().getTargetHistoryToken()), false); }); registerHandler(getEventBus().addHandler(AddActionButtonEvent.getType(), event -> { if (getProxy().getTargetHistoryToken().equals(event.getHistoryToken())) { List<ActionButtonDefinition<?>> pluginActionButtonList = new ArrayList<>(); pluginActionButtonList.add(event.getButtonDefinition()); addPluginActionButtons(pluginActionButtonList, false); } })); registerHandler(getEventBus().addHandler(AddKebabMenuListItemEvent.getType(), event -> { if (getProxy().getTargetHistoryToken().equals(event.getHistoryToken())) { List<ActionButtonDefinition<?>> pluginActionButtonList = new ArrayList<>(); pluginActionButtonList.add(event.getButtonDefinition()); addPluginActionButtons(pluginActionButtonList, true); } })); }
Source:
<code>public void copy_shouldCopyAllDrugOrderFields() throws Exception { DrugOrder drugOrder = new DrugOrder(); Drug drug = new Drug(); drug.setConcept(new Concept()); drugOrder.setDrug(drug); <START> OrderTest.assertThatAllFieldsAreCopied(drugOrder, null, "orderGroup", "sortWeight"); <END> }</code><technical_language>This is correct, orderGroup sortWeight need copied too, this stay unchanged instead update Order.copy copy fields</technical_language>

Target:
public void copy_shouldCopyAllDrugOrderFields() throws Exception { DrugOrder drugOrder = new DrugOrder(); Drug drug = new Drug(); drug.setConcept(new Concept()); drugOrder.setDrug(drug); OrderTest.assertThatAllFieldsAreCopied(drugOrder, null); }
Source:
<code>public void testGetTypeIndel() { assertEquals(VariantType.INDEL, new Variant("1", 1, 1, "T", "<DEL>").getType()); <START> assertEquals(VariantType.INDEL, new Variant("1", 1, 1, "T", "<INS>").getType()); <END> assertEquals(VariantType.INDEL, new Variant("1", 1, 1, ".", "T").getType()); assertEquals(VariantType.INDEL, new Variant("1", 1, 1, "", "T").getType()); assertEquals(VariantType.INDEL, new Variant("1", 1, 1, "GGGGCCC", "TGA").getType()); }</code><technical_language>consider angle-bracketed alleles INDELs more. For instance, in RS release VCF report write <156_DEL_BP> consider a SEQUENCE_ALTERATION</technical_language>

Target:
public void testGetTypeIndel() { assertEquals(VariantType.INDEL, new Variant("1", 1, 1, ".", "T").getType()); assertEquals(VariantType.INDEL, new Variant("1", 1, 1, "GGGGCCC", "TGA").getType()); }
Source:
<code>public Server listen() throws InterruptedException { workGroup = new NioEventLoopGroup(); try { <START> logger.info("Starting server on port: {}", this.port); <END> beatsInitializer = new BeatsInitializer(isSslEnable(), messageListener, clientInactivityTimeoutSeconds, beatsHeandlerThreadCount); ServerBootstrap server = new ServerBootstrap(); server.group(workGroup) .channel(NioServerSocketChannel.class) .childOption(ChannelOption.SO_LINGER, 0) .childHandler(beatsInitializer); Channel channel = server.bind(host, port).sync().channel(); channel.closeFuture().sync(); } finally { shutdown(); } return this; }</code><technical_language>@praseodym if workGroup is != null this line, shutdown "old" worker group leak theads here? I impossible get situation reason get a reload is effectively Exception in code shut this right</technical_language>

Target:
public Server listen() throws InterruptedException { if (workGroup != null) { try { logger.debug("Shutting down existing worker group before starting"); workGroup.shutdownGracefully().sync(); } catch (Exception e) { logger.error("Could not shut down worker group before starting", e); } } workGroup = new NioEventLoopGroup(); try { logger.info("Starting server on port: {}", this.port); beatsInitializer = new BeatsInitializer(isSslEnable(), messageListener, clientInactivityTimeoutSeconds, beatsHeandlerThreadCount); ServerBootstrap server = new ServerBootstrap(); server.group(workGroup) .channel(NioServerSocketChannel.class) .childOption(ChannelOption.SO_LINGER, 0) .childHandler(beatsInitializer); Channel channel = server.bind(host, port).sync().channel(); channel.closeFuture().sync(); } finally { shutdown(); } return this; }
Source:
<code>public void shutdown() { <START> if(null != this.queueProcessor) this.queueProcessor.shutdown(); <END> if(null != this.updaterThread) this.updaterThread.shutdown(); }</code><technical_language>please follow coding guidelines put code in curly braces</technical_language>

Target:
public void shutdown() { if(null != this.queueProcessor) { this.queueProcessor.shutdown(); } if(null != this.updaterThread) { this.updaterThread.shutdown(); } }
Source:
<code>private void adjustDisksImageConfiguration(Collection<DiskImage> diskImages) { for (DiskImage diskImage : diskImages) { <START> if (destStorages.get(diskInfoDestinationMap.get(diskImage.getId()).getStorageIds().get(0)).getStorageStaticData().getStorageType().isBlockDomain() && <END> diskImage.getVolumeType().equals(VolumeType.Sparse) && diskImage.getVolumeFormat().equals(VolumeFormat.RAW)) { diskImage.setvolumeFormat(VolumeFormat.COW); } } }</code><technical_language>export this part a method this if clause more readable..you name retrieveDomainForDisk()</technical_language>

Target:
private void adjustDisksImageConfiguration(Collection<DiskImage> diskImages) { for (DiskImage diskImage : diskImages) { if ( diskImage.getVolumeType().equals(VolumeType.Sparse) && diskImage.getVolumeFormat().equals(VolumeFormat.RAW) && getDestintationDomainTypeFromDisk(diskImage).isBlockDomain()) { diskImage.setvolumeFormat(VolumeFormat.COW); } } }
Source:
<code>@Override protected Boolean run(@Nullable VisorContinuousQueryCancelTaskArg arg) throws IgniteException { IgniteLogger log = ignite.log().getLogger(VisorContinuousQueryCancelJob.class); <START> log.info("Cancelling continuous query[routineId=" + arg.getRoutineId() + ']'); <END> try { IgniteInternalFuture<?> fut = ignite.context().continuous().stopRoutine(arg.getRoutineId()); fut.get(); } catch (IgniteCheckedException e) { return false; } return true; }</code><technical_language>if (log.isInfoEnabled())</technical_language>

Target:
@Override protected Boolean run(@Nullable VisorContinuousQueryCancelTaskArg arg) throws IgniteException { IgniteLogger log = ignite.log().getLogger(VisorContinuousQueryCancelJob.class); if (log.isInfoEnabled()) log.info("Cancelling continuous query[routineId=" + arg.getRoutineId() + ']'); try { IgniteInternalFuture<?> fut = ignite.context().continuous().stopRoutine(arg.getRoutineId()); fut.get(); } catch (IgniteCheckedException e) { return false; } return true; }
Source:
<code>public Multimap<URI, URI> aliases() { return ImmutableMultimap.<URI, URI>builder() .put(URI.create(ExtensionNamespaces.L3_ROUTER), URI.create("<LINK_2>")) .put(URI.create(ExtensionNamespaces.SECURITY_GROUPS), URI.create("<LINK_1>")) <START> .put(URI.create(ExtensionNamespaces.LBAAS_V1), <END> URI.create("<LINK_0>")) .build(); }</code><technical_language>ExtensionNamespaces.LBAAS consistent alias name</technical_language>

Target:
public Multimap<URI, URI> aliases() { return ImmutableMultimap.<URI, URI>builder() .put(URI.create(ExtensionNamespaces.L3_ROUTER), URI.create("<LINK_2>")) .put(URI.create(ExtensionNamespaces.SECURITY_GROUPS), URI.create("<LINK_1>")) .put(URI.create(ExtensionNamespaces.LBAAS), URI.create("<LINK_0>")) .build(); }
Source:
<code>public void init() { File elementsDataFile = new File(Compendium.Config.configPrefix + Compendium.Config.elementsDataJson); if (Config.useDefaultElements||!elementsDataFile.isFile()) { FileHelper.copyFromJar(ElementHandler.class, Compendium.Config.elementsDataJsonSource, Compendium.Config.elementsDataJson); } elementsDataFile = new File(Compendium.Config.configPrefix + Compendium.Config.elementsDataJson); if (elementsDataFile.isFile()) { LogHelper.debug("JSON file exists"); JsonReader jReader=null; try { jReader = new JsonReader(new InputStreamReader(new FileInputStream(elementsDataFile))); JsonParser parser = new JsonParser(); JsonObject elementsObject = parser.parse(jReader).getAsJsonObject(); int count = 1; LogHelper.debug("JSON Object:"); while (elementsObject.has(Integer.toString(count))) { JsonObject element = elementsObject.get(Integer.toString(count)).getAsJsonObject(); LogHelper.debug("Atomic Number: " + count); LogHelper.debug("Element name: " + element.get("longName")); LogHelper.debug("Element abbreviation: " + element.get("shortName")); count++; } } catch (Exception e) { throw new RuntimeException(e); } finally { if (jReader!=null) { try { jReader.close(); } catch (IOException e) { LogHelper.exception(e, Level.WARN); <START> } <END> } } } }</code><technical_language>minor note, need work fixing formatting</technical_language>

Target:
public void init() { if (Config.useDefaultElements){ InputStream stream=null; try{ stream=FileHelper.getInputStreamFromJar(ElementHandler.class, Compendium.Config.elementsDataJsonSource); readFromStream(stream); } finally { if (stream!=null){ try { stream.close(); } catch (IOException e) { LogHelper.exception("Cannot close stream!", e, Level.WARN); } } } } else { File elementsDataFile = new File(Compendium.Config.configPrefix + Compendium.Config.elementsDataJson); if (!elementsDataFile.isFile()) { FileHelper.copyFromJar(ElementHandler.class, Compendium.Config.elementsDataJsonSource, Compendium.Config.elementsDataJson); } elementsDataFile = new File(Compendium.Config.configPrefix + Compendium.Config.elementsDataJson); if (elementsDataFile.isFile()) { LogHelper.debug("JSON file exists"); InputStream stream=null; try { stream=new FileInputStream(elementsDataFile); readFromStream(stream); } catch (FileNotFoundException e) { throw new RuntimeException(e); } finally { if (stream!=null){ try { stream.close(); } catch (IOException e) { LogHelper.exception("Cannot close stream!", e, Level.WARN); } } } } } }
Source:
<code>public void queryItemsWithContinuationTokenAndPageSize() throws Exception{ List<String> actualIds = new ArrayList<>(); CosmosItemProperties properties = getDocumentDefinition(UUID.randomUUID().toString()); container.createItem(properties); actualIds.add(properties.getId()); properties = getDocumentDefinition(UUID.randomUUID().toString()); container.createItem(properties); actualIds.add(properties.getId()); properties = getDocumentDefinition(UUID.randomUUID().toString()); container.createItem(properties); actualIds.add(properties.getId()); String query = String.format("SELECT * from c where c.id in ('%s', '%s', '%s')", actualIds.get(0), actualIds.get(1), actualIds.get(2)); FeedOptions feedOptions = new FeedOptions(); String continuationToken = null; int pageSize = 1; int initialDocumentCount = 3; int finalDocumentCount = 0; CosmosContinuablePagedIterable<CosmosItemProperties> feedResponseIterator1 = container.queryItems(query, feedOptions, CosmosItemProperties.class); do { Iterable<FeedResponse<CosmosItemProperties>> feedResponseIterable = feedResponseIterator1.iterableByPage(continuationToken, pageSize); Iterator<FeedResponse<CosmosItemProperties>> feedResponse = feedResponseIterable.iterator(); <START> for (; feedResponse.hasNext(); ) { <END> FeedResponse<CosmosItemProperties> fr = feedResponse.next(); int resultSize = fr.getResults().size(); assertThat(resultSize).isEqualTo(pageSize); finalDocumentCount += fr.getResults().size(); continuationToken = fr.getContinuationToken(); } } while(continuationToken != null); assertThat(finalDocumentCount).isEqualTo(initialDocumentCount); }</code><technical_language>while loop more suitable</technical_language>

Target:
public void queryItemsWithContinuationTokenAndPageSize() throws Exception{ List<String> actualIds = new ArrayList<>(); CosmosItemProperties properties = getDocumentDefinition(UUID.randomUUID().toString()); container.createItem(properties); actualIds.add(properties.getId()); properties = getDocumentDefinition(UUID.randomUUID().toString()); container.createItem(properties); actualIds.add(properties.getId()); properties = getDocumentDefinition(UUID.randomUUID().toString()); container.createItem(properties); actualIds.add(properties.getId()); String query = String.format("SELECT * from c where c.id in ('%s', '%s', '%s')", actualIds.get(0), actualIds.get(1), actualIds.get(2)); FeedOptions feedOptions = new FeedOptions(); String continuationToken = null; int pageSize = 1; int initialDocumentCount = 3; int finalDocumentCount = 0; CosmosContinuablePagedIterable<CosmosItemProperties> feedResponseIterator1 = container.queryItems(query, feedOptions, CosmosItemProperties.class); do { Iterable<FeedResponse<CosmosItemProperties>> feedResponseIterable = feedResponseIterator1.iterableByPage(continuationToken, pageSize); for (FeedResponse<CosmosItemProperties> fr : feedResponseIterable) { int resultSize = fr.getResults().size(); assertThat(resultSize).isEqualTo(pageSize); finalDocumentCount += fr.getResults().size(); continuationToken = fr.getContinuationToken(); } } while(continuationToken != null); assertThat(finalDocumentCount).isEqualTo(initialDocumentCount); }
Source:
<code>public void logOut(String wikiURL) { try { getUrl(wikiURL + URLsContent.logout); } catch (TimeoutException e) { PageObjectLogging.log("logOut", "page loads for more than 30 seconds", true); } wait.until(ExpectedConditions.visibilityOfElementLocated(By <START> .cssSelector("a[data-id='login']"))); <END> PageObjectLogging.log("logOut", "user is logged out", true, driver); }</code><technical_language>remove this selector this class attribute. variable instead</technical_language>

Target:
public void logOut(String wikiURL) { try { getUrl(wikiURL + URLsContent.logout); } catch (TimeoutException e) { PageObjectLogging.log("logOut", "page loads for more than 30 seconds", true); } waitForElementByElement(loginButton); PageObjectLogging.log("logOut", "user is logged out", true, driver); }