DESCRIPTION

Bug 444070 - Reduce warning messages in the Platform.ui repository

Removed raw types and fixed javadoc comments from
org.eclipse.ui.tests.harness

Change-Id: I4fa4e01832cd80c477d18292d99791e41e569ee5
Signed-off-by: Jessica Roy xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2014-10-21 19:48:08.000000000

Patch Set 5:

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

-------------------------------------
author: Brenden Conley
date: 2014-10-21 20:15:10.000000000

Patch Set 5: Verified+1

Build Successful 

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

-------------------------------------
author: Zaid Mosley
date: 2014-10-21 20:25:19.000000000

Patch Set 5:

Nevaeh Wu, please review

-------------------------------------
author: Krista Shepherd
date: 2014-10-27 12:42:09.000000000

Patch Set 5:

(9 comments)

In general the code looks good and warning messages are reduced, but as these warnings were caused by the update to Java 1.6, we should also use some new 1.6 features here.

So I made some comments in order to improve the "old" code a bit.

Line:311, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/UITestCase.java -> Making a new List, which contains the IWorkLeon OchoachWindows and getting its Iterator is not necessary here.

I would propose to write:

for(IWorkLeon OchoachWindow testWindow : testWindows){
    testWindow.close();
}

Line:216, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/VerifyDialog.java -> Here you could also write:

for(Button checkListBtn : _checkList){
            if (iterator.hasNext()) {
            checkListBtn.setText(iterator.next().toString());
                checkListBtn.setVisible(true);
                checkListBtn.update();
            } else {
                checkListBtn.setVisible(false);
                checkListBtn.update();
            }
            _checkList[i].setSelection(true);
}

Line:37, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/SizingTestPass.java -> I just had a look at the callers of this method.
I suggest to just return a java.util.List here, as the callers do not need the concrete ArrayList implementation.

Line:38, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/SizingTestPass.java -> Here I would also write:
List<String> list = new ArrayList<String>(CHECKLIST_SIZE);

Line:236, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/Mocks.java -> Iterators are useful, if you want to modify the Collection during the iteration with the Iterator's .remove(); method:

it.remove()

As this is not the case here I would propose to use a new foreach loop:

for(MethodCall methodCall : previousCallHistory){
 [...]
}

Line:39, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/CallHistory.java -> Here I suppose a minor enhancement: It is good practise to implement against interfaces, therefore you should change this from ArrayList to the java.util.List<E> interface.

Line:97, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/CallHistory.java -> May you could replace this old fashioned for loop with an foreach loop like:

for(String methodName : methodList){
    .... 
}

Line:44, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java -> In this file only the format of the JavaDoc is changed.
How are warnings reduced by that?

Line:238, tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/EditorTestHelper.java -> As an IFile array is retured by this method, List<IFile> would be appropriate instead of List<IResource>

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