Java Code Examples for org.sonar.plugins.java.api.semantic.Symbol#isPrivate()
The following examples show how to use
org.sonar.plugins.java.api.semantic.Symbol#isPrivate() .
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: UnusedPrivateFieldCheck.java From vjtools with Apache License 2.0 | 5 votes |
public void checkIfUnused(VariableTree tree) { if (hasNoAnnotation(tree)) { Symbol symbol = tree.symbol(); String name = symbol.name(); if (symbol.isPrivate() && onlyUsedInVariableAssignment(symbol) && !"serialVersionUID".equals(name) && !unknownIdentifiers.contains(name)) { reportIssue(tree.simpleName(), "Remove this unused \"" + name + "\" private field."); } } }
Example 2
Source File: UnusedPrivateFieldCheck.java From vjtools with Apache License 2.0 | 5 votes |
public void checkIfUnused(VariableTree tree) { if (hasNoAnnotation(tree)) { Symbol symbol = tree.symbol(); String name = symbol.name(); if (symbol.isPrivate() && onlyUsedInVariableAssignment(symbol) && !"serialVersionUID".equals(name) && !unknownIdentifiers.contains(name)) { reportIssue(tree.simpleName(), "Remove this unused \"" + name + "\" private field."); } } }