[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14593: 24.3; java-mode indentation of try-with-resources statement
From: |
Alex |
Subject: |
bug#14593: 24.3; java-mode indentation of try-with-resources statement |
Date: |
Sun, 21 Aug 2016 21:39:41 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Alan Mackenzie <acm@muc.de> writes:
> Hello, Patrick.
>
> On Wed, 12 Jun 2013 00:24:13, Patrick Brinich-Langlois
> <pbrinichlanglois@gmail.com> wrote:
>
>> Java's try-with-resources statement (new in version 1.7) is indented
>> incorrectly in java-mode. Steps to reproduce:
>
>> * Create a new file. Enable java-mode and electric-indent-mode.
>> * Type the following:
>
>> public class Test {
>> public static void main(String[] args) {
>> Path dir = Paths.get(System.getProperty("user.home"));
>> try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
>> System.out.println("test");
>> }
>> }
>> }
>
>> The two lines after the try statement are indented an additional four
>> spaces. The final two closing braces are indented properly.
>
> This is indeed the case.
>
> The following patch should hopefully handle this case properly. After
> applying it, either recompile all the cc-*.el files, or just recompile
> cc-langs.el, cc-engine.el, cc-fonts.el, and cc-mode.el.
>
> Please confirm to me that the patch does indeed fix the bug, or report
> any further problems which aren't fixed. Thanks!
I'm closing this as the patch was applied in
5ab78d3d6a7efcb49d2a9be5b4bdb8eaf78f7a14 and it appears to fix the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#14593: 24.3; java-mode indentation of try-with-resources statement,
Alex <=