当前位置: 首页>>代码示例>>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;未经允许,请勿转载。