Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed deprecated methods from IOHelpers class #6481

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Fix #6081: Moved Java baseline from 8 (1.8) to 11
* Fix #6138: Removed unused `io:fabric8:kubernetes-model` artifact
* Fix #6156: Removed deprecated extension `io:fabric8:service-catalog`
* Fix #6158: Removed deprecated methods from `io.fabric8.kubernetes.client.utils.IOHelpers`

### 6.13.4 (2024-09-25)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/
package io.fabric8.kubernetes.client.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -28,8 +24,6 @@
import java.io.Writer;
import java.nio.charset.Charset;

/**
*/
public class IOHelpers {
private IOHelpers() {
throw new IllegalStateException("Utility class");
Expand Down Expand Up @@ -65,37 +59,4 @@ private static void copy(Reader reader, Writer writer) throws IOException {
}
}

/**
* @deprecated will be removed in future versions
*/
@Deprecated
public static boolean isJSONValid(String json) {
try {
ObjectMapper objectMapper = Serialization.jsonMapper();
objectMapper.readTree(json);
} catch (JsonProcessingException e) {
return false;
}
return true;
}

/**
* @deprecated will be removed in future versions
*/
@Deprecated
public static String convertYamlToJson(String yaml) {
return Serialization.asJson(Serialization.unmarshal(yaml, JsonNode.class));
}

/**
* @deprecated will be removed in future versions
*/
@Deprecated
public static String convertToJson(String jsonOrYaml) {
if (isJSONValid(jsonOrYaml)) {
return jsonOrYaml;
}
return convertYamlToJson(jsonOrYaml);
}

}
Loading