--- tags: tirc-library --- # OOError Object-oriented error handling ### maven ```xml= <dependency> <groupId>tirc.lib</groupId> <artifactId>OOError</artifactId> <version>1.0.0</version> </dependency> ``` ## 改良討論 ### OOError的字串格式編碼評估 目前使用的編碼是String.format,是否換成其他編碼會更好用? ```java= import java.text.MessageFormat; import org.slf4j.helpers.FormattingTuple; import org.slf4j.helpers.MessageFormatter; public class Test { public static void main(String[] args) { // 這個的缺點是不能編號 FormattingTuple message = MessageFormatter.arrayFormat("name={}, age={}", new Object[] {25, "huhx"}); System.out.println(message.getMessage()); // 這個的缺點是不能不編號 System.out.println(MessageFormat.format("name={1}, age={0}", 25, "huhx")); // 這個的缺點是跟多國語言有一點差異 System.out.println(String.format("%1$s %2$s %1$s", "Hi", "Java")); } } ``` ## Release Note ### v1.1.0 Release date: 2022.5.19 * 增加可比較錯誤類別 ComparableErr * 修正因前版支援字串錯誤碼衍生問題 ### v1.0.1 Release date: 2021.8.23 ### * Error code可支援字串錯誤碼 ### v1.0.0 Release date: 2021.2.2 ### * 移除test_tool相依性,將測項移至LibraryTestReportProject ### v0.0.4 Release date: 2019.1.26 ### * BaseErr 加入setAllParams方法 * ErrCreator 加入多重Params參數 * 增加source code於release中 ### v0.0.3 Release date: 2019.10.9 ### * 移除Spring的參考 * 加入errSource來記錄錯誤發生的源頭 ### v0.0.2 Release date: 2018.7.5 ### * 增加錯誤種類 ### v0.0.1 Release date: 2018.4.24 ### * 加入初版元件
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up