Skip to content

Commit

Permalink
Merge pull request google#738 from google/missing_field_details
Browse files Browse the repository at this point in the history
Added details and causes while throwing AssertionError
  • Loading branch information
inder123 committed Nov 16, 2015
2 parents 10fbfca + 4236494 commit 3f3ed02
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gson/src/main/java/com/google/gson/internal/Excluder.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final class Excluder implements TypeAdapterFactory, Cloneable {
try {
return (Excluder) super.clone();
} catch (CloneNotSupportedException e) {
throw new AssertionError();
throw new AssertionError(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private Adapter(ObjectConstructor<T> constructor, Map<String, BoundField> boundF
}
}
} catch (IllegalAccessException e) {
throw new AssertionError();
throw new AssertionError(e);
}
out.endObject();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ public EnumTypeAdapter(Class<T> classOfT) {
constantToName.put(constant, name);
}
} catch (NoSuchFieldException e) {
throw new AssertionError();
throw new AssertionError("Missing field in " + classOfT.getName(), e);
}
}
@Override public T read(JsonReader in) throws IOException {
Expand Down

0 comments on commit 3f3ed02

Please sign in to comment.