vyommani commented on code in PR #801:
URL: https://github.com/apache/ranger/pull/801#discussion_r2685200894
##########
agents-common/src/main/java/org/apache/ranger/authorization/utils/JsonUtils.java:
##########
@@ -47,235 +46,228 @@
public class JsonUtils {
private static final Logger LOG = LoggerFactory.getLogger(JsonUtils.class);
- private static final TypeReference TYPE_MAP_STRING_STRING =
new TypeReference<Map<String, String>>() {};
- private static final TypeReference TYPE_SET_STRING =
new TypeReference<Set<String>>() {};
- private static final TypeReference TYPE_LIST_STRING =
new TypeReference<List<String>>() {};
- private static final TypeReference TYPE_LIST_RANGER_VALIDITY_SCHEDULE =
new TypeReference<List<RangerValiditySchedule>>() {};
- private static final TypeReference TYPE_LIST_AUDIT_FILTER =
new TypeReference<List<AuditFilter>>() {};
- private static final TypeReference TYPE_LIST_RANGER_VALIDITY_RECURRENCE =
new TypeReference<List<RangerValidityRecurrence>>() {};
- private static final TypeReference TYPE_LIST_RANGER_PRINCIPAL =
new TypeReference<List<RangerPrincipal>>() {};
- private static final TypeReference TYPE_MAP_RANGER_MASK_INFO =
new TypeReference<Map<String, RangerPolicyItemDataMaskInfo>>() {};
- private static final TypeReference TYPE_MAP_RANGER_POLICY_RESOURCE =
new TypeReference<Map<String, RangerPolicyResource>>() {};
- private static final TypeReference TYPE_LIST_RANGER_TAG =
new TypeReference<List<RangerTag>>() {};
-
- static private final ThreadLocal<ObjectMapper> MAPPER = new
ThreadLocal<ObjectMapper>() {
- @Override
- protected ObjectMapper initialValue() {
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.setDateFormat(new
SimpleDateFormat("yyyyMMdd-HH:mm:ss.SSS-Z"));
- objectMapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES,
true);
- objectMapper.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
- return objectMapper;
- }
- };
+ private static final TypeReference<Map<String, String>>
TYPE_MAP_STRING_STRING = new TypeReference<Map<String,
String>>() {};
Review Comment:
Java 8 (still supported by Ranger) does not allow diamond operator (<>) with
anonymous inner classes → current code is intentional i think.
--
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]