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 201204 - String with newlines copied without newlines?
Summary: String with newlines copied without newlines?
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 7.1
Hardware: PC Windows XP
: P4 normal with 1 vote (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-22 10:37 UTC by monk.e.boy
Modified: 2012-01-26 09:01 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 monk.e.boy 2011-08-22 10:37:50 UTC
Hi,

  I'm using PHP, when I debug (XDebug) and look at the Variables window at a string value. If I select the string value from the Value column, then press Ctrl+C and paste it, the new lines are removed. If I click on the '...' and copy the text from the Value Window new lines are not removed.

  It seems that removing newlines from the text is wrong.

Why this causes me pain: Debugging this:

$sql = "

SELECT name
FROM people
WHERE
age > 30 # <-- this is a comment
AND
name LIKE '%abc%'

";

When copying the value of $sql with the newlines stripped out the SQL may become invalid (The comment lines are terminated with a \n). When copying the value from the pop-up window the newlines are kept and the SQL is valid.

monk.e.boy
Comment 1 Martin Entlicher 2011-09-08 20:20:34 UTC
This is a general problem of String property editor. This behavior is not only in debugger views, but e.g. in form editor's properties as well.
Comment 2 monk.e.boy 2011-09-09 08:31:29 UTC
In other IDEs I've used, viewing a string like the example above would show it formatted correctly in the debug Variables 'grid' view. The grid row would expand to a maximum of about 100px, then a little scroll bar would appear in the value grid cell.
Comment 3 Jan Peska 2011-10-31 13:38:12 UTC
Hi,

this is related issue to http://netbeans.org/bugzilla/show_bug.cgi?id=47430 : JTextField strips \n's, and if the text has changed, there's not much way to tell where to put them back. -> WONTFIX

In your case I would recommend to use custom editor (using '...' button) if you want to edit more then just plain text.
Comment 4 monk.e.boy 2011-10-31 13:50:16 UTC
If this is the case, then why not replace jtextfield with something that works?
Comment 5 Jan Peska 2011-10-31 15:08:21 UTC
I can reassign this issue to Explorer&Property Sheet (StringInplaceEditor belongs to it) for further evaluation. Lets see what component owner thinks about it.
Comment 6 monk.e.boy 2011-10-31 15:18:51 UTC
Thank you :)

There are a lot of bugs that I don't care much about, but when I inspect a variable I think seeing its value is important. I don't want to seem some weird version where the whitespace has been mangled. Did it also trim any chars after 1024 off, or was that me? Did it mangle the UTF8 characters, or was that a bug in my code?

Doing that reverse mental gymnastics part way through the debug cycle is tiring :)
Comment 7 Jaroslav Tulach 2011-11-04 10:02:15 UTC
What do I think of it? If somebody fixes it I am willing to apply patch.
Comment 8 Jaroslav Tulach 2012-01-26 09:01:08 UTC
No patch. No fix.