woowacourse-teams / 2020-taggle

🔖 태그 기반의 북마크 관리 서비스
https://taggle.kr
Apache License 2.0
20 stars 7 forks source link

LocalValidatorFactoryBean Bug 수정 #286

Closed ksy90101 closed 3 years ago

ksy90101 commented 3 years ago

LocalValidatorFactoryBean Bug 수정

description

Use try-with-resources or close this "LocalValidatorFactoryBean" in a "finally" clause.Why is this an issue?

Connections, streams, files, and other classes that implement the Closeable interface or its super-interface, AutoCloseable, needs to be closed after use. Further, that close call must be made in a finally block otherwise an exception could keep the call from being made. Preferably, when class implements AutoCloseable, resource should be created using "try-with-resources" pattern and will be closed automatically.

Failure to properly close resources will result in a resource leak which could bring first the application and then perhaps the box it's on to their knees.

progress