'enum' is a keyword in jdk 1.5
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1447 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: CollectionUtil.java,v 1.6 2002/12/05 22:10:28 shaper Exp $
|
// $Id: CollectionUtil.java,v 1.7 2004/06/12 23:17:02 ray Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -35,10 +35,10 @@ public class CollectionUtil
|
|||||||
* Adds all items returned by the enumeration to the supplied
|
* Adds all items returned by the enumeration to the supplied
|
||||||
* collection and returns the supplied collection.
|
* collection and returns the supplied collection.
|
||||||
*/
|
*/
|
||||||
public static Collection addAll (Collection col, Enumeration enum)
|
public static Collection addAll (Collection col, Enumeration enm)
|
||||||
{
|
{
|
||||||
while (enum.hasMoreElements()) {
|
while (enm.hasMoreElements()) {
|
||||||
col.add(enum.nextElement());
|
col.add(enm.nextElement());
|
||||||
}
|
}
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ConfigUtil.java,v 1.12 2004/01/24 06:02:11 mdb Exp $
|
// $Id: ConfigUtil.java,v 1.13 2004/06/12 23:17:02 ray Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -283,15 +283,15 @@ public class ConfigUtil
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
// first look for the files in the supplied class loader
|
// first look for the files in the supplied class loader
|
||||||
Enumeration enum = getResources(path, loader);
|
Enumeration enm = getResources(path, loader);
|
||||||
if (!enum.hasMoreElements()) {
|
if (!enm.hasMoreElements()) {
|
||||||
// if we couldn't find anything there, try the system class
|
// if we couldn't find anything there, try the system class
|
||||||
// loader (but only if that's not where we were already
|
// loader (but only if that's not where we were already
|
||||||
// looking)
|
// looking)
|
||||||
try {
|
try {
|
||||||
ClassLoader sysloader = ClassLoader.getSystemClassLoader();
|
ClassLoader sysloader = ClassLoader.getSystemClassLoader();
|
||||||
if (sysloader != loader) {
|
if (sysloader != loader) {
|
||||||
enum = getResources(path, sysloader);
|
enm = getResources(path, sysloader);
|
||||||
}
|
}
|
||||||
} catch (AccessControlException ace) {
|
} catch (AccessControlException ace) {
|
||||||
// can't get the system loader, no problem!
|
// can't get the system loader, no problem!
|
||||||
@@ -300,8 +300,8 @@ public class ConfigUtil
|
|||||||
|
|
||||||
// stick the matches into an array list so that we can count them
|
// stick the matches into an array list so that we can count them
|
||||||
ArrayList rsrcs = new ArrayList();
|
ArrayList rsrcs = new ArrayList();
|
||||||
while (enum.hasMoreElements()) {
|
while (enm.hasMoreElements()) {
|
||||||
rsrcs.add(enum.nextElement());
|
rsrcs.add(enm.nextElement());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we found no resources in our enumerations, try loading the
|
// if we found no resources in our enumerations, try loading the
|
||||||
@@ -609,9 +609,9 @@ public class ConfigUtil
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// try the path as is
|
// try the path as is
|
||||||
Enumeration enum = loader.getResources(path);
|
Enumeration enm = loader.getResources(path);
|
||||||
if (enum.hasMoreElements()) {
|
if (enm.hasMoreElements()) {
|
||||||
return enum;
|
return enm;
|
||||||
}
|
}
|
||||||
// try toggling the leading slash
|
// try toggling the leading slash
|
||||||
return loader.getResources(togglePath(path));
|
return loader.getResources(togglePath(path));
|
||||||
|
|||||||
Reference in New Issue
Block a user