From 4da46e2dbc7f3a5b90ab930a8259d82cc017525b Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Fri, 16 Feb 2007 16:44:42 +0000 Subject: [PATCH] Merged V2.0 to HEAD svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5161 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5162 . - Word 2003 fix svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5167 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5168 . - .sh executable scripts git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5174 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/filesys/locking/FileLock.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/java/org/alfresco/filesys/locking/FileLock.java b/source/java/org/alfresco/filesys/locking/FileLock.java index e2e27b6d9c..509bb56276 100644 --- a/source/java/org/alfresco/filesys/locking/FileLock.java +++ b/source/java/org/alfresco/filesys/locking/FileLock.java @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * As a special exception to the terms and conditions of version 2.0 of * the GPL, you may redistribute this Program in connection with Free/Libre @@ -151,24 +151,24 @@ public class FileLock public final boolean hasOverlap(long offset, long len) { - // Check if the lock is for the whole file - - if (isWholeFile()) + // Check if the lock is for the whole file + + if ( isWholeFile()) return true; + + // Check if the locks overlap - // Check if the locks overlap - - long endOff = getOffset() + getLength(); - + long endOff = getOffset() + ( getLength() - 1); + if (getOffset() < offset && endOff < offset) return false; - endOff = offset + len; - - if (getOffset() > endOff) + endOff = offset + ( len - 1); + + if ( getOffset() > endOff) return false; - // Locks overlap + // Locks overlap return true; }