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 107000 - unwanted "lib" folder created for every opened/created project
Summary: unwanted "lib" folder created for every opened/created project
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ potingwu
URL:
Keywords:
: 98741 106632 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-18 14:30 UTC by Milos Kleint
Modified: 2008-07-23 11:41 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch fixing the problem (3.25 KB, text/plain)
2008-07-23 03:05 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2007-06-18 14:30:20 UTC
I've upgraded to 17/Jun daily build, full IDE.
On every project open the IDE created an empty "lib" folder. This is not dependent on th eproject type, happens for web,
j2se, freeform, maven projects.
This is unnecessary and breaks several other things like subversion support (where the folder is marked as
"to-be-added") or delete project feature that fails to delete such folder because it cannot tell anything about this lib
folder.


I got rid of this functionality by disabling the visualweb cluster. Please remove this functionality.
Comment 1 _ potingwu 2007-06-18 17:40:21 UTC
This is created by complib.
Comment 2 _ edwingo 2007-06-18 17:57:25 UTC
I don't know what the right fix is for this bug. As I understand it, libraries for a project should go under the "lib"
directory. I know of at least two modules "complib" and "ejb" that need to add libraries for a project so I believe
these are the right places for them. Could someone advise me on how to fix this problem? I'll temporarily reassign this
to jglick since he might know. Feel free to call me on my cell if you want to chat.
Comment 3 Jesse Glick 2007-06-18 18:34:44 UTC
Do not create empty folders for no reason. I suppose "${basedir}/lib" is as good a place as any for a new folder that
you actually intend to put libraries in.
Comment 4 _ edwingo 2007-06-18 18:52:57 UTC
OK, I misunderstood the original bug. The bug is that an empty "lib" folder is created not that there are complib
specific libraries in it. Thanks Jesse.
Comment 5 _ edwingo 2007-06-19 18:36:15 UTC
*** Issue 106632 has been marked as a duplicate of this issue. ***
Comment 6 Jesse Glick 2007-06-21 18:27:28 UTC
Corrupting unrelated projects is a serious bug - sufficient grounds for removing the module from the build. I have tried
to put in a hotfix, but JsfProjectUtils.getProjectLibraryDirectory is called from several other places and so it is not
clear if the problem is completely fixed.

Checking in EjbLibReferenceHelper.java;
/shared/data/ccvs/repository/visualweb/ejb/src/org/netbeans/modules/visualweb/ejb/nodes/EjbLibReferenceHelper.java,v 
<--  EjbLibReferenceHelper.java
new revision: 1.8; previous revision: 1.7
done
Comment 7 _ edwingo 2007-06-21 18:33:44 UTC
OK, I will fix this bug today since a couple people have been complaining about it.
Comment 8 _ edwingo 2007-06-22 01:08:12 UTC
One cause in visualweb/complib has been fixed, but there are two other modules that could cause this.
Comment 9 _ potingwu 2007-06-22 01:13:33 UTC
I think these modules you mentioned should first check whether this is a visualweb project or not, then applied your
codes. Therefore it won't disturb other project types and also improve the performance.

In visualweb project, there is API for this checking.
Comment 10 _ edwingo 2007-06-22 01:37:37 UTC
This is old Creator code and it looks like Jesse checked in an equivalent fix so I'm closing this bug.
Comment 11 _ edwingo 2007-06-22 01:44:14 UTC
Actually, it may not exactly be equivalent WRT performance so I'm adding the API that potingwu mentions.
Comment 12 Jesse Glick 2007-06-22 01:56:58 UTC
I checked in a fix for the one stack trace I actually observed. I could not and did not verify that other callers of the
guilty method would not be invoked against non-visualweb projects.
Comment 13 Lark Fitzgerald 2007-06-22 22:14:25 UTC
Verified using:
NB6: 200706220000
Woodstock 4.1 200706220934
My web app did not have a lib directory.
Comment 14 _ edwingo 2007-06-22 22:48:53 UTC
I found another place where the problem can occur under different conditions and checked in a fix.
Comment 15 _ edwingo 2007-07-14 00:50:51 UTC
*** Issue 98741 has been marked as a duplicate of this issue. ***
Comment 16 David Konecny 2008-07-22 21:34:15 UTC
*** Issue 138048 has been marked as a duplicate of this issue. ***
Comment 17 David Konecny 2008-07-22 22:48:14 UTC
As described in issue 138048 this problem is back. I would accept the lib folder if something was in it but it is empty.
And what's more if I delete it and restart IDE the lib folder is recreated.
Comment 18 Jayashri Visvanathan 2008-07-23 00:54:23 UTC
Po-ting, can you look into this please ?
thanks
Comment 19 _ potingwu 2008-07-23 01:54:18 UTC
We need to concentrate the work on handling the project deleting now. Change it back to fixed.
Comment 20 David Konecny 2008-07-23 03:05:21 UTC
Created attachment 65300 [details]
patch fixing the problem
Comment 21 David Konecny 2008-07-23 03:07:03 UTC
As I've already said issue 138048 is not related to project deletion. If I create a Web project with Visual JSF and have
no intention of deleting it I still get lib folder created and if I remove it from my project structure it gets
recreated for not reason after IDE restart. That's different problem to one described in issue 107029.

Anyway, potingwu, could you please apply attached patch to your code. Or I can push it if you agree with it. It fixes
the problem described in this issue and in the issue 138048. It is the same fix as Jesse did a year ago just in
different place. It avoids calling JsfProjectUtils.getProjectLibraryDirectory (which always creates lib folder) in
places where you just check for presence of a folder and do not do anything with the folder. Thanks, -David
Comment 22 _ potingwu 2008-07-23 03:38:52 UTC
Thanks! Please push your fix.
Comment 23 David Konecny 2008-07-23 07:00:39 UTC
Patch integrated: 0bc28b1a99a8
Comment 24 Quality Engineering 2008-07-23 11:41:57 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #339 build
Changeset: http://hg.netbeans.org/main/rev/0bc28b1a99a8
User: David Konecny <dkonecny@netbeans.org>
Log: #107000 - avoid creating unwanted "lib" folder for every opened/created project with visual JSF