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 196800 - ShorterPaths incorrectly handles paths for non existing files
Summary: ShorterPaths incorrectly handles paths for non existing files
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jiri Skrivanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 10:38 UTC by Jiri Skrivanek
Modified: 2011-04-28 07:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2011-03-17 10:38:22 UTC
Property cluster.path.final contains also clusters not available in standard build because it is read from ide/launcher/netbeans.clusters. Then if you call

ant -f j2ee.kit/build.xml test-build

it generates broken paths in property test-sys-prop.cluster.path.final in test.properties in nbbuild\build\testdist\qa-functional\enterprise\org-netbeans-modules-j2ee-kit.

There is a check whether given path exists:

// check if <disk drive>:\path is property"
String path = token + ":" + nextToken;
if (new File(path).exists()) {
    nextToken = null;
} else {
    path = token;
}

It should be enough to use proper delimiter according to operating system. I will try to fix it.
Comment 1 Jesse Glick 2011-03-17 15:13:13 UTC
Right, the StringTokenizer should I guess be constructed using File.pathSeparator, and the weird block you quote deleted.

If you need to parse a path that might use either : or ; regardless of OS (e.g. because the original property might have been defined as a path using ':' in project.properties), copy org.netbeans.spi.project.support.ant.PropertyUtils.tokenizePath.
Comment 2 Jiri Skrivanek 2011-03-18 10:21:36 UTC
Fixed using tokenizePath() as Jesse suggested and "replacement mechanism" for test.properties separated to dedicated method.
#47feb1644138
Comment 3 Quality Engineering 2011-03-19 09:41:58 UTC
Integrated into 'main-golden', will be available in build *201103190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/47feb1644138
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #196800 - test.properties are now correctly created for non existing files.
Comment 4 Quality Engineering 2011-03-25 09:52:47 UTC
Integrated into 'main-golden', will be available in build *201103250400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2ff6bc4bce22
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #196800 - Excluded property not useful when creating test.properties.
Comment 5 Jesse Glick 2011-04-26 14:45:23 UTC
Did you intentionally backport this as releases #87d2ed5ef5d4, releases #38e50159abe1, etc.?
Comment 6 Jiri Skrivanek 2011-04-26 14:49:03 UTC
Yes, I needed to make tests work for release70.
Comment 7 Jesse Glick 2011-04-28 07:56:06 UTC
I see. Just confusing because the actual 7.0 release bits - releases #a693229ccdbb (see bug #198166) - uses a different version of ShorterPaths (in harness) than exists in the tip of the release70 branch. Complicated diagnosis of bug #197941.