[tomcat-jakartaee-migration] branch master updated: Add constructor to specify the profile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat-jakartaee-migration] branch master updated: Add constructor to specify the profile

remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git


The following commit(s) were added to refs/heads/master by this push:
     new 46f3682  Add constructor to specify the profile
46f3682 is described below

commit 46f368234f854c3da57e479ef3918beb1657c9d2
Author: remm <[hidden email]>
AuthorDate: Mon Feb 15 23:32:41 2021 +0100

    Add constructor to specify the profile
---
 src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java b/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java
index 0173f71..bc36b28 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java
@@ -37,6 +37,14 @@ public class ClassConverter implements Converter, ClassFileTransformer {
     private static final Logger logger = Logger.getLogger(ClassConverter.class.getCanonicalName());
     private static final StringManager sm = StringManager.getManager(ClassConverter.class);
 
+    protected final EESpecProfile profile;
+    public ClassConverter() {
+        this(EESpecProfile.TOMCAT);
+    }
+    public ClassConverter(EESpecProfile profile) {
+        this.profile = profile;
+    }
+
     @Override
     public boolean accepts(String filename) {
         String extension = Util.getExtension(filename);
@@ -88,7 +96,7 @@ public class ClassConverter implements Converter, ClassFileTransformer {
         ByteArrayInputStream inputStream = new ByteArrayInputStream(classfileBuffer);
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         try {
-            convert(className, inputStream, outputStream, EESpecProfile.TOMCAT);
+            convert(className, inputStream, outputStream, profile);
         } catch (IOException e) {
             throw new IllegalClassFormatException(e.getLocalizedMessage());
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]