From: Chad B. <cwb...@us...> - 2005-05-24 14:34:31
|
User: cwbrandon Date: 05/05/24 07:34:23 Modified: src/java/org/andromda/core/mapping Mappings.java Log: improve error message Revision Changes Path 1.30 +16 -10 andromda/src/java/org/andromda/core/mapping/Mappings.java Index: Mappings.java =================================================================== RCS file: /cvsroot/andromda/andromda/src/java/org/andromda/core/mapping/Mappings.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -r1.29 -r1.30 --- Mappings.java 23 May 2005 02:27:40 -0000 1.29 +++ Mappings.java 24 May 2005 14:34:22 -0000 1.30 @@ -1,21 +1,20 @@ package org.andromda.core.mapping; -import org.andromda.core.common.ExceptionUtils; -import org.andromda.core.common.XmlObjectFactory; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.ToStringBuilder; - import java.io.File; import java.io.FileReader; - +import java.net.MalformedURLException; import java.net.URL; - import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; +import org.andromda.core.common.ExceptionUtils; +import org.andromda.core.common.XmlObjectFactory; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.builder.ToStringBuilder; + /** * <p> An object responsible for mapping multiple <code>from</code> values to @@ -64,8 +63,15 @@ Mappings mappings = (Mappings)logicalMappings.get(mappingsUri); if (mappings == null) { + try + { mappings = getInstance(new URL(mappingsUri)); } + catch (final MalformedURLException exception) + { + throw new MappingsException("The given URI --> '" + mappingsUri + "' is invalid", exception); + } + } return getInheritedMappings(mappings); } catch (Throwable th) @@ -124,11 +130,11 @@ // mappings, try a relative path parentMappings = getInstance(new File(mappings.getCompletePath(mappings.extendsUri))); } - catch (Exception ex) + catch (final Exception exception) { if (!ignoreInheritanceFailure) { - throw ex; + throw exception; } } } |