auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void main(String[] args) { var serverStartTime = System.nanoTime(); var delayedService = new DelayedRemoteService(serverStartTime, 5); var delayedServiceCircuitBreaker = new DefaultCircuitBreaker(delayedService, 3000, 2, 2000 * 1000 * 1000); var quickService = new QuickRemoteService(); var quickServiceCircuitBreaker = new DefaultCircuitBreaker(quickService, 3000, 2, 2000 * 1000 * 1000); var monitoringService = new MonitoringService(delayedServiceCircuitBreaker, quickServiceCircuitBreaker); LOGGER.info(monitoringService.localResourceResponse()); LOGGER.info(monitoringService.delayedServiceResponse()); LOGGER.info(monitoringService.delayedServiceResponse()); LOGGER.info(delayedServiceCircuitBreaker.getState()); LOGGER.info(monitoringService.quickServiceResponse()); LOGGER.info(quickServiceCircuitBreaker.getState()); try { Thread.sleep(5000); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } LOGGER.info(delayedServiceCircuitBreaker.getState()); LOGGER.info(monitoringService.delayedServiceResponse()); LOGGER.info(delayedServiceCircuitBreaker.getState()); }</code><technical_language>logger</technical_language>

Target:
public static void main(String[] args) { var serverStartTime = System.nanoTime(); var delayedService = new DelayedRemoteService(serverStartTime, 5); var delayedServiceCircuitBreaker = new DefaultCircuitBreaker(delayedService, 3000, 2, 2000 * 1000 * 1000); var quickService = new QuickRemoteService(); var quickServiceCircuitBreaker = new DefaultCircuitBreaker(quickService, 3000, 2, 2000 * 1000 * 1000); var monitoringService = new MonitoringService(delayedServiceCircuitBreaker, quickServiceCircuitBreaker); LOGGER.info(monitoringService.localResourceResponse()); LOGGER.info(monitoringService.delayedServiceResponse()); LOGGER.info(monitoringService.delayedServiceResponse()); LOGGER.info(delayedServiceCircuitBreaker.getState()); LOGGER.info(monitoringService.quickServiceResponse()); LOGGER.info(quickServiceCircuitBreaker.getState()); try { LOGGER.info("Waiting for delayed service to become responsive"); Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } LOGGER.info(delayedServiceCircuitBreaker.getState()); LOGGER.info(monitoringService.delayedServiceResponse()); LOGGER.info(delayedServiceCircuitBreaker.getState()); }
Source:
<code>private boolean instantiateTree() throws IOException { index = new GBPTree<>( pageCache, storeFile, new LabelScanLayout(), pageSize, treeMonitor(), getDirty ); <START> return getDirty.isDirty(); <END> }</code><technical_language>getDirty need a field, of create here? I accessing else</technical_language>

Target:
private boolean instantiateTree() throws IOException { monitors.addMonitorListener( treeMonitor() ); GBPTree.Monitor monitor = monitors.newMonitor( GBPTree.Monitor.class ); MutableBoolean isDirty = new MutableBoolean(); Header.Reader getDirty = (pageCursor, length) -> isDirty.setValue( pageCursor.getByte() == DIRTY ); index = new GBPTree<>( pageCache, storeFile, new LabelScanLayout(), pageSize, monitor, getDirty ); return isDirty.getValue(); }
Source:
<code>public SearchResult doSearch(final SearchParameters parameters) throws InvalidQueryException { final MapSqlParameterSource parameterSource = new MapSqlParameterSource(); final var whereClauses = new ArrayList<String>(); for (Condition condition : parameters.getConditions()) { if (condition.getField().equals(Condition.Field.fedora_id) && condition.getOperator().equals(Condition.Operator.EQ)) { var object = condition.getObject(); if (!object.equals("*")) { <START> if (object.contains("*")) { <END> object = object.replace("*", "%"); whereClauses.add(FEDORA_ID_DB_COLUMN + " like '" + object + "'"); } else { whereClauses.add(FEDORA_ID_DB_COLUMN + " = '" + object + "'"); } } } else { throw new InvalidQueryException("Condition not supported: " + condition.getField() + condition.getOperator().getStringValue() + condition.getObject()); } } final var sql = new StringBuffer("select " + FEDORA_ID_DB_COLUMN + " from resources"); if (!whereClauses.isEmpty()) { sql.append(" where "); for (int x = 0; x < whereClauses.size(); x++) { if (x > 0) { sql.append(" and "); } sql.append(whereClauses.get(x)); } } sql.append(" order by " + FEDORA_ID_DB_COLUMN); sql.append(" limit :limit offset :offset"); parameterSource.addValue("limit", parameters.getMaxResults()); parameterSource.addValue("offset", parameters.getOffset()); final List<Map<String, Object>> items = jdbcTemplate.queryForList(sql.toString(), parameterSource); final var pagination = new PaginationInfo(parameters.getMaxResults(), parameters.getOffset()); return new SearchResult(items, pagination); }</code><technical_language>if a Fedora ID contains a * part of id</technical_language>

Target:
public SearchResult doSearch(final SearchParameters parameters) throws InvalidQueryException { final MapSqlParameterSource parameterSource = new MapSqlParameterSource(); final var whereClauses = new ArrayList<String>(); for (Condition condition : parameters.getConditions()) { if (condition.getField().equals(Condition.Field.FEDORA_ID) && condition.getOperator().equals(Condition.Operator.EQ)) { var object = condition.getObject(); if (!object.equals("*")) { if (object.contains("*")) { object = object.replace("*", "%"); whereClauses.add(FEDORA_ID_COLUMN + " like '" + object + "'"); } else { whereClauses.add(FEDORA_ID_COLUMN + " = '" + object + "'"); } } } else { throw new InvalidQueryException("Condition not supported: \"" + condition + "\""); } } final var sql = new StringBuilder("select " + FEDORA_ID_COLUMN + " from " + RESOURCES_TABLE); if (!whereClauses.isEmpty()) { sql.append(" where "); for (var it = whereClauses.iterator(); it.hasNext(); ) { sql.append(it.next()); if (it.hasNext()) { sql.append(" and "); } } } sql.append(" order by " + FEDORA_ID_COLUMN); sql.append(" limit :limit offset :offset"); parameterSource.addValue("limit", parameters.getMaxResults()); parameterSource.addValue("offset", parameters.getOffset()); final List<Map<String, Object>> items = jdbcTemplate.queryForList(sql.toString(), parameterSource); final var pagination = new PaginationInfo(parameters.getMaxResults(), parameters.getOffset()); return new SearchResult(items, pagination); }
Source:
<code>public ApplicationBean() { standardInboundAuthTypes = new ArrayList<String>(); standardInboundAuthTypes.add("oauth2"); standardInboundAuthTypes.add("wstrust"); standardInboundAuthTypes.add("samlsso"); standardInboundAuthTypes.add("openid"); <START> standardInboundAuthTypes.add("passivests"); <END> }</code><technical_language>Do need standard types in ApplicationBean. in DAO level is enough. this level treat generic config types right</technical_language>

Target:
public ApplicationBean() { }
Source:
<code>public boolean contains(TokenRange that) { if (this.isEmpty() || that.isEmpty()) return false; return this.contains(that.start, true) <START> && this.contains(that.end, false); <END> }</code><technical_language>This work if other range ends wraps around, for example ]4,8].contains(]7,5]) false. A straightforward implement contains is java this.intersects(that) && this.intersectWith(that).equals(that) If add it, inline simplify code</technical_language>

Target:
public boolean contains(TokenRange that) { if (this.isEmpty() || that.isEmpty() || !this.intersects(that)) return false; List<TokenRange> intersection = this.intersectWith(that); return intersection.size() == 1 && intersection.get(0).equals(that); }
Source:
<code>public void setup() throws Exception { MockitoAnnotations.initMocks(this); nameProvider = new ParanamerNameProvider(new DefaultCacheStore<AccessibleObject, List<Parameter>>()); this.provider = getProvider(); this.errors = new ArrayList<>(); when(converters.existsFor(Long.class)).thenReturn(true); when(converters.existsFor(long.class)).thenReturn(true); when(converters.existsFor(String.class)).thenReturn(true); when(converters.to(Long.class)).thenReturn(new LongConverter()); when(converters.to(long.class)).thenReturn(new PrimitiveLongConverter()); when(converters.to(String.class)).thenReturn(new StringConverter()); buyA = method("buyA", House.class); kick = method("kick", AngryCat.class); error = method("error", WrongCat.class); array = method("array", Long[].class); list = method("list", List.class); listOfObject= method("listOfObject", List.class); abc = method("abc", ABC.class); simple = method("simple", Long.class); string = method("string", String.class); stringArray = method("stringArray", String[].class); dependency = method("dependency", Result.class); primitive = method("primitive", long.class); doNothing = method("doNothing"); <START> generic = DefaultControllerMethod.instanceFor(Specific.class, new Mirror().on(Specific.class).reflect().method("generic").withAnyArgs()); <END> }</code><technical_language>this change</technical_language>

Target:
public void setup() throws Exception { MockitoAnnotations.initMocks(this); nameProvider = new ParanamerNameProvider(new DefaultCacheStore<AccessibleObject, List<Parameter>>()); this.provider = getProvider(); this.errors = new ArrayList<>(); when(converters.existsFor(Long.class)).thenReturn(true); when(converters.existsFor(long.class)).thenReturn(true); when(converters.existsFor(String.class)).thenReturn(true); when(converters.to(Long.class)).thenReturn(new LongConverter()); when(converters.to(long.class)).thenReturn(new PrimitiveLongConverter()); when(converters.to(String.class)).thenReturn(new StringConverter()); buyA = method("buyA", House.class); kick = method("kick", AngryCat.class); error = method("error", WrongCat.class); array = method("array", Long[].class); list = method("list", List.class); listOfObject= method("listOfObject", List.class); abc = method("abc", ABC.class); simple = method("simple", Long.class); string = method("string", String.class); stringArray = method("stringArray", String[].class); dependency = method("dependency", Result.class); primitive = method("primitive", long.class); doNothing = method("doNothing"); generic = DefaultControllerMethod.instanceFor(Specific.class, Generic.class.getDeclaredMethod("generic", Object.class)); }
Source:
<code>public ProcessingFamilyDefinition() { super(NAME, new AggregateDefinition(), new FieldSelectorDefinition(), new FilterRowDefinition(), new NormalizeDefinition(), <START> new PythonRowDefinition(), new ReplicateDefinition(), new TypeConverterDefinition(), new WindowDefinition()); <END> }</code><technical_language>Please, careful, conflict <LINK_0></technical_language>

Target:
public ProcessingFamilyDefinition() { super(NAME, new AggregateDefinition(), new FieldSelectorDefinition(), new FilterRowDefinition(), new LimitDefinition(), new NormalizeDefinition(), new PythonRowDefinition(), new ReplicateDefinition(), new TypeConverterDefinition(), new WindowDefinition()); }
Source:
<code>protected Version getStoragePoolClusterLevel(Guid StoragePoolId) { <START> StoragePool storagePool = DbFacade.getInstance().getStoragePoolDao().get(StoragePoolId); <END> if (storagePool != null) { return storagePool.getcompatibility_version(); } else { log.errorFormat( "IrsBroker::getStoragePoolClusterLevel:: Could not find master domain for pool {0} !!!", getParameters().getStoragePoolId()); return null; } }</code><technical_language>awesome if add a method of getStoragePoolDao() return DbFacade.getInstance().getStoragePoolDao. I promised explanation , I provide (it mocking life easier, a step Dependency injection)</technical_language>

Target:
protected Version getStoragePoolClusterLevel(Guid StoragePoolId) { StoragePool storagePool = getStoragePoolDao().get(StoragePoolId); if (storagePool != null) { return storagePool.getcompatibility_version(); } else { log.errorFormat( "IrsBroker::getStoragePoolClusterLevel:: Could not find master domain for pool {0} !!!", getParameters().getStoragePoolId()); return null; } }
Source:
<code>public HttpMethod getMethod() { HttpMethod method = HttpMethod.resolve(this.jettyRequest.getMethod()); <START> Assert.notNull(method, "Method must not be null"); <END> return method; }</code><technical_language>Assert.state is more suitable here, notNull results in IllegalArgumentException</technical_language>

Target:
public HttpMethod getMethod() { HttpMethod method = HttpMethod.resolve(this.jettyRequest.getMethod()); Assert.state(method != null, "Method must not be null"); return method; }
Source:
<code>private Trigger postNewTriggerWithForm( @NonNull TriggeredCommandForm form, @NonNull Predicate predicate, @Nullable TriggerOptions options) throws ThingIFException { if (this.target == null) { throw new IllegalStateException("Can not perform this action before onboarding"); } if (form == null) { throw new IllegalArgumentException("form is null."); } if (predicate == null) { throw new IllegalArgumentException("predicate is null."); } JSONObject requestBody = options != null ? JsonUtils.newJson(this.gson.toJson(options)) : new JSONObject(); try { requestBody.put("triggersWhat", TriggersWhat.COMMAND.name()); requestBody.put("predicate", JsonUtils.newJson( this.gson.toJson(predicate, Predicate.class))); JSONObject command = JsonUtils.newJson( this.gson.toJson(form)); command.put("issuer", this.owner.getTypedID()); if (form.getTargetID() == null) { <START> command.put("target", this.target.getTypedID().toString()); <END> } requestBody.put("command", command); } catch (JSONException e) { throw new RuntimeException(e); } return postNewTrigger(requestBody); }</code><technical_language>I java if (!command.has("target")) { is java if (form.getTargetID() == null) need put target field if command field. I checking command is more clear. this liking. If do suggestion. Please ignore this:)</technical_language>

Target:
private Trigger postNewTriggerWithForm( @NonNull TriggeredCommandForm form, @NonNull Predicate predicate, @Nullable TriggerOptions options) throws ThingIFException { if (this.target == null) { throw new IllegalStateException("Can not perform this action before onboarding"); } if (form == null) { throw new IllegalArgumentException("form is null."); } if (predicate == null) { throw new IllegalArgumentException("predicate is null."); } JSONObject requestBody = options != null ? JsonUtils.newJson(this.gson.toJson(options)) : new JSONObject(); try { requestBody.put("triggersWhat", TriggersWhat.COMMAND.name()); requestBody.put("predicate", JsonUtils.newJson( this.gson.toJson(predicate, Predicate.class))); JSONObject command = JsonUtils.newJson( this.gson.toJson(form)); command.put("issuer", this.owner.getTypedID()); if (!command.has("target")) { command.put("target", this.target.getTypedID().toString()); } requestBody.put("command", command); } catch (JSONException e) { throw new RuntimeException(e); } return postNewTrigger(requestBody); }
Source:
<code><START> private Ordering<Row> dimensionOrdering(final String dimension, final StringComparator comparator) <END> { return Ordering.from(comparator) .nullsFirst() .onResultOf( new Function<Row, String>() { @Override public String apply(Row input) { final List<String> dimList = input.getDimension(dimension); return dimList.isEmpty() ? null : dimList.get(0); } } ); }</code><technical_language>please change dimensionOrdering() align metricOrdering()</technical_language>

Target:
private Ordering<Row> dimensionOrdering(final String dimension, final StringComparator comparator) { return Ordering.from(Comparator.comparing((Row row) -> row.getDimension(dimension).isEmpty() ? null : row.getDimension(dimension).get(0), Comparator.nullsFirst(comparator))); }
Source:
<code>public void scaleDownAndUp() throws Exception { int defaultNumInstancesperContainer = 4; topologyConfig.setComponentRam(BOLT_NAME, instanceDefaultResources.getRam()); topologyConfig.setComponentRam(SPOUT_NAME, instanceDefaultResources.getRam()); PackingPlan packingPlan = getFirstFitDecreasingPackingPlan(topology); Assert.assertEquals(packingPlan.getContainers().size(), 2); Assert.assertEquals(totalInstances, packingPlan.getInstanceCount()); int spoutScalingDown = -4; int boltScalingUp = 6; Map<String, Integer> componentChanges = new HashMap<>(); componentChanges.put(SPOUT_NAME, spoutScalingDown); componentChanges.put(BOLT_NAME, boltScalingUp); PackingPlan newPackingPlan = getFirstFitDecreasingPackingPlanRepack(topology, packingPlan, componentChanges); Assert.assertEquals(3, newPackingPlan.getContainers().size()); Assert.assertEquals((Integer) (totalInstances + spoutScalingDown + boltScalingUp), newPackingPlan.getInstanceCount()); <START> AssertPacking.assertNumInstances(newPackingPlan.getContainers(), <END> BOLT_NAME, 9); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), SPOUT_NAME, 0); AssertPacking.assertContainerRam(newPackingPlan.getContainers(), defaultNumInstancesperContainer * instanceDefaultResources.getRam()); }</code><technical_language>For this test others assert correct expected bolt spout sizes scale, starting correct assumptions</technical_language>

Target:
public void scaleDownAndUp() throws Exception { int defaultNumInstancesperContainer = 4; int spoutScalingDown = -4; int boltScalingUp = 6; Map<String, Integer> componentChanges = new HashMap<>(); componentChanges.put(SPOUT_NAME, spoutScalingDown); componentChanges.put(BOLT_NAME, boltScalingUp); int numContainersBeforeRepack = 2; PackingPlan newPackingPlan = doDefaultScalingTest(componentChanges, numContainersBeforeRepack); Assert.assertEquals(3, newPackingPlan.getContainers().size()); Assert.assertEquals((Integer) (totalInstances + spoutScalingDown + boltScalingUp), newPackingPlan.getInstanceCount()); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), BOLT_NAME, 9); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), SPOUT_NAME, 0); AssertPacking.assertContainerRam(newPackingPlan.getContainers(), defaultNumInstancesperContainer * instanceDefaultResources.getRam()); }
Source:
<code>private void phaseTwo(final long seq, PaxosProposalId proposalId, PaxosValue proposalValue) throws PaxosRoundFailureException { final PaxosProposal proposal = new PaxosProposal(proposalId, proposalValue); PaxosResponses<PaxosResponse> responses = PaxosQuorumChecker.collectQuorumResponses( acceptors, acceptor -> acceptor.accept(seq, proposal), quorumSize, <START> Duration.ofMillis(750)); <END> if (!responses.hasQuorum()) { throw new PaxosRoundFailureException("failed to acquire quorum in paxos phase two"); } }</code><technical_language>Sure. This (and above) feel a constant</technical_language>

Target:
private void phaseTwo(final long seq, PaxosProposalId proposalId, PaxosValue proposalValue) throws PaxosRoundFailureException { final PaxosProposal proposal = new PaxosProposal(proposalId, proposalValue); PaxosResponses<PaxosResponse> responses = PaxosQuorumChecker.collectQuorumResponses( acceptors, acceptor -> acceptor.accept(seq, proposal), quorumSize, executor, PaxosQuorumChecker.DEFAULT_REMOTE_REQUESTS_TIMEOUT); if (!responses.hasQuorum()) { throw new PaxosRoundFailureException("failed to acquire quorum in paxos phase two"); } }
Source:
<code>public void testCheckWrongArgumentForServerPassword() throws Exception { OracleExportAction.OracleExportActionConfig oracleExportActionConfig = new OracleExportAction.OracleExportActionConfig(sshServer.getHost(), sshServer.getPort(), USER, "wrongPassword", "system", "cask", "home", "sid", "/tmp/junit.csv", "select * from test;", "csv"); OracleExportAction oracleExportAction = new OracleExportAction(oracleExportActionConfig); MockActionContext mockActionContext = new MockActionContext(); try { oracleExportAction.run(mockActionContext); <START> } catch (IOException e) { <END> Assert.assertEquals("SSH authentication error when connecting to test@" + sshServer.getHost() + " on port " + sshServer.getPort(), e.getMessage()); } }</code><technical_language>throw a more specific exception instead rely verifying error message</technical_language>

Target:
public void testCheckWrongArgumentForServerPassword() throws Exception { OracleExportAction.OracleExportActionConfig oracleExportActionConfig = new OracleExportAction.OracleExportActionConfig(sshServer.getHost(), sshServer.getPort(), USER, "Password", "wrongPassword", "", "", "system", "cask", "home", "sid", "/tmp/junit.csv", "select * from test;", "", "/tmp", "CSV"); OracleExportAction oracleExportAction = new OracleExportAction(oracleExportActionConfig); MockActionContext mockActionContext = new MockActionContext(); oracleExportAction.run(mockActionContext); }
Source:
<code>? new OSSupportMacOSXCocoa.Cocoa64() : new OSSupportMacOSXCocoa.Cocoa32() : new OSSupportMacOSXCarbon(); private static final String OS_VERSION_PROPERTY = "os.version"; private static final String OS_VERSION = System.getProperties().get(OS_VERSION_PROPERTY).toString(); <START> private static final Object flip_flag_is_set = System.getProperties().get(FLIP_FLAG_NAME); <END> private static final int version = Integer.parseInt(OS_VERSION.split("\\.")[0]); private static final int mod = Integer.parseInt(OS_VERSION.split("\\.")[1]); private static final boolean isHighSierraOrMore = version > 10 || version == 10 && mod >= 13; private static final boolean mustFlipImage = flip_flag_is_set != null ? Boolean.getBoolean(FLIP_FLAG_NAME) : isHighSierraOrMore; protected OSSupportMacOSX() { }</code><technical_language>Olivier, put this in a static{} block try/catch declare fields? do think</technical_language>

Target:
? new OSSupportMacOSXCocoa.Cocoa64() : new OSSupportMacOSXCocoa.Cocoa32() : new OSSupportMacOSXCarbon(); private static boolean mustFlipImage; static { String osVersion = System.getProperties().get("os.version").toString(); Object flip_flag_is_set = System.getProperties().get(FLIP_FLAG); int version = Integer.parseInt(osVersion.split("\\.")[0]); int mod = Integer.parseInt(osVersion.split("\\.")[1]); boolean isHighSierraOrMore = version > 10 || version == 10 && mod >= 13; mustFlipImage = flip_flag_is_set != null ? Boolean.getBoolean(FLIP_FLAG) : isHighSierraOrMore; } protected OSSupportMacOSX() { }
Source:
<code>public void writeIndex(final Path output) throws IOException { if (output == null) { throw new IllegalArgumentException("null output path"); } <START> final int numberOfBlocksToWrite = getNumberOfBlocks() - 1; <END> final ByteBuffer buffer = allocateBuffer(numberOfBlocksToWrite, true); buffer.putLong(Integer.toUnsignedLong(numberOfBlocksToWrite)); for (final IndexEntry entry : entries.subList(1, entries.size())) { buffer.putLong(entry.getCompressedOffset()); buffer.putLong(entry.getUncompressedOffset()); } Files.write(output, buffer.array()); }</code><technical_language>yeah, this complicated things, drop need for</technical_language>

Target:
public void writeIndex(final Path output) throws IOException { if (output == null) { throw new IllegalArgumentException("null output path"); } final int numberOfBlocksToWrite = entries.size(); final ByteBuffer buffer = allocateBuffer(numberOfBlocksToWrite, true); buffer.putLong(Integer.toUnsignedLong(numberOfBlocksToWrite)); for (final IndexEntry entry : entries) { buffer.putLong(entry.getCompressedOffset()); buffer.putLong(entry.getUncompressedOffset()); } Files.write(output, buffer.array()); }
Source:
<code>private boolean isVirtualDevice() throws DeviceNotAvailableException { return getDevice().getSetting("global", <START> "device_name").toLowerCase().contains("cuttlefish"); <END> }</code><technical_language>this work for emulator for example</technical_language>

Target:
private boolean isVirtualDevice() throws DeviceNotAvailableException { return Objects.equals(getDevice().getProperty("ro.hardware.virtual_device"), "1"); }
Source:
<code>public void restrictedLoginDialogNotShownAfterConfirmationTest() { onView(withId(android.R.id.button1)) .perform(click()); <START> relaunchActivity(); <END> onView(withText(R.string.dialog_restricted_login_title)) .check(doesNotExist()); }</code><technical_language>stated in of other PRs im a huge fan of activity switching restarting in tests. is easier check this? set flag shared preference remembers dialog discarded, launch activity check dialog is displayed launch</technical_language>

Target:
public void restrictedLoginDialogNotShownAfterConfirmationTest() { onView(withId(android.R.id.button1)) .perform(click()); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(baseActivityTestRule.getActivity()); assertTrue("Token has been set but shouldn't be!", sharedPreferences.getBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, false)); }
Source:
<code>public static PostReceiveHook newChain(List<? extends PostReceiveHook> hooks) { PostReceiveHook[] newHooks = new PostReceiveHook[hooks.size()]; int i = 0; for (PostReceiveHook hook : hooks) { <START> if (hook != PostReceiveHook.NULL) <END> newHooks[i++] = hook; } if (i == 0) return PostReceiveHook.NULL; else if (i == 1) return newHooks[0]; else return new PostReceiveHookChain(newHooks); }</code><technical_language>This fails I pass in [hook1, NULL, NULL, hook2]. result array [hook1, hook2, null, null] onPostReceive method NPE invoke 3rd element. try cute filter out NULL hook</technical_language>

Target:
public static PostReceiveHook newChain( List<? extends PostReceiveHook> hooks) { PostReceiveHook[] newHooks = new PostReceiveHook[hooks.size()]; int i = 0; for (PostReceiveHook hook : hooks) if (hook != PostReceiveHook.NULL) newHooks[i++] = hook; if (i == 0) return PostReceiveHook.NULL; else if (i == 1) return newHooks[0]; else return new PostReceiveHookChain(newHooks, i); }
Source:
<code>static protected List<Sample> getTimeOfDayAsMeasurement(final List<Sample> light, final double startNaturalLightForbiddedenHour, final double stopNaturalLightForbiddenHour) { <START> List<Sample> minuteData = new ArrayList<>(); <END> for (final Sample s : light) { final DateTime t = new DateTime(s.dateTime + s.offsetMillis, DateTimeZone.UTC); final float hour = ((float)t.hourOfDay().get()) + t.minuteOfHour().get() / 60.0f; float value = 0.0f; if (hour > startNaturalLightForbiddedenHour || hour < stopNaturalLightForbiddenHour) { value = 1.0f; } minuteData.add(new Sample(s.dateTime,value,s.offsetMillis)); } return minuteData; }</code><technical_language>guava style please. Lists.newArrayList();</technical_language>

Target:
static protected List<Sample> getTimeOfDayAsMeasurement(final List<Sample> light, final double startNaturalLightForbiddedenHour, final double stopNaturalLightForbiddenHour) { final List<Sample> minuteData = Lists.newArrayList(); for (final Sample s : light) { final DateTime t = new DateTime(s.dateTime + s.offsetMillis, DateTimeZone.UTC); final float hour = ((float)t.hourOfDay().get()) + t.minuteOfHour().get() / 60.0f; float value = 0.0f; if (hour > startNaturalLightForbiddedenHour || hour < stopNaturalLightForbiddenHour) { value = 1.0f; } minuteData.add(new Sample(s.dateTime,value,s.offsetMillis)); } return minuteData; }
Source:
<code>public boolean isChangedBy(ProductData dto) { if (dto == null) { throw new IllegalArgumentException("dto is null"); } if (dto.getId() != null && !dto.getId().equals(this.id)) { return true; } if (dto.getName() != null && !dto.getName().equals(this.name)) { return true; } if (dto.getMultiplier() != null && !dto.getMultiplier().equals(this.multiplier)) { return true; } <START> Collection<String> dependentProductIds = dto.getDependentProductIds(); <END> if (dependentProductIds != null && !Util.collectionsAreEqual(this.dependentProductIds, dependentProductIds)) { return true; } Collection<ProductAttributeData> attributes = dto.getAttributes(); if (attributes != null) { Comparator comparator = new Comparator<Object>() { public int compare(Object lhs, Object rhs) { return ((ProductAttribute) lhs).isChangedBy((ProductAttributeData) rhs) ? 1 : 0; } }; if (!Util.collectionsAreEqual( (Collection) this.attributes, (Collection) attributes, comparator)) { return true; } } Collection<ProductContentData> productContent = dto.getProductContent(); if (productContent != null) { Comparator comparator = new Comparator<Object>() { public int compare(Object lhs, Object rhs) { return ((ProductContent) lhs).isChangedBy((ProductContentData) rhs) ? 1 : 0; } }; if (!Util.collectionsAreEqual( (Collection) this.productContent, (Collection) productContent, comparator)) { return true; } } return false; }</code><technical_language>want this check in place</technical_language>

Target:
public boolean isChangedBy(ProductData dto) { if (dto == null) { throw new IllegalArgumentException("dto is null"); } if (dto.getId() != null && !dto.getId().equals(this.id)) { return true; } if (dto.getName() != null && !dto.getName().equals(this.name)) { return true; } if (dto.getMultiplier() != null && !dto.getMultiplier().equals(this.multiplier)) { return true; } if (dto.isLocked() != null && !dto.isLocked().equals(this.locked)) { return true; } Collection<String> dependentProductIds = dto.getDependentProductIds(); if (dependentProductIds != null && !Util.collectionsAreEqual(this.dependentProductIds, dependentProductIds)) { return true; } Collection<ProductAttributeData> attributes = dto.getAttributes(); if (attributes != null) { Comparator comparator = new Comparator<Object>() { public int compare(Object lhs, Object rhs) { return ((ProductAttribute) lhs).isChangedBy((ProductAttributeData) rhs) ? 1 : 0; } }; if (!Util.collectionsAreEqual( (Collection) this.attributes, (Collection) attributes, comparator)) { return true; } } Collection<ProductContentData> productContent = dto.getProductContent(); if (productContent != null) { Comparator comparator = new Comparator<Object>() { public int compare(Object lhs, Object rhs) { return ((ProductContent) lhs).isChangedBy((ProductContentData) rhs) ? 1 : 0; } }; if (!Util.collectionsAreEqual( (Collection) this.productContent, (Collection) productContent, comparator)) { return true; } } return false; }
Source:
<code>private ICPPExecution loopOverArray(IVariable rangeVar, ICPPEvaluation valueRange, ActivationRecord record, ConstexprEvaluationContext context) { <START> ICPPEvaluation[] range = valueRange.getValue(null).getAll(); <END> for(int i = 0; i < range.length; i++ ) { ICPPEvaluation value = new EvalFixed(range[i].getType(null), range[i].getValueCategory(null), range[i].getValue(null)); if(rangeVar.getType() instanceof ICPPReferenceType) { value = new EvalReference(record, new EvalCompositeAccess(valueRange, i), value.getTemplateDefinition()); } record.update(rangeVar, value); ICPPExecution result = EvalUtil.executeStatement(bodyExec, record, context); if(result instanceof ExecReturn) { return result; } else if(result instanceof ExecBreak) { break; } else if(result instanceof ExecContinue) { continue; } } return null; }</code><technical_language>this file, null -> context.getPoint()</technical_language>

Target:
private ICPPExecution loopOverArray(IVariable rangeVar, ICPPEvaluation valueRange, ActivationRecord record, ConstexprEvaluationContext context) { ICPPEvaluation[] range = valueRange.getValue(context.getPoint()).getAll(); for(int i = 0; i < range.length; i++ ) { ICPPEvaluation value = new EvalFixed(range[i].getType(context.getPoint()), range[i].getValueCategory(context.getPoint()), range[i].getValue(context.getPoint())); if(rangeVar.getType() instanceof ICPPReferenceType) { value = new EvalReference(record, new EvalCompositeAccess(valueRange, i), value.getTemplateDefinition()); } record.update(rangeVar, value); ICPPExecution result = EvalUtil.executeStatement(bodyExec, record, context); if(result instanceof ExecReturn) { return result; } else if(result instanceof ExecBreak) { break; } else if(result instanceof ExecContinue) { continue; } } return null; }
Source:
<code>protected boolean validate() { getParameter().setTable(ElasticsearchUtils.getValidTableName(getParameter().getTable())); try { return !(getParameter().getTable() == null || !getTableMetadataManager().exists(ElasticsearchUtils.getValidTableName(getParameter().getTable()))); } catch (Exception e) { <START> logger.error("Error while checking table's existence.", e); <END> return false; } }</code><technical_language>Throw errors proper error codes for conditions</technical_language>

Target:
protected void validate() throws QueryStoreException { String tableName = ElasticsearchUtils.getValidTableName(getParameter().getTable()); try { if (tableName == null) { throw new QueryStoreException(QueryStoreException.ErrorCode.INVALID_REQUEST, "Table cannot be null"); } else if (!getTableMetadataManager().exists(tableName)) { throw new QueryStoreException(QueryStoreException.ErrorCode.NO_SUCH_TABLE, "Table not found"); } } catch (QueryStoreException e) { logger.error("Table is null or not found.", getParameter().getTable()); throw e; } catch (Exception e) { logger.error("Error while checking table's existence.", e); throw new QueryStoreException(QueryStoreException.ErrorCode.QUERY_EXECUTION_ERROR, "Error while fetching metadata"); } }
Source:
<code>public static long fsTick(File lastFile) throws InterruptedException, IOException { long sleepTime = 1; File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null); long startTime = (lastFile == null) ? tmp.lastModified() : lastFile .lastModified(); <START> tmp.deleteOnExit(); <END> long actTime = tmp.lastModified(); while (actTime <= startTime) { Thread.sleep(sleepTime); sleepTime *= 5; tmp.setLastModified(System.currentTimeMillis()); actTime = tmp.lastModified(); } return actTime; }</code><technical_language>deleteOnExit? If create this file in trash directory for this test, cleaned automatically test ends. delete function returns</technical_language>

Target:
public static long fsTick(File lastFile) throws InterruptedException, IOException { long sleepTime = 1; File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null); try { long startTime = (lastFile == null) ? tmp.lastModified() : lastFile .lastModified(); long actTime = tmp.lastModified(); while (actTime <= startTime) { Thread.sleep(sleepTime); sleepTime *= 5; tmp.setLastModified(System.currentTimeMillis()); actTime = tmp.lastModified(); } return actTime; } finally { tmp.delete(); } }
Source:
<code>public void testCreateCorrelationPropertyInfo() throws Exception { CorrelationKeyFactory factory = KieInternalServices.Factory.get().newCorrelationKeyFactory(); EntityManagerFactory emf = (EntityManagerFactory) context.get(EnvironmentName.ENTITY_MANAGER_FACTORY); UserTransaction ut = InitialContext.doLookup("java:comp/UserTransaction"); ut.begin(); try { EntityManager em = emf.createEntityManager(); em.persist(factory.newCorrelationKey(correlationKey)); ut.commit(); } catch (Exception ex) { ut.rollback(); Assert.fail("Exception thrown while trying to prepare correlation data."); } EntityManager em = emf.createEntityManager(); TypedQuery<CorrelationPropertyInfo> query = em.createQuery("SELECT o FROM CorrelationPropertyInfo o WHERE o.value = :ckey", CorrelationPropertyInfo.class); query.setParameter("ckey", correlationKey.substring(0, 255)); List<CorrelationPropertyInfo> keyInfo = query.getResultList(); for (CorrelationPropertyInfo key : keyInfo) { <START> System.out.println(key); <END> } em.close(); assertNotNull(keyInfo); assertEquals(1, keyInfo.size()); }</code><technical_language>I get rid of this println</technical_language>

Target:
public void testCreateCorrelationPropertyInfo() throws Exception { CorrelationKeyFactory factory = KieInternalServices.Factory.get().newCorrelationKeyFactory(); EntityManagerFactory emf = (EntityManagerFactory) context.get(EnvironmentName.ENTITY_MANAGER_FACTORY); UserTransaction ut = InitialContext.doLookup("java:comp/UserTransaction"); ut.begin(); try { EntityManager em = emf.createEntityManager(); em.persist(factory.newCorrelationKey(correlationKey)); ut.commit(); } catch (Exception ex) { ut.rollback(); Assert.fail("Exception thrown while trying to prepare correlation data."); } EntityManager em = emf.createEntityManager(); TypedQuery<CorrelationPropertyInfo> query = em.createQuery("SELECT o FROM CorrelationPropertyInfo o WHERE o.value = :ckey", CorrelationPropertyInfo.class); query.setParameter("ckey", correlationKey.substring(0, 255)); List<CorrelationPropertyInfo> keyInfo = query.getResultList(); em.close(); assertNotNull(keyInfo); assertEquals(1, keyInfo.size()); }
Source:
<code>public static String[] supportedResourcesPhoebus(){ String resources = getString(PHOEBUS_RESOURCES); if(resources == null || resources.trim().isEmpty()) resources = "bob"; try { return StringSplitter.splitIgnoreInQuotes(resources, ITEM_SEPARATOR, true); } catch (Exception e) { <START> ErrorHandlerUtil.handleError("Failed to parse hidden_widgets preference", e); <END> return null; } }</code><technical_language>hidden_widgets</technical_language>

Target:
public static String[] supportedResourcesPhoebus(){ String resources = getString(PHOEBUS_RESOURCES); if(resources == null || resources.trim().isEmpty()) resources = "bob"; try { return StringSplitter.splitIgnoreInQuotes(resources, ITEM_SEPARATOR, true); } catch (Exception e) { ErrorHandlerUtil.handleError("Failed to parse phoebus_resources preference", e); return null; } }
Source:
<code>private void completeDeployment(final BundleResourceDeployment resourceDeployment, BundleDeploymentStatus status, String message) { getBundleServerService().setBundleDeploymentStatus(resourceDeployment.getId(), status); BundleResourceDeploymentHistory.Status auditStatus = null; if(BundleDeploymentStatus.SUCCESS == status) { auditStatus = BundleResourceDeploymentHistory.Status.SUCCESS; inventoryManager.executeServiceScanDeferred(resourceDeployment.getResource().getId(), <START> configuration.getChildResourceDiscoveryDelay() * 1000); <END> } else { auditStatus = BundleResourceDeploymentHistory.Status.FAILURE; } auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_ENDED, resourceDeployment.getBundleDeployment().getName(), null, auditStatus, message, null); }</code><technical_language>this config property. This is number of seconds discovery is attempted a newly created resource. do is wait long enough new resources initialize in managed resource bundle deployment discoverable. interchangeable? similar argue waiting long enough for a new resource initialize children discoverable is (or bigger) waiting for new resource "materialize". 100% Jay's analytic brain find issues :-) Another question I is is enough for this agent-wide constant. resource components define (in plugin descriptor?) user deployment time? if is worth effort</technical_language>

Target:
private void completeDeployment(final BundleResourceDeployment resourceDeployment, BundleDeploymentStatus status, String message) { getBundleServerService().setBundleDeploymentStatus(resourceDeployment.getId(), status); BundleResourceDeploymentHistory.Status auditStatus = null; if(BundleDeploymentStatus.SUCCESS == status) { auditStatus = BundleResourceDeploymentHistory.Status.SUCCESS; Integer discoveryDelay = resourceDeployment.getBundleDeployment().getDiscoveryDelay(); if(discoveryDelay == null) { discoveryDelay = Integer.valueOf(0); } if(!(discoveryDelay.intValue() < 0)) { inventoryManager.executeServiceScanDeferred(resourceDeployment.getResource().getId(), discoveryDelay * 1000); } } else { auditStatus = BundleResourceDeploymentHistory.Status.FAILURE; } auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_ENDED, resourceDeployment.getBundleDeployment().getName(), null, auditStatus, message, null); }
Source:
<code>public String toString() { StringBuffer buffer = new StringBuffer(); <START> buffer.append("CompactionDetal:") <END> .append(compactionDetails.toString()) .append("\n") .append("CopyStartTime:") .append(copyStartTime) .append("\n") .append("CommitStartTime:") .append(commitStartTime) .append("\n") .append("CleanupStartTime:") .append(cleanupStartTime) .append("\n") .append("CycleEndTime:") .append(cycleEndTime) .append("\n"); return buffer.toString(); }</code><technical_language>typo: CompactionDetails</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CompactionDetails:") .append(compactionDetails.toString()) .append("\n") .append("CopyStartTime:") .append(copyStartTime) .append("\n") .append("CommitStartTime:") .append(commitStartTime) .append("\n") .append("CleanupStartTime:") .append(cleanupStartTime) .append("\n") .append("CycleEndTime:") .append(cycleEndTime) .append("\n"); if (safeToken != null) { sb.append("SafeToken:").append(safeToken.toString()).append("\n"); } return sb.toString(); }
Source:
<code>private void appendShowHideButtons() { String hideButton = "<button type=\"button\" onclick=\"hideLowLevelActions()\">hide low level actions</button>"; String showButton = "<button type=\"button\" onclick=\"showLowLevelActions()\">show low level actions</button>"; StringBuilder builder = new StringBuilder(); <START> builder.append(hideButton+showButton); <END> CommonUtils.appendTextToFile(logPath, builder.toString()); }</code><technical_language>build.append(hideButton); build.append(showButton);</technical_language>

Target:
private void appendShowHideButtons() { String hideButton = "<button id=\"hideLowLevel\">hide low level actions</button>"; String showButton = "<button id=\"showLowLevel\">show low level actions</button>"; StringBuilder builder = new StringBuilder(); builder.append(hideButton); builder.append(showButton); CommonUtils.appendTextToFile(logPath, builder.toString()); }
Source:
<code>protected final Object invokeNextAndCommitIf1Pc(TxInvocationContext ctx, PrepareCommand command) throws Throwable { Object result = invokeNextInterceptor(ctx, command); <START> if (command.isOnePhaseCommit() && (ctx.isOriginLocal() || configuration.isSecondPhaseAsync())) { <END> lockManager.unlockAll(ctx); } return result; }</code><technical_language>wrapping (ctx.isOriginLocal() || configuration.isSecondPhaseAsync()) in a separate method a bit clearer</technical_language>

Target:
protected final Object invokeNextAndCommitIf1Pc(TxInvocationContext ctx, PrepareCommand command) throws Throwable { Object result = invokeNextInterceptor(ctx, command); if (command.isOnePhaseCommit() && releaseLockOnTxCompletion(ctx)) { lockManager.unlockAll(ctx); } return result; }
Source:
<code>protected NodeSelection getSelectionHistory(ExecutionEvent event) { TaskView taskView = getTaskView(event); if (taskView != null) { NodeSelection selectionHistory = taskView.getSelection(); if (!isEnabledFor(selectionHistory)) { throw new IllegalStateException( String.format("Cannot execute command '%s' for current selection.", getCommandName(event))); } return selectionHistory; } else { ISelection currentSelection = HandlerUtil.getCurrentSelection(event); <START> return NodeSelection.from(currentSelection); <END> } }</code><technical_language>method lines above. getTaskView(), getTaskView(ExecutionEvent) getCommandName(ExecutionEvent) is longer deleted</technical_language>

Target:
protected NodeSelection getSelectionHistory(ExecutionEvent event) { ISelection currentSelection = HandlerUtil.getCurrentSelection(event); return NodeSelection.from(currentSelection); }
Source:
<code>public Integer getId() { <START> return id; <END> }</code><technical_language>this. prefix for class properties</technical_language>

Target:
public Integer getId() { return this.id; }
Source:
<code>public String toString() { return "TaskSelectionEvent{" + "forAdmin=" + forAdmin + ", forLog=" + forLog + ", description='" + description + '\'' + ", expirationTime=" + expirationTime + ", actualOwner='" + actualOwner + '\'' + ", status='" + status + '\'' + ", slaCompliance='" + slaCompliance + '\'' + ", priority=" + priority + ", processInstanceId=" + processInstanceId + ", processId='" + processId + '\'' + ", workItemId=" + workItemId + <START> ", slaCompliance=" + slaCompliance + <END> "} " + super.toString(); }</code><technical_language>slaCompliance is</technical_language>

Target:
public String toString() { return "TaskSelectionEvent{" + "forAdmin=" + forAdmin + ", forLog=" + forLog + ", description='" + description + '\'' + ", expirationTime=" + expirationTime + ", actualOwner='" + actualOwner + '\'' + ", status='" + status + '\'' + ", slaCompliance='" + slaCompliance + '\'' + ", priority=" + priority + ", processInstanceId=" + processInstanceId + ", processId='" + processId + '\'' + "} " + super.toString(); }
Source:
<code>public void testGetSchema() throws Exception { File schema = File.createTempFile("schema", ".sql"); Configuration c1 = new VoltDB.Configuration(new String[]{"get", "schema", "getvoltdbroot", voltDBRootParent, "file", schema.getAbsolutePath(), "forceget"}); ServerThread server = new ServerThread(c1); try { server.cli(); } catch (SimulatedExitException ex) { } byte[] encoded = Files.readAllBytes(Paths.get(schema.getAbsolutePath())); assertNotNull(encoded); assertTrue(encoded.length > 0); <START> String ddl = new String(encoded, Constants.UTF8ENCODING); <END> assertTrue(ddl.toLowerCase().contains("create table blah (")); assertTrue(ddl.toLowerCase().contains("ival bigint default '0' not null")); assertTrue(ddl.toLowerCase().contains("primary key (ival)")); }</code><technical_language>StandardCharsets</technical_language>

Target:
public void testGetSchema() throws Exception { File schema = File.createTempFile("schema", ".sql"); Configuration config = new VoltDB.Configuration(new String[]{"get", "schema", "getvoltdbroot", voltDBRootParentPath, "file", schema.getAbsolutePath(), "forceget"}); ServerThread server = new ServerThread(config); try { server.cli(); } catch (Throwable ex) { } byte[] encoded = Files.readAllBytes(Paths.get(schema.getAbsolutePath())); assertNotNull(encoded); assertTrue(encoded.length > 0); String ddl = new String(encoded, StandardCharsets.UTF_8); assertTrue(ddl.toLowerCase().contains("create table blah (")); assertTrue(ddl.toLowerCase().contains("ival bigint default '0' not null")); assertTrue(ddl.toLowerCase().contains("primary key (ival)")); }
Source:
<code>protected byte[] getFramedWriteBytes() { if (writeBuffer == null) { throw new UnsupportedOperationException("No write buffer set on FTranspprt"); } int numBytes = writeBuffer.size(); byte[] data = new byte[numBytes + 4]; ProtocolUtils.writeInt(numBytes, data, 0); System.arraycopy(writeBuffer.toByteArray(), 0, data, 4, numBytes); <START> writeBuffer.reset(); <END> return data; }</code><technical_language>question above</technical_language>

Target:
protected byte[] getFramedWriteBytes() { if (writeBuffer == null) { throw new UnsupportedOperationException("No write buffer set on FTranspprt"); } int numBytes = writeBuffer.size(); byte[] data = new byte[numBytes + 4]; ProtocolUtils.writeInt(numBytes, data, 0); System.arraycopy(writeBuffer.toByteArray(), 0, data, 4, numBytes); return data; }
Source:
<code>private void expandWorkSpaceItem() { Wait fluentWait = new FluentWait(seleniumWebDriver) <START> .withTimeout(WIDGET_TIMEOUT_SEC, SECONDS) <END> .pollingEvery(MINIMUM_SEC, SECONDS) .ignoring(StaleElementReferenceException.class, NoSuchElementException.class); fluentWait.until((ExpectedCondition<Boolean>) input -> workSpaceLink.isEnabled()); workSpaceLink.click(); }</code><technical_language>WIDGET_TIMEOUT_SEC is long timeout IMHO</technical_language>

Target:
private void expandWorkSpaceItem() { Wait fluentWait = new FluentWait(seleniumWebDriver) .withTimeout(ELEMENT_TIMEOUT_SEC, SECONDS) .pollingEvery(MINIMUM_SEC, SECONDS) .ignoring(StaleElementReferenceException.class, NoSuchElementException.class); fluentWait.until((ExpectedCondition<Boolean>) input -> workSpaceLink.isEnabled()); workSpaceLink.click(); }
Source:
<code>public UserView() { Span text = new Span("This is the view for a logged in user."); add(text); if (SessionRouteRegistry.getSessionRegistry(VaadinSession.getCurrent()) .getTargetUrl(VersionView.class).isPresent()) { <START> add(new RouterLink("Version", VersionView.class)); <END> } if (SessionRouteRegistry.getSessionRegistry(VaadinSession.getCurrent()) .getTargetUrl(TimeView.class).isPresent()) { add(new RouterLink("Time", TimeView.class)); } Button logout = new Button("Logout", e -> Login.logout()); add(logout); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Remove this call a constructor overridable "add" method. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public UserView() { Span text = new Span("This is the view for a logged in user."); add(text); RouteConfiguration routeConfiguration = RouteConfiguration .forSessionScope(); if (routeConfiguration.isRouteRegistered(VersionView.class)) { add(new RouterLink("Version", VersionView.class)); } if (routeConfiguration.isRouteRegistered(TimeView.class)) { add(new RouterLink("Time", TimeView.class)); } Button logout = new Button("Logout", e -> Login.logout()); add(logout); }