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
In the following UnusedPrivateMethod considers createListener unused if BytesParser is missing from the classpath. This is because when the target type for a lambda is unresolved (here the target type is BytesParser), we consider that the lambda does not match that type, as it is not a functional interface. I think when the target type is unresolved then we should assume it could be a functional interface that matches, and not fail the inference outright. This would allow createListener to resolve properly to its overload, even if eg the lambda parameter bytes would have an unknown type.
I encountered such an interesting situation: try check file BadClass.java
In the following UnusedPrivateMethod considers
createListener
unused ifBytesParser
is missing from the classpath. This is because when the target type for a lambda is unresolved (here the target type isBytesParser
), we consider that the lambda does not match that type, as it is not a functional interface. I think when the target type is unresolved then we should assume it could be a functional interface that matches, and not fail the inference outright. This would allowcreateListener
to resolve properly to its overload, even if eg the lambda parameterbytes
would have an unknown type.I encountered such an interesting situation: try check file BadClass.java
OK - no issues, if there is a class BytesParser.java in ClassPath.
As soon as I delete the class BytesParser.java (argument type) that
UnusedPrivateMethod
is triggered.Removing the second class BytesListener.java (method return type) does not trigger the issue t
UnusedPrivateMethod
.Why is it important for a static analyzer to have a neighbor class?
Originally posted by @deripas in #5184 (comment)
The text was updated successfully, but these errors were encountered: