com.alibaba.citrus.util.Assert.unreachableCode()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中com.alibaba.citrus.util.Assert.unreachableCode()方法的一些代码示例,展示了Assert.unreachableCode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.unreachableCode()方法的具体详情如下:
包路径:com.alibaba.citrus.util.Assert
类名称:Assert
方法名:unreachableCode

Assert.unreachableCode介绍

[英]不可能到达的代码。
[中]不可能到达的代码。

代码示例

代码示例来源:origin: webx/citrus

/** 不可能到达的代码。 */
public static <T> T unreachableCode() {
  unreachableCode(null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

public ConfigurationPoints getConfigurationPoints() {
  for (Schemas schemas : this) {
    if (schemas instanceof ConfigurationPoints) {
      return (ConfigurationPoints) schemas;
    }
  }
  unreachableCode("no ConfigurationPoints found");
  return null;
}

代码示例来源:origin: webx/citrus

/** 不可能到达的代码。 */
public static <T> T unreachableCode() {
  unreachableCode(null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

@Override
  protected T get(int i) {
    unreachableCode();
    return null;
  }
};

代码示例来源:origin: webx/citrus

public ConfigurationPoints getConfigurationPoints() {
  for (Schemas schemas : this) {
    if (schemas instanceof ConfigurationPoints) {
      return (ConfigurationPoints) schemas;
    }
  }
  unreachableCode("no ConfigurationPoints found");
  return null;
}

代码示例来源:origin: webx/citrus

@Override
protected String escape(String strValue) {
  unreachableCode();
  return strValue;
}

代码示例来源:origin: webx/citrus

/** 不可能到达的代码。 */
public static <T> T unreachableCode() {
  unreachableCode(null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

public ConfigurationPoints getConfigurationPoints() {
  for (Schemas schemas : this) {
    if (schemas instanceof ConfigurationPoints) {
      return (ConfigurationPoints) schemas;
    }
  }
  unreachableCode("no ConfigurationPoints found");
  return null;
}

代码示例来源:origin: webx/citrus

@Override
  protected T get(int i) {
    unreachableCode();
    return null;
  }
};

代码示例来源:origin: webx/citrus

@Override
  protected T get(int i) {
    unreachableCode();
    return null;
  }
};

代码示例来源:origin: webx/citrus

@Override
protected String escape(String strValue) {
  unreachableCode();
  return strValue;
}

代码示例来源:origin: webx/citrus

public void push(Type type) {
  Class<?> interfaceClass = null;
  if (type instanceof Class<?>) {
    interfaceClass = (Class<?>) type;
  } else if (type instanceof ParameterizedType) {
    interfaceClass = (Class<?>) ((ParameterizedType) type).getRawType();
  } else {
    unreachableCode("Unexpected interface type: %s", type);
  }
  if (!visited.contains(interfaceClass)) {
    queue.addLast(type);
    visited.add(interfaceClass);
  }
}

代码示例来源:origin: webx/citrus

public void push(Type type) {
  Class<?> interfaceClass = null;
  if (type instanceof Class<?>) {
    interfaceClass = (Class<?>) type;
  } else if (type instanceof ParameterizedType) {
    interfaceClass = (Class<?>) ((ParameterizedType) type).getRawType();
  } else {
    unreachableCode("Unexpected interface type: %s", type);
  }
  if (!visited.contains(interfaceClass)) {
    queue.addLast(type);
    visited.add(interfaceClass);
  }
}

代码示例来源:origin: webx/citrus

public void push(Type type) {
  Class<?> interfaceClass = null;
  if (type instanceof Class<?>) {
    interfaceClass = (Class<?>) type;
  } else if (type instanceof ParameterizedType) {
    interfaceClass = (Class<?>) ((ParameterizedType) type).getRawType();
  } else {
    unreachableCode("Unexpected interface type: %s", type);
  }
  if (!visited.contains(interfaceClass)) {
    queue.addLast(type);
    visited.add(interfaceClass);
  }
}

代码示例来源:origin: webx/citrus

private String getName(String path) {
  int fromIndex = this.category ? path.length() - 2 : path.length();
  try {
    return unescapeURL(
        path.substring(path.lastIndexOf("/", fromIndex) + 1, path.length() - (this.category ? 1 : 0)),
        "UTF-8");
  } catch (UnsupportedEncodingException e) {
    unreachableCode();
    return null;
  }
}

代码示例来源:origin: webx/citrus

private String getName(String path) {
  int fromIndex = this.category ? path.length() - 2 : path.length();
  try {
    return unescapeURL(
        path.substring(path.lastIndexOf("/", fromIndex) + 1, path.length() - (this.category ? 1 : 0)),
        "UTF-8");
  } catch (UnsupportedEncodingException e) {
    unreachableCode();
    return null;
  }
}

代码示例来源:origin: webx/citrus

@Override
  protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
    Object beanOrRef = SpringExtUtil.parseBean(element, parserContext, parserContext.getContainingBeanDefinition());
    AbstractBeanDefinition abd;

    if (beanOrRef instanceof BeanReference) {
      BeanDefinitionBuilder refBean = BeanDefinitionBuilder.genericBeanDefinition(BeanReferenceFactoryBean.class);

      refBean.addPropertyValue("targetBeanName", ((RuntimeBeanReference) beanOrRef).getBeanName());
      abd = refBean.getBeanDefinition();
    } else if (beanOrRef instanceof BeanDefinitionHolder) {
      BeanDefinition bd = ((BeanDefinitionHolder) beanOrRef).getBeanDefinition();
      assertTrue(bd instanceof AbstractBeanDefinition, "unexpected bean definition type: %s", bd);
      abd = (AbstractBeanDefinition) bd;
    } else {
      abd = null;
      unreachableCode("unexpected bean definition type: %s", beanOrRef);
    }

    return abd;
  }
}

代码示例来源:origin: webx/citrus

@Override
  protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
    Object beanOrRef = SpringExtUtil.parseBean(element, parserContext, parserContext.getContainingBeanDefinition());
    AbstractBeanDefinition abd;

    if (beanOrRef instanceof BeanReference) {
      BeanDefinitionBuilder refBean = BeanDefinitionBuilder.genericBeanDefinition(BeanReferenceFactoryBean.class);

      refBean.addPropertyValue("targetBeanName", ((RuntimeBeanReference) beanOrRef).getBeanName());
      abd = refBean.getBeanDefinition();
    } else if (beanOrRef instanceof BeanDefinitionHolder) {
      BeanDefinition bd = ((BeanDefinitionHolder) beanOrRef).getBeanDefinition();
      assertTrue(bd instanceof AbstractBeanDefinition, "unexpected bean definition type: %s", bd);
      abd = (AbstractBeanDefinition) bd;
    } else {
      abd = null;
      unreachableCode("unexpected bean definition type: %s", beanOrRef);
    }

    return abd;
  }
}

代码示例来源:origin: webx/citrus

public void visitTrace(String param) {
  if ("resourceName".equals(param)) {
    out().print(escapeHtml(traceElement.getResourceName()));
  } else if ("patternType".equals(param)) {
    out().print(escapeHtml(traceElement.getPatternType()));
  } else if ("patternName".equals(param)) {
    out().print(escapeHtml(traceElement.getPatternName()));
  } else if ("serviceName".equals(param)) {
    out().print(escapeHtml(traceElement.getBeanName()));
  } else if ("serviceLocation".equals(param)) {
    out().print(escapeHtml(traceElement.getConfigLocation()));
  } else if ("serviceLocationShort".equals(param)) {
    out().print(escapeHtml(traceElement.getShortLocation()));
  } else {
    unreachableCode();
  }
}

代码示例来源:origin: webx/citrus

public void visitTrace(String param) {
  if ("resourceName".equals(param)) {
    out().print(escapeHtml(traceElement.getResourceName()));
  } else if ("patternType".equals(param)) {
    out().print(escapeHtml(traceElement.getPatternType()));
  } else if ("patternName".equals(param)) {
    out().print(escapeHtml(traceElement.getPatternName()));
  } else if ("serviceName".equals(param)) {
    out().print(escapeHtml(traceElement.getBeanName()));
  } else if ("serviceLocation".equals(param)) {
    out().print(escapeHtml(traceElement.getConfigLocation()));
  } else if ("serviceLocationShort".equals(param)) {
    out().print(escapeHtml(traceElement.getShortLocation()));
  } else {
    unreachableCode();
  }
}

相关文章