Java??????????
???????????? ???????[ 2016/4/18 10:50:14 ] ??????????????? ????? ????
?????????LogUtil?????????л?????????????new???????????LogUtil?????????????????sLogUtil??о???????????????????????????е?getInstance??????????LogUtil?????????????????????ж????sLogUtil????new??????μ?LogUtil???????????????sLogUtil??????????????浱???????????LogUtil?????????????????????????????????????????·????
????LogUtil.getInstance().debug("Hello World");
??????????汾???????leader?????????Ц??Ц?????“????????????????????????????????bug?????
?????????????????????????????????????????????bug???
???????leader?????????????????????????????????????????????????????п???????????д??????????????????????????
????public static LogUtil getInstance() {
????if (sLogUtil == null) {
????sLogUtil = new LogUtil();
????}
????return sLogUtil;
????}
???????????????????????????getInstance?????????????????????2?У??????е?3?У????????????????е????2?У???????sLogUtil????null???????????if?ж????檔?????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????£?
????public synchronized static LogUtil getInstance() {
????if (sLogUtil == null) {
????sLogUtil = new LogUtil();
????}
????return sLogUtil;
????}
?????????????????????????????????getInstance??????????????Ч???????????????????????????
???????leader????????′???????“???????????????????п??????????????????????????δ?????????????”
????????????????????????????????
???????leaderЦЦ??“???y??????β???bug??????????????????Щ??????£????????getInstance????????????synchronized??????????????getInstace???????????????????????????????е?Ч??????????????????δ???LogUtil??????????????????????????????????????????????á?”
?????????synchronized?????????????????????????????????嵱?У?
public static LogUtil getInstance() {
synchronized (LogUtil.class) {
if (sLogUtil == null) {
sLogUtil = new LogUtil();
}
return sLogUtil;
}
}
????????Ч????????????????synchronized?????μ???????synchronized?????????????ж???????????
public static LogUtil getInstance() {
if (sLogUtil == null) {
synchronized (LogUtil.class) {
if (sLogUtil == null) {
sLogUtil = new LogUtil();
}
}
}
return sLogUtil;
}
??????????????????????sLogUtil??????????????????????3?У????????????????sLogUtil????????????????????????3????????????getInstance????????????????????????Ч??????????????????
???????鯔??????????????????????????ó????????????????
???????leader?????????????“??????????????????(Double-Check Locking)????????????????????????????????????????顣”
???????????????????????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????