It's all about the answers!

Ask a question

ILocateChangeSetSearchCriteriaFactory.create


Martin Gompertz (48611) | asked Sep 23 '14, 7:19 p.m.
edited Sep 23 '14, 7:21 p.m.
I had a program developed against 4.0.0.1 that used the method
ILocateChangeSetSearchCriteriaFactory.create(java.util.List<IChangeSetHandle> changeSets, java.util.List<IWorkspaceHandle> workspaces, java.util.List<IBaselineSetHandle> snapshots)

And now at 4.0.6 my build is broken because this function is no longer in the class.  Instead I have:

ILocateChangeSetSearchCriteriaFactory.create(java.util.List changeSets, java.util.List workspaces, java.util.List snapshots, java.util.List baselines)
ILocateChangeSetSearchCriteriaFactory.create(java.util.List changeSets, java.util.List workspaces, java.util.List snapshots, java.util.List baselines, boolean includeCopies)

So my build is broken, and presumably my program won't run against 4.0.6 because it no longer contains the method I coded against.

Moving forwards, though.... the javadoc says "baselines" cannot be null.  What should it be set to?  What if I don't want to search in baselines, but only in snapshots?  Please provide an answer, and clarify the javadoc - thanks!

One answer



permanent link
Tim Mok (6.6k38) | answered Sep 24 '14, 9:50 a.m.
JAZZ DEVELOPER
edited Sep 24 '14, 9:50 a.m.
If it cannot be null, the implication is to provide an empty list or a populated list.

Comments
Martin Gompertz commented Sep 24 '14, 7:31 p.m.

Thanks - OK I can get this code to compile:

    criteria = ILocateChangeSetsSearchCriteria.FACTORY.create(
          (java.util.List)changeSets,
          (java.util.List)locate_workspaces,
          (java.util.List)locate_snapshots,
          (java.util.List)locate_baselines );

where locate_baselines is just this
  private static List<IBaseline> locate_baselines;

The casts from properly-typed Lists are undesirable, but without them I get compile errors.

But although it compiles, it gives me IllegalArgumentException at runtime.

I guess it's down to the casts, but what can I do about that?  I need properly-typed lists.

This code worked at 4.0.0.1.

Any ideas why I get the exception?


Martin Gompertz commented Sep 24 '14, 7:41 p.m.

I have got this working - my "illegal argument" was the 4th argument which I had forgotten to initialise, and so was null.

Oh, and to be correct, when I said "this code worked at 4.0.0.1" I don't mean the code snippet I just posted.  I mean my old call to the old method that no longer exists at 4.0.6.


Tim Mok commented Sep 25 '14, 9:34 a.m.
JAZZ DEVELOPER

Yes, the baselines were added to the query. It was marked experimental before so anybody else using that search should be aware of that.


You can also call Collections.EMPTY_LIST if you don't intend to populate the baselines list at all. It creates a minimal List object implementation to reduce overhead.

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.