Package org.sonar.java.checks
Class PrintfMisuseCheck
- All Implemented Interfaces:
JavaCheck,JavaFileScanner
-
Field Summary
Fields inherited from class org.sonar.java.checks.AbstractPrintfChecker
JAVA_LANG_STRING, JAVA_LANG_THROWABLE, LEVELS, MESSAGE_FORMAT, MESSAGE_FORMAT_PATTERN, ORG_APACHE_LOGGING_LOG4J_LOGGER, PRINTF_METHOD_NAME, STRING_FORMATTEDFields inherited from class org.sonar.java.ast.visitors.SubscriptionVisitor
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MethodMatchersprotected voidhandleMessageFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args)protected voidhandleOtherFormatTree(MethodInvocationTree mit, ExpressionTree formatTree, List<ExpressionTree> args)protected voidhandlePrintfFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args)protected voidhandlePrintfFormatCatchingErrors(MethodInvocationTree mit, String formatString, List<ExpressionTree> args)protected voidMethods inherited from class org.sonar.java.checks.AbstractPrintfChecker
argIndexes, checkArgumentNumber, checkFormatting, cleanupDoubleQuote, cleanupLineSeparator, getIndex, getMessageFormatIndexes, getParameters, isNewArrayWithInitializers, reportMissingPrevious, transposeArgumentArray, verifyParametersForErrorsMethods inherited from class org.sonar.java.checks.methods.AbstractMethodDetection
nodesToVisit, onConstructorFound, onMethodReferenceFound, visitNodeMethods inherited from class org.sonar.plugins.java.api.IssuableSubscriptionVisitor
addIssue, addIssueOnFile, reportIssue, reportIssue, reportIssue, scanTreeMethods inherited from class org.sonar.java.ast.visitors.SubscriptionVisitor
leaveFile, leaveNode, scanFile, setContext, visitToken, visitTrivia
-
Constructor Details
-
PrintfMisuseCheck
public PrintfMisuseCheck()
-
-
Method Details
-
getMethodInvocationMatchers
- Overrides:
getMethodInvocationMatchersin classAbstractPrintfChecker
-
onMethodInvocationFound
- Overrides:
onMethodInvocationFoundin classAbstractMethodDetection
-
handlePrintfFormat
protected void handlePrintfFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args)- Specified by:
handlePrintfFormatin classAbstractPrintfChecker
-
handlePrintfFormatCatchingErrors
protected void handlePrintfFormatCatchingErrors(MethodInvocationTree mit, String formatString, List<ExpressionTree> args)- Specified by:
handlePrintfFormatCatchingErrorsin classAbstractPrintfChecker
-
handleMessageFormat
protected void handleMessageFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args)- Specified by:
handleMessageFormatin classAbstractPrintfChecker
-
handleOtherFormatTree
protected void handleOtherFormatTree(MethodInvocationTree mit, ExpressionTree formatTree, List<ExpressionTree> args)- Specified by:
handleOtherFormatTreein classAbstractPrintfChecker
-