Bug 59364 - [syntax highlighting] Highlight recursive calls
Summary: [syntax highlighting] Highlight recursive calls
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-20 19:05 EDT by MG CLA
Modified: 2005-09-02 12:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MG CLA 2004-04-20 19:05:24 EDT
One warning that would be good to have is a recursive call warning.  I made the
mistake of creating a method which called itself but I didn't mean to call
itself I meant to call a different overloaded version of the method.  This
resulted in a runtime stackoverflowerror which unfortunately didn't reveal a
stack trace and was thus quite hard to track down.  

It would be helpful if eclipse would highlight recursive method calls.  They are
quite rare and I think highlighting them in the text and reporting them as a
warning in the summary would help people avoid this situtation.

Thanks!
Comment 1 Philipe Mulet CLA 2004-04-21 07:27:23 EDT
Interesting suggestion. Will consider post 3.0
Comment 2 Adam Kiezun CLA 2005-08-24 18:43:00 EDT
sounds like a case for the proposed INFO severity
Comment 3 Philipe Mulet CLA 2005-08-30 16:01:03 EDT
It feels more like a request for improving semantic colouring in editor than a
true compiler diagnosis. Recursivity is not an coding bad practice, it only
feels like something the editor should render amongst the various aspects it
highlights already (field vs. local var, static vs. non static, etc).

Note that only direct recursion is to be detected here.
Comment 4 Philipe Mulet CLA 2005-08-30 16:01:35 EDT
Passing onto Text for further action.
Comment 5 Dani Megert CLA 2005-08-31 02:43:27 EDT
We have other compiler diagnostics, e.g. 'Unqualified access to instance field'
which are not directly bad coding practice and hence it might well make sense to
have a compiler diagnostic for this one.

Can the bug reporter clarify what he exactly desires.
Comment 6 Philipe Mulet CLA 2005-09-01 07:22:47 EDT
I agree somehow, but at the time, we didn't have semantic colouring. Now we have
it, we can introduce some nuance in how we surface some info to the user.

Note: some consider unqualified field access as bad practice as error prone.
Comment 7 MG CLA 2005-09-01 12:49:05 EDT
I think the most helpful thing would have been just syntax highlighting that
displayed the recursive call in a distinguishable manner from other method calls.

Thanks for considering the request! 
Comment 8 Tom Hofmann CLA 2005-09-01 13:08:53 EDT
I doubt the value of this highlighting given the fact that it could only mark
direct recursion.
Comment 9 Philipe Mulet CLA 2005-09-02 04:31:20 EDT
But this is all the reporter asked I believe.
Comment 10 Tom Hofmann CLA 2005-09-02 04:38:49 EDT
(In reply to comment #9)
> But this is all the reporter asked I believe.

True - it's just that I don't deem this functionality very useful.
Comment 11 MG CLA 2005-09-02 12:25:41 EDT
It is a rare use case because recursion is not used very often but given the
problem I would have avoided had it been highlighted I think it is valuable.  

Anyway, thank you for taking the time to consider the feature!