manshack_one Posted April 6, 2017 Share Posted April 6, 2017 I have a report that has an issue with evaluating a few fields with an expression like this one after upgrading from 6.0 to 6.3. In 6.0 there was no issue with this statement. I get confused on how Groovy and Java are intermingled when creating expressions. There are a few google results that talk about how after groovy 2.4 they began checking overloaded methods more closely but I can't make any sense of what it means. This is a pretty straightforward shorthand expression for an if-then situation. Any suggestions on how to write this expression so that it doesn't have an issue being resolved?Expression:($F{dental1}!=null || $F{dental2}!=null || $F{dental3}!=null)? ($F{dental1}+$F{dental2}+$F{dental3})/3:null Error:Caused by: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Long#plus.Cannot resolve which method to invoke for [null] due to overlapping prototypes between:[class java.lang.Character][class java.lang.String][class java.lang.Number] Link to comment Share on other sites More sharing options...
manshack_one Posted April 6, 2017 Author Share Posted April 6, 2017 Turns out there was null data sneaking into the calculation and Groovy wasn't sure how to handle it. Changed my logic up to check for that situation first and now i'm good to go. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now