-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSIP-157 / GEOS-7987 - Track modified properties in CatalogPostModifyEvent #2101
Conversation
Big API break Batman! There is no such a thing as a package protected method for an interface, they are all public. In this current form the change is proposal worthy and non backportable. Any chance you can use default methods to fix the backwards compatibility issues? |
Huh, learned something new today. Seems like that should have been obvious in retrospect. GSIP incoming. There are a few ways I could see of maintaining API backwards-compatibility. Unfortunately, they all run into the same problem: By necessity, anything using these methods would not set the changed values. This means that anything listening on CatalogPostModifiedEvent can no longer rely on an empty list of properties meaning nothing has changed. |
f2ea1aa
to
bb99511
Compare
Master is ready for breaking changes :-) |
Thanks for the reminder.
I've updated this so it is mergeable again, and sent out a notification to
the dev list.
…On Sat, Mar 18, 2017 at 3:50 AM, Andrea Aime ***@***.***> wrote:
Master is ready for breaking changes :-)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2101 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AI14yYhKkhLZ00Ue9jFd1t8B1Dmq8qrCks5rm7cKgaJpZM4L8keA>
.
|
@@ -200,10 +200,17 @@ public void remove(StoreInfo store) { | |||
} | |||
|
|||
public void save(StoreInfo store) { | |||
beforeSaved(store); | |||
ModificationProxy h = (ModificationProxy) Proxy.getInvocationHandler(store); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this pattern repeated over and over and over... how about a method taking a lambda to do the bit in the middle, after the notication and before commitProxy? Just thinking out loud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a good idea, although I don't know how to implement it (I am still not especially familiar with lambdas in java). If you've got an example of what you are suggesting, I could certainly apply it to the relevant places.
GSIP Here: https://github.com/geoserver/geoserver/wiki/GSIP-157
API Changes:
getPropertyNames
,getOldValues
,getNewValues
added to CatalogPostModifyEvent interface.getPropertyNames
,setPropertyNames
,getNewValues
,setNewValues
,getOldValues
,setOldValues
added to CatalogPostModifyEventImpl.List<String> propertyNames
,List oldValues
,List newValues
have been added to the package private methodfirePostModified
of AbstractCatalogDecorator, AbstractFilteredCatalog, CatalogImpl, and SecureCatalogImpl, and to the protected methodsbeforeSaved
andafterSaved
of AbstractCatalogFacade.All invocations of above methods and classes have been updated accordingly.
Given that all the changes are internal (protected or package private) to the Catalog, this seems likely to be a relatively safe change (Although I think it should not be backported, as it is still an API change)