Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1334298

Summary: Java files with non latin characters are not build properly
Product: [Retired] JBoss BRMS Platform 6 Reporter: Walter Medvedeo <wmedvede>
Component: BREAssignee: Walter Medvedeo <wmedvede>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.3.0CC: etirelli, manstis
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:09:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1328941    
Attachments:
Description Flags
Build erros for java files with non latin characters none

Description Walter Medvedeo 2016-05-09 11:08:11 UTC
Created attachment 1155246 [details]
Build erros for java files with non latin characters

Description of problem:

Java files with non latin characters in the name are not being build properly.

Here's some examples.

ыфва.java:

package demo.test;

public class ыфва implements java.io.Serializable {

    static final long serialVersionUID = 1L;

    public ыфва() {
    }
}


保存.java:

package demo.test;

public class ыфва implements java.io.Serializable {

    static final long serialVersionUID = 1L;

    public ыфва() {
    }

}

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. Create a Java file: "ыфва.java" manually and push it manually into a given project in the WB.

2. Try to build the project with the WB:

3. The java files don't build properly and the errors in the attached screen will be shown.

Actual results:

The project don't build properly and the build system shows errors.

Expected results:

The project should build properly.

Additional info:

Comment 2 Walter Medvedeo 2016-05-09 11:10:55 UTC
Edson, 

This is the first colateral error I could find if java files with non latin characters like the one suggested "ыфва.java" are added to the project.

Comment 3 Walter Medvedeo 2016-05-09 11:13:35 UTC
I've assign this to Mario since his the best person to look into this build errors.

Thanks.

Comment 4 Walter Medvedeo 2016-05-09 14:41:27 UTC
I've could see that the build seems to also have problems when packages like "com.test.ыфва" are used. See that for testing this case packages should also be created manually and then pushed into the WB repository. Sinc the WB ui don't let the creation of this type of packages.

@manstis or @edson can confirm this it's expected to have this type of packages too.

Comment 5 Mario Fusco 2016-05-09 16:37:11 UTC
I believe that the problem is not in the KieBuilder. 
I developed the test case that I'm pasting below and it works for me.

    @Test
    public void testBuildClassWithNonAsciiName() throws Exception {
        // BZ-1334298
        String java = "package org;\npublic class ыфва { }\n";
        String drl = "import org.ыфва;\nrule R when ыфва() then end\n";

        KieServices ks = KieServices.Factory.get();

        KieFileSystem kfs = ks.newKieFileSystem()
                              .write( "src/main/resources/drlFile.drl", drl )
                              .write( "src/main/java/org/ыфва.java", java );

        KieBuilder builder = ks.newKieBuilder( kfs ).buildAll();

        Results results = builder.getResults();
        assertEquals( 0, results.getMessages().size() );

        ks.getRepository().addKieModule( builder.getKieModule() );

        KieContainer kc = ks.newKieContainer( ks.getRepository().getDefaultReleaseId() );

        KieSession kieSession = kc.newKieSession( );
        assertNotNull( kieSession );

        Object obj = Class.forName( "org.ыфва", true, kc.getClassLoader() ).newInstance();
        kieSession.insert( obj );
        assertEquals( 1, kieSession.fireAllRules() );
    }

Comment 6 Mario Fusco 2016-05-09 16:57:57 UTC
I tried my reproducer also on 6.4.x branch and it works also there. Very likely the problem is on the web side. Reassigning to Walter.

Comment 7 Walter Medvedeo 2016-05-10 10:18:26 UTC
Thanks, Mario for checking the drools side. Finally I could verify that this error is in the WB build system.