Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How many types in Eclipse
How many types in Eclipse [message #290996] Mon, 05 September 2005 18:11 Go to next message
Eclipse UserFriend
Originally posted by: michael.pacione.cis.strath.ac.uk

Hi,

Can anyone tell me how many types (i.e. interfaces and classes) there are
in Eclipse, either in the full SDK or just the platform. I'm a software
engineering researcher, and would like to give some quantifiable idea of
what constitututes a big real-world system.
http://www.eclipse.org/eclipse/development/eclipse_3_1_stats .html says
there are 11,548 Java source files and 2,425,709 lines of Java code, but
the number of types would really be most useful.

Thanks,

Michael
Re: How many types in Eclipse [message #291096 is a reply to message #290996] Wed, 07 September 2005 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Given that (on average) 1 Java source file contains 1 class/interface, you could use that as a rough figure. (In actual fact, it would be slightly higher since anonymous inner classes come into play too.)

If you want a more accurate answer, I'd suggest that you go through each .jar file, and grep the number of '.class' files that you find in each one.

Since you're bound to say 'How do I do that?' I did a quick parse over the 3.1 classes:

23499 .class files
2606 .class files that begin with I (the convention used by Eclipse for interfaces)

So roughly 20,000 classes and 2,500 interfaces.
Re: How many types in Eclipse [message #291106 is a reply to message #291096] Wed, 07 September 2005 18:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.pacione.cis.strath.ac.uk

> Given that (on average) 1 Java source file contains 1 class/interface, you
> could use that as a rough figure. (In actual fact, it would be slightly
> higher since anonymous inner classes come into play too.)

Any inner class in fact. Which in a class that does, for example, a lot of
event handling could be quite a few. One is the absolute minimum number of
types a source file can contain.

> If you want a more accurate answer, I'd suggest that you go through
> each .jar file, and grep the number of '.class' files that you find in each
> one.
>
> Since you're bound to say 'How do I do that?' I did a quick parse over the
> 3.1 classes:

I am familiar with grep...

> 23499 .class files
> 2606 .class files that begin with I (the convention used by Eclipse for
> interfaces)
>
> So roughly 20,000 classes and 2,500 interfaces.

... but thanks for taking the trouble.
Re: How many types in Eclipse [message #291120 is a reply to message #291096] Thu, 08 September 2005 10:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Alex Blewitt wrote:
> Given that (on average) 1 Java source file contains 1
> class/interface, you could use that as a rough figure. (In actual
> fact, it would be slightly higher since anonymous inner classes come
> into play too.)
>
> If you want a more accurate answer, I'd suggest that you go through
> each .jar file, and grep the number of '.class' files that you find
> in each one.

Depending on the research context, it may be more appropriate to only
count top-level classes. Imagine the GUI code, which is likely to have
lots of anonymous and small nested classes for event handling. Does the
research really want to treat an anonymous mouse click handler class as
separate from the larger class that contains it? I can imagine that
there is some kinds of research that would, but seems like most times
you'd want such classes lumped in with their containing top-level class.

HTH,
Eric
Re: How many types in Eclipse [message #291130 is a reply to message #291120] Thu, 08 September 2005 17:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.pacione.cis.strath.ac.uk

Eric Rizzo wrote:

> Depending on the research context, it may be more appropriate to only
> count top-level classes. Imagine the GUI code, which is likely to have
> lots of anonymous and small nested classes for event handling. Does the
> research really want to treat an anonymous mouse click handler class as
> separate from the larger class that contains it? I can imagine that
> there is some kinds of research that would, but seems like most times
> you'd want such classes lumped in with their containing top-level class.

That's a good point. I guess the key is consistency when comparing such
measurements. It's certainly easier to count only classes at the top of
the containment hierarchy, as this is simply the number of source files
(~12,000 for Eclipse 3.1).
Re: How many types in Eclipse [message #291165 is a reply to message #291130] Fri, 09 September 2005 11:20 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Michael Pacione wrote:
> Eric Rizzo wrote:
>
>> Depending on the research context, it may be more appropriate to only
>> count top-level classes. Imagine the GUI code, which is likely to have
>> lots of anonymous and small nested classes for event handling. Does
>> the research really want to treat an anonymous mouse click handler
>> class as separate from the larger class that contains it? I can
>> imagine that there is some kinds of research that would, but seems
>> like most times you'd want such classes lumped in with their
>> containing top-level class.
>
>
> That's a good point. I guess the key is consistency when comparing such
> measurements. It's certainly easier to count only classes at the top of
> the containment hierarchy, as this is simply the number of source files
> (~12,000 for Eclipse 3.1).
>

Actually, strictly speaking that is not correct. It is possible for a
single source file to contain more than one top-level class. The only
restriction is that a single source file can only contain one public
top-level class.
Having said that, it is probably an academic point because it is
extremely rare (and recommended against as a best practice) to see more
than one top-level class in a single source file. I don't think I've
seen it done since the JDK 1.0 days when people were just figuring out
best practices for Java coding.

HTH,
Eric
Previous Topic:MS ASP Editor?
Next Topic:minimize and restore
Goto Forum:
  


Current Time: Thu May 29 12:08:26 EDT 2025

Powered by FUDForum. Page generated in 0.02621 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top