Paul Nicolucci created MYFACES-4449:
---------------------------------------
Summary: Implementation ClassUtils needs methods added to support
OSGI runtimes
Key: MYFACES-4449
URL: https://issues.apache.org/jira/browse/MYFACES-4449
Project: MyFaces Core
Issue Type: Bug
Components: General
Affects Versions: 4.0.0-RC1
Reporter: Paul Nicolucci
Assignee: Paul Nicolucci
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
--
This message was sent by Atlassian Jira
(v8.20.10#820010)