Bug 560928

Summary: [typing] smart insert doesn't handle try-with-resources
Product: [Eclipse Project] JDT Reporter: Julian Honnen <julian.honnen>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.15   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Julian Honnen CLA 2020-03-09 11:03:26 EDT
Both semicolons and braces within try-with-resources are not inserted at the expected position.

Given
	InputStream in = // ...;
	try (Closeable x = in|)

insert semicolon:
	try (Closeable x = in);
expected:
	try (Closeable x = in;)


insert brace:
	try (Closeable x = in{);
expected:
	try (Closeable x = in) {
Comment 1 Julian Honnen CLA 2020-03-24 12:06:02 EDT
Further complication: The smart-insert operates only on the current line. The following would need more context than that.

    try (Closeable x = in;
         Closeable y = out|)


Similarly the existing for loop handling doesn't work with multiple lines:
    for (int i = 0;
         i < 10|)
->
    for (int i = 0; 
         i < 10);
Comment 2 Eclipse Genie CLA 2022-03-16 14:17:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Eclipse Genie CLA 2024-03-07 01:05:39 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.