Bug 44653 - // $NON-NLS-1$ comments not kept on same line of the string while formatting
Summary: // $NON-NLS-1$ comments not kept on same line of the string while formatting
Status: RESOLVED DUPLICATE of bug 50989
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 56335 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-10 10:24 EDT by Frederic Fusier CLA
Modified: 2004-03-26 12:25 EST (History)
1 user (show)

See Also:


Attachments
Bug sample a little bit more readable... (1.58 KB, text/plain)
2003-10-10 12:34 EDT, Frederic Fusier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2003-10-10 10:24:30 EDT
I noticed that in certain circumstances (not always) the NON-NLS comment is not 
kept on the same line.
Here is the sample on which it happens for me:
		if (JavaModelManager.CP_RESOLVE_VERBOSE) {
			System.out.println("CPContainer SET  - setting 
container: [" //$NON-NLS-1$
					+ containerPath
					+ "] for projects: {" //$NON-NLS-1$
					+ 
(org.eclipse.jdt.internal.compiler.util.Util.toString(affectedProjects,
							new 
org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
								public String 
displayString(Object o) {
									return 
((IJavaProject) o).getElementName();
								}
							}))
					+ "} with values: " //$NON-NLS-1$
					+ 
(org.eclipse.jdt.internal.compiler.util.Util.toString(respectiveContainers,
							new 
org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
								public String 
displayString(Object o) {
									return 
((IClasspathContainer) o).getDescription();
								}
							})));
		}

then after formatting, I got:
		
		if (JavaModelManager.CP_RESOLVE_VERBOSE) {
			System.out.println("CPContainer SET  - setting 
container: ["
					//$NON-NLS-1$
					+ containerPath
					+ "] for projects: {"
					//$NON-NLS-1$
					+ 
(org.eclipse.jdt.internal.compiler.util.Util.toString(affectedProjects,
							new 
org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
								public String 
displayString(Object o) {
									return 
((IJavaProject) o).getElementName();
								}
							}))
					+ "} with values: "
					//$NON-NLS-1$
					+ 
(org.eclipse.jdt.internal.compiler.util.Util.toString(respectiveContainers,
							new 
org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
								public String 
displayString(Object o) {
									return 
((IClasspathContainer) o).getDescription();
								}
							})));
		}

It's a little bit tricky to see with these line breaks put by bugzilla, but 
I've already talked about this with Olivier and sent him precise reference...
Comment 1 Olivier Thomann CLA 2003-10-10 12:22:52 EDT
When the code is badly indented bu bugzilla, please attach your test case as a
plain text file.
Comment 2 Frederic Fusier CLA 2003-10-10 12:34:34 EDT
Created attachment 6403 [details]
Bug sample a little bit more readable...
Comment 3 Olivier Thomann CLA 2003-11-26 12:44:25 EST
Fixed and released in HEAD.
Regression test added.
Comment 4 David Audel CLA 2003-12-16 11:57:07 EST
Verified for 3.0M6
Comment 5 Dani Megert CLA 2004-03-26 09:52:45 EST
*** Bug 56335 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2004-03-26 10:15:18 EST
see comments dup bug 56335
Comment 7 Olivier Thomann CLA 2004-03-26 12:25:20 EST

*** This bug has been marked as a duplicate of 50989 ***