I think indexOf(".") in these code should be lastIndexOf(".").
From CATALOG -> Image Management -> Upload view. upload some Images it will call this method. This method is intended to add (count) to the image name, when the file name was already exist. I debugged in it, the imagePath was the absolute path of the image file. So If any parent folder name contains "." , it will not works correctly.
chunlinyao's Note: And after review the whole ImageManagementServices.java file. I found it use static variables (ex. imageCount imagePath). It is not thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1604554 13f79535-47bb-0310-9956-ffa450edef68