PROPOSAL: Method and Field Literals

Reinier Zwitserloot reinier at zwitserloot.com
Thu Mar 12 00:14:05 PDT 2009


with getField, I only see 834 results.

A search for "finally in.close", which only covers a small slice of  
ARM's bailiwick returns ~31100 results.

A -lot- of the method literals in that google code search result  
involve checking if a certain method exists in a certain class. I  
would assume the module system takes care of most of these calls (as  
its effectively a version check). That should take care of about 3000  
of those 7000 already.

  --Reinier Zwitserloot



On Mar 12, 2009, at 08:05, Jesse Wilson wrote:

> On Wed, Mar 11, 2009 at 9:48 PM, Reinier Zwitserloot <reinier at zwitserloot.com 
> > wrote:
> What's this useful for, exactly? Can anyone name me one non-exotic  
> use-case?
>
> In Glazed Lists we have an interface called TableFormat that maps a  
> value object to its columns for a table. A concise API to access  
> methods would be convenient:
>   TableFormat songsTableFormat = new TableFormat.Builder()
>       .addColumn("Name", Song#getSongName())
>       .addColumn("Track #", Song#getTrackNumber())
>       .addColumn("Artist", Song#getArtist())
>       .addColumn("Album", Song#getAlbum())
>       .build();
>
> Google Code Search suggests another 7,000 immediate candidates:
> http://www.google.com/codesearch?hl=en&lr=&q=%5C.class%5C.getMethod%5C%28%5C%22&sbtn=Search
>
> This includes code from Apache HTTP client, Log4J, Ant, JPA, SwingX,  
> EJB, SAX, Google Collections, GWT, Hibernate, Seam, MySQL, Equinox,  
> Eclipse... you name it.
>




More information about the coin-dev mailing list