-
-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes major code smells in GenericUtils.java (#372)
* fixes major code smells in GenericUtils.java * fixes major code smell * making classes GenericUtils and JSONSerializationUtils final
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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>"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} | ||
|