Skip to content

Commit 8551f8b

Browse files
committed
PDFBOX-5660: sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1932606 13f79535-47bb-0310-9956-ffa450edef68
1 parent bcf7896 commit 8551f8b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

xmpbox/src/main/java/org/apache/xmpbox/schema/PDFAIdentificationSchema.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
package org.apache.xmpbox.schema;
2323

24+
import java.util.Set;
2425
import org.apache.xmpbox.XMPMetadata;
2526
import org.apache.xmpbox.type.AbstractField;
2627
import org.apache.xmpbox.type.Attribute;
@@ -41,6 +42,7 @@
4142
@StructuredType(preferedPrefix = "pdfaid", namespace = "http://www.aiim.org/pdfa/ns/id/")
4243
public class PDFAIdentificationSchema extends XMPSchema
4344
{
45+
private static final Set<String> VALID_VALUES = Set.of("A", "B", "U", "e", "f");
4446

4547
@PropertyType(type = Types.Integer, card = Cardinality.Simple)
4648
public static final String PART = "part";
@@ -169,8 +171,7 @@ public void setConformance(String value) throws BadFieldValueException
169171
public void setConformanceProperty(TextType conf) throws BadFieldValueException
170172
{
171173
String value = conf.getStringValue();
172-
if (value.equals("A") || value.equals("B") || value.equals("U") ||
173-
value.equals("e") || value.equals("f"))
174+
if (VALID_VALUES.contains(value))
174175
{
175176
addProperty(conf);
176177
}

0 commit comments

Comments
 (0)