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 268182 - Create variable fix not working for try-with-resources
Summary: Create variable fix not working for try-with-resources
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: Dev
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-24 06:02 UTC by Jan Lahoda
Modified: 2016-09-25 06:09 UTC (History)
0 users

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 Jan Lahoda 2016-09-24 06:02:22 UTC
Consider this code:
---
package pkgtry.test;

import java.io.FileInputStream;

public class TryTest {

    public static void main(String[] args) {
        try (in = new FileInputStream("")) {
            
        }
    }

}
---

There is no fix that would add a type before the "in", to produce something like:
        try (FileInputStream in = new FileInputStream("")) {
Comment 1 Quality Engineering 2016-09-25 01:53:10 UTC
Integrated into 'main-silver', will be available in build *201609250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c6cb9bd4950e
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #268182 - adding Create resource fix for undefined resources in try-with-resources.