[jboss-jira] [JBoss JIRA] (DROOLS-722) lngLevel KnowledgeBuilderConfiguration doc is wrong, property cannot be set

Mario Fusco (JIRA) issues at jboss.org
Wed Jul 8 03:30:04 EDT 2015


     [ https://issues.jboss.org/browse/DROOLS-722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco resolved DROOLS-722.
--------------------------------
    Resolution: Out of Date


> lngLevel KnowledgeBuilderConfiguration doc is wrong, property cannot be set
> ---------------------------------------------------------------------------
>
>                 Key: DROOLS-722
>                 URL: https://issues.jboss.org/browse/DROOLS-722
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 5.5.0.Final
>            Reporter: Gilad Wolff
>            Assignee: Mario Fusco
>
> The documentation regrading setting the lngLevel in KnowledgeBuilderConfiguration is wrong: 
> {code}
> * <p>
>  * Two dialects are supported, Java and MVEL. Java is the default dialect.<br/>
>  * The Java dialect supports the following configurations:
>  * <ul>
>  * <li>drools.dialect.java.compiler = &lt;ECLIPSE|JANINO&gt;</li>
>  * <li>drools.dialect.java.lngLevel = &lt;1.5|1.6&gt;</li>
>  * </ul>
> {code}
> drools.dialect.java.lngLevel is not the property name. The actual property name is "drools.dialect.java.compiler.lnglevel". Here is the getter in JavaDialectConfiguration:
> {code}
> private String getDefaultLanguageLevel() {
>         String level = this.conf.getChainedProperties().getProperty( "drools.dialect.java.compiler.lnglevel",
>                                                                      null );
> {code}
> Moreover this property cannot be set in the configuration as it is ignored by the setProperty method of the PackageBuilderConfiguration:
> {code}
>    public void setProperty(String name,
>                             String value) {
>         name = name.trim();
>         if ( StringUtils.isEmpty( name ) ) {
>             return;
>         }
>         if ( name.equals( DefaultDialectOption.PROPERTY_NAME ) ) {
>             setDefaultDialect( value );
>         } else if ( name.startsWith( AccumulateFunctionOption.PROPERTY_NAME ) ) {
>             addAccumulateFunction( name.substring( AccumulateFunctionOption.PROPERTY_NAME.length() ),
>                                    value );
>         } else if ( name.startsWith( EvaluatorOption.PROPERTY_NAME ) ) {
>             this.evaluatorRegistry.addEvaluatorDefinition( value );
>         } else if ( name.equals( DumpDirOption.PROPERTY_NAME ) ) {
>             buildDumpDirectory( value );
>         } else if ( name.equals( DefaultPackageNameOption.PROPERTY_NAME ) ) {
>             setDefaultPackageName( value );
>         } else if ( name.equals( ProcessStringEscapesOption.PROPERTY_NAME ) ) {
>             setProcessStringEscapes( Boolean.parseBoolean( value ) );
>         } else if ( name.equals( ClassLoaderCacheOption.PROPERTY_NAME ) ) {
>             setClassLoaderCacheEnabled( Boolean.parseBoolean( value ) );
>         } else if ( name.startsWith( KBuilderSeverityOption.PROPERTY_NAME ) ) {
>             String key = name.substring( name.lastIndexOf('.') + 1 ); 
>             this.severityMap.put(key, KBuilderSeverityOption.get(key, value).getSeverity());
>         }
>     }
> {code}
> the only way to set it is as a jvm option (and then it is "collected" in the chainedProperties).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list