eclipse-jdtls / eclipse-jdt-core-incubator

Eclipse Public License 2.0
8 stars 1 forks source link

ConvertForLoopOperation cannot work with Javac #748

Closed mickaelistria closed 1 month ago

mickaelistria commented 2 months ago

ConvertForLoopOperation uses the type of .size() method on collections to determine the type. While it's fine with JDT, Javac does not consider the type argument in the .size() method, simply because the method is always the same, so it doesn't make sense to create such separation. The ConvertForLoopOperation could instead of this untyped size method check the type of the expression on which size() is called, and check a type method such as add to find the actual element type.

akurtakov commented 2 months ago

Is this smth for @jjohnstn to look at ?

jjohnstn commented 1 month ago

@mickaelistria Can this be closed now that the JDT patch has been merged?

mickaelistria commented 1 month ago

yes, thanks!