naver / arcus-spring

ARCUS as a caching provider for the Spring Cache Abstraction
Apache License 2.0
26 stars 16 forks source link

INTERNAL: get NullValue instance from arcus server #78

Closed oliviarla closed 4 months ago

oliviarla commented 4 months ago

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

oliviarla commented 4 months ago

@uhm0311 ๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค.

uhm0311 commented 4 months ago

@oliviarla

allowNullValue ์—ฌ๋ถ€์— ๋”ฐ๋ผ null์„ ์ €์žฅํ•˜๋ ค๊ณ  ์‹œ๋„ํ–ˆ์„ ๋•Œ ์„ฑ๊ณต/์‹คํŒจ๋ฅผ ๊ฒ€์ฆํ•˜๋Š” ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.

oliviarla commented 4 months ago

@uhm0311 ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ธฐ ์œ„ํ•ด NullValue.INSTANCE ์ •์  ํ•„๋“œ๋ฅผ ์ด์šฉํ•ด ๊ฐ์ฒด๋ฅผ ๊ฐ€์ ธ์˜ค๋ ค๊ณ  ํ–ˆ์œผ๋‚˜, ํ˜„์žฌ spring 4.3.0 ๋ฒ„์ „ ๊ธฐ์ค€์œผ๋กœ๋Š” package private ์ด๋ฏ€๋กœ NullValue ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

spring 4.3.10 ๋ฒ„์ „ ์ดํ›„๋ถ€ํ„ฐ๋Š” public์œผ๋กœ ๋ฐ”๋€Œ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— NullValue.INSTANCE ์ •์  ํ•„๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋‚˜, ํ˜„์žฌ๋กœ์„œ๋Š” reflection์„ ํ†ตํ•ด์„œ๋งŒ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

spring ํŒจ์น˜ ๋ฒ„์ „์„ ์˜ฌ๋ฆฌ๊ณ  ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ์ง€, ์•„๋‹ˆ๋ฉด reflection์œผ๋กœ ์ž‘์„ฑํ•ด๋‘˜์ง€ ์˜๊ฒฌ์„ ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

oliviarla commented 4 months ago
oliviarla commented 4 months ago

@uhm0311 ์ด๋ฏธ ํ…Œ์ŠคํŠธ์ฝ”๋“œ์—์„œ reflection์„ ํ†ตํ•ด protected ์ ‘๊ทผ ์ œ์–ด์ž์ธ toStoreValue ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ์–ด๋–ค ์˜๋ฏธ์ธ๊ฐ€์š”?

uhm0311 commented 4 months ago

@oliviarla

๋ฆฌํ”Œ๋ ‰์…˜์ด๋‚˜ 4.3.10์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•˜์ง€ ์•Š๊ณ ๋„ NullValue ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ์‹œ๋„ํ•ด๋ณด๋ผ๋Š” ์˜๋ฏธ์˜€์Šต๋‹ˆ๋‹ค. ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด 4.3.10์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•˜์‹œ์ฃ .