Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6228182

(pref) Dead store to local variable in method java.util.prefs.XmlSupport.loadPrefsDoc(InputStream)

XMLWordPrintable

    • b25
    • generic
    • generic

      In method java.util.prefs.XmlSupport.loadPrefsDoc(InputStream) there is an assignment to a local object called r, but it is never used in the method.

         private static Document loadPrefsDoc(InputStream in)
              throws SAXException, IOException
          {
              Resolver r = new Resolver(); // <------- here
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              dbf.setIgnoringElementContentWhitespace(true);
              dbf.setValidating(true);
              dbf.setCoalescing(true);
              dbf.setIgnoringComments(true);
              try {
                  DocumentBuilder db = dbf.newDocumentBuilder();
                  db.setEntityResolver(new Resolver()); // <----- we create it here anyway
                  db.setErrorHandler(new EH());
                  return db.parse(new InputSource(in));
              } catch (ParserConfigurationException e) {
                  throw new AssertionError(e);
              }
          }


      ###@###.### 2005-2-11 11:33:19 GMT

            sherman Xueming Shen
            jloefflm Johann Löfflmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: