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.
Please, fix failing tests org.netbeans.modules.groovy.editor.occurrences.*. http://test4u.cz.oracle.com/job/StableBTD-trunk/lastCompletedBuild/testReport/
Caused by the fix of issue 246573. Needs another fix in ASTUtils.java, or a fix of the tests? Bruno, Jirko, can you fix ASAP, for the fix to be in trunk before the Wednesday branching?
I'll have a look at this and report back tomorrow or sunday. I can't use the link provided but I'll run the tests for the provided package and see whats going on.
Just a bit of evaluation: i think before your change an occurrence of "String" was also found in "import java.lang.String;" but obviously now because it searches only "EQUALS" instead of "ENDS_WITH" the occurrence in the import is not counted. But sorry, i have no idea how to fix it, i have no knowledge of NB languages support.
An update on this issue: It took me a while but it seems I understand the way the occurrences are counted. (thank you Ondrej for the initial evaluation). The tests seem OK, so I'm back to issue 246573. I've noticed that the data that comes from the lexer doesn't seem right for that issue use case. So I'll investigate this further and either (1) attempt to see why the lexer is tokenizing the input incorrectly (we're using an old groovy-all that should be updated) or (2) continue fixing the issue in ASTUtils.java with a more elaborated verification.
Bruno, any estimate on when you could get to this issue? Tomorrow, we would like to Code Freeze NetBeans 8.1 and branch the sources. As per 8.1 Quality Criteria [1] we must reach 5 P1s and 15 P2s maximum. As you can see in the bug dashboard [2] Groovy unfortunately has 1 P1 (out of 7) and 2 P2s (out of 16) currently. [1] http://wiki.netbeans.org/NetBeans_81_Quality_Criteria [2] http://services.netbeans.org/dashboard/web/index.php
Created attachment 156470 [details] Proposed patch: The identifier can be a fully qualified class name such as java.lang.String. This patch fixes the wrong behaviour which Ondrej Vrabec correctly identified: If the identifier is java.lang.String, it should still be seen as a class type. The fix consists in checking whether the identifier is equal to the token text or ending in '.' + token text. This resolves this issue (failing tests) while maintaining the expected behaviour regarding issue 246573.
Regarding comment #1: Would it be possible somehow for me to access the test results so that I can know which tests fail *before* my patches and void this situation in the future? The proposed link doesn't work for me, so I suspect it's internal: http://test4u.cz.oracle.com/job/StableBTD-trunk/lastCompletedBuild/testReport/
Patch integrated as http://hg.netbeans.org/core-main/rev/ff043036f721. Thanks for your contribution Bruno!
Patch integrated to release81 branch as well: http://hg.netbeans.org/releases/rev/14aef598269f
Link is internal. To run groovy unit tests use this: ant -f groovy.editor test
Integrated into 'main-silver', will be available in build *201510020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ff043036f721 User: Jiri Kovalsky <jkovalsky@netbeans.org> Log: If the identifier is java.lang.String, it should still be seen as a class type. The fix takes into account whether the identifier is equal to the token text or ands with '.' + token text. Task #255050 - Failing org.netbeans.modules.groovy.editor.occurrences.* tests