Checks if the constant pool contains the provided long constant, which implies the constant is used somewhere in the code.

NB: compile-time constant expressions are evaluated at compile time.
327753
public boolean containsLong(long value) {
		for (int i = 1; i < maxPoolSize; i++) {
			if (types[i] == LONG && readLong(i) == value) return true;
		}
		return false;
	}
481280
public static boolean isLong(String input) {
        try {
            Long.parseLong(input);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
914288
def p_constant_declaration(p):
    ''
    p[0] = ast.ConstantDeclaration(p[1], p[3], lineno=p.lineno(1))
327775
public void ldc(String constant) throws IOException
    {
        int index = subClass.resolveConstantIndex(constant);
        super.ldc(index);
    }
1190318
public static boolean isConstantOrLiteral(Expression expression) {
        if (expression instanceof ConstantExpression) return true;
        if (expression instanceof ListExpression) return true;
        if (expression instanceof MapExpression) return true;
        return isPredefinedConstant(expression);
    }
539559
public static boolean isDeclarationLValue(Node n) {
    boolean isLValue = isLValue(n);

    if (!isLValue) {
      return false;
    }

    Node parent = n.getParent();

    switch (parent.getToken()) {
      case IMPORT_SPEC:
      case VAR:
      case LET:
      case CONST:
      case PARAM_LIST:
      case IMPORT:
      case CATCH:
      case CLASS:
      case FUNCTION:
        return true;
      case STRING_KEY:
        return isNameDeclaration(parent.getParent().getGrandparent());
      case OBJECT_PATTERN:
      case ARRAY_PATTERN:
        return isNameDeclaration(parent.getGrandparent());
      default:
        return false;
    }
  }
928085
@Override
    public void sawOpcode(int seen) {
        boolean allConstantStrings = false;
        boolean sawConstant = false;
        try {
            stack.precomputation(this);

            if (seen == Const.ATHROW) {
                checkForWEM();
            } else if ((seen == Const.LDC) || (seen == Const.LDC_W)) {
                if (getConstantRefOperand() instanceof ConstantString) {
                    sawConstant = true;
                }
            } else if ((seen == Const.INVOKESPECIAL) && Values.CONSTRUCTOR.equals(getNameConstantOperand())) {
                String clsName = getClassConstantOperand();
                if (clsName.indexOf("Exception") < 0) {
                    return;
                }
                JavaClass exCls = Repository.lookupClass(clsName);
                if (!exCls.instanceOf(exceptionClass)) {
                    return;
                }
                String sig = getSigConstantOperand();
                List<String> argTypes = SignatureUtils.getParameterSignatures(sig);
                int stringParms = 0;
                for (int t = 0; t < argTypes.size(); t++) {
                    if (!Values.SIG_JAVA_LANG_STRING.equals(argTypes.get(t))) {
                        continue;
                    }
                    stringParms++;
                    int stackOffset = argTypes.size() - t - 1;
                    if ((stack.getStackDepth() > stackOffset) && (stack.getStackItem(stackOffset).getUserValue() == null)) {
                        return;
                    }
                }
                if (Values.SLASHED_JAVA_LANG_EXCEPTION.equals(clsName) && SignatureBuilder.SIG_THROWABLE_TO_VOID.equals(getSigConstantOperand())) {
                    bugReporter.reportBug(
                            new BugInstance(this, BugType.WEM_OBSCURING_EXCEPTION.name(), LOW_PRIORITY).addClass(this).addMethod(this).addSourceLine(this));
                }
                allConstantStrings = stringParms > 0;
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            TernaryPatcher.pre(stack, seen);
            stack.sawOpcode(this, seen);
            TernaryPatcher.post(stack, seen);
            if ((sawConstant || allConstantStrings) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(Boolean.TRUE);
            }
        }
    }
1317787
boolean isCodeInCCLength(int encLength, int code) {
        boolean found;

        if (encLength > 1 || code >= BitSet.SINGLE_BYTE_SIZE) {
            if (mbuf == null) {
                found = false;
            } else {
                found = CodeRange.isInCodeRange(mbuf.getCodeRange(), code);
            }
        } else {
            found = bs.at(code);
        }

        if (isNot()) {
            return !found;
        } else {
            return found;
        }
    }
1010247
private SemanticType checkConstant(Expr.Constant expr, Environment env) {
		Value item = expr.getValue();
		switch (item.getOpcode()) {
		case ITEM_null:
			return Type.Null;
		case ITEM_bool:
			return Type.Bool;
		case ITEM_int:
			return Type.Int;
		case ITEM_byte:
			return Type.Byte;
		case ITEM_utf8:
			// FIXME: this is not an optimal solution. The reason being that we
			// have lost nominal information regarding whether it is an instance
			// of std::ascii or std::utf8, for example.
			return new SemanticType.Array(Type.Int);
		default:
			return internalFailure("unknown constant encountered: " + expr, expr);
		}
	}
606834
private boolean matchLong(final ByteBuffer bbuf, final ByteOrder bo, final boolean needMask, final long lMask) throws IOException {
		bbuf.order(bo);
		long got;
		final String testContent = getContent();
		if (testContent.startsWith("0x")) {
			got = Long.parseLong(testContent.substring(2), 16);
		} else if (testContent.startsWith("&")) {
			got = Long.parseLong(testContent.substring(3), 16);
		} else {
			got = Long.parseLong(testContent);
		}

		long found = bbuf.getInt();

		if (needMask) {
			found = (short) (found & lMask);
		}

		if (got != found) {
			return false;
		}

		return true;
	}
977109
static boolean hasDuplicateDeclarationSuppression(
      AbstractCompiler compiler, Node n, Node origVar) {
    // For VarCheck and VariableReferenceCheck, variables in externs do not generate duplicate
    // warnings.
    if (isExternNamespace(n)) {
      return true;
    }
    return TypeValidator.hasDuplicateDeclarationSuppression(compiler, origVar);
  }
699397
def isconst(cls, val):
        ''' 

        '''
        return isinstance(val, string_types) and \
               ((len(val) == 7 and val[0] == "#") or val in enums.NamedColor)
326412
def _handle_constant(self, node, scope, ctxt, stream):
        
        self._dlog("handling constant type {}".format(node.type))
        switch = {
            "int": (self._str_to_int, self._choose_const_int_class),
            "long": (self._str_to_int, self._choose_const_int_class),
            # TODO this isn't quite right, but py010parser wouldn't have
            # parsed it if it wasn't correct...
            "float": (lambda x: float(x.lower().replace("f", "")), fields.Float),
            "double": (float, fields.Double),

            # cut out the quotes
            "char": (lambda x: ord(utils.string_escape(x[1:-1])), fields.Char),

            # TODO should this be unicode?? will probably bite me later...
            # cut out the quotes
            "string": (lambda x: str(utils.string_escape(x[1:-1])), fields.String)
        }

        if node.type in switch:
            #return switch[node.type](node.value)
            conversion,field_cls = switch[node.type]
            val = conversion(node.value)

            if hasattr(field_cls, "__call__") and not type(field_cls) is type:
                field_cls = field_cls(val)

            field = field_cls()
            field._pfp__set_value(val)
            return field

        raise UnsupportedConstantType(node.coord, node.type)
1175693
private ConstantPoolEntry parseConstantPoolEntry(int index)
    throws IOException
  {
    int tag = read();

    switch (tag) {
    case CP_CLASS:
      return parseClassConstant(index);
      
    case CP_FIELD_REF:
      return parseFieldRefConstant(index);
      
    case CP_METHOD_REF:
      return parseMethodRefConstant(index);
      
    case CP_INTERFACE_METHOD_REF:
      return parseInterfaceMethodRefConstant(index);
      
    case CP_STRING:
      return parseStringConstant(index);
      
    case CP_INTEGER:
      return parseIntegerConstant(index);
      
    case CP_FLOAT:
      return parseFloatConstant(index);
      
    case CP_LONG:
      return parseLongConstant(index);
      
    case CP_DOUBLE:
      return parseDoubleConstant(index);
      
    case CP_NAME_AND_TYPE:
      return parseNameAndTypeConstant(index);
      
    case CP_UTF8:
      return parseUtf8Constant(index);

    default:
      throw error(L.l("'{0}' is an unknown constant pool type.",
                      tag));
    }
  }
685813
public boolean containsValue(final Object value) {
	return ! forEachPair( 
		new LongObjectProcedure() {
			public boolean apply(long iterKey, Object iterValue) {
				return (value != iterValue);
			}
		}
	);
}
93278
private static boolean isDeclaration(Node n) {
    switch (n.getParent().getToken()) {
      case LET:
      case CONST:
      case VAR:
      case CATCH:
        return true;
      case FUNCTION:
        return n == n.getParent().getFirstChild();

      case PARAM_LIST:
        return n.getGrandparent().isFunction();

      default:
        return false;
    }
  }
1263150
private boolean isLong(final String str) {
		try {
			Long.valueOf(str);
			return true;
		} catch (NumberFormatException e) {
			return false;
		}
	}