FranzGames / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Error in JsonSerializer and JsonDeserializer documentation. #360

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by von...@gmail.com on 31 Aug 2011 at 5:03

GoogleCodeExporter commented 9 years ago
Sorry, I hit the return key while entering the title, and it submitted my bug 
report.  (I'm not sure that's the best interface, but oh well.)

In any case, here's the problem.  The documentation for the JsonSerializer 
interface shows this example:

class IdSerializer implements JsonSerializer<Id>() {
  public JsonElement toJson(Id id, Type typeOfId, JsonSerializationContext context) {
    return new JsonPrimitive(id.getValue());
  }
}

The method should be named "serialize" and not "toJson".  A similar mistake 
appears in the JsonDeserializer documentation.

Original comment by von...@gmail.com on 31 Aug 2011 at 5:04

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r989.

Original comment by limpbizkit on 1 Oct 2011 at 4:09