|
|
Error#2301:Internal compiler error: com.borland.compiler.symtab.CompilerError: unexpected type: null |
| Matthew Mower writes:
I've already resolved the problem, but thought I would document it since (a) someone else might come across it and (b) I don't think the error message was very helpful in determining the cause of the problem - even though it was accurate. I received the error while trying to recompile a JUnit test suite which uses a number of inner class implemenations of other classes in our framework. The error was because I had recently removed a parameter from the constructor of the class that was being created as an inner class. I had removed this parameter from constructors all over our code, but had forgotten that these inner classes extended the modified class and so was still passing a null for the parameter - hence the error is accurate. However: -JBuilders "internal compiler error" foxed me into thinking I had broken the compiler, and lead me away from thinking it was a simple problem with my own code. -JBuilder could have highlighted the point where the unexpected type was occuring and lead me to realize what I had done much sooner. I'm not sure i'd have solved it yet if another poster in this group hadn't mentioned internal compiler issues with inner classes.
I think JBuilder should handle this case better. | |
| An example that triggers this confusing error message is the line below:
BrowserAction foo = new BrowserAction( "menuitem", 'm', "tooltip") {
...
}
The compiler is expecting a character value for the second parameter. If you replace the 'm' with the null keyword, the compiler produces the unexpected type message. Unfortuately, it fails to provide a line number reference so you probably have no idea what caused it.
| |
| Matthew Mower writes:
Here is the simple test case:
public class Untitled1 {
public Untitled1() {
}
}
I think the compiler should be able to generate a "constructor not
found" error in this case, and not go bust. | |
| [Append to This Answer] | |
| 2001-Sep-08 2:23pm |
| ||||||||
|
Java Community
Java Tools |
Code Central JB OpenTools |
Community Recent Threads |
Borland Chat Chat FAQ |
||||||||||||||
|
Feature Matrices 3.0 | 3.5 | 4.0 5.0 | 6.0 | 7.0 |
Shop for JBuilder |
JBuilder Downloads and reg keys |
Report Piracy | ||||||||||||||
|
Online Manuals 4.0 | 5.0 | 6.0 7.0 |
Borland DevSupport's Bug/RFE Form Quality Central Client |
JB Patches & Updates |
JBuilder FAQs TIs | ||||||||||||||
|
JBuilder Newsgroups |
Tamaracka's News Archive |
Mr. Haki's JBuilder Machine |
JGuru's JBuilder FAQ |
||||||||||||||
|
Sun's Bug Parade |
|||||||||||||||||
|
|||||||||||||||||