Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347880

Summary: [assist] Expressions should be preferred over types in return statement.
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Srikanth Sankaran CLA 2011-06-01 00:09:32 EDT
BETA_JAVA7 branch : (problem also exists in HEAD, but the example
below is from BETA_JAVA7 branch)

The method org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(MethodBinding, TypeBinding[], Scope, InvocationSite) ends with
a return statement of the form:

// check presence of unchecked argument conversion a posteriori (15.12.2.6)
return methodSubstitute;

Edit this statement and bring it to the form

return meth|

and try ctrl-space in the position marked with |

The first proposal is the type MethodBinding and the second proposal
is methodSubstitute. The second proposal makes way more sense in the
return statement context and its relevance should be boosted enough
to propose it ahead of the type.
Comment 1 Ayushman Jain CLA 2011-06-01 04:23:11 EDT
I'll investigate, time permitting. Though the problem may not be general to return statements, but may be occuring in this specific case.
Comment 2 Eclipse Genie CLA 2020-02-23 13:07:44 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.