[Geoserver-devel] [geoserver/geoserver] [GEOS-10723] params.extractor Resource (PR #6304)

Hope I was able to tame my IDE now.

I analyzed many usages of Resource.in() to find a possible example for the docs.

Instead I found another example for which I’m in doubt if it works this way:

LoggingUtilsDelegate.java#L385

In general, beneath the try/resource blocks many exception handing code can be found filling lines and lines of code.

Turning the IOException into a UncheckedIOException (as I proposed in optionalRead()) may be a first step.

But many read functions throw a bunch of mixed Exceptions besides IOException like for example:

org.geotools.xsd.Parser:parse(InputStream)

These are often turned into a throws Exception clause (I made bad experience with).

Finally these are either converted into a RuntimeException or it is simply logged.

So, a solution may be to introduce some additional exception handler (?Consumer) to the read (and possible write) method.

This can either be a logging statement or something turning the Exception(s) into a RuntimeException.

All together this turns into a more extensive concept.

For [GEOS-10705 ] I’m happy, if no more empty files are created accidentally.

Btw: I still observe problems with [GEOS-10683] on Windows. Is this unrelated to GSIP-215?

Dieter.

···

Von: Andrea Aime notifications@anonymised.com
Gesendet: Montag, 31. Oktober 2022 12:28
An: geoserver/geoserver geoserver@anonymised.com
Cc: Dieter Stüken - con terra GmbH d.stueken@anonymised.com; Author author@anonymised.com
Betreff: Re: [geoserver/geoserver] [GEOS-10723] params.extractor Resource (PR #6304)

One legit QA failure:

2022-10-28T14:25:43.0874191Z 14:25:43,087 [INFO] PMD Failure: org.geoserver.platform.resource.Resource:8 Rule:wildcards Priority:3 No Wildcard Imports.

(wildcard imports are disallowed by the Google Java coding convention we adopted).

Besides that, the changes to the params-extractor module look good to me, but I’d like to have @jodygarnett review the changes to Resource. Thinking out loud, it looks like a good addition, but it’s also asymmetric, probably the same methods should be offered on the write side? Anyways, let’s hear from @jodygarnett


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: <geoserver/geoserver/pull/6304/c1296951523@anonymised.com>