id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
124,800 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java | AbstractHttpCommandCodec.defineCommand | @Override
public void defineCommand(String name, HttpMethod method, String pathPattern) {
defineCommand(name, new CommandSpec(method, pathPattern));
} | java | @Override
public void defineCommand(String name, HttpMethod method, String pathPattern) {
defineCommand(name, new CommandSpec(method, pathPattern));
} | [
"@",
"Override",
"public",
"void",
"defineCommand",
"(",
"String",
"name",
",",
"HttpMethod",
"method",
",",
"String",
"pathPattern",
")",
"{",
"defineCommand",
"(",
"name",
",",
"new",
"CommandSpec",
"(",
"method",
",",
"pathPattern",
")",
")",
";",
"}"
] | Defines a new command mapping.
@param name The command name.
@param method The HTTP method to use for the command.
@param pathPattern The URI path pattern for the command. When encoding a command, each
path segment prefixed with a ":" will be replaced with the corresponding parameter
from the encoded command. | [
"Defines",
"a",
"new",
"command",
"mapping",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java#L296-L299 |
124,801 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/By.java | By.findElement | public WebElement findElement(SearchContext context) {
List<WebElement> allElements = findElements(context);
if (allElements == null || allElements.isEmpty()) {
throw new NoSuchElementException("Cannot locate an element using " + toString());
}
return allElements.get(0);
} | java | public WebElement findElement(SearchContext context) {
List<WebElement> allElements = findElements(context);
if (allElements == null || allElements.isEmpty()) {
throw new NoSuchElementException("Cannot locate an element using " + toString());
}
return allElements.get(0);
} | [
"public",
"WebElement",
"findElement",
"(",
"SearchContext",
"context",
")",
"{",
"List",
"<",
"WebElement",
">",
"allElements",
"=",
"findElements",
"(",
"context",
")",
";",
"if",
"(",
"allElements",
"==",
"null",
"||",
"allElements",
".",
"isEmpty",
"(",
... | Find a single element. Override this method if necessary.
@param context A context to use to find the element.
@return The WebElement that matches the selector. | [
"Find",
"a",
"single",
"element",
".",
"Override",
"this",
"method",
"if",
"necessary",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/By.java#L125-L131 |
124,802 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/logging/SessionLogHandler.java | SessionLogHandler.getSessionLogs | public static Map<String, SessionLogs> getSessionLogs(Map<String, Object> rawSessionMap) {
Map<String, SessionLogs> sessionLogsMap = new HashMap<>();
for (Map.Entry<String, Object> entry : rawSessionMap.entrySet()) {
String sessionId = entry.getKey();
if (!(entry.getValue() instanceof Map)) {
... | java | public static Map<String, SessionLogs> getSessionLogs(Map<String, Object> rawSessionMap) {
Map<String, SessionLogs> sessionLogsMap = new HashMap<>();
for (Map.Entry<String, Object> entry : rawSessionMap.entrySet()) {
String sessionId = entry.getKey();
if (!(entry.getValue() instanceof Map)) {
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"SessionLogs",
">",
"getSessionLogs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"rawSessionMap",
")",
"{",
"Map",
"<",
"String",
",",
"SessionLogs",
">",
"sessionLogsMap",
"=",
"new",
"HashMap",
"<>",
"("... | Creates a session logs map, with session logs mapped to session IDs, given
a raw session log map as a JSON object.
@param rawSessionMap The raw session map.
@return The session logs mapped to session IDs. | [
"Creates",
"a",
"session",
"logs",
"map",
"with",
"session",
"logs",
"mapped",
"to",
"session",
"IDs",
"given",
"a",
"raw",
"session",
"log",
"map",
"as",
"a",
"JSON",
"object",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/logging/SessionLogHandler.java#L34-L47 |
124,803 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/os/CommandLine.java | CommandLine.setEnvironmentVariables | public void setEnvironmentVariables(Map<String, String> environment) {
for (Map.Entry<String, String> entry : environment.entrySet()) {
setEnvironmentVariable(entry.getKey(), entry.getValue());
}
} | java | public void setEnvironmentVariables(Map<String, String> environment) {
for (Map.Entry<String, String> entry : environment.entrySet()) {
setEnvironmentVariable(entry.getKey(), entry.getValue());
}
} | [
"public",
"void",
"setEnvironmentVariables",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"environment",
".",
"entrySet",
"(",
")",
")",
"{",
"... | Adds the specified environment variables.
@param environment the variables to add
@throws IllegalArgumentException if any value given is null (unsupported) | [
"Adds",
"the",
"specified",
"environment",
"variables",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/os/CommandLine.java#L61-L65 |
124,804 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/MutableCapabilities.java | MutableCapabilities.merge | @Override
public MutableCapabilities merge(Capabilities extraCapabilities) {
if (extraCapabilities == null) {
return this;
}
extraCapabilities.asMap().forEach(this::setCapability);
return this;
} | java | @Override
public MutableCapabilities merge(Capabilities extraCapabilities) {
if (extraCapabilities == null) {
return this;
}
extraCapabilities.asMap().forEach(this::setCapability);
return this;
} | [
"@",
"Override",
"public",
"MutableCapabilities",
"merge",
"(",
"Capabilities",
"extraCapabilities",
")",
"{",
"if",
"(",
"extraCapabilities",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"extraCapabilities",
".",
"asMap",
"(",
")",
".",
"forEach",
"(",... | Merge the extra capabilities provided into this DesiredCapabilities instance. If capabilities
with the same name exist in this instance, they will be overridden by the values from the
extraCapabilities object.
@param extraCapabilities Additional capabilities to be added.
@return The DesiredCapabilities instance after ... | [
"Merge",
"the",
"extra",
"capabilities",
"provided",
"into",
"this",
"DesiredCapabilities",
"instance",
".",
"If",
"capabilities",
"with",
"the",
"same",
"name",
"exist",
"in",
"this",
"instance",
"they",
"will",
"be",
"overridden",
"by",
"the",
"values",
"from"... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/MutableCapabilities.java#L67-L76 |
124,805 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/net/NetworkUtils.java | NetworkUtils.getIp4NonLoopbackAddressOfThisMachine | public InetAddress getIp4NonLoopbackAddressOfThisMachine() {
for (NetworkInterface iface : networkInterfaceProvider.getNetworkInterfaces()) {
final InetAddress ip4NonLoopback = iface.getIp4NonLoopBackOnly();
if (ip4NonLoopback != null) {
return ip4NonLoopback;
}
}
throw new WebDriv... | java | public InetAddress getIp4NonLoopbackAddressOfThisMachine() {
for (NetworkInterface iface : networkInterfaceProvider.getNetworkInterfaces()) {
final InetAddress ip4NonLoopback = iface.getIp4NonLoopBackOnly();
if (ip4NonLoopback != null) {
return ip4NonLoopback;
}
}
throw new WebDriv... | [
"public",
"InetAddress",
"getIp4NonLoopbackAddressOfThisMachine",
"(",
")",
"{",
"for",
"(",
"NetworkInterface",
"iface",
":",
"networkInterfaceProvider",
".",
"getNetworkInterfaces",
"(",
")",
")",
"{",
"final",
"InetAddress",
"ip4NonLoopback",
"=",
"iface",
".",
"ge... | Returns a non-loopback IP4 hostname of the local host.
@return A string hostName | [
"Returns",
"a",
"non",
"-",
"loopback",
"IP4",
"hostname",
"of",
"the",
"local",
"host",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/net/NetworkUtils.java#L98-L106 |
124,806 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/net/NetworkUtils.java | NetworkUtils.obtainLoopbackIp4Address | public String obtainLoopbackIp4Address() {
final NetworkInterface networkInterface = getLoopBackAndIp4Only();
if (networkInterface != null) {
return networkInterface.getIp4LoopbackOnly().getHostName();
}
final String ipOfIp4LoopBack = getIpOfLoopBackIp4();
if (ipOfIp4LoopBack != null) {
... | java | public String obtainLoopbackIp4Address() {
final NetworkInterface networkInterface = getLoopBackAndIp4Only();
if (networkInterface != null) {
return networkInterface.getIp4LoopbackOnly().getHostName();
}
final String ipOfIp4LoopBack = getIpOfLoopBackIp4();
if (ipOfIp4LoopBack != null) {
... | [
"public",
"String",
"obtainLoopbackIp4Address",
"(",
")",
"{",
"final",
"NetworkInterface",
"networkInterface",
"=",
"getLoopBackAndIp4Only",
"(",
")",
";",
"if",
"(",
"networkInterface",
"!=",
"null",
")",
"{",
"return",
"networkInterface",
".",
"getIp4LoopbackOnly",... | Returns a single address that is guaranteed to resolve to an ipv4 representation of localhost
This may either be a hostname or an ip address, depending if we can guarantee what that the
hostname will resolve to ip4.
@return The address part og such an address | [
"Returns",
"a",
"single",
"address",
"that",
"is",
"guaranteed",
"to",
"resolve",
"to",
"an",
"ipv4",
"representation",
"of",
"localhost",
"This",
"may",
"either",
"be",
"a",
"hostname",
"or",
"an",
"ip",
"address",
"depending",
"if",
"we",
"can",
"guarantee... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/net/NetworkUtils.java#L115-L140 |
124,807 | SeleniumHQ/selenium | java/client/src/com/thoughtworks/selenium/BrowserConfigurationOptions.java | BrowserConfigurationOptions.serialize | public String serialize() {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String key : options.keySet()) {
if (first) {
first = false;
} else {
sb.append(';');
}
sb.append(key).append('=').append(options.get(key));
}
return sb.toString();
... | java | public String serialize() {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String key : options.keySet()) {
if (first) {
first = false;
} else {
sb.append(';');
}
sb.append(key).append('=').append(options.get(key));
}
return sb.toString();
... | [
"public",
"String",
"serialize",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"String",
"key",
":",
"options",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"first... | Serializes to the format "name=value;name=value".
@return String with the above format. | [
"Serializes",
"to",
"the",
"format",
"name",
"=",
"value",
";",
"name",
"=",
"value",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/BrowserConfigurationOptions.java#L67-L79 |
124,808 | SeleniumHQ/selenium | java/client/src/com/thoughtworks/selenium/BrowserConfigurationOptions.java | BrowserConfigurationOptions.set | public BrowserConfigurationOptions set(String key, String value) {
if (value != null) {
options.put(key, value);
}
return this;
} | java | public BrowserConfigurationOptions set(String key, String value) {
if (value != null) {
options.put(key, value);
}
return this;
} | [
"public",
"BrowserConfigurationOptions",
"set",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"options",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Sets the given key to the given value unless the value is null. In that case, no entry for the
key is made.
@param key the name of the key
@param value the value for the key
@return this / self | [
"Sets",
"the",
"given",
"key",
"to",
"the",
"given",
"value",
"unless",
"the",
"value",
"is",
"null",
".",
"In",
"that",
"case",
"no",
"entry",
"for",
"the",
"key",
"is",
"made",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/BrowserConfigurationOptions.java#L238-L243 |
124,809 | SeleniumHQ/selenium | java/client/src/com/thoughtworks/selenium/HttpCommandProcessor.java | HttpCommandProcessor.executeCommandOnServlet | public String executeCommandOnServlet(String command) {
try {
return getCommandResponseAsString(command);
} catch (IOException e) {
if (e instanceof ConnectException) {
throw new SeleniumException(e.getMessage(), e);
}
e.printStackTrace();
throw new UnsupportedOperationExce... | java | public String executeCommandOnServlet(String command) {
try {
return getCommandResponseAsString(command);
} catch (IOException e) {
if (e instanceof ConnectException) {
throw new SeleniumException(e.getMessage(), e);
}
e.printStackTrace();
throw new UnsupportedOperationExce... | [
"public",
"String",
"executeCommandOnServlet",
"(",
"String",
"command",
")",
"{",
"try",
"{",
"return",
"getCommandResponseAsString",
"(",
"command",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"if",
"(",
"e",
"instanceof",
"ConnectException",
... | Sends the specified command string to the bridge servlet
@param command command to execute
@return response from the command execution | [
"Sends",
"the",
"specified",
"command",
"string",
"to",
"the",
"bridge",
"servlet"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/HttpCommandProcessor.java#L120-L131 |
124,810 | SeleniumHQ/selenium | java/client/src/com/thoughtworks/selenium/HttpCommandProcessor.java | HttpCommandProcessor.parseCSV | public static String[] parseCSV(String input) {
List<String> output = new ArrayList<>();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
switch (c) {
case ',':
output.add(sb.toString());
sb = new StringBuffer(... | java | public static String[] parseCSV(String input) {
List<String> output = new ArrayList<>();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
switch (c) {
case ',':
output.add(sb.toString());
sb = new StringBuffer(... | [
"public",
"static",
"String",
"[",
"]",
"parseCSV",
"(",
"String",
"input",
")",
"{",
"List",
"<",
"String",
">",
"output",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"in... | Convert backslash-escaped comma-delimited string into String array. As described in SRC-CDP
spec section 5.2.1.2, these strings are comma-delimited, but commas can be escaped with a
backslash "\". Backslashes can also be escaped as a double-backslash.
@param input the unparsed string, e.g. "veni\, vidi\, vici,c:\\foo\... | [
"Convert",
"backslash",
"-",
"escaped",
"comma",
"-",
"delimited",
"string",
"into",
"String",
"array",
".",
"As",
"described",
"in",
"SRC",
"-",
"CDP",
"spec",
"section",
"5",
".",
"2",
".",
"1",
".",
"2",
"these",
"strings",
"are",
"comma",
"-",
"del... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/HttpCommandProcessor.java#L308-L328 |
124,811 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java | StandaloneConfiguration.merge | public void merge(StandaloneConfiguration other) {
if (other == null) {
return;
}
if (isMergeAble(Integer.class, other.browserTimeout, browserTimeout)) {
browserTimeout = other.browserTimeout;
}
if (isMergeAble(Integer.class, other.jettyMaxThreads, jettyMaxThreads)) {
jettyMaxThre... | java | public void merge(StandaloneConfiguration other) {
if (other == null) {
return;
}
if (isMergeAble(Integer.class, other.browserTimeout, browserTimeout)) {
browserTimeout = other.browserTimeout;
}
if (isMergeAble(Integer.class, other.jettyMaxThreads, jettyMaxThreads)) {
jettyMaxThre... | [
"public",
"void",
"merge",
"(",
"StandaloneConfiguration",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"isMergeAble",
"(",
"Integer",
".",
"class",
",",
"other",
".",
"browserTimeout",
",",
"browserTimeout"... | copy another configuration's values into this one if they are set. | [
"copy",
"another",
"configuration",
"s",
"values",
"into",
"this",
"one",
"if",
"they",
"are",
"set",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java#L180-L196 |
124,812 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java | StandaloneConfiguration.toJson | public Map<String, Object> toJson() {
Map<String, Object> json = new HashMap<>();
json.put("browserTimeout", browserTimeout);
json.put("debug", debug);
json.put("jettyMaxThreads", jettyMaxThreads);
json.put("log", log);
json.put("host", host);
json.put("port", port);
json.put("role", rol... | java | public Map<String, Object> toJson() {
Map<String, Object> json = new HashMap<>();
json.put("browserTimeout", browserTimeout);
json.put("debug", debug);
json.put("jettyMaxThreads", jettyMaxThreads);
json.put("log", log);
json.put("host", host);
json.put("port", port);
json.put("role", rol... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"toJson",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"json",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"json",
".",
"put",
"(",
"\"browserTimeout\"",
",",
"browserTimeout",
")",
";",... | Return a JsonElement representation of the configuration. Does not serialize nulls. | [
"Return",
"a",
"JsonElement",
"representation",
"of",
"the",
"configuration",
".",
"Does",
"not",
"serialize",
"nulls",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java#L275-L291 |
124,813 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/ExternalSessionKey.java | ExternalSessionKey.fromResponseBody | public static ExternalSessionKey fromResponseBody(String responseBody) throws NewSessionException {
if (responseBody != null && responseBody.startsWith("OK,")) {
return new ExternalSessionKey(responseBody.replace("OK,", ""));
}
throw new NewSessionException("The server returned an error : "+responseBo... | java | public static ExternalSessionKey fromResponseBody(String responseBody) throws NewSessionException {
if (responseBody != null && responseBody.startsWith("OK,")) {
return new ExternalSessionKey(responseBody.replace("OK,", ""));
}
throw new NewSessionException("The server returned an error : "+responseBo... | [
"public",
"static",
"ExternalSessionKey",
"fromResponseBody",
"(",
"String",
"responseBody",
")",
"throws",
"NewSessionException",
"{",
"if",
"(",
"responseBody",
"!=",
"null",
"&&",
"responseBody",
".",
"startsWith",
"(",
"\"OK,\"",
")",
")",
"{",
"return",
"new"... | extract the external key from the server response for a selenium1 new session request.
@param responseBody the response from the server
@return the ExternalKey if it was present in the server's response.
@throws NewSessionException in case the server didn't send back a success result. | [
"extract",
"the",
"external",
"key",
"from",
"the",
"server",
"response",
"for",
"a",
"selenium1",
"new",
"session",
"request",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/ExternalSessionKey.java#L130-L135 |
124,814 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/FluentWait.java | FluentWait.ignoreAll | public <K extends Throwable> FluentWait<T> ignoreAll(Collection<Class<? extends K>> types) {
ignoredExceptions.addAll(types);
return this;
} | java | public <K extends Throwable> FluentWait<T> ignoreAll(Collection<Class<? extends K>> types) {
ignoredExceptions.addAll(types);
return this;
} | [
"public",
"<",
"K",
"extends",
"Throwable",
">",
"FluentWait",
"<",
"T",
">",
"ignoreAll",
"(",
"Collection",
"<",
"Class",
"<",
"?",
"extends",
"K",
">",
">",
"types",
")",
"{",
"ignoredExceptions",
".",
"addAll",
"(",
"types",
")",
";",
"return",
"th... | Configures this instance to ignore specific types of exceptions while waiting for a condition.
Any exceptions not whitelisted will be allowed to propagate, terminating the wait.
@param types The types of exceptions to ignore.
@param <K> an Exception that extends Throwable
@return A self reference. | [
"Configures",
"this",
"instance",
"to",
"ignore",
"specific",
"types",
"of",
"exceptions",
"while",
"waiting",
"for",
"a",
"condition",
".",
"Any",
"exceptions",
"not",
"whitelisted",
"will",
"be",
"allowed",
"to",
"propagate",
"terminating",
"the",
"wait",
"."
... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/FluentWait.java#L162-L165 |
124,815 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java | DefaultProxyHtmlRenderer.tabConfig | private String tabConfig() {
StringBuilder builder = new StringBuilder();
builder.append("<div type='config' class='content_detail'>");
builder.append(proxy.getConfig().toString("<p>%1$s: %2$s</p>"));
builder.append("</div>");
return builder.toString();
} | java | private String tabConfig() {
StringBuilder builder = new StringBuilder();
builder.append("<div type='config' class='content_detail'>");
builder.append(proxy.getConfig().toString("<p>%1$s: %2$s</p>"));
builder.append("</div>");
return builder.toString();
} | [
"private",
"String",
"tabConfig",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"<div type='config' class='content_detail'>\"",
")",
";",
"builder",
".",
"append",
"(",
"proxy",
".",
"getC... | content of the config tab. | [
"content",
"of",
"the",
"config",
"tab",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java#L88-L94 |
124,816 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java | DefaultProxyHtmlRenderer.tabBrowsers | private String tabBrowsers() {
StringBuilder builder = new StringBuilder();
builder.append("<div type='browsers' class='content_detail'>");
SlotsLines rcLines = new SlotsLines();
SlotsLines wdLines = new SlotsLines();
for (TestSlot slot : proxy.getTestSlots()) {
if (slot.getProtocol() == Sel... | java | private String tabBrowsers() {
StringBuilder builder = new StringBuilder();
builder.append("<div type='browsers' class='content_detail'>");
SlotsLines rcLines = new SlotsLines();
SlotsLines wdLines = new SlotsLines();
for (TestSlot slot : proxy.getTestSlots()) {
if (slot.getProtocol() == Sel... | [
"private",
"String",
"tabBrowsers",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"<div type='browsers' class='content_detail'>\"",
")",
";",
"SlotsLines",
"rcLines",
"=",
"new",
"SlotsLines",... | content of the browsers tab | [
"content",
"of",
"the",
"browsers",
"tab"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java#L98-L123 |
124,817 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java | DefaultProxyHtmlRenderer.getLines | private String getLines(SlotsLines lines) {
StringBuilder builder = new StringBuilder();
for (MiniCapability cap : lines.getLinesType()) {
String icon = cap.getIcon();
String version = cap.getVersion();
builder.append("<p>");
if (version != null) {
builder.append("v:").append(ver... | java | private String getLines(SlotsLines lines) {
StringBuilder builder = new StringBuilder();
for (MiniCapability cap : lines.getLinesType()) {
String icon = cap.getIcon();
String version = cap.getVersion();
builder.append("<p>");
if (version != null) {
builder.append("v:").append(ver... | [
"private",
"String",
"getLines",
"(",
"SlotsLines",
"lines",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"MiniCapability",
"cap",
":",
"lines",
".",
"getLinesType",
"(",
")",
")",
"{",
"String",
"icon",
"="... | the lines of icon representing the possible slots | [
"the",
"lines",
"of",
"icon",
"representing",
"the",
"possible",
"slots"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java#L126-L141 |
124,818 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java | DefaultProxyHtmlRenderer.nodeTabs | private String nodeTabs() {
StringBuilder builder = new StringBuilder();
builder.append("<div class='tabs'>");
builder.append("<ul>");
builder
.append("<li class='tab' type='browsers'><a title='test slots' href='#'>Browsers</a></li>");
builder
.append("<li class='tab' type='config'><... | java | private String nodeTabs() {
StringBuilder builder = new StringBuilder();
builder.append("<div class='tabs'>");
builder.append("<ul>");
builder
.append("<li class='tab' type='browsers'><a title='test slots' href='#'>Browsers</a></li>");
builder
.append("<li class='tab' type='config'><... | [
"private",
"String",
"nodeTabs",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"<div class='tabs'>\"",
")",
";",
"builder",
".",
"append",
"(",
"\"<ul>\"",
")",
";",
"builder",
".",
... | the tabs header. | [
"the",
"tabs",
"header",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java#L172-L183 |
124,819 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java | DefaultProxyHtmlRenderer.getPlatform | public static String getPlatform(RemoteProxy proxy) {
if (proxy.getTestSlots().size() == 0) {
return "Unknown";
}
Platform res = getPlatform(proxy.getTestSlots().get(0));
for (TestSlot slot : proxy.getTestSlots()) {
Platform tmp = getPlatform(slot);
if (tmp != res) {
return "m... | java | public static String getPlatform(RemoteProxy proxy) {
if (proxy.getTestSlots().size() == 0) {
return "Unknown";
}
Platform res = getPlatform(proxy.getTestSlots().get(0));
for (TestSlot slot : proxy.getTestSlots()) {
Platform tmp = getPlatform(slot);
if (tmp != res) {
return "m... | [
"public",
"static",
"String",
"getPlatform",
"(",
"RemoteProxy",
"proxy",
")",
"{",
"if",
"(",
"proxy",
".",
"getTestSlots",
"(",
")",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"Unknown\"",
";",
"}",
"Platform",
"res",
"=",
"getPlatform",
... | return the platform for the proxy. It should be the same for all slots of the proxy, so checking that.
@param proxy remote proxy
@return Either the platform name, "Unknown", "mixed OS", or "not specified". | [
"return",
"the",
"platform",
"for",
"the",
"proxy",
".",
"It",
"should",
"be",
"the",
"same",
"for",
"all",
"slots",
"of",
"the",
"proxy",
"so",
"checking",
"that",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/DefaultProxyHtmlRenderer.java#L191-L208 |
124,820 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/utils/configuration/GridConfiguration.java | GridConfiguration.merge | public void merge(GridConfiguration other) {
if (other == null) {
return;
}
super.merge(other);
if (isMergeAble(Integer.class, other.cleanUpCycle, cleanUpCycle)) {
cleanUpCycle = other.cleanUpCycle;
}
if (isMergeAble(Map.class, other.custom, custom)) {
if (custom == null) {
... | java | public void merge(GridConfiguration other) {
if (other == null) {
return;
}
super.merge(other);
if (isMergeAble(Integer.class, other.cleanUpCycle, cleanUpCycle)) {
cleanUpCycle = other.cleanUpCycle;
}
if (isMergeAble(Map.class, other.custom, custom)) {
if (custom == null) {
... | [
"public",
"void",
"merge",
"(",
"GridConfiguration",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
")",
"{",
"return",
";",
"}",
"super",
".",
"merge",
"(",
"other",
")",
";",
"if",
"(",
"isMergeAble",
"(",
"Integer",
".",
"class",
",",
"other... | replaces this instance of configuration value with the 'other' value if it's set.
@param other | [
"replaces",
"this",
"instance",
"of",
"configuration",
"value",
"with",
"the",
"other",
"value",
"if",
"it",
"s",
"set",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/configuration/GridConfiguration.java#L91-L116 |
124,821 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/utils/ExtraServletUtil.java | ExtraServletUtil.createServlet | public static Class<? extends Servlet> createServlet(String className) {
try {
return Class.forName(className).asSubclass(Servlet.class);
} catch (ClassNotFoundException e) {
log.warning("The specified class : " + className + " cannot be instantiated " +
e.getMessage());
}
return n... | java | public static Class<? extends Servlet> createServlet(String className) {
try {
return Class.forName(className).asSubclass(Servlet.class);
} catch (ClassNotFoundException e) {
log.warning("The specified class : " + className + " cannot be instantiated " +
e.getMessage());
}
return n... | [
"public",
"static",
"Class",
"<",
"?",
"extends",
"Servlet",
">",
"createServlet",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"className",
")",
".",
"asSubclass",
"(",
"Servlet",
".",
"class",
")",
";",
"}",... | Reflexion to create the servlet based on the class name. Returns null if the class cannot be
instantiated.
@param className class name to be created
@return Class object for passed className argument, or <i>null</i> if no
matching class name can be found. | [
"Reflexion",
"to",
"create",
"the",
"servlet",
"based",
"on",
"the",
"class",
"name",
".",
"Returns",
"null",
"if",
"the",
"class",
"cannot",
"be",
"instantiated",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/utils/ExtraServletUtil.java#L36-L44 |
124,822 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java | RemoteWebDriver.log | protected void log(SessionId sessionId, String commandName, Object toLog, When when) {
if (!logger.isLoggable(level)) {
return;
}
String text = String.valueOf(toLog);
if (commandName.equals(DriverCommand.EXECUTE_SCRIPT)
|| commandName.equals(DriverCommand.EXECUTE_ASYNC_SCRIPT)) {
if ... | java | protected void log(SessionId sessionId, String commandName, Object toLog, When when) {
if (!logger.isLoggable(level)) {
return;
}
String text = String.valueOf(toLog);
if (commandName.equals(DriverCommand.EXECUTE_SCRIPT)
|| commandName.equals(DriverCommand.EXECUTE_ASYNC_SCRIPT)) {
if ... | [
"protected",
"void",
"log",
"(",
"SessionId",
"sessionId",
",",
"String",
"commandName",
",",
"Object",
"toLog",
",",
"When",
"when",
")",
"{",
"if",
"(",
"!",
"logger",
".",
"isLoggable",
"(",
"level",
")",
")",
"{",
"return",
";",
"}",
"String",
"tex... | Override this to be notified at key points in the execution of a command.
@param sessionId the session id.
@param commandName the command that is being executed.
@param toLog any data that might be interesting.
@param when verb tense of "Execute" to prefix message | [
"Override",
"this",
"to",
"be",
"notified",
"at",
"key",
"points",
"in",
"the",
"execution",
"of",
"a",
"command",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java#L673-L698 |
124,823 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/service/DriverService.java | DriverService.isRunning | public boolean isRunning() {
lock.lock();
try {
return process != null && process.isRunning();
} catch (IllegalThreadStateException e) {
return true;
} finally {
lock.unlock();
}
} | java | public boolean isRunning() {
lock.lock();
try {
return process != null && process.isRunning();
} catch (IllegalThreadStateException e) {
return true;
} finally {
lock.unlock();
}
} | [
"public",
"boolean",
"isRunning",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"process",
"!=",
"null",
"&&",
"process",
".",
"isRunning",
"(",
")",
";",
"}",
"catch",
"(",
"IllegalThreadStateException",
"e",
")",
"{",
"retu... | Checks whether the driver child process is currently running.
@return Whether the driver child process is still running. | [
"Checks",
"whether",
"the",
"driver",
"child",
"process",
"is",
"currently",
"running",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/service/DriverService.java#L160-L169 |
124,824 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/service/DriverService.java | DriverService.start | public void start() throws IOException {
lock.lock();
try {
if (process != null) {
return;
}
process = new CommandLine(this.executable, args.toArray(new String[] {}));
process.setEnvironmentVariables(environment);
process.copyOutputTo(getOutputStream());
process.execu... | java | public void start() throws IOException {
lock.lock();
try {
if (process != null) {
return;
}
process = new CommandLine(this.executable, args.toArray(new String[] {}));
process.setEnvironmentVariables(environment);
process.copyOutputTo(getOutputStream());
process.execu... | [
"public",
"void",
"start",
"(",
")",
"throws",
"IOException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"process",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"process",
"=",
"new",
"CommandLine",
"(",
"this",
".",
"executable",... | Starts this service if it is not already running. This method will block until the server has
been fully started and is ready to handle commands.
@throws IOException If an error occurs while spawning the child process.
@see #stop() | [
"Starts",
"this",
"service",
"if",
"it",
"is",
"not",
"already",
"running",
".",
"This",
"method",
"will",
"block",
"until",
"the",
"server",
"has",
"been",
"fully",
"started",
"and",
"is",
"ready",
"to",
"handle",
"commands",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/service/DriverService.java#L178-L193 |
124,825 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/service/DriverService.java | DriverService.stop | public void stop() {
lock.lock();
WebDriverException toThrow = null;
try {
if (process == null) {
return;
}
if (hasShutdownEndpoint()) {
try {
URL killUrl = new URL(url.toString() + "/shutdown");
new UrlChecker().waitUntilUnavailable(3, SECONDS, killUr... | java | public void stop() {
lock.lock();
WebDriverException toThrow = null;
try {
if (process == null) {
return;
}
if (hasShutdownEndpoint()) {
try {
URL killUrl = new URL(url.toString() + "/shutdown");
new UrlChecker().waitUntilUnavailable(3, SECONDS, killUr... | [
"public",
"void",
"stop",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"WebDriverException",
"toThrow",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"process",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"hasShutdownEndpoint",
"(",
")",
... | Stops this service if it is currently running. This method will attempt to block until the
server has been fully shutdown.
@see #start() | [
"Stops",
"this",
"service",
"if",
"it",
"is",
"currently",
"running",
".",
"This",
"method",
"will",
"attempt",
"to",
"block",
"until",
"the",
"server",
"has",
"been",
"fully",
"shutdown",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/service/DriverService.java#L213-L249 |
124,826 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.singleTap | public TouchActions singleTap(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new SingleTapAction(touchScreen, (Locatable) onElement));
}
tick(touchPointer.createPointerDown(0));
tick(touchPointer.createPointerUp(0));
return this;
} | java | public TouchActions singleTap(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new SingleTapAction(touchScreen, (Locatable) onElement));
}
tick(touchPointer.createPointerDown(0));
tick(touchPointer.createPointerUp(0));
return this;
} | [
"public",
"TouchActions",
"singleTap",
"(",
"WebElement",
"onElement",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"SingleTapAction",
"(",
"touchScreen",
",",
"(",
"Locatable",
")",
"onElement",
")",
")... | Allows the execution of single tap on the screen, analogous to click using a Mouse.
@param onElement the {@link WebElement} on the screen.
@return self | [
"Allows",
"the",
"execution",
"of",
"single",
"tap",
"on",
"the",
"screen",
"analogous",
"to",
"click",
"using",
"a",
"Mouse",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L54-L61 |
124,827 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.down | public TouchActions down(int x, int y) {
if (touchScreen != null) {
action.addAction(new DownAction(touchScreen, x, y));
}
return this;
} | java | public TouchActions down(int x, int y) {
if (touchScreen != null) {
action.addAction(new DownAction(touchScreen, x, y));
}
return this;
} | [
"public",
"TouchActions",
"down",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"DownAction",
"(",
"touchScreen",
",",
"x",
",",
"y",
")",
")",
";",
"}",
"retur... | Allows the execution of the gesture 'down' on the screen. It is typically the first of a
sequence of touch gestures.
@param x The x coordinate relative to the viewport
@param y The y coordinate relative to the viewport
@return self | [
"Allows",
"the",
"execution",
"of",
"the",
"gesture",
"down",
"on",
"the",
"screen",
".",
"It",
"is",
"typically",
"the",
"first",
"of",
"a",
"sequence",
"of",
"touch",
"gestures",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L71-L76 |
124,828 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.up | public TouchActions up(int x, int y) {
if (touchScreen != null) {
action.addAction(new UpAction(touchScreen, x, y));
}
return this;
} | java | public TouchActions up(int x, int y) {
if (touchScreen != null) {
action.addAction(new UpAction(touchScreen, x, y));
}
return this;
} | [
"public",
"TouchActions",
"up",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"UpAction",
"(",
"touchScreen",
",",
"x",
",",
"y",
")",
")",
";",
"}",
"return",
... | Allows the execution of the gesture 'up' on the screen. It is typically the last of a sequence
of touch gestures.
@param x The x coordinate relative to the viewport
@param y The y coordinate relative to the viewport
@return self | [
"Allows",
"the",
"execution",
"of",
"the",
"gesture",
"up",
"on",
"the",
"screen",
".",
"It",
"is",
"typically",
"the",
"last",
"of",
"a",
"sequence",
"of",
"touch",
"gestures",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L86-L91 |
124,829 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.move | public TouchActions move(int x, int y) {
if (touchScreen != null) {
action.addAction(new MoveAction(touchScreen, x, y));
}
return this;
} | java | public TouchActions move(int x, int y) {
if (touchScreen != null) {
action.addAction(new MoveAction(touchScreen, x, y));
}
return this;
} | [
"public",
"TouchActions",
"move",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"MoveAction",
"(",
"touchScreen",
",",
"x",
",",
"y",
")",
")",
";",
"}",
"retur... | Allows the execution of the gesture 'move' on the screen.
@param x The x coordinate relative to the viewport
@param y The y coordinate relative to the viewport
@return self | [
"Allows",
"the",
"execution",
"of",
"the",
"gesture",
"move",
"on",
"the",
"screen",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L100-L105 |
124,830 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.scroll | public TouchActions scroll(WebElement onElement, int xOffset, int yOffset) {
if (touchScreen != null) {
action.addAction(new ScrollAction(touchScreen, (Locatable) onElement, xOffset, yOffset));
}
return this;
} | java | public TouchActions scroll(WebElement onElement, int xOffset, int yOffset) {
if (touchScreen != null) {
action.addAction(new ScrollAction(touchScreen, (Locatable) onElement, xOffset, yOffset));
}
return this;
} | [
"public",
"TouchActions",
"scroll",
"(",
"WebElement",
"onElement",
",",
"int",
"xOffset",
",",
"int",
"yOffset",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"ScrollAction",
"(",
"touchScreen",
",",
"... | Creates a scroll gesture that starts on a particular screen location.
@param onElement the {@link WebElement} where the scroll starts.
@param xOffset The x offset to scroll
@param yOffset The y offset to scroll
@return self | [
"Creates",
"a",
"scroll",
"gesture",
"that",
"starts",
"on",
"a",
"particular",
"screen",
"location",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L115-L120 |
124,831 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.doubleTap | public TouchActions doubleTap(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new DoubleTapAction(touchScreen, (Locatable) onElement));
}
return this;
} | java | public TouchActions doubleTap(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new DoubleTapAction(touchScreen, (Locatable) onElement));
}
return this;
} | [
"public",
"TouchActions",
"doubleTap",
"(",
"WebElement",
"onElement",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"DoubleTapAction",
"(",
"touchScreen",
",",
"(",
"Locatable",
")",
"onElement",
")",
")... | Allows the execution of double tap on the screen, analogous to double click using a Mouse.
@param onElement The {@link WebElement} to double tap
@return self | [
"Allows",
"the",
"execution",
"of",
"double",
"tap",
"on",
"the",
"screen",
"analogous",
"to",
"double",
"click",
"using",
"a",
"Mouse",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L129-L134 |
124,832 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.longPress | public TouchActions longPress(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new LongPressAction(touchScreen, (Locatable) onElement));
}
return this;
} | java | public TouchActions longPress(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new LongPressAction(touchScreen, (Locatable) onElement));
}
return this;
} | [
"public",
"TouchActions",
"longPress",
"(",
"WebElement",
"onElement",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"LongPressAction",
"(",
"touchScreen",
",",
"(",
"Locatable",
")",
"onElement",
")",
")... | Allows the execution of long press gestures.
@param onElement The {@link WebElement} to long press
@return self | [
"Allows",
"the",
"execution",
"of",
"long",
"press",
"gestures",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L143-L148 |
124,833 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.scroll | public TouchActions scroll(int xOffset, int yOffset) {
if (touchScreen != null) {
action.addAction(new ScrollAction(touchScreen, xOffset, yOffset));
}
return this;
} | java | public TouchActions scroll(int xOffset, int yOffset) {
if (touchScreen != null) {
action.addAction(new ScrollAction(touchScreen, xOffset, yOffset));
}
return this;
} | [
"public",
"TouchActions",
"scroll",
"(",
"int",
"xOffset",
",",
"int",
"yOffset",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"ScrollAction",
"(",
"touchScreen",
",",
"xOffset",
",",
"yOffset",
")",
... | Allows the view to be scrolled by an x and y offset.
@param xOffset The horizontal offset relative to the viewport
@param yOffset The vertical offset relative to the viewport
@return self | [
"Allows",
"the",
"view",
"to",
"be",
"scrolled",
"by",
"an",
"x",
"and",
"y",
"offset",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L158-L163 |
124,834 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.flick | public TouchActions flick(int xSpeed, int ySpeed) {
if (touchScreen != null) {
action.addAction(new FlickAction(touchScreen, xSpeed, ySpeed));
}
return this;
} | java | public TouchActions flick(int xSpeed, int ySpeed) {
if (touchScreen != null) {
action.addAction(new FlickAction(touchScreen, xSpeed, ySpeed));
}
return this;
} | [
"public",
"TouchActions",
"flick",
"(",
"int",
"xSpeed",
",",
"int",
"ySpeed",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"FlickAction",
"(",
"touchScreen",
",",
"xSpeed",
",",
"ySpeed",
")",
")",
... | Sends a flick gesture to the current view.
@param xSpeed The horizontal speed in pixels/second
@param ySpeed The vertical speed in pixels/second
@return self | [
"Sends",
"a",
"flick",
"gesture",
"to",
"the",
"current",
"view",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L173-L178 |
124,835 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.flick | public TouchActions flick(WebElement onElement, int xOffset, int yOffset, int speed) {
if (touchScreen != null) {
action.addAction(new FlickAction(touchScreen, (Locatable) onElement, xOffset, yOffset, speed));
}
return this;
} | java | public TouchActions flick(WebElement onElement, int xOffset, int yOffset, int speed) {
if (touchScreen != null) {
action.addAction(new FlickAction(touchScreen, (Locatable) onElement, xOffset, yOffset, speed));
}
return this;
} | [
"public",
"TouchActions",
"flick",
"(",
"WebElement",
"onElement",
",",
"int",
"xOffset",
",",
"int",
"yOffset",
",",
"int",
"speed",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"FlickAction",
"(",
... | Allows the execution of flick gestures starting in a location's element.
@param onElement The {@link WebElement} to flick on
@param xOffset The x offset relative to the viewport
@param yOffset The y offset relative to the viewport
@param speed speed to flick, 0 = normal, 1 = fast, 2 = slow
@return self | [
"Allows",
"the",
"execution",
"of",
"flick",
"gestures",
"starting",
"in",
"a",
"location",
"s",
"element",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L190-L195 |
124,836 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/logging/LoggingPreferences.java | LoggingPreferences.addPreferences | public LoggingPreferences addPreferences(LoggingPreferences prefs) {
if (prefs == null) {
return this;
}
for (String logType : prefs.getEnabledLogTypes()) {
enable(logType, prefs.getLevel(logType));
}
return this;
} | java | public LoggingPreferences addPreferences(LoggingPreferences prefs) {
if (prefs == null) {
return this;
}
for (String logType : prefs.getEnabledLogTypes()) {
enable(logType, prefs.getLevel(logType));
}
return this;
} | [
"public",
"LoggingPreferences",
"addPreferences",
"(",
"LoggingPreferences",
"prefs",
")",
"{",
"if",
"(",
"prefs",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"for",
"(",
"String",
"logType",
":",
"prefs",
".",
"getEnabledLogTypes",
"(",
")",
")",
... | Adds the given logging preferences giving them precedence over existing
preferences.
@param prefs The logging preferences to add.
@return A references to this object. | [
"Adds",
"the",
"given",
"logging",
"preferences",
"giving",
"them",
"precedence",
"over",
"existing",
"preferences",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/logging/LoggingPreferences.java#L80-L88 |
124,837 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/LoadableComponent.java | LoadableComponent.get | @SuppressWarnings("unchecked")
public T get() {
try {
isLoaded();
return (T) this;
} catch (Error e) {
load();
}
isLoaded();
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T get() {
try {
isLoaded();
return (T) this;
} catch (Error e) {
load();
}
isLoaded();
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"get",
"(",
")",
"{",
"try",
"{",
"isLoaded",
"(",
")",
";",
"return",
"(",
"T",
")",
"this",
";",
"}",
"catch",
"(",
"Error",
"e",
")",
"{",
"load",
"(",
")",
";",
"}",
"isLoaded... | Ensure that the component is currently loaded.
@return The component.
@throws Error when the component cannot be loaded. | [
"Ensure",
"that",
"the",
"component",
"is",
"currently",
"loaded",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/LoadableComponent.java#L43-L55 |
124,838 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java | NewSessionRequestQueue.add | public void add(RequestHandler request) {
lock.writeLock().lock();
try {
newSessionRequests.add(request);
} finally {
lock.writeLock().unlock();
}
} | java | public void add(RequestHandler request) {
lock.writeLock().lock();
try {
newSessionRequests.add(request);
} finally {
lock.writeLock().unlock();
}
} | [
"public",
"void",
"add",
"(",
"RequestHandler",
"request",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"newSessionRequests",
".",
"add",
"(",
"request",
")",
";",
"}",
"finally",
"{",
"lock",
".",
"writeLock",
... | Adds a request handler to this queue.
@param request the RequestHandler to add | [
"Adds",
"a",
"request",
"handler",
"to",
"this",
"queue",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java#L55-L62 |
124,839 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java | NewSessionRequestQueue.processQueue | public void processQueue(
Predicate<RequestHandler> handlerConsumer,
Prioritizer prioritizer) {
Comparator<RequestHandler> comparator =
prioritizer == null ?
Ordering.allEqual()::compare :
(a, b) -> prioritizer.compareTo(
a.getRequest().getDesiredCapabilities(), b.ge... | java | public void processQueue(
Predicate<RequestHandler> handlerConsumer,
Prioritizer prioritizer) {
Comparator<RequestHandler> comparator =
prioritizer == null ?
Ordering.allEqual()::compare :
(a, b) -> prioritizer.compareTo(
a.getRequest().getDesiredCapabilities(), b.ge... | [
"public",
"void",
"processQueue",
"(",
"Predicate",
"<",
"RequestHandler",
">",
"handlerConsumer",
",",
"Prioritizer",
"prioritizer",
")",
"{",
"Comparator",
"<",
"RequestHandler",
">",
"comparator",
"=",
"prioritizer",
"==",
"null",
"?",
"Ordering",
".",
"allEqua... | Processes all the entries in this queue.
@param handlerConsumer The consumer that returns true if it has taken the item from the queue
@param prioritizer The prioritizer to use | [
"Processes",
"all",
"the",
"entries",
"in",
"this",
"queue",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java#L71-L95 |
124,840 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java | NewSessionRequestQueue.removeNewSessionRequest | public boolean removeNewSessionRequest(RequestHandler request) {
lock.writeLock().lock();
try {
return newSessionRequests.remove(request);
} finally {
lock.writeLock().unlock();
}
} | java | public boolean removeNewSessionRequest(RequestHandler request) {
lock.writeLock().lock();
try {
return newSessionRequests.remove(request);
} finally {
lock.writeLock().unlock();
}
} | [
"public",
"boolean",
"removeNewSessionRequest",
"(",
"RequestHandler",
"request",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"newSessionRequests",
".",
"remove",
"(",
"request",
")",
";",
"}",
"finally",
... | Remove a specific request
@param request The request to remove
@return A boolean result from doing a newSessionRequest.remove(request). | [
"Remove",
"a",
"specific",
"request"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java#L114-L121 |
124,841 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java | NewSessionRequestQueue.getDesiredCapabilities | public Iterable<DesiredCapabilities> getDesiredCapabilities() {
lock.readLock().lock();
try {
return newSessionRequests.stream()
.map(req -> new DesiredCapabilities(req.getRequest().getDesiredCapabilities()))
.collect(Collectors.toList());
} finally {
lock.readLock().unlock()... | java | public Iterable<DesiredCapabilities> getDesiredCapabilities() {
lock.readLock().lock();
try {
return newSessionRequests.stream()
.map(req -> new DesiredCapabilities(req.getRequest().getDesiredCapabilities()))
.collect(Collectors.toList());
} finally {
lock.readLock().unlock()... | [
"public",
"Iterable",
"<",
"DesiredCapabilities",
">",
"getDesiredCapabilities",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"newSessionRequests",
".",
"stream",
"(",
")",
".",
"map",
"(",
"req",
"-... | Provides the desired capabilities of all the items in this queue.
@return An Iterable of unmodifiable maps. | [
"Provides",
"the",
"desired",
"capabilities",
"of",
"all",
"the",
"items",
"in",
"this",
"queue",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/NewSessionRequestQueue.java#L128-L137 |
124,842 | SeleniumHQ/selenium | java/client/src/com/thoughtworks/selenium/DefaultRemoteCommand.java | DefaultRemoteCommand.parse | public static RemoteCommand parse(String inputLine) {
if (null == inputLine) throw new NullPointerException("inputLine can't be null");
String[] values = inputLine.split("\\|");
if (values.length != NUMARGSINCLUDINGBOUNDARIES) {
throw new IllegalStateException("Cannot parse invalid line: " + inputLine... | java | public static RemoteCommand parse(String inputLine) {
if (null == inputLine) throw new NullPointerException("inputLine can't be null");
String[] values = inputLine.split("\\|");
if (values.length != NUMARGSINCLUDINGBOUNDARIES) {
throw new IllegalStateException("Cannot parse invalid line: " + inputLine... | [
"public",
"static",
"RemoteCommand",
"parse",
"(",
"String",
"inputLine",
")",
"{",
"if",
"(",
"null",
"==",
"inputLine",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"inputLine can't be null\"",
")",
";",
"String",
"[",
"]",
"values",
"=",
"inputLine",
... | Factory method to create a RemoteCommand from a wiki-style input string
@param inputLine wiki-style input string
@return RemoteCommand | [
"Factory",
"method",
"to",
"create",
"a",
"RemoteCommand",
"from",
"a",
"wiki",
"-",
"style",
"input",
"string"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/DefaultRemoteCommand.java#L74-L82 |
124,843 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java | SelfRegisteringRemote.addBrowser | public void addBrowser(DesiredCapabilities cap, int instances) {
String s = cap.getBrowserName();
if (s == null || "".equals(s)) {
throw new InvalidParameterException(cap + " does seems to be a valid browser.");
}
if (cap.getPlatform() == null) {
cap.setPlatform(Platform.getCurrent());
}... | java | public void addBrowser(DesiredCapabilities cap, int instances) {
String s = cap.getBrowserName();
if (s == null || "".equals(s)) {
throw new InvalidParameterException(cap + " does seems to be a valid browser.");
}
if (cap.getPlatform() == null) {
cap.setPlatform(Platform.getCurrent());
}... | [
"public",
"void",
"addBrowser",
"(",
"DesiredCapabilities",
"cap",
",",
"int",
"instances",
")",
"{",
"String",
"s",
"=",
"cap",
".",
"getBrowserName",
"(",
")",
";",
"if",
"(",
"s",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"s",
")",
")",
"{",... | Adding the browser described by the capability, automatically finding out what platform the
node is launched from
@param cap describing the browser
@param instances number of times this browser can be started on the node. | [
"Adding",
"the",
"browser",
"described",
"by",
"the",
"capability",
"automatically",
"finding",
"out",
"what",
"platform",
"the",
"node",
"is",
"launched",
"from"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java#L139-L150 |
124,844 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java | SelfRegisteringRemote.getHubConfiguration | private GridHubConfiguration getHubConfiguration() throws Exception {
String hubApi =
"http://" + registrationRequest.getConfiguration().getHubHost() + ":"
+ registrationRequest.getConfiguration().getHubPort() + "/grid/api/hub";
URL api = new URL(hubApi);
HttpClient client = httpClientFacto... | java | private GridHubConfiguration getHubConfiguration() throws Exception {
String hubApi =
"http://" + registrationRequest.getConfiguration().getHubHost() + ":"
+ registrationRequest.getConfiguration().getHubPort() + "/grid/api/hub";
URL api = new URL(hubApi);
HttpClient client = httpClientFacto... | [
"private",
"GridHubConfiguration",
"getHubConfiguration",
"(",
")",
"throws",
"Exception",
"{",
"String",
"hubApi",
"=",
"\"http://\"",
"+",
"registrationRequest",
".",
"getConfiguration",
"(",
")",
".",
"getHubHost",
"(",
")",
"+",
"\":\"",
"+",
"registrationReques... | uses the hub API to get some of its configuration.
@return json object of the current hub configuration | [
"uses",
"the",
"hub",
"API",
"to",
"get",
"some",
"of",
"its",
"configuration",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java#L359-L374 |
124,845 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/rest/Responses.java | Responses.success | public static Response success(SessionId sessionId, Object value) {
Response response = new Response();
response.setSessionId(sessionId != null ? sessionId.toString() : null);
response.setValue(value);
response.setStatus(ErrorCodes.SUCCESS);
response.setState(ErrorCodes.SUCCESS_STRING);
return r... | java | public static Response success(SessionId sessionId, Object value) {
Response response = new Response();
response.setSessionId(sessionId != null ? sessionId.toString() : null);
response.setValue(value);
response.setStatus(ErrorCodes.SUCCESS);
response.setState(ErrorCodes.SUCCESS_STRING);
return r... | [
"public",
"static",
"Response",
"success",
"(",
"SessionId",
"sessionId",
",",
"Object",
"value",
")",
"{",
"Response",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"response",
".",
"setSessionId",
"(",
"sessionId",
"!=",
"null",
"?",
"sessionId",
".",... | Creates a response object for a successful command execution.
@param sessionId ID of the session that executed the command.
@param value the command result value.
@return the new response object. | [
"Creates",
"a",
"response",
"object",
"for",
"a",
"successful",
"command",
"execution",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/rest/Responses.java#L46-L53 |
124,846 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java | SessionLogsToFileRepository.createLogFileAndAddToMap | public void createLogFileAndAddToMap(SessionId sessionId) throws IOException {
File rcLogFile;
// create logFile;
rcLogFile = File.createTempFile(sessionId.toString(), ".rclog");
rcLogFile.deleteOnExit();
LogFile logFile = new LogFile(rcLogFile.getAbsolutePath());
sessionToLogFileMap.put(session... | java | public void createLogFileAndAddToMap(SessionId sessionId) throws IOException {
File rcLogFile;
// create logFile;
rcLogFile = File.createTempFile(sessionId.toString(), ".rclog");
rcLogFile.deleteOnExit();
LogFile logFile = new LogFile(rcLogFile.getAbsolutePath());
sessionToLogFileMap.put(session... | [
"public",
"void",
"createLogFileAndAddToMap",
"(",
"SessionId",
"sessionId",
")",
"throws",
"IOException",
"{",
"File",
"rcLogFile",
";",
"// create logFile;",
"rcLogFile",
"=",
"File",
".",
"createTempFile",
"(",
"sessionId",
".",
"toString",
"(",
")",
",",
"\".r... | This creates log file object which represents logs in file form. This opens ObjectOutputStream
which is used to write logRecords to log file and opens a ObjectInputStream which is used to
read logRecords from the file.
@param sessionId session-id for the log file entry needs to be created.
@throws IOException file i/o... | [
"This",
"creates",
"log",
"file",
"object",
"which",
"represents",
"logs",
"in",
"file",
"form",
".",
"This",
"opens",
"ObjectOutputStream",
"which",
"is",
"used",
"to",
"write",
"logRecords",
"to",
"log",
"file",
"and",
"opens",
"a",
"ObjectInputStream",
"whi... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java#L49-L56 |
124,847 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java | DefaultGridRegistry.assignRequestToProxy | private void assignRequestToProxy() {
while (!stop) {
try {
testSessionAvailable.await(5, TimeUnit.SECONDS);
newSessionQueue.processQueue(
this::takeRequestHandler,
getHub().getConfiguration().prioritizer);
// Just make sure we delete anything that is logged on... | java | private void assignRequestToProxy() {
while (!stop) {
try {
testSessionAvailable.await(5, TimeUnit.SECONDS);
newSessionQueue.processQueue(
this::takeRequestHandler,
getHub().getConfiguration().prioritizer);
// Just make sure we delete anything that is logged on... | [
"private",
"void",
"assignRequestToProxy",
"(",
")",
"{",
"while",
"(",
"!",
"stop",
")",
"{",
"try",
"{",
"testSessionAvailable",
".",
"await",
"(",
"5",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",
"newSessionQueue",
".",
"processQueue",
"(",
"this",
"::",... | iterates the list of incoming session request to find a potential match in the list of proxies.
If something changes in the registry, the matcher iteration is stopped to account for that
change. | [
"iterates",
"the",
"list",
"of",
"incoming",
"session",
"request",
"to",
"find",
"a",
"potential",
"match",
"in",
"the",
"list",
"of",
"proxies",
".",
"If",
"something",
"changes",
"in",
"the",
"registry",
"the",
"matcher",
"iteration",
"is",
"stopped",
"to"... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java#L238-L255 |
124,848 | SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java | DefaultGridRegistry.release | private void release(TestSession session, SessionTerminationReason reason) {
try {
lock.lock();
boolean removed = activeTestSessions.remove(session, reason);
if (removed) {
fireMatcherStateChanged();
}
} finally {
lock.unlock();
}
} | java | private void release(TestSession session, SessionTerminationReason reason) {
try {
lock.lock();
boolean removed = activeTestSessions.remove(session, reason);
if (removed) {
fireMatcherStateChanged();
}
} finally {
lock.unlock();
}
} | [
"private",
"void",
"release",
"(",
"TestSession",
"session",
",",
"SessionTerminationReason",
"reason",
")",
"{",
"try",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"boolean",
"removed",
"=",
"activeTestSessions",
".",
"remove",
"(",
"session",
",",
"reason",
"... | mark the session as finished for the registry. The resources that were associated to it are now
free to be reserved by other tests
@param session The session
@param reason the reason for the release | [
"mark",
"the",
"session",
"as",
"finished",
"for",
"the",
"registry",
".",
"The",
"resources",
"that",
"were",
"associated",
"to",
"it",
"are",
"now",
"free",
"to",
"be",
"reserved",
"by",
"other",
"tests"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java#L274-L284 |
124,849 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java | FirefoxBinary.locateFirefoxBinaryFromSystemProperty | private static Executable locateFirefoxBinaryFromSystemProperty() {
String binaryName = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_BINARY);
if (binaryName == null)
return null;
File binary = new File(binaryName);
if (binary.exists() && !binary.isDirectory())
return new Executab... | java | private static Executable locateFirefoxBinaryFromSystemProperty() {
String binaryName = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_BINARY);
if (binaryName == null)
return null;
File binary = new File(binaryName);
if (binary.exists() && !binary.isDirectory())
return new Executab... | [
"private",
"static",
"Executable",
"locateFirefoxBinaryFromSystemProperty",
"(",
")",
"{",
"String",
"binaryName",
"=",
"System",
".",
"getProperty",
"(",
"FirefoxDriver",
".",
"SystemProperty",
".",
"BROWSER_BINARY",
")",
";",
"if",
"(",
"binaryName",
"==",
"null",... | Locates the firefox binary from a system property. Will throw an exception if the binary cannot
be found. | [
"Locates",
"the",
"firefox",
"binary",
"from",
"a",
"system",
"property",
".",
"Will",
"throw",
"an",
"exception",
"if",
"the",
"binary",
"cannot",
"be",
"found",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java#L166-L195 |
124,850 | SeleniumHQ/selenium | java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java | FirefoxBinary.locateFirefoxBinariesFromPlatform | private static Stream<Executable> locateFirefoxBinariesFromPlatform() {
ImmutableList.Builder<Executable> executables = new ImmutableList.Builder<>();
Platform current = Platform.getCurrent();
if (current.is(WINDOWS)) {
executables.addAll(Stream.of("Mozilla Firefox\\firefox.exe",
... | java | private static Stream<Executable> locateFirefoxBinariesFromPlatform() {
ImmutableList.Builder<Executable> executables = new ImmutableList.Builder<>();
Platform current = Platform.getCurrent();
if (current.is(WINDOWS)) {
executables.addAll(Stream.of("Mozilla Firefox\\firefox.exe",
... | [
"private",
"static",
"Stream",
"<",
"Executable",
">",
"locateFirefoxBinariesFromPlatform",
"(",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"Executable",
">",
"executables",
"=",
"new",
"ImmutableList",
".",
"Builder",
"<>",
"(",
")",
";",
"Platform",
"curr... | Locates the firefox binary by platform. | [
"Locates",
"the",
"firefox",
"binary",
"by",
"platform",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java#L200-L258 |
124,851 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.removeSessionLogs | public synchronized void removeSessionLogs(SessionId sessionId) {
if (storeLogsOnSessionQuit) {
return;
}
ThreadKey threadId = sessionToThreadMap.get(sessionId);
SessionId sessionIdForThread = threadToSessionMap.get(threadId);
if (threadId != null && sessionIdForThread != null && sessionIdForT... | java | public synchronized void removeSessionLogs(SessionId sessionId) {
if (storeLogsOnSessionQuit) {
return;
}
ThreadKey threadId = sessionToThreadMap.get(sessionId);
SessionId sessionIdForThread = threadToSessionMap.get(threadId);
if (threadId != null && sessionIdForThread != null && sessionIdForT... | [
"public",
"synchronized",
"void",
"removeSessionLogs",
"(",
"SessionId",
"sessionId",
")",
"{",
"if",
"(",
"storeLogsOnSessionQuit",
")",
"{",
"return",
";",
"}",
"ThreadKey",
"threadId",
"=",
"sessionToThreadMap",
".",
"get",
"(",
"sessionId",
")",
";",
"Sessio... | Removes session logs for the given session id.
NB! If the handler has been configured to capture logs on quit no logs will be removed.
@param sessionId The session id to use. | [
"Removes",
"session",
"logs",
"for",
"the",
"given",
"session",
"id",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L132-L144 |
124,852 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.getLog | public synchronized String getLog(SessionId sessionId) throws IOException {
// TODO(chandra): Provide option to clear logs after getLog()
String logs = formattedRecords(sessionId);
logs = "\n<RC_Logs RC_Session_ID=" + sessionId + ">\n" + logs
+ "\n</RC_Logs>\n";
return logs;
} | java | public synchronized String getLog(SessionId sessionId) throws IOException {
// TODO(chandra): Provide option to clear logs after getLog()
String logs = formattedRecords(sessionId);
logs = "\n<RC_Logs RC_Session_ID=" + sessionId + ">\n" + logs
+ "\n</RC_Logs>\n";
return logs;
} | [
"public",
"synchronized",
"String",
"getLog",
"(",
"SessionId",
"sessionId",
")",
"throws",
"IOException",
"{",
"// TODO(chandra): Provide option to clear logs after getLog()",
"String",
"logs",
"=",
"formattedRecords",
"(",
"sessionId",
")",
";",
"logs",
"=",
"\"\\n<RC_L... | This returns Selenium Remote Control logs associated with the sessionId.
@param sessionId session-id for which the RC logs will be returned.
@return String RC logs for the sessionId
@throws IOException when the elves go bad | [
"This",
"returns",
"Selenium",
"Remote",
"Control",
"logs",
"associated",
"with",
"the",
"sessionId",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L171-L177 |
124,853 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.getLoggedSessions | public synchronized List<SessionId> getLoggedSessions() {
// TODO: Find a solution that can handle large numbers of sessions, maybe by
// reading them from disc.
ImmutableList.Builder<SessionId> builder = new ImmutableList.Builder<>();
builder.addAll(perSessionDriverEntries.keySet());
return builder... | java | public synchronized List<SessionId> getLoggedSessions() {
// TODO: Find a solution that can handle large numbers of sessions, maybe by
// reading them from disc.
ImmutableList.Builder<SessionId> builder = new ImmutableList.Builder<>();
builder.addAll(perSessionDriverEntries.keySet());
return builder... | [
"public",
"synchronized",
"List",
"<",
"SessionId",
">",
"getLoggedSessions",
"(",
")",
"{",
"// TODO: Find a solution that can handle large numbers of sessions, maybe by",
"// reading them from disc.",
"ImmutableList",
".",
"Builder",
"<",
"SessionId",
">",
"builder",
"=",
"... | Returns a list of session IDs for which there are logs.
The type of logs that are available depends on the log types provided
by the driver. An included session id will at least have server logs.
@return The list of session IDs. | [
"Returns",
"a",
"list",
"of",
"session",
"IDs",
"for",
"which",
"there",
"are",
"logs",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L187-L193 |
124,854 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.getAllLogsForSession | public synchronized SessionLogs getAllLogsForSession(SessionId sessionId) {
SessionLogs sessionLogs = new SessionLogs();
if (perSessionDriverEntries.containsKey(sessionId)) {
Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId);
for (String logType : typeToEntriesMap.key... | java | public synchronized SessionLogs getAllLogsForSession(SessionId sessionId) {
SessionLogs sessionLogs = new SessionLogs();
if (perSessionDriverEntries.containsKey(sessionId)) {
Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId);
for (String logType : typeToEntriesMap.key... | [
"public",
"synchronized",
"SessionLogs",
"getAllLogsForSession",
"(",
"SessionId",
"sessionId",
")",
"{",
"SessionLogs",
"sessionLogs",
"=",
"new",
"SessionLogs",
"(",
")",
";",
"if",
"(",
"perSessionDriverEntries",
".",
"containsKey",
"(",
"sessionId",
")",
")",
... | Gets all logs for a session.
@param sessionId The id of the session.
@return The logs for the session, ordered after log types in a session logs object. | [
"Gets",
"all",
"logs",
"for",
"a",
"session",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L201-L211 |
124,855 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.getSessionLog | public synchronized LogEntries getSessionLog(SessionId sessionId) throws IOException {
List<LogEntry> entries = new ArrayList<>();
for (LogRecord record : records(sessionId)) {
if (record.getLevel().intValue() >= serverLogLevel.intValue())
entries.add(new LogEntry(record.getLevel(), record.getMill... | java | public synchronized LogEntries getSessionLog(SessionId sessionId) throws IOException {
List<LogEntry> entries = new ArrayList<>();
for (LogRecord record : records(sessionId)) {
if (record.getLevel().intValue() >= serverLogLevel.intValue())
entries.add(new LogEntry(record.getLevel(), record.getMill... | [
"public",
"synchronized",
"LogEntries",
"getSessionLog",
"(",
"SessionId",
"sessionId",
")",
"throws",
"IOException",
"{",
"List",
"<",
"LogEntry",
">",
"entries",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"LogRecord",
"record",
":",
"records",... | Returns the server log for the given session id.
@param sessionId The session id.
@return The available server log entries for the session.
@throws IOException If there was a problem reading from file. | [
"Returns",
"the",
"server",
"log",
"for",
"the",
"given",
"session",
"id",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L220-L227 |
124,856 | SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.fetchAndStoreLogsFromDriver | public synchronized void fetchAndStoreLogsFromDriver(SessionId sessionId, WebDriver driver)
throws IOException {
if (!perSessionDriverEntries.containsKey(sessionId)) {
perSessionDriverEntries.put(sessionId, new HashMap<>());
}
Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(... | java | public synchronized void fetchAndStoreLogsFromDriver(SessionId sessionId, WebDriver driver)
throws IOException {
if (!perSessionDriverEntries.containsKey(sessionId)) {
perSessionDriverEntries.put(sessionId, new HashMap<>());
}
Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(... | [
"public",
"synchronized",
"void",
"fetchAndStoreLogsFromDriver",
"(",
"SessionId",
"sessionId",
",",
"WebDriver",
"driver",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"perSessionDriverEntries",
".",
"containsKey",
"(",
"sessionId",
")",
")",
"{",
"perSession... | Fetches and stores available logs from the given session and driver.
@param sessionId The id of the session.
@param driver The driver to get the logs from.
@throws IOException If there was a problem reading from file. | [
"Fetches",
"and",
"stores",
"available",
"logs",
"from",
"the",
"given",
"session",
"and",
"driver",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L236-L249 |
124,857 | redisson/redisson | redisson/src/main/java/org/redisson/misc/HighwayHash.java | HighwayHash.update | public void update(long a0, long a1, long a2, long a3) {
if (done) {
throw new IllegalStateException("Can compute a hash only once per instance");
}
v1[0] += mul0[0] + a0;
v1[1] += mul0[1] + a1;
v1[2] += mul0[2] + a2;
v1[3] += mul0[3] + a3;
for (int i = 0; i < 4; ++i) {
mul0[i] ^... | java | public void update(long a0, long a1, long a2, long a3) {
if (done) {
throw new IllegalStateException("Can compute a hash only once per instance");
}
v1[0] += mul0[0] + a0;
v1[1] += mul0[1] + a1;
v1[2] += mul0[2] + a2;
v1[3] += mul0[3] + a3;
for (int i = 0; i < 4; ++i) {
mul0[i] ^... | [
"public",
"void",
"update",
"(",
"long",
"a0",
",",
"long",
"a1",
",",
"long",
"a2",
",",
"long",
"a3",
")",
"{",
"if",
"(",
"done",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Can compute a hash only once per instance\"",
")",
";",
"}",
"v1... | Updates the hash with 32 bytes of data given as 4 longs. This function is
more efficient than updatePacket when you can use it.
@param a0 first 8 bytes in little endian 64-bit long
@param a1 next 8 bytes in little endian 64-bit long
@param a2 next 8 bytes in little endian 64-bit long
@param a3 last 8 bytes in little en... | [
"Updates",
"the",
"hash",
"with",
"32",
"bytes",
"of",
"data",
"given",
"as",
"4",
"longs",
".",
"This",
"function",
"is",
"more",
"efficient",
"than",
"updatePacket",
"when",
"you",
"can",
"use",
"it",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L78-L99 |
124,858 | redisson/redisson | redisson/src/main/java/org/redisson/misc/HighwayHash.java | HighwayHash.updateRemainder | public void updateRemainder(byte[] bytes, int pos, int size_mod32) {
if (pos < 0) {
throw new IllegalArgumentException(String.format("Pos (%s) must be positive", pos));
}
if (size_mod32 < 0 || size_mod32 >= 32) {
throw new IllegalArgumentException(
String.format("size_mod32 (%s) must b... | java | public void updateRemainder(byte[] bytes, int pos, int size_mod32) {
if (pos < 0) {
throw new IllegalArgumentException(String.format("Pos (%s) must be positive", pos));
}
if (size_mod32 < 0 || size_mod32 >= 32) {
throw new IllegalArgumentException(
String.format("size_mod32 (%s) must b... | [
"public",
"void",
"updateRemainder",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"pos",
",",
"int",
"size_mod32",
")",
"{",
"if",
"(",
"pos",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Pos (%s) m... | Updates the hash with the last 1 to 31 bytes of the data. You must use
updatePacket first per 32 bytes of the data, if and only if 1 to 31 bytes
of the data are not processed after that, updateRemainder must be used for
those final bytes.
@param bytes data array which has a length of at least pos + size_mod32
@param po... | [
"Updates",
"the",
"hash",
"with",
"the",
"last",
"1",
"to",
"31",
"bytes",
"of",
"the",
"data",
".",
"You",
"must",
"use",
"updatePacket",
"first",
"per",
"32",
"bytes",
"of",
"the",
"data",
"if",
"and",
"only",
"if",
"1",
"to",
"31",
"bytes",
"of",
... | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L111-L144 |
124,859 | redisson/redisson | redisson-hibernate/redisson-hibernate-5/src/main/java/org/redisson/hibernate/strategy/AbstractReadWriteAccessStrategy.java | AbstractReadWriteAccessStrategy.decrementLock | protected void decrementLock(SessionImplementor session, Object key, Lock lock) {
lock.unlock(region.nextTimestamp());
region.put(session, key, lock);
} | java | protected void decrementLock(SessionImplementor session, Object key, Lock lock) {
lock.unlock(region.nextTimestamp());
region.put(session, key, lock);
} | [
"protected",
"void",
"decrementLock",
"(",
"SessionImplementor",
"session",
",",
"Object",
"key",
",",
"Lock",
"lock",
")",
"{",
"lock",
".",
"unlock",
"(",
"region",
".",
"nextTimestamp",
"(",
")",
")",
";",
"region",
".",
"put",
"(",
"session",
",",
"k... | Unlock and re-put the given key, lock combination. | [
"Unlock",
"and",
"re",
"-",
"put",
"the",
"given",
"key",
"lock",
"combination",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson-hibernate/redisson-hibernate-5/src/main/java/org/redisson/hibernate/strategy/AbstractReadWriteAccessStrategy.java#L149-L152 |
124,860 | redisson/redisson | redisson/src/main/java/org/redisson/spring/cache/RedissonSpringCacheManager.java | RedissonSpringCacheManager.setConfig | public void setConfig(Map<String, ? extends CacheConfig> config) {
this.configMap = (Map<String, CacheConfig>) config;
} | java | public void setConfig(Map<String, ? extends CacheConfig> config) {
this.configMap = (Map<String, CacheConfig>) config;
} | [
"public",
"void",
"setConfig",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"CacheConfig",
">",
"config",
")",
"{",
"this",
".",
"configMap",
"=",
"(",
"Map",
"<",
"String",
",",
"CacheConfig",
">",
")",
"config",
";",
"}"
] | Set cache config mapped by cache name
@param config object | [
"Set",
"cache",
"config",
"mapped",
"by",
"cache",
"name"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/spring/cache/RedissonSpringCacheManager.java#L175-L177 |
124,861 | redisson/redisson | redisson/src/main/java/org/redisson/spring/cache/RedissonCacheMetrics.java | RedissonCacheMetrics.monitor | public static RedissonCache monitor(MeterRegistry registry, RedissonCache cache, Iterable<Tag> tags) {
new RedissonCacheMetrics(cache, tags).bindTo(registry);
return cache;
} | java | public static RedissonCache monitor(MeterRegistry registry, RedissonCache cache, Iterable<Tag> tags) {
new RedissonCacheMetrics(cache, tags).bindTo(registry);
return cache;
} | [
"public",
"static",
"RedissonCache",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"RedissonCache",
"cache",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"new",
"RedissonCacheMetrics",
"(",
"cache",
",",
"tags",
")",
".",
"bindTo",
"(",
"registry",
... | Record metrics on a Redisson cache.
@param registry - registry to bind metrics to
@param cache - cache to instrument
@param tags - tags to apply to all recorded metrics
@return cache | [
"Record",
"metrics",
"on",
"a",
"Redisson",
"cache",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/spring/cache/RedissonCacheMetrics.java#L44-L47 |
124,862 | redisson/redisson | redisson/src/main/java/org/redisson/executor/TasksRunnerService.java | TasksRunnerService.asyncScheduledServiceAtFixed | private RemoteExecutorServiceAsync asyncScheduledServiceAtFixed(String executorId, String requestId) {
ScheduledTasksService scheduledRemoteService = new ScheduledTasksService(codec, name, commandExecutor, executorId, responses);
scheduledRemoteService.setTerminationTopicName(terminationTopicName);
... | java | private RemoteExecutorServiceAsync asyncScheduledServiceAtFixed(String executorId, String requestId) {
ScheduledTasksService scheduledRemoteService = new ScheduledTasksService(codec, name, commandExecutor, executorId, responses);
scheduledRemoteService.setTerminationTopicName(terminationTopicName);
... | [
"private",
"RemoteExecutorServiceAsync",
"asyncScheduledServiceAtFixed",
"(",
"String",
"executorId",
",",
"String",
"requestId",
")",
"{",
"ScheduledTasksService",
"scheduledRemoteService",
"=",
"new",
"ScheduledTasksService",
"(",
"codec",
",",
"name",
",",
"commandExecut... | Creates RemoteExecutorServiceAsync with special executor which overrides requestId generation
and uses current requestId. Because recurring tasks should use the same requestId.
@return | [
"Creates",
"RemoteExecutorServiceAsync",
"with",
"special",
"executor",
"which",
"overrides",
"requestId",
"generation",
"and",
"uses",
"current",
"requestId",
".",
"Because",
"recurring",
"tasks",
"should",
"use",
"the",
"same",
"requestId",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java#L163-L175 |
124,863 | redisson/redisson | redisson/src/main/java/org/redisson/spring/cache/CacheConfig.java | CacheConfig.toJSON | public static String toJSON(Map<String, ? extends CacheConfig> config) throws IOException {
return new CacheConfigSupport().toJSON(config);
} | java | public static String toJSON(Map<String, ? extends CacheConfig> config) throws IOException {
return new CacheConfigSupport().toJSON(config);
} | [
"public",
"static",
"String",
"toJSON",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"CacheConfig",
">",
"config",
")",
"throws",
"IOException",
"{",
"return",
"new",
"CacheConfigSupport",
"(",
")",
".",
"toJSON",
"(",
"config",
")",
";",
"}"
] | Convert current configuration to JSON format
@param config object
@return json string
@throws IOException error | [
"Convert",
"current",
"configuration",
"to",
"JSON",
"format"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/spring/cache/CacheConfig.java#L168-L170 |
124,864 | redisson/redisson | redisson/src/main/java/org/redisson/spring/cache/CacheConfig.java | CacheConfig.toYAML | public static String toYAML(Map<String, ? extends CacheConfig> config) throws IOException {
return new CacheConfigSupport().toYAML(config);
} | java | public static String toYAML(Map<String, ? extends CacheConfig> config) throws IOException {
return new CacheConfigSupport().toYAML(config);
} | [
"public",
"static",
"String",
"toYAML",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"CacheConfig",
">",
"config",
")",
"throws",
"IOException",
"{",
"return",
"new",
"CacheConfigSupport",
"(",
")",
".",
"toYAML",
"(",
"config",
")",
";",
"}"
] | Convert current configuration to YAML format
@param config map
@return yaml string
@throws IOException error | [
"Convert",
"current",
"configuration",
"to",
"YAML",
"format"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/spring/cache/CacheConfig.java#L234-L236 |
124,865 | redisson/redisson | redisson/src/main/java/org/redisson/api/CronSchedule.java | CronSchedule.dailyAtHourAndMinute | public static CronSchedule dailyAtHourAndMinute(int hour, int minute) {
String expression = String.format("0 %d %d ? * *", minute, hour);
return of(expression);
} | java | public static CronSchedule dailyAtHourAndMinute(int hour, int minute) {
String expression = String.format("0 %d %d ? * *", minute, hour);
return of(expression);
} | [
"public",
"static",
"CronSchedule",
"dailyAtHourAndMinute",
"(",
"int",
"hour",
",",
"int",
"minute",
")",
"{",
"String",
"expression",
"=",
"String",
".",
"format",
"(",
"\"0 %d %d ? * *\"",
",",
"minute",
",",
"hour",
")",
";",
"return",
"of",
"(",
"expres... | Creates cron expression which schedule task execution
every day at the given time
@param hour of schedule
@param minute of schedule
@return object
@throws IllegalArgumentException
wrapping a ParseException if the expression is invalid | [
"Creates",
"cron",
"expression",
"which",
"schedule",
"task",
"execution",
"every",
"day",
"at",
"the",
"given",
"time"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/CronSchedule.java#L60-L63 |
124,866 | redisson/redisson | redisson/src/main/java/org/redisson/api/CronSchedule.java | CronSchedule.weeklyOnDayAndHourAndMinute | public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek) {
if (daysOfWeek == null || daysOfWeek.length == 0) {
throw new IllegalArgumentException("You must specify at least one day of week.");
}
String expression = String.format("0 %d %d ? ... | java | public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek) {
if (daysOfWeek == null || daysOfWeek.length == 0) {
throw new IllegalArgumentException("You must specify at least one day of week.");
}
String expression = String.format("0 %d %d ? ... | [
"public",
"static",
"CronSchedule",
"weeklyOnDayAndHourAndMinute",
"(",
"int",
"hour",
",",
"int",
"minute",
",",
"Integer",
"...",
"daysOfWeek",
")",
"{",
"if",
"(",
"daysOfWeek",
"==",
"null",
"||",
"daysOfWeek",
".",
"length",
"==",
"0",
")",
"{",
"throw"... | Creates cron expression which schedule task execution
every given days of the week at the given time.
Use Calendar object constants to define day.
@param hour of schedule
@param minute of schedule
@param daysOfWeek - Calendar object constants
@return object | [
"Creates",
"cron",
"expression",
"which",
"schedule",
"task",
"execution",
"every",
"given",
"days",
"of",
"the",
"week",
"at",
"the",
"given",
"time",
".",
"Use",
"Calendar",
"object",
"constants",
"to",
"define",
"day",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/CronSchedule.java#L75-L86 |
124,867 | redisson/redisson | redisson/src/main/java/org/redisson/api/CronSchedule.java | CronSchedule.monthlyOnDayAndHourAndMinute | public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute) {
String expression = String.format("0 %d %d %d * ?", minute, hour, dayOfMonth);
return of(expression);
} | java | public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute) {
String expression = String.format("0 %d %d %d * ?", minute, hour, dayOfMonth);
return of(expression);
} | [
"public",
"static",
"CronSchedule",
"monthlyOnDayAndHourAndMinute",
"(",
"int",
"dayOfMonth",
",",
"int",
"hour",
",",
"int",
"minute",
")",
"{",
"String",
"expression",
"=",
"String",
".",
"format",
"(",
"\"0 %d %d %d * ?\"",
",",
"minute",
",",
"hour",
",",
... | Creates cron expression which schedule task execution
every given day of the month at the given time
@param hour of schedule
@param minute of schedule
@param dayOfMonth of schedule
@return object | [
"Creates",
"cron",
"expression",
"which",
"schedule",
"task",
"execution",
"every",
"given",
"day",
"of",
"the",
"month",
"at",
"the",
"given",
"time"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/CronSchedule.java#L97-L100 |
124,868 | redisson/redisson | redisson/src/main/java/org/redisson/api/LocalCachedMapOptions.java | LocalCachedMapOptions.evictionPolicy | public LocalCachedMapOptions<K, V> evictionPolicy(EvictionPolicy evictionPolicy) {
if (evictionPolicy == null) {
throw new NullPointerException("evictionPolicy can't be null");
}
this.evictionPolicy = evictionPolicy;
return this;
} | java | public LocalCachedMapOptions<K, V> evictionPolicy(EvictionPolicy evictionPolicy) {
if (evictionPolicy == null) {
throw new NullPointerException("evictionPolicy can't be null");
}
this.evictionPolicy = evictionPolicy;
return this;
} | [
"public",
"LocalCachedMapOptions",
"<",
"K",
",",
"V",
">",
"evictionPolicy",
"(",
"EvictionPolicy",
"evictionPolicy",
")",
"{",
"if",
"(",
"evictionPolicy",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"evictionPolicy can't be null\"",
")"... | Sets eviction policy.
@param evictionPolicy
<p><code>LRU</code> - uses local cache with LRU (least recently used) eviction policy.
<p><code>LFU</code> - uses local cache with LFU (least frequently used) eviction policy.
<p><code>SOFT</code> - uses local cache with soft references. The garbage collector will evict item... | [
"Sets",
"eviction",
"policy",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/LocalCachedMapOptions.java#L216-L222 |
124,869 | redisson/redisson | redisson/src/main/java/org/redisson/misc/InfinitySemaphoreLatch.java | InfinitySemaphoreLatch.awaitUninterruptibly | public final boolean awaitUninterruptibly() {
try {
return await(15, TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return false;
}
} | java | public final boolean awaitUninterruptibly() {
try {
return await(15, TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return false;
}
} | [
"public",
"final",
"boolean",
"awaitUninterruptibly",
"(",
")",
"{",
"try",
"{",
"return",
"await",
"(",
"15",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread",
".",
"currentThread",
"(",
")",
... | waiting for an open state | [
"waiting",
"for",
"an",
"open",
"state"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/InfinitySemaphoreLatch.java#L92-L99 |
124,870 | redisson/redisson | redisson-hibernate/redisson-hibernate-52/src/main/java/org/redisson/hibernate/strategy/AbstractReadWriteAccessStrategy.java | AbstractReadWriteAccessStrategy.handleLockExpiry | protected void handleLockExpiry(SharedSessionContractImplementor session, Object key, Lockable lock) {
long ts = region.nextTimestamp() + region.getTimeout();
// create new lock that times out immediately
Lock newLock = new Lock(ts, uuid, nextLockId.getAndIncrement(), null);
newLock.unlo... | java | protected void handleLockExpiry(SharedSessionContractImplementor session, Object key, Lockable lock) {
long ts = region.nextTimestamp() + region.getTimeout();
// create new lock that times out immediately
Lock newLock = new Lock(ts, uuid, nextLockId.getAndIncrement(), null);
newLock.unlo... | [
"protected",
"void",
"handleLockExpiry",
"(",
"SharedSessionContractImplementor",
"session",
",",
"Object",
"key",
",",
"Lockable",
"lock",
")",
"{",
"long",
"ts",
"=",
"region",
".",
"nextTimestamp",
"(",
")",
"+",
"region",
".",
"getTimeout",
"(",
")",
";",
... | Handle the timeout of a previous lock mapped to this key | [
"Handle",
"the",
"timeout",
"of",
"a",
"previous",
"lock",
"mapped",
"to",
"this",
"key"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson-hibernate/redisson-hibernate-52/src/main/java/org/redisson/hibernate/strategy/AbstractReadWriteAccessStrategy.java#L157-L163 |
124,871 | redisson/redisson | redisson/src/main/java/org/redisson/RedissonNode.java | RedissonNode.start | public void start() {
if (hasRedissonInstance) {
redisson = Redisson.create(config);
}
retrieveAddresses();
if (config.getRedissonNodeInitializer() != null) {
config.getRedissonNodeInitializer().onStartup(this);
}
int map... | java | public void start() {
if (hasRedissonInstance) {
redisson = Redisson.create(config);
}
retrieveAddresses();
if (config.getRedissonNodeInitializer() != null) {
config.getRedissonNodeInitializer().onStartup(this);
}
int map... | [
"public",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"hasRedissonInstance",
")",
"{",
"redisson",
"=",
"Redisson",
".",
"create",
"(",
"config",
")",
";",
"}",
"retrieveAddresses",
"(",
")",
";",
"if",
"(",
"config",
".",
"getRedissonNodeInitializer",
"(",... | Start Redisson node instance | [
"Start",
"Redisson",
"node",
"instance"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/RedissonNode.java#L126-L154 |
124,872 | apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/resultset/ResultSetUtil.java | ResultSetUtil.convertValue | public static Object convertValue(final Object value, final Class<?> convertType) {
if (null == value) {
return convertNullValue(convertType);
}
if (value.getClass() == convertType) {
return value;
}
if (value instanceof Number) {
return conve... | java | public static Object convertValue(final Object value, final Class<?> convertType) {
if (null == value) {
return convertNullValue(convertType);
}
if (value.getClass() == convertType) {
return value;
}
if (value instanceof Number) {
return conve... | [
"public",
"static",
"Object",
"convertValue",
"(",
"final",
"Object",
"value",
",",
"final",
"Class",
"<",
"?",
">",
"convertType",
")",
"{",
"if",
"(",
"null",
"==",
"value",
")",
"{",
"return",
"convertNullValue",
"(",
"convertType",
")",
";",
"}",
"if... | Convert value via expected class type.
@param value original value
@param convertType expected class type
@return converted value | [
"Convert",
"value",
"via",
"expected",
"class",
"type",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/resultset/ResultSetUtil.java#L44-L62 |
124,873 | apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistry.java | MySQLBinaryStatementRegistry.remove | public synchronized void remove(final int statementId) {
MySQLBinaryStatement binaryStatement = getBinaryStatement(statementId);
if (null != binaryStatement) {
statementIdAssigner.remove(binaryStatement.getSql());
binaryStatements.remove(statementId);
}
} | java | public synchronized void remove(final int statementId) {
MySQLBinaryStatement binaryStatement = getBinaryStatement(statementId);
if (null != binaryStatement) {
statementIdAssigner.remove(binaryStatement.getSql());
binaryStatements.remove(statementId);
}
} | [
"public",
"synchronized",
"void",
"remove",
"(",
"final",
"int",
"statementId",
")",
"{",
"MySQLBinaryStatement",
"binaryStatement",
"=",
"getBinaryStatement",
"(",
"statementId",
")",
";",
"if",
"(",
"null",
"!=",
"binaryStatement",
")",
"{",
"statementIdAssigner",... | Remove expired cache statement.
@param statementId statement ID | [
"Remove",
"expired",
"cache",
"statement",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistry.java#L87-L93 |
124,874 | apache/incubator-shardingsphere | sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/RegistryCenterServiceLoader.java | RegistryCenterServiceLoader.load | public RegistryCenter load(final RegistryCenterConfiguration regCenterConfig) {
Preconditions.checkNotNull(regCenterConfig, "Registry center configuration cannot be null.");
RegistryCenter result = newService(regCenterConfig.getType(), regCenterConfig.getProperties());
result.init(regCenterConfi... | java | public RegistryCenter load(final RegistryCenterConfiguration regCenterConfig) {
Preconditions.checkNotNull(regCenterConfig, "Registry center configuration cannot be null.");
RegistryCenter result = newService(regCenterConfig.getType(), regCenterConfig.getProperties());
result.init(regCenterConfi... | [
"public",
"RegistryCenter",
"load",
"(",
"final",
"RegistryCenterConfiguration",
"regCenterConfig",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"regCenterConfig",
",",
"\"Registry center configuration cannot be null.\"",
")",
";",
"RegistryCenter",
"result",
"=",
"... | Load registry center from SPI.
@param regCenterConfig registry center configuration
@return registry center | [
"Load",
"registry",
"center",
"from",
"SPI",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/RegistryCenterServiceLoader.java#L50-L55 |
124,875 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/util/SQLUtil.java | SQLUtil.getExactlyValue | public static String getExactlyValue(final String value) {
return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value);
} | java | public static String getExactlyValue(final String value) {
return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value);
} | [
"public",
"static",
"String",
"getExactlyValue",
"(",
"final",
"String",
"value",
")",
"{",
"return",
"null",
"==",
"value",
"?",
"null",
":",
"CharMatcher",
".",
"anyOf",
"(",
"\"[]`'\\\"\"",
")",
".",
"removeFrom",
"(",
"value",
")",
";",
"}"
] | Get exactly value for SQL expression.
<p>remove special char for SQL expression</p>
@param value SQL expression
@return exactly SQL expression | [
"Get",
"exactly",
"value",
"for",
"SQL",
"expression",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/util/SQLUtil.java#L44-L46 |
124,876 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/util/SQLUtil.java | SQLUtil.getExactlyExpression | public static String getExactlyExpression(final String value) {
return null == value ? null : CharMatcher.anyOf(" ").removeFrom(value);
} | java | public static String getExactlyExpression(final String value) {
return null == value ? null : CharMatcher.anyOf(" ").removeFrom(value);
} | [
"public",
"static",
"String",
"getExactlyExpression",
"(",
"final",
"String",
"value",
")",
"{",
"return",
"null",
"==",
"value",
"?",
"null",
":",
"CharMatcher",
".",
"anyOf",
"(",
"\" \"",
")",
".",
"removeFrom",
"(",
"value",
")",
";",
"}"
] | Get exactly SQL expression.
<p>remove space for SQL expression</p>
@param value SQL expression
@return exactly SQL expression | [
"Get",
"exactly",
"SQL",
"expression",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/util/SQLUtil.java#L56-L58 |
124,877 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/util/SQLUtil.java | SQLUtil.getOriginalValue | public static String getOriginalValue(final String value, final DatabaseType databaseType) {
if (DatabaseType.MySQL != databaseType) {
return value;
}
try {
DefaultKeyword.valueOf(value.toUpperCase());
return String.format("`%s`", value);
} catch (fina... | java | public static String getOriginalValue(final String value, final DatabaseType databaseType) {
if (DatabaseType.MySQL != databaseType) {
return value;
}
try {
DefaultKeyword.valueOf(value.toUpperCase());
return String.format("`%s`", value);
} catch (fina... | [
"public",
"static",
"String",
"getOriginalValue",
"(",
"final",
"String",
"value",
",",
"final",
"DatabaseType",
"databaseType",
")",
"{",
"if",
"(",
"DatabaseType",
".",
"MySQL",
"!=",
"databaseType",
")",
"{",
"return",
"value",
";",
"}",
"try",
"{",
"Defa... | Get original value for SQL expression.
@param value SQL expression
@param databaseType database type
@return original SQL expression | [
"Get",
"original",
"value",
"for",
"SQL",
"expression",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/util/SQLUtil.java#L67-L77 |
124,878 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.skipWhitespace | public int skipWhitespace() {
int length = 0;
while (CharType.isWhitespace(charAt(offset + length))) {
length++;
}
return offset + length;
} | java | public int skipWhitespace() {
int length = 0;
while (CharType.isWhitespace(charAt(offset + length))) {
length++;
}
return offset + length;
} | [
"public",
"int",
"skipWhitespace",
"(",
")",
"{",
"int",
"length",
"=",
"0",
";",
"while",
"(",
"CharType",
".",
"isWhitespace",
"(",
"charAt",
"(",
"offset",
"+",
"length",
")",
")",
")",
"{",
"length",
"++",
";",
"}",
"return",
"offset",
"+",
"leng... | skip whitespace.
@return offset after whitespace skipped | [
"skip",
"whitespace",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L56-L62 |
124,879 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.skipComment | public int skipComment() {
char current = charAt(offset);
char next = charAt(offset + 1);
if (isSingleLineCommentBegin(current, next)) {
return skipSingleLineComment(COMMENT_BEGIN_SYMBOL_LENGTH);
} else if ('#' == current) {
return skipSingleLineComment(MYSQL_SPEC... | java | public int skipComment() {
char current = charAt(offset);
char next = charAt(offset + 1);
if (isSingleLineCommentBegin(current, next)) {
return skipSingleLineComment(COMMENT_BEGIN_SYMBOL_LENGTH);
} else if ('#' == current) {
return skipSingleLineComment(MYSQL_SPEC... | [
"public",
"int",
"skipComment",
"(",
")",
"{",
"char",
"current",
"=",
"charAt",
"(",
"offset",
")",
";",
"char",
"next",
"=",
"charAt",
"(",
"offset",
"+",
"1",
")",
";",
"if",
"(",
"isSingleLineCommentBegin",
"(",
"current",
",",
"next",
")",
")",
... | skip comment.
@return offset after comment skipped | [
"skip",
"comment",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L69-L80 |
124,880 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.scanVariable | public Token scanVariable() {
int length = 1;
if ('@' == charAt(offset + 1)) {
length++;
}
while (isVariableChar(charAt(offset + length))) {
length++;
}
return new Token(Literals.VARIABLE, input.substring(offset, offset + length), offset + length);... | java | public Token scanVariable() {
int length = 1;
if ('@' == charAt(offset + 1)) {
length++;
}
while (isVariableChar(charAt(offset + length))) {
length++;
}
return new Token(Literals.VARIABLE, input.substring(offset, offset + length), offset + length);... | [
"public",
"Token",
"scanVariable",
"(",
")",
"{",
"int",
"length",
"=",
"1",
";",
"if",
"(",
"'",
"'",
"==",
"charAt",
"(",
"offset",
"+",
"1",
")",
")",
"{",
"length",
"++",
";",
"}",
"while",
"(",
"isVariableChar",
"(",
"charAt",
"(",
"offset",
... | scan variable.
@return variable token | [
"scan",
"variable",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L131-L140 |
124,881 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.scanIdentifier | public Token scanIdentifier() {
if ('`' == charAt(offset)) {
int length = getLengthUntilTerminatedChar('`');
return new Token(Literals.IDENTIFIER, input.substring(offset, offset + length), offset + length);
}
if ('"' == charAt(offset)) {
int length = getLength... | java | public Token scanIdentifier() {
if ('`' == charAt(offset)) {
int length = getLengthUntilTerminatedChar('`');
return new Token(Literals.IDENTIFIER, input.substring(offset, offset + length), offset + length);
}
if ('"' == charAt(offset)) {
int length = getLength... | [
"public",
"Token",
"scanIdentifier",
"(",
")",
"{",
"if",
"(",
"'",
"'",
"==",
"charAt",
"(",
"offset",
")",
")",
"{",
"int",
"length",
"=",
"getLengthUntilTerminatedChar",
"(",
"'",
"'",
")",
";",
"return",
"new",
"Token",
"(",
"Literals",
".",
"IDENT... | scan identifier.
@return identifier token | [
"scan",
"identifier",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L151-L173 |
124,882 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.scanHexDecimal | public Token scanHexDecimal() {
int length = HEX_BEGIN_SYMBOL_LENGTH;
if ('-' == charAt(offset + length)) {
length++;
}
while (isHex(charAt(offset + length))) {
length++;
}
return new Token(Literals.HEX, input.substring(offset, offset + length), of... | java | public Token scanHexDecimal() {
int length = HEX_BEGIN_SYMBOL_LENGTH;
if ('-' == charAt(offset + length)) {
length++;
}
while (isHex(charAt(offset + length))) {
length++;
}
return new Token(Literals.HEX, input.substring(offset, offset + length), of... | [
"public",
"Token",
"scanHexDecimal",
"(",
")",
"{",
"int",
"length",
"=",
"HEX_BEGIN_SYMBOL_LENGTH",
";",
"if",
"(",
"'",
"'",
"==",
"charAt",
"(",
"offset",
"+",
"length",
")",
")",
"{",
"length",
"++",
";",
"}",
"while",
"(",
"isHex",
"(",
"charAt",
... | scan hex decimal.
@return hex decimal token | [
"scan",
"hex",
"decimal",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L217-L226 |
124,883 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.scanNumber | public Token scanNumber() {
int length = 0;
if ('-' == charAt(offset + length)) {
length++;
}
length += getDigitalLength(offset + length);
boolean isFloat = false;
if ('.' == charAt(offset + length)) {
isFloat = true;
length++;
... | java | public Token scanNumber() {
int length = 0;
if ('-' == charAt(offset + length)) {
length++;
}
length += getDigitalLength(offset + length);
boolean isFloat = false;
if ('.' == charAt(offset + length)) {
isFloat = true;
length++;
... | [
"public",
"Token",
"scanNumber",
"(",
")",
"{",
"int",
"length",
"=",
"0",
";",
"if",
"(",
"'",
"'",
"==",
"charAt",
"(",
"offset",
"+",
"length",
")",
")",
"{",
"length",
"++",
";",
"}",
"length",
"+=",
"getDigitalLength",
"(",
"offset",
"+",
"len... | scan number.
@return number token | [
"scan",
"number",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L237-L262 |
124,884 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java | Tokenizer.scanSymbol | public Token scanSymbol() {
int length = 0;
while (CharType.isSymbol(charAt(offset + length))) {
length++;
}
String literals = input.substring(offset, offset + length);
Symbol symbol;
while (null == (symbol = Symbol.literalsOf(literals))) {
literal... | java | public Token scanSymbol() {
int length = 0;
while (CharType.isSymbol(charAt(offset + length))) {
length++;
}
String literals = input.substring(offset, offset + length);
Symbol symbol;
while (null == (symbol = Symbol.literalsOf(literals))) {
literal... | [
"public",
"Token",
"scanSymbol",
"(",
")",
"{",
"int",
"length",
"=",
"0",
";",
"while",
"(",
"CharType",
".",
"isSymbol",
"(",
"charAt",
"(",
"offset",
"+",
"length",
")",
")",
")",
"{",
"length",
"++",
";",
"}",
"String",
"literals",
"=",
"input",
... | scan symbol.
@return symbol token | [
"scan",
"symbol",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/analyzer/Tokenizer.java#L301-L312 |
124,885 | apache/incubator-shardingsphere | sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/swapper/DataSourcePropertyProviderLoader.java | DataSourcePropertyProviderLoader.getProvider | public static DataSourcePropertyProvider getProvider(final DataSource dataSource) {
String dataSourceClassName = dataSource.getClass().getName();
return DATA_SOURCE_PROPERTY_PROVIDERS.containsKey(dataSourceClassName) ? DATA_SOURCE_PROPERTY_PROVIDERS.get(dataSourceClassName) : new DefaultDataSourceProper... | java | public static DataSourcePropertyProvider getProvider(final DataSource dataSource) {
String dataSourceClassName = dataSource.getClass().getName();
return DATA_SOURCE_PROPERTY_PROVIDERS.containsKey(dataSourceClassName) ? DATA_SOURCE_PROPERTY_PROVIDERS.get(dataSourceClassName) : new DefaultDataSourceProper... | [
"public",
"static",
"DataSourcePropertyProvider",
"getProvider",
"(",
"final",
"DataSource",
"dataSource",
")",
"{",
"String",
"dataSourceClassName",
"=",
"dataSource",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"return",
"DATA_SOURCE_PROPERTY_PROVIDERS... | Get data source property provider.
@param dataSource data source
@return data source property provider | [
"Get",
"data",
"source",
"property",
"provider",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/swapper/DataSourcePropertyProviderLoader.java#L48-L51 |
124,886 | apache/incubator-shardingsphere | sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/spring/boot/util/DataSourceUtil.java | DataSourceUtil.getDataSource | public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties) throws ReflectiveOperationException {
DataSource result = (DataSource) Class.forName(dataSourceClassName).newInstance();
for (Entry<String, Object> entry : dataSourceProperties.entryS... | java | public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties) throws ReflectiveOperationException {
DataSource result = (DataSource) Class.forName(dataSourceClassName).newInstance();
for (Entry<String, Object> entry : dataSourceProperties.entryS... | [
"public",
"static",
"DataSource",
"getDataSource",
"(",
"final",
"String",
"dataSourceClassName",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"dataSourceProperties",
")",
"throws",
"ReflectiveOperationException",
"{",
"DataSource",
"result",
"=",
"(",
"D... | Get data source.
@param dataSourceClassName data source class name
@param dataSourceProperties data source properties
@return data source instance
@throws ReflectiveOperationException reflective operation exception | [
"Get",
"data",
"source",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/spring/boot/util/DataSourceUtil.java#L55-L61 |
124,887 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/SQLParserFactory.java | SQLParserFactory.newInstance | public static SQLParser newInstance(
final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData, final String sql) {
lexerEngine.nextToken();
TokenType tokenType = lexerEngine.getCurrentToken().getType();
... | java | public static SQLParser newInstance(
final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData, final String sql) {
lexerEngine.nextToken();
TokenType tokenType = lexerEngine.getCurrentToken().getType();
... | [
"public",
"static",
"SQLParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"LexerEngine",
"lexerEngine",
",",
"final",
"ShardingTableMetaData",
"shardingTableMetaData",
",",
"final",
"String",
"sql... | Create SQL parser.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine
@param shardingTableMetaData sharding metadata
@param sql sql to parse
@return SQL parser | [
"Create",
"SQL",
"parser",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/SQLParserFactory.java#L69-L114 |
124,888 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/SQLParserFactory.java | SQLParserFactory.newInstance | public static SQLParser newInstance(final DatabaseType dbType, final EncryptRule encryptRule, final ShardingTableMetaData shardingTableMetaData, final String sql) {
if (DatabaseType.MySQL == dbType || DatabaseType.H2 == dbType) {
return new AntlrParsingEngine(dbType, sql, encryptRule, shardingTableM... | java | public static SQLParser newInstance(final DatabaseType dbType, final EncryptRule encryptRule, final ShardingTableMetaData shardingTableMetaData, final String sql) {
if (DatabaseType.MySQL == dbType || DatabaseType.H2 == dbType) {
return new AntlrParsingEngine(dbType, sql, encryptRule, shardingTableM... | [
"public",
"static",
"SQLParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"EncryptRule",
"encryptRule",
",",
"final",
"ShardingTableMetaData",
"shardingTableMetaData",
",",
"final",
"String",
"sql",
")",
"{",
"if",
"(",
"DatabaseType",
".... | Create Encrypt SQL parser.
@param dbType db type
@param encryptRule encrypt rule
@param shardingTableMetaData sharding table meta data
@param sql sql
@return sql parser | [
"Create",
"Encrypt",
"SQL",
"parser",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/SQLParserFactory.java#L125-L130 |
124,889 | apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/util/NumberUtil.java | NumberUtil.roundHalfUp | public static int roundHalfUp(final Object obj) {
if (obj instanceof Short) {
return (short) obj;
}
if (obj instanceof Integer) {
return (int) obj;
}
if (obj instanceof Long) {
return ((Long) obj).intValue();
}
if (obj instanceo... | java | public static int roundHalfUp(final Object obj) {
if (obj instanceof Short) {
return (short) obj;
}
if (obj instanceof Integer) {
return (int) obj;
}
if (obj instanceof Long) {
return ((Long) obj).intValue();
}
if (obj instanceo... | [
"public",
"static",
"int",
"roundHalfUp",
"(",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"Short",
")",
"{",
"return",
"(",
"short",
")",
"obj",
";",
"}",
"if",
"(",
"obj",
"instanceof",
"Integer",
")",
"{",
"return",
"(",
"i... | Round half up.
@param obj object to be converted
@return rounded half up number | [
"Round",
"half",
"up",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/util/NumberUtil.java#L42-L62 |
124,890 | apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/util/NumberUtil.java | NumberUtil.getExactlyNumber | public static Number getExactlyNumber(final String value, final int radix) {
try {
return getBigInteger(value, radix);
} catch (final NumberFormatException ex) {
return new BigDecimal(value);
}
} | java | public static Number getExactlyNumber(final String value, final int radix) {
try {
return getBigInteger(value, radix);
} catch (final NumberFormatException ex) {
return new BigDecimal(value);
}
} | [
"public",
"static",
"Number",
"getExactlyNumber",
"(",
"final",
"String",
"value",
",",
"final",
"int",
"radix",
")",
"{",
"try",
"{",
"return",
"getBigInteger",
"(",
"value",
",",
"radix",
")",
";",
"}",
"catch",
"(",
"final",
"NumberFormatException",
"ex",... | Get exactly number value and type.
@param value string to be converted
@param radix radix
@return exactly number value and type | [
"Get",
"exactly",
"number",
"value",
"and",
"type",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/util/NumberUtil.java#L71-L77 |
124,891 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/InsertIntoClauseParser.java | InsertIntoClauseParser.parse | public void parse(final InsertStatement insertStatement) {
lexerEngine.unsupportedIfEqual(getUnsupportedKeywordsBeforeInto());
lexerEngine.skipUntil(DefaultKeyword.INTO);
lexerEngine.nextToken();
tableReferencesClauseParser.parse(insertStatement, true);
skipBetweenTableAndValues(... | java | public void parse(final InsertStatement insertStatement) {
lexerEngine.unsupportedIfEqual(getUnsupportedKeywordsBeforeInto());
lexerEngine.skipUntil(DefaultKeyword.INTO);
lexerEngine.nextToken();
tableReferencesClauseParser.parse(insertStatement, true);
skipBetweenTableAndValues(... | [
"public",
"void",
"parse",
"(",
"final",
"InsertStatement",
"insertStatement",
")",
"{",
"lexerEngine",
".",
"unsupportedIfEqual",
"(",
"getUnsupportedKeywordsBeforeInto",
"(",
")",
")",
";",
"lexerEngine",
".",
"skipUntil",
"(",
"DefaultKeyword",
".",
"INTO",
")",
... | Parse insert into.
@param insertStatement insert statement | [
"Parse",
"insert",
"into",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/InsertIntoClauseParser.java#L44-L50 |
124,892 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java | TableReferencesClauseParser.parse | public final void parse(final SQLStatement sqlStatement, final boolean isSingleTableOnly) {
do {
parseTableReference(sqlStatement, isSingleTableOnly);
} while (lexerEngine.skipIfEqual(Symbol.COMMA));
} | java | public final void parse(final SQLStatement sqlStatement, final boolean isSingleTableOnly) {
do {
parseTableReference(sqlStatement, isSingleTableOnly);
} while (lexerEngine.skipIfEqual(Symbol.COMMA));
} | [
"public",
"final",
"void",
"parse",
"(",
"final",
"SQLStatement",
"sqlStatement",
",",
"final",
"boolean",
"isSingleTableOnly",
")",
"{",
"do",
"{",
"parseTableReference",
"(",
"sqlStatement",
",",
"isSingleTableOnly",
")",
";",
"}",
"while",
"(",
"lexerEngine",
... | Parse table references.
@param sqlStatement SQL statement
@param isSingleTableOnly is parse single table only | [
"Parse",
"table",
"references",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java#L77-L81 |
124,893 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java | TableReferencesClauseParser.parseSingleTableWithoutAlias | public final void parseSingleTableWithoutAlias(final SQLStatement sqlStatement) {
int beginPosition = lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length();
String literals = lexerEngine.getCurrentToken().getLiterals();
int skippedSchemaNameLength ... | java | public final void parseSingleTableWithoutAlias(final SQLStatement sqlStatement) {
int beginPosition = lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length();
String literals = lexerEngine.getCurrentToken().getLiterals();
int skippedSchemaNameLength ... | [
"public",
"final",
"void",
"parseSingleTableWithoutAlias",
"(",
"final",
"SQLStatement",
"sqlStatement",
")",
"{",
"int",
"beginPosition",
"=",
"lexerEngine",
".",
"getCurrentToken",
"(",
")",
".",
"getEndPosition",
"(",
")",
"-",
"lexerEngine",
".",
"getCurrentToke... | Parse single table without alias.
@param sqlStatement SQL statement | [
"Parse",
"single",
"table",
"without",
"alias",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java#L192-L204 |
124,894 | apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-core/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/executor/CommandExecutorSelector.java | CommandExecutorSelector.getExecutor | public static ExecutorService getExecutor(final boolean isOccupyThreadForPerConnection, final TransactionType transactionType, final ChannelId channelId) {
return (isOccupyThreadForPerConnection || TransactionType.XA == transactionType || TransactionType.BASE == transactionType)
? ChannelThreadExecu... | java | public static ExecutorService getExecutor(final boolean isOccupyThreadForPerConnection, final TransactionType transactionType, final ChannelId channelId) {
return (isOccupyThreadForPerConnection || TransactionType.XA == transactionType || TransactionType.BASE == transactionType)
? ChannelThreadExecu... | [
"public",
"static",
"ExecutorService",
"getExecutor",
"(",
"final",
"boolean",
"isOccupyThreadForPerConnection",
",",
"final",
"TransactionType",
"transactionType",
",",
"final",
"ChannelId",
"channelId",
")",
"{",
"return",
"(",
"isOccupyThreadForPerConnection",
"||",
"T... | Get executor service.
@param isOccupyThreadForPerConnection is occupy thread for per connection or not
@param transactionType transaction type
@param channelId channel ID
@return executor service | [
"Get",
"executor",
"service",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-core/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/executor/CommandExecutorSelector.java#L43-L46 |
124,895 | apache/incubator-shardingsphere | sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLBuilder.java | SQLBuilder.appendPlaceholder | public void appendPlaceholder(final ShardingPlaceholder shardingPlaceholder) {
segments.add(shardingPlaceholder);
currentSegment = new StringBuilder();
segments.add(currentSegment);
} | java | public void appendPlaceholder(final ShardingPlaceholder shardingPlaceholder) {
segments.add(shardingPlaceholder);
currentSegment = new StringBuilder();
segments.add(currentSegment);
} | [
"public",
"void",
"appendPlaceholder",
"(",
"final",
"ShardingPlaceholder",
"shardingPlaceholder",
")",
"{",
"segments",
".",
"add",
"(",
"shardingPlaceholder",
")",
";",
"currentSegment",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"segments",
".",
"add",
"(",
... | Append sharding placeholder.
@param shardingPlaceholder sharding placeholder | [
"Append",
"sharding",
"placeholder",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLBuilder.java#L84-L88 |
124,896 | apache/incubator-shardingsphere | sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLRewriteEngine.java | SQLRewriteEngine.rewrite | public SQLBuilder rewrite(final boolean isSingleRouting) {
SQLBuilder result = new SQLBuilder(parameters);
if (sqlTokens.isEmpty()) {
return appendOriginalLiterals(result);
}
appendInitialLiterals(!isSingleRouting, result);
appendTokensAndPlaceholders(!isSingleRouting... | java | public SQLBuilder rewrite(final boolean isSingleRouting) {
SQLBuilder result = new SQLBuilder(parameters);
if (sqlTokens.isEmpty()) {
return appendOriginalLiterals(result);
}
appendInitialLiterals(!isSingleRouting, result);
appendTokensAndPlaceholders(!isSingleRouting... | [
"public",
"SQLBuilder",
"rewrite",
"(",
"final",
"boolean",
"isSingleRouting",
")",
"{",
"SQLBuilder",
"result",
"=",
"new",
"SQLBuilder",
"(",
"parameters",
")",
";",
"if",
"(",
"sqlTokens",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"appendOriginalLiteral... | rewrite SQL.
@param isSingleRouting is rewrite
@return SQL builder | [
"rewrite",
"SQL",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLRewriteEngine.java#L145-L154 |
124,897 | apache/incubator-shardingsphere | sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLRewriteEngine.java | SQLRewriteEngine.generateSQL | public SQLUnit generateSQL(final TableUnit tableUnit, final SQLBuilder sqlBuilder, final ShardingDataSourceMetaData shardingDataSourceMetaData) {
return sqlBuilder.toSQL(tableUnit, getTableTokens(tableUnit), shardingRule, shardingDataSourceMetaData);
} | java | public SQLUnit generateSQL(final TableUnit tableUnit, final SQLBuilder sqlBuilder, final ShardingDataSourceMetaData shardingDataSourceMetaData) {
return sqlBuilder.toSQL(tableUnit, getTableTokens(tableUnit), shardingRule, shardingDataSourceMetaData);
} | [
"public",
"SQLUnit",
"generateSQL",
"(",
"final",
"TableUnit",
"tableUnit",
",",
"final",
"SQLBuilder",
"sqlBuilder",
",",
"final",
"ShardingDataSourceMetaData",
"shardingDataSourceMetaData",
")",
"{",
"return",
"sqlBuilder",
".",
"toSQL",
"(",
"tableUnit",
",",
"getT... | Generate SQL string.
@param tableUnit route table unit
@param sqlBuilder SQL builder
@param shardingDataSourceMetaData sharding data source meta data
@return SQL unit | [
"Generate",
"SQL",
"string",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLRewriteEngine.java#L514-L516 |
124,898 | apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dml/insert/InsertParserFactory.java | InsertParserFactory.newInstance | public static AbstractInsertParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) {
switch (dbType) {
case H2:
case MySQL:
return new MySQLInsertParser(shardingRule,... | java | public static AbstractInsertParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) {
switch (dbType) {
case H2:
case MySQL:
return new MySQLInsertParser(shardingRule,... | [
"public",
"static",
"AbstractInsertParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"LexerEngine",
"lexerEngine",
",",
"final",
"ShardingTableMetaData",
"shardingTableMetaData",
")",
"{",
"switch",... | Create insert parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine
@param shardingTableMetaData sharding meta data
@return insert parser instance | [
"Create",
"insert",
"parser",
"instance",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dml/insert/InsertParserFactory.java#L49-L63 |
124,899 | apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/yaml/engine/YamlEngine.java | YamlEngine.unmarshalProperties | public static Properties unmarshalProperties(final String yamlContent) {
return Strings.isNullOrEmpty(yamlContent) ? new Properties() : new Yaml().loadAs(yamlContent, Properties.class);
} | java | public static Properties unmarshalProperties(final String yamlContent) {
return Strings.isNullOrEmpty(yamlContent) ? new Properties() : new Yaml().loadAs(yamlContent, Properties.class);
} | [
"public",
"static",
"Properties",
"unmarshalProperties",
"(",
"final",
"String",
"yamlContent",
")",
"{",
"return",
"Strings",
".",
"isNullOrEmpty",
"(",
"yamlContent",
")",
"?",
"new",
"Properties",
"(",
")",
":",
"new",
"Yaml",
"(",
")",
".",
"loadAs",
"("... | Unmarshal properties YAML.
@param yamlContent YAML content
@return properties from YAML | [
"Unmarshal",
"properties",
"YAML",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/yaml/engine/YamlEngine.java#L106-L108 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.