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 249777 - AssertionError: Path must be absolute: Y:/src/buildroot-at91/output/staging/usr/include
Summary: AssertionError: Path must be absolute: Y:/src/buildroot-at91/output/staging/u...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-13 07:39 UTC by Exceptions Reporter
Modified: 2015-06-23 02:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 214743


Attachments
stacktrace (1.95 KB, text/plain)
2015-01-13 07:39 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2015-01-13 07:39:49 UTC
This bug was originally marked as duplicate of bug 244445, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201501120001)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Windows 7

User Comments:
GUEST: first run of nighly build




Stacktrace: 
java.lang.AssertionError: Path must be absolute: Y:/src/buildroot-at91/output/staging/usr/include
   at org.netbeans.modules.remote.impl.RemoteLogger.assertTrue(RemoteLogger.java:125)
   at org.netbeans.modules.remote.impl.fs.RemoteFileSystemProvider.toURL(RemoteFileSystemProvider.java:333)
   at org.netbeans.modules.remote.spi.FileSystemProvider.toUrl(FileSystemProvider.java:356)
   at org.netbeans.modules.cnd.remote.fs.CndFileSystemProviderImpl.toUrlImpl(CndFileSystemProviderImpl.java:114)
   at org.netbeans.modules.cnd.spi.utils.CndFileSystemProvider$DefaultProvider.toUrlImpl(CndFileSystemProvider.java:447)
   at org.netbeans.modules.cnd.spi.utils.CndFileSystemProvider.toUrl(CndFileSystemProvider.java:158)
Comment 1 Exceptions Reporter 2015-01-13 07:39:51 UTC
Created attachment 151481 [details]
stacktrace
Comment 2 Maria Tishkova 2015-01-13 10:10:09 UTC
Volodya, please take a look
Comment 3 Vladimir Kvashin 2015-05-27 17:53:57 UTC
I can easily reproduce my case (with empty path):
open a full remote project and add "/" as include path, that's it.

The stack that converts "/" into "" is:

"CreateFilesWorker A00 [vkvashin@localhost:23]"
	at org.netbeans.modules.dlight.libs.common.PathUtilities.normalizeUnixPath(PathUtilities.java:119)
	at org.netbeans.modules.remote.impl.fs.RemoteFileSystem.normalizeAbsolutePath(RemoteFileSystem.java:284)
	at org.netbeans.modules.remote.impl.fs.RemoteFileSystemProvider.normalizeAbsolutePath(RemoteFileSystemProvider.java:92)
	at org.netbeans.modules.remote.spi.FileSystemProvider.normalizeAbsolutePath(FileSystemProvider.java:173)
	at org.netbeans.modules.cnd.remote.fs.CndFileSystemProviderImpl.normalizeAbsolutePathImpl(CndFileSystemProviderImpl.java:135)
	at org.netbeans.modules.cnd.spi.utils.CndFileSystemProvider$DefaultProvider.normalizeAbsolutePathImpl(CndFileSystemProvider.java:497)
	at org.netbeans.modules.cnd.spi.utils.CndFileSystemProvider.normalizeAbsolutePath(CndFileSystemProvider.java:186)
	at org.netbeans.modules.cnd.utils.cache.CndFileUtils.normalizeAbsolutePath(CndFileUtils.java:321)
	at org.netbeans.modules.cnd.utils.FSPath.<init>(FSPath.java:78)
	at org.netbeans.modules.cnd.makeproject.api.configurations.Item.getUserIncludePaths(Item.java:722)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.getIncludeHandler(ProjectBase.java:1457)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.createPreprocHandler(ProjectBase.java:1449)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.preCreateIfNeed(ProjectBase.java:1153)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.createIfNeed(ProjectBase.java:1161)
	at org.netbeans.modules.cnd.modelimpl.csm.core.CreateFilesWorker$CreateFileRunnable.createProjectFilesIfNeedRun(CreateFilesWorker.java:230)
	at org.netbeans.modules.cnd.modelimpl.csm.core.CreateFilesWorker$CreateFileRunnable.run(CreateFilesWorker.java:189)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 4 Vladimir Kvashin 2015-05-27 17:56:39 UTC
I guess situation with non-absolute (from remote point of view) path "Y:/src/buildroot" can be reproduced if we add "Y:/src/buildroot" to include paths.

The issue here is that Item.getUserIncludePaths() uses not CndFileSystemProvider.isAbsolute(fileSystem, p), but CndPathUtilities.isPathAbsolute(p), which is incorrect
Comment 5 Vladimir Kvashin 2015-06-18 13:15:34 UTC
http://hg.netbeans.org/cnd-main/rev/f3ff6cec1ed6
Comment 6 Alexander Simon 2015-06-21 17:05:13 UTC
Sorry, why did you introduce new method "isPathAbsolute(FileSystem fs, String path)":
    public static boolean isPathAbsolute(FileSystem fs, String path) {
        return CndFileSystemProvider.isAbsolute(fs, path);
    }
The class already had the method:
    public static boolean isAbsolute(FileSystem fileSystem, String path) {
        return CndFileSystemProvider.isAbsolute(fileSystem, path);
    }
Please redo the fix.
By the way you forgot to increment spec version.
Comment 7 Vladimir Kvashin 2015-06-22 09:54:49 UTC
(In reply to Alexander Simon from comment #6)
> why did you introduce new method
>     public static boolean isPathAbsolute(FileSystem fs, String path) {
> ...
> The class already had the method:
>     public static boolean isAbsolute(FileSystem fileSystem, String path) {
> ...

That was done with intent. 
The problem is that we have isAbsolute(String) method.
Intent was to make each one who sees isAbsolute(String) in completion list see isAbsolute(FileSystem, String) right near, to help him/her to make proper choice.

In theory, I could remove old method at all, but there are abut 100 (sic!) modules that depend on cnd.util, including external microchip ones - so such refactoring could be quite painful.

And I've just pushed spec version increment - thanks for letting me know
http://hg.netbeans.org/cnd-main/rev/1cfcb9b1d0c8
Comment 8 Quality Engineering 2015-06-23 02:40:42 UTC
Integrated into 'main-silver', will be available in build *201506230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f3ff6cec1ed6
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #249777 - AssertionError: Path must be absolute: Y:/src/buildroot-at91/output/staging/usr/include