Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
c877e26d
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c877e26d
编写于
5月 09, 2011
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7021645: Project Coin: Minor improvements to java.lang.Throwable
Reviewed-by: mduigou
上级
70482eb0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
5 deletion
+23
-5
jdk/src/share/classes/java/lang/Throwable.java
jdk/src/share/classes/java/lang/Throwable.java
+23
-5
未找到文件。
jdk/src/share/classes/java/lang/Throwable.java
浏览文件 @
c877e26d
...
...
@@ -336,7 +336,10 @@ public class Throwable implements Serializable {
* Disabling of suppression should only occur in exceptional
* circumstances where special requirements exist, such as a
* virtual machine reusing exception objects under low-memory
* situations.
* situations. Circumstances where a given exception object is
* repeatedly caught and rethrown, such as to implement control
* flow between two sub-systems, is another situation where
* immutable throwable objects would be appropriate.
*
* @param message the detail message.
* @param cause the cause. (A {@code null} value is permitted,
...
...
@@ -423,6 +426,18 @@ public class Throwable implements Serializable {
* {@link #Throwable(String,Throwable)}, this method cannot be called
* even once.
*
* <p>An example of using this method on a legacy throwable type
* without other support for setting the cause is:
*
* <pre>
* try {
* lowLevelOp();
* } catch (LowLevelException le) {
* throw (HighLevelException)
* new HighLevelException().initCause(le); // Legacy constructor
* }
* </pre>
*
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or
...
...
@@ -788,7 +803,8 @@ public class Throwable implements Serializable {
* this throwable is permitted to return a zero-length array from this
* method. Generally speaking, the array returned by this method will
* contain one element for every frame that would be printed by
* {@code printStackTrace}.
* {@code printStackTrace}. Writes to the returned array do not
* affect future calls to this method.
*
* @return an array of stack trace elements representing the stack trace
* pertaining to this throwable.
...
...
@@ -971,8 +987,8 @@ public class Throwable implements Serializable {
/**
* Appends the specified exception to the exceptions that were
* suppressed in order to deliver this exception. This method is
* t
ypically called (automatically and implicitly) by the {@code
* try}-with-resources statement.
* t
hread-safe and typically called (automatically and implicitly)
*
by the {@code
try}-with-resources statement.
*
* <p>The suppression behavior is enabled <em>unless</em> disabled
* {@linkplain #Throwable(String, Throwable, boolean, boolean) via
...
...
@@ -1043,7 +1059,9 @@ public class Throwable implements Serializable {
*
* If no exceptions were suppressed or {@linkplain
* #Throwable(String, Throwable, boolean, boolean) suppression is
* disabled}, an empty array is returned.
* disabled}, an empty array is returned. This method is
* thread-safe. Writes to the returned array do not affect future
* calls to this method.
*
* @return an array containing all of the exceptions that were
* suppressed to deliver this exception.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录