Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2019-03-19 06:04:19 -0400
committerManoj Palat2019-03-19 06:46:39 -0400
commita39326e536c471be4affbcc0e5abf7e3abd41b82 (patch)
tree80c3c39d6190b526c5bb080c7f10452742fb7f30
parent3376a0f9b0b41ccc98b973fa93072064b1f74fd9 (diff)
downloadeclipse.jdt.core-a39326e536c471be4affbcc0e5abf7e3abd41b82.tar.gz
eclipse.jdt.core-a39326e536c471be4affbcc0e5abf7e3abd41b82.tar.xz
eclipse.jdt.core-a39326e536c471be4affbcc0e5abf7e3abd41b82.zip
Bug 545539 - [12] BreakStatement should not expose setImplicit( boolean)
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java5
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java5
2 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
index ecb94b013c..fde817539f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
@@ -26,6 +26,7 @@ import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.Block;
import org.eclipse.jdt.core.dom.BreakStatement;
import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ExpressionStatement;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.Statement;
@@ -824,11 +825,9 @@ public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
SwitchCase caseStatement1= ast.newSwitchCase();
caseStatement1.setSwitchLabeledRule(false);
caseStatement1.expressions().add(ast.newNumberLiteral("1"));
- BreakStatement statement1= ast.newBreakStatement();
StringLiteral literal1 = ast.newStringLiteral();
literal1.setLiteralValue("odd");
- statement1.setExpression(literal1);
- statement1.setImplicit(true);
+ ExpressionStatement statement1 = ast.newExpressionStatement(literal1);
listRewrite.insertAt(caseStatement1, 2, null);
listRewrite.insertAt(statement1, 3, null);
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java
index 393a730038..968c35a813 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java
@@ -265,13 +265,14 @@ public class BreakStatement extends Statement {
/**
* Sets the isImplicit of this break statement as <code>true</code> or <code>false</code>.
- * <code>true</code> indicates implicit and <code>false</code> indicates not implicit.
+ * <code>true</code> indicates implicit and <code>false</code> indicates not implicit. This flag is
+ * generated by compiler and is not expected to be set by client.
* @param isImplicit <code>true</code> or <code>false</code>
* @exception UnsupportedOperationException if this operation is used below JLS12
* @since 3.17 BETA_JAVA_12
*/
- public void setImplicit(boolean isImplicit) {
+ void setImplicit(boolean isImplicit) {
unsupportedBelow12();
this.isImplicit = isImplicit;
}

Back to the top