assertion: Language constructor must be non-public to avoid creating Language duplicates + test

GitOrigin-RevId: eb6954f444bf64bbc1d47b419af5e4db6fadf07e
This commit is contained in:
Alexey Kudravtsev
2024-04-23 15:32:42 +02:00
committed by intellij-monorepo-bot
parent d7d8c7af81
commit ddf9b3da94
10 changed files with 10 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ public class EcmaScriptRegexpLanguage extends Language {
public static final EcmaScriptRegexpLanguage INSTANCE = new EcmaScriptRegexpLanguage();
public static final String ID = "JSRegexp";
public EcmaScriptRegexpLanguage() {
private EcmaScriptRegexpLanguage() {
super(RegExpLanguage.INSTANCE, ID);
}
}

View File

@@ -12,7 +12,7 @@ public class EcmaScriptUnicodeRegexpLanguage extends Language {
public static final EcmaScriptUnicodeRegexpLanguage INSTANCE = new EcmaScriptUnicodeRegexpLanguage();
public static final String ID = "JSUnicodeRegexp";
public EcmaScriptUnicodeRegexpLanguage() {
private EcmaScriptUnicodeRegexpLanguage() {
super(RegExpLanguage.INSTANCE, ID);
}
}

View File

@@ -9,7 +9,7 @@ import com.intellij.psi.impl.source.xml.XmlFileImpl
import com.intellij.psi.tree.IFileElementType
import org.jetbrains.annotations.NotNull
class SvgLanguage : XMLLanguage(XMLLanguage.INSTANCE, "SVG", "image/svg+xml") {
class SvgLanguage private constructor(): XMLLanguage(XMLLanguage.INSTANCE, "SVG", "image/svg+xml") {
companion object {
@JvmField
val INSTANCE = SvgLanguage()

View File

@@ -10,7 +10,7 @@ public interface JspxFileViewProvider extends TemplateLanguageFileViewProvider {
Language JAVA_HOLDER_METHOD_TREE_LANGUAGE = new JavaHolderMethodTreeLanguage();
class JavaHolderMethodTreeLanguage extends Language implements DependentLanguage{
public JavaHolderMethodTreeLanguage() {
JavaHolderMethodTreeLanguage() {
super("JAVA_HOLDER_METHOD_TREE", "");
}
}

View File

@@ -32,7 +32,7 @@ import com.intellij.lang.Language;
public class ManifestLanguage extends Language {
public static final ManifestLanguage INSTANCE = new ManifestLanguage();
public ManifestLanguage() {
private ManifestLanguage() {
super("Manifest");
}
}

View File

@@ -6,7 +6,7 @@ import com.intellij.lang.Language;
public class PropertiesLanguage extends Language {
public static final PropertiesLanguage INSTANCE = new PropertiesLanguage();
public PropertiesLanguage() {
private PropertiesLanguage() {
super("Properties", "text/properties");
}
}

View File

@@ -8,7 +8,7 @@ import com.intellij.notification.NotificationGroupManager;
public final class ShLanguage extends Language {
public static final Language INSTANCE = new ShLanguage();
public ShLanguage() {
private ShLanguage() {
super("Shell Script", "application/x-bsh", "application/x-sh", "text/x-script.sh");
}
}

View File

@@ -8,7 +8,7 @@ import org.intellij.lang.regexp.RegExpLanguage;
public class PythonRegexpLanguage extends Language {
public static final PythonRegexpLanguage INSTANCE = new PythonRegexpLanguage();
public PythonRegexpLanguage() {
private PythonRegexpLanguage() {
super(RegExpLanguage.INSTANCE, "PythonRegExp");
}
}

View File

@@ -9,7 +9,7 @@ import org.intellij.lang.regexp.RegExpLanguage;
public class PythonVerboseRegexpLanguage extends Language {
public static final PythonVerboseRegexpLanguage INSTANCE = new PythonVerboseRegexpLanguage();
public PythonVerboseRegexpLanguage() {
private PythonVerboseRegexpLanguage() {
super(RegExpLanguage.INSTANCE, PyNames.VERBOSE_REG_EXP_LANGUAGE_ID);
}
}

View File

@@ -25,7 +25,7 @@ public class HtmlCompatibleMetaLanguage extends MetaLanguage {
() -> ContainerUtil.map2Set(EP_NAME.getExtensionList(), e -> e.language)
), EP_NAME, null);
public HtmlCompatibleMetaLanguage() {
private HtmlCompatibleMetaLanguage() {
super("HtmlCompatible");
}