Thanks for the nudge and the typo fixes, Vincent. I've fixed a few
smaller bugs by improving test coverage. The whole thing should behave
much better now.

On 10.12.2009 12:25:31 Vincent Hennebert wrote:
> Hi,
> 
> > Author: jeremias
> > Date: Wed Dec  9 13:21:04 2009
> > New Revision: 888794
> > 
> > URL: http://svn.apache.org/viewvc?rev=888794&view=rev
> > Log:
> > Added access methods for the remaining Dublin Core properties to the 
> > adapter.
> > Added support for removing properties.
> > 
> > Added:
> >     
> > xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/xmp/XMPPropertyTest.java
> > Modified:
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/Metadata.java
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/PropertyAccess.java
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPArray.java
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPStructure.java
> >     
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/DublinCoreAdapter.java
> > 
> <snip/>
> > Modified: 
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java
> > URL: 
> > http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java?rev=888794&r1=888793&r2=888794&view=diff
> > ==============================================================================
> > --- 
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java
> >  (original)
> > +++ 
> > xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java
> >  Wed Dec  9 13:21:04 2009
> > @@ -272,11 +306,13 @@
> >      protected void setValue(String propName, String value) {
> >          QName name = getQName(propName);
> >          XMPProperty prop = meta.getProperty(name);
> > -        if (prop == null) {
> > +        if (prop == null && value != null && value.length() > 0) {
> >              prop = new XMPProperty(name, value);
> >              meta.setProperty(prop);
> > -        } else {
> > +        } else if (value != null) {
> >              prop.setValue(value);
> > +        } else {
> > +            meta.removeProperty(name);
> 
> What’s supposed to happen if (prop == null && value != null && value.length()
> == 0)?
> 
> Vincent
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to