eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
36 stars 86 forks source link

Update InlineTempRefactoring logic to properly add method type parameters when needed #1573

Closed jjohnstn closed 1 month ago

jjohnstn commented 1 month ago

When JDT moved to Java 1.8 minimum, some tests that were Java 1.7 or lower started failing. One such failure was due to a flag no longer being set post 1.7. This failure for InlineTempTests.test31 was due to the flag, but once the flag was restored, the logic in InlineTempRefactoring cannot just blindly rely on the flag as sometimes type parameters are needed and sometimes they are not.

The fix will add logic to mark where type parameters might be needed and then leave them out. In checkFinalConditions(), there is a recompile of the changed file to see if any new problems are introduced. If they are at the spots we have recorded, we can mark this and redo the change with the type parameters added where noted.