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 236206 - Patch for: Java Hint-Wizard creates uncompilable code when using a multiline description
Summary: Patch for: Java Hint-Wizard creates uncompilable code when using a multiline ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2013-09-20 19:50 UTC by markiewb
Modified: 2013-11-24 02:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Shows the issue (109.55 KB, image/png)
2013-09-20 19:50 UTC, markiewb
Details
Proposed patch (1.83 KB, patch)
2013-11-16 12:14 UTC, markiewb
Details | Diff
Refined patch (1.54 KB, patch)
2013-11-21 09:52 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2013-09-20 19:50:59 UTC
Created attachment 140320 [details]
Shows the issue

* Use the Java Hint Wizard to create a hint
** use a multiline description

->
ACTUAL: uncompilable code is generated - see screenshot
EXPECTED: compilable code is generated - proposal: replace the linebreaks with <br/>
Comment 1 Svata Dedic 2013-11-07 09:55:23 UTC
Justification for P4: Hint coding does not target the typical NB user, only minor audience is affected.
Comment 2 markiewb 2013-11-16 12:14:48 UTC
Created attachment 142257 [details]
Proposed patch

I like to propose a patch to solve this issue. Please review and commit. Thank you!
Comment 3 Svata Dedic 2013-11-21 09:52:44 UTC
Created attachment 142434 [details]
Refined patch

I would modify the patch a little: one round of replacing could work for all the newline styles + add a linebreak to the code to make it more readable. The noncapturing group in the regex should prevent accidental match at the end, which would result in dangling + (and a syntax error).

Opionions ?
Comment 4 markiewb 2013-11-21 21:47:45 UTC
(In reply to Svata Dedic from comment #3)
> Created attachment 142434 [details]
> Refined patch
> 
> I would modify the patch a little: one round of replacing could work for all
> the newline styles + add a linebreak to the code to make it more readable.
> The noncapturing group in the regex should prevent accidental match at the
> end, which would result in dangling + (and a syntax error).
> 
> Opionions ?

That's a valid change. I am not a regex guru, but it could work.
Comment 5 Svata Dedic 2013-11-22 17:06:35 UTC
Integrated as http://hg.netbeans.org/jet-main/rev/bfa36e393139
Comment 6 Quality Engineering 2013-11-24 02:19:40 UTC
Integrated into 'main-silver', will be available in build *201311240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/bfa36e393139
User: Svata Dedic <sdedic@netbeans.org>
Log: #236206: description newlines replaced by <br> for HTML formatting (by Markiewb)