This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch sonar
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git


The following commit(s) were added to refs/heads/sonar by this push:
     new 989de9b6 Check boxed boolean
989de9b6 is described below

commit 989de9b6829423a481f7c1a81fbfdd6f00b63501
Author: Bertil Chapuis <[email protected]>
AuthorDate: Thu Jun 13 00:39:30 2024 +0200

    Check boxed boolean
---
 .../src/main/java/org/apache/baremaps/data/type/BooleanDataType.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/baremaps-data/src/main/java/org/apache/baremaps/data/type/BooleanDataType.java
 
b/baremaps-data/src/main/java/org/apache/baremaps/data/type/BooleanDataType.java
index feb04b67..bdcefca6 100644
--- 
a/baremaps-data/src/main/java/org/apache/baremaps/data/type/BooleanDataType.java
+++ 
b/baremaps-data/src/main/java/org/apache/baremaps/data/type/BooleanDataType.java
@@ -21,6 +21,8 @@ package org.apache.baremaps.data.type;
 
 import java.nio.ByteBuffer;
 
+import static java.lang.Boolean.TRUE;
+
 /** A {@link DataType} for reading and writing bytes in {@link ByteBuffer}s. */
 public class BooleanDataType extends MemoryAlignedDataType<Boolean> {
 
@@ -32,7 +34,7 @@ public class BooleanDataType extends 
MemoryAlignedDataType<Boolean> {
   /** {@inheritDoc} */
   @Override
   public void write(final ByteBuffer buffer, final int position, final Boolean 
value) {
-    buffer.put(position, value ? (byte) 1 : (byte) 0);
+    buffer.put(position, TRUE.equals(value) ? (byte) 1 : (byte) 0);
   }
 
   /** {@inheritDoc} */

Reply via email to