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 99363 - [guards] GuardedSectionsProvider has to support Charset
Summary: [guards] GuardedSectionsProvider has to support Charset
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2007-03-29 10:45 UTC by Jan Pokorsky
Modified: 2007-11-05 13:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed api change (15.83 KB, text/plain)
2007-06-19 18:16 UTC, Jan Pokorsky
Details
impl of the api change + modified clients (38.11 KB, text/plain)
2007-06-19 18:17 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2007-03-29 10:45:31 UTC
In order to use proper encoding by guards impl it seems to be necessary to
change GuardedSectionsProvider to accept encoding in better way then as String.
I would propose to replace present methods

Reader createGuardedReader(InputStream stream, String encoding) throws
UnsupportedEncodingException;
Writer createGuardedWriter(OutputStream stream, String encoding) throws
UnsupportedEncodingException;

with 

Reader createGuardedReader(InputStream stream, Charset encoding)
Writer createGuardedWriter(OutputStream stream, Charset encoding)

or with 

Reader createGuardedReader(Reader r)
Writer createGuardedWriter(Writer w)

This will ensure that e.g. in case of XML files client of API would not be
forced to parse file for encoding and later create a new stream using proper
encoding.

The change is incompatible but since the API has not been released yet I guess
it is acceptable to change the interface this way. I will update clients.
Comment 1 Vitezslav Stejskal 2007-03-30 01:54:10 UTC
I think you should take it to apireviews@, at least to let people know about the
change. I guess nobody will object the change if the api hasn't been published yet.
Comment 2 Jan Pokorsky 2007-03-30 12:17:34 UTC
I know. I wanted this to be filed. There are higher priority issues to solve now.
Comment 3 Jan Pokorsky 2007-06-19 18:16:15 UTC
Created attachment 43989 [details]
proposed api change
Comment 4 Jan Pokorsky 2007-06-19 18:17:42 UTC
Created attachment 43991 [details]
impl of the api change + modified clients
Comment 5 Jan Pokorsky 2007-06-19 18:28:58 UTC
I have implemented the first option replacing 'String encoding' with 'Charset charset' in GuardedSectionsProvider. I
also changed the API category level from Under Development to Official (org.netbeans.modules.editor.guards/1 spec 1.0).
Comment 6 Jan Pokorsky 2007-06-19 18:35:51 UTC
I would like to ask for fast review of this issue. The change is really simple and I hope it would be still possible to
integrate this to 6.0M10.
Comment 7 Jaroslav Tulach 2007-06-20 08:55:10 UTC
Integrate it to M10, it is an incompatible change and the sooner it is done, the better.

No changes in tests? That looks like your API is not much tested.
Comment 8 David Kaspar 2007-06-20 12:33:13 UTC
The second patch looks ok for Mobility Pack needs.
Comment 9 Jan Pokorsky 2007-06-20 13:45:50 UTC
Thanks for review I will integrate it.
Comment 10 Jan Pokorsky 2007-06-20 15:50:59 UTC
fixed in

RCS file: /cvs/editor/guards/apichanges.xml,v
done
Checking in editor/guards/apichanges.xml;
/cvs/editor/guards/apichanges.xml,v  <--  apichanges.xml
initial revision: 1.1
done
Checking in editor/guards/arch.xml;
/cvs/editor/guards/arch.xml,v  <--  arch.xml
new revision: 1.5; previous revision: 1.4
done
Checking in editor/guards/manifest.mf;
/cvs/editor/guards/manifest.mf,v  <--  manifest.mf
new revision: 1.3; previous revision: 1.2
done
Checking in editor/guards/nbproject/project.properties;
/cvs/editor/guards/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in editor/guards/src/org/netbeans/modules/editor/guards/GuardedReader.java;
/cvs/editor/guards/src/org/netbeans/modules/editor/guards/GuardedReader.java,v  <--  GuardedReader.java
new revision: 1.3; previous revision: 1.2
done
Checking in editor/guards/src/org/netbeans/modules/editor/guards/GuardedSectionsImpl.java;
/cvs/editor/guards/src/org/netbeans/modules/editor/guards/GuardedSectionsImpl.java,v  <--  GuardedSectionsImpl.java
new revision: 1.5; previous revision: 1.4
done
Checking in editor/guards/src/org/netbeans/modules/editor/guards/GuardedWriter.java;
/cvs/editor/guards/src/org/netbeans/modules/editor/guards/GuardedWriter.java,v  <--  GuardedWriter.java
new revision: 1.4; previous revision: 1.3
done
Checking in editor/guards/src/org/netbeans/spi/editor/guards/GuardedSectionsProvider.java;
/cvs/editor/guards/src/org/netbeans/spi/editor/guards/GuardedSectionsProvider.java,v  <--  GuardedSectionsProvider.java
new revision: 1.4; previous revision: 1.3
done
Checking in editor/guards/src/org/netbeans/spi/editor/guards/support/AbstractGuardedSectionsProvider.java;
/cvs/editor/guards/src/org/netbeans/spi/editor/guards/support/AbstractGuardedSectionsProvider.java,v  <-- 
AbstractGuardedSectionsProvider.java
new revision: 1.6; previous revision: 1.5
done
Checking in i18n/form/nbproject/project.xml;
/cvs/i18n/form/nbproject/project.xml,v  <--  project.xml
new revision: 1.18; previous revision: 1.17
done
Checking in java/guards/nbproject/project.xml;
/cvs/java/guards/nbproject/project.xml,v  <--  project.xml
new revision: 1.4; previous revision: 1.3
done
Checking in javadoc/nbproject/project.xml;
/cvs/javadoc/nbproject/project.xml,v  <--  project.xml
new revision: 1.24; previous revision: 1.23
done
Checking in form/nbproject/project.xml;
/cvs/form/nbproject/project.xml,v  <--  project.xml
new revision: 1.44; previous revision: 1.43
done
Checking in form/src/org/netbeans/modules/form/FormEditorSupport.java;
/cvs/form/src/org/netbeans/modules/form/FormEditorSupport.java,v  <--  FormEditorSupport.java
new revision: 1.210; previous revision: 1.209
done
Checking in form/swingapp/nbproject/project.xml;
/cvs/form/swingapp/nbproject/project.xml,v  <--  project.xml
new revision: 1.8; previous revision: 1.7
done
Checking in refactoring/api/nbproject/project.xml;
/cvs/refactoring/api/nbproject/project.xml,v  <--  project.xml
new revision: 1.12; previous revision: 1.11
done
Checking in mobility/designer/nbproject/project.xml;
/cvs/mobility/designer/nbproject/project.xml,v  <--  project.xml
new revision: 1.11; previous revision: 1.10
done
Checking in mobility/designer2/codegen/nbproject/project.xml;
/cvs/mobility/designer2/codegen/nbproject/project.xml,v  <--  project.xml
new revision: 1.4; previous revision: 1.3
done
Checking in mobility/designer2/io/nbproject/project.xml;
/cvs/mobility/designer2/io/nbproject/project.xml,v  <--  project.xml
new revision: 1.5; previous revision: 1.4
done
Checking in mobility/designer2/iojavame/nbproject/project.xml;
/cvs/mobility/designer2/iojavame/nbproject/project.xml,v  <--  project.xml
new revision: 1.7; previous revision: 1.6
done
Checking in mobility/designer2/midp/nbproject/project.xml;
/cvs/mobility/designer2/midp/nbproject/project.xml,v  <--  project.xml
new revision: 1.16; previous revision: 1.15
done
Checking in mobility/editor/src/org/netbeans/modules/mobility/editor/pub/J2MEDataObject.java;
/cvs/mobility/editor/src/org/netbeans/modules/mobility/editor/pub/J2MEDataObject.java,v  <--  J2MEDataObject.java
new revision: 1.7; previous revision: 1.6
done