target / POSSUM

MIT License
24 stars 4 forks source link

Deprecated Base64Utils causing warning #9

Closed pmpurifoy closed 1 year ago

pmpurifoy commented 1 year ago

Steps for repro: -run gradlew compileJava -view warning D:\POSSUM\src\main\java\com\target\devicemanager\components\printer\PrinterDevice.java:278: warning: [removal] Base64Utils in org.springframework.util has been deprecated and marked for removal Base64Utils.decodeFromString(content.data), ^ Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning

Docs mention warning using Base64Utils: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/Base64Utils.html

Fix: Use java.util.Base64 https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Base64.Decoder.html#decode(java.lang.String)

From: Base64Utils.decodeFromString(content.data)

src\main\java\com\target\devicemanager\components\printer\PrinterDevice.java line 278

To: Base64.getDecoder().decode(content.data)

I verified this fixes the issue locally, but no write access so I can't publish PR.

rrenkor commented 1 year ago

This issue has been resolved with PR https://github.com/target/POSSUM/pull/14. Thank you @pmpurifoy for the issue finding and resolution!