-
Bug
-
Resolution: Done
-
Major
-
2.5.0.Final
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 ...".