Skip to content

Commit

Permalink
Remove throws declarations for unchecked exceptions which don't need …
Browse files Browse the repository at this point in the history
…to be declared.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138695682
  • Loading branch information
blickly committed Nov 10, 2016
1 parent 41d5d4e commit 1827c47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/com/google/javascript/rhino/Node.java
Expand Up @@ -1083,7 +1083,7 @@ private int[] getSortedPropTypes() {
}

/** Can only be called when <tt>getType() == TokenStream.NUMBER</tt> */
public double getDouble() throws UnsupportedOperationException {
public double getDouble() {
if (this.token == Token.NUMBER) {
throw new IllegalStateException(
"Number node not created with Node.newNumber");
Expand All @@ -1094,9 +1094,10 @@ public double getDouble() throws UnsupportedOperationException {

/**
* Can only be called when <tt>getType() == Token.NUMBER</tt>
*
* @param value value to set.
*/
public void setDouble(double value) throws UnsupportedOperationException {
public void setDouble(double value) {
if (this.token == Token.NUMBER) {
throw new IllegalStateException(
"Number node not created with Node.newNumber");
Expand All @@ -1106,7 +1107,7 @@ public void setDouble(double value) throws UnsupportedOperationException {
}

/** Can only be called when node has String context. */
public String getString() throws UnsupportedOperationException {
public String getString() {
if (this.token == Token.STRING) {
throw new IllegalStateException(
"String node not created with Node.newString");
Expand All @@ -1117,9 +1118,10 @@ public String getString() throws UnsupportedOperationException {

/**
* Can only be called for a Token.STRING or Token.NAME.
*
* @param value the value to set.
*/
public void setString(String value) throws UnsupportedOperationException {
public void setString(String value) {
if (this.token == Token.STRING || this.token == Token.NAME) {
throw new IllegalStateException(
"String node not created with Node.newString");
Expand Down
3 changes: 1 addition & 2 deletions src/com/google/javascript/rhino/jstype/FunctionType.java
Expand Up @@ -634,8 +634,7 @@ public int getExtendedInterfacesCount() {
return extendedInterfaces.size();
}

public void setExtendedInterfaces(List<ObjectType> extendedInterfaces)
throws UnsupportedOperationException {
public void setExtendedInterfaces(List<ObjectType> extendedInterfaces) {
if (isInterface()) {
this.extendedInterfaces = ImmutableList.copyOf(extendedInterfaces);
for (ObjectType extendedInterface : this.extendedInterfaces) {
Expand Down

0 comments on commit 1827c47

Please sign in to comment.