xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hennebert <vhenneb...@gmail.com>
Subject 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/
Date Thu, 10 Dec 2009 11:25:31 GMT
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


Mime
View raw message