@Test public void parseLogFolderUuidFallback() throws IOException { String originalFolderName = "a80da2ae-8c85-43b0-a25b-d52319fb6d56"; File logFile = mTemporaryFolder.newFile(originalFolderName); UUID uuid = ErrorLogHelper.parseLogFolderUuid(logFile); assertNotEquals(uuid.toString(), originalFolderName); }
@NonNull public static UUID parseLogFolderUuid(File logFolder) { UUID uuid = null; if (logFolder.isDirectory()) { try { uuid = UUID.fromString(logFolder.getName()); } catch (IllegalArgumentException e) { AppCenterLog.warn(Crashes.LOG_TAG, "Cannot parse minidump folder name to UUID.", e); } } return uuid == null ? UUID.randomUUID() : uuid; }
ErrorLogHelper { @NonNull public static UUID parseLogFolderUuid(File logFolder) { UUID uuid = null; if (logFolder.isDirectory()) { try { uuid = UUID.fromString(logFolder.getName()); } catch (IllegalArgumentException e) { AppCenterLog.warn(Crashes.LOG_TAG, "Cannot parse minidump folder name to UUID.", e); } } return uuid == null ? UUID.randomUUID() : uuid; } }
ErrorLogHelper { @NonNull public static UUID parseLogFolderUuid(File logFolder) { UUID uuid = null; if (logFolder.isDirectory()) { try { uuid = UUID.fromString(logFolder.getName()); } catch (IllegalArgumentException e) { AppCenterLog.warn(Crashes.LOG_TAG, "Cannot parse minidump folder name to UUID.", e); } } return uuid == null ? UUID.randomUUID() : uuid; }  }
ErrorLogHelper { @NonNull public static UUID parseLogFolderUuid(File logFolder) { UUID uuid = null; if (logFolder.isDirectory()) { try { uuid = UUID.fromString(logFolder.getName()); } catch (IllegalArgumentException e) { AppCenterLog.warn(Crashes.LOG_TAG, "Cannot parse minidump folder name to UUID.", e); } } return uuid == null ? UUID.randomUUID() : uuid; }  @NonNull static ManagedErrorLog createErrorLog(@NonNull Context context, @NonNull final java.lang.Thread thread, @NonNull final Throwable throwable, @NonNull final Map<java.lang.Thread, StackTraceElement[]> allStackTraces, final long initializeTimestamp); @NonNull static ManagedErrorLog createErrorLog(@NonNull Context context, @NonNull final java.lang.Thread thread, @NonNull final Exception exception, @NonNull final Map<java.lang.Thread, StackTraceElement[]> allStackTraces, final long initializeTimestamp, boolean fatal); @NonNull static synchronized File getErrorStorageDirectory(); @NonNull static synchronized File getNewMinidumpDirectory(); @NonNull static synchronized File getNewMinidumpSubfolder(); @NonNull static synchronized File getNewMinidumpSubfolderWithContextData(Context context); @NonNull static synchronized File getPendingMinidumpDirectory(); @NonNull static File[] getStoredErrorLogFiles(); @NonNull static File[] getNewMinidumpFiles(); @Nullable static Device getStoredDeviceInfo(File logFolder); static void removeStaleMinidumpSubfolders(); static void removeMinidumpFolder(); @Nullable static File getLastErrorLogFile(); @Nullable static File getStoredThrowableFile(@NonNull UUID id); static void removeStoredThrowableFile(@NonNull UUID id); static void removeStoredErrorLogFile(@NonNull UUID id); @NonNull static ErrorReport getErrorReportFromErrorLog(@NonNull ManagedErrorLog log, String stackTrace); @NonNull static Exception getModelExceptionFromThrowable(@NonNull Throwable t); static Map<String, String> validateProperties(Map<String, String> properties, String logType); static void cleanPendingMinidumps(); @NonNull static UUID parseLogFolderUuid(File logFolder); @VisibleForTesting static void clearStaticState(); }
ErrorLogHelper { @NonNull public static UUID parseLogFolderUuid(File logFolder) { UUID uuid = null; if (logFolder.isDirectory()) { try { uuid = UUID.fromString(logFolder.getName()); } catch (IllegalArgumentException e) { AppCenterLog.warn(Crashes.LOG_TAG, "Cannot parse minidump folder name to UUID.", e); } } return uuid == null ? UUID.randomUUID() : uuid; }  @NonNull static ManagedErrorLog createErrorLog(@NonNull Context context, @NonNull final java.lang.Thread thread, @NonNull final Throwable throwable, @NonNull final Map<java.lang.Thread, StackTraceElement[]> allStackTraces, final long initializeTimestamp); @NonNull static ManagedErrorLog createErrorLog(@NonNull Context context, @NonNull final java.lang.Thread thread, @NonNull final Exception exception, @NonNull final Map<java.lang.Thread, StackTraceElement[]> allStackTraces, final long initializeTimestamp, boolean fatal); @NonNull static synchronized File getErrorStorageDirectory(); @NonNull static synchronized File getNewMinidumpDirectory(); @NonNull static synchronized File getNewMinidumpSubfolder(); @NonNull static synchronized File getNewMinidumpSubfolderWithContextData(Context context); @NonNull static synchronized File getPendingMinidumpDirectory(); @NonNull static File[] getStoredErrorLogFiles(); @NonNull static File[] getNewMinidumpFiles(); @Nullable static Device getStoredDeviceInfo(File logFolder); static void removeStaleMinidumpSubfolders(); static void removeMinidumpFolder(); @Nullable static File getLastErrorLogFile(); @Nullable static File getStoredThrowableFile(@NonNull UUID id); static void removeStoredThrowableFile(@NonNull UUID id); static void removeStoredErrorLogFile(@NonNull UUID id); @NonNull static ErrorReport getErrorReportFromErrorLog(@NonNull ManagedErrorLog log, String stackTrace); @NonNull static Exception getModelExceptionFromThrowable(@NonNull Throwable t); static Map<String, String> validateProperties(Map<String, String> properties, String logType); static void cleanPendingMinidumps(); @NonNull static UUID parseLogFolderUuid(File logFolder); @VisibleForTesting static void clearStaticState(); static final String DEVICE_INFO_FILE; static final String ERROR_LOG_FILE_EXTENSION; static final String THROWABLE_FILE_EXTENSION; @VisibleForTesting
    static final int FRAME_LIMIT; static final int MAX_PROPERTY_ITEM_LENGTH; static final String MINIDUMP_FILE_EXTENSION; }