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 194986 - New Folder wiz should warn about dots in folder names (esp. in TYPE_JAVA roots)
Summary: New Folder wiz should warn about dots in folder names (esp. in TYPE_JAVA roots)
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2011-02-02 13:58 UTC by arittner
Modified: 2016-07-07 08:39 UTC (History)
0 users

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 arittner 2011-02-02 13:58:34 UTC
Product Version: NetBeans IDE Dev (Build 201101250001)
Java: 1.6.0_23; Java HotSpot(TM) 64-Bit Server VM 19.0-b09
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)

Hi!

I think we need more clarification on creation of new folders or packages. 

The last trap in which I had dropped was a folder with a dot in the name.

I've created under "Other Sources" -> src/main/ressources -> "de.sepix.app.potential" a new folder. I've entered the package notation like this: "employee.ui". The node shows me this name:

de.sepix.app.potential.employee.ui

But it's:

de\sepix\app\potential\employee.ui

With the "New Package" Wizard it works well. Not intuitive.

Different questions to clarify some things and remove this traps:
Is it possible to show ressource-nodes with slashes? Like:
  de/sepix/app/potential/employee.ui

Is it possible to warn the user or deny dots in the New Folder wizard?

IMHO it makes no sense to allow ressource paths with dots in names. It is really impossible to reach the resources in layer.xml files:

<attr name="displayName" 
      bundlevalue="de.sepix.app.potential.employee.ui.Bundle#someKey"/>

Is it possible to merge "New Folder" and "New package"?

I've some more problems with Dot-Named-Folders (deletion and renaming is impossible), so: it's a bug.

br, josh.
Comment 1 Jesse Glick 2011-02-02 14:25:46 UTC
(In reply to comment #0)
> I've created under "Other Sources" -> src/main/ressources ->
> "de.sepix.app.potential" a new folder.

"Empty Folder"?

> I've entered the package notation like
> this: "employee.ui" [which created]:
> 
> de\sepix\app\potential\employee.ui

That's what you requested - a folder named "employee.ui".

> With the "New Package" Wizard it works well.

In that case you are requested a subpackage, where dot is the separator. Note that this has nothing to do with the Maven support.

> Is it possible to show ressource-nodes with slashes? Like:
>   de/sepix/app/potential/employee.ui

You can show package-typed source roots as trees if you prefer; right-click on the empty space in the Packages window.

> Is it possible to warn the user

Possible; leaving open for that purpose.

> deny dots in the New Folder wizard?

No, since this would prevent legitimate requests to create folders that happen to have dots in their names.

> it makes no sense to allow ressource paths with dots in names.

Depends on the project.

> It is really impossible to reach the resources in layer.xml files

ClassInPotentialPackage.class.getResource("employee.ui/Bundle.properties")

> Is it possible to merge "New Folder" and "New package"?

They serve different purposes.

> I've some more problems with Dot-Named-Folders (deletion and renaming is
> impossible)

If you come across specific problems, please file them separately (in this case probably in the java/Project component) with complete details to reproduce.
Comment 2 arittner 2011-02-02 14:41:57 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > I've created under "Other Sources" -> src/main/ressources ->
> > "de.sepix.app.potential" a new folder.
> 
> "Empty Folder"?

Empty Folder? No, I've this structure:
 "Other Sources"
   src/main/ressources
     de.sepix.app.potential

right mouse click -> New Folder -> "employee.ui"

> 
> > I've entered the package notation like
> > this: "employee.ui" [which created]:
> > 
> > de\sepix\app\potential\employee.ui
> 
> That's what you requested - a folder named "employee.ui".

Yes I know ;-)

> > Is it possible to show ressource-nodes with slashes? Like:
> >   de/sepix/app/potential/employee.ui
> 
> You can show package-typed source roots as trees if you prefer; right-click on
> the empty space in the Packages window.

No :-) - this tree view is very inconvenience for deep folder trees. 

> 
> > Is it possible to warn the user
> 
> Possible; leaving open for that purpose.

Ok!

> 
> > deny dots in the New Folder wizard?
> 
> No, since this would prevent legitimate requests to create folders that happen
> to have dots in their names.
> 
> > it makes no sense to allow ressource paths with dots in names.
> 
> Depends on the project.

Exactly.  
> 
> > It is really impossible to reach the resources in layer.xml files
> 
> ClassInPotentialPackage.class.getResource("employee.ui/Bundle.properties")

I can write this in a layer.xml file?

br, josh.
Comment 3 Jesse Glick 2011-02-02 14:55:03 UTC
(In reply to comment #2)
> right mouse click -> New Folder

That's what I was referring to - you are _creating_ a new empty folder.

> this tree view is very inconvenience for deep folder trees.

Currently there is no option to display TYPE_JAVA roots in the "flat list" style but using / as the package field separator. Might be useful. Another possibility that has been floated in the past is the hybrid of tree and flat list (com.mycom.myprj > mainpkg > subpkg), though it is unclear if this would be straightforward to implement. There is also a hidden option to display a list with compressed package fields (com.myc.myp.mai.subpkg). Probably need an SPI to provide alternate package views so that these things can be explored in plugins.

>> ClassInPotentialPackage.class.getResource("employee.ui/Bundle.properties")
> 
> I can write this in a layer.xml file?

No (other than using methodvalue), I was just pointing out that other usages of resources may work fine with folders containing dots, so it cannot be treated as an error.
Comment 4 Martin Balin 2016-07-07 08:39:04 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