Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2021-08-24 08:31:19 +0000
committerEike Stepper2021-08-24 08:31:19 +0000
commit51a4f42f38ec76c59e770ed5ec01eec58c77476e (patch)
tree43aeb204fcf6d95f024a5d76dd665e1ec420df92
parent6b26e3e7937f803ea959a5e72e88e657d6f591c5 (diff)
downloadcdo-51a4f42f38ec76c59e770ed5ec01eec58c77476e.tar.gz
cdo-51a4f42f38ec76c59e770ed5ec01eec58c77476e.tar.xz
cdo-51a4f42f38ec76c59e770ed5ec01eec58c77476e.zip
[575586] CDO protocol version constant must not be inlined
https://bugs.eclipse.org/bugs/show_bug.cgi?id=575586
-rw-r--r--plugins/org.eclipse.emf.cdo.common/.settings/.api_filters7
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolVersion.java53
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java1
5 files changed, 64 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters
index 2c80be8817..1affecc826 100644
--- a/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters
@@ -343,6 +343,13 @@
<message_argument value="38"/>
</message_arguments>
</filter>
+ <filter id="389242988">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants"/>
+ <message_argument value="PROTOCOL_VERSION"/>
+ <message_argument value="38"/>
+ </message_arguments>
+ </filter>
</resource>
<resource path="src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java" type="org.eclipse.emf.cdo.common.revision.CDORevisionData">
<filter id="1209008130">
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
index bf42a51c11..f025b289dd 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
@@ -30,35 +30,8 @@ public interface CDOProtocolConstants
/**
* @since 4.2
- * @noreference This field is not intended to be referenced by clients.
- */
- public static final int PROTOCOL_VERSION = 39; // CDOLockOwner.isDurableView becomes derived
-
- // public static final int PROTOCOL_VERSION = 38; // CDOBranchTag support
- // public static final int PROTOCOL_VERSION = 37; // SIGNAL_ACKNOWLEDGE_COMPRESSED_STRINGS
- // public static final int PROTOCOL_VERSION = 36; // CDOID.NIL
- // public static final int PROTOCOL_VERSION = 35; // DiffieHellman.Server.Challenge.getSecretAlgorithmKeyLen()
- // public static final int PROTOCOL_VERSION = 34; // CDOSessionProtocol.loadMergeData2()
- // public static final int PROTOCOL_VERSION = 33; // CDOCommitInfo.getMergeSource()
- // public static final int PROTOCOL_VERSION = 32; // ROLLBACK_REASON_UNIT_INTEGRITY
- // public static final int PROTOCOL_VERSION = 31; // CDOCommonRepository.isSupportingUnits()
- // public static final int PROTOCOL_VERSION = 30; // UnitOpcode
- // public static final int PROTOCOL_VERSION = 29; // SIGNAL_UNIT
- // public static final int PROTOCOL_VERSION = 28; // SIGNAL_RESET_TRANSACTION
- // public static final int PROTOCOL_VERSION = 27; // SIGNAL_OPENED_SESSION
- // public static final int PROTOCOL_VERSION = 26; // Add prefetch depth in LockStateRequest/Indication
- // public static final int PROTOCOL_VERSION = 25; // OpenSessionResponse.repositoryAuthenticating
- // public static final int PROTOCOL_VERSION = 24; // SIGNAL_LOAD_OBJECT_LIFETIME
- // public static final int PROTOCOL_VERSION = 23; // Fix branch renaming
- // public static final int PROTOCOL_VERSION = 22; // Prefetch returns RevisionInfo instead of CDORevision to have
- // PointerCDORevision
- // public static final int PROTOCOL_VERSION = 21; // Update how CDOChangeSetData's detachedObject is encoded, see
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=449171
- // public static final int PROTOCOL_VERSION = 20; // Have OMMonitor optional in
- // RequestWithMonitoring/IndicationWithMonitoring
- // public static final int PROTOCOL_VERSION = 19; // Branch renaming
- // public static final int PROTOCOL_VERSION = 18; // Password change protocol
- // public static final int PROTOCOL_VERSION = 17; // Last update for make query fail in sequence
+ */
+ public static final int PROTOCOL_VERSION = CDOProtocolVersion.getValue();
/**
* @since 4.6
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolVersion.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolVersion.java
new file mode 100644
index 0000000000..2be9273f65
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolVersion.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2021 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.protocol;
+
+/**
+ * @author Eike Stepper
+ */
+class CDOProtocolVersion
+{
+ private static final int VALUE;
+
+ static
+ {
+ VALUE = 40; // Prevent protocol version constant inlining
+
+ // VALUE = 39; // CDOLockOwner.isDurableView becomes derived
+ // VALUE = 38; // CDOBranchTag support
+ // VALUE = 37; // SIGNAL_ACKNOWLEDGE_COMPRESSED_STRINGS
+ // VALUE = 36; // CDOID.NIL
+ // VALUE = 35; // DiffieHellman.Server.Challenge.getSecretAlgorithmKeyLen()
+ // VALUE = 34; // CDOSessionProtocol.loadMergeData2()
+ // VALUE = 33; // CDOCommitInfo.getMergeSource()
+ // VALUE = 32; // ROLLBACK_REASON_UNIT_INTEGRITY
+ // VALUE = 31; // CDOCommonRepository.isSupportingUnits()
+ // VALUE = 30; // UnitOpcode
+ // VALUE = 29; // SIGNAL_UNIT
+ // VALUE = 28; // SIGNAL_RESET_TRANSACTION
+ // VALUE = 27; // SIGNAL_OPENED_SESSION
+ // VALUE = 26; // Add prefetch depth in LockStateRequest/Indication
+ // VALUE = 25; // OpenSessionResponse.repositoryAuthenticating
+ // VALUE = 24; // SIGNAL_LOAD_OBJECT_LIFETIME
+ // VALUE = 23; // Fix branch renaming
+ // VALUE = 22; // Prefetch returns RevisionInfo instead of CDORevision to have PointerCDORevision
+ // VALUE = 21; // Update how CDOChangeSetData's detachedObject is encoded, see bug 449171
+ // VALUE = 20; // Have OMMonitor optional in RequestWithMonitoring/IndicationWithMonitoring
+ // VALUE = 19; // Branch renaming
+ // VALUE = 18; // Password change protocol
+ // VALUE = 17; // Last update for make query fail in sequence
+ }
+
+ static int getValue()
+ {
+ return VALUE;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
index 3c7626a4ca..72e9620ae4 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
@@ -105,6 +105,7 @@ public class CDOClientProtocol extends AuthenticatingSignalProtocol<CDOSessionIm
@Override
public int getVersion()
{
+ // See org.eclipse.emf.cdo.common.protocol.CDOProtocolVersion.
return PROTOCOL_VERSION;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
index a09ed6a210..34cab72b27 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
@@ -71,6 +71,7 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession> implement
@Override
public int getVersion()
{
+ // See org.eclipse.emf.cdo.common.protocol.CDOProtocolVersion.
return PROTOCOL_VERSION;
}

Back to the top