Skip to content

Commit

Permalink
Merge branch 'master' into fb_jpms
Browse files Browse the repository at this point in the history
  • Loading branch information
struberg authored Dec 7, 2024
2 parents 0e916b8 + 1ffe0a0 commit 499a0a9
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/lang3/SystemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>
* The field will return {@code false} if {@code OS_NAME} is {@code null}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()}.
* </p>
* <p>
* 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.
* </p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
}

Expand All @@ -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);
}

}
Expand All @@ -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);
}

}
Expand All @@ -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<TemporalUnit> getUnits() {
return null;
return duration.getUnits();
}

@Override
public Temporal subtractFrom(final Temporal temporal) {
return null;
return duration.subtractFrom(temporal);
}

@Override
Expand Down

0 comments on commit 499a0a9

Please sign in to comment.