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) {
277
277
*/
278
278
public static boolean isVariable (String s ) {
279
279
if (s == null ||
280
- s .length () < 3 ||
280
+ s .length () < 2 ||
281
281
!s .startsWith ("$" ) ||
282
282
!Character .isLetter (s .charAt (1 ))) {
283
283
return false ;
Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ public void testIsVariable(){
76
76
assertTrue (StringUtils .isVariable ("$ab" ));
77
77
assertTrue (StringUtils .isVariable ("$asdasda" ));
78
78
assertTrue (StringUtils .isVariable ("$a34asd12e" ));
79
+ assertTrue (StringUtils .isVariable ("$a" ));
79
80
80
- assertFalse (StringUtils .isVariable ("$a" ));
81
81
assertFalse (StringUtils .isVariable ("sda" ));
82
82
assertFalse (StringUtils .isVariable (" " ));
83
83
assertFalse (StringUtils .isVariable ("... . /" ));
@@ -159,4 +159,4 @@ public void testRemoveStartingChars(){
159
159
assertEquals ("bcde" , StringUtils .removeStartingChars ("aaaaaabcde" , 'a' ));
160
160
assertEquals ("bcdeaa" , StringUtils .removeStartingChars ("aaaaaabcdeaa" , 'a' ));
161
161
}
162
- }
162
+ }
You can’t perform that action at this time.
0 commit comments