-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Deprecated Calls #21
base: main
Are you sure you want to change the base?
Conversation
@@ -127,7 +128,7 @@ protected boolean principalChanged(HttpServletRequest request, Authentication cu | |||
} | |||
|
|||
protected List<SubjectIssuerDNPair> getSubjectIssuerDNPairs(String proxiedSubjects, String proxiedIssuers) { | |||
if (StringUtils.isEmpty(proxiedSubjects)) { | |||
if (ObjectUtils.isEmpty(proxiedSubjects)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this method has overhead as it has to do isInstanceOf checks. I would prefer to use !StringUtils.hasLength(proxiedSubjects)
ScheduledReporter reporter = factory.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS) | ||
.build(configProps.getHost(), configProps.getPort()); | ||
registerReporter(reporter).start(configProps.getInterval(), configProps.getIntervalUnit()); | ||
} catch (InstantiationException | IllegalAccessException e) { | ||
throw new RuntimeException("Unable to instantiate metrics reporter factory class " + configProps.getFactoryClass() + ": " + e.getMessage(), e); | ||
} catch (InvocationTargetException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could have simply added these addition exceptions to the previous catch clause.
throw new HttpMessageNotReadableException("Unable to read protostuff message: " + e.getMessage(), e, inputMessage); | ||
} catch (InvocationTargetException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer adding this exception to the previous clause instead.
Replace several straightforward deprecated calls with their suggested replacements.
part of NationalSecurityAgency/datawave#2443