inner and nested class confusion

Hi,

it's my first post on these forums. I don't know where to post this (not in OpenAPI nor in plugins, but then where?).

I'm testing IDEA 5.1: incredibly cool IDE!

That said I think I found a slightly misleading bug.

If I create a class containing a nested static class like this:


IDEA highlights "Example" in red, saying that it is never used, which is correct.

However, IDEA's little pop-up message says:

"Private inner class 'Example' is never used"

and my eyes popped-up :)

I think it's plain wrong to call an nested static class an "inner" class.

The JLS is very clear about that if I'm not mistaken:

"An inner class is a nested class that is not explicitly or implicitly declared static."
- § 8.1.2

That definition comes from JLS 2nd edition but didn't change afterwards.

If I am not seeing things, where should I report this so a bug report is filled (it is important, IMHO, to get the terminology right)? (what it is the procedure to follow?) Can I do it with the account I just created to post here?

Thanks in advance and keep on the good work on that incredible IDE,

Jean





4 comments


The JLS is clear on the terminology, but common usage doesn't follow the JLS. The decision was made to follow common usage, which is "inner" (or "static inner" for precision) rather than "nested".

--Dave Griffith

0

Dear Dave,

I totally disagree. The "common usage" that I've seen both at work, on Usenet and on the Web certainly makes a very clear distinction between nested and inner.

A quick search on Google:

java "inner class" 523 000 matches
java "nested class" 1 200 000 matches

This is not a scientific proof, but it shows quite clearly that the term "nested class" associated with Java is both known and widely used (more than twice as more than "inner class" in that simple example), so why not use the correct term? If people don't know the distinction between inner and nested, at least search results tends to show they use both (interchangeably?).

Moreover, all inner classes are nested, so changing 'inner' to 'nested' would be right, even when the class is an inner class (which I don't advocate: all I'd want is a non-inner nested class called what it is).

Moreover you say:

+
The decision was made to follow common usage, which is "inner" (or "static inner" for precision) rather than "nested".
+

So which common usage are you following? "inner" right? But then you say that "static inner" is the common usage for such a case.

Concluding that such usage is right on the grounds that many people believe it is right is a logical fallacy (it would be a logical fallacy even if everybody but the JLS were believing it was right). In this case it's not even that way: many people are using the terms nested and inner correctly.

The decision was to follow a common usage amonst certain people, that is one thing.

The decision was to follow a wrong usage, that is a fact.

And it helps spreading misconception (that is an opinion),

a potential customer testing IntelliJ IDEA,

0

I should note that I'm not a JetBrains employee, and am only relaying what's I've heard said before in these forums.

--Dave Griffith

0

Jean L. wrote:

If I am not seeing things, where should I report this so a bug report is filled

http://www.jetbrains.net/jira
I think you may need to create a separate account for the bug tracking
system, but I can't remember (so long since I did it)
R

0

Please sign in to leave a comment.