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

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


            }
          }
        } else {
          Constant cst = value.constant;
          if (cst != Constant.NotAConstant && cst.typeID() == T_JavaLangString) {
            IrritantSet irritants = CompilerOptions.warningTokenToIrritants(cst.stringValue());
            if (irritants != null) {
              suppressWarningIrritants = new IrritantSet(irritants);
              // TODO: should check for unused warning token against enclosing annotation as well ?
            } else {
              scope.problemReporter().unhandledWarningToken(value);
View Full Code Here


        @Override
        public Object getValue() {
            Constant constant = mBinding.constant();
            if (constant != null) {
                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) {
View Full Code Here

          Expression[] inits = initializer.expressions;
          if (inits != null) {
            for (int j = 0, initsLength = inits.length; j < initsLength; j++) {
              Constant cst = inits[j].constant;
              if (cst != Constant.NotAConstant && cst.typeID() == T_JavaLangString) {
                IrritantSet irritants = CompilerOptions.warningTokenToIrritants(cst.stringValue());
                if (irritants != null) {
                  if (suppressWarningIrritants == null) {
                    suppressWarningIrritants = new IrritantSet(irritants);
                  } else if (suppressWarningIrritants.set(irritants) == null) {
                      scope.problemReporter().unusedWarningToken(inits[j]);
View Full Code Here

            }
          }
        } else {
          Constant cst = value.constant;
          if (cst != Constant.NotAConstant && cst.typeID() == T_JavaLangString) {
            IrritantSet irritants = CompilerOptions.warningTokenToIrritants(cst.stringValue());
            if (irritants != null) {
              suppressWarningIrritants = new IrritantSet(irritants);
              // TODO: should check for unused warning token against enclosing annotation as well ?
            } else {
              scope.problemReporter().unhandledWarningToken(value);
View Full Code Here

                  reportDuplicateCase((CaseStatement) statement, this.cases[j], length);
                }
              }
              this.constants[counter++] = key;
            } else {
              String key = constant.stringValue();
              //----check for duplicate case statement------------
              for (int j = 0; j < counter; j++) {
                if (this.stringConstants[j].equals(key)) {
                  reportDuplicateCase((CaseStatement) statement, this.cases[j], length);
                }
View Full Code Here

                Expression[] inits = initializer.expressions;
                if (inits != null) {
                  for (int iToken = 0, tokenCount = inits.length; iToken < tokenCount; iToken++) {
                    Constant cst = inits[iToken].constant;
                    if (cst != Constant.NotAConstant && cst.typeID() == TypeIds.T_JavaLangString) {
                      IrritantSet tokenIrritants = CompilerOptions.warningTokenToIrritants(cst.stringValue());
                      if (tokenIrritants != null
                          && !tokenIrritants.areAllSet() // no complaint against @SuppressWarnings("all")
                          && options.isAnyEnabled(tokenIrritants) // if irritant is effectively enabled
                          && (foundIrritants[iSuppress] == null || !foundIrritants[iSuppress].isAnySet(tokenIrritants))) { // if irritant had no matching problem
                        if (unusedWarningTokenIsWarning) {
View Full Code Here

                  }
                }
              } else {
                Constant cst = value.constant;
                if (cst != Constant.NotAConstant && cst.typeID() == T_JavaLangString) {
                  IrritantSet tokenIrritants = CompilerOptions.warningTokenToIrritants(cst.stringValue());
                  if (tokenIrritants != null
                      && !tokenIrritants.areAllSet() // no complaint against @SuppressWarnings("all")
                      && options.isAnyEnabled(tokenIrritants) // if irritant is effectively enabled
                      && (foundIrritants[iSuppress] == null || !foundIrritants[iSuppress].isAnySet(tokenIrritants))) { // if irritant had no matching problem
                    if (unusedWarningTokenIsWarning) {
View Full Code Here

        @Override
        public Object getValue() {
            Constant constant = mBinding.constant();
            if (constant != null) {
                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) {
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.