File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed 
plugin-maven/src/test/java/com/diffplug/spotless/maven/java 
testlib/src/main/resources/java/removeunusedimports Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -30,4 +30,14 @@ void testRemoveUnusedImports() throws Exception {
3030		mavenRunner ().withArguments ("spotless:apply" ).runNoError ();
3131		assertFile (path ).sameAsResource ("java/removeunusedimports/JavaCodeWithPackageFormatted.test" );
3232	}
33+ 
34+ 	@ Test 
35+ 	void  testIssue2532 () throws  Exception  {
36+ 		writePomWithJavaSteps ("<removeUnusedImports/>" );
37+ 
38+ 		String  path  = "src/main/java/test.java" ;
39+ 		setFile (path ).toResource ("java/removeunusedimports/Issue2532Pre.test" );
40+ 		mavenRunner ().withArguments ("spotless:apply" ).runNoError ();
41+ 		assertFile (path ).sameAsResource ("java/removeunusedimports/Issue2532Post.test" );
42+ 	}
3343}
Original file line number Diff line number Diff line change 1+ package hello.world;
2+ 
3+ import mylib.UsedB;
4+ import mylib.UsedA;
5+ 
6+ public class Java {
7+ public static void main(String[] args) {
8+ System.out.println("hello");
9+ UsedB.someMethod();
10+ UsedA.someMethod();
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ package hello.world;
2+ 
3+ import mylib.UsedB;
4+ import mylib.UsedA;
5+ 
6+ public class Java {
7+ public static void main(String[] args) {
8+ System.out.println("hello");
9+ UsedB.someMethod();
10+ UsedA.someMethod();
11+ }
12+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments