mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 08:45:34 +07:00
IDEA-154668 MagicConstant on new Font(...) accepts 0 (Font.PLAIN) but rejects 1 (Font.BOLD)
This commit is contained in:
@@ -446,4 +446,10 @@
|
||||
<description>Must be one of: SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, SwingConstants.LEADING, SwingConstants.TRAILING</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>X.java</file>
|
||||
<line>268</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Magic Constant</problem_class>
|
||||
<description>Must be one of: FontType.PLAIN, FontType.BOLD, FontType.ITALIC</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -18,9 +18,9 @@ import org.intellij.lang.annotations.MagicConstant;
|
||||
import java.io.*;
|
||||
|
||||
class Const {
|
||||
public static final int X = 0;
|
||||
public static final int X = 1;
|
||||
public static final int Y = 2;
|
||||
public static final int Z = 3;
|
||||
public static final int Z = 4;
|
||||
}
|
||||
public class X {
|
||||
|
||||
@@ -256,4 +256,15 @@ public class X {
|
||||
plusSupportedInFlags(0);
|
||||
plusSupportedInFlags(-1);
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
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(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user