Skip to content

Commit

Permalink
Remove ElasticsearchIAE and ElasticsearchISE
Browse files Browse the repository at this point in the history
This commit removes ElasticsearchIAE and ElasticsearchISE in favor of
the JDKs IAE and ISE.

Closes elastic#10794
  • Loading branch information
s1monw committed Apr 28, 2015
1 parent 7d8f39f commit 14fe084
Show file tree
Hide file tree
Showing 436 changed files with 1,506 additions and 1,666 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/apache/lucene/analysis/PrefixAnalyzer.java
Expand Up @@ -21,7 +21,7 @@

import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.lang.IllegalArgumentException;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -97,7 +97,7 @@ public PrefixTokenFilter(TokenStream input, char separator, Iterable<? extends C
this.currentPrefix = null;
this.separator = separator;
if (prefixes == null || !prefixes.iterator().hasNext()) {
throw new ElasticsearchIllegalArgumentException("one or more prefixes needed");
throw new IllegalArgumentException("one or more prefixes needed");
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/apache/lucene/store/StoreRateLimiting.java
Expand Up @@ -19,7 +19,7 @@
package org.apache.lucene.store;

import org.apache.lucene.store.RateLimiter.SimpleRateLimiter;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.lang.IllegalArgumentException;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.unit.ByteSizeValue;

Expand All @@ -42,15 +42,15 @@ public static enum Type {
MERGE,
ALL;

public static Type fromString(String type) throws ElasticsearchIllegalArgumentException {
public static Type fromString(String type) throws IllegalArgumentException {
if ("none".equalsIgnoreCase(type)) {
return NONE;
} else if ("merge".equalsIgnoreCase(type)) {
return MERGE;
} else if ("all".equalsIgnoreCase(type)) {
return ALL;
}
throw new ElasticsearchIllegalArgumentException("rate limiting type [" + type + "] not valid, can be one of [all|merge|none]");
throw new IllegalArgumentException("rate limiting type [" + type + "] not valid, can be one of [all|merge|none]");
}
}

Expand Down Expand Up @@ -88,7 +88,7 @@ public void setType(Type type) {
this.type = type;
}

public void setType(String type) throws ElasticsearchIllegalArgumentException {
public void setType(String type) throws IllegalArgumentException {
this.type = Type.fromString(type);
}
}

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/org/elasticsearch/Version.java
Expand Up @@ -459,12 +459,12 @@ public static Version fromId(int id) {
/**
* Return the {@link Version} of Elasticsearch that has been used to create an index given its settings.
*
* @throws ElasticsearchIllegalStateException if the given index settings doesn't contain a value for the key {@value IndexMetaData#SETTING_VERSION_CREATED}
* @throws IllegalStateException if the given index settings doesn't contain a value for the key {@value IndexMetaData#SETTING_VERSION_CREATED}
*/
public static Version indexCreated(Settings indexSettings) {
final Version indexVersion = indexSettings.getAsVersion(IndexMetaData.SETTING_VERSION_CREATED, null);
if (indexVersion == null) {
throw new ElasticsearchIllegalStateException("[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: [" + indexSettings.get(IndexMetaData.SETTING_UUID) + "]");
throw new IllegalStateException("[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: [" + indexSettings.get(IndexMetaData.SETTING_UUID) + "]");
}
return indexVersion;
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/elasticsearch/action/ActionFuture.java
Expand Up @@ -35,7 +35,7 @@ public interface ActionFuture<T> extends Future<T> {

/**
* Similar to {@link #get()}, just catching the {@link InterruptedException} and throwing
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
Expand All @@ -46,7 +46,7 @@ public interface ActionFuture<T> extends Future<T> {

/**
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
Expand All @@ -57,7 +57,7 @@ public interface ActionFuture<T> extends Future<T> {

/**
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
Expand All @@ -70,7 +70,7 @@ public interface ActionFuture<T> extends Future<T> {

/**
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
Expand All @@ -81,7 +81,7 @@ public interface ActionFuture<T> extends Future<T> {

/**
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
* an {@link org.elasticsearch.ElasticsearchIllegalStateException} instead. Also catches
* an {@link IllegalStateException} instead. Also catches
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
* <p/>
* <p>Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
Expand Down
Expand Up @@ -19,20 +19,22 @@

package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.ElasticsearchException;

import java.lang.IllegalArgumentException;

import java.util.ArrayList;
import java.util.List;

/**
*
*/
public class ActionRequestValidationException extends ElasticsearchIllegalArgumentException {
public class ActionRequestValidationException extends IllegalArgumentException {

private final List<String> validationErrors = new ArrayList<>();

public ActionRequestValidationException() {
super(null);
super("validation failed");
}

public void addValidationError(String error) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/elasticsearch/action/ThreadingModel.java
Expand Up @@ -19,7 +19,7 @@

package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.lang.IllegalArgumentException;

/**
*
Expand Down Expand Up @@ -108,7 +108,7 @@ public static ThreadingModel fromId(byte id) {
} else if (id == 3) {
return OPERATION_LISTENER;
} else {
throw new ElasticsearchIllegalArgumentException("No threading model for [" + id + "]");
throw new IllegalArgumentException("No threading model for [" + id + "]");
}
}
}
Expand Up @@ -19,7 +19,7 @@

package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.lang.IllegalArgumentException;

/**
* Write Consistency Level control how many replicas should be active for a write operation to occur (a write operation
Expand Down Expand Up @@ -53,7 +53,7 @@ public static WriteConsistencyLevel fromId(byte value) {
} else if (value == 3) {
return ALL;
}
throw new ElasticsearchIllegalArgumentException("No write consistency match [" + value + "]");
throw new IllegalArgumentException("No write consistency match [" + value + "]");
}

public static WriteConsistencyLevel fromString(String value) {
Expand All @@ -66,6 +66,6 @@ public static WriteConsistencyLevel fromString(String value) {
} else if (value.equals("all")) {
return ALL;
}
throw new ElasticsearchIllegalArgumentException("No write consistency match [" + value + "]");
throw new IllegalArgumentException("No write consistency match [" + value + "]");
}
}
Expand Up @@ -19,7 +19,7 @@

package org.elasticsearch.action.admin.cluster.health;

import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.lang.IllegalArgumentException;

/**
*
Expand Down Expand Up @@ -48,7 +48,7 @@ public static ClusterHealthStatus fromValue(byte value) {
case 2:
return RED;
default:
throw new ElasticsearchIllegalArgumentException("No cluster health status for value [" + value + "]");
throw new IllegalArgumentException("No cluster health status for value [" + value + "]");
}
}
}
Expand Up @@ -20,7 +20,7 @@
package org.elasticsearch.action.admin.cluster.health;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ElasticsearchIllegalStateException;
import java.lang.IllegalStateException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.IndicesOptions;
Expand Down Expand Up @@ -141,7 +141,7 @@ public void onNewClusterState(ClusterState clusterState) {

@Override
public void onClusterServiceClose() {
listener.onFailure(new ElasticsearchIllegalStateException("ClusterService was close during health call"));
listener.onFailure(new IllegalStateException("ClusterService was close during health call"));
}

@Override
Expand Down
Expand Up @@ -20,8 +20,8 @@
package org.elasticsearch.action.admin.cluster.repositories.put;

import org.elasticsearch.ElasticsearchGenerationException;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.Version;
import java.lang.IllegalArgumentException;

import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.common.bytes.BytesReference;
Expand Down Expand Up @@ -218,7 +218,7 @@ public PutRepositoryRequest source(Map repositoryDefinition) {
type(entry.getValue().toString());
} else if (name.equals("settings")) {
if (!(entry.getValue() instanceof Map)) {
throw new ElasticsearchIllegalArgumentException("Malformed settings section, should include an inner object");
throw new IllegalArgumentException("Malformed settings section, should include an inner object");
}
settings((Map<String, Object>) entry.getValue());
}
Expand All @@ -236,7 +236,7 @@ public PutRepositoryRequest source(String repositoryDefinition) {
try {
return source(XContentFactory.xContent(repositoryDefinition).createParser(repositoryDefinition).mapOrderedAndClose());
} catch (IOException e) {
throw new ElasticsearchIllegalArgumentException("failed to parse repository source [" + repositoryDefinition + "]", e);
throw new IllegalArgumentException("failed to parse repository source [" + repositoryDefinition + "]", e);
}
}

Expand All @@ -260,7 +260,7 @@ public PutRepositoryRequest source(byte[] repositoryDefinition, int offset, int
try {
return source(XContentFactory.xContent(repositoryDefinition, offset, length).createParser(repositoryDefinition, offset, length).mapOrderedAndClose());
} catch (IOException e) {
throw new ElasticsearchIllegalArgumentException("failed to parse repository source", e);
throw new IllegalArgumentException("failed to parse repository source", e);
}
}

Expand All @@ -274,7 +274,7 @@ public PutRepositoryRequest source(BytesReference repositoryDefinition) {
try {
return source(XContentFactory.xContent(repositoryDefinition).createParser(repositoryDefinition).mapOrderedAndClose());
} catch (IOException e) {
throw new ElasticsearchIllegalArgumentException("failed to parse template source", e);
throw new IllegalArgumentException("failed to parse template source", e);
}
}

Expand Down
Expand Up @@ -19,7 +19,7 @@

package org.elasticsearch.action.admin.cluster.shards;

import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.lang.IllegalArgumentException;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.support.IndicesOptions;
Expand Down Expand Up @@ -61,11 +61,11 @@ public ActionRequestValidationException validate() {
@Override
public ClusterSearchShardsRequest indices(String... indices) {
if (indices == null) {
throw new ElasticsearchIllegalArgumentException("indices must not be null");
throw new IllegalArgumentException("indices must not be null");
} else {
for (int i = 0; i < indices.length; i++) {
if (indices[i] == null) {
throw new ElasticsearchIllegalArgumentException("indices[" + i + "] must not be null");
throw new IllegalArgumentException("indices[" + i + "] must not be null");
}
}
}
Expand Down

0 comments on commit 14fe084

Please sign in to comment.