File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
main/java/com/cloudinary/utils Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ public static String mergeToSingleUnderscore(String s) {
277277 */
278278 public static boolean isVariable (String s ) {
279279 if (s == null ||
280- s .length () < 3 ||
280+ s .length () < 2 ||
281281 !s .startsWith ("$" ) ||
282282 !Character .isLetter (s .charAt (1 ))) {
283283 return false ;
Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ public void testIsVariable(){
7676 assertTrue (StringUtils .isVariable ("$ab" ));
7777 assertTrue (StringUtils .isVariable ("$asdasda" ));
7878 assertTrue (StringUtils .isVariable ("$a34asd12e" ));
79+ assertTrue (StringUtils .isVariable ("$a" ));
7980
80- assertFalse (StringUtils .isVariable ("$a" ));
8181 assertFalse (StringUtils .isVariable ("sda" ));
8282 assertFalse (StringUtils .isVariable (" " ));
8383 assertFalse (StringUtils .isVariable ("... . /" ));
@@ -159,4 +159,4 @@ public void testRemoveStartingChars(){
159159 assertEquals ("bcde" , StringUtils .removeStartingChars ("aaaaaabcde" , 'a' ));
160160 assertEquals ("bcdeaa" , StringUtils .removeStartingChars ("aaaaaabcdeaa" , 'a' ));
161161 }
162- }
162+ }
You can’t perform that action at this time.
0 commit comments