cziegeler commented on code in PR #69:
URL:
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/69#discussion_r883459002
##########
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##########
@@ -1077,25 +1077,30 @@ private void gather(final ResourceResolver resolver,
final List<MapEntry> entrie
*/
private boolean addEntry(final Map<String, List<MapEntry>> entryMap, final
String key, final MapEntry entry) {
- if (entry==null){
+ if (entry == null) {
+ log.trace("trying to add null entry for {}", key);
return false;
- }
-
- List<MapEntry> entries = entryMap.get(key);
- if (entries == null) {
- entries = new ArrayList<>();
- entries.add(entry);
- // and finally sort list
- Collections.sort(entries);
- entryMap.put(key, entries);
} else {
Review Comment:
When entry is null, the return statement will be executed. So no need to do
a "else" here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]