You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/11/20 16:44:53 UTC
[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #3295: ARTEMIS-2931: Resolving potential NPEs detected by eclipse
michaelandrepearce commented on a change in pull request #3295:
URL: https://github.com/apache/activemq-artemis/pull/3295#discussion_r527818573
##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
##########
@@ -565,11 +565,12 @@ public boolean checkPageFileExists(final int pageNumber) {
SequentialFileFactory factory = null;
try {
factory = checkFileFactory();
+ SequentialFile file = factory.createSequentialFile(fileName);
+ return file.exists();
} catch (Exception ignored) {
+ assert false : "PagingStoreFactory::newFileFactory never-throws assumption failed.";
Review comment:
I agree with @jbertram having assert and rasing errors is not nice. Its much cleaner to return boolean with true false if it was successful
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org