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 167459 - only java packages are offered by cc in @page import directive
Summary: only java packages are offered by cc in @page import directive
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: Sun Linux
: P2 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords: REGRESSION
: 161358 166389 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-22 13:07 UTC by Jindrich Sedek
Modified: 2009-11-11 09:46 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2009-06-22 13:07:52 UTC
Create new Web Application
Create some public class in some package in the project
use this code in index.jsp and at position of "|" invoke cc:
<%@page import="|" %> 
the package you have just created is not on the list - just java packages appears

while adding some jar on classpath, I can't see such packages on the list neither.
Comment 1 Jindrich Sedek 2009-06-22 13:10:10 UTC
regression against 6.5.1 -> would be good to provide a fix in patch for 6.7
Comment 2 Tomasz Slota 2009-06-24 14:44:17 UTC
There is some major mess in here that was overlooked during migration to CSL :

- the JavaCompletionProvider fails to provide completion results for the "page import", "jsp:useBean", etc. because of wrong implementation of the 
org.netbeans.modules.editor.java.Utilities.isJavaContext() method. The method is based on token ids and some black magic, it ignores the embedding info

- the completion items that appear in the list are created by JavaJspCompletionProvider. This is a zombie class that should be removed after migration to CSL. JavaJspCompletionProvider creates a virtual java file in the memory filesystem. That file does not belong to the project and thus the new infrastructure is not 
able to resolve the correct classpath.

I am reassigning to Dusan for the first step of the fix: changing Utilities.isJavaContext() to use embedding info
Comment 3 Petr Jiricka 2009-07-02 17:56:00 UTC
Dusane, would you be able to do your part soon, so we can consider this for patch 1? Thanks.
Comment 4 Dusan Balek 2009-07-02 19:43:04 UTC
Utilities.isJavaContext() is used to quickly filter out code completion invocations on offsets that are not in Java
"context" (e.g. invocations on offsets within string literals, comments, etc.). It is based on lexer tokens because it
is fast. It's cheaper to find out a (possibly embedded) java token sequence on the given offset than to parse whole file
and find out an embedding info using the Parsing API. My question is: Is it possible to create an embedded java token(s)
inside a JSP token representing "" in <%@page import="|" %> ?

BTW: I have tried to comment out the call to Utilities.isJavaContext() and it seems that there is no embedded
JavaParserResult on the given offset anyway.
Comment 5 Marek Fukala 2009-07-02 20:37:34 UTC
"Is it possible to create an embedded java token(s)
inside a JSP token representing "" in <%@page import="|" %> ?"

Yes, I can create the java embedding lazily for the whole value including the quotations with start/endSkipLen == 1 or
possibly w/o the skip lenghts if neecessary.
Comment 6 Tomasz Slota 2009-08-24 13:30:01 UTC
*** Issue 161358 has been marked as a duplicate of this issue. ***
Comment 7 Tomasz Slota 2009-08-27 15:51:50 UTC
fixed for page/tag import, but still valid for jsp:useBean, page extends, variable variable-class and type attributes.

http://hg.netbeans.org/web-main/rev/542816917d3d
Comment 8 Quality Engineering 2009-08-31 20:27:47 UTC
Integrated into 'main-golden', will be available in build *200908311509* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/542816917d3d
User: Tomasz Slota <tslota@netbeans.org>
Log: #167459: only java packages are offered by cc in @page import directive
Comment 9 Quality Engineering 2009-09-04 03:56:23 UTC
Integrated into 'main-golden', will be available in build *200909032054* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e8eb7ccac070
User: Tomasz Slota <tslota@netbeans.org>
Log: #167459: only java packages are offered by cc in @page import directive - jsp:useBean
Comment 10 Tomasz Slota 2009-09-23 14:28:32 UTC
fixed for 'page import'.

http://hg.netbeans.org/web-main/rev/87b768e919ac

The remaining use cases will be tracked separately as a P3 issue 172886.

Comment 11 Quality Engineering 2009-09-25 09:15:10 UTC
Integrated into 'main-golden', will be available in build *200909241442* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/87b768e919ac
User: Tomasz Slota <tslota@netbeans.org>
Log: #167459: only java packages are offered by cc in @page import directive
Comment 12 Jindrich Sedek 2009-10-20 15:19:41 UTC
v.
NetBeans IDE 6.8 Beta (Build 200910192001)
Comment 13 Tomasz Slota 2009-11-11 09:46:12 UTC
*** Bug 166389 has been marked as a duplicate of this bug. ***