< prev index next >

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

Print this page

        

@@ -1,8 +1,8 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @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.

@@ -2579,21 +2579,21 @@
         // for all (recursively) imported grammars
         SchemaGrammar sg1, sg2;
         List<SchemaGrammar> gs;
         for (int i = 0; i < currGrammars.size(); i++) {
             // get the grammar
-            sg1 = (SchemaGrammar)currGrammars.get(i);
+            sg1 = currGrammars.get(i);
             // we need to add grammars imported by sg1 too
             gs = sg1.getImportedGrammars();
             // for all grammars imported by sg2, but not in the vector
             // we add them to the vector
             if (gs == null) {
                 continue;
             }
 
             for (int j = gs.size() - 1; j >= 0; j--) {
-                sg2 = (SchemaGrammar)gs.get(j);
+                sg2 = gs.get(j);
                 if (!currGrammars.contains(sg2)) {
                     currGrammars.add(sg2);
                 }
             }
         }

@@ -2604,11 +2604,11 @@
     private boolean existingGrammars(List<SchemaGrammar> grammars) {
         int length = grammars.size();
         final XSDDescription desc = new XSDDescription();
 
         for (int i=0; i < length; i++) {
-            final SchemaGrammar sg1 = (SchemaGrammar)grammars.get(i);
+            final SchemaGrammar sg1 = grammars.get(i);
             desc.setNamespace(sg1.getTargetNamespace());
 
             final SchemaGrammar sg2 = findGrammar(desc, false);
             if (sg2 != null) {
                 return true;

@@ -2620,11 +2620,11 @@
 
     private boolean canAddComponents(List<XSObject> components) {
         final int size = components.size();
         final XSDDescription desc = new XSDDescription();
         for (int i=0; i<size; i++) {
-            XSObject component = (XSObject) components.get(i);
+            XSObject component = components.get(i);
             if (!canAddComponent(component, desc)) {
                 return false;
             }
         }
         return true;

@@ -2761,11 +2761,11 @@
     private void updateImportList(List<SchemaGrammar> importedSrc, List<SchemaGrammar> importedDst)
     {
         final int size = importedSrc.size();
 
         for (int i=0; i<size; i++) {
-            final SchemaGrammar sg = (SchemaGrammar) importedSrc.get(i);
+            final SchemaGrammar sg =  importedSrc.get(i);
             if (!containedImportedGrammar(importedDst, sg)) {
                 importedDst.add(sg);
             }
         }
     }

@@ -3359,11 +3359,11 @@
     private boolean containedImportedGrammar(List<SchemaGrammar> importedGrammar, SchemaGrammar grammar) {
         final int size = importedGrammar.size();
         SchemaGrammar sg;
 
         for (int i=0; i<size; i++) {
-            sg = (SchemaGrammar) importedGrammar.get(i);
+            sg =  importedGrammar.get(i);
             if (null2EmptyString(sg.getTargetNamespace()).equals(null2EmptyString(grammar.getTargetNamespace()))) {
                 return true;
             }
         }
         return false;

@@ -3764,11 +3764,11 @@
             registry.put(qName, currComp);
             registry_sub.put(qName, currSchema);
         }
         else {
             Element collidingElem = (Element)objElem;
-            XSDocumentInfo collidingElemSchema = (XSDocumentInfo)registry_sub.get(qName);
+            XSDocumentInfo collidingElemSchema = registry_sub.get(qName);
             if (collidingElem == currComp) return;
             Element elemParent = null;
             XSDocumentInfo redefinedSchema = null;
             // case where we've collided with a redefining element
             // (the parent of the colliding element is a redefine)
< prev index next >