[GitHub] [tomcat-jakartaee-migration] FSchumacher opened a new pull request, #45: Migrate SPI files in directories by renaming them to the jakartaee pr…

2023-03-25 Thread via GitHub


FSchumacher opened a new pull request, #45:
URL: https://github.com/apache/tomcat-jakartaee-migration/pull/45

   …efix
   
   We already rename files in JAR files, so directory handling should follow 
here. A more correct way to handle this, would probably be to restrict the 
renaming to files, that are found in META-INF/services directories, only.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-jakartaee-migration] codecov-commenter commented on pull request #45: Migrate SPI files in directories by renaming them to the jakartaee pr…

2023-03-25 Thread via GitHub


codecov-commenter commented on PR #45:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/45#issuecomment-1483795564

   ## 
[Codecov](https://codecov.io/gh/apache/tomcat-jakartaee-migration/pull/45?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#45](https://codecov.io/gh/apache/tomcat-jakartaee-migration/pull/45?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (647909e) into 
[main](https://codecov.io/gh/apache/tomcat-jakartaee-migration/commit/0e21b054e81aba8f28a55d43f5b9252e786053b3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (0e21b05) will **not change** coverage.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@Coverage Diff@@
   ##   main  #45   +/-   ##
   =
 Coverage 72.96%   72.96%   
 Complexity  130  130   
   =
 Files14   14   
 Lines   614  614   
 Branches104  104   
   =
 Hits448  448   
 Misses  126  126   
 Partials 40   40   
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/tomcat-jakartaee-migration/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[...in/java/org/apache/tomcat/jakartaee/Migration.java](https://codecov.io/gh/apache/tomcat-jakartaee-migration/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3RvbWNhdC9qYWthcnRhZWUvTWlncmF0aW9uLmphdmE=)
 | `84.04% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD 
build times. [Learn 
more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 66544] java.lang.ArrayIndexOutOfBoundsException @ rg.apache.coyote.http11.Http11Processor.service Error processing request

2023-03-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66544

Felix Schumacher  changed:

   What|Removed |Added

 OS||All
 Status|NEW |NEEDINFO

--- Comment #1 from Felix Schumacher  ---
Could this be related to
https://stackoverflow.com/questions/73556769/getting-errors-related-to-java-security-manager-expiringcache-java
(or https://github.com/adoptium/adoptium-support/issues/230)?

If so, you could try to set the JVM properties 
  sun.io.useCanonCaches=false
  sun.io.useCanonPrefixCache=false

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-jakartaee-migration] ebourg commented on a diff in pull request #45: Migrate SPI files in directories by renaming them to the jakartaee pr…

2023-03-25 Thread via GitHub


ebourg commented on code in PR #45:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/45#discussion_r1148359861


##
src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java:
##
@@ -139,6 +139,39 @@ public void testMigrateDirectory() throws Exception {
 String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
 assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
 assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new 
File("target/test-classes/migration/javax.enterprise.inject.spi.Extension");
+assertTrue("SPI file has not been migrated by renaming", 
migratedSpiFile.exists());
+
+String migratedSpiSource = FileUtils.readFileToString(migratedSpiFile, 
StandardCharsets.UTF_8);
+assertTrue("SPI file copied with content", 
migratedSpiSource.contains("some.class.Reference"));
+}
+
+@Test
+public void testMigrateDirectoryWithEeProfile() throws Exception {
+File sourceDirectory = new File("src/test/resources");
+File destinationDirectory = new 
File("target/test-classes/migration-ee");
+
+Migration migration = new Migration();
+migration.setEESpecProfile(EESpecProfiles.EE);
+migration.setSource(sourceDirectory);
+migration.setDestination(destinationDirectory);
+migration.execute();
+
+assertTrue("Destination directory not found", 
destinationDirectory.exists());
+
+File migratedFile = new File(destinationDirectory, 
"HelloServlet.java");
+assertTrue("Migrated file not found", migratedFile.exists());
+
+String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
+assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
+assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new File(destinationDirectory, 
"jakarta.enterprise.inject.spi.Extension");
+assertTrue("SPI file migrated by renaming", migratedSpiFile.exists());

Review Comment:
   The assert message is missing a "not" I think: "SPI file not migrated by 
renaming"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-jakartaee-migration] ebourg commented on a diff in pull request #45: Migrate SPI files in directories by renaming them to the jakartaee pr…

2023-03-25 Thread via GitHub


ebourg commented on code in PR #45:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/45#discussion_r1148359876


##
src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java:
##
@@ -139,6 +139,39 @@ public void testMigrateDirectory() throws Exception {
 String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
 assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
 assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new 
File("target/test-classes/migration/javax.enterprise.inject.spi.Extension");
+assertTrue("SPI file has not been migrated by renaming", 
migratedSpiFile.exists());
+
+String migratedSpiSource = FileUtils.readFileToString(migratedSpiFile, 
StandardCharsets.UTF_8);
+assertTrue("SPI file copied with content", 
migratedSpiSource.contains("some.class.Reference"));
+}
+
+@Test
+public void testMigrateDirectoryWithEeProfile() throws Exception {
+File sourceDirectory = new File("src/test/resources");
+File destinationDirectory = new 
File("target/test-classes/migration-ee");
+
+Migration migration = new Migration();
+migration.setEESpecProfile(EESpecProfiles.EE);
+migration.setSource(sourceDirectory);
+migration.setDestination(destinationDirectory);
+migration.execute();
+
+assertTrue("Destination directory not found", 
destinationDirectory.exists());
+
+File migratedFile = new File(destinationDirectory, 
"HelloServlet.java");
+assertTrue("Migrated file not found", migratedFile.exists());
+
+String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
+assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
+assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new File(destinationDirectory, 
"jakarta.enterprise.inject.spi.Extension");
+assertTrue("SPI file migrated by renaming", migratedSpiFile.exists());
+
+String migratedSpiSource = FileUtils.readFileToString(migratedSpiFile, 
StandardCharsets.UTF_8);
+assertTrue("SPI file copied with content", 
migratedSpiSource.contains("some.class.Reference"));

Review Comment:
   Same here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] FSchumacher opened a new pull request, #604: Fix Bug 66543 - Wrong log message used in StandardContext#fireRequestDestroyEvent

2023-03-25 Thread via GitHub


FSchumacher opened a new pull request, #604:
URL: https://github.com/apache/tomcat/pull/604

   Give it its own log message instead of re-using the one from 
fireRequestInitEvent.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-jakartaee-migration] FSchumacher commented on a diff in pull request #45: Migrate SPI files in directories by renaming them to the jakartaee pr…

2023-03-25 Thread via GitHub


FSchumacher commented on code in PR #45:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/45#discussion_r1148360532


##
src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java:
##
@@ -139,6 +139,39 @@ public void testMigrateDirectory() throws Exception {
 String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
 assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
 assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new 
File("target/test-classes/migration/javax.enterprise.inject.spi.Extension");
+assertTrue("SPI file has not been migrated by renaming", 
migratedSpiFile.exists());
+
+String migratedSpiSource = FileUtils.readFileToString(migratedSpiFile, 
StandardCharsets.UTF_8);
+assertTrue("SPI file copied with content", 
migratedSpiSource.contains("some.class.Reference"));
+}
+
+@Test
+public void testMigrateDirectoryWithEeProfile() throws Exception {
+File sourceDirectory = new File("src/test/resources");
+File destinationDirectory = new 
File("target/test-classes/migration-ee");
+
+Migration migration = new Migration();
+migration.setEESpecProfile(EESpecProfiles.EE);
+migration.setSource(sourceDirectory);
+migration.setDestination(destinationDirectory);
+migration.execute();
+
+assertTrue("Destination directory not found", 
destinationDirectory.exists());
+
+File migratedFile = new File(destinationDirectory, 
"HelloServlet.java");
+assertTrue("Migrated file not found", migratedFile.exists());
+
+String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
+assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
+assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new File(destinationDirectory, 
"jakarta.enterprise.inject.spi.Extension");
+assertTrue("SPI file migrated by renaming", migratedSpiFile.exists());

Review Comment:
   Oh, yes, the other test message are *reversed*. Will update them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 66543] Misleading error log in fireRequestDestroyEvent

2023-03-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66543

--- Comment #1 from Felix Schumacher  ---
I have created a PR (https://github.com/apache/tomcat/pull/604) and will merge
it, if no comments on the PR suggest otherwise.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-jakartaee-migration] ebourg merged pull request #45: Migrate SPI files in directories by renaming them to the jakartaee pr…

2023-03-25 Thread via GitHub


ebourg merged PR #45:
URL: https://github.com/apache/tomcat-jakartaee-migration/pull/45


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat-jakartaee-migration] branch main updated: Migrate SPI files in directories by renaming them to the jakartaee prefix (#45)

2023-03-25 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg 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 040b951  Migrate SPI files in directories by renaming them to the 
jakartaee prefix (#45)
040b951 is described below

commit 040b951aee19522fd7d58c231c1c30677539d973
Author: Felix Schumacher 
AuthorDate: Sat Mar 25 13:41:48 2023 +0100

Migrate SPI files in directories by renaming them to the jakartaee prefix 
(#45)
---
 CHANGES.md |  4 +++
 .../org/apache/tomcat/jakartaee/Migration.java |  3 +-
 .../org/apache/tomcat/jakartaee/MigrationTest.java | 33 ++
 .../javax.enterprise.inject.spi.Extension  |  1 +
 4 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 8b31d08..de8ff50 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,9 @@
 # Tomcat Migration Tool for Jakarta EE - Changelog
 
+## 1.0.7
+
+- When converting directories, rename files according to the chosen profile. 
(fschumacher)
+
 ## 1.0.6
 
 - 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)
diff --git a/src/main/java/org/apache/tomcat/jakartaee/Migration.java 
b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
index 74d32a3..62660dd 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Migration.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
@@ -252,7 +252,7 @@ public class Migration {
 String[] files = src.list();
 for (String file : files) {
 File srcFile = new File(src, file);
-File destFile = new File(dest, file);
+File destFile = new File(dest, profile.convert(file));
 if (srcFile.isDirectory()) {
 if ((destFile.exists() && destFile.isDirectory()) || 
destFile.mkdir()) {
 migrateDirectory(srcFile, destFile);
@@ -265,7 +265,6 @@ public class Migration {
 }
 }
 
-
 private void migrateFile(File src, File dest) throws IOException {
 boolean inplace = src.equals(dest);
 if (!inplace) {
diff --git a/src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java 
b/src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java
index 34048bb..6fc6a9b 100644
--- a/src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java
+++ b/src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java
@@ -139,6 +139,39 @@ public class MigrationTest {
 String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
 assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
 assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new 
File("target/test-classes/migration/javax.enterprise.inject.spi.Extension");
+assertTrue("SPI file has not been migrated by renaming", 
migratedSpiFile.exists());
+
+String migratedSpiSource = FileUtils.readFileToString(migratedSpiFile, 
StandardCharsets.UTF_8);
+assertTrue("SPI file not copied with content", 
migratedSpiSource.contains("some.class.Reference"));
+}
+
+@Test
+public void testMigrateDirectoryWithEeProfile() throws Exception {
+File sourceDirectory = new File("src/test/resources");
+File destinationDirectory = new 
File("target/test-classes/migration-ee");
+
+Migration migration = new Migration();
+migration.setEESpecProfile(EESpecProfiles.EE);
+migration.setSource(sourceDirectory);
+migration.setDestination(destinationDirectory);
+migration.execute();
+
+assertTrue("Destination directory not found", 
destinationDirectory.exists());
+
+File migratedFile = new File(destinationDirectory, 
"HelloServlet.java");
+assertTrue("Migrated file not found", migratedFile.exists());
+
+String migratedSource = FileUtils.readFileToString(migratedFile, 
StandardCharsets.UTF_8);
+assertFalse("Imports not migrated", migratedSource.contains("import 
javax.servlet"));
+assertTrue("Migrated imports not found", 
migratedSource.contains("import jakarta.servlet"));
+
+File migratedSpiFile = new File(destinationDirectory, 
"jakarta.enterprise.inject.spi.Extension");
+assertTrue("SPI file not migrated by renaming", 
migratedSpiFile.exists());
+
+String migratedSpiSource = FileUtils.readFileToString(migratedSpiFile, 
StandardCharsets.UTF_8);
+assertTrue("SPI file not copied with content", 
migratedSpiSource.contains("some.class.Reference"));
 }
 
 @Test
diff --git a/src/test/resources/javax.enterprise.inject.spi.Extension 
b/src/test/resources/javax.enterprise.inject.spi.Extension
new