java.lang.IllegalArgumentException: java.lang.IllegalStateException: Some writing method should be present for field get__PtrFieldName
at net.openhft.chronicle.values.ValueModel.acquire(ValueModel.java:60)
at net.openhft.chronicle.values.Values.nativeClassFor(Values.java:82)
at net.openhft.chronicle.values.Values.newNativeReference(Values.java:50)
Where:
1.5.1. Haven't tested other versions
To reproduce:
Create a Value interface a/b/c/X.java
Create a getter/setter on X.java: "long getmyPtr()" and "void setmyPtr(long x)".
Instantiate 'X', Values.newNativeReference(X.class) and this throws the stack trace above.
I needed this strange naming convention to hide these methods in my IDE. They hold native pointer values and I don't need them since I dereference the pointer via a "getMyPointedObject()" method in the same interface (via a default method). i.e I have "long getmyPtr()", "void setmyPtr(long)" and "default MyObject getMyPointerObect()".
This is a minor issue, but here it is.
Stack trace
java.lang.IllegalArgumentException: java.lang.IllegalStateException: Some writing method should be present for field get__PtrFieldName at net.openhft.chronicle.values.ValueModel.acquire(ValueModel.java:60) at net.openhft.chronicle.values.Values.nativeClassFor(Values.java:82) at net.openhft.chronicle.values.Values.newNativeReference(Values.java:50)
Where:
1.5.1. Haven't tested other versions
To reproduce:
Potential Issue
Looks like https://github.com/OpenHFT/Chronicle-Values/blob/chronicle-values-1.5.1/src/main/java/net/openhft/chronicle/values/CodeTemplate.java#L64 regex matches with field name "getmyPtr" so the setter expects "getmyPtr" instead of "set__myPtr" !
My use case
I needed this strange naming convention to hide these methods in my IDE. They hold native pointer values and I don't need them since I dereference the pointer via a "getMyPointedObject()" method in the same interface (via a default method). i.e I have "long getmyPtr()", "void setmyPtr(long)" and "default MyObject getMyPointerObect()".
Workarounds
Many. So, this is low priority.