We're updating the issue view to help you get more done. 

ConstraintDescriptorImpl.equals does not match Annotation Proxies

Description

Class.getAnnotations() returns a Proxy object wrapping the annotation class; these objects are cached. ConstraintDescriptorImpl uses the equals() method of the annotation, but the proxy object does not implement a equals method, so Object.equals() is used.

1 if ( annotation != null ? !annotation.equals( that.annotation ) : that.annotation != null ) { ... }

Under high load or low memory, the cached proxy objects get cleared and newly initialized, which breaks the equals-check and the validation gets skipped.

Annotation.annotationType() should be checked.

This bug may be related to

I'm still working on an unittest to show this behavior. At the moment we can reproduce it by hammering our Struts2 application with JMeter.

Environment

None

Status

Assignee

Hardy Ferentschik

Reporter

sebastian haas

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

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.1.2.Final

Priority

Major