diff --git a/platform/projectModel-api/src/com/intellij/openapi/components/StoredProperty.kt b/platform/projectModel-api/src/com/intellij/openapi/components/StoredProperty.kt index e8f53dc36e74..5cd999ed9c2c 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/components/StoredProperty.kt +++ b/platform/projectModel-api/src/com/intellij/openapi/components/StoredProperty.kt @@ -54,14 +54,22 @@ abstract class BaseState : SerializationFilter, ModificationTracker { return result } - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is BaseState) return false - - return properties == other.properties - } + override fun equals(other: Any?) = this === other || (other is BaseState && properties == other.properties) override fun hashCode() = properties.hashCode() + + override fun toString(): String { + if (properties.isEmpty()) { + return "" + } + + val builder = StringBuilder() + for (property in properties) { + builder.append(property.value).append(" ") + } + builder.setLength(builder.length - 1) + return builder.toString() + } } internal class StoredProperty(internal val defaultValue: T?) : ReadWriteProperty { @@ -80,13 +88,9 @@ internal class StoredProperty(internal val defaultValue: T?) : ReadWritePrope } } - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is StoredProperty<*>) return false - - if (value != other.value) return false - return true - } + override fun equals(other: Any?) = this === other || (other is StoredProperty<*> && value == other.value) override fun hashCode() = value?.hashCode() ?: 0 + + override fun toString() = value?.toString() ?: super.toString() } \ No newline at end of file diff --git a/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleExtension.java b/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleExtension.java index 443c198cb360..fe43b5c69a17 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleExtension.java +++ b/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleExtension.java @@ -67,7 +67,7 @@ public abstract class ModuleExtension implements Disposable, Comparable