This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262780 - [82cat] [regression] Paths with %20 should be converted to spaces
Summary: [82cat] [regression] Paths with %20 should be converted to spaces
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 8.2
Hardware: PC Mac OS X
: P4 normal (vote)
Assignee: issues@javaee
Depends on:
Reported: 2016-07-12 12:53 UTC by brettryan
Modified: 2016-07-20 21:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Patch replacing dangerous File.toURL() to Utilities.toURI(File).toURL() (2.56 KB, patch)
2016-07-14 02:36 UTC, brettryan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description brettryan 2016-07-12 12:53:50 UTC
This issue has been identified where spaces exist in the install path while opening jsp content. Upon opening log messages are produced where about illegal characters. Investigating this reveals that while the path is printed with a space, the actual string contents of the URL contains %20. This may potentially be a bug in the JSP support, however; it would be great if org.openide.util.BaseUtilities#toURI( recovered from this by detecting a scheme of 'file' and replacing occurrences of '%20' with a space.

Steps to Reproduce
1. Have the IDE in a path with a space and start.
2. Open a web project
3. Open a JSP with a taglib reference such as "<%@ taglib uri="" prefix="c" %>"

Actual Behaviour
IDE seems to function fine (albeit am I missing functionality?), though exceptions of those attached are spat out.

Desired Behaviour
Recover from exceptions and not litter messages.

Product Version: NetBeans IDE Dev (Build 20160712-16457b922100)
Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14
System: Mac OS X version 10.11.4 running on x86_64; UTF-8; en_AU (nb)
User directory: /Users/bryan/Development/netcat/netbeans ide/nbbuild/testuserdir
Cache directory: /Users/bryan/Development/netcat/netbeans ide/nbbuild/testuserdir/var/cache

     [exec] INFO [org.netbeans.modules.masterfs.filebasedfs.FileBasedURLMapper]: URL=file:/Users/bryan/Development/netcat/netbeans ide/nbbuild/netbeans/enterprise/docs/
     [exec] Illegal character in path at index 45: file:/Users/bryan/Development/netcat/netbeans ide/nbbuild/netbeans/enterprise/docs/
     [exec] 	at$
     [exec] 	at$Parser.checkChars(
     [exec] 	at$Parser.parseHierarchical(
     [exec] 	at$Parser.parse(
     [exec] 	at<init>(
     [exec] 	at
     [exec] [catch] at org.netbeans.modules.masterfs.filebasedfs.FileBasedURLMapper.getFileObjects(
     [exec] 	at org.netbeans.modules.masterfs.MasterURLMapper.getFileObjects(
     [exec] 	at org.openide.filesystems.URLMapper.findFileObject(
     [exec] 	at org.openide.filesystems.JarArchiveRootProvider.isArchiveFile(
     [exec] 	at org.openide.filesystems.FileUtil.getArchiveRoot(
     [exec] 	at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.initHelp(
     [exec] 	at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.initCompletionData(
     [exec] 	at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getAllTags(
     [exec] 	at org.netbeans.modules.web.core.syntax.JSPProcessor.createBeanVarDeclarations(
     [exec] 	at org.netbeans.modules.web.core.syntax.SimplifiedJspServlet.renderProcess(
     [exec] 	at org.netbeans.modules.web.core.syntax.JSPProcessor$
     [exec] 	at org.netbeans.editor.BaseDocument.render(
     [exec] 	at org.netbeans.modules.web.core.syntax.JSPProcessor.process(
     [exec] 	at org.netbeans.modules.web.core.syntax.EmbeddingProviderImpl.getEmbeddings(
     [exec] 	at org.netbeans.modules.parsing.impl.TaskProcessor.callEmbeddingProvider(
     [exec] 	at org.netbeans.modules.parsing.impl.SourceCache.refresh(
     [exec] 	at org.netbeans.modules.parsing.impl.TaskProcessor$
     [exec] 	at org.openide.util.lookup.Lookups.executeWith(
     [exec] 	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(
     [exec] 	at org.netbeans.modules.parsing.impl.TaskProcessor$
     [exec] 	at java.util.concurrent.Executors$
     [exec] 	at
     [exec] 	at org.openide.util.RequestProcessor$
     [exec] 	at org.netbeans.modules.openide.util.GlobalLookup.execute(
     [exec] 	at org.openide.util.lookup.Lookups.executeWith(
     [exec] 	at org.openide.util.RequestProcessor$
Comment 1 brettryan 2016-07-12 12:56:11 UTC
Marking as regression as this does not appear within 8.1. As it doesn't (appear) to affect functionality am relaxing to P4.
Comment 2 brettryan 2016-07-14 02:36:08 UTC
Created attachment 160381 [details]
Patch replacing dangerous File.toURL() to Utilities.toURI(File).toURL()

File.toURL() [1] should be avoided as it does not escape spaces correctly, one should convert to a URI first and then to a URL.