Bug 258950 - CoreException in log when analyzing org.eclipse.osgi
Summary: CoreException in log when analyzing org.eclipse.osgi
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-16 10:11 EST by Markus Keller CLA
Modified: 2009-03-03 12:18 EST (History)
2 users (show)

See Also:


Attachments
fix (4.33 KB, patch)
2008-12-17 16:59 EST, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2008-12-16 10:11:59 EST
I20081211-1908

- set 3.4 as API baseline
- check out org.eclipse.equinox/framework/bundles/org.eclipse.osgi from :pserver:anonymous@dev.eclipse.org:/cvsroot/rt/
- build
=> log (same status twice):

!ENTRY org.eclipse.pde.api.tools 4 120 2008-12-16 16:07:41.459
!MESSAGE Error logged from API Tools Core:
!STACK 1
org.eclipse.core.runtime.CoreException: Could not locate the source position for: getSubjectDN in the type: BundleSignerCondition
        at org.eclipse.pde.api.tools.internal.builder.AbstractProblemDetector.noSourcePosition(AbstractProblemDetector.java:264)
        at org.eclipse.pde.api.tools.internal.builder.SystemApiDetector.getSourceRange(SystemApiDetector.java:355)
        at org.eclipse.pde.api.tools.internal.builder.AbstractProblemDetector.createProblem(AbstractProblemDetector.java:106)
        at org.eclipse.pde.api.tools.internal.builder.AbstractProblemDetector.createProblems(AbstractProblemDetector.java:316)
        at org.eclipse.pde.api.tools.internal.builder.ReferenceAnalyzer.analyze(ReferenceAnalyzer.java:191)
        at org.eclipse.pde.api.tools.internal.builder.ReferenceAnalyzer.analyze(ReferenceAnalyzer.java:411)
        at org.eclipse.pde.api.tools.internal.builder.BaseApiAnalyzer.checkApiUsage(BaseApiAnalyzer.java:747)
        at org.eclipse.pde.api.tools.internal.builder.BaseApiAnalyzer.analyzeComponent(BaseApiAnalyzer.java:246)
        at org.eclipse.pde.api.tools.internal.builder.ApiAnalysisBuilder.buildAll(ApiAnalysisBuilder.java:404)
        at org.eclipse.pde.api.tools.internal.builder.ApiAnalysisBuilder.build(ApiAnalysisBuilder.java:307)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:280)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:361)
        at org.eclipse.core.internal.resources.Project$1.run(Project.java:524)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
        at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
        at org.eclipse.core.internal.resources.Project.build(Project.java:102)
        at org.eclipse.pde.api.tools.internal.util.Util$BuildJob.run(Util.java:205)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.pde.api.tools 4 0 2008-12-16 16:07:41.459
!MESSAGE Could not locate the source position for: getSubjectDN in the type: BundleSignerCondition
Comment 1 Olivier Thomann CLA 2008-12-16 14:07:36 EST
I'll have a look.
Comment 2 Olivier Thomann CLA 2008-12-16 14:55:24 EST
The problem in this case comes from the fact that I don't get the expected source when requesting the source of a line number to the document.
It might come from the boggus debug attribute. I'll investigate.
Comment 3 Olivier Thomann CLA 2008-12-16 15:20:26 EST
There is a suspicious entry in the line number table that screws up the retrieval of the right source code to locate the error.
Comment 4 Olivier Thomann CLA 2008-12-16 21:50:07 EST
I think we should fix two things.
1) Fix the debug attribute
2) Return a valid source position even if the right line cannot be retrieved. I propose the source range of the enclosing type.
Comment 5 Olivier Thomann CLA 2008-12-17 11:17:48 EST
Open bug 259129 for the issue in the debug attribute.
Comment 6 Michael Rennie CLA 2008-12-17 16:59:33 EST
Created attachment 120770 [details]
fix

The problem was actually in our logic to select a method name within a line of code. Most of this was fixed with the fix for bug 251617, and the patch handles the rest of the edge case.
Comment 7 Michael Rennie CLA 2008-12-17 17:00:26 EST
A bit more refactoring could be done to fully leverage the new Signatures class.
Comment 8 Michael Rennie CLA 2008-12-18 11:55:13 EST
Applied patch with updates:

1. coalesced and pushed up methods for finding field and method source ranges
2. used the new Signatures class in additional locations in the System API Detector

Please verify Olivier
Comment 9 Dani Megert CLA 2009-01-07 06:40:09 EST
FYI: I got the same error using latest I-build (I20090106-1323), see bug 260235.
Comment 10 Olivier Thomann CLA 2009-03-03 12:18:30 EST
Verified.