libgdx/libgdx — pull request #1005 by anserran (2013-11-26 17:20:53+00:00)
Title: Fixed some issues with GWT reflection and JSon

Commit:
- Json was unable to create list for fields with type "List"
- Added list to the default "reflected" classes in GWT backend
- Fixed reflection generator to avoid that setters convert primitives types to java wrappers.

The bug:
I'm doing heavy work combining reflection and Json with GWT and I found the next problem:
Say I have a class like this:

```java
public class SceneElement {
public float x;
public float y;
}
```

and I have a json file like:
```json
{
x: 2,
y: 3
}
```

Then:

```java
SceneElement e = json.fromJson(fh, SceneElement.class);
e.x += 2;
// Result in Java e.x = 4.0f;
// Result in GWT e.x = "22";
```

Instead of adding the numbers, it's concateneting them, because initially e.x type was a JavaScript class created by GWT to mimic java.lang.Float instead of a primitive. The problem comes from the json reader: it returns a java.lang.Float when it finds a number, and when the field is setted, it is not converted back to a primitive.

In Java, when you use reflection to assign a java.lang.Float to a float field, the java.lang.Float is automatically converted to a float, but not in GWT. This problem repeats for all primitive types.

So this pull request is to perform that conversion to primitive also in GWT. I modified the generation of the reflection cache, creating more specific setters.

This pull request also fixes a small bug with lists generation from json and adds java.util.List to the default reflection classes in GWT.