Closed GoogleCodeExporter closed 8 years ago
It looks like the Thread.currentThread().getContxtClassLoader() line appeared
in c27e9c7d7688c1f497af95ef004e7d6439c42080 where it replaced
java.util.ServiceLoader.load(Class) which uses the thread's context ClassLoader.
Thus, it seems to me that using the thread's context ClassLoader is the right
thing to do. The question is how to fix this issue for Android Eclair (if at
all -- its share of Android devices is around 5% and dwindling) without
affecting other cases.
The issue on Android Eclair might be caused by
http://code.google.com/p/android/issues/detail?id=5697.
Original comment by klyu...@google.com
on 9 Jul 2012 at 11:37
I don't think we want to fix this for Eclair, which is the problem. Work-around
for Eclair devices with this line of code:
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
Original comment by limpbizkit
on 10 Jul 2012 at 2:22
Fair enough. Feel free to close this issue.
Original comment by klyu...@google.com
on 10 Jul 2012 at 9:51
OK, thx for the information :)
Issue closed.
Original comment by brice.du...@gmail.com
on 16 Jul 2012 at 12:35
For posterity, the fixed I implemented in our project is here: a custom
InstrumentationTestRunner that sets the thread's context class loader to the
one that works:
http://code.google.com/p/google-authenticator/source/browse/tests/src/com/google
/android/apps/authenticator/MockitoWorkaroundForEclairInstrumentationTestRunner.
java??r=441dc15b40d9d6c19d05913653fee5b351824b93&repo=android&repo=android.
Original comment by klyu...@google.com
on 16 Jul 2012 at 8:34
Original issue reported on code.google.com by
klyu...@google.com
on 3 Jul 2012 at 10:44