Mercurial > hg > de.codedo.java.editor
diff src/de/codedo/java/editor/CodedoJavaElementImageProvider.java @ 8:778c251baa66
Anpassungen fuer aktuelles JDK. Input Stream, aus dem das Icon geladen wird, ordentlich schliessen.
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Thu, 15 Oct 2020 09:43:34 +0200 |
parents | 6287f5e469f1 |
children | 935df68696c0 |
line wrap: on
line diff
--- a/src/de/codedo/java/editor/CodedoJavaElementImageProvider.java Mon Sep 07 14:49:50 2015 +0200 +++ b/src/de/codedo/java/editor/CodedoJavaElementImageProvider.java Thu Oct 15 09:43:34 2020 +0200 @@ -1,5 +1,6 @@ package de.codedo.java.editor; +import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Set; @@ -58,8 +59,14 @@ Image image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEF_VIEW); Device device = image.getDevice(); - InputStream input = getClass().getClassLoader().getResourceAsStream("icons/icon.png"); - _customTitleImage = new Image(device, input); + try (InputStream input = getClass().getClassLoader().getResourceAsStream("icons/icon.png")) + { + _customTitleImage = new Image(device, input); + } + catch (IOException ex) + { + throw new IllegalStateException(ex); + } } return _customTitleImage; }