Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Matela2018-05-01 20:15:48 +0000
committerMateusz Matela2018-05-01 20:16:36 +0000
commited495f0c157b5f9bb5472b16bfc7639baabab923 (patch)
treecdc848cfd9b6e012e0679a8890475605101d6f57 /org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
parent17f843244d722f7543dc33e0f4ea19424b12c6b0 (diff)
downloadeclipse.jdt.core-ed495f0c157b5f9bb5472b16bfc7639baabab923.tar.gz
eclipse.jdt.core-ed495f0c157b5f9bb5472b16bfc7639baabab923.tar.xz
eclipse.jdt.core-ed495f0c157b5f9bb5472b16bfc7639baabab923.zip
Bug 534225 - [formatter] Align Javadoc tags in columns option causes extra spacesI20180502-0100I20180501-2000
Diffstat (limited to 'org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java')
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
index cfc64f2f74..0438dd58f4 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TokenManager.java
@@ -281,19 +281,15 @@ public class TokenManager implements Iterable<Token> {
public int getPositionInLine(int tokenIndex) {
Token token = get(tokenIndex);
- if (token.getAlign() > 0)
- return get(tokenIndex).getAlign();
// find the first token in line and calculate position of given token
int firstTokenIndex = token.getLineBreaksBefore() > 0 ? tokenIndex : findFirstTokenInLine(tokenIndex);
Token firstToken = get(firstTokenIndex);
int startingPosition = toIndent(firstToken.getIndent(), firstToken.getWrapPolicy() != null);
- if (firstTokenIndex == tokenIndex)
- return startingPosition;
this.positionInLineCounter.value = tokenIndex;
this.positionInLineCounter.counter = startingPosition;
traverse(firstTokenIndex, this.positionInLineCounter);
- return this.positionInLineCounter.counter;
+ return Math.max(this.positionInLineCounter.counter, token.getAlign());
}
public int findSourcePositionInLine(int position) {

Back to the top