fixed cast to paraemeter type in evaluation
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Wed, 22 Jul 2015 10:37:03 +0000 (13:37 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Wed, 22 Jul 2015 10:38:44 +0000 (13:38 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java

index cab3811be6876c3ac9c5674df658a5e3f60116ac..5523463d8359b0251f99865cc535f3d2c7144b49 100644 (file)
@@ -1080,15 +1080,17 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
 
       final boolean performCastToWrapperClass = shouldPerformBoxingConversion && !castingToPrimitive;
 
-      String castTypeName = castType.getCanonicalText();
-      if (performCastToWrapperClass) {
-        final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(castType);
-        if (unboxedType != null) {
-          castTypeName = unboxedType.getCanonicalText();
+      if (!(PsiUtil.resolveClassInClassTypeOnly(castType) instanceof PsiTypeParameter)) {
+        String castTypeName = castType.getCanonicalText();
+        if (performCastToWrapperClass) {
+          final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(castType);
+          if (unboxedType != null) {
+            castTypeName = unboxedType.getCanonicalText();
+          }
         }
-      }
 
-      myResult = new TypeCastEvaluator(operandEvaluator, castTypeName, castingToPrimitive);
+        myResult = new TypeCastEvaluator(operandEvaluator, castTypeName, castingToPrimitive);
+      }
 
       if (performCastToWrapperClass) {
         myResult = new BoxingEvaluator(myResult);