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 218920 - Hint (cast) creates more space than needed.
Summary: Hint (cast) creates more space than needed.
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-24 16:31 UTC by Chiana
Modified: 2014-04-11 09:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Line before using hint to cast (48.27 KB, image/jpeg)
2012-09-24 16:31 UTC, Chiana
Details
Line after using the hint to cast (39.97 KB, image/jpeg)
2012-09-24 16:32 UTC, Chiana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2012-09-24 16:31:17 UTC
[ JDK VERSION : 1.7.7 ]

When using the hint "Cast <value> to <othervalue>" it creates a large gap on
the line. See screendump 1(before) & 2(after).
Nothing that really matters, just annoying and should probable be fixed as it
is a regression
Comment 1 Chiana 2012-09-24 16:31:52 UTC
Created attachment 124819 [details]
Line before using hint to cast
Comment 2 Chiana 2012-09-24 16:32:30 UTC
Created attachment 124820 [details]
Line after using the hint to cast
Comment 3 Chiana 2012-11-23 09:17:09 UTC
Jan, this is not the only hint that has this behaviour, some of the "Surrond with..." also makes a lot of spaces.

Unfortunatley there seems to be no pattern to when this happens except in this one where it happens alot...
Comment 4 Jan Lahoda 2012-11-23 09:24:52 UTC
(In reply to comment #3)
> Jan, this is not the only hint that has this behaviour, some of the "Surrond
> with..." also makes a lot of spaces.

Yes, it appears to be a bug in the way code is generated (thus the move to java.source).

> 
> Unfortunatley there seems to be no pattern to when this happens except in this
> one where it happens alot...

I think the immediate cause is that indent level is incorrectly determined when a blocks opening bracket is on a line that does not have the "correct" indent, e.g. because of a multi-line method headers or a multi-line if/while/... conditions.
Comment 5 Quality Engineering 2012-11-24 13:07:57 UTC
Integrated into 'main-golden', will be available in build *201211240959* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7e7de00e56f6
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #218920: ensuring that the root and the selected node are set atomically.
Comment 6 Jan Lahoda 2012-11-26 09:15:34 UTC
The immediate cause is fixed by fix for bug #222028, but there is one more possible problem which I would like to investigate.
Comment 7 Svata Dedic 2014-04-11 09:24:39 UTC
Seems to work OK in trunk; by default, a space is generated after typecast - change in tools/options as necessary.