I would like my projekt to switch at startup between backend libraries, with option to not shade both of them into resulting Jar, while having full compile-them visibility of both. I would also like to avoid loading backends using Class.forName.
Can you help me understand if any of these will lead to a ClassNotFoundError for unshaded library and which will not?
- Leaving an unused class field, of type from this library
- Leaving an unused method, with arguments or return from this library
- Referencing this library in a backend class that will only be loaded conditionally like
backend = isNewBackend ? new FancyBackend() : new OldBackend()
If all of these result in error, is there an easier strategy for this?
Aucun commentaire:
Enregistrer un commentaire