mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[java-inspections] NotNullFieldNotInitializedInspection: describe options in options pane, rather than in description
Fixes usability problem reported in IDEA-334886 "@NotNull field is not initialized" inspection ignores the setUp method. GitOrigin-RevId: bc1dd1b2f470ed2477e251e4d5db7d5933718718
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3dfc2fefc0
commit
c3318c29c4
@@ -17,6 +17,7 @@ import com.intellij.codeInspection.UpdateInspectionOptionFix;
|
||||
import com.intellij.codeInspection.options.OptPane;
|
||||
import com.intellij.codeInspection.util.InspectionMessage;
|
||||
import com.intellij.java.JavaBundle;
|
||||
import com.intellij.openapi.util.text.HtmlChunk;
|
||||
import com.intellij.psi.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -35,8 +36,10 @@ public class NotNullFieldNotInitializedInspection extends AbstractBaseJavaLocalI
|
||||
@Override
|
||||
public @NotNull OptPane getOptionsPane() {
|
||||
return pane(
|
||||
checkbox(IGNORE_IMPLICITLY_WRITTEN_FIELDS_NAME, JavaBundle.message("inspection.notnull.field.not.initialized.option.implicit")),
|
||||
checkbox(IGNORE_FIELDS_WRITTEN_IN_SETUP_NAME, JavaBundle.message("inspection.notnull.field.not.initialized.option.setup")));
|
||||
checkbox(IGNORE_IMPLICITLY_WRITTEN_FIELDS_NAME, JavaBundle.message("inspection.notnull.field.not.initialized.option.implicit"))
|
||||
.description(HtmlChunk.raw(JavaBundle.message("inspection.notnull.field.not.initialized.option.implicit.description"))),
|
||||
checkbox(IGNORE_FIELDS_WRITTEN_IN_SETUP_NAME, JavaBundle.message("inspection.notnull.field.not.initialized.option.setup"))
|
||||
.description(HtmlChunk.raw(JavaBundle.message("inspection.notnull.field.not.initialized.option.setup.description"))));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -18,11 +18,5 @@ Reports fields annotated as not-null that are not initialized in the constructor
|
||||
<code>getValue</code> may return null if the setter was not called.
|
||||
</p>
|
||||
<!-- tooltip end -->
|
||||
<p>Configure the inspection:</p>
|
||||
<ul>
|
||||
<li>Use the <b>Ignore fields which could be initialized implicitly</b> option to control whether a warning should be issued if the field could be initialized implicitly
|
||||
(e.g. via a dependency injection).</li>
|
||||
<li>Use the <b>Ignore fields initialized in setUp() method</b> option to control whether a warning should be issued if the field is written in the test case <code>setUp()</code> method.</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -549,7 +549,9 @@ inspection.no.jdk.error.message=The JDK is not configured properly for this proj
|
||||
inspection.no.modules.error.message=This project contains no modules. Inspection cannot proceed.
|
||||
inspection.notnull.field.not.initialized.display.name=@NotNull field is not initialized
|
||||
inspection.notnull.field.not.initialized.option.implicit=Ignore fields which could be initialized implicitly
|
||||
inspection.notnull.field.not.initialized.option.implicit.description=When checked, fields that are known to be initialized implicitly will not be reported
|
||||
inspection.notnull.field.not.initialized.option.setup=Ignore fields initialized in setUp() method
|
||||
inspection.notnull.field.not.initialized.option.setup.description=When checked, fields in test case classes that are initialized in setup methods (e.g. annotated via <code>@Before</code> or <code>@BeforeEach</code>) will not be reported.
|
||||
inspection.null.value.for.optional.assigned.ignore.fix.name=Do not warn when comparing Optional with null
|
||||
inspection.null.value.for.optional.assigned.message=Optional value is compared with null
|
||||
inspection.null.value.for.optional.context.assignment=assignment
|
||||
|
||||
Reference in New Issue
Block a user