field may be final: ignore throw clause when field was not assigned (IDEA-96018)

This commit is contained in:
anna
2012-11-30 16:51:25 +01:00
parent 87aaab7b0d
commit 1af524b889
2 changed files with 20 additions and 2 deletions
@@ -630,8 +630,9 @@ public class FinalUtils {
}
private void satisfyVacuously() {
definitelyAssigned = true;
definitelyUnassigned = true;
if (definitelyAssigned) {
definitelyUnassigned = true;
}
}
private static boolean isPrePostFixExpression(
@@ -398,4 +398,21 @@ class Q implements Iterator<String> {
public void remove() {
throw new UnsupportedOperationException();
}
}
class R {
private static final String someStaticStuff;
static {
try {
someStaticStuff = "";
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
private String someInjectedStuff;
public String getSomeInjectedStuff() {
return someInjectedStuff;
}
}