apache / apache/netbeans

`^` char breaks URL parsing

Open
#6,236 10 comments 0 reactions 0 assignees View on GitHub
HTML
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 18

### What happened

Remote CSS is not shown if its url contains a `^`

### How to reproduce

Add this to an html page:
```html

```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 10 version 10.0 running on amd64; Cp1252; it_IT (nb)

### JDK

11.0.17; OpenJDK 64-Bit Server VM 11.0.17+8

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

stack trace

SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.navigator.NavigatorController$1

java.net.URISyntaxException: Illegal character in path at index 28: https://unpkg.com/primeflex@^3/primeflex.css
at java.base/java.net.URI$Parser.fail(URI.java:2913)
at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3166)
at java.base/java.net.URI$Parser.parse(URI.java:3114)
at java.base/java.net.URI.(URI.java:600)
at java.base/java.net.URL.toURI(URL.java:1061)
at org.openide.filesystems.FileObject.toURI(FileObject.java:1270)
Caused: java.lang.IllegalStateException
at org.openide.filesystems.FileObject.toURI(FileObject.java:1275)
at org.netbeans.modules.navigator.ProviderRegistry.getProviders(ProviderRegistry.java:98)
at org.netbeans.modules.navigator.NavigatorController.obtainProviders(NavigatorController.java:593)
at org.netbeans.modules.navigator.NavigatorController.access$200(NavigatorController.java:76)
at org.netbeans.modules.navigator.NavigatorController$1.run(NavigatorController.java:391)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1419)
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:2034)

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the provided HTML link, then read org.netbeans.modules.navigator.ProviderRegistry.getProviders and the FileObject.toURI stack-trace path. Done means the remote CSS URL containing ^ no longer causes the URI parsing failure and the stylesheet is shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.