You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/04/01 06:17:28 UTC
svn commit: r1875983 -
/pdfbox/branches/issue45/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchema.java
Author: tilman
Date: Wed Apr 1 06:17:28 2020
New Revision: 1875983
URL: http://svn.apache.org/viewvc?rev=1875983&view=rev
Log:
PDFBOX-4071: simplify code
Modified:
pdfbox/branches/issue45/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchema.java
Modified: pdfbox/branches/issue45/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchema.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchema.java?rev=1875983&r1=1875982&r2=1875983&view=diff
==============================================================================
--- pdfbox/branches/issue45/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchema.java (original)
+++ pdfbox/branches/issue45/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchema.java Wed Apr 1 06:17:28 2020
@@ -1120,21 +1120,11 @@ public class XMPSchema extends AbstractS
for (AbstractField child : arrayProp.getContainer().getAllProperties())
{
Attribute text = child.getAttribute(XmpConstants.LANG_NAME);
- if (text != null)
- {
- retval.add(text.getValue());
- }
- else
- {
- retval.add(XmpConstants.X_DEFAULT);
- }
+ retval.add(text != null ? text.getValue() : XmpConstants.X_DEFAULT);
}
return retval;
}
- else
- {
- throw new IllegalArgumentException("The property '" + name + "' is not of Lang Alt type");
- }
+ throw new IllegalArgumentException("The property '" + name + "' is not of Lang Alt type");
}
// no property with that name
return null;