* fix script compatibility issue
This commit is contained in:
parent
b315e9e9ea
commit
2c92f46814
|
@ -265,6 +265,14 @@ public class ScriptShellMethods {
|
|||
return Charset.forName("UTF-8").decode(self.duplicate()).toString();
|
||||
}
|
||||
|
||||
public static ByteBuffer get(URL self) throws IOException {
|
||||
return WebRequest.fetch(self, 0, null, null);
|
||||
}
|
||||
|
||||
public static ByteBuffer get(URL self, Map<String, String> requestParameters) throws IOException {
|
||||
return WebRequest.fetch(self, 0, requestParameters, null);
|
||||
}
|
||||
|
||||
public static ByteBuffer post(URL self, Map<String, ?> parameters, Map<String, String> requestParameters) throws IOException {
|
||||
return WebRequest.post(self, parameters, requestParameters);
|
||||
}
|
||||
|
|
|
@ -185,11 +185,13 @@ public class ExpressionFormatMethods {
|
|||
* Find a matcher that matches the given pattern (case-insensitive)
|
||||
*/
|
||||
public static Matcher findMatch(String self, String pattern) {
|
||||
if (pattern == null)
|
||||
return null;
|
||||
|
||||
Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self);
|
||||
return matcher.find() ? matcher.reset() : null;
|
||||
if (pattern != null) {
|
||||
Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self);
|
||||
if (matcher.find()) {
|
||||
return matcher.reset();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue