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

Error in JDT Core during AST creation when using exhaustive switch statement and @NotNull #2708

Closed
1 task done
ashley-taylor opened this issue Jul 12, 2024 · 3 comments
Closed
1 task done
Assignees

Comments

@ashley-taylor
Copy link

Steps to reproduce

Make sure you have jakarta.validation on the classpath

Then, the following code causes a build error

import jakarta.validation.constraints.NotNull;

public class TestSwitch {

	public static void main(@NotNull Animal animal) {
		switch(animal) {
		case Cat c -> {}
        }
	}
	record Cat() implements Animal {}
	sealed interface  Animal permits Cat {}
}

Tested under this environment:

  • OS & version: macOS 14.3
  • Eclipse IDE/Platform version (as shown in Help > About): 2023-12 (4.30.0)

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
@srikanth-sankaran
Copy link
Contributor

What error is reported ? Can you paste the message here please ?

@srikanth-sankaran srikanth-sankaran added the help wanted Extra attention is needed label Oct 24, 2024
@srikanth-sankaran
Copy link
Contributor

If some one has the cycles to spare, please try and see if you are able to extract a standalone test case that can show the problems against plain SDK JDT and against JDT's built in null annotations.

@srikanth-sankaran srikanth-sankaran self-assigned this Oct 24, 2024
@srikanth-sankaran srikanth-sankaran removed the help wanted Extra attention is needed label Oct 24, 2024
@srikanth-sankaran
Copy link
Contributor

This problem is not reproducible. Please reopen with a plain java test case if you have evidence to feel otherwise.

@srikanth-sankaran srikanth-sankaran closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
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

No branches or pull requests

2 participants