當前位置: 首頁>>代碼示例>>Java>>正文


Java IllegalArgumentException.printStackTrace方法代碼示例

本文整理匯總了Java中java.lang.IllegalArgumentException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java IllegalArgumentException.printStackTrace方法的具體用法?Java IllegalArgumentException.printStackTrace怎麽用?Java IllegalArgumentException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.lang.IllegalArgumentException的用法示例。


在下文中一共展示了IllegalArgumentException.printStackTrace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getByName

import java.lang.IllegalArgumentException; //導入方法依賴的package包/類
public static WorldGenerator getByName(String name) {
    WorldGenerator gen = generators.getOrDefault(name, null);

    if (gen == null) {
        try {
            throw new IllegalArgumentException("\"" + name + "\" is not a valid WorldGenerator");
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
            ArmadaCraft.getInstance().shutdown();
        }
    } else {
        return gen;
    }

    return null;
}
 
開發者ID:csnxs,項目名稱:armadacraft,代碼行數:17,代碼來源:WorldGenerator.java

示例2: checkReply

import java.lang.IllegalArgumentException; //導入方法依賴的package包/類
public boolean checkReply(primitives_t reply, int iteration) {
    try {
        int n = iteration;
        checkField(reply.i8, (byte)(n % 100), "i8");
        checkField(reply.i16, (short)(n * 10), "i16");
        checkField((long)reply.i64, (long)(n * 10000), "i64");
        checkField(reply.position[0], (float)n, "position[0]");
        checkField(reply.position[1], (float)n, "position[1]");
        checkField(reply.position[2], (float)n, "position[2]");
        checkField(reply.orientation[0], (double)n, "orientation[0]");
        checkField(reply.orientation[1], (double)n, "orientation[1]");
        checkField(reply.orientation[2], (double)n, "orientation[2]");
        checkField(reply.orientation[3], (double)n, "orientation[3]");
        checkField(reply.num_ranges, n, "num_ranges");
        for (int i = 0; i < reply.num_ranges; i++) {
            checkField(reply.ranges[i], (short)i, String.format("ranges[%d]", i));
        }
        checkField(reply.name, String.valueOf(n), "name");
        checkField(reply.enabled, n % 2 == 1, "enabled");
    } catch (IllegalArgumentException ex) {
        ex.printStackTrace(System.err);
        return false;
    }
    return true;
}
 
開發者ID:lcm-proj,項目名稱:lcm,代碼行數:26,代碼來源:LcmTestClient.java

示例3: onDestroy

import java.lang.IllegalArgumentException; //導入方法依賴的package包/類
@Override
public void onDestroy() {
    super.onDestroy();
    if(richRemoteInputReceiver != null) {
        try {
            this.cordova.getActivity().unregisterReceiver(richRemoteInputReceiver);
            richRemoteInputReceiver = null;    
        } catch(IllegalArgumentException e) {
            //not an error case
        	if(Log.isLoggable(RICHNOTI, Log.DEBUG))
            	Log.d(TAG, "unregistering receiver in onDestroy: " +e.getMessage());
            e.printStackTrace();
        }
    }
}
 
開發者ID:Samsung,項目名稱:CordovaPlugins,代碼行數:16,代碼來源:RichNotification.java


注:本文中的java.lang.IllegalArgumentException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。