René's URL Explorer Experiment


Title: Google Java Format fails on complex switch expressions with Java 21 · Issue #983 · google/google-java-format · GitHub

Open Graph Title: Google Java Format fails on complex switch expressions with Java 21 · Issue #983 · google/google-java-format

X Title: Google Java Format fails on complex switch expressions with Java 21 · Issue #983 · google/google-java-format

Description: Version 1.18.1 formatter throws an exception when trying to handle code like this: return switch (obj1) { case null -> obj2 == null; case T1 myT1 when obj2 instanceof T1 otherT1 -> myT1.equalsStrict(otherT1); // exception ^ at the when (...

Open Graph Description: Version 1.18.1 formatter throws an exception when trying to handle code like this: return switch (obj1) { case null -> obj2 == null; case T1 myT1 when obj2 instanceof T1 otherT1 -> myT1.equalsStric...

X Description: Version 1.18.1 formatter throws an exception when trying to handle code like this: return switch (obj1) { case null -> obj2 == null; case T1 myT1 when obj2 instanceof T1 otherT1 -> myT1.equal...

Opengraph URL: https://github.com/google/google-java-format/issues/983

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Google Java Format fails on complex switch expressions with Java 21","articleBody":"Version 1.18.1 formatter throws an exception when trying to handle code like this:\r\n```java\r\n      return switch (obj1) {\r\n          case null -> obj2 == null;\r\n          case T1 myT1 when obj2 instanceof T1 otherT1 -> myT1.equalsStrict(otherT1);\r\n          // exception ^ at the when (69:46 in the original source)\r\n          case T2 myT2 when obj2 instanceof T2 otherT2 -> T2.isDeepEquals(myT2, otherT2);\r\n          default -> obj1.equals(obj2);\r\n      };\r\n```\r\n\r\nThe exception is:\r\n```\r\nStep 'google-java-format' found problem in 'src/test/java/com/example/test/acceptance/ExpectedResult.java':\r\n69:46: error: : or -> expected\r\ncom.google.googlejavaformat.java.FormatterException: 69:46: error: : or -> expected\r\n        at com.google.googlejavaformat.java.FormatterException.fromJavacDiagnostics(FormatterException.java:51)\r\n        at com.google.googlejavaformat.java.Formatter.format(Formatter.java:149)\r\n        at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:273)\r\n        at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:247)\r\n        at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:213)\r\n        at com.diffplug.spotless.glue.java.GoogleJavaFormatFormatterFunc.apply(GoogleJavaFormatFormatterFunc.java:65)\r\n        at com.diffplug.spotless.FormatterFunc.apply(FormatterFunc.java:32)\r\n        at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:82)\r\n        at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:103)\r\n        at com.diffplug.spotless.Formatter.compute(Formatter.java:246)\r\n        at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:203)\r\n        at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:190)\r\n        at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:105)\r\n        at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:89)\r\n\u003cgradle stack trace elided>\r\n```","author":{"url":"https://github.com/bmeier-pros","@type":"Person","name":"bmeier-pros"},"datePublished":"2023-10-30T14:20:22Z","url":"https://github.com/google/google-java-format/issues/983"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:18419910-3eb0-4b63-ad3e-cf7a9711bfd0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC980:16DABC:13E88C:1AC3B3:6AFBDDDC
html-safe-nonceb1c98502f5a2dc7b759b804a833758bc68e12a2ae4e92f392f00d09d48d84c41
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTgwOjE2REFCQzoxM0U4OEM6MUFDM0IzOjZBRkJERERDIiwidmlzaXRvcl9pZCI6Ijg5NjQwMTgzNzI2MDE0Mzc2NjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd542d5d7943af5ce244e7bcfe3f8064f7648fd3b37ea235f4d9eaf9edd1cf7cc
hovercard-subject-tagissue:1968491217
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-java-format/983/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c8759eefc1b8528a2bd93faef8f29cf0ed8082fa2520405a7f38994e9fd8d5b9/google/google-java-format/issues/983
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c8759eefc1b8528a2bd93faef8f29cf0ed8082fa2520405a7f38994e9fd8d5b9/google/google-java-format/issues/983
og:image:altVersion 1.18.1 formatter throws an exception when trying to handle code like this: return switch (obj1) { case null -> obj2 == null; case T1 myT1 when obj2 instanceof T1 otherT1 -> myT1.equalsStric...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebmeier-pros
hostnamegithub.com
expected-hostnamegithub.com
None744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec
turbo-cache-controlno-preview
go-importgithub.com/google/google-java-format git https://github.com/google/google-java-format.git
octolytics-dimension-user_id1342004
octolytics-dimension-user_logingoogle
octolytics-dimension-repository_id35448780
octolytics-dimension-repository_nwogoogle/google-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35448780
octolytics-dimension-repository_network_root_nwogoogle/google-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedf859c48a4c8b4c0009c19bb4e82101aacb4b998
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/google/google-java-format/issues/983#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F983
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F983
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=google%2Fgoogle-java-format
Reloadhttps://github.com/google/google-java-format/issues/983
Reloadhttps://github.com/google/google-java-format/issues/983
Reloadhttps://github.com/google/google-java-format/issues/983
googlehttps://github.com/google
google-java-formathttps://github.com/google/google-java-format
Codehttps://github.com/google/google-java-format
Issues84 (84)https://github.com/google/google-java-format/issues
Pull requests35 (35)https://github.com/google/google-java-format/pulls
Actionshttps://github.com/google/google-java-format/actions
Projectshttps://github.com/google/google-java-format/projects
Wikihttps://github.com/google/google-java-format/wiki
Security and qualityhttps://github.com/google/google-java-format/security
Insightshttps://github.com/google/google-java-format/pulse
https://github.com/google/google-java-format
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/983
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/983
Google Java Format fails on complex switch expressions with Java 21https://github.com/google/google-java-format/issues/983#top
Java 21https://github.com/google/google-java-format/issues?q=state%3Aopen%20label%3A%22Java%2021%22
https://github.com/bmeier-pros
bmeier-proshttps://github.com/bmeier-pros
on Oct 30, 2023https://github.com/google/google-java-format/issues/983#issue-1968491217
https://github.com/bmeier-pros
bmeier-proshttps://github.com/bmeier-pros
on Oct 30, 2023https://github.com/google/google-java-format/issues/983#issuecomment-1785326689
#973https://github.com/google/google-java-format/issues/973
#922https://github.com/google/google-java-format/issues/922
cushonhttps://github.com/cushon
Java 21https://github.com/google/google-java-format/issues?q=state%3Aopen%20label%3A%22Java%2021%22
on Dec 7, 2023https://github.com/google/google-java-format/issues/983#event-11187067238
copybara-servicehttps://github.com/apps/copybara-service
on Dec 7, 2023https://github.com/google/google-java-format/issues/983#event-11187628762
Add support for guard clauses in Java 21 switch expressionshttps://github.com/google/google-java-format/commit/23714d0286c51a0a8f0dafe301c94e3f70036004
23714d0https://github.com/google/google-java-format/commit/23714d0286c51a0a8f0dafe301c94e3f70036004
Add support for guard clauses in Java 21 switch expressionshttps://github.com/google/google-java-format/commit/b86c508be5f42e7ed0d55cd1abe2c04d2db66676
b86c508https://github.com/google/google-java-format/commit/b86c508be5f42e7ed0d55cd1abe2c04d2db66676
https://github.com/cushon
cushonhttps://github.com/cushon
on Dec 8, 2023https://github.com/google/google-java-format/issues/983#issuecomment-1847504277
430ba3bhttps://github.com/google/google-java-format/commit/430ba3b0e237b746157a3392663da4b4bb7c733d
b86c508https://github.com/google/google-java-format/commit/b86c508be5f42e7ed0d55cd1abe2c04d2db66676
cushonhttps://github.com/cushon
completedhttps://github.com/google/google-java-format/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 8, 2023https://github.com/google/google-java-format/issues/983#event-11195624146
Sign up for freehttps://github.com/signup?return_to=https://github.com/google/google-java-format/issues/983
Sign in to commenthttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/983
Java 21https://github.com/google/google-java-format/issues?q=state%3Aopen%20label%3A%22Java%2021%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.