Changes From Version 0.9.6.2 to 0.9.6.3

1. Fixed a bug, introduced by JEP 0.9.6.1, that causes crashes in
   complex Java applets on OS X 10.4 and above.  This bug was a
   side-effect of a workaround for a different problem (caused by a
   change in the behavior of Apple's JVMs in Java 6.0 on OS X 10.4.X
   and J2SE 5.0 on OS X 10.5).  The workaround has now been corrected.

   This change resolves bmo bug 380517.  For more information see
   performOnMainThread_TU() in Handlers.m.

2. Worked around a change in Mozilla.org code that broke
   JavaScript-to-Java LiveConnect in all "trunk" browsers:  The
   nsIScriptSecurityManager interface changed, along with its UID.

   For more information see bmo bug 383783 and search on
   NS_ISCRIPTSECURITYMANAGERNEWERALT5_IID in the MRJ Plugin JEP's
   CSecureEnv.h and CSecureEnv.cpp.

3. Worked around an Apple design flaw that (rarely) causes crashes on
   OS X 10.4 and above.

   These crashes happen when _class_lookupMethodAndLoadCache is called
   simultaneously on two different threads.  I worked around them by
   using usleep() in place of [NSThread sleepUntilDate:].  For more
   information see performOnMainThread and performCEventOnMainThread
   in AppletView.m.

4. Fixed a bug in the JEP's workaround for a long-standing bug in
   Mozilla.org browsers' support for tab-switching (bmo bug 277067),
   which caused switching between two IFrames not to work properly
   when one or both of them contain Java applets.

   This change resolves bmo bug 379058.  For more information see
   JEPMoveAndClipJavaApplet() and [NSAppShadow
   moveAndClipOnMainThread] in Controller.m.

Changes From Version 0.9.6.1 to 0.9.6.2

1. Fixed a seldom-encountered crash bug that was introduced by version
   0.9.6.1 of the Java Embedding Plugin.  The crash happens when a
   Java Thread subclass calls super.run() (or the equivalent) from its
   run() method.

   This change resolves bmo bug 377215.

   For more information see RunnableWrapper.java.

Changes From Version 0.9.6 to 0.9.6.1

1. Changed the "version test" link in the Java Embedding Plugin's
   "about:plugins" display from
   http://www.java.com/en/download/help/testvm.xml to
   http://gemal.dk/browserspy/java.html.

   The java.com test applet no longer works on Java 1.4.X (it's been
   recompiled with the J2SE 5.0 javac compiler).

2. A browser window's minimize button is no longer disabled by loading
   at least one Java applet in the window.  (This happens only in
   Carbon-based browsers (Firefox and Seamonkey), on OS X 10.4 and
   above, and only with JEP 0.9.6.)

   This change resolves bmo bug 369894.

   For more information see HandleDispatcher() in Handlers.m and

   https://bugzilla.mozilla.org/show_bug.cgi?id=369894.

3. Changed the way Java applets' URLs are logged to the system
   console, to avoid problems (including crashes) that can happen if
   the URL inadvertently contains printf escape sequences.  For
   example, if the applet's URL contains "with space", the space will
   be encoded (as "with%20space") -- but "%20s" is a printf escape
   sequence indicating a string, of which at most 20 characters will
   be printed.

   This change resolves
   http://sourceforge.net/forum/forum.php?thread_id=1700130&forum_id=371125.

   Earlier JEP versions used NSLog(), which is a printf-derivative and
   tries to interpret escape sequences like "%20s".  Now the JEP
   converts the UTF16 string containing the applet's URL into a UTF8
   string, and uses puts() on that.  For more information see
   Java_AppletFramePanel_tellAppletCreated() in AppletView.m.

4. The Java Embedding Plugin now sets the maximum heap size (the
   javaplugin.maxHeapSize System property) to 96 MB ("96m") on OS X
   10.4 and above (unless the user has set this value explicitly in
   the Java Control Panel).  The default value for this was (and still
   is) 64 MB.  But Apple's Mac OS X v10.4 Release 5 sets the maximum
   heap size to 96 MB for Safari and other WebKit browsers, so I've
   changed the JEP to conform to this behavior.

   This change resolves
   http://sourceforge.net/forum/forum.php?thread_id=1696451&forum_id=371125.

   For more information see the bottom of initProperties() in
   AppletHandlerFactory.java and the following URL (which I've
   deliberately broken into three lines):

   http://developer.apple.com/releasenotes/Java/Java104R5RN/
     ResolvedIssues/chapter_3_section_2.html
     #//apple_ref/doc/uid/TP40005278-CH3-DontLinkElementID_8

5. Added a workaround for the "Java GIF File Parsing Memory Corruption
   Vulnerability" (CVE-2007-0243).

   Apple has already implemented a partial fix for this problem (for
   its most serious aspects) in "Java for Mac OS X v10.4 Release 5".
   As far as I can tell, this security flaw is no longer exploitable
   on any of Apple's current JVMs.  So my fix isn't urgent.  But it's
   still needed -- since Apple has never released (and perhaps never
   will release) a complete fix.

   For more information see
   Java_sun_awt_image_GifImageDecoder_parseImage_redirect() in
   AppletView.m and

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-CVE-2007-0243
   http://lists.apple.com/archives/Java-dev/2007/Feb/msg00270.html
   http://lists.apple.com/archives/Java-dev/2007/Feb/msg00277.html

6. Fixed a flaw in a previous workaround (for Apple keyboard focus
   bugs) that disables keyboard input in a Java modal dialog on OS X
   10.4 and above.  This resolves bmo bug 360313 comment #1.

   For more information see becomeFirstResponder_FM() in Handlers.m
   and the following URL (particularly comment #1 and following):

   https://bugzilla.mozilla.org/show_bug.cgi?id=360313

7. Resolved a seldom-encountered (and trunk-only) crash bug caused by
   trying to process an invalid NSView object in an NSWindow object
   that has just been dismissed, but is still valid.

   I hadn't realized this could happen -- in fact it might be an Apple
   bug or a browser bug.  But it's easy enough to work around.  This
   change partially resolves bmo bug 374260 (the other, unresolved
   aspects of this bug are due to (other) browser bugs).

   For more information see hookExistingObjects and _setVisible in
   Controller.m.

8. Resolved a bizarre (and seldom encountered) crash bug caused by a
   flaw in a workaround for Apple bugs in the handling of Java modal
   dialogs in Carbon-based browsers:  After you load at least one
   signed Java applet in any browser window, the Page Setup dialog
   will crash when you dismiss it (on OS X 10.4.X (and presumably
   above)).

   My fix resolves
   http://sourceforge.net/tracker/index.php?func=detail&aid=1670831&group_id=107955&atid=649116.

   For more information see _realDoModalLoopForCarbonWindow in
   Controller.m.

9. Fixed an old bug in the MRJPlugin that (very rarely) causes crashes
   when doing Java-to-JavaScript LiveConnect.

   This resolves
   http://sourceforge.net/tracker/index.php?func=detail&aid=1638030&group_id=107955&atid=649116.

   For more information see Java_netscape_javascript_JSObject_call()
   in LiveConnectNativeMethods.cpp.

10. Created a new workaround for bmo bug 312072 -- one that works on
   Mac OS X 10.2.8, and works better on OS X 10.3.X.

   The new workaround uses the same basic strategy as the previous one
   -- it limits the kinds of events that are processed by the JEP
   while it's spinning the main-thread event loop and waiting for a
   Java applet to finish loading.  But now I suspend the workaround
   while a Java modal dialog is active.  This gets rid of the hangs
   that occurred frequently on OS X 10.2.8 and more rarely on OS X
   10.3.X, and thereby allows me to use the workaround on OS X 10.2.8.
   It also still eliminates (or greatly reduces the frequency of) the
   crashes that are caused by bmo bug 312072.

   For more information see the comment above shouldProcessAllEvents
   in AppletView.m and

   https://bugzilla.mozilla.org/show_bug.cgi?id=312072

11. Disabled the "modality" of all Java modal windows and dialogs on OS
   X 10.2.8 and 10.3.X.  The windows and dialogs still display and
   work -- they're just no longer modal.

   Previous JEP versions already disabled the modality of Java modal
   windows in Cocoa-based browsers (i.e. Camino) on OS X 10.2.8 and
   10.3.X, but contained workarounds for problems with Java modal
   dialogs in Carbon-based browsers (Firefox and Seamonkey).  However,
   Apple's implementation of Java modal windows on these OSes is
   crawling with bugs, and there were still some problems that I
   hadn't managed to work around.  I decided that further efforts on
   my part were pointless.  Apple's implementations of Java modal
   dialogs in OS X 10.4.X and above are much better (though still not
   perfect -- see item #8 above).

   For more information see isModal_AWTCW() in Handlers.m.

12. Made several changes to improve the efficiency of the Java garbage
   collector.  The most important of them works around a design flaw
   in Apple's Java SE 6.0 Release 1 Developer Preview 6 and its Java
   6.0 and J2SE 5.0 JVMs on OS X 10.5 (Leopard), which cause the
   following problem -- clicking at least once on a Java applet
   prevents it from being garbage collected!

   For more information see performOnMainThread_TU() in Handlers.m and
   search on DeleteLocalRef in the JEP source.

13. Changed how the Java Embedding Plugin keeps track of "jobs" that
   are running on secondary threads while the JEP is waiting (and
   spinning the event loop) on the main thread.  Earlier versions
   could sometimes end up "waiting" for a job that had already
   finished -- leading to hangs or other strange behavior.  (These
   problems only occurred rarely, and only on OS X 10.4.X and above.)

   For more information see the comments above Java_runningJobs in
   AppletView.m and doProxy() in LiveConnect.java, and search on
   "jobID" in the JEP source code.

14. Added several workarounds for actual and potential memory leaks on
   OS X 10.3.X and 10.2.8.  These are caused by bugs in Apple's JVMs,
   though for some reason they happen more often in Camino than in
   Firefox or Seamonkey.

   Most of the leaks are only "potential" -- an error message appears
   in the system console telling you "Please Attach Debugger : No
   Autorelease pool exists".  But sometimes you'll also see a message
   that something has been "autoreleased with no pool in place - just
   leaking".

   Wherever possible, the JEP now wraps Java run loops with calls to
   AppletHandlerFactory.allocAutoreleasePool() and
   AppletHandlerFactory.releaseAutoreleasePool().  For more
   information, search for these in the JEP source, look at
   RunnableWrapper.java and MySimpleEventQueue.java, and see
   Java_java_lang_Thread_start_redirect(),
   Java_RunnableWrapper_poseAsThread() and
   Java_RunnableWrapper_unposeThreads() (in AppletView.m).

15. Added code to make it less likely that windows a Java applet has
   created will remain open after the applet has been destroyed.  In
   earlier versions of the JEP, these windows were always destroyed
   when an applet's tab or window was closed, but often weren't
   destroyed when the applet's page was reloaded.

   For more information, search on disableChildWindows(),
   disposeChildWindows(), getCurrentAppletFrame() and
   setCurrentAppletFrame() in the JEP source.

16. Changed how Java applets are destroyed, to make it less likely
   that one or more of an applet's threads will remain running after
   this has happened.

   For more information see destroyAppletDirectly2() in
   AppletFrame.java.

17. Substantially improved the EventMunger class in MyEventQueue.java.
   This should reduce the (already low) frequency of hangs on Mac OS X
   10.2.8.

Changes From Version 0.9.5+g to 0.9.6

1. The Java Embedding Plugin now supports accessing the browser's
   cookie store (in Mozilla.org browsers).

   This fix resolves bmo bug 324632, and allows me to remove one of
   the items in my list of "known problems".

   For more information see JEPCookieHandler14X.java and
   JEPCookieHandler150.java, and do a case-insensitive search on
   "cookie" in the JavaEmbeddingPlugin.bundle and MRJ Plugin JEP
   source code.

2. The Java Embedding Plugin now supports automatic proxy
   configuration for Java applets (i.e. PAC files) on Mac OS X 10.3.X
   and above.  The JEP gets its settings from the Network panel in
   System Preferences -- so if you specify a PAC file there, the Java
   Embedding Plugin will run it before trying to load any Java applet.

   For more information see (particularly) the GetWindowAltMessage
   class and MRJGetJSObject() in the MRJ Plugin JEP's
   LiveConnectNativeMethods.cpp.

   The JEP doesn't support automatic proxy configuration on Mac OS X
   10.2.8 -- since that OS has no built-in support for PAC files.

   This fix will (I hope) resolve bmo bug 347413.

3. The Java Embedding Plugin now supports Java SE 6.0 (which is
   available for Mac OS X 10.4.X).

   This fix resolves the following bug report:
   http://sourceforge.net/tracker/index.php?func=detail&aid=1540289&group_id=107955&atid=649116

   Adding support for Java 6.0 required many changes to JEP code.  For
   more information search on "Java 1.6.0", "1.6.0", "160" and "Java
   SE 6".

4. The Java Embedding Plugin now works correctly with Mac OS X Leopard
   (10.5) -- at least with the builds that Apple has made available to
   Apple Developer Connection subscribers.

   For more information search on "Leopard" and "10.5" in the JEP
   source code.

5. Found an alternative to using Apple's buggy mouse and keyboard
   event handlers for its Cocoa-Carbon interface.  At one fell swoop
   this fixes a lot of bugs in Apple's Cocoa-Carbon interface (though
   unfortunately not all of them).  It also means that I've been able
   to eliminate a lot of hackish workarounds for the now vanished
   bugs, which should hopefully make the Java Embedding Plugin more
   robust and trouble-free.

   This change resolves (or helps resolve) the following bmo bugs:

   a. Bug 347039 -- Key equivalents not processed as menu events after
      loading Java.
   b. Bug 347391 -- After loading Java, Flash IME fails in the same
      window.  (Other changes to TSM document handling also helped.)
   c. Bug 352948 -- Apple's buggy handlers cause a spurious (but
      benign) error message to be displayed repeatedly in the system
      console whenever you use a Mighty Mouse's scroll ball or do
      two-fingered scrolling (on a laptop trackpad) in OS X 10.4.X.

   For more information see (particularly) CreateNSEvent() in
   Handlers.m.

6. Fixed a problem with a previous fix (for bugs in Apple's
   Cocoa-Carbon interface) that prevented input in "password fields"
   in Java applets.

   This problem was introduced in JEP 0.9.5+g.  The fix for it
   resolves bmo bug 353160.  JEP 0.9.5+g+2 contained a different fix
   for this problem, in NSApplication sendEvent in Controller.m.  But
   now that the JEP is no longer using Apple's buggy mouse and
   keyboard handlers for its Cocoa-Carbon interface (see item #5 in
   this list), I've been able to eliminate the "previous fix"
   completely (since the problem it solved went away with Apple's
   buggy event handlers).

7. Fixed an old bug in the Java Embedding Plugin that prevented dead
   keys from working in a Carbon-based browser's window after at least
   one Java applet had been loaded in it.  (Examples of Carbon-based
   browsers are Firefox and Seamonkey.)

   This fix resolves bmo bug 347041.  It was also included in JEP
   0.9.5+g+2.  For more information see (particularly) the comment
   above "currentActiveDoc = TSMGetActiveDocument()" in HandleAETSM()
   in Handlers.m.

8. Worked around recent changes (on the trunk) to Mozilla.org
   browsers that broke JavaScript-to-Java LiveConnect.  (Changes to
   the UUID for the nsIScriptSecurityManager interface, used by the
   MRJ Plugin JEP.)

   This resolves bmo bug 350664.

9. Added code to explicitly make a Java applet visible after it has
   finished loading (after its start() method has been called).  This
   makes it less likely that an applet will still be invisible
   (totally or partially) after it has finished loading.

   For more information see maybeStartAppletOnMainThread in
   Controller.m.

10. Added an extra layer between the JEP's Objective-C code and its
   Java code (the AppletHandler class).  This was needed to make Java
   garbage collection work on Java SE 6.  I also renamed several Java
   classes to (hopefully) make the new class hierarchy easier to
   understand.  For more information see (particularly)
   AppletHandler.java.

   Java garbage collection is still pretty badly broken in Apple's
   Java SE 6 (even in Safari, and particularly when using
   LiveConnect).  Since Safari is effected, Apple may fix the
   problem(s).

11. Changed the way Java-to-JavaScript LiveConnect calls are processed.
   The new procedure is much faster, and also avoids hangs that would
   have prevented me from adding support for automatic proxy
   configuration.

   I've stopped using nsIJVMThreadManager::PostEvent(), and instead
   use JEPRunOnMainThread() to pass Java-to-JavaScript calls to a new
   class in JavaEmbeddingPlugin.bundle (CEvent) that has its own
   dedicated "run loop source".

12. Worked around a bug in the versioning of Apple's "Java plugin"
   (JavaPluginCocoa.bundle) in Apple's first JVM for Intel Macs, which
   caused crashes when running with the default settings in that JVM
   with JEP 0.9.5+f and 0.9.5+g (and 0.9.5+g+2).

   In that first Intel-Mac JVM (unlike its PPC counterpart),
   JavaPluginCocoa.bundle's CFBundleShortVersionString was the same
   for both Java 1.4.2 and Java 1.5.0.  This caused earlier JEP
   versions to assume that the user had chosen Java 1.5.0.  But if the
   user had actually chosen Java 1.4.2 (which was the default), the
   JEP would crash in JavaPluginCocoa.bundle's registerNatives().
   (Earlier JEP versions simply always ran Java 1.5.0.)

   One workaround is to upgrade to Apple's latest JVM, which doesn't
   have this problem.  But now the JEP knows how to extract the
   correct version information from Apple's first Intel-Mac
   JavaPluginCocoa.bundle by other means.  This workaround resolves
   bmo bug 355637 (and probably also several other bmo bugs).

   For more information see checkBundle in Controller.m.

13. Toned down a workaround for strange behavior that happens when (in
   a Carbon-based browser like Firefox) a JVM-created window is active
   (and topmost) and you choose one of several menu commands (Quit,
   About, New Window or New Tab).  (These problems are bugs in Apple's
   Cocoa-Carbon interface.)

   The JEP now only works around the worst of these bugs (which happen
   when you choose Quit, and which can cause crashes).  As a result,
   my workarounds no longer have the bad side effects reported at
   http://sourceforge.net/tracker/index.php?func=detail&aid=1560855&group_id=107955&atid=649116.
   (Windows and menus popped up by Java applets were minimized when
   you chose a command from one of those menus.)

   For more information see HandleApp() in Handlers.m.

14. Narrowed the scope of a fix for problems with JavaScript windows
   that are popped up from Java applets, to fix a different problem
   with URLs invoked from Java applets (both problems are very
   obscure).

   This fix resolves bmo bug 356866.  For more information see
   waitForActivePopupClose() in AppletView.m.

15. Worked around an Apple bug that occasionally causes the following
   message to appear in the system console (not the Java Console):

   Attempt to call non-applicable method "keyCode" on SyntheticEvent!

   For more information see keyCode_SE() in Handlers.m.

16. Made some changes changes to avoid hangs and crashes (particularly
   hangs/crashes on exit) in Mac OS X 10.4.X and higher.

   a. Made processCustomEventSpool and processCEventSpool (in
      AppletView.m) not dispatch events when the browser is
      terminating.
   b. Made performOnMainThread() and performCEventOnMainThread() (in
      AppletView.m) stop waiting for a task to finish when the browser
      is terminating.
   c. Made the code in Controller.m that locks controllerArray
      release those locks more quickly, and do less while the locks
      are held.  Generally these methods now copy controllerArray,
      unlock it, and work on the copy.  This makes deadlocks less
      likely.

17. Changed how updates are handled in Carbon-based browsers
   (e.g. Firefox) to avoid occasional crashes when a browser window is
   closed that contains many Java applets (especially if some of the
   applets are still loading).

   These crashes usually happened in CallNextEventHandler() in
   Handlers.m's HandleWindow(), and were more likely on OS X 10.4.X
   (and above), and in Firefox 2.0.  My change was to prevent updates
   from being processed while a window is closing.  For more
   information see HandleWindow() in Handlers.m (particularly the
   kEventWindowHidden case), windowWillClose (in Controller.m) and
   handleCarbonUpdate (in Controller.m).

18. Improved the code that checks for invalid pointers (to plugin
   objects) passed in from Mozilla.org browsers.  This helps avoid
   occasional crashes in the MRJContext class of the MRJ Plugin JEP.

   For more information see MRJPluginInstance::isValidInstance() (in
   the MRJ Plugin JEP's MRJPlugin.cpp) and isControllerValid (in
   JavaEmbeddingPlugin.bundle's Controller.m).

19. Fixed a problem where (under very unusual circumstances) Java
   applets that had been made invisible were (inappropriately) made
   visible again when the browser page that contained them was
   resized.

   I only know of one case of this (http://194.65.135.122/, an
   electronics parts vendor) -- which seems to roll its own tabs, and
   to put an applet in each "tab".  To see the problem using earlier
   versions of the JEP, load this page in a Carbon-based browser (like
   Firefox) and switch from the "Hierarchia" tab to either the
   "Favoritas" or "Pesquisas" tab, then resize the page.

   For more information see NSAppShadow resetHybridView (in
   Controller.m) and the comment above setFrame in AppletView.m.

20. Fixed a problem with the handling of JavaScript-to-Java calls on
   Mac OS X 10.4.X and higher -- sometimes processing (on the main
   thread) continued before these calls (which are processed on
   secondary threads) had returned.

   For more information see Java_processMainThreadEvents(),
   Java_beforeProcessing() and Java_stopProcessing() in AppletView.m,
   and how these are now used in LiveConnect.java.

21. Further optimized the initial JavaScript call to one of a Java
   applet's methods, to avoid serious delays on Mac-Intel versions of
   OS X.

   The first Java-to-JavaScript call on a Java applet can result in
   thousands of other Java-to-JavaScript calls being made, as the
   browser "reflects" all of the applet's methods.  And on Mac OS X
   10.4.X (and above), potentially each of these calls needs to be
   made on another thread, while the browser is waiting on the main
   thread (leading to delays of 30 seconds or more on a PPC Mac, and
   delays of several minutes on an Intel Mac).  Previous JEP versions
   already contained optimizations that caused many of these calls to
   run on the main thread (instead of on secondary threads), and this
   was enough to reduce the worst-case delay to 3-4 seconds on a PPC
   Mac.  But (for reasons that are unclear) delays of 30 seconds or
   more were still possible on an Intel Mac (especially after the fix
   for item #20 above).  The additional optimizations cause _all_ of
   the initial Java-to-JavaScript calls to run on the main thread,
   which reduces the worst-case delay to 3-4 seconds even on an Intel
   Mac.

   For more information see the comment above CallMethodMessage::
   initializeMessage() in the MRJ Plugin JEP's CSecureEnv.cpp, and bmo
   bug 191035, comments 14 and 15.

22. Added support for the "style" attribute in APPLET or OBJECT tags
   (in the HTML code that loads a Java applet).

   For more information see fixAttributes in Controller.m.

Changes From Version 0.9.5+f to 0.9.5+g

1. Fixed a (very old) JEP bug that disabled IME input (e.g. Chinese
   and Japanese language input) or Unicode-based keyboard layouts
   (e.g. US Extended, Arabic, Greek, Hebrew) in Mozilla.org
   Carbon-based browsers (i.e. Firefox and SeaMonkey), if none of the
   windows into which you'd loaded at least one Java applet was still
   open.

   In recent trunk and 1.8 branch builds (those that obtain keystrokes
   from the TSM kUnicodeNotFromInputMethod event and have a fix for
   bug 344701), this bug can disable all keyboard input.

   This fix resolves the bug described in bmo bug 344701's comments 6
   through 8.  For more information see HandleAETSM() in Handlers.m
   and:

   https://bugzilla.mozilla.org/show_bug.cgi?id=344701#c8

2. Fixed a bug (introduced in JEP 0.9.5+e) that caused keyboard
   shortcuts to sometimes be acted on twice in Mozilla.org
   Carbon-based browsers.  For example, pressing Command+T would
   sometimes cause two tabs to be opened in the current browser
   window, and pressing Command+W would sometimes cause two tabs to be
   closed.

   This fix resolves bmo bug 344249.  For more information search on
   "344249" in Handlers.m and see:

   https://bugzilla.mozilla.org/show_bug.cgi?id=344249

3. Fixed problems with several workarounds for bugs in Apple's
   Cocoa-Carbon interface.  All of these workarounds tried to ensure
   that a browser window becomes active when it's supposed to.  But
   some of them didn't always work correctly -- for example sometimes
   causing a browser window not to activate when you clicked on its
   content area (only when you clicked on its title bar).

   These fixes resolve bmo bug 344006.  For more information search in
   Handlers.m on "344006" and "SelectWindow" and see:

   https://bugzilla.mozilla.org/show_bug.cgi?id=344006

4. Fixed a bug (introduced in JEP 0.9.5+e) that prevented raw keyboard
   events from getting to the browser in recent trunk and 1.8 branch
   builds of Carbon-based Mozilla.org browsers (i.e. Firefox and
   SeaMonkey).

   This fix resolves bmo bug 344153.  For more information search on
   "344153" in Handlers.m and see:

   https://bugzilla.mozilla.org/show_bug.cgi?id=344153

   It's not yet clear what symptoms this fix clears up -- it didn't
   cause browser keyboard input to fail (recent trunk and 1.8 branch
   builds obtain keystrokes from the TSM kUnicodeNotFromInputMethod
   event, instead of from raw keyboard events).

5. Fixed a number of JEP bugs that sometimes resulted in keyboard
   input being temporarily disabled in Java applets when switching
   between windows in Carbon-based browsers.

   For more information see "case kEventWindowDeactivated" in
   HandleWindow() and becomeFirstResponder_FM() (both in Handlers.m).

6. Added special handing for the minimize button (aka the "collapse
   box") in Carbon-based browsers, to reduce or eliminate the
   following odd problem with Apple's Cocoa-Carbon interface:
   Sometimes when you minimize a window to the Dock, it bounces right
   back again.

   For more information search on "collapse box" in Handlers.m.

Changes From Version 0.9.5+e to 0.9.5+f

1. Fixed a bug in the Java Embedding Plugin that sometimes causes the
   browser window to be deactivated, and which has some very strange
   side effects on menus (one of which is a crash bug).  This bug only
   effects Carbon-based browsers (e.g. Firefox and Seamonkey).

   JEP 0.9.5 introduced a workaround for an Apple bug that sometimes
   causes trouble switching between multiple browser windows in a
   Carbon-based browser (yet another of Apple's Cocoa-Carbon interface
   bugs).  But the workaround didn't distinguish between browser
   windows and other kinds of windows (e.g. menus).  So it would
   sometimes incorrectly deactivate the current browser window.

   This fix resolves bmo bug 341234, and at least partially resolves
   bmo bug 320998 (which is a topcrasher).

   For more information search on "kWindowActivationScopeAll" in
   Handlers.m and see:
   https://bugzilla.mozilla.org/show_bug.cgi?id=320998
   https://bugzilla.mozilla.org/show_bug.cgi?id=341234

2. The Java Embedding Plugin now defaults to Java 5.0/1.5 on OS X
   10.4.X (when used with Apple's J2SE 5.0 Release 4) if the user
   hasn't specified a Java version (using the "Java Preferences"
   application).

   JEP 0.9.5+e defaulted to Java 1.4.2 -- which doesn't conform to
   Safari's behavior and which therefore caused some confusion.

   For more information see JEPController checkBundle (in
   Controller.m) and:
   https://bugzilla.mozilla.org/show_bug.cgi?id=342997

3. Worked around an Apple bug that sometimes causes crashes in
   low-level graphics "primitives" on Java 1.4.2 from J2SE 5.0 Release
   4 on OS X 10.4.X.

   For more information see the comment above the definition for
   SurfaceDataBounds in AppletView.m.

4. Changed the behavior of some JavaScript-to-Java LiveConnect calls
   on OS X 10.4.X, so that as many of these calls as possible run on
   the event queue of a particular applet, instead of on a generic
   LiveConnect event queue.

   Earlier JEP versions made all these calls run on the LiveConnect
   event queue.  But this had some odd side effects, including at
   least one case of a JTextPane object not accepting keyboard input
   if it had been created on the LiveConnect event queue.

   For more information see LiveConnect.java.

Changes From Version 0.9.5+d to 0.9.5+e

1. The Java Embedding Plugin's binaries are now provided both as
   universal binaries and as PPC-only binaries.

   Older Mozilla.org browsers (e.g. Firefox 1.0.8, Mozilla 1.7.13 and
   Camino 0.8.5) can't load universal-binary plugins.

2. Fixed a JEP bug that caused a crash when you use Apple's Java
   Console.  This fix resolves bmo bug 331190.

   For more information see JEPController saveParentTSMState (in
   Controller.m) and the following:
   https://bugzilla.mozilla.org/show_bug.cgi?id=331190

3. Worked around a crash bug (Intel only) caused by Mozilla.org's
   renaming of one of the XPCOM interfaces used by the MRJ Plugin JEP
   (nsIThreadManager was renamed to nsIJVMThreadManager in recent
   trunk nightlies).

   For more information see nsjvmFixes.h and the following:
   https://bugzilla.mozilla.org/show_bug.cgi?id=338685
   https://bugzilla.mozilla.org/show_bug.cgi?id=326273

4. Added a workaround for bmo bug 277067, which causes ghost images to
   be displayed while switching tabs in Mozilla.org browsers (item #C1
   in KnownProblems.txt).

   For more information see the comment above willZeroClip in
   AppletView.m's setClip and
   https://bugzilla.mozilla.org/show_bug.cgi?id=277067.

5. Significantly improved the Java Embedding Plugin's workarounds for
   Mozilla.org's browsers' "spurious updates" problems (item #C2 in
   KnownProblems.txt).  These changes seem to resolve bmo bug 333003.

   For more information see JEPController handleCarbonUpdate (in
   Controller.m), HandleWindow() (in Handlers.m), HandleApp() (in
   Handlers.m), setNeedsDisplayInRect (in Controller.m), _drawRect
   (in Controller.m) and the following:
   https://bugzilla.mozilla.org/show_bug.cgi?id=333003

6. Fixed a seldom-encountered crash bug in applets that use a
   ScrollPane object, by changing my earlier workaround (added in JEP
   0.9.5+d) for a bug in how Apple's JVM handles these objects.  This
   resolves bmo bug 338738.

   For more information see reflectScrolledClipView_AWTSV() in
   Handlers.m and the following:
   https://bugzilla.mozilla.org/show_bug.cgi?id=338738

7. Worked around a change in Apple's versioning policy and fixed
   design flaws in the Java Embedding Plugin to make it easier to
   switch between Java versions 5.0 and 1.4.2 on OS X Tiger.

   a) With J2SE 5.0 Release 4, Apple changed how their
      JavaPluginCocoa.bundle (in /Library/Internet Plug-Ins/)
      determines which Java version gets used by Java applets.  As a
      result, earlier versions of the Java Embedding Plugin (e.g. JEP
      0.9.5+d) always ran Java 5.0 when used with J2SE 5.0 Release 4,
      regardless of the setting for "Plugin Version" in the Java
      Control Panel.  I've now added code to accomodate Apple's
      change.

      For more information see JEPController checkBundle.

   b) It's now possible to change your Java version by changing which
      directory the CurrentJDK soft link points to (in /System/
      Library/Frameworks/JavaVM.framework/Versions/), without crashing
      the Java Embedding Plugin.  Apple still does _not_ support this,
      and I don't recommend it.  But the JEP itself no longer prevents
      you from doing so.

      I changed the JEP's code to explicitly specify the Java version
      number in directory names.  For more information see
      JEPController checkBundle and AppletView maybeCreateJavaVM.

8. Worked around or fixed several bugs to improve LiveConnect
   functionality.

   a) The OJI interface has a design flaw that sometimes makes it
      difficult to determine which "plugin instance" a
      Java-to-JavaScript call "belongs" to.  Because of this, previous
      versions of the MRJ Plugin were unable to process calls to
      methods (for example call() or eval()) of a JSObject object that
      wasn't created using the JSObject.getWindow() method.  JEP
      0.9.5+e contains a workaround, which resolves bmo bug 329457.

      For more information see the comment above PushJS2JInfo() in
      JNIUtils.java and calls to CurrentJS2JPluginInstance() in
      LiveConnectNativeMethods.cpp, plus the following:
      https://bugzilla.mozilla.org/show_bug.cgi?id=329457

   b) Improved the handling of JavaScript-to-Java and
      Java-to-JavaScript calls that are "nested" under
      JavaScript-to-Java calls, especially on OS X 10.4.X (Tiger).
      This resolves problems using the URL at bmo bug 329457 that
      weren't actually reported there.

      For more information see the comments above nestingLevel in the
      MRJ Plugin JEP's CSecureEnv.cpp and above nestedDoProxy() in
      JavaEmbeddingPlugin.bundle's LiveConnect.java.

9. Worked around bugs in Apple's JVMs' support for modal windows on OS
   X 10.3.9 and 10.2.8, which prevent mouse clicks from working in a
   modal window's child windows.  This resolves the following bug:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1456457&group_id=107955&atid=649116

   For more information see HandleDispatcher() in Handlers.m.

10. Fixed a seldom-encountered bug that only effects OS X 10.3.9 --
    sometimes an applet won't update properly after you click (or
    click-drag) elements within it.  This fix resolves bmo bugs 302843
    and 335804.

    For more information see the comment above the line that contains
    "apple.awt.graphics.EnableLazyDrawing" in
    AppletHolderFactory.java's initProperties() and the following:
    https://bugzilla.mozilla.org/show_bug.cgi?id=302843
    https://bugzilla.mozilla.org/show_bug.cgi?id=335804

11. Found a new way to set the keyboard focus in Java applets running
    in a Carbon-based browser.  This makes it less likely that the
    JEP's event handlers will be configured for a Cocoa keyboard focus
    (i.e. one that's in an applet) when the keyboard focus is actually
    somewhere in the browser (outside of any Java applet).  (When this
    happens the browser doesn't receive keystrokes.)

    For more information see the comment above
    becomeFirstResponder_FM() in Handlers.m.

12. Worked around bugs in how Apple handles Carbon-modal dialogs
    running above Cocoa windows.

    For more information see the comment above "focusedWindow =
    GetUserFocusWindow()" in HandleDispatcher() (in Handlers.m) and
    search on "carbonModal" in JavaEmbeddingPlugin.bundle code.

13. Changed how Carbon events are "redispatched" to the browser (to
    prevent them from being swallowed by Apple's handlers for its
    Cocoa-Carbon interface).  My new method causes these events to be
    "redispatched" to fewer handlers, which in principle should avoid
    future problems (especially as Mozilla.org changes its event
    handling in future versions of its Carbon-based browsers).

    For more information search on "redispatchToAll" in Handlers.m's
    HandleDispatcher().

14. Worked around bad interactions between Apple's Cocoa-Carbon
    interface and Mozilla.org's use of some menu commands.  (For
    example, strange things used to happen if you chose "Quit" or
    "About" from the browser menu while a Cocoa window (popped up by
    the JVM or a Java applet) was topmost.)

    For more information see the "if (class == kEventClassCommand)" of
    HandleApp() in Handlers.m.

Changes From Version 0.9.5+c to 0.9.5+d

1. The Java Embedding Plugin distro's binaries are now "universal" --
   they will work on either older Macs with PPC CPUs or newer ones
   with Intel CPUs.

   A number of changes were needed to make this possible, all of which
   were pointed out to me by Mark Mentovai of Mozilla.org, and used in
   his "fat JEP" patches.  (Camino 1.0 and recent DeerPark nightlies
   already include Mark's universal binary patch of JEP 0.9.5+c.  See
   https://bugzilla.mozilla.org/show_bug.cgi?id=327785).  Thanks,
   Mark!

   a) Apple's new version of Sun's standard JNI include file (jni.h)
      now produces very different results on the PPC and Intel
      platforms -- all the JNI APIs are at different offsets (within a
      structure).  To account for this, the MRJ Plugin JEP now
      includes the new jni.h (for both platforms).

   b) Calls to objc_msgSend_stret() don't compile correctly on the
      Intel platform.  So I ended up replacing all these calls (there
      were five or six of them), plus many others that didn't use
      standard Objective C syntax.  I used Objective C "categories" to
      make this possible (as Mark has also done in his JEP patches).
      See Controller.h.

   c) JNI_GetCreatedJavaVMs() can return bogus JVMs if there has ever
      been a failed call to JNI_CreateJavaVM() (possibly only when
      running under Rosetta).  This led to crashes when people ran
      PPC-only JEP binaries under Rosetta.  Now (on both platforms)
      the JEP uses a global flag to record whether or not any of its
      calls to JNI_CreateJavaVM() has failed.  If so, it never calls
      JNI_GetCreatedJavaVMs().  See maybeCreateJavaVM in AppletView.m.

2. Changed the MRJ Plugin JEP to accomodate a recent change in
   Mozilla.org's CAPS security interface -- one that breaks the MRJ
   Plugin JEP's JavaScript-to-Java LiveConnect support in recent
   "trunk" nightlies.

   See https://bugzilla.mozilla.org/show_bug.cgi?id=293973#c20,
   CSecureEnv.h and CSecureEnv.cpp.

3. Fixed a couple of bugs in the JEP that sometimes caused spurious
   access-violation errors (in the Java console).  These problems
   happened when the JEP tried to load (i.e. to access for the first
   time) privileged classes and class methods while running in the
   (relatively non-privileged) security context of a Java applet.

   The solution was to pre-load these classes and methods -- i.e. to
   load them before any applet has been created, while the JEP is
   still running with full permissions.  See initProperties() in
   AppletHolderFactory.java.

4. Worked around a bug in Apple's JVMs that caused Java ScrollPane
   objects not to work properly when scrolled -- the content's
   clipping wasn't updated as it was scrolled, so that "newer" content
   didn't become visible as it was scrolled into view.

   This resolves the reproduceable part of the following bug report:
   http://sourceforge.net/tracker/index.php?func=detail&aid=1438338&group_id=107955&atid=649116.

   For more information see reflectScrolledClipView_AWTSV() and
   _setNativeFrame_CM() in Handlers.m.

5. Fixed a bug in the JEP that caused an applet's start() method never
   to be called if it had non-zero HTML "width" and "height", but
   never became visible (even partly).

   This resolves the following two bug reports:
   http://sourceforge.net/tracker/index.php?func=detail&aid=1438179&group_id=107955&atid=649116
   https://bugzilla.mozilla.org/show_bug.cgi?id=328466

   Fixing this bug required a fairly substantial design change --
   older JEP versions only called an applet's start() method the first
   time it (or part of it) became visible (if the applet's "width" and
   "height" were non-zero).  For more information see the comment
   above startApplet in AppletView.m.

6. Fixed a JEP bug that could (under unusual circumstances) cause a
   crash while using one of the (Japanese) Kotoeri input methods
   (including Romaji).

   This resolves the reproduceable part of bugzilla.mozilla.org bug
   318677 (of which the crash reported in bmo bug 329457 is probably a
   duplicate).  See:
   https://bugzilla.mozilla.org/show_bug.cgi?id=318677
   https://bugzilla.mozilla.org/show_bug.cgi?id=329457

   And see the comment above createDummyTextViewImpl in Controller.m.
   This fix also required a fairly large design change.

7. Fixed a JEP bug that caused Java applet components that had been
   explicitly disabled (using Component.setEnabled(false)) to be
   re-enabled.

   This fix resolves the reproduceable part of this bug report:
   http://sourceforge.net/forum/forum.php?thread_id=1448187&forum_id=371125

   As often happens, this bug was a side-effect of a fix intended to
   get around other bugs -- ones in the popular map24.com applets.  I
   toned down the map24.com fixes to get around this bug.  For more
   information see enableDisabledComponents() in SimpleLayout.java.

8. Fixed a JEP bug that, under very unusual circumstances, caused the
   JEP (and the browser) to hang:  The JEP would hang if (in a
   Carbon-based browser like Firefox) a Java applet popped up a window
   (e.g. it created and displayed a JFrame object) and called
   AppletContext.showDocument() from that window.

   This fix resolves the reproduceable part of this bug report:
   https://bugzilla.mozilla.org/show_bug.cgi?id=311843.

   For more information see waitForActivePopupClose() in AppletView.m.

9. Tightened up an existing fix (for a Cocoa-Carbon interface bug)
   that itself (rarely) caused odd problems.

   This fix-of-a-fix resolves
   https://bugzilla.mozilla.org/show_bug.cgi?id=320380.

   The existing fix (and its tightened-up successor) compensate for
   the following problem:  It's standard behavior for certain Cocoa
   controls (e.g. buttons) to swallow mouse-up events corresponding to
   mouse-down events received by those controls.  But this _isn't_
   standard behavior in a Carbon environment, and can cause all sorts
   of nasty problems.

   For more information see the comment below
   SendEventToEventTargetWithOptions() in Handlers.m's
   HandleDispatcher().

10. Worked around a probable Apple bug that (very rarely) caused
   crashes in Camino.

   This fix resolves the crashes that I reported at
   https://bugzilla.mozilla.org/show_bug.cgi?id=326195.  It's not
   clear that anyone else has ever reported these crashes, though
   bugzilla.mozilla.org bug 325987 is a possible dup.

   My crashes turn out not to have been caused by Apple's new CoreText
   framework, or to have been (completely) fixed by (re)applying
   Apple's latest Combo updates (for 10.4.4 or 10.4.5).  I suspect the
   actual cause is one or more bugs in Apple's OS X 10.4
   CFPreferences/NSUserDefaults code.  For more information see the
   comment above the call to resetStandardUserDefaults in
   AppletView.m's maybeCreateJavaVM.

Changes From Version 0.9.5+b to 0.9.5+c

1. Worked around a bad interaction between the Java Embedding Plugin
   and Apple's newest trackpad and Mighty Mouse drivers, which stopped
   these devices from working properly in Mozilla.org's Carbon-based
   browsers (Firefox, Seamonkey and the Mozilla suite) once a Java
   applet had been loaded on OS X 10.4.X.

   This workaround resolves bugzilla.mozillz.org bug 309344.  Search
   on kEventMouseScroll in Handlers.m and see:

   https://bugzilla.mozilla.org/show_bug.cgi?id=309344
   https://bugzilla.mozilla.org/show_bug.cgi?id=319078

2. Largely worked around a bad interaction between the Java Embedding
   Plugin and Mozilla.org's "frame" code, which can cause crashes in
   any Mozilla.org browser.  (The workaround works on OS X 10.4.X and
   10.3.X, but not 10.2.8.)

   See the comment above postJEPSendingEventsStartedNotification in
   AppletView.m and:

   https://bugzilla.mozilla.org/show_bug.cgi?id=312062
   https://bugzilla.mozilla.org/show_bug.cgi?id=315111#c13
   https://bugzilla.mozilla.org/show_bug.cgi?id=324281

3. Worked around a bug in Apple's implementation of Java popup menus
   on OS X 10.3.X and 10.4.X, which caused them not to close when you
   click outside them in a Mozilla.org Carbon-based browser (Firefox,
   Seamonkey or the Mozilla Suite).

   This resolves bugzilla.mozilla.org bug 318424.  See the comment
   about the PopuInfo class in Controller.m and:

   https://bugzilla.mozilla.org/show_bug.cgi?id=318424

4. Several minor bugfixes and workarounds.

Changes From Version 0.9.5+a to 0.9.5+b

1. Fixed a bug in the Java Embedding Plugin that disables keyboard
   input in Carbon browsers (such as Firefox and the Mozilla suite)
   when using any Unicode keyboard layout.  Examples are US Extended,
   Arabic, Hebrew and Greek.  All such keyboard layouts have a Unicode
   "input type" in the International control panel.

   For more information see HandleAETSM() in Handlers.m and
   https://bugzilla.mozilla.org/show_bug.cgi?id=313807.  This bug
   doesn't effect "input methods" (such as are used to input Chinese
   or Japanese text).

2. Fixed a couple of other bugs that could, under unusual
   circumstances, disable keyboard input from any keyboard:

   a. Worked around an Apple bug that sometimes disables keyboard
      input in Carbon browsers after using a Command+key combination
      (for example Command+t to open a new tab).

      For more information see HandleDispatcher() in Handlers.m.

   b. Fixed a bug in the Java Embedding Plugin that sometimes causes
      it to become confused (in Carbon browsers) about which applet is
      focused, when several applets are loaded in different tabs in
      the same browser window.

      For more information see JEPController showHideAppletImpl in
      Controller.m and AppletView setClip in AppletView.m.

Changes From Version 0.9.5 to 0.9.5+a

1. Fixed a bug in the Java Embedding Plugin, that, under unusual
   circumstances, causes Cocoa browsers (like Camino) to hang on exit
   in Mac OS X 10.4.X.

   The hang occurs when you exit the browser and the current page
   happens to contain an applet that failed to load.  It was caused by
   redundant calls to JEPController windowWillClose.  For more
   information see JEPController applicationWillTerminate.

2. Fixed a version 0.9.5 regression in the Java Embedding Plugin that
   causes wierdness on Mac OS X 10.4.X when changing to or from pages
   that contain applets:  Often the page doesn't update until you move
   the mouse.

   For more information see Java_processMainThreadEvents() in
   AppletView.m.

3. Added a few more workarounds for rarely encountered crashes that
   happen when you switch rapidly between pages that contain lots of
   applets.  All of these crashes are caused by Apple's JVM trying to
   access objects that have already been deleted.

   For more information see syncFromJava_AWTCAW() and
   viewBecameKey_FM() in Handlers.m.

Changes From Version 0.9.4 to 0.9.5

(Includes changes from 0.9.4 to 0.9.4+a)

1. Fixed three different problems which (rarely) caused keyboard input
   to be disabled outside of applets in Carbon-based browsers (like
   Firefox, SeaMonkey and the Mozilla Suite).

   a. Worked around a bug in Apple's Cocoa-Carbon interface.  See
      NSAppShadow showURLOnMainThread in Controller.m and
      HandleDispatcher() in Handlers.m

   b. Fixed a bug in the Java Embedding Plugin that sometimes caused a
      Cocoa input context to be set where a Carbon input context was
      needed.  See JEPController routeEvent in Controller.m

   c. Added code to work around the effects of changes caused by the
      fix for Bugzilla bug 298961 (which was incorporated in Firefox
      1.5 Beta 2).  See AppletView setClip (in AppletView.m).

   The workaround for the first of these three problems fixes the
   following bug:

   https://bugzilla.mozilla.org/show_bug.cgi?id=298216

2. Fixed or worked around several problems which tended to cause
   crashes while rapidly switching among pages containing lots of
   applets, or while quitting the browser if the current page
   contained lots of applets:

   a. Postpone releasing JEPController and AppletView objects -- see
      cleanup_AWTCAW() and cleanup_AWTCE() in Handlers.m.

   b. Check more aggressively (on OS X 10.2.8) for attempts (from code
      in Apple's JVM) to display objects that have been deleted -- see
      MyNSWindow displayIfNeeded in Controller.m.

   c. Disable buggy code in Apple's JVM that tends (on OS X 10.2.8 and
      10.3.X) to cause crashes as an applet is dynamically resized --
      see viewDidEndLiveResize_AWT() and viewDidEndLiveResize_AWTWV()
      in Handlers.m.

   d. Stop Apple code from releasing an AwtException object that has
      already been autoreleased -- see autorelease_AWTEX() in
      Handlers.m.

   e. Tighten up code in the MRJ Plugin JEP that stops the browser
      from accessing an applet that is being destroyed -- search on
      mDestroying in MRJContext.cp, MRJContext.h and MRJPlugin.cpp.

   f. Stop Apple's OS X 10.4.2 JVMs from calling hostWindow on an
      applet viewer peer that has been deleted.  See hostWindow_CE()
      in Handlers.m.

   g. Tighten up code in several other places in Handlers.m to prevent
      crashes when Apple's JVM tries to access objects that have been
      deleted.

3. Fixed several JVM memory leaks:

   a. Worked around design flaws in the garbage collector to stop an
      applet's AppletHolder and AppletHolderPanel objects from being
      leaked.  See AppletHolderFactory.createAppletHolder() (in
      AppletHolderFactory.java), deleteAppletJNIGlobalRefs() and
      tellHolderCreated() (in AppletView.m).

   b. Worked around a bug in Apple's JVM's native code (on OS X 10.2.8
      and 10.3.X, but not 10.4.X) that could, under unusual
      circumstances, cause all of an applet's resources to be leaked.
      See setDraggingDestination_CM() in Handlers.m.

   c. Fixed a bug in the Java Embedding Plugin that caused the JVM to
      leak the resources of an applet that had failed to load.  See
      JEPController cleanupApplet (in Controller.m) and AppletView
      destroyApplet (in AppletView.m).

4. Fixed a bug in the Java Embedding Plugin that could corrupt the bar
   at the bottom of Camino's browser page (by causing parts of an
   applet to appear there).  See AppletView isDisplayable (in
   AppletView.m).

5. Worked around another problem triggered by the fix for Bugzilla bug
   298961:  On OS X 10.4.2 (at least), in Cocoa browsers, updates to
   applets in background tabs can now leak through to the foreground
   tab.

   See MyNSView _propagateDirtyRectsToOpaqueAncestors (in Controller.m)
   and https://bugzilla.mozilla.org/show_bug.cgi?id=298961.

6. Several other minor fixes.

Changes From Version 0.9.3 to 0.9.4

1. Made the Java Embedding Plugin compatible with Apple's recently
   released Java Security Update for Mac OS X 10.3.X.

   Earlier versions of the Java Embedding Plugin used the version
   numbers of Java and its components to determine the characteristics
   of the Java Virtual Machine it was using (which changed
   substantially between OS X 10.3.X and 10.4.X).  But Apple's Java
   Security Update for OS X 10.3.X changed these version numbers to
   values that had previously only been used on OS X 10.4.X.  So
   running the Java Embedding Plugin on OS X 10.3.X now caused it to
   think it was running on OS X 10.4.X, which made it malfunction.

   The Java Embedding Plugin now explicitly checks the OS version, in
   addition to its checks for the version numbers of Java and its
   components.

   I'm very glad that Apple updated Java on 10.3.X at the same time
   they updated it on OS X 10.4.X.  But, though Apple made pre-release
   versions of the OS X 10.4.X update available to developers through
   their Developer Connection, and announced these updates on their
   Java-Dev mailing list, they never did either of these things for
   their OS X 10.3.X update.  So I didn't have a chance to test the
   Java Embedding Plugin against this update before its release, or to
   notice that the JEP was broken and fix it.

   For more information see:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1291312&group_id=107955&atid=649116
   https://bugzilla.mozilla.org/show_bug.cgi?id=308549

2. Changed the behavior of the Java Embedding Plugin to suit recent
   changes in Camino's tab bar.  Prior to this change, black blobs and
   other strange artifacts would appear in the tab bar if it overlaid
   one or more applets (even ones in other tabs).

   For more information see AppletView isOpaque in AppletView.m and
   https://bugzilla.mozilla.org/show_bug.cgi?id=302712.

3. Fixed a bug that (under certain conditions) caused the Preferences
   panel to go blank in recent Camino alphas and nightlies.

   For more information see MyNSView addSubview in Controller.m and
   https://bugzilla.mozilla.org/show_bug.cgi?id=302606.

4. Worked around an Apple bug that caused recent pre-release versions
   of Firefox (for example Firefox 1.5 Beta 1) and Camino (for example
   Camino 1.0 Alpha 1) to sometimes hang while loading the first Java
   applet in a browser session.

   For more information see:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1280909&group_id=107955&atid=649116
   https://bugzilla.mozilla.org/show_bug.cgi?id=306872

   Also see the comment on the CustomEvent class in AppletView.m.

5. Worked around another Apple bug that caused mouse selection to be
   turned on (inappropriately) after clicking on an applet (in recent
   pre-release versions of Firefox like Firefox 1.5 Beta 1).  After
   doing this, moving the mouse around caused text and graphics
   outside the applet to be selected and deselected, as if you were
   holding down the left mouse button and "dragging" the mouse
   pointer.

   For more information see:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1280927&group_id=107955&atid=649116
   https://bugzilla.mozilla.org/show_bug.cgi?id=306874

   Also see HandleDispatcher() in Handlers.m and doLeftMouseUp in
   AppletView.m.

6. Worked around yet another Apple bug that changed the behavior of
   the "Firefox : About Mozilla Firefox" menu after at least one
   applet had been loaded in a window.  (SeaMonkey and the Mozilla
   Suite were also effected.)

   For more information see:

   https://bugzilla.mozilla.org/show_bug.cgi?id=306942

7. Eliminated some thread leaks.

   For more information see getJavaEnv:vmPtr: in AppletView.m.

Changes From Version 0.9.2 to 0.9.3

1. Made further improvements to my workarounds for the large number of
   spurious updates that Mozilla-family browsers send to the MRJ
   Plugin JEP (and indirectly to JavaEmbeddingPlugin.bundle).

   In the past I've called this the "Camino spurious updates bug".
   But, though the problem may be worst in Camino (particularly in the
   most recent versions), it really effects all the Mozilla-family
   browsers.  Unless we do something about them, these redundant
   updates cause applets to flash annoyingly, sometimes several times
   per second.

   With JEP 0.9.3 I added a new call, MaybeDrawJavaApplet(), to the
   Java Embedding Plugin C/C++ API, and shifted some of the burden of
   squelching spurious updates from the MRJ Plugin JEP to
   JavaEmbeddingPlugin.bundle.

   For more information see MaybeDrawJavaApplet() in
   JavaEmbeddingPlugin.h, item #B16 in Changes-JEP.txt, JEPController
   maybeDrawApplet, JEPController handleCarbonUpdate and MyNSView
   _drawRect in Controller.m, and forwardEvent_EF() in Handlers.m.

2. Fixed a problem that caused the Print dialog to be messed up in
   Carbon browsers (Firefox and Mozilla/Seamonkey) on OS X 10.4.X
   (Tiger).  This was due to a Tiger-specific side effect of one of my
   workarounds for Apple's Cocoa/Carbon interface bugs.

   For more information see drawRect_CWV(), isFlipped_CWV() and
   isFlipped_CWF() in Handlers.m.  Also see the following bug report:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1221337&group_id=107955&atid=649116

3. Improved my workaround for an Apple bug that caused crashes when
   you press Control+key or Option+key combinations while the focus is
   in an applet.  This workaround was first introduced in JEP 0.9.1
   (see item #4 in that version's Changes.txt).  But I discovered that
   these crashes still happened, under some circumstances.

   The enhanced workaround should fix them completely.  For more
   information see insertText_AWT() in Handlers.m.

4. Fixed a crash bug triggered by applets that use Java sound when
   they're run in Java 1.5 on OS X 10.4.X (Tiger).

   Code in the Java sound library (libjsound.jnilib) thought it was
   running on Java 1.4.2, not Java 1.5.  The fix involved changing to
   a better method for telling the various Java components which Java
   version is running.

   For more information see JEPController checkBundle in Controller.m.
   Also see the following bug report:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1206781&group_id=107955&atid=649116

5. Made it more likely that Command+key combinations (like Command+T
   or Command+W) will work in Carbon browsers (like Firefox and
   Mozilla/Seamonkey) when an applet has first been loaded in a page,
   but before the user has clicked the mouse in it.

   (These key combinations (except for Command+H and Command+Q) will
   still stop working once you click the mouse on an applet -- this is
   a feature (or design flaw) of the Mozilla-family Carbon-based
   browsers.  They'll start working again when you click the mouse
   outside any applet.)

   For more information see MyNSApplication sendEvent in Controller.m.

6. Fixed a couple of hang/freeze bugs in Java-to-JavaScript
   LiveConnect (in the MRJ Plugin JEP).  For more information see
   items #B20 and #B21 in Changes-JEP.txt.

7. Worked around an obscure Apple bug in Tiger that causes some
   applets which update themselves continuously not to be displayed
   correctly.  An example of this problem is the video applet at

   http://java.sun.com/j2se/jre_check/index.jsp

   For more information see getContext_ADCM() in Handlers.m.

8. Many other minor fixes and improvements.

Changes From Version 0.9.1 to 0.9.2

1. Fixed a major security hole in the MRJ Plugin that effects all
   nightly, alpha and beta releases of the Mozilla-family browsers
   issued since 2004-04-25, but none of the "released" versions.  So,
   for example, Firefox 1.0.X, Mozilla 1.7.X and Camino 0.8.X aren't
   vulnerable.

   In browsers effected by this hole, potentially all security checks
   are disabled when doing JavaScript-to-Java LiveConnect.  So, for
   example, my fix for the ""Sun Java Plugin Arbitrary Package Access
   Vulnerability" (first included in JEP 0.8.8, released 12-05-2004)
   doesn't work on any of the vulnerable browsers on JEP versions
   earlier than 0.9.2 (this version, released 05-18-2005).

   For more information see item #B19 in Changes-JEP.txt.

2. Cleaned up some problems with my workaround for Camino's "spurious
   updates" bug.  (This workaround first appeared in JEP 0.9.1.)
   These problems caused applets to disappear when they shouldn't,
   especially in other browsers than Camino.  For more information see
   handleCarbonUpdate in Controller.m and item #B16 in
   Changes-JEP.txt.

3. A few other minor fixes.

Changes From Version 0.9.0 to 0.9.1

1. The Java Embedding Plugin is now compatible with Mac OS X 10.4
   ("Tiger"), and can use either Java 1.4.2_07 (which ships with
   Tiger), or Java 1.5.0_02 (which is available as a free download
   from Apple for Tiger).

   Apple's new Java "threading model" forces all Java code off the
   main thread that can draw or trigger drawing.  Previous versions of
   the Java Embedding Plugin already mostly followed this model, but
   there were some exceptions that needed to be rectified (if only for
   Tiger).  Where this made the biggest difference is with
   LiveConnect, whose implementation has been significantly altered.
   Apple also made other changes to Java internals in their new Tiger
   versions, which I needed to accomodate.

   For more information search in the Java Embedding Plugin's (and MRJ
   Plugin JEP's) source code on "tiger".

2. Fixed a (minor) security hole in all of Apple's Java versions (from
   1.3.1 to 1.5.0), and in previous versions of the Java Embedding
   Plugin, that allows an applet "Frame"'s methods (to which access is
   normally forbidden) to be called from JavaScript.  For more
   information search on "getAppletFrame" in the MRJPlugin JEP's
   MRJSession.cpp.

3. Command-h and Command-q now work properly in Carbon browsers (like
   Firefox and Mozilla).  See HandleDispatcher() in Handlers.m.

4. The Java Embedding Plugin no longer crashes when you press
   Control+key or Option+key combinations while the focus is in an
   applet.  The problem was caused by a bug in Apple's JVM.  For the
   workaround/fix see insertText_AWT() in Handlers.m.

5. Added a workaround for the Camino "spurious updates" bug, which
   causes some applets to flash annoyingly.  For more information see
   item #B16 in Changes-JEP.txt.

6. Fixed clipping for applets (usually image-based) that update
   themselves at unexpected times (asynchronously), and which (on
   previous JEP versions) drew outside their boundaries when you
   scrolled or resized the browser window.  Here are some examples.
   This was reported as bug 1102057.

   http://www.niftyfiftys.com/
   http://www.homestead.com/prosites-niyh/hom_eng.html

   http://sourceforge.net/tracker/index.php?func=detail&aid=1102057&group_id=107955&atid=649116

   For more information see GraphicsClipper.java, resumeAfterWait1 in
   Controller.m, and canDraw_AWT() in Handlers.m.

7. Fixed a problem that occurs when more than one applet on a page
   tries to do Java-to-JavaScript LiveConnect.  For more information
   see item #B17 in Changes-JEP.txt.  This was one of the problems
   reported as bug 1086807,

   http://sourceforge.net/tracker/index.php?func=detail&aid=1086807&group_id=107955&atid=649116

8. An applet's resize() method now works correctly when called from
   applet or JavaScript code.  For more information see resizeApplet()
   in AppletHolder.java and appletResize() in AppletHolderPanel.java.

9. Many other minor changes and improvements.

Changes From Version 0.8.9 to 0.9.0

1. The Java Embedding Plugin is now compatible with Apple's latest
   Java update -- the "WebStart and Java Plugin Update 1.4.2".

   This update is currently only available to Apple Developer
   Connection members as "WebStart and Java Plugin Update 1.4.2 FC
   Seed".  But it will (presumably) soon be released via Software
   Update.

   The "WebStart and Java Plugin Update" breaks support for signed
   applets in earlier versions of the Java Embedding Plugin -- a
   "java.lang.UnsatisfiedLinkError: _showSecurityDialog" error (and
   stack trace) appear in the Java Console whenever you try to access
   a signed applet.

   For more information see loadJavaPluginCocoa in AppletView.m.

2. Fixed a design flaw in the MRJ Plugin that caused it to sometimes
   fail to elevate a signed applet's privileges when the applet's code
   is called via LiveConnect.  This helps when connecting to
   http://hushmail.com/.

   For more information see item #B.13 in the MRJ Plugin JEP's
   Changes-JEP.txt.

3. Fixed several seldom-encountered crash or hang bugs:

   a. New code ensures that an autorelease pool is always in place
      when a LiveConnect call is made into Java from JavaScript.

      For more information see hookJNIRunnable in AppletView.m.

   b. Mozilla and Firefox no longer crash when you quit with a
      Java-created popup window active.

      For more information see applicationWillTerminate and
      windowWillClose in Controller.m.

   c. Camino no longer crashes (as it occasionally used to) when you
      close one window containing applets while another window
      containing applets is still open.

      For more information see windowWillClose in Controller.m.

   d. Fixed a bug that caused the browser to occasionally crash when
      loading an applet.

      For more information see item #B.14 in the MRJ Plugin JEP's
      Changes-JEP.txt.

4. A few other minor changes and bugfixes.

Changes From Version 0.8.8 to 0.8.9

1. Changed back to launching the version 1.4.X Java Virtual Machine on
   demand (whenever Java is used for the first time in a browser
   session).

   From versions 0.8.3 to 0.8.8, the Java Embedding Plugin launched
   the 1.4.X JVM as the browser started up.  The change was made to
   accomodate using LiveConnect outside of any applet.  I've now
   figured out how to do this without launching the JVM at browser
   startup (for more information see maybeCreateJavaVM and
   loadAWTLibraries in AppletView.m).

   Furthermore, future releases of the Mozilla-family browsers will no
   longer be able to launch the JVM at startup (because they will no
   longer load the MRJ Plugin at startup).  This change has already
   appeared in the nightlies created since 12-02-2004 (except for
   those corresponding to the "1.7 branch").  For more information on
   this change see:

   https://bugzilla.mozilla.org/show_bug.cgi?id=128366

2. Fixed a bug that caused Firefox and Mozilla 1.8a to hang when
   changing versions, running for the first time, or installing
   extensions.

   This fix was a side-effect of change #1 -- changing back to
   launching the JVM on demand.

3. The Java Control Panel's console once again works correctly.

   It was broken by part of version 0.8.8's fix for the Java
   LiveConnect "Arbitrary Package Access" security hole.  For more
   information see OpenSessionJNI() in the MRJ Plugin JEP's
   MRJSession.cpp.

4. Fixed a display-misalignment bug that was introduced by version
   0.8.7 of the Java Embedding Plugin, as part of an over-zealous
   attempt to make the interactive applets at http://www.map24.com/
   work correctly.

   The bug caused many different kinds of problems at quite a few
   different sites.  Some examples are:

   http://www.xrce.xerox.com/competencies/content-analysis/arabic/input/keyboard_input.html
   http://www.boursorama.com/graphiques/graphique_histo.phtml?symbole=INTC
   http://www.javaview.de/demo/index.html (Many of the demos listed here)

   The map24.com-specific changes have been toned down, and quite a
   few other changes have also been made.  For more information, see
   particularly SimpleLayout.java.

   The map24.com interactive applets should still work correctly most
   of the time.  If they don't, it may help to resize the page again,
   or to switch to another tab and then switch back.

5. Eliminated some thread and memory leaks.

   The thread leaks were caused by calling the dispose() method from
   the applet's own event-handling thread -- which caused that thread
   and at least one other to stay alive after the applet had been
   destroyed.  For more information see destroyApplet() in
   AppletHolder.java.  (Some thread leaks still occur when rapidly
   creating and destroying applets.)

   Most of the memory leaks were caused by a bug in Apple's
   implementation of the Objective-C NSEnumerator class.  I eliminated
   these by replacing all the code in the Java Embedding Plugin that
   used NSEnumerator.  The bug is documented at:

   http://www.complang.org/bogus_retain_via_NSEnumerator-1632680-5337-a.html

6. Several other minor changes and bugfixes.

Changes From Version 0.8.7 to 0.8.8

1. Added a fix for the "Sun Java Plugin Arbitrary Package Access
   Vulnerability" (which effects JavaScript-to-Java LiveConnect), as
   reported at the following URLs:

   http://securityfocus.com/archive/1/382072/2004-11-23/2004-11-29/0
   http://securityfocus.com/archive/1/381940/2004-11-16/2004-11-22/0

   The fix works for both Java 1.4.X (what you get when you use the
   MRJ Plugin JEP with JavaEmbeddingPlugin.bundle) and Java 1.3.1
   (what you get when you use the MRJ Plugin JEP by itself).  Earlier
   versions (prior to 0.8.8) of the Java Embedding Plugin are
   vulnerable, in both configurations.

   Version 0.8.8 of the Java Embedding Plugin now passes the test for
   this vulnerability at the following URLs, in both configurations:

   http://bcheck.scanit.be/bcheck/
   http://bcheck.scanit.be/bcheck/choosetests.php

   You might think that it's Apple's responsibility to fix this.  But
   none of Apple's own products are vulnerable -- either because (like
   the Java Applet.plugin and earlier versions of Safari) they don't
   support LiveConnect at all, or because (like more recent versions
   of Safari) their LiveConnect implementations have somehow avoided
   the problem.  So I suspect that Apple may never release versions of
   Java 1.4.X or Java 1.3.1 to address it.

   Interestingly, the bcheck test crashes the current version of
   Safari (the one that's included in Apple's 2004-12-02 security
   update).  But I wrote a simpler test of my own (a "hello world"
   applet plus the proof-of-concept JavaScript code given in Jouko
   Pynnonen's advisory), which doesn't crash Safari and does (I think)
   show that it's not vulnerable.

   For more information see checkClassAccess() in JNIUtils.java and
   Java_java_lang_Class_forName0_redirect() and OpenSessionJNI() in
   MRJSession.cpp.

2. Made a few other minor changes.  For example:

   Restored the applet download-and-initialization timeout to 60
   seconds from 30 seconds (as it was in JEP 0.8.7) -- 30 seconds
   wasn't enough for some large applets to download over a slow
   connection and then initialize.  (See doInitialization in
   AppletView.m.)

   The Java Embedding Plugin now logs when an applet is created (both
   to the Java console and the "system console").  This should help
   people to determine whether or not a given page uses applets.

Changes From Version 0.8.6 to 0.8.7

1. Worked around a bug/design-flaw in Firefox 1.0 that broke the MRJ
   Plugin -- causing it to crash on LiveConnect calls.

   Firefox 1.0 makes a backwards-incompatible change in a part of the
   OJI API used by the MRJ Plugin.  Firefox 1.0RC1 and 1.0RC2 have the
   same problem.  For more information see
   CSecureEnv::sendMessageToJava() in the MRJ Plugin JEP's
   CSecureEnv.cpp and the following URLs:

   http://sourceforge.net/tracker/index.php?func=detail&aid=1063222&group_id=107955&atid=649116
   https://bugzilla.mozilla.org/show_bug.cgi?id=234169

2. Fixed a class of bugs in the Java Embedding Plugin that caused
   extended characters and Unicode characters to be mishandled,
   sometimes resulting in a crash (for example when visiting
   http://www.emtac.com/).

   The problem was that the Java Native Interface (JNI) calls that I
   used to translate to and from Java strings (jstring objects)
   (NewStringUTF() and GetStringUTFCharacters()) can't handle either
   extended or Unicode characters.  I replaced them with calls that
   can -- NewString() and GetStringChars().  For more information,
   search on these names in AppletView.m.

3. Changed how applets are initialized, to enable support for applets
   and web pages that try to do LiveConnect very soon after the
   browser has loaded an applet.  This should make the Java Embedding
   Plugin work with a larger range of internet banking sites.

   The underlying problem is that the Mozilla family of browsers
   assume an applet will be initialized synchronously -- that it will
   be fully loaded by the time the browser's call to load an applet
   has returned.  But (for various reasons) this is impossible with
   Apple's Java 1.4.X implementation.  For most applets it doesn't
   matter.  But sometimes it _does_ matter -- for example when an
   applet tries to call LiveConnect methods from its init() method, or
   when the browser tries (via LiveConnect) to call an applet's
   methods in a JavaScript OnLoad() handler.  Internet banking sites
   often do one or both of these things.

   For more information see "jep.asyncinit" in the "Runtime
   Parameters" section of Readme.txt and (particularly) initWithParams
   and doInitialization in AppletView.m.

4. Added a couple of "runtime parameters" to allow people to use the
   Java Control Panel to change the Java Embedding Plugin's behavior.

   For more information see the "Runtime Parameters" section of
   Readme.txt.

5. Made several enhancements to the Java Embedding Plugin C/C++ API.

   Some are needed to support the change in how applets are
   initialized (see item #3 above).  Others are just for convenience
   -- for example I added calls to obtain the value of certain Java
   system properties (those set by the Java Control Panel) before the
   JVM has started.  For more information see JavaEmbeddingPlugin.h.

6. Made changes to prevent version mismatches between
   JavaEmbeddingPlugin.bundle and the MRJ Plugin JEP.  As of the
   current version (0.8.7) of the Java Embedding Plugin, the MRJ
   Plugin JEP will ignore copies of JavaEmbeddingPlugin.bundle that
   don't have a "matching" version number -- instead it will fall back
   to using Java 1.3.1.

7. Many other minor changes and bugfixes -- including some aimed at
   the applets used by http://www.map24.com/, which should now work
   with the Java Embedding Plugin.

Changes From Version 0.8.5 to 0.8.6

1. Fixed a whole class of LiveConnect bugs (some of them crash bugs)
   in the MRJ Plugin.  Versions 0.8.3 through 0.8.5 of the MRJ Plugin
   JEP included a partial fix, which I have now removed.  Several
   people reported problems using Java-to-JavaScript LiveConnect calls
   to display several alert boxes in a row.  The new fix resolves
   these problems.

   For more information see item #B10 in Changes-JEP.txt.

2. Fixed a bad interaction with CocoaGestures
   (http://www.bitart.com/CocoaGestures.html) that caused Carbon
   browsers (like Mozilla and Firefox) to crash on startup on systems
   where both CocoaGestures and the Java Embedding Plugin were
   installed.

   For more information see MyNSApplication : sendEvent in
   Controller.m.

3. Substantially improved how applets are displayed (or redisplayed)
   after you've resized the page or switched tabs -- particularly when
   the page contains lots of applets, and particularly in Carbon
   browsers like Mozilla and Firefox.

   Reduced or eliminated the spurious display of off-screen applets
   after a page has been resized.  For more information see
   isDisplayable in AppletView.m.  Also see the following URL, which
   is a particularly good test of the problem:

   http://www.mozilla.org/quality/browser/front-end/testcases/oji/test2.html

   You should no longer see all the applets on a page flash (in a
   Carbon browser) when you click the mouse on one of them after
   having switched tabs.  For more information search on
   "skipUpdateOnce" in Handlers.m and see handleCarbonUpdate in
   Controller.m.

   In Carbon browsers the resize-handling code is now triggered at
   more appropriate times.  For more information search on
   suspendAppletUpdates and resumeAppletUpdates in HandleWindows() in
   Handlers.m.

4. Several other minor changes and bugfixes.

Changes From Version 0.8.4 to 0.8.5

1. Improved keyboard and mouse event handling for applets in multiple
   tabs in Carbon browsers (like Mozilla and Firefox).  Some of these
   changes fixed problems introduced by version 0.8.4.

   I've continued to revise the code that handles keyboard and mouse
   events and the "window cache".

   The keyboard focus no longer spontaneously changes to an applet
   when you scroll or resize a window that contains applets.
   Performance is much better scrolling and resizing a window that
   contains multiple applets.  (Both are fixes for problems introduced
   by version 0.8.4.)

   Keyboard and mouse events are now handled more consistently when
   switching tabs.  There are still occasional problems (such as
   keystrokes or mouse-overs being ignored) -- but it should be
   possible to resolve these by switching to a different tab and then
   switching back.

   Mozilla and Firefox no longer respond to command-key combinations
   after the user has explicitly changed the focus to an applet (by
   clicking the mouse in it).  Some may not see this as an
   improvement.  But it conforms to these browsers' behavior when
   using Java 1.3.1.  And the underlying change which causes this
   behavior helps make the JEP's handling of keyboard and mouse events
   more consistent.

   For more information see (particularly) showHideApplet and
   routeEvent in Controller.m, setClip in AppletView.m and
   HandleDispatcher() in Handlers.m.  The "underlying change"
   mentioned in the previous paragraph is that the browser now
   receives mouse-down and mouse-up events even when the focus is in
   an applet (see HandleDispatcher()).

2. Loading an applet with no user interface no longer disables
   keyboard input.  (This bug was also introduced, or at least
   aggravated, by JEP version 0.8.4.)

   Some applets have zero size and no user interface, and get their
   input from standard HTML controls via JavaScript (and LiveConnect).
   One example of this is Postbank.nl's logon page
   (https://www.p3.postbank.nl/sesam/SesamLoginServlet).  No previous
   version of the JEP handled these correctly, but versions prior to
   0.8.4 made it possible to get around the problem by clicking the
   mouse somewhere else and then back in the "Account" and "Password"
   boxes.

   For more information see afterInitializeOnMainThread in
   Controller.m.

3. Fixed an error that disabled a small number of applets that use
   popup windows -- particularly stock ticker applets such as
   ScotTrader's (http://www.scottrader.com/).  (This bug, too, was
   introduced by JEP 0.8.4.)

   The error message (displayed in the Java console) was as follows:

     java.lang.RuntimeException: Non-java exception raised, not
     handled! (Original problem: *** -[CPopupMenu getOwningWindow]:
     selector not recognized) at
     apple.awt.CMenuItem.nativeCreate(NativeMethod)

   For more information see registerModelForUpdate_TU() in Handlers.m.

4. Substantial improvements clipping applets that dynamically update
   their display in Java 1.4.2.  (For a good example see
   http://www.fantasyasylum.com/)

   For more information see suspendAppletUpdate, resumeAppletUpdates
   and resumeAfterWait2 in Controller.m.

5. The native print dialog invoked from an applet (what you get when
   your applet says "getToolkit().getPrintJob()") no longer refuses to
   accept keyboard and mouse input.

   This is a Carbon-Cocoa interface bug that I'd missed in previous
   versions of the JEP.  For more information see MyNSApplication :
   runModalForCarbonWindow in Controller.m.

6. The Java Embedding Plugin's support for "natively" resizing an
   applet now works correctly.  (It's no longer impossible to make the
   applet larger than its "original" size.)

   This fix corrects a problem in Apple's JVM.  For more information
   see resizeApplet in AppletView.m and resizeApplet() in
   AppletHolder.java.

7. Crashes should no longer happen when you rapidly switch between
   applets on different pages.

   Fixing this problem involved tightening up the code that handles
   what happens when an applet is being loaded or destroyed.  The
   changes are scattered across several different modules.  For more
   information search through the JEP source code on "destroying" and
   see item #9 in Changes-JEP.txt.

8. Several other minor bugfixes.

   For a couple of examples see MyNSWindow : displayIfNeeded in
   Controller.m and tickFlusher_AWTCTX() in Handlers.m.

Changes From Version 0.8.3 to 0.8.4

1. The Java Embedding Plugin is now compatible with Apple's Java 1.4.2
   Update 2 Final Candidate (posted at the Apple Developer Connection
   on 9-8-2004).

   (Version 0.8.3 was mostly compatible, but a faulty version check in
   Controller.m's checkBundle method broke support for the Java
   Control Panel's "runtime parameters".)

2. Control-key combinations (for example command-t, command-w,
   command-i and command-u) no longer cause duplicate results in
   Carbon browsers (like Mozilla or Firefox).

   This was one of the bugs fixed by a substantial rewrite of keyboard
   event handling.  For more information see HandleDispatcher() in
   Handlers.m.

3. The Java Control Panel's console once again works correctly.

   The console was (mostly) broken in JEP 0.8.3 by the change to
   starting the JVM as the browser is launched.  The fix was to make
   sure the MRJ Plugin's console support is always initialized just
   after the JVM is started.  For more information see CreateJVM() in
   the MRJ Plugin JEP's MRJSession.cpp file.

4. Fixed a LiveConnect bug (in the MRJ Plugin) that caused the browser
   to crash whenever you visited http://visualroute.visualware.com.

   This is actually an extension of an earlier fix.  See item #B6 in
   Changes-JEP.txt.

5. Fixed a thread-contention issue that caused
   http://www.lohn1.de/lobn.htm to hang any Mozilla-family browser on
   OS X 10.3.5 with Java 1.4.2 Update 1 (or Update 2).

   For more information see layoutContainer() in SimpleLayout.java.

6. Fixed mouse-over support in applets such as Sun's LiveFeedback
   ImageMap sample and http://www.fantasyasylum.com's "High Voltage
   News" applet.

   Mouse-over support did work (more or less) in previous JEP
   versions, but was flaky if an applet was clipped or updated its
   display dynamically.

   Fixing it required working around an Apple bug and rewriting the
   JEP's "window cache" code.  For more information see
   mouseMovedAWT_AWT() in Handlers.m and search the JEP's source code
   for _setVisible and _removeWindowFromCache.

7. Substantially improved keystroke and mouse handling for applets in
   multiple tabs in Carbon browsers (like Mozilla and Firefox).

   This fell out from my rewrites of keyboard event handling
   (mentioned in item #2 above) and the "window cache" code (mentioned
   in item #5 above), plus a couple of workarounds for Apple bugs (see
   setAWTDelegate_AWTCTV() and registerModelForUpdate_TU() in
   Handlers.m).

   Applets in multiple tabs still work very poorly in Camino, though.

8. Several other minor bugfixes.

   For one example search on CancelMenuTrackingPtr in routeEvent in
   Controller.m -- you'll find a workaround for an OS X 10.3.X bug
   that caused the root menu not to close when the user clicked in a
   Carbon browser window outside any applet.

Changes From Version 0.8.2 to 0.8.3

1. The Java Embedding Plugin is now compatible with Java 1.4.2 Update
   1 (released by Apple in early August, 2004).

   For more information search on "isJava142Update1" in the source
   code.

2. The Java Embedding Plugin now supports "runtime parameters" entered
   using the "Java Control Panel".

   For more information see getRuntimeParams in Controller.m.

3. LiveConnect now works consistently outside an applet.

   Previous versions of the JEP would hang if you tried to use
   LiveConnect outside an applet without first having browsed to at
   least one applet during the browser's current "session".  (Examples
   of using LiveConnect outside an applet can be found at
   http://www.mozilla.org/quality/browser/front-end/testcases/oji/liveconnecttest.html.)

   To make this possible, the Java Virtual Machine is now loaded as
   you launch the browser (which slightly increases how long it takes
   to launch).

   For more information see loadAWTLibraries in Controller.m and
   CreateJVM() in the MRJ Plugin JEP's MRJSession.cpp.

4. It's now possible to invoke a JavaScript alert from a Java applet.

   Previous versions of the JEP would hang if you tried to do this.

   For more information see item #A10 in the MRJ Plugin JEP's
   Changes-JEP.txt.

5. It's now less likely that the keyboard will beep at you or be
   disabled after having used a Command-key or Control-key
   combination, or after having loaded a broken applet.

   For example, something in the Mozilla family's "about:plugins" page
   attempts to load an applet via a Chrome URL (which of course
   fails).  In previous versions of the JEP, this disabled keyboard
   input (for example in the URL box) until you pressed the browser's
   "Back" button.

   For more information see HandleDispatcher() and HandleWindow() in
   Handlers.m.

6. The Java Embedding Plugin can now "natively" resize applets that
   appear to be able to resize themselves ... though this support is
   still buggy.

   The JEP now assumes that an applet supports "native" resizing if
   the HTML code that invokes it specifies the applet's "width" and
   "height" as percentages of the space available (instead of absolute
   numbers of "pixels").  But the right and bottom of an applet will
   be clipped if you try to make it bigger than its "original" size
   (its size when it was first displayed).

   For more information see resizeApplet() in AppletHolder.java.

7. Several other minor bugfixes (some for seldom-encountered
   crash/hang bugs).

   For examples see translateCurrentClip() in AppletHolder.java,
   HandleAETSM() and attributedSubstringFromRange_TSMIC() in
   Handlers.m, and item #A11 in the MRJ Plugin JEP's Changes-JEP.txt.

Changes From Version 0.8.1 to 0.8.2

1. Made numerous improvements to sizing and clipping code, thereby
   fixing a whole slew of display problems.

   It's now much more unusual for parts of an applet to display
   outside its clipping boundaries.  Applets that dynamically generate
   their contents are much less likely to have part of their display
   cut off (e.g. the NOAA radar-looping applets) or to misalign text
   within the display (e.g. http://gemal.dk/browserspy/java.html).

   For more information about these changes, see particularly
   SimpleLayout.java, translateCurrentClip() and imposeClip() in
   AppletHolder.java, clipWithTranslation in AppletView.m, and
   drawRect_AWT() and lockFocusIfCanDraw_AWT() in Handlers.m.

2. Redesigned the code for handling keystrokes and mouse events in
   Carbon browsers.

   It turns out that the methods I used in earlier versions (which
   relied heavily on CallNextEventHandler()) worked only for browsers
   that use WaitNextEvent() (a pre-Carbon method) to get events from
   the OS.  Mozilla and Firefox mostly use WaitNextEvent().  But for a
   few kinds of events (notably mouse-wheel events) they use a more
   modern method -- Carbon event handlers.  I received some reports
   that mouse wheels didn't work with versions 0.8.0 and 0.8.1.
   Tracing this problem revealed a much more fundamental one.

   Some other problems were also solved by this change.  For example,
   double-clicking on a Mozilla or Firefox window will now minimize it
   (as it should).

   For more information see particularly HandleDispatcher() in
   Handlers.m.

3. Added code to work around an Apple bug that causes Camino to hang
   in the NOAA radar-looping applets (and presumably also in other
   applets that rapidly regenerate their content) on OS X 10.3.X.

   To some extent this problem was mitigated by the changes described
   in item #1.  But I found I also had to add the code in
   markAsDirty_CM() in Handlers.m.

4. Added code to (partially) work around an Apple bug that sometimes
   causes buttons and panels in Swing applets to have black
   backgrounds in Carbon browsers on OS X 10.3.X.

   See FixLookAndFeel in AppletHolder.java for more information.

5. Disabled Java-initiated modal windows for Cocoa browers (like
   Camino).  The windows (e.g. security dialogs or error reports)
   still display -- they just are no longer modal.

   Apple's JVM's modal-window code is badly broken -- a browser's
   menus and windows often remain disabled even after you've closed a
   modal security dialog or error report.  All versions of the Java
   Embedding Plugin contain workarounds for this problem for Carbon
   browsers (like Mozilla and Firefox).  But recently I realized that
   the problem also effects Cocoa browsers (though not as severely).
   I was unable to get my Carbon-browser workaround to work with Cocoa
   browsers, so I've simply disabled Java-initiated modal windows for
   them.

6. Made some changes that improve the Java Embedding Plugin's
   stability (i.e. reduce the likelihood that it will hang), though I
   haven't entirely eliminated the problem.

   For some time I've noticed that the Java Embedding Plugin will
   occasionally hang, on seemingly random occasions.  The problem is
   roughly twice as bad on Mac OS X 10.3.X (with Java 1.4.2) as it is
   on OS X 10.2.8 (with Java 1.4.1) ... though even on 10.3.X it's no
   more than a minor annoyance (at least on my system, which is a
   dual-1Ghz-CPU G4).

   After a lot of trial and error, I found a few changes that seemed
   to improve things.  On OS X 10.3.X the hangs are perhaps only 25%
   as frequent as they used to be.  And on 10.2.8 I may have
   eliminated them entirely.

   For more information see java_vfprintf() and
   lockFocusIfCanDraw_AWT() in Handlers.m.

7. Fixed some bugs in the MRJ Plugin that (in effect) disabled the
   Java-to-Javascript side of LiveConnect.  I still haven't done much
   LiveConnect testing, so I don't know if it's now fully functional.

   For more information see items #A7 and #B6 in Changes-JEP.txt.

Changes From Version 0.8.0 to 0.8.1

1. Corrected the "Installing and Uninstalling the Binaries" section of
   Readme.txt with a better method to ensure that the Mozilla family
   of browers always loads the MRJ Plugin JEP when displaying an
   applet (as opposed to the Java Applet Plugin or the Java Applet
   Plugin Enabler, which only support older Java versions).

   I misunderstood how Mozilla chooses among several plugins that all
   support the same MIME type.  I originally thought Mozilla would
   prefer an OJI plugin to one that used the (older) Netscape plugin
   API -- that's not true.

   Mozilla (and family) always searches the following directories for
   plugins in the same order -- first the "Contents/MacOS/plugins"
   directory inside the browser package, then the "/Library/Internet
   Plug-Ins" directory in the user's home directory, then the system's
   "/Library/Internet Plug-Ins" directory.  The first plugin found
   that supports a given MIME type is the one that gets used.  But
   among plugins in the same directory, Mozilla sorts by (first)
   timestamp and (second) filename.  So if several plugins in the same
   directory all support the same MIME type, it's the one with the
   most recent timestamp (or the one among those with the latest
   timestamp whose name is earliest in the alphabetical sort order)
   that gets chosen.

   The sorting takes place at the call to pluginFilesArray.Sort() in
   the method nsPluginHostImpl::ScanPluginsDirectory() in file
   modules/plugin/base/src/nsPluginHostImpl.cpp.

2. Fixed the unsatisfied link errors that were happening on native
   methods (nativeGetCookieInfo or nativeSetCookieInfo) of the
   MacOSXCookieHandler class.

   To do this I needed to make sure that I always load
   libAppletsInCocoa.jnilib in the JavaPluginCocoa.bundle, if the
   latter is present.  And in Java 1.4.2 I also needed to get rid of
   the "final" modifier from the netscape.javascript.JSObject class in
   the MRJ Plugin JEP (so that apple.applet.JSObject in
   libAppletsInCocoa.jnilib could override it).

3. Added code to Controller.m, AppletView.m and Handlers.m to better
   support applets in tabs in recent versions of Mozilla and family.

   Originally I'd thought (from tests I did a few months ago) that
   no version of Mozilla had any support for applets in tabs.  Bill
   McGonigle's message to bugzilla.mozilla.org corrected me on this
   (comment #68 at
   http://bugzilla.mozilla.org/show_bug.cgi?id=197813).

   When I re-ran my tests, I found problems that I was able to trace
   to the Java Embedding Plugin ... or (in one case) to work around by
   changing code in the Java Embedding Plugin.  In this last case (the
   most visible of the problems I found), an applet in a given tab was
   cleared after switching to another tab -- leaving a rectangular
   blank spot in the second tab.  (This may actually be due to a bug
   in how the most recent versions of Mozilla handle applets in tabs.
   See KnownProblems.txt.)

4. Possibly fixed a method visibility problem with Java 1.4.2 DP1.

   I say "possibly" because I'm unable to install 1.4.2 DP1 on my
   system, even after reinstalling the entire OS five or six times
   (with minor variations).

   It appears that the constructors for the CAppletFrame, CCanvas and
   CPanel classes changed from having "public" access to having no
   access modifier -- which makes them only accessible from the "same
   package".  To work around this I moved my MyCAppletFrame,
   MyCCanvas14X and MyCPanel classes from the "jep" package to the
   "apple.applet" package inside JavaEmbeddingPlugin.jar.  To make
   sure that works I also granted AllPermission to
   JavaEmbeddingPlugin.jar (which I now do in
   AppletHolderFactory.java).

