Whether this type is the original constructor of a nominal type.
Does not include structural constructors.
433410
public final boolean isNominalConstructor() {
    if (isConstructor() || isInterface()) {
      FunctionType fn = toMaybeFunctionType();
      if (fn == null) {
        return false;
      }

      // Programmer-defined constructors will have a link
      // back to the original function in the source tree.
      // Structural constructors will not.
      if (fn.getSource() != null) {
        return true;
      }

      // Native constructors are always nominal.
      return fn.isNativeObjectType();
    }
    return false;
  }
1185282
private static boolean isConstructor(String methodName) {
        return Const.CONSTRUCTOR_NAME.equals(methodName) || Const.STATIC_INITIALIZER_NAME.equals(methodName) || "readObject".equals(methodName)
                || "clone".equals(methodName) || "close".equals(methodName) || "writeObject".equals(methodName)
                || "toString".equals(methodName) || "init".equals(methodName) || "initialize".equals(methodName)
                || "dispose".equals(methodName) || "finalize".equals(methodName) || "this".equals(methodName)
                || "_jspInit".equals(methodName) || "_jspDestroy".equals(methodName);

    }
1182538
function isPlainObject(val) {
  if (getTag(val) !== "object") {
    return false
  }

  const pp = getPrototype(val)

  if (pp === null || pp === void 0) {
    return true
  }

  const Ctor = pp.constructor && pp.constructor.toString()

  return Ctor === objectCtorString
}
821176
public boolean isType(final org.efaps.admin.datamodel.Type _type)
    {
        return getType().equals(_type);
    }
758626
function isClassConstructor(node) {
    return node.type === "FunctionExpression" &&
        node.parent &&
        node.parent.type === "MethodDefinition" &&
        node.parent.kind === "constructor";
}
942691
private boolean isSynthetic(Method m) {
        if ((m.getAccessFlags() & Const.ACC_SYNTHETIC) != 0) {
            return true;
        }
        Attribute[] attrs = m.getAttributes();
        for (Attribute attr : attrs) {
            if (attr instanceof Synthetic) {
                return true;
            }
        }
        return false;
    }
1190105
public boolean hasDefaultConstructor() {
	    if (!delegate.isPresent()) {
	        return false;
	    }
	    
	    final Constructor<?>[] constructors = delegateClass().getConstructors();
        for (final Constructor<?> constructor : constructors) {
            if (constructor.getParameterTypes().length == 0) {
                return true;
            }
        }
        
        return false;
	}
123472
private static boolean hasUnknownOrEmptySupertype(FunctionType ctor) {
    checkArgument(ctor.isConstructor() || ctor.isInterface());
    checkArgument(!ctor.isUnknownType());

    // The type system should notice inheritance cycles on its own
    // and break the cycle.
    while (true) {
      ObjectType maybeSuperInstanceType =
          ctor.getPrototype().getImplicitPrototype();
      if (maybeSuperInstanceType == null) {
        return false;
      }
      if (maybeSuperInstanceType.isUnknownType()
          || maybeSuperInstanceType.isEmptyType()) {
        return true;
      }
      ctor = maybeSuperInstanceType.getConstructor();
      if (ctor == null) {
        return false;
      }
      checkState(ctor.isConstructor() || ctor.isInterface());
    }
  }
871955
public static boolean isDesignatedConstructor(MethodDeclaration node) {
    if (!node.isConstructor()) {
      return false;
    }
    Block body = node.getBody();
    if (body == null) {
      return false;
    }
    List<Statement> stmts = body.getStatements();
    return (stmts.isEmpty() || !(stmts.get(0) instanceof ConstructorInvocation));
  }
1301843
private boolean verifyTypes()
    {
        SuccessAndResult<ThriftType> output = topologicalSort(thriftTypes, new Predicate<ThriftType>()
        {
            @Override
            public boolean apply(@Nullable ThriftType t)
            {
                ThriftProtocolType proto = checkNotNull(t).getProtocolType();
                if (proto == ThriftProtocolType.ENUM || proto == ThriftProtocolType.STRUCT) {
                    return verifyStruct(t, true);
                } else {
                    Preconditions.checkState(false, "Top-level non-enum and non-struct?");
                    return false;   // silence compiler
                }
            }
        });
        if (output.success) {
            thriftTypes = output.result;
            return true;
        } else {
            for (ThriftType t: output.result) {
                // we know it's gonna fail, we just want the precise error message
                verifyStruct(t, false);
            }
            return false;
        }
    }
328051
def is_fundamental(type_):
    """"""
    return does_match_definition(
        type_,
        cpptypes.fundamental_t,
        (cpptypes.const_t, cpptypes.volatile_t)) \
        or does_match_definition(
            type_,
            cpptypes.fundamental_t,
            (cpptypes.volatile_t, cpptypes.const_t))
1255731
def is_constructor(node):
    
    return (
        node.parent
        and isinstance(node.parent.scope(), astroid.nodes.ClassDef)
        and node.name == "__init__"
    )
1217249
public static boolean isPrimitive(Type type) {
        return type.equals(boolean.class)
                || type.equals(double.class)
                || type.equals(float.class)
                || type.equals(short.class)
                || type.equals(int.class)
                || type.equals(long.class)
                || type.equals(byte.class)
                || type.equals(char.class);
    }
753014
private static boolean isPrototypeMethodDefinition(Node node) {
    Node parent = node.getParent();
    Node grandparent = node.getGrandparent();
    if (parent == null || grandparent == null) {
      return false;
    }

    switch (node.getToken()) {
      case MEMBER_FUNCTION_DEF:
        if (NodeUtil.isEs6ConstructorMemberFunctionDef(node)) {
          return false; // Constructors aren't methods.
        }

        return true;

      case GETPROP:
        {
          // Case: `Foo.prototype.bar = function() { };
          if (parent.getFirstChild() != node) {
            return false;
          }

          if (!NodeUtil.isExprAssign(grandparent)) {
            return false;
          }

          Node functionNode = parent.getLastChild();
          if ((functionNode == null) || !functionNode.isFunction()) {
            return false;
          }

          Node nameNode = node.getFirstChild();
          return nameNode.isGetProp() && nameNode.getLastChild().getString().equals("prototype");
        }

      case STRING_KEY:
        {
          // Case: `Foo.prototype = {
          //          bar: function() { },
          //        }`
          checkArgument(parent.isObjectLit(), parent);

          if (!grandparent.isAssign()) {
            return false;
          }

          if (grandparent.getLastChild() != parent) {
            return false;
          }

          Node greatgrandparent = grandparent.getParent();
          if (greatgrandparent == null || !greatgrandparent.isExprResult()) {
            return false;
          }

          Node functionNode = node.getFirstChild();
          if ((functionNode == null) || !functionNode.isFunction()) {
            return false;
          }

          Node target = grandparent.getFirstChild();
          return target.isGetProp() && target.getLastChild().getString().equals("prototype");
        }

      default:
        return false;
    }
  }
382620
private static boolean typeMayHaveInvariant(Type type, Context context) {
		if (type instanceof Type.Void) {
			return false;
		} else if (type instanceof Type.Null) {
			return false;
		} else if (type instanceof Type.Bool) {
			return false;
		} else if (type instanceof Type.Byte) {
			return false;
		} else if (type instanceof Type.Int) {
			return false;
		} else if (type instanceof Type.Array) {
			Type.Array lt = (Type.Array) type;
			return typeMayHaveInvariant(lt.getElement(), context);
		} else if (type instanceof Type.Record) {
			Type.Record rt = (Type.Record) type;
			Tuple<Type.Field> fields = rt.getFields();
			for (int i = 0; i != fields.size(); ++i) {
				Type.Field field = fields.get(i);
				if (typeMayHaveInvariant(field.getType(), context)) {
					return true;
				}
			}
			return false;
		} else if (type instanceof Type.Reference) {
			Type.Reference lt = (Type.Reference) type;
			return typeMayHaveInvariant(lt.getElement(), context);
		} else if (type instanceof Type.Union) {
			Type.Union t = (Type.Union) type;
			for (int i = 0; i != t.size(); ++i) {
				if (typeMayHaveInvariant(t.get(i), context)) {
					return true;
				}
			}
			return false;
		} else if (type instanceof Type.Callable) {
			Type.Callable ft = (Type.Callable) type;
			return typeMayHaveInvariant(ft.getParameters(), context) || typeMayHaveInvariant(ft.getReturns(), context);
		} else if (type instanceof Type.Nominal) {
			Type.Nominal nt = (Type.Nominal) type;
			// HACK
			return true;
		} else if (type instanceof Type.Variable) {
			// FIXME: unsure what the right solution is here?
			return true;
		} else {
			throw new RuntimeException("unknown type encountered (" + type + ")");
		}
	}
946285
public static boolean isResolved(Type type) {
    if (type instanceof GenericArrayType) {
      return isResolved(((GenericArrayType) type).getGenericComponentType());
    }
    if (type instanceof ParameterizedType) {
      for (Type t : ((ParameterizedType) type).getActualTypeArguments()) {
        if (!isResolved(t)) {
          return false;
        }
      }
      return true;
    }
    return type instanceof Class;
  }
1090797
public static boolean isInitialConstructor(JCTree tree) {
        JCMethodInvocation app = firstConstructorCall(tree);
        if (app == null) return false;
        Name meth = name(app.meth);
        return meth == null || meth != meth.table.names._this;
    }