Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

build:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.1.0
secrets:
DV_ACCESS_TOKEN: ${{ startsWith(github.ref_name, 'release/') && '' || secrets.DEVELOCITY_ACCESS_KEY }}
with:
Expand All @@ -44,7 +44,7 @@ jobs:
deploy-snapshot:
needs: build
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/12.1.0
# Secrets for deployments
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
Expand All @@ -57,7 +57,7 @@ jobs:
deploy-release:
needs: build
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/12.1.0
# Secrets for deployments
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand All @@ -78,7 +78,7 @@ jobs:
needs: [ deploy-snapshot, deploy-release ]
if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }}
name: "verify-reproducibility (${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }})"
uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@rel/12.1.0
with:
nexus-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || 'https://repository.apache.org/content/groups/snapshots' }}
# Encode the `runs-on` input as JSON array
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ permissions: read-all
jobs:

analyze:
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/12.1.0
with:
java-version: |
8
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

deploy-site-stg:
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand All @@ -51,7 +51,7 @@ jobs:

deploy-site-pro:
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x-site-pro'
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
deploy-site-rel:
needs: export-version
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/merge-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

build:
if: github.repository == 'apache/logging-log4j2' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.1.0
secrets:
DV_ACCESS_TOKEN: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
with:
Expand All @@ -42,7 +42,7 @@ jobs:

merge-dependabot:
needs: build
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/12.0.0
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/12.1.0
with:
java-version: 17
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ else if (dateFormatStr.equalsIgnoreCase(AbsoluteTimeDateFormat.DATE_AND_TIME_DAT
// formattingInfo.dump();
currentLiteral.setLength(0);
break;
/*
* case 'u': if(i < patternLength) { char cNext = pattern.charAt(i); if(cNext >= '0' && cNext <= '9') { pc = new
* UserFieldPatternConverter(formattingInfo, cNext - '0'); LogLog.debug("USER converter ["+cNext+"].");
* formattingInfo.dump(); currentLiteral.setLength(0); i++; } else LogLog.error("Unexpected char"
* +cNext+" at position "+i); } break;
*/
/*
* case 'u': if(i < patternLength) { char cNext = pattern.charAt(i); if(cNext >= '0' && cNext <= '9') { pc = new
* UserFieldPatternConverter(formattingInfo, cNext - '0'); LogLog.debug("USER converter ["+cNext+"].");
* formattingInfo.dump(); currentLiteral.setLength(0); i++; } else LogLog.error("Unexpected char"
* +cNext+" at position "+i); } break;
*/
case 'x':
pc = new BasicPatternConverter(formattingInfo, NDC_CONVERTER);
// LogLog.debug("NDC converter.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ AsyncLoggerConfigDelegate getAsyncLoggerConfigDelegate() {
}

@Override
@SuppressWarnings("BoxedPrimitiveEquality")
protected void log(final LogEvent event, final LoggerConfigPredicate predicate) {
// See LOG4J2-2301
if (predicate == LoggerConfigPredicate.ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ private void processPlugin(Element element) {
ExecutableElement executableChild = (ExecutableElement) child;
if (executableChild.getModifiers().contains(Modifier.PUBLIC)) {
switch (executableChild.getSimpleName().toString()) {
// 1. All public constructors.
// 1. All public constructors.
case "<init>":
addMethod(typeElement, executableChild);
break;
// 2. Static `newInstance` method used in, e.g. `PatternConverter` classes.
// 2. Static `newInstance` method used in, e.g. `PatternConverter` classes.
case "newInstance":
if (executableChild.getModifiers().contains(Modifier.STATIC)) {
addMethod(typeElement, executableChild);
}
break;
// 3. Other factory methods are annotated, so we don't deal with them here.
// 3. Other factory methods are annotated, so we don't deal with them here.
default:
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,16 +384,16 @@ public void run() {
break;
}
switch (result.status) {
// These results cause changes in the filter
// We call the listeners
// These results cause changes in the filter
// We call the listeners
case SUCCESS:
case NOT_FOUND:
case EMPTY:
for (FilterConfigUpdateListener listener : listeners) {
listener.onEvent();
}
break;
// These results do no cause changes in the filter
// These results do no cause changes in the filter
case ERROR:
case NOT_MODIFIED:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private ThreadContextMap createThreadContextMap() {
case WEB_APP_CONTEXT_MAP:
case WEB_APP_CLASS_NAME:
return new DefaultThreadContextMap();
// Old FQCN of the garbage-free context map
// Old FQCN of the garbage-free context map
case "org.apache.logging.log4j.spi.GarbageFreeSortedArrayThreadContextMap":
case GARBAGE_FREE_CONTEXT_MAP:
case GARBAGE_FREE_CLASS_NAME:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void stop(final BundleContext context) throws Exception {
@Override
public void bundleChanged(final BundleEvent event) {
switch (event.getType()) {
// FIXME: STARTING instead of STARTED?
// FIXME: STARTING instead of STARTED?
case BundleEvent.STARTED:
scanBundleForPlugins(event.getBundle());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void formatTo(final StringBuilder buffer, final Instant instant) {

switch (formatters.length) {

// If found an empty pattern, return an empty formatter
// If found an empty pattern, return an empty formatter
case 0:
return new AbstractFormatter(pattern, locale, timeZone, ChronoUnit.FOREVER) {
@Override
Expand All @@ -175,11 +175,11 @@ public void formatTo(final StringBuilder buffer, final Instant instant) {
}
};

// If extracted a single formatter, return it as is
// If extracted a single formatter, return it as is
case 1:
return formatters[0];

// Profiling shows that unrolling the generic loop boosts performance
// Profiling shows that unrolling the generic loop boosts performance
case 2:
final InstantPatternFormatter first = formatters[0];
final InstantPatternFormatter second = formatters[1];
Expand All @@ -192,7 +192,7 @@ public void formatTo(StringBuilder buffer, Instant instant) {
}
};

// Combine all extracted formatters into one
// Combine all extracted formatters into one
default:
final ChronoUnit precision = Stream.of(formatters)
.map(InstantFormatter::getPrecision)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,16 @@ public InstantPatternFormatter build() {
// Wrap the formatter with caching, if necessary
switch (formatter.getPrecision()) {

// It is not worth caching when a precision equal to or higher than microsecond is requested
// It is not worth caching when a precision equal to or higher than microsecond is requested
case NANOS:
case MICROS:
return formatter;

// Millisecond precision cache
// Millisecond precision cache
case MILLIS:
return InstantPatternThreadLocalCachedFormatter.ofMilliPrecision(formatter);

// Cache everything else with second precision
// Cache everything else with second precision
default:
return InstantPatternThreadLocalCachedFormatter.ofSecondPrecision(formatter);
}
Expand Down
13 changes: 0 additions & 13 deletions log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -991,19 +991,6 @@
</executions>
</plugin>

<!-- REMOVE THIS `m-c-p` OVERRIDE with the next `logging-parent` update!
This is a temporary fix for the Error Prone `2.36.0` issue:
https://github.com/apache/logging-parent/commit/c98462c444eda72d5fe8e7a0b8112949142b7a0a -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs combine.children="append">
<arg>--should-stop=ifError=FLOW</arg>
</compilerArgs>
</configuration>
</plugin>

<!--
~ Some external logging bridges can interfere with our tests, giving false negatives.
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public void logMessage(
// ERROR and FATAL.
private java.util.logging.Level convertLevel(final Level level) {
switch (level.getStandardLevel()) {
// Test in logical order of likely frequency of use
// Must be kept in sync with #getLevel()
// Test in logical order of likely frequency of use
// Must be kept in sync with #getLevel()
case ALL:
return java.util.logging.Level.ALL;
case TRACE:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.apache.logging</groupId>
<artifactId>logging-parent</artifactId>
<version>12.0.0</version>
<version>12.1.0</version>
<relativePath />
</parent>

Expand Down