Skip to content

Commit

Permalink
JAMES-2251 Switch to HashMap
Browse files Browse the repository at this point in the history
Using a synchronized collection appears to be unnecessary.
  • Loading branch information
dtrebbien authored and aduprat committed Dec 12, 2017
1 parent 23b9690 commit 78b04fe
Showing 1 changed file with 4 additions and 9 deletions.
Expand Up @@ -22,11 +22,12 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.inject.Inject;
import javax.mail.Address;
Expand Down Expand Up @@ -60,8 +61,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.fge.lambdas.Throwing;
import com.github.fge.lambdas.consumers.ConsumerChainer;
import com.google.common.collect.ImmutableSet;

@SuppressWarnings("deprecation")
Expand All @@ -71,7 +70,7 @@ public class JamesMailetContext implements MailetContext, Configurable {
/**
* A hash table of server attributes These are the MailetContext attributes
*/
private final Hashtable<String, Object> attributes = new Hashtable<>();
private final Map<String, Object> attributes = new HashMap<>();
protected DNSService dns;

private UsersRepository localusers;
Expand Down Expand Up @@ -130,11 +129,7 @@ public void removeAttribute(String key) {

@Override
public Iterator<String> getAttributeNames() {
final List<String> names;
synchronized (attributes) {
names = new ArrayList<>(attributes.keySet());
}
return names.iterator();
return attributes.keySet().iterator();
}

/**
Expand Down

0 comments on commit 78b04fe

Please sign in to comment.