Camel
  1. Camel
  2. CAMEL-4265

Fail to close stream in DefaultPropertiesResolver

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.3, 2.8.0
    • Fix Version/s: 2.8.1, 2.9.0
    • Component/s: camel-core
    • Labels:
      None
    • Environment:

      Any

      Description

      protected Properties loadPropertiesFromFilePath(CamelContext context, String path) throws IOException {
      if (path.startsWith("file:"))

      { path = ObjectHelper.after(path, "file:"); }

      InputStream is = new FileInputStream(path);
      Properties answer = new Properties();
      answer.load(is);
      return answer;
      }

      Stream not closed before return, as well as in another method: loadPropertiesFromClasspath.

      1. close_inputstream.patch
        1 kB
        edge wang
      2. close_inputstream.patch
        1 kB
        edge wang

        Activity

        Hide
        edge wang added a comment -

        ok, thanks.

        Show
        edge wang added a comment - ok, thanks.
        Hide
        Claus Ibsen added a comment -

        When we are to cut a 2.8.1 release, we will look at all the bugs fixed for Camel 2.9 and backport the bugs that can be done and make sense. I am sure this bug will be backported. So just have patience.

        Show
        Claus Ibsen added a comment - When we are to cut a 2.8.1 release, we will look at all the bugs fixed for Camel 2.9 and backport the bugs that can be done and make sense. I am sure this bug will be backported. So just have patience.
        Hide
        Claus Ibsen added a comment -

        Please dont change the fix versions as its only committers who does this, when he commits/backports.

        Show
        Claus Ibsen added a comment - Please dont change the fix versions as its only committers who does this, when he commits/backports.
        Hide
        edge wang added a comment -

        Can I modify it's fixed version, to add 2.8.1?

        Show
        edge wang added a comment - Can I modify it's fixed version, to add 2.8.1?
        Hide
        Claus Ibsen added a comment -

        Thanks for the patch.

        I polished it a bit to use IOHelper to close the resource.

        Show
        Claus Ibsen added a comment - Thanks for the patch. I polished it a bit to use IOHelper to close the resource.
        Hide
        edge wang added a comment -

        Didn't notice the license choice, this time would be ok.

        Show
        edge wang added a comment - Didn't notice the license choice, this time would be ok.
        Hide
        Claus Ibsen added a comment -

        Edge, can you re-attach the patch and make sure to grant license to Apache. We cannot accept patches without the license.

        Show
        Claus Ibsen added a comment - Edge, can you re-attach the patch and make sure to grant license to Apache. We cannot accept patches without the license.
        Hide
        edge wang added a comment -

        I attached a file, hope it's in needed format.

        No test case could be provided since it is a simple close operation surrounded by try ... finally.

        Show
        edge wang added a comment - I attached a file, hope it's in needed format. No test case could be provided since it is a simple close operation surrounded by try ... finally.
        Hide
        Claus Ibsen added a comment -

        Thanks for reporting. Do you want to try to provide a patch to fix this?

        See more details here
        http://camel.apache.org/contributing.html

        Show
        Claus Ibsen added a comment - Thanks for reporting. Do you want to try to provide a patch to fix this? See more details here http://camel.apache.org/contributing.html

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            edge wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development