Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 256451 - [ds tooling] Declarative Service Builder fails if property type attribute is not set
Summary: [ds tooling] Declarative Service Builder fails if property type attribute is ...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-25 10:43 EST by Philipp Kursawe CLA
Modified: 2008-11-30 14:38 EST (History)
2 users (show)

See Also:


Attachments
Fixed (896 bytes, patch)
2008-11-28 15:09 EST, Rafael Oliveira Nóbrega CLA
caniszczyk: iplog+
Details | Diff
Fixed the Last Patch (1.27 KB, patch)
2008-11-28 15:18 EST, Rafael Oliveira Nóbrega CLA
caniszczyk: iplog+
Details | Diff
mylyn/context/zip (1.21 KB, application/octet-stream)
2008-11-30 14:38 EST, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Kursawe CLA 2008-11-25 10:43:21 EST
If you edit a DS component xml by hand and forget to set a type of a property explicit, the Declarative Service Builder fails during save with a NPE. I think OSGi specs say, that you can ommit the type of a proerty and it is supposed to be String then. So a fix would be to assume "String" as the default type and even not add the type property unless it is not String.

java.lang.NullPointerException
	at org.eclipse.pde.internal.ds.core.builders.DSErrorReporter.validatePropertySpecificTypeValue(DSErrorReporter.java:321)
	at org.eclipse.pde.internal.ds.core.builders.DSErrorReporter.validatePropertyTypesValues(DSErrorReporter.java:296)
	at org.eclipse.pde.internal.ds.core.builders.DSErrorReporter.validatePropertyElements(DSErrorReporter.java:285)
	at org.eclipse.pde.internal.ds.core.builders.DSErrorReporter.validateContent(DSErrorReporter.java:72)
	at org.eclipse.pde.internal.ds.core.builders.DSBuilder.checkFile(DSBuilder.java:140)
	at org.eclipse.pde.internal.ds.core.builders.DSBuilder.access$2(DSBuilder.java:130)
	at org.eclipse.pde.internal.ds.core.builders.DSBuilder$DeltaVisitor.visit(DSBuilder.java:92)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
	at org.eclipse.pde.internal.ds.core.builders.DSBuilder.build(DSBuilder.java:113)
	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:201)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Rafael Oliveira Nóbrega CLA 2008-11-28 15:09:24 EST
Created attachment 119047 [details]
Fixed

Thanks Philipp! :)
Comment 2 Rafael Oliveira Nóbrega CLA 2008-11-28 15:18:57 EST
Created attachment 119051 [details]
Fixed the Last Patch

Ops,
now we do.. 

+		if (type == null) {
+			type = IDSConstants.VALUE_PROPERTY_TYPE_STRING;
+		}

Thanks!
Comment 3 Chris Aniszczyk CLA 2008-11-30 14:37:59 EST
done.

Thanks for the report Phillip! Keep the feedback coming, that's the only way we'll improve the editor before 3.5 ships :)

Thanks for the fix Rafael!

> 20091130
Comment 4 Chris Aniszczyk CLA 2008-11-30 14:38:03 EST
Created attachment 119091 [details]
mylyn/context/zip