This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git
The following commit(s) were added to refs/heads/main by this push: new 46467c0 Fix handling of javax.annotation package in 1.0.5 46467c0 is described below commit 46467c0a0942a70b5b011de321147362eca83c72 Author: remm <r...@apache.org> AuthorDate: Fri Dec 2 09:35:42 2022 +0100 Fix handling of javax.annotation package in 1.0.5 PR#40 submitted by Danny Thomas --- CHANGES.md | 2 +- .../java/org/apache/tomcat/jakartaee/EESpecProfiles.java | 14 +++++++------- .../org/apache/tomcat/jakartaee/EESpecProfileTest.java | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 08ecc7c..21e85b9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## 1.0.6 -- TBD +- Fix handling of javax.annotation package in 1.0.5. PR [#40](https://github.com/apache/tomcat-jakartaee-migration/pull/40) provided by Danny Thomas (remm) ## 1.0.5 diff --git a/src/main/java/org/apache/tomcat/jakartaee/EESpecProfiles.java b/src/main/java/org/apache/tomcat/jakartaee/EESpecProfiles.java index ff8c3a3..054a73c 100644 --- a/src/main/java/org/apache/tomcat/jakartaee/EESpecProfiles.java +++ b/src/main/java/org/apache/tomcat/jakartaee/EESpecProfiles.java @@ -64,17 +64,17 @@ public enum EESpecProfiles implements EESpecProfile { "Priority", "Resource", "Resources", - "security/DeclareRoles", - "security/DenyAll", - "security/PermitAll", - "security/RolesAllowed", - "security/RunAs", - "sql/DataSourceDefinition" + "security[/\\.]DeclareRoles", + "security[/\\.]DenyAll", + "security[/\\.]PermitAll", + "security[/\\.]RolesAllowed", + "security[/\\.]RunAs", + "sql[/\\.]DataSourceDefinition" )); static final String EE = String.join("|", Arrays.asList( "([/\\.](activation", - "annotation(" + ANNOTATION_CLASSES + ")", + "annotation[/\\.](" + ANNOTATION_CLASSES + ")", "batch", "decorator", "ejb", diff --git a/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java b/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java index 94d56d7..61bc2ae 100644 --- a/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java +++ b/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java @@ -27,6 +27,8 @@ public class EESpecProfileTest { public void testProfileTomcat() { EESpecProfile profile = EESpecProfiles.TOMCAT; + assertEquals("jakarta.annotation.PostConstruct", profile.convert("javax.annotation.PostConstruct")); + assertEquals("jakarta.annotation.security.DeclareRoles", profile.convert("javax.annotation.security.DeclareRoles")); assertEquals("jakarta.ejb", profile.convert("javax.ejb")); assertEquals("jakarta.el", profile.convert("javax.el")); assertEquals("jakarta.mail", profile.convert("javax.mail")); @@ -86,6 +88,8 @@ public class EESpecProfileTest { EESpecProfile profile = EESpecProfiles.EE; assertEquals("jakarta.activation.Generated", profile.convert("javax.activation.Generated")); + assertEquals("jakarta.annotation.PostConstruct", profile.convert("javax.annotation.PostConstruct")); + assertEquals("jakarta.annotation.security.DeclareRoles", profile.convert("javax.annotation.security.DeclareRoles")); assertEquals("jakarta.batch", profile.convert("javax.batch")); assertEquals("jakarta.decorator", profile.convert("javax.decorator")); assertEquals("jakarta.ejb", profile.convert("javax.ejb")); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org