Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358118

Summary: NPE in Xbase compiler for method with inferred return type and recursive method call
Product: [Modeling] TMF Reporter: Christian Weisskopf <christian.weisskopf>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Xtend class
none
Stack trace none

Description Christian Weisskopf CLA 2011-09-19 09:51:20 EDT
Build Identifier: 2.0.1.v201108020636

The attached Xtend class (using the Xtend tutorial project) does not compile to java due to a NPE thrown in the Xtend/Xbase compiler. The call hierarchy to reproduce the error is as follows:

- recursiveMethod (Return type declared)
  - method1 (Return type declared)
    - method2 (No return type declared)
      - recursiveMethod (Return type declared)

The circumstances are very specific and in any of the following cases, no NPE is thrown:

- In case of a declared return type for method2
- In case of a direct call to method2 from the recursiveMethod
- In case of no call to recusriveMethod in method2

See the attached files for more details and the stack trace.

Reproducible: Always

Steps to Reproduce:
1. Import the Xtend tutorial project
2. Copy the attached Xtend class in to the xtend.tutorial.basics package
3. Check the Eclipse .log-file for an NPE
Comment 1 Christian Weisskopf CLA 2011-09-19 09:52:48 EDT
Created attachment 203590 [details]
Xtend class
Comment 2 Christian Weisskopf CLA 2011-09-19 09:53:41 EDT
Created attachment 203591 [details]
Stack trace
Comment 3 Sebastian Zarnekow CLA 2011-09-29 10:01:08 EDT
Pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:49:35 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:00:37 EDT
Closing all bugs that were set to RESOLVED before Neon.0