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 142439 - Problem with parentheses when editing Java in a JSP
Summary: Problem with parentheses when editing Java in a JSP
Status: RESOLVED INCOMPLETE
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-31 17:04 UTC by mbarnes
Modified: 2009-11-05 13:00 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 mbarnes 2008-07-31 17:04:33 UTC
Product Version: NetBeans IDE 6.1 (Build 200807020101)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

I am editing Java code in a JSP, and there is a bug that's driving me nuts.
I just can't take it anymore, so I'm reporting it.

When I am entering a Java method call, and I get to the point where I click
the '(' key, nothing happens!  I have to click it a second time.  If I forget
to do this, and continue on to the closing ')', it gets entered, without the
opening '('.  If I go back to enter the opening '(', both the '(' and the ')'
get added, so now I have "())".

Very easy to reproduce.  It happens every time!

If I didn't have to switch between JSP and Java all the time, I could almost
live with this.  The Java editor outside JSP doesn't have this problem.  So
I cannot just always double-click the '('.  Of course, I have to edit Java
and JSP outside the IDE from time to time...

Please, please can I get a fix for this?

Thanks.
Comment 1 Tomasz Slota 2008-08-18 10:33:24 UTC
>When I am entering a Java method call, and I get to the point where I click the '(' key, nothing happens!

I am not able to reproduce this step, can you please provide a specific example of code where it happens? Thanks
Comment 2 mbarnes 2008-08-18 17:50:19 UTC
1) Create a new empty file, and call it x.jsp
2) In this file, type the keys: '<' '%' and <cr>
3) Now back up and clean up the mess that auto-completion made,
   and make the file look exactly like this (three lines):
<%

%>
4) Place your cursor on the blank line, then QUICKLY type these keys exactly:
System.currentTimeMillis(
5) When I do this, each and every time, the '(' key does nothing except make the
auto-completion window disappear.
6) If I delay a bit, then press the '(' a second time, I get "()" and the text-entry
   point  is between the two parentheses.
Comment 3 mbarnes 2008-09-10 22:22:18 UTC
Confirming that this is still an issue with 6.5 beta.
Comment 4 Tomasz Slota 2008-10-09 12:54:37 UTC
I am definitely not able to reproduce it on my machine. If you are a Sun employee based in Prague and you can still reproduce it please contact me or 
somebody from the core editor team in person.
Comment 5 mbarnes 2008-10-09 15:16:54 UTC
Really?  Very Strange!

I can reproduce this readily, each and every time, using either NB 6.0.1 or 6.5 Beta
on both Kubuntu Linux and on Windows XP.

In the steps to reproduce below, in step 4, as you are typing "System.currentTimeMillis(",
you DON'T see the auto-completion pop-up follow along with your cursor from the time you
type the '.' until the time you type the '(' ???

I see a pop-up that contains the following list:
  abstract
  class
  enum
  final
  import
  interface
  package
  public

If I actually select anything from that pop-up, the pop-up disappears,
but nothing else happens.


1) Create a new Empty File, and call it x.jsp

2) In this file, type these keys: '<' '%' and <cr>

When you type the <cr>, the following is the result:
<%@ include  %>
This mess is itself a bug, which I've reported in a separate Issue.

3) Now back up and clean up the mess that auto-completion made,
and make the file look exactly like this (three lines):
<%

%>

4) Place your cursor on the blank line, then type these keys exactly:
System.currentTimeMillis(

5) When I do this, each and every time, the '(' key does nothing
except make the auto-completion window disappear.

6) If I delay a bit, then press the '(' a second time, I get
"()" and the text-entry point is between the two parentheses.
Comment 6 David Konecny 2009-02-09 01:16:54 UTC
FYI, I tried to reproduce but without any success. The empty was created into Web Pages folder of a web app project.
Typing <% shows code completion and pressing enter does not generate anything. For currentTimeMillis I was getting
closing bracket after typing opening one.

  Product Version         = NetBeans IDE Dev (Build 090209)
  Operating System        = Linux version 2.6.24-23-generic running on i386
  Java; VM; Vendor        = 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23; Sun Microsystems Inc.
Comment 7 Petr Jiricka 2009-11-05 13:00:21 UTC
Same here. Can you please try again with the latest NB 6.8 build? I am using:

Product Version: NetBeans IDE Dev (Build web-main-2003-on-091104)
Java: 1.6.0_15; Java HotSpot(TM) 64-Bit Server VM 14.1-b02-92
System: Mac OS X version 10.5.8 running on x86_64; MacRoman; en_US (nb)