diff --git a/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java b/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java index e2f01e25f8..21731cb716 100644 --- a/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java +++ b/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java @@ -58,7 +58,7 @@ public abstract class AbstractVersionDetails implements VersionDetails { + "[-.]?(\\d{0,2}[a-z]?|\\d{6}\\.\\d{4})|\\d{8}(?:\\.?\\d{6})?)$"); /** - * The current version. Guarded by {@link #currentVersionLock}. + * Current version of the dependency artifact. * * @since 1.0-beta-1 */ @@ -66,14 +66,6 @@ public abstract class AbstractVersionDetails implements VersionDetails { protected boolean verboseDetail = true; - /** - * Not sure if we need to be thread safe, but there's no harm being careful, after all we could be invoked from an - * IDE. - * - * @since 1.0-beta-1 - */ - private final Object currentVersionLock = new Object(); - protected AbstractVersionDetails() {} @Override @@ -121,16 +113,12 @@ public final boolean isCurrentVersionDefined() { @Override public final ArtifactVersion getCurrentVersion() { - synchronized (currentVersionLock) { - return currentVersion; - } + return currentVersion; } @Override public final void setCurrentVersion(ArtifactVersion currentVersion) { - synchronized (currentVersionLock) { - this.currentVersion = currentVersion; - } + this.currentVersion = currentVersion; } @Override