summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/i18n
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 15:40:17 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:01 +0200
commitb65017a2a7af290f6681da7b197a52efe83d5185 (patch)
tree06f71a435ba200d044109469b13be7c8f5dbe950 /qadevOOo/tests/java/ifc/i18n
parent33ec740d1438c3dddf8e1974757ed05bb76425ca (diff)
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo/tests/java/ifc/i18n')
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java38
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XCalendar.java2
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java2
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java6
4 files changed, 24 insertions, 24 deletions
diff --git a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java
index 27cc0ae55e0a..0fb7f2497446 100644
--- a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java
+++ b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java
@@ -170,7 +170,7 @@ public class _XBreakIterator extends MultiMethodTest {
tRes.tested("previousCharacters()", bRes);
}
- ArrayList vBounds = new ArrayList();
+ ArrayList<Boundary> vBounds = new ArrayList<Boundary>();
/**
* Saves bounds of all returned words for the future tests. <p>
@@ -205,7 +205,7 @@ public class _XBreakIterator extends MultiMethodTest {
requiredMethod("nextWord()");
int i = UnicodeString.length() - 1;
- ArrayList vPrevBounds = new ArrayList();
+ ArrayList<Boundary> vPrevBounds = new ArrayList<Boundary>();
while( i > 0 ) {
Boundary bounds =
oObj.previousWord(UnicodeString, i, locale, wordType);
@@ -237,7 +237,7 @@ public class _XBreakIterator extends MultiMethodTest {
for(int i = 0; i < vBounds.size(); i++) {
// calculate middle of the word
- Boundary iBounds = (Boundary)vBounds.get(i);
+ Boundary iBounds = vBounds.get(i);
int iPos = (iBounds.endPos - iBounds.startPos) / 2
+ iBounds.startPos;
Boundary bounds = oObj.getWordBoundary(UnicodeString, iPos,
@@ -268,7 +268,7 @@ public class _XBreakIterator extends MultiMethodTest {
for(int i = 0; i < vBounds.size(); i++) {
// calculate middle of the word
- Boundary iBounds = (Boundary)vBounds.get(i);
+ Boundary iBounds = vBounds.get(i);
int iPos = (iBounds.endPos - iBounds.startPos) / 2
+ iBounds.startPos;
@@ -294,7 +294,7 @@ public class _XBreakIterator extends MultiMethodTest {
boolean bRes = true;
for(int i = 0; i < vBounds.size(); i++) {
- Boundary iBounds = (Boundary)vBounds.get(i);
+ Boundary iBounds = vBounds.get(i);
boolean isBegin = oObj.isBeginWord(UnicodeString, iBounds.startPos,
locale, WordType.ANY_WORD);
bRes = bRes && isBegin;
@@ -326,7 +326,7 @@ public class _XBreakIterator extends MultiMethodTest {
boolean bRes = true;
for(int i = 0; i < vBounds.size(); i++) {
- Boundary iBounds = (Boundary)vBounds.get(i);
+ Boundary iBounds = vBounds.get(i);
boolean isEnd = oObj.isEndWord(UnicodeString, iBounds.endPos,
locale, WordType.ANY_WORD);
bRes = bRes && isEnd;
@@ -343,7 +343,7 @@ public class _XBreakIterator extends MultiMethodTest {
tRes.tested("isEndWord()", bRes);
}
- ArrayList vSentenceStart = new ArrayList();
+ ArrayList<Integer> vSentenceStart = new ArrayList<Integer>();
/**
* Tries to find all sentences starting positions passing every character
* as position parameter and stores them. Then tries to pass invalid
@@ -389,7 +389,7 @@ public class _XBreakIterator extends MultiMethodTest {
public void _endOfSentence() {
boolean bRes = true;
for(int i = 0; i < vSentenceStart.size(); i++) {
- int start = ((Integer)vSentenceStart.get(i)).intValue();
+ int start = vSentenceStart.get(i).intValue();
int end = oObj.endOfSentence(UnicodeString, start, locale);
bRes &= end > start;
log.println("Sentence " + i + " range is [" + start + ", "
@@ -549,8 +549,8 @@ public class _XBreakIterator extends MultiMethodTest {
return cType;
}
- ArrayList vCharBlockBounds = new ArrayList();
- ArrayList vCharBlockTypes = new ArrayList();
+ ArrayList<Boundary> vCharBlockBounds = new ArrayList<Boundary>();
+ ArrayList<Short> vCharBlockTypes = new ArrayList<Short>();
/**
* Creates array of all char blocks with their boundaries and
@@ -579,16 +579,16 @@ public class _XBreakIterator extends MultiMethodTest {
}
for(int i = 0; i < vCharBlockBounds.size() - 1; i++) {
- int endPos = ((Boundary)vCharBlockBounds.get(i)).endPos;
- int startPos = ((Boundary)vCharBlockBounds.get(i + 1)).startPos;
+ int endPos = vCharBlockBounds.get(i).endPos;
+ int startPos = vCharBlockBounds.get(i + 1).startPos;
bCharBlockRes &= endPos == startPos;
}
log.println("Testing for no intersections : " + bCharBlockRes);
- int startPos = ((Boundary)vCharBlockBounds.get(0)).startPos;
+ int startPos = vCharBlockBounds.get(0).startPos;
bCharBlockRes &= startPos == 0;
- int endPos = ((Boundary)vCharBlockBounds.get
- (vCharBlockBounds.size() - 1)).endPos;
+ int endPos = vCharBlockBounds.get
+ (vCharBlockBounds.size() - 1).endPos;
bCharBlockRes &= endPos == UnicodeString.length();
log.println("Regions should starts with 0 and ends with "
+ UnicodeString.length());
@@ -621,8 +621,8 @@ public class _XBreakIterator extends MultiMethodTest {
boolean bRes = true;
for(int i = 0; i < vCharBlockBounds.size(); i++) {
- Boundary bounds = (Boundary)vCharBlockBounds.get(i);
- Short type = (Short)vCharBlockTypes.get(i);
+ Boundary bounds = vCharBlockBounds.get(i);
+ Short type = vCharBlockTypes.get(i);
if (bounds.startPos - 1 < 0) continue;
int iPos = oObj.nextCharBlock(UnicodeString, bounds.startPos - 1,
locale, type.shortValue());
@@ -652,8 +652,8 @@ public class _XBreakIterator extends MultiMethodTest {
boolean bRes = true;
for(int i = 0; i < vCharBlockBounds.size(); i++) {
- Boundary bounds = (Boundary)vCharBlockBounds.get(i);
- Short type = (Short)vCharBlockTypes.get(i);
+ Boundary bounds = vCharBlockBounds.get(i);
+ Short type = vCharBlockTypes.get(i);
int iPos = oObj.previousCharBlock(UnicodeString,
bounds.endPos + 1, locale, type.shortValue());
if (iPos != bounds.startPos) {
diff --git a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java
index 484bca394fa2..7dc2dffe6029 100644
--- a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java
+++ b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java
@@ -72,7 +72,7 @@ public class _XCalendar extends MultiMethodTest {
public void before() {
XLocaleData locData = null;
try {
- locData = (XLocaleData) UnoRuntime.queryInterface(
+ locData = UnoRuntime.queryInterface(
XLocaleData.class,
((XMultiServiceFactory)tParam.getMSF()).createInstance(
"com.sun.star.i18n.LocaleData"));
diff --git a/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java b/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java
index bee1a1bc95d2..7f89b7d93a9b 100644
--- a/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java
+++ b/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java
@@ -43,7 +43,7 @@ public class _XExtendedCalendar extends MultiMethodTest {
Locale[] installed_locales = null;
XLocaleData locData = null;
try {
- locData = (XLocaleData) UnoRuntime.queryInterface(
+ locData = UnoRuntime.queryInterface(
XLocaleData.class,
((XMultiServiceFactory)tParam.getMSF()).createInstance(
"com.sun.star.i18n.LocaleData"));
diff --git a/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java b/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java
index d30e7b2fefbe..773ea0a1490f 100644
--- a/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java
+++ b/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java
@@ -29,7 +29,7 @@ import lib.MultiMethodTest;
public class _XExtendedIndexEntrySupplier extends MultiMethodTest {
public XExtendedIndexEntrySupplier oObj;
protected Locale[] locales = null;
- protected HashMap algorithms = new HashMap();
+ protected HashMap<Integer, String[]> algorithms = new HashMap<Integer, String[]>();
public void _compareIndexEntry() {
requiredMethod("getIndexKey()");
@@ -83,7 +83,7 @@ public class _XExtendedIndexEntrySupplier extends MultiMethodTest {
log.println("Language: " + locales[i].Language);
for (int j = 0; j < algorithms.size(); j++) {
- String[] algs = (String[])algorithms.get(new Integer(j));
+ String[] algs = algorithms.get(new Integer(j));
for (int k=0;k<algs.length;k++) {
log.println("\t Algorythm :" +
algs[k]);
@@ -145,7 +145,7 @@ public class _XExtendedIndexEntrySupplier extends MultiMethodTest {
boolean res = true;
for (int i = 0; i < algorithms.size(); i++) {
- String[] names = (String[]) algorithms.get(new Integer(i));
+ String[] names = algorithms.get(new Integer(i));
log.println("loading algorithms for " + locales[i].Country +
"," + locales[i].Language);