提交 c800d392 编写于 作者: N nicky

ThreadLocal test

上级 db03bdd4
......@@ -12,10 +12,11 @@ import com.muses.taoshop.web.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.Date;
import java.util.List;
/**
......@@ -77,10 +78,6 @@ public class IndexController extends BaseController{
CategoryTreeUtils treeUtil = new CategoryTreeUtils();
List<ItemCategory> list = iItemCategoryService.listCategory();
List<ItemCategory> categories = treeUtil.buildCategoryTree(list);
for(ItemCategory itemCategory : categories){
Date unixlongTime = itemCategory.getCreateTime();
log.debug("create time!!!!!!!!!"+unixlongTime);
}
String jsonString = "";
if(!CollectionUtils.isEmpty(categories)){
jsonString = JSON.toJSON(categories).toString();
......
package com.muses.taoshop;
import java.lang.ref.SoftReference;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -55,5 +56,6 @@ public class ThreadLocalTest implements Runnable {
for(int i =0;i<=1000;i++){
es.execute(new ThreadLocalTest(i));
}
threadLocal.remove();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册