[jboss-jira] [JBoss JIRA] Created: (JBRULES-1640) Packaged rules use StringBuilder even when JavaDialectConfiguration languageLevel set to 1.4

Brad Koehn (JIRA) jira-events at lists.jboss.org
Wed Jun 11 10:47:16 EDT 2008


Packaged rules use StringBuilder even when JavaDialectConfiguration languageLevel set to 1.4
--------------------------------------------------------------------------------------------

                 Key: JBRULES-1640
                 URL: http://jira.jboss.com/jira/browse/JBRULES-1640
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Drl Parser/Builder
    Affects Versions: 4.0.7
         Environment: Java 5/6 for building packages, Java 2 (1.4) for reading them. 
            Reporter: Brad Koehn
         Assigned To: Mark Proctor


When creating a package and serializing it under Java 5/6, and the languageLevel is set to "1.4", Drools will generate code that uses StringBuilder, a class that doesn't exist in Java 1.4. 

Here's some code that is used to generate the package:

		PackageBuilderConfiguration packageBuilderConfiguration = new PackageBuilderConfiguration();
		JavaDialectConfiguration javaDialectConfiguration = (JavaDialectConfiguration) packageBuilderConfiguration
				.getDialectConfiguration("java");
		javaDialectConfiguration.setJavaLanguageLevel("1.4");
		javaDialectConfiguration.setCompiler(JavaDialectConfiguration.JANINO);
		packageBuilderConfiguration.setDialectConfiguration("java",
				javaDialectConfiguration);

Drools (Janino, in this case) generates the correct major/minor version of the classes, so they load correctly under a 1.4 JVM, but I then get a NoClassDefFoundError: java.util.StringBuilder at rule execution time. 

If I build the same package under a 1.4 JVM, Drools doesn't use StringBuilder and the rules execute correctly on a 1.4 JVM. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list