Derby
  1. Derby
  2. DERBY-5935

Remove unused code for factory classes in the reflection service

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.10.1.1
    • Component/s: Services
    • Labels:
      None

      Description

      The reflection service has some code for creating factory classes for each class generated for SQL queries, but the code is disabled due to memory concerns. We should remove the code to reduce code complexity and engine jar footprint. If someone wants to enable this code later, they can always revive it from the svn history.

      1. d5935-1a.diff
        10 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Attaching the patch d5935-1a.diff which makes the following changes:

        ReflectGeneratedClass.java:

        • Removed third parameter to constructor (factoryClass) since it's always null.
        • Removed fields factoryClass and factory because they are always null when constructor is called with param factoryClass=null.
        • Removed method newInstance() because it always degenerates to a call to super.newInstance() when factoryClass=null, so it could just inherit the method from the parent class.

        ReflectLoader2.java:

        • Remove third argument from call to ReflectGeneratedClass's constructor.
        • Remove commented out code for generating factory classes.

        ReflectClassesJava2.java:

        • Remove third argument from call to ReflectGeneratedClass's constructor.

        DatabaseClasses.java:

        • Remove code that's only called by the commented out code in ReflectLoader2.

        GCInstanceFactory.java:

        • Removed the class since it's only used in code removed by this patch.

        All the regression tests ran cleanly with the patch.

        Show
        Knut Anders Hatlen added a comment - Attaching the patch d5935-1a.diff which makes the following changes: ReflectGeneratedClass.java: Removed third parameter to constructor (factoryClass) since it's always null. Removed fields factoryClass and factory because they are always null when constructor is called with param factoryClass=null. Removed method newInstance() because it always degenerates to a call to super.newInstance() when factoryClass=null, so it could just inherit the method from the parent class. ReflectLoader2.java: Remove third argument from call to ReflectGeneratedClass's constructor. Remove commented out code for generating factory classes. ReflectClassesJava2.java: Remove third argument from call to ReflectGeneratedClass's constructor. DatabaseClasses.java: Remove code that's only called by the commented out code in ReflectLoader2. GCInstanceFactory.java: Removed the class since it's only used in code removed by this patch. All the regression tests ran cleanly with the patch.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1390342.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1390342.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development