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 91533 - inline error reporting incorrectly identifies an inconvertible type
Summary: inline error reporting incorrectly identifies an inconvertible type
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-24 16:34 UTC by lsanders
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lsanders 2006-12-24 16:34:39 UTC
The following program compiles on jdk 1.5 and jdk 1.6 without error (and oddly, 
without an unchecked cast warning), but the netbeans' inline error detection 
reports an "inconvertible types":

import java.util.*;

public class Test extends ArrayList<Object> {
    public <T> ArrayList<T> test(Class<T> clazz) {
        if (clazz == Object.class) {
            // The following return encounters 2 bugs:
            // 1) Netbeans inline error detection improperly identifies it as 
            //    an "inconvertible type", even though it compiles
            // 2) The current 1.5 and 1.6 compilers compile it without giving
            //    an "unchecked cast" warning
            return (ArrayList<T>)this;
            
            // A simple workaround to get the results I expected is to use an
            // intermediate cast, as follows:
            // return (ArrayList<T>)((ArrayList<Object>)this);
        }
        // ... other junk
        return null;
    }
}
Comment 1 Jiri Prox 2007-01-02 08:59:27 UTC
Which build of 5.5 do you use? I've tried it in 5.5fcs and no error annotation
was shown
Comment 2 Jiri Prox 2007-09-12 11:11:20 UTC
No response for a long time -> closing 
If it is still reproducible, please reopen the issue and provide requested information. 
Comment 3 Quality Engineering 2007-09-20 12:05:06 UTC
Reorganization of java component