From f9ef4bfe009016affc6f50a27bed0560431c8eb8 Mon Sep 17 00:00:00 2001
From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04>
Date: Thu, 20 Nov 2008 16:39:49 +0000
Subject: [PATCH] change to ensure autosave does not start until the
 GFFDocumentEntry constructor has completed

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@9410 ee4ac58c-ac51-4696-9907-e4b3aa274f04
---
 uk/ac/sanger/artemis/io/GFFDocumentEntry.java    |  7 ++++---
 uk/ac/sanger/artemis/io/SimpleDocumentEntry.java | 10 +++-------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/uk/ac/sanger/artemis/io/GFFDocumentEntry.java b/uk/ac/sanger/artemis/io/GFFDocumentEntry.java
index 913875337..c390395e1 100644
--- a/uk/ac/sanger/artemis/io/GFFDocumentEntry.java
+++ b/uk/ac/sanger/artemis/io/GFFDocumentEntry.java
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFDocumentEntry.java,v 1.59 2008-10-01 11:35:30 tjc Exp $
+ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFDocumentEntry.java,v 1.60 2008-11-20 16:39:49 tjc Exp $
  */
 
 package uk.ac.sanger.artemis.io;
@@ -46,7 +46,7 @@ import org.gmod.schema.sequence.FeatureLoc;
  *  A DocumentEntry that can read an GFF entry from a Document.
  *
  *  @author Kim Rutherford
- *  @version $Id: GFFDocumentEntry.java,v 1.59 2008-10-01 11:35:30 tjc Exp $
+ *  @version $Id: GFFDocumentEntry.java,v 1.60 2008-11-20 16:39:49 tjc Exp $
  **/
 
 public class GFFDocumentEntry extends SimpleDocumentEntry
@@ -69,10 +69,11 @@ public class GFFDocumentEntry extends SimpleDocumentEntry
       throws IOException, EntryInformationException 
   {
     super(new GFFEntryInformation(), document, listener);
-
+    super.in_constructor = true;
     // join the separate exons into one feature (if appropriate)
     //combineFeatures();
     combineGeneFeatures();
+    super.in_constructor = false;
     finished_constructor = true;
   }
 
diff --git a/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java b/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java
index f6f718a3b..5bb1f5cd4 100644
--- a/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java
+++ b/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java,v 1.25 2008-09-10 10:40:57 tjc Exp $
+ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java,v 1.26 2008-11-20 16:39:49 tjc Exp $
  */
 
 package uk.ac.sanger.artemis.io;
@@ -40,7 +40,7 @@ import javax.swing.JOptionPane;
  *  This class contains the methods common to all DocumentEntry objects.
  *
  *  @author Kim Rutherford <kmr@sanger.ac.uk>
- *  @version $Id: SimpleDocumentEntry.java,v 1.25 2008-09-10 10:40:57 tjc Exp $
+ *  @version $Id: SimpleDocumentEntry.java,v 1.26 2008-11-20 16:39:49 tjc Exp $
  **/
 
 abstract public class SimpleDocumentEntry
@@ -88,7 +88,7 @@ abstract public class SimpleDocumentEntry
    *  Set to true in the constructor while features are added.  setDirtyFlag()
    *  will do nothing while this is true.
    **/
-  private boolean in_constructor = false;
+  protected boolean in_constructor = false;
 
   /**
    *  Create a new SimpleDocumentEntry from the given Document.
@@ -1203,8 +1203,6 @@ abstract public class SimpleDocumentEntry
     }
     else
     {
-//  XXX FIXME - disabled for now because the code is suspect
-
        if(autosave_thread == null && getName() != null) 
        {
          // this is the first change so start autosaving
@@ -1212,9 +1210,7 @@ abstract public class SimpleDocumentEntry
          autosave_thread.start();
        }
 
-
       final java.util.Calendar calendar = java.util.Calendar.getInstance();
-
       last_change_time = calendar.getTime();
     }
   }
-- 
GitLab