Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348146 - [compiler] NPE when compiling serializable team at compliance level 1.3
Summary: [compiler] NPE when compiling serializable team at compliance level 1.3
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 17:36 EDT by Stephan Herrmann CLA
Modified: 2011-08-19 15:24 EDT (History)
0 users

See Also:


Attachments
test & fix (4.52 KB, patch)
2011-06-02 17:46 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-06-02 17:36:46 EDT
Given a serializable team with a bound role, so a restoreRole(..) will
have to be generated. If project settings define 1.3 compliance
the following NPE will be thrown:


java.lang.NullPointerException
	at org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator.baseclassReference(AstGenerator.java:349)
	at org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.SerializationGenerator.fillRestoreRole(SerializationGenerator.java:146)
	at org.eclipse.objectteams.otdt.internal.core.compiler.lifting.LiftingEnvironment.fillInitCaches(LiftingEnvironment.java:452)
	at org.eclipse.objectteams.otdt.internal.core.compiler.lifting.LiftingEnvironment.fillGeneratedMethods(LiftingEnvironment.java:402)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.establishLateElementsCopied(Dependencies.java:2030)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureTeamState(Dependencies.java:577)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureAstState(Dependencies.java:446)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureState(Dependencies.java:275)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureState(Dependencies.java:252)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureState(Dependencies.java:252)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureState(Dependencies.java:215)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:842)
Comment 1 Stephan Herrmann CLA 2011-06-02 17:46:01 EDT
Created attachment 197280 [details]
test & fix

We were trying to infer information from the parameterized type of
a role cache which is not available at compliance 1.3.

This patch fixes the immediate issue, pending analysis how far we
want to go in supporting compliance < 1.5
Comment 2 Stephan Herrmann CLA 2011-08-13 11:57:22 EDT
Patch has been release for 2.1 M1 (r1866).

(the test case had to be renamed because that number was taken by now).
Comment 3 Stephan Herrmann CLA 2011-08-19 15:24:33 EDT
Verified for 2.1M1 using build 201108142105