|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2021 the original author or authors. |
| 2 | + * Copyright 2002-2022 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
16 | 16 |
|
17 | 17 | package org.springframework.jms.support;
|
18 | 18 |
|
19 |
| -import java.util.Arrays; |
20 | 19 | import java.util.Enumeration;
|
21 | 20 | import java.util.HashMap;
|
22 |
| -import java.util.HashSet; |
23 | 21 | import java.util.Map;
|
24 | 22 | import java.util.Set;
|
25 | 23 |
|
|
56 | 54 | */
|
57 | 55 | public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> implements JmsHeaderMapper {
|
58 | 56 |
|
59 |
| - private static final Set<Class<?>> SUPPORTED_PROPERTY_TYPES = new HashSet<>(Arrays.asList( |
60 |
| - Boolean.class, Byte.class, Double.class, Float.class, Integer.class, Long.class, Short.class, String.class)); |
| 57 | + private static final Set<Class<?>> SUPPORTED_PROPERTY_TYPES = Set.of(Boolean.class, Byte.class, |
| 58 | + Double.class, Float.class, Integer.class, Long.class, Short.class, String.class, byte[].class); |
61 | 59 |
|
62 | 60 |
|
63 | 61 | @Override
|
@@ -99,7 +97,7 @@ public void fromHeaders(MessageHeaders headers, jakarta.jms.Message jmsMessage)
|
99 | 97 | Object value = entry.getValue();
|
100 | 98 | if (value != null && SUPPORTED_PROPERTY_TYPES.contains(value.getClass())) {
|
101 | 99 | try {
|
102 |
| - String propertyName = this.fromHeaderName(headerName); |
| 100 | + String propertyName = fromHeaderName(headerName); |
103 | 101 | jmsMessage.setObjectProperty(propertyName, value);
|
104 | 102 | }
|
105 | 103 | catch (Exception ex) {
|
@@ -211,7 +209,7 @@ public MessageHeaders toHeaders(jakarta.jms.Message jmsMessage) {
|
211 | 209 | while (jmsPropertyNames.hasMoreElements()) {
|
212 | 210 | String propertyName = jmsPropertyNames.nextElement().toString();
|
213 | 211 | try {
|
214 |
| - String headerName = this.toHeaderName(propertyName); |
| 212 | + String headerName = toHeaderName(propertyName); |
215 | 213 | headers.put(headerName, jmsMessage.getObjectProperty(propertyName));
|
216 | 214 | }
|
217 | 215 | catch (Exception ex) {
|
|
0 commit comments