Bill commented on a change in pull request #5273:
URL: https://github.com/apache/geode/pull/5273#discussion_r446354173



##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
##########
@@ -549,7 +550,7 @@ public void setVersionObjectForTest(Version v) {
   }
 
   @Override
-  public Version getVersionObject() {
+  public VersionOrdinal getVersionObject() {

Review comment:
       Since `IDM` isa `MemberIdentifier` this (overridden) method has to 
return a `VersionOrdinal` not a `Version` since, in general, a 
`MemberIdentifier` can be for a member that is running an unknown software 
version.
   
   I'm renaming `MemberIdentifier.getVersionObject()` => 
`MemberIdentifier.getVersionOrdinalObject()`. 
   To summarize the state of `IDM` version methods this is what it looks like 
now:
   
   ```java
     // inherited from MemberIdentifier. It has a new name to make the return 
type explicit
     @Override
     public VersionOrdinal getVersionOrdinalObject() {…}
   
     /**
      * If this member runs a version known in this JVM then return that 
Version.
      * If this member does not run a known version then return Version.CURRENT.
      *
      * In various serialization scenarios we want the well-known version for 
this
      * member, or, if it doesn't have a well-known version, we want the current
      * (in this JVM) software version. Rather than have that logic spread 
around in
      * the serialization code, it is centralized here.
      */
     public Version getVersionObject() {…}
   ```
   
   We still have lots of ways to get a `Version` from a `short` version 
ordinal. `Version` class has these static methods:
   
   * `fromOrdinal(short ordinal) throws 
UnsupportedSerializationVersionException`
   * `fromOrdinalOrCurrent(short ordinal)`
   * `fromOrdinalNoThrow(short ordinal, boolean returnNullForCurrent)`
   
   There is some unfortunate duplication in those methods. Consolidating that 
logic is beyond the scope of this PR.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to