Skip to content

Commit 2435fd1

Browse files
committed
Fix deprecation warnings in CSV lib.
1 parent 6b14dfa commit 2435fd1

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

src/main/java/fiji/plugin/trackmate/detection/CSVImporter.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* it under the terms of the GNU General Public License as
99
* published by the Free Software Foundation, either version 3 of the
1010
* License, or (at your option) any later version.
11-
*
11+
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/gpl-3.0.html>.
@@ -72,7 +72,7 @@ public CSVImporter( final String filePath,
7272
final double radius,
7373
final String xColumnName, final String yColumnName, final String zColumnName, final String frameColumnName,
7474
final String qualityColumn, final String nameColumn, final String idColumn,
75-
final double xOrigin, final double yOrigin, final double zOrigin)
75+
final double xOrigin, final double yOrigin, final double zOrigin )
7676
{
7777
this.filePath = filePath;
7878
this.radius = radius;
@@ -116,10 +116,11 @@ public boolean process()
116116

117117
try
118118
{
119-
final CSVFormat csvFormat = CSVFormat
120-
.EXCEL
121-
.withHeader()
122-
.withCommentMarker( '#' );
119+
final CSVFormat csvFormat = CSVFormat.EXCEL
120+
.builder()
121+
.setHeader()
122+
.setCommentMarker( '#' )
123+
.get();
123124
records = csvFormat.parse( in );
124125
}
125126
catch ( final IOException e )
@@ -208,10 +209,10 @@ public boolean process()
208209
name = record.get( namecol );
209210

210211
final Spot spot;
211-
if (null != idcol)
212+
if ( null != idcol )
212213
{
213214
// Hijack spot IDs: we force ID to match ID provided.
214-
final int id = Integer.parseInt( record.get( idcol ) );
215+
final int id = Integer.parseInt( record.get( idcol ) );
215216
spot = new Spot( id );
216217
spot.putFeature( Spot.POSITION_X, x );
217218
spot.putFeature( Spot.POSITION_Y, y );
@@ -275,7 +276,7 @@ public static void main( final String[] args )
275276
filePath, 30,
276277
"x [nm]", "y [nm]", "z [nm]", "frame",
277278
"photons", null, null,
278-
0., 0., 0.);
279+
0., 0., 0. );
279280

280281
if ( !importer.checkInput() || !importer.process() )
281282
{

src/main/java/fiji/plugin/trackmate/detection/CSVImporterConfigPanel.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* it under the terms of the GNU General Public License as
99
* published by the Free Software Foundation, either version 3 of the
1010
* License, or (at your option) any later version.
11-
*
11+
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/gpl-3.0.html>.
@@ -499,8 +499,10 @@ private void readHeaders()
499499
try
500500
{
501501
final CSVFormat csvFormat = CSVFormat.EXCEL
502-
.withHeader()
503-
.withCommentMarker( '#' );
502+
.builder()
503+
.setHeader()
504+
.setCommentMarker( '#' )
505+
.get();
504506
records = csvFormat.parse( in );
505507
}
506508
catch ( final Exception e )

src/main/java/fiji/plugin/trackmate/importer/csv/ImporterController.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* it under the terms of the GNU General Public License as
99
* published by the Free Software Foundation, either version 3 of the
1010
* License, or (at your option) any later version.
11-
*
11+
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/gpl-3.0.html>.
@@ -336,8 +336,10 @@ private boolean readHeaders()
336336
try
337337
{
338338
final CSVFormat csvFormat = CSVFormat.EXCEL
339-
.withHeader()
340-
.withCommentMarker( '#' );
339+
.builder()
340+
.setHeader()
341+
.setCommentMarker( '#' )
342+
.get();
341343
records = csvFormat.parse( in );
342344
}
343345
catch ( final Exception e )

0 commit comments

Comments
 (0)