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 255050 - Failing org.netbeans.modules.groovy.editor.occurrences.* tests
Summary: Failing org.netbeans.modules.groovy.editor.occurrences.* tests
Status: VERIFIED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P1 normal (vote)
Assignee: bruno.flavio
URL:
Keywords: 81_HR_FIX, TEST
Depends on:
Blocks:
 
Reported: 2015-09-07 07:33 UTC by Jiri Skrivanek
Modified: 2015-10-09 10:13 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch: The identifier can be a fully qualified class name such as java.lang.String. (1.53 KB, patch)
2015-09-29 22:07 UTC, bruno.flavio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2015-09-07 07:33:14 UTC
Please, fix failing tests org.netbeans.modules.groovy.editor.occurrences.*.

http://test4u.cz.oracle.com/job/StableBTD-trunk/lastCompletedBuild/testReport/
Comment 1 Antonin Nebuzelsky 2015-09-25 15:06:16 UTC
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?
Comment 2 bruno.flavio 2015-09-25 19:43:00 UTC
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.
Comment 3 Ondrej Vrabec 2015-09-25 19:49:11 UTC
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.
Comment 4 bruno.flavio 2015-09-27 22:25:02 UTC
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.
Comment 5 Jiri Kovalsky 2015-09-29 19:02:40 UTC
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
Comment 6 bruno.flavio 2015-09-29 22:07:34 UTC
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.
Comment 7 bruno.flavio 2015-09-29 22:13:49 UTC
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/
Comment 8 Jiri Kovalsky 2015-09-30 11:54:26 UTC
Patch integrated as http://hg.netbeans.org/core-main/rev/ff043036f721. Thanks for your contribution Bruno!
Comment 9 Jiri Kovalsky 2015-10-01 06:10:21 UTC
Patch integrated to release81 branch as well: http://hg.netbeans.org/releases/rev/14aef598269f
Comment 10 Jiri Skrivanek 2015-10-01 07:29:00 UTC
Link is internal. To run groovy unit tests use this:

ant -f groovy.editor test
Comment 11 Quality Engineering 2015-10-02 01:37:13 UTC
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