id
stringlengths
29
30
content
stringlengths
152
2.6k
codereview_new_java_data_8544
public AbstractCoordinator(GroupRebalanceConfig rebalanceConfig, /** * Invoked prior to each group join or rejoin. This is typically used to perform any * cleanup from the previous generation (such as committing offsets for the consumer) * @param generation The previous generation or -1 if there...
codereview_new_java_data_8546
public void start() { stateUpdaterThread = new StateUpdaterThread("state-updater", changelogReader, offsetResetter); stateUpdaterThread.start(); shutdownGate = new CountDownLatch(1); } - // initialize the last commit as of now to prevent first commit happens immed...
codereview_new_java_data_8548
public class ListConsumerGroupOffsetsResult { final KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> future; - public ListConsumerGroupOffsetsResult(KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> future) { this.future = future; } We need to push this public in order to be used in a...
codereview_new_java_data_8549
public class ListConsumerGroupOffsetsHandler extends AdminApiHandler.Batched<Coo private final AdminApiLookupStrategy<CoordinatorKey> lookupStrategy; public ListConsumerGroupOffsetsHandler( - String groupId, - List<TopicPartition> partitions, - LogContext logContext ) ...
codereview_new_java_data_8550
public ListConsumerGroupOffsetsResult listConsumerGroupOffsets(final String grou final ListConsumerGroupOffsetsOptions options) { SimpleAdminApiFuture<CoordinatorKey, Map<TopicPartition, OffsetAndMetadata>> future = ListConsu...
codereview_new_java_data_8553
protected AbstractWorkerSourceTask(ConnectorTaskId id, this.admin = admin; this.offsetReader = offsetReader; this.offsetWriter = offsetWriter; - this.offsetStore = offsetStore; this.closeExecutor = closeExecutor; this.sourceTaskContext = sourceTaskContext; ...
codereview_new_java_data_8554
public void configure(Map<String, ?> configs, boolean isKey) { @Override public void close() { - this.serializer.close(); - this.deserializer.close(); } @Override ```suggestion Utils.closeQuietly(this.serializer, "JSON converter serializer"); Utils.closeQuietly(...
codereview_new_java_data_8555
public SchemaAndValue toConnectHeader(String topic, String headerKey, byte[] val @Override public void close() { - Utils.closeQuietly(this.serializer, "number format serializer"); - Utils.closeQuietly(this.deserializer, "number format deserializer"); } } What is `format`? Would `number...
codereview_new_java_data_8556
boolean joinGroupIfNeeded(final Timer timer) { resetJoinGroupFuture(); synchronized (AbstractCoordinator.this) { final String shortReason = String.format("rebalance failed due to an exception: (%s)", - exception.getMessage(), ...
codereview_new_java_data_8557
boolean joinGroupIfNeeded(final Timer timer) { resetJoinGroupFuture(); synchronized (AbstractCoordinator.this) { - final String shortReason = String.format("rebalance failed due to an exception: (%s)", exception.getClass().getSimpleName())...
codereview_new_java_data_8562
public void shouldQuerySpecificActivePartitionStores() throws Exception { assertThat(store1.get(key), is(notNullValue())); assertThat(getStore(kafkaStreams2, storeQueryParam2).get(key), is(nullValue())); final InvalidStateStoreException exception = - ...
codereview_new_java_data_8563
public void shouldQuerySpecificActivePartitionStores() throws Exception { assertThat(store1.get(key), is(notNullValue())); assertThat(getStore(kafkaStreams2, storeQueryParam2).get(key), is(nullValue())); final InvalidStateStoreException exception = - ...
codereview_new_java_data_8564
public static String safeUniqueTestName(final Class<?> testClass, final TestName .replace('=', '_'); } - public static String safeUniqueClassTestName(final Class<?> testClass) { - return (testClass.getSimpleName()) - .replace(':', '_') - .replace('.', '_'...
codereview_new_java_data_8565
CompletableFuture<Long> await(T threshold, long maxWaitTimeMs); /** - * Complete awaiting futures whose associated values are smaller than the given threshold value. - * The completion callbacks will be triggered from the calling thread. * * @param value the threshold value used...
codereview_new_java_data_8576
public void testCommitAsyncWithUserAssignedType() { // should try to find coordinator since we are commit async coordinator.commitOffsetsAsync(singletonMap(t1p, new OffsetAndMetadata(100L)), (offsets, exception) -> { - throw new AssertionError("Commit should not get responses"); ...
codereview_new_java_data_8577
void handleBrokerUnfenced(int brokerId, long brokerEpoch, List<ApiMessageAndVers * @param records The record list to append to. */ void handleBrokerInControlledShutdown(int brokerId, long brokerEpoch, List<ApiMessageAndVersion> records) { - if (featureControl.metadataVersion().isInControl...
codereview_new_java_data_8578
import java.util.stream.Collectors; public enum BrokerRegistrationInControlledShutdownChange { NONE(0, Optional.empty()), IN_CONTROLLED_SHUTDOWN(1, Optional.of(true)); What do you think about document why `Optional.of(false)` is not a valid change? import java.util.stream.Collectors; public enum...
codereview_new_java_data_8579
private final Processor<KIn, VIn, KOut, VOut> processor; private final FixedKeyProcessor<KIn, VIn, VOut> fixedKeyProcessor; private final String name; - protected final Time time; public final Set<String> stateStores; - protected InternalProcessorContext<KOut, VOut> internalProcessorConte...
codereview_new_java_data_8580
private final Processor<KIn, VIn, KOut, VOut> processor; private final FixedKeyProcessor<KIn, VIn, VOut> fixedKeyProcessor; private final String name; - protected final Time time; public final Set<String> stateStores; - protected InternalProcessorContext<KOut, VOut> internalProcessorConte...
codereview_new_java_data_8581
private final Processor<KIn, VIn, KOut, VOut> processor; private final FixedKeyProcessor<KIn, VIn, VOut> fixedKeyProcessor; private final String name; - protected final Time time; public final Set<String> stateStores; - protected InternalProcessorContext<KOut, VOut> internalProcessorConte...
codereview_new_java_data_8756
private static com.google.datastore.v1.Key getKey(Mutation m) { } else if (m.hasUpdate()) { return m.getUpdate().getKey(); } else { - throw new IllegalArgumentException(String.format("Mutation %s is not valid.", m)); } } Are these 4 cases exhaustive? I also see `OPERATION_N...
codereview_new_java_data_8757
private static com.google.datastore.v1.Key getKey(Mutation m) { return m.getUpdate().getKey(); } else { LOG.warning("Mutation %s does not have an operation type set.", m); - return ""; } } ah need to return a Key.getDefaultInstance() private static com.google.datastore....
codereview_new_java_data_8758
private static com.google.datastore.v1.Key getKey(Mutation m) { } else if (m.hasUpdate()) { return m.getUpdate().getKey(); } else { - LOG.warning("Mutation %s does not have an operation type set.", m); return Entity.getDefaultInstance().getKey(); } } ```suggestion ...
codereview_new_java_data_8759
public static Set<String> getJavaCapabilities() { capabilities.add("beam:version:sdk_base:" + JAVA_SDK_HARNESS_CONTAINER_URL); capabilities.add(BeamUrns.getUrn(SplittableParDoComponents.TRUNCATE_SIZED_RESTRICTION)); capabilities.add(BeamUrns.getUrn(Primitives.TO_STRING)); - capabilities.add(BeamUrns....
codereview_new_java_data_8760
public void accept(WindowedValue<T> input) throws Exception { // Use the ExecutionStateTracker and enter an appropriate state to track the // Process Bundle Execution time metric and also ensure user counters can get an appropriate - // metrics container. for (int size = consumerAndMetadata...
codereview_new_java_data_8764
static String createJobIdWithDestination( public enum JobType { LOAD, TEMP_TABLE_LOAD, - ZERO_LOAD, COPY, EXPORT, QUERY, } /** SCHEMA_UPDATE is more informative? wdyt static String createJobIdWithDestination( public enum JobType { LOAD, TEMP_TABLE_LOAD, COPY,...
codereview_new_java_data_8769
public class ProcessBundleHandler { @VisibleForTesting final BundleProcessorCache bundleProcessorCache; private final Set<String> runnerCapabilities; - private DataSampler dataSampler; public ProcessBundleHandler( PipelineOptions options, ```suggestion private final DataSampler dataSampler; `...
codereview_new_java_data_8770
*/ public class OutputSampler<T> { private final Coder<T> coder; - private final List<T> buffer = new ArrayList<>(); private static final Logger LOG = LoggerFactory.getLogger(OutputSampler.class); // Maximum number of elements in buffer. setup the capacity of the buffer so we don't pay and resizing cos...
codereview_new_java_data_8771
public static void main( FinalizeBundleHandler finalizeBundleHandler = new FinalizeBundleHandler(executorService); // Create the sampler, if the experiment is enabled. - Optional<List<String>> experimentList = - Optional.ofNullable(options.as(ExperimentalOptions.class).getExperiments()); ...
codereview_new_java_data_8772
public DataSampler() { * @param sampleEveryN Sets how often to sample. */ public DataSampler(int maxSamples, int sampleEveryN) { - this.maxSamples = maxSamples <= 0 ? 10 : maxSamples; - this.sampleEveryN = sampleEveryN <= 0 ? 1000 : sampleEveryN; } // Maximum number of elements in buffer. Its...
codereview_new_java_data_8872
public enum RunecraftAction implements ItemSkillAction @Override public String getName(final ItemManager itemManager) { - return "Blood Rune (Zeah)"; } }, TRUE_BLOOD_RUNE(ItemID.BLOOD_RUNE, 77, 10.5f, false) These blocks should be dedented one level ```suggestion { @Override public String g...
codereview_new_java_data_8873
public static final int LION_GUARD = 44584; public static final int WARP = 44585; public static final int WARP_44586 = 44586; - public static final int RUBBLE_44595 = 44595; public static final int LAVA_POOL = 44601; public static final int WATERFALL_44602 = 44602; public static final int PREFORM_STORAGE =...
codereview_new_java_data_8874
NECTAR(Type.POTION, "Nectar", "N", ItemID.NECTAR_4, ItemID.NECTAR_3, ItemID.NECTAR_2, ItemID.NECTAR_1), AMBROSIA(Type.POTION, "Ambros", "A", ItemID.AMBROSIA_2, ItemID.AMBROSIA_1), LIQUID_ADRENALINE(Type.POTION, "L.Adrn", "L.A", ItemID.LIQUID_ADRENALINE_2, ItemID.LIQUID_ADRENALINE_1), - TEARS_OF_ELIDINIS(Type.POT...
codereview_new_java_data_8875
package io.cdap.cdap.sourcecontrol.operationrunner; /** - * Exception thrown when push operation fails in operation runner. Encapsulates all underlying exceptions. */ -public class PullFailureException extends Exception { - public PullFailureException(String message, Exception cause) { - super(message, cau...
codereview_new_java_data_8876
public void run(RunnableTaskContext context) throws Exception { ProgramRunDispatcherContext dispatcherContext = new ProgramRunDispatcherContext( GSON.fromJson(context.getParam(), ProgramRunDispatcherContext.class)); context.setCleanupTask(dispatcherContext::executeCleanupTasks); ProgramRunDispa...
codereview_new_java_data_8877
public void run(RunnableTaskContext context) throws Exception { ProgramRunDispatcherContext dispatcherContext = new ProgramRunDispatcherContext( GSON.fromJson(context.getParam(), ProgramRunDispatcherContext.class)); context.setCleanupTask(dispatcherContext::executeCleanupTasks); ProgramRunDispa...
codereview_new_java_data_8878
public Cluster getClusterDetail(ProvisionerContext context, Cluster cluster) { @Override public PollingStrategy getPollingStrategy(ProvisionerContext context, Cluster cluster) { - return PollingStrategies.fixedInterval(0, TimeUnit.SECONDS); } } do you know if we end up using this interval for creation ...
codereview_new_java_data_9795
public interface ThemeEditorCommand { - String OK = "ok"; - String ERROR = "error"; String STATE = "themeEditorState"; Nit: To not confuse these with actual command names, we can prefix them with `CODE_` public interface ThemeEditorCommand { + String CODE_OK = "ok"; + String CODE_...
codereview_new_java_data_9796
protected void setCssProperty(CascadingStyleSheet styleSheet, } else { // rule with given selector, property and value exists -> save // for undo - String existingValue = existingDeclaration - .getExpressionAsCSSString(); ...
codereview_new_java_data_9797
-package com.vaadin.base.devserver.themeeditor.messages; - -public class ComponentMetadataRequest extends BaseRequest { -} Seems a bit weird to keep this. The respective handler could maybe deserialize into a `BaseRequest`, or we add a generic `EmptyRequest`. No strong preferences for changing this though if you pref...
codereview_new_java_data_9798
-package com.vaadin.base.devserver.themeeditor.messages; - -public class LoadPreviewRequest extends BaseRequest { -} Same here, also an empty class.
codereview_new_java_data_9799
public class ThemeEditorHistory { private static class UiHistory extends LinkedHashMap<String, MessageHandler.ExecuteAndUndo> { - private static final int LIMIT = 30; @Override protected boolean removeEldestEntry( Since the history is only relevant during development, an...
codereview_new_java_data_9800
public interface HasAriaLabel extends HasElement { * the aria-label text to set or {@code null} to clear */ default void setAriaLabel(String ariaLabel) { - getElement().setAttribute(ElementConstants.ARIA_LABEL_PROPERTY_NAME, - ariaLabel); } /** The name of...
codereview_new_java_data_9801
* <p> * Vaadin gets the SystemMessages from the {@link SystemMessagesProvider} * configured in {@link VaadinService}. You can customize this by creating a - * {@link VaadinServiceInitListener} that sets an instance on * {@link SystemMessagesProvider} to * {@link VaadinService#setSystemMessagesProvider(System...
codereview_new_java_data_9803
* * @return The push servlet mapping to use */ - String getPushServletMapping(); /** * Gets the properties configured for the deployment, e.g. as init Could this just be a default returning `""`? Then it would only be overridden/implemented if necessary ```suggestion default...
codereview_new_java_data_9804
public PushMode getPushMode() { return PushMode.DISABLED; } - @Override - public String getPushServletMapping() { - return ""; - } - @Override public Properties getInitParameters() { return allProperties; not needed if going with default public PushMode getPushMode...
codereview_new_java_data_9805
public PushMode getPushMode() { return null; } - @Override - public String getPushServletMapping() { - return ""; - } - @Override public Properties getInitParameters() { return null; not needed if going with default public PushMo...
codereview_new_java_data_9806
public interface EndpointRequestUtil extends Serializable { boolean isAnonymousEndpoint(HttpServletRequest request); /** - * Shows whether the Hilla is used in the project. * - * @return true if Hilla is used, false otherwise */ static boolean isEndpointUsed() { try { ```...
codereview_new_java_data_9807
public interface EndpointRequestUtil extends Serializable { boolean isAnonymousEndpoint(HttpServletRequest request); /** - * Shows whether the Hilla is used in the project. * - * @return true if Hilla is used, false otherwise */ static boolean isEndpointUsed() { try { ```...
codereview_new_java_data_9808
public boolean isNavigationSupported() { * @return the currently active route instance if available */ public Optional<Component> getCurrentView() { - try { - return Optional.ofNullable((Component) getInternals() - .getActiveRouterTargetsChain().get(0)); - }...
codereview_new_java_data_9809
public class ViteWebsocketConnection implements Listener { private final Consumer<String> onMessage; - private WebSocket clientWebSocket; - private Runnable onClose; private Logger getLogger() { return LoggerFactory.getLogger(getClass()); nit: can be final public class ViteWebsocketCo...
codereview_new_java_data_9810
public static String getJarResourceString(String jarImport) { } /** - * Get the folder the front-end resources from JAR dependencies are copied - * into. * * @param frontendDirectory * project's frontend directory ```suggestion * Get the front-end resources folde...
codereview_new_java_data_9811
public NodeTasks(Options options) { commands.add(new TaskUpdateSettingsFile(options, themeName, pwa)); if (options.productionMode || options.isEnableDevServer() || options.isDevBundleBuild()) { - LoggerFactory.getLogger(NodeTasks.class) - .info("Running ...
codereview_new_java_data_9812
public void testAddOn() { } @Test - public void noFrontendFilesCreated() { File baseDir = new File(System.getProperty("user.dir", ".")); - // shouldn't create a dev-bundle Assert.assertTrue("New devBundle should be generated", new File(baseDir, "dev-bundle").e...
codereview_new_java_data_9813
protected Stream<String> getExcludedPatterns() { "com\\.vaadin\\.flow\\.router\\.RoutePathProvider", "com\\.vaadin\\.flow\\.router\\.RouteNotFoundError\\$LazyInit", "com\\.vaadin\\.flow\\.router\\.internal\\.RouteSegment\\$RouteSegmentValue", - "com\\.v...
codereview_new_java_data_9814
-package com.vaadin.devbundle; - -import com.vaadin.flow.component.dependency.JsModule; -import com.vaadin.flow.component.dependency.NpmPackage; - -@JsModule("@polymer/paper-input/paper-input.js") -@JsModule("@polymer/paper-checkbox/paper-checkbox.js") -@NpmPackage(value = "@polymer/paper-input", version = "3.0.2") -@...
codereview_new_java_data_9815
public static void updateBuildFile(PluginAdapterBuild adapter) { * @param adapter * used plugin adapter implementation */ - public static void removeBuildFile(PluginAdapterBuild adapter) { File tokenFile = getTokenFile(adapter); if (tokenFile.exists()) { - t...
codereview_new_java_data_9816
public Document getBootstrapPage(BootstrapContext context) { document.outputSettings().prettyPrint(false); - // In V14 legacy bootstrap mode, the theme is initialized in - // target/frontend/generated-flow-imports.js but not in normal - // bootstrap mode and for export...
codereview_new_java_data_9817
* * An instance of this class is available for injection as bean in view and * layout classes. The class is not {@link java.io.Serializable}, so potential - * referencing fields in Vaadin view should be defined {@literal transient}. * * @author Vaadin Ltd * @since 23.3 ```suggestion * referencing fields...
codereview_new_java_data_9818
public <U> Optional<U> getAuthenticatedUser(Class<U> userType) { } /** - * Gets an {@link Optional} containing of the authenticated principal name - * as defined in {@link Principal#getName()}, or empty if the user is not - * authenticated. * * The principal name usually refers to a...
codereview_new_java_data_9819
public <U> Optional<U> getAuthenticatedUser(Class<U> userType) { } /** - * Gets an {@link Optional} containing of the authenticated principal name - * as defined in {@link Principal#getName()}, or empty if the user is not - * authenticated. * * The principal name usually refers to a...
codereview_new_java_data_9820
import com.vaadin.flow.shared.ui.Transport; import com.vaadin.flow.uitest.servlet.ViewTestLayout; -/* - * Note that @Push is generally not supported in this location, but instead - * explicitly picked up by logic in the BasicPushUI constructor. - */ @CustomPush(transport = Transport.WEBSOCKET_XHR) @Route(value =...
codereview_new_java_data_9821
assert getServerId(valueMap) == -1 } else if (uiState != UIState.TERMINATED) { registry.getSystemErrorHandler() .handleSessionExpiredError(null); } } else if (meta.containsKey("appError") ...
codereview_new_java_data_9822
public void importFromJson(JsonObject json) { assert json != null; for (String key : json.keys()) { - // assert !constants.has(key); JsonValue value = json.get(key); assert value != null && value.getType() != JsonType.NULL; Would it be better to add something...
codereview_new_java_data_9823
protected final <T> void set(Class<T> type, T instance) { * <p> * Note that instances by default are considered final, and you are not * allowed to update an instance of any given type manually. Uses resettable - * supplier to allow Registry to recreate given instance during session - * resyn...
codereview_new_java_data_9824
public enum RequestType { UIDL(ApplicationConstants.REQUEST_TYPE_UIDL), /** - * Session resynchronization requests. */ - SESSION_RESYNC(ApplicationConstants.REQUEST_TYPE_SESSION_RESYNC), /** * Heartbeat requests. I wonder if we should use a name more r...
codereview_new_java_data_9825
* the browser. * <p> * NOTE: In the case of using JsModule with LitTemplate, the value needs to - * point to a real file as it will be copied to the stats.json. An exported - * alias from the package will not work. * * @return a JavaScript module identifier */ Can we reword...
codereview_new_java_data_9826
public AtmosphereFramework addInitParameter(String name, findFirstUrlMapping(servletRegistration.get()) + Constants.PUSH_MAPPING); } else { - getLogger().warn( "Unable to determine servlet registration for {}. " ...
codereview_new_java_data_9827
public Options withFeatureFlags(FeatureFlags featureFlags) { } protected FeatureFlags getFeatureFlags() { - if (featureFlags != null) { - return featureFlags; - } - - final FeatureFlags flags = new FeatureFlags(lookup); - if (javaResourceFolder != null) { - ...
codereview_new_java_data_9828
public void doInit(VaadinRequest request, int uiId) { * the initialization request * @param uiId * the id of the new ui * * @see #getUIId() */ missing javadoc for `appId` param public void doInit(VaadinRequest request, int uiId) { * the init...
codereview_new_java_data_9829
public void init() throws Exception { commandsField.setAccessible(true); commands = (List<FallibleCommand>) commandsField.get(nodeTasks); - // With Vite we always have two default tasks that cannot be reomve - // by configuring builder commands.clear(); Assert.asse...
codereview_new_java_data_9830
public final class Constants implements Serializable { * Internal servlet parameter for push url configuration. */ public static final String INTERNAL_SERVLET_PARAMETER_PUSH_URL = "internalPushURL"; /** * The static build resources folder. */ ```suggestion public static final St...
codereview_new_java_data_9831
private static String findFirstUrlMapping(ServletConfig config) { if (name != null) { ServletRegistration reg = config.getServletContext() .getServletRegistrations().get(name); - firstMapping = reg.getMappings().stream().findFirst().orElse("/"); } ...
codereview_new_java_data_9832
private NodeMap getConfigurationMap() { /** * Gets the fixed push URL. * - * @return the fixed push URL */ public String getPushUrl() { return Constants.PUSH_MAPPING; Let's reflect the fixed (constant) push url in the javadoc, so let's mention "/VAADIN/push" explicitly here. ...
codereview_new_java_data_9833
public AtmospherePushConnection(Registry registry) { String serviceUrl = registry.getApplicationConfiguration() .getServiceUrl(); if (!serviceUrl.equals(".")) { url = serviceUrl + url; } runWhenAtmosphereLoaded( Constants define ``` public static...
codereview_new_java_data_9834
.getResourceAsStream("version.properties")); } catch (Exception e) { LoggerFactory.getLogger(PolymerTemplate.class.getName()) - .error("Unable to read the version.properties file.", e); } LicenseChecker.checkLicenseFromStaticBlock("flow-...
codereview_new_java_data_9836
public void convertFile(Path filePath, boolean useLit1, command.add("-disable-optional-chaining"); } - ProcessBuilder builder = FrontendUtils.createProcessBuilder(command); - builder.inheritIO(); - Process process = builder.start(); if (process.waitFor() != 0) { ...
codereview_new_java_data_9837
public void commandToString_longCommand_resultIsWrapped() { List<String> command = Arrays.asList("./node/node", "./node_modules/webpack-dev-server/bin/webpack-dev-server.js", "--config", "./webpack.config.js", "--port 57799", -"--env watchDogPort=57798", "-d", "--inline=false...
codereview_new_java_data_9838
public void execute() throws MojoFailureException { } } catch (Exception e) { throw new MojoFailureException( - "Could not execute convert-polymer-to-lit goal.", e); } } } ```suggestion "Could not execute convert-polymer goal.",...
codereview_new_java_data_9839
import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import org.apache.maven.artifact.DependencyResolutionRequiredException; -import org.apache.maven.model.Build; -import o...
codereview_new_java_data_9840
package com.vaadin.flow.plugin.base; import java.io.File; ```suggestion /* * Copyright 2000-2022 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://ww...
codereview_new_java_data_9841
default boolean isPnpmEnabled() { * Returns whether server-side and offline license checking are enabled or * not. * <p> - * New license checker is only available in NPM mode with enabled live reload. * Once compatibility/bower mode is used or live reload is disabled, * the old licens...
codereview_new_java_data_9842
default boolean isPnpmEnabled() { * Returns whether server-side and offline license checking are enabled or * not. * <p> - * New license checker is only available in NPM mode with enabled live reload. * Once compatibility/bower mode is used or live reload is disabled, * the old licens...
codereview_new_java_data_9843
public boolean synchronizedHandleRequest(VaadinSession session, * development mode. */ public static void addLicenseChecker(Document indexDocument, DeploymentConfiguration config) { - if (config.isOldLicenseCheckerEnabled()) { - addScript(indexDocument, - "window.V...
codereview_new_java_data_9844
private void checkCompatibilityMode(boolean loggWarning) { * Log a warning if new license checker is enabled in compatibility mode * or while the live reload is off. */ - private void checkNewLicenseChecker(boolean loggWarning) { boolean enableNewLicenseChecker = !getBooleanProperty( ...
codereview_new_java_data_9845
public class InitParameters implements Serializable { * * @since 2.8 */ - public static final String SERVLET_PARAMETER_ENABLE_OLD_LICENSE_CHECKER = "enableOldLicenseChecker"; } ```suggestion public static final String SERVLET_PARAMETER_ENABLE_OLD_LICENSE_CHECKER = "oldLicenseChecker"; ``` ...
codereview_new_java_data_9846
public class TaskUpdateImports extends NodeUpdater { private final boolean disablePnpm; private final boolean productionMode; private final List<String> additionalFrontendModules; - private final boolean enableOldLicenseChecker; private class UpdateMainImportsFile extends AbstractUpdateImports...
codereview_new_java_data_9848
protected String filterServerResponseHeader( return prefix + headerValue; } } catch (MalformedURLException e) { - e.printStackTrace(); - return headerValue; } } Can `printStackTrace` be removed or replaced using l...
codereview_new_java_data_9849
private static String getStoredServerNavigation( if (session == null) { return null; } - return (String) session.getAttribute( ViewAccessChecker.SESSION_STORED_REDIRECT_ABSOLUTE); } static boolean isTypescriptLogin(HttpServletRequest request) { Does i...
codereview_new_java_data_9850
private Map<String, String> readDependencies(String id, return map; } catch (IOException e) { - log().error("Unable to read default dependencies", e); return new HashMap<>(); } Adding `id` value to the error message may simplify troubleshooting, in case of ex...
codereview_new_java_data_9851
private static String getExistingFileContent(File generatedFile) if (!generatedFile.exists()) { return null; } - return FileUtils.readFileToString(generatedFile, - StandardCharsets.UTF_8); } } nit: we can maybe use a static import for `UTF_8`, as we do in `wr...
codereview_new_java_data_9852
protected void setupCss(Element head, BootstrapContext context) { // visible and outside of normal flow setupErrorDialogs(styles); - styles = head.appendElement("style").attr("type", - CSS_TYPE_ATTRIBUTE_VALUE); setupHiddenElement(styles); ...
codereview_new_java_data_9853
import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; import java.util.Optional; @Service public class AccountService { - private static final Map<String, Account> ACCOUNT_CACHE = new HashMap<>(2); public AccountService(UserIn...
codereview_new_java_data_9854
public class UIAccessContextIT extends AbstractIT { @Test public void securityContextSetForUIAccess() throws Exception { - String expectedUserBalance = "Hello John the User, your bank account balance is $10000."; - String expectedAdminBalance = "Hello Emma the Admin, your bank account balance...
codereview_new_java_data_9855
public void loadProperties() { // Allow users to override a feature flag with a system property for (Feature f : features) { - var prop = System.getProperty("featureFlag-" + f.getId()); if (prop != null) { f.setEnabled(Boolean.parseBoolean(prop)); Should ...
codereview_new_java_data_9856
public void enabledFeatureFlagsMarkedInStatsWhenToggled() @Test public void featureFlagShouldBeOverridableWithSystemProperty() throws IOException { - System.setProperty("featureFlag-exampleFeatureFlag", "true"); createFeatureFlagsFile( "com.vaadin.experimental.ex...
codereview_new_java_data_9857
Map<String, String> getDefaultDevDependencies() { defaults.put("rollup-plugin-brotli", "3.1.0"); defaults.put("vite-plugin-checker", "0.4.9"); defaults.put("mkdirp", "1.0.4"); // for application-theme-plugin - defaults.put("rollup-plugin-workbox", "6.2.0"); ...
codereview_new_java_data_9858
public String getTranslation(String key, Locale locale, Object... params) { * @param params * parameters used in translation string * @return translation for key if found - * @deprecated Use {@link #getTranslation(Locale, String, Object...)} - * instead */ pu...
codereview_new_java_data_9859
/* - * Copyright 2000-2021 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of ```suggestion * Copyright 2000-2022 Vaadin Ltd. ``` /* + * Copyright 2000-2022 Vaadin Ltd. * * License...
codereview_new_java_data_9860
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { * Typically, subclasses should call super to apply default Vaadin * configuration in addition to custom rules. * - * @param http - * @throws Exception */ protected void configure(HttpSecurity http) throws ...