Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 511644

Summary: [Formatter] Content of e.g. {@link} is not wrapped even if too long
Product: [Eclipse Project] JDT Reporter: Michael Vorburger <mike>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3    
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=407251
Whiteboard: stalebug

Description Michael Vorburger CLA 2017-02-03 08:52:47 EST
E.g. the following JavaDoc:

    /**
     * Deprecated update.
     *
     * @deprecated Use {@link SingleTransactionDataBroker#syncUpdate(DataBroker, LogicalDatastoreType, InstanceIdentifier, DataObject)}
     */

currently (4.7.0 M4) gets Formatted like this:

	/**
	 * Deprecated update.
	 *
	 * @deprecated Use
	 *             {@link SingleTransactionDataBroker#syncUpdate(DataBroker, LogicalDatastoreType, InstanceIdentifier, DataObject)}
	 */

but this is incorrect, because the last line (with the @link) is still longer than the configured maximum line width (which was 120, in this case).  It should have formatted it e.g. as something like the following, I think:

    /**
     * Deprecated update.
     *
     * @deprecated Use
     *             {@link SingleTransactionDataBroker#syncUpdate(
     *                          DataBroker, LogicalDatastoreType, InstanceIdentifier, DataObject)}
     */

Bug 407251 seems vaguely related to this...  But it claims that breaking e.g. {@link} is wrong, which is the opposite of what I'm suggesting here... at least in Eclipse's own Javadoc view, this (as I'm suggesting it above) seems to be handled just fine though, so I think bug 407251 is wrong.
Comment 1 Michael Vorburger CLA 2017-02-03 09:00:20 EST
> at least in Eclipse's own Javadoc view, this seems to be handled just fine

I've also verified it running Java 8 JDK javadoc, and it seems to deal with line breaks within @link just fine apparently...

PS, BTW: This issue may not be limited to {@link} but also affect other JavaDoc .. macros, or whatever they're called; I've just noticed during Format of a comment containing a {@link}.
Comment 2 Eclipse Genie CLA 2020-04-20 06:32:39 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.