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 258311 - Disjunctive exception catch code formatting rule
Summary: Disjunctive exception catch code formatting rule
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-10 16:04 UTC by aosamai
Modified: 2016-08-27 02:18 UTC (History)
1 user (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 aosamai 2016-03-10 16:04:05 UTC

    
Comment 1 aosamai 2016-03-10 16:05:30 UTC
Hi guys, while implementing google PMD checkstyle rules, we need to make sure that logical operators in disjunctive catch types always appear in new line.

So the required format is like so

try {
     //some code
} catch (ParseErrorException 
         | MethodInvocationException 
         | ResourceNotFoundException exception) {
    //some code
}

Currently there is no option to configure this in the netbeans editor

Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b18
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 2 Jiri Prox 2016-04-06 13:53:36 UTC
set Disjunctive Catch Types to Always in Options -> Editor -> Formatting -> Java -> Wrapping.

The only difference is that '|' is left on the end of line
Comment 3 aosamai 2016-04-06 14:09:28 UTC
Correct JIRI and this is preventing us from implementing google check style in netbeans
Comment 4 Dusan Balek 2016-08-25 08:19:31 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/45db361b5a2b
Comment 5 Quality Engineering 2016-08-27 02:18:45 UTC
Integrated into 'main-silver', will be available in build *201608270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/45db361b5a2b
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #258311 - Disjunctive exception catch code formatting rule - fixed.