Cleanup of sort function
This commit is contained in:
parent
fee3fd81a0
commit
e54b53c974
2 changed files with 6 additions and 4 deletions
|
|
@ -16,6 +16,7 @@ import zutil.parser.Templator;
|
||||||
|
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
@ -76,8 +77,8 @@ public class EventOverviewWebPage extends HalWebPage {
|
||||||
return tmpl;
|
return tmpl;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Event[] events = Event.getLocalEvents(db).toArray(new Event[0]);
|
List<Event> events = Event.getLocalEvents(db);
|
||||||
Arrays.sort(events, DeviceNameComparator.getInstance());
|
Collections.sort(events, DeviceNameComparator.getInstance());
|
||||||
|
|
||||||
Templator tmpl = new Templator(FileUtil.find(OVERVIEW_TEMPLATE));
|
Templator tmpl = new Templator(FileUtil.find(OVERVIEW_TEMPLATE));
|
||||||
tmpl.set("events", events);
|
tmpl.set("events", events);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import zutil.parser.Templator;
|
||||||
|
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -53,8 +54,8 @@ public class SensorOverviewWebPage extends HalWebPage {
|
||||||
tmpl.set("history", history);
|
tmpl.set("history", history);
|
||||||
return tmpl;
|
return tmpl;
|
||||||
} else {
|
} else {
|
||||||
Sensor[] sensors = Sensor.getLocalSensors(db).toArray(new Sensor[0]);
|
List<Sensor> sensors = Sensor.getLocalSensors(db);
|
||||||
Arrays.sort(sensors, DeviceNameComparator.getInstance());
|
Collections.sort(sensors, DeviceNameComparator.getInstance());
|
||||||
|
|
||||||
Templator tmpl = new Templator(FileUtil.find(OVERVIEW_TEMPLATE));
|
Templator tmpl = new Templator(FileUtil.find(OVERVIEW_TEMPLATE));
|
||||||
tmpl.set("sensors", sensors);
|
tmpl.set("sensors", sensors);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue