TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
Message message = ERR_EMR_INTFIRSTCOMP_NO_INITIAL_PARENTHESIS.get(
String.valueOf(valueString));
throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
message, e);
}
}
int pos = 1;
while ((pos < valueLength) && ((valueString.charAt(pos)) == ' '))
{
pos++;
}
if (pos >= valueLength)
{
Message message =
ERR_EMR_INTFIRSTCOMP_NO_NONSPACE.get(String.valueOf(valueString));
throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
message);
}
// The current position must be the start position for the value. Keep
// reading until we find the next space.
int startPos = pos++;
while ((pos < valueLength) && ((valueString.charAt(pos)) != ' '))
{
pos++;
}
if (pos >= valueLength)
{
Message message = ERR_EMR_INTFIRSTCOMP_NO_SPACE_AFTER_INT.get(
String.valueOf(valueString));
throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
message);
}
// We should now have the position of the integer value. Make sure it's an
// integer and return it.
try
{
return Integer.parseInt(valueString.substring(startPos, pos));
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
Message message = ERR_EMR_INTFIRSTCOMP_FIRST_COMPONENT_NOT_INT.get(
String.valueOf(valueString));
throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
message);
}
}