You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Scott Palmer <sw...@gmail.com> on 2022/10/28 16:00:22 UTC

Netbeans 16-rc2 Java Editor Bug

I just noticed that there is an issue with NetBeans inserting an extra }
character while editing Java code.

If I type the following:

  if (someCondition) {}

Then I place the cursor between the braces { | } and hit enter, the result
is:

  if (someCondition) {
    |
  }}

(Where | is the cursor location before and after)

Note the extra closing brace.

Scott

Re: Netbeans 16-rc2 Java Editor Bug

Posted by Scott Palmer <sw...@gmail.com>.
Ah.. well it seems this is caused by an incomplete brace in code
that follows, but several lines away.  So I understand what NB is trying to
do, it is just unexpected in the immediate context.

Basically I had a large method that was in the process of being edited and
was missing its final closing brace.   I was adding a condition near the
beginning of the method and observed this happening.
I'm not sure if it is worth doing anything about, though it was irritating
until I realized why it was happening.

Cheers,

SCott

On Fri, Oct 28, 2022 at 12:00 PM Scott Palmer <sw...@gmail.com> wrote:

> I just noticed that there is an issue with NetBeans inserting an extra }
> character while editing Java code.
>
> If I type the following:
>
>   if (someCondition) {}
>
> Then I place the cursor between the braces { | } and hit enter, the result
> is:
>
>   if (someCondition) {
>     |
>   }}
>
> (Where | is the cursor location before and after)
>
> Note the extra closing brace.
>
> Scott
>
>