1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-05 12:41:08 +01:00

SMACK-363 Applied code cleanup patches for many generics related issues.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13325 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2012-10-26 10:47:55 +00:00
parent 6dc64671e2
commit e08c8afe44
109 changed files with 577 additions and 605 deletions

View file

@ -240,8 +240,6 @@ public final class ModelUtil {
final long MS_IN_AN_HOUR = 1000 * 60 * 60;
final long MS_IN_A_MINUTE = 1000 * 60;
final long MS_IN_A_SECOND = 1000;
Date currentTime = new Date();
long numDays = diff / MS_IN_A_DAY;
diff = diff % MS_IN_A_DAY;
long numHours = diff / MS_IN_AN_HOUR;
diff = diff % MS_IN_AN_HOUR;
@ -249,7 +247,6 @@ public final class ModelUtil {
diff = diff % MS_IN_A_MINUTE;
long numSeconds = diff / MS_IN_A_SECOND;
diff = diff % MS_IN_A_SECOND;
long numMilliseconds = diff;
StringBuilder buf = new StringBuilder();
if (numHours > 0) {
@ -270,8 +267,8 @@ public final class ModelUtil {
/**
* Build a List of all elements in an Iterator.
*/
public static List iteratorAsList(Iterator i) {
ArrayList list = new ArrayList(10);
public static <T> List<T> iteratorAsList(Iterator<T> i) {
ArrayList<T> list = new ArrayList<T>(10);
while (i.hasNext()) {
list.add(i.next());
}
@ -281,18 +278,18 @@ public final class ModelUtil {
/**
* Creates an Iterator that is the reverse of a ListIterator.
*/
public static Iterator reverseListIterator(ListIterator i) {
return new ReverseListIterator(i);
public static <T> Iterator<T> reverseListIterator(ListIterator<T> i) {
return new ReverseListIterator<T>(i);
}
}
/**
* An Iterator that is the reverse of a ListIterator.
*/
class ReverseListIterator implements Iterator {
private ListIterator _i;
class ReverseListIterator<T> implements Iterator<T> {
private ListIterator<T> _i;
ReverseListIterator(ListIterator i) {
ReverseListIterator(ListIterator<T> i) {
_i = i;
while (_i.hasNext())
_i.next();
@ -302,13 +299,14 @@ class ReverseListIterator implements Iterator {
return _i.hasPrevious();
}
public Object next() {
public T next() {
return _i.previous();
}
public void remove() {
_i.remove();
}
}