Class TypeInferenceLogger.SimpleLogger
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.SimpleLogger
-
- All Implemented Interfaces:
TypeInferenceLogger
- Direct Known Subclasses:
TypeInferenceLogger.VerboseLogger
- Enclosing interface:
- TypeInferenceLogger
public static class TypeInferenceLogger.SimpleLogger extends Object implements TypeInferenceLogger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger
TypeInferenceLogger.SimpleLogger, TypeInferenceLogger.VerboseLogger
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringANSI_BLUEprotected static StringANSI_GRAYprotected static StringANSI_PURPLEprotected static StringANSI_REDprotected static StringANSI_RESETprotected static StringANSI_YELLOWprotected static intLEVEL_INCREMENTprotected PrintStreamout
-
Constructor Summary
Constructors Constructor Description SimpleLogger(PrintStream out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidambiguityError(MethodCallSite site, @Nullable ExprMirror.InvocationMirror.MethodCtDecl selected, List<ExprMirror.InvocationMirror.MethodCtDecl> methods)protected Stringcolor(Object str, String color)protected static StringcolorIvars(Object str)protected static StringcolorPunct(Object str)protected static StringdoColor(Object str, Pattern pattern, String replacement)protected voidendSection(String footer)voidfallbackInvocation(JMethodSig ctdecl, MethodCallSite site)protected intgetLevel()voidlogResolutionFail(ResolutionFailure exception)Log that the instantiation of the method type m for the given call site failed.TypeInferenceLoggernewInstance()Return an instance for concurrent use in another thread.voidnoApplicableCandidates(MethodCallSite site)voidnoCompileTimeDeclaration(MethodCallSite site)protected @NonNull StringppBound(InferenceVar ivar, InferenceVar.BoundKind kind, JTypeMirror bound)protected @NonNull StringppHighlight(JMethodSig sig)protected @NonNull StringppMethod(JMethodSig sig)protected voidprintExpr(ExprMirror expr)protected voidprintln(String str)protected voidstartSection(String header)protected voidupdateLevel(int increment)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger
boundAdded, ctxInitialization, endArg, endArgsChecks, endInference, endReturnChecks, functionalExprNeedsInvocationCtx, isNoop, ivarInstantiated, ivarMerged, polyResolutionFailure, propagateAndAbort, skipArgAsNonPertinent, skipInstantiation, startArg, startArgsChecks, startInference, startReturnChecks
-
-
-
-
Field Detail
-
out
protected final PrintStream out
-
LEVEL_INCREMENT
protected static final int LEVEL_INCREMENT
- See Also:
- Constant Field Values
-
ANSI_RESET
protected static final String ANSI_RESET
- See Also:
- Constant Field Values
-
ANSI_BLUE
protected static final String ANSI_BLUE
- See Also:
- Constant Field Values
-
ANSI_PURPLE
protected static final String ANSI_PURPLE
- See Also:
- Constant Field Values
-
ANSI_GRAY
protected static final String ANSI_GRAY
- See Also:
- Constant Field Values
-
ANSI_RED
protected static final String ANSI_RED
- See Also:
- Constant Field Values
-
ANSI_YELLOW
protected static final String ANSI_YELLOW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleLogger
public SimpleLogger(PrintStream out)
-
-
Method Detail
-
getLevel
protected int getLevel()
-
updateLevel
protected void updateLevel(int increment)
-
println
protected void println(String str)
-
endSection
protected void endSection(String footer)
-
startSection
protected void startSection(String header)
-
logResolutionFail
public void logResolutionFail(ResolutionFailure exception)
Description copied from interface:TypeInferenceLoggerLog that the instantiation of the method type m for the given call site failed. The exception provides a detail message. Such an event is perfectly normal and may happen repeatedly when performing overload resolution.Exceptions occuring in an
invocation phaseare compile-time errors though.- Specified by:
logResolutionFailin interfaceTypeInferenceLogger- Parameters:
exception- Failure record
-
noApplicableCandidates
public void noApplicableCandidates(MethodCallSite site)
- Specified by:
noApplicableCandidatesin interfaceTypeInferenceLogger
-
noCompileTimeDeclaration
public void noCompileTimeDeclaration(MethodCallSite site)
- Specified by:
noCompileTimeDeclarationin interfaceTypeInferenceLogger
-
fallbackInvocation
public void fallbackInvocation(JMethodSig ctdecl, MethodCallSite site)
- Specified by:
fallbackInvocationin interfaceTypeInferenceLogger
-
ambiguityError
public void ambiguityError(MethodCallSite site, @Nullable ExprMirror.InvocationMirror.MethodCtDecl selected, List<ExprMirror.InvocationMirror.MethodCtDecl> methods)
- Specified by:
ambiguityErrorin interfaceTypeInferenceLogger
-
printExpr
protected void printExpr(ExprMirror expr)
-
ppMethod
protected @NonNull String ppMethod(JMethodSig sig)
-
ppHighlight
protected @NonNull String ppHighlight(JMethodSig sig)
-
ppBound
protected @NonNull String ppBound(InferenceVar ivar, InferenceVar.BoundKind kind, JTypeMirror bound)
-
newInstance
public TypeInferenceLogger newInstance()
Description copied from interface:TypeInferenceLoggerReturn an instance for concurrent use in another thread. If this is Noop, then return the same instance because it's thread-safe.- Specified by:
newInstancein interfaceTypeInferenceLogger
-
-