From 5efa6b8e9fa13be596ce6a346e7d79e86eb17ee2 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 18 Mar 2013 23:24:27 +0400 Subject: [PATCH] IDEA-103244 java.lang.AssertionError using JetGradle on IDEA IU-129.17 --- .../jetbrains/plugins/gradle/diff/GradleDiffUtil.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/diff/GradleDiffUtil.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/diff/GradleDiffUtil.java index d3533059f8d4..9a5c4eea8b93 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/diff/GradleDiffUtil.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/diff/GradleDiffUtil.java @@ -1,5 +1,6 @@ package org.jetbrains.plugins.gradle.diff; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.LibraryOrderEntry; @@ -33,6 +34,8 @@ import java.util.Map; */ public class GradleDiffUtil { + private static final Logger LOG = Logger.getInstance("#" + GradleDiffUtil.class.getName()); + private GradleDiffUtil() { } @@ -42,7 +45,7 @@ public class GradleDiffUtil { *

* Example: particular module has been added at the gradle side. We want to mark that module, its content root(s), dependencies etc * as gradle-local changes. - * + * * @param entity target gradle-local entity * @param context changes calculation context to use */ @@ -66,7 +69,7 @@ public class GradleDiffUtil { @Override public void visit(@NotNull GradleContentRoot contentRoot) { - context.register(new GradleContentRootPresenceChange(contentRoot, null)); + context.register(new GradleContentRootPresenceChange(contentRoot, null)); } @Override @@ -184,7 +187,9 @@ public class GradleDiffUtil { for (I entity : ideEntities) { Object key = calculator.getIdeKey(entity); final I previous = ideEntitiesByKeys.put(key, entity); - assert previous == null : key; + if (previous != null) { + LOG.warn("Duplicate setup for library " + key); + } } for (G gradleEntity: gradleEntities) { I ideEntity = ideEntitiesByKeys.remove(calculator.getGradleKey(gradleEntity, context));