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 233541 - Editor inserts whitespace at (random) places when code is incorrect
Summary: Editor inserts whitespace at (random) places when code is incorrect
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-27 14:16 UTC by chriswesdorp
Modified: 2013-08-01 19:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
the results of editor formating on invalid code (25.96 KB, image/png)
2013-07-27 14:16 UTC, chriswesdorp
Details
the formatting setting used in NB (222.92 KB, application/zip)
2013-07-31 20:52 UTC, chriswesdorp
Details
screen capture of the bug (1.11 MB, video/quicktime)
2013-07-31 20:59 UTC, chriswesdorp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chriswesdorp 2013-07-27 14:16:35 UTC
Created attachment 137900 [details]
the results of editor formating on invalid code

When inserting a line of java code that is not correct (e.g. undeclared variable names) the editor inserts spaces at certain places. This happens even when a line is not yet correct because variables need to be filled first.

To reproduce in a Java editor

# Type in one go "String s = String.format" then pause
-> A space is included at the end

# Type ctrl+space to open code completion
# Select the (String, Object...) method
-> The code is appended but a space is added after "format " and after "args ". 

Finish the code line by making it "String s = String.format(undeclared, args);" You will see additional spaces after "format ", "undeclared " and "args ".

When declaring the variables undeclared and args the spaces after these will disappear but the space after "format " is still there.
Comment 1 Dusan Balek 2013-07-30 15:31:13 UTC
Unfortunately, I cannot reproduce the problem. Could you please attach your formatting options (especially the 'Spaces' category)? Thanks.
Comment 2 chriswesdorp 2013-07-31 20:52:45 UTC
Created attachment 138085 [details]
the formatting setting used in NB

I attached the formatting settings as used in NB 7.4. I believe these are the default settings.
Comment 3 chriswesdorp 2013-07-31 20:59:36 UTC
Created attachment 138086 [details]
screen capture of the bug

I also attached a small screencast of the bug. The keyboard viewer is also in view. This is the runtime info:

Product Version: NetBeans IDE 7.4 Beta (Build 201307092200)
Java: 1.7.0_40-ea; Java HotSpot(TM) 64-Bit Server VM 24.0-b53
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b34
System: Mac OS X version 10.8.4 running on x86_64; UTF-8; en_US (nb)
Comment 4 Dusan Balek 2013-08-01 07:49:56 UTC
Are you sure that spaces are really added after "format " and after "args "? From the attached screencast it seems to me that there is a problem with italic font rendering. It looks like your italic font is "wider" than the plain one making an illusion of the added space. Could you please check your font settings and make sure that the font that you are using is really monospaced?
Comment 5 chriswesdorp 2013-08-01 19:48:18 UTC
Humz, yes seems to be whitespace after italic words. The default is Courier New, I also tried with the Monospaced font. Still happens. Sometimes I see wrong calculations because of using Retrina in 1920x1200 resolution, but also on the default 1440x900 the whitespace is visible.