edu.mit.csail.sdg.alloy4
Class MailBug

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4.MailBug
All Implemented Interfaces:
java.lang.Runnable, java.lang.Thread.UncaughtExceptionHandler

public final class MailBug
extends java.lang.Object
implements java.lang.Thread.UncaughtExceptionHandler, java.lang.Runnable

This class asks the user for permission to email a bug report when an uncaught exception occurs.


Method Summary
static java.lang.String dump(java.lang.Throwable ex)
          This method concatenates a Throwable's message and stack trace and all its causes into a single String.
static java.lang.String latestBuildName()
          If alloy.mit.edu has replied, then return the latest Alloy build name, else return "unknown"
static int latestBuildNumber()
          If alloy.mit.edu has replied, then return the latest Alloy build number, else return -1.
 void run()
          This method will query alloy.mit.edu for the latest version number.
static void setup()
          Setup the uncaught-exception-handler and use a separate thread to query alloy.mit.edu for latest version number.
 void uncaughtException(java.lang.Thread thread, java.lang.Throwable ex)
          This method is an exception handler for uncaught exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

latestBuildNumber

public static int latestBuildNumber()
If alloy.mit.edu has replied, then return the latest Alloy build number, else return -1.


latestBuildName

public static java.lang.String latestBuildName()
If alloy.mit.edu has replied, then return the latest Alloy build name, else return "unknown"


setup

public static void setup()
Setup the uncaught-exception-handler and use a separate thread to query alloy.mit.edu for latest version number.


dump

public static java.lang.String dump(java.lang.Throwable ex)
This method concatenates a Throwable's message and stack trace and all its causes into a single String.


run

public void run()
This method will query alloy.mit.edu for the latest version number.

Specified by:
run in interface java.lang.Runnable

uncaughtException

public void uncaughtException(java.lang.Thread thread,
                              java.lang.Throwable ex)
This method is an exception handler for uncaught exceptions.

Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler