Community
Participate
Working Groups
Resubmitting part of bug 52855, marked as duplicate of bug 49686. Additional newlines with pre tags are not covered by bug 49686. Build id: 3.0-M7 - an extra newline is appended before a <pre> tag. I think there are no configuration options for this like for the "add an empty line before parameters", so it should not be added. public class WrappingTest { /** * Javadocs formatting adds an extra empty line for a [pre] tag like in this situation * * <pre>wrap here</pre>. */ public static final String CONSTANT3 = "somevalue"; }
*** Bug 62052 has been marked as a duplicate of this bug. ***
I20040512 Note that the extra lines and spaces are added on each run. Thus, if you format your class several 6 times you will have 6 empty lines between pre tags and the text and 6 additional spaces between the begin of the text and the '*'
*** Bug 63408 has been marked as a duplicate of this bug. ***
This is a squirrely bug: using the M9 build on the Javadoc below, there is no newline added to the first or second <pre> block, but newlines are added to the third and fourth <pre> blocks. As before, one additional newline is added to each <pre> block every time the formatter runs. Also, although "Format HTML tags" is disabled, the formatter puts a newline before the closing </pre> tag, which doesn't seem correct or desireable. /** * Weighted or unweighted least-squares line fit. <code>LineFit</code> uses * the method of least squares to fit a line to two-dimensional data: * * <pre> * y = a + b * x </pre> * * (This is also called linear regression.) In addition to the slope and * y-intercept, <code>LineFit</code> can compute the square of the correlation * coefficient (R squared), the Durbin-Watson statistic, the mean squared error, * sigma, the t-statistics, the predicted y values and the residuals of the y * values. <br><br> * * <code>LineFit</code> accepts float or double input. If weights are passed * to the constructor, <code>LineFit</code> minimizes the weighted sum of the * squared errors and applies the weights to the following statistics: R * squared, the Durbin-Watson statistic, the mean squared error, sigma and the * t-statistics. <br><br> * * The decision to use or not use weighting could be made using your a priori * knowledge of the data or using supplemental data. If the data is sparse or * contains non-random noise, weighting can degrade the solution. Weighting is a * good option if some points are suspect or less relevant (e.g., older terms in * a time series, points that are known to have more noise). <br><br> * * SYNOPSIS * * <pre> * try { * LineFit lineFit = new LineFit(x, y, w); * double slope = lineFit.getSlope(); * double intercept = lineFit.getIntercept(); * double durbinWatson = lineFit.getDurbinWatson(); * double meanSqError = lineFit.getMeanSqError(); * double rSquared = lineFit.getRSquared(); * double sigma = lineFit.getSigma(); * double tStatisticSlope = lineFit.getTStatisticSlope(); * double tStatisticIntercept = lineFit.getTStatisticIntercept(); * double[] predictedYs = lineFit.getPredictedYs(); * double[] residuals = lineFit.getResiduals(); * } catch (IllegalArgumentException exception) { * exception.printStackTrace(); * } catch (AssertionError error) { * error.printStackTrace(); * } </pre> * * ALGORITHM <br><br> * * The least-square line is the line that minimizes the sum of the squares of * the y residuals: * * <pre> * Minimize SUM((y[i] - (a + b * x[i])) ** 2) </pre> * * Setting the partial derivatives of a and b to zero yields a solution that can * be expressed in terms of the means, variances and covariances of x and y: * * <pre> * b = SUM((x[i] - meanX) * (y[i] - meanY)) / SUM((x[i] - meanX) ** 2) * * a = meanY - b * meanX </pre> * * Note that a and b are undefined if the x values are all equal. <br><br> * */
*** Bug 66649 has been marked as a duplicate of this bug. ***
*** Bug 68967 has been marked as a duplicate of this bug. ***
*** Bug 69243 has been marked as a duplicate of this bug. ***
*** Bug 69313 has been marked as a duplicate of this bug. ***
*** Bug 69712 has been marked as a duplicate of this bug. ***
*** Bug 70447 has been marked as a duplicate of this bug. ***
*** Bug 71459 has been marked as a duplicate of this bug. ***
The formatter is also inserting additional indentation. For example, before formatting: /** * Pop up a periodic reminder. Usage: * * <pre> * java org.biesack.simplereminder.Reminder Some text to include in the reminder. * java org.biesack.simplereminder.Reminder -t "Remember to stretch." -i 1 -s 15 Some text to include in the reminder. * </pre> * ... */ then after formatting the source three times: /** * Pop up a periodic reminder. Usage: * * <pre> * * * * java org.biesack.simplereminder.Reminder Some text to include in the reminder. * java org.biesack.simplereminder.Reminder -t "Remember to stretch." -i 1 -s 15 Some text to include in the reminder. * * * * </pre>
just my two cents.... I just opened the formatting preferences, went to the comments tab, selected "Clear blank lines in comments", saved and exited. Tried formatting again, and no new lines where added !! went back and de-selected that same option, just trying stuff, formatting now _still_ does not generate new lines ! :-( so I honestly dont know how the problem disappeared, but Im reporting anyway.
*** Bug 76053 has been marked as a duplicate of this bug. ***
*** Bug 76438 has been marked as a duplicate of this bug. ***
*** Bug 76542 has been marked as a duplicate of this bug. ***
*** Bug 78002 has been marked as a duplicate of this bug. ***
I am using Eclipse Version: 3.1.0 Build id: 200408122000 and this bug is still present. Which plug is has to be updated/patched and where can I get it? I think it is still a bug even though there is the work around to check "Clear blank lines in comments" in the Code formater prefereces.
I am using 3.0.1, Build id: 200409161125. I tried the workaround and checked the 'Clear blank lines in comments' option. But it doesn't work. Newlines are still appended after the <pre> and before the </pre> tag.
I can reproduce this bug in eclipse 3.1M4. The workaround did not help.
*** Bug 87418 has been marked as a duplicate of this bug. ***
I don't understand how such a bug has not been resolved in one year... are javadoc comments not in use at IBM? ;-) Sorry for sounding harsh, but it's really an annoying bug...
(In reply to comment #22) > I don't understand how such a bug has not been resolved in one year... are > javadoc comments not in use at IBM? ;-) > Sorry for sounding harsh, but it's really an annoying bug... I am starting to try to locate the source of this bug and fix it. I am annoyed by it too, IBM focuses mostly on new features. I am not a committer and it has been very hard to figure out how to even properly debug selected sections of eclipse. The cvs is very hard to navigate and there are many classes involved with the code formatter.
Please note that the comment formatter has just been pushed down to JDT Core i.e. you will find the code in plug-in org.eclipse.jdt.core, package org.eclipse.jdt.internal.formatter.comment.
As far as I can tell the problem arises when the text between <pre> and </pre> is not valid java code. Yet, it is not supposed to be... in my case, the <pre> sections contain a pseudo-graphical representation of a diagram...
*** Bug 91231 has been marked as a duplicate of this bug. ***
*** Bug 96268 has been marked as a duplicate of this bug. ***
Any hope to see this fixed for Eclipse 3.1? It's quite annoying!
Created attachment 22936 [details] Patch against JavaDocRegion.java
The fix is trivial. I approve this change for 3.1 RC3.
+1 for RC3
There's another problem with the source code formatting inside <pre> for some of the attached examples the code is shifted to the right upon each format. This is not related to my patch and is covered in bug 99738.
Created attachment 22947 [details] Improved patch against JavadocRegion.java
Created attachment 22948 [details] Additional test case for JavaDocTestCase.java The existing test cases all pass and I've added a new one for this PR.
Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.formatter.comment.JavaDocTestCase.testNoExtraNewlineWithPre1. The regression test contains a workaround for bug 99738.
Verified using build N20050616-0010 + JDT Core HEAD.
*** Bug 101213 has been marked as a duplicate of this bug. ***