forked from I2P_Developers/i2p.i2p
Susimail, EdDSA: Convert Hashtable to HashMap
This commit is contained in:
@ -39,9 +39,10 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
@ -62,7 +63,7 @@ class MailCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final POP3MailBox mailbox;
|
private final POP3MailBox mailbox;
|
||||||
private final Hashtable<String, Mail> mails;
|
private final Map<String, Mail> mails;
|
||||||
private final PersistentMailCache disk;
|
private final PersistentMailCache disk;
|
||||||
private final I2PAppContext _context;
|
private final I2PAppContext _context;
|
||||||
private final Folder<String> folder;
|
private final Folder<String> folder;
|
||||||
@ -87,7 +88,7 @@ class MailCache {
|
|||||||
String host, int port, String user, String pass) throws IOException {
|
String host, int port, String user, String pass) throws IOException {
|
||||||
_log = ctx.logManager().getLog(MailCache.class);
|
_log = ctx.logManager().getLog(MailCache.class);
|
||||||
this.mailbox = mailbox;
|
this.mailbox = mailbox;
|
||||||
mails = new Hashtable<String, Mail>();
|
mails = new HashMap<String, Mail>();
|
||||||
disk = new PersistentMailCache(ctx, host, port, user, pass, folderName);
|
disk = new PersistentMailCache(ctx, host, port, user, pass, folderName);
|
||||||
_context = ctx;
|
_context = ctx;
|
||||||
Folder<String> folder = new Folder<String>();
|
Folder<String> folder = new Folder<String>();
|
||||||
@ -336,7 +337,7 @@ class MailCache {
|
|||||||
Mail mail = null, newMail = null;
|
Mail mail = null, newMail = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* synchronize update to hashtable
|
* synchronize update to Map
|
||||||
*/
|
*/
|
||||||
synchronized(mails) {
|
synchronized(mails) {
|
||||||
mail = mails.get( uidl );
|
mail = mails.get( uidl );
|
||||||
@ -421,7 +422,7 @@ class MailCache {
|
|||||||
boolean headerOnly = hOnly;
|
boolean headerOnly = hOnly;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* synchronize update to hashtable
|
* synchronize update to Map
|
||||||
*/
|
*/
|
||||||
synchronized(mails) {
|
synchronized(mails) {
|
||||||
mail = mails.get( uidl );
|
mail = mails.get( uidl );
|
||||||
|
@ -18,7 +18,6 @@ import java.io.OutputStream;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
|
@ -17,7 +17,8 @@ import java.security.KeyPair;
|
|||||||
import java.security.KeyPairGeneratorSpi;
|
import java.security.KeyPairGeneratorSpi;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.security.spec.AlgorithmParameterSpec;
|
import java.security.spec.AlgorithmParameterSpec;
|
||||||
import java.util.Hashtable;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.i2p.crypto.eddsa.spec.EdDSAGenParameterSpec;
|
import net.i2p.crypto.eddsa.spec.EdDSAGenParameterSpec;
|
||||||
import net.i2p.crypto.eddsa.spec.EdDSANamedCurveSpec;
|
import net.i2p.crypto.eddsa.spec.EdDSANamedCurveSpec;
|
||||||
@ -38,10 +39,10 @@ public class KeyPairGenerator extends KeyPairGeneratorSpi {
|
|||||||
protected SecureRandom random;
|
protected SecureRandom random;
|
||||||
protected boolean initialized;
|
protected boolean initialized;
|
||||||
|
|
||||||
private static final Hashtable<Integer, AlgorithmParameterSpec> edParameters;
|
private static final Map<Integer, AlgorithmParameterSpec> edParameters;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
edParameters = new Hashtable<Integer, AlgorithmParameterSpec>();
|
edParameters = new HashMap<Integer, AlgorithmParameterSpec>();
|
||||||
|
|
||||||
edParameters.put(Integer.valueOf(256), new EdDSAGenParameterSpec(EdDSANamedCurveTable.ED_25519));
|
edParameters.put(Integer.valueOf(256), new EdDSAGenParameterSpec(EdDSANamedCurveTable.ED_25519));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user