Changeset 3426


Ignore:
Timestamp:
11/29/07 12:57:13 (12 years ago)
Author:
melissa
Message:

Only check once to see if the native library exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/LegacyND2Reader.java

    r3424 r3426  
    3030 
    3131public class LegacyND2Reader extends FormatReader { 
     32 
     33  private static boolean noSDK = false; 
    3234 
    3335  private static ReflectedUniverse r = createReflectedUniverse(); 
     
    3739      r = new ReflectedUniverse(); 
    3840      r.exec("import ND_to_Image6D"); 
     41      System.loadLibrary("Nd2SdkWrapperI6D"); 
    3942    } 
    4043    catch (ReflectException e) { 
    41       LogTools.trace(e); 
     44      if (debug) LogTools.trace(e); 
     45      noSDK = true; 
     46    } 
     47    catch (UnsatisfiedLinkError e) { 
     48      if (debug) LogTools.trace(e); 
     49      noSDK = true; 
    4250    } 
    4351    return r; 
     
    124132  /* @see loci.formats.IFormatHandler#isThisType(String, boolean) */ 
    125133  public boolean isThisType(String name, boolean open) { 
    126     try { 
    127       System.loadLibrary("Nd2SdkWrapperI6D"); 
    128     } 
    129     catch (UnsatisfiedLinkError e) { 
    130       return false; 
    131     } 
    132     return true; 
     134    return !noSDK; 
    133135  } 
    134136 
Note: See TracChangeset for help on using the changeset viewer.