This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 29731 - Implement more compiler error suggestions
Summary: Implement more compiler error suggestions
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 3.x
Hardware: Sun All
: P2 blocker with 1 vote (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-26 00:19 UTC by Torbjorn Norbye
Modified: 2011-09-19 23:44 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2002-12-26 00:19:46 UTC
I'd like to see more compiler-error autofixers.
Here are some ideas:
    -- automatically add cast when it's missing
    -- handle length() vs length vs size() confusion
    -- not thrown exceptions - remove try block?
       (beware of finally() clause)
    -- catch uncaught exceptions - can you add try
block
       or does that require too much refactoring
intelligence?
Comment 1 Torbjorn Norbye 2003-02-17 22:15:49 UTC
length() vs size() confusion is now handled. Whenever you're referring
to an unknown method "length", it checks the target class to see if it
provides a size" method, and if so, offers to use it. And ditto for
"size".
Comment 2 Torbjorn Norbye 2003-03-06 17:36:19 UTC
It also handles casts now. If you have e.g.
   Object o;
   Integer i = o;
it will offer to insert a cast to make this 
   Integer i = (Integer)o;
and similarly if you have
   ArrayList l = (List)o;
it will offer to change the cast to make this
   ArrayList l = (ArrayList)o;
I think it will also handle casting for parameters in function calls;
I noticed an off-by-one error the other day so I should go back and
check that.