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

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


public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  this.preAssertInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);

  Constant cst = this.assertExpression.optimizedBooleanConstant();
  boolean isOptimizedTrueAssertion = cst != Constant.NotAConstant && cst.booleanValue() == true;
  boolean isOptimizedFalseAssertion = cst != Constant.NotAConstant && cst.booleanValue() == false;

  FlowInfo conditionFlowInfo = this.assertExpression.analyseCode(currentScope, flowContext, flowInfo.copy());
  UnconditionalFlowInfo assertWhenTrueInfo = conditionFlowInfo.initsWhenTrue().unconditionalInits();
  FlowInfo assertInfo = conditionFlowInfo.initsWhenFalse();
View Full Code Here


public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  this.preAssertInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);

  Constant cst = this.assertExpression.optimizedBooleanConstant();
  boolean isOptimizedTrueAssertion = cst != Constant.NotAConstant && cst.booleanValue() == true;
  boolean isOptimizedFalseAssertion = cst != Constant.NotAConstant && cst.booleanValue() == false;

  FlowInfo conditionFlowInfo = this.assertExpression.analyseCode(currentScope, flowContext, flowInfo.copy());
  UnconditionalFlowInfo assertWhenTrueInfo = conditionFlowInfo.initsWhenTrue().unconditionalInits();
  FlowInfo assertInfo = conditionFlowInfo.initsWhenFalse();
  if (isOptimizedTrueAssertion) {
View Full Code Here

    }
    this.preCondInitStateIndex =
      currentScope.methodScope().recordInitializationStates(flowInfo);

    Constant cst = this.condition == null ? null : this.condition.constant;
    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);
View Full Code Here

    this.preCondInitStateIndex =
      currentScope.methodScope().recordInitializationStates(flowInfo);

    Constant cst = this.condition == null ? null : this.condition.constant;
    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);
   
View Full Code Here

    Constant cst = this.condition == null ? null : this.condition.constant;
    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();
View Full Code Here

    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

    Constant constant = variableBinding.constant();
    if (constant == null || constant == Constant.NotAConstant) return null;
    TypeBinding type = variableBinding.type;
    switch (type.id) {
      case TypeIds.T_boolean:
        return constant.booleanValue();
      case TypeIds.T_byte:
        return constant.byteValue();
      case TypeIds.T_char:
        return constant.charValue();
      case TypeIds.T_double:
View Full Code Here

      case TypeIds.T_float :
        return currentConstant.floatValue() != otherConstant.floatValue();
      case TypeIds.T_double :
        return currentConstant.doubleValue() != otherConstant.doubleValue();
      case TypeIds.T_boolean :
        return currentConstant.booleanValue() != otherConstant.booleanValue();
      case TypeIds.T_JavaLangString :
        return !currentConstant.stringValue().equals(otherConstant.stringValue());
    }
  }
  return false;
View Full Code Here

  public Object getConstantValue() {
    Constant c = this.binding.constant();
    if (c == null || c == Constant.NotAConstant) return null;
    switch (c.typeID()) {
      case TypeIds.T_boolean:
        return Boolean.valueOf(c.booleanValue());
      case TypeIds.T_byte:
        return new Byte(c.byteValue());
      case TypeIds.T_char:
        return new Character(c.charValue());
      case TypeIds.T_double:
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.