Bug 39841 - Give better explanation of why abstract class can't be instantiated
Summary: Give better explanation of why abstract class can't be instantiated
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-09 19:10 EDT by Colin Sampaleanu CLA
Modified: 2003-07-16 06:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Sampaleanu CLA 2003-07-09 19:10:31 EDT
When you try to construct an abstract class MyClass, you get the error
  The type MyClass can not be instantiated
Now this may seem obvious to some people, and will seem obvious to me from now
on, but the first time I got this error, I spent 5 minutes trying to figure out
what the problem was, I simply thought there was something wrong with the
constructor, or Eclipse was buggy, etc. Then I decided to look at the class
definition itself. Changig this to 
  The type MyClass can not be instantiated because it is abstract
or
  The abstract type MyClass can not be instantiated
would be much clearer.
Comment 1 Philipe Mulet CLA 2003-07-10 06:37:49 EDT
Actually, other forbidden scenarii using the same problem message are:
- attempting to allocate a base type
- attempting to allocate an interface
Comment 2 Philipe Mulet CLA 2003-07-10 06:39:24 EDT
Changed error message to read:
  "Cannot instantiate the type MyClass, since it is not a concrete class"

Is it ok ?
Comment 3 Philipe Mulet CLA 2003-07-10 06:40:29 EDT
Marking as fixed (reopen if you disagree)
Comment 4 David Audel CLA 2003-07-16 06:22:17 EDT
Verified.