You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same bug as #1652 still occurs when compiling on Windows: Error Prone warns about unnecessary fully qualified imports in package-info.java and recommends imports instead.
Output:
[javac] C:\projects\java-common-lib\src\org\sosy_lab\common\annotations\package-info.java:10: warning: [UnnecessarilyFullyQualified] This fully qualified name is unambiguous to the compiler if imported.
[javac] @com.google.errorprone.annotations.CheckReturnValue
[javac] ^
[javac] (see https://errorprone.info/bugpattern/UnnecessarilyFullyQualified)
[javac] Did you mean '@CheckReturnValue'?
[javac] C:\projects\java-common-lib\src\org\sosy_lab\common\annotations\package-info.java:11: warning: [UnnecessarilyFullyQualified] This fully qualified name is unambiguous to the compiler if imported.
[javac] @javax.annotation.ParametersAreNonnullByDefault
[javac] ^
[javac] (see https://errorprone.info/bugpattern/UnnecessarilyFullyQualified)
[javac] Did you mean '@ParametersAreNonnullByDefault'?
When looking at ea312c9 (the fix for #1652) the problem seems clear: the code in UnnecessarilyFullyQualified.isPackageInfo() of this commit only works if / is used as file-name separator, but in my build \ is used as can be seen from the error message. The code should probably either use File.separatorChar, or allow both / and \, or even better use proper file-name handling methods. Something like name.endsWith("package-info.java") might also be good enough in practice.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Should be possible to reproduce by just using Windows and the same reproducer as in #1652.
What version of Error Prone are you using?
2.5.1
The text was updated successfully, but these errors were encountered:
Description of the problem:
The same bug as #1652 still occurs when compiling on Windows: Error Prone warns about unnecessary fully qualified imports in
package-info.java
and recommends imports instead.Output:
(full log)
When looking at ea312c9 (the fix for #1652) the problem seems clear: the code in
UnnecessarilyFullyQualified.isPackageInfo()
of this commit only works if/
is used as file-name separator, but in my build\
is used as can be seen from the error message. The code should probably either useFile.separatorChar
, or allow both/
and\
, or even better use proper file-name handling methods. Something likename.endsWith("package-info.java")
might also be good enough in practice.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Should be possible to reproduce by just using Windows and the same reproducer as in #1652.
What version of Error Prone are you using?
2.5.1
The text was updated successfully, but these errors were encountered: