This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Throw LinkageError's, not RuntimeException's, for uncompilable source code | ||
---|---|---|---|
Product: | java | Reporter: | Jesse Glick <jglick> |
Component: | Compiler | Assignee: | Dusan Balek <dbalek> |
Status: | NEW --- | ||
Severity: | normal | CC: | ceklock, gtzabari |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 177536 | ||
Bug Blocks: |
Description
Jesse Glick
2009-11-24 10:39:24 UTC
Well, although LE may be appropriate for un-resolvable method, it is not appropriate, IMO, for code like "1+;" (there is no linkage problem in this statement, and the LE would be throw when the execution would reach the point of such a statement). Using both LE and RE would be quite confusing for users (and the rest of the IDE too). So I am not sure if throwing LE is a good idea. For syntax errors, just throw whatever subclass of LinkageError is most appropriate - probably ClassFormatError, maybe VerifyError. These are all assignable to LinkageError even though they do not involve class -> class dependencies as such, i.e. LinkageError really means "some fatal problem loading classes", which is exactly what should be used for erroneous code. Makes sense to me. |