Commit c2c21787 authored by zhangsen's avatar zhangsen

根据代码检查工具处理阻断漏洞 0224

parent 098cbf6c
......@@ -21,7 +21,7 @@ public class AmosThreadPool {
/**
* 单例
*/
private static AmosThreadPool instance;
private static volatile AmosThreadPool instance;
/**
* 执行服务
......@@ -34,14 +34,12 @@ public class AmosThreadPool {
* @return
*/
public static AmosThreadPool getInstance() {
if (null != instance) {
return instance;
}
synchronized (AmosThreadPool.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
instance = new AmosThreadPool();
}
return instance;
}
......
......@@ -17,7 +17,7 @@ public class TriggerKeyQueue {
/**
* 单例
*/
private static TriggerKeyQueue instance;
private static volatile TriggerKeyQueue instance;
/**
* 队列
......@@ -42,14 +42,12 @@ public class TriggerKeyQueue {
* @return
*/
public static TriggerKeyQueue getInstance() {
if (null != instance) {
return instance;
}
synchronized (TriggerKeyQueue.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (TriggerKeyQueue.class) {
if (instance == null) {
instance = new TriggerKeyQueue();
}
}
instance = new TriggerKeyQueue();
}
return instance;
}
......
......@@ -52,15 +52,16 @@ public class TikaUtils {
ContentHandler handler = new ToHTMLContentHandler();
AutoDetectParser parser = new AutoDetectParser();
Metadata metadata = new Metadata();
try (InputStream stream = new FileInputStream(new File(fileName));) {
try {
InputStream stream = new FileInputStream(new File(fileName));
InputStream stream2 = new FileInputStream(new File(fileName));
parser.parse(stream, handler, metadata);
FileHelper.writeFile(handler.toString(), outPutFile + ".html");
FileHelper.parse(outPutFile + ".html");
return null;
} catch (Exception e) {
e.printStackTrace();
}
return null;
return "";
}
......
......@@ -21,7 +21,7 @@ public class AmosThreadPool {
/**
* 单例
*/
private static AmosThreadPool instance;
private static volatile AmosThreadPool instance;
/**
* 执行服务
......@@ -34,14 +34,12 @@ public class AmosThreadPool {
* @return
*/
public static AmosThreadPool getInstance() {
if (null != instance) {
return instance;
}
synchronized (AmosThreadPool.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
instance = new AmosThreadPool();
}
return instance;
}
......
......@@ -17,7 +17,7 @@ public class TriggerKeyQueue {
/**
* 单例
*/
private static TriggerKeyQueue instance;
private static volatile TriggerKeyQueue instance;
/**
* 队列
......@@ -42,14 +42,12 @@ public class TriggerKeyQueue {
* @return
*/
public static TriggerKeyQueue getInstance() {
if (null != instance) {
return instance;
}
synchronized (TriggerKeyQueue.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (TriggerKeyQueue.class) {
if (instance == null) {
instance = new TriggerKeyQueue();
}
}
instance = new TriggerKeyQueue();
}
return instance;
}
......
......@@ -20,7 +20,7 @@ public class AmosThreadPool {
/**
* 单例
*/
private static AmosThreadPool instance;
private static volatile AmosThreadPool instance;
/**
* 执行服务
......@@ -33,14 +33,12 @@ public class AmosThreadPool {
* @return
*/
public static AmosThreadPool getInstance() {
if (null != instance) {
return instance;
}
synchronized (AmosThreadPool.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
instance = new AmosThreadPool();
}
return instance;
}
......
......@@ -17,7 +17,7 @@ public class TriggerKeyQueue {
/**
* 单例
*/
private static TriggerKeyQueue instance;
private static volatile TriggerKeyQueue instance;
/**
* 队列
......@@ -42,14 +42,12 @@ public class TriggerKeyQueue {
* @return
*/
public static TriggerKeyQueue getInstance() {
if (null != instance) {
return instance;
}
synchronized (TriggerKeyQueue.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (TriggerKeyQueue.class) {
if (instance == null) {
instance = new TriggerKeyQueue();
}
}
instance = new TriggerKeyQueue();
}
return instance;
}
......
......@@ -21,7 +21,7 @@ public class AmosThreadPool {
/**
* 单例
*/
private static AmosThreadPool instance;
private static volatile AmosThreadPool instance;
/**
* 执行服务
......@@ -34,14 +34,12 @@ public class AmosThreadPool {
* @return
*/
public static AmosThreadPool getInstance() {
if (null != instance) {
return instance;
}
synchronized (AmosThreadPool.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
instance = new AmosThreadPool();
}
return instance;
}
......
......@@ -17,7 +17,7 @@ public class TriggerKeyQueue {
/**
* 单例
*/
private static TriggerKeyQueue instance;
private static volatile TriggerKeyQueue instance;
/**
* 队列
......@@ -42,14 +42,12 @@ public class TriggerKeyQueue {
* @return
*/
public static TriggerKeyQueue getInstance() {
if (null != instance) {
return instance;
}
synchronized (TriggerKeyQueue.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (TriggerKeyQueue.class) {
if (instance == null) {
instance = new TriggerKeyQueue();
}
}
instance = new TriggerKeyQueue();
}
return instance;
}
......
......@@ -20,7 +20,7 @@ public class AmosThreadPool {
/**
* 单例
*/
private static AmosThreadPool instance;
private static volatile AmosThreadPool instance;
/**
* 执行服务
......@@ -33,14 +33,12 @@ public class AmosThreadPool {
* @return
*/
public static AmosThreadPool getInstance() {
if (null != instance) {
return instance;
}
synchronized (AmosThreadPool.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
instance = new AmosThreadPool();
}
return instance;
}
......
......@@ -16,30 +16,30 @@ public class AmosThreadPool {
*/
private static final Logger log = LoggerFactory.getLogger(AmosThreadPool.class);
/**
* 单例
*/
private static AmosThreadPool instance;
/**
* 执行服务
*/
private static ExecutorService executorService;
/**
* 单例
*/
private static volatile AmosThreadPool instance;
/**
* 获取单例
*
* @return
*/
public static AmosThreadPool getInstance() {
if (null != instance) {
return instance;
}
synchronized (AmosThreadPool.class) {
if (instance != null) {
return instance;
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
instance = new AmosThreadPool();
}
return instance;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment