Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336395 - [compiler] enum inside team class may cause NPE
Summary: [compiler] enum inside team class may cause NPE
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.8 M6   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 16:15 EST by Stephan Herrmann CLA
Modified: 2011-06-07 10:12 EDT (History)
0 users

See Also:


Attachments
test (1.41 KB, patch)
2011-02-04 16:31 EST, Stephan Herrmann CLA
no flags Details | Diff
fix under test (5.25 KB, patch)
2011-02-04 17:46 EST, 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-02-04 16:15:37 EST
If a team class containing an enum declaration is sub-classed 
the compiler throws: 

java.lang.NullPointerException
	at org.eclipse.objectteams.otdt.internal.core.compiler.util.AstConverter.createNestedType(AstConverter.java:356)
	at org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.copyinheritance.CopyInheritance._OT$copyRole$orig(CopyInheritance.java:598)
...

Workaround: declare all enums outside teams for now.
Comment 1 Stephan Herrmann CLA 2011-02-04 16:31:58 EST
Created attachment 188370 [details]
test

Here's a minimal witness.
Comment 2 Stephan Herrmann CLA 2011-02-04 17:46:40 EST
Created attachment 188379 [details]
fix under test

Here's a minimal fix. Need more testing before calling this resolved.
Comment 3 Stephan Herrmann CLA 2011-02-05 09:20:56 EST
the patch caused a regression in test1517_nestedRoleFile5() which is
fixed in r1294, r1295.

Also in a more complex example (SOM tracer) the enum no longer causes problems.
Closing as fixed.
Comment 4 Stephan Herrmann CLA 2011-06-07 10:12:25 EDT
A FUP has been filed as bug 348570.

Still the core issue has been verified using build 201106070730.