[jboss-jira] [JBoss JIRA] (DROOLS-184) kieResources.newClassPathResource() violates the Class.getResource() conventions

Geoffrey De Smet (JIRA) jira-events at lists.jboss.org
Mon Jul 1 04:09:21 EDT 2013


Geoffrey De Smet created DROOLS-184:
---------------------------------------

             Summary: kieResources.newClassPathResource() violates the Class.getResource() conventions
                 Key: DROOLS-184
                 URL: https://issues.jboss.org/browse/DROOLS-184
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 6.0.0.Beta4
            Reporter: Geoffrey De Smet
            Assignee: Edson Tirelli


Suppose I have a jar like this:
{code}
cheeseProject-1.0.0.jar
  /org/cheese/MyCheeseApp.class
  /org/cheese/myCheeseRules.drl
{code}

There are 2 ways in plain old Java, to get that drl classpath resource:
{code}
  getClass().getResource("/org/cheese/myCheeseRules.drl") // OK
  getClass().getResource("myCheeseRules.drl") // OK
{code}

The KnowledgeBase's  classpath resource creation expected similar parameters.

In KieBase I expected it to work in the same way:
{code}
kieResources.newClassPathResource("/org/cheese/myCheeseRules.drl") // FAILS
kieResources.newClassPathResource("myCheeseRules.drl", MyCheeseApp.class) // FAILS
{code}

Instead it expects something like this:
{code}
kieResources.newClassPathResource("src/main/resource/xxx/org/cheese/myCheeseRules.drl") // ???
{code}

That's not compatible with the JDK definition of a classpath resource, and therefore shouldn't be called newClassPathResource(...). And I 'd like to be able to use the real newClassPathResource() variation.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list