{"id":340136,"date":"2022-10-24T03:00:08","date_gmt":"2022-10-24T03:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340136"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340136","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0431\u0435\u0437 NPE. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Intellij Idea<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%B8%D0%BD%D1%86%D0%B8%D0%BF_%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B8_%D0%91%D0%B0%D1%80%D0%B1%D0%B0%D1%80%D1%8B_%D0%9B%D0%B8%D1%81%D0%BA%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">\u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432<\/a> (<a href=\"https:\/\/ru.wikipedia.org\/wiki\/SOLID_(%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82%D0%BD%D0%BE-%D0%BE%D1%80%D0%B8%D0%B5%D0%BD%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5)\" rel=\"noopener noreferrer nofollow\">SOLID<\/a>) \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430-\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u043c-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c, \u043d\u0443\u0436\u043d\u044b <a href=\"https:\/\/habr.com\/ru\/post\/237843\/\" rel=\"noopener noreferrer nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/a> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nonnull<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <code>Nonnull<\/code>. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nullable<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c <code>Nullable<\/code> \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0437\u0430 \u0432\u0430\u0441 Idea \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0418\u0437 &#171;\u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187; Idea \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u043d\u0435 \u0442\u0435, \u0447\u0442\u043e \u0432\u044b\u0448\u0435). \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 null free \u043a\u043e\u0434, \u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435: 1) \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430; 2) \u043b\u0435\u0433\u0430\u0441\u0438 \u043a\u043e\u0434\u0430; \u0438 3) \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e <code>null<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/11c\/93f\/763\/11c93f76315b5f6d22102fb3b6eb4823.jpeg\" width=\"800\" height=\"376\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/11c\/93f\/763\/11c93f76315b5f6d22102fb3b6eb4823.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 <code>@Nullable<\/code> \u0438 <code>@Nonnull<\/code>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0442\u043e\u043d\u0443\u0442\u044c \u0432 \u044d\u0442\u0438\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e, \u0447\u0442\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <code>@Nonnull<\/code> \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0442.\u0435. \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435\u044f\u0432\u043d\u0430\u044f.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u044c Idea \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043a\u0430\u043a <code>@Nonnull<\/code>, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u043a\u043e\u0434\u043e\u043c. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c <a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-144920\/Please-allow-custom-NonnullByDefault-annotations#focus=Comments-27-3949320.0-0\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043c\u0435\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Idea. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>org.eclipse.jdt.annotation.NonNullByDefault<\/code> \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e.<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-125281\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 JSR-305<\/a>. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u0430-\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b      \u043f\u043e\u0434\u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/checkerframework.org\/manual\/#default-qualifier\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Checker Framework<\/a>. \u041c\u0435\u0442\u0430-\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435      \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0430\u043a\u0435\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u0430 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0434\u043f\u0430\u043a\u0435\u0442\u043e\u0432.\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/checkerframework.org\/manual\/#lombok-copying-annotations\" rel=\"noopener noreferrer nofollow\">Lombok<\/a>.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c JSR-305<\/h4>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c<\/p>\n<pre><code class=\"xml\">&lt;dependency> \u00a0\u00a0\u00a0 &lt;groupId>com.google.code.findbugs&lt;\/groupId> \u00a0\u00a0\u00a0 &lt;artifactId>jsr305&lt;\/artifactId> \u00a0\u00a0\u00a0 &lt;version>3.0.2&lt;\/version> \u00a0\u00a0\u00a0 &lt;scope>provided&lt;\/scope> &lt;\/dependency><\/code><\/pre>\n<p>Scope \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c &#171;provided&#187;, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u0432\u0430\u043c \u0432 Runtime \u044d\u0442\u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, JVM \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Runtime \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 <code>Class.getAnnotations()<\/code> \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438. \u041f\u043e\u0434\u0445\u043e\u0434 \u0441 provided <a href=\"https:\/\/github.com\/spring-projects\/spring-framework\/blob\/main\/build.gradle#L121\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442<\/a> \u0438 Spring Framework, \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <code>org.springframework.lang.NonNull<\/code> (\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0442\u043e <code>import javax.annotation.Nonnull<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d \u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u0448\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f). \u0420\u0430\u0437\u043c\u0435\u0440 jar \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ~20 \u043a\u0411.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@NonnullByDefault<\/code><\/p>\n<pre><code class=\"java\"> import \u043b\u044e\u0431\u0438\u043c\u0430\u044f.\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.Nonnull  \/**  * This annotation can be applied to a package, class or method to indicate that the class fields,  * method return types and parameters in that element are not null by default unless there is:  * The method overrides a method in a superclass (in which  * case the annotation of the corresponding parameter in the superclass applies) there is a  * default parameter annotation applied to a more tightly nested element.  *  * @see &lt;a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-125281\">Impl&lt;\/a>  *\/ @Documented @Nonnull @TypeQualifierDefault({         ElementType.ANNOTATION_TYPE,         ElementType.CONSTRUCTOR,         ElementType.FIELD,         ElementType.LOCAL_VARIABLE,         ElementType.METHOD,         ElementType.PACKAGE,         ElementType.PARAMETER,         ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface NonnullByDefault { }<\/code><\/pre>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nonnull<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u0431\u043e  <code>org.springframework.lang.NonNull<\/code>(\u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Spring), \u043b\u0438\u0431\u043e <code>javax.annotation.Nonnull<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u044b\u0448\u0430\u0442\u044c \u0437\u0430\u0446\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435, \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437 NPE (\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430), \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b <code>package-info.java<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c<\/p>\n<pre><code class=\"java\">@NonnullByDefault package ru.my.package;<\/code><\/pre>\n<p>Idea \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430: &#171;<em>Method annotated with @Nullable must not override @NonnullByDefault method<\/em>&#171;<\/p>\n<h4>\u041f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Checker Framework<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c (\u0440\u0430\u0437\u043c\u0435\u0440 jar \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ~200 \u043a\u0411)<\/p>\n<pre><code class=\"xml\">&lt;dependency>     &lt;groupId>org.checkerframework&lt;\/groupId>     &lt;artifactId>checker-qual&lt;\/artifactId>     &lt;version>3.25.0&lt;\/version>     &lt;scope>provided&lt;\/scope> &lt;\/dependency><\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b <code>package-info.java<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c<\/p>\n<pre><code class=\"java\">@DefaultQualifier(Nonnull.class) package ru.my.package; import \u043b\u044e\u0431\u0438\u043c\u0430\u044f.\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.Nonnull<\/code><\/pre>\n<p>\u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 &#8212; \u044d\u0442\u043e, \u0447\u0442\u043e \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0438\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0435 \u043d\u0430 <code>NonNull<\/code>, \u0430 <code>DefaultQualifier<\/code>: &#171;<em>Method annotated with @Nullable must not override @DefaultQualifier method<\/em>&#171;<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>Nonnull<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u0431\u043e <code>org.springframework.lang.NonNull<\/code>, \u043b\u0438\u0431\u043e <code>org.checkerframework.checker.nullness.qual.NonNull<\/code>.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Idea<\/h3>\n<p>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e <u>\u043e\u0434\u043d\u0438\u043c<\/u> \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0435\u044f\u0432\u043d\u0430\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@Nonnull<\/code>. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u043c \u043d\u0430\u0441\u0447\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 class-\u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043c\u0435\u0440 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 <code>@Nonnull<\/code> \u0432 class-\u0444\u0430\u0439\u043b\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442).<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438  \u0432 Idea \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u043d\u044e <em>Editor \u2192 Inspections \u2192 Java \u2192 Probable bugs<\/em> , \u0432  \u0433\u0440\u0443\u043f\u043f\u0430\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 <code>@NotNull\/@Nullable problems<\/code>,\u00a0<code>Return of 'null'<\/code> \u0438 <code>Constant conditions &amp; exceptions<\/code>. \u0421heckbox-\u044b \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u0430 \u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 CVS \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>.idea\/inspectionProfiles<\/code> \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li>\n<p><code>Inspections.xml<\/code><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;component name=\"InspectionProjectProfileManager\">   &lt;profile version=\"1.0\">     &lt;option name=\"myName\" value=\"Inspections\" \/>     &lt;inspection_tool class=\"ConstantConditions\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">       &lt;option name=\"SUGGEST_NULLABLE_ANNOTATIONS\" value=\"true\" \/>       &lt;option name=\"DONT_REPORT_TRUE_ASSERT_STATEMENTS\" value=\"false\" \/>     &lt;\/inspection_tool>     &lt;inspection_tool class=\"NullableProblems\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">       &lt;option name=\"REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL\" value=\"false\" \/>       &lt;option name=\"REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_GETTER\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_SETTER_PARAMETER\" value=\"true\" \/>       &lt;option name=\"REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS\" value=\"false\" \/>       &lt;option name=\"REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD\" value=\"true\" \/>     &lt;\/inspection_tool>     &lt;inspection_tool class=\"ReturnNull\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">       &lt;option name=\"m_reportObjectMethods\" value=\"true\" \/>       &lt;option name=\"m_reportArrayMethods\" value=\"true\" \/>       &lt;option name=\"m_reportCollectionMethods\" value=\"true\" \/>       &lt;option name=\"m_ignorePrivateMethods\" value=\"false\" \/>     &lt;\/inspection_tool>     &lt;inspection_tool class=\"VariableTypeCanBeExplicit\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\" editorAttributes=\"WARNING_ATTRIBUTES\" \/>   &lt;\/profile> &lt;\/component><\/code><\/pre>\n<ul>\n<li>\n<p><code>profiles_settings.xml<\/code><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"yaml\">&lt;component name=\"InspectionProjectProfileManager\">   &lt;settings>     &lt;option name=\"PROJECT_PROFILE\" value=\"Inspections\" \/>     &lt;version value=\"1.0\" \/>   &lt;\/settings> &lt;\/component><\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 GIT, \u0442\u043e \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 <code>.gitignore<\/code><\/p>\n<pre><code>.idea !.idea\/inspectionProfiles<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>Constant conditions &amp; exceptions<\/code> \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c  \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439, \u043a\u043b\u0438\u043a\u043d\u0443\u0432 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 <code>Configure Annotations...<\/code>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>.idea\/misc.xml<\/code>. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CVS, \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u043a, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435  \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0432\u0441\u0435\u043c\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/147\/541\/8b4\/1475418b462726c34f1878634eec2b2c.png\" alt=\"\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u0432 Idea\" title=\"\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u0432 Idea\" width=\"1293\" height=\"697\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/147\/541\/8b4\/1475418b462726c34f1878634eec2b2c.png\"\/><figcaption>\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u0432 Idea<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/633\/614\/967\/6336149678c1c1bf7580b6e5b10b0af3.png\" alt=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\" title=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\" width=\"1200\" height=\"451\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/633\/614\/967\/6336149678c1c1bf7580b6e5b10b0af3.png\"\/><figcaption>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h3>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u0442\u0430\u043c, \u0433\u0434\u0435 \u0434\u0430\u043b\u0435\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f <code>Nonnull<\/code>, \u043f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c; \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 <code>Nonnull<\/code> \u043c\u043e\u0436\u043d\u043e \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442).<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"center\"><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\"><strong>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nonnull<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c<code>Nonnull<\/code> \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705  <\/p>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u0415\u0441\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nullable<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <code>Nullable<\/code>. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 setter \u0438 getter \u043c\u0435\u0442\u043e\u0434\u0430\u0445  \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c \u043f\u043e\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 <code>null<\/code> \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d <code>Nonnull<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code> \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <code>null<\/code> \u043e\u0442\u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e (\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u0438\u0431\u043e \u044d\u0442\u043e\u0442 warn, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439)<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code>, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e <code>null<\/code>  <\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <code>Nonnull<\/code> \u043f\u043e\u043b\u044e \u043d\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>null<\/code> (\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 warn)  <\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">8<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code>, \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>null<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">9<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code>, \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 <code>null<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">10<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f NPE \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>null<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u044f \u0432 Idea \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/076\/2f3\/222\/0762f3222ccde6ef29a0a02697502d0b.png\" alt=\"\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\" title=\"\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\" width=\"1013\" height=\"801\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/076\/2f3\/222\/0762f3222ccde6ef29a0a02697502d0b.png\"\/><figcaption>\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7d0\/fec\/85b\/7d0fec85b87fd4a4a846dba752a9c39e.png\" alt=\"\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\" title=\"\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\" width=\"1002\" height=\"797\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d0\/fec\/85b\/7d0fec85b87fd4a4a846dba752a9c39e.png\"\/><figcaption>\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.framework.qual.DefaultQualifier;  @DefaultQualifier(NonNull.class) @SuppressWarnings({\"unused\", \"FieldMayBeFinal\", \"ResultOfMethodCallIgnored\", \"FieldCanBeLocal\"}) class Sub extends Base {     private Integer nonNull = 1;     @Nullable private Integer nullable;      @Nullable     @Override     Integer nonNull(Integer i) { return null; } \/\/ 1, 2      Integer getNullable() { return nullable; } \/\/ 3, 8      void setNullable(Integer nullable) { this.nullable = nullable; }      @Nullable     Integer getNonNull() { return nonNull; }      void setNonNull(@Nullable Integer nonNull) { this.nonNull = nonNull; } \/\/ 7      void test() { nonNullArg(1); nonNullArg(null); } \/\/ 4      void nonNullArg(Integer i) {} \/\/ 5 (works for Checker Framework only; JSR 305 requires @NonNull on arg explicitly)      void test2() { Integer i = null; } \/\/ 6      \/\/ (configured by \"Constraint conditions &amp; exceptions\" -> \"Report nullable method always return non-null value\")     @Nullable \/\/ 9? (no warn, idea bug)     Object nonNullResult(Integer i) { return new Object(); }      void testNpe(@Nullable Integer i) { i.longValue(); } \/\/ 10      void noTestNpe(Integer i) { i.longValue(); } \/\/ this is nonNull by default }  @DefaultQualifier(NonNull.class) class Base {     Integer nonNull(@Nullable Integer i) { return 1; } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0439 \u0438\u0437 maven<\/h3>\n<h3>SpotBugs (JSR-305) plugin<\/h3>\n<p> \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043a\u0435\u0439\u0441\u044b 4, 7, 10 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 JSR-305, \u0432  \u0441\u0445\u0435\u043c\u0435 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 Checker Framework \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 10 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 NPE  (\u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 <a href=\"https:\/\/github.com\/spotbugs\/spotbugs\/issues\/643\" rel=\"noopener noreferrer nofollow\">SpotBugs<\/a>). \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f maven <a href=\"https:\/\/spotbugs.readthedocs.io\/en\/stable\/maven.html\" rel=\"noopener noreferrer nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c<\/a> \u043e\u0431\u0440\u0430\u0437\u043e\u043c  <\/p>\n<pre><code class=\"xml\">&lt;plugin>     &lt;groupId>com.github.spotbugs&lt;\/groupId>     &lt;artifactId>spotbugs-maven-plugin&lt;\/artifactId>     &lt;version>4.7.2.1&lt;\/version>     &lt;executions>         &lt;execution>             &lt;goals>                 &lt;goal>check&lt;\/goal>             &lt;\/goals>             &lt;phase>compile&lt;\/phase>         &lt;\/execution>     &lt;\/executions> &lt;\/plugin><\/code><\/pre>\n<h3>Checker Framework plugin<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u0440\u043e\u043c\u0435 5-\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f 4-\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439. \u0414\u043b\u044f Java 11+ \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/checkerframework.org\/manual\/#maven\" rel=\"noopener noreferrer nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c<\/a> \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<pre><code class=\"xml\">&lt;plugin>     &lt;groupId>org.apache.maven.plugins&lt;\/groupId>     &lt;artifactId>maven-compiler-plugin&lt;\/artifactId>     &lt;version>3.10.1&lt;\/version>     &lt;configuration>         &lt;fork>true&lt;\/fork> &lt;!-- Must fork or else JVM arguments are ignored. -->         &lt;showDeprecation>true&lt;\/showDeprecation>         &lt;showWarnings>true&lt;\/showWarnings>         &lt;annotationProcessorPaths>             &lt;path>                 &lt;groupId>org.projectlombok&lt;\/groupId>                 &lt;artifactId>lombok&lt;\/artifactId>                 &lt;version>${lombok.version}&lt;\/version>             &lt;\/path>             &lt;path>                 &lt;groupId>org.checkerframework&lt;\/groupId>                 &lt;artifactId>checker&lt;\/artifactId>                 &lt;version>${checkerframework.version}&lt;\/version>             &lt;\/path>         &lt;\/annotationProcessorPaths>         &lt;annotationProcessors>             &lt;annotationProcessor>                 lombok.launch.AnnotationProcessorHider$AnnotationProcessor             &lt;\/annotationProcessor>             &lt;annotationProcessor>                 org.checkerframework.checker.nullness.NullnessChecker             &lt;\/annotationProcessor>         &lt;\/annotationProcessors>         &lt;compilerArgs combine.children=\"append\">             &lt;!--arg>-Awarns&lt;\/arg--> &lt;!-- CI: \u043f\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c -->             &lt;arg>-Astubs=jdk.astub&lt;\/arg>             &lt;arg>-J--add-opens=jdk.compiler\/com.sun.tools.javac.code=ALL-UNNAMED&lt;\/arg>             &lt;arg>-J--add-opens=jdk.compiler\/com.sun.tools.javac.comp=ALL-UNNAMED&lt;\/arg>             &lt;arg>-J--add-opens=jdk.compiler\/com.sun.tools.javac.main=ALL-UNNAMED&lt;\/arg>             &lt;arg>-J--add-opens=jdk.compiler\/com.sun.tools.javac.processing=ALL-UNNAMED&lt;\/arg>             &lt;arg>-J--add-opens=jdk.compiler\/com.sun.tools.javac.tree=ALL-UNNAMED&lt;\/arg>             &lt;arg>-J--add-opens=jdk.compiler\/com.sun.tools.javac.util=ALL-UNNAMED&lt;\/arg>         &lt;\/compilerArgs>     &lt;\/configuration> &lt;\/plugin><\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043d\u0435\u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c <a href=\"https:\/\/github.com\/typetools\/jdk\" rel=\"noopener noreferrer nofollow\">API JDK<\/a>, \u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u044b <code>Objects.requireNonNull(@NonNull arg)<\/code>, \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f <code>@NonNull<\/code>. \u0414\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c astub. \u0412 \u043a\u043e\u0440\u043d\u0435 CVS \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u044f \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/checkerframework.org\/manual\/#suppressing-warnings-stub\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0437\u0434\u0430\u0442\u044c <\/a>\u0444\u0430\u0439\u043b <code>jdk.astub<\/code>  <\/p>\n<pre><code class=\"java\">import org.checkerframework.checker.nullness.qual.Nullable;   package java.util; public class Objects {     public static &lt;T> T requireNonNull(@Nullable T obj);     public static &lt;T> T requireNonNull(@Nullable T obj, String message); }<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b <a href=\"https:\/\/checkerframework.org\/manual\/#stub-format\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0436\u043d\u043e<\/a> \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <code>package<\/code>. <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; <code>@SuppressWarnings({\"nullness\", \"ConstantConditions\"})<\/code> &#8212; \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043e\u0431\u0445\u043e\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 NPE, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0431\u0440\u0430\u0442\u044c warning \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 (&#171;nullness&#187;), \u043d\u043e \u0438 \u0434\u043b\u044f \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0439 Idea (&#171;ConstantConditions&#187;).<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/695004\/\"> https:\/\/habr.com\/ru\/post\/695004\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%B8%D0%BD%D1%86%D0%B8%D0%BF_%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B8_%D0%91%D0%B0%D1%80%D0%B1%D0%B0%D1%80%D1%8B_%D0%9B%D0%B8%D1%81%D0%BA%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">\u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432<\/a> (<a href=\"https:\/\/ru.wikipedia.org\/wiki\/SOLID_(%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82%D0%BD%D0%BE-%D0%BE%D1%80%D0%B8%D0%B5%D0%BD%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5)\" rel=\"noopener noreferrer nofollow\">SOLID<\/a>) \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430-\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u043c-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c, \u043d\u0443\u0436\u043d\u044b <a href=\"https:\/\/habr.com\/ru\/post\/237843\/\" rel=\"noopener noreferrer nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/a> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nonnull<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <code>Nonnull<\/code>. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nullable<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c <code>Nullable<\/code> \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0437\u0430 \u0432\u0430\u0441 Idea \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0418\u0437 &#171;\u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187; Idea \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u043d\u0435 \u0442\u0435, \u0447\u0442\u043e \u0432\u044b\u0448\u0435). \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 null free \u043a\u043e\u0434, \u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435: 1) \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430; 2) \u043b\u0435\u0433\u0430\u0441\u0438 \u043a\u043e\u0434\u0430; \u0438 3) \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e <code>null<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 <code>@Nullable<\/code> \u0438 <code>@Nonnull<\/code>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0442\u043e\u043d\u0443\u0442\u044c \u0432 \u044d\u0442\u0438\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e, \u0447\u0442\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <code>@Nonnull<\/code> \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0442.\u0435. \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435\u044f\u0432\u043d\u0430\u044f.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u044c Idea \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043a\u0430\u043a <code>@Nonnull<\/code>, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u043a\u043e\u0434\u043e\u043c. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c <a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-144920\/Please-allow-custom-NonnullByDefault-annotations#focus=Comments-27-3949320.0-0\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043c\u0435\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Idea. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>org.eclipse.jdt.annotation.NonNullByDefault<\/code> \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e.<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-125281\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 JSR-305<\/a>. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u0430-\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b      \u043f\u043e\u0434\u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/checkerframework.org\/manual\/#default-qualifier\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Checker Framework<\/a>. \u041c\u0435\u0442\u0430-\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435      \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0430\u043a\u0435\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u0430 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0434\u043f\u0430\u043a\u0435\u0442\u043e\u0432.\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/checkerframework.org\/manual\/#lombok-copying-annotations\" rel=\"noopener noreferrer nofollow\">Lombok<\/a>.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c JSR-305<\/h4>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c<\/p>\n<pre><code class=\"xml\">&lt;dependency> \u00a0\u00a0\u00a0 &lt;groupId>com.google.code.findbugs&lt;\/groupId> \u00a0\u00a0\u00a0 &lt;artifactId>jsr305&lt;\/artifactId> \u00a0\u00a0\u00a0 &lt;version>3.0.2&lt;\/version> \u00a0\u00a0\u00a0 &lt;scope>provided&lt;\/scope> &lt;\/dependency><\/code><\/pre>\n<p>Scope \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c &#171;provided&#187;, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u0432\u0430\u043c \u0432 Runtime \u044d\u0442\u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, JVM \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Runtime \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 <code>Class.getAnnotations()<\/code> \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438. \u041f\u043e\u0434\u0445\u043e\u0434 \u0441 provided <a href=\"https:\/\/github.com\/spring-projects\/spring-framework\/blob\/main\/build.gradle#L121\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442<\/a> \u0438 Spring Framework, \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <code>org.springframework.lang.NonNull<\/code> (\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0442\u043e <code>import javax.annotation.Nonnull<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d \u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u0448\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f). \u0420\u0430\u0437\u043c\u0435\u0440 jar \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ~20 \u043a\u0411.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@NonnullByDefault<\/code><\/p>\n<pre><code class=\"java\"> import \u043b\u044e\u0431\u0438\u043c\u0430\u044f.\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.Nonnull  \/**  * This annotation can be applied to a package, class or method to indicate that the class fields,  * method return types and parameters in that element are not null by default unless there is:  * The method overrides a method in a superclass (in which  * case the annotation of the corresponding parameter in the superclass applies) there is a  * default parameter annotation applied to a more tightly nested element.  *  * @see &lt;a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-125281\">Impl&lt;\/a>  *\/ @Documented @Nonnull @TypeQualifierDefault({         ElementType.ANNOTATION_TYPE,         ElementType.CONSTRUCTOR,         ElementType.FIELD,         ElementType.LOCAL_VARIABLE,         ElementType.METHOD,         ElementType.PACKAGE,         ElementType.PARAMETER,         ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface NonnullByDefault { }<\/code><\/pre>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nonnull<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u0431\u043e  <code>org.springframework.lang.NonNull<\/code>(\u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Spring), \u043b\u0438\u0431\u043e <code>javax.annotation.Nonnull<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u044b\u0448\u0430\u0442\u044c \u0437\u0430\u0446\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435, \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437 NPE (\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430), \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b <code>package-info.java<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c<\/p>\n<pre><code class=\"java\">@NonnullByDefault package ru.my.package;<\/code><\/pre>\n<p>Idea \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430: &#171;<em>Method annotated with @Nullable must not override @NonnullByDefault method<\/em>&#171;<\/p>\n<h4>\u041f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Checker Framework<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c (\u0440\u0430\u0437\u043c\u0435\u0440 jar \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ~200 \u043a\u0411)<\/p>\n<pre><code class=\"xml\">&lt;dependency>     &lt;groupId>org.checkerframework&lt;\/groupId>     &lt;artifactId>checker-qual&lt;\/artifactId>     &lt;version>3.25.0&lt;\/version>     &lt;scope>provided&lt;\/scope> &lt;\/dependency><\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b <code>package-info.java<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c<\/p>\n<pre><code class=\"java\">@DefaultQualifier(Nonnull.class) package ru.my.package; import \u043b\u044e\u0431\u0438\u043c\u0430\u044f.\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.Nonnull<\/code><\/pre>\n<p>\u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 &#8212; \u044d\u0442\u043e, \u0447\u0442\u043e \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0438\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0435 \u043d\u0430 <code>NonNull<\/code>, \u0430 <code>DefaultQualifier<\/code>: &#171;<em>Method annotated with @Nullable must not override @DefaultQualifier method<\/em>&#171;<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>Nonnull<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u0431\u043e <code>org.springframework.lang.NonNull<\/code>, \u043b\u0438\u0431\u043e <code>org.checkerframework.checker.nullness.qual.NonNull<\/code>.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Idea<\/h3>\n<p>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e <u>\u043e\u0434\u043d\u0438\u043c<\/u> \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0435\u044f\u0432\u043d\u0430\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@Nonnull<\/code>. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u043c \u043d\u0430\u0441\u0447\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 class-\u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043c\u0435\u0440 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 <code>@Nonnull<\/code> \u0432 class-\u0444\u0430\u0439\u043b\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442).<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438  \u0432 Idea \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u043d\u044e <em>Editor \u2192 Inspections \u2192 Java \u2192 Probable bugs<\/em> , \u0432  \u0433\u0440\u0443\u043f\u043f\u0430\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 <code>@NotNull\/@Nullable problems<\/code>,\u00a0<code>Return of 'null'<\/code> \u0438 <code>Constant conditions &amp; exceptions<\/code>. \u0421heckbox-\u044b \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u0430 \u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 CVS \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>.idea\/inspectionProfiles<\/code> \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li>\n<p><code>Inspections.xml<\/code><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;component name=\"InspectionProjectProfileManager\">   &lt;profile version=\"1.0\">     &lt;option name=\"myName\" value=\"Inspections\" \/>     &lt;inspection_tool class=\"ConstantConditions\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">       &lt;option name=\"SUGGEST_NULLABLE_ANNOTATIONS\" value=\"true\" \/>       &lt;option name=\"DONT_REPORT_TRUE_ASSERT_STATEMENTS\" value=\"false\" \/>     &lt;\/inspection_tool>     &lt;inspection_tool class=\"NullableProblems\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">       &lt;option name=\"REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL\" value=\"false\" \/>       &lt;option name=\"REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_GETTER\" value=\"true\" \/>       &lt;option name=\"REPORT_NOT_ANNOTATED_SETTER_PARAMETER\" value=\"true\" \/>       &lt;option name=\"REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS\" value=\"false\" \/>       &lt;option name=\"REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD\" value=\"true\" \/>     &lt;\/inspection_tool>     &lt;inspection_tool class=\"ReturnNull\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">       &lt;option name=\"m_reportObjectMethods\" value=\"true\" \/>       &lt;option name=\"m_reportArrayMethods\" value=\"true\" \/>       &lt;option name=\"m_reportCollectionMethods\" value=\"true\" \/>       &lt;option name=\"m_ignorePrivateMethods\" value=\"false\" \/>     &lt;\/inspection_tool>     &lt;inspection_tool class=\"VariableTypeCanBeExplicit\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\" editorAttributes=\"WARNING_ATTRIBUTES\" \/>   &lt;\/profile> &lt;\/component><\/code><\/pre>\n<ul>\n<li>\n<p><code>profiles_settings.xml<\/code><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"yaml\">&lt;component name=\"InspectionProjectProfileManager\">   &lt;settings>     &lt;option name=\"PROJECT_PROFILE\" value=\"Inspections\" \/>     &lt;version value=\"1.0\" \/>   &lt;\/settings> &lt;\/component><\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 GIT, \u0442\u043e \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 <code>.gitignore<\/code><\/p>\n<pre><code>.idea !.idea\/inspectionProfiles<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>Constant conditions &amp; exceptions<\/code> \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c  \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439, \u043a\u043b\u0438\u043a\u043d\u0443\u0432 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 <code>Configure Annotations...<\/code>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>.idea\/misc.xml<\/code>. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CVS, \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u043a, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435  \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0432\u0441\u0435\u043c\u0438.<\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u0432 Idea<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/figcaption><\/figure>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h3>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u0442\u0430\u043c, \u0433\u0434\u0435 \u0434\u0430\u043b\u0435\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f <code>Nonnull<\/code>, \u043f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c; \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 <code>Nonnull<\/code> \u043c\u043e\u0436\u043d\u043e \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442).<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"center\"><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\"><strong>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nonnull<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c<code>Nonnull<\/code> \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705  <\/p>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u0415\u0441\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Nullable<\/code>, \u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <code>Nullable<\/code>. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 setter \u0438 getter \u043c\u0435\u0442\u043e\u0434\u0430\u0445  \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c \u043f\u043e\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 <code>null<\/code> \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d <code>Nonnull<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code> \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <code>null<\/code> \u043e\u0442\u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e (\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u0438\u0431\u043e \u044d\u0442\u043e\u0442 warn, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439)<\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code>, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e <code>null<\/code>  <\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <code>Nonnull<\/code> \u043f\u043e\u043b\u044e \u043d\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>null<\/code> (\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 warn)  <\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">8<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code>, \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>null<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">9<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>Nullable<\/code>, \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 <code>null<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">10<\/p>\n<\/td>\n<td data-colwidth=\"486\" width=\"486\">\n<p align=\"left\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f NPE \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>null<\/code><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u044f \u0432 Idea \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 Idea \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.framework.qual.DefaultQualifier;  @DefaultQualifier(NonNull.class) @SuppressWarnings({\"unused\", \"FieldMayBeFinal\", \"ResultOfMethodCallIgnored\", \"FieldCanBeLocal\"}) class Sub extends Base {     private Integer nonNull = 1;     @Nullable private Integer nullable;      @Nullable     @Override     Integer nonNull(Integer i) { return null; } \/\/ 1, 2      Integer getNullable() { return nullable; } \/\/ 3, 8      void setNullable(Integer nullable) { this.nullable = nullable; }      @Nullable     Integer getNonNull() { return nonNull; }      void<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-340136","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340136"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340136\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}