Author: jlboudart
Date: Wed Aug 21 07:54:21 2013
New Revision: 1516105
URL: http://svn.apache.org/r1516105
Log:
Be less agressive on catch clauses, Exception is caught when Exception is not
thrown
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntConfigParser.java
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntConfigParser.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntConfigParser.java?rev=1516105&r1=1516104&r2=1516105&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntConfigParser.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntConfigParser.java
Wed Aug 21 07:54:21 2013
@@ -215,7 +215,7 @@ public class EasyAntConfigParser {
String key = (String) propertiesEnum.nextElement();
easyAntConfiguration.getDefinedProps().put(key,
properties.get(key));
}
- } catch (Exception e) {
+ } catch (IOException e) {
if (attributes.getValue("file") != null) {
throw new SAXException("can't read property file
at : " + attributes.getValue("file"));
} else if (attributes.getValue("url") != null) {
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java?rev=1516105&r1=1516104&r2=1516105&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
Wed Aug 21 07:54:21 2013
@@ -641,14 +641,15 @@ public class SubModule extends AbstractE
Class<?> c = orig.getClass();
Object copy = orig;
+ Method cloneM;
try {
- Method cloneM = c.getMethod("clone", new Class[0]);
+ cloneM = c.getMethod("clone", new Class[0]);
if (cloneM != null) {
copy = cloneM.invoke(orig, new Object[0]);
log("Adding clone of reference " + oldKey, Project.MSG_DEBUG);
}
- } catch (Exception e) {
- // not Clonable
+ } catch (ReflectiveOperationException e) {
+ // not clonable
}
if (copy instanceof ProjectComponent) {
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java?rev=1516105&r1=1516104&r2=1516105&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
Wed Aug 21 07:54:21 2013
@@ -662,9 +662,12 @@ public class EasyAntRepositoryCacheManag
Message.debug("\tresolver not found: " + resolverName
+ " => cannot use cached ivy file for "
+ mrid);
}
- } catch (Exception e) {
+ } catch (ParseException e) {
// will try with resolver
Message.debug("\tproblem while parsing cached ivy file
for: " + mrid + ": " + e.getMessage());
+ } catch (IOException e) {
+ // will try with resolver
+ Message.debug("\tproblem while accessing cached ivy file
for: " + mrid + ": " + e.getMessage());
}
} else {
Message.debug("\tno ivy file in cache for " + mrid + ": tried
" + ivyFile);