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 String
ANSI_BLUE
protected static String
ANSI_GRAY
protected static String
ANSI_PURPLE
protected static String
ANSI_RED
protected static String
ANSI_RESET
protected static String
ANSI_YELLOW
protected static int
LEVEL_INCREMENT
protected PrintStream
out
-
Constructor Summary
Constructors Constructor Description SimpleLogger(PrintStream out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ambiguityError(MethodCallSite site, @Nullable ExprMirror.InvocationMirror.MethodCtDecl selected, List<ExprMirror.InvocationMirror.MethodCtDecl> methods)
protected String
color(Object str, String color)
protected static String
colorIvars(Object str)
protected static String
colorPunct(Object str)
protected static String
doColor(Object str, Pattern pattern, String replacement)
protected void
endSection(String footer)
void
fallbackInvocation(JMethodSig ctdecl, MethodCallSite site)
protected int
getLevel()
void
logResolutionFail(ResolutionFailure exception)
Log that the instantiation of the method type m for the given call site failed.TypeInferenceLogger
newInstance()
Return an instance for concurrent use in another thread.void
noApplicableCandidates(MethodCallSite site)
void
noCompileTimeDeclaration(MethodCallSite site)
protected @NonNull String
ppBound(InferenceVar ivar, InferenceVar.BoundKind kind, JTypeMirror bound)
protected @NonNull String
ppHighlight(JMethodSig sig)
protected @NonNull String
ppMethod(JMethodSig sig)
protected void
printExpr(ExprMirror expr)
protected void
println(String str)
protected void
startSection(String header)
protected void
updateLevel(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:TypeInferenceLogger
Log 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 phase
are compile-time errors though.- Specified by:
logResolutionFail
in interfaceTypeInferenceLogger
- Parameters:
exception
- Failure record
-
noApplicableCandidates
public void noApplicableCandidates(MethodCallSite site)
- Specified by:
noApplicableCandidates
in interfaceTypeInferenceLogger
-
noCompileTimeDeclaration
public void noCompileTimeDeclaration(MethodCallSite site)
- Specified by:
noCompileTimeDeclaration
in interfaceTypeInferenceLogger
-
fallbackInvocation
public void fallbackInvocation(JMethodSig ctdecl, MethodCallSite site)
- Specified by:
fallbackInvocation
in interfaceTypeInferenceLogger
-
ambiguityError
public void ambiguityError(MethodCallSite site, @Nullable ExprMirror.InvocationMirror.MethodCtDecl selected, List<ExprMirror.InvocationMirror.MethodCtDecl> methods)
- Specified by:
ambiguityError
in 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:TypeInferenceLogger
Return an instance for concurrent use in another thread. If this is Noop, then return the same instance because it's thread-safe.- Specified by:
newInstance
in interfaceTypeInferenceLogger
-
-