A comment on this implementation:
My impression is that Java 1.4.2 won't throw NoSuchMethodException
as getenv in that version is deprecated, not missing.
This would mean that you could call getenv() directly instead of
reflectively as long as it was only called on Java 5.
Neil
+ protected Method getSystemGetenvMethod() {
+ Method getenvMethod = null;
+ try {
+ getenvMethod = java.lang.System.class.getMethod("getenv",
(Class[]) null);
+ if (!getenvMethod.getReturnType().equals(java.util.Map.class))
{
+ // wrong return type
+ getenvMethod = null;
+ }
+ } catch (NoSuchMethodException e) {
+ // This is the error you get if using Java 1.4.2
+ getenvMethod = null;
+ } catch (Exception e) {
+ // Some other e.g. security problem
+ getenvMethod = null;
+ }
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel