Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2019-08-07 09:59:12 +0000
committerSarika Sinha2019-08-07 10:21:06 +0000
commit1fe269b376f145e7bd8624d45acde60649c700d1 (patch)
tree0214d23d80ed6f01aceadb8294ada3b886737270
parent2dd58e630eefa755033abef13e0afbc6ed5d6d06 (diff)
downloadeclipse.jdt.ui-1fe269b376f145e7bd8624d45acde60649c700d1.tar.gz
eclipse.jdt.ui-1fe269b376f145e7bd8624d45acde60649c700d1.tar.xz
eclipse.jdt.ui-1fe269b376f145e7bd8624d45acde60649c700d1.zip
Bug 549622: Impact of PreviewEnabled check in DOM on JDT UI
-rw-r--r--org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java17
1 files changed, 7 insertions, 10 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 9b9ba4afa5..0fb5091eb0 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
@@ -366,25 +366,22 @@ public class ASTFlattener extends GenericVisitor {
return false;
}
- /*
- * @see ASTVisitor#visit(BreakStatement)
- */
@Override
public boolean visit(BreakStatement node) {
int apiLevel= node.getAST().apiLevel();
- if (apiLevel >= JLS12 && node.isImplicit() && node.getExpression() == null) {
+ if (apiLevel == JLS12 && node.getAST().isPreviewEnabled() && node.isImplicit() && node.getExpression() == null) {
return false;
}
- if (apiLevel < JLS12 || (apiLevel >= JLS12 && !node.isImplicit())) {
- this.fBuffer.append("break");//$NON-NLS-1$
- }
+ this.fBuffer.append("break");//$NON-NLS-1$
if (node.getLabel() != null) {
this.fBuffer.append(" ");//$NON-NLS-1$
node.getLabel().accept(this);
}
- if (apiLevel >= JLS12 && node.getExpression() != null) {
- this.fBuffer.append(" ");//$NON-NLS-1$
- node.getExpression().accept(this);
+ if (apiLevel == JLS12 && node.getAST().isPreviewEnabled()) {
+ if (node.getExpression() != null) {
+ this.fBuffer.append(" ");//$NON-NLS-1$
+ node.getExpression().accept(this);
+ }
}
this.fBuffer.append(";");//$NON-NLS-1$
return false;

Back to the top