Package org.eclipse.jdt.internal.compiler.impl

Examples of org.eclipse.jdt.internal.compiler.impl.Constant.booleanValue()


    boolean isConditionTrue = cst == null || (cst != Constant.NotAConstant && cst.booleanValue() == true);
    boolean isConditionFalse = cst != null && (cst != Constant.NotAConstant && cst.booleanValue() == false);

    cst = this.condition == null ? null : this.condition.optimizedBooleanConstant();
    boolean isConditionOptimizedTrue = cst == null ||  (cst != Constant.NotAConstant && cst.booleanValue() == true);
    boolean isConditionOptimizedFalse = cst != null && (cst != Constant.NotAConstant && cst.booleanValue() == false);
   
    // process the condition
    LoopingFlowContext condLoopContext = null;
    FlowInfo condInfo = flowInfo.nullInfoLessUnconditionalCopy();
    if (this.condition != null) {
View Full Code Here


      for (int i = 0, max = this.initializations.length; i < max; i++) {
        this.initializations[i].generateCode(this.scope, codeStream);
      }
    }
    Constant cst = this.condition == null ? null : this.condition.optimizedBooleanConstant();
    boolean isConditionOptimizedFalse = cst != null && (cst != Constant.NotAConstant && cst.booleanValue() == false);
    if (isConditionOptimizedFalse) {
      this.condition.generateCode(this.scope, codeStream, false);
      // May loose some local variable initializations : affecting the local variable attributes
      if ((this.bits & ASTNode.NeededScope) != 0) {
        codeStream.exitUserScope(this.scope);
View Full Code Here

    if (internalObject instanceof Constant) {
      Constant constant = (Constant) internalObject;
      switch (constant.typeID()) {
        case TypeIds.T_boolean:
          return Boolean.valueOf(constant.booleanValue());
        case TypeIds.T_byte:
          return new Byte(constant.byteValue());
        case TypeIds.T_char:
          return new Character(constant.charValue());
        case TypeIds.T_double:
View Full Code Here

                if (constant instanceof StringConstant) {
                    return constant.stringValue();
                } else if (constant instanceof IntConstant) {
                    return constant.intValue();
                } else if (constant instanceof BooleanConstant) {
                    return constant.booleanValue();
                } else if (constant instanceof LongConstant) {
                    return constant.longValue();
                } else if (constant instanceof DoubleConstant) {
                    return constant.doubleValue();
                } else if (constant instanceof CharConstant) {
View Full Code Here

}
private FlowInfo analyseBooleanAssertion(BlockScope currentScope, Expression argument,
    FlowContext flowContext, FlowInfo flowInfo, boolean wasInsideAssert, boolean passOnTrue)
{
  Constant cst = argument.optimizedBooleanConstant();
  boolean isOptimizedTrueAssertion = cst != Constant.NotAConstant && cst.booleanValue() == true;
  boolean isOptimizedFalseAssertion = cst != Constant.NotAConstant && cst.booleanValue() == false;
  int tagBitsSave = flowContext.tagBits;
  flowContext.tagBits |= FlowContext.HIDE_NULL_COMPARISON_WARNING;
  if (!passOnTrue)
    flowContext.tagBits |= FlowContext.INSIDE_NEGATION; // this affects syntactic analysis for fields in EqualExpression
View Full Code Here

private FlowInfo analyseBooleanAssertion(BlockScope currentScope, Expression argument,
    FlowContext flowContext, FlowInfo flowInfo, boolean wasInsideAssert, boolean passOnTrue)
{
  Constant cst = argument.optimizedBooleanConstant();
  boolean isOptimizedTrueAssertion = cst != Constant.NotAConstant && cst.booleanValue() == true;
  boolean isOptimizedFalseAssertion = cst != Constant.NotAConstant && cst.booleanValue() == false;
  int tagBitsSave = flowContext.tagBits;
  flowContext.tagBits |= FlowContext.HIDE_NULL_COMPARISON_WARNING;
  if (!passOnTrue)
    flowContext.tagBits |= FlowContext.INSIDE_NEGATION; // this affects syntactic analysis for fields in EqualExpression
  FlowInfo conditionFlowInfo = argument.analyseCode(currentScope, flowContext, flowInfo.copy());
View Full Code Here

  Constant cst = optimizedBooleanConstant();
  generateCode(currentScope, codeStream, valueRequired && cst == Constant.NotAConstant);
  if ((cst != Constant.NotAConstant) && (cst.typeID() == TypeIds.T_boolean)) {
    int pc = codeStream.position;
    if (cst.booleanValue() == true) {
      // constant == true
      if (valueRequired) {
        if (falseLabel == null) {
          // implicit falling through the FALSE case
          if (trueLabel != null) {
View Full Code Here

                if (constant instanceof StringConstant) {
                    return constant.stringValue();
                } else if (constant instanceof IntConstant) {
                    return constant.intValue();
                } else if (constant instanceof BooleanConstant) {
                    return constant.booleanValue();
                } else if (constant instanceof LongConstant) {
                    return constant.longValue();
                } else if (constant instanceof DoubleConstant) {
                    return constant.doubleValue();
                } else if (constant instanceof CharConstant) {
View Full Code Here

   */
  private static boolean isOptimizedFalse(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue() == false) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

   */
  private static boolean isOptimizedTrue(Expression condition) {
    if (condition != null) {
      Constant cst = condition.optimizedBooleanConstant();
      if (cst != Constant.NotAConstant) {
        if (cst.booleanValue() == true) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.