apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.63k stars 844 forks source link

CDNJS update library throws exception #7783

Open ltheussl opened 2 days ago

ltheussl commented 2 days ago

Apache NetBeans version

Apache NetBeans 23

What happened

In a php project when choosing Properties -> JavaScript Libraries -> CDNJS, trying to Update a library has no effect, and following exception is thrown:

java.lang.IllegalArgumentException: Invalid prefix or suffix
    at java.base/java.nio.file.TempFileHelper.generatePath(TempFileHelper.java:60)
    at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:125)
    at java.base/java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:159)
    at java.base/java.nio.file.Files.createTempFile(Files.java:923)
    at org.netbeans.modules.javascript.cdnjs.LibraryProvider.downloadLibraryFile(LibraryProvider.java:252)
    at org.netbeans.modules.javascript.cdnjs.LibraryCustomizer$StoreListener.updateLibraries(LibraryCustomizer.java:175)
    at org.netbeans.modules.javascript.cdnjs.LibraryCustomizer$StoreListener.run(LibraryCustomizer.java:117)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)

Language / Project Type / NetBeans Component

PHP project with javascript libraries

How to reproduce

Create a php project and add a javascripr library from Properties -> JavaScript Libraries -> CDNJS. Close the dialog and manually set the version to a lower value in project.xml. Then try to update the version in the CDNJS properties.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10 Pro 22H2

JDK

21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

This used to work some time ago, but not in Netbeans 22 and 23

Are you willing to submit a pull request?

No

matthiasblaesing commented 1 day ago

What is the name of the library you tried to update? The code does not look that broken, but it would break, if there would be a slash inside the name. Is that the case?

ltheussl commented 1 day ago

Thanks for the comment and sorry, - I should have mentioned this. It's pdfmake which I try to upgrade from 0.2.10 to 0.2.12. There is indeed a slash in some dependencies (eg Roboto-Italic.ttf). Following your comment I tried to ugrade a different library (jszip) and that worked... however, also pdfmake used to work some time ago. Unfortunately I can't say when exactly, probably around netbeans 16.