Details

    • Bug
    • Resolution: Done
    • Major
    • 2.6.0.Final
    • 2.5.0.Final
    • EAP6 -> EAP7

    Description

      I have code like this:

              configuration.addFile(new File("somefile"));
              configuration.add(new XmlDocumentImpl(null, null));
              configuration.addXML("<xml/>");
              ... // a lot of other add* methods invoked
      

      All these method invocations are caught except of the second one:

              configuration.add(new XmlDocumentImpl(null, null));
      

      The rule that is supposed to catch this, hibernate4-00002, has quite weird condition. The test inside the ruleset is simpler than what I have (it also wouldn't compile, there's no such method as Configuration.add(String)), which is probably the reason why the test didn't catch this.

      Also, the rule's hint reads "Method org.hibernate.cfg.Configuration.add() is deprecated ..." – it uses parenthesis after the method name "add()". No other rule for Configuration.addXxx methods use the parenthesis, it's always just "Method org.hibernate.cfg.Configuration.addXxx is deprecated ...".

      Attachments

        Activity

          People

            mnovotny@redhat.com Marek Novotny
            lthon@redhat.com Ladislav Thon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: