directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r477613 - /directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponse.java
Date Tue, 21 Nov 2006 10:38:23 GMT
Author: pamarcelot
Date: Tue Nov 21 02:38:22 2006
New Revision: 477613

URL: http://svn.apache.org/viewvc?view=rev&rev=477613
Log:
Modifying DSML Parser. The method getCurrentSearchResultEntry() of the SearchResponse class
was throwing an exception (ArrayOutOfBounds) if there was no SearchResultEntry in the List.

Modified:
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponse.java

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponse.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponse.java?view=diff&rev=477613&r1=477612&r2=477613
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponse.java
(original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponse.java
Tue Nov 21 02:38:22 2006
@@ -47,7 +47,14 @@
     
     public SearchResultEntry getCurrentSearchResultEntry()
     {
-        return searchResultEntryList.get( searchResultEntryList.size() - 1 );
+        if ( searchResultEntryList.size() > 0 )
+        {
+            return searchResultEntryList.get( searchResultEntryList.size() - 1 );
+        }
+        else
+        {
+            return null;
+        }
     }
 	
 	public boolean addSearchResultReference(SearchResultReference searchResultReference)



Mime
View raw message