コード例 #1
0
    public static JavaKind selectComponentKind(BasicArrayCopyNode arraycopy, boolean exact) {
      ResolvedJavaType srcType = StampTool.typeOrNull(arraycopy.getSource().stamp());
      ResolvedJavaType destType = StampTool.typeOrNull(arraycopy.getDestination().stamp());

      if (srcType == null || !srcType.isArray() || destType == null || !destType.isArray()) {
        if (!exact) {
          JavaKind component = getComponentKind(srcType);
          if (component != null) {
            return component;
          }
          return getComponentKind(destType);
        }
        return null;
      }
      if (exact) {
        if (!destType.getComponentType().isAssignableFrom(srcType.getComponentType())) {
          return null;
        }
        if (!arraycopy.isExact()) {
          return null;
        }
      }
      return srcType.getComponentType().getJavaKind();
    }