Skip to content

Commit

Permalink
fixes major code smells in GenericUtils.java (#372)
Browse files Browse the repository at this point in the history
* fixes major code smells in GenericUtils.java

* fixes major code smell

* making classes GenericUtils and JSONSerializationUtils final
  • Loading branch information
hks1 authored Jul 15, 2022
1 parent 65656b1 commit 93598e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
*
* @author KSASAN [email protected]
*/
public class GenericUtils {
public final class GenericUtils {

public static final String LOCALHOST = "127.0.0.1";

private GenericUtils() {}

/**
* @deprecated
* @param payload
* @return
*/
@Deprecated
public static String wrapPayloadInGenericVulnerableAppTemplate(String payload) {
String generalPayload =
"<html><title>Security Testing</title><body><h1>Vulnerable Application </h1> %s </body></html>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
*
* @author KSASAN [email protected]
*/
public class JSONSerializationUtils {
public final class JSONSerializationUtils {

private static final ObjectMapper MAPPER = new ObjectMapper();

private JSONSerializationUtils() {}

public static <T> String serialize(T object) throws JsonProcessingException {
return MAPPER.writeValueAsString(object);
}
Expand Down

0 comments on commit 93598e6

Please sign in to comment.