Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantExplicitChronoField/afterOffsetDateTimeConvert.java
Mikhail Pyltsin c3d30761af [java-inspections] IDEA-313911 Convert calls with ChronoField and ChronoUnit to more specific methods
GitOrigin-RevId: 22ec271f7c1be21a09852d8c0aca572857c204a6
2023-02-22 14:55:51 +00:00

20 lines
624 B
Java

// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
import java.time.OffsetDateTime;
import java.time.temporal.ChronoField;
class Main {
public static int test(OffsetDateTime offsetDateTime) {
return offsetDateTime.get<caret>Nano();
}
public static int test2(OffsetDateTime offsetDateTime) {
return offsetDateTime.get(ChronoField.INSTANT_SECONDS);
}
public static int test3(OffsetDateTime offsetDateTime) {
return offsetDateTime.getYear();
}
public static void test4(OffsetTime time) {
time.get(1, ChronoUnit.YEARS);
}
}