From 4e8fe18ca844d422ec394f0ce85c48180f8613f4 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 21 Apr 2017 12:42:41 +0200 Subject: [PATCH] Fix facet validation: change ArgumentParseErrors to a data class BaseCompilerSettings.validateInheritedFieldsUnchanged() compares old and new properties of the compiler settings, and the check requires ArgumentParseErrors.equals() to be correctly implemented --- .../common/arguments/parseCommandLineArguments.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt index 3bdde30d33b..c6fc83f8e9c 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.cli.common.arguments import com.intellij.util.SmartList import java.lang.reflect.Field -import java.util.LinkedHashMap +import java.util.* annotation class Argument( val value: String, @@ -34,20 +34,20 @@ val Argument.isAdvanced: Boolean private val ADVANCED_ARGUMENT_PREFIX = "-X" private val FREE_ARGS_DELIMITER = "--" -class ArgumentParseErrors { - val unknownArgs: MutableList = SmartList() +data class ArgumentParseErrors( + val unknownArgs: MutableList = SmartList(), - val unknownExtraFlags: MutableList = SmartList() + val unknownExtraFlags: MutableList = SmartList(), // Names of extra (-X...) arguments which have been passed in an obsolete form ("-Xaaa bbb", instead of "-Xaaa=bbb") - val extraArgumentsPassedInObsoleteForm: MutableList = SmartList() + val extraArgumentsPassedInObsoleteForm: MutableList = SmartList(), // Non-boolean arguments which have been passed multiple times, possibly with different values. // The key in the map is the name of the argument, the value is the last passed value. - val duplicateArguments: MutableMap = LinkedHashMap() + val duplicateArguments: MutableMap = LinkedHashMap(), var argumentWithoutValue: String? = null -} +) // Parses arguments in the passed [result] object, or throws an [IllegalArgumentException] with the message to be displayed to the user fun parseCommandLineArguments(args: Array, result: A) {