Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331844 - Open Declaration (F3) on "request" identifier in Java code fragments is being handled incorrectly
Summary: Open Declaration (F3) on "request" identifier in Java code fragments is being...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: needinfo
: 331843 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-04 10:30 EST by Missing name CLA
Modified: 2011-03-09 17:49 EST (History)
4 users (show)

See Also:


Attachments
A screenshot for the result of F3 key (Open Declaration) (40.75 KB, image/png)
2010-12-06 18:37 EST, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2010-12-04 10:30:53 EST
It opens a file with empty source code in Linux gedit.


-- Configuration Details --
Product: Eclipse 1.2.0.20090619-0620 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.5.1.r351_v20090810-0600-7r88FEoFI0WTo6Az-1qFRHm37ChJ
Comment 1 Nitin Dahyabhai CLA 2010-12-06 09:20:02 EST
I think we need more information about this as it routinely works, as well as confirmation that it affects the 2010 release.  In general we're not fixing bugs in 2009 releases.

Can it be reproduced with Helios SR1?  Is it specific to the Web Page Editor or does it also happen with the Java Editor?  What *should* happen instead of what's observed?
Comment 2 Missing name CLA 2010-12-06 18:37:09 EST
Created attachment 184676 [details]
A screenshot for the result of F3 key (Open Declaration)
Comment 3 Missing name CLA 2010-12-06 18:56:29 EST
The bug is reproduced with Helios SR1, see the "screenshot1*" attached for the result of the F3 key press on "request" identifier in index.jsp in the root of the webapp. Example index.jsp has content 

<% request.getScheme(); out.println(); %>

If we have a regular .java file in a method with a formal parameter "HttpServletRequest request", and with a mention "request" of this formal parameter, on F3, the Java editor moves the caret to a formal parameter declaration (i.e. to the "request" instance in a method header).

What the JSP editor should do, I don't know. But displaying an *empty* source .java file in OS default plaintext edit is definitely *not* a declaration for the request formal parameter. So this is a bug.

Ultimately, it *may* compile the JSP with some JSP compiler (or with target JSP servlet container JSP compiler), and show the formal parameter declaration there. But that sounds terrible. I don't propose implementing this---maybe just disabling F3 (Open Declaration) is better than implementing the full-fledged way... You please decide.
Comment 4 Missing name CLA 2010-12-06 19:04:17 EST
*** Bug 331843 has been marked as a duplicate of this bug. ***
Comment 5 Missing name CLA 2010-12-06 19:09:10 EST
- Exactly what *is* observed?

- When we have index.jsp with content

<% request.getScheme(); out.println(); %>

and position the caret inside "request" or "out" identifiers, and press F3 (Open Declaration), then Eclipse opens gedit (in Ubintu Linux) with some non-existing .java file located in our Eclipse project. See the screenshot to see this .java file name. That's incorrect.
Comment 6 Nick Sandonato CLA 2011-03-09 17:49:52 EST
This occurs because it is a local variable within the translated source. If you click on out() or getScheme() instead, you'll be taken to their declarations in their respective classes. Changes checked in so the hyperlink doesn't work if it were to take you to the translation of the JSP.