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 257349 - Generate <p> On Blank Lines corrupts <code> blocks in Javadoc
Summary: Generate <p> On Blank Lines corrupts <code> blocks in Javadoc
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-31 08:00 UTC by _ gtzabari
Modified: 2016-01-06 02:17 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 _ gtzabari 2015-12-31 08:00:28 UTC
Product Version: NetBeans IDE Dev (Build 201512240002)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b17
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b17
System: Windows 10 version 10.0 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Marking this as P1 because it results in silent Javadoc corruption (almost as bad as data loss).

Repro steps:

1. Create a Netbeans project with "Generate <p> On Blank Lines" enabled.
2. Add this Javadoc to a method:

	/**
	 * See following code:
	 * <pre><code>
	 * String text = "something";
         *
	 * if (text.equals("fail"))
	 *   return;
	 * </code></pre>
	 */
3. Notice that "Generate Javadoc" works fine and the Netbeans inline Javadoc viewer displays the entire code sniplet.
4. Invoke code-format. Notice that Netbeans inserts <p> on the empty line inside <pre><code>:

	/**
	 * See following code:
	 * <pre><code>
	 * String text = "something";
         * <p>
	 * if (text.equals("fail"))
	 *   return;
	 * </code></pre>
	 */
5. Notice that "Generate Javadoc" fails with "error: block element not allowed within inline element <code>: p" and Netbeans inline Javadoc viewer truncates the code block at the line with <p>.

Expected behavior: Netbeans should not insert <p> inside <code> blocks.
Comment 1 Dusan Balek 2016-01-05 10:45:13 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/57e2476f0f54
Comment 2 Quality Engineering 2016-01-06 02:17:12 UTC
Integrated into 'main-silver', will be available in build *201601060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/57e2476f0f54
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #257349 - Generate <p> On Blank Lines corrupts <code> blocks in Javadoc - fixed.