From a5e4cf4d130b45c31646b4cccb38a3a00af4ed4c Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Mon, 20 Jan 2014 17:27:43 +0400 Subject: [PATCH] Add additional diagnostic to investigate EA-51665 (assert: FTManager.createAndStoreBundledTemplate). --- .../intellij/ide/fileTemplates/impl/BundledFileTemplate.java | 5 +++++ .../src/com/intellij/ide/fileTemplates/impl/FTManager.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/BundledFileTemplate.java b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/BundledFileTemplate.java index 43833e79b3e1..0a1b4a5cb579 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/BundledFileTemplate.java +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/BundledFileTemplate.java @@ -101,4 +101,9 @@ public final class BundledFileTemplate extends FileTemplateBase { public boolean isTextModified() { return !getText().equals(getDefaultText()); } + + @Override + public String toString() { + return myDefaultTemplate.getTemplateURL() == null ? "" : myDefaultTemplate.getTemplateURL().toString(); + } } diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FTManager.java b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FTManager.java index 1938241e6dab..b1b6cec2d2ad 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FTManager.java +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FTManager.java @@ -188,7 +188,8 @@ class FTManager { final FileTemplateBase previous = myTemplates.put(qName, bundled); mySortedTemplates = null; - LOG.assertTrue(previous == null, "Duplicate bundled template " + qName); + LOG.assertTrue(previous == null, "Duplicate bundled template " + qName + + " [" + template.getTemplateURL() + ", " + previous + ']'); return bundled; }