Title: Exception formatting switch expressions · Issue #477 · google/google-java-format · GitHub
Open Graph Title: Exception formatting switch expressions · Issue #477 · google/google-java-format
X Title: Exception formatting switch expressions · Issue #477 · google/google-java-format
Description: Formatting this code: public class A { public static String foo(int in) { return switch (in) { case 1 -> "A"; case 2 -> "B"; default -> throw new IllegalStateException("Unknown input " + in); }; } } Produces this exception: https://paste...
Open Graph Description: Formatting this code: public class A { public static String foo(int in) { return switch (in) { case 1 -> "A"; case 2 -> "B"; default -> throw new IllegalStateException("Unknown input " + in); }; } ...
X Description: Formatting this code: public class A { public static String foo(int in) { return switch (in) { case 1 -> "A"; case 2 -> "B"; default -> throw new IllegalStateException(...
Opengraph URL: https://github.com/google/google-java-format/issues/477
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exception formatting switch expressions","articleBody":"Formatting this code:\r\n```java\r\npublic class A {\r\n\r\n public static String foo(int in) {\r\n return switch (in) {\r\n case 1 -> \"A\";\r\n case 2 -> \"B\";\r\n default -> throw new IllegalStateException(\"Unknown input \" + in);\r\n };\r\n }\r\n}\r\n```\r\nProduces this exception: https://pastebin.com/yQ1kt8mh\r\n\r\nFormatting this code:\r\n```java\r\npublic class A {\r\n\r\n public static String foo(int in) {\r\n return switch (in) {\r\n case 1 -> \"A\";\r\n case 2 -> \"B\";\r\n default -> \"C\";\r\n };\r\n }\r\n}\r\n```\r\nProduces this exception: https://pastebin.com/SEC77wYT\r\n\r\nI am using version `1.8` through spotless java version `3.29.0` (latest) and running on JDK 14.","author":{"url":"https://github.com/Octogonapus","@type":"Person","name":"Octogonapus"},"datePublished":"2020-05-09T16:24:35Z","url":"https://github.com/google/google-java-format/issues/477"}
| 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:b3440a52-dad1-040d-8662-29fa00a9d6e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 994C:20E5B9:7B72C9:A4A662:6AFBD051 |
| html-safe-nonce | 36a353ffa1f5ab446ac28a0cf7295398ccba68951cb26f25de0572c800b36702 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTRDOjIwRTVCOTo3QjcyQzk6QTRBNjYyOjZBRkJEMDUxIiwidmlzaXRvcl9pZCI6IjMzMDA5MDAzMTY4ODYzMjMyODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bee5e694b5ebb584705e6fe78c4aa32342f33822bacc9048facaa4bc0cc60ce5 |
| hovercard-subject-tag | issue:615211288 |
| 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/477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2e06879ef614d7e7f646659e2b2da8bf8bc8165a57d92173ddc84b5e4fae66af/google/google-java-format/issues/477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2e06879ef614d7e7f646659e2b2da8bf8bc8165a57d92173ddc84b5e4fae66af/google/google-java-format/issues/477 |
| og:image:alt | Formatting this code: public class A { public static String foo(int in) { return switch (in) { case 1 -> "A"; case 2 -> "B"; default -> throw new IllegalStateException("Unknown input " + in); }; } ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Octogonapus |
| 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