libgdx/libgdx — pull request #1025 by hneuer (2013-12-01 15:01:01+00:00)
Title: Added elementTypes to gwt reflection

- Added elementTypes to gwt reflection to support field.getElementType in GWT
- switched types form Set to List and added some sorting in ReflectionCacheSourceCreator so the generated code stays more stable between runs
- corrected Type.isAssignableFrom (the logic was switched)
- Reverted some changes form PR #1005 as they broke things for copying primitive fields using reflection.
I am using something like:

field.set(obj, field.get((other.obj));

Example generated JS code:

case 107837400:
java_lang_String_$equals__Ljava_lang_String_2Ljava_lang_Object_2Z($intern_3466, param) && com_badlogic_gwtref_client_IReflectionCacheGenerated_$s5648__Lcom_badlogic_gwtref_client_IReflectionCacheGenerated_2Lcom_rustybyte_es_components_CMusic_2ZV(com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(obj, Q$com_rustybyte_es_components_CMusic), java_lang_Boolean_$booleanValue__Ljava_lang_Boolean_2Z(com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(value_0, Q$java_lang_Boolean)));
break;

Results in the following exception for a boolean field:

com_google_gwt_core_client_impl_StackTraceCreator$Collector_$makeException__Lcom_google_gwt_core_client_impl_StackTraceCreator$Collector_2Lcom_google_gwt_core_client_JavaScriptObject_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76170)
com_google_gwt_core_client_impl_StackTraceCreator$CollectorMoz_$collect__Lcom_google_gwt_core_client_impl_StackTraceCreator$CollectorMoz_2Lcom_google_gwt_core_client_JsArrayString_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76238)
com_google_gwt_core_client_impl_StackTraceCreator$CollectorChrome_collect__Lcom_google_gwt_core_client_JsArrayString_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76330)
com_google_gwt_core_client_impl_StackTraceCreator_createStackTrace__Lcom_google_gwt_core_client_JsArrayString_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76108)
com_google_gwt_core_client_impl_StackTraceCreator$CollectorChrome_fillInStackTrace__Ljava_lang_Throwable_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76376)
com_google_gwt_core_client_impl_StackTraceCreator_fillInStackTrace__Ljava_lang_Throwable_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76130)
java_lang_Throwable_$fillInStackTrace__Ljava_lang_Throwable_2Ljava_lang_Throwable_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:27136)
java_lang_Throwable_Throwable__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:27193)
java_lang_Exception_Exception__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:27232)
java_lang_RuntimeException_RuntimeException__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:27256)
java_lang_ClassCastException_ClassCastException__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:91223)
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:78877)
com_badlogic_gwtref_client_IReflectionCacheGenerated_set__Lcom_badlogic_gwtref_client_Field_2Ljava_lang_Object_2Ljava_lang_Object_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:71927)
com_badlogic_gwtref_client_Field_$set__Lcom_badlogic_gwtref_client_Field_2Ljava_lang_Object_2Ljava_lang_Object_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:33667)
com_badlogic_gdx_utils_reflect_Field_$set__Lcom_badlogic_gdx_utils_reflect_Field_2Ljava_lang_Object_2Ljava_lang_Object_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:33575)
com_rustybyte_es_Component$ReflectionField_copyFrom__Lcom_rustybyte_es_ComponentField_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:83143)
com_rustybyte_es_Component_$copyFrom__Lcom_rustybyte_es_Component_2Lcom_rustybyte_es_Component_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:82983)
com_rustybyte_es_World_$instantiatePrototype__Lcom_rustybyte_es_World_2Lcom_rustybyte_es_prototyping_EntityPrototype_2ZLcom_rustybyte_es_Entity_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:83878)
com_rustybyte_es_World_$instantiatePrototype__Lcom_rustybyte_es_World_2Lcom_rustybyte_es_prototyping_EntityPrototype_2Lcom_rustybyte_es_Entity_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:83870)
com_rustybyte_steamtd_core_screens_MainScreen_initializeStage__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:89481)
com_rustybyte_steamtd_core_screens_AbstractScreenWithStage_$show__Lcom_rustybyte_steamtd_core_screens_AbstractScreenWithStage_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:88809)
com_rustybyte_steamtd_core_screens_AbstractScreenWithStageAndWorld_show__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:88877)
com_rustybyte_steamtd_core_FooGame_render__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:86047)
com_badlogic_gdx_backends_gwt_GwtApplication_$mainLoop__Lcom_badlogic_gdx_backends_gwt_GwtApplication_2V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:1674)
com_badlogic_gdx_backends_gwt_GwtApplication$2_run__V (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:1940)
com_google_gwt_user_client_Timer_fire__IV (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:1921)
(anonymous function) (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:1910)
com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:75687)
com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2 (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:75764)
(anonymous function) (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:75732)
(anonymous function) (ED3B5F9B05BF2C377D9AFF10441C4905.cache.html:76501)