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 200513 - try-with code completion problem
Summary: try-with code completion problem
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P2 normal with 1 vote (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-29 12:21 UTC by grofzero
Modified: 2011-08-02 13:41 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 grofzero 2011-07-29 12:21:10 UTC
I tried the new Java 1.7 try-with-resources statement in Netbeans 7 with the following sample code:

try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.*")) {
  for (Path entry : stream) {
    System.out.println(entry.getFileName());
  }
}

The code works fine, but autocomplete doesn't work for the 'stream' variable inside the try block!
Comment 1 Jiri Prox 2011-07-29 13:09:31 UTC
reproducible

the 'stream' is not provided among available variables. Getting code completion for content of stream clas (eg stream.<invoke cc here>) works fine.


Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Userdir: C:\Users\jprox\.netbeans\7.0
Comment 2 Dusan Balek 2011-07-29 18:22:31 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/0089c8a554d1
Comment 3 Quality Engineering 2011-08-02 13:41:56 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/0089c8a554d1
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #200513: try-with code completion problem - fixed.