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.
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.
Sorry, but the Java language requires the second parameter of the instanceof operator to be a reference type, e.g. "String" or "java.util.List" (JSL 15.20.2). The second parameter cannot be an expression. Please see java.lang.Class.isAssignable.