Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Implemented
-
None
Description
Conversion is unnecessary:
OMRequest validatedRequest = request.toBuilder().build();
Default value can be created lazily (only if not found in map):
private <K, V> V getAndInitialize(K key, V defaultValue, Map<K, V> from) { V inMapValue = from.get(key); if (inMapValue == null || !from.containsKey(key)) { from.put(key, defaultValue); return defaultValue; } return inMapValue; }
Attachments
Issue Links
- links to