diff -r 1f650edec019 openide.text/test/unit/src/org/openide/text/CloneableEditorDocumentGCTest.java --- a/openide.text/test/unit/src/org/openide/text/CloneableEditorDocumentGCTest.java Thu Oct 15 12:11:32 2009 +0200 +++ b/openide.text/test/unit/src/org/openide/text/CloneableEditorDocumentGCTest.java Fri Oct 16 15:56:40 2009 +0200 @@ -55,7 +55,9 @@ import java.util.Date; import java.util.List; import javax.swing.text.Document; +import javax.swing.text.EditorKit; import org.netbeans.junit.NbTestCase; +import org.openide.text.Line.Set; import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.windows.CloneableOpenSupport; @@ -92,6 +94,7 @@ private static final Object LOCK = new Object(); private boolean waiting; + private boolean isNbLikeEditorKit; public CloneableEditorDocumentGCTest(String s) { super(s); @@ -158,6 +161,11 @@ LOCK.notifyAll(); } } + + public void testDocumentGCedOnNbLike () throws Exception { + isNbLikeEditorKit = true; + testDocumentGCed(); + } // // Implementation of the CloneableEditorSupport.Env @@ -240,6 +248,16 @@ public CES (Env env, Lookup l) { super (env, l); } + + protected @Override EditorKit createEditorKit() { + EditorKit retValue; + if (isNbLikeEditorKit) { + retValue = new NbLikeEditorKit(); + } else { + retValue = super.createEditorKit(); + } + return retValue; + } public CloneableTopComponent.Ref getRef () { return allEditors;