Ok, you are right, you do need the additional condition for checking the underlying project is opened. The reason why that is needed is that we are calling ``IJavaElement.exists``, not ``IResource.exists``.

About using ``Try`` or ``Option``,  I've mixed feelings - I can elaborate on those if you'd like me to do so. But for the moment I'd go for an ``Option``.