BlockInfoReader.java patch
Mircea Toma <[email protected]>
| Newsgroups | gmane.comp.java.jcontainer.interest |
|---|---|
| Message-ID | <[email protected]> |
Hi, This is a patch for org\jcontainer\loom\components\util\infobuilder\BlockInfoReader.java class. Modified the code to avoid NPE when a value is not provided for @dna.dependency key="*". Modified the code to avoid NPE when a value is not provided for @dna.dependency optional="true/false". Mircea
BlockInfoReader.java.patch
(text/plain, 1.4 KB)
Index: engine/src/java/org/jcontainer/loom/components/util/infobuilder/BlockInfoReader.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/util/infobuilder/BlockInfoReader.java,v
retrieving revision 1.2
diff -u -r1.2 BlockInfoReader.java
--- engine/src/java/org/jcontainer/loom/components/util/infobuilder/BlockInfoReader.java 18 Oct 2003 07:29:55 -0000 1.2
+++ engine/src/java/org/jcontainer/loom/components/util/infobuilder/BlockInfoReader.java 29 Oct 2003 01:02:31 -0000
@@ -108,11 +108,12 @@
for( int i = 0; i < attributes.length; i++ )
{
final Attribute attribute = attributes[ i ];
- final String key = attribute.getParameter( "key" );
final String depType = attribute.getParameter( "type" );
+ final String key = attribute.getParameter( "key", depType );
final boolean optional =
- attribute.getParameter( "optional" ).equals( "true" );
- deps.add( new DependencyDescriptor( key, depType, optional ) );
+ "true".equals( attribute.getParameter( "optional" ) );
+ final DependencyDescriptor dependencyDescriptor = new DependencyDescriptor( key, depType, optional );
+ deps.add( dependencyDescriptor );
}
return (DependencyDescriptor[])deps.toArray( DependencyDescriptor.EMPTY_SET );