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

solomax pushed a commit to branch OPENJPA-2940-mysql9
in repository https://gitbox.apache.org/repos/asf/openjpa.git


The following commit(s) were added to refs/heads/OPENJPA-2940-mysql9 by this 
push:
     new 22dd88a43 Tests are fixed; Some maven warnings are addressed
22dd88a43 is described below

commit 22dd88a434a0972f1a48a836d82c9797dfb8093a
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Sun Jun 7 16:02:27 2026 +0700

    Tests are fixed; Some maven warnings are addressed
---
 .../org/apache/openjpa/jdbc/sql/DBDictionary.java  | 31 +++++++++++++---------
 .../openjpa/lib/identifier/IdentifierRule.java     |  7 ++---
 .../apache/openjpa/jdbc/sql/TestSnakeCaseDDL.java  |  9 ++++---
 .../persistence/jdbc/TestFKColumnNames.java        |  2 +-
 openjpa-project/checkstyle.xml                     |  5 ++--
 openjpa-project/suppressions.xml                   |  5 ++--
 .../openjpa-maven-plugin/src/site/site.xml         |  6 +++--
 src/site/site.xml                                  | 14 +++++-----
 8 files changed, 44 insertions(+), 35 deletions(-)

diff --git 
a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java 
b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
index 90fb451e2..f185ee493 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
@@ -321,7 +321,7 @@ public class DBDictionary
     public int maxEmbeddedBlobSize = -1;
     public int maxEmbeddedClobSize = -1;
     public int inClauseLimit = -1;
-    
+
     /**
      * Attention, while this is named datePrecision it actually only get used 
for Timestamp handling!
      * @see StateManagerImpl#roundTimestamp(Timestamp, int)
@@ -502,10 +502,10 @@ public class DBDictionary
     private String conversionKey = null;
 
     public boolean supportsUuidType = false;
-    
+
     public boolean supportsUnsizedCharOnCast = true;
-    
-    public String integerCastTypeName = integerTypeName; 
+
+    public String integerCastTypeName = integerTypeName;
 
     // Naming utility and naming rules
     private DBIdentifierUtil namingUtil = null;
@@ -638,6 +638,10 @@ public class DBDictionary
 
         DBIdentifierRule columnNamingRule = new 
ColumnIdentifierRule(invalidColumnWordSet);
         namingRules.put(columnNamingRule.getName(), columnNamingRule);
+        // restoring default "empty" cfg
+        IdentifierRule rule = 
Normalizer.getNamingConfiguration().getDefaultIdentifierRule();
+        rule.setDelimitReservedWords(false);
+        rule.setReservedWords(Set.of());
     }
 
     //////////////////////
@@ -2063,7 +2067,7 @@ public class DBDictionary
             return appendSize(col, autoAssignTypeName);
 
         if (col.getJavaType() == JavaTypes.UUID_OBJ) {
-            if (supportsUuidType) 
+            if (supportsUuidType)
                 return appendSize(col, uuidTypeName);
             else {
                 return appendSize(col, getTypeName(Types.VARCHAR));
@@ -3270,7 +3274,7 @@ public class DBDictionary
         }
         buf.append(")");
     }
-    
+
     public void replace(SQLBuffer buf, FilterValue from, FilterValue subs, 
FilterValue replacement) {
        buf.append(replaceFunctionName).append("(");
        from.appendTo(buf);
@@ -3280,7 +3284,7 @@ public class DBDictionary
        replacement.appendTo(buf);
        buf.append(")");
     }
-    
+
     public void left(SQLBuffer buf, FilterValue str, FilterValue length) {
        buf.append(leftFunctionName).append("(");
        str.appendTo(buf);
@@ -5298,7 +5302,9 @@ public class DBDictionary
             
selectWordSet.addAll(Arrays.asList(StringUtil.split(selectWords.toUpperCase(Locale.ENGLISH),
 ",", 0)));
 
         if (invalidColumnWordSet.isEmpty()) {
-            
invalidColumnWordSet.addAll(loadFromResource("sql-invalid-column-names.rsrc"));
+            Collection<String> invalidColumns = 
loadFromResource("sql-invalid-column-names.rsrc");
+            invalidColumnWordSet.addAll(invalidColumns);
+            
namingRules.get(DBIdentifierType.COLUMN.name()).setReservedWords(invalidColumns);
         }
 
         // initialize the error codes
@@ -5578,11 +5584,10 @@ public class DBDictionary
     }
 
     /**
-         * Used by some mappings to represent data that has already been
-         * serialized so that we don't have to serialize multiple times.
-         */
-        public record SerializedData(byte[] bytes) {
-
+     * Used by some mappings to represent data that has already been
+     * serialized so that we don't have to serialize multiple times.
+     */
+    public record SerializedData(byte[] bytes) {
     }
 
     /**
diff --git 
a/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java
 
b/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java
index a1dde236b..1d28c6058 100644
--- 
a/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java
+++ 
b/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java
@@ -18,6 +18,7 @@
  */
 package org.apache.openjpa.lib.identifier;
 
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Locale;
 import java.util.Set;
@@ -124,9 +125,9 @@ public class IdentifierRule {
         return _onlyLettersDigitsUnderscores;
     }
 
-    public void setReservedWords(Set<String> reservedWords) {
+    public void setReservedWords(Collection<String> reservedWords) {
         _reservedWords = reservedWords.stream()
-                .map(w -> w.toUpperCase(Locale.ROOT))
+                .map(w -> w.toUpperCase(Locale.ENGLISH))
                 .collect(Collectors.toSet());
     }
 
@@ -206,6 +207,6 @@ public class IdentifierRule {
     }
 
     public boolean isReservedWord(String identifier) {
-        return _reservedWords.contains(identifier.toUpperCase(Locale.ROOT));
+        return _reservedWords.contains(identifier.toUpperCase(Locale.ENGLISH));
     }
 }
diff --git 
a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestSnakeCaseDDL.java
 
b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestSnakeCaseDDL.java
index 76c7ab63c..f6ae11868 100644
--- 
a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestSnakeCaseDDL.java
+++ 
b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestSnakeCaseDDL.java
@@ -48,7 +48,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 public class TestSnakeCaseDDL {
-       
+
        private static final Logger logger = 
Logger.getLogger(TestSnakeCaseDDL.class.getCanonicalName());
 
     @Test
@@ -82,8 +82,9 @@ public class TestSnakeCaseDDL {
                     .getTables(null, null, "%", null)) {
                 while (tables.next()) {
                     final String table = tables.getString(3);
-                    if (table.toUpperCase(Locale.ROOT).startsWith("SNAKE")) {
-                        createdTables.put(table.toUpperCase(Locale.ROOT), 
table);
+                    final String upper = table.toUpperCase(Locale.ENGLISH);
+                    if (upper.startsWith("SNAKE")) {
+                        createdTables.put(upper, table);
                     }
                 }
             }
@@ -132,7 +133,7 @@ public class TestSnakeCaseDDL {
                     em.close();
                 }
             }
-            final String tableName = 
createdTables.get("SnakeCaseDDLMy1Entity".toUpperCase(Locale.ROOT));
+            final String tableName = 
createdTables.get("SnakeCaseDDLMy1Entity".toUpperCase(Locale.ENGLISH));
             try (final Connection connection = ds.getConnection();
                  final Statement statement = connection.createStatement();
                  final ResultSet rs = statement.executeQuery("select foo_bar, 
this_field from \"" + tableName + "\"")) {
diff --git 
a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java
 
b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java
index 492ffee3a..b76318e63 100644
--- 
a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java
+++ 
b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/TestFKColumnNames.java
@@ -38,7 +38,7 @@ public class TestFKColumnNames extends 
AbstractPersistenceTestCase {
         return col.getIdentifier().getName()
                 .replace(cfg.getLeadingDelimiter(), "")
                 .replace(cfg.getTrailingDelimiter(), "")
-                .toUpperCase(Locale.ROOT);
+                .toUpperCase(Locale.ENGLISH);
     }
 
     /**
diff --git a/openjpa-project/checkstyle.xml b/openjpa-project/checkstyle.xml
index d59aa1741..52c58c106 100644
--- a/openjpa-project/checkstyle.xml
+++ b/openjpa-project/checkstyle.xml
@@ -10,9 +10,8 @@
     OF ANY KIND, either express or implied. See the License for the specific
     language governing permissions and limitations under the License. -->
 <!DOCTYPE module PUBLIC
-        "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
-        "http://www.puppycrawl.com/dtds/configuration_1_2.dtd";>
-
+        "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
+        "https://checkstyle.org/dtds/configuration_1_3.dtd";>
 <!-- This is a temporary file. As we get closer to enforcing the OpenJPA
     style to be like the default Sun Microsystems Definition default file, then
     we can remove this file and remove the reference from the pom.xml -->
diff --git a/openjpa-project/suppressions.xml b/openjpa-project/suppressions.xml
index e7541efb4..69a5cc968 100644
--- a/openjpa-project/suppressions.xml
+++ b/openjpa-project/suppressions.xml
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
 
 <!DOCTYPE suppressions PUBLIC
-    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
-    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd";>
-
+               "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
+               "https://checkstyle.org/dtds/suppressions_1_2.dtd";>
 <suppressions>
        <suppress checks="RegexpSinglelineJava" 
files=".*openjpa-examples\\.*java" />
        <suppress checks="RegexpSinglelineJava" files="Test.*java" />
diff --git a/openjpa-tools/openjpa-maven-plugin/src/site/site.xml 
b/openjpa-tools/openjpa-maven-plugin/src/site/site.xml
index e87e069e1..15abe8422 100644
--- a/openjpa-tools/openjpa-maven-plugin/src/site/site.xml
+++ b/openjpa-tools/openjpa-maven-plugin/src/site/site.xml
@@ -16,7 +16,9 @@
   |
 -->
 
-<project xmlns="http://maven.apache.org/DECORATION/1.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 
http://maven.apache.org/xsd/decoration-1.0.0.xsd";>
+<site xmlns="http://maven.apache.org/SITE/2.0.0";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+        xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 
https://maven.apache.org/xsd/site-2.0.0.xsd";>
     <body>
         <menu name="Overview">
             <item name="Introduction" href="index.html" />
@@ -30,4 +32,4 @@
             <item name="TestEnhance" href="examples/testenhance.html" />
         </menu>
     </body>
-</project>
\ No newline at end of file
+</site>
diff --git a/src/site/site.xml b/src/site/site.xml
index be9fc2559..a0e1c3269 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -17,9 +17,12 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project name="OpenJPA">
-    <bannerLeft>
-        <name>OpenJPA</name>
+<site xmlns="http://maven.apache.org/SITE/2.0.0";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+        xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 
https://maven.apache.org/xsd/site-2.0.0.xsd";
+        name="Apache OpenJPA">
+    <bannerLeft href="https://openjpa.apache.org/";>
+        <image src="https://openjpa.apache.org/images/openjpa-logo.png"; 
alt="OpenJPA Logo"/>
     </bannerLeft>
     <publishDate format="dd MMM yyyy HH:mm z"/>
     <body>
@@ -30,8 +33,7 @@
         </menu>
 
         <menu name="Community">
-            <item name="Issue Tracker"
-                href="https://issues.apache.org/jira/browse/OPENJPA"/>
+            <item name="Issue Tracker" 
href="https://issues.apache.org/jira/browse/OPENJPA"/>
         </menu>
 
         <menu ref="parent"/>
@@ -45,4 +47,4 @@
         <artifactId>maven-fluido-skin</artifactId>
         <version>2.1.0</version>
     </skin>
-</project>
+</site>

Reply via email to