lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Dissel (JIRA)" <>
Subject [jira] Created: (LUCENENET-26) ArgumentOutOfRangeException in FieldInfo(int fieldNumber) constructor
Date Thu, 02 Nov 2006 21:47:16 GMT
ArgumentOutOfRangeException in FieldInfo(int fieldNumber) constructor

                 Key: LUCENENET-26
             Project: Lucene.Net
          Issue Type: Improvement
            Reporter: Marco Dissel
            Priority: Trivial

Another exception is raised that can be avoided.. In this case the fieldNumber = -1 resulting
in the ArgumentOutOfRangeException

This can be easily solved by checking (fieldNumber > -1 && fieldNumber < byNumber.Count)

ps. the java version has the same problem..

		/// <summary> Return the fieldinfo object referenced by the fieldNumber.</summary>
		/// <param name="fieldNumber">
		/// </param>
		/// <returns> the FieldInfo object or null when the given fieldNumber
		/// doesn't exist.
		/// </returns>
		public FieldInfo FieldInfo(int fieldNumber)
				return (FieldInfo) byNumber[fieldNumber];
			catch (System.ArgumentOutOfRangeException) // (System.IndexOutOfRangeException)
				return null;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message