You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2013/04/21 21:20:02 UTC

Re: svn commit: r1470311 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java

On 21 April 2013 16:21, <tn...@apache.org> wrote:

> Author: tn
> Date: Sun Apr 21 15:21:45 2013
> New Revision: 1470311
>
> URL: http://svn.apache.org/r1470311
> Log:
> Suppress deprecation warnings for ArrayStack usage.
>
>
Surely the code should use whatever the replacement is?


> Modified:
>
> commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
>
> Modified:
> commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
> URL:
> http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java?rev=1470311&r1=1470310&r2=1470311&view=diff
>
> ==============================================================================
> ---
> commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
> (original)
> +++
> commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
> Sun Apr 21 15:21:45 2013
> @@ -910,6 +910,7 @@ public class MapUtils {
>       *  If <code>null</code>, the text 'null' is output.
>       * @throws NullPointerException if the stream is <code>null</code>
>       */
> +    @SuppressWarnings("deprecation")
>      public static void verbosePrint(final PrintStream out, final Object
> label, final Map<?, ?> map) {
>          verbosePrintInternal(out, label, map, new ArrayStack<Map<?,
> ?>>(), false);
>      }
> @@ -932,6 +933,7 @@ public class MapUtils {
>       *   If <code>null</code>, the text 'null' is output.
>       * @throws NullPointerException if the stream is <code>null</code>
>       */
> +    @SuppressWarnings("deprecation")
>      public static void debugPrint(final PrintStream out, final Object
> label, final Map<?, ?> map) {
>          verbosePrintInternal(out, label, map, new ArrayStack<Map<?,
> ?>>(), true);
>      }
> @@ -961,6 +963,7 @@ public class MapUtils {
>       * @param debug  flag indicating whether type names should be output.
>       * @throws NullPointerException if the stream is <code>null</code>
>       */
> +    @SuppressWarnings("deprecation")
>      private static void verbosePrintInternal(final PrintStream out, final
> Object label, final Map<?, ?> map,
>                                               final ArrayStack<Map<?, ?>>
> lineage, final boolean debug) {
>          printIndent(out, lineage.size());
>
>
>

Re: svn commit: r1470311 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java

Posted by Thomas Neidhart <th...@gmail.com>.
My idea was that > 90% of the potential users will use Java 6+, thus it
made sense to me, but of course we can change it and wait till we move to
Java 6 ourselves.

Thomas


On Sun, Apr 21, 2013 at 11:10 PM, sebb <se...@gmail.com> wrote:

> On 21 April 2013 21:30, Thomas Neidhart <th...@gmail.com> wrote:
>
> > On 04/21/2013 09:20 PM, sebb wrote:
> > > On 21 April 2013 16:21, <tn...@apache.org> wrote:
> > >
> > >> Author: tn
> > >> Date: Sun Apr 21 15:21:45 2013
> > >> New Revision: 1470311
> > >>
> > >> URL: http://svn.apache.org/r1470311
> > >> Log:
> > >> Suppress deprecation warnings for ArrayStack usage.
> > >>
> > >>
> > > Surely the code should use whatever the replacement is?
> >
> > I deprecated ArrayStack as it is obsoleted by the Deque interface of
> > Java 6. As we still target Java 5 for collections, I decided to keep it,
> > as there is no other non-synchronized LIFO stack available (unless you
> > use a plain LinkedList).
> >
> > But we could also decide to target Java 6 for collections 4?
> >
> >
> Would it not be better to leave the deprecation until the code actually
> needs Java 6?
>
> There's nothing Java 5 users can do about the deprecation, so it's
> currently just noise.
>
> Thomas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>

Re: svn commit: r1470311 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java

Posted by sebb <se...@gmail.com>.
On 21 April 2013 21:30, Thomas Neidhart <th...@gmail.com> wrote:

> On 04/21/2013 09:20 PM, sebb wrote:
> > On 21 April 2013 16:21, <tn...@apache.org> wrote:
> >
> >> Author: tn
> >> Date: Sun Apr 21 15:21:45 2013
> >> New Revision: 1470311
> >>
> >> URL: http://svn.apache.org/r1470311
> >> Log:
> >> Suppress deprecation warnings for ArrayStack usage.
> >>
> >>
> > Surely the code should use whatever the replacement is?
>
> I deprecated ArrayStack as it is obsoleted by the Deque interface of
> Java 6. As we still target Java 5 for collections, I decided to keep it,
> as there is no other non-synchronized LIFO stack available (unless you
> use a plain LinkedList).
>
> But we could also decide to target Java 6 for collections 4?
>
>
Would it not be better to leave the deprecation until the code actually
needs Java 6?

There's nothing Java 5 users can do about the deprecation, so it's
currently just noise.

Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: svn commit: r1470311 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java

Posted by Thomas Neidhart <th...@gmail.com>.
On 04/21/2013 09:20 PM, sebb wrote:
> On 21 April 2013 16:21, <tn...@apache.org> wrote:
> 
>> Author: tn
>> Date: Sun Apr 21 15:21:45 2013
>> New Revision: 1470311
>>
>> URL: http://svn.apache.org/r1470311
>> Log:
>> Suppress deprecation warnings for ArrayStack usage.
>>
>>
> Surely the code should use whatever the replacement is?

I deprecated ArrayStack as it is obsoleted by the Deque interface of
Java 6. As we still target Java 5 for collections, I decided to keep it,
as there is no other non-synchronized LIFO stack available (unless you
use a plain LinkedList).

But we could also decide to target Java 6 for collections 4?

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org