apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.63k stars 840 forks source link

ComputeImports: fix package computation. #7363

Closed mbien closed 3 months ago

mbien commented 4 months ago

attempt to fix #7073, #5537, #6902 and https://issues.apache.org/jira/browse/NETBEANS-2814

 // hit ctrl+shift+i, it shouldn't import anything
import java.util.List;
public class FixImports {
    public static class SomeClass2 {
        public static String java(String value) {
            return value;
        }
    }
}
mbien commented 4 months ago

Minimal nitpick: The test sources seem to be missing package declarations.

@matthiasblaesing good that you mentioned this since I misunderstood how the test works. It uses now one test file since all it has to do is to check that the computed candidates are empty.