@@ -83,21 +83,21 @@ public boolean isAssignableFrom(Type type) {
8383 if ((type == TYPE_UNDEFINED_OBJECT ) || (this .type == TYPE_UNDEFINED_OBJECT ) || (this .type == TYPE_OBJECT ) || this .type .equals (type )) {
8484 return true ;
8585 } else if ((this .type .getDimension () == type .getDimension ()) && this .type .isObject ()) {
86- ObjectType ot1 = (ObjectType ) this .type ;
86+ ObjectType thisObjectType = (ObjectType ) this .type ;
8787
8888 if (type .isObject ()) {
89- ObjectType ot2 = (ObjectType ) type ;
89+ ObjectType otherObjectType = (ObjectType ) type ;
9090
91- if (ot1 .getInternalName ().equals (ot2 .getInternalName ()) && (ot1 .getTypeArguments () != null ) && (ot2 .getTypeArguments () != null )) {
92- return ot1 .getTypeArguments ().isTypeArgumentAssignableFrom (ot2 .getTypeArguments ());
91+ if (thisObjectType .getInternalName ().equals (otherObjectType .getInternalName ()) && (thisObjectType .getTypeArguments () != null ) && (otherObjectType .getTypeArguments () != null )) {
92+ return thisObjectType .getTypeArguments ().isTypeArgumentAssignableFrom (otherObjectType .getTypeArguments ());
9393 }
9494
9595 if (type .getDimension () == 0 ) {
96- if ((ot1 .getTypeArguments () == null ) ? (ot2 .getTypeArguments () == null ) : ot1 .getTypeArguments ().equals (ot2 .getTypeArguments ())) {
97- return objectTypeMaker .isAssignable (ot1 , ot2 );
96+ if ((thisObjectType .getTypeArguments () == null ) ? (otherObjectType .getTypeArguments () == null ) : thisObjectType .getTypeArguments ().equals (otherObjectType .getTypeArguments ())) {
97+ return objectTypeMaker .isAssignable (thisObjectType , otherObjectType );
9898 }
9999 }
100- } else if (ot1 .getInternalName ().equals (TYPE_OBJECT .getInternalName ())) {
100+ } else if (thisObjectType .getInternalName ().equals (TYPE_OBJECT .getInternalName ())) {
101101 return true ;
102102 }
103103 }
@@ -115,8 +115,9 @@ public void typeOnRight(Type type) {
115115 assert !this .type .isPrimitive () && !type .isPrimitive () : "ObjectLocalVariable.typeOnRight(type) : unexpected type" ;
116116
117117 if (this .type .isObject ()) {
118+ ObjectType thisObjectType = (ObjectType ) this .type ;
119+
118120 if (type .isObject ()) {
119- ObjectType thisObjectType = (ObjectType ) this .type ;
120121 ObjectType otherObjectType = (ObjectType ) type ;
121122
122123 if (thisObjectType .getInternalName ().equals (otherObjectType .getInternalName ())) {
@@ -133,7 +134,7 @@ public void typeOnRight(Type type) {
133134 fireChangeEvent ();
134135 }
135136 }
136- } else if (type .isGeneric () && ( this . type == TYPE_OBJECT )) {
137+ } else if (type .isGeneric () && thisObjectType . getInternalName (). equals ( TYPE_OBJECT . getInternalName () )) {
137138 this .type = type ;
138139 fireChangeEvent ();
139140 }
@@ -150,23 +151,29 @@ public void typeOnLeft(Type type) {
150151 } else if ((this .type .getDimension () == 0 ) && (type .getDimension () == 0 )) {
151152 assert !this .type .isPrimitive () && !type .isPrimitive () : "unexpected type in ObjectLocalVariable.typeOnLeft(type)" ;
152153
153- if (this .type .isObject () && type .isObject ()) {
154- ObjectType thisObjectType = (ObjectType )this .type ;
155- ObjectType otherObjectType = (ObjectType )type ;
154+ if (this .type .isObject ()) {
155+ ObjectType thisObjectType = (ObjectType ) this .type ;
156156
157- if (thisObjectType .getInternalName ().equals (otherObjectType .getInternalName ())) {
158- if ((thisObjectType .getTypeArguments () == null ) && (otherObjectType .getTypeArguments () != null )) {
159- // Keep type, update type arguments
160- this .type = otherObjectType ;
161- fireChangeEvent ();
162- }
163- } else if (objectTypeMaker .isAssignable (otherObjectType , thisObjectType )) {
164- // Assignable types
165- if ((thisObjectType .getTypeArguments () == null ) && (otherObjectType .getTypeArguments () != null )) {
166- // Keep type, update type arguments
167- this .type = thisObjectType .createType (otherObjectType .getTypeArguments ());
168- fireChangeEvent ();
157+ if (type .isObject ()) {
158+ ObjectType otherObjectType = (ObjectType ) type ;
159+
160+ if (thisObjectType .getInternalName ().equals (otherObjectType .getInternalName ())) {
161+ if ((thisObjectType .getTypeArguments () == null ) && (otherObjectType .getTypeArguments () != null )) {
162+ // Keep type, update type arguments
163+ this .type = otherObjectType ;
164+ fireChangeEvent ();
165+ }
166+ } else if (objectTypeMaker .isAssignable (otherObjectType , thisObjectType )) {
167+ // Assignable types
168+ if ((thisObjectType .getTypeArguments () == null ) && (otherObjectType .getTypeArguments () != null )) {
169+ // Keep type, update type arguments
170+ this .type = thisObjectType .createType (otherObjectType .getTypeArguments ());
171+ fireChangeEvent ();
172+ }
169173 }
174+ } else if (type .isGeneric () && thisObjectType .getInternalName ().equals (TYPE_OBJECT .getInternalName ())) {
175+ this .type = type ;
176+ fireChangeEvent ();
170177 }
171178 }
172179 }
0 commit comments