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

(proxy) redundant read edges to superinterfaces of proxy interfaces

XMLWordPrintable

      Peter Levart catches a bug in dynamic proxy code that adds read edge to proxy interfaces and all their superinterfaces.

      A proxy class only needs to access the proxy interfaces and the types referenced in the method signature of all methods.

      777 // set up proxy class access to proxy interfaces and superinterfaces
      778 Deque<Class<?>> deque = new LinkedList<>(interfaces);
      779 Set<Class<?>> visited = new HashSet<>();
      780 while (!deque.isEmpty()) {
      781 Class<?> c = deque.poll();
      782 if (!visited.add(c)) {
      783 continue;
      784 }
      785 ensureAccess(target, c);
      786
      787 // add all superinterfaces
      788 for (Class<?> intf : c.getInterfaces()) {
      789 deque.add(intf);
      790 }
      791 }

      The above loop adding all superinterfaces can be removed.

            mchung Mandy Chung (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: