commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/stat/data CertifiedDataAbstractTest.java
Date Mon, 06 Dec 2004 05:49:44 GMT
psteitz     2004/12/05 21:49:44

  Modified:    math/src/java/org/apache/commons/math/linear
                        InvalidMatrixException.java
                        MatrixIndexException.java
               math/src/test/org/apache/commons/math/linear
                        InvalidMatrixExceptionTest.java
                        MatrixIndexExceptionTest.java
               math/src/test/org/apache/commons/math/stat/data
                        CertifiedDataAbstractTest.java
  Log:
  Removed JDK 1.4 dependent code.
  PR# 32538.
  
  Revision  Changes    Path
  1.8       +3 -19     jakarta-commons/math/src/java/org/apache/commons/math/linear/InvalidMatrixException.java
  
  Index: InvalidMatrixException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/linear/InvalidMatrixException.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- InvalidMatrixException.java	11 Jul 2004 18:43:44 -0000	1.7
  +++ InvalidMatrixException.java	6 Dec 2004 05:49:44 -0000	1.8
  @@ -31,7 +31,7 @@
        * Default constructor.
        */
       public InvalidMatrixException() {
  -        this(null, null);
  +        this(null);
       }
   
       /**
  @@ -39,23 +39,7 @@
        * @param message descriptive error message.
        */
       public InvalidMatrixException(String message) {
  -        this(message, null);
  +        super(message);
       }
   
  -    /**
  -     * Construct an exception with the given message and root cause.
  -     * @param message descriptive error message.
  -     * @param cause root cause.
  -     */
  -    public InvalidMatrixException(String message, Throwable cause) {
  -        super(message, cause);
  -    }
  -
  -    /**
  -     * Create an exception with a given root cause.
  -     * @param throwable caught exception causing this problem
  -     */
  -    public InvalidMatrixException(Throwable throwable) {
  -        this(null, throwable);
  -    }
   }
  
  
  
  1.8       +4 -20     jakarta-commons/math/src/java/org/apache/commons/math/linear/MatrixIndexException.java
  
  Index: MatrixIndexException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/linear/MatrixIndexException.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MatrixIndexException.java	11 Jul 2004 18:43:44 -0000	1.7
  +++ MatrixIndexException.java	6 Dec 2004 05:49:44 -0000	1.8
  @@ -30,31 +30,15 @@
        * Default constructor.
        */
       public MatrixIndexException() {
  -        this(null, null);
  -    }
  -
  -    /**
  -     * Construct an exception with the given message.
  -     * @param message descriptive error message.
  -     */
  -    public MatrixIndexException(String message) {
  -        this(message, null);
  +        this(null);
       }
   
       /**
        * Construct an exception with the given message and root cause.
        * @param message descriptive error message.
  -     * @param cause root cause.
        */
  -    public MatrixIndexException(String message, Throwable cause) {
  -        super(message, cause);
  +    public MatrixIndexException(String message) {
  +        super(message);
       }
   
  -    /**
  -     * Create an exception with a given root cause.
  -     * @param throwable caught exception causing this problem
  -     */
  -    public MatrixIndexException(Throwable throwable) {
  -        this(null, throwable);
  -    }
   }
  
  
  
  1.2       +1 -25     jakarta-commons/math/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java
  
  Index: InvalidMatrixExceptionTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvalidMatrixExceptionTest.java	27 Apr 2004 16:51:52 -0000	1.1
  +++ InvalidMatrixExceptionTest.java	6 Dec 2004 05:49:44 -0000	1.2
  @@ -27,7 +27,6 @@
        */
       public void testConstructor(){
           InvalidMatrixException ex = new InvalidMatrixException();
  -        assertNull(ex.getCause());
           assertNull(ex.getMessage());
       }
       
  @@ -37,29 +36,6 @@
       public void testConstructorMessage(){
           String msg = "message";
           InvalidMatrixException ex = new InvalidMatrixException(msg);
  -        assertNull(ex.getCause());
           assertEquals(msg, ex.getMessage());
  -    }
  -    
  -    /**
  -     * 
  -     */
  -    public void testConstructorMessageCause(){
  -        String outMsg = "outer message";
  -        String inMsg = "inner message";
  -        Exception cause = new Exception(inMsg);
  -        InvalidMatrixException ex = new InvalidMatrixException(outMsg, cause);
  -        assertEquals(outMsg, ex.getMessage());
  -        assertEquals(cause, ex.getCause());
  -    }
  -    
  -    /**
  -     * 
  -     */
  -    public void testConstructorCause(){
  -        String inMsg = "inner message";
  -        Exception cause = new Exception(inMsg);
  -        InvalidMatrixException ex = new InvalidMatrixException(cause);
  -        assertEquals(cause, ex.getCause());
       }
   }
  
  
  
  1.2       +1 -25     jakarta-commons/math/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java
  
  Index: MatrixIndexExceptionTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MatrixIndexExceptionTest.java	27 Apr 2004 16:51:52 -0000	1.1
  +++ MatrixIndexExceptionTest.java	6 Dec 2004 05:49:44 -0000	1.2
  @@ -27,7 +27,6 @@
        */
       public void testConstructor(){
           MatrixIndexException ex = new MatrixIndexException();
  -        assertNull(ex.getCause());
           assertNull(ex.getMessage());
       }
       
  @@ -37,29 +36,6 @@
       public void testConstructorMessage(){
           String msg = "message";
           MatrixIndexException ex = new MatrixIndexException(msg);
  -        assertNull(ex.getCause());
           assertEquals(msg, ex.getMessage());
  -    }
  -    
  -    /**
  -     * 
  -     */
  -    public void testConstructorMessageCause(){
  -        String outMsg = "outer message";
  -        String inMsg = "inner message";
  -        Exception cause = new Exception(inMsg);
  -        MatrixIndexException ex = new MatrixIndexException(outMsg, cause);
  -        assertEquals(outMsg, ex.getMessage());
  -        assertEquals(cause, ex.getCause());
  -    }
  -    
  -    /**
  -     * 
  -     */
  -    public void testConstructorCause(){
  -        String inMsg = "inner message";
  -        Exception cause = new Exception(inMsg);
  -        MatrixIndexException ex = new MatrixIndexException(cause);
  -        assertEquals(cause, ex.getCause());
       }
   }
  
  
  
  1.8       +5 -6      jakarta-commons/math/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java
  
  Index: CertifiedDataAbstractTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CertifiedDataAbstractTest.java	8 Oct 2004 05:08:19 -0000	1.7
  +++ CertifiedDataAbstractTest.java	6 Dec 2004 05:49:44 -0000	1.8
  @@ -16,10 +16,10 @@
   
   package org.apache.commons.math.stat.data;
   
  -import java.beans.Expression;
   import java.io.BufferedReader;
   import java.io.IOException;
   import java.io.InputStreamReader;
  +import java.lang.reflect.Method;
   import java.net.URL;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -134,9 +134,8 @@
   	
   	protected Object getProperty(Object bean, String name) throws Exception{
   	    // Get the value of prop
  -	    String prop = "get" + name.substring(0,1).toUpperCase() + name.substring(1);
  -        Expression expr = new Expression(bean, prop, new Object[0]);
  -        expr.execute();
  -        return expr.getValue();
  +	    String prop = "get" + name.substring(0,1).toUpperCase() + name.substring(1); 
  +        Method meth = bean.getClass().getMethod(prop, new Class[0]);
  +        return meth.invoke(bean, new Object[0]);
   	}
   }
  
  
  

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


Mime
View raw message