Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2011-01-07 21:47:37 +0000
committerChris Goldthorpe2011-01-07 21:47:37 +0000
commit2b9bd58646052370e563961d4607093758dc6ab3 (patch)
tree3f3c48f51511789340cd295110062944dcfe08fb /org.eclipse.ua.tests/help
parentb6e9f30e0aab46a8f33d4b52cdf9f5134de15132 (diff)
downloadeclipse.platform.ua-2b9bd58646052370e563961d4607093758dc6ab3.tar.gz
eclipse.platform.ua-2b9bd58646052370e563961d4607093758dc6ab3.tar.xz
eclipse.platform.ua-2b9bd58646052370e563961d4607093758dc6ab3.zip
Fix warnings when compiled with Java 5.0
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java19
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java14
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneParticipant.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneXMLParticipant.java10
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java10
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java14
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java6
8 files changed, 43 insertions, 42 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java
index 9a77b5933..bbf01e17c 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@ import org.eclipse.help.internal.search.SearchHit;
import org.eclipse.help.internal.search.SearchQuery;
import org.eclipse.help.internal.search.SearchResults;
import org.eclipse.help.internal.workingset.AdaptableHelpResource;
+import org.eclipse.help.internal.workingset.AdaptableToc;
import org.eclipse.help.internal.workingset.WorkingSet;
import org.eclipse.help.internal.workingset.WorkingSetManager;
@@ -125,16 +126,16 @@ public class ExtraDirTest extends TestCase {
WorkingSet[] workingSets = null;
if (scope != null) {
WorkingSetManager wsm = BaseHelpSystem.getWorkingSetManager();
- List tocs = new ArrayList();
+ List<AdaptableToc> tocs = new ArrayList<AdaptableToc>();
StringTokenizer tok = new StringTokenizer(scope, ", \t\n");
while (tok.hasMoreTokens()) {
tocs.add(wsm.getAdaptableToc(tok.nextToken()));
}
- workingSets = new WorkingSet[] { wsm.createWorkingSet("testWorkingSet", (AdaptableHelpResource[])tocs.toArray(new AdaptableHelpResource[tocs.size()])) };
+ workingSets = new WorkingSet[] { wsm.createWorkingSet("testWorkingSet", tocs.toArray(new AdaptableHelpResource[tocs.size()])) };
}
// expected hits
- final Set hrefsToFind = new HashSet();
+ final Set<String> hrefsToFind = new HashSet<String>();
if (expectedResults != null) {
StringTokenizer tok = new StringTokenizer(expectedResults, ", \t\n");
while (tok.hasMoreTokens()) {
@@ -143,7 +144,7 @@ public class ExtraDirTest extends TestCase {
}
// run test
- final Set unexpectedHrefs = new HashSet();
+ final Set<String> unexpectedHrefs = new HashSet<String>();
ISearchQuery query = new SearchQuery(searchWord, false, new ArrayList(), Platform.getNL());
SearchResults collector = new SearchResults(workingSets, 500, Platform.getNL());
BaseHelpSystem.getSearchManager().search(query, collector, new NullProgressMonitor());
@@ -168,9 +169,9 @@ public class ExtraDirTest extends TestCase {
buf.append("While searching for: " + searchWord + ",\n");
if (!hrefsToFind.isEmpty()) {
buf.append("Some of the expected results were not found:\n");
- Iterator iter = hrefsToFind.iterator();
+ Iterator<String> iter = hrefsToFind.iterator();
while (iter.hasNext()) {
- String missedHref = (String)iter.next();
+ String missedHref = iter.next();
buf.append(missedHref + "\n");
}
}
@@ -179,9 +180,9 @@ public class ExtraDirTest extends TestCase {
buf.append("\nAlso,\n");
}
buf.append("Found some unexpected search results:\n");
- Iterator iter = unexpectedHrefs.iterator();
+ Iterator<String> iter = unexpectedHrefs.iterator();
while (iter.hasNext()) {
- String unexpectedHref = (String)iter.next();
+ String unexpectedHref = iter.next();
buf.append(unexpectedHref + "\n");
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
index fce3a2547..5a370475c 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -79,7 +79,7 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
assertEquals(1, readWsets.length);
AdaptableHelpResource[] resources = readWsets[0].getElements();
assertEquals(1, resources.length);
- Set topics = new HashSet();
+ Set<AdaptableTopic> topics = new HashSet<AdaptableTopic>();
topics.add(topic1);
assertTrue(topics.contains(resources[0]));
checkCookies(resp);
@@ -100,7 +100,7 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
assertEquals(1, readWsets.length);
AdaptableHelpResource[] resources = readWsets[0].getElements();
assertEquals(2, resources.length);
- Set topics = new HashSet();
+ Set<AdaptableTopic> topics = new HashSet<AdaptableTopic>();
topics.add(topic1);
topics.add(topic3);
assertTrue(topics.contains(resources[0]));
@@ -126,7 +126,7 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
assertEquals(1, readWsets.length);
AdaptableHelpResource[] resources = readWsets[0].getElements();
assertEquals(3, resources.length);
- Set topics = new HashSet();
+ Set<AdaptableTopic> topics = new HashSet<AdaptableTopic>();
topics.add(topic1);
topics.add(topic3);
topics.add(topic5);
@@ -155,7 +155,7 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
assertEquals(1, readWsets.length);
AdaptableHelpResource[] resources = readWsets[0].getElements();
assertEquals(1, resources.length);
- Set topics = new HashSet();
+ Set<AdaptableTopic> topics = new HashSet<AdaptableTopic>();
topics.add(topic1);
assertTrue(topics.contains(resources[0]));
checkCookies(resp);
@@ -182,7 +182,7 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
assertEquals(1, readWsets.length);
AdaptableHelpResource[] resources = readWsets[0].getElements();
assertEquals(2, resources.length);
- Set topics = new HashSet();
+ Set<AdaptableTopic> topics = new HashSet<AdaptableTopic>();
topics.add(topic1);
topics.add(topic3);
assertTrue(topics.contains(resources[0]));
@@ -213,7 +213,7 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
assertEquals(1, readWsets.length);
AdaptableHelpResource[] resources = readWsets[0].getElements();
assertEquals(3, resources.length);
- Set topics = new HashSet();
+ Set<AdaptableTopic> topics = new HashSet<AdaptableTopic>();
topics.add(topic1);
topics.add(topic3);
topics.add(topic5);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneParticipant.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneParticipant.java
index d91a39ac6..576b502f0 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneParticipant.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,8 +41,8 @@ public class MockLuceneParticipant extends LuceneSearchParticipant {
return Status.OK_STATUS;
}
- public Set getAllDocuments(String locale) {
- HashSet set = new HashSet();
+ public Set<String> getAllDocuments(String locale) {
+ HashSet<String> set = new HashSet<String>();
set.add(DOC_1);
set.add(DOC_2);
return set;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneXMLParticipant.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneXMLParticipant.java
index b45a969dc..55b5b6d40 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneXMLParticipant.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockLuceneXMLParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,15 +22,15 @@ public class MockLuceneXMLParticipant extends XMLSearchParticipant {
public static final String DOC_1 = "/org.eclipse.ua.tests/data/help/search/lucene_xml_1.xml";
public static final String DOC_2 = "/org.eclipse.ua.tests/data/help/search/lucene_xml_2.xml";
- public Set getAllDocuments(String locale) {
- HashSet set = new HashSet();
+ public Set<String> getAllDocuments(String locale) {
+ HashSet<String> set = new HashSet<String>();
set.add(DOC_1 + "?id=xml1" + "?id=xml2");
set.add(DOC_2);
return set;
}
- public Set getContributingPlugins() {
- Set result = new HashSet();
+ public Set<String> getContributingPlugins() {
+ Set<String> result = new HashSet<String>();
result.add("org.eclipse.ua.tests");
return result;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java
index fc0189472..fd4464fd4 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,8 +26,8 @@ public class MockSearchParticipant extends SearchParticipant {
private static final String DOC_1 = "/org.eclipse.ua.tests/participant1.xml";
private static final String DOC_2 = "/org.eclipse.ua.tests/participant2.xml";
- public Set getAllDocuments(String locale) {
- HashSet set = new HashSet();
+ public Set<String> getAllDocuments(String locale) {
+ HashSet<String> set = new HashSet<String>();
set.add(DOC_1);
set.add(DOC_2);
return set;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java
index 1f45b4797..42cbb9532 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,15 +22,15 @@ public class MockSearchParticipantXML extends SearchParticipantXML {
public static final String DOC_1 = "/org.eclipse.ua.tests/data/help/search/participant_xml_1.xml";
public static final String DOC_2 = "/org.eclipse.ua.tests/data/help/search/participant_xml_2.xml";
- public Set getAllDocuments(String locale) {
- HashSet set = new HashSet();
+ public Set<String> getAllDocuments(String locale) {
+ HashSet<String> set = new HashSet<String>();
set.add(DOC_1 + "?id=xml1" + "?id=xml2");
set.add(DOC_2);
return set;
}
- public Set getContributingPlugins() {
- Set result = new HashSet();
+ public Set<String> getContributingPlugins() {
+ Set<String> result = new HashSet<String>();
result.add("org.eclipse.ua.tests");
return result;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java
index cbdf03154..d85fa9f1b 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,8 +46,8 @@ public class SearchTestUtils {
*/
public static String searchForExpectedResults(String searchWord,
String[] hrefs, String nl) {
- final Set hrefsToFind = new HashSet();
- final Set unexpectedHrefs = new HashSet();
+ final Set<String> hrefsToFind = new HashSet<String>();
+ final Set<String> unexpectedHrefs = new HashSet<String>();
hrefsToFind.addAll(Arrays.asList(hrefs));
SearchHit[] hits;
@@ -72,9 +72,9 @@ public class SearchTestUtils {
buf.append("While searching for: " + searchWord + ",\n");
if (!hrefsToFind.isEmpty()) {
buf.append("Some of the expected results were not found:\n");
- Iterator iter = hrefsToFind.iterator();
+ Iterator<String> iter = hrefsToFind.iterator();
while (iter.hasNext()) {
- String missedHref = (String)iter.next();
+ String missedHref = iter.next();
buf.append(missedHref + "\n");
}
}
@@ -83,9 +83,9 @@ public class SearchTestUtils {
buf.append("\nAlso,\n");
}
buf.append("Found some unexpected search results:\n");
- Iterator iter = unexpectedHrefs.iterator();
+ Iterator<String> iter = unexpectedHrefs.iterator();
while (iter.hasNext()) {
- String unexpectedHref = (String)iter.next();
+ String unexpectedHref = iter.next();
buf.append(unexpectedHref + "\n");
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java
index 5310750f9..7f9f36107 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -204,12 +204,12 @@ public class WorkingSetManagerTest extends TestCase {
private void createWsetWithAllTocs(WorkingSetManager mgr, String name) {
WorkingSet wset = new WorkingSet(name);
- List tocList = new ArrayList();
+ List<AdaptableToc> tocList = new ArrayList<AdaptableToc>();
Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
for (int i = 0; i < tocs.length; i++) {
tocList.add(mgr.getAdaptableToc(tocs[i].getHref()));
}
- wset.setElements((AdaptableHelpResource[]) tocList.toArray(new AdaptableToc[0]));
+ wset.setElements(tocList.toArray(new AdaptableToc[0]));
mgr.addWorkingSet(wset);
};

Back to the top