Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistency of method names in BaseTypeVisitor #1090

Open
wmdietl opened this issue Feb 5, 2025 · 0 comments
Open

Consistency of method names in BaseTypeVisitor #1090

wmdietl opened this issue Feb 5, 2025 · 0 comments

Comments

@wmdietl
Copy link
Member

wmdietl commented Feb 5, 2025

Methods that check some property and issue errors/warnings if the property are violated are usually called "check":

grep "void check" framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
    protected void checkQualifierParameter(ClassTree classTree) {
    protected void checkExtendsAndImplements(ClassTree classTree) {
    protected void checkExtendsOrImplements(
    protected void checkFieldInvariantDeclarations(ClassTree classTree) {
    protected void checkDefaultConstructor(ClassTree tree) {}
    protected void checkPurityAnnotations(MethodTree tree) {
    protected void checkConstructorResult(
    private void checkContractsAtMethodDeclaration(
    private void checkParametersAreEffectivelyFinal(
    protected void checkPostcondition(
    protected void checkConditionalPostcondition(
    protected void checkExplicitAnnotationsOnIntersectionBounds(
    protected void checkThisConstructorCall(MethodInvocationTree thisCall) {
    protected void checkSuperConstructorCall(MethodInvocationTree superCall) {
    protected void checkThisOrSuperConstructorCall(
    protected void checkVarargs(AnnotatedExecutableType invokedMethod, Tree tree) {
    protected void checkPreconditions(MethodInvocationTree tree, Set<Precondition> preconditions) {
    protected void checkTypecastRedundancy(TypeCastTree typeCastTree) {
    protected void checkTypecastSafety(TypeCastTree typeCastTree) {
    protected void checkExceptionParameter(CatchTree tree) {
    protected void checkThrownExpression(ThrowTree tree) {
    protected void checkTypeArguments(
    private void checkHasQualifierParameterAsTypeArgument(
    protected void checkMethodInvocability(
    protected void checkConstructorInvocation(
    protected void checkEnclosingExpr(NewClassTree node, AnnotatedExecutableType constructorType) {
    protected void checkArguments(
        private void checkPurity() {
        private void checkPreAndPostConditions() {
        private void checkParametersMsg(
        private void checkReturnMsg(boolean success) {
    private void checkContractsSubset(
    protected void checkAccess(IdentifierTree identifierTree, Void p) {
    protected void checkAccessAllowed(

However, a few are called "warn":

> grep "void warn" framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
    protected void warnInvalidPolymorphicQualifier(ClassTree classTree) {
    protected void warnInvalidPolymorphicQualifier(
    protected void warnRedundantAnnotations(Tree tree, AnnotatedTypeMirror type) {
    private void warnAboutTypeAnnotationsTooEarly(Tree tree, ModifiersTree modifiersTree) {
    public void warnAboutIrrelevantJavaTypes(

I noticed this because #1080 renamed checkForPolymorphicQualifiers to warnInvalidPolymorphicQualifier which seems inconsistent.

Think through what our guidance for method names should be, adapt the code, and document it in the class documentation and the developer guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant