You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by Vincent Hennebert <vh...@gmail.com> on 2009/12/10 12:25:31 UTC

Re: svn commit: r888794 - in /xmlgraphics/commons/trunk: src/java/org/apache/xmlgraphics/xmp/ src/java/org/apache/xmlgraphics/xmp/schemas/ test/java/org/apache/xmlgraphics/xmp/

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

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: svn commit: r888794 - in /xmlgraphics/commons/trunk: src/java/org/apache/xmlgraphics/xmp/ src/java/org/apache/xmlgraphics/xmp/schemas/ test/java/org/apache/xmlgraphics/xmp/

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
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: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org