ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6514] New: - When redefining a datatype it should check if the class is the same
Date Mon, 18 Feb 2002 01:19:35 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6514>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6514

When redefining a datatype it should check if the class is the same

           Summary: When redefining a datatype it should check if the class
                    is the same
           Product: Ant
           Version: 1.5 alpha (nightly)
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: pkr@netnord.dk


When redefining a datatype it should check if the class name in the new
definition is the same as the class name in the previous definition. Just the
same as when a task is redefined.

Here is a simple patch, where the changes are copyied from the code that defines
a task:

Index: src/main/org/apache/tools/ant/Project.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.93
diff -c -r1.93 Project.java
*** src/main/org/apache/tools/ant/Project.java  2 Feb 2002 12:52:00 -0000      1.93
--- src/main/org/apache/tools/ant/Project.java  18 Feb 2002 01:16:22 -0000
***************
*** 659,667 ****
       * @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);
          }
  
          String msg = " +User datatype: " + typeName + "     " +
typeClass.getName();
--- 659,675 ----
       * @param typeClass full datatype classname     
       */
      public void addDataTypeDefinition(String typeName, Class typeClass) {
!         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();

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message