Skip to Content.
Sympa Menu

notify-dpml - r1119 - in trunk/main: . central/src/docs/about/reports central/src/docs/about/setup transit/core/src/main/net/dpml/transit transit/core/src/test/net/dpml/transit/test

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1119 - in trunk/main: . central/src/docs/about/reports central/src/docs/about/setup transit/core/src/main/net/dpml/transit transit/core/src/test/net/dpml/transit/test
  • Date: Sat, 18 Feb 2006 05:46:55 +0100

Author: mcconnell
Date: 2006-02-18 05:46:34 +0100 (Sat, 18 Feb 2006)
New Revision: 1119

Modified:
trunk/main/build.xml
trunk/main/central/src/docs/about/reports/index.xml
trunk/main/central/src/docs/about/reports/navigation.xml
trunk/main/central/src/docs/about/setup/archive.xml
trunk/main/transit/core/src/main/net/dpml/transit/Construct.java

trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
Log:
1. resolve the checkstyle errors from Construct class changes
2. remove checkstyle report for the site content

Modified: trunk/main/build.xml
===================================================================
--- trunk/main/build.xml 2006-02-17 08:05:13 UTC (rev 1118)
+++ trunk/main/build.xml 2006-02-18 04:46:34 UTC (rev 1119)
@@ -136,6 +136,7 @@
<copy todir="${share.docs.reports}">
<fileset dir="target/reports">
<exclude name="api/**"/>
+ <exclude name="checkstyle/**"/>
</fileset>
</copy>
<copy todir="${share.docs}">

Modified: trunk/main/central/src/docs/about/reports/index.xml
===================================================================
--- trunk/main/central/src/docs/about/reports/index.xml 2006-02-17 08:05:13
UTC (rev 1118)
+++ trunk/main/central/src/docs/about/reports/index.xml 2006-02-18 04:46:34
UTC (rev 1119)
@@ -31,10 +31,6 @@
modules together with Javadocs for the Planet component
suite.</td>
</tr>
<tr>
- <td><a
href="../../reports/@VERSION@/checkstyle/index.html">Checkstyle</a></td>
- <td>Style compliance report based on the Checkstyle tool with DPML
style rules.</td>
- </tr>
- <tr>
<td><a
href="../../reports/@VERSION@/catalog/index.html">Catalog</a></td>
<td>Description of all component types.</td>
</tr>

Modified: trunk/main/central/src/docs/about/reports/navigation.xml
===================================================================
--- trunk/main/central/src/docs/about/reports/navigation.xml 2006-02-17
08:05:13 UTC (rev 1118)
+++ trunk/main/central/src/docs/about/reports/navigation.xml 2006-02-18
04:46:34 UTC (rev 1119)
@@ -27,7 +27,6 @@
<menu>
<item name="Junit" href="../../reports/@VERSION@/junit/index.html"/>
<item name="Javadocs" href="../../api/dpml/@VERSION@/index.html"/>
- <item name="Checkstyle"
href="../../reports/@VERSION@/checkstyle/index.html"/>
<item name="Catalog"
href="../../reports/@VERSION@/catalog/index.html"/>
</menu>


Modified: trunk/main/central/src/docs/about/setup/archive.xml
===================================================================
--- trunk/main/central/src/docs/about/setup/archive.xml 2006-02-17 08:05:13
UTC (rev 1118)
+++ trunk/main/central/src/docs/about/setup/archive.xml 2006-02-18 04:46:34
UTC (rev 1119)
@@ -19,8 +19,6 @@
<subsection name="Build @VERSION@">

<p>
- The @VERSION@ milestone adds support for array datatype (primitive
and complex)
- to the context IOC model.
</p>

<table>
@@ -57,13 +55,57 @@

<p>
Online <a href="http://api.dpml.net/dpml/@VERSION@";>Javadoc</a>,
- <a href="http://www.dpml.net/reports/@VERSION@/junit";>JUnit</a>, <a
href="http://www.dpml.net/reports/@VERSION@/checkstyle/index.html";>Checkstyle</a>
and <a
href="http://www.dpml.net/reports/@VERSION@/catalog/index.html";>Catalog</a>
reports are available.
+ <a href="http://www.dpml.net/reports/@VERSION@/junit";>JUnit</a> and
<a
href="http://www.dpml.net/reports/@VERSION@/catalog/index.html";>Catalog</a>
reports are available.
</p>

</subsection>

+ <subsection name="Build 20060217">

+ <p>
+ The 20060217 milestone adds support for array datatypes (primitive
and complex)
+ to the context IOC model.
+ </p>

+ <table>
+ <tr>
+ <td>Windows NSIS Installer</td>
+ <td>
+ <a
href="http://download.dpml.net/milestones/20060217/dpml-sdk-win32-20060217.zip";>
+ dpml-sdk-win32-20060217.exe</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Windows Zip Archive</td>
+ <td>
+ <a
href="http://download.dpml.net/milestones/20060217/dpml-sdk-win32-20060217.zip";>
+ dpml-sdk-win32-20060217.zip</a>
+ </td>
+ <td>
+ <a
href="http://download.dpml.net/milestones/20060217/dpml-sdk-win32-20060217.zip.md5";>
+ MD5</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Linux Archive</td>
+ <td>
+ <a
href="http://download.dpml.net/milestones/20060217/dpml-sdk-linux-20060217.tar.gz";>
+ dpml-sdk-linux-20060217.tar.gz</a>
+ </td>
+ <td>
+ <a
href="http://download.dpml.net/milestones/20060217/dpml-sdk-linux-20060217.tar.gz.md5";>
+ MD5</a>
+ </td>
+ </tr>
+ </table>
+
+ <p>
+ Online <a href="http://api.dpml.net/dpml/20060217";>Javadoc</a>,
+ <a href="http://www.dpml.net/reports/20060217/junit";>JUnit</a>, <a
href="http://www.dpml.net/reports/20060217/checkstyle/index.html";>Checkstyle</a>
and <a
href="http://www.dpml.net/reports/20060217/catalog/index.html";>Catalog</a>
reports are available.
+ </p>
+
+ </subsection>
+
<subsection name="Build 20060215">

<p>

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
2006-02-17 08:05:13 UTC (rev 1118)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
2006-02-18 04:46:34 UTC (rev 1119)
@@ -18,10 +18,6 @@

package net.dpml.transit;

-import java.beans.SimpleBeanInfo;
-import java.beans.BeanDescriptor;
-import java.beans.DefaultPersistenceDelegate;
-import java.beans.Encoder;
import java.beans.Expression;
import java.io.Serializable;
import java.lang.reflect.Field;
@@ -429,191 +425,7 @@
Class type = c.getComponentType();
if( type.isPrimitive() )
{
- Object result = Array.newInstance( type,
instances.length );
- if( Integer.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Integer )
- {
- Integer integer = (Integer) instance;
- int v = integer.intValue();
- Array.setInt( result, i, v );
- }
- else
- {
- final String error =
- "Supplied int array argument class ["
- + instance.getClass().getName()
- + "] is not an Integer.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Short.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Short )
- {
- Short primitive = (Short) instance;
- short v = primitive.shortValue();
- Array.setShort( result, i, v );
- }
- else
- {
- final String error =
- "Supplied short array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Short.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Long.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Long )
- {
- Long primitive = (Long) instance;
- long v = primitive.longValue();
- Array.setLong( result, i, v );
- }
- else
- {
- final String error =
- "Supplied long array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Long.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Byte.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Byte )
- {
- Byte primitive = (Byte) instance;
- byte v = primitive.byteValue();
- Array.setByte( result, i, v );
- }
- else
- {
- final String error =
- "Supplied byte array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Byte.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Double.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Double )
- {
- Double primitive = (Double) instance;
- double v = primitive.doubleValue();
- Array.setDouble( result, i, v );
- }
- else
- {
- final String error =
- "Supplied double array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Double.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Float.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Float )
- {
- Float primitive = (Float) instance;
- float v = primitive.floatValue();
- Array.setFloat( result, i, v );
- }
- else
- {
- final String error =
- "Supplied float array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Float.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Character.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Character )
- {
- Character primitive = (Character) instance;
- char v = primitive.charValue();
- Array.setChar( result, i, v );
- }
- else
- {
- final String error =
- "Supplied char array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Character.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else if( Boolean.TYPE == type )
- {
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Boolean )
- {
- Boolean primitive = (Boolean) instance;
- boolean v = primitive.booleanValue();
- Array.setBoolean( result, i, v );
- }
- else
- {
- final String error =
- "Supplied boolean array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Boolean.";
- throw new ValueException( error );
- }
- }
- return result;
- }
- else
- {
- final String error =
- "Primitive array class ["
- + type.getName()
- + "] is not recognized.";
- throw new UnsupportedOperationException( error );
- }
+ return buildPrimitiveArray( type, instances );
}
else
{
@@ -631,7 +443,6 @@
final String error =
"Array ["
+ type.getName()
-
+ "] contains an invalid element ["
+ instance.getClass().getName()
+ "].";
@@ -703,7 +514,244 @@
throw new ValueException( error, e );
}
}
+
+ private Object buildPrimitiveArray( Class type, Object[] instances )
throws ValueException
+ {
+ Object result = Array.newInstance( type, instances.length );
+ if( Integer.TYPE == type )
+ {
+ return buildIntArray( instances );
+ }
+ else if( Short.TYPE == type )
+ {
+ return buildShortArray( instances );
+ }
+ else if( Long.TYPE == type )
+ {
+ return buildLongArray( instances );
+ }
+ else if( Byte.TYPE == type )
+ {
+ return buildByteArray( instances );
+ }
+ else if( Double.TYPE == type )
+ {
+ return buildDoubleArray( instances );
+ }
+ else if( Float.TYPE == type )
+ {
+ return buildFloatArray( instances );
+ }
+ else if( Character.TYPE == type )
+ {
+ return buildCharacterArray( instances );
+ }
+ else if( Boolean.TYPE == type )
+ {
+ return buildBooleanArray( instances );
+ }
+ else
+ {
+ final String error =
+ "Primitive array class ["
+ + type.getName()
+ + "] is not recognized.";
+ throw new UnsupportedOperationException( error );
+ }
+ }

+ private Object buildIntArray( Object[] instances ) throws ValueException
+ {
+ Object result = Array.newInstance( Integer.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Integer )
+ {
+ Integer integer = (Integer) instance;
+ int v = integer.intValue();
+ Array.setInt( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied int array argument class ["
+ + instance.getClass().getName()
+ + "] is not an Integer.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildShortArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Short.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Short )
+ {
+ Short primitive = (Short) instance;
+ short v = primitive.shortValue();
+ Array.setShort( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied short array argument class ["
+ + instance.getClass().getName()
+ + "] is not an Short.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildLongArray( Object[] instances ) throws ValueException
+ {
+ Object result = Array.newInstance( Long.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Long )
+ {
+ Long primitive = (Long) instance;
+ long v = primitive.longValue();
+ Array.setLong( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied long array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Long.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildByteArray( Object[] instances ) throws ValueException
+ {
+ Object result = Array.newInstance( Byte.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Byte )
+ {
+ Byte primitive = (Byte) instance;
+ byte v = primitive.byteValue();
+ Array.setByte( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied byte array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Byte.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildDoubleArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Double.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Double )
+ {
+ Double primitive = (Double) instance;
+ double v = primitive.doubleValue();
+ Array.setDouble( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied double array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Double.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildFloatArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Float.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Float )
+ {
+ Float primitive = (Float) instance;
+ float v = primitive.floatValue();
+ Array.setFloat( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied float array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Float.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildCharacterArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Character.TYPE, instances.length
);
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Character )
+ {
+ Character primitive = (Character) instance;
+ char v = primitive.charValue();
+ Array.setChar( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied char array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Character.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildBooleanArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Boolean.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Boolean )
+ {
+ Boolean primitive = (Boolean) instance;
+ boolean v = primitive.booleanValue();
+ Array.setBoolean( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied boolean array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Boolean.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
private Object[] getInstanceValues(
Map map, ClassLoader classloader, Value[] args ) throws Exception
{

Modified:
trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
2006-02-17 08:05:13 UTC (rev 1118)
+++
trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
2006-02-18 04:46:34 UTC (rev 1119)
@@ -198,6 +198,10 @@
}
}

+ /**
+ * Test array return type.
+ * @exception Exception if an unexpected error occurs.
+ */
public void testSimpleArray() throws Exception
{
String[] args = new String[]{"aaa", "bbb"};
@@ -209,6 +213,10 @@
assertTrue( "simple-array", equal );
}

+ /**
+ * Test array with zero entries.
+ * @exception Exception if an unexpected error occurs.
+ */
public void testZeroLengthArray() throws Exception
{
String[] args = new String[0];
@@ -238,7 +246,7 @@
*/
public void testPrimitiveArray() throws Exception
{
- int[] args = new int[]{ 1, 2, 3 };
+ int[] args = new int[]{1, 2, 3};
Value p1 = new Construct( "int", "1" );
Value p2 = new Construct( "int", "2" );
Value p3 = new Construct( "int", "3" );




  • r1119 - in trunk/main: . central/src/docs/about/reports central/src/docs/about/setup transit/core/src/main/net/dpml/transit transit/core/src/test/net/dpml/transit/test, mcconnell at BerliOS, 02/17/2006

Archive powered by MHonArc 2.6.24.

Top of Page