Changeset 3115 for trunk


Ignore:
Timestamp:
08/28/07 11:51:29 (13 years ago)
Author:
curtis
Message:

Add DummyMetadata as default metadata retrieval object.
Throw IllegalArgumentException if attempting to set a null metadata object.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatReader.java

    r3114 r3115  
    485485  public void setMetadataStore(MetadataStore store) { 
    486486    FormatTools.assertId(currentId, false, 1); 
     487    if (store == null) { 
     488      throw new IllegalArgumentException("Metadata object is null"); 
     489    } 
    487490    metadataStore = store; 
    488491  } 
  • trunk/loci/formats/FormatWriter.java

    r3108 r3115  
    5757  protected boolean initialized; 
    5858 
    59   protected MetadataRetrieve metadataRetrieve; 
     59  /** 
     60   * Current metadata retrieval object. Should <b>never</b> be accessed 
     61   * directly as the semantics of {@link #getMetadataRetrieve(String)} 
     62   * prevent "null" access. 
     63   */ 
     64  protected MetadataRetrieve metadataRetrieve = new DummyMetadata(); 
    6065 
    6166  // -- Constructors -- 
     
    98103  public void setMetadataRetrieve(MetadataRetrieve retrieve) { 
    99104    FormatTools.assertId(currentId, false, 1); 
     105    if (retrieve == null) { 
     106      throw new IllegalArgumentException("Metadata object is null"); 
     107    } 
    100108    metadataRetrieve = retrieve; 
    101109  } 
Note: See TracChangeset for help on using the changeset viewer.