[java] Fix NoPackage rule

- Also make it's search much more precise, making it 10X faster
This commit is contained in:
Juan Martín Sotuyo Dodero
2019-04-12 17:27:45 -03:00
parent 5ad7ca97bc
commit eb7903d963

View File

@ -1359,8 +1359,9 @@ Detects when a class or interface does not have a package definition.
<priority>3</priority>
<properties>
<property name="xpath">
<value>//ClassOrInterfaceDeclaration[count(preceding::PackageDeclaration) = 0]</value>
<value>/CompilationUnit[not(./PackageDeclaration)]/TypeDeclaration[1]</value>
</property>
<property name="version" value="2.0"/>
</properties>
<example>
<![CDATA[