Open sbernard31 opened 1 year ago
Not directly linked but not sure to get why isPrefixed
is transient ? :thinking:
static final class RequestMatcher {
private final Method method;
private final String uriPath;
private transient final boolean isPrefixed;
Well, that transient
was to prevent adding isPrefixed
to equals
method.
Oh I was thinking transient
was about Java Serialization. Not sure to know how this is related to equals
? Maybe something related to IDE code generation ?
That is needed by this testing tool: https://jqno.nl/equalsverifier/ to skip fields from being tested.
Oh I didn't know about EqualsVerifier
maybe this is a library we should use in Leshan :thinking:
About transient, I read documentation : https://jqno.nl/equalsverifier/manual/ignoring-fields/#transient-fields and they also talk about serialization maybe it make more sense to use : https://jqno.nl/equalsverifier/manual/ignoring-fields/#ignoring-fields (but clearly this is very small details)
Currently this is not possible to do :
If you do that
RootResource
will never be called. I think this is because/
and/*
will create 2RequestMatcher
which will be considered as equal and soDefault
will overrideRootResource
in handlers hashmap. Maybe the solution is to addisPrefixed
attribute toequals()
andhashcode()
methods ?(triggered by https://github.com/open-coap/java-coap/issues/27#issuecomment-1527757330)