Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Перечислите все проблемы, которые вы видите в данном коде
- public abstract class Digest {
- private Map<byte[], byte[]> cache = new HashMap<byte[], byte[]>();
- public byte[] digest(byte[] input) {
- byte[] result = cache.get(input);
- if (result == null) {
- synchronized (cache) {
- result = cache.get(input);
- if (result == null) {
- result = doDigest(input);
- cache.put(input, result);
- }
- }
- }
- return result;
- }
- protected abstract byte[] doDigest(byte[] input);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement