Skip to main content



      Home
Home » Modeling » EMF » Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputStream
Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputStream [message #1852504] Thu, 19 May 2022 03:33 Go to next message
Eclipse UserFriend
why is there a refresh call for out of sync files in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputStream
if the read is done outside of a workspace/resource lock holding thread this might lead to a wait for the workspace lock to be resolved.
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852507 is a reply to message #1852504] Thu, 19 May 2022 06:51 Go to previous messageGo to next message
Eclipse UserFriend
Because the subsequent call to org.eclipse.core.resources.IFile.setContents(InputStream, boolean, boolean, IProgressMonitor) throws CoreException if "The workspace is not in sync with the corresponding location in the local file system and <code>force </code> is <code>false</code where org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceOutputStream(String, Map<?, ?>) generally calls it with false.
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852508 is a reply to message #1852507] Thu, 19 May 2022 07:58 Go to previous messageGo to next message
Eclipse UserFriend
for output stream it is clear, i am asking on inputstream
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852513 is a reply to message #1852508] Thu, 19 May 2022 08:56 Go to previous messageGo to next message
Eclipse UserFriend
IFile.getContents() throws
	
	 * <li> {@link IResourceStatus#OUT_OF_SYNC_LOCAL} - The workspace is not in sync with
	 * 		 the corresponding location in the local file system (and
	 *       {@link ResourcesPlugin#PREF_LIGHTWEIGHT_AUTO_REFRESH} is disabled).</li>

And note that PREF_LIGHTWEIGHT_AUTO_REFRESH is @since 3.7 and this plugin has "org.eclipse.core.resources;bundle-version="[3.6.0,4.0.0)". We could still test the preference using the "refresh.lightweight.enabled" string to avoid the refresh call if that's helpful. But are you sure that's actually helpful or would it just move the problem to happen during the getContents call?
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852518 is a reply to message #1852513] Thu, 19 May 2022 14:22 Go to previous message
Eclipse UserFriend
thx. we will consider having our own variant of the handler
Previous Topic:xsd to Ecore: Trouble with xsd:Extension
Next Topic:Binary serialization to existing OutputStream
Goto Forum:
  


Current Time: Sat Aug 30 19:08:13 EDT 2025

Powered by FUDForum. Page generated in 0.04115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top