Description of problem: If you add a multibyte class name Java file (e.g. あいうえお.java) to a project using "git push", the project fails to build. The error messages are displayed in "Messages" pane. ====== The public type あいうえお must be defined in its own file | あいうえお.java The type あいうえお collides with a package | あいうえお.java ====== No error is logged in server.log. Note: You cannot create a multibyte class name Java file by Data Objects Editor. This issue can be reproduced by pushing the local Java file via git. Steps to Reproduce: 1. Login to business-central 2. Clone a repository (e.g. 'repository1') to local filesystem by ssh git clone (e.g. git clone ssh://brmsAdmin@localhost:8001/repository1) 3. Add a multibyte class name Java file (e.g. あいうえお.java attached to this BZ for your convenience) to local filesystem (e.g. /repository1/project1/src/main/java/org/kie/example/project1/あいうえお.java) 4. git add, commit and push 5. Confirm that "あいうえお" exists under Project Explorer "DATA OBJECTS" 5. "Build&Deploy" in business-central Actual results: Build failed with the messages ===== The public type あいうえお must be defined in its own file | あいうえお.java The type あいうえお collides with a package | あいうえお.java ===== Expected results: Build successful and we can use the class for rules.
Note: We can use a multibyte class name Java file and multibyte filed name in simple Drools use case. https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/I18nTest.java covers only multibyte filed name though.
[Analysis] The error is raised in KieBuilderImpl.compileJavaClasses() because KieBuilderImpl.srcMfs stores the java file (あいうえお.java) path as URL encoded path "src/main/java/org/kie/example/project1/%E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A.java". So failed in compilation. URL encoding is done by EncodingUtil.encodePath() Daemon Thread [http-localhost.localdomain/127.0.0.1:8080-4] (Suspended (breakpoint at line 238 in EncodingUtil)) EncodingUtil.encodePath(String) line: 238 JGitPathImpl(AbstractPath<FS>).encodePath(String) line: 256 JGitPathImpl(AbstractPath<FS>).toURIString() line: 252 JGitPathImpl(AbstractPath<FS>).toUri() line: 243 Builder.visitPaths(DirectoryStream<Path>) line: 574 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.visitPaths(DirectoryStream<Path>) line: 560 Builder.<init>(Project, IOService, KieProjectService, ProjectImportsService, List<BuildValidationHelper>, PackageNameWhiteList, LRUProjectDependenciesClassLoaderCache, LRUPomModelCache) line: 141 LRUBuilderCache.assertBuilder(Project) line: 93 LRUBuilderCache$Proxy$_$$_WeldClientProxy.assertBuilder(Project) line: not available BuildServiceImpl.doBuild(Project) line: 173 ...
Created attachment 1104594 [details] あいうえお.java