[ https://issues.apache.org/jira/browse/GROOVY-7583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher resolved GROOVY-7583. --------------------------------------- Resolution: Fixed Assignee: Pascal Schumacher Fix Version/s: 2.4.6 Fixed. Thanks for reporting. > Unnecessary Instantiation on DefaultGroovyMethods.numberAwareCompareTo > ---------------------------------------------------------------------- > > Key: GROOVY-7583 > URL: https://issues.apache.org/jira/browse/GROOVY-7583 > Project: Groovy > Issue Type: Improvement > Affects Versions: 2.4.5 > Reporter: Thibault Kruse > Assignee: Pascal Schumacher > Priority: Minor > Fix For: 2.4.6 > > > in numberAwareCompareTo() > {code} > NumberAwareComparator<Comparable> numberAwareComparator = new > NumberAwareComparator<Comparable>(); > return numberAwareComparator.compare(self, other); > {code} > The code inside NumberAwareComparator.compare can be static, so there is no > need to create a new Instance of the Comparator every numberAwareCompareTo is > called. I suggest extracting the logic into a public static method, and to > use that, or anything similar. -- This message was sent by Atlassian JIRA (v6.3.4#6332)