diff options
author | Andrey Loskutov | 2016-12-26 21:33:55 +0000 |
---|---|---|
committer | Sergey Prigogin | 2017-01-03 18:05:36 +0000 |
commit | a0d51d43b91f9cab4008f2b52db69b4300555553 (patch) | |
tree | e6694bb796046950a1810603c0f1856f2d6a9381 | |
parent | 5375e83b88bed8d70bc5a1b096ad7fa165f87afe (diff) | |
download | eclipse.platform.team-M20170103-1700.tar.gz eclipse.platform.team-M20170103-1700.tar.xz eclipse.platform.team-M20170103-1700.zip |
Bug 509708 - Don't try to create an image from a null descriptor.M20170201-0400M20170126-1300M20170126-0400M20170125-0400M20170118-0830M20170118-0500M20170118-0430M20170111-0400M20170105-1300M20170104-1200M20170104-0545M20170104-0400M20170103-1700M20170103-1405
Elements in the outline can be "virtual" without real direction of the
change (e.g. "Compilation Unit" root node). Such elements are created
from RangeDifferences with "NOCHANGE" kind (so the
DocumentMerger.Diff.fDirection is zero), and therefore they do not have
an image descriptor configured in CompareConfiguration.fgImages array.
Also increment service segment after patch.
Change-Id: I82645b097fe49a3d61e2e7934a0190a718a9ec35
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r-- | bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java | 10 | ||||
-rw-r--r-- | bundles/org.eclipse.compare/pom.xml | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java index 6066657bb..cbc0c15a1 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java @@ -305,14 +305,20 @@ public class CompareConfiguration { * disposed when the <code>dispose</code> method is called. * * @param kind the kind of change as defined in <code>Differencer</code>. - * @return an modification of the base image reflecting the kind of change. + * @return an modification of the base image reflecting the kind of change + * or {@code null} if there is no image descriptor registered for + * given id. * @see org.eclipse.compare.structuremergeviewer.Differencer * @since 2.0 */ public Image getImage(int kind) { - if (fDisposed) + if (fDisposed) { return null; + } ImageDescriptor id= getImageDescriptor(kind); + if (id == null) { + return null; + } ResourceManager rm = getResourceManager(); return rm.createImage(id); } diff --git a/bundles/org.eclipse.compare/pom.xml b/bundles/org.eclipse.compare/pom.xml index 607979e96..b221ea714 100644 --- a/bundles/org.eclipse.compare/pom.xml +++ b/bundles/org.eclipse.compare/pom.xml @@ -5,7 +5,7 @@ are made available under the terms of the Eclipse Distribution License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/org/documents/edl-v10.php - + Contributors: Igor Fedorenko - initial implementation --> |