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 251360 - Assign to new variable using SHIFT-RETURN at Code completion generates incompilable code
Summary: Assign to new variable using SHIFT-RETURN at Code completion generates incomp...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-22 14:19 UTC by markiewb
Modified: 2015-03-27 03:23 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 markiewb 2015-03-22 14:19:13 UTC
Assign to new variable using SHIFT-RETURN at Code completion generates incompilable code, when the return type is a generic.

<code>
CompilationController p=null;
List<? extends TypeElement> topLevelElements = p.getTopLevelElements();
topLevelElements.iterator().n|
</code>

* Invoke code completion at |
* Choose entry "next" and press SHIFT-RETURN

ACTUAL:
<code>
? extends TypeElement next = topLevelElements.iterator().next();
</code>

EXPECTED:
<code>
TypeElement next = topLevelElements.iterator().next();
</code>


BTW: It works, when I apply the assignment hint to topLevelElements.iterator().next();

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Dusan Balek 2015-03-26 16:05:40 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/996beb685943
Comment 2 Quality Engineering 2015-03-27 03:23:55 UTC
Integrated into 'main-silver', will be available in build *201503270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/996beb685943
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #251360: Assign to new variable using SHIFT-RETURN at Code completion generates incompilable code - fixed.