{"id":464381,"date":"2025-06-25T03:00:15","date_gmt":"2025-06-25T03:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=464381"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=464381","title":{"rendered":"<span>\u041a\u0430\u0440\u0442\u044b, Java, 2 null&#8217;\u0430. XMage edition<\/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>\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u043d\u0430 Java \u2014 \u0432\u0435\u0449\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0434\u043a\u0430\u044f, \u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0443\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442 XMage \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0451\u043b PVS-Studio \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ecd\/c0a\/024\/ecdc0a024c4b5e66136cc77613639a3d.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/ecd\/c0a\/024\/ecdc0a024c4b5e66136cc77613639a3d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ecd\/c0a\/024\/ecdc0a024c4b5e66136cc77613639a3d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p><a href=\"https:\/\/github.com\/magefree\/mage\" rel=\"noopener noreferrer nofollow\">XMage<\/a> \u2014 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 open source \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438\u0433\u0440\u044b <a href=\"https:\/\/magic.wizards.com\/\" rel=\"noopener noreferrer nofollow\">Magic: the Gathering<\/a>. \u0418\u0433\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0441 \u0431\u043e\u0442\u0430\u043c\u0438, \u0442\u0430\u043a \u0438 \u043e\u043d\u043b\u0430\u0439\u043d \u0441 \u0434\u0440\u0443\u0437\u044c\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Java \u0438 \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 10 \u043b\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f: \u0441\u0435\u0439\u0447\u0430\u0441 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 47 \u0442\u044b\u0441\u044f\u0447 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u2014 1.8 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0441\u0442\u0440\u043e\u043a. \u041f\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 XMage \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/0758\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430 ~800 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a, \u0438 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 <a href=\"https:\/\/github.com\/magefree\/mage\/wiki\/Development-Testing-Tools\" rel=\"noopener noreferrer nofollow\">\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430<\/a> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430. \u0418 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u0431\u044b\u043b\u043e \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0451\u0442 \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<h3>Unit-\u0442\u0435\u0441\u0442\u044b \u0432\u0441\u0435\u043c\u0443 \u0433\u043e\u043b\u043e\u0432\u0430<\/h3>\n<p>\u0418\u0437\u0432\u0435\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0435\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u044e\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u043e \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432?<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u0432 unit-\u0442\u0435\u0441\u0442\u0430\u0445.<\/p>\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e<\/h4>\n<pre><code class=\"java\">@Test public void test_NamesEquals() {   ....   \/\/ same names (empty names can't be same)   Assert.assertFalse(CardUtil.haveSameNames(         \"\",          \"\"));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_CREATURE.getObjectName(),          \"\"));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_CREATURE.getObjectName(),          EmptyNames.FACE_DOWN_CREATURE.getObjectName()));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_TOKEN.getObjectNam(),          \"\"));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_TOKEN.getObjectNam(),          EmptyNames.FACE_DOWN_CREATURE.getObjectName())); \/\/ &lt;=   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6072\/\" rel=\"noopener noreferrer nofollow\">V6072<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;FACE_DOWN_TOKEN&#8217; variable should be used instead of &#8216;FACE_DOWN_CREATURE&#8217;. AliasesApiTest.java 30<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>FACE_DOWN_TOKEN<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>FACE_DOWN_CREATURE<\/code>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f &#171;\u043f\u0443\u0441\u0442\u044b\u0445 \u0438\u043c\u0451\u043d&#187;. \u041f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u0443\u0441\u0442\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438. \u041e\u0431 \u044d\u0442\u043e\u043c \u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. <code>FACE_DOWN_CREATURE<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0441 \u0441\u043e\u0431\u043e\u0439 \u0436\u0435, \u0430 <code>FACE_DOWN_TOKEN<\/code> \u2014 \u043d\u0435\u0442.<\/p>\n<p>\u042f \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u0438 \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0448\u0451\u043b \u0443\u0434\u0430\u0447\u043d\u043e.<\/p>\n<h4>\u041d\u0435\u0440\u0430\u0432\u043d\u044b\u0439 \u0431\u043e\u0439<\/h4>\n<pre><code class=\"java\">@Test public void test_Simple_LongGame() {     ....     addCard(Zone.LIBRARY, playerA, \"Mountain\", 10);     addCard(Zone.LIBRARY, playerA, \"Forest\", 10);     addCard(Zone.LIBRARY, playerA, \"Lightning Bolt\", 20);     addCard(Zone.LIBRARY, playerA, \"Balduvian Bears\", 10);     \/\/     addCard(Zone.LIBRARY, playerB, \"Mountain\", 10);     addCard(Zone.LIBRARY, playerA, \"Forest\", 10);        \/\/ &lt;=     addCard(Zone.LIBRARY, playerB, \"Lightning Bolt\", 20);     addCard(Zone.LIBRARY, playerB, \"Balduvian Bears\", 10);     .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6072\/\" rel=\"noopener noreferrer nofollow\">V6072<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;playerB&#8217; variable should be used instead of &#8216;playerA&#8217;. SimulationPerformanceAITest.java 60<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0443\u0432\u0438\u0434\u0435\u0432 \u0441\u0442\u0440\u0435\u043b\u043a\u0443 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0437\u0434\u0435\u0441\u044c \ud83d\ude42<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0440\u0430\u043a\u0430 AI vs AI \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u0447\u0435\u0441\u0442\u043d\u043e. \u0413\u043e\u0441\u043f\u043e\u0434\u0438\u043d\u0443 A \u0434\u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u0435\u0441\u043d\u044b\u0445 \u043a\u0430\u0440\u0442, \u043d\u0435\u0436\u0435\u043b\u0438 \u0433\u043e\u0441\u043f\u043e\u0434\u0438\u043d\u0443 B. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. \u0422\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c \u2014 \u0442\u0435\u0441\u0442 \u0437\u0435\u043b\u0451\u043d\u044b\u0439.<\/p>\n<h3>\u041e\u0447\u0435\u043f\u044f\u0442\u043a\u0438 \u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b<\/h3>\n<h4>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043e\u0445<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Null dereference of &#8216;permanent&#8217;. ThreeTreeScribe.java 78<\/p>\n<pre><code class=\"java\">@Override public boolean checkTrigger(GameEvent event, Game game) {     ....     Permanent permanent = zEvent.getTarget();     return (    permanent != null              || !permanent.isControlledBy(getControllerId()))  \/\/ &lt;=             &amp;&amp; (permanent.getId().equals(getSourceId())                  || permanent.isCreature(game)); } <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044f\u0432\u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043b\u044b\u0431\u043d\u0443\u0442\u044c\u0441\u044f. \u0412\u043d\u0443\u0442\u0440\u0438 <code>return<\/code> \u043c\u044b \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c <code>permanent<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0432\u0435\u043d <code>null<\/code>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u0440\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> \u0438 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u041d\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Potential null dereference of &#8216;player&#8217;. DelifsCone.java 104<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Potential null dereference of &#8216;permanent&#8217;. DelifsCone.java 104<\/p>\n<pre><code class=\"java\">@Override public boolean apply(Game game, Ability source) {     Player player = game.getPlayer(source.getControllerId());     Permanent          permanent = game.getPermanent(....);     if (player != null || permanent != null) {         player.gainLife(permanent.getPower().getValue(), game, source);         return true;     }     return false; } <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 <code>null<\/code> \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0430 \u0438\u0437 \u043d\u0438\u0445, \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u042f\u0432\u043d\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u043e\u0441\u044c <code>&amp;&amp;<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>||<\/code>. \u0422\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u043a\u0441\u0442\u0430\u0442\u0438, \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e.<\/p>\n<h4>\u041d\u0443, \u043f\u043e\u0447\u0442\u0438&#8230;<\/h4>\n<pre><code class=\"java\">static {     for (int count = 1; count &lt;= 6; count++) {         FilterCard filter = new FilterCreatureCard(                 \"creature card that's exactly \" +                         CardUtil.numberToText(count) +                         \" color\" + (count &gt; 0 ? \"s\" : \"\")         );         filter.add(new EvolvingDoorPredicate(count));         filterMap.put(count, filter);     } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6007\/\" rel=\"noopener noreferrer nofollow\">V6007<\/a> Expression &#8216;count &gt; 0&#8217; is always true. EvolvingDoor.java 76<\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 &#171;s&#187; \u043a \u0441\u043b\u043e\u0432\u0443 &#171;color&#187;. \u0421 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 0 \u043d\u0430 1 \u0432 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0439 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0435 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u0446\u0438\u043a\u043b \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e.<\/p>\n<h4>\u0412\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u2013 \u043c\u044b \u0443\u0436\u0435 \u043c\u043e\u0433\u043b\u0438<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6060\/\" rel=\"noopener noreferrer nofollow\">V6060<\/a> The &#8216;table&#8217; reference was utilized before it was verified against null. TableController.java 725<\/p>\n<pre><code class=\"java\">private void startGame(UUID choosingPlayerId) throws GameException {     try {         ....     } catch (Exception ex) {         logger.fatal(\"Error starting game table: \" + table.getId(), ex);         if (table != null) {             managerFactory.tableManager().removeTable(table.getId());         }         ....      } } <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 <code>null<\/code> \u0434\u0435\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435. \u041d\u043e \u0432\u0441\u0435\u043c\u0443 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f. \u0412\u043e\u0442 \u0438 \u0437\u0434\u0435\u0441\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 <code>table<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u043d\u0435 <code>null<\/code> \u043b\u0438 \u043e\u043d.<\/p>\n<p>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6060\/\" rel=\"noopener noreferrer nofollow\">V6060<\/a> The &#8216;enchantment&#8217; reference was utilized before it was verified against null. PublicEnemy.java 79<\/p>\n<pre><code class=\"java\">@Override public boolean applies(Permanent permanent, Ability source, Game game) {     Permanent          enchantment = game.getPermanent(source.getSourceId());     Permanent          enchantedCreature = game.getPermanent(enchantment.getAttachedTo());     if (enchantment == null || enchantedCreature == null) {         return false;     }     if (permanent.isControlledBy(enchantedCreature.getControllerId())) {         return false;     }     return true; } <\/code><\/pre>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442 <code>enchantment<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <code>enchantedCreature<\/code>, \u0430 \u0443\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438 \u043e\u043d\u0438 <code>null<\/code>.<\/p>\n<h4>\u041d\u0435\u0434\u043e\u043c\u0430\u043f\u0438\u043b\u0438<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6012\/\" rel=\"noopener noreferrer nofollow\">V6012<\/a> The &#8216;?:&#8217; operator, regardless of its conditional expression, always returns one and the same value &#8216;card&#8217;. SkyclaveApparition.java 108<\/p>\n<pre><code class=\"java\">@Override public boolean apply(Game game, Ability source) {     ....      Set&lt;UUID&gt; owners = new HashSet&lt;&gt;();     int totalCMC = exile             .getCards(game)             .stream()             .filter(Objects::nonNull)             .map(card -&gt; owners.add(card.getOwnerId()) ? card : card) \/\/ &lt;=             .mapToInt(MageObject::getManaValue)             .sum();     ....     return true; } <\/code><\/pre>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0422\u043e \u043b\u0438 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <code>card<\/code> \u0445\u043e\u0442\u0435\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0435\u0442\u043e\u043a \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438, \u0442\u043e \u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b stream&#8217;\u0430 \u0445\u043e\u0442\u044f\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>Set<\/code> <code>owners<\/code>. \u0415\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u043f\u0440\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>peek<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>map<\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u043e \u043c\u0435\u0442\u043e\u0434\u044b peek \u0438 map<\/summary>\n<div class=\"spoiler__content\">\n<p><code>peek<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0439 \u0435\u043c\u0443 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0441 \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p><code>map<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0435\u043c\u0443 \u0435\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/div>\n<\/details>\n<h4>\u0418 \u0441\u043d\u043e\u0432\u0430 null<\/h4>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0443\u0442\u044c \u043a \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0441\u0432\u043e\u0438\u043c\u0438 \u0433\u043b\u0430\u0437\u043a\u0430\u043c\u0438.<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"java\">@Override public boolean apply(Game game, Ability source) {     ....     Card card = getCard(player, toReveal, game);     ....     player.moveCards(card, Zone.BATTLEFIELD, source, game);     ....     Permanent creature = game.getPermanent(card.getId());  \/\/ &lt;=     .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Potential null dereference of &#8216;card&#8217;. AspiringChampion.java 84<\/p>\n<p>\u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 <code>getCard<\/code>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 <code>card<\/code>. \u0412 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f <code>null<\/code>:<\/p>\n<pre><code class=\"java\">private static Card getCard(Player player, Cards toReveal, Game game) {     for (Card card : player.getLibrary().getCards(game)) {         toReveal.add(card);         if (card.isCreature(game)) {             return card;         }     }     return null; } <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043c\u0435\u0442\u043e\u0434\u0430 <code>moveCards<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>card<\/code>, \u044d\u0442\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"java\">@Override public boolean moveCards(Card card, ....) {     Set&lt;Card&gt; cardList = new HashSet&lt;&gt;();     if (card != null) {         cardList.add(card);     }     return moveCards(cardList, toZone, source, game,                       tapped, faceDown, byOwner, appliedEffects); } <\/code><\/pre>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u043a\u043e\u0434\u0430, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043a\u043e\u0434\u0430 \u043a \u043d\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f, \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>null<\/code>.<\/p>\n<h3>\u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u044b Java \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h3>\n<h4>\u0410\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u0441\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c String \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6013\/\" rel=\"noopener noreferrer nofollow\">V6013<\/a> Strings &#8216;referenceName&#8217; and &#8216;&#187;&#187;&#8216; are compared by reference. Possibly an equality comparison was intended. UrzasHotTub.java 112<\/p>\n<pre><code class=\"java\">private boolean sharesWordWithName(String str) {     if (referenceName == null || referenceName == \"\") {         return false;     }     . . . . } <\/code><\/pre>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439). \u0421\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>==<\/code>, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0430 \u043d\u0435 \u0441\u0430\u043c\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0418 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 Java \u0435\u0441\u0442\u044c String Pool, \u0438 \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442. \u042d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0436\u0435. \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>equals<\/code> (\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u2014 \u043c\u0435\u0442\u043e\u0434 <code>isEmpty<\/code>).<\/p>\n<h4>\u0410\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u0441 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6087\/\" rel=\"noopener noreferrer nofollow\">V6087<\/a> InvalidClassException may occur during deserialization. Non-serializable ancestor &#8216;RoomImpl&#8217; is missing an accessible no-arg constructor. GamesRoomImpl.java 32<\/p>\n<pre><code class=\"java\">public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable {     .... } <\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u043c, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043d\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043a\u0430 \u043d\u0435\u0442 public no-arg \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"java\">public abstract class RoomImpl implements Room {     ....     public RoomImpl(ChatManager chatManager) {         roomId = UUID.randomUUID();         chatId = chatManager.createChatSession(\"Room \" + roomId);     }     .... } <\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e?<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Java (<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/1190\/\" rel=\"noopener noreferrer nofollow\">\u0442\u044b\u043a<\/a>). \u0421\u043e\u0447\u0442\u0443 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u0435\u0451 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442:<\/p>\n<blockquote>\n<p>\u0414\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0430 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043d\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043a\u0430. \u0418 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432\u0435\u0434\u044c \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043a\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0431\u0430\u0439\u0442\u043e\u0432. \u0414\u043b\u044f \u043d\u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u043d\u0430\u0441 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u043a\u0438. \u0427\u0442\u043e\u0431\u044b \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043d\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/blockquote>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>InvalidClassException<\/code> c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c <code>no valid constructor<\/code>.<\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f: &#171;\u041d\u0430\u0437\u0432\u0430\u043b\u0441\u044f <code>Serializable<\/code> \u2014 \u0438\u043c\u0435\u0439 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0441 public no-arg \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c&#187;.<\/p>\n<h4>\u0410\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6102\/\" rel=\"noopener noreferrer nofollow\">V6102<\/a> Inconsistent synchronization of the &#8216;continuousRuleModifyingEffects&#8217; field. Consider synchronizing the field on all usages. ContinuousEffects.java 43<\/p>\n<pre><code class=\"java\">public class ContinuousEffects {     ....     private ContinuousEffectsList&lt;....&gt;        continuousRuleModifyingEffects = new ContinuousEffectsList&lt;&gt;();     ....     public synchronized void removeInactiveEffects(Game game) {         ....         continuousRuleModifyingEffects.removeInactiveEffects(game);         ....     }     ....     public synchronized void removeEndOfCombatEffects() {         ....         continuousRuleModifyingEffects.removeEndOfCombatEffects();         ....     }     ....     public boolean preventedByRuleModification(....) {         for (.... effect : continuousRuleModifyingEffects) {     \/\/ &lt;=             if (!effect.checksEventType(event, game)) {                 continue;             }             ....         }         ....     }     ....     public synchronized void addEffect(....) {         ....         switch (effect.getEffectType()) {             ....             case CONTINUOUS_RULE_MODIFICATION:                 continuousRuleModifyingEffects.addEffect(....);                 break;             ....         }     }     .... } <\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440 \u044f \u043f\u0440\u0438\u0432\u0451\u043b \u043b\u0438\u0448\u044c \u043f\u0430\u0440\u0443 \u043c\u0435\u0441\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043a\u043e\u0434\u0435 \u0432 \u0432\u043e\u0441\u044c\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043f\u043e\u043b\u0435 <code>continuousRuleModifyingEffects<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u0430 \u0432 \u0434\u0435\u0432\u044f\u0442\u043e\u043c \u043d\u0435\u0442. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0441\u0442\u0430\u043b \u2014 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0431\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430.<\/p>\n<p>\u0420\u0430\u0437 \u043c\u0435\u0442\u043e\u0434\u044b, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u043e\u043b\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u043a\u0430\u043a <code>synchronized<\/code>, \u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u043e\u043b\u0435\u043c <code>continuousRuleModifyingEffects<\/code> \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>preventedByRuleModification<\/code> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 (\u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432), \u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c (\u0432 \u043d\u0435\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435). \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u0431\u0440\u043e\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>ConcurrentModificationException<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <code>ArrayList<\/code>, \u0430 \u0432 \u043d\u0435\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043d\u0435\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 for-each;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0442\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437-\u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438: \u043f\u043e\u0442\u043e\u043a, \u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u043d\u0435, \u0442\u0430\u043a \u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438.<\/p>\n<h4>\u0410\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u0441 equals \u0438 hashCode<\/h4>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>equals<\/code> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d, \u0430 <code>hashCode<\/code> \u043d\u0435\u0442.<\/p>\n<pre><code class=\"java\">public class CounterView implements Serializable {     . . . .      @Override     public boolean equals(Object other) {         if (other == this) {             return true;         }         if (other == null) {             return false;         }         if (!(other instanceof CounterView)) {             return false;         }         CounterView oth = (CounterView) other;         return                 (count == oth.count) &amp;&amp;                         (name.equals(oth.name));     } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6049\/\" rel=\"noopener noreferrer nofollow\">V6049<\/a> Classes that define &#8216;equals&#8217; method must also define &#8216;hashCode&#8217; method. Class: &#8216;CounterView&#8217;. CounterView.java 10<\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>equals<\/code> \u0438 <code>hashCode<\/code> \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0436\u0430\u0432\u0438\u0441\u0442\u0430 \u043e\u0442\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u043e\u0434\u043a\u043e\u0440\u043a\u0435. \u041d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u043b\u0438 \u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0438\u0445 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0447\u0438\u0442\u0430\u044e \u043d\u0443\u0436\u043d\u044b\u043c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u0448\u0438 \u0447\u0438\u0442\u0430\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u0440\u0435\u0431\u044f\u0442\u0430, \u043d\u043e \u0438 \u0442\u0435, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c Java. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0443.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0432\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432<code>equals<\/code> \u0438 <code>hashCode<\/code>. \u0412\u0441\u0435 \u0438\u0445 \u044f \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 <a href=\"https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/api\/java.base\/java\/lang\/Object.html#hashCode()\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <code>hashCode<\/code>:<\/p>\n<blockquote>\n<p>If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.<\/p>\n<\/blockquote>\n<p>\u0418 \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <code>equals<\/code> \u0438 <code>hashCode<\/code> \u0432 \u043f\u0430\u0440\u0435. \u041e\u0431 \u044d\u0442\u043e\u043c \u0436\u0435 \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <code>equals<\/code>:<\/p>\n<blockquote>\n<p>It is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.<\/p>\n<\/blockquote>\n<p>\u0410 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442? \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443. <code>HashMap<\/code>, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b <code>hashCode<\/code> \u0438 <code>equals<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>hashCode<\/code> \u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c <code>HashSet<\/code> \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0447\u0435\u0433\u043e \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c.<\/p>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043f\u043e\u0442\u043e\u043c. \u041b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e.<\/p>\n<h4>\u0410\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u0441 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6114\/\" rel=\"noopener noreferrer nofollow\">V6114<\/a> The &#8216;ComputerPlayerMCTS&#8217; class contains the &#8216;threadPoolSimulations&#8217; Closeable field, but the resources that the field is holding are not released inside the class. ComputerPlayerMCTS.java 39<\/p>\n<pre><code class=\"java\">public class ComputerPlayerMCTS extends ComputerPlayer {   ....   private ExecutorService threadPoolSimulations = null;   ....   protected void applyMCTS(....) {     if (this.threadPoolSimulations == null) {       ....       this.threadPoolSimulations = new ThreadPoolExecutor(....);     }     ....     try {       List&lt;Future&lt;Boolean&gt;&gt;          runningTasks = threadPoolSimulations.invokeAll(tasks,                                                         thinkTime,                                                         TimeUnit.SECONDS);       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e <code>Closable<\/code>-\u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0410 \u0441 \u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0440 <code>ExecutorService<\/code> <code>Closable<\/code>? \u0421 19 Java <code>ExecutorSerivce<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>AutoClosable<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ExecutorService<\/code> \u0432 <code>try-with-resource<\/code>.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0430\u0436\u043d\u043e \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u2014 Java 8. \u0410 \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u044f \u0435\u0433\u043e \u043d\u0430 21 \u0432\u0435\u0440\u0441\u0438\u0438. \u041e\u0442\u0441\u044e\u0434\u0430 \u0438 <code>Closable<\/code> \u0432 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \ud83d\ude42 \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443 \u043d\u0438\u0445 <code>ExecutorService<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>Closable<\/code>. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043b\u0436\u043d\u044b, \u0430 \u0437\u0434\u0435\u0441\u044c \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041d\u0430 \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/docs.oracle.com\/en\/java\/javase\/19\/docs\/api\/java.base\/java\/util\/concurrent\/ExecutorService.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<blockquote>\n<p>An unused ExecutorService should be shut down to allow reclamation of its resources.<\/p>\n<\/blockquote>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>ExecutorService<\/code>.<\/p>\n<h3>\u0417\u0430\u0431\u0430\u0432\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0432\u0448\u0438\u0435 \u0443\u043b\u044b\u0431\u043d\u0443\u0442\u044c\u0441\u044f<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u0451\u0448\u044c, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c \u0438 \u0447\u0435\u043c-\u0442\u043e \u0441\u0435\u0431\u044f \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u0435 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u043c\u0438, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u043c\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h4>\u0421\u0443\u043f\u0435\u0440-\u0434\u0443\u043f\u0435\u0440 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h4>\n<pre><code class=\"java\">public class Session {   ....   \/\/ TODO: enableafter full research   private static final boolean      SUPER_DUPER_BUGGY_AND_FASTEST_ASYNC_CONNECTION = false;    ....   public void fireCallback(final ClientCallback call) {     ....     try {       if (valid &amp;&amp; callBackLock.tryLock(50, TimeUnit.MILLISECONDS)) {         ....         boolean sendAsync = SUPER_DUPER_BUGGY_AND_FASTEST_ASYNC_CONNECTION                 &amp;&amp; call.getMethod().getType().canComeInAnyOrder();        \/\/ &lt;=         ....       }       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6019\/\" rel=\"noopener noreferrer nofollow\">V6019<\/a> Unreachable code detected. It is possible that an error is present. Session.java 438<\/p>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0439. \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043d\u0435\u0433\u043e, \u044f \u0440\u0430\u0441\u043f\u043b\u044b\u043b\u0441\u044f \u0432 \u0443\u043b\u044b\u0431\u043a\u0435. \u041d\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0448\u044c\u0441\u044f \u0441 <code>SUPER_DUPER_BUGGY_AND_FASTEST_ASYNC_CONNECTION<\/code>. \u041a \u0441\u043b\u043e\u0432\u0443, \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 <a href=\"https:\/\/github.com\/magefree\/mage\/blob\/master\/Mage.Server\/src\/main\/java\/mage\/server\/Session.java\" rel=\"noopener noreferrer nofollow\">\u043a\u043b\u0430\u0441\u0441\u0435<\/a> \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u044b. \u041d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0435\u043d\u0435 \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 &#171;enable after full research&#187; \u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e \u044d\u0442\u043e \ud83d\ude42<\/p>\n<h4>\u0420\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c?<\/h4>\n<pre><code class=\"java\">\/\/ TODO: investigate why we just discard sourceId and provide source directly? public ZoneChangeGroupEvent(...., UUID sourceId, Ability source, ....) {         super(....);         this.fromZone = fromZone;         this.toZone = toZone;         this.cards = cards;         this.tokens = tokens;         this.source = source; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6022\/\" rel=\"noopener noreferrer nofollow\">V6022<\/a> Parameter &#8216;sourceId&#8217; is not used inside constructor body. ZoneChangeGroupEvent.java 23<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0430 \u043b\u044e\u0434\u0435\u0439, \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0438\u0448\u0443\u0442 \u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438. \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u044b\u0448\u0435 \u0431\u0443\u0434\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e <code>sourceId<\/code> \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u0436\u0435 \u0432 TODO \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0434\u0438\u043d \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0447\u0442\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b \u0432 \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441. \u041b\u0438\u0447\u043d\u043e \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0432 \u043a\u043e\u0434\u0435, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043b\u044b\u0431\u043d\u0443\u0442\u044c\u0441\u044f.<\/p>\n<h3>\u041a\u043e\u043d\u0435\u0446<\/h3>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c, \u043a\u0430\u043a \u0438 \u043c\u043d\u0435, \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 XMage, \u043f\u0443\u0441\u0442\u044c \u0445\u043e\u0442\u044c \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c. \u041c\u0435\u043d\u044f \u0440\u0430\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442-\u0434\u043e\u043b\u0433\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0410 \u0435\u0449\u0451 \u044f \u0440\u0430\u0434, \u0447\u0442\u043e \u043d\u0430 Java \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u0433\u0440\u0430\u043c\u0438.<\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/1219\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u0433\u0434\u0435 \u043c\u044b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0438 \u0431\u0430\u0433\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u0432 Minecraft \u043c\u043e\u0434\u0435, \u0438 \u0433\u0434\u0435 \u043c\u044b <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/1113\/\" rel=\"noopener noreferrer nofollow\">\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438<\/a> \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Java.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0435\u0433\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1257\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0443<\/a>.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0440\u0430 \u043f\u0440\u043e\u0449\u0430\u0442\u044c\u0441\u044f. \u0414\u043e \u0441\u043a\u043e\u0440\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Vladislav Bogdanov. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/java\/1257\/\" rel=\"noopener noreferrer nofollow\">Lock, Java, and two nulls: XMage edition<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/921290\/\"> https:\/\/habr.com\/ru\/articles\/921290\/<\/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>\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u043d\u0430 Java \u2014 \u0432\u0435\u0449\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0434\u043a\u0430\u044f, \u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0443\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442 XMage \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0451\u043b PVS-Studio \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p><a href=\"https:\/\/github.com\/magefree\/mage\" rel=\"noopener noreferrer nofollow\">XMage<\/a> \u2014 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 open source \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438\u0433\u0440\u044b <a href=\"https:\/\/magic.wizards.com\/\" rel=\"noopener noreferrer nofollow\">Magic: the Gathering<\/a>. \u0418\u0433\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0441 \u0431\u043e\u0442\u0430\u043c\u0438, \u0442\u0430\u043a \u0438 \u043e\u043d\u043b\u0430\u0439\u043d \u0441 \u0434\u0440\u0443\u0437\u044c\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Java \u0438 \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 10 \u043b\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f: \u0441\u0435\u0439\u0447\u0430\u0441 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 47 \u0442\u044b\u0441\u044f\u0447 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u2014 1.8 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0441\u0442\u0440\u043e\u043a. \u041f\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 XMage \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/0758\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430 ~800 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a, \u0438 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 <a href=\"https:\/\/github.com\/magefree\/mage\/wiki\/Development-Testing-Tools\" rel=\"noopener noreferrer nofollow\">\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430<\/a> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430. \u0418 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u0431\u044b\u043b\u043e \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0451\u0442 \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<h3>Unit-\u0442\u0435\u0441\u0442\u044b \u0432\u0441\u0435\u043c\u0443 \u0433\u043e\u043b\u043e\u0432\u0430<\/h3>\n<p>\u0418\u0437\u0432\u0435\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0435\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u044e\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u043e \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432?<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u0432 unit-\u0442\u0435\u0441\u0442\u0430\u0445.<\/p>\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e<\/h4>\n<pre><code class=\"java\">@Test public void test_NamesEquals() {   ....   \/\/ same names (empty names can't be same)   Assert.assertFalse(CardUtil.haveSameNames(         \"\",          \"\"));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_CREATURE.getObjectName(),          \"\"));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_CREATURE.getObjectName(),          EmptyNames.FACE_DOWN_CREATURE.getObjectName()));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_TOKEN.getObjectNam(),          \"\"));   Assert.assertFalse(CardUtil.haveSameNames(         EmptyNames.FACE_DOWN_TOKEN.getObjectNam(),          EmptyNames.FACE_DOWN_CREATURE.getObjectName())); \/\/ &lt;=   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6072\/\" rel=\"noopener noreferrer nofollow\">V6072<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;FACE_DOWN_TOKEN&#8217; variable should be used instead of &#8216;FACE_DOWN_CREATURE&#8217;. AliasesApiTest.java 30<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>FACE_DOWN_TOKEN<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>FACE_DOWN_CREATURE<\/code>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f &#171;\u043f\u0443\u0441\u0442\u044b\u0445 \u0438\u043c\u0451\u043d&#187;. \u041f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u0443\u0441\u0442\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438. \u041e\u0431 \u044d\u0442\u043e\u043c \u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. <code>FACE_DOWN_CREATURE<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0441 \u0441\u043e\u0431\u043e\u0439 \u0436\u0435, \u0430 <code>FACE_DOWN_TOKEN<\/code> \u2014 \u043d\u0435\u0442.<\/p>\n<p>\u042f \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u0438 \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0448\u0451\u043b \u0443\u0434\u0430\u0447\u043d\u043e.<\/p>\n<h4>\u041d\u0435\u0440\u0430\u0432\u043d\u044b\u0439 \u0431\u043e\u0439<\/h4>\n<pre><code class=\"java\">@Test public void test_Simple_LongGame() {     ....     addCard(Zone.LIBRARY, playerA, \"Mountain\", 10);     addCard(Zone.LIBRARY, playerA, \"Forest\", 10);     addCard(Zone.LIBRARY, playerA, \"Lightning Bolt\", 20);     addCard(Zone.LIBRARY, playerA, \"Balduvian Bears\", 10);     \/\/     addCard(Zone.LIBRARY, playerB, \"Mountain\", 10);     addCard(Zone.LIBRARY, playerA, \"Forest\", 10);        \/\/ &lt;=     addCard(Zone.LIBRARY, playerB, \"Lightning Bolt\", 20);     addCard(Zone.LIBRARY, playerB, \"Balduvian Bears\", 10);     .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6072\/\" rel=\"noopener noreferrer nofollow\">V6072<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;playerB&#8217; variable should be used instead of &#8216;playerA&#8217;. SimulationPerformanceAITest.java 60<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0443\u0432\u0438\u0434\u0435\u0432 \u0441\u0442\u0440\u0435\u043b\u043a\u0443 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0437\u0434\u0435\u0441\u044c \ud83d\ude42<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0440\u0430\u043a\u0430 AI vs AI \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u0447\u0435\u0441\u0442\u043d\u043e. \u0413\u043e\u0441\u043f\u043e\u0434\u0438\u043d\u0443 A \u0434\u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u0435\u0441\u043d\u044b\u0445 \u043a\u0430\u0440\u0442, \u043d\u0435\u0436\u0435\u043b\u0438 \u0433\u043e\u0441\u043f\u043e\u0434\u0438\u043d\u0443 B. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. \u0422\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c \u2014 \u0442\u0435\u0441\u0442 \u0437\u0435\u043b\u0451\u043d\u044b\u0439.<\/p>\n<h3>\u041e\u0447\u0435\u043f\u044f\u0442\u043a\u0438 \u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b<\/h3>\n<h4>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043e\u0445<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Null dereference of &#8216;permanent&#8217;. ThreeTreeScribe.java 78<\/p>\n<pre><code class=\"java\">@Override public boolean checkTrigger(GameEvent event, Game game) {     ....     Permanent permanent = zEvent.getTarget();     return (    permanent != null              || !permanent.isControlledBy(getControllerId()))  \/\/ &lt;=             &amp;&amp; (permanent.getId().equals(getSourceId())                  || permanent.isCreature(game)); } <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044f\u0432\u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043b\u044b\u0431\u043d\u0443\u0442\u044c\u0441\u044f. \u0412\u043d\u0443\u0442\u0440\u0438 <code>return<\/code> \u043c\u044b \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c <code>permanent<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0432\u0435\u043d <code>null<\/code>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u0440\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> \u0438 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u041d\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Potential null dereference of &#8216;player&#8217;. DelifsCone.java 104<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Potential null dereference of &#8216;permanent&#8217;. DelifsCone.java 104<\/p>\n<pre><code class=\"java\">@Override public boolean apply(Game game, Ability source) {     Player player = game.getPlayer(source.getControllerId());     Permanent          permanent = game.getPermanent(....);     if (player != null || permanent != null) {         player.gainLife(permanent.getPower().getValue(), game, source);         return true;     }     return false; } <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 <code>null<\/code> \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0430 \u0438\u0437 \u043d\u0438\u0445, \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u042f\u0432\u043d\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u043e\u0441\u044c <code>&amp;&amp;<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>||<\/code>. \u0422\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u043a\u0441\u0442\u0430\u0442\u0438, \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e.<\/p>\n<h4>\u041d\u0443, \u043f\u043e\u0447\u0442\u0438&#8230;<\/h4>\n<pre><code class=\"java\">static {     for (int count = 1; count &lt;= 6; count++) {         FilterCard filter = new FilterCreatureCard(                 \"creature card that's exactly \" +                         CardUtil.numberToText(count) +                         \" color\" + (count &gt; 0 ? \"s\" : \"\")         );         filter.add(new EvolvingDoorPredicate(count));         filterMap.put(count, filter);     } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6007\/\" rel=\"noopener noreferrer nofollow\">V6007<\/a> Expression &#8216;count &gt; 0&#8217; is always true. EvolvingDoor.java 76<\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 &#171;s&#187; \u043a \u0441\u043b\u043e\u0432\u0443 &#171;color&#187;. \u0421 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 0 \u043d\u0430 1 \u0432 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0439 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0435 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u0446\u0438\u043a\u043b \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e.<\/p>\n<h4>\u0412\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u2013 \u043c\u044b \u0443\u0436\u0435 \u043c\u043e\u0433\u043b\u0438<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6060\/\" rel=\"noopener noreferrer nofollow\">V6060<\/a> The &#8216;table&#8217; reference was utilized before it was verified against null. TableController.java 725<\/p>\n<pre><code class=\"java\">private void startGame(UUID choosingPlayerId) throws GameException {     try {         ....     } catch (Exception ex) {         logger.fatal(\"Error starting game table: \" + table.getId(), ex);         if (table != null) {             managerFactory.tableManager().removeTable(table.getId());         }         ....      } } <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 <code>null<\/code> \u0434\u0435\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435. \u041d\u043e \u0432\u0441\u0435\u043c\u0443 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f. \u0412\u043e\u0442 \u0438 \u0437\u0434\u0435\u0441\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 <code>table<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u043d\u0435 <code>null<\/code> \u043b\u0438 \u043e\u043d.<\/p>\n<p>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6060\/\" rel=\"noopener noreferrer nofollow\">V6060<\/a> The &#8216;enchantment&#8217; reference was utilized before it was verified against null. PublicEnemy.java 79<\/p>\n<pre><code class=\"java\">@Override public boolean applies(Permanent permanent, Ability source, Game game) {     Permanent          enchantment = game.getPermanent(source.getSourceId());     Permanent          enchantedCreature = game.getPermanent(enchantment.getAttachedTo());     if (enchantment == null || enchantedCreature == null) {         return false;     }     if (permanent.isControlledBy(enchantedCreature.getControllerId())) {         return false;     }     return true; } <\/code><\/pre>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442 <code>enchantment<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <code>enchantedCreature<\/code>, \u0430 \u0443\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438 \u043e\u043d\u0438 <code>null<\/code>.<\/p>\n<h4>\u041d\u0435\u0434\u043e\u043c\u0430\u043f\u0438\u043b\u0438<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6012\/\" rel=\"noopener noreferrer nofollow\">V6012<\/a> The &#8216;?:&#8217; operator, regardless of its conditional expression, always returns one and the same value &#8216;card&#8217;. SkyclaveApparition.java 108<\/p>\n<pre><code class=\"java\">@Override public boolean apply(Game game, Ability source) {     ....      Set&lt;UUID&gt; owners = new HashSet&lt;&gt;();     int totalCMC = exile             .getCards(game)             .stream()             .filter(Objects::nonNull)             .map(card -&gt; owners.add(card.getOwnerId()) ? card : card) \/\/ &lt;=             .mapToInt(MageObject::getManaValue)             .sum();     ....     return true; } <\/code><\/pre>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0422\u043e \u043b\u0438 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <code>card<\/code> \u0445\u043e\u0442\u0435\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0435\u0442\u043e\u043a \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438, \u0442\u043e \u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b stream&#8217;\u0430 \u0445\u043e\u0442\u044f\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>Set<\/code> <code>owners<\/code>. \u0415\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u043f\u0440\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>peek<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>map<\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u043e \u043c\u0435\u0442\u043e\u0434\u044b peek \u0438 map<\/summary>\n<div class=\"spoiler__content\">\n<p><code>peek<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0439 \u0435\u043c\u0443 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0441 \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p><code>map<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0435\u043c\u0443 \u0435\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/div>\n<\/details>\n<h4>\u0418 \u0441\u043d\u043e\u0432\u0430 null<\/h4>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0443\u0442\u044c \u043a \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0441\u0432\u043e\u0438\u043c\u0438 \u0433\u043b\u0430\u0437\u043a\u0430\u043c\u0438.<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"java\">@Override public boolean apply(Game game, Ability source) {     ....     Card card = getCard(player, toReveal, game);     ....     player.moveCards(card, Zone.BATTLEFIELD, source, game);     ....     Permanent creature = game.getPermanent(card.getId());  \/\/ &lt;=     .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v6008\/\" rel=\"noopener noreferrer nofollow\">V6008<\/a> Potential null dereference of &#8216;card&#8217;. AspiringChampion.java 84<\/p>\n<p>\u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 <code>getCard<\/code>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 <code>card<\/code>. \u0412 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f <code>null<\/code>:<\/p>\n<pre><code class=\"java\">private static Card getCard(Player player, Cards toReveal, Game game) {     for (Card card : player.getLibrary().getCards(game)) {         toReveal.add(card);         if (card.isCreature(game)) {             return card;         }     }     return null; } <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043c\u0435\u0442\u043e\u0434\u0430 <code>moveCards<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>card<\/code>, \u044d\u0442\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"java\">@Override public boolean moveCards(Card card, ....) {     Set&lt;Card&gt; cardList = new HashSet&lt;&gt;();     if (card != null) {         cardList.add(card);     }     return moveCards(cardList, toZone, source, game,                       tapped, faceDown, byOwner, appliedEffects); } <\/code><\/pre>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u043a\u043e\u0434\u0430, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043a\u043e\u0434\u0430 \u043a \u043d\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f, \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>null<\/code>.<\/p>\n<h3>\u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u044b Java \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h3>\n<h4>\u0410\u043a\u043a\u0443<\/h><\/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-464381","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/464381","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=464381"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/464381\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=464381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=464381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=464381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}