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 252296 - Add CC entries to create new object
Summary: Add CC entries to create new object
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-08 09:58 UTC by cezariusz
Modified: 2015-10-05 11:35 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Aggregate this... (37.59 KB, image/png)
2015-05-08 10:00 UTC, cezariusz
Details
... and that (42.45 KB, image/png)
2015-05-08 10:02 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cezariusz 2015-05-08 09:58:02 UTC
Product Version: NetBeans IDE Dev (Build 201505020001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Windows 7 version 6.1 running on amd64; UTF-8; pl_PL (nb)

When writting a code you have to create new object very often. Usually it's something like this:

Type variable = new Type();

Code completion is very helpful here, but it would be even better if it suggested "new" right after the "=" character. For example:

    public String toString() {
        StringBuilder sb = |

Having cursor at the | position I would like to see "new StringBuilder" in the CC list. This could work similarly to the case when static methods are available. For example:

    public void checkTimeZone() {
        TimeZone zone = |

In this case CC offers "TimeZone.getDefault()" and "TimeZone.getTimeZone" at the first place and that's great. How about adding "new" calls to the list, so it would look like:

+-----------------------------------------------------------+
| TimeZone.getDefault()                            TimeZone |
| TimeZone.getTimeZone(String ID)                  TimeZone |
| TimeZone.getTimeZone(ZoneId zoneId)              TimeZone |
| new SimpleTimeZone (java.util)                            |
| new TimeZone (java.util)                                  |
| new ZoneInfo (sun.util.calendar)                          |
+---------------------- (separator) ------------------------+
| clone()                                              void |
| equals(Object obj)                                boolean |
| ....                                                      |

It would save several keystrokes. What do you think?
Comment 1 cezariusz 2015-05-08 10:00:42 UTC
Created attachment 153562 [details]
Aggregate this...
Comment 2 cezariusz 2015-05-08 10:02:12 UTC
Created attachment 153563 [details]
... and that