Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317916 - "Name" field in "Hello World ANSI C Project" default comment does not contain characters past the first space.
Summary: "Name" field in "Hello World ANSI C Project" default comment does not contain...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-25 02:14 EDT by Jared Mathis CLA
Modified: 2020-09-04 15:26 EDT (History)
2 users (show)

See Also:


Attachments
fix (2.40 KB, patch)
2011-01-29 11:46 EST, Stefan Gh CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Mathis CLA 2010-06-25 02:14:24 EDT
Build Identifier: 20100617-1415

After making a "Hello World ANSI C Project" the  Inside the file Test Project > src > Test Project.c, the comment will say "File: Test.c" instead of "File: Test Project.c"

Reproducible: Always

Steps to Reproduce:
1. File > New > C Project.
2. Enter a project name with spaces (i.e. "Test Project").
3. Select "Hello World ANSI C Project."
4. Click Finish.
Comment 1 Stefan Gh CLA 2011-01-29 11:46:17 EST
Created attachment 187908 [details]
fix

The file name is set by ${projectName}, while the default comment's file name value is set by ${baseName}. The comment should use the same parameter as the actual file.

The patch applies this change to the other HelloWorld projects, in addition to the one pointed by the bug.
Comment 2 Andrew Gvozdev CLA 2011-01-29 11:52:09 EST
I don't think we should replace ${baseName} with ${projectName} in this case. Rather, handling of ${baseName} should be fixed to return proper base name of file with spaces.
Comment 3 Stefan Gh CLA 2011-01-29 12:15:42 EST
${baseName} is set from MBSWizardHandler.getBaseName(). It takes the project name and ignores everything after the last "." until the following " ".
so projectName = "test.content" becomes baseName = "content"
and projectName = "test content" becomes baseName = "test".

If we change baseName to return the exact project name, then why not use projectName directly?