Skip to content

Commit 10d64e8

Browse files
ppkarwaszCopilot
andauthored
Adapt the build to logging-parent conventions (#467)
* Adapt build to `logging-parent` conventions Most build configuration is now inherited from `logging-parent` and the `apache` parent POM. ZooKeeper is bumped to satisfy `requireUpperBoundDeps`. Assisted-By: Claude Fable 5 <noreply@anthropic.com> * Expand star imports The formatting rules inherited from `logging-parent` forbid wildcard imports. Assisted-By: Claude Fable 5 <noreply@anthropic.com> * Fix or suppress Error Prone warnings The `GuardedBy` suppressions are intentional: the channel queue locks must not be held on blocking operations and the unguarded reads are benign. The `jvm.config` flags let Error Prone access javac internals on JDK 16+. Assisted-By: Claude Fable 5 <noreply@anthropic.com> * Disable BND baseline for never-released artifacts These artifacts have no published version to compare against. Assisted-By: Claude Fable 5 <noreply@anthropic.com> * Configure RAT exclusions via `.rat-excludes` The file is shared with the ASF Trusted Releases platform checks, which match patterns against the archive root: hence the `**/` prefix. Files that support comments get an SPDX header instead of an exclusion. Assisted-By: Claude Fable 5 <noreply@anthropic.com> * fix: add comment to disabled test Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 9acf154 commit 10d64e8

37 files changed

Lines changed: 220 additions & 522 deletions

File tree

.mvn/jvm.config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
2+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
3+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
4+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
5+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
6+
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
7+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
8+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
9+
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
10+
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
11+
-Dfile.encoding=UTF-8

.rat-excludes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.rat-excludes
2+
**/src/test/resources/test_command.ps1

flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestCheckpointRebuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
*/
1717
package org.apache.flume.channel.file;
1818

19-
import static org.apache.flume.channel.file.TestUtils.*;
19+
import static org.apache.flume.channel.file.TestUtils.compareInputAndOut;
20+
import static org.apache.flume.channel.file.TestUtils.consumeChannel;
21+
import static org.apache.flume.channel.file.TestUtils.fillChannel;
22+
import static org.apache.flume.channel.file.TestUtils.getAllLogs;
2023

2124
import com.google.common.collect.Maps;
2225
import java.io.File;

flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestFileChannelRestart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import static org.apache.flume.channel.file.TestUtils.putWithoutCommit;
2626
import static org.apache.flume.channel.file.TestUtils.takeEvents;
2727
import static org.apache.flume.channel.file.TestUtils.takeWithoutCommit;
28-
import static org.fest.reflect.core.Reflection.*;
28+
import static org.fest.reflect.core.Reflection.field;
2929

3030
import com.google.common.collect.Lists;
3131
import com.google.common.collect.Maps;

flume-ng-channels/flume-spillable-memory-channel/src/main/java/org/apache/flume/channel/SpillableMemoryChannel.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ private void commitPutsToPrimary() {
535535
channelCounter.addToEventPutSuccessCount(putList.size());
536536
}
537537

538+
// `queueLock` must not be held on blocking operations,
539+
// and an approximate channel size is enough for the counter.
540+
@SuppressWarnings("GuardedBy")
538541
@Override
539542
protected void doRollback() {
540543
logger.debug("Rollback() of " + (takeCalled ? " Take Tx" : (putCalled ? " Put Tx" : "Empty Tx")));
@@ -729,6 +732,8 @@ public void configure(Context context) {
729732
super.configure(context);
730733
}
731734

735+
// the unguarded read of `memQueue` only detects whether the queue needs resizing
736+
@SuppressWarnings("GuardedBy")
732737
private void resizePrimaryQueue(int newMemoryCapacity) throws InterruptedException {
733738
if (memQueue != null && memoryCapacity == newMemoryCapacity) {
734739
return;
@@ -765,6 +770,8 @@ private void resizePrimaryQueue(int newMemoryCapacity) throws InterruptedExcepti
765770
}
766771
}
767772

773+
// an approximate channel size is enough for the counter
774+
@SuppressWarnings("GuardedBy")
768775
@Override
769776
public synchronized void start() {
770777
super.start();
@@ -779,6 +786,8 @@ public synchronized void start() {
779786
channelCounter.setChannelSize(totalCount);
780787
}
781788

789+
// an approximate channel size is enough for the counter
790+
@SuppressWarnings("GuardedBy")
782791
@Override
783792
public synchronized void stop() {
784793
if (getLifecycleState() == LifecycleState.STOP) {

flume-ng-configfilters/flume-ng-external-process-config-filter/src/test/resources/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: Apache-2.0
23

34
if [ $1 = "my_password_key" ]; then
45
echo "filtered";

flume-ng-configfilters/flume-ng-external-process-config-filter/src/test/resources/test_error.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: Apache-2.0
3+
24
echo "Error message from stderr" 1>&2
35
echo "Error message from stdout"
46

flume-ng-configuration/src/test/java/org/apache/flume/conf/TestAgentConfiguration.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
package org.apache.flume.conf;
1818

1919
import static org.apache.flume.conf.FlumeConfigurationError.ErrorOrWarning.ERROR;
20-
import static org.junit.Assert.*;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertFalse;
22+
import static org.junit.Assert.assertNotNull;
23+
import static org.junit.Assert.assertNull;
24+
import static org.junit.Assert.assertTrue;
2125

2226
import java.util.Arrays;
2327
import java.util.HashMap;

flume-ng-configuration/src/test/java/org/apache/flume/conf/TestFlumeConfiguration.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
package org.apache.flume.conf;
1818

1919
import static org.apache.flume.conf.FlumeConfigurationError.ErrorOrWarning.ERROR;
20-
import static org.apache.flume.conf.FlumeConfigurationErrorType.*;
20+
import static org.apache.flume.conf.FlumeConfigurationErrorType.AGENT_CONFIGURATION_INVALID;
21+
import static org.apache.flume.conf.FlumeConfigurationErrorType.AGENT_NAME_MISSING;
22+
import static org.apache.flume.conf.FlumeConfigurationErrorType.CONFIG_ERROR;
23+
import static org.apache.flume.conf.FlumeConfigurationErrorType.INVALID_PROPERTY;
24+
import static org.apache.flume.conf.FlumeConfigurationErrorType.PROPERTY_NAME_NULL;
25+
import static org.apache.flume.conf.FlumeConfigurationErrorType.PROPERTY_VALUE_NULL;
2126
import static org.junit.Assert.assertEquals;
2227

2328
import java.util.HashMap;

flume-ng-core/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@
190190
<plugin>
191191
<groupId>org.apache.maven.plugins</groupId>
192192
<artifactId>maven-antrun-plugin</artifactId>
193-
<version>${mvn-antrun-plugin.version}</version>
194193
<executions>
195194
<execution>
196195
<id>generate-version</id>
@@ -213,7 +212,6 @@
213212
<plugin>
214213
<groupId>org.codehaus.mojo</groupId>
215214
<artifactId>build-helper-maven-plugin</artifactId>
216-
<version>${mvn-build-helper-plugin}</version>
217215
<executions>
218216
<execution>
219217
<id>add-source</id>
@@ -246,7 +244,6 @@
246244
<plugin>
247245
<groupId>org.apache.maven.plugins</groupId>
248246
<artifactId>maven-antrun-plugin</artifactId>
249-
<version>${mvn-antrun-plugin.version}</version>
250247
<executions>
251248
<execution>
252249
<id>generate-version</id>
@@ -269,7 +266,6 @@
269266
<plugin>
270267
<groupId>org.codehaus.mojo</groupId>
271268
<artifactId>build-helper-maven-plugin</artifactId>
272-
<version>${mvn-build-helper-plugin}</version>
273269
<executions>
274270
<execution>
275271
<id>add-source</id>

0 commit comments

Comments
 (0)