Hi Benjamin,

2008/8/8 Benjamin Bentmann <[EMAIL PROTECTED]>:
> Hi Vincent,
>
>> Author: vsiveton
>> Date: Thu Aug  7 13:29:31 2008
>> New Revision: 683705
>>
>> URL: http://svn.apache.org/viewvc?rev=683705&view=rev
>> Log:
>> o added a validation for lineLength and indentSize and updated Javadoc
>> (should be positive)
>> o change modifier for toLines() into public static so it could be used
>> outside like in the help plugin
>>
>> Modified:
>>
>>  
>> maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
>> o change modifier for toLines() into public static so it could be used
>> outside like in the help plugin
>>
>> [...]
>> -        writer.write( "    private List toLines( String text, int indent
>> )" + LS );
>> +        writer.write( "    public static List toLines( String text, int
>> indent, int indentSize, int lineLength )" + LS );
>
> I am not sure whether it is a good idea to promote original private
> helpers into public API just for the sake or reusing them in another
> (admittedly similar) context. Once a method is public, you are required
> to keep it like that since other people can start using it and expect
> backward-compats, limitting our possibilities to change the
> implementation, possibly preventing progress or causing deprecated

Agree on that but this method is a requirement for PluginHelpGenerator
so we definitely need to maintain it.

> clutter. I mean, there is a reason why Java provides different means of
> visibility/access and hopefully a reason for us to carefully choose one
> of these ;-)
>
> In order to keep indepenent things decoupled from one other, I would
> rather recommend to just copy the code. If you don't feel comfortable
> with that since copy&paste isn't ideal either, than at a minimum we
> should keep the method package private. This still allows you to call it
> from the Help Plugin's mojos (which reside in the same package) but
> also expresses the intention "don't touch me!".

Another way is to use the Method#invoke(). I don't like very well copy/paste ;)
But making it private with a Javadoc comment is fine.

Cheers,

Vincent

> What do you think?
>
>
> Benjamin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to