boolean (@NotNull PsiElement element) { if (!(element instanceof GrLiteral expression)) return false; final PsiType type = expression.getType(); if (type == null) return false; if (!PsiTypes.intType().equals(type) && !PsiTypes.longType().equals(type) && !type.equalsToText("java.lang.Integer") && !type.equalsToText("java.lang.Long")) { return false; } @NonNls final String text = expression.getText(); if (text == null || text.isEmpty()) { return false; } if (text.startsWith("0x") || text.startsWith("0X")) { return true; } if (text.startsWith("0b") || text.startsWith("0B")) { return true; } if ("0".equals(text) || "0L".equals(text)) { return false; } return text.charAt(0) != '0'; }