From 89612a0993a3854d04db640546a72513f055c825 Mon Sep 17 00:00:00 2001 From: Mikhail Shabarov Date: Mon, 23 Dec 2024 14:29:47 +0200 Subject: [PATCH 1/5] chore: Remove unused declarations in flow-server and flow-data --- .../client/flow/GwtEventHandlerTest.java | 6 ---- .../main/java/com/vaadin/flow/dom/Node.java | 36 ------------------- .../flow/internal/menu/MenuRegistry.java | 3 -- .../nodefeature/ElementPropertyMap.java | 23 ++++++------ .../router/AbstractRouteNotFoundError.java | 4 +-- .../vaadin/flow/server/AppShellRegistry.java | 9 ++--- .../DeploymentConfigurationFactory.java | 5 ++- .../IndexHtmlRequestHandler.java | 2 +- .../server/communication/PushHandler.java | 3 +- .../communication/rpc/MapSyncRpcHandler.java | 9 ++--- .../dau/DAUVaadinRequestInterceptor.java | 2 -- .../flow/server/frontend/NodeUpdater.java | 5 +-- .../frontend/TaskCopyTemplateFiles.java | 4 --- .../server/frontend/TaskGeneratePWAIcons.java | 7 ---- .../server/frontend/TaskGenerateTsConfig.java | 2 +- .../frontend/TaskRunDevBundleBuild.java | 8 ++--- .../server/frontend/VersionsJsonFilter.java | 2 -- .../scanner/FullDependenciesScanner.java | 13 ------- .../flow/server/startup/ServletDeployer.java | 2 -- .../webcomponent/WebComponentGenerator.java | 1 - .../vaadin/flow/internal/JsonUtilsTest.java | 31 ---------------- 21 files changed, 26 insertions(+), 151 deletions(-) diff --git a/flow-client/src/test-gwt/java/com/vaadin/client/flow/GwtEventHandlerTest.java b/flow-client/src/test-gwt/java/com/vaadin/client/flow/GwtEventHandlerTest.java index 562bc6b5428..86f9ec59179 100644 --- a/flow-client/src/test-gwt/java/com/vaadin/client/flow/GwtEventHandlerTest.java +++ b/flow-client/src/test-gwt/java/com/vaadin/client/flow/GwtEventHandlerTest.java @@ -254,12 +254,6 @@ private void assertPublishedMethods(Element element, String[] expected) { expected); } - private void assertPolymerMethods(Element element, String[] expected) { - ServerEventObject object = WidgetUtil.crazyJsoCast(element); - assertEventHandlerMethods(() -> getPublishedServerMethods(object), - expected); - } - private void assertEventHandlerMethods( Supplier> methodsProvider, String... expected) { JsArray publishedServerMethods = methodsProvider.get(); diff --git a/flow-server/src/main/java/com/vaadin/flow/dom/Node.java b/flow-server/src/main/java/com/vaadin/flow/dom/Node.java index 89716639b4f..8d43d0ebbcb 100644 --- a/flow-server/src/main/java/com/vaadin/flow/dom/Node.java +++ b/flow-server/src/main/java/com/vaadin/flow/dom/Node.java @@ -596,40 +596,4 @@ protected void ensureChildHasParent(Element child, boolean internalCheck) { } } } - - /** - * Attaches a child element with the given {@code tagName} which is the next - * sibling for the {@code previousSibling}. - *

- * The {@code previousSibling} parameter value can be {@code null} which - * means that the very first child with the given {@code tagName} will be - * used to attach (if any). - *

- * This method may be used to get a server side element for the client side - * DOM element which has been created on the client side aside of the - * server. - *

- * The element is not returned right away since it may not exist at all on - * the client side and its index in the children list is unknown. The - * provided {@code callback} is used instead to provide the mapped - * server-side element in case it has been found or report an error if it - * doesn't exist. - *

- * This API is experimental and disabled for public usage. - * - * @param tagName - * the tag name of the element to attach, not {@code null} - * @param previousSibling - * previous sibling, may be {@code null} - * @param callback - * the callback which will be invoked with a server side element - * instance or an error will be reported, not {@code null} - * @return this element - */ - private N attachExistingElement(String tagName, Element previousSibling, - ChildElementConsumer callback) { - getStateProvider().attachExistingElement(getNode(), tagName, - previousSibling, callback); - return getSelf(); - } } diff --git a/flow-server/src/main/java/com/vaadin/flow/internal/menu/MenuRegistry.java b/flow-server/src/main/java/com/vaadin/flow/internal/menu/MenuRegistry.java index 64c29b0f18f..481870df3ad 100644 --- a/flow-server/src/main/java/com/vaadin/flow/internal/menu/MenuRegistry.java +++ b/flow-server/src/main/java/com/vaadin/flow/internal/menu/MenuRegistry.java @@ -70,9 +70,6 @@ */ public class MenuRegistry { - private static final Logger log = LoggerFactory - .getLogger(MenuRegistry.class); - /** * File routes lazy loading and caching. */ diff --git a/flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java b/flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java index 9134c611280..e272798a2ba 100644 --- a/flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java +++ b/flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java @@ -200,7 +200,7 @@ protected Serializable remove(String key) { @Override protected boolean mayUpdateFromClient(String key, Serializable value) { - return allowUpdateFromClient(key, value); + return allowUpdateFromClient(key); } @Override @@ -212,7 +212,7 @@ protected boolean producePutChange(String key, boolean hadValueEarlier, return super.producePutChange(key, hadValueEarlier, newValue); } - private boolean allowUpdateFromClient(String key, Serializable value) { + private boolean allowUpdateFromClient(String key) { AllowUpdate isAllowed = isUpdateFromClientAllowedBeforeFilter(key); if (!AllowUpdate.NO_EXPLICIT_STATUS.equals(isAllowed)) { return AllowUpdate.EXPLICITLY_ALLOW.equals(isAllowed); @@ -476,19 +476,18 @@ private static Logger getLogger() { /** * The method first checks whether the update from client is allowed using - * the method {@link #allowUpdateFromClient(String, Serializable)}. Then if - * it's not allowed then it either throws or returns NO OPERATION runnable - * in case if {@link #updateFromClientFilter} disallows the update (in this - * case it's just an application business logic and we should not throw). + * the method {@link #allowUpdateFromClient(String)}. Then if it's not + * allowed then it either throws or returns NO OPERATION runnable in case if + * {@link #updateFromClientFilter} disallows the update (in this case it's + * just an application business logic and we should not throw). * - * The logic inside the {@link #allowUpdateFromClient(String, Serializable)} - * check block repeats its own logic to make sure that: + * The logic inside the {@link #allowUpdateFromClient(String)} check block + * repeats its own logic to make sure that: *

    - *
  • It's in sync with - * {@link #allowUpdateFromClient(String, Serializable)} (and + *
  • It's in sync with {@link #allowUpdateFromClient(String)} (and * {@link #mayUpdateFromClient(String, Serializable)} *
  • The update is disallowed by the filter (and not some other checks - * that are inside {@link #allowUpdateFromClient(String, Serializable)} + * that are inside {@link #allowUpdateFromClient(String)} *
      * * Here is the logic flow: @@ -555,7 +554,7 @@ private Runnable doDeferredUpdateFromClient(String key, Serializable value) // Use private allowUpdateFromClient method instead of // mayUpdateFromClient which may be overridden // The logic below - if (!allowUpdateFromClient(key, value)) { + if (!allowUpdateFromClient(key)) { if (isDisallowedByFilter(key)) { return () -> { // nop diff --git a/flow-server/src/main/java/com/vaadin/flow/router/AbstractRouteNotFoundError.java b/flow-server/src/main/java/com/vaadin/flow/router/AbstractRouteNotFoundError.java index 76e772f98d0..f2ea253d07b 100644 --- a/flow-server/src/main/java/com/vaadin/flow/router/AbstractRouteNotFoundError.java +++ b/flow-server/src/main/java/com/vaadin/flow/router/AbstractRouteNotFoundError.java @@ -131,12 +131,12 @@ private String getRoutes(BeforeEnterEvent event) { routeTemplates.forEach( (k, v) -> routeElements.add(routeTemplateToHtml(k, v))); - routeElements.addAll(getClientRoutes(event)); + routeElements.addAll(getClientRoutes()); return routeElements.stream().map(Element::outerHtml) .collect(Collectors.joining()); } - private List getClientRoutes(BeforeEnterEvent event) { + private List getClientRoutes() { return FrontendUtils.getClientRoutes().stream() .filter(route -> !route.contains("$layout")) .map(route -> route.replace("$index", "")) diff --git a/flow-server/src/main/java/com/vaadin/flow/server/AppShellRegistry.java b/flow-server/src/main/java/com/vaadin/flow/server/AppShellRegistry.java index e72876864f4..bde81ddd6d4 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/AppShellRegistry.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/AppShellRegistry.java @@ -36,7 +36,6 @@ import com.vaadin.flow.component.page.Push; import com.vaadin.flow.component.page.TargetElement; import com.vaadin.flow.component.page.Viewport; -import com.vaadin.flow.di.Lookup; import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.theme.Theme; @@ -72,8 +71,6 @@ public class AppShellRegistry implements Serializable { private Class appShellClass; - private final Lookup lookup; - /** * A wrapper class for storing the {@link AppShellRegistry} instance in the * servlet context. @@ -92,8 +89,7 @@ public AppShellRegistryWrapper(AppShellRegistry registry) { } } - private AppShellRegistry(VaadinContext context) { - this.lookup = context.getAttribute(Lookup.class); + private AppShellRegistry() { } /** @@ -109,8 +105,7 @@ public static AppShellRegistry getInstance(VaadinContext context) { AppShellRegistryWrapper attribute = context .getAttribute(AppShellRegistryWrapper.class); if (attribute == null) { - attribute = new AppShellRegistryWrapper( - new AppShellRegistry(context)); + attribute = new AppShellRegistryWrapper(new AppShellRegistry()); context.setAttribute(attribute); } return attribute.registry; diff --git a/flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java b/flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java index 6e2a69194ef..128b6963fea 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java @@ -105,12 +105,11 @@ protected Properties createInitParameters(Class systemPropertyBaseClass, } } - readBuildInfo(initParameters, vaadinConfig.getVaadinContext()); + readBuildInfo(initParameters); return initParameters; } - private void readBuildInfo(Properties initParameters, - VaadinContext context) { + private void readBuildInfo(Properties initParameters) { String json = getTokenFileContent(initParameters::getProperty); // Read the json and set the appropriate system properties if not // already set. diff --git a/flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java b/flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java index 36e3bfe1127..1d22fedf738 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java @@ -226,7 +226,7 @@ private static void addDevBundleTheme(Document document, } private void applyThemeVariant(Document indexDocument, - VaadinContext context) throws IOException { + VaadinContext context) { ThemeUtils.getThemeAnnotation(context).ifPresent(theme -> { String variant = theme.variant(); if (!variant.isEmpty()) { diff --git a/flow-server/src/main/java/com/vaadin/flow/server/communication/PushHandler.java b/flow-server/src/main/java/com/vaadin/flow/server/communication/PushHandler.java index 06b0965b91f..e7ebe18d306 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/communication/PushHandler.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/communication/PushHandler.java @@ -545,8 +545,7 @@ private static UI findUiUsingResource(AtmosphereResource resource, * The atmosphere resource to send refresh to * */ - private static void sendRefreshAndDisconnect(AtmosphereResource resource) - throws IOException { + private static void sendRefreshAndDisconnect(AtmosphereResource resource) { sendNotificationAndDisconnect(resource, VaadinService .createCriticalNotificationJSON(null, null, null, null)); } diff --git a/flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/MapSyncRpcHandler.java b/flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/MapSyncRpcHandler.java index eb41a716f02..9254039bf3b 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/MapSyncRpcHandler.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/MapSyncRpcHandler.java @@ -93,15 +93,13 @@ protected Optional handleNode(StateNode node, .reduce(DisabledUpdateMode::mostPermissive).orElse(null); if (isEnabled) { - return enqueuePropertyUpdate(node, invocationJson, feature, - property); + return enqueuePropertyUpdate(node, invocationJson, property); } else if (DisabledUpdateMode.ALWAYS.equals(updateMode)) { LoggerFactory.getLogger(MapSyncRpcHandler.class).trace( "Property update request for disabled element is received from the client side. " + "Change will be applied since the property '{}' always allows its update.", property); - return enqueuePropertyUpdate(node, invocationJson, feature, - property); + return enqueuePropertyUpdate(node, invocationJson, property); } else { final Logger logger = LoggerFactory .getLogger(MapSyncRpcHandler.class); @@ -124,8 +122,7 @@ protected Optional handleNode(StateNode node, } private Optional enqueuePropertyUpdate(StateNode node, - JsonObject invocationJson, Class feature, - String property) { + JsonObject invocationJson, String property) { Serializable value = JsonCodec.decodeWithoutTypeInfo( invocationJson.get(JsonConstants.RPC_PROPERTY_VALUE)); diff --git a/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUVaadinRequestInterceptor.java b/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUVaadinRequestInterceptor.java index 946defddee2..3c08eed80ce 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUVaadinRequestInterceptor.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUVaadinRequestInterceptor.java @@ -25,7 +25,6 @@ public class DAUVaadinRequestInterceptor implements VaadinRequestInterceptor, private final String applicationName; private final UserIdentitySupplier userIdentitySupplier; - private final DAUCustomizer dauCustomizer; public DAUVaadinRequestInterceptor( DeploymentConfiguration deploymentConfiguration, @@ -34,7 +33,6 @@ public DAUVaadinRequestInterceptor( this.userIdentitySupplier = dauCustomizer != null ? dauCustomizer.getUserIdentitySupplier() : null; - this.dauCustomizer = dauCustomizer; } @Override diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java index 21f6f0fa1f6..67d8763f1e9 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java @@ -583,11 +583,8 @@ protected void generateVersionsJson(JsonObject packageJson) * defined packages. * * @return versions Json based on package.json - * @throws IOException - * If reading package.json fails */ - private JsonObject generateVersionsFromPackageJson(JsonObject packageJson) - throws IOException { + private JsonObject generateVersionsFromPackageJson(JsonObject packageJson) { JsonObject versionsJson = Json.createObject(); // if we don't have versionsJson lock package dependency versions. final JsonObject dependencies = packageJson.getObject(DEPENDENCIES); diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskCopyTemplateFiles.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskCopyTemplateFiles.java index 93a41c70b66..3be0e1b456e 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskCopyTemplateFiles.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskCopyTemplateFiles.java @@ -107,8 +107,4 @@ private String getJsModuleAnnotationValue(Annotation jsmAnnotation) throw new ExecutionFailedException(e); } } - - Logger log() { - return LoggerFactory.getLogger(getClass()); - } } diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGeneratePWAIcons.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGeneratePWAIcons.java index 52a0cbbead2..60e2af8cdb9 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGeneratePWAIcons.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGeneratePWAIcons.java @@ -182,13 +182,6 @@ private CompletableFuture generateIcon(InternalPwaIcon icon) { }); } - private BufferedImage getBaseImage(URL logo) throws IOException { - URLConnection logoResource = logo != null ? logo.openConnection() - : BootstrapHandler.class.getResource("default-logo.png") - .openConnection(); - return ImageIO.read(logoResource.getInputStream()); - } - private static class InternalPwaIcon extends PwaIcon { private final BufferedImage baseImage; diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateTsConfig.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateTsConfig.java index 256468962fe..d8b5eae9aa1 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateTsConfig.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskGenerateTsConfig.java @@ -174,7 +174,7 @@ protected boolean shouldGenerate() { return !getGeneratedFile().exists(); } - private void overrideIfObsolete() throws ExecutionFailedException { + private void overrideIfObsolete() { try { // Project's TS config File projectTsConfigFile = new File( diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunDevBundleBuild.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunDevBundleBuild.java index b260781858e..9be2a712008 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunDevBundleBuild.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunDevBundleBuild.java @@ -22,9 +22,7 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; import org.apache.commons.io.FileUtils; @@ -98,8 +96,7 @@ public void execute() throws ExecutionFailedException { getLogger().info( "Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified"); - runFrontendBuildTool("Vite", "vite/bin/vite.js", Collections.emptyMap(), - "build"); + runFrontendBuildTool("Vite", "vite/bin/vite.js", "build"); copyPackageLockToBundleFolder(); @@ -111,8 +108,7 @@ private static Logger getLogger() { } private void runFrontendBuildTool(String toolName, String executable, - Map environment, String... params) - throws ExecutionFailedException { + String... params) throws ExecutionFailedException { Logger logger = getLogger(); FrontendToolsSettings settings = new FrontendToolsSettings( diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/VersionsJsonFilter.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/VersionsJsonFilter.java index 3e603f3a52d..4f9914b04e9 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/VersionsJsonFilter.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/VersionsJsonFilter.java @@ -33,7 +33,6 @@ class VersionsJsonFilter { private final JsonObject userManagedDependencies; - private final JsonObject vaadinVersions; private final String dependenciesKey; @@ -42,7 +41,6 @@ class VersionsJsonFilter { VersionsJsonFilter(JsonObject packageJson, String dependenciesKey) { this.dependenciesKey = dependenciesKey; userManagedDependencies = collectUserManagedDependencies(packageJson); - vaadinVersions = collectFrameworkVersions(packageJson); } /** diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/scanner/FullDependenciesScanner.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/scanner/FullDependenciesScanner.java index 3f154b00fdd..420f64690a2 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/scanner/FullDependenciesScanner.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/scanner/FullDependenciesScanner.java @@ -81,19 +81,6 @@ class FullDependenciesScanner extends AbstractDependenciesScanner { private final SerializableBiFunction, Class, List> annotationFinder; - /** - * Creates a new scanner instance which discovers all dependencies in the - * classpath. - * - * @param finder - * a class finder - * @param featureFlags - * available feature flags and their status - */ - FullDependenciesScanner(ClassFinder finder, FeatureFlags featureFlags) { - this(finder, AnnotationReader::getAnnotationsFor, featureFlags, true); - } - /** * Creates a new scanner instance which discovers all dependencies in the * classpath. diff --git a/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java b/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java index ea03327d8c8..238f3010ae2 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java @@ -180,8 +180,6 @@ private void logServletCreation(VaadinServletCreation servletCreation, logger.warn(servletCreationMessage); } else { logger.info(servletCreationMessage); - ServletRegistration vaadinServlet = findVaadinServlet( - servletContext); } } diff --git a/flow-server/src/main/java/com/vaadin/flow/server/webcomponent/WebComponentGenerator.java b/flow-server/src/main/java/com/vaadin/flow/server/webcomponent/WebComponentGenerator.java index 0915a6f181e..dbf3b22beef 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/webcomponent/WebComponentGenerator.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/webcomponent/WebComponentGenerator.java @@ -50,7 +50,6 @@ public class WebComponentGenerator { private static final String TOKEN_ATTRIBUTE_NAME = "_AttributeName_"; private static final String TOKEN_CHANGE_EVENT_NAME = "_ChangeEventName_"; private static final String TOKEN_PROPERTY_NAME = "_PropertyName_"; - private static final String HTML_TEMPLATE = "webcomponent-template.html"; private static final String JS_TEMPLATE = "webcomponent-template.js"; private static final String SCRIPT_TEMPLATE = "webcomponent-script-template.js"; private static final String CODE_PROPERTY_DEFAULT = "webcomponent-property-default.js"; diff --git a/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java b/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java index 931fb873e7d..745ffb18aaa 100644 --- a/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java @@ -136,18 +136,6 @@ public void collectEmptyStream() { Assert.assertEquals(0, a.length()); } - public void createObjectStreamForNull() { - Assert.assertEquals(Stream.empty(), JsonUtils.objectStream(null)); - } - - public void createNumberStreamForNull() { - Assert.assertEquals(Stream.empty(), JsonUtils.numberStream(null)); - } - - public void createStreamForNull() { - Assert.assertEquals(Stream.empty(), JsonUtils.stream(null)); - } - @Test public void testStream() { JsonArray array = createTestArray1(); @@ -281,11 +269,7 @@ public ChildBean getChild() { } public static class ChildBean { - private String childValue = "child"; - public String getChildValue() { - return childValue; - } } public static class BeanWithTemporalFields { @@ -331,21 +315,6 @@ public static class ListAndMapBean { childBeanList.add(secondChild); } - public Map getIntegerMap() { - return integerMap; - } - - public List getChildBeanList() { - return childBeanList; - } - - public List getIntegerList() { - return integerList; - } - - public Map getChildBeanMap() { - return childBeanMap; - } } @Test From b260c873b9a83691aab202fcb8db6799f45b1825 Mon Sep 17 00:00:00 2001 From: Mikhail Shabarov Date: Mon, 23 Dec 2024 14:39:35 +0200 Subject: [PATCH 2/5] bring back childValue --- .../src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java b/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java index 745ffb18aaa..8c4895fd579 100644 --- a/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java @@ -269,7 +269,7 @@ public ChildBean getChild() { } public static class ChildBean { - + private String childValue = "child"; } public static class BeanWithTemporalFields { From 79449fc3c9f7a46fbd8ae5409e3da3db4e97fc04 Mon Sep 17 00:00:00 2001 From: Mikhail Shabarov Date: Mon, 23 Dec 2024 15:03:56 +0200 Subject: [PATCH 3/5] bring back getters --- .../vaadin/flow/internal/JsonUtilsTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java b/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java index 8c4895fd579..9d83a0a89ba 100644 --- a/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/internal/JsonUtilsTest.java @@ -270,6 +270,10 @@ public ChildBean getChild() { public static class ChildBean { private String childValue = "child"; + + public String getChildValue() { + return childValue; + } } public static class BeanWithTemporalFields { @@ -315,6 +319,22 @@ public static class ListAndMapBean { childBeanList.add(secondChild); } + // these getters are needed for bean serialization: + public Map getIntegerMap() { + return integerMap; + } + + public List getChildBeanList() { + return childBeanList; + } + + public List getIntegerList() { + return integerList; + } + + public Map getChildBeanMap() { + return childBeanMap; + } } @Test From fea7787c9e51ac06bc76917ba2a95968b91430d2 Mon Sep 17 00:00:00 2001 From: Mikhail Shabarov Date: Mon, 23 Dec 2024 15:27:15 +0200 Subject: [PATCH 4/5] delete attachExistingElement ref --- .../src/main/java/com/vaadin/flow/dom/ChildElementConsumer.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/dom/ChildElementConsumer.java b/flow-server/src/main/java/com/vaadin/flow/dom/ChildElementConsumer.java index 23ce831b283..b5496df8054 100644 --- a/flow-server/src/main/java/com/vaadin/flow/dom/ChildElementConsumer.java +++ b/flow-server/src/main/java/com/vaadin/flow/dom/ChildElementConsumer.java @@ -22,8 +22,6 @@ * Callback which allows to handle request to map a client side DOM element to * the server {@link Element} instance. * - * @see Node#attachExistingElement(String, Element, ChildElementConsumer) - * * @author Vaadin Ltd * @since 1.0 * From 75ee8d3d76d0204794f65a8976cfabec99b43e26 Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Fri, 27 Dec 2024 10:07:33 +0100 Subject: [PATCH 5/5] remove unused method parameter --- .../java/com/vaadin/flow/server/startup/ServletDeployer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java b/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java index 238f3010ae2..2dc6ba8f4d6 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/startup/ServletDeployer.java @@ -39,7 +39,6 @@ import com.vaadin.flow.server.VaadinServlet; import com.vaadin.flow.server.VaadinServletConfig; import com.vaadin.flow.server.VaadinServletContext; -import com.vaadin.flow.server.frontend.FrontendUtils; /** * Context listener that automatically registers Vaadin servlets. @@ -161,11 +160,11 @@ public void contextInitialized(ServletContextEvent sce) { ? createAppServlet(context) : null; - logServletCreation(servletCreation, context, productionMode); + logServletCreation(servletCreation, productionMode); } private void logServletCreation(VaadinServletCreation servletCreation, - ServletContext servletContext, boolean productionMode) { + boolean productionMode) { Logger logger = getLogger(); if (servletCreation == null || productionMode) {