You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/01/12 11:21:08 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs WhichResource.java

bodewig     2004/01/12 02:21:08

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        WhichResource.java
  Log:
  Merge from HEAD
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.22 +14 -2     ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.21
  retrieving revision 1.503.2.22
  diff -u -r1.503.2.21 -r1.503.2.22
  --- WHATSNEW	18 Dec 2003 08:54:14 -0000	1.503.2.21
  +++ WHATSNEW	12 Jan 2004 10:21:08 -0000	1.503.2.22
  @@ -1,5 +1,17 @@
  -Changes from Ant 1.6.B3 to Ant 1.6
  -==================================
  +Changes from Ant 1.6.0 to Ant 1.6.1
  +===================================
  +
  +Fixed bugs:
  +-----------
  +
  +* Fix handling of default ant namespace for nested elements.
  +
  +* Fix jboss element of ejb task (introduced in ant 1.6.0).
  +
  +* <whichresource> failed to load classes correctly.
  +
  +Changes from Ant 1.6.B3 to Ant 1.6.0
  +====================================
   
   Changes that could break older environments:
   --------------------------------------------
  
  
  
  No                   revision
  No                   revision
  1.5.2.2   +11 -7     ant/src/main/org/apache/tools/ant/taskdefs/WhichResource.java
  
  Index: WhichResource.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/WhichResource.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- WhichResource.java	12 Dec 2003 19:34:26 -0000	1.5.2.1
  +++ WhichResource.java	12 Jan 2004 10:21:08 -0000	1.5.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -168,13 +168,17 @@
           String location = null;
           if (classname != null) {
               //convert a class name into a resource
  -            classname = classname.replace('.', '/');
  -            resource = "/" + classname + ".class";
  -        } else {
  -            if (!resource.startsWith("/")) {
  -                resource = "/" + resource;
  -            }
  +            resource = classname.replace('.', '/') + ".class";
  +        }
  +
  +        if (resource == null) {
  +            throw new BuildException("One of class or resource is required");
           }
  +
  +        if (resource.startsWith("/")) {
  +            resource = resource.substring(1);
  +        }
  +
           log("Searching for " + resource, Project.MSG_VERBOSE);
           URL url;
           url = loader.getResource(resource);
  
  
  

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