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: | Netbeans editor shows False errors (red) on Inherited field in Groovy from Java base class | ||
---|---|---|---|
Product: | groovy | Reporter: | aplatypus <aplatypus> |
Component: | Editor | Assignee: | bruno.flavio |
Status: | NEW --- | ||
Severity: | normal | Keywords: | JDK_8, USABILITY |
Priority: | P2 | ||
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
IDE log
Sample project |
Description
aplatypus
2016-09-27 00:55:59 UTC
Created attachment 162226 [details]
IDE log
I tried changing the base classes to be Groovy classes. I thought that might remove the issue. It does NOT. Even when the sub-class class inherits from groovy parents the protected static ... Shows an error in a static void method() Firstly there's a typo in the example classes: * FilterTest extends ServerTesting extends UnitTestingBase And not as shown below (initially), my apologies. For the groovy base classes version, I used: * FilterTest extends ServerBddTesting extends UnitBddTestingBase Unfortunately making the base classes into Groovy classes broke the test. These Log messages below are printed by the (Groovy) base classes. Tracking in the debugger, when the ServerBddTesting.setUpClass() call returns, there's a null pointer exception (as shown below). Whereas when the FilterTest inherits from more or less the *same* classes written in Java all the code runs very happily. At this point I definitely think the Groovy file using Java base classes is an error. It looks like there is an incompatibility with the Groovy language and Java concerning what happens with protected fields/data. One expects a "static protected XXX ..." declared item to be available in static scope for all child-classes in Most OO languages I've used. Is this an anomaly or is that how it is supposed to function? ------------ Testsuite: FilterTest FilterTest DEBUG : Log file configured from: '4ABS/4ABS-testing-log4j.properties'. FilterTest INFO : Unit testing: 4ABS Build: 1.14.0-dev (build: 005--SNAPSHOT ... BugGenie #173, #176) FilterTest INFO : Test label: FilterTest - 1.14.0-dev (build: 005--SNAPSHOT ... BugGenie #173, #176), server-side FilterTest INFO : Test file: FilterTest Testcase: FilterTest: Caused an ERROR Cannot invoke method info() on null object java.lang.NullPointerException: Cannot invoke method info() on null object at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at au.com.fourtel.fourabs.trip.TrainAdvancedFilterTest.setUpClass(TrainAdvancedFilterTest.groovy:43) Reassigning for further evaluation. I have the same problem when trying to use the Moqui (http://www.moqui.org/) project sources in NetBeans. It e.g. has a Groovy class defined as : abstract class EntityFindBase and then a Java class public class EntityFindImpl extends EntityFindBase For details of the implementation, you can see the source code here: https://github.com/moqui/moqui-framework/tree/master/framework/src/main/groovy/org/moqui/impl/entity It's also not possible to jump from the Java class to the Groovy class (using e.g. "Goto Source" or "Goto Declaration") Created attachment 162261 [details]
Sample project
I've created a very simple project which I believe shows the problem stated in this issue. Could you please confirm?
-Bruno
|