private Record createRecord(RecordProperties recordProperties) throws RecordException {
  String debugDirectory;
  if (isRecording()) {
    debugDirectory=previousDebugDirectory;
  }
 else {
    debugDirectory=SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_DIRECTORY);
  }
  String recordDirectory=debugDirectory + File.separator + RecordConstants.RECORD_FOLDER_NAME+ File.separator+ recordProperties.getIssueID()+ File.separator+ recordProperties.getReferenceID();
  Record record=new Record(recordProperties,recordDirectory);
  try {
    createFolder(record.getFolderPath());
    PrintWriter printWriterInfo=getPrintWriterForFile(record,RecordConstants.INFO_FILE_NAME);
    JsonValue info=recordReport.infoReport(record);
    try {
      JSONObject json=new JSONObject(info.toString());
      printWriterInfo.println(json.toString(4));
    }
 catch (    JSONException e) {
      debug.warning("Can't indent json '{}'",info,e);
      printWriterInfo.println(info);
    }
    printWriterInfo.flush();
    return record;
  }
 catch (  IOException e) {
    debug.error("Info report can't be initialized for issue '{}'",recordProperties,e);
    throw new RecordException("Info report can't be initialized for issue '" + recordProperties.getIssueID() + "'",e);
  }
}

private Record createRecord ( RecordProperties recordProperties ) throws RecordException { String debugDirectory ; if ( isRecording ( ) ) { debugDirectory = previousDebugDirectory ; } else { debugDirectory = SystemPropertiesManager . get ( DebugConstants . CONFIG_DEBUG_DIRECTORY ) ; } String recordDirectory = debugDirectory + File . separator + RecordConstants . RECORD_FOLDER_NAME + File . separator + recordProperties . getIssueID ( ) + File . separator + recordProperties . getReferenceID ( ) ; Record record = new Record ( recordProperties , recordDirectory ) ; try { createFolder ( record . getFolderPath ( ) ) ; PrintWriter printWriterInfo = getPrintWriterForFile ( record , RecordConstants . INFO_FILE_NAME ) ; JsonValue info = recordReport . infoReport ( record ) ; try { JSONObject json = new JSONObject ( info . toString ( ) ) ; printWriterInfo . println ( json . toString ( 4 ) ) ; } catch ( JSONException e ) { debug . warning ( "Can't indent json '{}'" , info , e ) ; printWriterInfo . println ( info ) ; } printWriterInfo . flush ( ) ; return record ; } catch ( IOException e ) { debug . error ( "Info report can't be initialized for issue '{}'" , recordProperties , e ) ; throw new RecordException ( "Info report can't be initialized for issue '" + recordProperties . getIssueID ( ) + "'" , e ) ; } }
create a new recorddebug
