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

Bug 342331

Summary: npe when running repo2runnable apitooling.analysis_reportconversion task in SDK build
Product: [Eclipse Project] PDE Reporter: Kim Moir <kim.moir>
Component: API ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie, Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
xml report
none
Proposed fix
none
api verify xml files
none
Proposed fix
none
Proposed fix none

Description Kim Moir CLA 2011-04-08 16:24:53 EDT
[apitooling.analysis_reportconversion] problem message : org.eclipse.ltk.internal.ui.refactoring.util.ViewerPane illegally extends org.eclipse.swt.custom.ViewForm
[apitooling.analysis_reportconversion] problem severity : 1
[apitooling.analysis_reportconversion] problem message : org.eclipse.ltk.ui.refactoring.TextEditChangeNode extends non-API type org.eclipse.ltk.internal.ui.refactoring.InternalTextEditChangeNode
[apitooling.analysis_reportconversion] problem severity : 1
[apitooling.analysis_reportconversion] problem message : org.eclipse.ltk.ui.refactoring.TextEditChangeNode.ChildNode extends non-API type org.eclipse.ltk.internal.ui.refactoring.PreviewNode
[apitooling.analysis_reportconversion] problem severity : 1
[apitooling.analysis_reportconversion] problem message : Constructor for org.eclipse.ltk.ui.refactoring.TextEditChangeNode.ChildNode with non-API parameter type org.eclipse.ltk.internal.ui.refactoring.PreviewNode
[apitooling.analysis_reportconversion] problem severity : 1
[apitooling.analysis_reportconversion] category : bundleVersion
  [antcall] Exiting /builds/N201104081307/org.eclipse.releng.eclipsebuilder/buildAll.xml.

BUILD FAILED
/builds/N201104081307/org.eclipse.releng.eclipsebuilder/buildAll.xml:83: The following error occurred while executing this line:
I just switched the build to use I20110406-1223 bundles. I get an NPE when running the apitooling.analysis_reportconversion task.

<apitooling.analysis_reportconversion xmlfiles="${report_directory_location}" debug="true" htmlfiles="${html_directory_location}" />


/builds/N201104081307/org.eclipse.releng.eclipsebuilder/buildAll.xml:464: java.lang.NullPointerException
        at org.eclipse.pde.api.tools.internal.tasks.AnalysisReportConversionTask.dumpReport(AnalysisReportConversionTask.java:367)
        at org.eclipse.pde.api.tools.internal.tasks.AnalysisReportConversionTask.execute(AnalysisReportConversionTask.java:456)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(Eclipse
Comment 1 Curtis Windatt CLA 2011-04-11 11:39:15 EDT
We should add a better debug statement in the handler.
Comment 2 Michael Rennie CLA 2011-04-11 14:40:49 EDT
(In reply to comment #1)
> We should add a better debug statement in the handler.

Looking at the code it appears the XML report might be bogus and the report converter is blowing up because it expected to find the XML element 'report' to create a new report object handle - which does not happen, leading to the NPE in dumpReport(..).
Comment 3 Kim Moir CLA 2011-04-11 16:25:44 EDT
Created attachment 192978 [details]
xml report
Comment 4 Olivier Thomann CLA 2011-04-11 16:59:03 EDT
I'll take a look.
Comment 5 Olivier Thomann CLA 2011-04-13 12:04:29 EDT
The attached xml report is simply not the right one.
I wonder if the right task has been called before the conversion task. The xml report attached to this bug report should be the one created for deprecation or api freeze tasks.
Can I see where this is invoked ?
Comment 6 Olivier Thomann CLA 2011-04-13 12:08:58 EDT
Created attachment 193168 [details]
Proposed fix

The api analysis task is supposed to create a bunch of reports, not just one.
Comment 7 Olivier Thomann CLA 2011-04-13 12:57:22 EDT
I don't think that the report attached is the one from the call in the buildAll.xml file.
Would it be possible to get all reports in:
${report}/apitoolsverifications/xml
?
Comment 8 Kim Moir CLA 2011-04-13 13:20:52 EDT
Olivier, I have to run the build again to recreate those files.  The build is from a few days ago, and the build output was automatically deleted.  I'll provide the files once they are available later today.
Comment 9 Kim Moir CLA 2011-04-13 16:47:57 EDT
Created attachment 193195 [details]
api verify xml files
Comment 10 Olivier Thomann CLA 2011-04-14 10:38:24 EDT
Created attachment 193260 [details]
Proposed fix

Better fix. The problem came from the counts.xml file which doesn't contain a <report> element.
The converter now ignores such files and print a debug statement if debug is enabled to log what file was skipped.
Comment 11 Olivier Thomann CLA 2011-04-14 10:52:14 EDT
Created attachment 193261 [details]
Proposed fix
Comment 12 Olivier Thomann CLA 2011-04-14 10:55:16 EDT
Released for 3.7M7.
The conversion task now logs unknown elements in debug mode.

[apitooling.analysis_reportconversion] unknown element : reportedcount
[apitooling.analysis_reportconversion] Skipped file : c:\tests_api\analysis\xml\counts.xml
Comment 13 Kim Moir CLA 2011-04-24 20:39:33 EDT
Thanks Olivier. Verified that this was fixed in 3.7M7 by running a test build with the bundles from I20110421-1800.