You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Stuart Roe (JIRA)" <se...@james.apache.org> on 2005/01/10 14:37:12 UTC
[jira] Commented: (JAMES-237) J2 1.5'enum' is a keyword
[ http://issues.apache.org/jira/browse/JAMES-237?page=comments#action_57469 ]
Stuart Roe commented on JAMES-237:
----------------------------------
Here is a patch that changes the 'enum' variables to 'enumeration', thus allowing the code to compile with the JDK1.5.
--- src/java/org/apache/james/fetchmail/MessageProcessor.java (revision 123091)
+++ src/java/org/apache/james/fetchmail/MessageProcessor.java (working copy)
@@ -842,13 +842,13 @@
*/
protected boolean isBouncing() throws MessagingException
{
- Enumeration enum =
+ Enumeration enumeration =
getMessageIn().getMatchingHeaderLines(
new String[] { "X-fetched-from" });
int count = 0;
- while (enum.hasMoreElements())
+ while (enumeration.hasMoreElements())
{
- String header = (String) enum.nextElement();
+ String header = (String) enumeration.nextElement();
if (header.equals(getFetchTaskName()))
count++;
}
@@ -901,11 +901,11 @@
{
try
{
- Enumeration enum =
+ Enumeration enumeration =
msg.getMatchingHeaderLines(new String[] { "Received" });
- while (enum.hasMoreElements())
+ while (enumeration.hasMoreElements())
{
- String received = (String) enum.nextElement();
+ String received = (String) enumeration.nextElement();
int nextSearchAt = 0;
int i = 0;
--- src/java/org/apache/james/nntpserver/repository/ArticleIDRepository.java (revision 123091)
+++ src/java/org/apache/james/nntpserver/repository/ArticleIDRepository.java (working copy)
@@ -153,10 +153,10 @@
} finally {
IOUtil.shutdownStream(fin);
}
- Enumeration enum = prop.keys();
+ Enumeration enumeration = prop.keys();
NNTPArticle article = null;
- while ( article == null && enum.hasMoreElements() ) {
- String groupName = (String)enum.nextElement();
+ while ( article == null && enumeration.hasMoreElements() ) {
+ String groupName = (String)enumeration.nextElement();
int number = Integer.parseInt(prop.getProperty(groupName));
NNTPGroup group = repo.getGroup(groupName);
if ( group != null ) {
--- src/java/org/apache/james/fetchpop/FetchPOP.java (revision 123091)
+++ src/java/org/apache/james/fetchpop/FetchPOP.java (working copy)
@@ -102,9 +102,9 @@
getLogger().error("can't create message out of fetched message "+messages[i].identifier);
}
}
- Enumeration enum = received.elements();
- while (enum.hasMoreElements()) {
- POP3MessageInfo element = (POP3MessageInfo) enum.nextElement();
+ Enumeration enumeration = received.elements();
+ while (enumeration.hasMoreElements()) {
+ POP3MessageInfo element = (POP3MessageInfo) enumeration.nextElement();
pop.deleteMessage(element.number);
if (getLogger().isDebugEnabled()) {
getLogger().debug("Delete:" + pop.getReplyString());
--- src/java/org/apache/james/userrepository/UsersLDAPRepository.java (revision 123091)
+++ src/java/org/apache/james/userrepository/UsersLDAPRepository.java (working copy)
@@ -248,9 +248,9 @@
Attribute members
= ctx.getAttributes("", attrIDs).get(membersAttr);
if (members != null) {
- NamingEnumeration enum = members.getAll();
- while (enum.hasMore()) {
- result.add((String)enum.next());
+ NamingEnumeration enumeration = members.getAll();
+ while (enumeration.hasMore()) {
+ result.add((String)enumeration.next());
}
}
} catch (NamingException e) {
@@ -388,10 +388,10 @@
.append(usersDomain);
String filter = filterBuffer.toString();
- NamingEnumeration enum = rootCtx.search("", filter, ctls);
+ NamingEnumeration enumeration = rootCtx.search("", filter, ctls);
- if (enum.hasMore()) { // ie User is in Directory
- SearchResult newSr = (SearchResult)enum.next();
+ if (enumeration.hasMore()) { // ie User is in Directory
+ SearchResult newSr = (SearchResult)enumeration.next();
String userDN = newSr.getName();
Attribute servers = rootCtx.getAttributes(userDN, returnAttrs).get(groupAttr);
@@ -515,10 +515,10 @@
.append(usersDomain);
String filter = filterBuffer.toString();
- NamingEnumeration enum = rootCtx.search("", filter, ctls);
+ NamingEnumeration enumeration = rootCtx.search("", filter, ctls);
- if (enum.hasMore()) { // ie User is in Directory
- SearchResult newSr = (SearchResult)enum.next();
+ if (enumeration.hasMore()) { // ie User is in Directory
+ SearchResult newSr = (SearchResult)enumeration.next();
String userDN = newSr.getName();
System.out.println("Found user entry: " + userDN);
@@ -639,9 +639,9 @@
try {
rootCtx = new InitialDirContext(env);
- NamingEnumeration enum = rootCtx.search("", filter, ctls);
- if (enum.hasMore()) { // ie User is in Directory
- SearchResult sr = (SearchResult)enum.next();
+ NamingEnumeration enumeration = rootCtx.search("", filter, ctls);
+ if (enumeration.hasMore()) { // ie User is in Directory
+ SearchResult sr = (SearchResult)enumeration.next();
String userRDN = sr.getName();
StringBuffer userDNBuffer =
new StringBuffer(128)
> J2 1.5'enum' is a keyword
> -------------------------
>
> Key: JAMES-237
> URL: http://issues.apache.org/jira/browse/JAMES-237
> Project: James
> Type: Bug
> Components: James Core
> Environment: James CVS, J2 1.5
> Reporter: Fredrik Hedberg
> Priority: Trivial
>
> As of J2 1.5 'enum' is a keyword, several files affected in a lot of modules.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org