Bug 6327 - Keep .class files compiled with the assert statement executable on older VMs than 1.4 VMs
Summary: Keep .class files compiled with the assert statement executable on older VMs ...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 13976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-11-26 14:48 EST by Olivier Thomann CLA
Modified: 2009-08-30 02:35 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2001-11-26 14:48:34 EST
If a source file is using the new assert statement, the code generation makes 
it incompatible with VMs older than 1.4 VMs. We might want to keep this binary 
compatibility considering that older VMs should simply run these .class files as 
a 1.4 VM would do with assertion disabled.
This means we would silently ignore the exceptions thrown if fields, methods or 
classes used to manage the assert statement are not present.

According to the specs, Java platform implementors are under no obligation to do 
this. We might consider adding a support for that.
Comment 1 Philipe Mulet CLA 2001-11-27 03:08:55 EST
This would though mean we'd wrap assertions in try/catch statements during code 
gen... Maybe we could rather use the -target VM_version to tell us whether or 
not to use reflect or direct 1.4 lib access when generating bytecodes for an 
assert statement.
Comment 2 Olivier Thomann CLA 2001-11-27 10:46:26 EST
Exactly. We would use reflection to retrieve the java.lang.AssertionError class 
and try/catch to handle invalid accesses to missing fields or methods. This is 
easily doable with the current API. The change would be very local to the 
AssertStatement code generation.
Comment 3 Philipe Mulet CLA 2002-02-02 06:52:37 EST
Nice to have, but we shouldn't pollute the normal codegen to support this 
scenario, unless it becomes critical that we support it.

Comment 4 Philipe Mulet CLA 2003-06-13 04:51:50 EDT
*** Bug 13976 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Webmaster CLA 2009-08-30 02:35:35 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.