{"id":442,"date":"2021-03-11T06:22:35","date_gmt":"2021-03-11T06:22:35","guid":{"rendered":"http:\/\/scrutineer.co.kr\/wordpress\/?p=442"},"modified":"2021-03-25T05:51:04","modified_gmt":"2021-03-25T05:51:04","slug":"%eb%aa%a8%eb%8d%98-%ec%9e%90%eb%b0%94-%ec%9d%b8-%ec%95%a1%ec%85%98-11%ec%9e%a5","status":"publish","type":"post","link":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/2021\/03\/11\/%eb%aa%a8%eb%8d%98-%ec%9e%90%eb%b0%94-%ec%9d%b8-%ec%95%a1%ec%85%98-11%ec%9e%a5\/","title":{"rendered":"\ubaa8\ub358 \uc790\ubc14 \uc778 \uc561\uc158 11\uc7a5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">NPE\ub294 \ub9cc\uc545\uc758 \uadfc\uc6d0<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">NPE\ub294 \ub9cc\uc545\uc758 \uadfc\uc6d0\uc774\ub2e4. \ud504\ub85c\uc81d\ud2b8\ub294 \ucee4\ub155, \ud1a0\uc774\ud504\ub85c\uc81d\ud2b8\ub098 \ud558\ub2e4\ubabb\ud574 \ud559\uad50 \uacfc\uc81c\ub77c\ub3c4 \ud574 \ubcf4\uba74 \uc774\uac8c \uc5bc\ub9c8\ub098 \uc790\uc8fc \ud130\uc9c0\uace0 \ube61\uce58\ub294\uac74\uc9c0 \uad73\uc774 \ub9d0 \uc548\ud574\ub3c4 \ub420 \ub4ef.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub7ec\ub2c8\uae4c NPE\ub97c \uc608\ubc29\ud560 \uc218 \uc788\ub294 \ucf54\ub4dc\ub97c \ub9cc\ub4e4\uc5b4 \ubcf4\uc790<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if (object != null) {\n  \/\/ \ub354 \uc774\uc0c1 \uc790\uc138\ud55c \uc124\uba85\uc740 \uc0dd\ub7b5\ud55c\ub2e4\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\uac8c \ubcc4\ub85c \uc88b\uc9c0 \uc54a\uc740 \ubc29\ubc95\uc774\ub780 \uac83\uc740 \ubb50&#8230;\uad73\uc774&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub7fc \uc774\ub7f0 \ubc29\ubc95\uc73c\ub85c \ud574\ubcfc\uae4c?<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public String getCarInsuranceName(Person person) {\n  if (person == null) {\n    return \"Unknown\";\n  }\n  if (car == null) {\n    return \"Unknown\";\n  }\n  Insurance insurance = car.getInsurance();\n  if (insurance == null) {\n    return \"Unknown\";\n  }\n  \n  return insurance.getName();\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ubb54\uac00 \uc880 \ub354 \ub290\ub08c\uc788\uc5b4 \ubcf4\uc778\ub2e4 \uadf8\uce58..?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uadfc\ub370 \uc800\ub807\uac8c if\ub97c \ub355\uc9c0\ub355\uc9c0 \uce60\ud558\uace0 early return\uc774 \ub9ce\uc544\uc9c0\ub294 \ucf54\ub4dc\uac00 \uadf8\ub807\uac8c \uc88b\uc544 \ubcf4\uc774\uc9c0 \uc54a\ub294 \uac74 \ub9e4\ud55c\uac00\uc9c0\uc774\ub2e4. \uc801\uc5b4\ub3c4 \ub09c \uadf8\ub807\uac8c \ub290\ub08c..<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(\uc720\uc9c0\ubcf4\uc218\ub97c \ud558\uba74\uc11c \ud074\ub798\uc2a4\uc5d0 \ud504\ub85c\ud37c\ud2f0\uac00 \ud558\ub098 \ub354 \uc0dd\uae30\uba74 null\uc774 \ud1b5\uacfc\ub418\ub294 \uacbd\uc6b0\ub97c \ub9c9\uae30 \uc704\ud574 &#8216;if\ubb38\uc744 \ucd94\uac00\ud574\uc57c&#8217; \ud558\ub294 \ub3d9\uc791\ub3c4 \ub611\uac19\uc774 \ucd94\uac00\ub418\uc5b4\uc57c \ud558\ub294\ub370&#8230;.\uc74c&#8230; \uadf8\uac78 \uae4c\uba39\uc73c\uba74?)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\uc544\ubb34\ud2bc NPE\ub294 \ub9cc\uc545\uc758 \uadfc\uc6d0\uc774\uace0, NPE \ubc1c\uc0dd\uc744 \ub9c9\uae30 \uc704\ud574 \uc218\ub9ce\uc740 \uc2dc\ub3c4\ub97c \ud574 \ubcf4\uc558\uc73c\ub098 \uc27d\uc9c0 \uc54a\uc558\ub2e4.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">null\ub54c\ubb38\uc5d0 \ubc1c\uc0dd\ud558\ub294 \ubb38\uc81c<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>\uc5d0\ub7ec\uc758 \uadfc\uc6d0\uc774\ub2e4<ul><li>null\ub584\ubb38\uc5d0 NPE\ub77c\ub294 \uc5d0\ub7ec\uac00 \ubed1\ud558\uba74 \ud280\ub098\uc628\ub2e4. \uc774\ub798\uc800\ub798 \ubcf4\uae30\uc2eb\uc74c<\/li><\/ul><\/li><li>\ucf54\ub4dc\ub97c \uc5b4\uc9c0\ub7fd\ud78c\ub2e4<ul><li>if null&#8230;\ub355\uc9c0\ub355\uc9c0&#8230; \uc774\ub798\uc800\ub798 \ubcf4\uae30\uc2eb\uc74c 2<\/li><\/ul><\/li><li>null\uc774 \uc544\ubb34 \uc758\ubbf8\uac00 \uc5c6\ub2e4<ul><li>&#8216;\uc758\ubbf8\uac00 \uc5c6\ub2e4&#8217; \ub77c\ub294 \uc758\ubbf8\ub97c \uac00\uc9c4(&#8230;) \ud45c\ud604\uc2dd\uc784&#8230;<\/li><\/ul><\/li><li>\uc790\ubc14 \ucca0\ud559\uc5d0 \uc704\ubc30\ub41c\ub2e4<ul><li>C\uacc4\uc5f4\uc758 \uac15\uc810\uc774\uc790 \ub2e8\uc810\uc778 \ud3ec\uc778\ud130 \uac1c\ub150\uc740 \uc5c6\uc574\ub294\ub370, null\ud3ec\uc778\ud130\ub294 \ub450\uc5c8\ub2e4. \uc544\uc774\ub7ec\ub2c8\ud558\ub2e4.<\/li><\/ul><\/li><li>\ud615\uc2dd \uc2dc\uc2a4\ud15c\uc5d0 \uad6c\uba4d\uc744 \ub9cc\ub4e0\ub2e4<ul><li>\uac15\ud0c0\uc785 \uc5b8\uc5b4 \uc2dc\uc2a4\ud15c\uc778 \uc790\ubc14\uc5d0,  null\uc740 \uc57d\ud0c0\uc785 \uc5b8\uc5b4 \uc2dc\uc2a4\ud15c\ub9c8\ub0e5 \uc5b4\ub5a4 \ud0c0\uc785\uc758 \ubcc0\uc218(\ucc38\uc870)\uc5d0 \uac16\ub2e4 \ubd99\uc77c \uc218 \uc788\uc74c.<br>\ud2b9\uc815 \ubcc0\uc218\uc5d0 null\uc744 assign\ud558\uc600\uc744 \uc2dc, \ub098\uc911\uc5d0 &#8216;\uc560\ucd08\uc5d0 null\uc774 \uc5b4\ub5a4 \uc758\ubbf8\ub85c \uc0ac\uc6a9\ub418\uc5c8\ub294\uac00&#8217; \uc5d0 \ub300\ud55c \ucd94\uc801\uc744 \ud558\uae30 \ud798\ub4ec.<\/li><\/ul><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\uadf8\ub798\uc11c \uc5b4\ub5bb\uac8c \ud560\uac74\ub370?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub798\uc11c jave.util.Optional&lt;T&gt;\uc774\ub77c\ub294 \uc0c8\ub85c\uc6b4 \ud074\ub798\uc2a4\ub97c \uc790\ubc148\ubd80\ud130 \uc81c\uacf5\ud55c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">null\uc744 \uc608\ubc29\ud558\uae30 \uc704\ud574, \ube48 \uaecd\ub370\uae30\ub77c\uace0 \uc0dd\uac01\ud558\ub294 Optional \ud074\ub798\uc2a4\ub85c \ud55c\ubc88 \ub354 \ub798\ud551\uc744 \ud574\uc8fc\ub294 \uac1c\ub150\uc774\ub77c\uace0 \uc0dd\uac01\ud558\uba74 \ub41c\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"408\" height=\"207\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-16.png\" alt=\"\" class=\"wp-image-443\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-16.png 408w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-16-300x152.png 300w\" sizes=\"auto, (max-width: 408px) 100vw, 408px\" \/><figcaption>\uc694\ub7f0 \uc2dd\uc73c\ub85c&#8230;<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Car\ub97c \ucc38\uc870\ud560 \ub54c, null\uc77c \uc218\ub3c4 \uc788\ub294 Car\ub97c \uc9c1\uc811 \ucc38\uc870\ud558\ub294 \uac83\uc774 \uc544\ub2cc, Car\ub97c \uac10\uc2f8\uace0 \uc788\ub294 Optional\uc744 \ucc38\uc870\ud558\ub294 \uac1c\ub150\uc774\ubbc0\ub85c \ubb50 \ub85c\uc9c1\uc774 \uc6d0\ud558\ub294\ub300\ub85c \ub3cc\uc9c0 \uc54a\uc744\uc9c4 \ubab0\ub77c\ub3c4, NPE\ub9cc\ud07c\uc740 \uc608\ubc29\ud560 \uc218 \uc788\ub2e4!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Optional\uc744 \uc774\uc6a9\ud558\ub294 \ucf54\ub4dc \uc608\uc81c\ub97c \ud55c\ubc88 \ubd10\ubcf4\uc790<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"106\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-17.png\" alt=\"\" class=\"wp-image-444\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-17.png 702w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-17-300x45.png 300w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"356\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-18.png\" alt=\"\" class=\"wp-image-445\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-18.png 697w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-18-300x153.png 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\ud2b9\uae30\ud560 \ub9cc\ud55c \uac83\uc774 Insurance.name \ud504\ub85c\ud37c\ud2f0\uc778\ub370, \uc598\ub294 Optional\ub85c \uac10\uc2f8\uc9c0 \uc54a\uc558\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8216;NPE\uac00 \ub098\ub294\uac70 \uc544\ub0d0?&#8217; \ub77c\uace0 \uc0dd\uac01\ud560 \uc218 \uc788\ub2e4. \ubb3c\ub860&#8230;. NPE\uac00 \ub098\uaca0\uc9c0&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud558\uc9c0\ub9cc \ucf54\ub4dc \uc8fc\uc11d\uc73c\ub85c \uc368\uc838\uc788\ub4ef \uc774 \ucf54\ub4dc\uc5d0\ub294 \uc228\uaca8\uc9c4 \uc758\ubbf8\uac00 \uc874\uc7ac\ud55c\ub2e4. &#8216;\ubcf4\ud5d8\ud68c\uc0ac\uc5d0\ub294 \ubc18.\ub4dc.\uc2dc. \uc774\ub984\uc774 \uc788\uc5b4\uc57c \ud55c\ub2e4&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub7ec\ub2c8\uae4c NPE\uac00 \ub09c\ub2e4\uba74 \uc774\uac74 \uc758\ub3c4\uce58 \uc54a\uc740 NPE\uac00 \uc544\ub2c8\ub77c, &#8216;\ub2f9\uc5f0\ud788 \ub098\uc57c \ud558\ub294 NPE&#8217;\ub77c\ub294 \uac83\uc784.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub7f0 \ucf54\ub4dc\uc5d0 \uc775\uc219\ud574\uc9c0\uba74 \uad73\uc774 \uc8fc\uc11d\uc744 \ub355\uc9c0\ub355\uc9c0 \uccd0\ubc14\ub974\uc9c0 \uc54a\uace0\ub3c4, \uac1c\ubc1c\uc790\uc758 \uc758\ub3c4\uac00 \ub2f4\uae34 \ucf54\ub4dc\ub97c \uc791\uc131\ud560 \uc218 \uc788\ub2e4\ub294 \ub73b\uc774\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Optional \uc0ac\uc6a9\ubc95<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/* Optional \uac1d\uccb4 \ub9cc\ub4e4\uae30 *\/\n\n\/\/\ube48 Optional\nOptional&lt;Car> optCar = Optional.empty();\n\n\/\/null\uc774 \uc544\ub2cc \uac12\uc73c\ub85c \ub9cc\ub4e4\uae30\nOptional&lt;Car> nonNullableOptCar = Optional.of(car); \/\/\uc774\uac74 car\uc778\uc2a4\ud134\uc2a4\uac00 null\uc774\uba74 NPE\ubc1c\uc0dd\ud568..\n\n\/\/null\uac12\uc73c\ub85c \ub9cc\ub4e4\uae30\nOptional&lt;Car> nullableOptCar = Optional.ofNullable(car);\n\n\/* \n  Optional.map \uba54\uc18c\ub4dc\ub97c \ud1b5\ud55c \uac12 \ucd94\ucd9c \n    insurance \ub77c\ub294 \uc778\uc2a4\ud134\uc2a4\uc758 \uc774\ub984(\ubcf4\ud5d8\ud68c\uc0ac\uc774\ub984)\uc744 \ucd94\ucd9c\ud558\uace0\uc790 \ud560 \ub54c\n*\/\n\n\/\/\uc774 \ud328\ud134\uc758 \ucf54\ub4dc\ub97c\nString name = null;\nif(insurance != null) {\n  name = insurance.getName();\n}\n\n\/\/\uc774\ub7f0 \uc2dd\uc73c\ub85c \uc791\uc131\uac00\ub2a5\nOptional&lt;Insurance> optInsurance = Optional.ofNullable(insurance);\nOptional&lt;String> name = optInsurance.map(Insurance::getName);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">map\uba54\uc18c\ub4dc\ub97c \uc774\uc6a9\ud55c \uac12 \ucd94\ucd9c \ucf54\ub4dc\ub97c \ubcf4\uba74&#8230;. \ubb54\uac00 \uc2a4\ud2b8\ub9bc\uc5d0\uc11c \uc4f0\ub294 map() \uc774\ub791 \ube44\uc2b7\ud558\uc9c0 \uc54a\ub098? \uc81c\ub300\ub85c \uc774\ud574\ud55c \uac83\uc774\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\uc2a4\ud2b8\ub9bc<ul><li>\uc2a4\ud2b8\ub9bc\uc758 \uac01 element\uc5d0, \uc81c\uacf5\ub41c \ud568\uc218\ub97c apply\ub97c \ud558\ub294 \uacb0\uacfc\uac12\uc744 \ub9ac\ud134<\/li><\/ul><\/li><li>Optional<ul><li>Optional\uc758 \uc694\uc18c\uc5d0, \uc81c\uacf5\ub41c \ud568\uc218\ub97c apply\ud558\ub294 \uacb0\uacfc\uac12\uc744 \ub9ac\ud134<\/li><\/ul><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\ub0b4\ubd80\uc801\uc778 \ub3d9\uc791\uc744 \uad6c\uccb4\uc801\uc73c\ub85c \ubaa8\ub974\ub354\ub77c\ub3c4(\uacf5\ubd80\ud558\uba74 \uc54c\uaca0\uc9c0), \uc774\ub807\uac8c \ube44\uc2b7\ud558\uac8c \ub3d9\uc791\ud55c\ub2e4\ub294 \uac83\uc744 \uc778\uc9c0\ud574 \ub450\uc790.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub97c \uadf8\ub9bc\uc73c\ub85c \ud45c\ud604\ud558\uba74 \uc774\ub807\uac8c \ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"258\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-20.png\" alt=\"\" class=\"wp-image-448\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-20.png 671w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-20-300x115.png 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><figcaption>\uc704\ub294 \uc2a4\ud2b8\ub9bc, \uc544\ub798\ub294 Optional<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\uba54\uc18c\ub4dc \uccb4\uc778\uacfc flatmap<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub7fc \ub2e4\uc74c\uacfc \uac19\uc740 \ub808\uac70\uc2dc \uc790\ubc14 \ucf54\ub4dc \uc608\uc81c\uac00 \uc788\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"469\" height=\"83\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-21.png\" alt=\"\" class=\"wp-image-449\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-21.png 469w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-21-300x53.png 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uc598\ub97c Optional\uc744 \uc774\uc6a9\ud558\uc5ec \ud638\ucd9c\ud558\ub824\uba74 \uc5b4\ub5bb\uac8c \ud574\uc57c \ud560\uae4c?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"129\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-22.png\" alt=\"\" class=\"wp-image-450\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-22.png 465w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-22-300x83.png 300w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><figcaption>\uc774\ub807\uac8c\uc694?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uc55e\uc11c \uad6c\ud604\ud588\ub358 Person, Car, Insurance \ud074\ub798\uc2a4\ub97c \ucc38\uace0\ud574\ubcf4\uba74, Person::getCar\uc758 \ub9ac\ud134 \ud0c0\uc785\uc774 Car\ud0c0\uc785\uc774 \uc544\ub2c8\ub77c Optional&lt;Car&gt; \ud0c0\uc785\uc774\ubbc0\ub85c, 3\ub77c\uc778\uc758 \uc2e4\ud589\uacb0\uacfc\ub294 Optional&lt;Optional&lt;Car&gt;&gt; \ud0c0\uc785\uc73c\ub85c \ub9ac\ud134\ub428\uc744 \uc54c \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ubb3c\ub860 Car.getCar()\uc758 \ub9ac\ud134\ud0c0\uc785\uc744 Car\ub85c \ud55c\ub2e4\uba74\uc57c&#8230; \ucef4\ud30c\uc77c \uc624\ub958\uac00 \ub098\uc9c4 \uc54a\uaca0\uc9c0. \ud558\uc9c0\ub9cc \uadf8\uac74 \uadf8\uac70\ub300\ub85c \ubb38\uc81c\uc778\uac8c getCar \uba54\uc18c\ub4dc\ub97c \ub2e4\uc2dc Car\ud0c0\uc785\uc73c\ub85c \ubcc0\uacbd\ud558\uba74 NPE\ubb38\uc81c\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\ub2e4\ub294 \uac83\uc774\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub7fc \uc5b4\ub5bb\uac8c \ud574\uacb0\ud558\ub290\ub0d0? Optional\uc758 flatMap\uba54\uc18c\ub4dc\ub97c \uc774\uc6a9\ud558\uba74 \ub41c\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"270\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-23.png\" alt=\"\" class=\"wp-image-452\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-23.png 714w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-23-300x113.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"162\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-24.png\" alt=\"\" class=\"wp-image-453\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-24.png 601w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-24-300x81.png 300w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><figcaption>\uadf8\ub798\uc11c \uc694\ub807\uac8c \uc0ac\uc6a9\ud558\uba74 \ub41c\ub2e4<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uae54\ub054\ud558\uac8c NPE\uac00 \ub098\uc9c0 \uc54a\uc73c\uba74\uc11c if null \uc5c6\uc774, \ud55c\ub208\uc5d0 \ub4e4\uc5b4\uc624\ub294 \uac04\ub2e8\ud55c \ucf54\ub4dc\ub85c \uc791\uc131\ud558\uac8c \ub418\uc5c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Optional \uc2a4\ud2b8\ub9bc \uc870\uc791<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uc790\ubc14 9\uc11c\ubd80\ud130\ub294 \uc544\uc608 Optional\uc5d0 stream() \uac00 \ucd94\uac00\ub418\uc5c8\ub2e4. Optional \uc790\uccb4\uc5d0 \uc2a4\ud2b8\ub9bc\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4\ub294 \ub73b\uc774\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public Set&lt;String> getCarInsuranceNames(List&lt;Person> persons) {\n  return persons.stream()\n                .map(Person::getCar) \/\/ Optional&lt;Car>\n                .map(optCar -> optCar.flatMap(Car::getInsurance)) \/\/ flatMap\uc744 \uc368\uc11c Optional&lt;Car> --> Optional&lt;Insurance>\n                .map(optIns -> optIns.map(Insurance::getName))  \/\/ Optional&lt;Insurance> --> Optional&lt;String>\n                .flatMap(Optional::stream) \/\/ Stream&lt;Optional&lt;String>> --> Stream&lt;String>\n                .collect(toSet());\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub7f0 \uc2dd\uc73c\ub85c Optional\uc790\uccb4\uc5d0 Stream\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. \ubc88\uac70\ub86d\uc9c0 \uc54a\uac8c \uace7\ubc14\ub85c Set&lt;String> \uc744 \ub9ac\ud134\ud560 \uc218 \uc788\uac8c\ub054&#8230;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span class=\"has-inline-color has-cyan-bluish-gray-color\">\uc544\ub9c8 \uc6d0\ub798\ub294 stream.filter(Optional::isPresent) \ub85c \ud544\ud130 \ud6c4\uc5d0 Optional::get \uba54\uc18c\ub4dc \ucc38\uc870\ub97c \uc0ac\uc6a9\ud558\uc5ec \ucd5c\uc885\uc801\uc73c\ub85c String\uc744 \uac00\uc838\uc62c \uc218 \uc788\uc744\uac70\ub2e4&#8230;<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub2e4\ub9cc \uc774 \ucf54\ub4dc\ub97c \ubcf4\uba74&#8230;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\uccab\ubc88\uc9f8 \uc5f0\uc0b0\uc5d0 Car\uac00 \uc544\ub2c8\ub77c Optional&lt;Car>\uac00 \ud280\uc5b4\ub098\uc628\ub2e4 (\uc815\ud655\ud78c Stream&lt;Optional&lt;Car>>)<\/li><li>\ub450\ubc88\uc9f8 \uc5f0\uc0b0\uc5d0 \uc774 Optional\uc744 \uc5b8\ub7a9\ud558\uae30 \uc704\ud574 flatMap\uc744 \ud55c\ubc88 \uc0ac\uc6a9\ud55c\ub2e4<\/li><li>\uc138\ubc88\uc9f8\u001f \uc5f0\uc0b0\uc5d0 \ube44\ub85c\uc18c Insurance.name \uc744 \uad6c\ud55c\ub2e4<\/li><li>\ub124\ubc88\uc9f8 \uc5f0\uc0b0\uc5d0 \ub610 Optional&lt;String>\uc744 \uc5b8\ub7a9\ud558\uae30 \uc704\ud574 flatMap\uc744 \ud55c\ubc88 \uc0ac\uc6a9\ud55c\ub2e4<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub7f0 \uc2dd\uc73c\ub85c, Optional\uc774 NPE\ub294 \ub9c9\uc544\uc8fc\uc9c0\ub9cc, Optional\ub85c \ud55c\ubc88 wrapping\uc774 \ub418\uc5b4 \uc788\uc73c\ubbc0\ub85c, \uc2a4\ud2b8\ub9bc \uc5f0\uc0b0 \uc0ac\uc6a9\uc2dc \ub9e4\ubc88 \uac81\ub098 \uadc0\ucc2e\uac8c(\uadf8\ub9ac\uace0 \uc5b4\ub835\uac8c) \uc2e0\uacbd\uc744 \uc368\uc57c \ud55c\ub2e4\ub294 \ub2e8\uc810\uc774 \uc788\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Optional \uc5b8\ub7a9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Optional \uc778\uc2a4\ud134\uc2a4\uc5d0 \ud3ec\ud568\ub41c \uac12\uc744 \uc77d\ub294 \ub2e4\uc591\ud55c \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf8\ub2e4<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>get()<ul><li>\ub9d0\uadf8\ub300\ub85c \uac12\uc744 \ub9ac\ud134\ud574 \uc8fc\ub294 \uba54\uc18c\ub4dc. \uadfc\ub370, \uac12\uc774 \ube44\uc5b4\uc788\ub294 \uacbd\uc6b0\uc5d4 NoSuchElementException\uc774 \ubc1c\uc0dd\ud55c\ub2e4. get()\uc744 \ubed4\uc9c8\ub098\uac8c \uc0ac\uc6a9\ud558\uba74 \uacb0\uad6d \uad6c\uc870\uc801\uc73c\ub85c NPE\uccb4\ud06c if\ubb38\uc774\ub791 \ub2e4\ub97c\uac8c \uc5c6\uc744\ud14c\ub2c8 \uc9c0\uc591\ud558\uc790<\/li><\/ul><\/li><li>orElse()<ul><li>Optional\uc5d0 \uac12\uc774 \uc5c6\uc744\ub54c \ub514\ud3f4\ud2b8\uac12\uc744 \ub9ac\ud134\ubc1b\uc744 \uc218 \uc788\ub2e4.<\/li><\/ul><\/li><li>orElseGet(Supplier&lt;? extends T>)<ul><li>orElse() \ub791 \uac19\uc740 \uac1c\ub150\uc774\ub2e4. orElse()\ub300\ube44 \uc880 \ub354 \ucd95\uc57d\ub41c \ubc84\uc804<\/li><\/ul><\/li><li>orElseThrow(Supplier&lt;? extends X> exceptionSupplier)<ul><li>orElseGet() \uc774 \ub514\ud3f4\ud2b8\uac12\uc744 \ub9ac\ud134\ud55c\ub2e4\uba74 \uc598\ub294 \uc608\uc678\ub97c \ub358\uc9c4\ub2e4. \uc5ec\ub7ec\ubaa8\ub85c \ub358\uc9c8 \uc218 \uc788\ub294 \uc608\uc678\ub97c \uc815\ud560 \uc218 \uc788\ub2e4\ub294 \uc810\ub9cc \uc81c\uc678\ud558\uba74 get()\uacfc \ub2e4\ub97c \ubc14\uac00 \uc5c6\uc74c<\/li><\/ul><\/li><li>ifPresent(Consumer&lt;? super T> comsumer)<ul><li>\uac12\uc774 \uc5c6\ub2e4\uba74 consumer\uac00 \uc544\ubb34\uc77c\ub3c4 \ud558\uc9c0 \uc54a\uace0, \uac12\uc774 \uc788\ub2e4\uba74 consumer\ub97c \uc2e4\ud589\ud55c\ub2e4.<\/li><\/ul><\/li><li>ifPersentOrElse(Consumer&lt;? super T> actoin, Runnable emptyAction)<ul><li>orElse &lt;-> orElseGet \uacfc \ub3d9\uc77c\ud55c \uc218\uc900\uc758 \uad00\uacc4. Optional\uc774 \ube44\uc5b4\uc788\uc744 \ub54c \uc2e4\ud589\ud560 \uc218 \uc788\ub294 Runnable\uc744 arg\ub85c \ubc1b\ub294\ub2e4<\/li><\/ul><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\ub450\uac1c\uc758 Optional\uc744 \uc774\uc6a9\ud558\uc5ec \uc5f0\uc0b0\ud558\uae30<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Person \uacfc Car\ub97c \uc774\uc6a9\ud574\uc11c, \uac00\uc7a5 \uc800\ub834\ud55c \ubcf4\ud5d8\ub8cc\ub97c \uc81c\uacf5\ud558\ub294 \uba54\uc18c\ub4dc\ub97c \ub9cc\ub4e0\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uc790<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"139\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-25.png\" alt=\"\" class=\"wp-image-465\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-25.png 644w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-25-300x65.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub9ac\uace0 \uc774 \ub450 \uc694\uc18c\uac00 Optional\ub85c \ub798\ud551\ub41c, Optional&lt;Person> \uacfc Optional&lt;Car> \ub97c arg\ub85c \ubc1b\ub294 \uba54\uc18c\ub4dc\ub97c \ub9cc\ub4e0\ub2e4\uace0 \ud574 \ubcf4\uc790<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"81\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-27.png\" alt=\"\" class=\"wp-image-467\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-27.png 534w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-27-300x46.png 300w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"77\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-28.png\" alt=\"\" class=\"wp-image-468\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-28.png 532w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-28-300x43.png 300w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\ubb50 \ub418\ub294 \ucf54\ub4dc\uc774\uae34 \ud558\uc9c0\ub9cc, if \uccb4\ud06c\uac00 \ubb54\uac00 \uc880&#8230;.\uc138\ub828\ub418\uc9c0 \ubabb\ud55c \ub290\ub08c\uc774\ub2e4<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"117\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-29.png\" alt=\"\" class=\"wp-image-469\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-29.png 772w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-29-300x45.png 300w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-29-768x116.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><figcaption>\ud3b8-\uc548<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub7f0 \uc2dd\uc73c\ub85c flatMap\uc744 \uc774\uc6a9\ud574\uc11c Optional&lt;Person> \uc744 Person\uc73c\ub85c \uc5b8\ub7a9\uc744 \ud558\uc5ec \ud55c \uc904\uc758 \ucf54\ub4dc\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\ub2e4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span class=\"has-inline-color has-cyan-bluish-gray-color\">\ud544\ud130\ub85c \ud2b9\uc815 \uac12 \uac70\ub974\uae30\ub294 \ub108\ubb34\ub108\ubb34\ub108\ubb34\ub108\ubb34 \uc775\uc219\ud574\uc11c \uc288\ud37c\ud328\uc2a4<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Optional \ud074\ub798\uc2a4\uc5d0\uc11c \ub2e4\uc591\ud55c \uba54\uc18c\ub4dc\ub97c \uc81c\uacf5\ud574 \uc900\ub2e4. \uae30\uc874\uc5d0 stream\uc744 \ub9ce\uc774 \uc0ac\uc6a9\ud558\ub358 \uc0ac\ub78c\ub4e4\uc5d0\uac90 \uce5c\uc219\ud55c \ub0b4\uc6a9\uc77c \uac83\uc774\ub2e4<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"710\" src=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-30.png\" alt=\"\" class=\"wp-image-470\" srcset=\"https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-30.png 868w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-30-300x245.png 300w, https:\/\/scrutineer.co.kr\/wordpress\/wp-content\/uploads\/2021\/03\/image-30-768x628.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Optional \uc2e4\uc81c \uc608\uc81c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">nullable\ud55c \ubcc0\uc218\ub97c Optional\ub85c \uac10\uc2f8\uae30<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Object value = map.get(\"key\");\n\nOptional&lt;Object> value = Optional.ofNullable(map.get(\"key\"));<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc608\uc678\ucc98\ub9ac\ub97c Optional\ub85c<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">try{\n  return Optional.of(Integer.parseInt(s));\n} catch (NumberFormatException e) {\n  return Optional.empty();\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc751\uc6a9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Properties\uac12\uc744 \ud14c\uc2a4\ud2b8\ud558\ub294 \ud14c\uc2a4\ud2b8\ucf54\ub4dc\ub97c \ub9cc\ub4e0\ub2e4\uace0 \ud558\uc790. \ub2e4\uc74c\uacfc \uac19\uc774 Properties\ub97c \uc77d\uc5b4\uc11c \uac12\uc774 \uc81c\ub300\ub85c \ub4e4\uc5b4\uac00\uc788\ub294\uc9c0\ub97c \ud14c\uc2a4\ud2b8\ud558\ub294 JUnit assertion \ucf54\ub4dc\ub97c \uc608\uc81c\ub85c&#8230;&#8230; readDuration\uba54\uc18c\ub4dc\ub97c \uad6c\ud604\ud574 \ubcf8\ub2e4<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Properties props = new Properties();\nprops.setProperty(\"a\",\"5\");\nprops.setProperty(\"b\",\"true\");\nprops.setProperty(\"c\",\"-3\");\n\nassertEquals(5, readDuration(param,\"a\"));\nassertEquals(0, readDuration(param,\"b\"));\nassertEquals(0, readDuration(param,\"c\"));\nassertEquals(0, readDuration(param,\"d\"));<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc704 \ucf54\ub4dc\uac00 \ucc38\uc774 \ub418\ub824\ub294 readDuratoin\uc744 \uad6c\ud604\ud55c\ub2e4 \uce58\uba74&#8230; Optional \uc5c6\uc774\ub294 \uc774\ub807\uac8c \uad6c\ud604\ub420 \uc218 \uc788\uc744 \uac83\uc774\ub2e4<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public int readDuration(Properties props, String name) {\n  String value = props.getProperty(name);\n  if (value != null) {\n    try {\n      int i = Integer.parseInt(value);\n      if (i>0) return i;\n    } catch(NumberFormatException nfe) {}\n  }\n  return 0;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud760&#8230;.. if\uc5d0 try\/catch\ub77c&#8230;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc880 \ub354 \uae54\ub054\ud558\uac8c Optional\uc744 \uc774\uc6a9\ud558\uc5ec \ucf54\ub4dc\ub97c \ub9ac\ud329\ud1a0\ub9c1 \ud574 \ubcf4\uc790<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public int readDuration(Properties props, String name) {\n  return Optional.ofNullable(props.getProperty(name))\n                 .flatMap(OptionalUtility::stringToInt)\n                 .filter(i -> i>0)\n                 .orElse(0);\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud3b8-\uc548<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NPE\ub294 \ub9cc\uc545\uc758 \uadfc\uc6d0 NPE\ub294 \ub9cc\uc545\uc758 \uadfc\uc6d0\uc774\ub2e4. \ud504\ub85c\uc81d\ud2b8\ub294 \ucee4\ub155, \ud1a0\uc774\ud504\ub85c\uc81d\ud2b8\ub098 \ud558\ub2e4\ubabb\ud574 \ud559\uad50 \uacfc\uc81c\ub77c\ub3c4 \ud574 \ubcf4\uba74 \uc774\uac8c \uc5bc\ub9c8\ub098 \uc790\uc8fc \ud130\uc9c0\uace0 \ube61\uce58\ub294\uac74\uc9c0 \uad73\uc774 \ub9d0 \uc548\ud574\ub3c4 \ub420 \ub4ef. \uadf8\ub7ec\ub2c8\uae4c NPE\ub97c \uc608\ubc29\ud560 \uc218 \uc788\ub294 \ucf54\ub4dc\ub97c \ub9cc\ub4e4\uc5b4 \ubcf4\uc790 \uc774\uac8c \ubcc4\ub85c \uc88b\uc9c0 \uc54a\uc740 \ubc29\ubc95\uc774\ub780 \uac83\uc740 \ubb50&#8230;\uad73\uc774&#8230; \uadf8\ub7fc \uc774\ub7f0 \ubc29\ubc95\uc73c\ub85c \ud574\ubcfc\uae4c? \ubb54\uac00 \uc880 \ub354 \ub290\ub08c\uc788\uc5b4 \ubcf4\uc778\ub2e4 \uadf8\uce58..? \uadfc\ub370 \uc800\ub807\uac8c if\ub97c \ub355\uc9c0\ub355\uc9c0 \uce60\ud558\uace0 early &#8230; <a title=\"\ubaa8\ub358 \uc790\ubc14 \uc778 \uc561\uc158 11\uc7a5\" class=\"read-more\" href=\"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/2021\/03\/11\/%eb%aa%a8%eb%8d%98-%ec%9e%90%eb%b0%94-%ec%9d%b8-%ec%95%a1%ec%85%98-11%ec%9e%a5\/\" aria-label=\"Read more about \ubaa8\ub358 \uc790\ubc14 \uc778 \uc561\uc158 11\uc7a5\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-442","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":11,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/442\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}