public static synchronized Atom findOrCreate(byte[] bytes) { if (bytes == null) { throw new IllegalArgumentException("bytes is null"); } AtomKey key = new AtomKey(bytes); Atom val = dictionary.get(key); if (val != null) { return val; } val = new Atom(key); dictionary.put(key, val); return val; }
public static synchronized Atom findOrCreate(byte[] bytes) { if (bytes == null) { throw new IllegalArgumentException("bytes is null"); } AtomKey key = new AtomKey(bytes); Atom val = dictionary.get(key); if (val != null) { return val; } val = new Atom(key); dictionary.put(key, val); return val; }