You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by gg...@apache.org on 2023/06/23 16:41:58 UTC

[juneau] branch master updated: [juneau-dto] Throw IllegalArgumentException instead of RuntimeException

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

ggregory 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 d1d4eb3fe [juneau-dto] Throw IllegalArgumentException instead of RuntimeException
d1d4eb3fe is described below

commit d1d4eb3fe0191d322d78d24cf471d8bf0103fab2
Author: Gary Gregory <gg...@rocketsoftware.com>
AuthorDate: Fri Jun 23 12:41:23 2023 -0400

    [juneau-dto] Throw IllegalArgumentException instead of
    RuntimeException
---
 .../src/main/java/org/apache/juneau/dto/jsonschema/JsonSchemaMap.java   | 2 +-
 .../juneau-dto/src/main/java/org/apache/juneau/dto/openapi3/Items.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/JsonSchemaMap.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/JsonSchemaMap.java
index 15fbad255..b4b2a0121 100644
--- a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/JsonSchemaMap.java
+++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/JsonSchemaMap.java
@@ -86,7 +86,7 @@ public abstract class JsonSchemaMap extends ConcurrentHashMap<URI,JsonSchema> {
 	public JsonSchemaMap add(JsonSchema...schemas) {
 		for (JsonSchema schema : schemas) {
 			if (schema.getId() == null)
-				throw new RuntimeException("Schema with no ID passed to JsonSchemaMap.add(Schema...)");
+				throw new IllegalArgumentException("Schema with no ID passed to JsonSchemaMap.add(Schema...)");
 			put(schema.getId(), schema);
 			schema.setSchemaMap(this);
 		}
diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/openapi3/Items.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/openapi3/Items.java
index cdb310315..31db60487 100644
--- a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/openapi3/Items.java
+++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/openapi3/Items.java
@@ -164,7 +164,7 @@ public class Items extends OpenApiElement {
 	 */
 	public Items setType(String value) {
 		if (isStrict() && ! contains(value, VALID_TYPES))
-			throw new RuntimeException(
+			throw new IllegalArgumentException(
 				"Invalid value passed in to setType(String).  Value='"+value+"', valid values="
 				+ Json5Serializer.DEFAULT.toString(VALID_TYPES));
 		type = value;