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

Bug 327993

Summary: NPE when creating a formatting specification
Product: z_Archived Reporter: Zoltan Ujhelyi <zoltan.ujhelyi>
Component: IMPAssignee: Stan Sutton <suttons>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
A log stating that no wizard page can be created.
none
The detailed, IMP-specific exception trace
none
A patch for the 0.1.91 version none

Description Zoltan Ujhelyi CLA 2010-10-17 14:31:30 EDT
Build Identifier: 20100917-0705

The wizard that creates a new formatting specification is broken - it cannot be run, as it throws a null-pointer exception right after the start, and the contents of the page is not rendered.

I observed this behaviour on both Eclipse 3.5 and 3.6, and using both the latest (IMP v0.1.v201008201835 (20 Aug 2010)) and prior release from the update site (IMP v0.1.v201004212015 (21 Apr 2010)).

I will submit a stack trace as an attachment.

Reproducible: Always

Steps to Reproduce:
1. Create an IMP-based editor with grammar
2. Try to create a Box-based formatting specification in the New... wizard
3. Observe, that the wizard page cannot be created because of a nullpointer exception
Comment 1 Zoltan Ujhelyi CLA 2010-10-17 14:33:26 EDT
Created attachment 181051 [details]
A log stating that no wizard page can be created.

The first exception in the error log states that an NPE was thrown during the creation of a wizard page.
Comment 2 Zoltan Ujhelyi CLA 2010-10-17 14:34:36 EDT
Created attachment 181052 [details]
The detailed, IMP-specific exception trace

The exception trace using IMP-specific code. It was submitted as a separate exception in the error log (not a hierarchic trace).
Comment 3 Zoltan Ujhelyi CLA 2010-10-17 15:36:06 EDT
After looking into the mentioned code, I found, that the NPE is thrown at the following line: 

createDescriptionText(container, fSchema.getDescription());

At that point fSchema is null. After some debugging, I found that fSchema is initialized in the constructor, after looking for an extension point called "formattingSpecification" in the plug-in "org.eclipse.imp.metatooling".

The metatooling plug-in does not define any extension points at all, and I did not find any extension point called "formattingSpecification", just an "org.eclipse.imp.formattingSpecification" in the "org.eclipse.imp.formatting" plug-in.
Comment 4 Zoltan Ujhelyi CLA 2010-10-17 15:39:10 EDT
Created attachment 181054 [details]
A patch for the 0.1.91 version

A simple modification of the metatooling plug-in (v0.1.91) code to use the correct plug-in ID.
Comment 5 Zoltan Ujhelyi CLA 2010-10-17 15:42:13 EDT
Sorry for the comment spam - but I checked, that the same patch can be used in the trunk version as well (0.2.1).

I think, it would be nice to provide a fixed release from the 0.1 series as well as fixing the 0.2 series.