quick fix for MagicConstantInspection which suggests to replace 1 with Font.BOLD

This commit is contained in:
Alexey Kudravtsev
2016-04-15 12:34:33 +03:00
parent ac5712ebbf
commit bfcb00fff6
9 changed files with 303 additions and 45 deletions

View File

@@ -0,0 +1,14 @@
// "Replace with 'FontType.PLAIN'" "true"
import org.intellij.lang.annotations.MagicConstant;
class D {
static class FontType {
public static final int PLAIN = 0;
public static final int BOLD = 1;
public static final int ITALIC = 2;
}
void font(@MagicConstant(flags = {FontType.PLAIN, FontType.BOLD, FontType.ITALIC}) int x) {
// 0 is not allowed despite the fact that it's flags parameter
font(<caret>0);
}
}