# HG changeset patch # User Josef Eisl # Date 1414687938 -3600 # Node ID 62d3440228b8ab8217be648618a81d86563c3f0c # Parent b7226cb963c330827143447fbe6b3d8a0af2febb Improve javadoc for ResolvedJavaType.getSingleImplementor() and CompilerToVM.getKlassImplementor(). diff -r b7226cb963c3 -r 62d3440228b8 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Thu Oct 30 16:52:13 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Thu Oct 30 17:52:18 2014 +0100 @@ -181,6 +181,10 @@ /** * Gets the single implementor of this type. Calling this method on a non-interface type causes * an exception. + *

+ * If the compiler uses the result of this method for its compilation, the usage must be guarded + * because the verifier can not guarantee that the assigned type really implements this + * interface. Additionally, class loading can invalidate the result of this method. * * @return {@code null} if there is no implementor, the implementor if there is only one, or * {@code this} if there are more than one. diff -r b7226cb963c3 -r 62d3440228b8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Thu Oct 30 16:52:13 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Thu Oct 30 17:52:18 2014 +0100 @@ -90,10 +90,12 @@ long findUniqueConcreteMethod(long actualHolderMetaspaceKlass, long metaspaceMethod); /** - * Returns the implementor for the given interface class. + * Returns the implementor for the given interface class, if there is a single implementor. * * @param metaspaceKlass the metaspace klass to get the implementor for - * @return the implementor as metaspace klass pointer or null if there is no implementor + * @return the implementor as metaspace klass pointer if there is a single implementor, null if + * there is no implementor, or the input metaspace klass pointer ({@code metaspaceKlass} + * ) itself if there is more than one implementor. */ long getKlassImplementor(long metaspaceKlass);