Skip to content

Location NPE fix#12

Merged
sbesson merged 7 commits intoome:masterfrom
dgault:Location-NPE-fix
Aug 10, 2017
Merged

Location NPE fix#12
sbesson merged 7 commits intoome:masterfrom
dgault:Location-NPE-fix

Conversation

@dgault
Copy link
Copy Markdown
Member

@dgault dgault commented Aug 1, 2017

Issue was raised on the mailing list: http://lists.openmicroscopy.org.uk/pipermail/ome-users/2017-July/006557.html

From discussions since then it was decided to adapt the same contract as used in https://docs.oracle.com/javase/8/docs/api/java/io/File.html#getParentFile-- and return null if the parent does not exist rather than throwing a NullPointerException

To test:

  • Ensure builds and tests are all green

@sbesson
Copy link
Copy Markdown
Member

sbesson commented Aug 7, 2017

Closing/reopening to include #13 in the Travis build

@sbesson sbesson closed this Aug 7, 2017
@sbesson sbesson reopened this Aug 7, 2017
@sbesson
Copy link
Copy Markdown
Member

sbesson commented Aug 7, 2017

With the last fix, the tests now fail with

testParentNull(loci.common.utests.LocationTest)  Time elapsed: 0.007 sec  <<< FAILURE!
java.lang.AssertionError: nullParentFile expected:<null> but was:<null>
	at loci.common.utests.LocationTest.testParentNull(LocationTest.java:182)

@sbesson
Copy link
Copy Markdown
Member

sbesson commented Aug 10, 2017

With the last commits, the tests passes and the behavior of Location matches the contract of java.io.File for the constructors and getParentFile. All makes sense to me. Only nitpicky comment before releasing is that I would like to review the Javadoc to make sure java.io.File is correctly referenced. I will try to open a Javadoc-only PR before cutting ome-common:5.3.3

@sbesson sbesson merged commit 9756c3f into ome:master Aug 10, 2017
@sbesson sbesson mentioned this pull request Aug 10, 2017
@sbesson sbesson added this to the 5.4.0 milestone Sep 21, 2017
@sbesson sbesson mentioned this pull request Oct 12, 2018
@sbesson sbesson mentioned this pull request Jan 14, 2019
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.

2 participants