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

ILocateChangeSetSearchCriteriaFactory.create

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!

0 votes



One answer

Permanent link
If it cannot be null, the implication is to provide an empty list or a populated list.

0 votes

Comments

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?

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.

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

Question asked: Sep 23 '14, 7:19 p.m.

Question was seen: 3,104 times

Last updated: Sep 25 '14, 9:34 a.m.

Confirmation Cancel Confirm