UnusedImports does not consider use in annocations
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Using Hibernate Any declarations in a package-info.java file. This is required to compile and checkstyle also does not report this as an unsed import.
See example below
@AnyMetaDefs({
@AnyMetaDef(
name = "AnyFoo",
idType = "long",
metaType = "string",
metaValues = {
@MetaValue(value = "FooBar", targetEntity = FooBar.class)
}
)
})
package com.foo;
import org.hibernate.annotations.AnyMetaDef;
import org.hibernate.annotations.AnyMetaDefs;
import org.hibernate.annotations.MetaValue;
import com.foo.impl.FooBar;
Also a note, there is no real place to put a SuppressWarnings in the file that has an effect on the PMD warnings produced