Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370040 - [otre] NoSuchFieldError when mixing class file versions within one type hierarchy
Summary: [otre] NoSuchFieldError when mixing class file versions within one type hiera...
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.1   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-28 07:13 EST by Stephan Herrmann CLA
Modified: 2012-09-22 16:02 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 Stephan Herrmann CLA 2012-01-28 07:13:10 EST
In Juno M5 plugin org.eclipse.jdt.junit.launcher has moved to a BREE of J2SE-1.5 while org.eclipse.pde.launching remains at 1.4. 

Both plugins have a class called JUnitLaunchCOnfigurationDelegate where the pde version inherits from the junit.launcher version.

When trying to weave into both classes the OTRE produces a
   java.lang.NoSuchFieldError: _OT$self_class$

This happens because the field is only generated for 1.4- so the super class doesn't need it, however, when weaving the sub-class we wrongly assume that the field has been woven into the super class.
Comment 1 Stephan Herrmann CLA 2012-01-28 11:32:30 EST
Fixed by keeping all class literal access local: instead of accessing ThatClass._OT$self_class$ use one more field: ThisClass._OT$class_literal$ThatClass, This avoids the inconsistencies if class files have different format (1.4 vs. 1.5+).

Test and fix have been released via commit 8574731a0f2dc482cebc92613334e05b97ad83d0
Comment 2 Stephan Herrmann CLA 2012-09-22 16:02:19 EDT
Works OK in the OTDT, considering as fixed indeed.