This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts-intellij-plugin.git


The following commit(s) were added to refs/heads/main by this push:
     new 0dfeb1b  fix: replace deprecated DynamicBundle(String) constructor 
(#155)
0dfeb1b is described below

commit 0dfeb1bc62d75ff380504259881a6835c997d3e5
Author: Lukasz Lenart <[email protected]>
AuthorDate: Mon Nov 16 13:29:02 2026 +0100

    fix: replace deprecated DynamicBundle(String) constructor (#155)
    
    Plugin Verifier for IntelliJ IDEA 2026.3 reports the String-only
    DynamicBundle constructor as deprecated. StrutsBundle now delegates to
    DynamicBundle(Class, String) instead of extending DynamicBundle.
    
    Co-authored-by: Cursor <[email protected]>
---
 CHANGELOG.md                                       |  1 +
 .../java/com/intellij/struts2/StrutsBundle.java    | 11 ++++----
 .../com/intellij/struts2/StrutsBundleTest.java     | 33 ++++++++++++++++++++++
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 88cc345..7a74d2a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@
 - Dependencies - JSP support now requires the JetBrains Marketplace 
`com.intellij.jsp` plugin (IntelliJ IDEA Ultimate subscription); users without 
Ultimate can no longer load the Struts plugin
 - Dependencies - FreeMarker and Velocity are now Marketplace plugins pinned to 
`263.7307.112` and `263.7307.101`
 - Migrate the OGNL color settings page to the declarative 
`com.intellij.colorSettings` extension 
([#151](https://github.com/apache/struts-intellij-plugin/issues/151))
+- Replace the deprecated `DynamicBundle(String)` constructor with 
`DynamicBundle(Class, String)` delegation
 
 ## [262.19039.1] - 2026-08-01
 
diff --git a/src/main/java/com/intellij/struts2/StrutsBundle.java 
b/src/main/java/com/intellij/struts2/StrutsBundle.java
index 068c92a..c223c60 100644
--- a/src/main/java/com/intellij/struts2/StrutsBundle.java
+++ b/src/main/java/com/intellij/struts2/StrutsBundle.java
@@ -16,6 +16,7 @@ package com.intellij.struts2;
 
 import com.intellij.DynamicBundle;
 import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.PropertyKey;
 
@@ -26,21 +27,21 @@ import java.util.function.Supplier;
  *
  * @author Yann C&eacute;bron
  */
-public final class StrutsBundle extends DynamicBundle {
+public final class StrutsBundle {
 
   public static @Nls String message(@NotNull @PropertyKey(resourceBundle = 
PATH_TO_BUNDLE) String key, Object @NotNull ... params) {
     return ourInstance.getMessage(key, params);
   }
 
   @NotNull
-  public static Supplier<String> messagePointer(@NotNull 
@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object @NotNull ... 
params) {
+  public static Supplier<@Nls String> messagePointer(@NotNull 
@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object @NotNull ... 
params) {
     return ourInstance.getLazyMessage(key, params);
   }
 
+  @NonNls
   private static final String PATH_TO_BUNDLE = "messages.Struts2Bundle";
-  private static final StrutsBundle ourInstance = new StrutsBundle();
+  private static final DynamicBundle ourInstance = new 
DynamicBundle(StrutsBundle.class, PATH_TO_BUNDLE);
 
   private StrutsBundle() {
-    super(PATH_TO_BUNDLE);
   }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/com/intellij/struts2/StrutsBundleTest.java 
b/src/test/java/com/intellij/struts2/StrutsBundleTest.java
new file mode 100644
index 0000000..7b42238
--- /dev/null
+++ b/src/test/java/com/intellij/struts2/StrutsBundleTest.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2026 The authors
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.struts2;
+
+import junit.framework.TestCase;
+
+public class StrutsBundleTest extends TestCase {
+
+  public void testMessageLoadsFromPluginBundle() {
+    assertEquals("Struts 2", StrutsBundle.message("struts2"));
+  }
+
+  public void testMessageFormatsParameters() {
+    assertEquals("Add struts.xml to file set",
+                 StrutsBundle.message("annotators.fileset.fix.add.to.fileset", 
"struts.xml"));
+  }
+
+  public void testMessagePointerResolvesTheSameText() {
+    assertEquals("Struts 2", StrutsBundle.messagePointer("struts2").get());
+  }
+}

Reply via email to