java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Java 17: Update switch expressions

Open iluwatar opened this issue 2 years ago • 4 comments

Java's switch expression syntax has vastly evolved over the years. It's well described at https://medium.com/@javatechie/the-evolution-of-switch-statement-from-java-7-to-java-17-4b5eee8d29b7

Acceptance criteria

  • Java 17 switch expressions have been applied throughout the repository

iluwatar avatar Dec 02 '22 06:12 iluwatar

Hello @iluwatar,

I haven't contributed to open source yet. But I want to start now.

I am:

  • Oracle Certified Professional Java SE 11 Developer
  • Oracle Certified Professional Java SE 17 Developer

I could take this Issue and refactor all switch expressions to the new syntax.

CodePawfect avatar Dec 14 '22 09:12 CodePawfect

Hello @iluwatar thank you for assigne me to the issue.

when i checkout fresh master branch and run mvn checkstyle:check then multiple errors occure:

image

I already have made all necressary changes to the switch statements and opened an pull request in draft. The Pull Request shows "all checks have failed" because of the checkstyle errors from master.

I would be grateful if you could tell me how I should proceed here.

CodePawfect avatar Dec 15 '22 19:12 CodePawfect

@AlexMitDemBart that command is not taking into account the checkstyle configuration we have in the pom.xml. Try ./mvnw validate instead.

iluwatar avatar Dec 17 '22 07:12 iluwatar

@iluwatar

Is this something that i can fix?

image

CodePawfect avatar Dec 17 '22 12:12 CodePawfect

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 17 '23 16:02 stale[bot]

Hey @iluwatar can I work on this issue, I am new to open source but I have a good grip in Java

akshatarora0013 avatar Mar 20 '23 07:03 akshatarora0013

Made the pull request (issue #2376), changed all the switch expressions according to JAVA 17.

akshatarora0013 avatar Mar 20 '23 12:03 akshatarora0013

'm new to open-sourcing and I have no clue about what I should be doing. Can anyone guide me? I have basic knowledge of java let me know in which way I can help you.

jaswanthg76 avatar Mar 25 '23 11:03 jaswanthg76