Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4449

Implementation ClassUtils needs methods added to support OSGI runtimes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0-RC1
    • 2.3-next-M8, 4.0.0-RC2
    • General
    • None

    Description

      Historically in MyFaces, there existed an ClassUtils in the implementation as well as the API. In Faces 4.0 the code was refactored to have the Classutils in the Impl extend the ClassUtils in the API:

      API: https://github.com/apache/myfaces/blob/main/api/src/main/java/org/apache/myfaces/core/api/shared/lang/ClassUtils.java

      Impl: https://github.com/apache/myfaces/blob/main/impl/src/main/java/org/apache/myfaces/util/lang/ClassUtils.java

       

      If we look at the 3.0 branches you'll see the implementation class does not extend the API class:

      API: https://github.com/apache/myfaces/blob/3.0.x/api/src/main/java/jakarta/faces/component/html/_ClassUtils.java

      Impl: https://github.com/apache/myfaces/blob/3.0.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java

       

      Having all the classloading methods in the API class works fine when the API and IMPL are bundled within an application but when trying to integrate MyFaces into an OSGI runtime where the API has no visibility into the implementation then a number of classloading issues occur.

       

      I've identified the following methods that need to be placed back into the implementation ClassUtils:

      • public static URL getResource(String resource)
      • public static InputStream getResourceAsStream(String resource)
      • public static Class simpleClassForName(String type)
      • public static Class simpleClassForName(String type, boolean logException)
      • public static Class classForName(String type) throws ClassNotFoundException

      Attachments

        Activity

          People

            paul.nicolucci Paul Nicolucci
            paul.nicolucci Paul Nicolucci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: