Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1330

SingletonPrimitiveType#getName() is expensive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • (Java) V4 4.5.0
    • (Java) V4 4.7.0
    • odata4-commons
    • None

    Description

      The implementation of SingletonPrimitiveType#getName() is expensive if monitored in the JVisualVM sampler:
       

        @Override
        public String getName() {
          return getClass().getSimpleName().substring(3);
        }
      

      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.

      Attachments

        Activity

          People

            mirbo mibo
            dirk.mahler Dirk Mahler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: