public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
private static void finalizerTimedOut(Object object) { // The current object has exceeded the finalization deadline; abort! String message = object.getClass().getName() + ".finalize() timed out after " + (MAX_FINALIZE_NANOS / NANOS_PER_SECOND) + " seconds"; Exception syntheticException = new TimeoutException(message); // We use the stack from where finalize() was running to show where it was stuck. syntheticException.setStackTrace(FinalizerDaemon.INSTANCE.getStackTrace()); Thread.UncaughtExceptionHandler h = Thread.getDefaultUncaughtExceptionHandler(); if (h == null) { // If we have no handler, log and exit. System.logE(message, syntheticException); System.exit(2); } // Otherwise call the handler to do crash reporting. // We don't just throw because we're not the thread that // timed out; we're the thread that detected it. h.uncaughtException(Thread.currentThread(), syntheticException); } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
defaultSocketFactory = (SocketFactory) sfc.newInstance(); } catch (Exception e) { System.logE("Problem creating " + defaultName, e);
@FindBugsSuppressWarnings("FI_EXPLICIT_INVOCATION") private void doFinalize(FinalizerReference<?> reference) { FinalizerReference.remove(reference); Object object = reference.get(); reference.clear(); try { finalizingStartedNanos = System.nanoTime(); finalizingObject = object; synchronized (FinalizerWatchdogDaemon.INSTANCE) { FinalizerWatchdogDaemon.INSTANCE.notify(); } object.finalize(); } catch (Throwable ex) { // The RI silently swallows these, but Android has always logged. System.logE("Uncaught exception thrown by finalizer", ex); } finally { finalizingObject = null; } } }
public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
public TzDataAndroid(String... paths) { for (String path : paths) { if (loadData(path)) { return; } } // We didn't find any usable tzdata on disk, so let's just hard-code knowledge of "GMT". // This is actually implemented in TimeZone itself, so if this is the only time zone // we report, we won't be asked any more questions. System.logE("Couldn't find any tzdata!"); version = "missing"; zoneTab = "# Emergency fallback data.\n"; ids = new String[] { "GMT" }; byteOffsets = rawUtcOffsets = new int[1]; }
private static void finalizerTimedOut(Object object) { // The current object has exceeded the finalization deadline; abort! String message = object.getClass().getName() + ".finalize() timed out after " + (MAX_FINALIZE_NANOS / NANOS_PER_SECOND) + " seconds"; Exception syntheticException = new TimeoutException(message); // We use the stack from where finalize() was running to show where it was stuck. syntheticException.setStackTrace(FinalizerDaemon.INSTANCE.getStackTrace()); Thread.UncaughtExceptionHandler h = Thread.getDefaultUncaughtExceptionHandler(); if (h == null) { // If we have no handler, log and exit. System.logE(message, syntheticException); System.exit(2); } // Otherwise call the handler to do crash reporting. // We don't just throw because we're not the thread that // timed out; we're the thread that detected it. h.uncaughtException(Thread.currentThread(), syntheticException); } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
private boolean loadData(String path) { try { mappedFile = MemoryMappedFile.mmapRO(path); } catch (ErrnoException errnoException) { return false; } try { readHeader(); return true; } catch (Exception ex) { // Something's wrong with the file. // Log the problem and return false so we try the next choice. System.logE("tzdata file \"" + path + "\" was present but invalid!", ex); return false; } }
@FindBugsSuppressWarnings("FI_EXPLICIT_INVOCATION") private void doFinalize(FinalizerReference<?> reference) { FinalizerReference.remove(reference); Object object = reference.get(); reference.clear(); try { finalizingStartedNanos = System.nanoTime(); finalizingObject = object; synchronized (FinalizerWatchdogDaemon.INSTANCE) { FinalizerWatchdogDaemon.INSTANCE.notify(); } object.finalize(); } catch (Throwable ex) { // The RI silently swallows these, but Android has always logged. System.logE("Uncaught exception thrown by finalizer", ex); } finally { finalizingObject = null; } } }
@FindBugsSuppressWarnings("FI_EXPLICIT_INVOCATION") private void doFinalize(FinalizerReference<?> reference) { FinalizerReference.remove(reference); Object object = reference.get(); reference.clear(); try { finalizingStartedNanos = System.nanoTime(); finalizingObject = object; synchronized (FinalizerWatchdogDaemon.INSTANCE) { FinalizerWatchdogDaemon.INSTANCE.notify(); } object.finalize(); } catch (Throwable ex) { // The RI silently swallows these, but Android has always logged. System.logE("Uncaught exception thrown by finalizer", ex); } finally { finalizingObject = null; } } }