Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ private void invalidParamsCheck(JavaDiagnosticsContext context, String uri, ICom
// this method will be called to scan all methods looking for either @Produces annotations OR @Inject annotations. In either
// scenario this method will then check for disallowed parameter annotations and add diagnostics to be displayed if detected.
Set<String> paramScopesSet;
boolean mutuallyExclusive = false;

for (IMethod method : type.getMethods()) {
IAnnotation targetAnnotation = null;

boolean mutuallyExclusive = false;
for (IAnnotation annotation : method.getAnnotations()) {
if (DiagnosticUtils.isMatchedJavaElement(type, annotation.getElementName(), target)) {
targetAnnotation = annotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ RemoveConstraintAnnotation = Remove constraint annotation {0} from element
# BeanValidationDiagnosticsParticipant
ConstraintAnnotationsMethod = Constraint annotations are not allowed on static methods.
ConstraintAnnotationsField = Constraint annotations are not allowed on static fields.
SizeOrNonEmptyAnnotationsField = This annotation can only be used on CharSequence, Collection, Array, Map type fields.
SizeOrNonEmptyAnnotationsMethod = This annotation can only be used on CharSequence, Collection, Array, Map return type methods.
SizeOrNonEmptyAnnotationsField = This annotation can only be used on fields of type CharSequence, Collection, Array, or Map.
SizeOrNonEmptyAnnotationsMethod = This annotation can only be used on methods that have CharSequence, Collection, Array or Map as a return type.
AnnotationBooleanMethods = The {0} annotation can only be used on boolean and Boolean type methods.
AnnotationBooleanFields = The {0} annotation can only be used on boolean and Boolean type fields.
AnnotationBigDecimalMethods= The {0} annotation can only be used on: \n- BigDecimal \n- BigInteger \n- CharSequence\n- byte, short, int, long (and their respective wrappers) \n type methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ public void fieldConstraintValidation() throws Exception {
"jakarta.validation.constraints.Past");

Diagnostic d21 = d(66, 20, 26,
"This annotation can only be used on CharSequence, Collection, Array, Map type fields.",
"This annotation can only be used on fields of type CharSequence, Collection, Array, or Map.",
DiagnosticSeverity.Error, "jakarta-bean-validation", "InvalidAnnotationOnNonSizeMethodOrField",
"jakarta.validation.constraints.Size");

Diagnostic d22 = d(69, 29, 45,
"This annotation can only be used on CharSequence, Collection, Array, Map type fields.",
"This annotation can only be used on fields of type CharSequence, Collection, Array, or Map.",
DiagnosticSeverity.Error, "jakarta-bean-validation", "InvalidAnnotationOnNonSizeMethodOrField",
"jakarta.validation.constraints.NotEmpty");

Expand Down Expand Up @@ -363,7 +363,7 @@ public void methodConstraintValidation() throws Exception {
"jakarta.validation.constraints.AssertFalse");

Diagnostic d4 = d(36, 19, 28,
"This annotation can only be used on CharSequence, Collection, Array, Map return type methods.",
"This annotation can only be used on methods that have CharSequence, Collection, Array or Map as a return type.",
DiagnosticSeverity.Error, "jakarta-bean-validation", "InvalidAnnotationOnNonSizeMethodOrField",
"jakarta.validation.constraints.Size");

Expand Down
Loading