discomarathon / google-gson

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

gson doesn't build on Java 6 #158

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When building gson using Java 6, I get the following error.

  .../gson-trunk/gson/src/main/java/com/google/gson/Gson.java:[446,23]
  type parameters of <T>T cannot be determined; no unique maximal instance
  exists for type variable T with upper bounds T,java.lang.Object

I can confirm this when using Sun's JDK, versions 6u12 through 6u16, but I
suspect that the error happens with all of Sun's Java 6 JDKs.

I've attached a patch that fixes the issue.

Original issue reported on code.google.com by tim.molo...@gmail.com on 23 Sep 2009 at 2:03

Attachments:

GoogleCodeExporter commented 9 years ago
Oh, since it's such a trivial change, can it be included in the gson 1.4 
release that
I hear could happen before the end of the month?  Thanks.

Original comment by tim.molo...@gmail.com on 23 Sep 2009 at 2:04

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

Original comment by inder123 on 23 Sep 2009 at 5:17

GoogleCodeExporter commented 9 years ago
Fixed in r444 
The problem arises because of the incompatible way JDK 1.5 and JDK 1.6 handle 
casting to type variables. One of 
them throws a warning if you cast, the other one throws a compilation error if 
you dont. 

Original comment by inder123 on 23 Sep 2009 at 5:22

GoogleCodeExporter commented 9 years ago
Issue 145 has been merged into this issue.

Original comment by inder123 on 23 Sep 2009 at 5:47