Revision: 14495
          http://gate.svn.sourceforge.net/gate/?rev=14495&view=rev
Author:   markagreenwood
Date:     2011-11-04 15:45:07 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
simplify some code and prevent a ClassCastException from occuring

Modified Paths:
--------------
    gate/trunk/src/gate/persist/SerialDataStore.java

Modified: gate/trunk/src/gate/persist/SerialDataStore.java
===================================================================
--- gate/trunk/src/gate/persist/SerialDataStore.java    2011-11-04 15:06:32 UTC 
(rev 14494)
+++ gate/trunk/src/gate/persist/SerialDataStore.java    2011-11-04 15:45:07 UTC 
(rev 14495)
@@ -527,13 +527,12 @@
   /** Get a list of the names of LRs of a particular type that are present. */
   public List getLrNames(String lrType) throws PersistenceException {
     // the list of files storing LRs of this type; an array for the names
-    String[] lrFileNames = (String[]) getLrIds(lrType).toArray();
-    ArrayList lrNames = new ArrayList();
+    List<String> lrFileNames = getLrIds(lrType);
+    List<String> lrNames = new ArrayList<String>();
 
     // for each lr file name, munge its name and add to the lrNames list
-    for(int i = 0; i<lrFileNames.length; i++) {
-      String name = getLrName(lrFileNames[i]);
-      lrNames.add(name);
+    for(String fname : lrFileNames) {
+      lrNames.add(getLrName(fname));
     }
 
     return lrNames;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to