Integer.parseInt("5")
和Long.parseLong("5")
在Eclipse Expressions窗口中抛出UnsupportedOperationException
。parseInt和parseLong引发一个UnsupportedOperationException异常
我想这也是我在运行时获得,但作为Eclipse的新的异常,我不知道如何找到的e
调试会话中的类型:
public static long longTryParse(String text, long fallbackValue) {
try {
return Long.parseLong(text);
} catch (Exception e) {
return fallbackValue; // When stopping at a breakpoint here, Eclipse says that e is of type 'Exception'. Well, that's informative.
}
}
所以......
- 这些是有效的声明?
- 如果是这样,为什么我会得到异常?
- (重要性不大)为什么Eclipse在调试会话期间不会说e的类型是UnsupportedOperationException而不是Exception?
谢谢!
重启Eclipse与clean选项,也许它可以帮助 – 2011-04-01 06:25:30