Resolve ambiguity between descriptorFile and fileName when parsing descriptors

In 1.9.0 a new method getDescrptorFile was introduced. This actually can cause various problems and has some open design questions that should be answered in this ticket. (I'll attach a branch with a test demonstrating part of the problem.)

DescriptorParser has the new method (since 1.9.0):

public Iterable<Descriptor> parseDescriptors(byte[] rawDescriptorBytes,
    File descriptorFile, String fileName);

In addition to the problem demonstrated in the (to be attached) test this raises some questions:

  1. What should be done, if descriptorFile.getName() != fileName?
  2. What should be done, if descriptorFile != null && (null == fileName || fileName.isEmpty())?
  3. What should be done, if descriptorFile == null && null != fileName? 4a) What should be done, if descriptorFile == null && null != fileName && fileName.isEmpty()? 4b) What should be done, if descriptorFile == null && null == fileName?

The implementation of the solution should also have tests for each of the possible cases.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information