Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Generics and APIs

Hi everyone,

Thanks for the clarification, Martin.  I was under the assumption that
changes in an API contract (whether in the source code or the
documentation) were considered breaking API changes.  For example, changing
the Javadoc from "This method never returns null." to "This method returns
null if X happens." would likely break clients that didn't do null checks.
In this case, since we're just documenting the assumptions that existing
clients of the code are making, it's not really a breaking change.  It
might be if API clients outside of CDT are making other assumptions than
the ones within CDT...

And as Mike pointed out, it's really more of a documentation change.
Existing clients are already assuming they're getting instances of the
types I'm adding to the method signatures.

Seems like the community is ok with these changes.  I'll get them checked
in shortly.

Thanks for all your input!

Jason Montojo
IBM CDT Team
IBM Toronto Lab
905-413-5228
jmontojo@xxxxxxxxxx

cdt-dev-bounces@xxxxxxxxxxx wrote on 10/04/2008 04:23:54 PM:

> Hello Jason,
>
> I might have missed something here since it's been a while
> Since I've been digesting cdt-dev... But in what respect
> Do you think that "Genericizing" a method return value is
> An API change?
>
> On
> http://wiki.eclipse.org/Evolving_Java-based_APIs_2#Turning_non-generic_t
> ypes_and_methods_into_generic_ones
> I can read "As long as the erasure looks like the corresponding
> declaration prior to generification, the change is binary compatible
> with existing code."
>
> So your change is definitely binary compatible.
>
> It's not source compatbile, of course, because a (theoretical)
> Client that uses a Map<Foo,Bar> and was able to assign your
> Returned Map to his Map<Foo,Bar> can no longer do this now.
> But that would likely have been an error anyways...
>
> Cheers,
> --
> Martin Oberhuber, Senior Member of Technical Staff, Wind River
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
>
> > -----Original Message-----
> > From: cdt-dev-bounces@xxxxxxxxxxx
> > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jason Montojo
> > Sent: Donnerstag, 10. April 2008 21:39
> > To: cdt-dev@xxxxxxxxxxx
> > Subject: [cdt-dev] Generics and APIs
> >
> >
> > Hi everyone,
> >
> > I've been fixing compiler warnings about generics in the
> > language mapping
> > classes.  This involved having to change a number of method
> > signatures to
> > account for parameterized collections. For example, I changed this in
> > LanguageManager:
> >
> > Old:
> > public Map getContentTypeIdToLanguageDescriptionsMap(){ ... }
> >
> > New:
> > public Map<String, ILanguageDescriptor[]>
> > getContentTypeIdToLanguageDescriptionsMap(){ ... }
> >
> > Such a change wouldn't break existing clients and it makes
> > the API much
> > easier to work with.  Regardless, it is still an API change.
> >
> > Should I go ahead and make the changes to the signatures?  Or should I
> > leave them as-is?  I know we're already past the API freeze
> > so I'd like to
> > know how the community feels about this.
> >
> > Thanks,
> > Jason Montojo
> > IBM CDT Team
> > IBM Toronto Lab
> > 905-413-5228
> > jmontojo@xxxxxxxxxx
> >
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top