Mark,

On 6/30/21 08:51, Mark Thomas wrote:
All,

I wanted to get some feedback on a possible code clean-up. Currently, we declare literal arrays like this:

String[] array = new String[] { "value1", "value2", "value3" );

We could simplify these declarations to:

String[] array = { "value1", "value2", "value3" );

There doesn't appear to be a checkstyle rule to enforce one approach or the other.

Assuming someone is willing to spend the time to make these changes what do the folks here think?

I think the code is a little cleaner and therefore easier to read but the benefit seems minimal. I'm not sure it is worth "fixing" the existing code.

We could use this going forward as the opportunity arises. The inconsistency in style bugs me a little - but not so much I couldn't live with it.

Thoughts?

Hmm. Is there a minimum compiler version necessary to use that syntax? I've literally never seen it before. Maybe it's just always been there...

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to