jinmeiliao commented on a change in pull request #6495:
URL: https://github.com/apache/geode/pull/6495#discussion_r636257206
##########
File path:
geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/Configuration.java
##########
@@ -183,20 +185,48 @@ public void fromData(DataInput in) throws IOException,
ClassNotFoundException {
propertiesFileName = DataSerializer.readString(in);
gemfireProperties = DataSerializer.readProperties(in);
HashSet<String> jarNames = DataSerializer.readHashSet(in);
- if (jarNames != null) {
- // we are reading pre 1.12 data. So add each jar name to deployments
- jarNames.stream()
- .map(x -> new Deployment(x, null, null))
- .forEach(deployment ->
deployments.put(deployment.getDeploymentName(), deployment));
- } else {
+ try {
// version of the data we are reading (1.12 or later)
final Version version =
Versioning.getVersion(VersioningIO.readOrdinal(in));
if (version.isNotOlderThan(KnownVersion.GEODE_1_12_0)) {
deployments.putAll(DataSerializer.readHashMap(in));
}
+ } catch (EOFException ex) {
Review comment:
When the xxData_pre_XX is not triggered, the existence of jarNames
should be enough to determine whether we are reading a pre1.12 data or not. Do
we have to use a try/catch block here?
--
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]