< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java

Print this page

        

@@ -1,8 +1,8 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

@@ -59,11 +59,11 @@
             //return this array back to pool
             fAttrChecker.returnAttrArray(attrValues, schemaDoc);
             return;
         }
 
-        UniqueOrKey uniqueOrKey = null;
+        UniqueOrKey uniqueOrKey;
         if(DOMUtil.getLocalName(uElem).equals(SchemaSymbols.ELT_UNIQUE)) {
             uniqueOrKey = new UniqueOrKey(schemaDoc.fTargetNamespace, uName, element.fName, IdentityConstraint.IC_UNIQUE);
         } else {
             uniqueOrKey = new UniqueOrKey(schemaDoc.fTargetNamespace, uName, element.fName, IdentityConstraint.IC_KEY);
         }

@@ -87,11 +87,11 @@
 
             // handle duplicates
             if (fSchemaHandler.fTolerateDuplicates) {
                 if (idc != null) {
                     if (idc instanceof UniqueOrKey) {
-                        uniqueOrKey = (UniqueOrKey) uniqueOrKey;
+                        uniqueOrKey = (UniqueOrKey)idc;
                     }
                 }
                 fSchemaHandler.addIDConstraintDecl(uniqueOrKey);
             }
         }
< prev index next >