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

Issue #4845: removed usage of TokenTypes from inputs #11402

Merged
merged 1 commit into from
Mar 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.ArrayList;
import java.util.List;

import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.Calendar;

public class InputDeclarationOrderForwardReference {

Expand All @@ -34,7 +34,7 @@ public class InputDeclarationOrderForwardReference {
private static final String COMMON_PART = "common_part";
public static final String FIRST = COMMON_PART + "2";

private static final String SECOND = String.valueOf(TokenTypes.ELIST) + FIRST;
private static final String SECOND = String.valueOf(Calendar.MONDAY) + FIRST;
public static final String THIRD = FIRST;

private static int ID = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.Calendar;

/* This input file is intended to be used on strict configuration: max=0 */
public class InputClassFanOutComplexityAnnotations { // violation

private int tokenType = TokenTypes.EXPR;
private int dayOfWeek = Calendar.MONDAY;

public void foo1(@TypeAnnotation char a) {}

Expand Down Expand Up @@ -82,10 +82,10 @@ class OuterClass { // violation

private static final String value = "4";

@TwoParametersAnnotation(value = "4", tokenType = 1)
@TwoParametersAnnotation(value = "4", dayOfWeek = 1)
public static final String EMPTY_STRING = "";

@TwoParametersAnnotation(value = value, tokenType = TokenTypes.ANNOTATION)
@TwoParametersAnnotation(value = value, dayOfWeek = Calendar.TUESDAY)
public static final String TAB = "\t";

}
Expand All @@ -108,6 +108,6 @@ interface MyInterface {}

String value();

int tokenType();
int dayOfWeek();

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.util.List;

import com.puppycrawl.tools.checkstyle.api.TokenTypes;


public class InputNoWhitespaceAfterArrayDeclarations2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespacebeforecasedefaultcolon;

import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.Calendar;

public class InputNoWhitespaceBeforeCaseDefaultColon {
{
Expand Down Expand Up @@ -62,10 +62,10 @@ public class InputNoWhitespaceBeforeCaseDefaultColon {
break;
}

switch (TokenTypes.ABSTRACT) {
case TokenTypes.TYPECAST : // violation
switch (Calendar.MONDAY) {
case Calendar.TUESDAY : // violation
break;
case TokenTypes.ARRAY_DECLARATOR:
case Calendar.WEDNESDAY:
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import com.puppycrawl.tools.checkstyle.FileStatefulCheck;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though this is the meta scapper, I wasn't seeing any uses of these imports so I removed them because of their connection to this issue.
Let me know if there is a reason for these.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please recheck git history.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romani When I rechecked one file InputJavadocMetadataScraperNoCodeInFileCheck, the file had been like that since the beginning.

Pull #10827: reworks JavadocMetadataScrapperTest to make more sense

This is more me moving files around.

Issue #8771: Improve code coverage for metadata generator classes

This is where the file really started and it is the same. I didn't see anything in PRs, and this issue was for code coverage. I can only assume we wanted more of a representation of the Check without copying the check's full source.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's merge this PR

import com.puppycrawl.tools.checkstyle.utils.ScopeUtil;




/** //violation
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

import com.puppycrawl.tools.checkstyle.StatelessCheck;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;



/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import java.util.List;

import com.puppycrawl.tools.checkstyle.StatelessCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.DetailNode;
import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.JavadocUtil;
import com.puppycrawl.tools.checkstyle.utils.TokenUtil;







/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import java.util.Arrays;
import java.util.Locale;

import com.puppycrawl.tools.checkstyle.DetailAstImpl;

import com.puppycrawl.tools.checkstyle.StatelessCheck;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.CheckUtil;
import com.puppycrawl.tools.checkstyle.utils.CommonUtil;
import com.puppycrawl.tools.checkstyle.utils.TokenUtil;






/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

import com.puppycrawl.tools.checkstyle.StatelessCheck;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.FileContents;
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
import com.puppycrawl.tools.checkstyle.api.TextBlock;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.CommonUtil;







/**
* <p>
Expand Down