Browse Source

Ignore redefinition of datatypes if new and old class are the same.

PR: 6514
Submitted by:	Peter Kristensen <pkr@netnord.dk>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271425 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
c2f05281ce
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      src/main/org/apache/tools/ant/Project.java

+ 11
- 3
src/main/org/apache/tools/ant/Project.java View File

@@ -659,9 +659,17 @@ public class Project {
* @param typeClass full datatype classname
*/
public void addDataTypeDefinition(String typeName, Class typeClass) {
if (null != dataClassDefinitions.get(typeName)) {
log("Trying to override old definition of datatype "+typeName,
MSG_WARN);
Class old = (Class)dataClassDefinitions.get(typeName);
if (null != old) {
if (old.equals(typeClass)) {
log("Ignoring override for datatype " + typeName
+ ", it is already defined by the same class.",
MSG_VERBOSE);
return;
} else {
log("Trying to override old definition of datatype "+typeName,
MSG_WARN);
}
}

String msg = " +User datatype: " + typeName + " " + typeClass.getName();


Loading…
Cancel
Save