Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 121977 Details for
Bug 260416
multiple attempts at locking a Location cause release not to work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed fix
260416.txt (text/plain), 2.84 KB, created by
Thomas Watson
on 2009-01-08 11:43:58 EST
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2009-01-08 11:43:58 EST
Size:
2.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.osgi.tests >Index: src/org/eclipse/osgi/tests/services/datalocation/BasicLocationTests.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/BasicLocationTests.java,v >retrieving revision 1.7 >diff -u -r1.7 BasicLocationTests.java >--- src/org/eclipse/osgi/tests/services/datalocation/BasicLocationTests.java 7 Jan 2009 20:35:50 -0000 1.7 >+++ src/org/eclipse/osgi/tests/services/datalocation/BasicLocationTests.java 8 Jan 2009 16:42:44 -0000 >@@ -148,6 +148,33 @@ > } > } > >+ public void testCreateLocation05() { >+ Location configLocation = LocationManager.getConfigurationLocation(); >+ File testLocationFile = OSGiTestsActivator.getContext().getDataFile("testLocations/testCreateLocation01"); >+ Location testLocation = configLocation.createLocation(null, null, false); >+ try { >+ testLocation.set(testLocationFile.toURL(), false); >+ } catch (Throwable t) { >+ fail("Failed to set location", t); >+ } >+ try { >+ assertTrue("Could not lock location", testLocation.lock()); >+ assertFalse("Could lock a secend time", testLocation.lock()); >+ assertFalse("Could lock a third time", testLocation.lock()); >+ } catch (IOException e) { >+ fail("Failed to lock location", e); >+ } finally { >+ testLocation.release(); >+ } >+ try { >+ assertTrue("Could not lock location", testLocation.lock()); >+ } catch (IOException e) { >+ fail("Failed to lock location", e); >+ } finally { >+ testLocation.release(); >+ } >+ } >+ > public void testSetLocationWithEmptyLockFile() { > Location configLocation = LocationManager.getConfigurationLocation(); > File testLocationFile = OSGiTestsActivator.getContext().getDataFile("testLocations/testSetLocationWithEmptyLockFile"); //$NON-NLS-1$ >#P org.eclipse.osgi >Index: supplement/src/org/eclipse/core/runtime/internal/adaptor/BasicLocation.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/supplement/src/org/eclipse/core/runtime/internal/adaptor/BasicLocation.java,v >retrieving revision 1.8 >diff -u -r1.8 BasicLocation.java >--- supplement/src/org/eclipse/core/runtime/internal/adaptor/BasicLocation.java 7 Jan 2009 20:35:52 -0000 1.8 >+++ supplement/src/org/eclipse/core/runtime/internal/adaptor/BasicLocation.java 8 Jan 2009 16:42:45 -0000 >@@ -190,7 +190,8 @@ > throw new IOException(NLS.bind(EclipseAdaptorMsg.location_notFileProtocol, locationValue)); > throw new IllegalStateException(EclipseAdaptorMsg.location_noLockFile); // this is really unexpected > } >- >+ if (isLocked()) >+ return false; > File parentFile = new File(lock.getParent()); > if (!parentFile.exists()) > if (!parentFile.mkdirs())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 260416
: 121977