[cxf] branch 3.3.x-fixes updated (e0a3a23 -> 6b3d768)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[cxf] branch 3.3.x-fixes updated (e0a3a23 -> 6b3d768)

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

coheigea pushed a change to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from e0a3a23  [CXF-8191]align dom4j bundle version to 2.1.1
     new 41c834a  getBytes uses the platform charset by default. (#624)
     new cdc0942  Removing exclusions which is no longer required
     new 6b3d768  Recording .gitmergeinfo Changes

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                                 |  2 ++
 parent/pom.xml                                                |  6 ------
 .../java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java   | 11 +++++------
 3 files changed, 7 insertions(+), 12 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[cxf] 01/03: getBytes uses the platform charset by default. (#624)

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

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 41c834aea9bc6a537f7b336e626d07036e40b5c6
Author: Adrian Leonhard <[hidden email]>
AuthorDate: Tue Jan 14 13:35:05 2020 +0100

    getBytes uses the platform charset by default. (#624)
   
    * getBytes uses the platform charset by default.
   
    As far as I can see, the only place where the schemas are loaded into the cache is loadSchemasIntoCache, where they are extracted from an XML Document. As such, they won't have an associated encoding. The XMLSource defaults to UTF-8, so this blows up if you have special characters and, for example, windows-1252 as the platform charset.
   
    * Alphabet hard
   
    * Update WadlGenerator.java
   
    https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/
   
    * Remove BOS import
   
    (cherry picked from commit 543521ab051cb4f199faeab5765d001920bbbba2)
---
 .../java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
index 3573a14..1827e81 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
@@ -19,7 +19,6 @@
 package org.apache.cxf.jaxrs.model.wadl;
 
 import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
@@ -32,6 +31,7 @@ import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.net.URI;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -1978,7 +1978,7 @@ public class WadlGenerator implements ContainerRequestFilter {
             this.theSchemas = new LinkedList<>();
             // we'll need to do the proper schema caching eventually
             for (String s : schemas) {
-                XMLSource source = new XMLSource(new ByteArrayInputStream(s.getBytes()));
+                XMLSource source = new XMLSource(new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8)));
                 source.setBuffering();
                 Map<String, String> locs = getLocationsMap(source, "import", links, ui);
                 locs.putAll(getLocationsMap(source, "include", links, ui));
@@ -2026,17 +2026,16 @@ public class WadlGenerator implements ContainerRequestFilter {
         }
 
         private String transformSchema(String schema, Map<String, String> locs) {
-            ByteArrayOutputStream bos = new ByteArrayOutputStream();
-            SchemaConverter sc = new SchemaConverter(StaxUtils.createXMLStreamWriter(bos), locs);
+            StringWriter sw = new StringWriter();
+            SchemaConverter sc = new SchemaConverter(StaxUtils.createXMLStreamWriter(sw), locs);
             try {
                 StaxUtils.copy(new StreamSource(new StringReader(schema)), sc);
                 sc.flush();
                 sc.close();
-                return bos.toString();
+                return sw.toString();
             } catch (Exception ex) {
                 return schema;
             }
-
         }
 
         @Override

Reply | Threaded
Open this post in threaded view
|

[cxf] 02/03: Removing exclusions which is no longer required

coheigea
Administrator
In reply to this post by coheigea
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit cdc0942717bda3ebd965464199ef175d6271e05f
Author: Colm O hEigeartaigh <[hidden email]>
AuthorDate: Tue Jan 14 17:30:28 2020 +0000

    Removing exclusions which is no longer required
   
    (cherry picked from commit 48caf0646efb0bcecc2a740c5819a7c1a6ee3110)
---
 parent/pom.xml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 63ee9da..29c1840 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1260,12 +1260,6 @@
                 <groupId>org.apache.cxf.xjc-utils</groupId>
                 <artifactId>cxf-xjc-runtime</artifactId>
                 <version>${cxf.xjc-utils.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>javax.xml.bind</groupId>
-                        <artifactId>jaxb-api</artifactId>
-                    </exclusion>
-                </exclusions>
             </dependency>
             
             <dependency>

Reply | Threaded
Open this post in threaded view
|

[cxf] 03/03: Recording .gitmergeinfo Changes

coheigea
Administrator
In reply to this post by coheigea
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 6b3d7681bd43a56e09b2931ac106f90e854b1b83
Author: Colm O hEigeartaigh <[hidden email]>
AuthorDate: Tue Jan 14 19:39:03 2020 +0000

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 9b23675..b595b2d 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -12,6 +12,7 @@ B 11de1e0dfff9a8f9b157e23983c8e25f8503f868
 B 1279837f4879cb5446ae402cec432010455151fa
 B 129a02d671c9aa0bcbb3be1ffd732d7937583667
 B 1448dd059193dac0a975520707ae98b1fe3a7e18
+B 16c1d31b17b310d32d24676d3aca9c2b80c866ee
 B 180fbbbd5571840b5f7a09ab7c0ce59605edd346
 B 1c55f929bd90a5a50530b5eaf22216c93ce3f2f9
 B 1e01eef91b69706c55874d8df5e14a555d11c91a
@@ -43,6 +44,7 @@ B 4ba8ca20314da9a581f1e9a17cec5f14a210f55f
 B 4c39a21a06edc779a91d5dc86cf85257d7a7d5d4
 B 4d46618c17cb5c1386d493c75faf0f89dbece267
 B 505b76285bae4b9d9827eb8191ce0a08d6623d42
+B 5c81c3e82990ae0906a6e2b48746726f894618a1
 B 5fd6e467773b092a0327fef64fd4c9e4cce5f6e1
 B 62e828c7e74d0dd5d4e337a090344a13501d8aeb
 B 64584f32c8a4632344a1e062e0fc969dfd88e41e