Datasets:
Download raw/java/cwe_1025_1_upgrade.java from amazon/AutoSUIT: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/datasets/amazon/AutoSUIT/resolve/main/raw/java/cwe_1025_1_upgrade.java
- Command line
-
hf download hf://datasets/amazon/AutoSUIT/raw/java/cwe_1025_1_upgrade.java
-
curl -L -o cwe_1025_1_upgrade.java https://huggingface.co/datasets/amazon/AutoSUIT/resolve/main/raw/java/cwe_1025_1_upgrade.java
557 Bytes
| class StringComparator { | |
| void compareStrings(String str1, String str2) { | |
| // Check if both strings are null | |
| if (str1 == null && str2 == null) { | |
| System.out.println("str1 equals str2"); | |
| return; | |
| } | |
| // Handle case where one string is null | |
| if (str1 == null || str2 == null) { | |
| return; // Exit method as they can't be equal | |
| } | |
| // Perform case-sensitive comparison | |
| if (str1.equals(str2)) { | |
| System.out.println("str1 equals str2"); | |
| } | |
| } | |
| } | |