Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to avoid RAW type warning from IBuildDefinition.getProperties()?

I'm reading the properties from a project area and want to save it a list:

IBuildDefinition buildDefinition = buildClient.getBuildDefinition(buildDefName, new NullProgressMonitor()); List<IBuildProperty> buildProps = buildDefinition.getProperties();

This produces a warning because getProperties() returns a raw-type List. How can I fix the warning because I'm assuming that the API is not going to get changed so that this warning would be avoided in the first place. 

Thanks!

0 votes


Accepted answer

Permanent link

I don't think you can. You can either suppress the warning in Eclipse or cast to a raw type and then use instanceof tests when working with the list.

David Frenzel selected this answer as the correct answer

0 votes

Comments

Since I'm iterating over the List I'm now casting all the Objects (because it's a raw List now) to IBuildProperty and now the warnings are gone. Thanks!

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936

Question asked: Jul 24 '18, 10:54 a.m.

Question was seen: 1,428 times

Last updated: Jul 24 '18, 11:19 a.m.

Confirmation Cancel Confirm