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 86667 - error in Java 5 code: capture of ?
Summary: error in Java 5 code: capture of ?
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-06 12:24 UTC by saxena_ashes
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 saxena_ashes 2006-10-06 12:24:20 UTC
Netbeans5.0 does not allow an object of a class with a wildcard parameter to be
instance-checked with a subclass that does not take parameters. For example, in
a code like this:

58	public void testingGenerics(ParentClass<?> transaction) {
59	    boolean test = transaction instanceof SubClass;
60	}

The class SubClass is defined as:

	class SubClass extends ParentClass<SomeOtherClass> {
	    ...
	    ...
	}

The line containing the instanceof check is shown in red, neither does Netbeans
allow the compiler to build it. An 'inconvertible types' error results. Here is
the compacted stack trace.

TestFile.java: 59
found   : ParentClass<capture of ?>
required: SubClass
1 error.
Comment 1 Jan Lahoda 2007-03-21 21:49:12 UTC
Seems like this problem in javac:
http://forum.java.sun.com/thread.jspa?forumID=316&threadID=654170

The problem should be fixed in JDK1.5u8 and JDK1.6.

The error is no longer shown in the editor in NetBeans 6.0, so marking as fixed.

Thanks for the report.