Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 482b1f5e authored by Nicolas Guillouet's avatar Nicolas Guillouet
Browse files

Fix NullPointerException on translateMessage

parent ac30d1b7
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ import fr.inrialpes.exmo.ontowrap.OntowrapException;
* In version 3.0 this class is virtually abstract.
* But it cannot be declared abstract because it uses its own constructor.
*
* @author Jrme Euzenat, David Loup, Raphal Troncy
* @author Jérôme Euzenat, David Loup, Raphaël Troncy
* @version $Id$
*/
......@@ -830,7 +830,7 @@ public class BasicAlignment implements Alignment {
for ( Map.Entry<Object,Object> m : prefix.entrySet() ) {
if ( m.getKey() != null ) {
mainQuery = Pattern.compile("<"+m.getValue()+"([A-Za-z0-9_-]+)>").matcher(mainQuery).replaceAll( m.getKey()+":$1" );
mainQuery = "PREFIX "+m.getKey()+": <"+m.getValue()+"> .\n" + mainQuery;
mainQuery = "PREFIX "+m.getKey()+": <"+m.getValue()+"> \n" + mainQuery;
}
}
......@@ -843,8 +843,12 @@ public class BasicAlignment implements Alignment {
try {
// The second part replaces the named items by their counterparts
for( Cell cell : this ){
URI uri1 = cell.getObject1AsURI(this);
URI uri2 = cell.getObject2AsURI(this);
if(uri1 != null && uri2 != null){
result = result.replaceAll( cell.getObject1AsURI(this).toString(),
cell.getObject2AsURI(this).toString() );
}
}
} catch (AlignmentException alex) {
logger.debug( "IGNORED AlignmentException {}", alex );
......
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