1 9 package com.vladium.util; 10 11 25 public 26 interface IJREVersion 27 { 28 30 31 boolean JRE_1_2_PLUS = _JREVersion._JRE_1_2_PLUS; 33 boolean JRE_1_3_PLUS = _JREVersion._JRE_1_3_PLUS; 35 boolean JRE_1_4_PLUS = _JREVersion._JRE_1_4_PLUS; 37 39 boolean JRE_SUN_SIGNAL_COMPATIBLE = _JREVersion._JRE_SUN_SIGNAL_COMPATIBLE; 40 41 46 abstract class _JREVersion 47 { 48 static final boolean _JRE_1_2_PLUS; static final boolean _JRE_1_3_PLUS; static final boolean _JRE_1_4_PLUS; 52 static final boolean _JRE_SUN_SIGNAL_COMPATIBLE; 54 private _JREVersion () {} 56 static 57 { 58 _JRE_1_2_PLUS = ((SecurityManager .class.getModifiers () & 0x0400) == 0); 59 60 boolean temp = false; 61 if (_JRE_1_2_PLUS) 62 { 63 try 64 { 65 StrictMath.abs (1.0); 66 temp = true; 67 } 68 catch (Error ignore) {} 69 } 70 _JRE_1_3_PLUS = temp; 71 72 if (temp) 73 { 74 temp = false; 75 try 76 { 77 " ".subSequence (0, 0); 78 temp = true; 79 } 80 catch (NoSuchMethodError ignore) {} 81 } 82 _JRE_1_4_PLUS = temp; 83 84 temp = false; 85 try 86 { 87 Class.forName ("sun.misc.Signal"); 88 Class.forName ("sun.misc.SignalHandler"); 89 90 temp = true; 91 } 92 catch (Throwable ignore) {} 93 94 _JRE_SUN_SIGNAL_COMPATIBLE = temp; 95 } 96 97 } 99 } 102 | Popular Tags |