Java. Lang. numberformatexception: multiple points resolved

Source: Internet
Author: User

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;


}

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.