Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1289

FileCacheStore: skip unnecessary stream creation if file is empty

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 5.0.0.FINAL
    • 5.0.0.CR8
    • Loaders and Stores
    • None

      The method FileCacheStore.loadBucket() does not need to call "new FileInputStream()", when the file is empty (length==0).
      So it might be better to add the following lines before the call to "new FileInputStream(bucketFile)":

      // BEGIN: new stuff
      if (bucketFile.length()==0)
      return null;
      // END: new stuff

            manik_jira Manik Surtani (Inactive)
            snazy0 Robert Stupp (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: