| Summary: | [inline][1.7] Inline should not be available for variables used in the resource specification of try-with-resources | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> |
| Component: | UI | Assignee: | Deepak Azad <deepakazad> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | daniel_megert, deepakazad, raksha.vasisht |
| Version: | 3.7 | ||
| Target Milestone: | 3.7.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fix is part of the patch in bug 352445 comment 4. Verified for Juno M1 with 4.2 build I20110729-0200. |
BETA_JAVA7 class Test{ public static void main(String[] args) throws IOException { try (FileInputStream fis = new FileInputStream("")) { FileInputStream fis2 = fis; } } } right click on fis> refactor> Inline.. You get class Test{ public static void main(String[] args) throws IOException { try (FileInputStream) { FileInputStream fis2 = new FileInputStream(""); } } } (My use case was: try (FileInputStream fis = new FileInputStream(""); FileInputStream fis2 = fis) { ... } and i was only using fis2 in the the try block, so thought of inlining fis)