ErrorManager function ( String ... arg0 ) { if ( ErrorManager . singletonObject == null ) ErrorManager . singletonObject = new ErrorManager ( arg0 . length > 0 ? arg0 [ 0 ] : "srini_string" ) ; return ErrorManager . singletonObject ; }
it could happen that the access method may be called twice from 2 different classes at the same time and hence more than one object being created . this could violate the design patter principle . in order to prevent the simultaneous invocation of the getter method by 2 threads or classes simultaneously we add the synchronized keyword to the method declaration concode_field_sep ErrorManager singletonObject concode_elem_sep String prefix concode_elem_sep Properties properties concode_elem_sep int serialCounter concode_field_sep String generateErrorSerialNumber concode_elem_sep String getErrorName concode_elem_sep String getErrorCode concode_elem_sep Object clone concode_elem_sep void reportError concode_elem_sep void reportError concode_elem_sep void reportError concode_elem_sep void reportError concode_elem_sep String toString concode_elem_sep void main