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 116072 - Stop creating empty catalog in project root dir
Summary: Stop creating empty catalog in project root dir
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Catalog (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on: 148118 148119 148120
Blocks:
  Show dependency tree
 
Reported: 2007-09-19 22:13 UTC by Jesse Glick
Modified: 2011-11-03 15:33 UTC (History)
3 users (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 2007-09-19 22:13:24 UTC
070918, JDK 6, Ubuntu. It seems that in recent builds if I try to use XML code completion in a project, the IDE inserts
a file

---%<--- catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <nextCatalog catalog="nbproject/private/cache/retriever/catalog.xml"/>
</catalog>
---%<---

in the project root directory. I don't know what this is for but I do not want it; please do not create any such files
(at least not without asking permission).
Comment 1 Jesse Glick 2007-09-19 22:23:02 UTC
Sometimes the file is empty.

It seems a lot of people have been affected already. Please also delete this debris in CVS:

----%<---- cnd/antlr/catalog.xml
----%<---- cnd/apt/catalog.xml
----%<---- cnd/classview/catalog.xml
----%<---- cnd/completion/catalog.xml
----%<---- cnd/configurationapi/catalog.xml
----%<---- cnd/core/catalog.xml
----%<---- cnd/discovery/catalog.xml
----%<---- cnd/dwarfdiscovery/catalog.xml
----%<---- cnd/dwarfdump/catalog.xml
----%<---- cnd/folding/catalog.xml
----%<---- cnd/gdb/catalog.xml
----%<---- cnd/gotodeclaration/catalog.xml
----%<---- cnd/highlight/catalog.xml
----%<---- cnd/makeproject/catalog.xml
----%<---- cnd/modelapi/catalog.xml
----%<---- cnd/modeldiscovery/catalog.xml
----%<---- cnd/modelui/catalog.xml
----%<---- cnd/modelutil/catalog.xml
----%<---- cnd/qnavigator/catalog.xml
----%<---- cnd/refactoring/catalog.xml
----%<---- cnd/repositoryapi/catalog.xml
----%<---- cnd/repository/catalog.xml
----%<---- contrib/EditorThemeSuite/export/catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <nextCatalog catalog="nbproject/private/cache/retriever/catalog.xml"/>
</catalog>
----%<---- contrib/wadechandler_projects/JavaTextCopyPasteModule/catalog.xml
----%<---- enterprise/bpel/xpath/catalog.xml
----%<---- enterprise/compapp/casaeditor/catalog.xml
----%<---- enterprise/dataintegrator/edmpro/catalog.xml
----%<---- enterprise/dcom/dcomwizard/catalog.xml
----%<---- enterprise/iep/editor/catalog.xml
<!--
The contents of this file are subject to the terms of the Common Development
and Distribution License (the License). You may not use this file except in
compliance with the License.

 You can obtain a copy of the License at http://www.netbeans.org/cddl.html
or http://www.netbeans.org/cddl.txt.

When distributing Covered Code, include this CDDL Header Notice in each file
and include the License file at http://www.netbeans.org/cddl.txt.
If applicable, add the following below the CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"

 The Original Software is NetBeans. The Initial Developer of the Original
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
 Microsystems, Inc. All Rights Reserved.
-->
----%<---- enterprise/iep/project/catalog.xml
<!--
   - The contents of this file are subject to the terms of the Common Development
   - and Distribution License (the License). You may not use this file except in
   - compliance with the License.
   -
   - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   - or http://www.netbeans.org/cddl.txt.

   - When distributing Covered Code, include this CDDL Header Notice in each file
   - and include the License file at http://www.netbeans.org/cddl.txt.
   - If applicable, add the following below the CDDL Header, with the fields
   - enclosed by brackets [] replaced by your own identifying information:
   - "Portions Copyrighted [year] [name of copyright owner]"
   -
   - The Original Software is NetBeans. The Initial Developer of the Original
   - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   - Microsystems, Inc. All Rights Reserved.
  -->
----%<---- enterprise/openesbaddons/ldap/catalog.xml
----%<---- enterprise/openesbaddons/swift/catalog.xml
----%<---- enterprise/openesbaddons/tcpip/catalog.xml
----%<---- identity/profileapi/catalog.xml
----%<---- identity/servermgr/catalog.xml
----%<---- performance/catalog.xml
----%<---- ruby/rspec/catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <nextCatalog catalog="nbproject/private/cache/retriever/catalog.xml"/>
</catalog>
----%<---- visualweb/navigation/catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <nextCatalog catalog="nbproject/private/cache/retriever/catalog.xml"/>
</catalog>
----%<---- visualweb/ravelibs/commons-fileupload/catalog.xml
----%<---- visualweb/woodstock/components/catalog.xml
----%<---- visualweb/woodstock/defaulttheme/catalog.xml
----%<---- web/jsf/navigation/catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <nextCatalog catalog="nbproject/private/cache/retriever/catalog.xml"/>
</catalog>
----%<---- web/libs/jsf-1_2-ri/catalog.xml
----%<---- websvc/components/google/catalog.xml
----%<---- websvc/examples/CalculatorApp/catalog.xml
----%<---- websvc/examples/SecureCalculatorApp/catalog.xml
----%<---- websvc/rest/catalog.xml
----%<---- xml/jaxb/catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <nextCatalog catalog="nbproject/private/cache/retriever/catalog.xml"/>
</catalog>
----%<---- xml/schema/catalog.xml
----%<----

(websvc/examples/CalculatorClientApp/catalog.xml and websvc/examples/SecureCalculatorClientApp/catalog.xml have
nontrivial content which might be intentional, I don't know.)
Comment 2 Samaresh Panda 2007-09-19 22:45:59 UTC
This was a problem all along, which I fixed recently. Is it possible that the catalog.xml were there before and you just
saw them now.
Comment 3 Jesse Glick 2007-09-19 22:50:14 UTC
No, a fresh catalog.xml was definitely created, today, using yesterday's dev build. Reproducible - open nbbuild project,
open nbbuild/javadoctools/apichanges.xsl, use CC somewhere to insert

<xsl:choose></xsl:choose>

and save. nbbuild/catalog.xml appears.
Comment 4 Samaresh Panda 2007-09-19 23:17:22 UTC
but this one is not empty though. Whenever external resources are fetched from internet, this file gets created and
populated. This is how resolver works. See http://xml.apache.org/commons/components/resolver/resolver-article.html.

Earlier, empty files were getting created and that got fixed. I have to agree that for xsl, CC infrastructure is coming
into play and trying to fetch external resources. In a way this is good, but in this case, it is a waste, because it
doesn't use that resource. I'll fix this.
Comment 5 Samaresh Panda 2007-09-20 00:05:51 UTC
Fixed.
/cvs/xml/retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogModelImpl.java
new revision: 1.16; previous revision: 1.15
/cvs/xml/schema/completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImpl.java
new revision: 1.16; previous revision: 1.15
/cvs/xml/schema/completion/src/org/netbeans/modules/xml/schema/completion/util/DefaultModelProvider.java
new revision: 1.9; previous revision: 1.8

Let me know if this works.
Comment 6 Mikhail Matveev 2007-09-20 15:28:33 UTC
The bug doesn't exist for 20 Sep build, JDK 1.6, WinXP. But I can't reproduce it for Beta 1 as well. So I'm not marking
it as verified. 
Comment 7 Jesse Glick 2007-09-20 18:32:01 UTC
Creation of catalog.xml from CC does seem to be fixed in 070920, at least on my previous test case (apichanges.xsl) - I
hope it does not happen under other circumstances.

Reopening since there are still dozens of useless catalog.xml's cluttering CVS that need to be deleted, as mentioned before.
Comment 8 Samaresh Panda 2007-09-20 20:56:23 UTC
Do you want me to delete them, even though I didn't commit them? Shouldn't the developer be careful while committing the
files he didn't intend?
Comment 9 Jesse Glick 2007-09-20 21:17:42 UTC
Developers _should_ be more careful but clearly a lot of people either didn't even look at the list of files they were
committing, or saw this catalog.xml but didn't bother to question its purpose. So yes, please clean up the unnecessary
files - if you don't, they will probably stay there forever, since the older junk gets the more strongly people believe
it is there for a reason. (To get the attached summary, I just did a quick wildcard list on */{,*/,*/*/}catalog.xml in a
nb_all checkout and manually excluded a handful of matches which seemed to have useful contents.)
Comment 10 Samaresh Panda 2007-09-20 22:25:12 UTC
I have deleted all I could find. Please delete if you find some empty ones.
Comment 11 tonybeckham 2008-01-30 21:18:52 UTC
Original bug submitter and QE agree that the fix was verified but the submitter wanted some other clean up work done as
well.  That work was completed so marking this a Verified once again.
Comment 12 Jesse Glick 2008-01-30 22:23:53 UTC
The cleanup was not completed. I have just deleted several more such catalog.xml's from main (#cdd87e79c35c), contrib
(#29f2b0a243d3), and misc (#6d1fe8dffd64). There are still a number of probably garbage catalog.xml's in samples which I
did not touch:

bpel.samples/resources/AsynchronousSample/AsynchronousSample/catalog.xml
bpel.samples/resources/BluePrint1/BluePrint1/catalog.xml
bpel.samples/resources/BluePrint2/BluePrint2/catalog.xml
bpel.samples/resources/BluePrint3/BluePrint3/catalog.xml
bpel.samples/resources/BluePrint4/BluePrint4/catalog.xml
bpel.samples/resources/BluePrint5/BluePrint5/catalog.xml
bpel.samples/resources/SynchronousSample/SynchronousSample/catalog.xml
bpel.samples/resources/TravelReservationService/TravelReservationService/catalog.xml
identity.samples/StockQuoteClient/catalog.xml
identity.samples/StockQuoteService/catalog.xml
j2ee.samples/samples_src/JsfJpaCrud/catalog.xml
soa.kit/test/qa-functional/data/XSLTTestProject/catalog.xml
visualweb.samples.bundled/webapps/MovieAdmin/catalog.xml
visualweb.samples.bundled/webapps/SinglePageCrudForm/catalog.xml
visualweb.samples.bundled/webapps/SinglePageCrudTable/catalog.xml
visualweb.samples.bundled/webapps/TravelCenter/catalog.xml
Comment 13 tonybeckham 2008-01-30 22:51:46 UTC
What about filing a separate issue for the cleanup process?
Comment 14 Quality Engineering 2011-11-02 15:16:09 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e901e5d61aae
User: Jesse Glick <jglick@netbeans.org>
Log: Cleanup of probably dead files; see bug #116072.
Leaving xml.wsdl.model/catalog.xml since it looked like it might be used for something.
Comment 15 Quality Engineering 2011-11-03 15:33:05 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e901e5d61aae
User: Jesse Glick <jglick@netbeans.org>
Log: Cleanup of probably dead files; see bug #116072.
Leaving xml.wsdl.model/catalog.xml since it looked like it might be used for something.