It's all about the answers!

Ask a question

Why does getting the IAttribute value throw AssertionFailedException ?


Shwetha G (6022) | asked Apr 19 '17, 4:25 a.m.

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

One answer



permanent link
Ralph Schoon (59.7k23643) | answered Apr 19 '17, 4:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 19 '17, 4:48 a.m.

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?.

Your answer


Register or to post your answer.