atom feed19 messages in org.xwiki.devsRe: [xwiki-devs] [VOTE] REST API Chan...
FromSent OnAttachments
Ludovic DubostJul 27, 2012 1:12 am 
Ludovic DubostAug 7, 2012 10:33 pm 
Fabio MancinelliAug 21, 2012 5:18 am 
Sergiu DumitriuAug 21, 2012 6:19 am 
Ludovic DubostAug 21, 2012 1:02 pm 
Vincent MassolAug 21, 2012 1:17 pm 
Fabio MancinelliAug 21, 2012 1:48 pm 
Sergiu DumitriuAug 21, 2012 1:56 pm 
Vincent MassolAug 21, 2012 2:05 pm 
Ludovic DubostAug 21, 2012 3:54 pm 
Thomas MortagneAug 25, 2012 8:40 am 
Ludovic DubostOct 8, 2012 7:35 am 
Ludovic DubostOct 10, 2012 7:37 am 
Fabio MancinelliOct 12, 2012 8:59 am 
Jerome VelociterOct 12, 2012 11:09 am 
Thomas MortagneOct 14, 2012 1:55 am 
Fabio MancinelliOct 17, 2012 2:14 pm 
Fabio MancinelliOct 19, 2012 11:24 am 
Ludovic DubostOct 19, 2012 1:04 pm 
Subject:Re: [xwiki-devs] [VOTE] REST API Changes not passing CLIRR. Ignore errors
From:Ludovic Dubost (
Date:Oct 8, 2012 7:35:38 am


All votes told to move the code to internal packages.

This is something I can do, however I'm not sure exactly which code should go into the internal package and which one should stay where it is.

Right now here is the list of classes failing or not the CLIRR tests

Not failing:


So which one of these are not internal ?


2012/8/25 Thomas Mortagne <>:

On Tue, Aug 21, 2012 at 10:18 PM, Vincent Massol <> wrote:

On Aug 21, 2012, at 2:18 PM, Fabio Mancinelli wrote:

On Fri, Jul 27, 2012 at 10:12 AM, Ludovic Dubost <> wrote:

As part of rest improvements to display pretty names of users and other improvements, I'm getting CLIRR errors because of API changes of the model and of public class:

1/ Model CLIRR error because the version field has been moved to PageSummary from Page. Page extends PageSummary. I need the version field also in representations sending back only PageSummaries. Unfortunately CLIRR does not realize that the version field is still there when moved to the super class. I believe it's safe to ignore this error. Howerver I've put ignore all errors on the Page class as I don't have a way to ignore this specific error

Yep, I think it's safe. We're adding stuff in a representation (page summary) and keeping it also in the other, so API-wise it's ok.

Note that CLIRR doesn't have false positives so if it complains it means there's
a breakage. The only decision to take is whether it's an "acceptable" breakage,
i.e. we voluntarily break assuming that nobody was using it and accept that a
few users might get broken.

2/ CLIRR errors because of parameter additions to objects that are used (I think) only internally by the REST server API. Here are the errors:

[ERROR] In method 'public createAttachment(,, com.xpn.xwiki.api.Attachment, java.lang.String, java.lang.String)' the number of arguments has changed

The DomainObjectFactory is actually a utility class that is used to build REST-model objects from XWiki-model objects. It has been created just to prevent code duplication in resource implementations.

The question is whether this is supposed to be a SPI or not.

Now I think it's unlikely that somebody uses it outside the REST module (a quick grep confirmed this for platform).

The only use case for a developer of a module to use this class is if she wants to return a REST-model object and build it using the utility methods. I think this is quite unlikely.

AFAIU all parameters additions are about "pretty names" (

If we want to be conservative we might do the following: we can add the new methods and preserve the old ones making them call the new ones with default parameters.

* false in methods like this * null, false in methods like this . This implies that in the new implementation the if statement should also check for null values (like in this case:

We could also think about whether continuing to keep this class in the public API. It could make sense but I think that nobody will ever use it so we can start to @deprecate it and eventually move it in internal packages.

Based on what you say I'd say that these classes/methods were put public by
mistake and should all be moved to the internal package without going through

+1 for internal, if it's not supposed to be used outside of the module that's the definition of internal

Of course this means no other other XWiki modules should use them either since
they're internal.

Also this means that we don't provide any SPI either since SPI are user-public.
Is that what we want?

Thanks -Vincent