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

SwitchPatternTests failing in I-builds #2986

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

mpalat
Copy link
Contributor

@mpalat mpalat commented Sep 19, 2024

fixes issue #2982

What it does

fixes issue #2982

The return value of the CallSite [used by invokedynamic of typeSwitch] has changed in Java 23 - we need to check that if its a primitive enabled switch pattern (meaning that its 23 + preview then use the new signature else old]

How to test

run
org.eclipse.jdt.core.tests.compiler.regression.SwitchPatternTest testBug574525_03 - at level 21 and 22 with a 21 and 22 jre respectively.
-- | --


Author checklist

@akurtakov
Copy link
Contributor

Have you looked at the failing test in the verification build? Hopefully, it's not caused by the change here.

@akurtakov
Copy link
Contributor

Btw, if we(committers) find it too much of an effort to fill the PR template maybe we should remove it? @eclipse-jdt/eclipse-jdt-committers wdyt?

@mpalat
Copy link
Contributor Author

mpalat commented Sep 19, 2024

Have you looked at the failing test in the verification build? Hopefully, it's not caused by the change here.

That failures is unrelated - so is the failure that has happened with the repeat run. I have ran those tests locally and are passing. Am planning to merge it

@mpalat
Copy link
Contributor Author

mpalat commented Sep 19, 2024

Btw, if we(committers) find it too much of an effort to fill the PR template maybe we should remove it? @eclipse-jdt/eclipse-jdt-committers wdyt?

I have filled the template now - thanks for pointing out. I think we can keep the template

@mpalat mpalat merged commit 365a361 into eclipse-jdt:master Sep 19, 2024
6 of 9 checks passed
@jukzi
Copy link
Contributor

jukzi commented Sep 19, 2024

PR template

PR template is too much overhead to fill out on daily bases, but as long as i can delete that part i don't care. For non-committers it's a good explanation what we expect though.

@stephan-herrmann
Copy link
Contributor

Btw, if we(committers) find it too much of an effort to fill the PR template maybe we should remove it? @eclipse-jdt/eclipse-jdt-committers wdyt?

I had the same thought many times.

For first time contributors the template may make sense as a guideline of what information we need. Do non-committer contributors use the template as intended? I don't have any figures.

When committers leave the template untouched, this sets a poor example. I personally figure, I don't need to specify how to test, e.g., because I will already include unit tests that give that exact information. Being a committer also adhering to coding conventions and ECA can be assumed even if I don't specify this every time. But even we should keep in mind that github issues and PRs are an essential source of information for reviewers (now) and maintainers (later).

As a consequence, I personally have the habit of replacing the template with information that is to the point for committer-to-committer communication. Does anyone object to that?

Comment on lines +1026 to +1028
this.isPrimitiveSwitch
? exprType.signature()
: "Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are two more locations below this block which still use exprType.signature() unconditionally. Shouldn't those have the same guard, too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... or, simpler still, make an early return if !this.isPrimitiveSwitch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, will take a look - will wait for an I build first to confirm the fix

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 this pull request may close these issues.

4 participants