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.
Summary: |
instanceof Will Not Allow Comparison to a Method's Return Value |
Product: |
java
|
Reporter: |
cbush06 |
Component: |
Editor | Assignee: |
Dusan Balek <dbalek> |
Status: |
RESOLVED
INVALID
|
|
|
Severity: |
normal
|
|
|
Priority: |
P1
|
|
|
Version: |
7.0 | |
|
Hardware: |
PC | |
|
OS: |
Windows 7 x64 | |
|
Issue Type:
|
DEFECT
|
Exception Reporter:
|
|
Attachments: |
Screenshot of NetBeans syntax error
|
Created attachment 108730 [details] Screenshot of NetBeans syntax error I have a method titled "getSupportedClass()" that returns the Class object representing an object's class (e.g. o.getClass()). I cannot use the method with the instanceof operator. For example: if(anObject instanceof anotherObject.getSupportedClass()) I believe the issue lies in the parser used by netbeans. I even tried having the method return a Type object (although Class objects implement Type). Either way, I receive a syntax error from NetBeans. NetBeans seems to expect only the name of the class instanceof is comparing an object to. I have attached a screenshot with the error to this.