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.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
|
@ -76,8 +77,8 @@ public class EventOverviewWebPage extends HalWebPage {
|
|||
return tmpl;
|
||||
}
|
||||
else {
|
||||
Event[] events = Event.getLocalEvents(db).toArray(new Event[0]);
|
||||
Arrays.sort(events, DeviceNameComparator.getInstance());
|
||||
List<Event> events = Event.getLocalEvents(db);
|
||||
Collections.sort(events, DeviceNameComparator.getInstance());
|
||||
|
||||
Templator tmpl = new Templator(FileUtil.find(OVERVIEW_TEMPLATE));
|
||||
tmpl.set("events", events);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import zutil.parser.Templator;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -53,8 +54,8 @@ public class SensorOverviewWebPage extends HalWebPage {
|
|||
tmpl.set("history", history);
|
||||
return tmpl;
|
||||
} else {
|
||||
Sensor[] sensors = Sensor.getLocalSensors(db).toArray(new Sensor[0]);
|
||||
Arrays.sort(sensors, DeviceNameComparator.getInstance());
|
||||
List<Sensor> sensors = Sensor.getLocalSensors(db);
|
||||
Collections.sort(sensors, DeviceNameComparator.getInstance());
|
||||
|
||||
Templator tmpl = new Templator(FileUtil.find(OVERVIEW_TEMPLATE));
|
||||
tmpl.set("sensors", sensors);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue