Changeset 8243 in josm for trunk/src/com/drew/metadata/tiff
- Timestamp:
- 2015-04-21T00:42:50+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/drew/metadata/tiff/DirectoryTiffHandler.java
r8132 r8243 41 41 protected final Metadata _metadata; 42 42 43 protected DirectoryTiffHandler(Metadata metadata, Class<? extends Directory> initialDirectory) 43 protected DirectoryTiffHandler(Metadata metadata, Class<? extends Directory> initialDirectoryClass) 44 44 { 45 45 _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); 47 54 } 48 55 … … 54 61 protected void pushDirectory(@NotNull Class<? extends Directory> directoryClass) 55 62 { 56 assert(directoryClass != _currentDirectory.getClass());57 63 _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); 59 72 } 60 73
Note:
See TracChangeset
for help on using the changeset viewer.