Bug 168153 [DataBinding] Simplify the management of the default Realm
In the bug where Realms where born there was talk of making the setting of the Realm a little more foolproof. Currently when setting the Realm the developer needs to remember to retrieve the current Realm and to set it back in a finally block to be a good citizen. I think Boris spoke of something like the following to remedy this... Realm.setDefault(myRealm, new Runnable() { public void run() { //do stuff with myRealm as default } }); I've been finding myself writing a method that does just this in my own code. I think this should be added to Realm to ensure that the default realm is being set and reset correctly.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java
* http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Brad Reynolds - bugs 137877, 152543, 152540
 *     Brad Reynolds - bug 116920
 *     Brad Reynolds - bug 164247
 *     Brad Reynolds - bug 164653
 *******************************************************************************/
package org.eclipse.jface.tests.databinding;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.core.databinding.observable.masterdetail.DetailObservableValueTest;
import org.eclipse.core.tests.databinding.beans.BeansObservablesTest;
import org.eclipse.core.tests.databinding.observable.map.AbstractObservableMapTest;
import org.eclipse.core.tests.databinding.observable.map.ObservableMapTest;
import org.eclipse.core.tests.databinding.observable.map.WritableMapTest;
import org.eclipse.jface.internal.databinding.provisional.conversion.IdentityConverterTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryBooleanPrimitiveTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryBytePrimitiveTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryDoublePrimitiveTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryFloatPrimitiveTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryIntTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryLongPrimitiveTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryShortPrimitiveTest;
import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryTest;
import org.eclipse.jface.internal.databinding.provisional.validation.ObjectToPrimitiveValidatorTest;
import org.eclipse.jface.tests.databinding.mask.EditMaskLexerAndTokenTest;
import org.eclipse.jface.tests.databinding.mask.EditMaskParserTest;