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 66577

Summary: Make EditableProperties a public utility class
Product: platform Reporter: Sherold Dev <sherold>
Component: -- Other --Assignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker CC: apireviews
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 169481    
Bug Blocks: 153227, 166585    
Attachments: Proposed patch

Description Sherold Dev 2005-10-12 10:30:41 UTC
Make the org.netbeans.spi.project.support.ant.EditableProperties a public
utility class, i.e. move it to a package like org.openide.util.EditableProperties.

EditableProperties class is similar to java.util.Properties but it is designed
to retain additional information needed for safe hand-editing. Making this class
publicly available would be a great benefit to any module that have to deal with
properties file editing. An example here is the tomcatint module that has to
edit the catalina.properties file.

As Jesse pointed out, the main problem is that we cannot simply deprecate the
original version in ant/project because it is used in the signatures of other
ant/project API methods:

http://www.netbeans.org/download/dev/javadoc/org-netbeans-modules-project-ant/org/netbeans/spi/project/support/ant/class-use/EditableProperties.html

Here are some possibilities how to do the change, although non of them seems to
be convenient enough

1. all the methods referring to the old EditableProperties could also be
deprecated and replaced by the new version

2. the old EditableProperties could inherit from the new EditableProperties, if
they are left non final 

3. the old EditableProperties public methods could delegate to those in the new
EditableProperties

I would like to discuss here whether and how to do this api change.
Comment 1 Jan Lahoda 2005-10-12 10:37:06 UTC
This is IMO a subset of issue #65229, which I would like to adress (at least
partially) for a future realease.
Comment 2 Sherold Dev 2005-10-12 11:40:56 UTC
You are right -> duplicate

*** This issue has been marked as a duplicate of 65229 ***
Comment 3 Jesse Glick 2009-07-22 20:04:24 UTC
Closing duplicate, reopening this.
Comment 4 Jesse Glick 2009-07-22 23:16:47 UTC
Created attachment 85097 [details]
Proposed patch
Comment 5 Jesse Glick 2009-07-22 23:18:52 UTC
Using sherold's strategy #3. Please review.
Comment 6 Jesse Glick 2009-07-22 23:28:37 UTC
ruby.rakeproject/src/org/netbeans/modules/ruby/spi/project/support/rake/EditableProperties.java can probably also be
deleted, since it is only in a friend package. tomcat5/src/org/netbeans/modules/tomcat5/util/EditableProperties.java can
definitely be deleted, and probably also
compapp.projects.jbi/catdsrc/org/netbeans/modules/compapp/catd/util/EditableProperties.java.
Comment 7 Jesse Glick 2009-07-29 16:55:31 UTC
core-main #d3c768524b90
Comment 8 Quality Engineering 2009-07-30 06:02:46 UTC
Integrated into 'main-golden', will be available in build *200907300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d3c768524b90
User: Jesse Glick <jglick@netbeans.org>
Log: Issue #66577: make EditableProperties available even without a dep on project.ant; generally useful.