From: Jonathan C. <jcr...@us...> - 2004-04-28 19:59:52
|
Update of /cvsroot/gmod/apollo/src/java/apollo/dataadapter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30818 Modified Files: AbstractApolloAdapter.java Log Message: Added workaround for bug in per-database style file support (DatabaseToStyle). Index: AbstractApolloAdapter.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/dataadapter/AbstractApolloAdapter.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AbstractApolloAdapter.java 15 Apr 2004 16:13:37 -0000 1.25 --- AbstractApolloAdapter.java 28 Apr 2004 19:59:38 -0000 1.26 *************** *** 92,99 **** // have to send actual style as there might be a synteny style now associated with // this adapter ! Config.setStyle(getStyle()); ! System.out.println("Set style to " + getStyle() + "; style file source(s): " ! + getStyle().getAllStyleFilesString()); ! System.out.println("Using tiers file " + getStyle().getTiersFile()); // should make annotation change log a DataListener getAnnotationChangeLog().reset(); --- 92,100 ---- // have to send actual style as there might be a synteny style now associated with // this adapter ! Style style = getStyle(); // workaround for a bug in getStyle(); do NOT call getStyle() more than once until this is fixed ! Config.setStyle(style); ! System.out.println("Set style to " + style + "; style file source(s): " ! + style.getAllStyleFilesString()); ! System.out.println("Using tiers file " + style.getTiersFile()); // should make annotation change log a DataListener getAnnotationChangeLog().reset(); *************** *** 243,247 **** This can be overridden by setStyle, which is used by SyntenyAdapter to overrides its childrens style with its own. Once we have the ability ! to switch between single and mutli species, the style will need to be synched with it (not there yet). Also a style can have other styles it loads depending on the db that is --- 244,248 ---- This can be overridden by setStyle, which is used by SyntenyAdapter to overrides its childrens style with its own. Once we have the ability ! to switch between single and multi species, the style will need to be synched with it (not there yet). Also a style can have other styles it loads depending on the db that is *************** *** 257,260 **** --- 258,266 ---- // Check if style has database styles, and if so load that one if (style.databaseHasStyle(getDatabase())) { + // JC: There's a bug here, insofar as a second call to getStyle() can change the style back + // from the database-specific style to the default style (assuming only a single level of + // indirection in the style files.) At the root of the problem is the fact that getStyle() has + // a side effect; adding this 'if' clause makes the existing problem evident by making the side + // effect non-idempotent. style = style.getStyleForDb(getDatabase()); } |