Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "VIATRA/Query/UserDocumentation/PureWhitelist"
(create) |
m (Harmath.incquerylabs.com moved page EMFIncQuery/UserDocumentation/PureWhitelist to VIATRA/Query/UserDocumentation/PureWhitelist: Migration) |
(No difference)
|
Revision as of 12:08, 26 February 2016
By default, check()/eval() constraints do not support calling arbitrary Java methods, since they are generally assumed to be impure. However, if you have a pure method and want to call it in these types of constraints, you have two options:
- if it is implemented by you, annotate it with the @Pure annotation of Xbase (org.eclipse.xtext.xbase.lib.Pure)
- if it comes from a third-party library, register it via the org.eclipse.incquery.patternlanguage.purewhitelist extension point
Some standard library methods are marked as pure by default, including:
- java.lang.Math
- java.lang.String