Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-367

Can't use JANINO compiler

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.3, 3.1-m1
    • 3.0.2
    • drools-compiler
    • None
    • Workaround Exists
    • Hide

      org.drools.compiler.PackageBuilder row 504

      private void loadCompiler() {
      switch ( configuration.getCompiler() ) {
      case PackageBuilderConfiguration.JANINO :

      { if ( !"1.4".intern().equals( configuration.getJavaLanguageLevel() ) ) throw new RuntimeDroolsException( "Incompatible Java language level with selected compiler" ); compiler = JavaCompilerFactory.getInstance().createCompiler( "janino" ); #need a break here !!!! }

      case PackageBuilderConfiguration.ECLIPSE :
      default :

      { EclipseJavaCompilerSettings eclipseSettings = new EclipseJavaCompilerSettings(); eclipseSettings.getMap().put( "org.eclipse.jdt.core.compiler.codegen.targetPlatform", configuration.getJavaLanguageLevel() ); eclipseSettings.getMap().put( "org.eclipse.jdt.core.compiler.source", configuration.getJavaLanguageLevel() ); compiler = new EclipseJavaCompiler( eclipseSettings ); }

      }
      }

      Show
      org.drools.compiler.PackageBuilder row 504 private void loadCompiler() { switch ( configuration.getCompiler() ) { case PackageBuilderConfiguration.JANINO : { if ( !"1.4".intern().equals( configuration.getJavaLanguageLevel() ) ) throw new RuntimeDroolsException( "Incompatible Java language level with selected compiler" ); compiler = JavaCompilerFactory.getInstance().createCompiler( "janino" ); #need a break here !!!! } case PackageBuilderConfiguration.ECLIPSE : default : { EclipseJavaCompilerSettings eclipseSettings = new EclipseJavaCompilerSettings(); eclipseSettings.getMap().put( "org.eclipse.jdt.core.compiler.codegen.targetPlatform", configuration.getJavaLanguageLevel() ); eclipseSettings.getMap().put( "org.eclipse.jdt.core.compiler.source", configuration.getJavaLanguageLevel() ); compiler = new EclipseJavaCompiler( eclipseSettings ); } } }
    • Low

    Description

      If I set the builder to use janino as compiler, using both enviroment variable -Ddrools.compiler=JANINO and programmatic configuration PackageBuilderConfiguration.setCompiler( PackageBuilderConfiguration.JANINO ),
      the compiler selected is always eclipse.
      I see in source that the switch that control the compiler to use is lacking of a break.

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            crl42 Carlo Rossi (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty