- 
                Notifications
    You must be signed in to change notification settings 
- Fork 900
          fix RemoveUnusedImportsStep leftovers
          #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
base: master
Are you sure you want to change the base?
  
    fix RemoveUnusedImportsStep leftovers
  
  #1262
              Conversation
| 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. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP
        
          
                core/src/test/java/com/google/googlejavaformat/java/RemoveUnusedImportsTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                core/src/test/java/com/google/googlejavaformat/java/RemoveUnusedImportsTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      33f45fd    to
    91080e2      
    Compare
  
    91080e2    to
    05caad3      
    Compare
  
            
          
                core/src/test/java/com/google/googlejavaformat/java/RemoveUnusedImportsTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                core/src/test/java/com/google/googlejavaformat/java/RemoveUnusedImportsTest.java
          
            Show resolved
            Hide resolved
        
      | @Pankraz76 | 
RemoveUnusedImportsStepRemoveUnusedImportsStep leftovers
      05caad3    to
    cf8220e      
    Compare
  
    | import org.junit.runners.JUnit4; | ||
|  | ||
| import java.util.List; | ||
|  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be an issue now imposed by the new fixes done by me.
cf8220e    to
    8e6d995      
    Compare
  
    | "import $1" + sep + sep); | ||
|  | ||
| // Remove multiple blank lines elsewhere in imports section | ||
| s = s.replaceAll("(?m)^import .+" + sep + "\\s+" + sep + "(?=import)", "import $1" + sep); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items:
so the formatter test failing on the previous version is fixed now, but still failing other tests as well.
At least only related to the class, except of the IndexOutOfBounds.
[ERROR] Failures: 
[ERROR]   RemoveUnusedImportsTest.removeUnused:577 value of:
    removeUnusedImports(...)
diff (-expected +actual):
    @@ -1,5 +1,4 @@
     package p;
    -import java.lang.Foo;
     import java.lang.Foo.Bar;
     import p.Baz;
     import p.Baz.Bork;
[ERROR]   RemoveUnusedImportsTest.removeUnused:577 value of:
    removeUnusedImports(...)
expected:
    …pkg.Constants.FOO;
    
    public class Test …
but was:
    …pkg.Constants.FOO;
    
    
    public class Test …
[ERROR]   RemoveUnusedImportsTest.removeUnused:577 value of:
    removeUnusedImports(...)
expected:
    class Test {
      java.…
but was:
    
    class Test {
      java.…
[ERROR] Errors: 
[ERROR]   MainTest.optimizeImportsDoesNotLeaveEmptyLines:246 » IndexOutOfBounds No group...
[INFO] 
[ERROR] Tests run: 1580, Failures: 3, Errors: 1, Skipped: 0
8e6d995    to
    87ae466      
    Compare
  
    87ae466    to
    e6c2323      
    Compare
  
    | can not fix remaining tests, ether disable or fix. Kindly request some feedback. Thanks. | 
fix #1261
@iddeepak kindly request your eyes on this.