forked from phoedos/pmd
fix #4141
This commit is contained in:
parent
905f1432f4
commit
a1bcad2db2
@ -102,7 +102,10 @@ and unintentional empty constructors.
|
||||
[@containsComment = false()]
|
||||
[not(BlockStatement)]
|
||||
[$ignoreExplicitConstructorInvocation = true() or not(ExplicitConstructorInvocation)]
|
||||
[not(../Annotation/MarkerAnnotation/Name[pmd-java:typeIs('javax.inject.Inject')])]
|
||||
[not(../Annotation/MarkerAnnotation/Name[
|
||||
pmd-java:typeIs('javax.inject.Inject')
|
||||
or pmd-java:typeIs('org.springframework.beans.factory.annotation.Autowired')
|
||||
])]
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
|
@ -187,4 +187,30 @@ public class MyClass {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#4141 UncommentedEmptyConstructor FP when annotated constructor with @Autowired</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
public class Bug {
|
||||
@Autowired
|
||||
public Bug() {
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#4141 UncommentedEmptyConstructor FP when annotated constructor with @Autowired</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Bug {
|
||||
@org.springframework.beans.factory.annotation.Autowired
|
||||
public Bug() {
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
</test-data>
|
||||
|
Loading…
x
Reference in New Issue
Block a user