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

openjdk8/9 test code should be parseable by checkstyle #3033

Closed
romani opened this Issue Mar 12, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@romani
Member

romani commented Mar 12, 2016

list of suppressions: https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/projects-for-circle.properties#L6 due to problem of parsing files.

All parsing problems need to be grouped, reported as separate problems, all reported cases should be proved to be compiled by javac.

Exclude list should be minimized to list of folders/files that contain only non-compilable source by javac.

@romani romani added the approved label Mar 12, 2016

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach May 29, 2016

Member

Regression Errors on JDK8 in 5 files:

/test/java/lang/annotation/TypeAnnotationReflection.java:551:46: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/TypeAnnotationReflection.java.

/test/java/lang/annotation/TypeParamAnnotation.java:102:18: expecting IDENT, found '@'
/test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java:111:92: unexpected token: .
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java.

/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java:34:25: unexpected token: GetAnnotatedReceiverType
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java.

/test/tools/pack200/typeannos/TypeUseTarget.java:39:38: expecting ELLIPSIS, found 'this'
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TypeUseTarget.java.

/test/tools/pack200/typeannos/TargetTypes.java:93:25: expecting ELLIPSIS, found 'this'
/test/tools/pack200/typeannos/TargetTypes.java:108:6: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:112:13: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:150:9: unexpected token: new
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TargetTypes.java.

Regression Errors on JDK9 in 9 files:

/test/java/lang/annotation/TypeAnnotationReflection.java:622:46: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/TypeAnnotationReflection.java.

/test/java/lang/annotation/TypeParamAnnotation.java:102:18: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java.

/test/java/lang/annotation/TypeVariableBounds.java:97:37: expecting IDENT, found '@'
/test/java/lang/annotation/TypeVariableBounds.java:111:32: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/TypeVariableBounds.java.

/test/java/lang/annotation/typeAnnotations/TestExecutableGetAnnotatedType.java:200:52: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/TestExecutableGetAnnotatedType.java.

/test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java:131:92: unexpected token: .
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java.

/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java:35:25: unexpected token: GetAnnotatedReceiverType
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java.

/test/tools/pack200/typeannos/TypeUseTarget.java:39:38: expecting ELLIPSIS, found 'this'
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TypeUseTarget.java.

/test/tools/pack200/typeannos/TargetTypes.java:93:25: expecting ELLIPSIS, found 'this'
/test/tools/pack200/typeannos/TargetTypes.java:108:6: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:112:13: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:150:9: unexpected token: new
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TargetTypes.java.

/test/javax/xml/bind/jxc/8073519/InputWithError.java:28:10: unexpected token: compile
MismatchedTokenException occurred during the analysis of file /test/javax/xml/bind/jxc/8073519/InputWithError.java.
Member

rnveach commented May 29, 2016

Regression Errors on JDK8 in 5 files:

/test/java/lang/annotation/TypeAnnotationReflection.java:551:46: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/TypeAnnotationReflection.java.

/test/java/lang/annotation/TypeParamAnnotation.java:102:18: expecting IDENT, found '@'
/test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java:111:92: unexpected token: .
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java.

/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java:34:25: unexpected token: GetAnnotatedReceiverType
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java.

/test/tools/pack200/typeannos/TypeUseTarget.java:39:38: expecting ELLIPSIS, found 'this'
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TypeUseTarget.java.

/test/tools/pack200/typeannos/TargetTypes.java:93:25: expecting ELLIPSIS, found 'this'
/test/tools/pack200/typeannos/TargetTypes.java:108:6: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:112:13: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:150:9: unexpected token: new
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TargetTypes.java.

Regression Errors on JDK9 in 9 files:

/test/java/lang/annotation/TypeAnnotationReflection.java:622:46: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/TypeAnnotationReflection.java.

/test/java/lang/annotation/TypeParamAnnotation.java:102:18: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java.

/test/java/lang/annotation/TypeVariableBounds.java:97:37: expecting IDENT, found '@'
/test/java/lang/annotation/TypeVariableBounds.java:111:32: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/TypeVariableBounds.java.

/test/java/lang/annotation/typeAnnotations/TestExecutableGetAnnotatedType.java:200:52: expecting IDENT, found '@'
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/TestExecutableGetAnnotatedType.java.

/test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java:131:92: unexpected token: .
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java.

/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java:35:25: unexpected token: GetAnnotatedReceiverType
MismatchedTokenException occurred during the analysis of file /test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java.

/test/tools/pack200/typeannos/TypeUseTarget.java:39:38: expecting ELLIPSIS, found 'this'
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TypeUseTarget.java.

/test/tools/pack200/typeannos/TargetTypes.java:93:25: expecting ELLIPSIS, found 'this'
/test/tools/pack200/typeannos/TargetTypes.java:108:6: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:112:13: expecting IDENT, found '@'
/test/tools/pack200/typeannos/TargetTypes.java:150:9: unexpected token: new
MismatchedTokenException occurred during the analysis of file /test/tools/pack200/typeannos/TargetTypes.java.

/test/javax/xml/bind/jxc/8073519/InputWithError.java:28:10: unexpected token: compile
MismatchedTokenException occurred during the analysis of file /test/javax/xml/bind/jxc/8073519/InputWithError.java.
@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jun 3, 2016

Member

@rnveach , I merged all your PRs, please proceed.
do not forget to update excludes in properties file of chekcstyle-tester to make sure no regression happen.

Member

romani commented Jun 3, 2016

@rnveach , I merged all your PRs, please proceed.
do not forget to update excludes in properties file of chekcstyle-tester to make sure no regression happen.

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Oct 8, 2016

Member

current regression errors in JDK9:
http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java#l82

/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java:82:56: unexpected token: ?

/test/tools/pack200/typeannos/TypeUseTarget.java:39:74: unexpected token: ...
/test/tools/pack200/typeannos/TypeUseTarget.java:40:8: unexpected token: Object
/test/tools/pack200/typeannos/TypeUseTarget.java:40:26: unexpected token: String
/test/tools/pack200/typeannos/TypeUseTarget.java:40:36: unexpected token: [

/test/javax/xml/bind/jxc/8073519/InputWithError.java:28:10: unexpected token: compile

Not sure what ModalDialogActivationTest is, but the others are similar issues from last run.
InputWithError is a bug file and shouldn't compile.

code from file ModalDialogActivationTest:

public MyModalDialog(Frame owner, String title)ª {
Member

rnveach commented Oct 8, 2016

current regression errors in JDK9:
http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java#l82

/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java:82:56: unexpected token: ?

/test/tools/pack200/typeannos/TypeUseTarget.java:39:74: unexpected token: ...
/test/tools/pack200/typeannos/TypeUseTarget.java:40:8: unexpected token: Object
/test/tools/pack200/typeannos/TypeUseTarget.java:40:26: unexpected token: String
/test/tools/pack200/typeannos/TypeUseTarget.java:40:36: unexpected token: [

/test/javax/xml/bind/jxc/8073519/InputWithError.java:28:10: unexpected token: compile

Not sure what ModalDialogActivationTest is, but the others are similar issues from last run.
InputWithError is a bug file and shouldn't compile.

code from file ModalDialogActivationTest:

public MyModalDialog(Frame owner, String title)ª {
@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Oct 9, 2016

Member

@rnveach , please put ModalDialogActivationTest.java file to exclude.
Please open bug on openjdk to keep sources compilable :) , looks like they lost this test in their build system.

http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/tools/pack200/typeannos/TypeUseTarget.java

hard to read this file, is it compilable ? if yes - please create separate issue on it against checkstyle.
We could keep it in exclude till issue is fixed to keep running on openjdk now.

Member

romani commented Oct 9, 2016

@rnveach , please put ModalDialogActivationTest.java file to exclude.
Please open bug on openjdk to keep sources compilable :) , looks like they lost this test in their build system.

http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/tools/pack200/typeannos/TypeUseTarget.java

hard to read this file, is it compilable ? if yes - please create separate issue on it against checkstyle.
We could keep it in exclude till issue is fixed to keep running on openjdk now.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Oct 22, 2016

Member

@rnveach ,

http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/tools/pack200/typeannos/TypeUseTarget.java

hard to read this file, is it compilable ? if yes - please create separate issue on it against checkstyle.
We could keep it in exclude till issue is fixed to keep running on openjdk now.

do you have answer on this ?
Looks like we need to add and issues against checkstyle to support it.

  1. We need to add a comment that explains such exclusions.

/test/javax/xml/bind/jxc/8073519/

why not a single file exclusion ? you reported complile-problem only in
/test/javax/xml/bind/jxc/8073519/InputWithError.java

**/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java

Does it make sense to open the issue on openjdk to fix that file ?

openjdk8

do you remember why we have such big exclusions **/test/tools/**,**/test/java/lang/annotation/** ?

Member

romani commented Oct 22, 2016

@rnveach ,

http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/tools/pack200/typeannos/TypeUseTarget.java

hard to read this file, is it compilable ? if yes - please create separate issue on it against checkstyle.
We could keep it in exclude till issue is fixed to keep running on openjdk now.

do you have answer on this ?
Looks like we need to add and issues against checkstyle to support it.

  1. We need to add a comment that explains such exclusions.

/test/javax/xml/bind/jxc/8073519/

why not a single file exclusion ? you reported complile-problem only in
/test/javax/xml/bind/jxc/8073519/InputWithError.java

**/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java

Does it make sense to open the issue on openjdk to fix that file ?

openjdk8

do you remember why we have such big exclusions **/test/tools/**,**/test/java/lang/annotation/** ?

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Oct 23, 2016

Member

@romani

http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/tools/pack200/typeannos/TypeUseTarget.java#l39

@B String test(@B TypeUseTarget<K> this, @B String param, @B String @B ... vararg) {

This is the same as example from Issue #3238 . It is compilable and has an issue already opened.

public void m5(@Nullable String @Nullable ... vararg) {}

Folder is a bug reference number. Since the file is not compilable on purpose. It seemed more natural to me, at the time, that that whole folder couldn't be trusted with future files.
We can change this to just the file if you want to. I don't really expect them to add new files to this folder. I can do this with item 2.

I think they may already know. https://bugs.openjdk.java.net/browse/JDK-8166015?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel

Edit: Weird, says it was resolved on 2016-09-20.
Edit 2: Bug references change history: http://hg.openjdk.java.net/jdk9/client/jdk/rev/f4b285f26302#l1.44 and http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f4b285f26302#l1.44
So it should really be fixed. I'll double check before applying update.

No idea. That was added the same day this issue was opened by you with no other issue/PR attached. I don't think I was involved with the creation of this issue.

Member

rnveach commented Oct 23, 2016

@romani

http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/2bf254421854/test/tools/pack200/typeannos/TypeUseTarget.java#l39

@B String test(@B TypeUseTarget<K> this, @B String param, @B String @B ... vararg) {

This is the same as example from Issue #3238 . It is compilable and has an issue already opened.

public void m5(@Nullable String @Nullable ... vararg) {}

Folder is a bug reference number. Since the file is not compilable on purpose. It seemed more natural to me, at the time, that that whole folder couldn't be trusted with future files.
We can change this to just the file if you want to. I don't really expect them to add new files to this folder. I can do this with item 2.

I think they may already know. https://bugs.openjdk.java.net/browse/JDK-8166015?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel

Edit: Weird, says it was resolved on 2016-09-20.
Edit 2: Bug references change history: http://hg.openjdk.java.net/jdk9/client/jdk/rev/f4b285f26302#l1.44 and http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f4b285f26302#l1.44
So it should really be fixed. I'll double check before applying update.

No idea. That was added the same day this issue was opened by you with no other issue/PR attached. I don't think I was involved with the creation of this issue.

romani added a commit to checkstyle/contribution that referenced this issue Oct 23, 2016

romani added a commit to checkstyle/contribution that referenced this issue Oct 23, 2016

romani added a commit that referenced this issue Oct 23, 2016

romani added a commit to checkstyle/contribution that referenced this issue Oct 23, 2016

romani added a commit to checkstyle/contribution that referenced this issue Oct 23, 2016

@romani romani added this to the 7.2 milestone Oct 23, 2016

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Oct 23, 2016

Member

master build is passed;
comments were added for each exclusions;
openjdk8 exclusions are minimized;

Member

romani commented Oct 23, 2016

master build is passed;
comments were added for each exclusions;
openjdk8 exclusions are minimized;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment