You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2018/06/08 19:36:48 UTC
[cxf] branch 3.1.x-fixes updated (4eb02c8 -> 207041b)
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a change to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.
from 4eb02c8 Recording .gitmergeinfo Changes
new 1532323 [CXF-7754] Fix WrappedAttachments.toArray
new 207041b Recording .gitmergeinfo Changes
The 2 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 | 1 +
.../org/apache/cxf/jaxws/context/WrappedAttachments.java | 4 ++--
.../apache/cxf/jaxws/context/WrappedAttachmentsTest.java | 13 +++++++++++--
3 files changed, 14 insertions(+), 4 deletions(-)
--
To stop receiving notification emails like this one, please contact
dkulp@apache.org.
[cxf] 01/02: [CXF-7754] Fix WrappedAttachments.toArray
Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 15323238564d80bdde07ec17aa271f1760c88ef1
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Fri Jun 8 15:20:41 2018 -0400
[CXF-7754] Fix WrappedAttachments.toArray
(cherry picked from commit 8eab54c2a285ac91b0a04b8cd7e899d45f15b73a)
# Conflicts:
# rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java
# rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedAttachmentsTest.java
---
.../org/apache/cxf/jaxws/context/WrappedAttachments.java | 4 ++--
.../apache/cxf/jaxws/context/WrappedAttachmentsTest.java | 13 +++++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java
index 4b53c62..485dc38 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java
@@ -70,8 +70,8 @@ class WrappedAttachments implements Set<Attachment> {
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
- T[] copy = a.length == attachments.size()
- ? a : (T[])Array.newInstance(a.getClass(), attachments.size());
+ T[] copy = a.length == attachments.size()
+ ? a : (T[])Array.newInstance(a.getClass().getComponentType(), attachments.size());
int i = 0;
for (Map.Entry<String, DataHandler> entry : attachments.entrySet()) {
Attachment o = cache.get(entry.getKey());
diff --git a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedAttachmentsTest.java b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedAttachmentsTest.java
index 8ce0ef9..90c2d53 100644
--- a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedAttachmentsTest.java
+++ b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedAttachmentsTest.java
@@ -62,11 +62,20 @@ public class WrappedAttachmentsTest extends Assert {
attachments.remove(attx);
assertEquals(1, attachments.size());
-
- Attachment[] atts = attachments.toArray(new Attachment[attachments.size()]);
+
+ Attachment[] atts = attachments.toArray(new Attachment[0]); //NOPMD - explicitly test this
+ assertEquals(1, atts.length);
+ assertEquals("att-1".equals(attx.getId()) ? "att-2" : "att-1", atts[0].getId());
+
+ atts = attachments.toArray(new Attachment[attachments.size()]); //NOPMD - explicitly test this
assertEquals(1, atts.length);
assertEquals("att-1".equals(attx.getId()) ? "att-2" : "att-1", atts[0].getId());
+ Object o[] = attachments.toArray(); //NOPMD - explicitly test this
+ assertEquals(1, o.length);
+ Attachment a = (Attachment)o[0];
+ assertEquals("att-1".equals(attx.getId()) ? "att-2" : "att-1", a.getId());
+
attachments.clear();
assertTrue(attachments.isEmpty());
assertTrue(content.isEmpty());
--
To stop receiving notification emails like this one, please contact
dkulp@apache.org.
[cxf] 02/02: Recording .gitmergeinfo Changes
Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 207041b8b490de686e0ee9a95851e4a09a240cf7
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Fri Jun 8 15:36:42 2018 -0400
Recording .gitmergeinfo Changes
---
.gitmergeinfo | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitmergeinfo b/.gitmergeinfo
index e3d7be2..662d813 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -1120,6 +1120,7 @@ M 8dbc8cbfa532706ec138c3580543d38ee5c34daf
M 8e131133c8566a124605cb06e0b6db98fddb5972
M 8e650cfe3efd63a06c25b7e912d9d4db61598eb1
M 8e8f01a3cb5a83c5b97b5a037acb5e0bb777e3aa
+M 8eab54c2a285ac91b0a04b8cd7e899d45f15b73a
M 8edb9dc618a0e87de7aaccadc799518fda4f866b
M 8f8e587cde7ec97410da6b0586810ccf8f0f3233
M 8fa9b8b14b391a419569c1050d2a5a6ffa37710d
--
To stop receiving notification emails like this one, please contact
dkulp@apache.org.