Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1505

Space characters between "(" and LocalVariableType in the enhanced "for" (foreach) statement causes compilation error.

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.9.0.GA
    • 7.10.0.GA
    • BRE
    • This issue is reproducible¬†at least on RHDM 7.2.1.GA and 7.9.0.GA.

    • CR1
    • Hide
      $ unzip reproducer_02801729_1b.zip
      $ cd reproducer_02801729_1b
      $ mvn clean compile exec:exec -DgenerateModel=NO
          :
          :
      [INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:build (default-build) @ reproducer_02801729_1b ---
          :
          :
      [ERROR] Unable to build KieBaseModel:rules
      Unable to Analyse Expression for ( Bus bus : $buses ) {            System.out.println("bus: " + bus);        };:
      [Error: cannot resolve identifier: Bu]
      [Near : {... for ( Bus bus : $buses ) { ....}]
                        ^
      [Line: 8, Column: 0] : [Rule name='bus1']
      
      
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  2.504 s
      [INFO] Finished at: 2020-11-18T13:00:35+09:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:build (default-build) on project reproducer_02801729_1b: Execution default-build of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:build failed: Unable to get KieModule, Errors Existed: Error Messages:
      [ERROR] Message [id=1, kieBase=rules, level=ERROR, path=com/example/reproducer/Sample.drl, line=8, column=0
      [ERROR]    text=Unable to Analyse Expression for ( Bus bus : $buses ) {            System.out.println("bus: " + bus);        };:
      [ERROR] [Error: cannot resolve identifier: Bu]
      [ERROR] [Near : {... for ( Bus bus : $buses ) { ....}]
      [ERROR]                   ^
      [ERROR] [Line: 8, Column: 0]]
      [ERROR] ---
      [ERROR] Warning Messages:
      [ERROR] ---
      [ERROR] Info Messages:
      [ERROR] 
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
      
      Show
      $ unzip reproducer_02801729_1b.zip $ cd reproducer_02801729_1b $ mvn clean compile exec:exec -DgenerateModel=NO : : [INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:build (default-build) @ reproducer_02801729_1b --- : : [ERROR] Unable to build KieBaseModel:rules Unable to Analyse Expression for ( Bus bus : $buses ) { System.out.println("bus: " + bus); };: [Error: cannot resolve identifier: Bu] [Near : {... for ( Bus bus : $buses ) { ....}] ^ [Line: 8, Column: 0] : [Rule name='bus1'] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.504 s [INFO] Finished at: 2020-11-18T13:00:35+09:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:build (default-build) on project reproducer_02801729_1b: Execution default-build of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:build failed: Unable to get KieModule, Errors Existed: Error Messages: [ERROR] Message [id=1, kieBase=rules, level=ERROR, path=com/example/reproducer/Sample.drl, line=8, column=0 [ERROR] text=Unable to Analyse Expression for ( Bus bus : $buses ) { System.out.println("bus: " + bus); };: [ERROR] [Error: cannot resolve identifier: Bu] [ERROR] [Near : {... for ( Bus bus : $buses ) { ....}] [ERROR] ^ [ERROR] [Line: 8, Column: 0]] [ERROR] --- [ERROR] Warning Messages: [ERROR] --- [ERROR] Info Messages: [ERROR] [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
    • 2020 Week 49-51 (from Nov 30)
    • -

    Description

      Compiling rules described in mvel dialect mode which contains the enhanced "for" (foreach) statement with space characters between "(" and LocalVariableType in generateModel=NO causes compilation error. For example, MVEL compiler can compile (1) successfully, but fails to compile (2).
      (1) for (LocalVariableType VariableDeclaratorId : Expression )
      (2) for ( LocalVariableType VariableDeclaratorId : Expression )

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            rhn-support-myoshida Masato Yoshida
            Daniel Rosa Daniel Rosa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: