From d6bb45a7d46fca1d9b52e03b3bc7804575bfc488 Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Mon, 23 Jun 2025 19:17:03 +0200 Subject: [PATCH] IJPF-CR-29151 [java] IDEA-374204 JEP 512: use 'Compact Source Files' for implicitly declared classes - fix naming (cherry picked from commit 91c2c095f5ca3b2ac3d6fc6de8d85b4f7205cfe7) (cherry picked from commit e9c066e0a80b0154b69f1cf94334ab1e209dd74f) IJ-MR-169535 GitOrigin-RevId: 305bc4173b42de65872f95e867b193eaef35a8c8 --- .../resources/messages/JavaCompilationErrorBundle.properties | 4 ++-- java/java-impl/resources/messages/RefactorJBundle.properties | 2 +- .../resources/messages/JavaSyntaxBundle.properties | 4 ++-- .../Incorrect implicit class name with spaces.java | 2 +- .../implicitClass/Incorrect.implicit.class.name.java | 2 +- .../daemonCodeAnalyzer/implicitClass/SameNameInnerClass.java | 2 +- .../implicitClass/SameNameInnerClass21.java | 2 +- java/openapi/resources/messages/JavaBundle.properties | 2 +- .../resources/messages/JavaRefactoringBundle.properties | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/java/codeserver/highlighting/resources/messages/JavaCompilationErrorBundle.properties b/java/codeserver/highlighting/resources/messages/JavaCompilationErrorBundle.properties index 99767625f42c..64f3c5078f1b 100644 --- a/java/codeserver/highlighting/resources/messages/JavaCompilationErrorBundle.properties +++ b/java/codeserver/highlighting/resources/messages/JavaCompilationErrorBundle.properties @@ -136,8 +136,8 @@ class.or.package.expected=Expected class or package class.inherits.abstract.and.default={0} inherits abstract and default for {1} from types {2} and {3} class.inherits.unrelated.defaults={0} inherits unrelated defaults for {1} from types {2} and {3} -class.implicit.no.main.method=Compact source files contains no 'main' method -class.implicit.invalid.file.name=The file name of a compact source file is not a valid identifier +class.implicit.no.main.method=Compact source file contains no 'main' method +class.implicit.invalid.file.name=The name of a compact source file is not a valid identifier class.implicit.initializer=Initializers are not allowed in compact source files class.implicit.package.statement=Package statement is not allowed in compact source files diff --git a/java/java-impl/resources/messages/RefactorJBundle.properties b/java/java-impl/resources/messages/RefactorJBundle.properties index 6a4460b8a50c..c698ab501730 100644 --- a/java/java-impl/resources/messages/RefactorJBundle.properties +++ b/java/java-impl/resources/messages/RefactorJBundle.properties @@ -18,7 +18,7 @@ the.selected.class.is.an.annotation.type=The selected class is an annotation int the.refactoring.is.not.supported.on.non.static.inner.classes=The refactoring is not supported on non-static inner classes. the.selected.class.has.no.members.to.extract=The selected class has no members to extract. the.selected.class.should.belong.to.project.sources=The selected class should belong to project sources -refactoring.cannot.be.done.in.implicit.class=Refactoring cannot be done in compact source files +refactoring.cannot.be.done.in.implicit.class=Cannot refactor compact source files references.to.extract=References to extract ( {0, choice, 0#(Not found)|1#{0} reference|2#{0} references}{1, choice, 0#|1# in {1} file|2# in {1} files}) extract.class.as.enum.column.title=As Enum extract.class.depends.on.0.from.1.tooltip=Depends on {0} from {1} diff --git a/java/java-syntax/resources/messages/JavaSyntaxBundle.properties b/java/java-syntax/resources/messages/JavaSyntaxBundle.properties index 290e2eee6dcb..323781b6f9d9 100644 --- a/java/java-syntax/resources/messages/JavaSyntaxBundle.properties +++ b/java/java-syntax/resources/messages/JavaSyntaxBundle.properties @@ -58,12 +58,12 @@ feature.javadoc.snippets=@snippet in Javadoc feature.pattern.guard.and.record.patterns=Pattern guards and record patterns feature.record.patterns.in.for.each=Record patterns in for-each loops feature.primitive.types.in.patterns=Primitive types in patterns, instanceof and switch -feature.implicit.import.in.implicit.classes=Implicit import in compact source files +feature.implicit.import.in.implicit.classes=Implicit import in a compact source file feature.enum.qualified.name.in.switch=Qualified enum as a constant in switch feature.string.templates=String templates feature.unnamed.vars=Unnamed patterns and variables feature.implicit.classes=Compact source files -feature.implicit.class.name.out.of.scope=Names of implicitly declared class of a compact source file are out of scopes +feature.implicit.class.name.out.of.scope=The name of an implicitly declared class of a compact source file is out of scope feature.instance.main.method=Instance main method feature.inherited.static.main.method=Inherited static main method feature.scoped.values=Scoped Values diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect implicit class name with spaces.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect implicit class name with spaces.java index 09099dd79bd2..780a152ff723 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect implicit class name with spaces.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect implicit class name with spaces.java @@ -1 +1 @@ -void main() {} \ No newline at end of file +void main() {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect.implicit.class.name.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect.implicit.class.name.java index 09099dd79bd2..780a152ff723 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect.implicit.class.name.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/Incorrect.implicit.class.name.java @@ -1 +1 @@ -void main() {} \ No newline at end of file +void main() {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass.java index 8bb34d78353d..ae3201a13e19 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass.java @@ -1,4 +1,4 @@ -public class SameNameInnerClass { +public class SameNameInnerClass { } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass21.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass21.java index 22f42104a932..8384234ef32f 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass21.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/implicitClass/SameNameInnerClass21.java @@ -1,4 +1,4 @@ -public class SameNameInnerClass21 { +public class SameNameInnerClass21 { } diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index 4a5b126a619d..be3ef0c0781b 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -725,7 +725,7 @@ inspection.string.template.reverse.migration.string.message=String template can inspection.string.template.migration.concatenation.message=Concatenation can be replaced with string template inspection.string.template.migration.name=String template can be used inspection.string.template.reverse.migration.name=String template can be concatenated string -inspection.implicit.to.explicit.class.backward.migration.name=Compact source file can be replaced with an ordinary class +inspection.implicit.to.explicit.class.backward.migration.name=Compact source file can be replaced with a regular class inspection.implicit.to.explicit.class.backward.migration.fix.name=Convert an implicitly declared class of a compact source file into a regular class inspection.explicit.to.implicit.class.migration.name=Explicit class declaration can be converted into a compact source file inspection.explicit.to.implicit.class.migration.fix.name=Convert into compact source file diff --git a/java/openapi/resources/messages/JavaRefactoringBundle.properties b/java/openapi/resources/messages/JavaRefactoringBundle.properties index 33f086205e93..d81b97d16a1a 100644 --- a/java/openapi/resources/messages/JavaRefactoringBundle.properties +++ b/java/openapi/resources/messages/JavaRefactoringBundle.properties @@ -822,7 +822,7 @@ dialog.message.moving.directories.to=Moving directories to ''{0}'' progress.title.collect.hierarchy=Collect ''{0}'' hierarchy introduce.variable.message.change.semantics.warning=Extracting the selected expression changes the semantics of the surrounding expression. introduce.variable.message.expression.refers.to.pattern.variable.declared.outside=The selected expression refers to pattern variable ''{0}'', which will be out of scope. -introduce.variable.message.cannot.extract.in.implicit.class=Cannot extract in compact source file. +introduce.variable.message.cannot.extract.in.implicit.class=Cannot extract in a compact source file. introduce.variable.message.cannot.extract.variable.in.interface=Cannot extract variable in an interface. tooltip.cannot.inline.pattern.variable=Cannot inline pattern variable inline.popup.highlight=Highlight {0} conflicting {0, choice, 1#write|2#writes}