Skip to content

Commit

Permalink
merge nimak/refactor-adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
nimakarimipour committed Nov 5, 2024
2 parents 32194c8 + 36930c0 commit 8af557a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public FixSerializationConfig(boolean fieldInitInfoEnabled, @Nullable String out
this.fieldInitInfoEnabled = fieldInitInfoEnabled;
this.outputDirectory = outputDirectory;
serializer =
new Serializer(this, SerializationAdapter.getAdapter(SerializationAdapter.LATEST_VERSION));
new Serializer(
this, SerializationAdapter.getAdapterForVersion(SerializationAdapter.LATEST_VERSION));
}

/**
Expand Down Expand Up @@ -89,7 +90,7 @@ public FixSerializationConfig(String configFilePath, int serializationVersion) {
document, "/serialization/fieldInitInfo", "active", Boolean.class)
.orElse(false);
SerializationAdapter serializationAdapter =
SerializationAdapter.getAdapter(serializationVersion);
SerializationAdapter.getAdapterForVersion(serializationVersion);
serializer = new Serializer(this, serializationAdapter);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public interface SerializationAdapter {
* @param version The version of the adapter to return.
* @return The adapter corresponding to the given version.
*/
static SerializationAdapter getAdapter(int version) {
static SerializationAdapter getAdapterForVersion(int version) {
switch (version) {
case 1:
return new SerializationV1Adapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ ERROR_FILE_NAME, new SerializationV1Adapter().getErrorsOutputFileHeader())
*/
public void checkVersionSerialization(int version) {
SerializationTestHelper<ErrorDisplay> tester = new SerializationTestHelper<>(root);
SerializationAdapter adapter = SerializationAdapter.getAdapter(version);
SerializationAdapter adapter = SerializationAdapter.getAdapterForVersion(version);
tester
.setArgs(
Arrays.asList(
Expand Down

0 comments on commit 8af557a

Please sign in to comment.