ppkarwasz commented on PR #3638:
URL: https://github.com/apache/logging-log4j2/pull/3638#issuecomment-2848474770

   > I see 2 implementations of `StackLocator`, with the newer one relying on 
`StackWalker`. It is [available on 
Android](https://developer.android.com/reference/java/lang/StackWalker), though 
on the most recent versions only (Android 14+). This way, the `StackLocator` 
strategy can be used on JVM and newer devices while falling back to the slower 
`AndroidStackLocator` on older devices.
   > 
   > Not sure how this solution aligns with your current packaging strategy 
(because you mentioned multi-release JAR). Take it as a wild idea.
   
   One of the two versions of `StackLocator` is in `META-INF/versions/9`, so 
Android can not use it. Maybe there is an option to use that class when 
compiling, but I never found it.
   
   > If I was to refactor it, I would employ the Strategy pattern in 
`StackLocatorUtil` rather than adding more code to `StackLocator`. This way, 
while initializing `StackLocatorUtil`, I would inject the existing 
`StackLocator` for JVM platforms and `AndroidStackLocator` for Android.
   
   Yes, probably this is what we should have used from the start.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to