SAM interface/class figures [Re: Preparing for the 0.2
Mark Mahieu
markmahieu at googlemail.com
Fri Feb 5 13:34:56 PST 2010
Hi Alex,
On 5 Feb 2010, at 20:58, Alex Buckley wrote:
> Hi Alexey,
>
> Alexey Kudravtsev wrote:
>> In any case, in this post by Neal Gafter, where these classes are supposed
>> to be SAM types, the majority of them are obviously not.
>> ==================
>>> Below are all the distinct classes
>>>
>>> com.sun.tools.example.debug.tty.Commands.AsyncExecution
>>> com.sun.tools.hat.internal.model.AbstractJavaHeapObjectVisitor
>>> com.sun.tools.hat.internal.util.Comparer
>>> java.awt.font.TextLine.Function
>>> java.io.InputStream
>>> java.io.OutputStream
>>> java.lang.Thread
>>> java.nio.charset.CoderResult.Cache
>>> java.util.TimerTask
>>> java.util.regex.Pattern.CharProperty
>>> java.util.regex.Pattern.CharPropertyNames.CharPropertyFactory
>>> java.util.regex.Pattern.CharPropertyNames.CloneableProperty
>>> javax.swing.AbstractAction
>> ======================
>
> 1) I did not interpret Neal as saying that these classes are SAMs. He said:
>
> Total anonymous classes: 1155
> ...
> And where the type is a SAM type: 811
> ...
> Those that are interfaces: 752
> Those that are classes: 59
> Total distinct interfaces: 50 (see below)
> Total distinct classes: 13 (see below)
>
> That is, 1155 anon.classes implement/extend 50 interfaces and 13
> classes. Only 811 anon.classes implement/extend SAM types; Neal did not
> say how many of the 50 interfaces and 13 classes are SAM types.
I thought the same at first, but the code starts out with the set of all anonymous classes and then whittles that down by applying the 3 filters ("no constructor args", "only one method", "SAM type") until arriving at a refined set which satisfies all of those conditions.
Any subsequent output, beginning with the first "Those that are..." line, is based on that refined set, so in the example above, I think the 50 interfaces and 13 classes are all supposed to be SAM types.
The reason they aren't (if my interpretation above is correct) is only due to the bug I mentioned earlier today.
Mark
More information about the lambda-dev
mailing list