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

The constructor ValueError(Value, String, String) is undefined

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • drools-eclipse
    • None
    • Hide

      I defined a POJO class somestuff.messages.ValueError with the constructor

      public ValueError(final String value, final String messageKey, final String token) {}

      My the .drl:

      import somestuff.messages.*;

      rule "foobar"
      when Object()
      then
      insert( new ValueError( "foo", "bar", "baz" ) );
      end

      Interesting note:

      • This happens only if the class name is "ValueError", the package name does not seem to matter.
      • If I change the import from the glob to the explicit fqn of the class
        import somestuff.messages.ValueError;
        then the Eclipse-Problems-entry goes away!

      A personal guess: class resolution of the eclipse plugin does find an internal type first if using the glob import.

      Show
      I defined a POJO class somestuff.messages.ValueError with the constructor public ValueError(final String value, final String messageKey, final String token) {} My the .drl: import somestuff.messages.*; rule "foobar" when Object() then insert( new ValueError( "foo", "bar", "baz" ) ); end Interesting note: This happens only if the class name is "ValueError", the package name does not seem to matter. If I change the import from the glob to the explicit fqn of the class import somestuff.messages.ValueError; then the Eclipse-Problems-entry goes away! A personal guess: class resolution of the eclipse plugin does find an internal type first if using the glob import.
    • Hide

      Use imports with fully qualified class names;

      Show
      Use imports with fully qualified class names;

    Description

      I do get the message "The constructor ValueError(String, String, String) is undefined" in the Eclipse-Problems tab when compiling the project.
      The projects actually runs as expected.

      This happens when
      a) the class name is "ValueError". Might hit other class names, too. But ValueError is what I used
      b) I use glob imports, e.g. import foo.bar.*;

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            christophlinder Christoph Linder (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty