-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
package org.json; | ||
|
||
/** | ||
* The JSONException is thrown by the JSON.org classes when things are amiss. | ||
* @author JSON.org | ||
* @version 2010-12-24 | ||
*/ | ||
public class JSONException extends Exception { | ||
private static final long serialVersionUID = 0; | ||
private Throwable cause; | ||
|
||
/** | ||
* Constructs a JSONException with an explanatory message. | ||
* @param message Detail about the reason for the exception. | ||
*/ | ||
public JSONException(String message) { | ||
super(message); | ||
} | ||
|
||
public JSONException(Throwable cause) { | ||
super(cause.getMessage()); | ||
this.cause = cause; | ||
} | ||
|
||
public Throwable getCause() { | ||
return this.cause; | ||
} | ||
} | ||
package org.json; | ||
|
||
/** | ||
* The JSONException is thrown by the JSON.org classes when things are amiss. | ||
* | ||
* @author JSON.org | ||
* @version 2013-02-10 | ||
*/ | ||
public class JSONException extends RuntimeException { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
private static final long serialVersionUID = 0; | ||
private Throwable cause; | ||
|
||
/** | ||
* Constructs a JSONException with an explanatory message. | ||
* | ||
* @param message | ||
* Detail about the reason for the exception. | ||
*/ | ||
public JSONException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a new JSONException with the specified cause. | ||
*/ | ||
public JSONException(Throwable cause) { | ||
super(cause.getMessage()); | ||
this.cause = cause; | ||
} | ||
|
||
/** | ||
* Returns the cause of this throwable or null if the cause is nonexistent or unknown. | ||
* @returns the cause of this throwable or null if the cause is nonexistent or unknown. | ||
*/ | ||
public Throwable getCause() { | ||
return this.cause; | ||
} | ||
} |
4 comments
on commit 0759465
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuntimeException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it seems you just changed some unnecessary comment lines for the java docs, am I right?
Because the commit message is very unclear (and some more) =(
A commit message like changed comments and whitespaces for Java Doc
would be much better. Just a suggestion =)
I often think that there are changes on the API or sourcecode but int he end there are just whitespace and comment changes and I am very confused then if there is any real change and if I would need to update my JSON java files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-public class JSONException extends Exception {
+public class JSONException extends RuntimeException {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is my favorite commit ever, no Exception mess anymore!
yeah!
RuntimeException ftw!