{"id":201334,"date":"2013-11-09T11:36:02","date_gmt":"2013-11-09T07:36:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=201334"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=201334","title":{"rendered":"<span class=\"post_title\">FindBugs \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c Java \u043b\u0443\u0447\u0448\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/825\/895\/c92\/825895c9203cf34e9017a5576651ae2b.png\" align=\"right\"\/>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043a\u043e\u0434\u0430 \u043b\u044e\u0431\u044f\u0442 \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u044e. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u044f\u0437\u044b\u043a\u0443 \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u044d\u0442\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438. \u0418 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c: \u0432\u0441\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043c\u0443\u0447\u0430\u0435\u0448\u044c\u0441\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0438\u0434\u0438\u0442 \u0440\u044f\u0434\u043e\u043c \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043a\u0430\u043a \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434. \u041e\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u043c: \u00ab\u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0442\u044b \u043e\u0448\u0438\u0431\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u043b\u00bb, \u043d\u043e \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442: \u00ab\u043d\u0435\u0442, \u0442\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u0432\u043e\u043d \u0441\u0430\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0433\u043b\u044f\u043d\u044c\u00bb. \u0422\u0430\u043a\u043e\u0439 \u0442\u043e\u0432\u0430\u0440\u0438\u0449 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0439 \u0441\u0430\u043c\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0432\u0435\u0449\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435, \u0438 \u043c\u043e\u043b\u0447\u0438\u0442 \u043e \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043c \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u0445 Java, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0443\u0437\u043d\u0430\u043b \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 FindBugs. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u0435\u0449\u0438 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0434\u043b\u044f \u0432\u0430\u0441. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u0443\u043c\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b, \u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<h4>\u0422\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 ?:<\/h4>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438. \u042f \u0441\u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438  <\/p>\n<pre><code class=\"java\">Type var = condition ? valTrue : valFalse;<\/code><\/pre>\n<p>\u0438<\/p>\n<pre><code class=\"java\">Type var; if(condition)   var = valTrue; else   var = valFalse;<\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044c. \u0422\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0441\u043a\u0430\u0436\u0435\u043c, \u043f\u0440\u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432 if-\u0444\u043e\u0440\u043c\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 valTrue \u0441\u0440\u0430\u0437\u0443 \u043a \u0442\u0438\u043f\u0443 Type, \u0430 \u0432 \u0444\u043e\u0440\u043c\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u043f\u0435\u0440\u0432\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0442\u0438\u043f\u0443 valTrue \u0438 valFalse (\u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e valFalse \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f), \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u0438\u043f\u0443 Type. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0435\u0441\u043b\u0438 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 \u043d\u0438\u043c\u0438 (Integer, Double \u0438 \u0442. \u0434.) \u0412\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 <a href=\"http:\/\/docs.oracle.com\/javase\/specs\/jls\/se7\/html\/jls-15.html#jls-15.25\">JLS 15.25<\/a>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<\/p>\n<pre><code class=\"java\">Number n = flag ? new Integer(1) : new Double(2.0);<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 n, \u0435\u0441\u043b\u0438 flag \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d? \u041e\u0431\u044a\u0435\u043a\u0442 Double \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1.0. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0441\u043c\u0435\u0448\u043d\u044b \u043d\u0430\u0448\u0438 \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0438\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442. \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0442\u043e\u0440\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 double). \u0410 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043a\u0441\u0438\u043d\u0433. \u041f\u043e \u0441\u0443\u0442\u0438 \u043a\u043e\u0434 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0442\u0430\u043a\u043e\u043c\u0443:  <\/p>\n<pre><code class=\"java\">Number n; if( flag )     n = Double.valueOf((double) ( new Integer(1).intValue() )); else     n = Double.valueOf(new Double(2.0).doubleValue());<\/code><\/pre>\n<p>  \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043a\u043e\u0434 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041d\u043e FindBugs \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:  <\/p>\n<blockquote><p>BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR: Primitive value is unboxed and coerced for ternary operator in TestTernary.main(String[])<\/p>\n<p>  A wrapped primitive value is unboxed and converted to another primitive type as part of the evaluation of a conditional ternary operator (the b? e1: e2 operator). The semantics of Java mandate that if e1 and e2 are wrapped numeric values, the values are unboxed and converted\/coerced to their common type (e.g, if e1 is of type Integer and e2 is of type Float, then e1 is unboxed, converted to a floating point value, and boxed. See JLS Section 15.25.<\/p><\/blockquote>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, FindBugs \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e Integer.valueOf(1) \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0447\u0435\u043c new Integer(1), \u043d\u043e \u044d\u0442\u043e \u0443\u0436 \u0432\u0441\u0435 \u0438 \u0442\u0430\u043a \u0437\u043d\u0430\u044e\u0442.<\/p>\n<p>  \u0418\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"java\">Integer n = flag ? 1 : null;<\/code><\/pre>\n<p>  \u0410\u0432\u0442\u043e\u0440 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c null \u0432 n, \u0435\u0441\u043b\u0438 \u0444\u043b\u0430\u0433 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u0414\u0443\u043c\u0430\u0435\u0442\u0435, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u0414\u0430. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c:  <\/p>\n<pre><code class=\"java\">Integer n = flag1 ? 1 : flag2 ? 2 : null;<\/code><\/pre>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 \u0444\u043b\u0430\u0433\u0430 \u0441\u0431\u0440\u043e\u0448\u0435\u043d\u044b, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 NullPointerException. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u2014 int \u0438 null, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f Integer. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043b\u0435\u0432\u043e\u0433\u043e \u2014 int \u0438 Integer, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c Java \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 int. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c unboxing, \u0432\u044b\u0437\u0432\u0430\u0432 intValue, \u0447\u0442\u043e \u0438 \u0432\u044b\u0434\u0430\u0451\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041a\u043e\u0434 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0442\u0430\u043a\u043e\u043c\u0443:  <\/p>\n<pre><code class=\"java\">Integer n; if( flag1 )     n = Integer.valueOf(1); else {     if( flag2 )         n = Integer.valueOf(Integer.valueOf(2).intValue());     else         n = Integer.valueOf(((Integer)null).intValue()); }<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c FindBugs \u0432\u044b\u0434\u0430\u0451\u0442 \u0434\u0432\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443:  <\/p>\n<blockquote><p>BX_UNBOXING_IMMEDIATELY_REBOXED: Boxed value is unboxed and then immediately reboxed in TestTernary.main(String[])<br \/>  NP_NULL_ON_SOME_PATH: Possible null pointer dereference of null in TestTernary.main(String[])<br \/>  There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed.<\/p><\/blockquote>\n<p>  \u041d\u0443 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443:  <\/p>\n<pre><code class=\"java\">double[] vals = new double[] {1.0, 2.0, 3.0}; double getVal(int idx) {     return (idx &lt; 0 || idx &gt;= vals.length) ? null : vals[idx]; }<\/code><\/pre>\n<p>  \u041d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0438\u043f, \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c null? \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043e\u043d \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041d\u0443 \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u2014 \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u043b\u0438.<\/p>\n<h4>DateFormat<\/h4>\n<p>  \u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 Java \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 DateFormat. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"java\">public String getDate() {     return new SimpleDateFormat(&quot;yyyy-MM-dd HH:mm:ss&quot;).format(new Date()); }<\/code><\/pre>\n<p>  \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043a\u043b\u0430\u0441\u0441 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0444\u043e\u0440\u043c\u0430\u0442. \u041c\u043d\u043e\u0433\u0438\u043c \u043f\u0440\u0438\u0434\u0451\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0438\u0434\u0435\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438: \u0437\u0430\u0447\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c?  <\/p>\n<pre><code class=\"java\">private static final DateFormat format = new SimpleDateFormat(&quot;yyyy-MM-dd HH:mm:ss&quot;);  public String getDate() {     return format.format(new Date()); }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0442\u043e\u043b\u044c\u043a\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u043e\u0447\u043d\u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0438\u0437\u0440\u0435\u0434\u043a\u0430 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a DateFormat <a href=\"http:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/text\/DateFormat.html\">\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e<\/a>:  <\/p>\n<blockquote><p>Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.<\/p><\/blockquote>\n<p>  \u0418 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e SimpleDateFormat. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 format() \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0438\u0448\u0435\u0442 \u0432 \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SimpleDateFormat \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043a \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443. \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u0438\u0448\u0435\u0442 FindBugs \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443:  <\/p>\n<blockquote><p>STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE: Call to method of static java.text.DateFormat in TestDate.getDate()<br \/>  As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous.<\/p>\n<p>  For more information on this see <a href=\"http:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=6231579\">Sun Bug #6231579<\/a> and <a href=\"http:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=6178997\">Sun Bug #6178997<\/a>.<\/p><\/blockquote>\n<p>  <\/p>\n<h4>\u041f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 BigDecimal<\/h4>\n<p>  \u0423\u0437\u043d\u0430\u0432, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 BigDecimal \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0438 \u0443\u0432\u0438\u0434\u0435\u0432, \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0442 double, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0448\u0430\u0442, \u0447\u0442\u043e \u0432\u0441\u0451 \u044f\u0441\u043d\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"java\">System.out.println(new BigDecimal(1.1));<\/code><\/pre>\n<p>  \u0414\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c: 1.100000000000000088817841970012523233890533447265625. \u0422\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 double \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 IEEE754, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c 1.1 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u043e (\u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0440\u043e\u0431\u044c). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a 1.1. \u0410 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 BigDecimal(double) \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e: \u043e\u043d \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 IEEE754 \u043a \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 (\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u0430\u044f \u0434\u0440\u043e\u0431\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439). \u0415\u0441\u043b\u0438 \u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 BigDecimal \u0438\u043c\u0435\u043d\u043d\u043e 1.1, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0431\u043e <code>new BigDecimal(&quot;1.1&quot;)<\/code>, \u043b\u0438\u0431\u043e <code>BigDecimal.valueOf(1.1)<\/code>. \u0415\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443, \u0430 \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430. FindBugs \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u044e\u0442\u0441\u044f \u0442\u0435 \u0436\u0435 \u0441\u043e\u0432\u0435\u0442\u044b.<\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0448\u0442\u0443\u043a\u0430:  <\/p>\n<pre><code class=\"java\">BigDecimal d1 = new BigDecimal(&quot;1.1&quot;); BigDecimal d2 = new BigDecimal(&quot;1.10&quot;); System.out.println(d1.equals(d2));<\/code><\/pre>\n<p>  \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 d1 \u0438 d2 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0447\u0438\u0441\u043b\u043e, \u043d\u043e equals \u0432\u044b\u0434\u0430\u0451\u0442 false, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b, \u043d\u043e \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a (\u0447\u0438\u0441\u043b\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439). \u042d\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u043e \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u043a\u0430\u043a equals. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u043f\u043b\u044b\u0442\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441\u0440\u0430\u0437\u0443. \u0421\u0430\u043c FindBugs \u043e\u0431 \u044d\u0442\u043e\u043c, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442, \u043d\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043a \u043d\u0435\u043c\u0443 \u2014 <a href=\"http:\/\/fb-contrib.sourceforge.net\/\">fb-contrib<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0431\u0430\u0433 \u0443\u0447\u0442\u0451\u043d:  <\/p>\n<blockquote><p>MDM_BIGDECIMAL_EQUALS<\/p>\n<p>  equals() being called to compare two java.math.BigDecimal numbers. This is normally a mistake, as two BigDecimal objects are only equal if they are equal in both value and scale, so that 2.0 is not equal to 2.00. To compare BigDecimal objects for mathematical equality, use compareTo() instead.  <\/p><\/blockquote>\n<p>  <\/p>\n<h4>\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0441\u0442\u0440\u043e\u043a \u0438 printf<\/h4>\n<p>  \u041d\u0435\u0440\u0435\u0434\u043a\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b, \u043f\u0435\u0440\u0435\u0448\u0435\u0434\u0448\u0438\u0435 \u043d\u0430 Java \u043f\u043e\u0441\u043b\u0435 \u0421\u0438, \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0434\u043b\u044f \u0441\u0435\u0431\u044f <a href=\"http:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/io\/PrintStream.html#printf%28java.lang.String,%20java.lang.Object...%29\">PrintStream.printf<\/a> (\u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"http:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/io\/PrintWriter.html#printf%28java.lang.String,%20java.lang.Object...%29\">PrintWriter.printf<\/a> \u0438 \u0442. \u0434.). \u041c\u043e\u043b, \u043e\u0442\u043b\u0438\u0447\u043d\u043e, \u044d\u0442\u043e \u044f \u0437\u043d\u0430\u044e, \u043f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0432 \u0421\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0435\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u0438\u044f. \u041e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430\u0445 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>  \u0412 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438. \u0412\u044b\u0432\u043e\u0434 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 &#8216;\\n&#8217; \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043b\u044e\u0431\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 (&quot;\\r\\n&quot; \u043d\u0430 Windows). \u0412 Java \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0442: \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u042d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0435\u043b\u0430\u044e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 PrintStream.println. \u041d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 printf \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 &#8216;\\n&#8217; \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e &#8216;\\n&#8217;, \u0430 \u043d\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"java\">System.out.printf(&quot;%s\\n&quot;, &quot;str#1&quot;); System.out.println(&quot;str#2&quot;);<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0444\u0430\u0439\u043b, \u0443\u0432\u0438\u0434\u0438\u043c:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/85f\/6b4\/e2a\/85f6b4e2ab95807597bed3e209e8a66a.png\"\/><br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u0447\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u0435\u0441\u0442\u0438 \u043a\u0440\u044b\u0448\u0443 \u043a\u0430\u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0430\u0440\u0441\u0435\u0440\u0443. \u041e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043d\u0430 Unix-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e printf, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f &quot;%n&quot;. \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u0438\u0448\u0435\u0442 FindBugs \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443:  <\/p>\n<blockquote><p>VA_FORMAT_STRING_USES_NEWLINE: Format string should use %n rather than \\n in TestNewline.main(String[])<\/p>\n<p>  This format string include a newline character (\\n). In format strings, it is generally preferable better to use %n, which will produce the platform-specific line separator. <\/p><\/blockquote>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u0434\u0430\u0432\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u041d\u043e \u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u0442 \u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/201334\/\"> http:\/\/habrahabr.ru\/post\/201334\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/825\/895\/c92\/825895c9203cf34e9017a5576651ae2b.png\" align=\"right\"\/>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043a\u043e\u0434\u0430 \u043b\u044e\u0431\u044f\u0442 \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u044e. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u044f\u0437\u044b\u043a\u0443 \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u044d\u0442\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438. \u0418 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c: \u0432\u0441\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043c\u0443\u0447\u0430\u0435\u0448\u044c\u0441\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0438\u0434\u0438\u0442 \u0440\u044f\u0434\u043e\u043c \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043a\u0430\u043a \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434. \u041e\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u043c: \u00ab\u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0442\u044b \u043e\u0448\u0438\u0431\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u043b\u00bb, \u043d\u043e \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442: \u00ab\u043d\u0435\u0442, \u0442\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u0432\u043e\u043d \u0441\u0430\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0433\u043b\u044f\u043d\u044c\u00bb. \u0422\u0430\u043a\u043e\u0439 \u0442\u043e\u0432\u0430\u0440\u0438\u0449 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0439 \u0441\u0430\u043c\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0432\u0435\u0449\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435, \u0438 \u043c\u043e\u043b\u0447\u0438\u0442 \u043e \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043c \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u0445 Java, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0443\u0437\u043d\u0430\u043b \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 FindBugs. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u0435\u0449\u0438 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0434\u043b\u044f \u0432\u0430\u0441. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u0443\u043c\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b, \u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<h4>\u0422\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 ?:<\/h4>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438. \u042f \u0441\u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438  <\/p>\n<pre><code class=\"java\">Type var = condition ? valTrue : valFalse;<\/code><\/pre>\n<p>\u0438<\/p>\n<pre><code class=\"java\">Type var; if(condition)   var = valTrue; else   var = valFalse;<\/code><\/pre>\n<p>  <\/p>\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-201334","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201334","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=201334"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201334\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}