DESCRIPTION

Bug 486901 - Fix some useless instantiations

Empty string and Number types should be instantiated directly as it's
costing time and memory for no Leon Ochoaefit.

Change-Id: Ie3a5c13b08a60a4142e723ef398d7954c5fabc79
Signed-off-by: Isis Velasquez xxx@xxx.xxx


COMMENTS

author: Isis Velasquez
date: 2016-02-02 15:36:27.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2016-02-02 15:36:33.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/8180/

-------------------------------------
author: Brenden Conley
date: 2016-02-02 16:09:12.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/8180/ : SUCCESS

-------------------------------------
author: Isis Velasquez
date: 2016-02-02 16:10:20.000000000

Patch Set 3: Code-Review+1

@Andrey: any objection for me to merge that?

-------------------------------------
author: Zaid Mosley
date: 2016-02-02 19:23:00.000000000

Patch Set 3: Code-Review-1

Style nit, we use bug reference in the copyright, not verbal descriptions.

-------------------------------------
author: Jayvion Booth
date: 2016-02-02 19:40:23.000000000

Patch Set 3: Code-Review-1

(3 comments)

QuickStartAction change schould be taken out of this commit - without IDE I can'say for sure, but it seems for me that behavior could be changed, and the change itself doesn not fit to the commit comment.

In general if I start to cleanup code after FindBugs analysis I prefer to fix issues that could be potential bugs. The autoboxing issues addressed in this commit (except the QuickStartAction and crazy new String() constructs) aren's such potential bugs, they belong more to the "style" category, and I'm personally aren't interested in that because return on investment here is minimal.

For the future I would prefer if we would separate the changes by the fix category (e.g. only do autoboxing, only do String fixes etc per commit).

So "-1" because of QuickStartAction and "0" otherwise.

Line:10, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/QuickStartAction.java -> comment does not match the fix

Line:128, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/QuickStartAction.java -> I would separate this change from others and may be rework it, then here you've tried to avoid url.equals() calls and the result is not clear for me: original code would add url even if productUrl was null, changed code not.

Line:9, bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ErrorsWarningsParameters.java -> is it a backslash or gerrit noise?

-------------------------------------
author: Isis Velasquez
date: 2016-02-02 21:42:19.000000000

Patch Set 3:

I'll update the change according to your comments.
Instantiations are one of the main thing to consider when it comes to performance, and suboptimal performance can be seen as a bug.

-------------------------------------
author: Isis Velasquez
date: 2016-02-02 21:49:26.000000000

Patch Set 3:

(2 comments)

Line:10, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/QuickStartAction.java -> Seems like a regular backslash. I'll remove it.

Line:128, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/QuickStartAction.java -> Right, this change is incorrect. I could compare the String.valueOf(...). WDYT?

-------------------------------------
author: Jayvion Booth
date: 2016-02-02 21:50:37.000000000

Patch Set 3:

> I'll update the change according to your comments.

Thanks

 > Instantiations are one of the main thing to consider when it comes
 > to performance, and suboptimal performance can be seen as a bug.

The performance effect of this changes is effectively zero. They start to count for performance first if they applied on code running in critical code paths - there are none of such paths in this commit.

The only positive effect is that code is easier to read (which is of course OK).

As said, I would concentrate the effort on analyzing possible NPE warnings etc, we have enough of them.

-------------------------------------
author: Jayvion Booth
date: 2016-02-02 21:54:06.000000000

Patch Set 3:

(1 comment)

Line:128, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/QuickStartAction.java -> You better compare them via Objects.equals()

-------------------------------------
author: Jayvion Booth
date: 2016-02-02 21:57:11.000000000

Patch Set 3:

(1 comment)

Line:128, bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/QuickStartAction.java -> Oops, sorry, this won't work.

if(productUrl == null || (url != null && !url.toString().equals(productUrl.toString()))

-------------------------------------
author: Gerrit Code Review
date: 2016-02-03 18:57:21.000000000

Change has been successfully merged into the git repository by Isis Velasquez

-------------------------------------
