ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/ant1compat/org/apache/tools/ant Ant1CompatProject.java BuildException.java
Date Sun, 07 Apr 2002 02:48:39 GMT
adammurdoch    02/04/06 18:48:39

  Modified:    proposal/myrmidon/src/ant1compat/org/apache/tools/ant
                        Ant1CompatProject.java BuildException.java
  Log:
  Fix compile problem.
  
  Revision  Changes    Path
  1.13      +14 -6     jakarta-ant/proposal/myrmidon/src/ant1compat/org/apache/tools/ant/Ant1CompatProject.java
  
  Index: Ant1CompatProject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/ant1compat/org/apache/tools/ant/Ant1CompatProject.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Ant1CompatProject.java	31 Mar 2002 10:56:58 -0000	1.12
  +++ Ant1CompatProject.java	7 Apr 2002 02:48:39 -0000	1.13
  @@ -34,7 +34,7 @@
    * Ant1 original, this class contains the extensions.
    *
    * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a>
  - * @version $Revision: 1.12 $ $Date: 2002/03/31 10:56:58 $
  + * @version $Revision: 1.13 $ $Date: 2002/04/07 02:48:39 $
    */
   public class Ant1CompatProject extends Project
   {
  @@ -447,14 +447,22 @@
        */
       public Hashtable getProperties()
       {
  -        Hashtable propsCopy = new Hashtable();
  +        final Hashtable propsCopy = new Hashtable();
   
  -        Map contextProps = m_context.getProperties();
  -        Iterator propNames = contextProps.keySet().iterator();
  +        final Map contextProps;
  +        try
  +        {
  +            contextProps = m_context.getProperties();
  +        }
  +        catch( final TaskException e )
  +        {
  +            throw new BuildException( e );
  +        }
  +        final Iterator propNames = contextProps.keySet().iterator();
           while( propNames.hasNext() )
           {
  -            String name = (String)propNames.next();
  -            String value = getProperty( name );
  +            final String name = (String)propNames.next();
  +            final String value = getProperty( name );
               if( value != null )
               {
                   propsCopy.put( name, value );
  
  
  
  1.2       +25 -27    jakarta-ant/proposal/myrmidon/src/ant1compat/org/apache/tools/ant/BuildException.java
  
  Index: BuildException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/ant1compat/org/apache/tools/ant/BuildException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BuildException.java	20 Mar 2002 22:30:55 -0000	1.1
  +++ BuildException.java	7 Apr 2002 02:48:39 -0000	1.2
  @@ -71,16 +71,15 @@
   public class BuildException extends RuntimeException {
   
       /** Exception that might have caused this one. */
  -    private Throwable cause;
  +    private Throwable m_cause;
   
       /** Location in the build file where the exception occured */
  -    private Location location = Location.UNKNOWN_LOCATION;
  +    private Location m_location = Location.UNKNOWN_LOCATION;
   
       /**
        * Constructs a build exception with no descriptive information.
        */
       public BuildException() {
  -        super();
       }
   
       /**
  @@ -89,7 +88,7 @@
        * @param msg A description of or information about the exception.
        *            Should not be <code>null</code>.
        */
  -    public BuildException(String msg) {
  +    public BuildException(final String msg) {
           super(msg);
       }
   
  @@ -102,9 +101,9 @@
        * @param cause The exception that might have caused this one.
        *              May be <code>null</code>.
        */
  -    public BuildException(String msg, Throwable cause) {
  +    public BuildException(final String msg, final Throwable cause) {
           super(msg);
  -        this.cause = cause;
  +        m_cause = cause;
       }
   
       /**
  @@ -118,9 +117,11 @@
        * @param location The location in the project file where the error 
        *                 occurred. Must not be <code>null</code>.
        */
  -    public BuildException(String msg, Throwable cause, Location location) {
  +    public BuildException( final String msg,
  +                           final Throwable cause,
  +                           final Location location) {
           this(msg, cause);
  -        this.location = location;
  +        m_location = location;
       }
   
       /**
  @@ -129,9 +130,8 @@
        * @param cause The exception that might have caused this one.
        *              Should not be <code>null</code>.
        */
  -    public BuildException(Throwable cause) {
  -        super(cause.toString());
  -        this.cause = cause;
  +    public BuildException(final Throwable cause ) {
  +        this(cause.getMessage(), cause);
       }
   
       /**
  @@ -143,9 +143,9 @@
        * @param location The location in the project file where the error 
        *                 occurred. Must not be <code>null</code>.
        */
  -    public BuildException(String msg, Location location) {
  +    public BuildException(final String msg, final Location location) {
           super(msg);
  -        this.location = location;
  +        m_location = location;
       }
   
       /**
  @@ -157,9 +157,9 @@
        * @param location The location in the project file where the error 
        *                 occurred. Must not be <code>null</code>.
        */
  -    public BuildException(Throwable cause, Location location) {
  +    public BuildException(final Throwable cause, final Location location) {
           this(cause);
  -        this.location = location;
  +        m_location = location;
       }
   
       /**
  @@ -169,7 +169,7 @@
        *         exception is associated with this one
        */
       public Throwable getException() {
  -        return cause;
  +        return m_cause;
       }
   
       /**
  @@ -178,7 +178,7 @@
        * @return the location of the error and the error message
        */
       public String toString() {
  -        return location.toString() + getMessage();
  +        return m_location.toString() + getMessage();
       }
   
       /**
  @@ -187,8 +187,8 @@
        * @param location The file location where the error occurred.
        *                 Must not be <code>null</code>.
        */
  -    public void setLocation(Location location) {
  -        this.location = location;
  +    public void setLocation(final Location location) {
  +        m_location = location;
       }
   
       /**
  @@ -197,7 +197,7 @@
        * @return the file location where the error occurred.
        */
       public Location getLocation() {
  -        return location;
  +        return m_location;
       }
   
       /**
  @@ -218,9 +218,9 @@
       public void printStackTrace(PrintStream ps) {
           synchronized (ps) {
               super.printStackTrace(ps);
  -            if (cause != null) {
  +            if (m_cause != null) {
                   ps.println("--- Nested Exception ---");
  -                cause.printStackTrace(ps);
  +                m_cause.printStackTrace(ps);
               }
           }
       }
  @@ -235,21 +235,19 @@
       public void printStackTrace(PrintWriter pw) {
           synchronized (pw) {
               super.printStackTrace(pw);
  -            if (cause != null) {
  +            if (m_cause != null) {
                   pw.println("--- Nested Exception ---");
  -                cause.printStackTrace(pw);
  +                m_cause.printStackTrace(pw);
               }
           }
       }
   
  -    //-------------------Modified from Ant1 ---------------------
       /**
        * Myrmidon-friendly cascading exception method.
        * @return the cascading cause of this exception.
        */
       public Throwable getCause()
       {
  -        return cause;
  +        return m_cause;
       }
  -    //--------------------- End modified section ---------------
   }
  
  
  

--
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