Skip to content

Commit a5ec298

Browse files
authored
Merge pull request #3834 from jacomago/java-5-migrations
Java 5 migrations
2 parents 7934111 + 281e1e1 commit a5ec298

124 files changed

Lines changed: 256 additions & 294 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/alarm/model/src/test/java/org/phoebus/applications/alarm/AlarmConfigProducerDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private void sendConfigHierarchy(final Producer<String, AlarmTreeItem<?>> produc
185185
}
186186

187187
// Place all keys (alarm tree paths) in the same partition
188-
private static final Integer partition = Integer.valueOf(0);
188+
private static final Integer partition = 0;
189189

190190
private void sendItemConfig(final Producer<String, AlarmTreeItem<?>> producer,
191191
final String topic, final AlarmTreeItem<?> item)

app/alarm/model/src/test/java/org/phoebus/applications/alarm/AlarmStateProducerDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void close()
9292
@SuppressWarnings("resource")
9393
Producer<String, BasicState> producer = new KafkaProducer<>(props, key_serializer, value_serializer);
9494
// Place all keys (alarm tree paths) in the same partition
95-
Integer partition = Integer.valueOf(0);
95+
Integer partition = 0;
9696

9797
while (true)
9898
{

app/alarm/ui/src/main/java/org/phoebus/applications/alarm/ui/tree/AlarmTreeConfigView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private void startup()
189189
// expand tree item if is matches item name
190190
if (tree_config_view.getRoot() != null && itemName != null) {
191191
for (TreeItem treeItem : tree_config_view.getRoot().getChildren()) {
192-
if (((AlarmTreeItem) treeItem.getValue()).getName().equals(itemName)) {
192+
if (((AlarmTreeItem<?>) treeItem.getValue()).getName().equals(itemName)) {
193193
expandAlarms(treeItem);
194194
break;
195195
}

app/alarm/ui/src/main/java/org/phoebus/applications/alarm/ui/tree/AlarmTreeView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private void startup()
218218
// expand tree item if is matches item name
219219
if (tree_view.getRoot() != null && itemName != null) {
220220
for (TreeItem treeItem : tree_view.getRoot().getChildren()) {
221-
if (((AlarmTreeItem) treeItem.getValue()).getName().equals(itemName)) {
221+
if (((AlarmTreeItem<?>) treeItem.getValue()).getName().equals(itemName)) {
222222
expandAlarms(treeItem);
223223
break;
224224
}

app/channel/views/src/main/java/org/phoebus/channel/views/ui/ChannelTreeByPropertyNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public String getDisplayValue()
153153
private String formatVType(VType value )
154154
{
155155
Alarm alarm = Alarm.alarmOf(value);
156-
StringBuffer sb = new StringBuffer();
156+
StringBuilder sb = new StringBuilder();
157157
sb.append(FormatOptionHandler.format(value, FormatOption.DEFAULT, -1, true));
158158
if (!alarm.getSeverity().equals(AlarmSeverity.NONE))
159159
{

app/databrowser-json/src/main/java/org/phoebus/archive/reader/json/internal/JsonVTypeReader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ public static VType readValue(
293293
// Ensure that we have labels for all indices.
294294
int min_value = Integer.MAX_VALUE;
295295
int max_value = Integer.MIN_VALUE;
296-
for (var i = 0; i < enum_value.size(); ++i) {
297-
final var value = enum_value.get(i);
296+
for (final Integer value : enum_value) {
298297
min_value = Math.min(min_value, value);
299298
max_value = Math.max(max_value, value);
300299
}

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/export/ExcelExportJob.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ private void exportTable(final JobMonitor monitor) throws Exception
313313
final VType line[] = iter.next();
314314

315315
cell = createTimeCell(row = sheet.createRow(row.getRowNum() + 1), time);
316-
for (int i=0; i<line.length; ++i)
317-
cell = createValueCells(row, cell.getColumnIndex()+1, line[i]);
316+
for (VType vType : line) cell = createValueCells(row, cell.getColumnIndex() + 1, vType);
318317
++line_count;
319318
if ((line_count % PROGRESS_UPDATE_LINES) == 0)
320319
monitor.beginTask(MessageFormat.format("Wrote {0} samples", line_count));

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/export/SpreadsheetExportJob.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ protected void performExport(final JobMonitor monitor,
8383
final VType line[] = sheet.next();
8484
out.print(unixTimeStamp ? time.toEpochMilli() : TimestampFormats.MILLI_FORMAT.format(time));
8585

86-
for (int i=0; i<line.length; ++i)
87-
out.print(Messages.Export_Delimiter + formatter.format(line[i]));
86+
for (VType vType : line) out.print(Messages.Export_Delimiter + formatter.format(vType));
8887
out.println();
8988
++line_count;
9089
if ((line_count % PROGRESS_UPDATE_LINES) == 0)

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/model/FormulaItem.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,11 @@ private void compute()
195195
while (more_input)
196196
{ // Find oldest time stamp of all the inputs
197197
time = null;
198-
for (int i = 0; i < values.length; i++)
199-
{
200-
if (values[i] == null)
198+
for (VType vType : values) {
199+
if (vType == null)
201200
continue;
202-
final Instant sample_time = org.phoebus.core.vtypes.VTypeHelper.getTimestamp(values[i]);
203-
if (time == null || sample_time.compareTo(time) < 0)
201+
final Instant sample_time = org.phoebus.core.vtypes.VTypeHelper.getTimestamp(vType);
202+
if (time == null || sample_time.compareTo(time) < 0)
204203
time = sample_time;
205204
}
206205
if (time == null)

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/ui/AddPVDialog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ private Node createContent(final Model model, final int count)
206206
Tooltip displayNameTextFieldTooltip = new Tooltip(Messages.TraceDisplayNameTT);
207207
displayNameTextField.setTooltip(displayNameTextFieldTooltip);
208208
gridPane.add(displayNameTextField, 1, row, 2, 1);
209-
nameAndDisplayNames.add(new Pair(name, displayNameTextField));
209+
nameAndDisplayNames.add(new Pair<>(name, displayNameTextField));
210210
}
211211
else {
212-
nameAndDisplayNames.add(new Pair(name, name));
212+
nameAndDisplayNames.add(new Pair<>(name, name));
213213
}
214214

215215
if (! formula)

0 commit comments

Comments
 (0)