Replace boolean flag with enum, assert open vs. closed projection and update javadoc. Original Pull Request: #2420