{
try
{
- Thread.sleep(5);
+ Thread.sleep(5+2*(51-wait));
} catch (InterruptedException e)
{
}
long nextl = session.length();
+ Console.trace("Finished waiting around for session save... ("+nextl+" length - was "+l+" and waits "+wait+")");
if (nextl != l)
{
wait = 50;
l = nextl;
}
} while (--wait > 0);
+ if (l==0) {
+ Console.error("Structure viewer session save resulted in zero length file. This is a bug, please report it.");
+ }
return session;
}
File viewerState = viewFrame.saveSession();
if (viewerState != null)
{
+ if (viewerState.length()==0)
+ {
+ addErrorMessage("Dataloss warning: structure viewer session file was zero length.");
+ }
copyFileToJar(jout, viewerState.getPath(),
getViewerJarEntryName(viewId), viewerType);
}
return object;
}
+ private void addErrorMessage(String string)
+ {
+ if (errorMessage==null)
+ {
+ errorMessage="";
+ }
+ errorMessage+=string+"\n";
+ }
+
/**
* Writes PCA viewer attributes and computed values to an XML model object and
* adds it to the JalviewModel. Any exceptions are reported by logging.