Skip to content
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

Websocket annotation on AnnotatedConfigEndpoint class #5774

Closed
janbartel opened this issue Dec 8, 2020 · 4 comments · Fixed by #5777
Closed

Websocket annotation on AnnotatedConfigEndpoint class #5774

janbartel opened this issue Dec 8, 2020 · 4 comments · Fixed by #5777
Assignees

Comments

@janbartel
Copy link
Contributor

janbartel commented Dec 8, 2020

jetty-11

In the code below, Eclipse flags the use of the private non-static fields (idleTimeout, maxMessageSize, maxMessageSize, inputBufferSize) of the enclosing class (ClientConfigTest) as illegal because those fields are not static.

  @WebSocket(idleTimeout = idleTimeout, maxTextMessageSize = maxMessageSize, maxBinaryMessageSize = maxMessageSize, inputBufferSize = inputBufferSize, batchMode = BatchMode.ON)
   public class AnnotatedConfigEndpoint extends EventSocket
   {
   }
@janbartel
Copy link
Contributor Author

@lachlan-roberts Eclipse seems to think this is a problem, can you investigate?

@janbartel
Copy link
Contributor Author

BTW, it's the same error for jetty-10

@joakime
Copy link
Contributor

joakime commented Dec 8, 2020

To be clear, Eclipse is complaining about the ClientConfigTest final fields not being static.

https://github.com/eclipse/jetty.project/blob/aabe5ceee26971beb57d399a1424b8274ee6f4ef/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConfigTest.java#L65-L67

As Eclipse expects that if you use an annotation, the values are actually constants. (requires them to be final static).

@lachlan-roberts
Copy link
Contributor

I don't think this is actually a problem as the AnnotatedConfigEndpoint class is not static either so it should work. Either way I will make a PR to clean it up and make all of the fields and classes used for this static.

lachlan-roberts added a commit that referenced this issue Dec 8, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Dec 10, 2020
…tic (#5777)

* Issue #5774 - make fields and classes in Client/Server ConfigTest static

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* changes from review

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants