From 938f6e95216d107d95646da7be94e10e6cd44bc1 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Wed, 23 Aug 2023 09:14:09 +0200 Subject: [PATCH] replaced MethodHandles with custom reflection-less reflectivity --- .../demo/repository/CustomerRepository.java | 2 +- .../shautvast/contiguous/ListSerializer.java | 3 +- .../contiguous/ListSerializerTest.java | 5 ++- .../shautvast/contiguous/JdbcResultsTest.java | 14 ++++----- lib/pom.xml | 15 ++++++++- .../contiguous/BigDecimalHandler.java | 4 ++- .../contiguous/BigIntegerHandler.java | 4 ++- .../shautvast/contiguous/BufferCache.java | 2 -- .../contiguous/BuiltinTypeHandler.java | 13 +++++--- .../shautvast/contiguous/ByteHandler.java | 4 ++- .../shautvast/contiguous/ContiguousList.java | 31 ++++++++++++++----- .../shautvast/contiguous/DoubleHandler.java | 4 ++- .../shautvast/contiguous/FloatHandler.java | 4 ++- .../shautvast/contiguous/IntegerHandler.java | 4 ++- .../shautvast/contiguous/LongHandler.java | 4 ++- .../contiguous/NotImplementedList.java | 2 +- .../contiguous/PropertyHandlerFactory.java | 6 ++-- .../shautvast/contiguous/ShortHandler.java | 4 ++- .../shautvast/contiguous/StringHandler.java | 4 ++- .../shautvast/contiguous/TypeHandler.java | 16 +++++----- .../github/shautvast/contiguous/ByteBean.java | 2 +- .../shautvast/contiguous/DoubleBean.java | 2 +- .../shautvast/contiguous/FloatBean.java | 2 +- .../github/shautvast/contiguous/IntBean.java | 2 +- .../github/shautvast/contiguous/LongBean.java | 2 +- .../shautvast/contiguous/ShortBean.java | 2 +- 26 files changed, 103 insertions(+), 54 deletions(-) diff --git a/demo/src/main/java/com/github/shautvast/contiguous/demo/repository/CustomerRepository.java b/demo/src/main/java/com/github/shautvast/contiguous/demo/repository/CustomerRepository.java index bf905b2..67cf048 100644 --- a/demo/src/main/java/com/github/shautvast/contiguous/demo/repository/CustomerRepository.java +++ b/demo/src/main/java/com/github/shautvast/contiguous/demo/repository/CustomerRepository.java @@ -29,7 +29,7 @@ public class CustomerRepository { } public List getAllCustomersTraditional() { - return jdbcTemplate.query("select * from customers", (rs, rowNum) -> new Customer( + return jdbcTemplate.query("select * from customers limit 10000", (rs, rowNum) -> new Customer( rs.getString("name"),rs.getString("email"), rs.getString("streetname"), rs.getInt("housenumber"), rs.getString("city"), rs.getString("country") diff --git a/jackson/src/main/java/com/github/shautvast/contiguous/ListSerializer.java b/jackson/src/main/java/com/github/shautvast/contiguous/ListSerializer.java index f974316..fe43788 100644 --- a/jackson/src/main/java/com/github/shautvast/contiguous/ListSerializer.java +++ b/jackson/src/main/java/com/github/shautvast/contiguous/ListSerializer.java @@ -22,7 +22,8 @@ public class ListSerializer extends StdSerializer> { Iterator jsons = clist.jsonIterator(); while (jsons.hasNext()) { - generator.writeRawValue(jsons.next()); + String next = jsons.next(); + generator.writeRawValue(next); } generator.writeEndArray(); diff --git a/jackson/src/test/java/com/github/shautvast/contiguous/ListSerializerTest.java b/jackson/src/test/java/com/github/shautvast/contiguous/ListSerializerTest.java index eae29ca..5c879f8 100644 --- a/jackson/src/test/java/com/github/shautvast/contiguous/ListSerializerTest.java +++ b/jackson/src/test/java/com/github/shautvast/contiguous/ListSerializerTest.java @@ -10,16 +10,16 @@ import static org.junit.jupiter.api.Assertions.*; class ListSerializerTest { - private ObjectMapper mapper; @BeforeEach - public void setup(){ + public void setup() { mapper = new ObjectMapper(); final SimpleModule module = new SimpleModule("mySerializers"); module.addSerializer(new ListSerializer()); mapper.registerModule(module); } + @Test public void testStringList() throws JsonProcessingException { ContiguousList strings = new ContiguousList<>(String.class); @@ -42,7 +42,6 @@ class ListSerializerTest { strings.add(new AdamsObject("Publishing houses of Ursa Minor")); - String json = mapper.writeValueAsString(strings); assertEquals("[{\"name\": \"Vogon constructor fleet\"}," + "{\"name\": \"Restaurant at the end of the Galaxy\"}," + diff --git a/jdbc/src/test/java/com/github/shautvast/contiguous/JdbcResultsTest.java b/jdbc/src/test/java/com/github/shautvast/contiguous/JdbcResultsTest.java index a6a99ff..171a5fe 100644 --- a/jdbc/src/test/java/com/github/shautvast/contiguous/JdbcResultsTest.java +++ b/jdbc/src/test/java/com/github/shautvast/contiguous/JdbcResultsTest.java @@ -1,26 +1,22 @@ package com.github.shautvast.contiguous; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.Mockito; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.Map; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.mockito.Mockito.when; -@ExtendWith(MockitoExtension.class) class JdbcResultsTest { - @Mock - private ResultSet mockResults; - @Test public void testListOfString() throws SQLException { + ResultSet mockResults = Mockito.mock(ResultSet.class); when(mockResults.next()).thenReturn(true, false); when(mockResults.getObject(1)).thenReturn("Zaphod"); @@ -35,6 +31,7 @@ class JdbcResultsTest { @Test public void testListOfBean() throws SQLException { + ResultSet mockResults = Mockito.mock(ResultSet.class); when(mockResults.next()).thenReturn(true, false); // the shape of the result equals that of the result (name:String, age:int) when(mockResults.getObject("name")).thenReturn("Zaphod"); @@ -51,6 +48,7 @@ class JdbcResultsTest { @Test public void testNameMapping() throws SQLException { + ResultSet mockResults = Mockito.mock(ResultSet.class); when(mockResults.next()).thenReturn(true, false); when(mockResults.getObject("name")).thenReturn("Trillian"); when(mockResults.getObject("realName")).thenReturn("Tricia MacMillan"); diff --git a/lib/pom.xml b/lib/pom.xml index bd86205..3a55fa7 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -12,7 +12,7 @@ contiguous - Datastructures with contiguous storage. Core library with no external dependencies + Datastructures with contiguous storage. Core library jar @@ -21,6 +21,11 @@ UTF-8 + + com.github.shautvast + reflective + 1.2.1 + org.junit.jupiter junit-jupiter-engine @@ -40,4 +45,12 @@ test + + + + github + GitHub OWNER Apache Maven Packages + https://maven.pkg.github.com/shautvast/Contiguous + + \ No newline at end of file diff --git a/lib/src/main/java/com/github/shautvast/contiguous/BigDecimalHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/BigDecimalHandler.java index 3c80ecb..6150c9d 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/BigDecimalHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/BigDecimalHandler.java @@ -1,10 +1,12 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; import java.math.BigDecimal; class BigDecimalHandler extends BuiltinTypeHandler { - public BigDecimalHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public BigDecimalHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(BigDecimal.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/BigIntegerHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/BigIntegerHandler.java index 7da9133..183be82 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/BigIntegerHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/BigIntegerHandler.java @@ -1,10 +1,12 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; import java.math.BigInteger; class BigIntegerHandler extends BuiltinTypeHandler { - public BigIntegerHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public BigIntegerHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(BigInteger.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/BufferCache.java b/lib/src/main/java/com/github/shautvast/contiguous/BufferCache.java index b0f4ccb..2bc6190 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/BufferCache.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/BufferCache.java @@ -1,10 +1,8 @@ package com.github.shautvast.contiguous; -import java.lang.ref.SoftReference; import java.nio.ByteBuffer; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; /** * Boundless cache something diff --git a/lib/src/main/java/com/github/shautvast/contiguous/BuiltinTypeHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/BuiltinTypeHandler.java index 35446e9..ff8eff8 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/BuiltinTypeHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/BuiltinTypeHandler.java @@ -1,6 +1,6 @@ package com.github.shautvast.contiguous; -import java.lang.invoke.MethodHandle; +import com.github.shautvast.reflective.MetaMethod; /** * Base class for handlers. Its responsibility is to read and write a property from the incoming object to the internal storage. @@ -12,7 +12,7 @@ import java.lang.invoke.MethodHandle; * ie. when a bean is added or retrieved from the list */ abstract class BuiltinTypeHandler extends TypeHandler { - public BuiltinTypeHandler(Class type, String name, MethodHandle getter, MethodHandle setter) { + public BuiltinTypeHandler(Class type, String name, MetaMethod getter, MetaMethod setter) { super(type, name, getter, setter); } @@ -38,9 +38,9 @@ abstract class BuiltinTypeHandler extends TypeHandler { if (getter == null) { return (T) propertyValue; } - + System.out.println(propertyValue.getClass()); try { - return (T) getter.invoke(propertyValue); + return (T) getter.invoke(propertyValue).unwrap(); } catch (Throwable e) { throw new IllegalStateException(e); } @@ -57,8 +57,11 @@ abstract class BuiltinTypeHandler extends TypeHandler { * @param value the value that has been read from ContiguousList storage */ public void setValue(Object instance, Object value) { + System.out.println(instance.getClass()); + System.out.println(cast(value)); + System.out.println(setter.getMetaClass().getJavaClass().getName()); try { - setter.invokeWithArguments(instance, cast(value)); + setter.invoke(instance, cast(value)).unwrap(); } catch (Throwable e) { throw new IllegalStateException(e); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/ByteHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/ByteHandler.java index badd6fa..4e0d47e 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/ByteHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/ByteHandler.java @@ -1,5 +1,7 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; /** @@ -7,7 +9,7 @@ import java.lang.invoke.MethodHandle; */ class ByteHandler extends BuiltinTypeHandler { - public ByteHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public ByteHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(Byte.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/ContiguousList.java b/lib/src/main/java/com/github/shautvast/contiguous/ContiguousList.java index c6b8256..919e749 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/ContiguousList.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/ContiguousList.java @@ -1,5 +1,10 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.InvokerFactory; +import com.github.shautvast.reflective.MetaClass; +import com.github.shautvast.reflective.MetaMethod; +import com.github.shautvast.reflective.Reflective; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.reflect.InvocationTargetException; @@ -73,7 +78,7 @@ public class ContiguousList extends NotImplementedList implements List elementIndices.add(0); // index of first element } - public void close(){ + public void close() { BufferCache.release(this.data); } @@ -100,13 +105,15 @@ public class ContiguousList extends NotImplementedList implements List * using reflection find all properties in the element, recursing down when the property is compound */ private void addPropertyHandlersForCompoundType(Class type, CompoundTypeHandler parentCompoundType) { - final MethodHandles.Lookup lookup = getLookup(type); + MetaClass metaType = Reflective.getMetaClass(type); Arrays.stream(type.getDeclaredFields()) .forEach(field -> { try { Class fieldType = field.getType(); - MethodHandle getter = lookup.findGetter(type, field.getName(), fieldType); - MethodHandle setter = lookup.findSetter(type, field.getName(), fieldType); + + String capitalized = capitalize(field.getName()); + MetaMethod getter = metaType.getMethod("get" + capitalized).get(); + MetaMethod setter = metaType.getMethod("set" + capitalized).get(); Optional typeHandler = PropertyHandlerFactory.forType(fieldType, field.getName(), getter, setter); if (typeHandler.isPresent()) { @@ -161,7 +168,7 @@ public class ContiguousList extends NotImplementedList implements List } else { CompoundTypeHandler child = ((CompoundTypeHandler) property); try { - Object result = child.getGetter().invoke(element); + Object result = child.getGetter().invoke(element).unwrap(); storePropertyData(result, child); } catch (Throwable e) { throw new RuntimeException(e); @@ -213,7 +220,9 @@ public class ContiguousList extends NotImplementedList implements List compoundType.getProperties().forEach(property -> { if (property instanceof BuiltinTypeHandler) { BuiltinTypeHandler type = ((BuiltinTypeHandler) property); - type.setValue(element, ValueReader.read(data)); + Object readValue = ValueReader.read(data); + System.out.println(readValue); + type.setValue(element, readValue); } else { try { CompoundTypeHandler p = (CompoundTypeHandler) property; @@ -221,7 +230,7 @@ public class ContiguousList extends NotImplementedList implements List Object newInstance = p.getType().getDeclaredConstructor().newInstance(); // set it on the parent - p.getSetter().invokeWithArguments(element, newInstance); + p.getSetter().invoke(element, newInstance); // recurse down copyDataIntoNewObject(newInstance, p); @@ -615,8 +624,9 @@ public class ContiguousList extends NotImplementedList implements List private void ensureFree(int length) { while (bufferPosition + length > data.capacity()) { ByteBuffer bytes = this.data; + bytes.position(0); BufferCache.release(this.data); - this.data = BufferCache.get((int)(bytes.capacity() * 1.5)); + this.data = BufferCache.get((int) (bytes.capacity() * 1.5)); this.data.put(bytes); } } @@ -745,4 +755,9 @@ public class ContiguousList extends NotImplementedList implements List } else return Varint.write(6); } } + + private String capitalize(String text) { + return text.substring(0, 1).toUpperCase() + text.substring(1); + } + } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/DoubleHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/DoubleHandler.java index fe7c814..51a3e84 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/DoubleHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/DoubleHandler.java @@ -1,12 +1,14 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; /** * Stores a double value. */ class DoubleHandler extends BuiltinTypeHandler { - public DoubleHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public DoubleHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(Double.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/FloatHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/FloatHandler.java index c0d0ba5..cb324fb 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/FloatHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/FloatHandler.java @@ -1,9 +1,11 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; class FloatHandler extends BuiltinTypeHandler { - public FloatHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public FloatHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(Float.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/IntegerHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/IntegerHandler.java index 308001c..e78641b 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/IntegerHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/IntegerHandler.java @@ -1,9 +1,11 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; class IntegerHandler extends BuiltinTypeHandler { - public IntegerHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public IntegerHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(Integer.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/LongHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/LongHandler.java index 7cb1981..e0e6438 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/LongHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/LongHandler.java @@ -1,9 +1,11 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; class LongHandler extends BuiltinTypeHandler { - public LongHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public LongHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(Long.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/NotImplementedList.java b/lib/src/main/java/com/github/shautvast/contiguous/NotImplementedList.java index 8214924..4ecc98e 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/NotImplementedList.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/NotImplementedList.java @@ -4,7 +4,7 @@ import java.util.*; import java.util.function.UnaryOperator; /** - * Base class that is a list of all the methods live that will likely not be implemented (pun intended) + * Base class with all the methods that will not be implemented * Only purpose: reduce linecount in the subclass. * * @param diff --git a/lib/src/main/java/com/github/shautvast/contiguous/PropertyHandlerFactory.java b/lib/src/main/java/com/github/shautvast/contiguous/PropertyHandlerFactory.java index 0ef95b6..fbbf820 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/PropertyHandlerFactory.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/PropertyHandlerFactory.java @@ -1,5 +1,7 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; @@ -38,10 +40,10 @@ final class PropertyHandlerFactory { } @SuppressWarnings("unchecked") - public static Optional forType(Class type, String name, MethodHandle getter, MethodHandle setter) { + public static Optional forType(Class type, String name, MetaMethod getter, MetaMethod setter) { return Optional.ofNullable(BUILTIN.get(type)).map(appenderClass -> { try { - return (BuiltinTypeHandler) appenderClass.getDeclaredConstructor(String.class, MethodHandle.class, MethodHandle.class) + return (BuiltinTypeHandler) appenderClass.getDeclaredConstructor(String.class, MetaMethod.class, MetaMethod.class) .newInstance(name, getter, setter); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) { diff --git a/lib/src/main/java/com/github/shautvast/contiguous/ShortHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/ShortHandler.java index c752c7f..86676c7 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/ShortHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/ShortHandler.java @@ -1,9 +1,11 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; class ShortHandler extends BuiltinTypeHandler { - public ShortHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public ShortHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(Short.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/StringHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/StringHandler.java index aed7d8e..8fb3460 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/StringHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/StringHandler.java @@ -1,9 +1,11 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; class StringHandler extends BuiltinTypeHandler { - public StringHandler(String propertyName, MethodHandle getter, MethodHandle setter) { + public StringHandler(String propertyName, MetaMethod getter, MetaMethod setter) { super(String.class, propertyName, getter, setter); } diff --git a/lib/src/main/java/com/github/shautvast/contiguous/TypeHandler.java b/lib/src/main/java/com/github/shautvast/contiguous/TypeHandler.java index de1193b..2735a35 100644 --- a/lib/src/main/java/com/github/shautvast/contiguous/TypeHandler.java +++ b/lib/src/main/java/com/github/shautvast/contiguous/TypeHandler.java @@ -1,5 +1,7 @@ package com.github.shautvast.contiguous; +import com.github.shautvast.reflective.MetaMethod; + import java.lang.invoke.MethodHandle; /** @@ -11,8 +13,8 @@ import java.lang.invoke.MethodHandle; */ public abstract class TypeHandler { - protected MethodHandle getter; // both can be null, if it's for a known ('primitive') type - protected MethodHandle setter; + protected MetaMethod getter; // both can be null, if it's for a known ('primitive') type + protected MetaMethod setter; private final Class type; /** @@ -20,26 +22,26 @@ public abstract class TypeHandler { */ private final String name; - public TypeHandler(Class type, String name, MethodHandle getter, MethodHandle setter) { + public TypeHandler(Class type, String name, MetaMethod getter, MetaMethod setter) { this.type = type; this.name = name; this.getter = getter; this.setter = setter; } - void setGetter(MethodHandle getter) { + void setGetter(MetaMethod getter) { this.getter = getter; } - public MethodHandle getGetter() { + public MetaMethod getGetter() { return getter; } - public MethodHandle getSetter() { + public MetaMethod getSetter() { return setter; } - void setSetter(MethodHandle setter) { + void setSetter(MetaMethod setter) { this.setter = setter; } diff --git a/lib/src/test/java/com/github/shautvast/contiguous/ByteBean.java b/lib/src/test/java/com/github/shautvast/contiguous/ByteBean.java index 9bb8de9..c21e96a 100644 --- a/lib/src/test/java/com/github/shautvast/contiguous/ByteBean.java +++ b/lib/src/test/java/com/github/shautvast/contiguous/ByteBean.java @@ -7,6 +7,6 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -class ByteBean { +public class ByteBean { byte value; } diff --git a/lib/src/test/java/com/github/shautvast/contiguous/DoubleBean.java b/lib/src/test/java/com/github/shautvast/contiguous/DoubleBean.java index 9ae3822..cf18c88 100644 --- a/lib/src/test/java/com/github/shautvast/contiguous/DoubleBean.java +++ b/lib/src/test/java/com/github/shautvast/contiguous/DoubleBean.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -class DoubleBean { +public class DoubleBean { private Double value; diff --git a/lib/src/test/java/com/github/shautvast/contiguous/FloatBean.java b/lib/src/test/java/com/github/shautvast/contiguous/FloatBean.java index 658e2de..b5ed4c0 100644 --- a/lib/src/test/java/com/github/shautvast/contiguous/FloatBean.java +++ b/lib/src/test/java/com/github/shautvast/contiguous/FloatBean.java @@ -7,6 +7,6 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -class FloatBean { +public class FloatBean { private Float value; } diff --git a/lib/src/test/java/com/github/shautvast/contiguous/IntBean.java b/lib/src/test/java/com/github/shautvast/contiguous/IntBean.java index bd863b5..c930221 100644 --- a/lib/src/test/java/com/github/shautvast/contiguous/IntBean.java +++ b/lib/src/test/java/com/github/shautvast/contiguous/IntBean.java @@ -7,6 +7,6 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -class IntBean { +public class IntBean { private int value; } diff --git a/lib/src/test/java/com/github/shautvast/contiguous/LongBean.java b/lib/src/test/java/com/github/shautvast/contiguous/LongBean.java index 16e61d7..b0ff62f 100644 --- a/lib/src/test/java/com/github/shautvast/contiguous/LongBean.java +++ b/lib/src/test/java/com/github/shautvast/contiguous/LongBean.java @@ -7,6 +7,6 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -class LongBean { +public class LongBean { private long value; } diff --git a/lib/src/test/java/com/github/shautvast/contiguous/ShortBean.java b/lib/src/test/java/com/github/shautvast/contiguous/ShortBean.java index 0a37f31..9248107 100644 --- a/lib/src/test/java/com/github/shautvast/contiguous/ShortBean.java +++ b/lib/src/test/java/com/github/shautvast/contiguous/ShortBean.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -class ShortBean { +public class ShortBean { private short value; }