Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 405038 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java (-3 / +14 lines)
Lines 473-481 Link Here
473
								this.scribe.printNextToken(operators[i], this.preferences.insert_space_before_binary_operator);
473
								this.scribe.printNextToken(operators[i], this.preferences.insert_space_before_binary_operator);
474
								this.scribe.alignFragment(binaryExpressionAlignment, i);
474
								this.scribe.alignFragment(binaryExpressionAlignment, i);
475
							}
475
							}
476
							if (operators[i] == TerminalTokens.TokenNameMINUS && isNextToken(TerminalTokens.TokenNameMINUS)) {
476
							switch(operators[i]) {
477
								// the next character is a minus (unary operator)
477
								case TerminalTokens.TokenNameMINUS :
478
								this.scribe.space();
478
									if (isNextToken(TerminalTokens.TokenNameMINUS)
479
											|| isNextToken(TerminalTokens.TokenNameMINUS_MINUS)) {
480
										// the next character is a '-' or '--' (unary operator)
481
										this.scribe.space();
482
									}
483
									break;
484
								case TerminalTokens.TokenNamePLUS :
485
									if (isNextToken(TerminalTokens.TokenNamePLUS)
486
											|| isNextToken(TerminalTokens.TokenNamePLUS_PLUS)) {
487
										// the next character is a + or ++ (unary operator)
488
										this.scribe.space();
489
									}
479
							}
490
							}
480
							if (this.preferences.insert_space_after_binary_operator) {
491
							if (this.preferences.insert_space_after_binary_operator) {
481
								this.scribe.space();
492
								this.scribe.space();

Return to bug 405038