diff --git a/src/fr/inrialpes/exmo/align/service/SQLCache.java b/src/fr/inrialpes/exmo/align/service/SQLCache.java index 701e16c62a0ebfa5dec26b757a25997d9678ae88..11ecefb13e6ad33346c5bc4112643ee0f4ef7271 100644 --- a/src/fr/inrialpes/exmo/align/service/SQLCache.java +++ b/src/fr/inrialpes/exmo/align/service/SQLCache.java @@ -352,14 +352,13 @@ public class SQLCache extends VolatilCache implements Cache { ResultSet rs = st.executeQuery( "SELECT * FROM cell WHERE id = '" + id + "'" ); while( rs.next() ) { logger.trace( "Loading cell {}", rs.getString( "cell_id" ) ); - try { // To suppress Cell cell; if ( alignment instanceof URIAlignment ) { URI ent1 = new URI( rs.getString("uri1") ); URI ent2 = new URI( rs.getString("uri2") ); if ( ent1 == null || ent2 == null ) break; cell = ((URIAlignment)alignment).addAlignCell( ent1, ent2, rs.getString("relation"), Double.parseDouble(rs.getString("measure")) ); - } else { // load the cell + } else { // load the cell (if this is not a URIAlignment, this is an EDOALAlignment) esrv = new EDOALSQLCache( service ); esrv.init(); Object ent1 = esrv.extractExpression( Long.parseLong( rs.getString("uri1") ) ); @@ -384,8 +383,6 @@ public class SQLCache extends VolatilCache implements Cache { } } cell.setSemantics( rs.getString( "semantics" ) ); - // To suppress - } catch (Exception toto) { toto.printStackTrace(); } } // reset @@ -611,9 +608,10 @@ public class SQLCache extends VolatilCache implements Cache { cellid = alignment.getExtension( Namespace.ALIGNMENT.uri, Annotations.ID ) + cellid; } } else if ( ( c.getExtensions() != null ) || - ( ((EDOALCell)c).transformations() != null && !((EDOALCell)c).transformations().isEmpty() ) || - ( ((EDOALCell)c).linkkeys() != null && !((EDOALCell)c).linkkeys().isEmpty() ) ) { - // if no id => generate one. + ( ( c instanceof EDOALCell ) && + ( ( ((EDOALCell)c).transformations() != null && !((EDOALCell)c).transformations().isEmpty() ) || + ( ((EDOALCell)c).linkkeys() != null && !((EDOALCell)c).linkkeys().isEmpty() ) ) ) ) { + // if no id and we need one for => generate one. cellid = generateCellId(); } else cellid = "";