Skip to content

Commit

Permalink
Merge pull request #26 from isaki/2021-09.r1
Browse files Browse the repository at this point in the history
API Update Fixes for 1.10.X
  • Loading branch information
isaki authored Sep 24, 2021
2 parents 1512e74 + adbed80 commit 060a271
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-SymbolicName: OldJavaFormatter;singleton:=true
Bundle-Name: OldJavaFormatter
Bundle-Version: 1.10.0
Bundle-Version: 1.10.1
Require-Bundle: org.eclipse.jdt.core;bundle-version="[3.27.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.18.100,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.23.0,4.0.0)"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Original plugin can be found [here](http://eclipse-n-mati.blogspot.com.es/2015/0
| 1.7.0 | 2020-09 | Luna, Neon | No code changes, but rather a rebuild with the 2020-09 toolchain. |
| 1.8.0 | 2020-12, 2021-03 | Luna, Neon | No code changes, but rather a rebuild with the 2020-12 toolchain. |
| 1.9.0 | 2021-06 | Luna, Neon | Changed library dependency versions, rebuild of plugin with 2021-06 toolchain. |
| 1.10.0 | 2021-09 | Luna, Neon | Changed library dependency versions, addressed compiler warnings, addressed deprecated API warnings, addressed breaks caused by upstream API changes. |
| 1.10.1 | 2021-09 | Luna, Neon | Changed library dependency versions, addressed compiler warnings, addressed deprecated API warnings, addressed breaks caused by upstream API changes. |
5 changes: 2 additions & 3 deletions src/org/eclipse/jdt/luna/formatter/CodeFormatterVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -3289,10 +3289,9 @@ public boolean visit(CaseStatement caseStatement, BlockScope scope) {
this.scribe.printNextToken(TerminalTokens.TokenNamedefault);
this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_default);
} else {
this.scribe.printNextToken(TerminalTokens.TokenNamecase);
this.scribe.space();

for (int i = 0; i < cexpr.length; ++i) {
this.scribe.printNextToken(TerminalTokens.TokenNamecase);
this.scribe.space();
cexpr[i].traverse(this, scope);
this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_case);
}
Expand Down
7 changes: 4 additions & 3 deletions src/org/eclipse/jdt/neon/formatter/SpacePreparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,12 @@ public boolean visit(SwitchCase node) {
if (node.isDefault()) {
handleToken(node, TokenNameCOLON, this.options.insert_space_before_colon_in_default, false);
} else {
handleToken(node, TokenNamecase, false, true);

// Null check not required as we checked isDefault() above.
final List<Expression> expressions = node.expressions();
expressions.forEach((x) -> handleToken(x, TokenNameCOLON, this.options.insert_space_before_colon_in_case, false));
expressions.forEach((x) -> {
handleToken(node, TokenNamecase, false, true);
handleToken(x, TokenNameCOLON, this.options.insert_space_before_colon_in_case, false);
});
}
return true;
}
Expand Down

0 comments on commit 060a271

Please sign in to comment.