You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2018/08/21 18:05:47 UTC

Re: ant git commit: Remove redundancies

> diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java b/src/main/org/apache/tools/ant/types/PatternSet.java

> -                : new StringBuilder(baseString).append(";encoding->").append(encoding).toString();
> +                : baseString + ";encoding->" + encoding;

I don't understand what kind of redundancy have you been removing here.

Stefan

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


Re: ant git commit: Remove redundancies

Posted by Gintautas Grigelionis <g....@gmail.com>.
On Thu, 23 Aug 2018 at 07:06, Stefan Bodewig <bo...@apache.org> wrote:

> On 2018-08-22, Matt Sicker wrote:
>
> > Pretty much every implementation of javac will automatically convert the
> > string concatenation code into StringBuilders. Decompile the byte code
> and
> > see for yourself.
>
> I know that :-)
>
> The thing I qibble about is the commit message says "remove
> redundancies" and I don't see any redundancy in the original code.
>

Sorry, my bad. That should have been "early suboptimisation".
I believe, Java 9+ optimises string concatenation differently (or,
actually, it may use invokedynamic to delay it :-).

Gintas

Re: ant git commit: Remove redundancies

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-08-22, Matt Sicker wrote:

> Pretty much every implementation of javac will automatically convert the
> string concatenation code into StringBuilders. Decompile the byte code and
> see for yourself.

I know that :-)

The thing I qibble about is the commit message says "remove
redundancies" and I don't see any redundancy in the original code.

Stefan

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


Re: ant git commit: Remove redundancies

Posted by Matt Sicker <bo...@gmail.com>.
Pretty much every implementation of javac will automatically convert the
string concatenation code into StringBuilders. Decompile the byte code and
see for yourself.

On Tue, 21 Aug 2018 at 13:05, Stefan Bodewig <bo...@apache.org> wrote:

>
> > diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java
> b/src/main/org/apache/tools/ant/types/PatternSet.java
>
> > -                : new
> StringBuilder(baseString).append(";encoding->").append(encoding).toString();
> > +                : baseString + ";encoding->" + encoding;
>
> I don't understand what kind of redundancy have you been removing here.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

-- 
Matt Sicker <bo...@gmail.com>