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.
Summary: | Enhancement: default name of main class | ||
---|---|---|---|
Product: | java | Reporter: | boblang99 |
Component: | Project | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jglick, olangr |
Priority: | P3 | Keywords: | USABILITY |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
boblang99
2010-08-17 12:28:24 UTC
Might be a better default, especially if it would "autocamelize" your project name, which does not necessarily look anything like a Java class name. The question is what to do with the generated package name. Does the following make sense or is it redundant? Name: [test-frobnitz-download] (entered) Folder: [/tmp] (entered) Location: [/tmp/test-frobnitz-download] (computed) Package: [test.frobnitz.download] (suggested) Main Class: [test.frobnitz.download.TestFrobnitzDownload] (suggested) (In reply to comment #1) > Might be a better default, especially if it would "autocamelize" your project > name, which does not necessarily look anything like a Java class name. The > question is what to do with the generated package name. Does the following make > sense or is it redundant? > > Name: [test-frobnitz-download] (entered) > Folder: [/tmp] (entered) > Location: [/tmp/test-frobnitz-download] (computed) > Package: [test.frobnitz.download] (suggested) > Main Class: [test.frobnitz.download.TestFrobnitzDownload] (suggested) I think the suggested package name (test.frobnitz.download) and suggested Main class name (test.frobnitz.download.TestFrobnitzDownload) both make good sense. My personal usage is to use a camel name for the project (eg MyJavaProject) and I would not want the to lose the embedded capitals in the main class name (ie. MyJavaProject.java is fine, but Myjavaproject.java is not). Obviously, there is a convention that package names do not contain caps. Additionally, for compatibility with previous versions, I would also allow the option for a user to stick with Main. I don't want this change to be forced upon an unwilling user. >Additionally, for compatibility with previous versions, I would also allow the option for a user to stick with Main.
This will require an additional UI option in the wizard and will complicate the UI. Anyway it's just a default which can be changed by the user in the 2nd step of the wizard.
Jesse's proposal seems good, I will do it in this way. The only question is what to do with project names like: for-download-project where the camel case part is a keyword and it cannot be a package name. Should we ignore it (download.project) or escape it somehow like (forpkg.download.project)? I would prefer the escape, eg. by suffix pkg. Fixed jet-main dbb301a14469 Integrated into 'main-golden', will be available in build *201009010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/dbb301a14469 User: Tomas Zezula <tzezula@netbeans.org> Log: #189591:Enhancement: default name of main class |