Skip to content

blindspot on RemoveUnusedImportsStep #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Jun 26, 2025

fix #1261

@iddeepak kindly request your eyes on this.

  • execute and debug some test locally on IDE?
  • maybe work this out?
    • tc exposed some issues
[ERROR] Failures: 
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
expected:
    interface Test { private static void foo() {} }
    
    
but was:
    import java.lang.Foo;
    interface Test { private static void foo() {} }
    
    
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
expected:
    …pkg.Constants.FOO;
    
    public class Test …
but was:
    …pkg.Constants.FOO;
    
    
    public class Test …
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
diff (-expected +actual):
    @@ -1,3 +1,4 @@
    +import static java.util.Collections.*;
     import static java.util.Collections.emptyList;
     
     class Test {
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
expected:
    class Test {
      java.…
but was:
    
    class Test {
      java.…
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
diff (-expected +actual):
    @@ -1,3 +1,4 @@
    +import static java.lang.Math.*;
     import static java.lang.Math.PI;
     
     class Test {
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
expected:
    // This is a comment mentioning ArrayList
    class Test {}
    
    
but was:
    
    // This is a comment mentioning ArrayList
    class Test {}
    
    
[ERROR]   RemoveUnusedImportsTest.removeUnused:485 value of:
    removeUnusedImports(...)
diff (-expected +actual):
    @@ -1,5 +1,6 @@
     package com.foo;
     import static com.foo.Outer.A;
    +import com.foo.*;
     import com.foo.B;
     import com.bar.C;
     class Test {
[INFO] 
[ERROR] Tests run: 1580, Failures: 7, Errors: 0, Skipped: 0

Copy link

google-cla bot commented Jun 26, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Author

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIP

s
},
{
s1,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item:
java: exporting a package from system module jdk.compiler is not allowed with --release

unable to run in ide, therefore unable to debug:

feel free to take over, thx.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, same here individually not able to run

s
},
{
s1,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item:
java: exporting a package from system module jdk.compiler is not allowed with --release

unable to run in ide, therefore unable to debug:

feel free to take over, thx.

image

@Pankraz76 Pankraz76 force-pushed the fix-fix-blindspot-on-`RemoveUnusedImportsStep` branch 3 times, most recently from 33f45fd to 91080e2 Compare June 26, 2025 12:42
@Pankraz76 Pankraz76 marked this pull request as ready for review June 26, 2025 12:42
@Pankraz76 Pankraz76 force-pushed the fix-fix-blindspot-on-`RemoveUnusedImportsStep` branch from 91080e2 to 05caad3 Compare June 26, 2025 12:43
},
{
"""
import java.lang.Deprecated;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java.lang.Deprecated is in the implicitly imported package.
https://www.jetbrains.com/help/inspectopedia/JavaLangImport.html

{
"""
package p;
import java.lang.Foo;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you writes java.lang.Foo fully qualified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blindspot on RemoveUnusedImportsStep
2 participants