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 185426 - EL function code completion doesn't respect writen prefix
Summary: EL function code completion doesn't respect writen prefix
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 normal (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-04 11:30 UTC by Jindrich Sedek
Modified: 2010-05-10 09:13 UTC (History)
2 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 2010-05-04 11:30:54 UTC
Create new JSP application
import functions JSTL taglib: 
<%@taglib prefix="f" uri="http://java.sun.com/jsp/jstl/functions" %>
use this code and invoke cc at position of "|"
${f:|}

select some item on the list and complete code
result:
${f:f:contains()}
'f:' should not be completed twice
Comment 1 Tomasz Slota 2010-05-04 14:42:04 UTC
reproducible, confirmed P2
Comment 2 Tomasz Slota 2010-05-05 10:03:49 UTC
I have a fix but I've discovered another, related problem: there is no CC if the function name is partially completed, e.g.:

${f:cont|} is not expanded to ${f:contains()}. I will try fix both issues at the same time
Comment 3 Tomasz Slota 2010-05-07 15:51:30 UTC
It looks like all these issues are caused by the wrong calculation of ELExpretion.getReplace() - it should include the function prefix, but it doesn't. 

There is quite a bit magic in ELExpretion.getReplace() calculation, still going through it...
Comment 4 Marek Fukala 2010-05-07 19:31:44 UTC
That's likely my regression from last year's changes to the ELExpression...
Comment 5 Marek Fukala 2010-05-07 20:24:23 UTC
I'm not sure how old is the bug and who caused it, but I've fixed it anyway. Since the existing code is extremely unreadable, fragile and untested, I added a separate branch of code which covers only the described cases and delegates to the original mess if its not its context.

I've added a unit test which covers this particular cases and tested the other cases slightly.

Tomasz, please verify my changes please!

fixed in web-main#fcb36f93049f

And I have to repeat myself again and again, the whole EL area deserves brand new code.
Comment 6 Marek Fukala 2010-05-07 20:30:29 UTC
And I'm sorry Tomasz for wasting you time in the evaluation... you can now use the knowledge of the magic code in the fix review ;-)
Comment 7 Tomasz Slota 2010-05-10 08:30:43 UTC
I was afraid a major rewrite was necessary, but thought it was probably my mistake not to see a simple fix. Thanks for taking action on this!
Comment 8 Quality Engineering 2010-05-10 09:13:14 UTC
Integrated into 'main-golden', will be available in build *201005100200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log: