當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。