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
This commit is contained in:
Derek Hulley
2007-02-16 16:44:42 +00:00
parent b2037c66e2
commit 4da46e2dbc

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * 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 * 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 * 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) public final boolean hasOverlap(long offset, long len)
{ {
// Check if the lock is for the whole file // Check if the lock is for the whole file
if (isWholeFile()) if ( isWholeFile())
return true; return true;
// Check if the locks overlap
// Check if the locks overlap long endOff = getOffset() + ( getLength() - 1);
long endOff = getOffset() + getLength();
if (getOffset() < offset && endOff < offset) if (getOffset() < offset && endOff < offset)
return false; return false;
endOff = offset + len; endOff = offset + ( len - 1);
if (getOffset() > endOff) if ( getOffset() > endOff)
return false; return false;
// Locks overlap // Locks overlap
return true; return true;
} }