Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
12d023bd
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
12d023bd
编写于
1月 07, 2010
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6915171: Clarify checked/unchecked status of Throwable and its subclasses
Reviewed-by: dholmes
上级
e1a13723
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
38 addition
and
18 deletion
+38
-18
src/share/classes/java/lang/Error.java
src/share/classes/java/lang/Error.java
+11
-7
src/share/classes/java/lang/Exception.java
src/share/classes/java/lang/Exception.java
+12
-4
src/share/classes/java/lang/RuntimeException.java
src/share/classes/java/lang/RuntimeException.java
+9
-7
src/share/classes/java/lang/Throwable.java
src/share/classes/java/lang/Throwable.java
+6
-0
未找到文件。
src/share/classes/java/lang/Error.java
浏览文件 @
12d023bd
...
@@ -26,27 +26,31 @@
...
@@ -26,27 +26,31 @@
package
java.lang
;
package
java.lang
;
/**
/**
* An
<code>Error</code> is a subclass of <code>Throwable</code>
* An
{@code Error} is a subclass of {@code Throwable}
* that indicates serious problems that a reasonable application
* that indicates serious problems that a reasonable application
* should not try to catch. Most such errors are abnormal conditions.
* should not try to catch. Most such errors are abnormal conditions.
* The
<code>ThreadDeath</code>
error, though a "normal" condition,
* The
{@code ThreadDeath}
error, though a "normal" condition,
* is also a subclass of
<code>Error</code>
because most applications
* is also a subclass of
{@code Error}
because most applications
* should not try to catch it.
* should not try to catch it.
* <p>
* <p>
* A method is not required to declare in its
<code>throws</code>
* A method is not required to declare in its
{@code throws}
* clause any subclasses of
<code>Error</code>
that might be thrown
* clause any subclasses of
{@code Error}
that might be thrown
* during the execution of the method but not caught, since these
* during the execution of the method but not caught, since these
* errors are abnormal conditions that should never occur.
* errors are abnormal conditions that should never occur.
*
*
* That is, {@code Error} and its subclasses are regarded as unchecked
* exceptions for the purposes of compile-time checking of exceptions.
*
* @author Frank Yellin
* @author Frank Yellin
* @see java.lang.ThreadDeath
* @see java.lang.ThreadDeath
* @jls3 11.2 Compile-Time Checking of Exceptions
* @since JDK1.0
* @since JDK1.0
*/
*/
public
class
Error
extends
Throwable
{
public
class
Error
extends
Throwable
{
static
final
long
serialVersionUID
=
4980196508277280342L
;
static
final
long
serialVersionUID
=
4980196508277280342L
;
/**
/**
* Constructs a new error with
<code>null</code>
as its detail message.
* Constructs a new error with
{@code null}
as its detail message.
* The cause is not initialized, and may subsequently be initialized by a
* The cause is not initialized, and may subsequently be initialized by a
* call to {@link #initCause}.
* call to {@link #initCause}.
*/
*/
...
@@ -69,7 +73,7 @@ public class Error extends Throwable {
...
@@ -69,7 +73,7 @@ public class Error extends Throwable {
/**
/**
* Constructs a new error with the specified detail message and
* Constructs a new error with the specified detail message and
* cause. <p>Note that the detail message associated with
* cause. <p>Note that the detail message associated with
*
<code>cause</code>
is <i>not</i> automatically incorporated in
*
{@code cause}
is <i>not</i> automatically incorporated in
* this error's detail message.
* this error's detail message.
*
*
* @param message the detail message (which is saved for later retrieval
* @param message the detail message (which is saved for later retrieval
...
...
src/share/classes/java/lang/Exception.java
浏览文件 @
12d023bd
...
@@ -26,19 +26,27 @@
...
@@ -26,19 +26,27 @@
package
java.lang
;
package
java.lang
;
/**
/**
* The class
<code>Exception</code>
and its subclasses are a form of
* The class
{@code Exception}
and its subclasses are a form of
*
<code>Throwable</code>
that indicates conditions that a reasonable
*
{@code Throwable}
that indicates conditions that a reasonable
* application might want to catch.
* application might want to catch.
*
*
* <p>The class {@code Exception} and any subclasses that are not also
* subclasses of {@link RuntimeException} are <em>checked
* exceptions</em>. Checked exceptions need to be declared in a
* method or constructor's {@code throws} clause if they can be thrown
* by the execution of the method or constructor and propagate outside
* the method or constructor boundary.
*
* @author Frank Yellin
* @author Frank Yellin
* @see java.lang.Error
* @see java.lang.Error
* @jls3 11.2 Compile-Time Checking of Exceptions
* @since JDK1.0
* @since JDK1.0
*/
*/
public
class
Exception
extends
Throwable
{
public
class
Exception
extends
Throwable
{
static
final
long
serialVersionUID
=
-
3387516993124229948L
;
static
final
long
serialVersionUID
=
-
3387516993124229948L
;
/**
/**
* Constructs a new exception with
<code>null</code>
as its detail message.
* Constructs a new exception with
{@code null}
as its detail message.
* The cause is not initialized, and may subsequently be initialized by a
* The cause is not initialized, and may subsequently be initialized by a
* call to {@link #initCause}.
* call to {@link #initCause}.
*/
*/
...
@@ -61,7 +69,7 @@ public class Exception extends Throwable {
...
@@ -61,7 +69,7 @@ public class Exception extends Throwable {
/**
/**
* Constructs a new exception with the specified detail message and
* Constructs a new exception with the specified detail message and
* cause. <p>Note that the detail message associated with
* cause. <p>Note that the detail message associated with
*
<code>cause</code>
is <i>not</i> automatically incorporated in
*
{@code cause}
is <i>not</i> automatically incorporated in
* this exception's detail message.
* this exception's detail message.
*
*
* @param message the detail message (which is saved for later retrieval
* @param message the detail message (which is saved for later retrieval
...
...
src/share/classes/java/lang/RuntimeException.java
浏览文件 @
12d023bd
...
@@ -26,22 +26,24 @@
...
@@ -26,22 +26,24 @@
package
java.lang
;
package
java.lang
;
/**
/**
*
<code>RuntimeException</code>
is the superclass of those
*
{@code RuntimeException}
is the superclass of those
* exceptions that can be thrown during the normal operation of the
* exceptions that can be thrown during the normal operation of the
* Java Virtual Machine.
* Java Virtual Machine.
* <p>
* A method is not required to declare in its <code>throws</code>
* clause any subclasses of <code>RuntimeException</code> that might
* be thrown during the execution of the method but not caught.
*
*
* <p>{@code RuntimeException} and its subclasses are <em>unchecked
* exceptions</em>. Unchecked exceptions do <em>not</em> need to be
* declared in a method or constructor's {@code throws} clause if they
* can be thrown by the execution of the method or constructor and
* propagate outside the method or constructor boundary.
*
*
* @author Frank Yellin
* @author Frank Yellin
* @jls3 11.2 Compile-Time Checking of Exceptions
* @since JDK1.0
* @since JDK1.0
*/
*/
public
class
RuntimeException
extends
Exception
{
public
class
RuntimeException
extends
Exception
{
static
final
long
serialVersionUID
=
-
7034897190745766939L
;
static
final
long
serialVersionUID
=
-
7034897190745766939L
;
/** Constructs a new runtime exception with
<code>null</code>
as its
/** Constructs a new runtime exception with
{@code null}
as its
* detail message. The cause is not initialized, and may subsequently be
* detail message. The cause is not initialized, and may subsequently be
* initialized by a call to {@link #initCause}.
* initialized by a call to {@link #initCause}.
*/
*/
...
@@ -63,7 +65,7 @@ public class RuntimeException extends Exception {
...
@@ -63,7 +65,7 @@ public class RuntimeException extends Exception {
/**
/**
* Constructs a new runtime exception with the specified detail message and
* Constructs a new runtime exception with the specified detail message and
* cause. <p>Note that the detail message associated with
* cause. <p>Note that the detail message associated with
*
<code>cause</code>
is <i>not</i> automatically incorporated in
*
{@code cause}
is <i>not</i> automatically incorporated in
* this runtime exception's detail message.
* this runtime exception's detail message.
*
*
* @param message the detail message (which is saved for later retrieval
* @param message the detail message (which is saved for later retrieval
...
...
src/share/classes/java/lang/Throwable.java
浏览文件 @
12d023bd
...
@@ -34,6 +34,11 @@ import java.io.*;
...
@@ -34,6 +34,11 @@ import java.io.*;
* this class or one of its subclasses can be the argument type in a
* this class or one of its subclasses can be the argument type in a
* <code>catch</code> clause.
* <code>catch</code> clause.
*
*
* For the purposes of compile-time checking of exceptions, {@code
* Throwable} and any subclass of {@code Throwable} that is not also a
* subclass of either {@link RuntimeException} or {@link Error} are
* regarded as checked exceptions.
*
* <p>Instances of two subclasses, {@link java.lang.Error} and
* <p>Instances of two subclasses, {@link java.lang.Error} and
* {@link java.lang.Exception}, are conventionally used to indicate
* {@link java.lang.Exception}, are conventionally used to indicate
* that exceptional situations have occurred. Typically, these instances
* that exceptional situations have occurred. Typically, these instances
...
@@ -142,6 +147,7 @@ import java.io.*;
...
@@ -142,6 +147,7 @@ import java.io.*;
* @author unascribed
* @author unascribed
* @author Josh Bloch (Added exception chaining and programmatic access to
* @author Josh Bloch (Added exception chaining and programmatic access to
* stack trace in 1.4.)
* stack trace in 1.4.)
* @jls3 11.2 Compile-Time Checking of Exceptions
* @since JDK1.0
* @since JDK1.0
*/
*/
public
class
Throwable
implements
Serializable
{
public
class
Throwable
implements
Serializable
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录