boolean (PsiExpression expression, PsiType assignmentType) { // JLS 5.2 Assignment Conversion if (PsiTypes.shortType().equals(assignmentType)) { return canValueBeContained(expression, Short.MIN_VALUE, Short.MAX_VALUE); } else if (PsiTypes.charType().equals(assignmentType)) { return canValueBeContained(expression, Character.MIN_VALUE, Character.MAX_VALUE); } else if (PsiTypes.byteType().equals(assignmentType)) { return canValueBeContained(expression, Byte.MIN_VALUE, Byte.MAX_VALUE); } return false; }