Skip to content

Commit 46e2f31

Browse files
ctruedenimagejan
authored andcommitted
Use the diamond syntax
Thanks, Java 7!
1 parent ddad54e commit 46e2f31

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/net/imagej/table/AbstractTable.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public AbstractTable() {
6060
public AbstractTable(final int colCount, final int rowCount) {
6161
super();
6262
checkRowCount(rowCount);
63-
rowHeaders = new SizableArrayList<String>();
63+
rowHeaders = new SizableArrayList<>();
6464
this.rowCount = rowCount;
6565
setColumnCount(colCount);
6666
}
@@ -96,7 +96,7 @@ public C appendColumn(final String header) {
9696

9797
@Override
9898
public ArrayList<C> appendColumns(final int count) {
99-
final ArrayList<C> result = new ArrayList<C>(count);
99+
final ArrayList<C> result = new ArrayList<>(count);
100100
for (int c = 0; c < count; c++) {
101101
result.add(appendColumn());
102102
}
@@ -105,7 +105,7 @@ public ArrayList<C> appendColumns(final int count) {
105105

106106
@Override
107107
public ArrayList<C> appendColumns(final String... headers) {
108-
final ArrayList<C> result = new ArrayList<C>(headers.length);
108+
final ArrayList<C> result = new ArrayList<>(headers.length);
109109
for (final String header : headers) {
110110
result.add(appendColumn(header));
111111
}
@@ -140,7 +140,7 @@ public ArrayList<C> insertColumns(final int col, final int count) {
140140
}
141141

142142
// insert new blank columns
143-
final ArrayList<C> result = new ArrayList<C>(count);
143+
final ArrayList<C> result = new ArrayList<>(count);
144144
for (int c = 0; c < count; c++) {
145145
final C column = createColumn(null);
146146
result.add(column);
@@ -177,7 +177,7 @@ public ArrayList<C> removeColumns(final int col, final int count) {
177177
checkCol(col, count);
178178

179179
// save to-be-removed columns
180-
final ArrayList<C> result = new ArrayList<C>(count);
180+
final ArrayList<C> result = new ArrayList<>(count);
181181
for (int c = 0; c < count; c++) {
182182
result.add(get(col + c));
183183
}
@@ -197,7 +197,7 @@ public ArrayList<C> removeColumns(final int col, final int count) {
197197

198198
@Override
199199
public ArrayList<C> removeColumns(final String... headers) {
200-
final ArrayList<C> result = new ArrayList<C>(headers.length);
200+
final ArrayList<C> result = new ArrayList<>(headers.length);
201201
for (final String header : headers) {
202202
result.add(removeColumn(header));
203203
}

src/main/java/net/imagej/table/DefaultResultsTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public ImgPlus<DoubleType> img() {
7474
final AxisType[] axes = { Axes.X, Axes.Y };
7575
final String name = "Results";
7676
final ImgPlus<DoubleType> imgPlus =
77-
new ImgPlus<DoubleType>(img, name, axes);
77+
new ImgPlus<>(img, name, axes);
7878
// TODO: Once ImgPlus has a place for row & column labels, add those too.
7979
return imgPlus;
8080
}

0 commit comments

Comments
 (0)