joomla/joomla-platform — pull request #1729 by mbabker (2012-12-01 21:39:31+00:00)
Title: Deprecate application loading in JFactory::getApplication()

JFactory::getApplication() is heavily tied in to working with the legacy JApplication class, making it nearly impossible to properly refactor the method to work with the newer JApplicationBase classes. Since JFactory::getApplication() is heavily used to retrieve the application object, instead of deprecating and removing the method completely, instead I propose to deprecate its code to handle instantiating an application instance, in this case, JApplication. In 13.3 when JApplication is removed from the legacy tree, the method will be converted to throwing an Exception if the application object in JFactory is not set by applications. This allows this heavily used API to continue to be used to globally retrieve the application object.

As well, I've added a check to ensure that JApplication is present if getApplication() is actually loading an instance. Since it is in the legacy tree, there is the chance it is not present. An Exception is thrown in this instance.