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 59081 - Package decl not deleted for new main class in default package using __PACKAGE__ macro
Summary: Package decl not deleted for new main class in default package using __PACKAG...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-19 23:10 UTC by Jesse Glick
Modified: 2007-09-26 09:14 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 Jesse Glick 2005-05-19 23:10:26 UTC
Dev build. Make a new j2seproject app and specify a main class with no package
name. Created in the correct location but starts with

package ;
public class Whatever {...}

Note that J2SEProjectGenerator just gets a JavaDataObject (from
Templates/Classes/Main.java) and calls createFromTemplate on it, so the problem
seems to be in JavaDataObject.
Comment 1 Tomas Zezula 2005-05-20 08:02:54 UTC
Yes, it seems as a bug in the JavaDataObject or the javamodel
Resource.setPackageName().
The JDO.handleCreateFromTemplate () was not changed, probaly
Resource.setPackageName () is wrong.
Comment 2 Pavel Flaska 2005-08-25 14:11:20 UTC
Hm, I just tried it and it worked correctly, but I did not find any related
change neither in JavaDataObject nor in ResourceImpl. Reopen if it is still
reproducible.
Comment 3 Jesse Glick 2005-08-26 18:51:06 UTC
Works for making a new class from template, but not for new j2seproject.
Comment 4 Tomas Zezula 2005-09-14 18:24:39 UTC
It is handled by JDO. It seems to work fine in the trunk build.
Comment 5 Jesse Glick 2005-09-14 23:49:07 UTC
It does work in a fresh user dir. My customized template for a main class had

package __PACKAGE__;
public class __NAME__ {
    ....
}

which used to work fine but apparently no longer does. When I change it to

package Templates.Classes;
public class Main {
    ....
}

then it is OK. So minor settings incompatibility which we will presumably not
bother fixing.
Comment 6 Jesse Glick 2005-09-14 23:49:30 UTC
Wrong resolution however.
Comment 7 Jesse Glick 2005-09-14 23:50:00 UTC
More precise result.