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

sergeychugunov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 710b2f3e5f0 IGNITE-26278 Fix handling of class files loaded from JAR 
archives (#12294)
710b2f3e5f0 is described below

commit 710b2f3e5f0f58834c502f2ad045396012910744
Author: Sergey Chugunov <[email protected]>
AuthorDate: Thu Aug 28 17:02:45 2025 +0400

    IGNITE-26278 Fix handling of class files loaded from JAR archives (#12294)
---
 .../org/apache/ignite/tools/classgen/ClassesGenerator.java   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
 
b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
index 404a85a558f..942084e86b9 100644
--- 
a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
+++ 
b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
@@ -46,6 +46,9 @@ public class ClassesGenerator {
     /** */
     private static final String DEFAULT_FILE_PATH = META_INF + 
"classnames.properties";
 
+    /** File path separator used to separate path parts by {@link 
JarInputStream} . */
+    private static final char JAR_ENTRY_SEPARATOR = '/';
+
     /** */
     private static final String[] EXCLUDED_PACKAGES = {
         "org.apache.ignite.tools"
@@ -187,12 +190,12 @@ public class ClassesGenerator {
 
                     while ((entry = jin.getNextJarEntry()) != null) {
                         if (!entry.isDirectory() && 
entry.getName().toLowerCase().endsWith(".class"))
-                            processClassFile(entry.getName(), 0);
+                            processClassFile(entry.getName(), 0, 
JAR_ENTRY_SEPARATOR);
                     }
                 }
             }
             else if (path.toLowerCase().endsWith(".class"))
-                processClassFile(path, prefixLen);
+                processClassFile(path, prefixLen, File.separatorChar);
         }
     }
 
@@ -242,11 +245,12 @@ public class ClassesGenerator {
     /**
      * @param path File path.
      * @param prefixLen Prefix length.
+     * @param separatorChar Char symbol to convert class file path to java 
class name.
      * @throws Exception In case of error.
      */
-    private void processClassFile(String path, int prefixLen)
+    private void processClassFile(String path, int prefixLen, char 
separatorChar)
         throws Exception {
-        String clsName = path.substring(prefixLen, path.length() - 
6).replace(File.separatorChar, '.');
+        String clsName = path.substring(prefixLen, path.length() - 
6).replace(separatorChar, '.');
 
         for (String pkg : EXCLUDED_PACKAGES) {
             if (clsName.startsWith(pkg))

Reply via email to