1 9 package com.vladium.emma.ant; 10 11 import java.io.File ; 12 import java.lang.reflect.Method ; 13 import java.lang.reflect.Modifier ; 14 15 import org.apache.tools.ant.types.FileSet; 16 17 21 public 22 interface IANTVersion 23 { 24 26 27 boolean ANT_1_5_PLUS = _ANTVersion._ANT_1_5_PLUS; 29 30 abstract class _ANTVersion 31 { 32 static final boolean _ANT_1_5_PLUS; 34 private _ANTVersion () { } 35 36 static 37 { 38 boolean temp = true; 39 try 40 { 41 final Method m = FileSet.class.getMethod ("setFile", new Class [] { File .class }); 42 43 45 final int modifiers = m.getModifiers (); 46 if ((modifiers & Modifier.STATIC) != 0) 47 temp = false; 48 } 49 catch (NoSuchMethodException nsme) 50 { 51 temp = false; 52 } 53 catch (SecurityException se) 54 { 55 temp = false; 56 } 57 catch (Throwable t) 58 { 59 t.printStackTrace (System.out); 60 temp = false; 61 } 62 63 _ANT_1_5_PLUS = temp; 64 } 65 66 } 68 } | Popular Tags |