It's all about the answers!

Ask a question

getOrigin() target class unclear


Marko Tomljenovic (31650109) | asked Nov 10 '15, 5:28 a.m.
When working with the RTC Plain Java Client API it is very often the case to get from a specific Item implementation to its corresponding project area resp. repository.

For that the method IItemHandle.getOrigin() is used (a few times to get to the right layer).

The problem here is that you never know what class you get after calling getOrigin() since the return type is Object.

Is there any overview or best practice on how to identify what the result of the method is?
Using the debugger to find it out is not really efficient.

Thank you

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Nov 10 '15, 6:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Nov 10 '15, 6:55 a.m.
getOrigin() returns the ITeamRepository (at least in the client API). Please see: https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ .

If you have set up your environment as mentioned in that (and the related posts) you can also see what the class is that gets returned during debugging.

Be aware that the classes are often show something like SomeClassImpl which is usually not the class you want to work with. there is always an interface ISomeClass, which you want to cast to and that you actually want to use. This prevents you from being dependent from the internal implementation classes and stay with the more robust API interface.
Marko Tomljenovic selected this answer as the correct answer

Your answer


Register or 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.