Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputStream
Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputStream [message #1852504] Thu, 19 May 2022 07:33 Go to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14582
Registered: July 2009
Senior Member
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.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852507 is a reply to message #1852504] Thu, 19 May 2022 10:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32985
Registered: July 2009
Senior Member
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.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852508 is a reply to message #1852507] Thu, 19 May 2022 11:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14582
Registered: July 2009
Senior Member
for output stream it is clear, i am asking on inputstream

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852513 is a reply to message #1852508] Thu, 19 May 2022 12:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32985
Registered: July 2009
Senior Member
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?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Why refresh call in PlatformResourceURIHandlerImpl.WorkbenchHelper.createPlatformResourceInputSt [message #1852518 is a reply to message #1852513] Thu, 19 May 2022 18:22 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14582
Registered: July 2009
Senior Member
thx. we will consider having our own variant of the handler

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:xsd to Ecore: Trouble with xsd:Extension
Next Topic:Binary serialization to existing OutputStream
Goto Forum:
  


Current Time: Sat Nov 11 09:23:16 GMT 2023

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

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

Back to the top