This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch file-lock in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
commit 54802f04cfe39f96e33d4c056e104f83b2f1af33 Author: Michael Osipov <[email protected]> AuthorDate: Sun Dec 12 20:33:15 2021 +0100 Add TODOs above log message consistency I would turn them into comments until the same approach is applied to all lock impls until it is harmonized which can be done in a separate PR. --- .../java/org/eclipse/aether/named/support/FileLockNamedLock.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/support/FileLockNamedLock.java b/maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/support/FileLockNamedLock.java index eac049f..f519af2 100644 --- a/maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/support/FileLockNamedLock.java +++ b/maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/support/FileLockNamedLock.java @@ -111,6 +111,7 @@ public final class FileLockNamedLock { if ( obtainedLock.isShared() ) { + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} lock (shared={})", name(), true ); steps.push( Boolean.TRUE ); return true; @@ -121,6 +122,7 @@ public final class FileLockNamedLock boolean weOwnExclusive = steps.contains( Boolean.FALSE ); if ( weOwnExclusive ) { + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} lock (shared={})", name(), true ); steps.push( Boolean.TRUE ); return true; @@ -133,6 +135,7 @@ public final class FileLockNamedLock } } + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} no obtained lock: obtain shared file lock", name() ); FileLock fileLock = obtainFileLock( true ); if ( fileLock != null ) @@ -166,6 +169,7 @@ public final class FileLockNamedLock boolean weOwnShared = steps.contains( Boolean.TRUE ); if ( weOwnShared ) { + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} steps not empty, has not exclusive lock: lock-upgrade not supported", name() ); @@ -183,6 +187,7 @@ public final class FileLockNamedLock boolean weOwnExclusive = steps.contains( Boolean.FALSE ); if ( weOwnExclusive ) { + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} lock (shared={})", name(), false ); steps.push( Boolean.FALSE ); return true; @@ -195,6 +200,7 @@ public final class FileLockNamedLock } } + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} no obtained lock: obtain exclusive file lock", name() ); FileLock fileLock = obtainFileLock( false ); if ( fileLock != null ) @@ -224,6 +230,7 @@ public final class FileLockNamedLock throw new IllegalStateException( "Wrong API usage: unlock without lock" ); } Boolean shared = steps.pop(); + // TODO No counterpart in other lock impls, drop or make consistent? logger.trace( "{} unlock (shared = {})", name(), shared ); if ( steps.isEmpty() && !anyOtherThreadHasSteps() ) { @@ -276,4 +283,4 @@ public final class FileLockNamedLock } return result; } -} \ No newline at end of file +}
