Problem:
The shared variable simpledateformat is used in the multithreading method, and the following error is returned:
Java. Lang. numberformatexception: multiple points
At sun. Misc. floatingdecimal. readjavaformatstring (floatingdecimal. Java: 1084
Cause:
Simpledateformat is thread-insecure and should not be avoided!
Solution:
New simpledateformat ();
Example:
Simpledateformat SDF = new simpledateformat ();
Class queryuserbynothread extends thread {
Loginopr;
Countdownlatch countdown;
Map <string, Object> map; // construct the returned information
Group group;
String grpuid;
Simpledateformat SDF;
List <Cust> listcust;
List <groupmember> listmem;
List <user> listuser;
User user;
Map <string, string> member = new hashmap <string, string> ();
/**
* @ Param Bo
* @ Param loginopr
*/
Public queryuserbynothread (loginopr, countdownlatch cdown, Map <string, string> Member, group, string grpuid, list <Cust> listcust, list <groupmember> listmem, list <user> listuser, user, Map <string, Object> map ){
Super ();
This. member. putall (member );
This. Countdown = cdown;
This. Map = map;
This. Group = group;
This. grpuid = grpuid;
This. SDF = new simpledateformat (constants. date_model_8 );
This. listmem = listmem;
This. listuser = listuser;
This. loginopr = loginopr;
This. User = user;
}