当前位置: 首页>>代码示例>>Java>>正文


Java ArrayUtils.EMPTY_STRING_ARRAY属性代码示例

本文整理汇总了Java中org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtils.EMPTY_STRING_ARRAY属性的具体用法?Java ArrayUtils.EMPTY_STRING_ARRAY怎么用?Java ArrayUtils.EMPTY_STRING_ARRAY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.lang.ArrayUtils的用法示例。


在下文中一共展示了ArrayUtils.EMPTY_STRING_ARRAY属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRootCauseStackTrace

/**
 * <p>Creates a compact stack trace for the root cause of the supplied
 * <code>Throwable</code>.</p>
 *
 * <p>The output of this method is consistent across JDK versions.
 * It consists of the root exception followed by each of its wrapping
 * exceptions separated by '[wrapped]'. Note that this is the opposite
 * order to the JDK1.4 display.</p>
 *
 * @param throwable  the throwable to examine, may be null
 * @return an array of stack trace frames, never null
 * @since 2.0
 */
public static String[] getRootCauseStackTrace(Throwable throwable) {
    if (throwable == null) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }
    Throwable throwables[] = getThrowables(throwable);
    int count = throwables.length;
    ArrayList frames = new ArrayList();
    List nextTrace = getStackFrameList(throwables[count - 1]);
    for (int i = count; --i >= 0;) {
        List trace = nextTrace;
        if (i != 0) {
            nextTrace = getStackFrameList(throwables[i - 1]);
            removeCommonFrames(trace, nextTrace);
        }
        if (i == count - 1) {
            frames.add(throwables[i].toString());
        } else {
            frames.add(WRAPPED_MARKER + throwables[i].toString());
        }
        for (int j = 0; j < trace.size(); j++) {
            frames.add(trace.get(j));
        }
    }
    return (String[]) frames.toArray(new String[0]);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:38,代码来源:ExceptionUtils.java

示例2: getVolumeFailureSummary

@Override // FsDatasetSpi
public VolumeFailureSummary getVolumeFailureSummary() {
  return new VolumeFailureSummary(ArrayUtils.EMPTY_STRING_ARRAY, 0, 0);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:SimulatedFSDataset.java

示例3: getStackFrames

/**
 * <p>Captures the stack trace associated with the specified
 * <code>Throwable</code> object, decomposing it into a list of
 * stack frames.</p>
 *
 * <p>The result of this method vary by JDK version as this method
 * uses {@link Throwable#printStackTrace(java.io.PrintWriter)}.
 * On JDK1.3 and earlier, the cause exception will not be shown
 * unless the specified throwable alters printStackTrace.</p>
 *
 * @param throwable  the <code>Throwable</code> to examine, may be null
 * @return an array of strings describing each stack frame, never null
 */
public static String[] getStackFrames(Throwable throwable) {
    if (throwable == null) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }
    return getStackFrames(getStackTrace(throwable));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:ExceptionUtils.java

示例4: toNoNullStringArray

/**
 * Converts the given Collection into an array of Strings. The returned array does not contain <code>null</code>
 * entries. Note that {@link Arrays#sort(Object[])} will throw an {@link NullPointerException} if an array element 
 * is <code>null</code>.
 * 
 * @param collection
 *            The collection to convert
 * @return A new array of Strings.
 */
static String[] toNoNullStringArray(Collection collection) {
    if (collection == null) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }
    return toNoNullStringArray(collection.toArray());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:ReflectionToStringBuilder.java


注:本文中的org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。