Title: Error formatting switch blocks with arrow labels · Issue #507 · google/google-java-format · GitHub
Open Graph Title: Error formatting switch blocks with arrow labels · Issue #507 · google/google-java-format
X Title: Error formatting switch blocks with arrow labels · Issue #507 · google/google-java-format
Description: GJF gives the following error when formatting a file containing a switch statement using Java 14 arrow labels (case ... ->): error: expected token: 'case'; generated ; instead For example: public class App { public void test(String subje...
Open Graph Description: GJF gives the following error when formatting a file containing a switch statement using Java 14 arrow labels (case ... ->): error: expected token: 'case'; generated ; instead For example: public c...
X Description: GJF gives the following error when formatting a file containing a switch statement using Java 14 arrow labels (case ... ->): error: expected token: 'case'; generated ; instead For exampl...
Opengraph URL: https://github.com/google/google-java-format/issues/507
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error formatting switch blocks with arrow labels","articleBody":"GJF gives the following error when formatting a file containing a switch statement using Java 14 arrow labels (`case ... ->`):\r\n\r\n```\r\nerror: expected token: 'case'; generated ; instead\r\n```\r\n\r\nFor example:\r\n\r\n```java\r\npublic class App {\r\n\r\n public void test(String subject) {\r\n switch (subject) {\r\n case \"A\" -> System.out.println(\"A\");\r\n case \"B\" -> System.out.println(\"B\");\r\n }\r\n }\r\n}\r\n```\r\n\r\nGJF version: `google-java-format-1.8-all-deps.jar`\r\nJava version:\r\n```\r\nopenjdk version \"14.0.1\" 2020-04-14\r\nOpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7)\r\nOpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.1+7, mixed mode, sharing)\r\n```","author":{"url":"https://github.com/skirkpatrick","@type":"Person","name":"skirkpatrick"},"datePublished":"2020-07-15T18:07:06Z","url":"https://github.com/google/google-java-format/issues/507"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:443dd968-291f-cadb-866f-f1c98acf1891 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A684:76282:9F8CCE:DBCD1A:6AFBDA42 |
| html-safe-nonce | 4e25e0540ca7a57b00079fa4c49c6dca2072f5b1b296b974acada75b403339b8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjg0Ojc2MjgyOjlGOENDRTpEQkNEMUE6NkFGQkRBNDIiLCJ2aXNpdG9yX2lkIjoiNzc5NjEyNDg2MTEwODgzNjkzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c697cfb7964536a1b478c677dfbfa618cd457c6640762a95a685fff36759561e |
| hovercard-subject-tag | issue:657549835 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-java-format/507/issue_layout |
| twitter:image | https://opengraph.githubassets.com/33397eb2e52922d82471dbd51d31e45c6d19c424b3a3a1e6f6d59c38c9d58f13/google/google-java-format/issues/507 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/33397eb2e52922d82471dbd51d31e45c6d19c424b3a3a1e6f6d59c38c9d58f13/google/google-java-format/issues/507 |
| og:image:alt | GJF gives the following error when formatting a file containing a switch statement using Java 14 arrow labels (case ... ->): error: expected token: 'case'; generated ; instead For example: public c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirkpatrick |
| hostname | github.com |
| expected-hostname | github.com |
| None | 18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/google-java-format git https://github.com/google/google-java-format.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 35448780 |
| octolytics-dimension-repository_nwo | google/google-java-format |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35448780 |
| octolytics-dimension-repository_network_root_nwo | google/google-java-format |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 820be804f18e1ef3940bd74a00d41d73d02e2b91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width