< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java

Print this page

        

@@ -1,8 +1,8 @@
 /*
  * Copyright (c) 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.

@@ -189,11 +189,11 @@
         synchronized (fGrammars) {
             clean();
             int hash = hashCode(desc);
             int index = (hash & 0x7FFFFFFF) % fGrammars.length;
             for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
-                Grammar tempGrammar = (Grammar) entry.grammar.get();
+                Grammar tempGrammar = entry.grammar.get();
                 /** If the soft reference has been cleared, remove this entry from the pool. */
                 if (tempGrammar == null) {
                     removeEntry(entry);
                 }
                 else if ((entry.hash == hash) && equals(entry.desc, desc)) {

@@ -239,11 +239,11 @@
         synchronized (fGrammars) {
             clean();
             int hash = hashCode(desc);
             int index = (hash & 0x7FFFFFFF) % fGrammars.length;
             for (Entry entry = fGrammars[index]; entry != null ; entry = entry.next) {
-                Grammar tempGrammar = (Grammar) entry.grammar.get();
+                Grammar tempGrammar = entry.grammar.get();
                 /** If the soft reference has been cleared, remove this entry from the pool. */
                 if (tempGrammar == null) {
                     removeEntry(entry);
                 }
                 else if ((entry.hash == hash) && equals(entry.desc, desc)) {

@@ -361,11 +361,11 @@
         if (entry.next != null) {
             entry.next.prev = entry.prev;
         }
         --fGrammarCount;
         entry.grammar.entry = null;
-        return (Grammar) entry.grammar.get();
+        return entry.grammar.get();
     }
 
     /**
      * Removes stale entries from the pool.
      */
< prev index next >