| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4b359374-223c-d850-9f9d-6556045f98b3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B9D0:3DE1D3:4EED0:6DF1A:6AFBC697 |
| html-safe-nonce | d12b9aa3fada88f5a427dd135e7903cc2fe8c5ce8af12b665cb7bab5c81d846e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUQwOjNERTFEMzo0RUVEMDo2REYxQTo2QUZCQzY5NyIsInZpc2l0b3JfaWQiOiI0NzIzOTE3NTU3MjMwOTc4NzExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 72996a6538fb53c0f8832c79638791a9da01b8f24ae065ae50fb2a51d92045cb |
| hovercard-subject-tag | pull_request:5082911374 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/openjavaformat/open-java-format/pull/174/files |
| twitter:image | https://avatars.githubusercontent.com/u/214171?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/214171?s=400&v=4 |
| og:image:alt | Fixes #149.
What was wrong
Removing unused imports dropped every import from java.lang, used or not. A single-type import shadows a type with the same simple name declared in the file's own pac... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d440bda0d812801778b27bfe9f7c1ce9ff22420c73f6f95150c4fcbca311c50b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git |
| octolytics-dimension-user_id | 325177626 |
| octolytics-dimension-user_login | openjavaformat |
| octolytics-dimension-repository_id | 1288055459 |
| octolytics-dimension-repository_nwo | openjavaformat/open-java-format |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 214273098 |
| octolytics-dimension-repository_parent_nwo | palantir/palantir-java-format |
| octolytics-dimension-repository_network_root_id | 214273098 |
| octolytics-dimension-repository_network_root_nwo | palantir/palantir-java-format |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2c43021aed8695990c86c0eaaedc600bfeffec36 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/openjavaformat/open-java-format/pull/174/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fpull%2F174%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fpull%2F174%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openjavaformat%2Fopen-java-format |
| Reload | https://github.com/openjavaformat/open-java-format/pull/174/files |
| Reload | https://github.com/openjavaformat/open-java-format/pull/174/files |
| Reload | https://github.com/openjavaformat/open-java-format/pull/174/files |
| openjavaformat | https://github.com/openjavaformat |
| open-java-format | https://github.com/openjavaformat/open-java-format |
| Code | https://github.com/openjavaformat/open-java-format |
| Issues30 (30) | https://github.com/openjavaformat/open-java-format/issues |
| Pull requests5 (5) | https://github.com/openjavaformat/open-java-format/pulls |
| Discussions | https://github.com/openjavaformat/open-java-format/discussions |
| Actions | https://github.com/openjavaformat/open-java-format/actions |
| Security and quality | https://github.com/openjavaformat/open-java-format/security |
| Insights | https://github.com/openjavaformat/open-java-format/pulse |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fopenjavaformat%2Fopen-java-format%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fopenjavaformat%2Fopen-java-format%2Fissues%2Fnew%2Fchoose |
| abashev | https://github.com/abashev |
| 21.X.X | https://github.com/openjavaformat/open-java-format/tree/21.X.X |
| fix/keep-used-java-lang-import | https://github.com/openjavaformat/open-java-format/tree/fix/keep-used-java-lang-import |
|
Conversation
0
| https://github.com/openjavaformat/open-java-format/pull/174 |
|
Commits
2
| https://github.com/openjavaformat/open-java-format/pull/174/commits |
|
Checks
17
| https://github.com/openjavaformat/open-java-format/pull/174/checks |
|
Files changed
| https://github.com/openjavaformat/open-java-format/pull/174/files |
| Please reload this page | https://github.com/openjavaformat/open-java-format/pull/174/files |
|
Keep java.lang imports that disambiguate a simple name
| https://github.com/openjavaformat/open-java-format/pull/174/files#top |
|
Show all changes
2 commits
| https://github.com/openjavaformat/open-java-format/pull/174/files |
|
bff74a0
Keep java.lang imports that disambiguate a simple name
ZayanKhan-12 Sep 15, 2026
| https://github.com/openjavaformat/open-java-format/pull/174/commits/bff74a00cf54e5c45d93ad9ef076e514c82277a1 |
|
e66ee55
Move the tests of unused import removal into case files
abashev Oct 30, 2026
| https://github.com/openjavaformat/open-java-format/pull/174/commits/e66ee55fd7ea0fa67ce20a2711c2ad830e059f71 |
|
Clear filters
| https://github.com/openjavaformat/open-java-format/pull/174/files |
| Please reload this page | https://github.com/openjavaformat/open-java-format/pull/174/files |
| Please reload this page | https://github.com/openjavaformat/open-java-format/pull/174/files |
|
RemoveUnusedImports.java
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-5299716450ca7354169f28803b5295a125ab25fdfbd3257eba438d4ff4f91768 |
|
RemoveUnusedImportsCaseLabelsTest.java
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-3cbe6525ef6fd3ac615c28684a0f928f50cacdc1787afb35c61789a6e430d917 |
|
RemoveUnusedImportsTest.java
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-e560a53ebc61bb106744b2431ebabab2a17823a75d2611eafd5acfd54b25a035 |
|
fullyQualifiedJavadocReferenceNeedsNoImport.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-2cc2f06b6e1668304a987b939f1dae4e802e669d0b08a6675e9c5fe9744f4597 |
|
importOnDemandStays.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-8eed029e3de49495bbbbf28be46694eebd6ce1bc521cf0b8bf49894bf5fb899b |
|
importUsedOnlyByAJavadocLinkStays.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-a99cedc3d4c777ae770fab3bf4f49ca8f995bef0dd85856bd9d22f3c47a34844 |
|
importsFromTheOwnPackageGo.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-6e323d453555c66be8369b09024551d9ba9dd6a290ff653c8167db73a4b2fe63 |
|
importsUsedByJavadocMemberReferencesStay.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-105ee0716ad98579bcf8c69acde326f8c9b2d82bc919b65ad21158300d60b058 |
|
javaLangImportOnDemandGoes.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-3e01e40c70b7218b9a1b36d7c0f5e3d5950ad44f1e906dc0683308b9fe0c6cb4 |
|
javaLangImportUsedByJavadocStays.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-b03d304f612eac2f4fe081bf3a78b6c57085ff2120c36fffb67edd8cd87af4fa |
|
javadocArrayParameterKeepsTheImportOfItsQualifier.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-afed97974659fd3a61386cdd8a7771796c110d4f94269d6c09d72e84abe0ba89 |
|
javadocLinkOnALaterLineKeepsItsImport.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-448a1d12c631534bb17652b003a448365fdebaf2a2ef53d1a8d43a58b6148702 |
|
javadocReferenceToANestedTypeKeepsTheOuterImport.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-202baa2e19a127c929a53fcbc57c3a2ec7d945d697e12cb55f83c5a084970b47 |
|
javadocReferenceToOwnMemberWithoutImports.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-eb8ccb5afc783f52365746ec802159b84daaa299e30e5e6b925fa8629c3c1ad5 |
|
javadocTagsKeepTheirImports.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-5f789ec5ce826b912156164b9ba07c7a7c6824c24127e034c0df757b2b954426 |
|
typesInCaseLabelsKeepTheirImports.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-a8e6f6e9edfb8da0468340a449d894ce8e98d9990b5a7d04d20d2f06822a67d6 |
|
unusedImportGoesFromBesideAUsedOne.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-3a3d96f211e351ed58b7c757d2b1ecee4c86c5561f40780911b457e4e307deb8 |
|
unusedImportsOnTheLineOfAUsedOneGo.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-77197633393559f8d19d6de5364d62c2f0c1901fdb7f3553cab0cf37cb50daec |
|
unusedJavaLangImportGoes.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-802b492d4232b1b0ab1606c23a3b688358d2f41e8514d120b9609c78e21e80cf |
|
unusedJavaLangImportGoesBesideAnImportOnDemand.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-a01b885fee5e9098edd0d7fe19779c43ec3c7c8afee1925e20155c0c7ec45167 |
|
usedJavaLangImportShadowsATypeOfTheOwnPackage.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-3afd197ba1d48cbeaff7e4a3dddb42d394a7e9c8b872af4c07e08e01014ce8ea |
|
usedJavaLangImportShadowsAnImportOnDemand.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-86b71b5b5f7b3722070065d4d4d74adf5c3d5e2218b04446de7dd7ce7c6fa882 |
|
usedJavaLangImportStaysOwnPackageImportGoes.case
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-00fe88d78345347f133235c3983f1eab314220e6b0761a40098208b2411545b0 |
| open-java-format/src/main/java/com/palantir/javaformat/java/RemoveUnusedImports.java | https://github.com/openjavaformat/open-java-format/pull/174/files#diff-5299716450ca7354169f28803b5295a125ab25fdfbd3257eba438d4ff4f91768 |
|
View file
| https://github.com/openjavaformat/open-java-format/blob/e66ee55fd7ea0fa67ce20a2711c2ad830e059f71/open-java-format/src/main/java/com/palantir/javaformat/java/RemoveUnusedImports.java |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/openjavaformat/open-java-format/pull/174/{{ revealButtonHref }} |
|
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-5299716450ca7354169f28803b5295a125ab25fdfbd3257eba438d4ff4f91768 |
|
| https://github.com/openjavaformat/open-java-format/pull/174/files#diff-5299716450ca7354169f28803b5295a125ab25fdfbd3257eba438d4ff4f91768 |
| ...-format/src/test/java/com/palantir/javaformat/java/RemoveUnusedImportsCaseLabelsTest.java | https://github.com/openjavaformat/open-java-format/pull/174/files#diff-3cbe6525ef6fd3ac615c28684a0f928f50cacdc1787afb35c61789a6e430d917 |
|
View file
| https://github.com/openjavaformat/open-java-format/blob/6bcacfc3aee4854dc7ca4799c700bb6f4f3d3ef4/open-java-format/src/test/java/com/palantir/javaformat/java/RemoveUnusedImportsCaseLabelsTest.java |
|
Open in desktop
| https://desktop.github.com |
| Please reload this page | https://github.com/openjavaformat/open-java-format/pull/174/files |
| Please reload this page | https://github.com/openjavaformat/open-java-format/pull/174/files |
| Please reload this page | https://github.com/openjavaformat/open-java-format/pull/174/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |