This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Serialization of empty vector over a socket


Mark Wielaard wrote:

Linking with -static shows a completely different problem then you
have. The SHA implementation class is not linked with the program since
it is only referenced indirectly through Class.forName(String). I made a
patch for the Gnu security provider
// Message Digests
- put("MessageDigest.SHA", "gnu.java.security.provider.SHA");
- put("MessageDigest.MD5", "gnu.java.security.provider.MD5");
+ put("MessageDigest.SHA", gnu.java.security.provider.SHA.class.getName());
+ put("MessageDigest.MD5", gnu.java.security.provider.MD5.class.getName());

Its worth considering a side-effect of this change: All of the Gnu provider's cryptography classes will now be initialized upon creation of the provider, which will increase memory consumption and startup time slightly. In this case it probibly isn't significant enough to worry about, but in general I'm not a fan of these hacks to support static linking. We need to come up with a real, general solution (such as runtime feedback of used classes) rather than putting these workarounds everywhere.

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]