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 254682 - "Go to Type" result is different for the same input
Summary: "Go to Type" result is different for the same input
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 8.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 07:45 UTC by stwr
Modified: 2015-08-29 03:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
First 'java.io.' result (34.00 KB, image/png)
2015-08-25 07:45 UTC, stwr
Details
Second 'java.io.' result (86.41 KB, image/png)
2015-08-25 07:46 UTC, stwr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stwr 2015-08-25 07:45:35 UTC
Product Version: NetBeans IDE Dev (Build 201508250002)
Java: 1.8.0_60-ea; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-ea-b25
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)

--Use Case--
1. Open 'Go to Type'
2. Type 'java.io' and lookup the result
3. Add '.' and lookup the result
4. Add anything and remove it afterwards (so text field should contain again 'java.io.' and lookup the result

--Expected Result--
'Go to Type' result is the same for the same input.

--Actual Result--
The result after 3rd step is different (contains less entries) than the result after the 4th step. Please see pictures.
Comment 1 stwr 2015-08-25 07:45:54 UTC
Created attachment 155601 [details]
First 'java.io.' result
Comment 2 stwr 2015-08-25 07:46:08 UTC
Created attachment 155602 [details]
Second 'java.io.' result
Comment 3 Jiri Prox 2015-08-25 10:24:43 UTC
I can reproduce similar behavior. 

When I type java.nio. for the first time the list contains lost of entries which does not match the pattern (as java_awt_AWTKeyStroke_PersistenceDelegate in java.beans.MetaData). 

After adding * (e.g. java.nio.*) all classes from java.nio package are correctly displayed. 

After deleting the * the list still shows the classes from nio package.



I guess issue 254691 may be related
Comment 4 Tomas Zezula 2015-08-27 13:16:05 UTC
yes, the lookup in step 3) and step 4) should be the same.
The expected behavior:

Type 'java.io' and lookup the result -> classes starting with io in package containing "*.java*.*" should be found.

Add '.' and lookup the result
Should return all classes in package structure "*.java*.io*.*"
Comment 5 Tomas Zezula 2015-08-27 13:59:17 UTC
The problem is in the different implementation of the splitting function in the java and jumpto. In the jumpto the ending dot is ignored in java is taken.
Comment 6 Tomas Zezula 2015-08-27 14:32:35 UTC
Fixed jet-main 2bb8f6fc3a9e.
Thanks for the report.

The problem was caused that I wanted to prevent transition from result to <Not Found> in the go to symbol. In the Go To Symbol it's currently impossible (expensive) to find all symbols in given prefix. So I wanted to consume the '.' and still keep the prevous search, for example 'Util' and 'Util.' both searched for 'Util' adding 'Util.t' it searched for 't' in 'Util'. But the code is shared among go to type nad go to symbol. In go to type it's logical to lookup package content for 'java.io.'. So now I rather allowed the transition from result to <Not Found> in Go To Symbol. And I will think how to implement the all symbols for given prefix in some performance effective way.
Comment 7 Quality Engineering 2015-08-29 03:02:59 UTC
Integrated into 'main-silver', will be available in build *201508290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2bb8f6fc3a9e
User: Tomas Zezula <tzezula@netbeans.org>
Log: #254682:"Go to Type" result is different for the same input