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

Why does getting the IAttribute value throw AssertionFailedException ?

Hello All,

I have following code, which throws AssertionFailedException. What is the reason for this.

workItemClient = (IWorkItemClient) teamRepository .getClientLibrary(IWorkItemClient.class);
        IEnumeration<ILiteral> enumeration = (IEnumeration<ILiteral>) workItemClient.resolveEnumeration(iattribute, monitor);
            iac = (IAuditableClient) ((ITeamRepository) currentWorkItem.getOrigin()).getClientLibrary(IAuditableClient.class);
            String[] iaval = iattribute.getValue(iac, currentWorkItem, monitor);

Request you to assist me on this.

Thanks

0 votes



One answer

Permanent link

That is bad Java Code. There is no checking for null or if the calls actually return anything useful. A little bit of debugging and being able to read the exception should provide you with what you need to know.


Then there is no return type of String[] for getValue() that I am aware of either.  List types are returned as List<Object> 
e.g. List<String>. A decent Java application tests for instance of before casting. 

I think I provided you with many hints about how to setup and debug the RTC Java API, you might want to check the answers on prior questions.

I have also tried to point out that just posting a Java snippet with an minimal error message is insufficient in this forum. The error does not tell where that happens and there are also no line numbers anyone could tell from where. See How should I ask a question in the Forum if I want to receive useful answers?.

0 votes

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,942

Question asked: Apr 19 '17, 4:25 a.m.

Question was seen: 1,434 times

Last updated: Apr 19 '17, 4:48 a.m.

Confirmation Cancel Confirm