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

Bug 321992

Summary: Assertion checks in Provided Capability constructor do not show which property is null
Product: [Eclipse Project] Equinox Reporter: Katya Stoycheva <katya.stoycheva>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: katya.stoycheva, pascal, s.yousouf
Version: unspecified   
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
It is clearly shown which of the arguments is null and which is the provided capability by its namespace, if not null. pascal: iplog+

Description Katya Stoycheva CLA 2010-08-06 10:28:33 EDT
Build Identifier: I20100406-1034

All scenarios that try to create an instance of class org.eclipse.equinox.internal.p2.metadata.ProvidedCapabilty (e.g. for  defining a capability which an installable unit declares to provide in the metadata repository) by passing a null value for the namespace and/or name parameters ends up with an AssertionFailedException with a meaningless message that gives no hint which argument is null and which is the concerned capability.

Reproducible: Always

Steps to Reproduce:
1. In Eclipse IDE 3.6, run P2 product publisher application with configured standard parameters but omitting the “flavor” parameter, e.g.:
-metadataRepository file:///D:/tools (url to an existing repository)
-artifactRepository file:///D:/tools (url to an existing repository)
-productFile d:/file.product (file path to a standard product file)
-append
2. Observe the output which contains the AssertionFailedException with an unclear  message:
Status ERROR: org.eclipse.equinox.p2.artifact.repository code=0 null argument: org.eclipse.core.runtime.AssertionFailedException: null argument:
Comment 1 Katya Stoycheva CLA 2010-08-06 10:30:07 EDT
Created attachment 176039 [details]
It is clearly shown which of the arguments is null and which is the provided capability by its namespace, if not null.

Old message:
org.eclipse.core.runtime.AssertionFailedException: null argument: the namespace of the provided capabilty is not defined

New message:
org.eclipse.core.runtime.AssertionFailedException: null argument:the name of provided capability org.eclipse.equinox.p2.flavor is not defined
Comment 2 Pascal Rapicault CLA 2011-01-19 16:19:37 EST
thx for the patch.