IG: warn about autoboxing in enum constants (IDEA-160831)

This commit is contained in:
Bas Leijdekkers
2016-09-09 11:39:03 +02:00
parent 22df3f0751
commit c87ac81364
2 changed files with 9 additions and 3 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2015 Dave Griffith, Bas Leijdekkers
* Copyright 2003-2016 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -439,8 +439,8 @@ public class ExpectedTypeUtils {
@NotNull
private static JavaResolveResult findCalledMethod(PsiExpressionList expressionList) {
final PsiElement parent = expressionList.getParent();
if (parent instanceof PsiCallExpression) {
final PsiCallExpression call = (PsiCallExpression)parent;
if (parent instanceof PsiCall) {
final PsiCall call = (PsiCall)parent;
return call.resolveMethodGenerics();
}
else if (parent instanceof PsiAnonymousClass) {
@@ -81,4 +81,10 @@ public class AutoBoxing {
interface R {
Integer box();
}
enum NumberedLetter {
A(<warning descr="Auto-boxing '3'">3</warning>);
NumberedLetter(Integer i) {
}
}
}