Uploaded image for project: 'Tamaya'
  1. Tamaya
  2. TAMAYA-198

tamaya-formats blindly tries (and failes) to parse a config file with multiple formats

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3-incubating
    • 0.3-incubating
    • Extensions
    • None

    Description

      BaseFormatPropertySourceProvider can handle multiple formats registered. This is useful in my project because we actually support multiple formats for a certain type of config file and this way we can implement one Provider which can provide PropertySources for all of them.

      But getPropertySources() will

      1. blindly try all files with all formats. E.g. if both, "properties" and "ini" formats are registered, it will try all files with both formats without checking format.accepts() first.
      2. try all the formats with the same InputStream. If the previous format does not reset the input stream, it is already at the end of the file and the following formats don't have anything left to read, returning null. This leads to some {{NullPointerException}}s being logged.

      Attachments

        1. TAMAYA-198.patch
          4 kB
          Thomas Liebetraut

        Activity

          People

            anatole Anatole Tresch
            tommie-lie Thomas Liebetraut
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: