Skip to content

Commit

Permalink
remove not thrown IllegalArgumentException from javadoc of exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Fendt <Florian.Fendt@bosch.io>
  • Loading branch information
ffendt committed Sep 18, 2020
1 parent be37619 commit cd56294
Show file tree
Hide file tree
Showing 143 changed files with 22 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public static Builder newBuilder(@Nullable final CharSequence entityId) {
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new ThingIdInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand All @@ -105,6 +104,7 @@ public Optional<CharSequence> getEntityId() {
return Optional.ofNullable(entityId);
}

// TODO: equals and hashcode
/**
* A mutable builder with a fluent API for a {@link NamespacedEntityIdInvalidException}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public static DittoRuntimeExceptionBuilder<DittoHeadersTooLargeException> newAut
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new DittoHeadersTooLargeException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<
* @param builder the builder for the exception.
* @return the exception.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected.
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public static InvalidRqlExpressionException fromMessage(@Nullable final String m
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new InvalidRqlExpressionException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public static Builder newBuilder() {
* @throws NullPointerException if any argument is {@code null}.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if the {@code jsonObject} does not have the {@link
* org.eclipse.ditto.model.base.exceptions.DittoRuntimeException.JsonFields#MESSAGE} field.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected.
*/
public static SignalEnrichmentFailedException fromJson(final JsonObject jsonObject,
final DittoHeaders dittoHeaders) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public static TimeoutInvalidException.Builder newBuilder(final String message) {
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new DittoHeaderInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand All @@ -114,6 +113,10 @@ public static TimeoutInvalidException fromJson(final JsonObject jsonObject, fina
@NotThreadSafe
public static final class Builder extends DittoRuntimeExceptionBuilder<TimeoutInvalidException> {

private Builder() {
description(DEFAULT_DESCRIPTION);
}

@Override
protected TimeoutInvalidException doBuild(final DittoHeaders dittoHeaders,
@Nullable final String message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static TooManyRequestsException fromMessage(@Nullable final String messag
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new TooManyRequestsException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public static DittoRuntimeExceptionBuilder<UnsupportedMediaTypeException> withDe
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new UnsupportedMediaTypeException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down Expand Up @@ -119,4 +118,4 @@ protected UnsupportedMediaTypeException doBuild(final DittoHeaders dittoHeaders,
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public static ConnectionConfigurationInvalidException fromMessage(@Nullable fina
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new ConnectionConfigurationInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public static ConnectionSignalIdEnforcementFailedException fromMessage(@Nullable
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new ConnectionSignalIdEnforcementFailedException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public static ConnectionUriInvalidException fromMessage(@Nullable final String m
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new ConnectionUriInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public static MessageMapperConfigurationFailedException fromMessage(@Nullable fi
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new MessageMapperConfigurationFailedException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public static MessageMapperConfigurationInvalidException fromMessage(@Nullable f
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new MessageMapperConfigurationInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public static MessageMappingFailedException fromMessage(@Nullable final String m
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new MessageMappingFailedException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public static MessageSendingFailedException fromMessage(@Nullable final String m
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new MessageSendingFailedException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public static TopicParseException fromMessage(@Nullable final String message,
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new TopicParseException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public static Builder newBuilder() {
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new JwtAudienceInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public static Builder newBuilder() {
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new JwtInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public static FeatureIdInvalidException fromMessage(@Nullable final String messa
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new FeatureIdInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
package org.eclipse.ditto.model.messages;

import static org.eclipse.ditto.model.base.common.ConditionChecker.checkNotNull;

import java.net.URI;
import java.util.Objects;
import java.util.function.Predicate;
Expand Down Expand Up @@ -117,13 +119,18 @@ public int hashCode() {
* @param dittoHeaders the headers.
* @return an instance of this class.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
*/
public static MessageFormatInvalidException fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) {
return DittoRuntimeException.fromJson(jsonObject, dittoHeaders, new Builder());
checkNotNull(jsonObject, "jsonObject");
final Builder builder = new Builder();
jsonObject.getValue(VALIDATION_ERRORS)
.filter(JsonValue::isArray)
.map(JsonValue::asArray)
.ifPresent(builder::validationErrors);
return DittoRuntimeException.fromJson(jsonObject, dittoHeaders, builder);
}

/**
Expand All @@ -149,16 +156,6 @@ public Builder validationErrors(@Nullable final JsonArray validationErrors) {
return this;
}

@Override
public Builder loadJson(final JsonObject jsonObject) {
super.loadJson(jsonObject);
jsonObject.getValue(VALIDATION_ERRORS)
.filter(JsonValue::isArray)
.map(JsonValue::asArray)
.ifPresent(this::validationErrors);
return this;
}

@Override
protected MessageFormatInvalidException doBuild(final DittoHeaders dittoHeaders,
@Nullable final String message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public static Builder newBuilder(final long actualBytes, final long maxBytes) {
* @param dittoHeaders the headers.
* @return an instance of this class.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public static MessageSendNotAllowedException fromMessage(@Nullable final String
* @param dittoHeaders the headers.
* @return an instance of this class.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public static MessageTimeoutException fromMessage(@Nullable final String message
* @param dittoHeaders the headers.
* @return an instance of this class.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public static SubjectInvalidException fromMessage(@Nullable final String message
* @param dittoHeaders the headers.
* @return an instance of this class.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public static ThingIdInvalidException fromMessage(@Nullable final String message
* @param dittoHeaders the headers of the command which resulted in this exception.
* @return the new ThingIdInvalidException.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public static TimeoutInvalidException fromMessage(final String message) {
* @param dittoHeaders the headers.
* @return an instance of this class.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public static DittoRuntimeExceptionBuilder<NamespaceBlockedException> newBuilder
* @param dittoHeaders Ditto headers.
* @return Deserialized exception.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public static DittoRuntimeExceptionBuilder<PlaceholderFunctionSignatureInvalidEx
* @param dittoHeaders Ditto headers.
* @return Deserialized exception.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public static DittoRuntimeExceptionBuilder<PlaceholderFunctionTooComplexExceptio
* @param dittoHeaders Ditto headers.
* @return Deserialized exception.
* @throws NullPointerException if any argument is {@code null}.
* @throws IllegalArgumentException if {@code jsonObject} is empty.
* @throws org.eclipse.ditto.json.JsonMissingFieldException if this JsonObject did not contain an error message.
* @throws org.eclipse.ditto.json.JsonParseException if the passed in {@code jsonObject} was not in the expected
* format.
Expand Down
Loading

0 comments on commit cd56294

Please sign in to comment.