org.sonar.plugins.java.api.tree.ModifierKeywordTree Java Examples
The following examples show how to use
org.sonar.plugins.java.api.tree.ModifierKeywordTree.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BadConstantNameCheck.java From vjtools with Apache License 2.0 | 5 votes |
private static boolean isStaticFinal(VariableTree variableTree) { boolean isStatic = false; boolean isFinal = false; for (ModifierKeywordTree modifierKeywordTree : variableTree.modifiers().modifiers()) { Modifier modifier = modifierKeywordTree.modifier(); if (modifier == Modifier.STATIC) { isStatic = true; } if (modifier == Modifier.FINAL) { isFinal = true; } } return isStatic && isFinal; }
Example #2
Source File: BadConstantNameCheck.java From vjtools with Apache License 2.0 | 5 votes |
private static boolean isStaticFinal(VariableTree variableTree) { boolean isStatic = false; boolean isFinal = false; for (ModifierKeywordTree modifierKeywordTree : variableTree.modifiers().modifiers()) { Modifier modifier = modifierKeywordTree.modifier(); if (modifier == Modifier.STATIC) { isStatic = true; } if (modifier == Modifier.FINAL) { isFinal = true; } } return isStatic && isFinal; }
Example #3
Source File: SynchronizedKeywordUsageCheck.java From AEM-Rules-for-SonarQube with Apache License 2.0 | 5 votes |
@Override public void visitMethod(MethodTree tree) { List<ModifierKeywordTree> modifiers = tree.modifiers().modifiers(); for (ModifierKeywordTree modifier : modifiers) { if (modifier.modifier() == Modifier.SYNCHRONIZED) { visitor.reportIssue(modifier, MESSAGE); } } super.visitMethod(tree); }