You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Ben Alex (JIRA)" <ji...@apache.org> on 2019/06/02 01:13:00 UTC
[jira] [Comment Edited] (NETBEANS-236) Incorrect brace spacing in
try-with-resources
[ https://issues.apache.org/jira/browse/NETBEANS-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16853853#comment-16853853 ]
Ben Alex edited comment on NETBEANS-236 at 6/2/19 1:12 AM:
-----------------------------------------------------------
I have been seeing this exact same issue with NetBeans 11.0 (and NetBeans 10.0 before it).
To reproduce:
* Install NetBeans 11.0 (I'm using build 20190407 on Arch Linux)
* Delete any existing ~/.netbeans so you have no prior configuration
* Create a new Java project and class using the defaults
* Enter a simple method like shown below
* Attempt to format
{{ public void test() throws IOException {}}
{{ try(InputStream is = new ByteArrayInputStream(new byte[] {})) {}}
{{ // ...}}
The resulting format will have a space incorrectly inserted before InputStream. This is despite Options > Editor > Formatting > Spaces having no ticks for any "Within Parentheses" options. It is interesting to note the "Alignment" category preview shows the incorrect insertion of spaces, ie:
{{try ( Resource r1 = null;}}
{{ Resource r2 = getResource()) {}}
was (Author: ben.alex):
I have been seeing this exact same issue with NetBeans 11.0 (and NetBeans 10.0 before it).
To reproduce:
* Install NetBeans 11.0 (I'm using build 20190407 on Arch Linux)
* Delete any existing ~/.netbeans so you have no prior configuration
* Create a new Java project and class using the defaults
* Enter a simple method like shown below
* Attempt to format
{{ public void test() throws IOException {}}
{{ try(InputStream is = new ByteArrayInputStream(new byte[] {})) {}}
{{ // ...}}
{{ }}}
{{ }}}
The resulting format will have a space incorrectly inserted before InputStream. This is despite Options > Editor > Formatting > Spaces having no ticks for any "Within Parentheses" options. It is interesting to note the "Alignment" category preview shows the incorrect insertion of spaces, ie:
{{try ( Resource r1 = null;}}
{{ Resource r2 = getResource()) {}}
> Incorrect brace spacing in try-with-resources
> ---------------------------------------------
>
> Key: NETBEANS-236
> URL: https://issues.apache.org/jira/browse/NETBEANS-236
> Project: NetBeans
> Issue Type: Bug
> Components: editor - Formatting & Indentation
> Affects Versions: 8.2
> Environment: build 152
> Reporter: Gili
> Assignee: Gili
> Priority: Major
> Fix For: 9.0
>
>
> Given:
> {{try (Session session = scope.getSession())}}
> Invoking code-format results in:
> {{try ( Session session = scope.getSession())}}
> in spite of the fact that the IDE is configured not to insert a space inside the parenthesis.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists