Add check on default message to recognize missing {} for keys

Description

I had a problem because I miswrote my constraint

1 2 3 4 5 6 7 8 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Constraint(validatedBy={CancellationCode.StringValidator.class}) public @interface CancellationCode { String message() default "org.jboss.jdf.example.ticketmonster.model.CancellationCode.message"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; }

Note the missing {} around the message default key.

We might want to detect that in the annotation processor by checking the following pattern:

  • long ish without space

  • dots

  • no {} around

Environment

None

Status

Assignee

Marko Bekhta

Reporter

Emmanuel Bernard

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major