Static method locking
Public static synchronized List getVerifyListInfo (byte [] b) {List signatureVerifications = new ArrayList (); SignatureVerification sv = new SignatureVerification (); byte [] cert = null; SPDocument doc = new SPDocument (); cert = doc.VerifySignature (b); int I = doc.getVerifyResult () Logger.info ("VerifyService---getVerifyResult:" + I); if (I = = 0) {sv.setModified (false);} if (I = = 1) {sv.setModified (true) } if (I = = 2 | | I = = 3) {sv.setModified (true);} if (cert! = null) {sv.setX509Base64 (com.itrus.util.Base64.encode (cert)); signatureVerifications.add (sv) } return signatureVerifications;}
The SO library called in the static method, and the SO library frees memory to report errors, so locks are added and multithreaded testing faults are eliminated.