From 80c58327faaa4873369f6bb949e62792c2f708e0 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.
---
opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java b/opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java
index 23d94c7..6d28876 100644
--- a/opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java
+++ b/opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java
@@ -25,6 +25,7 @@
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.protocols.asn1;
+import org.opends.messages.Message;
@@ -35,8 +36,7 @@
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
-import static org.opends.server.messages.MessageHandler.*;
-import static org.opends.server.messages.ProtocolMessages.*;
+import static org.opends.messages.ProtocolMessages.*;
@@ -217,9 +217,9 @@
// Make sure that there are an acceptable number of bytes in the length.
if (numLengthBytes > 4)
{
- int msgID = MSGID_ASN1_ELEMENT_SET_INVALID_NUM_LENGTH_BYTES;
- String message = getMessage(msgID, numLengthBytes);
- throw new ASN1Exception(msgID, message);
+ Message message =
+ ERR_ASN1_ELEMENT_SET_INVALID_NUM_LENGTH_BYTES.get(numLengthBytes);
+ throw new ASN1Exception(message);
}
@@ -231,9 +231,9 @@
{
// We've reached the end of the stream in the middle of the value.
// This is not good, so throw an exception.
- int msgID = MSGID_ASN1_ELEMENT_SET_TRUNCATED_LENGTH;
- String message = getMessage(msgID, numLengthBytes);
- throw new IOException(message);
+ Message message =
+ ERR_ASN1_ELEMENT_SET_TRUNCATED_LENGTH.get(numLengthBytes);
+ throw new IOException(message.toString());
}
length = (length << 8) | lengthByte;
@@ -250,9 +250,9 @@
}
else if ((maxElementSize > 0) && (length > maxElementSize))
{
- int msgID = MSGID_ASN1_READER_MAX_SIZE_EXCEEDED;
- String message = getMessage(msgID, length, maxElementSize);
- throw new ASN1Exception(msgID, message);
+ Message message =
+ ERR_ASN1_READER_MAX_SIZE_EXCEEDED.get(length, maxElementSize);
+ throw new ASN1Exception(message);
}
@@ -266,9 +266,9 @@
int bytesRead = inputStream.read(value, readPos, bytesNeeded);
if (bytesRead < 0)
{
- int msgID = MSGID_ASN1_ELEMENT_SET_TRUNCATED_VALUE;
- String message = getMessage(msgID, length, bytesNeeded);
- throw new IOException(message);
+ Message message =
+ ERR_ASN1_ELEMENT_SET_TRUNCATED_VALUE.get(length, bytesNeeded);
+ throw new IOException(message.toString());
}
bytesNeeded -= bytesRead;
--
Gitblit v1.10.0