Skip to content

Conversation

@SethSmucker
Copy link
Collaborator

Replace several straightforward deprecated calls with their suggested replacements.

part of NationalSecurityAgency/datawave#2443

@SethSmucker SethSmucker self-assigned this Sep 24, 2024

protected List<SubjectIssuerDNPair> getSubjectIssuerDNPairs(String proxiedSubjects, String proxiedIssuers) {
if (StringUtils.isEmpty(proxiedSubjects)) {
if (ObjectUtils.isEmpty(proxiedSubjects)) {
Copy link
Collaborator

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)

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) {
Copy link
Collaborator

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.

} catch (InstantiationException | IllegalAccessException e) {
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException e) {
throw new HttpMessageNotReadableException("Unable to read protostuff message: " + e.getMessage(), e, inputMessage);
} catch (InvocationTargetException e) {
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants