Skip to content

Commit cfe1ffa

Browse files
committed
Remove deprecated objects
1 parent 0e95afb commit cfe1ffa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/java/edu/wpi/grip/core/operations/composite/SaveImageOperation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import org.bytedeco.javacpp.BytePointer;
1414
import org.bytedeco.javacpp.IntPointer;
1515

16-
import java.text.SimpleDateFormat;
17-
import java.util.Date;
16+
import java.time.LocalDateTime;
17+
import java.time.format.DateTimeFormatter;
1818
import java.util.List;
1919
import java.util.concurrent.TimeUnit;
2020

@@ -51,8 +51,8 @@ public class SaveImageOperation implements Operation {
5151

5252
private final FileManager fileManager;
5353
private final BytePointer imagePointer = new BytePointer();
54-
private Stopwatch stopwatch = Stopwatch.createStarted();
55-
private SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd_HHmmss.SSS");
54+
private final Stopwatch stopwatch = Stopwatch.createStarted();
55+
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
5656

5757
public SaveImageOperation(InputSocket.Factory inputSocketFactory, OutputSocket.Factory outputSocketFactory, FileManager fileManager) {
5858
this.fileManager = fileManager;
@@ -104,6 +104,6 @@ public void perform() {
104104
}
105105
imagePointer.get(buffer, 0, bufferSize);
106106

107-
fileManager.saveImage(buffer, format.format(new Date()) + ".jpeg");
107+
fileManager.saveImage(buffer, LocalDateTime.now().format(formatter) + ".jpeg");
108108
}
109109
}

0 commit comments

Comments
 (0)