JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.64k stars 2.59k forks source link

Exception when trying to change a linked file's path (being an URL) #11020

Open ror3d opened 8 months ago

ror3d commented 8 months ago

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build (copy version output from About dialog)

Steps to reproduce the behaviour

  1. Use the jabref extension to download any article (for example https://arxiv.org/abs/2304.04088 )
  2. Have the checkbox "Download linked online files" unchecked
  3. Go to the General tab for the entry
  4. Right-click one of the file entries and select Edit
  5. Click on the folder icon next to the Link entry "Browse"
  6. Notice an exception is thrown when the online url is attempted to be opened as a directory

Expected result Clicking on the folder icon to browse for a new file when the existing text is an online URL should open the file browser in the library's default data directory.

Appendix

@TechReport{Belhe.Xu.eaImportanceSamplingBRDF2023, author = {Belhe, Yash and Xu, Bing and Bangaru, Sai Praveen and Ramamoorthi, Ravi and Li, Tzu-Mao}, title = {Importance {Sampling} {BRDF} {Derivatives}}, year = {2023}, month = apr, note = {arXiv:2304.04088 [cs] type: article}, abstract = {We propose a set of techniques to efficiently importance sample the derivatives of several BRDF models. In differentiable rendering, BRDFs are replaced by their differential BRDF counterparts which are real-valued and can have negative values. This leads to a new source of variance arising from their change in sign. Real-valued functions cannot be perfectly importance sampled by a positive-valued PDF and the direct application of BRDF sampling leads to high variance. Previous attempts at antithetic sampling only addressed the derivative with the roughness parameter of isotropic microfacet BRDFs. Our work generalizes BRDF derivative sampling to anisotropic microfacet models, mixture BRDFs, Oren-Nayar, Hanrahan-Krueger, among other analytic BRDFs. Our method first decomposes the real-valued differential BRDF into a sum of single-signed functions, eliminating variance from a change in sign. Next, we importance sample each of the resulting single-signed functions separately. The first decomposition, positivization, partitions the real-valued function based on its sign, and is effective at variance reduction when applicable. However, it requires analytic knowledge of the roots of the differential BRDF, and for it to be analytically integrable too. Our key insight is that the single-signed functions can have overlapping support, which significantly broadens the ways we can decompose a real-valued function. Our product and mixture decompositions exploit this property, and they allow us to support several BRDF derivatives that positivization could not handle. For a wide variety of BRDF derivatives, our method significantly reduces the variance (up to 58x in some cases) at equal computation cost and enables better recovery of spatially varying textures through gradient-descent-based inverse rendering.}, creationdate = {2024-03-13T16:54:08}, doi = {10.48550/arXiv.2304.04088}, file = {arXiv Fulltext PDF:https\://arxiv.org/pdf/2304.04088.pdf:application/pdf;arXiv.org Snapshot:http\://arxiv.org/abs/2304.04088:text/html}, keywords = {Computer Science - Graphics}, modificationdate = {2024-03-13T16:54:08}, owner = {Roc}, school = {arXiv}, url = {http://arxiv.org/abs/2304.04088}, urldate = {2024-03-13}, }

Siedlerchr commented 8 months ago

In the latest dev version I don't get any exception https://builds.jabref.org/main/ Opening the folder works fine and I can replae it with a local file.

ror3d commented 8 months ago

I'm using the version open from intellij as downloaded from the main branch a couple hours ago.

image image image image

These are the exeption details:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at javafx.fxml@21.0.2/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1858)
    at javafx.fxml@21.0.2/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1726)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics@21.0.2/javafx.scene.Node.fireEvent(Node.java:8875)
    at javafx.controls@21.0.2/javafx.scene.control.Button.fire(Button.java:203)
    at javafx.controls@21.0.2/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
    at javafx.controls@21.0.2/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics@21.0.2/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
    at javafx.graphics@21.0.2/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
    at javafx.graphics@21.0.2/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
    at javafx.graphics@21.0.2/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
    at javafx.graphics@21.0.2/com.sun.glass.ui.View.notifyMouse(View.java:937)
    at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
    at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:212)
    at javafx.graphics@21.0.2/com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:515)
    at javafx.graphics@21.0.2/com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:650)
    at javafx.graphics@21.0.2/javafx.stage.Stage.showAndWait(Stage.java:469)
    at javafx.controls@21.0.2/javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
    at javafx.controls@21.0.2/javafx.scene.control.Dialog.showAndWait(Dialog.java:346)
    at org.jabref@100.0.0/org.jabref.gui.JabRefDialogService.showCustomDialogAndWait(JabRefDialogService.java:289)
    at org.jabref@100.0.0/org.jabref.gui.fieldeditors.LinkedFileViewModel.edit(LinkedFileViewModel.java:378)
    at org.jabref@100.0.0/org.jabref.gui.fieldeditors.LinkedFilesEditor$ContextAction.execute(LinkedFilesEditor.java:376)
    at org.jabref@100.0.0/org.jabref.gui.actions.JabRefAction.lambda$new$3(JabRefAction.java:40)
    at org.controlsfx.controls@11.2.0/org.controlsfx.control.action.Action.handle(Action.java:423)
    at org.controlsfx.controls@11.2.0/org.controlsfx.control.action.Action.handle(Action.java:64)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.controls@21.0.2/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
    at javafx.controls@21.0.2/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1415)
    at javafx.controls@21.0.2/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1368)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
    at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
    at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics@21.0.2/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
    at javafx.graphics@21.0.2/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
    at javafx.graphics@21.0.2/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
    at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
    at javafx.graphics@21.0.2/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
    at javafx.graphics@21.0.2/com.sun.glass.ui.View.notifyMouse(View.java:937)
    at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:72)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at javafx.base@21.0.2/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:270)
    at javafx.fxml@21.0.2/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
    at javafx.fxml@21.0.2/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1853)
    ... 98 more
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 5: https://arxiv.org/pdf/2304.04088.pdf
    at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
    at java.base/java.nio.file.Path.of(Path.java:148)
    at org.jabref@100.0.0/org.jabref.gui.linkedfile.LinkedFilesEditDialogViewModel.openBrowseDialog(LinkedFilesEditDialogViewModel.java:79)
    at org.jabref@100.0.0/org.jabref.gui.linkedfile.LinkedFileEditDialogView.openBrowseDialog(LinkedFileEditDialogView.java:74)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    ... 105 more
Siedlerchr commented 8 months ago

Ah Okay seems odd and a windows issue... Tested on mac

koppor commented 8 months ago

The most important element of the stack trace is

Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 5: https://arxiv.org/pdf/2304.04088.pdf

There is an if missing. If the link is an online link, do NOT rename on the file system, just rename the field value.

@Siedlerchr Did you really use https://arxiv.org/pdf/2304.04088.pdf as file name for testing?

koppor commented 8 months ago

Note that this confusion comes, because we also store URLs in the file field - and not only references to local files.

Generally, this refs https://github.com/JabRef/jabref/issues/98.

Example issues and fixes: https://github.com/JabRef/jabref/pull/8514