Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ private X509Certificate generateExpiredCert(String dn,
KeyPair pair, String algorithm) throws CertificateException,
IllegalStateException, IOException, OperatorCreationException {
Date from = new Date();
Date to = new Date(from.getTime() + 100L);
Date to = from;
return generateTestCert(dn, pair, algorithm, from, to);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can directly pass from instead of to in generateTestCert
something like - generateTestCert(dn, pair, algorithm, from, from);
no need to have
Date to = from;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I think it may be more readable to keep the fields of "from" and "to"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability better to add a comment explaining why we are passing from for both arguments.
Though trivial assigning unnecessary would have cost and isn't a good practice IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Have added a comment for readability.

}

Expand Down