diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 491f2e5d720..47b00ea1d9e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 with: persist-credentials: false - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -57,7 +57,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # 3.27.6 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -68,7 +68,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # 3.27.6 # âšī¸ Command-line programs to run using the OS shell. # đ https://git.io/JvXDl @@ -82,4 +82,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # 3.27.6 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 227b52fe9da..e28963aee21 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 36a2dbe7291..da8aa4698dc 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -64,6 +64,6 @@ jobs: retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # 3.27.6 with: sarif_file: results.sarif diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java b/src/main/java/org/apache/commons/lang3/SystemUtils.java index 726f01adddd..652e49d3f78 100644 --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java @@ -1671,7 +1671,7 @@ public class SystemUtils { public static final boolean IS_OS_SUN_OS = getOsNameMatches("SunOS"); /** - * The constant {@code true} if this is a UNIX like system, as in any of AIX, HP-UX, Irix, Linux, MacOSX, Solaris or SUN OS. + * The constant {@code true} if this is a Unix like system, as in any of AIX, HP-UX, Irix, Linux, MacOSX, Solaris or SUN OS. * *
* The field will return {@code false} if {@code OS_NAME} is {@code null}. diff --git a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java index a76b3857e06..085a07ce1ac 100644 --- a/src/main/java/org/apache/commons/lang3/text/StrBuilder.java +++ b/src/main/java/org/apache/commons/lang3/text/StrBuilder.java @@ -1150,7 +1150,7 @@ public StrBuilder appendln(final StringBuilder str, final int startIndex, final * By default, the new line is the system default from {@link System#lineSeparator()}. *
*- * The new line string can be changed using {@link #setNewLineText(String)}. For example, you can use this to force the output to always use UNIX line + * The new line string can be changed using {@link #setNewLineText(String)}. For example, you can use this to force the output to always use Unix line * endings even when on Windows. *
* diff --git a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderReflectJreImplementationTest.java b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderReflectJreImplementationTest.java index 230470198bd..a8001d377de 100644 --- a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderReflectJreImplementationTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderReflectJreImplementationTest.java @@ -22,7 +22,21 @@ import java.time.Duration; import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.OffsetDateTime; +import java.time.OffsetTime; import java.time.Period; +import java.time.Year; +import java.time.YearMonth; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.chrono.HijrahDate; +import java.time.chrono.JapaneseDate; +import java.time.chrono.MinguoDate; +import java.time.chrono.ThaiBuddhistDate; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAmount; @@ -82,17 +96,33 @@ static class MyClass { private final MyTemporal temporal; private final MyTemporalAccessor temporalAccessor; private final MyTemporalAmount temporalAmount; + private final Object[] objects; - MyClass(final MyCharSequence charSequence, final MyTemporal temporal, final MyTemporalAccessor temporalAccessor, final MyTemporalAmount temporalAmount) { + MyClass(final MyCharSequence charSequence, final MyTemporal temporal, final MyTemporalAccessor temporalAccessor, + final MyTemporalAmount temporalAmount) { this.charSequence = charSequence; this.temporal = temporal; this.temporalAccessor = temporalAccessor; this.temporalAmount = temporalAmount; + final int value = Integer.parseInt(charSequence.toString()); + final LocalDate localDate = LocalDate.ofEpochDay(value); + final LocalTime localTime = LocalTime.of(value, value); + final LocalDateTime localDateTime = LocalDateTime.of(localDate, localTime); + final OffsetDateTime offsetDateTime = OffsetDateTime.of(localDateTime, ZoneOffset.UTC); + final ZoneOffset zoneOffset = ZoneOffset.ofHours(value); + this.objects = new Object[] { + // a Long + value, + // all concrete dates and times + localDate, HijrahDate.from(localDate), JapaneseDate.from(localDate), MinguoDate.from(localDate), ThaiBuddhistDate.from(localDate), + localDate, localTime, localDateTime, offsetDateTime, OffsetTime.of(localTime, zoneOffset), Year.of(value), YearMonth.of(value, value), + ZonedDateTime.of(localDateTime, zoneOffset), zoneOffset, ZoneId.of(zoneOffset.getId()) }; } @Override public String toString() { - return String.format("%s[%s - %s - %s - $s]", getClass().getSimpleName(), charSequence, temporal, temporalAccessor, temporalAmount); + return String.format("%s[%s, %s, %s, %s, %s]", getClass().getSimpleName(), charSequence, temporal, temporalAccessor, temporalAmount, + Arrays.toString(objects)); } } @@ -114,37 +144,37 @@ static class MyTemporal implements Temporal { @Override public long getLong(final TemporalField field) { - return 0; + return instant.get(field); } @Override public boolean isSupported(final TemporalField field) { - return false; + return instant.isSupported(field); } @Override public boolean isSupported(final TemporalUnit unit) { - return false; + return instant.isSupported(unit); } @Override public Temporal plus(final long amountToAdd, final TemporalUnit unit) { - return null; + return instant.plus(amountToAdd, unit); } @Override public String toString() { - return String.format("%s[%s - %s - %s]", getClass().getSimpleName(), string, instant, duration, period); + return String.format("%s[%s, %s, %s, %s]", getClass().getSimpleName(), string, instant, duration, period); } @Override public long until(final Temporal endExclusive, final TemporalUnit unit) { - return 0; + return instant.until(endExclusive, unit); } @Override public Temporal with(final TemporalField field, final long newValue) { - return null; + return instant.with(field, newValue); } } @@ -162,22 +192,21 @@ static class MyTemporalAccessor implements TemporalAccessor { this.instant = Instant.ofEpochMilli(value); this.duration = Duration.between(instant, instant.plusMillis(value)); this.period = Period.ofDays(value); - } @Override public long getLong(final TemporalField field) { - return 0; + return instant.get(field); } @Override public boolean isSupported(final TemporalField field) { - return false; + return instant.isSupported(field); } @Override public String toString() { - return String.format("%s[%s - %s - % - %s]", getClass().getSimpleName(), string, instant, duration, period); + return String.format("%s[%s, %s, %s, %s]", getClass().getSimpleName(), string, instant, duration, period); } } @@ -200,22 +229,22 @@ static class MyTemporalAmount implements TemporalAmount { @Override public Temporal addTo(final Temporal temporal) { - return null; + return duration.addTo(temporal); } @Override public long get(final TemporalUnit unit) { - return 0; + return duration.get(unit); } @Override public List