Changeset 2676


Ignore:
Timestamp:
04/25/07 13:25:45 (13 years ago)
Author:
curtis
Message:

Use exception chaining with IOException.

File:
1 edited

Legend:

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

    r2674 r2676  
    103103  /* @see loci.formats.IFormatReader#close(boolean) */ 
    104104  public void close(boolean fileOnly) throws IOException { 
    105     if (fileOnly) { 
    106       try { 
    107         r.exec("openMovieFile.close()"); 
    108       } 
    109       catch (ReflectException e) { 
    110         throw new IOException("Close movie failed"); 
    111       } 
    112     } 
    113     else close(); 
     105    try { 
     106      r.exec("openMovieFile.close()"); 
     107      if (!fileOnly) { 
     108        r.exec("m.disposeQTObject()"); 
     109        r.exec("imageTrack.disposeQTObject()"); 
     110        r.exec("QTSession.close()"); 
     111      } 
     112    } 
     113    catch (ReflectException e) { 
     114      IOException io = new IOException("Close movie failed"); 
     115      io.initCause(e); 
     116      throw io; 
     117    } 
     118    if (!fileOnly) currentId = null; 
    114119  } 
    115120 
    116121  /* @see loci.formats.IFormatReader#close() */ 
    117122  public void close() throws IOException { 
    118     if (currentId == null) return; 
    119  
    120     try { 
    121       r.exec("openMovieFile.close()"); 
    122       r.exec("m.disposeQTObject()"); 
    123       r.exec("imageTrack.disposeQTObject()"); 
    124       r.exec("QTSession.close()"); 
    125     } 
    126     catch (ReflectException e) { 
    127       throw new IOException("Close movie failed"); 
    128     } 
    129     currentId = null; 
     123    close(false); 
    130124  } 
    131125 
Note: See TracChangeset for help on using the changeset viewer.