This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit e5f1abf3bd7459d547d2d6e2c45dc05073f7a46b Author: Martin Desruisseaux <[email protected]> AuthorDate: Tue Jan 6 10:35:03 2026 +0100 Fix wrong value of `ArithmeticFunction.getResultClass()`. Minor code formatting (spaces). --- .../main/org/apache/sis/coverage/CategoryList.java | 2 +- .../org/apache/sis/feature/StringJoinOperation.java | 2 +- .../org/apache/sis/filter/DefaultFilterFactory.java | 2 +- .../org/apache/sis/filter/math/ArithmeticFunction.java | 18 ++++++++++-------- .../main/org/apache/sis/image/AnnotatedImage.java | 4 ++-- .../sis/image/internal/shared/TileOpExecutor.java | 2 +- .../apache/sis/filter/visitor/FunctionNamesTest.java | 4 ++-- .../main/org/apache/sis/metadata/StateChanger.java | 2 +- .../main/org/apache/sis/util/iso/Types.java | 2 +- .../main/org/apache/sis/xml/LegacyCodes.java | 2 +- .../main/org/apache/sis/xml/Pooled.java | 6 +++--- .../org/apache/sis/xml/bind/FinalClassExtensions.java | 2 +- .../test/org/apache/sis/metadata/iso/APIVerifier.java | 2 +- .../main/org/apache/sis/io/wkt/StoredTree.java | 8 ++++---- .../main/org/apache/sis/io/wkt/WKTFormat.java | 4 ++-- .../main/org/apache/sis/storage/aggregate/Group.java | 2 +- .../org/apache/sis/storage/base/MetadataBuilder.java | 2 +- .../main/org/apache/sis/measure/UnitRegistry.java | 4 ++-- .../main/org/apache/sis/util/Locales.java | 2 +- .../main/org/apache/sis/util/collection/Cache.java | 4 ++-- .../org/apache/sis/util/collection/Containers.java | 2 +- .../org/apache/sis/util/collection/DerivedMap.java | 2 +- .../apache/sis/util/collection/WeakValueHashMap.java | 4 ++-- .../apache/sis/util/internal/shared/AbstractMap.java | 2 +- .../org/apache/sis/util/internal/shared/Cloner.java | 2 +- .../test/org/apache/sis/test/Assertions.java | 2 +- .../main/org/apache/sis/storage/isobmff/Reader.java | 2 +- 27 files changed, 47 insertions(+), 45 deletions(-) diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/CategoryList.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/CategoryList.java index 27382507bf..bba233abf1 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/CategoryList.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/CategoryList.java @@ -120,7 +120,7 @@ final class CategoryList extends AbstractList<Category> implements MathTransform /** * Index of the last used category. We assume that this category is the most likely to be * requested in the next {@code transform(…)} method invocation. This field does not need - * to be volatile because it is not a problem if a thread see an outdated value; this is + * to be volatile because it is not a problem if a thread see an outdated value. This is * only a hint, and the arrays used with this index are immutable. */ private transient int lastUsed; diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java index 34f69dc0af..32282145e0 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java @@ -95,7 +95,7 @@ final class StringJoinOperation extends AbstractOperation { * semantic of {@link ObjectConverter#inverse()}, but this is okay for {@link StringJoinOperation} needs. * This converter should never be accessible to users however. */ - private static final class ForFeature extends SurjectiveConverter<Object,Object> implements Serializable { + private static final class ForFeature extends SurjectiveConverter<Object, Object> implements Serializable { /** For cross-version compatibility. */ private static final long serialVersionUID = 2208230611402221572L; diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DefaultFilterFactory.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DefaultFilterFactory.java index 7b173219e8..095fe5cd6e 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DefaultFilterFactory.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DefaultFilterFactory.java @@ -187,7 +187,7 @@ public abstract class DefaultFilterFactory<R,G,T> extends AbstractFactory implem * * @see #forFeatures() */ - static final Features<Object,Object> DEFAULT = new Features<>(Object.class, Object.class, WraparoundMethod.SPLIT); + static final Features<Object, Object> DEFAULT = new Features<>(Object.class, Object.class, WraparoundMethod.SPLIT); /** * Creates a new factory operating on {@link Feature} instances. diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/math/ArithmeticFunction.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/math/ArithmeticFunction.java index a0e6f9c8eb..aa94231833 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/math/ArithmeticFunction.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/math/ArithmeticFunction.java @@ -72,14 +72,16 @@ public abstract class ArithmeticFunction<R, A extends Number> extends BinaryFunc public Class<? extends Number> getResultClass() { NumberType type = widestOperandType(); switch (type) { - case BYTE: return Short.class; - case SHORT: return Integer.class; - case INTEGER: return Long.class; - case LONG: return Number.class; // Because of the possibility of overflow. - } - type = effective(type); - if (type.isReal()) { - return type.classOfValues(false).asSubclass(Number.class); + case BYTE: + case SHORT: + case INTEGER: return Long.class; // `applyAsLong(…)` is used for all these types. + case LONG: break; // Because of the possibility of overflow. + default: { + type = effective(type); + if (type.isReal()) { + return type.classOfValues(false).asSubclass(Number.class); + } + } } return Number.class; } diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/AnnotatedImage.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/AnnotatedImage.java index 5ef1de0bad..2165cd121c 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/AnnotatedImage.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/AnnotatedImage.java @@ -83,7 +83,7 @@ abstract class AnnotatedImage extends ImageAdapter { * computation failed for some tiles, that computation will be redone again for the same property * every time it is requested, until it eventually fully succeeds and the result become cached.</p> */ - private static final WeakHashMap<RenderedImage, Cache<Object,Object>> CACHE = new WeakHashMap<>(); + private static final WeakHashMap<RenderedImage, Cache<Object, Object>> CACHE = new WeakHashMap<>(); /** * Cache of property values computed for the {@linkplain #source} image. This is an entry from the @@ -97,7 +97,7 @@ abstract class AnnotatedImage extends ImageAdapter { * <p>Keys are {@link String} instances containing directly the property name when {@link #areaOfInterest} * and {@link #getExtraParameter()} are {@code null}, or {@link CacheKey} instances otherwise.</p> */ - private final Cache<Object,Object> cache; + private final Cache<Object, Object> cache; /** * Keys in the {@link AnnotatedImage#cache} when {@link AnnotatedImage#areaOfInterest} is non-null. diff --git a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/TileOpExecutor.java b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/TileOpExecutor.java index 86dde6b52f..a7863e9bc8 100644 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/TileOpExecutor.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/image/internal/shared/TileOpExecutor.java @@ -823,7 +823,7 @@ public class TileOpExecutor { /** * A thread-local variable which is given to each invocation of the {@link #processor}. * Processor implementation can use this instance for storing or updating information. - * No synchronization is needed since this instance is not shared by other threads. + * No synchronization is needed since this instance is not shared with other threads. * This value may be {@code null} if no such object is needed. */ protected final A accumulator; diff --git a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/filter/visitor/FunctionNamesTest.java b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/filter/visitor/FunctionNamesTest.java index 74a9844cc8..70fabecdfc 100644 --- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/filter/visitor/FunctionNamesTest.java +++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/filter/visitor/FunctionNamesTest.java @@ -111,7 +111,7 @@ public final class FunctionNamesTest extends TestCase { */ @Test public void verifyLiteral() { - final var expression = new Literal<Object,Object>() { + final var expression = new Literal<Object, Object>() { @Override public Object getValue() {return null;} @Override public <N> Expression<Object, N> toValueType(Class<N> target) { throw new UnsupportedOperationException(); @@ -125,7 +125,7 @@ public final class FunctionNamesTest extends TestCase { */ @Test public void verifyValueReference() { - final var expression = new ValueReference<Object,Object>() { + final var expression = new ValueReference<Object, Object>() { @Override public String getXPath() {return null;} @Override public Object apply(Object o) {return null;} @Override public Class<Object> getResourceClass() {return Object.class;} diff --git a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/StateChanger.java b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/StateChanger.java index aaa9a71127..69c2c50d35 100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/StateChanger.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/StateChanger.java @@ -201,7 +201,7 @@ final class StateChanger extends MetadataVisitor<Boolean> { */ if (object instanceof Map<?,?>) { final var map = new LinkedHashMap<Object, Object>((Map<?,?>) object); - for (final Map.Entry<Object,Object> entry : map.entrySet()) { + for (final Map.Entry<Object, Object> entry : map.entrySet()) { entry.setValue(applyTo(entry.getValue())); } return Containers.unmodifiable(map); diff --git a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java index f583525d49..9f716a2410 100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java @@ -504,7 +504,7 @@ public final class Types { * which are expected to be internized anyway when the corresponding classes are loaded. */ typeForNames = JDK19.newHashMap(2 * props.size()); - for (final Map.Entry<Object,Object> e : props.entrySet()) { + for (final Map.Entry<Object, Object> e : props.entrySet()) { final String key = ((String) e.getKey()).intern(); final String value = ((String) e.getValue()).intern(); typeForNames.put(key, value); diff --git a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/LegacyCodes.java b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/LegacyCodes.java index 63bb8bc9f0..f8cdcf7580 100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/LegacyCodes.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/LegacyCodes.java @@ -58,7 +58,7 @@ final class LegacyCodes { final int capacity = Containers.hashMapCapacity(codes.size()); IANA_TO_LEGACY = new HashMap<>(capacity); LEGACY_TO_IANA = new HashMap<>(capacity); - for (final Map.Entry<Object,Object> entry : codes.entrySet()) { + for (final Map.Entry<Object, Object> entry : codes.entrySet()) { final String legacy = ((String) entry.getKey()).intern(); final String name = ((String) entry.getValue()).intern(); IANA_TO_LEGACY.put(name .toUpperCase(Locale.US), legacy); // IANA names are restricted to US-ASCII. diff --git a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/Pooled.java b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/Pooled.java index 5327eea246..6349fa0999 100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/Pooled.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/Pooled.java @@ -78,7 +78,7 @@ abstract class Pooled { * * This map is never {@code null}. */ - final Map<Object,Object> initialProperties = new LinkedHashMap<>(); + final Map<Object, Object> initialProperties = new LinkedHashMap<>(); /** * Bit masks for various boolean attributes. This include whatever the language codes @@ -194,7 +194,7 @@ abstract class Pooled { */ final void initialize(final Pooled template) throws JAXBException { reset(template); // Set the SIS properties first. JAXB properties are set below. - for (final Map.Entry<Object,Object> entry : template.initialProperties.entrySet()) { + for (final Map.Entry<Object, Object> entry : template.initialProperties.entrySet()) { setStandardProperty((String) entry.getKey(), entry.getValue()); } } @@ -208,7 +208,7 @@ abstract class Pooled { * @throws JAXBException if an error occurred while restoring a property. */ public final void reset(final Pooled template) throws JAXBException { - for (final Map.Entry<Object,Object> entry : initialProperties.entrySet()) { + for (final Map.Entry<Object, Object> entry : initialProperties.entrySet()) { reset(entry.getKey(), entry.getValue()); } initialProperties.clear(); diff --git a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/bind/FinalClassExtensions.java b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/bind/FinalClassExtensions.java index 0cb55221dd..877443fab4 100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/bind/FinalClassExtensions.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/bind/FinalClassExtensions.java @@ -65,7 +65,7 @@ public final class FinalClassExtensions { * <h4>Synchronization</h4> * All accesses to this map shall be synchronized on the map object. */ - private static final Map<Object,Object> SENTINEL_VALUES = new IdentityHashMap<>(); + private static final Map<Object, Object> SENTINEL_VALUES = new IdentityHashMap<>(); /** * Do not allow instantiation of this class. diff --git a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/APIVerifier.java b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/APIVerifier.java index 9bfbfef1ec..e8e4c67d1e 100644 --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/APIVerifier.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/iso/APIVerifier.java @@ -96,7 +96,7 @@ public final class APIVerifier extends TestCase { throws ClassNotFoundException, NoSuchMethodException { final Set<Method> classChanges = new HashSet<>(); - for (final Map.Entry<Object,Object> entry : changes.entrySet()) { + for (final Map.Entry<Object, Object> entry : changes.entrySet()) { final Class<?> implementation = standard.getImplementation(Class.forName((String) entry.getKey())); for (final String change : (String[]) CharSequences.split((String) entry.getValue(), ' ')) { switch (change.charAt(0)) { diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/StoredTree.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/StoredTree.java index 411150c6b3..eb1dc10e38 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/StoredTree.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/StoredTree.java @@ -333,7 +333,7 @@ final class StoredTree implements Serializable { * @param tree root of the tree of WKT elements. * @param sharedValues pool to use for sharing unique instances of values. */ - StoredTree(final Element tree, final Map<Object,Object> sharedValues) { + StoredTree(final Element tree, final Map<Object, Object> sharedValues) { final Deflater deflater = new Deflater(sharedValues); root = (Node) deflater.unique(new Node(deflater, tree)); offsets = deflater.offsets(); @@ -346,7 +346,7 @@ final class StoredTree implements Serializable { * @param trees roots of the trees of WKT elements. * @param sharedValues pool to use for sharing unique instances of values. */ - StoredTree(final List<Element> trees, final Map<Object,Object> sharedValues) { + StoredTree(final List<Element> trees, final Map<Object, Object> sharedValues) { final Deflater deflater = new Deflater(sharedValues); root = new Node(deflater, trees); // Do not invoke `unique(…)` on anymous node. offsets = deflater.offsets(); @@ -380,7 +380,7 @@ final class StoredTree implements Serializable { * This is a copy of {@link WKTFormat#sharedValues} map. * This is reset to {@code null} when not needed anymore. */ - private Map<Object,Object> sharedValues; + private Map<Object, Object> sharedValues; /** * The {@link Element#offset} value of {@link StoredTree#root} together with offsets of all @@ -400,7 +400,7 @@ final class StoredTree implements Serializable { * * @param sharedValues pool of previously created objects. */ - Deflater(final Map<Object,Object> sharedValues) { + Deflater(final Map<Object, Object> sharedValues) { this.sharedValues = sharedValues; offsets = new short[24]; } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/WKTFormat.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/WKTFormat.java index 389ad65012..3a858540fd 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/WKTFormat.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/WKTFormat.java @@ -267,7 +267,7 @@ public class WKTFormat extends CompoundFormat<Object> { * The only cost of destroying the map too aggressively is that we may have more instance duplications * than what we would otherwise have.</p> */ - private transient Map<Object,Object> sharedValues; + private transient Map<Object, Object> sharedValues; /** * A formatter using the same symbols as the {@linkplain #parser}. @@ -1040,7 +1040,7 @@ public class WKTFormat extends CompoundFormat<Object> { * for the source of logging messages which is the enclosing {@code WKTParser} instead of a factory. * Also provides a mechanism for adding default identifier to root {@link IdentifiedObject}. */ - private final class Parser extends GeodeticObjectParser implements Function<Object,Object> { + private final class Parser extends GeodeticObjectParser implements Function<Object, Object> { /** Creates a new parser. */ Parser(final URI sourceFile, final Map<String,StoredTree> fragments, final Symbols symbols, final NumberFormat numberFormat, final DateFormat dateFormat, final UnitFormat unitFormat, diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/aggregate/Group.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/aggregate/Group.java index c586d86edb..c5b9fcea72 100644 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/aggregate/Group.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/aggregate/Group.java @@ -57,7 +57,7 @@ abstract class Group<E> { * of {@link CoverageAggregator}, which is then shared by all groups contained in the aggregator. * The keys and values in the pool shall be immutable or objects handled as if they were immutable. */ - private final Map<Object,Object> sharedInstances; + private final Map<Object, Object> sharedInstances; /** * The processor to use for creating grid coverages. This is the place where, for example, diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java index fdb3fbe605..705f54d29c 100644 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java @@ -161,7 +161,7 @@ public class MetadataBuilder { * <tr><td>Other</td> <td>Same as key</td> <td>{@link #shared(Class, Object)}</td></tr> * </table> */ - private final Map<Object,Object> sharedValues = new HashMap<>(); + private final Map<Object, Object> sharedValues = new HashMap<>(); /** * Whether to add ISO 19115-1 and ISO 19115-2 entries in "metadata standards" node. diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitRegistry.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitRegistry.java index 0a218e68cb..50a5fe61c5 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitRegistry.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitRegistry.java @@ -101,7 +101,7 @@ final class UnitRegistry implements SystemOfUnits, Serializable { * N⋅m is considered equivalent to m⋅N, and both of them are associated to the symbol "J" (Joule). * We ignore dimension order because it has no incidence on the unit symbol shown to user. */ - private static final Map<Object,Object> HARD_CODED = new HashMap<>(256); + private static final Map<Object, Object> HARD_CODED = new HashMap<>(256); /** * Units defined by the user. Accesses to this map implies synchronization. @@ -121,7 +121,7 @@ final class UnitRegistry implements SystemOfUnits, Serializable { * the user-defined map will typically stay empty. This separation avoids synchronization of hard-coded values. * Furthermore the two maps have a different policy on whether to consider dimension order as significant. */ - private static final WeakValueHashMap<Object,Object> USER_DEFINED = new WeakValueHashMap<>(Object.class, + private static final WeakValueHashMap<Object, Object> USER_DEFINED = new WeakValueHashMap<>(Object.class, UnitRegistry::hashCodeOrdered, UnitRegistry::equalsOrdered); diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Locales.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Locales.java index 7ae0d8b24a..85bdccb939 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Locales.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Locales.java @@ -53,7 +53,7 @@ public final class Locales { * * @see #unique(Locale) */ - private static final Map<Locale,Locale> POOL; + private static final Map<Locale, Locale> POOL; static { final Locale[] locales = Locale.getAvailableLocales(); POOL = JDK19.newHashMap(locales.length); diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Cache.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Cache.java index b30d79d546..7b23f38cab 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Cache.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Cache.java @@ -644,7 +644,7 @@ public class Cache<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V> { ensureValidType(value); /** Similar to {@link Cache.ReplaceAdapter}, but adapted to the merge case. */ - final class Adapter implements BiFunction<Object,Object,Object> { + final class Adapter implements BiFunction<Object, Object, Object> { /** Forwards {@link Cache#map} calls to the user-provided function. */ @Override public Object apply(final Object oldValue, final Object givenValue) { final V toReplace = valueOf(oldValue); @@ -670,7 +670,7 @@ public class Cache<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V> { * Before to forward the calls, {@code ReplaceAdapter} verifies if the value is under computation. If yes, then * this adapter blocks until the value is available for forwarding it to the user. */ - private final class ReplaceAdapter implements BiFunction<K,Object,Object> { + private final class ReplaceAdapter implements BiFunction<K, Object, Object> { /** The new values for which to send notifications. */ private Deferred<K,V> changes; diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Containers.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Containers.java index d8bbe529f5..f4178ed061 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Containers.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/Containers.java @@ -685,7 +685,7 @@ public final class Containers { * Consequently, any change in the original map is immediately visible in the derived map, * and conversely. * - * <p>The {@link Map#put(Object,Object) Map.put(K,V)} method is supported only if the given + * <p>The {@link Map#put(Object, Object) Map.put(K,V)} method is supported only if the given * converters are {@linkplain org.apache.sis.math.FunctionProperty#INVERTIBLE invertible}. * An invertible converter is not mandatory for other {@code Map} operations like {@link Map#get(Object)}, * but some of them may be faster if the inverse converters are available.</p> diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/DerivedMap.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/DerivedMap.java index 76e4a7c628..3a4b177830 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/DerivedMap.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/DerivedMap.java @@ -180,7 +180,7 @@ class DerivedMap<SK,SV,K,V> extends AbstractMap<K,V> implements } /** - * Implementation of the {@link #put(Object,Object)} method storing the given converted entry + * Implementation of the {@link #put(Object, Object)} method storing the given converted entry * to the storage map. The {@code original} key is used only for formatting an error message * in case of failure. */ diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/WeakValueHashMap.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/WeakValueHashMap.java index 84f4e6d716..cf5c57da28 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/WeakValueHashMap.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/collection/WeakValueHashMap.java @@ -104,7 +104,7 @@ public class WeakValueHashMap<K,V> extends AbstractMap<K,V> { * Shall be consistent with {@link #hashFunction}. * The arguments given in calls to {@code test(Object, Object)} will never be null. */ - private final BiPredicate<Object,Object> comparator; + private final BiPredicate<Object, Object> comparator; /** * An entry in the {@link WeakValueHashMap}. This is a weak reference @@ -299,7 +299,7 @@ public class WeakValueHashMap<K,V> extends AbstractMap<K,V> { @SuppressWarnings({"rawtypes", "unchecked"}) // Generic array creation. public WeakValueHashMap(final Class<K> keyType, final ToIntFunction<Object> hashFunction, - final BiPredicate<Object,Object> comparator) + final BiPredicate<Object, Object> comparator) { this.keyType = Objects.requireNonNull(keyType); this.hashFunction = Objects.requireNonNull(hashFunction); diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/AbstractMap.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/AbstractMap.java index bf82e5bbbf..2da8ee66e8 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/AbstractMap.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/AbstractMap.java @@ -57,7 +57,7 @@ import org.apache.sis.util.resources.Errors; * <ul> * <li>{@link #clear()}</li> * <li>{@link #remove(Object)}</li> - * <li>{@link #put(Object,Object)}</li> + * <li>{@link #put(Object, Object)}</li> * <li>{@link #addKey(Object)} (non-standard, optional method)</li> * <li>{@link #addValue(Object)} (non-standard, optional method)</li> * </ul> diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/Cloner.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/Cloner.java index 1ce4fc1c1f..d9603c15c6 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/Cloner.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/internal/shared/Cloner.java @@ -59,7 +59,7 @@ public final class Cloner { * This is used for preserving reference graph, and also as a safety against infinite recursion. * Keys must be compared using identity comparison, not {@link Object#equals(Object)}. */ - private final IdentityHashMap<Object,Object> cloneResults; + private final IdentityHashMap<Object, Object> cloneResults; /** * Creates a new {@code Cloner} instance which requires public {@code clone()} method to be present. diff --git a/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java b/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java index a9ae0e1e85..f7568a93d3 100644 --- a/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java +++ b/endorsed/src/org.apache.sis.util/test/org/apache/sis/test/Assertions.java @@ -521,7 +521,7 @@ public final class Assertions { */ public static void assertMapEquals(final Map<?,?> expected, final Map<?,?> actual) { if (expected != null && actual != null && !expected.isEmpty()) { - final var r = new LinkedHashMap<Object,Object>(expected); + final var r = new LinkedHashMap<Object, Object>(expected); for (final Map.Entry<?,?> entry : actual.entrySet()) { final Object key = entry.getKey(); if (!r.containsKey(key)) { diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Reader.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Reader.java index 297d93e1b2..cea92bb39c 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Reader.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/Reader.java @@ -100,7 +100,7 @@ public final class Reader implements Cloneable { * * @see #unique(Object) */ - public final Map<Object,Object> sharedObjects; + public final Map<Object, Object> sharedObjects; /** * Arbitrary objects identifying warnings that have already been reported.
