is there a way to mark a function as part of a bui...
# detekt
r
is there a way to mark a function as part of a builder so that detekt can recognise if one forgot to end the building process?
s
Yes, you could write a custom domain-specific rule for that.
r
fair enough, I hoped detekt already has something like @CheckReturnValue
s
Nope. JSR 305 describes and provides this feature.
r
I figured JSR 305 was not really implemented in the sense of, there is no CheckReturnValue annotation in JDK, no? Maybe I am mistaking, if so, shall I open a feature request on github that detekt supports it as well?
s
It's not part of the JDK but a reference implementation exists in one of Google's libraries. It's also part of Findbugs and Error Prone. I don't see a reason to reimplement this, because there is more than one existing solution. We strive to adhere to the DRY principle. The following stackoverflow link gives more information regarding JSR 305. https://stackoverflow.com/questions/2289694/what-is-the-status-of-jsr-305 HTH Markus