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 55884 - [Study] [EP-23] Warning about the default package not visible enough
Summary: [Study] [EP-23] Warning about the default package not visible enough
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Petr Jiricka
URL: http://ui.netbeans.org/nonav/usabilit...
Keywords: UI
Depends on:
Blocks:
 
Reported: 2005-03-03 14:44 UTC by Petr Blaha
Modified: 2016-07-07 08:52 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2005-03-03 14:44:32 UTC
A participant created a session bean into the
default package as he didn't notice the warning
about the default package in the new file wizard.
Recommendation
Always fill the package field with an initial
value. This way the user has to manually delete
the value and then should notice the inline error
which appears.
Comment 1 _ ludo 2005-03-03 16:07:25 UTC
I would recommend that this warning becomes a rule:

For web services, we already know they do not work without packages.
For ejbs, we should force the existence of a package when created from
within the IDE. 
This will clear up the confusion.
(If the user really wante to created without package, she will have to
do that outside the IDE, the same way the IDE does not create EJB CMP
1.0 ejbs, but can understand them if imported)
Comment 2 Rochelle Raccah 2005-03-03 18:53:13 UTC
I think this is related to issue 54575.
Comment 3 Martin Adamek 2005-03-17 15:11:26 UTC
I agree theat we should provide some non-default package. Anyway, after
discussion with HIE I closed issue 54575 with empty-package implementation (to
be consistent with other wizards). I am reassigning this to HIE. Please define
what should be default package name for all wizards.
Comment 4 Jiri Kopsa 2005-03-19 22:06:34 UTC
I was trying to find some information about the limits of default packages in
regards to J2EE, but have not find anything.

Could somebody provide me with some links or do a summary for me, please?

Are the following points correct and comprehensive?
- "default package" is a bad practice
- it is recommended not to use it starting with J2SE 1.4 due to some API issues
(reflection, or what?)
- it does not work in J2EE 1.4 (when exactly?)

If they are correct, I would suggest to:
- for J2SE classes: use at least the recommandation message as we do now 
- for J2EE stuff: forbid the usage of default packages (i.e. add a warning and
disable the next/finish buttons)
Comment 5 _ ludo 2005-03-19 22:16:08 UTC
Well, sometimes, the IDE emits this message:
You are trying to access file: jndi.properties from the default package.
Please see http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc
-files/classpath.html#default_package

when a propertie file is loaded fromt he default package.
Read the link to have more data, that links to
http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#40169

I would recommend that by default, we do not use the default package, ancd
create one (maybe the project name, javatized).
For Web Services, it just does not work: wscompile tool fails with default packages.
Comment 6 Jiri Kopsa 2005-03-19 23:12:42 UTC
Here is a proposal:
1. Let's provide a default value of the package editable-combobox if the list of
packages is empty (e.g. a javatized project name). NEW!
2. If the list is not empty, the first element is selected by default (i.e. no
default value is "generated") - current behaviour.
3. If the wizard was activated before, the previous value is selected. Every
wizard remembers its own "previous package" (e.g. adding Entity Beans to one
package  and Session Beans to the other) NEW! OPTIONAL.

This solutions:
- provides novice user with a package name, thus guides him to good practice
and/or working code (WS)
- does not bother any user with a default value that is much probably going to
be replaced (the points #2 and #3 of the solution are very important!)
- provides a reasonable default value (previous one) between separate
activations of a wizard.

Implementation:
Since this touches all the wizards throughout the IDE, it is very questionable
whether we want to implement this in 4.1 in regards to schedule/risk.

Alternative:
Forbid the users from creating J2EE artefacts in the "default package". We might
even use this rule in case that the proposal is implemented, if folks think this
is a correct behaviour - I still don't have an answer (link) about J2EE &
"default packages" issue. Ludo, who should I ask for an "official statement"?
Comment 7 jrojcek 2005-03-21 13:26:48 UTC
I agree with Jirka's proposal (points 1., 2. and 3.). Plus if the user invokes the wizard from contextual 
menu on a package then the package is well known.
Comment 8 Jiri Kopsa 2005-03-23 14:03:13 UTC
Based on feedback, I'm summing up the conclusion once again:

1. Let's provide a default value of the package editable-combobox if the list of
packages is empty (e.g. a javatized project name). NEW!

2. If the list is not empty, the first element is selected by default (i.e. no
default value is "generated") - current behaviour.

3. If the wizard was activated before, the previous value is selected. Every
wizard remembers its own "previous package" (e.g. adding Entity Beans to one
package  and Session Beans to the other) NEW! OPTIONAL.

And another two points:

4. If the wizard was activated on a specific package, the package is preselected.

5. If the user clears the Package field:
   - in case of J2EE wizard, the following message appears and the Next/Finish
buttons are disabled
     "Provide a package name."

   - in case of other wizards, the current warning message appears
     "Warning: As of JDK 1.4, it is highly ..."
     Note: there is a BUG - the message does not wrap.

I propose the restricted J2EE wizards to be the following:

Entity Bean
Message-Driven Bean
CMP Entity Beans from Database
Session Bean
Web Service

Assigning to Peter J. to decide on the implementation.
Comment 9 Petr Jiricka 2005-03-23 19:07:21 UTC
For 4.1, we will disable the Next/Finish buttons, I will look at that. The other
items are post-4.1.
Comment 10 Petr Jiricka 2005-03-24 13:13:24 UTC
Fixed the Next/Finish buttons. The rest of this issue is an enhancement, I'd
say. Changing to enhancement.

j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ejb/wizard

session/SessionEJBWizard.java, v1.6
cmp/MultipleEntitySetupPanel.java, v1.15
cmp/Bundle.properties, v 1.16
mdb/MessageEJBWizard.java, v1.5
entity/EntityEJBWizard.java, v1.4
Comment 11 Martin Balin 2016-07-07 08:52:47 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss