eclipse-sourceediting / sourceediting

Code repository for the Eclipse Web Tools Platform's Source Editing project
Eclipse Public License 2.0
6 stars 6 forks source link

FileBufferModelManager.detectContentType reports a FileNotFoundException #4

Closed jansems closed 8 months ago

jansems commented 8 months ago

See: https://github.com/eclipse-sourceediting/sourceediting/blame/ace69bc17f39220a3b7652576363e3bcffdfe38b/core/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java#L596

The fileStore.openInputStream throws a CoreException when a FileNotFoundException occurs. The CoreException is then logged.

Hence: issue eclipse-platform #147: https://github.com/eclipse-sourceediting/sourceediting/commit/fac0aa24a44eb667ce3697c7b32718b9cb72abe8

these type of exceptions are meant to be ignored.

This happens in version: org.eclipse.wst.sse.core: 1.2.1200.v202308180854

reproducible when trying to connect a TextFileDocumentProvider to a non-exisitng file like: `IFile fileToLoad = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/myproject/test.xml"));

    IDocumentProvider provider = new TextFileDocumentProvider();
    try {
        provider.connect(fileToLoad);
    } catch (CoreException e) {
        e.printStackTrace();
    } finally {
        provider.disconnect(fileToLoad);
    }`
nitind commented 8 months ago

Chnaged, thanks!

jansems commented 8 months ago

Thank you for fixing this!