Skip to content

Inefficient and inconsistent setAllowedOrigins collection types in AbstractSockJsService/OriginHandshakeInterceptor [SPR-13761] #18334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Dec 4, 2015 · 0 comments
Assignees
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 4, 2015

Juergen Hoeller opened SPR-13761 and commented

AbstractSockJsService and OriginHandshakeInterceptor both had setAllowedOrigins / getAllowedOrigins accessors added in the middle of the 4.1.x line, but unfortunately in an inefficient and inconsistent way: Since all access goes via contains calls, the optimal data structure is a Set. OriginHandshakeInterceptor fortunately already allows for adapting this since it declares Collection; however, for no good reason, AbstractSockJsService declares List instead. Aligning this towards consistent Collection declaration and efficient use of internal LinkedHashSets is necessary, and let's rather do this right now - also in 4.1.9 - before those methods get used on a more widespread basis. For declarative configuration and Java source compilation, this change is compatible anyway; it is just not binary-compatible for precompiled jars.


Affects: 4.1.8, 4.2.3

Issue Links:

Referenced from: commits 3d1ae9c, 83c9ec4

Backported to: 4.1.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants