4069 JSP: find usages handles declaration context <%! %> incorrectly

I have some JSP files were they declare the same variable
i the declaration context <%! %>. Some of the variables were
static final; others were just static.

I found some strange behaviors when trying to do find usages
and refactorings.

For example, look at the sample case below A.jsp and B.jsp.
They both declare a constant A.


-


A.jsp----


A =

]]>
-


B.jsp----


B =

]]>
-




With A.jsp in editor, if I do a find usages on A_jsp:A, it
will show both usages in A and B.

As far as I know this is wrong; The A_Jsp:A is separate from
the B_Jsp:A variable. If you lookat the java code generated by
the JSP compiler you will have two classes A_jsp.java and B_jsp.java.


public class A_jsp extends HttpJspBase {
public static final int A = 0;
...
}

Because the Find Usages is wrong, many other IDEA fuctions also fail.
The main area where I am having a problem is when I tried to rename some
of these variables. If I renamed A_jsp:A, it would rename the references
to A in the B.jsp file even though those refer to B_jsp:A.

Likewise, if I try to do a safe delete on A_jsp:A after removing the only
reference in A.jsp, it will stay say there are references in B.jsp.

The editor seems to understand things correctly because if I delete the
declaration of A i B.jsp, then the reference to A below is highlighted as an
error, which is correct.

So, the main problem seems to be the find usages.

I was going to file a JIRA issue, but wanted to post here first to see
if anyone has run into this.

2 comments

Ok I added the Jira request to the pile. I'll say a prayer tonight that this is fixed sometime during Demetra.

JSP: find usages handles declaration context <%! %> incorrectly
http://www.jetbrains.net/jira/browse/IDEA-6069


BTW the new Jira formatting tags are really nice. I like the

tags.

0

Please sign in to leave a comment.