[ https://issues.apache.org/jira/browse/OLINGO-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
mibo reassigned OLINGO-1330: ---------------------------- Assignee: mibo > SingletonPrimitiveType#getName() is expensive > --------------------------------------------- > > Key: OLINGO-1330 > URL: https://issues.apache.org/jira/browse/OLINGO-1330 > Project: Olingo > Issue Type: Bug > Components: odata4-commons > Affects Versions: (Java) V4 4.5.0 > Reporter: Dirk Mahler > Assignee: mibo > Priority: Major > > The implementation of SingletonPrimitiveType#getName() is expensive if > monitored in the JVisualVM sampler: > > {code:java} > @Override > public String getName() { > return getClass().getSimpleName().substring(3); > } > {code} > The main problem here is the Class#getSimpleName is a quite "complex" > calculation that's exectued every time when the method is invoked. The name > should be cached instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)