GROOVY-9946: Add @Pure to mark constant result of method#1492
GROOVY-9946: Add @Pure to mark constant result of method#1492daniellansun wants to merge 1 commit intomasterfrom
@Pure to mark constant result of method#1492Conversation
|
If this annotation is a marker and not a transform, is there a better package for it? I am not understanding the value proposition here. The ticket does not describe why this would be useful. Is the recreation of GString value a performance problem in some context? |
Any suggestion is welcome. Currently I put it with
Currently we just cache literal of |
|
I am thinking this could be generalised. If instead of having a very specific class annotation, we had a |
|
OK. Let me try to implement |
@ConstantString to mark constant result of toString@Pure to mark constant result of method
|
LGTM. The one thing which I think we should do is move the |
Thanks for your reviewing and help ;-) |
| for (Object value : values) { | ||
| if (null == value) continue; | ||
| if (!(ImmutablePropertyUtils.builtinOrMarkedImmutableClass(value.getClass()) | ||
| if (!(toStringMarkedPure(value.getClass()) |
There was a problem hiding this comment.
We can probably swap the order of this clause and the next since this one is probably less common than next line.
|
Merged, thanks! |
See https://issues.apache.org/jira/browse/GROOVY-9946