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

beans/finder/MethodFinder.findMethod incorrectly returns null

XMLWordPrintable

        java.desktop/share/classes/com/sun/beans/finder/MethodFinder.java

        Looking at
        public static Method findMethod(Class<?> type, String name, Class<?>...args) throws NoSuchMethodException {


        I see this
        <pre>
        Method method = CACHE.get(signature);

        return (method == null) || isPackageAccessible(method.getDeclaringClass()) ? method : CACHE.create(signature);

        </pre>

        Let's simplify that 2nd line to make it easier to read
        return (method == null) ? method : CACHE.create(signature);

        So if method is not found in the cache, return null ? If it is found then re-cache it ?

        Surely something is badly broken here and I'm surprised it isn't causing problems unless this whole method is pretty unimportant .. or the CACHE is generally populated by some other path for most cases.

              azvegint Alexander Zvegintsev
              prr Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: