From f40ae25352f842f188ce833406f8aeb500ae64ca Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 25 Sep 2015 16:43:01 -0400 Subject: [PATCH] Another sync of ElasticsearchException ids with 2.0 --- .../org/elasticsearch/ElasticsearchException.java | 8 ++++---- .../elasticsearch/ExceptionSerializationTests.java | 14 ++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/ElasticsearchException.java b/core/src/main/java/org/elasticsearch/ElasticsearchException.java index 84800c7948a..0fa4d68a406 100644 --- a/core/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/core/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -500,7 +500,9 @@ public class ElasticsearchException extends RuntimeException implements ToXConte MAPPER_EXCEPTION(org.elasticsearch.index.mapper.MapperException.class, org.elasticsearch.index.mapper.MapperException::new, 37), INVALID_TYPE_NAME_EXCEPTION(org.elasticsearch.indices.InvalidTypeNameException.class, org.elasticsearch.indices.InvalidTypeNameException::new, 38), SNAPSHOT_RESTORE_EXCEPTION(org.elasticsearch.snapshots.SnapshotRestoreException.class, org.elasticsearch.snapshots.SnapshotRestoreException::new, 39), + PARSING_EXCEPTION(org.elasticsearch.common.ParsingException.class, org.elasticsearch.common.ParsingException::new, 40), INDEX_SHARD_CLOSED_EXCEPTION(org.elasticsearch.index.shard.IndexShardClosedException.class, org.elasticsearch.index.shard.IndexShardClosedException::new, 41), + RECOVER_FILES_RECOVERY_EXCEPTION(org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException::new, 42), TRUNCATED_TRANSLOG_EXCEPTION(org.elasticsearch.index.translog.TruncatedTranslogException.class, org.elasticsearch.index.translog.TruncatedTranslogException::new, 43), RECOVERY_FAILED_EXCEPTION(org.elasticsearch.indices.recovery.RecoveryFailedException.class, org.elasticsearch.indices.recovery.RecoveryFailedException::new, 44), INDEX_SHARD_RELOCATED_EXCEPTION(org.elasticsearch.index.shard.IndexShardRelocatedException.class, org.elasticsearch.index.shard.IndexShardRelocatedException::new, 45), @@ -596,10 +598,8 @@ public class ElasticsearchException extends RuntimeException implements ToXConte STRICT_DYNAMIC_MAPPING_EXCEPTION(org.elasticsearch.index.mapper.StrictDynamicMappingException.class, org.elasticsearch.index.mapper.StrictDynamicMappingException::new, 135), RETRY_ON_REPLICA_EXCEPTION(org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException.class, org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException::new, 136), TYPE_MISSING_EXCEPTION(org.elasticsearch.indices.TypeMissingException.class, org.elasticsearch.indices.TypeMissingException::new, 137), - PARSING_EXCEPTION(org.elasticsearch.common.ParsingException.class, org.elasticsearch.common.ParsingException::new, 140), - RECOVER_FILES_RECOVERY_EXCEPTION(org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException::new, 141), - FAILED_TO_COMMIT_CLUSTER_STATE_EXCEPTION(org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException::new, 142), - QUERY_SHARD_EXCEPTION(org.elasticsearch.index.query.QueryShardException.class, org.elasticsearch.index.query.QueryShardException::new, 143); + FAILED_TO_COMMIT_CLUSTER_STATE_EXCEPTION(org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException::new, 140), + QUERY_SHARD_EXCEPTION(org.elasticsearch.index.query.QueryShardException.class, org.elasticsearch.index.query.QueryShardException::new, 141); final Class exceptionClass; final FunctionThatThrowsIOException constructor; diff --git a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 92f06cd5a17..aec95dbdadc 100644 --- a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -227,13 +227,13 @@ public class ExceptionSerializationTests extends ESTestCase { ParsingException ex = serialize(new ParsingException(1, 2, "fobar", null)); assertNull(ex.getIndex()); assertEquals(ex.getMessage(), "fobar"); - assertEquals(ex.getLineNumber(),1); + assertEquals(ex.getLineNumber(), 1); assertEquals(ex.getColumnNumber(), 2); ex = serialize(new ParsingException(1, 2, null, null)); assertNull(ex.getIndex()); assertNull(ex.getMessage()); - assertEquals(ex.getLineNumber(),1); + assertEquals(ex.getLineNumber(), 1); assertEquals(ex.getColumnNumber(), 2); } @@ -697,9 +697,9 @@ public class ExceptionSerializationTests extends ESTestCase { ids.put(37, org.elasticsearch.index.mapper.MapperException.class); ids.put(38, org.elasticsearch.indices.InvalidTypeNameException.class); ids.put(39, org.elasticsearch.snapshots.SnapshotRestoreException.class); - ids.put(40, null); + ids.put(40, org.elasticsearch.common.ParsingException.class); ids.put(41, org.elasticsearch.index.shard.IndexShardClosedException.class); - ids.put(42, null); + ids.put(42, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class); ids.put(43, org.elasticsearch.index.translog.TruncatedTranslogException.class); ids.put(44, org.elasticsearch.indices.recovery.RecoveryFailedException.class); ids.put(45, org.elasticsearch.index.shard.IndexShardRelocatedException.class); @@ -797,10 +797,8 @@ public class ExceptionSerializationTests extends ESTestCase { ids.put(137, org.elasticsearch.indices.TypeMissingException.class); ids.put(138, null); ids.put(139, null); - ids.put(140, org.elasticsearch.common.ParsingException.class); - ids.put(141, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class); - ids.put(142, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class); - ids.put(143, org.elasticsearch.index.query.QueryShardException.class); + ids.put(140, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class); + ids.put(141, org.elasticsearch.index.query.QueryShardException.class); Map, Integer> reverse = new HashMap<>(); for (Map.Entry> entry : ids.entrySet()) {