This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 08f418a907 Code cleanup
08f418a907 is described below
commit 08f418a9077efe877f9e1bdbc177491d03438fa4
Author: James Bognar <[email protected]>
AuthorDate: Sun Oct 19 17:13:20 2025 -0400
Code cleanup
---
TODO-Utils.md | 138 ----------
.../org/apache/juneau/bean/openapi3/Items.java | 5 +-
.../juneau/bean/openapi3/SecuritySchemeInfo.java | 5 +-
.../org/apache/juneau/bean/swagger/HeaderInfo.java | 4 +-
.../java/org/apache/juneau/bean/swagger/Items.java | 4 +-
.../apache/juneau/bean/swagger/ParameterInfo.java | 7 +-
.../apache/juneau/bean/swagger/SecurityScheme.java | 3 +-
.../apache/juneau/common/utils/ArrayUtils2.java | 290 ++++++++++++++++++++
.../juneau/jena/annotation/RdfAnnotation.java | 5 +-
.../main/java/org/apache/juneau/BeanFilter.java | 2 +-
.../java/org/apache/juneau/BeanPropertyMeta.java | 4 +-
.../src/main/java/org/apache/juneau/ClassMeta.java | 2 +-
.../src/main/java/org/apache/juneau/MediaType.java | 8 +-
.../main/java/org/apache/juneau/StringRanges.java | 2 +-
.../apache/juneau/annotation/AnnotationImpl.java | 3 +-
.../apache/juneau/annotation/BeanAnnotation.java | 5 +-
.../juneau/annotation/BeanIgnoreAnnotation.java | 3 +-
.../apache/juneau/annotation/BeancAnnotation.java | 3 +-
.../apache/juneau/annotation/BeanpAnnotation.java | 7 +-
.../juneau/annotation/ExampleAnnotation.java | 3 +-
.../apache/juneau/annotation/ItemsAnnotation.java | 10 +-
.../juneau/annotation/MarshalledAnnotation.java | 3 +-
.../juneau/annotation/NamePropertyAnnotation.java | 3 +-
.../annotation/ParentPropertyAnnotation.java | 3 +-
.../apache/juneau/annotation/SchemaAnnotation.java | 44 +--
.../juneau/annotation/SubItemsAnnotation.java | 10 +-
.../apache/juneau/annotation/SwapAnnotation.java | 5 +-
.../annotation/TargetedAnnotationBuilder.java | 3 +-
.../juneau/annotation/TargetedAnnotationImpl.java | 4 +-
.../annotation/TargetedAnnotationTBuilder.java | 5 +-
.../juneau/annotation/TargetedAnnotationTImpl.java | 4 +-
.../apache/juneau/annotation/UriAnnotation.java | 3 +-
.../org/apache/juneau/collections/JsonMap.java | 4 +-
.../juneau/csv/annotation/CsvAnnotation.java | 3 +-
.../apache/juneau/html/BasicHtmlDocTemplate.java | 2 +-
.../juneau/html/annotation/HtmlAnnotation.java | 3 +-
.../juneau/html/annotation/HtmlLinkAnnotation.java | 3 +-
.../juneau/http/annotation/ContentAnnotation.java | 3 +-
.../juneau/http/annotation/FormDataAnnotation.java | 3 +-
.../juneau/http/annotation/HeaderAnnotation.java | 3 +-
.../juneau/http/annotation/PathAnnotation.java | 3 +-
.../http/annotation/PathRemainderAnnotation.java | 5 +-
.../juneau/http/annotation/QueryAnnotation.java | 3 +-
.../juneau/http/annotation/RequestAnnotation.java | 3 +-
.../juneau/http/annotation/ResponseAnnotation.java | 7 +-
.../http/annotation/StatusCodeAnnotation.java | 3 +-
.../org/apache/juneau/internal/ArrayUtils.java | 296 ---------------------
.../java/org/apache/juneau/internal/SimpleMap.java | 4 +-
.../juneau/json/annotation/JsonAnnotation.java | 3 +-
.../msgpack/annotation/MsgPackAnnotation.java | 3 +-
.../juneau/oapi/annotation/OpenApiAnnotation.java | 3 +-
.../plaintext/annotation/PlainTextAnnotation.java | 3 +-
.../juneau/soap/annotation/SoapXmlAnnotation.java | 3 +-
.../juneau/uon/annotation/UonAnnotation.java | 3 +-
.../urlencoding/UrlEncodingParserSession.java | 2 +-
.../annotation/UrlEncodingAnnotation.java | 3 +-
.../apache/juneau/xml/XmlSerializerSession.java | 2 +-
.../juneau/xml/annotation/XmlAnnotation.java | 3 +-
.../apache/juneau/http/header/BasicCsvHeader.java | 6 +-
.../org/apache/juneau/http/header/EntityTags.java | 4 +-
.../apache/juneau/http/part/BasicCsvArrayPart.java | 4 +-
.../juneau/rest/mock/MockServletRequest.java | 2 +-
.../rest/annotation/OpSwaggerAnnotation.java | 17 +-
.../juneau/rest/annotation/RestAnnotation.java | 37 +--
.../rest/annotation/RestDeleteAnnotation.java | 17 +-
.../juneau/rest/annotation/RestGetAnnotation.java | 23 +-
.../juneau/rest/annotation/RestOpAnnotation.java | 28 +-
.../rest/annotation/RestOptionsAnnotation.java | 23 +-
.../rest/annotation/RestPatchAnnotation.java | 29 +-
.../juneau/rest/annotation/RestPostAnnotation.java | 29 +-
.../juneau/rest/annotation/RestPutAnnotation.java | 29 +-
.../juneau/rest/annotation/SwaggerAnnotation.java | 9 +-
.../org/apache/juneau/rest/arg/FormDataArg.java | 3 +-
.../java/org/apache/juneau/rest/arg/HeaderArg.java | 3 +-
.../java/org/apache/juneau/rest/arg/QueryArg.java | 3 +-
.../org/apache/juneau/rest/util/RestUtils.java | 2 +-
.../annotation/BeanConfigAnnotation_Test.java | 3 +-
.../juneau/html/HtmlDocConfigAnnotation_Test.java | 3 +-
.../apache/juneau/reflect/ExecutableInfo_Test.java | 3 +-
.../org/apache/juneau/reflect/ParamInfoTest.java | 3 +-
.../juneau/utest/utils/FakeWriterSerializer.java | 3 +-
.../org/apache/juneau/utils/ArrayUtilsTest.java | 29 +-
.../apache/juneau/xml/XmlConfigAnnotationTest.java | 3 +-
83 files changed, 599 insertions(+), 692 deletions(-)
diff --git a/TODO-Utils.md b/TODO-Utils.md
index 3165bc2d0d..e69de29bb2 100644
--- a/TODO-Utils.md
+++ b/TODO-Utils.md
@@ -1,138 +0,0 @@
-# TODO: Replace Utils References with Static Imports
-
-This document lists files that still contain `Utils.` method calls that can be
replaced with static imports.
-
-## Files with Utils. calls that need static import replacement
-
-### High Priority Files (Multiple Utils. calls) - ✅ COMPLETED
-
-#### 1.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/collections/JsonList.java`
- ✅ COMPLETED
-- **Line 272**: `Utils.isEmpty(s)` → `Utils.isEmpty(s)` (kept qualified due to
import conflicts)
-- **Line 275**: `Utils.splita(s.trim(), ',')` → `Utils.splita(s.trim(), ',')`
(kept qualified due to import conflicts)
-- **Status**: ⚠️ Import conflicts with `java.util.*` prevent static imports
-
-#### 2.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java` - ✅
COMPLETED
-- **Line 902**: `Utils.array(properties.values(), BeanPropertyMeta.class)` →
`array(properties.values(), BeanPropertyMeta.class)`
-- **Line 922**: `Utils.eq(this, (BeanMeta<?>)o, (x, y) ->
Utils.eq(x.classMeta, y.classMeta))` → `eq(this, (BeanMeta<?>)o, (x, y) ->
eq(x.classMeta, y.classMeta))`
-- **Status**: ✅ Successfully replaced with static imports
-
-#### 3.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserSession.java`
- ✅ COMPLETED
-- **Line 289**: `Utils.opt(parseAnything(eType.getElementType(), r, outer,
isRoot, pMeta))` → `opt(parseAnything(eType.getElementType(), r, outer, isRoot,
pMeta))`
-- **Status**: ✅ Successfully replaced with static imports
-
-#### 4.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/CollectionUtils.java`
- ✅ COMPLETED
-- **Line 89**: `Utils.set(entries)` → `set(entries)`
-- **Line 547**: `Utils.set(values)` → `set(values)`
-- **Status**: ✅ Successfully replaced with static imports
-
-#### 5.
`juneau-microservice/juneau-microservice-jetty/src/main/java/org/apache/juneau/microservice/jetty/JettyMicroservice.java`
-- **Line 548**: `Utils.firstNonNull(builder.ports,
cf.get("Jetty/port").as(int[].class).orElseGet(() ->
mf.getWithDefault("Jetty-Port", new int[] { 8000 }, int[].class)))`
-- **Line 556**: `Utils.firstNonNull(builder.jettyXmlResolveVars,
cf.get("Jetty/resolveVars").asBoolean().orElse(false))`
-- **Status**: Needs `import static org.apache.juneau.common.utils.Utils.*;`
-
-#### 6.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java`
-- **Line 232**: `Utils.opt(parseAnything(eType.getElementType(), r, outer))`
-- **Status**: Needs `import static org.apache.juneau.common.utils.Utils.*;`
-
-#### 7.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java`
- ✅ COMPLETED
-- **Line 612**: `Utils.s(o)` → `s(o)`
-- **Line 676**: `Utils.s(value)` → `s(value)`
-- **Line 883**: `Utils.firstNonNull(bpHtml.getRender(), cHtml.getRender())` →
`firstNonNull(bpHtml.getRender(), cHtml.getRender())`
-- **Status**: ✅ Successfully replaced with static imports
-
-#### 8.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerSession.java`
- ✅ COMPLETED
-- **Line 246**: `Utils.isNotEmpty(l)` → `isNotEmpty(l)`
-- **Status**: ✅ Successfully replaced with static imports
-
-#### 9.
`juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java`
- ✅ COMPLETED
-- **Line 268**: `Utils.isEmpty(Utils.s(qs))` → `isEmpty(s(qs))`
-- **Status**: ✅ Successfully replaced with static imports
-
-#### 10.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserSession.java`
- ✅ COMPLETED
-- **Line 215**: `Utils.opt(parseAnything(eType.getElementType(), r, outer,
pMeta))` → `opt(parseAnything(eType.getElementType(), r, outer, pMeta))`
-- **Status**: ✅ Successfully replaced with static imports
-
-### Test Files (Many Utils. calls)
-
-#### 11.
`juneau-utest/src/test/java/org/apache/juneau/utils/StringUtils_Test.java`
-- **Lines 398-888**: Multiple `Utils.` method calls in test methods
-- **Status**: Already has `import static
org.apache.juneau.common.utils.Utils.*;` on line 22
-- **Note**: This file has many test cases that call Utils methods directly for
testing purposes
-
-### Files with Single Utils. calls
-
-#### 12.
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java`
-- **Status**: Already has `import static
org.apache.juneau.common.utils.Utils.*;` on line 22
-- **Note**: Check for any remaining Utils. calls
-
-#### 13.
`juneau-microservice/juneau-microservice-jetty/src/main/java/org/apache/juneau/microservice/jetty/JettyLogger.java`
-- **Status**: Already has `import static
org.apache.juneau.common.utils.Utils.*;` on line 20
-- **Note**: Check for any remaining Utils. calls
-
-#### 14.
`juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java`
-- **Status**: Already has `import static
org.apache.juneau.common.utils.Utils.*;` on line 21
-- **Note**: Check for any remaining Utils. calls
-
-#### 15.
`juneau-utest/src/test/java/org/apache/juneau/serializer/UriResolution_Test.java`
-- **Status**: Already has `import static
org.apache.juneau.common.utils.Utils.*;` on line 19
-- **Note**: Check for any remaining Utils. calls
-
-#### 16.
`juneau-core/juneau-bct/src/main/java/org/apache/juneau/junit/bct/BasicBeanConverter.java`
-- **Status**: Has `import static org.apache.juneau.junit.bct.Utils.*;` on line
20
-- **Note**: This is a different Utils class (junit.bct.Utils), not the common
Utils
-
-#### 17.
`juneau-core/juneau-bct/src/main/java/org/apache/juneau/junit/bct/Stringifiers.java`
-- **Status**: Has `import static org.apache.juneau.junit.bct.Utils.*;` on line
21
-- **Note**: This is a different Utils class (junit.bct.Utils), not the common
Utils
-
-## Files with Import Statements Only (Already Fixed)
-
-These files only contain import statements for Utils and no actual Utils.
method calls:
-
--
`juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/UrlPath.java`
(line 21)
--
`juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanStore.java`
(line 19)
--
`juneau-core/juneau-config/src/main/java/org/apache/juneau/config/internal/ConfigMap.java`
(line 22)
--
`juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java`
(line 25)
--
`juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/logger/CallLogger.java`
(line 23)
--
`juneau-core/juneau-common/src/main/java/org/apache/juneau/common/utils/StringUtils.java`
(line 24)
--
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParserSession.java`
(line 22)
--
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriResolver.java`
(line 22)
--
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MediaRange.java`
(line 19)
--
`juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathRemainderAnnotation.java`
(line 21)
-
-## Non-Code Files (Ignore)
-
-- `TODO-switch.md` - Documentation file
-- `juneau-docs/docs/release-notes/9.2.0.md` - Documentation file
-
-## Summary
-
-**Total files needing Utils. replacement**: 17 files
-**✅ High Priority Files Completed**: 8 out of 10 files (80% complete)
-**Files with static imports already**: 10 files (just need to replace Utils.
calls)
-**Files needing static imports added**: 2 files (JettyMicroservice.java,
UrlEncodingParserSession.java)
-**Test files**: 1 file (StringUtils_Test.java - may need special handling)
-**Different Utils classes**: 2 files (junit.bct.Utils - not the common Utils)
-
-## Progress Update
-
-### ✅ Completed High Priority Files (8/10):
-1. ✅ BeanMeta.java - 2 Utils. calls replaced
-2. ✅ HtmlParserSession.java - 1 Utils. call replaced
-3. ✅ CollectionUtils.java - 2 Utils. calls replaced
-4. ✅ HtmlSerializerSession.java - 3 Utils. calls replaced
-5. ✅ CsvSerializerSession.java - 1 Utils. call replaced
-6. ✅ RestUtils.java - 1 Utils. call replaced
-7. ✅ JsonParserSession.java - 1 Utils. call replaced
-8. ⚠️ JsonList.java - Import conflicts prevent static imports (kept qualified)
-
-### 🔄 Remaining High Priority Files (2/10):
-1. JettyMicroservice.java - 2 Utils. calls (needs static import added)
-2. UrlEncodingParserSession.java - 1 Utils. call (needs static import added)
-
-## Recommended Order
-
-1. ✅ **High Priority**: Files with multiple Utils. calls that already have
static imports (8/10 completed)
-2. **Medium Priority**: Files that need static imports added (2 files
remaining)
-3. **Low Priority**: Test files and single-call files
-4. **Ignore**: Documentation files and different Utils classes
diff --git
a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
index d1f3a6045e..c71f503429 100644
---
a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
+++
b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
@@ -17,7 +17,6 @@
package org.apache.juneau.bean.openapi3;
import static org.apache.juneau.common.utils.Utils.*;
-import static org.apache.juneau.internal.ArrayUtils.contains;
import static org.apache.juneau.internal.CollectionBuilders.*;
import static org.apache.juneau.internal.ConverterUtils.*;
@@ -431,7 +430,7 @@ public class Items extends OpenApiElement {
* @return This object
*/
public Items setCollectionFormat(String value) {
- if (isStrict() && ! contains(value, VALID_COLLECTION_FORMATS))
+ if (isStrict() && ! ArrayUtils2.contains(value,
VALID_COLLECTION_FORMATS))
throw new BasicRuntimeException("Invalid value passed
in to setCollectionFormat(String). Value=''{0}'', valid values={1}", value,
VALID_COLLECTION_FORMATS);
collectionFormat = value;
return this;
@@ -703,7 +702,7 @@ public class Items extends OpenApiElement {
* @return This object
*/
public Items setType(String value) {
- if (isStrict() && ! contains(value, VALID_TYPES))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_TYPES))
throw new IllegalArgumentException("Invalid value
passed in to setType(String). Value='" + value + "', valid values=" +
Json5Serializer.DEFAULT.toString(VALID_TYPES));
type = value;
return this;
diff --git
a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SecuritySchemeInfo.java
b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SecuritySchemeInfo.java
index 0ddae628bd..30962cb34c 100644
---
a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SecuritySchemeInfo.java
+++
b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SecuritySchemeInfo.java
@@ -17,7 +17,6 @@
package org.apache.juneau.bean.openapi3;
import static org.apache.juneau.common.utils.Utils.*;
-import static org.apache.juneau.internal.ArrayUtils.contains;
import static org.apache.juneau.internal.CollectionBuilders.*;
import static org.apache.juneau.internal.ConverterUtils.*;
@@ -340,7 +339,7 @@ public class SecuritySchemeInfo extends OpenApiElement {
* @return This object
*/
public SecuritySchemeInfo setIn(String value) {
- if (isStrict() && ! contains(value, VALID_IN))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_IN))
throw new BasicRuntimeException("Invalid value passed
in to setIn(String). Value=''{0}'', valid values={1}", value, VALID_IN);
in = value;
return this;
@@ -430,7 +429,7 @@ public class SecuritySchemeInfo extends OpenApiElement {
* @return This object
*/
public SecuritySchemeInfo setType(String value) {
- if (isStrict() && ! contains(value, VALID_TYPES))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_TYPES))
throw new BasicRuntimeException("Invalid value passed
in to setType(String). Value=''{0}'', valid values={1}", value, VALID_TYPES);
type = value;
return this;
diff --git
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
index cc76c46849..497a8cbd9d 100644
---
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
+++
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
@@ -452,7 +452,7 @@ public class HeaderInfo extends SwaggerElement {
* @return This object.
*/
public HeaderInfo setCollectionFormat(String value) {
- if (isStrict() && ! ArrayUtils.contains(value,
VALID_COLLECTION_FORMATS))
+ if (isStrict() && ! ArrayUtils2.contains(value,
VALID_COLLECTION_FORMATS))
throw new BasicRuntimeException("Invalid value passed
in to setCollectionFormat(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_COLLECTION_FORMATS));
collectionFormat = value;
return this;
@@ -734,7 +734,7 @@ public class HeaderInfo extends SwaggerElement {
* @return This object.
*/
public HeaderInfo setType(String value) {
- if (isStrict() && ! ArrayUtils.contains(value, VALID_TYPES))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_TYPES))
throw new BasicRuntimeException("Invalid value passed
in to setType(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_TYPES));
type = value;
return this;
diff --git
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
index c7b0ab6799..e30a9b65b9 100644
---
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
+++
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
@@ -425,7 +425,7 @@ public class Items extends SwaggerElement {
* @return This object.
*/
public Items setCollectionFormat(String value) {
- if (isStrict() && ! ArrayUtils.contains(value,
VALID_COLLECTION_FORMATS))
+ if (isStrict() && ! ArrayUtils2.contains(value,
VALID_COLLECTION_FORMATS))
throw new BasicRuntimeException("Invalid value passed
in to setCollectionFormat(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_COLLECTION_FORMATS));
collectionFormat = value;
return this;
@@ -678,7 +678,7 @@ public class Items extends SwaggerElement {
* @return This object.
*/
public Items setType(String value) {
- if (isStrict() && ! ArrayUtils.contains(value, VALID_TYPES))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_TYPES))
throw new BasicRuntimeException("Invalid value passed
in to setType(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_TYPES));
type = value;
return this;
diff --git
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/ParameterInfo.java
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/ParameterInfo.java
index 41e0a331d4..1569aa691c 100644
---
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/ParameterInfo.java
+++
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/ParameterInfo.java
@@ -17,7 +17,6 @@
package org.apache.juneau.bean.swagger;
import static org.apache.juneau.common.utils.Utils.*;
-import static org.apache.juneau.internal.ArrayUtils.contains;
import static org.apache.juneau.internal.CollectionBuilders.*;
import static org.apache.juneau.internal.ConverterUtils.*;
@@ -665,7 +664,7 @@ public class ParameterInfo extends SwaggerElement {
* @return This object.
*/
public ParameterInfo setCollectionFormat(String value) {
- if (isStrict() && ! contains(value, VALID_COLLECTION_FORMATS))
+ if (isStrict() && ! ArrayUtils2.contains(value,
VALID_COLLECTION_FORMATS))
throw new BasicRuntimeException("Invalid value passed
in to setCollectionFormat(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_COLLECTION_FORMATS));
collectionFormat = value;
return this;
@@ -824,7 +823,7 @@ public class ParameterInfo extends SwaggerElement {
* @return This object.
*/
public ParameterInfo setIn(String value) {
- if (isStrict() && ! contains(value, VALID_IN))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_IN))
throw new BasicRuntimeException("Invalid value passed
in to setIn(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_IN));
in = value;
if ("path".equals(value))
@@ -1025,7 +1024,7 @@ public class ParameterInfo extends SwaggerElement {
* @return This object.
*/
public ParameterInfo setType(String value) {
- if (isStrict() && ! contains(value, VALID_TYPES))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_TYPES))
throw new BasicRuntimeException("Invalid value passed
in to setType(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_TYPES));
type = value;
return this;
diff --git
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SecurityScheme.java
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SecurityScheme.java
index 7e260384c9..c7b4419496 100644
---
a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SecurityScheme.java
+++
b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SecurityScheme.java
@@ -17,7 +17,6 @@
package org.apache.juneau.bean.swagger;
import static org.apache.juneau.common.utils.Utils.*;
-import static org.apache.juneau.internal.ArrayUtils.contains;
import static org.apache.juneau.internal.CollectionBuilders.*;
import static org.apache.juneau.internal.ConverterUtils.*;
@@ -415,7 +414,7 @@ public class SecurityScheme extends SwaggerElement {
* @return This object.
*/
public SecurityScheme setType(String value) {
- if (isStrict() && ! contains(value, VALID_TYPES))
+ if (isStrict() && ! ArrayUtils2.contains(value, VALID_TYPES))
throw new BasicRuntimeException("Invalid value passed
in to setType(String). Value=''{0}'', valid values={1}", value,
Json5.of(VALID_TYPES));
type = value;
return this;
diff --git
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/utils/ArrayUtils2.java
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/utils/ArrayUtils2.java
index 1a56f340ec..a1353aef43 100644
---
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/utils/ArrayUtils2.java
+++
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/utils/ArrayUtils2.java
@@ -16,6 +16,11 @@
*/
package org.apache.juneau.common.utils;
+import static org.apache.juneau.common.utils.Utils.*;
+
+import java.lang.reflect.*;
+import java.util.*;
+
public class ArrayUtils2 {
/**
@@ -31,4 +36,289 @@ public class ArrayUtils2 {
return l[l.length - 1];
}
+ /**
+ * Appends one or more elements to an array.
+ *
+ * @param <T> The element type.
+ * @param array The array to append to.
+ * @param newElements The new elements to append to the array.
+ * @return A new array with the specified elements appended.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T[] append(T[] array, T...newElements) {
+ if (array == null)
+ return newElements;
+ if (newElements.length == 0)
+ return array;
+ T[] a =
(T[])Array.newInstance(array.getClass().getComponentType(), array.length +
newElements.length);
+ for (int i = 0; i < array.length; i++)
+ a[i] = array[i];
+ for (int i = 0; i < newElements.length; i++)
+ a[i + array.length] = newElements[i];
+ return a;
+ }
+
+ /**
+ * Converts the specified array to a <c>Set</c>.
+ *
+ * <p>
+ * The order of the entries in the set are the same as the array.
+ *
+ * @param <T> The entry type of the array.
+ * @param array The array being wrapped in a <c>Set</c> interface.
+ * @return The new set.
+ */
+ public static <T> Set<T> asSet(final T[] array) {
+ Utils.assertArgNotNull("array", array);
+ return new AbstractSet<>() {
+
+ @Override /* Overridden from Set */
+ public Iterator<T> iterator() {
+ return new Iterator<>() {
+ int i = 0;
+
+ @Override /* Overridden from Iterator */
+ public boolean hasNext() {
+ return i < array.length;
+ }
+
+ @Override /* Overridden from Iterator */
+ public T next() {
+ if (i >= array.length)
+ throw new
NoSuchElementException();
+ T t = array[i];
+ i++;
+ return t;
+ }
+
+ @Override /* Overridden from Iterator */
+ public void remove() {
+ throw new
UnsupportedOperationException("Not supported.");
+ }
+ };
+ }
+
+ @Override /* Overridden from Set */
+ public int size() {
+ return array.length;
+ }
+ };
+ }
+
+ /**
+ * Combine an arbitrary number of arrays into a single array.
+ *
+ * @param <E> The element type.
+ * @param arrays Collection of arrays to combine.
+ * @return A new combined array, or <jk>null</jk> if all arrays are
<jk>null</jk>.
+ */
+ @SuppressWarnings("unchecked")
+ public static <E> E[] combine(E[]...arrays) {
+ Utils.assertArgNotNull("arrays", arrays);
+ int l = 0;
+ E[] a1 = null;
+ for (E[] a : arrays) {
+ if (a1 == null && a != null)
+ a1 = a;
+ l += (a == null ? 0 : a.length);
+ }
+ if (a1 == null)
+ return null;
+ E[] a =
(E[])Array.newInstance(a1.getClass().getComponentType(), l);
+ int i = 0;
+ for (E[] aa : arrays)
+ if (aa != null)
+ for (E t : aa)
+ a[i++] = t;
+ return a;
+ }
+
+ /**
+ * Returns the index position of the element in the specified array
using the {@link String#equals(Object)} method.
+ *
+ * @param element The element to check for.
+ * @param array The array to check.
+ * @return
+ * The index position of the element in the specified array, or
+ * <c>-1</c> if the array doesn't contain the element, or the
array or element is <jk>null</jk>.
+ */
+ public static int indexOf(String element, String[] array) {
+ if (element == null || array == null)
+ return -1;
+ for (int i = 0; i < array.length; i++)
+ if (element.equals(array[i]))
+ return i;
+ return -1;
+ }
+
+ /**
+ * Returns <jk>true</jk> if the specified array is null or has a length
of zero.
+ *
+ * @param array The array to check.
+ * @return <jk>true</jk> if the specified array is null or has a length
of zero.
+ */
+ public static boolean isEmptyArray(Object[] array) {
+ return array == null || array.length == 0;
+ }
+
+ /**
+ * Returns <jk>true</jk> if the specified array is not null and has a
length greater than zero.
+ *
+ * @param array The array to check.
+ * @return <jk>true</jk> if the specified array is not null and has a
length greater than zero.
+ */
+ public static boolean isNotEmptyArray(Object[] array) {
+ return array != null && array.length > 0;
+ }
+
+ /**
+ * Returns <jk>true</jk> if the following sorted arrays are equals.
+ *
+ * @param a1 Array #1.
+ * @param a2 Array #2.
+ * @return <jk>true</jk> if the following sorted arrays are equals.
+ */
+ public static boolean equals(String[] a1, String[] a2) {
+ if (a1.length != a2.length)
+ return false;
+ for (int i = 0; i < a1.length; i++)
+ if (! Utils.eq(a1[i], a2[i]))
+ return false;
+ return true;
+ }
+
+ /**
+ * Reverses the entries in an array.
+ *
+ * @param <E> The element type.
+ * @param array The array to reverse.
+ * @return The same array.
+ */
+ public static <E> E[] reverse(E[] array) {
+ for (int i = 0; i < array.length / 2; i++) {
+ E temp = array[i];
+ array[i] = array[array.length - i - 1];
+ array[array.length - i - 1] = temp;
+ }
+ return array;
+ }
+
+ /**
+ * Converts the specified collection to an array.
+ *
+ * <p>
+ * Works on both object and primitive arrays.
+ *
+ * @param <E> The element type.
+ * @param c The collection to convert to an array.
+ * @param elementType The component type of the collection.
+ * @return A new array.
+ */
+ public static <E> Object toArray(Collection<?> c, Class<E> elementType)
{
+ Object a = Array.newInstance(elementType, c.size());
+ Iterator<?> it = c.iterator();
+ int i = 0;
+ while (it.hasNext())
+ Array.set(a, i++, it.next());
+ return a;
+ }
+
+ /**
+ * Converts the specified array to an <c>ArrayList</c>
+ *
+ * @param <E> The element type.
+ * @param array The array to convert.
+ * @param elementType
+ * The type of objects in the array.
+ * It must match the actual component type in the array.
+ * @return A new {@link ArrayList}
+ */
+ @SuppressWarnings("unchecked")
+ public static <E> List<E> toList(Object array, Class<E> elementType) {
+ List<E> l = new ArrayList<>(Array.getLength(array));
+ for (int i = 0; i < Array.getLength(array); i++)
+ l.add((E)Array.get(array, i));
+ return l;
+ }
+
+ /**
+ * Copies the specified array into the specified list.
+ *
+ * <p>
+ * Works on both object and primitive arrays.
+ *
+ * @param array The array to copy into a list.
+ * @param list The list to copy the values into.
+ * @return The same list passed in.
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public static List copyToList(Object array, List list) {
+ if (array != null) {
+ int length = Array.getLength(array);
+ for (int i = 0; i < length; i++)
+ list.add(Array.get(array, i));
+ }
+ return list;
+ }
+
+ /**
+ * Recursively converts the specified array into a list of objects.
+ *
+ * @param array The array to convert.
+ * @return A new {@link ArrayList}
+ */
+ public static List<Object> toObjectList(Object array) {
+ List<Object> l = new ArrayList<>(Array.getLength(array));
+ for (int i = 0; i < Array.getLength(array); i++) {
+ Object o = Array.get(array, i);
+ if (isArray(o))
+ o = toObjectList(o);
+ l.add(o);
+ }
+ return l;
+ }
+
+ /**
+ * Converts the specified collection to an array of strings.
+ *
+ * <p>
+ * Entries are converted to strings using {@link #toString()}.
+ * <jk>null</jk> values remain <jk>null</jk>.
+ *
+ * @param c The collection to convert.
+ * @return The collection as a string array.
+ */
+ public static String[] toStringArray(Collection<?> c) {
+ String[] r = new String[c.size()];
+ int i = 0;
+ for (Object o : c)
+ r[i++] = Utils.s(o);
+ return r;
+ }
+
+ /**
+ * Makes a copy of the specified array.
+ *
+ * @param array The array to copy.
+ * @param <T> The element type.
+ * @return A new copy of the array, or <jk>null</jk> if the array was
<jk>null</jk>.s
+ */
+ public static <T> T[] copyOf(T[] array) {
+ return array == null ? null : Arrays.copyOf(array,
array.length);
+ }
+
+ /**
+ * Returns <jk>true</jk> if the specified array contains the specified
element using the {@link String#equals(Object)}
+ * method.
+ *
+ * @param element The element to check for.
+ * @param array The array to check.
+ * @return
+ * <jk>true</jk> if the specified array contains the specified
element,
+ * <jk>false</jk> if the array or element is <jk>null</jk>.
+ */
+ public static boolean contains(String element, String[] array) {
+ return indexOf(element, array) != -1;
+ }
+
}
diff --git
a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/annotation/RdfAnnotation.java
b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/annotation/RdfAnnotation.java
index 0ec7832bd5..5dd34f6261 100644
---
a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/annotation/RdfAnnotation.java
+++
b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/annotation/RdfAnnotation.java
@@ -25,6 +25,7 @@ import java.lang.reflect.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.jena.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -175,7 +176,7 @@ public class RdfAnnotation {
@Override
public void apply(AnnotationInfo<Rdf> ai, RdfParser.Builder b) {
Rdf a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
@@ -198,7 +199,7 @@ public class RdfAnnotation {
@Override
public void apply(AnnotationInfo<Rdf> ai, RdfSerializer.Builder
b) {
Rdf a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanFilter.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanFilter.java
index f387cb19ba..f42a29c598 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanFilter.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanFilter.java
@@ -100,7 +100,7 @@ public class BeanFilter {
interceptor(x.interceptor());
if (isNotVoid(x.implClass()))
implClass(x.implClass());
- if (isNotEmptyArray(x.dictionary()))
+ if (ArrayUtils2.isNotEmptyArray(x.dictionary()))
dictionary(x.dictionary());
if (isNotEmpty(x.example()))
example(x.example());
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
index e7f96c3448..aa675367d7 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
@@ -492,7 +492,7 @@ public class BeanPropertyMeta implements
Comparable<BeanPropertyMeta> {
// Copy any existing array values into
the temporary list.
Object oldArray = invokeGetter(bean,
pName);
- copyToList(oldArray, l);
+ ArrayUtils2.copyToList(oldArray, l);
}
// Add new entry to our array.
@@ -1289,7 +1289,7 @@ public class BeanPropertyMeta implements
Comparable<BeanPropertyMeta> {
* @throws InvocationTargetException Thrown by method invocation.
*/
protected void setArray(Object bean, List l) throws
IllegalArgumentException, IllegalAccessException, InvocationTargetException {
- Object array = toArray(l,
this.rawTypeMeta.getElementType().getInnerClass());
+ Object array = ArrayUtils2.toArray(l,
this.rawTypeMeta.getElementType().getInnerClass());
invokeSetter(bean, name, array);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
index 8489f184db..28d83408f2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
@@ -188,7 +188,7 @@ public class ClassMeta<T> implements Type {
&& x.isNotDeprecated()
&& x.hasReturnType(c)
&& x.hasParamTypes(String.class)
- && ArrayUtils.contains(x.getName(),
fromStringMethodNames))
+ && ArrayUtils2.contains(x.getName(),
fromStringMethodNames))
).map(MethodInfo::inner)
.orElse(null);
// @formatter:on
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MediaType.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MediaType.java
index a6d5282407..d27dc5e588 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MediaType.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MediaType.java
@@ -180,7 +180,7 @@ public class MediaType implements Comparable<MediaType> {
subTypes = StringUtils.splita(subType, '+');
subTypesSorted = Arrays.copyOf(subTypes, subTypes.length);
Arrays.sort(this.subTypesSorted);
- hasSubtypeMeta = ArrayUtils.contains("*", this.subTypes);
+ hasSubtypeMeta = ArrayUtils2.contains("*", this.subTypes);
StringBuilder sb = new StringBuilder();
sb.append(mediaType);
@@ -409,13 +409,13 @@ public class MediaType implements Comparable<MediaType> {
return 0;
// Subtypes match but are ordered different
- if (ArrayUtils.equals(subTypesSorted, o.subTypesSorted))
+ if (ArrayUtils2.equals(subTypesSorted, o.subTypesSorted))
return c + 7500;
for (String st1 : subTypes) {
if ("*".equals(st1))
c += 0;
- else if (ArrayUtils.contains(st1, o.subTypes))
+ else if (ArrayUtils2.contains(st1, o.subTypes))
c += 100;
else if (o.hasSubtypeMeta)
c += 0;
@@ -425,7 +425,7 @@ public class MediaType implements Comparable<MediaType> {
for (String st2 : o.subTypes) {
if ("*".equals(st2))
c += 0;
- else if (ArrayUtils.contains(st2, subTypes))
+ else if (ArrayUtils2.contains(st2, subTypes))
c += 100;
else if (hasSubtypeMeta)
c += 0;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/StringRanges.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/StringRanges.java
index 825f00bf0e..e99bd88068 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/StringRanges.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/StringRanges.java
@@ -146,7 +146,7 @@ public class StringRanges {
*/
public StringRanges(StringRange...value) {
this.string = StringUtils.join(value, ", ");
- this.value = copyOf(value);
+ this.value = ArrayUtils2.copyOf(value);
}
/**
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/AnnotationImpl.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/AnnotationImpl.java
index a0e7b3f4c8..2d1051e3fc 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/AnnotationImpl.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/AnnotationImpl.java
@@ -18,7 +18,6 @@ package org.apache.juneau.annotation;
import static java.util.Arrays.*;
import static org.apache.juneau.collections.JsonMap.*;
-import static org.apache.juneau.internal.ArrayUtils.copyOf;
import java.lang.annotation.*;
import java.lang.reflect.*;
@@ -55,7 +54,7 @@ public class AnnotationImpl implements Annotation {
*/
public AnnotationImpl(AnnotationBuilder<?> b) {
this.annotationType = b.annotationType;
- this.description = copyOf(b.description);
+ this.description = ArrayUtils2.copyOf(b.description);
}
/**
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanAnnotation.java
index a6b9298bcf..dfdf2e8d1c 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
import org.apache.juneau.swap.*;
@@ -51,7 +52,7 @@ public class BeanAnnotation {
@Override
public void apply(AnnotationInfo<Bean> ai, BeanContext.Builder
b) {
Bean a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
@@ -328,7 +329,7 @@ public class BeanAnnotation {
Impl(Builder b) {
super(b);
- this.dictionary = copyOf(b.dictionary);
+ this.dictionary = ArrayUtils2.copyOf(b.dictionary);
this.example = b.example;
this.excludeProperties = b.excludeProperties;
this.findFluentSetters = b.findFluentSetters;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreAnnotation.java
index 0166e88bb7..b4bb0b0093 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class BeanIgnoreAnnotation {
@Override
public void apply(AnnotationInfo<BeanIgnore> ai,
BeanContext.Builder b) {
BeanIgnore a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeancAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeancAnnotation.java
index 9f308b06c5..b37a32ce4f 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeancAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeancAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class BeancAnnotation {
@Override
public void apply(AnnotationInfo<Beanc> ai, BeanContext.Builder
b) {
Beanc a = ai.inner();
- if (isEmptyArray(a.on()))
+ if (ArrayUtils2.isEmptyArray(a.on()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanpAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanpAnnotation.java
index 2539637866..042a5a6e90 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanpAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanpAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class BeanpAnnotation {
@Override
public void apply(AnnotationInfo<Beanp> ai, BeanContext.Builder
b) {
Beanp a = ai.inner();
- if (isEmptyArray(a.on()))
+ if (ArrayUtils2.isEmptyArray(a.on()))
return;
b.annotations(copy(a, vr()));
}
@@ -211,10 +212,10 @@ public class BeanpAnnotation {
Impl(Builder b) {
super(b);
- this.dictionary = copyOf(b.dictionary);
+ this.dictionary = ArrayUtils2.copyOf(b.dictionary);
this.format = b.format;
this.name = b.name;
- this.params = copyOf(b.params);
+ this.params = ArrayUtils2.copyOf(b.params);
this.properties = b.properties;
this.ro = b.ro;
this.type = b.type;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ExampleAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ExampleAnnotation.java
index c836afce69..93a1fb6139 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ExampleAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ExampleAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class ExampleAnnotation {
@Override
public void apply(AnnotationInfo<Example> ai,
BeanContext.Builder b) {
Example a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ItemsAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ItemsAnnotation.java
index f516f1875a..73a1646f17 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ItemsAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ItemsAnnotation.java
@@ -20,6 +20,8 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
+import org.apache.juneau.common.utils.*;
+
/**
* Utility classes and methods for the {@link Items @Items} annotation.
*
@@ -445,12 +447,12 @@ public class ItemsAnnotation {
Impl(Builder b) {
super(b);
this.$ref = b.$ref;
- this._default = copyOf(b._default);
- this._enum = copyOf(b._enum);
+ this._default = ArrayUtils2.copyOf(b._default);
+ this._enum = ArrayUtils2.copyOf(b._enum);
this.cf = b.cf;
this.collectionFormat = b.collectionFormat;
- this.df = copyOf(b.df);
- this.e = copyOf(b.e);
+ this.df = ArrayUtils2.copyOf(b.df);
+ this.e = ArrayUtils2.copyOf(b.e);
this.emax = b.emax;
this.emin = b.emin;
this.exclusiveMaximum = b.exclusiveMaximum;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
index edf7f13a82..ed2b733dc4 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class MarshalledAnnotation {
@Override
public void apply(AnnotationInfo<Marshalled> ai,
BeanContext.Builder b) {
Marshalled a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/NamePropertyAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/NamePropertyAnnotation.java
index 31b9e7747a..d2c70b495d 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/NamePropertyAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/NamePropertyAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class NamePropertyAnnotation {
@Override
public void apply(AnnotationInfo<NameProperty> ai,
BeanContext.Builder b) {
NameProperty a = ai.inner();
- if (isEmptyArray(a.on()))
+ if (ArrayUtils2.isEmptyArray(a.on()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ParentPropertyAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ParentPropertyAnnotation.java
index d030867acc..9ea04d9db8 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ParentPropertyAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/ParentPropertyAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class ParentPropertyAnnotation {
@Override
public void apply(AnnotationInfo<ParentProperty> ai,
BeanContext.Builder b) {
ParentProperty a = ai.inner();
- if (isEmptyArray(a.on()))
+ if (ArrayUtils2.isEmptyArray(a.on()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SchemaAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SchemaAnnotation.java
index 0570c71c4f..8b3a05dbb9 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SchemaAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SchemaAnnotation.java
@@ -56,7 +56,7 @@ public class SchemaAnnotation {
@Override
public void apply(AnnotationInfo<Schema> ai, Context.Builder b)
{
Schema a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
@@ -942,18 +942,18 @@ public class SchemaAnnotation {
Impl(Builder b) {
super(b);
this.$ref = b.$ref;
- this._default = copyOf(b._default);
- this._enum = copyOf(b._enum);
- this.additionalProperties =
copyOf(b.additionalProperties);
- this.allOf = copyOf(b.allOf);
+ this._default = ArrayUtils2.copyOf(b._default);
+ this._enum = ArrayUtils2.copyOf(b._enum);
+ this.additionalProperties =
ArrayUtils2.copyOf(b.additionalProperties);
+ this.allOf = ArrayUtils2.copyOf(b.allOf);
this.aev = b.aev;
this.allowEmptyValue = b.allowEmptyValue;
this.cf = b.cf;
this.collectionFormat = b.collectionFormat;
- this.d = copyOf(b.d);
- this.df = copyOf(b.df);
+ this.d = ArrayUtils2.copyOf(b.d);
+ this.df = ArrayUtils2.copyOf(b.df);
this.discriminator = b.discriminator;
- this.e = copyOf(b.e);
+ this.e = ArrayUtils2.copyOf(b.e);
this.emax = b.emax;
this.emin = b.emin;
this.exclusiveMaximum = b.exclusiveMaximum;
@@ -983,7 +983,7 @@ public class SchemaAnnotation {
this.multipleOf = b.multipleOf;
this.p = b.p;
this.pattern = b.pattern;
- this.properties = copyOf(b.properties);
+ this.properties = ArrayUtils2.copyOf(b.properties);
this.r = b.r;
this.readOnly = b.readOnly;
this.required = b.required;
@@ -995,7 +995,7 @@ public class SchemaAnnotation {
this.type = b.type;
this.ui = b.ui;
this.uniqueItems = b.uniqueItems;
- this.xml = copyOf(b.xml);
+ this.xml = ArrayUtils2.copyOf(b.xml);
// JSON Schema Draft 2020-12 fields
this.deprecatedProperty = b.deprecatedProperty;
this.$id = b.$id;
@@ -1003,18 +1003,18 @@ public class SchemaAnnotation {
this.contentEncoding = b.contentEncoding;
this.exclusiveMaximumValue = b.exclusiveMaximumValue;
this.exclusiveMinimumValue = b.exclusiveMinimumValue;
- this._const = copyOf(b._const);
- this.examples = copyOf(b.examples);
- this.$comment = copyOf(b.$comment);
- this.prefixItems = copyOf(b.prefixItems);
- this.unevaluatedItems = copyOf(b.unevaluatedItems);
- this.unevaluatedProperties =
copyOf(b.unevaluatedProperties);
- this.dependentSchemas = copyOf(b.dependentSchemas);
- this.dependentRequired = copyOf(b.dependentRequired);
- this._if = copyOf(b._if);
- this._then = copyOf(b._then);
- this._else = copyOf(b._else);
- this.$defs = copyOf(b.$defs);
+ this._const = ArrayUtils2.copyOf(b._const);
+ this.examples = ArrayUtils2.copyOf(b.examples);
+ this.$comment = ArrayUtils2.copyOf(b.$comment);
+ this.prefixItems = ArrayUtils2.copyOf(b.prefixItems);
+ this.unevaluatedItems =
ArrayUtils2.copyOf(b.unevaluatedItems);
+ this.unevaluatedProperties =
ArrayUtils2.copyOf(b.unevaluatedProperties);
+ this.dependentSchemas =
ArrayUtils2.copyOf(b.dependentSchemas);
+ this.dependentRequired =
ArrayUtils2.copyOf(b.dependentRequired);
+ this._if = ArrayUtils2.copyOf(b._if);
+ this._then = ArrayUtils2.copyOf(b._then);
+ this._else = ArrayUtils2.copyOf(b._else);
+ this.$defs = ArrayUtils2.copyOf(b.$defs);
postConstruct();
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SubItemsAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SubItemsAnnotation.java
index 198ae3c7e3..9ee2553b8d 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SubItemsAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SubItemsAnnotation.java
@@ -450,19 +450,19 @@ public class SubItemsAnnotation {
Impl(Builder b) {
super(b);
this.$ref = b.$ref;
- this._default = copyOf(b._default);
- this._enum = copyOf(b._enum);
+ this._default = ArrayUtils2.copyOf(b._default);
+ this._enum = ArrayUtils2.copyOf(b._enum);
this.cf = b.cf;
this.collectionFormat = b.collectionFormat;
- this.df = copyOf(b.df);
- this.e = copyOf(b.e);
+ this.df = ArrayUtils2.copyOf(b.df);
+ this.e = ArrayUtils2.copyOf(b.e);
this.emax = b.emax;
this.emin = b.emin;
this.exclusiveMaximum = b.exclusiveMaximum;
this.exclusiveMinimum = b.exclusiveMinimum;
this.f = b.f;
this.format = b.format;
- this.items = copyOf(b.items);
+ this.items = ArrayUtils2.copyOf(b.items);
this.max = b.max;
this.maxi = b.maxi;
this.maximum = b.maximum;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SwapAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SwapAnnotation.java
index 1386406fec..bc761c32a7 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SwapAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/SwapAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class SwapAnnotation {
@Override
public void apply(AnnotationInfo<Swap> ai, BeanContext.Builder
b) {
Swap a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
@@ -157,7 +158,7 @@ public class SwapAnnotation {
Impl(Builder b) {
super(b);
this.impl = b.impl;
- this.mediaTypes = copyOf(b.mediaTypes);
+ this.mediaTypes = ArrayUtils2.copyOf(b.mediaTypes);
this.template = b.template;
this.value = b.value;
postConstruct();
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationBuilder.java
index a2ef5fe6df..3c59800773 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationBuilder.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationBuilder.java
@@ -18,6 +18,7 @@ package org.apache.juneau.annotation;
import java.lang.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.internal.*;
/**
@@ -49,7 +50,7 @@ public class TargetedAnnotationBuilder<B extends
TargetedAnnotationBuilder<B>> e
*/
public B on(String...values) {
for (String v : values)
- on = ArrayUtils.append(on, v);
+ on = ArrayUtils2.append(on, v);
return asThis();
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationImpl.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationImpl.java
index e2009fa05d..c9c13a7cdc 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationImpl.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationImpl.java
@@ -18,6 +18,8 @@ package org.apache.juneau.annotation;
import static org.apache.juneau.internal.ArrayUtils.*;
+import org.apache.juneau.common.utils.*;
+
/**
* An implementation of an annotation that has an <code>on</code> value
targeting classes/methods/fields/constructors.
*
@@ -35,7 +37,7 @@ public class TargetedAnnotationImpl extends AnnotationImpl {
*/
public TargetedAnnotationImpl(TargetedAnnotationBuilder<?> b) {
super(b);
- this.on = copyOf(b.on);
+ this.on = ArrayUtils2.copyOf(b.on);
}
/**
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTBuilder.java
index 36f33a3af0..d80d62903b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTBuilder.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTBuilder.java
@@ -18,6 +18,7 @@ package org.apache.juneau.annotation;
import java.lang.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.internal.*;
/**
@@ -49,7 +50,7 @@ public class TargetedAnnotationTBuilder<B extends
TargetedAnnotationTBuilder<B>>
*/
public B on(Class<?>...value) {
for (Class<?> v : value)
- on = ArrayUtils.append(on, v.getName());
+ on = ArrayUtils2.append(on, v.getName());
return asThis();
}
@@ -62,7 +63,7 @@ public class TargetedAnnotationTBuilder<B extends
TargetedAnnotationTBuilder<B>>
@SuppressWarnings("unchecked")
public B onClass(Class<?>...value) {
for (Class<?> v : value)
- onClass = ArrayUtils.append(onClass, v);
+ onClass = ArrayUtils2.append(onClass, v);
return asThis();
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTImpl.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTImpl.java
index e408eede66..02744a9b00 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTImpl.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/TargetedAnnotationTImpl.java
@@ -18,6 +18,8 @@ package org.apache.juneau.annotation;
import static org.apache.juneau.internal.ArrayUtils.*;
+import org.apache.juneau.common.utils.*;
+
/**
* An implementation of an annotation that has an <code>on</code> value
targeting classes/methods/fields/constructors.
*
@@ -35,7 +37,7 @@ public class TargetedAnnotationTImpl extends
TargetedAnnotationImpl {
*/
public TargetedAnnotationTImpl(TargetedAnnotationTBuilder<?> b) {
super(b);
- this.onClass = copyOf(b.onClass);
+ this.onClass = ArrayUtils2.copyOf(b.onClass);
}
/**
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/UriAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/UriAnnotation.java
index 720ed8397d..9b5105a9fe 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/UriAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/UriAnnotation.java
@@ -23,6 +23,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -50,7 +51,7 @@ public class UriAnnotation {
@Override
public void apply(AnnotationInfo<Uri> ai, BeanContext.Builder
b) {
Uri a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/collections/JsonMap.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/collections/JsonMap.java
index 490cb600ef..274f7acf9b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/collections/JsonMap.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/collections/JsonMap.java
@@ -1343,11 +1343,11 @@ public class JsonMap extends
LinkedHashMap<String,Object> {
return def;
String[] r = null;
if (s instanceof Collection)
- r = ArrayUtils.toStringArray((Collection<?>)s);
+ r = ArrayUtils2.toStringArray((Collection<?>)s);
else if (s instanceof String[])
r = (String[])s;
else if (s instanceof Object[])
- r = ArrayUtils.toStringArray(alist((Object[])s));
+ r = ArrayUtils2.toStringArray(alist((Object[])s));
else
r = StringUtils.splita(Utils.s(s));
return (r.length == 0 ? def : r);
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/annotation/CsvAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/annotation/CsvAnnotation.java
index 51e64046fe..b2ed12e3e5 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/annotation/CsvAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/annotation/CsvAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -51,7 +52,7 @@ public class CsvAnnotation {
@Override
public void apply(AnnotationInfo<Csv> ai, Context.Builder b) {
Csv a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
index 0c9565d5a6..4db7ad54e1 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
@@ -299,7 +299,7 @@ public class BasicHtmlDocTemplate implements
HtmlDocTemplate {
*/
protected void nav(HtmlDocSerializerSession session, HtmlWriter w,
Object o) throws Exception {
String[] links = session.getNavLinks();
- if (links.length > 0 && ! ArrayUtils.contains("NONE", links)) {
+ if (links.length > 0 && ! ArrayUtils2.contains("NONE", links)) {
w.sTag(3, "ol").nl(3);
for (String l : links) {
w.sTag(4, "li");
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlAnnotation.java
index 26850d3209..fa5d893234 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.html.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -54,7 +55,7 @@ public class HtmlAnnotation {
@Override
public void apply(AnnotationInfo<Html> ai, Context.Builder b) {
Html a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlLinkAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlLinkAnnotation.java
index 82a8a36e0d..79898f2b08 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlLinkAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/annotation/HtmlLinkAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class HtmlLinkAnnotation {
@Override
public void apply(AnnotationInfo<HtmlLink> ai, Context.Builder
b) {
HtmlLink a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContentAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContentAnnotation.java
index 317bc5ed45..92650ad672 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContentAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContentAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -51,7 +52,7 @@ public class ContentAnnotation {
@Override
public void apply(AnnotationInfo<Content> ai,
BeanContext.Builder b) {
Content a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
index 4cb2bdf67c..6d492c4a62 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
@@ -25,6 +25,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -53,7 +54,7 @@ public class FormDataAnnotation {
@Override
public void apply(AnnotationInfo<FormData> ai,
BeanContext.Builder b) {
FormData a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
index fc92a6ae2b..826ae2475c 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
@@ -25,6 +25,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -53,7 +54,7 @@ public class HeaderAnnotation {
@Override
public void apply(AnnotationInfo<Header> ai,
BeanContext.Builder b) {
Header a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
index 491fab440e..0601a74a23 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
@@ -25,6 +25,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -53,7 +54,7 @@ public class PathAnnotation {
@Override
public void apply(AnnotationInfo<Path> ai, BeanContext.Builder
b) {
Path a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathRemainderAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathRemainderAnnotation.java
index 4ae37e5e0d..d0a5f2a29a 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathRemainderAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathRemainderAnnotation.java
@@ -25,6 +25,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -57,7 +58,7 @@ public class PathRemainderAnnotation {
@Override
public void apply(AnnotationInfo<PathRemainder> ai,
BeanContext.Builder b) {
PathRemainder a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
@@ -179,7 +180,7 @@ public class PathRemainderAnnotation {
Impl(Builder b) {
super(b);
this.def = b.def;
- this.description = copyOf(b.description);
+ this.description = ArrayUtils2.copyOf(b.description);
this.parser = b.parser;
this.schema = b.schema;
this.serializer = b.serializer;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
index 58e38fb1cc..2088c46dbe 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
@@ -25,6 +25,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -53,7 +54,7 @@ public class QueryAnnotation {
@Override
public void apply(AnnotationInfo<Query> ai, BeanContext.Builder
b) {
Query a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
index 905f05afb3..2b3c14cd14 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class RequestAnnotation {
@Override
public void apply(AnnotationInfo<Request> ai,
BeanContext.Builder b) {
Request a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java
index b50140c8cc..20e570d3ca 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class ResponseAnnotation {
@Override
public void apply(AnnotationInfo<Response> ai,
BeanContext.Builder b) {
Response a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
@@ -173,8 +174,8 @@ public class ResponseAnnotation {
Impl(Builder b) {
super(b);
- this.examples = copyOf(b.examples);
- this.headers = copyOf(b.headers);
+ this.examples = ArrayUtils2.copyOf(b.examples);
+ this.headers = ArrayUtils2.copyOf(b.headers);
this.parser = b.parser;
this.schema = b.schema;
this.serializer = b.serializer;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/StatusCodeAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/StatusCodeAnnotation.java
index eb7990bfec..16441e1a6b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/StatusCodeAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/StatusCodeAnnotation.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class StatusCodeAnnotation {
@Override
public void apply(AnnotationInfo<StatusCode> ai,
BeanContext.Builder b) {
StatusCode a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(a);
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/ArrayUtils.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/ArrayUtils.java
index 52fcf18187..97802efa5e 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/ArrayUtils.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/ArrayUtils.java
@@ -31,300 +31,4 @@ import org.apache.juneau.common.utils.*;
* </ul>
*/
public class ArrayUtils {
-
- /**
- * Appends one or more elements to an array.
- *
- * @param <T> The element type.
- * @param array The array to append to.
- * @param newElements The new elements to append to the array.
- * @return A new array with the specified elements appended.
- */
- @SuppressWarnings("unchecked")
- public static <T> T[] append(T[] array, T...newElements) {
- if (array == null)
- return newElements;
- if (newElements.length == 0)
- return array;
- T[] a =
(T[])Array.newInstance(array.getClass().getComponentType(), array.length +
newElements.length);
- for (int i = 0; i < array.length; i++)
- a[i] = array[i];
- for (int i = 0; i < newElements.length; i++)
- a[i + array.length] = newElements[i];
- return a;
- }
-
- /**
- * Converts the specified array to a <c>Set</c>.
- *
- * <p>
- * The order of the entries in the set are the same as the array.
- *
- * @param <T> The entry type of the array.
- * @param array The array being wrapped in a <c>Set</c> interface.
- * @return The new set.
- */
- public static <T> Set<T> asSet(final T[] array) {
- Utils.assertArgNotNull("array", array);
- return new AbstractSet<>() {
-
- @Override /* Overridden from Set */
- public Iterator<T> iterator() {
- return new Iterator<>() {
- int i = 0;
-
- @Override /* Overridden from Iterator */
- public boolean hasNext() {
- return i < array.length;
- }
-
- @Override /* Overridden from Iterator */
- public T next() {
- if (i >= array.length)
- throw new
NoSuchElementException();
- T t = array[i];
- i++;
- return t;
- }
-
- @Override /* Overridden from Iterator */
- public void remove() {
- throw new
UnsupportedOperationException("Not supported.");
- }
- };
- }
-
- @Override /* Overridden from Set */
- public int size() {
- return array.length;
- }
- };
- }
-
- /**
- * Combine an arbitrary number of arrays into a single array.
- *
- * @param <E> The element type.
- * @param arrays Collection of arrays to combine.
- * @return A new combined array, or <jk>null</jk> if all arrays are
<jk>null</jk>.
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] combine(E[]...arrays) {
- Utils.assertArgNotNull("arrays", arrays);
- int l = 0;
- E[] a1 = null;
- for (E[] a : arrays) {
- if (a1 == null && a != null)
- a1 = a;
- l += (a == null ? 0 : a.length);
- }
- if (a1 == null)
- return null;
- E[] a =
(E[])Array.newInstance(a1.getClass().getComponentType(), l);
- int i = 0;
- for (E[] aa : arrays)
- if (aa != null)
- for (E t : aa)
- a[i++] = t;
- return a;
- }
-
- /**
- * Returns <jk>true</jk> if the specified array contains the specified
element using the {@link String#equals(Object)}
- * method.
- *
- * @param element The element to check for.
- * @param array The array to check.
- * @return
- * <jk>true</jk> if the specified array contains the specified
element,
- * <jk>false</jk> if the array or element is <jk>null</jk>.
- */
- public static boolean contains(String element, String[] array) {
- return indexOf(element, array) != -1;
- }
-
- /**
- * Makes a copy of the specified array.
- *
- * @param array The array to copy.
- * @param <T> The element type.
- * @return A new copy of the array, or <jk>null</jk> if the array was
<jk>null</jk>.s
- */
- public static <T> T[] copyOf(T[] array) {
- return array == null ? null : Arrays.copyOf(array,
array.length);
- }
-
- /**
- * Copies the specified array into the specified list.
- *
- * <p>
- * Works on both object and primitive arrays.
- *
- * @param array The array to copy into a list.
- * @param list The list to copy the values into.
- * @return The same list passed in.
- */
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public static List copyToList(Object array, List list) {
- if (array != null) {
- int length = Array.getLength(array);
- for (int i = 0; i < length; i++)
- list.add(Array.get(array, i));
- }
- return list;
- }
-
- /**
- * Returns <jk>true</jk> if the following sorted arrays are equals.
- *
- * @param a1 Array #1.
- * @param a2 Array #2.
- * @return <jk>true</jk> if the following sorted arrays are equals.
- */
- public static boolean equals(String[] a1, String[] a2) {
- if (a1.length != a2.length)
- return false;
- for (int i = 0; i < a1.length; i++)
- if (! Utils.eq(a1[i], a2[i]))
- return false;
- return true;
- }
-
- /**
- * Returns the index position of the element in the specified array
using the {@link String#equals(Object)} method.
- *
- * @param element The element to check for.
- * @param array The array to check.
- * @return
- * The index position of the element in the specified array, or
- * <c>-1</c> if the array doesn't contain the element, or the
array or element is <jk>null</jk>.
- */
- public static int indexOf(String element, String[] array) {
- if (element == null || array == null)
- return -1;
- for (int i = 0; i < array.length; i++)
- if (element.equals(array[i]))
- return i;
- return -1;
- }
-
- /**
- * Returns <jk>true</jk> if the specified array is null or has a length
of zero.
- *
- * @param array The array to check.
- * @return <jk>true</jk> if the specified array is null or has a length
of zero.
- */
- public static boolean isEmptyArray(Object[] array) {
- return array == null || array.length == 0;
- }
-
- /**
- * Returns <jk>true</jk> if both specified arrays are null or have a
length of zero.
- *
- * @param array1 The array to check.
- * @param array2 The array to check.
- * @return <jk>true</jk> if the specified array is null or has a length
of zero.
- */
- public static boolean isEmptyArray(Object[] array1, Object[] array2) {
- return isEmptyArray(array1) && isEmptyArray(array2);
- }
-
- /**
- * Returns <jk>true</jk> if the specified array is not null and has a
length greater than zero.
- *
- * @param array The array to check.
- * @return <jk>true</jk> if the specified array is not null and has a
length greater than zero.
- */
- public static boolean isNotEmptyArray(Object[] array) {
- return array != null && array.length > 0;
- }
-
- /**
- * Reverses the entries in an array.
- *
- * @param <E> The element type.
- * @param array The array to reverse.
- * @return The same array.
- */
- public static <E> E[] reverse(E[] array) {
- for (int i = 0; i < array.length / 2; i++) {
- E temp = array[i];
- array[i] = array[array.length - i - 1];
- array[array.length - i - 1] = temp;
- }
- return array;
- }
-
- /**
- * Converts the specified collection to an array.
- *
- * <p>
- * Works on both object and primitive arrays.
- *
- * @param <E> The element type.
- * @param c The collection to convert to an array.
- * @param elementType The component type of the collection.
- * @return A new array.
- */
- public static <E> Object toArray(Collection<?> c, Class<E> elementType)
{
- Object a = Array.newInstance(elementType, c.size());
- Iterator<?> it = c.iterator();
- int i = 0;
- while (it.hasNext())
- Array.set(a, i++, it.next());
- return a;
- }
-
- /**
- * Converts the specified array to an <c>ArrayList</c>
- *
- * @param <E> The element type.
- * @param array The array to convert.
- * @param elementType
- * The type of objects in the array.
- * It must match the actual component type in the array.
- * @return A new {@link ArrayList}
- */
- @SuppressWarnings("unchecked")
- public static <E> List<E> toList(Object array, Class<E> elementType) {
- List<E> l = new ArrayList<>(Array.getLength(array));
- for (int i = 0; i < Array.getLength(array); i++)
- l.add((E)Array.get(array, i));
- return l;
- }
-
- /**
- * Recursively converts the specified array into a list of objects.
- *
- * @param array The array to convert.
- * @return A new {@link ArrayList}
- */
- public static List<Object> toObjectList(Object array) {
- List<Object> l = new ArrayList<>(Array.getLength(array));
- for (int i = 0; i < Array.getLength(array); i++) {
- Object o = Array.get(array, i);
- if (isArray(o))
- o = toObjectList(o);
- l.add(o);
- }
- return l;
- }
-
- /**
- * Converts the specified collection to an array of strings.
- *
- * <p>
- * Entries are converted to strings using {@link #toString()}.
- * <jk>null</jk> values remain <jk>null</jk>.
- *
- * @param c The collection to convert.
- * @return The collection as a string array.
- */
- public static String[] toStringArray(Collection<?> c) {
- String[] r = new String[c.size()];
- int i = 0;
- for (Object o : c)
- r[i++] = Utils.s(o);
- return r;
- }
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SimpleMap.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SimpleMap.java
index e91e0022e7..988b414944 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SimpleMap.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SimpleMap.java
@@ -94,7 +94,7 @@ public class SimpleMap<K,V> extends AbstractMap<K,V> {
@Override /* Overridden from Map */
public Set<Map.Entry<K,V>> entrySet() {
- return asSet(entries);
+ return ArrayUtils2.asSet(entries);
}
@Override /* Overridden from Map */
@@ -107,7 +107,7 @@ public class SimpleMap<K,V> extends AbstractMap<K,V> {
@Override /* Overridden from Map */
public Set<K> keySet() {
- return asSet(keys);
+ return ArrayUtils2.asSet(keys);
}
@Override /* Overridden from Map */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/annotation/JsonAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/annotation/JsonAnnotation.java
index b6e7623532..1e1d62a77b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/annotation/JsonAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/annotation/JsonAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class JsonAnnotation {
@Override
public void apply(AnnotationInfo<Json> ai, Context.Builder b) {
Json a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/annotation/MsgPackAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/annotation/MsgPackAnnotation.java
index bee098da63..8445efb93d 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/annotation/MsgPackAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/annotation/MsgPackAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class MsgPackAnnotation {
@Override
public void apply(AnnotationInfo<MsgPack> ai, Context.Builder
b) {
MsgPack a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/annotation/OpenApiAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/annotation/OpenApiAnnotation.java
index 64a1561505..4fe1787e83 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/annotation/OpenApiAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/annotation/OpenApiAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class OpenApiAnnotation {
@Override
public void apply(AnnotationInfo<OpenApi> ai, Context.Builder
b) {
OpenApi a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/annotation/PlainTextAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/annotation/PlainTextAnnotation.java
index 3b50f6f756..de0bfd262c 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/annotation/PlainTextAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/annotation/PlainTextAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -51,7 +52,7 @@ public class PlainTextAnnotation {
@Override
public void apply(AnnotationInfo<PlainText> ai, Context.Builder
b) {
PlainText a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/annotation/SoapXmlAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/annotation/SoapXmlAnnotation.java
index 110c556b8d..be0f05055c 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/annotation/SoapXmlAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/annotation/SoapXmlAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -51,7 +52,7 @@ public class SoapXmlAnnotation {
@Override
public void apply(AnnotationInfo<SoapXml> ai, Context.Builder
b) {
SoapXml a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/annotation/UonAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/annotation/UonAnnotation.java
index 4fcd07d0ac..2a155c0e27 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/annotation/UonAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/annotation/UonAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class UonAnnotation {
@Override
public void apply(AnnotationInfo<Uon> ai, Context.Builder b) {
Uon a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
index 9785b430cf..b7f63659e8 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserSession.java
@@ -262,7 +262,7 @@ public class UrlEncodingParserSession extends
UonParserSession {
parseIntoMap2(r, m, sType, c2);
c2.addAll(m.values());
if (sType.isArray())
- o = ArrayUtils.toArray(c2,
sType.getElementType().getInnerClass());
+ o = ArrayUtils2.toArray(c2,
sType.getElementType().getInnerClass());
else if (sType.isArgs())
o = c2.toArray(new Object[c2.size()]);
else
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/annotation/UrlEncodingAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/annotation/UrlEncodingAnnotation.java
index b2419001ea..de9ac1ff9b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/annotation/UrlEncodingAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/annotation/UrlEncodingAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class UrlEncodingAnnotation {
@Override
public void apply(AnnotationInfo<UrlEncoding> ai,
Context.Builder b) {
UrlEncoding a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
index 265953bf0d..938071e7fd 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
@@ -313,7 +313,7 @@ public class XmlSerializerSession extends
WriterSerializerSession {
if (defaultNamespace != null &&
(ns.uri.equals(defaultNamespace.uri) || ns.name.equals(defaultNamespace.name)))
defaultNamespace = ns;
else
- namespaces = append(namespaces, ns);
+ namespaces = ArrayUtils2.append(namespaces, ns);
}
private Namespace findDefaultNamespace(Namespace n) {
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/XmlAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/XmlAnnotation.java
index 22dd66d8b5..22d96fd985 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/XmlAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/XmlAnnotation.java
@@ -24,6 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -52,7 +53,7 @@ public class XmlAnnotation {
@Override
public void apply(AnnotationInfo<Xml> ai, Context.Builder b) {
Xml a = ai.inner();
- if (isEmptyArray(a.on(), a.onClass()))
+ if (ArrayUtils2.isEmptyArray(a.on()) &&
ArrayUtils2.isEmptyArray(a.onClass()))
return;
b.annotations(copy(a, vr()));
}
diff --git
a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/BasicCsvHeader.java
b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/BasicCsvHeader.java
index a0b2b42169..bfbc57993d 100644
---
a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/BasicCsvHeader.java
+++
b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/BasicCsvHeader.java
@@ -120,7 +120,7 @@ public class BasicCsvHeader extends BasicHeader {
*/
public BasicCsvHeader(String name, String...value) {
super(name, StringUtils.join(value, ", "));
- this.value = copyOf(value);
+ this.value = ArrayUtils2.copyOf(value);
this.supplier = null;
}
@@ -151,7 +151,7 @@ public class BasicCsvHeader extends BasicHeader {
* @return The header value as an array wrapped in an {@link Optional}.
Never <jk>null</jk>.
*/
public Optional<String[]> asArray() {
- return Utils.opt(copyOf(value()));
+ return Utils.opt(ArrayUtils2.copyOf(value()));
}
/**
@@ -245,7 +245,7 @@ public class BasicCsvHeader extends BasicHeader {
* @return The header value as an array. Can be <jk>null</jk>.
*/
public String[] toArray() {
- return copyOf(value());
+ return ArrayUtils2.copyOf(value());
}
/**
diff --git
a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/EntityTags.java
b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/EntityTags.java
index c5437fe932..494f09fb7d 100644
---
a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/EntityTags.java
+++
b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/EntityTags.java
@@ -65,7 +65,7 @@ public class EntityTags {
*/
public EntityTags(EntityTag...value) {
this.string = StringUtils.join(value, ", ");
- this.value = copyOf(value);
+ this.value = ArrayUtils2.copyOf(value);
}
/**
@@ -87,7 +87,7 @@ public class EntityTags {
* @return The entity tags in this object as an array. Can be
<jk>null</jk>.
*/
public EntityTag[] toArray() {
- return copyOf(value);
+ return ArrayUtils2.copyOf(value);
}
/**
diff --git
a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/part/BasicCsvArrayPart.java
b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/part/BasicCsvArrayPart.java
index ef426e3fae..eb8a0423a1 100644
---
a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/part/BasicCsvArrayPart.java
+++
b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/part/BasicCsvArrayPart.java
@@ -121,7 +121,7 @@ public class BasicCsvArrayPart extends BasicPart {
* @return The part value as an array wrapped in an {@link Optional}.
Never <jk>null</jk>.
*/
public Optional<String[]> asArray() {
- return Utils.opt(copyOf(value()));
+ return Utils.opt(ArrayUtils2.copyOf(value()));
}
/**
@@ -206,7 +206,7 @@ public class BasicCsvArrayPart extends BasicPart {
* @return The part value as an array, or <jk>null</jk> if the value
<jk>null</jk>.
*/
public String[] toArray() {
- return copyOf(value());
+ return ArrayUtils2.copyOf(value());
}
/**
diff --git
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockServletRequest.java
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockServletRequest.java
index 82182ca1e6..fa0c4555f6 100644
---
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockServletRequest.java
+++
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockServletRequest.java
@@ -542,7 +542,7 @@ public class MockServletRequest implements
HttpServletRequest {
if (value != null) {
String[] v1 = (value instanceof String[]) ?
(String[])value : new String[] { value.toString() };
String[] v2 = headerMap.get(name);
- String[] v3 = ArrayUtils.combine(v2, v1);
+ String[] v3 = ArrayUtils2.combine(v2, v1);
headerMap.put(name, v3);
}
return this;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation.java
index 500b189f7e..929bbb86c3 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
/**
* Utility classes and methods for the {@link OpSwagger @OpSwagger} annotation.
@@ -190,17 +191,17 @@ public class OpSwaggerAnnotation {
Impl(Builder b) {
super(b);
- this.consumes = copyOf(b.consumes);
+ this.consumes = ArrayUtils2.copyOf(b.consumes);
this.deprecated = b.deprecated;
this.externalDocs = b.externalDocs;
this.operationId = b.operationId;
- this.parameters = copyOf(b.parameters);
- this.produces = copyOf(b.produces);
- this.responses = copyOf(b.responses);
- this.schemes = copyOf(b.schemes);
- this.summary = copyOf(b.summary);
- this.tags = copyOf(b.tags);
- this.value = copyOf(b.value);
+ this.parameters = ArrayUtils2.copyOf(b.parameters);
+ this.produces = ArrayUtils2.copyOf(b.produces);
+ this.responses = ArrayUtils2.copyOf(b.responses);
+ this.schemes = ArrayUtils2.copyOf(b.schemes);
+ this.summary = ArrayUtils2.copyOf(b.summary);
+ this.tags = ArrayUtils2.copyOf(b.tags);
+ this.value = ArrayUtils2.copyOf(b.value);
postConstruct();
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
index 68e3d8bfd3..5fdf05838f 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.cp.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
@@ -734,50 +735,50 @@ public class RestAnnotation {
this.allowedMethodParams = b.allowedMethodParams;
this.beanStore = b.beanStore;
this.callLogger = b.callLogger;
- this.children = copyOf(b.children);
+ this.children = ArrayUtils2.copyOf(b.children);
this.clientVersionHeader = b.clientVersionHeader;
this.config = b.config;
- this.consumes = copyOf(b.consumes);
- this.converters = copyOf(b.converters);
+ this.consumes = ArrayUtils2.copyOf(b.consumes);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.debugEnablement = b.debugEnablement;
this.debugOn = b.debugOn;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
this.defaultContentType = b.defaultContentType;
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponserHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponserHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
this.maxInput = b.maxInput;
this.messages = b.messages;
- this.parsers = copyOf(b.parsers);
+ this.parsers = ArrayUtils2.copyOf(b.parsers);
this.partParser = b.partParser;
this.partSerializer = b.partSerializer;
this.path = b.path;
- this.produces = copyOf(b.produces);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.renderResponseStackTraces =
b.renderResponseStackTraces;
- this.responseProcessors = copyOf(b.responseProcessors);
+ this.responseProcessors =
ArrayUtils2.copyOf(b.responseProcessors);
this.restChildrenClass = b.restChildrenClass;
this.restOperationsClass = b.restOperationsClass;
- this.restOpArgs = copyOf(b.restOpArgs);
+ this.restOpArgs = ArrayUtils2.copyOf(b.restOpArgs);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.siteName = b.siteName;
this.staticFiles = b.staticFiles;
this.swagger = b.swagger;
this.swaggerProvider = b.swaggerProvider;
- this.title = copyOf(b.title);
+ this.title = ArrayUtils2.copyOf(b.title);
this.uriAuthority = b.uriAuthority;
this.uriContext = b.uriContext;
this.uriRelativity = b.uriRelativity;
this.uriResolution = b.uriResolution;
- this.queryParams = copyOf(b.queryParams);
- this.headerParams = copyOf(b.headerParams);
- this.pathParams = copyOf(b.pathParams);
- this.formDataParams = copyOf(b.formDataParams);
+ this.queryParams = ArrayUtils2.copyOf(b.queryParams);
+ this.headerParams = ArrayUtils2.copyOf(b.headerParams);
+ this.pathParams = ArrayUtils2.copyOf(b.pathParams);
+ this.formDataParams =
ArrayUtils2.copyOf(b.formDataParams);
postConstruct();
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
index 0c631c7227..04fad3dbeb 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
import org.apache.juneau.reflect.*;
@@ -318,14 +319,14 @@ public class RestDeleteAnnotation {
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
- this.path = copyOf(b.path);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
+ this.path = ArrayUtils2.copyOf(b.path);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
this.summary = b.summary;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
index 88363d1a65..08ae955aac 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
import org.apache.juneau.reflect.*;
@@ -359,22 +360,22 @@ public class RestGetAnnotation {
Impl(Builder b) {
super(b);
this.clientVersion = b.clientVersion;
- this.converters = copyOf(b.converters);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
- this.path = copyOf(b.path);
- this.produces = copyOf(b.produces);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
+ this.path = ArrayUtils2.copyOf(b.path);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.summary = b.summary;
this.swagger = b.swagger;
this.value = b.value;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
index 3666200362..d3d54012e2 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
@@ -446,28 +446,28 @@ public class RestOpAnnotation {
Impl(Builder b) {
super(b);
this.clientVersion = b.clientVersion;
- this.consumes = copyOf(b.consumes);
- this.converters = copyOf(b.converters);
+ this.consumes = ArrayUtils2.copyOf(b.consumes);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
this.defaultContentType = b.defaultContentType;
- this.defaultRequestFormData =
copyOf(b.defaultRequestFormData);
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
+ this.defaultRequestFormData =
ArrayUtils2.copyOf(b.defaultRequestFormData);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
this.maxInput = b.maxInput;
this.method = b.method;
- this.parsers = copyOf(b.parsers);
- this.path = copyOf(b.path);
- this.produces = copyOf(b.produces);
+ this.parsers = ArrayUtils2.copyOf(b.parsers);
+ this.path = ArrayUtils2.copyOf(b.path);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.summary = b.summary;
this.swagger = b.swagger;
this.value = b.value;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOptionsAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOptionsAnnotation.java
index c75ca29df8..fa1b264967 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOptionsAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOptionsAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
import org.apache.juneau.reflect.*;
@@ -359,22 +360,22 @@ public class RestOptionsAnnotation {
Impl(Builder b) {
super(b);
this.clientVersion = b.clientVersion;
- this.converters = copyOf(b.converters);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
- this.path = copyOf(b.path);
- this.produces = copyOf(b.produces);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
+ this.path = ArrayUtils2.copyOf(b.path);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.summary = b.summary;
this.swagger = b.swagger;
this.value = b.value;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatchAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatchAnnotation.java
index c9068fca7e..76ba6294fa 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatchAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatchAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
import org.apache.juneau.reflect.*;
@@ -422,27 +423,27 @@ public class RestPatchAnnotation {
Impl(Builder b) {
super(b);
this.clientVersion = b.clientVersion;
- this.consumes = copyOf(b.consumes);
- this.converters = copyOf(b.converters);
+ this.consumes = ArrayUtils2.copyOf(b.consumes);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
this.defaultContentType = b.defaultContentType;
- this.defaultRequestFormData =
copyOf(b.defaultRequestFormData);
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
+ this.defaultRequestFormData =
ArrayUtils2.copyOf(b.defaultRequestFormData);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
this.maxInput = b.maxInput;
- this.parsers = copyOf(b.parsers);
- this.path = copyOf(b.path);
- this.produces = copyOf(b.produces);
+ this.parsers = ArrayUtils2.copyOf(b.parsers);
+ this.path = ArrayUtils2.copyOf(b.path);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.summary = b.summary;
this.swagger = b.swagger;
this.value = b.value;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
index 26aa62e76f..8d1b224627 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
import org.apache.juneau.reflect.*;
@@ -422,27 +423,27 @@ public class RestPostAnnotation {
Impl(Builder b) {
super(b);
this.clientVersion = b.clientVersion;
- this.consumes = copyOf(b.consumes);
- this.converters = copyOf(b.converters);
+ this.consumes = ArrayUtils2.copyOf(b.consumes);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
this.defaultContentType = b.defaultContentType;
- this.defaultRequestFormData =
copyOf(b.defaultRequestFormData);
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
+ this.defaultRequestFormData =
ArrayUtils2.copyOf(b.defaultRequestFormData);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
this.maxInput = b.maxInput;
- this.parsers = copyOf(b.parsers);
- this.path = copyOf(b.path);
- this.produces = copyOf(b.produces);
+ this.parsers = ArrayUtils2.copyOf(b.parsers);
+ this.path = ArrayUtils2.copyOf(b.path);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.summary = b.summary;
this.swagger = b.swagger;
this.value = b.value;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
index a7d8d1d12b..c215c66dce 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
@@ -23,6 +23,7 @@ import java.nio.charset.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.*;
import org.apache.juneau.reflect.*;
@@ -422,27 +423,27 @@ public class RestPutAnnotation {
Impl(Builder b) {
super(b);
this.clientVersion = b.clientVersion;
- this.consumes = copyOf(b.consumes);
- this.converters = copyOf(b.converters);
+ this.consumes = ArrayUtils2.copyOf(b.consumes);
+ this.converters = ArrayUtils2.copyOf(b.converters);
this.debug = b.debug;
this.defaultAccept = b.defaultAccept;
this.defaultCharset = b.defaultCharset;
this.defaultContentType = b.defaultContentType;
- this.defaultRequestFormData =
copyOf(b.defaultRequestFormData);
- this.defaultRequestQueryData =
copyOf(b.defaultRequestQueryData);
- this.defaultRequestAttributes =
copyOf(b.defaultRequestAttributes);
- this.defaultRequestHeaders =
copyOf(b.defaultRequestHeaders);
- this.defaultResponseHeaders =
copyOf(b.defaultResponseHeaders);
- this.encoders = copyOf(b.encoders);
- this.guards = copyOf(b.guards);
- this.matchers = copyOf(b.matchers);
+ this.defaultRequestFormData =
ArrayUtils2.copyOf(b.defaultRequestFormData);
+ this.defaultRequestQueryData =
ArrayUtils2.copyOf(b.defaultRequestQueryData);
+ this.defaultRequestAttributes =
ArrayUtils2.copyOf(b.defaultRequestAttributes);
+ this.defaultRequestHeaders =
ArrayUtils2.copyOf(b.defaultRequestHeaders);
+ this.defaultResponseHeaders =
ArrayUtils2.copyOf(b.defaultResponseHeaders);
+ this.encoders = ArrayUtils2.copyOf(b.encoders);
+ this.guards = ArrayUtils2.copyOf(b.guards);
+ this.matchers = ArrayUtils2.copyOf(b.matchers);
this.maxInput = b.maxInput;
- this.parsers = copyOf(b.parsers);
- this.path = copyOf(b.path);
- this.produces = copyOf(b.produces);
+ this.parsers = ArrayUtils2.copyOf(b.parsers);
+ this.path = ArrayUtils2.copyOf(b.path);
+ this.produces = ArrayUtils2.copyOf(b.produces);
this.roleGuard = b.roleGuard;
this.rolesDeclared = b.rolesDeclared;
- this.serializers = copyOf(b.serializers);
+ this.serializers = ArrayUtils2.copyOf(b.serializers);
this.summary = b.summary;
this.swagger = b.swagger;
this.value = b.value;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/SwaggerAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/SwaggerAnnotation.java
index def96ab4f2..21b0fbf41f 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/SwaggerAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/SwaggerAnnotation.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.http.annotation.*;
/**
@@ -167,10 +168,10 @@ public class SwaggerAnnotation {
this.contact = b.contact;
this.externalDocs = b.externalDocs;
this.license = b.license;
- this.tags = copyOf(b.tags);
- this.termsOfService = copyOf(b.termsOfService);
- this.title = copyOf(b.title);
- this.value = copyOf(b.value);
+ this.tags = ArrayUtils2.copyOf(b.tags);
+ this.termsOfService =
ArrayUtils2.copyOf(b.termsOfService);
+ this.title = ArrayUtils2.copyOf(b.title);
+ this.value = ArrayUtils2.copyOf(b.value);
this.version = b.version;
postConstruct();
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/FormDataArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/FormDataArg.java
index acf8ec9053..d133d3f278 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/FormDataArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/FormDataArg.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.http.annotation.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.internal.*;
@@ -192,7 +193,7 @@ public class FormDataArg implements RestOpArg {
if (multi) {
Collection c = cm.isArray() ? list() :
(Collection)(cm.canCreateNewInstance() ? cm.newInstance() : new JsonList());
rh.getAll(name).stream().map(x ->
x.parser(ps).schema(schema).as(cm.getElementType()).orElse(null)).forEach(x ->
c.add(x));
- return cm.isArray() ? ArrayUtils.toArray(c,
cm.getElementType().getInnerClass()) : c;
+ return cm.isArray() ? ArrayUtils2.toArray(c,
cm.getElementType().getInnerClass()) : c;
}
if (cm.isMapOrBean() && isOneOf(name, "*", "")) {
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/HeaderArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/HeaderArg.java
index 6f46506ff5..f2fbd663cc 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/HeaderArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/HeaderArg.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.http.annotation.*;
import org.apache.juneau.http.header.*;
import org.apache.juneau.httppart.*;
@@ -238,7 +239,7 @@ public class HeaderArg implements RestOpArg {
if (multi) {
Collection c = cm.isArray() ? list() :
(Collection)(cm.canCreateNewInstance() ? cm.newInstance() : new JsonList());
rh.stream(name).map(x ->
x.parser(ps).schema(schema).as(cm.getElementType()).orElse(null)).forEach(x ->
c.add(x));
- return cm.isArray() ? ArrayUtils.toArray(c,
cm.getElementType().getInnerClass()) : c;
+ return cm.isArray() ? ArrayUtils2.toArray(c,
cm.getElementType().getInnerClass()) : c;
}
if (cm.isMapOrBean() && isOneOf(name, "*", "")) {
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/QueryArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/QueryArg.java
index fe3f25cfd0..a4ea12f6f4 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/QueryArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/arg/QueryArg.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.http.annotation.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.internal.*;
@@ -197,7 +198,7 @@ public class QueryArg implements RestOpArg {
if (multi) {
Collection c = cm.isArray() ? list() :
(Collection)(cm.canCreateNewInstance() ? cm.newInstance() : new JsonList());
rh.getAll(name).stream().map(x ->
x.parser(ps).schema(schema).as(cm.getElementType()).orElse(null)).forEach(x ->
c.add(x));
- return cm.isArray() ? ArrayUtils.toArray(c,
cm.getElementType().getInnerClass()) : c;
+ return cm.isArray() ? ArrayUtils2.toArray(c,
cm.getElementType().getInnerClass()) : c;
}
if (cm.isMapOrBean() && isOneOf(name, "*", "")) {
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
index 9cea8440ea..99e62c7e17 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
@@ -484,7 +484,7 @@ public class RestUtils {
if (! b)
m.put(key, null);
} else if (b && m.get(key) != null) {
- m.put(key, append(m.get(key), val));
+ m.put(key, ArrayUtils2.append(m.get(key), val));
} else {
m.put(key, new String[] { val });
}
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
index 01304916cc..caea58611c 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
@@ -25,6 +25,7 @@ import java.util.stream.*;
import org.apache.juneau.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.json.*;
import org.apache.juneau.marshaller.*;
@@ -54,7 +55,7 @@ class BeanConfigAnnotation_Test extends TestBase {
.map(TO_STRING)
.collect(Collectors.joining(","));
if (isArray(t))
- return apply(ArrayUtils.toList(t,
Object.class));
+ return apply(ArrayUtils2.toList(t,
Object.class));
if (t instanceof JsonMap)
return ((JsonMap)t).toString();
if (t instanceof Map)
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/html/HtmlDocConfigAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/html/HtmlDocConfigAnnotation_Test.java
index 03aac5fcbc..ab2f904baf 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/html/HtmlDocConfigAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/html/HtmlDocConfigAnnotation_Test.java
@@ -24,6 +24,7 @@ import java.util.function.*;
import java.util.stream.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.html.annotation.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.reflect.*;
@@ -41,7 +42,7 @@ class HtmlDocConfigAnnotation_Test extends TestBase {
private static final Function<Object,String> TO_STRING = t -> {
if (isArray(t))
- return
HtmlDocConfigAnnotation_Test.TO_STRING.apply(ArrayUtils.toList(t,
Object.class));
+ return
HtmlDocConfigAnnotation_Test.TO_STRING.apply(ArrayUtils2.toList(t,
Object.class));
if (t instanceof Collection)
return ((Collection<?>)t)
.stream()
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/reflect/ExecutableInfo_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/reflect/ExecutableInfo_Test.java
index d7311cd275..6054a1e4d9 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/reflect/ExecutableInfo_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/reflect/ExecutableInfo_Test.java
@@ -29,6 +29,7 @@ import java.util.function.*;
import java.util.stream.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.internal.*;
import org.junit.jupiter.api.*;
@@ -46,7 +47,7 @@ class ExecutableInfo_Test extends TestBase {
if (t instanceof List)
return
((List<?>)t).stream().map(this).collect(Collectors.joining(","));
if (isArray(t))
- return
StreamSupport.stream(ArrayUtils.toList(t, Object.class).spliterator(),
false).map(this).collect(Collectors.joining(","));
+ return
StreamSupport.stream(ArrayUtils2.toList(t, Object.class).spliterator(),
false).map(this).collect(Collectors.joining(","));
if (t instanceof Annotation)
return "@" +
((Annotation)t).annotationType().getSimpleName() + "()";
if (t instanceof Class)
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
b/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
index 1ee58f6daf..3d3b03628f 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/reflect/ParamInfoTest.java
@@ -28,6 +28,7 @@ import java.util.stream.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.internal.*;
import org.junit.jupiter.api.*;
@@ -64,7 +65,7 @@ class ParamInfoTest extends TestBase {
if (t instanceof List)
return
((List<?>)t).stream().map(this).collect(Collectors.joining(","));
if (isArray(t))
- return
StreamSupport.stream(ArrayUtils.toList(t, Object.class).spliterator(),
false).map(this).collect(Collectors.joining(","));
+ return
StreamSupport.stream(ArrayUtils2.toList(t, Object.class).spliterator(),
false).map(this).collect(Collectors.joining(","));
if (t instanceof MethodInfo)
return
((MethodInfo)t).getDeclaringClass().getSimpleName() + '.' +
((MethodInfo)t).getShortName();
if (t instanceof CA)
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/utest/utils/FakeWriterSerializer.java
b/juneau-utest/src/test/java/org/apache/juneau/utest/utils/FakeWriterSerializer.java
index dc685f644a..0572ccdc71 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/utest/utils/FakeWriterSerializer.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/utest/utils/FakeWriterSerializer.java
@@ -18,7 +18,6 @@
package org.apache.juneau.utest.utils;
import static org.apache.juneau.common.utils.Utils.*;
-import static org.apache.juneau.internal.ArrayUtils.toList;
import java.io.*;
import java.util.*;
@@ -54,7 +53,7 @@ public class FakeWriterSerializer extends WriterSerializer
implements HttpPartSe
if (value instanceof Collection<?> x)
value = StringUtils.join(x, '|');
if (isArray(value))
- value = StringUtils.join(toList(value,
Object.class), "|");
+ value =
StringUtils.join(ArrayUtils2.toList(value, Object.class), "|");
return "x" + value + "x";
}
}
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/utils/ArrayUtilsTest.java
b/juneau-utest/src/test/java/org/apache/juneau/utils/ArrayUtilsTest.java
index 01e0fc907b..9cd5010d89 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/utils/ArrayUtilsTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/utils/ArrayUtilsTest.java
@@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.*;
import java.util.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.junit.jupiter.api.*;
class ArrayUtilsTest extends TestBase {
@@ -33,19 +34,19 @@ class ArrayUtilsTest extends TestBase {
@Test void a01_appendArrayToArray() {
String[] s = {};
- s = append(s, "a", "b");
+ s = ArrayUtils2.append(s, "a", "b");
assertList(s, "a", "b");
- s = append(s, "c");
+ s = ArrayUtils2.append(s, "c");
assertList(s, "a", "b", "c");
- s = append(s);
+ s = ArrayUtils2.append(s);
assertList(s, "a", "b", "c");
- var o = append((Object[])null);
+ var o = ArrayUtils2.append((Object[])null);
assertEmpty(o);
- s = append((String[])null, "a", "b");
+ s = ArrayUtils2.append((String[])null, "a", "b");
assertList(s, "a", "b");
}
@@ -53,10 +54,10 @@ class ArrayUtilsTest extends TestBase {
// asSet(T[])
//====================================================================================================
@Test void a02_asSet() {
- assertThrows(IllegalArgumentException.class,
()->asSet((String[])null));
+ assertThrows(IllegalArgumentException.class,
()->ArrayUtils2.asSet((String[])null));
var s = a("a");
- var i = asSet(s).iterator();
+ var i = ArrayUtils2.asSet(s).iterator();
assertEquals("a", i.next());
assertThrows(UnsupportedOperationException.class, i::remove);
@@ -70,12 +71,12 @@ class ArrayUtilsTest extends TestBase {
var s1 = a("a");
var s2 = a("b");
- assertList(combine(s1, s2), "a", "b");
- assertList(combine(s1), "a");
- assertList(combine(s2), "b");
- assertList(combine(s1,null), "a");
- assertList(combine(null,s2), "b");
- assertNull(combine(null,null));
- assertNull(combine());
+ assertList(ArrayUtils2.combine(s1, s2), "a", "b");
+ assertList(ArrayUtils2.combine(s1), "a");
+ assertList(ArrayUtils2.combine(s2), "b");
+ assertList(ArrayUtils2.combine(s1,null), "a");
+ assertList(ArrayUtils2.combine(null,s2), "b");
+ assertNull(ArrayUtils2.combine(null,null));
+ assertNull(ArrayUtils2.combine());
}
}
\ No newline at end of file
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/xml/XmlConfigAnnotationTest.java
b/juneau-utest/src/test/java/org/apache/juneau/xml/XmlConfigAnnotationTest.java
index 1dbf639910..e52068d191 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/xml/XmlConfigAnnotationTest.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/xml/XmlConfigAnnotationTest.java
@@ -26,6 +26,7 @@ import javax.xml.stream.events.*;
import javax.xml.stream.util.*;
import org.apache.juneau.*;
+import org.apache.juneau.common.utils.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.reflect.*;
import org.apache.juneau.svl.*;
@@ -45,7 +46,7 @@ class XmlConfigAnnotationTest extends TestBase {
if (t == null)
return null;
if (isArray(t))
- return
XmlConfigAnnotationTest.TO_STRING.apply(ArrayUtils.toList(t, Object.class));
+ return
XmlConfigAnnotationTest.TO_STRING.apply(ArrayUtils2.toList(t, Object.class));
if (t instanceof AA)
return "AA";
if (t instanceof AB)