jbonofre commented on code in PR #3376:
URL: https://github.com/apache/avro/pull/3376#discussion_r2084516382
##########
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java:
##########
@@ -128,31 +150,43 @@ private boolean trustAllPackages() {
return (trustedPackages.size() == 1 && "*".equals(trustedPackages.get(0)));
}
- private void checkSecurity(Class clazz) throws ClassNotFoundException {
- if (trustAllPackages() || clazz.isPrimitive()) {
+ private void checkSecurity(String className) throws ClassNotFoundException {
+ if (trustAllPackages() || PRIMITIVES.contains(className)) {
return;
}
+ for (String trustedClass : getTrustedClasses()) {
+ if (className.equals(trustedClass)) {
+ return;
+ }
+ }
+
boolean found = false;
Review Comment:
That's right, it's "old code keep". That's for pointing out, let me clean
this.
--
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]