Changeset 8243 in josm for trunk/src/com/drew/metadata/tiff


Ignore:
Timestamp:
2015-04-21T00:42:50+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #11359 - update to metadata-extractor 2.8.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/metadata/tiff/DirectoryTiffHandler.java

    r8132 r8243  
    4141    protected final Metadata _metadata;
    4242
    43     protected DirectoryTiffHandler(Metadata metadata, Class<? extends Directory> initialDirectory)
     43    protected DirectoryTiffHandler(Metadata metadata, Class<? extends Directory> initialDirectoryClass)
    4444    {
    4545        _metadata = metadata;
    46         _currentDirectory = _metadata.getOrCreateDirectory(initialDirectory);
     46        try {
     47            _currentDirectory = initialDirectoryClass.newInstance();
     48        } catch (InstantiationException e) {
     49            throw new RuntimeException(e);
     50        } catch (IllegalAccessException e) {
     51            throw new RuntimeException(e);
     52        }
     53        _metadata.addDirectory(_currentDirectory);
    4754    }
    4855
     
    5461    protected void pushDirectory(@NotNull Class<? extends Directory> directoryClass)
    5562    {
    56         assert(directoryClass != _currentDirectory.getClass());
    5763        _directoryStack.push(_currentDirectory);
    58         _currentDirectory = _metadata.getOrCreateDirectory(directoryClass);
     64        try {
     65            _currentDirectory = directoryClass.newInstance();
     66        } catch (InstantiationException e) {
     67            throw new RuntimeException(e);
     68        } catch (IllegalAccessException e) {
     69            throw new RuntimeException(e);
     70        }
     71        _metadata.addDirectory(_currentDirectory);
    5972    }
    6073
Note: See TracChangeset for help on using the changeset viewer.