IJPL-159596 cleanup

GitOrigin-RevId: 49e1d0d2018367065485476c828ef6038d6e2c85
This commit is contained in:
Vladimir Krivosheev
2024-08-05 19:30:33 +02:00
committed by intellij-monorepo-bot
parent 3d0f2a0265
commit d7e86c19c8

View File

@@ -1,19 +1,4 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.descriptors;
import com.intellij.openapi.diagnostic.Logger;
@@ -24,15 +9,15 @@ import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
public class ConfigFileMetaData {
public final class ConfigFileMetaData {
private static final Logger LOG = Logger.getInstance(ConfigFileMetaData.class);
@Nls private final String myTitle;
private final String myId;
private final String myFileName;
private final String myDirectoryPath;
private final ConfigFileVersion[] myVersions;
private final ConfigFileVersion myDefaultVersion;
private final boolean myOptional;
private final ConfigFileVersion[] versions;
private final ConfigFileVersion defaultVersion;
private final boolean isOptional;
private final boolean myFileNameFixed;
private final boolean myUnique;
@@ -52,10 +37,10 @@ public class ConfigFileMetaData {
myFileNameFixed = fileNameFixed;
myUnique = unique;
LOG.assertTrue(versions.length > 0, "No versions specified for '" + id + "' descriptor");
myVersions = versions;
myOptional = optional;
myDefaultVersion = defaultVersion != null ? defaultVersion : myVersions[myVersions.length - 1];
LOG.assertTrue(Arrays.asList(myVersions).contains(myDefaultVersion));
this.versions = versions;
isOptional = optional;
this.defaultVersion = defaultVersion == null ? versions[versions.length - 1] : defaultVersion;
LOG.assertTrue(Arrays.asList(versions).contains(this.defaultVersion));
}
public ConfigFileMetaData(final @Nls String title,
@@ -88,20 +73,19 @@ public class ConfigFileMetaData {
}
public boolean isOptional() {
return myOptional;
return isOptional;
}
public ConfigFileVersion[] getVersions() {
return myVersions;
return versions;
}
public String toString() {
return myTitle;
}
public ConfigFileVersion getDefaultVersion() {
return myDefaultVersion;
return defaultVersion;
}
public boolean isFileNameFixed() {