Karaf
  1. Karaf
  2. KARAF-643

KarArtifactInstaller::init has incorrect warning logic

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.2.1
    • Fix Version/s: 2.2.9, 2.3.0
    • Component/s: karaf-kar
    • Labels:
      None
    • Environment:

      Ubuntu Linux (though I believe the issue affects all platforms).

      Description

      KarArtifactInstaller.java has the following block:
      if (new File(timestampPath).mkdirs())

      { logger.warn("Unable to create directory for Karaf Archive timestamps. Results may vary..."); }

      which looks as though it's missing a !
      mkdirs returns true if and only if the directory was created, along with all necessary parent directories; false otherwise.

      1. karaf-643.txt
        0.7 kB
        Michael Van Geertruy

        Activity

        Hide
        Freeman Fang added a comment -

        commit fix per Chris Dolan's suggestion
        http://svn.apache.org/viewvc?rev=1372227&view=rev for 2.3.x branch
        http://svn.apache.org/viewvc?rev=1372221&view=rev for 2.2.x branch

        Show
        Freeman Fang added a comment - commit fix per Chris Dolan's suggestion http://svn.apache.org/viewvc?rev=1372227&view=rev for 2.3.x branch http://svn.apache.org/viewvc?rev=1372221&view=rev for 2.2.x branch
        Hide
        Freeman Fang added a comment -

        Hi,

        Yeah, we should take Chris's approach here.

        Freeman

        Show
        Freeman Fang added a comment - Hi, Yeah, we should take Chris's approach here. Freeman
        Hide
        Martin Lichtin added a comment -

        +1 The warning is definitely confusing:

        2012-08-10 12:28:42,579 | WARN | rint Extender: 1 | KarArtifactInstaller | 33 - org.apache.karaf.deployer.kar - 2.2.8 | Unable to create directory for Karaf Archive timestamps. Results may vary...
        2012-08-10 12:28:42,579 | INFO | rint Extender: 1 | KarArtifactInstaller | 33 - org.apache.karaf.deployer.kar - 2.2.8 | Karaf archives will be extracted to C:\Users\mli\nuc\sandbox\master\transaction\tx-reference\tx-ref-itests\target\paxexam\f8026a21-3205-4ac6-bb9a-22957e54dca1/system
        2012-08-10 12:28:42,579 | INFO | rint Extender: 1 | KarArtifactInstaller | 33 - org.apache.karaf.deployer.kar - 2.2.8 | Timestamps for Karaf archives will be extracted to C:\Users\mli\nuc\sandbox\master\transaction\tx-reference\tx-ref-itests\target\paxexam\f8026a21-3205-4ac6-bb9a-22957e54dca1/system\.timestamps

        Show
        Martin Lichtin added a comment - +1 The warning is definitely confusing: 2012-08-10 12:28:42,579 | WARN | rint Extender: 1 | KarArtifactInstaller | 33 - org.apache.karaf.deployer.kar - 2.2.8 | Unable to create directory for Karaf Archive timestamps. Results may vary... 2012-08-10 12:28:42,579 | INFO | rint Extender: 1 | KarArtifactInstaller | 33 - org.apache.karaf.deployer.kar - 2.2.8 | Karaf archives will be extracted to C:\Users\mli\nuc\sandbox\master\transaction\tx-reference\tx-ref-itests\target\paxexam\f8026a21-3205-4ac6-bb9a-22957e54dca1/system 2012-08-10 12:28:42,579 | INFO | rint Extender: 1 | KarArtifactInstaller | 33 - org.apache.karaf.deployer.kar - 2.2.8 | Timestamps for Karaf archives will be extracted to C:\Users\mli\nuc\sandbox\master\transaction\tx-reference\tx-ref-itests\target\paxexam\f8026a21-3205-4ac6-bb9a-22957e54dca1/system\.timestamps
        Hide
        Chris Dolan added a comment -

        The patch should be "(!file.exists() && !file.mkdirs())" because mkdirs returns false if the folder already exists.

        Show
        Chris Dolan added a comment - The patch should be "(!file.exists() && !file.mkdirs())" because mkdirs returns false if the folder already exists.
        Hide
        Michael Van Geertruy added a comment -

        Patch for this bug.

        Show
        Michael Van Geertruy added a comment - Patch for this bug.

          People

          • Assignee:
            Freeman Fang
            Reporter:
            Yaytay
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development