本文整理汇总了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;
}
示例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;
}
示例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();
}
}
}