Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2019-03-20 08:14:51 +0000
committerNoopur Gupta2019-03-20 08:14:51 +0000
commita9867813623f0dd0dfe62452af0a5a6cd11fc147 (patch)
treee5ead6468126afe4b7d02689ac689e9a2496e768
parent5cd5e176ca8fa8e5cb7e2bd90d93d043b15f92e1 (diff)
downloadeclipse.jdt.ui-a9867813623f0dd0dfe62452af0a5a6cd11fc147.tar.gz
eclipse.jdt.ui-a9867813623f0dd0dfe62452af0a5a6cd11fc147.tar.xz
eclipse.jdt.ui-a9867813623f0dd0dfe62452af0a5a6cd11fc147.zip
Bug 539080: [12] Switch AST to JLS12Y20190320-2200
-rw-r--r--org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java
index f5ced4e4ce..d4149fb40d 100644
--- a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java
+++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java
@@ -371,12 +371,18 @@ public class ASTFlattener extends GenericVisitor {
*/
@Override
public boolean visit(BreakStatement node) {
- this.fBuffer.append("break");//$NON-NLS-1$
+ int apiLevel= node.getAST().apiLevel();
+ if (apiLevel >= JLS12 && node.isImplicit() && node.getExpression() == null) {
+ return false;
+ }
+ if (apiLevel < JLS12 || (apiLevel >= JLS12 && !node.isImplicit())) {
+ this.fBuffer.append("break");//$NON-NLS-1$
+ }
if (node.getLabel() != null) {
this.fBuffer.append(" ");//$NON-NLS-1$
node.getLabel().accept(this);
}
- if (node.getAST().apiLevel() >= JLS12 && node.getExpression() != null) {
+ if (apiLevel >= JLS12 && node.getExpression() != null) {
this.fBuffer.append(" ");//$NON-NLS-1$
node.getExpression().accept(this);
}

Back to the top