Yeah that is a lot of hard work from Andrea (the checks benefit from lots of QA checks being performed).
Can you just make a new method? /** * .... * @param output output stream to be used for feature content * @param autoclose close writer after use * @return a writer */ public static Writer toWriter(OuputStreamWriter output, boolean autoclose); -- Jody Garnett On Tue, 17 Mar 2020 at 16:44, Jim Hughes <jhug...@ccri.com> wrote: > Hi Jody, > > This is more or less the approach that I described above. Since I was > encouraged to toss up a PR for that approach, I put one together. (By the > way, it was a good exercise. I really like the checkboxes and the new > improvements to the CI hooks! Those were awesome. I missed the formatting > on the first pass, but managed to address those issues easily enough. All > that was very, very easy to use...) > > The API as-is allows for implementation details to leak and be confusing. > While I was putting up the PR, I checked to see if GeoWebCache or GeoServer > use this capability and I don't think they do. Overall, if this doesn't > get addressed, I have a suitable workaround. It may be worth it for all to > move on. (I did enjoy the new and improved PR process. That was great!) > > Cheers, > > Jim > On 3/17/2020 7:02 PM, Jody Garnett wrote: > > I am not quite sure what I am seeing in this PR. > > I was going to ask you to add a note to the javadoc explaining the API > contract (ie that we trust users to close the provided writer). But then I > got confused, if I am reading the code correctly, the other writers > returned (for example BufferedWriter) will close end up the underlying > stream. > > This results in an inconsistent API contract... which I am not wild about. > > Since this is an unsupported module should we just break the existing API > contract in order to be clear about expectations? > -- > Jody Garnett > > > On Tue, 17 Mar 2020 at 15:33, Jim Hughes <jhug...@ccri.com> wrote: > >> Hi all, >> >> Here's a PR for the discussed approach: >> https://github.com/geotools/geotools/pull/2839 >> >> I'm not wild about it, but it does fix the 'regression' / change I saw. >> I think the idea of the method GeoJSONUtil.toWriter(Object output) is a bit >> too broad, and that means that any solution which keeps the API in place >> will be a little silly looking. >> >> If anyone doesn't like it, the identified approach can readily be used >> downstream in GeoMesa. >> >> Other than that, the GeoTools RC looks pretty reasonable. I'm hoping >> that we can kick the tires on the GeoServer RC, but that's uncertain. >> >> Cheers, >> >> Jim >> On 3/13/2020 3:34 AM, Andrea Aime wrote: >> >> On Thu, Mar 12, 2020 at 10:11 PM Jim Hughes <jhug...@ccri.com> wrote: >> >>> Hi Andrea, >>> >>> Ah! The context that some of the Objects need closing and others do not >>> helps clarify things. >>> >>> I just wrote a client side version of such a wrapper to see if it'd work >>> (it does). Sounds like an amendment to 'toWriter' to have a no-op-close >>> wrapper around the 1) BufferedWriter, 2) Writer, and 3) OutputStream would >>> fit the bill? >>> >>> If so, I can try to put something together. >>> >> Please go ahead! >> >> Cheers >> Andrea >> == >> >> GeoServer Professional Services from the experts! Visit >> http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf >> Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa >> (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 >> http://www.geo-solutions.it http://twitter.com/geosolutions_it >> ------------------------------------------------------- *Con riferimento >> alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - >> Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni >> circostanza inerente alla presente email (il suo contenuto, gli eventuali >> allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i >> destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per >> errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le >> sarei comunque grato se potesse darmene notizia. This email is intended >> only for the person or entity to which it is addressed and may contain >> information that is privileged, confidential or otherwise protected from >> disclosure. We remind that - as provided by European Regulation 2016/679 >> “GDPR” - copying, dissemination or use of this e-mail or the information >> herein by anyone other than the intended recipient is prohibited. If you >> have received this email by mistake, please notify us immediately by >> telephone or e-mail.* >> >>
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel