-
Notifications
You must be signed in to change notification settings - Fork 15
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
Ensure that sigtest -IgnoreJDKClass can ignore JDK classes (java.* and javax.transaction.xa.*) during signature check #30
Ensure that sigtest -IgnoreJDKClass can ignore JDK classes (java.* and javax.transaction.xa.*) during signature check #30
Conversation
73b3a66
to
7e1cbdd
Compare
Signed-off-by: Scott Marlow <smarlow@redhat.com>
7e1cbdd
to
405644d
Compare
Signed-off-by: Scott Marlow <smarlow@redhat.com>
Will merge this soon so that we can start using the changes in EE 11 TCKs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks great. Just left a few review comments.
private static PackageGroup excludedJdkClasses = new PackageGroup(true); | ||
|
||
public static void enable() { | ||
excludedJdkClasses.addPackages(new String[] {"java", "javax.transaction.xa" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also ignore things like javax.sql
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I looked at the current https://github.com/jakartaee/platform-tck/blob/master/src/com/sun/ts/tests/signaturetest/signature-repository/jakarta.persistence.sig#L1840 file and do see that we should include javax.sql and others as well.
Perhaps we should exclude all of javax since all of the classes that we care about checking for (super-setting/sub-setting) changes should be in the jakarta
package.
For reference, output of grep javax
in signaturetest/signature-repository folder is attached to javax.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ I think it would be appropriate to ignore all javax
packages assuming that they are part of the JDK since this artifact is part of jakartaee
tools. But maybe put a big warning somewhere in the README that we will ignore java and javax
just in case :)
if (JDKExclude.isJdkClass(baseAnnotList[requiredPos].getName()) || | ||
JDKExclude.isJdkClass(testAnnotList[foundPos].getName())) { | ||
// don't check excluded Annotation classes | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be continue
instead of return
? Otherwise, you won't check the rest of the annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @KyleAure as this change led to a more correct checkAnnotations
implementation as we made the suggested fix and also changed to validate JDK annotations by checking that the implementation uses the same JDK annotation class name.
… even if a JDK annotation is checked. checkAnnotations() should also validate JDK annotations by only comparing the JDK annotation class name. Signed-off-by: Scott Marlow <smarlow@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍🏼. A contributor to this repo might need to review.
Work in progress for #20. This change eliminates the need for passing the often changing list JDK classes to exclude. Instead just set -IgnoreJDKClass