Class PrintfFailCheck
- All Implemented Interfaces:
JavaCheck, JavaFileScanner
-
Field Summary
Fields inherited from class AbstractPrintfChecker
JAVA_LANG_STRING, JAVA_LANG_THROWABLE, LEVELS, MESSAGE_FORMAT, MESSAGE_FORMAT_PATTERN, MESSAGE_FORMAT_PATTERN_PREDICATE, ORG_APACHE_LOGGING_LOG4J_LOGGER, PRINTF_METHOD_NAME, STRING_FORMATTEDModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final MethodMatchersprotected static final Patternprotected static final Stringprotected static final Stringprotected static final MethodMatchersFields inherited from class SubscriptionVisitor
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidprotected voidMethods inherited from class AbstractPrintfChecker
argIndexes, checkArgumentNumber, checkFormatting, cleanupDoubleQuote, cleanupLineSeparator, getIndex, getMessageFormatIndexes, getMethodInvocationMatchers, getParameters, isNewArrayWithInitializers, transposeArgumentArray, verifyParametersForErrorsModifier and TypeMethodDescriptionargIndexes(List<String> params) protected booleancheckArgumentNumber(MethodInvocationTree mit, int nbReadParams, int nbArgs) protected final voidcheckFormatting(MethodInvocationTree mit, boolean isMessageFormat) protected static StringcleanupDoubleQuote(String formatString) protected static voidcleanupLineSeparator(List<String> params) protected static IntegergetMessageFormatIndexes(String formatString, MethodInvocationTree mit) protected MethodMatchersgetParameters(String formatString, MethodInvocationTree mit) protected static booleanisNewArrayWithInitializers(ExpressionTree expression) protected static Optional<List<ExpressionTree>> protected voidverifyParametersForErrors(MethodInvocationTree mit, List<ExpressionTree> args, List<String> params) Methods inherited from class AbstractMethodDetection
nodesToVisit, onConstructorFound, onMethodReferenceFound, visitNodeMethods inherited from class IssuableSubscriptionVisitor
addIssue, addIssueOnFile, leaveFile, reportIssue, reportIssue, reportIssue, reportIssue, scanFile, scanTree, setContextMethods inherited from class SubscriptionVisitor
leaveNode, visitToken, visitTriviaMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JavaFileScanner
scanWithoutParsing
-
Constructor Details
-
PrintfFailCheck
public PrintfFailCheck()
-
-
Method Details
-
onMethodInvocationFound
- Overrides:
onMethodInvocationFoundin classAbstractMethodDetection
-
handlePrintfFormat
protected void handlePrintfFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args) - Specified by:
handlePrintfFormatin classAbstractPrintfChecker
-
handleMessageFormat
protected void handleMessageFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args) - Specified by:
handleMessageFormatin classAbstractPrintfChecker
-
handlePrintfFormatCatchingErrors
protected void handlePrintfFormatCatchingErrors(MethodInvocationTree mit, String formatString, List<ExpressionTree> args) - Specified by:
handlePrintfFormatCatchingErrorsin classAbstractPrintfChecker
-
handleOtherFormatTree
protected void handleOtherFormatTree(MethodInvocationTree mit, ExpressionTree formatTree, List<ExpressionTree> args) - Specified by:
handleOtherFormatTreein classAbstractPrintfChecker
-
reportMissingPrevious
- Overrides:
reportMissingPreviousin classAbstractPrintfChecker
-