Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370271 - [compiler] NPE in PredicateGenerator with no predicate present
Summary: [compiler] NPE in PredicateGenerator with no predicate present
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.0.1   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 2.1 M6   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 15:39 EST by Stephan Herrmann CLA
Modified: 2013-02-20 16:29 EST (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-31 15:39:11 EST
While playing with team serialization I got a flood of the following exception while marking a serializable role as confined:

java.lang.NullPointerException
	at org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.PredicateGenerator.internalCreateBasePredicateCheck(PredicateGenerator.java:192)
	at org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.PredicateGenerator.createBasePredicateCheck(PredicateGenerator.java:162)
	at org.eclipse.objectteams.otdt.internal.core.compiler.mappings.CallinImplementor.generateCallinStatements(CallinImplementor.java:492)
	at org.eclipse.objectteams.otdt.internal.core.compiler.mappings.CallinImplementor$1.generateStatements(CallinImplementor.java:419)
	at org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.AbstractStatementsGenerator.generateAllStatements(AbstractStatementsGenerator.java:46)
	at org.eclipse.objectteams.otdt.internal.core.compiler.model.MethodModel.generateStatements(MethodModel.java:467)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.establishLateElementsCopied(Dependencies.java:2046)
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.ensureTeamState(Dependencies.java:578)
Comment 1 Stephan Herrmann CLA 2012-01-31 15:42:37 EST
Minimal test case:

public class B {
	void foo() {}
}
public team class TeamBug370271 {

	protected class R extends Confined playedBy B {

		void foo() <- after void foo();

		private void foo() {
		}		
	}
}

Removing either "extends Confined" or the callin avoids the issue.
Comment 2 Stephan Herrmann CLA 2012-02-23 16:52:48 EST
Resolved for 2.1 M6 via commit 74ba1aaf17fd4359457f6b520c6b318aa8f5b66b

This was a simple super class loop running past Team.Confined and straight into nirvana.
Comment 3 Stephan Herrmann CLA 2013-02-20 16:29:27 EST
Verified using 2.2 M5