Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d3fa0c66 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- corrected a bug in cell storage (unsafe casting to EDOALCell)

parent 15f6ae5d
No related branches found
No related tags found
No related merge requests found
......@@ -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 = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment