exceptions unnecessarily used for control-flow

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P5
    • 6
    • Affects Version/s: 1.3.0
    • Component/s: core-libs

      in src/share/classes/java/io/ObjectInputStream.java we have the following code:

              try {
                  if ((cl = resolveProxyClass(ifaces)) == null) {
                      throw new ClassNotFoundException("null class");
                  }
              } catch (ClassNotFoundException ex) {
                  resolveEx = ex;
              }

      This code might be more efficient if rewritten as

              try {
                  if ((cl = resolveProxyClass(ifaces)) == null) {
                      resolveEx = ClassNotFoundException("null class");
                  }
              } catch (ClassNotFoundException ex) {
                  resolveEx = ex;
              }

      This pattern occurs once more within that file.

            Assignee:
            Andrey Ozerov
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: