Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-321

Refactor subclasses of ClassPathRepository for differences in underlying cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 6.4.0
    • None
    • None

    Description

      (After implementing BCEL-320)

      BCEL has different ClassPathRepository classes with slight modification in its underlying cache:

      • ClassPathRepository uses HashMap<String, JavaClass> for JavaClass cache
      • MemorySensitiveClassPathRepository uses HashMap<String, SoftReference<JavaClass>
      • New LruCacheClassPathRepository by BCEL-320 will use LinkedHashMap<String, JavaClass> for JavaClass cache

      The logic of loadClass, storeClass, and findClass methods are almost same (attached screenshot of ClassPathRepository and MemorySensitiveClassPathRepository as below). I think they can leverage an abstraction over the internal cache so that they will have less duplicate code.

      After BCEL-320, I'm thinking to create a PR for the abstraction.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              suztomo Tomo Suzuki
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m