repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
194
func_name
stringlengths
6
111
whole_func_string
stringlengths
80
3.8k
language
stringclasses
1 value
func_code_string
stringlengths
80
3.8k
func_code_tokens
listlengths
20
697
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
434
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
kotcrab/vis-ui
ui/src/main/java/com/kotcrab/vis/ui/widget/file/FileTypeFilter.java
FileTypeFilter.addRule
public void addRule (String description, String... extensions) { rules.add(new Rule(description, extensions)); }
java
public void addRule (String description, String... extensions) { rules.add(new Rule(description, extensions)); }
[ "public", "void", "addRule", "(", "String", "description", ",", "String", "...", "extensions", ")", "{", "rules", ".", "add", "(", "new", "Rule", "(", "description", ",", "extensions", ")", ")", ";", "}" ]
Adds new rule to {@link FileTypeFilter} @param description rule description used in FileChooser's file type select box @param extensions list of extensions without leading dot, eg. 'jpg', 'png' etc.
[ "Adds", "new", "rule", "to", "{" ]
train
https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/file/FileTypeFilter.java#L57-L59
QSFT/Doradus
doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java
RESTClient.sendAndReceive
private RESTResponse sendAndReceive(String header, byte[] body) throws IOException { // Fail before trying if socket has been closed. if (isClosed()) { throw new IOException("Socket has been closed"); } Exception lastException = null; for (int attempt = 0; attempt < MAX_SOCKET_RETRIES; attempt++) { try { sendRequest(header, body); return readResponse(); } catch (IOException e) { // Attempt to reconnect; if this fails, the server's probably down and we // let reconnect's IOException pass through. lastException = e; m_logger.warn("Socket error occurred -- reconnecting", e); reconnect(); } } // Here, all reconnects succeeded but retries failed; something else is wrong with // the server or the request. throw new IOException("Socket error; all retries failed", lastException); }
java
private RESTResponse sendAndReceive(String header, byte[] body) throws IOException { // Fail before trying if socket has been closed. if (isClosed()) { throw new IOException("Socket has been closed"); } Exception lastException = null; for (int attempt = 0; attempt < MAX_SOCKET_RETRIES; attempt++) { try { sendRequest(header, body); return readResponse(); } catch (IOException e) { // Attempt to reconnect; if this fails, the server's probably down and we // let reconnect's IOException pass through. lastException = e; m_logger.warn("Socket error occurred -- reconnecting", e); reconnect(); } } // Here, all reconnects succeeded but retries failed; something else is wrong with // the server or the request. throw new IOException("Socket error; all retries failed", lastException); }
[ "private", "RESTResponse", "sendAndReceive", "(", "String", "header", ",", "byte", "[", "]", "body", ")", "throws", "IOException", "{", "// Fail before trying if socket has been closed.\r", "if", "(", "isClosed", "(", ")", ")", "{", "throw", "new", "IOException", ...
we reconnect and retry up to MAX_SOCKET_RETRIES before giving up.
[ "we", "reconnect", "and", "retry", "up", "to", "MAX_SOCKET_RETRIES", "before", "giving", "up", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L407-L429
reactor/reactor-netty
src/main/java/reactor/netty/http/client/HttpClient.java
HttpClient.mapConnect
public final HttpClient mapConnect(BiFunction<? super Mono<? extends Connection>, ? super Bootstrap, ? extends Mono<? extends Connection>> connector) { return new HttpClientOnConnectMap(this, connector); }
java
public final HttpClient mapConnect(BiFunction<? super Mono<? extends Connection>, ? super Bootstrap, ? extends Mono<? extends Connection>> connector) { return new HttpClientOnConnectMap(this, connector); }
[ "public", "final", "HttpClient", "mapConnect", "(", "BiFunction", "<", "?", "super", "Mono", "<", "?", "extends", "Connection", ">", ",", "?", "super", "Bootstrap", ",", "?", "extends", "Mono", "<", "?", "extends", "Connection", ">", ">", "connector", ")",...
Intercept the connection lifecycle and allows to delay, transform or inject a context. @param connector A bi function mapping the default connection and configured bootstrap to a target connection. @return a new {@link HttpClient}
[ "Intercept", "the", "connection", "lifecycle", "and", "allows", "to", "delay", "transform", "or", "inject", "a", "context", "." ]
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L413-L415
kochedykov/jlibmodbus
src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java
ModbusMaster.writeFileRecord
final public void writeFileRecord(int serverAddress, ModbusFileRecord record) throws ModbusProtocolException, ModbusNumberException, ModbusIOException { processRequest(ModbusRequestBuilder.getInstance().buildWriteFileRecord(serverAddress, record)); }
java
final public void writeFileRecord(int serverAddress, ModbusFileRecord record) throws ModbusProtocolException, ModbusNumberException, ModbusIOException { processRequest(ModbusRequestBuilder.getInstance().buildWriteFileRecord(serverAddress, record)); }
[ "final", "public", "void", "writeFileRecord", "(", "int", "serverAddress", ",", "ModbusFileRecord", "record", ")", "throws", "ModbusProtocolException", ",", "ModbusNumberException", ",", "ModbusIOException", "{", "processRequest", "(", "ModbusRequestBuilder", ".", "getIns...
This function code is used to perform a file record write. All Request Data Lengths are provided in terms of number of bytes and all Record Lengths are provided in terms of the number of 16-bit words. A file is an organization of records. Each file contains 10000 records, addressed 0000 to 9999 decimal or 0X0000 to 0X270F. For example, record 12 is addressed as 12. The function can write multiple groups of references. @param serverAddress a server address @param record the ModbusFileRecord to be written @throws ModbusProtocolException if modbus-exception is received @throws ModbusNumberException if response is invalid @throws ModbusIOException if remote slave is unavailable
[ "This", "function", "code", "is", "used", "to", "perform", "a", "file", "record", "write", ".", "All", "Request", "Data", "Lengths", "are", "provided", "in", "terms", "of", "number", "of", "bytes", "and", "all", "Record", "Lengths", "are", "provided", "in"...
train
https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java#L424-L427
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java
FluentCloseableIterable.transform
public final <E> FluentCloseableIterable<E> transform(Function<? super T, ? extends E> function) { return from(CloseableIterables.transform(this, function)); }
java
public final <E> FluentCloseableIterable<E> transform(Function<? super T, ? extends E> function) { return from(CloseableIterables.transform(this, function)); }
[ "public", "final", "<", "E", ">", "FluentCloseableIterable", "<", "E", ">", "transform", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "E", ">", "function", ")", "{", "return", "from", "(", "CloseableIterables", ".", "transform", "(", "th...
Returns a fluent iterable that applies {@code function} to each element of this fluent iterable. <p>The returned fluent iterable's iterator supports {@code remove()} if this iterable's iterator does. After a successful {@code remove()} call, this fluent iterable no longer contains the corresponding element.
[ "Returns", "a", "fluent", "iterable", "that", "applies", "{", "@code", "function", "}", "to", "each", "element", "of", "this", "fluent", "iterable", "." ]
train
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java#L188-L190
navnorth/LRJavaLib
src/com/navnorth/learningregistry/LRSigner.java
LRSigner.normalizeMap
private Map<String, Object> normalizeMap(Map<String, Object> doc) { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (String key : doc.keySet()) { Object value = doc.get(key); if (value == null) { result.put(key, nullLiteral); } else if (value instanceof Boolean) { result.put(key, ((Boolean) value).toString()); } else if (value instanceof List<?>) { result.put(key, normalizeList((List<Object>) value)); } else if (value instanceof Map<?, ?>) { result.put(key, normalizeMap((Map<String, Object>) value)); } else { result.put(key, value); } } return result; }
java
private Map<String, Object> normalizeMap(Map<String, Object> doc) { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (String key : doc.keySet()) { Object value = doc.get(key); if (value == null) { result.put(key, nullLiteral); } else if (value instanceof Boolean) { result.put(key, ((Boolean) value).toString()); } else if (value instanceof List<?>) { result.put(key, normalizeList((List<Object>) value)); } else if (value instanceof Map<?, ?>) { result.put(key, normalizeMap((Map<String, Object>) value)); } else { result.put(key, value); } } return result; }
[ "private", "Map", "<", "String", ",", "Object", ">", "normalizeMap", "(", "Map", "<", "String", ",", "Object", ">", "doc", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "result", "=", "new", "LinkedHashMap", "<", "String", ",", "Object",...
Normalizes document as LRSignature Python module does - nulls converted to string literal "null" - booleans converted to string literals "true" or "false" - numeric values in lists are dropped - nested maps/JSON documents are normalized @param doc Document to normalize
[ "Normalizes", "document", "as", "LRSignature", "Python", "module", "does", "-", "nulls", "converted", "to", "string", "literal", "null", "-", "booleans", "converted", "to", "string", "literals", "true", "or", "false", "-", "numeric", "values", "in", "lists", "...
train
https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRSigner.java#L153-L174
jmrozanec/cron-utils
src/main/java/com/cronutils/model/time/generator/OnDayOfWeekValueGenerator.java
OnDayOfWeekValueGenerator.generateNoneValues
private int generateNoneValues(final On on, final int year, final int month, final int reference) { // the day of week the first of the month is on final int dowForFirstDoM = LocalDate.of(year, month, 1).getDayOfWeek().getValue();// 1-7 // the day of week we need, normalize to jdk8time final int requiredDoW = ConstantsMapper.weekDayMapping(mondayDoWValue, ConstantsMapper.JAVA8, on.getTime().getValue()); // the first day of the month int baseDay = 1;// day 1 from given month // the difference between the days of week final int diff = dowForFirstDoM - requiredDoW; // //base day remains the same if diff is zero if (diff < 0) { baseDay = baseDay + Math.abs(diff); } if (diff > 0) { baseDay = baseDay + 7 - diff; } // if baseDay is greater than the reference, we are returning the initial matching day value //Fix issue #92 if (reference < 1) { return baseDay; } while (baseDay <= reference) { baseDay += 7; } return baseDay; }
java
private int generateNoneValues(final On on, final int year, final int month, final int reference) { // the day of week the first of the month is on final int dowForFirstDoM = LocalDate.of(year, month, 1).getDayOfWeek().getValue();// 1-7 // the day of week we need, normalize to jdk8time final int requiredDoW = ConstantsMapper.weekDayMapping(mondayDoWValue, ConstantsMapper.JAVA8, on.getTime().getValue()); // the first day of the month int baseDay = 1;// day 1 from given month // the difference between the days of week final int diff = dowForFirstDoM - requiredDoW; // //base day remains the same if diff is zero if (diff < 0) { baseDay = baseDay + Math.abs(diff); } if (diff > 0) { baseDay = baseDay + 7 - diff; } // if baseDay is greater than the reference, we are returning the initial matching day value //Fix issue #92 if (reference < 1) { return baseDay; } while (baseDay <= reference) { baseDay += 7; } return baseDay; }
[ "private", "int", "generateNoneValues", "(", "final", "On", "on", ",", "final", "int", "year", ",", "final", "int", "month", ",", "final", "int", "reference", ")", "{", "// the day of week the first of the month is on", "final", "int", "dowForFirstDoM", "=", "Loca...
Generate valid days of the month for the days of week expression. This method requires that you pass it a -1 for the reference value when starting to generate a sequence of day values. That allows it to handle the special case of which day of the month is the initial matching value. @param on The expression object giving us the particular day of week we need. @param year The year for the calculation. @param month The month for the calculation. @param reference This value must either be -1 indicating you are starting the sequence generation or an actual day of month that meets the day of week criteria. So a value previously returned by this method. @return
[ "Generate", "valid", "days", "of", "the", "month", "for", "the", "days", "of", "week", "expression", ".", "This", "method", "requires", "that", "you", "pass", "it", "a", "-", "1", "for", "the", "reference", "value", "when", "starting", "to", "generate", ...
train
https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/generator/OnDayOfWeekValueGenerator.java#L136-L161
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/FormatCache.java
FormatCache.getInstance
public F getInstance(final String pattern, TimeZone timeZone, Locale locale) { Validate.notNull(pattern, "pattern must not be null"); if (timeZone == null) { timeZone = TimeZone.getDefault(); } if (locale == null) { locale = Locale.getDefault(); } final MultipartKey key = new MultipartKey(pattern, timeZone, locale); F format = cInstanceCache.get(key); if (format == null) { format = createInstance(pattern, timeZone, locale); final F previousValue= cInstanceCache.putIfAbsent(key, format); if (previousValue != null) { // another thread snuck in and did the same work // we should return the instance that is in ConcurrentMap format= previousValue; } } return format; }
java
public F getInstance(final String pattern, TimeZone timeZone, Locale locale) { Validate.notNull(pattern, "pattern must not be null"); if (timeZone == null) { timeZone = TimeZone.getDefault(); } if (locale == null) { locale = Locale.getDefault(); } final MultipartKey key = new MultipartKey(pattern, timeZone, locale); F format = cInstanceCache.get(key); if (format == null) { format = createInstance(pattern, timeZone, locale); final F previousValue= cInstanceCache.putIfAbsent(key, format); if (previousValue != null) { // another thread snuck in and did the same work // we should return the instance that is in ConcurrentMap format= previousValue; } } return format; }
[ "public", "F", "getInstance", "(", "final", "String", "pattern", ",", "TimeZone", "timeZone", ",", "Locale", "locale", ")", "{", "Validate", ".", "notNull", "(", "pattern", ",", "\"pattern must not be null\"", ")", ";", "if", "(", "timeZone", "==", "null", "...
<p>Gets a formatter instance using the specified pattern, time zone and locale.</p> @param pattern {@link java.text.SimpleDateFormat} compatible pattern, non-null @param timeZone the time zone, null means use the default TimeZone @param locale the locale, null means use the default Locale @return a pattern based date/time formatter @throws IllegalArgumentException if pattern is invalid or <code>null</code>
[ "<p", ">", "Gets", "a", "formatter", "instance", "using", "the", "specified", "pattern", "time", "zone", "and", "locale", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/FormatCache.java#L74-L94
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java
base_resource.add_resource
protected base_response add_resource(nitro_service service,options option) throws Exception { if (!service.isLogin() && !this.get_object_type().equals("login")) service.login(); String sessionid = service.get_sessionid(); String request = resource_to_string(service, sessionid, option); return post_data(service,request); }
java
protected base_response add_resource(nitro_service service,options option) throws Exception { if (!service.isLogin() && !this.get_object_type().equals("login")) service.login(); String sessionid = service.get_sessionid(); String request = resource_to_string(service, sessionid, option); return post_data(service,request); }
[ "protected", "base_response", "add_resource", "(", "nitro_service", "service", ",", "options", "option", ")", "throws", "Exception", "{", "if", "(", "!", "service", ".", "isLogin", "(", ")", "&&", "!", "this", ".", "get_object_type", "(", ")", ".", "equals",...
Use this method to perform a add operation on netscaler resource. @param service nitro_service object. @param option options class object. @return status of the operation performed. @throws Exception
[ "Use", "this", "method", "to", "perform", "a", "add", "operation", "on", "netscaler", "resource", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L163-L170
Erudika/para
para-server/src/main/java/com/erudika/para/rest/RestUtils.java
RestUtils.getBatchReadResponse
public static Response getBatchReadResponse(App app, List<String> ids) { try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(), RestUtils.class, "batch", "read")) { if (app != null && ids != null && !ids.isEmpty()) { ArrayList<ParaObject> results = new ArrayList<>(ids.size()); for (ParaObject result : Para.getDAO().readAll(app.getAppIdentifier(), ids, true).values()) { if (checkImplicitAppPermissions(app, result) && checkIfUserCanModifyObject(app, result)) { results.add(result); } } return Response.ok(results).build(); } else { return getStatusResponse(Response.Status.BAD_REQUEST, "Missing ids."); } } }
java
public static Response getBatchReadResponse(App app, List<String> ids) { try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(), RestUtils.class, "batch", "read")) { if (app != null && ids != null && !ids.isEmpty()) { ArrayList<ParaObject> results = new ArrayList<>(ids.size()); for (ParaObject result : Para.getDAO().readAll(app.getAppIdentifier(), ids, true).values()) { if (checkImplicitAppPermissions(app, result) && checkIfUserCanModifyObject(app, result)) { results.add(result); } } return Response.ok(results).build(); } else { return getStatusResponse(Response.Status.BAD_REQUEST, "Missing ids."); } } }
[ "public", "static", "Response", "getBatchReadResponse", "(", "App", "app", ",", "List", "<", "String", ">", "ids", ")", "{", "try", "(", "final", "Metrics", ".", "Context", "context", "=", "Metrics", ".", "time", "(", "app", "==", "null", "?", "null", ...
Batch read response as JSON. @param app the current App object @param ids list of ids @return status code 200 or 400
[ "Batch", "read", "response", "as", "JSON", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L480-L495
NextFaze/power-adapters
power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java
PowerAdapter.showOnlyWhile
@CheckResult @NonNull public final PowerAdapter showOnlyWhile(@NonNull Condition condition) { checkNotNull(condition, "condition"); if (condition instanceof ConstantCondition) { if (condition.eval()) { return this; } else { return EMPTY; } } return new ConditionalAdapter(this, condition); }
java
@CheckResult @NonNull public final PowerAdapter showOnlyWhile(@NonNull Condition condition) { checkNotNull(condition, "condition"); if (condition instanceof ConstantCondition) { if (condition.eval()) { return this; } else { return EMPTY; } } return new ConditionalAdapter(this, condition); }
[ "@", "CheckResult", "@", "NonNull", "public", "final", "PowerAdapter", "showOnlyWhile", "(", "@", "NonNull", "Condition", "condition", ")", "{", "checkNotNull", "(", "condition", ",", "\"condition\"", ")", ";", "if", "(", "condition", "instanceof", "ConstantCondit...
Returns a new adapter that presents the items of this adapter only while the specified condition evaluates to {@code true}. @param condition The condition dictating whether to show the items. @return A new adapter.
[ "Returns", "a", "new", "adapter", "that", "presents", "the", "items", "of", "this", "adapter", "only", "while", "the", "specified", "condition", "evaluates", "to", "{" ]
train
https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java#L517-L529
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java
PrimaveraReader.addUserDefinedField
private void addUserDefinedField(FieldTypeClass fieldType, UserFieldDataType dataType, String name) { try { switch (fieldType) { case TASK: TaskField taskField; do { taskField = m_taskUdfCounters.nextField(TaskField.class, dataType); } while (m_taskFields.containsKey(taskField) || m_wbsFields.containsKey(taskField)); m_project.getCustomFields().getCustomField(taskField).setAlias(name); break; case RESOURCE: ResourceField resourceField; do { resourceField = m_resourceUdfCounters.nextField(ResourceField.class, dataType); } while (m_resourceFields.containsKey(resourceField)); m_project.getCustomFields().getCustomField(resourceField).setAlias(name); break; case ASSIGNMENT: AssignmentField assignmentField; do { assignmentField = m_assignmentUdfCounters.nextField(AssignmentField.class, dataType); } while (m_assignmentFields.containsKey(assignmentField)); m_project.getCustomFields().getCustomField(assignmentField).setAlias(name); break; default: break; } } catch (Exception ex) { // // SF#227: If we get an exception thrown here... it's likely that // we've run out of user defined fields, for example // there are only 30 TEXT fields. We'll ignore this: the user // defined field won't be mapped to an alias, so we'll // ignore it when we read in the values. // } }
java
private void addUserDefinedField(FieldTypeClass fieldType, UserFieldDataType dataType, String name) { try { switch (fieldType) { case TASK: TaskField taskField; do { taskField = m_taskUdfCounters.nextField(TaskField.class, dataType); } while (m_taskFields.containsKey(taskField) || m_wbsFields.containsKey(taskField)); m_project.getCustomFields().getCustomField(taskField).setAlias(name); break; case RESOURCE: ResourceField resourceField; do { resourceField = m_resourceUdfCounters.nextField(ResourceField.class, dataType); } while (m_resourceFields.containsKey(resourceField)); m_project.getCustomFields().getCustomField(resourceField).setAlias(name); break; case ASSIGNMENT: AssignmentField assignmentField; do { assignmentField = m_assignmentUdfCounters.nextField(AssignmentField.class, dataType); } while (m_assignmentFields.containsKey(assignmentField)); m_project.getCustomFields().getCustomField(assignmentField).setAlias(name); break; default: break; } } catch (Exception ex) { // // SF#227: If we get an exception thrown here... it's likely that // we've run out of user defined fields, for example // there are only 30 TEXT fields. We'll ignore this: the user // defined field won't be mapped to an alias, so we'll // ignore it when we read in the values. // } }
[ "private", "void", "addUserDefinedField", "(", "FieldTypeClass", "fieldType", ",", "UserFieldDataType", "dataType", ",", "String", "name", ")", "{", "try", "{", "switch", "(", "fieldType", ")", "{", "case", "TASK", ":", "TaskField", "taskField", ";", "do", "{"...
Configure a new user defined field. @param fieldType field type @param dataType field data type @param name field name
[ "Configure", "a", "new", "user", "defined", "field", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L814-L871
tvesalainen/util
util/src/main/java/org/vesalainen/ui/ScanlineFiller.java
ScanlineFiller.floodFill
public void floodFill(int xx, int yy, Rectangle clip, int replacement) { floodFill(xx, yy, clip, (c)->c!=replacement, replacement); }
java
public void floodFill(int xx, int yy, Rectangle clip, int replacement) { floodFill(xx, yy, clip, (c)->c!=replacement, replacement); }
[ "public", "void", "floodFill", "(", "int", "xx", ",", "int", "yy", ",", "Rectangle", "clip", ",", "int", "replacement", ")", "{", "floodFill", "(", "xx", ",", "yy", ",", "clip", ",", "(", "c", ")", "-", "", ">", "c", "!=", "replacement", ",", "re...
Fills clipped area starting at xx,yy. Area must be surrounded with replacement (or clip) @param xx @param yy @param clip @param replacement
[ "Fills", "clipped", "area", "starting", "at", "xx", "yy", ".", "Area", "must", "be", "surrounded", "with", "replacement", "(", "or", "clip", ")" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/ScanlineFiller.java#L75-L78
ralscha/wampspring-security
src/main/java/ch/rasc/wampspring/security/WampMessageSecurityMetadataSourceRegistry.java
WampMessageSecurityMetadataSourceRegistry.wampDestMatchers
private Constraint wampDestMatchers(WampMessageType type, String... patterns) { List<MatcherBuilder> matchers = new ArrayList<>(patterns.length); for (String pattern : patterns) { matchers.add(new PathMatcherMessageMatcherBuilder(pattern, type)); } return new Constraint(matchers); }
java
private Constraint wampDestMatchers(WampMessageType type, String... patterns) { List<MatcherBuilder> matchers = new ArrayList<>(patterns.length); for (String pattern : patterns) { matchers.add(new PathMatcherMessageMatcherBuilder(pattern, type)); } return new Constraint(matchers); }
[ "private", "Constraint", "wampDestMatchers", "(", "WampMessageType", "type", ",", "String", "...", "patterns", ")", "{", "List", "<", "MatcherBuilder", ">", "matchers", "=", "new", "ArrayList", "<>", "(", "patterns", ".", "length", ")", ";", "for", "(", "Str...
Maps a {@link List} of {@link WampDestinationMessageMatcher} instances. If no destination is found on the Message, then the Matcher returns false. @param type the {@link WampMessageType} to match on. If null, the {@link WampMessageType} is not considered for matching. @param patterns the patterns to create {@link WampDestinationMessageMatcher} from. Uses {@link MessageSecurityMetadataSourceRegistry#wampDestPathMatcher(PathMatcher)} . @return the {@link Constraint} that is associated to the {@link MessageMatcher} @see {@link MessageSecurityMetadataSourceRegistry#wampDestPathMatcher(PathMatcher)}
[ "Maps", "a", "{", "@link", "List", "}", "of", "{", "@link", "WampDestinationMessageMatcher", "}", "instances", ".", "If", "no", "destination", "is", "found", "on", "the", "Message", "then", "the", "Matcher", "returns", "false", "." ]
train
https://github.com/ralscha/wampspring-security/blob/e589b31dc2ff7c78b1be768edae0bc9d543ba7a6/src/main/java/ch/rasc/wampspring/security/WampMessageSecurityMetadataSourceRegistry.java#L181-L187
google/closure-templates
java/src/com/google/template/soy/jbcsrc/runtime/JbcSrcRuntime.java
JbcSrcRuntime.getProtoField
public static SoyValue getProtoField(SoyProtoValue proto, String field) { if (proto == null) { throw new NullPointerException("Attempted to access field '" + field + "' of null"); } return handleTofuNull(proto.getProtoField(field)); }
java
public static SoyValue getProtoField(SoyProtoValue proto, String field) { if (proto == null) { throw new NullPointerException("Attempted to access field '" + field + "' of null"); } return handleTofuNull(proto.getProtoField(field)); }
[ "public", "static", "SoyValue", "getProtoField", "(", "SoyProtoValue", "proto", ",", "String", "field", ")", "{", "if", "(", "proto", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Attempted to access field '\"", "+", "field", "+", "\"' ...
Helper function to make SoyProtoValue.getProtoField compatible with the jbcsrc representation of {@code null}.
[ "Helper", "function", "to", "make", "SoyProtoValue", ".", "getProtoField", "compatible", "with", "the", "jbcsrc", "representation", "of", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/runtime/JbcSrcRuntime.java#L178-L183
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/KeysInner.java
KeysInner.listByAutomationAccount
public KeyListResultInner listByAutomationAccount(String resourceGroupName, String automationAccountName) { return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName).toBlocking().single().body(); }
java
public KeyListResultInner listByAutomationAccount(String resourceGroupName, String automationAccountName) { return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName).toBlocking().single().body(); }
[ "public", "KeyListResultInner", "listByAutomationAccount", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ")", "{", "return", "listByAutomationAccountWithServiceResponseAsync", "(", "resourceGroupName", ",", "automationAccountName", ")", ".", "toBlo...
Retrieve the automation keys for an account. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the KeyListResultInner object if successful.
[ "Retrieve", "the", "automation", "keys", "for", "an", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/KeysInner.java#L70-L72
lightbend/config
config/src/main/java/com/typesafe/config/ConfigRenderOptions.java
ConfigRenderOptions.setOriginComments
public ConfigRenderOptions setOriginComments(boolean value) { if (value == originComments) return this; else return new ConfigRenderOptions(value, comments, formatted, json); }
java
public ConfigRenderOptions setOriginComments(boolean value) { if (value == originComments) return this; else return new ConfigRenderOptions(value, comments, formatted, json); }
[ "public", "ConfigRenderOptions", "setOriginComments", "(", "boolean", "value", ")", "{", "if", "(", "value", "==", "originComments", ")", "return", "this", ";", "else", "return", "new", "ConfigRenderOptions", "(", "value", ",", "comments", ",", "formatted", ",",...
Returns options with origin comments toggled. If this is enabled, the library generates comments for each setting based on the {@link ConfigValue#origin} of that setting's value. For example these comments might tell you which file a setting comes from. <p> {@code setOriginComments()} controls only these autogenerated "origin of this setting" comments, to toggle regular comments use {@link ConfigRenderOptions#setComments}. @param value true to include autogenerated setting-origin comments in the render @return options with origin comments toggled
[ "Returns", "options", "with", "origin", "comments", "toggled", ".", "If", "this", "is", "enabled", "the", "library", "generates", "comments", "for", "each", "setting", "based", "on", "the", "{", "@link", "ConfigValue#origin", "}", "of", "that", "setting", "s",...
train
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigRenderOptions.java#L96-L101
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.payment_transaction_GET
public ArrayList<Long> payment_transaction_GET(Long paymentMethodId, net.minidev.ovh.api.me.payment.method.transaction.OvhStatus status) throws IOException { String qPath = "/me/payment/transaction"; StringBuilder sb = path(qPath); query(sb, "paymentMethodId", paymentMethodId); query(sb, "status", status); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t2); }
java
public ArrayList<Long> payment_transaction_GET(Long paymentMethodId, net.minidev.ovh.api.me.payment.method.transaction.OvhStatus status) throws IOException { String qPath = "/me/payment/transaction"; StringBuilder sb = path(qPath); query(sb, "paymentMethodId", paymentMethodId); query(sb, "status", status); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t2); }
[ "public", "ArrayList", "<", "Long", ">", "payment_transaction_GET", "(", "Long", "paymentMethodId", ",", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "me", ".", "payment", ".", "method", ".", "transaction", ".", "OvhStatus", "status", ")", "throws", ...
Retrieve associated payment method transaction ID list REST: GET /me/payment/transaction @param paymentMethodId [required] Payment method ID @param status [required] Transaction status API beta
[ "Retrieve", "associated", "payment", "method", "transaction", "ID", "list" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1147-L1154
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java
ParagraphVectors.similarityToLabel
@Deprecated public double similarityToLabel(String rawText, String label) { if (tokenizerFactory == null) throw new IllegalStateException("TokenizerFactory should be defined, prior to predict() call"); List<String> tokens = tokenizerFactory.create(rawText).getTokens(); List<VocabWord> document = new ArrayList<>(); for (String token : tokens) { if (vocab.containsWord(token)) { document.add(vocab.wordFor(token)); } } return similarityToLabel(document, label); }
java
@Deprecated public double similarityToLabel(String rawText, String label) { if (tokenizerFactory == null) throw new IllegalStateException("TokenizerFactory should be defined, prior to predict() call"); List<String> tokens = tokenizerFactory.create(rawText).getTokens(); List<VocabWord> document = new ArrayList<>(); for (String token : tokens) { if (vocab.containsWord(token)) { document.add(vocab.wordFor(token)); } } return similarityToLabel(document, label); }
[ "@", "Deprecated", "public", "double", "similarityToLabel", "(", "String", "rawText", ",", "String", "label", ")", "{", "if", "(", "tokenizerFactory", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"TokenizerFactory should be defined, prior to predic...
This method returns similarity of the document to specific label, based on mean value @param rawText @param label @return
[ "This", "method", "returns", "similarity", "of", "the", "document", "to", "specific", "label", "based", "on", "mean", "value" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L652-L665
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/FilePathMappingUtils.java
FilePathMappingUtils.buildFilePathMapping
public static FilePathMapping buildFilePathMapping(JoinableResourceBundle bundle, String path, ResourceReaderHandler rsHandler) { FilePathMapping fPathMapping = null; String filePath = rsHandler.getFilePath(path); if(filePath != null){ File f = new File(filePath); if(f.exists()){ fPathMapping = new FilePathMapping(bundle, filePath, f.lastModified()); if(bundle != null){ bundle.getLinkedFilePathMappings().add(fPathMapping); } }else{ if(LOGGER.isDebugEnabled()){ LOGGER.debug("The file path '"+filePath+"' associated to the URL '"+path+"' doesn't exixts."); } } } return fPathMapping; }
java
public static FilePathMapping buildFilePathMapping(JoinableResourceBundle bundle, String path, ResourceReaderHandler rsHandler) { FilePathMapping fPathMapping = null; String filePath = rsHandler.getFilePath(path); if(filePath != null){ File f = new File(filePath); if(f.exists()){ fPathMapping = new FilePathMapping(bundle, filePath, f.lastModified()); if(bundle != null){ bundle.getLinkedFilePathMappings().add(fPathMapping); } }else{ if(LOGGER.isDebugEnabled()){ LOGGER.debug("The file path '"+filePath+"' associated to the URL '"+path+"' doesn't exixts."); } } } return fPathMapping; }
[ "public", "static", "FilePathMapping", "buildFilePathMapping", "(", "JoinableResourceBundle", "bundle", ",", "String", "path", ",", "ResourceReaderHandler", "rsHandler", ")", "{", "FilePathMapping", "fPathMapping", "=", "null", ";", "String", "filePath", "=", "rsHandler...
Builds the File path mapping and add it to the file mappings of the bundle @param bundle the bundle @param path the resource path @param rsHandler the resource reader handler @return the file path mapping
[ "Builds", "the", "File", "path", "mapping", "and", "add", "it", "to", "the", "file", "mappings", "of", "the", "bundle" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/FilePathMappingUtils.java#L56-L77
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperCube.java
SVGHyperCube.drawFrame
public static Element drawFrame(SVGPlot svgp, Projection2D proj, SpatialComparable box) { SVGPath path = new SVGPath(); ArrayList<double[]> edges = getVisibleEdges(proj, box); final int dim = box.getDimensionality(); double[] min = new double[dim]; for(int i = 0; i < dim; i++) { min[i] = box.getMin(i); } double[] rv_min = proj.fastProjectDataToRenderSpace(min); recDrawEdges(path, rv_min[0], rv_min[1], edges, BitsUtil.zero(edges.size())); return path.makeElement(svgp); }
java
public static Element drawFrame(SVGPlot svgp, Projection2D proj, SpatialComparable box) { SVGPath path = new SVGPath(); ArrayList<double[]> edges = getVisibleEdges(proj, box); final int dim = box.getDimensionality(); double[] min = new double[dim]; for(int i = 0; i < dim; i++) { min[i] = box.getMin(i); } double[] rv_min = proj.fastProjectDataToRenderSpace(min); recDrawEdges(path, rv_min[0], rv_min[1], edges, BitsUtil.zero(edges.size())); return path.makeElement(svgp); }
[ "public", "static", "Element", "drawFrame", "(", "SVGPlot", "svgp", ",", "Projection2D", "proj", ",", "SpatialComparable", "box", ")", "{", "SVGPath", "path", "=", "new", "SVGPath", "(", ")", ";", "ArrayList", "<", "double", "[", "]", ">", "edges", "=", ...
Wireframe hypercube. @param svgp SVG Plot @param proj Visualization projection @param box Bounding box @return path element
[ "Wireframe", "hypercube", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperCube.java#L94-L105
apache/incubator-atlas
client/src/main/java/org/apache/atlas/AtlasClient.java
AtlasClient.updateEntityAttribute
public EntityResult updateEntityAttribute(final String guid, final String attribute, String value) throws AtlasServiceException { LOG.debug("Updating entity id: {}, attribute name: {}, attribute value: {}", guid, attribute, value); JSONObject response = callAPIWithRetries(API.UPDATE_ENTITY_PARTIAL, value, new ResourceCreator() { @Override public WebResource createResource() { API api = API.UPDATE_ENTITY_PARTIAL; WebResource resource = getResource(api, guid); resource = resource.queryParam(ATTRIBUTE_NAME, attribute); return resource; } }); return extractEntityResult(response); }
java
public EntityResult updateEntityAttribute(final String guid, final String attribute, String value) throws AtlasServiceException { LOG.debug("Updating entity id: {}, attribute name: {}, attribute value: {}", guid, attribute, value); JSONObject response = callAPIWithRetries(API.UPDATE_ENTITY_PARTIAL, value, new ResourceCreator() { @Override public WebResource createResource() { API api = API.UPDATE_ENTITY_PARTIAL; WebResource resource = getResource(api, guid); resource = resource.queryParam(ATTRIBUTE_NAME, attribute); return resource; } }); return extractEntityResult(response); }
[ "public", "EntityResult", "updateEntityAttribute", "(", "final", "String", "guid", ",", "final", "String", "attribute", ",", "String", "value", ")", "throws", "AtlasServiceException", "{", "LOG", ".", "debug", "(", "\"Updating entity id: {}, attribute name: {}, attribute ...
Supports Partial updates Updates property for the entity corresponding to guid @param guid guid @param attribute property key @param value property value
[ "Supports", "Partial", "updates", "Updates", "property", "for", "the", "entity", "corresponding", "to", "guid" ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L496-L509
apache/incubator-gobblin
gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AvroHttpJoinConverter.java
AvroHttpJoinConverter.generateHttpOperation
@Override protected HttpOperation generateHttpOperation (GenericRecord inputRecord, State state) { Map<String, String> keyAndValue = new HashMap<>(); Optional<Iterable<String>> keys = getKeys(state); HttpOperation operation; if (keys.isPresent()) { for (String key : keys.get()) { String value = inputRecord.get(key).toString(); log.debug("Http join converter: key is {}, value is {}", key, value); keyAndValue.put(key, value); } operation = new HttpOperation(); operation.setKeys(keyAndValue); } else { operation = HttpUtils.toHttpOperation(inputRecord); } return operation; }
java
@Override protected HttpOperation generateHttpOperation (GenericRecord inputRecord, State state) { Map<String, String> keyAndValue = new HashMap<>(); Optional<Iterable<String>> keys = getKeys(state); HttpOperation operation; if (keys.isPresent()) { for (String key : keys.get()) { String value = inputRecord.get(key).toString(); log.debug("Http join converter: key is {}, value is {}", key, value); keyAndValue.put(key, value); } operation = new HttpOperation(); operation.setKeys(keyAndValue); } else { operation = HttpUtils.toHttpOperation(inputRecord); } return operation; }
[ "@", "Override", "protected", "HttpOperation", "generateHttpOperation", "(", "GenericRecord", "inputRecord", ",", "State", "state", ")", "{", "Map", "<", "String", ",", "String", ">", "keyAndValue", "=", "new", "HashMap", "<>", "(", ")", ";", "Optional", "<", ...
Extract user defined keys by looking at "gobblin.converter.http.keys" If keys are defined, extract key-value pair from inputRecord and set it to HttpOperation If keys are not defined, generate HttpOperation by HttpUtils.toHttpOperation
[ "Extract", "user", "defined", "keys", "by", "looking", "at", "gobblin", ".", "converter", ".", "http", ".", "keys", "If", "keys", "are", "defined", "extract", "key", "-", "value", "pair", "from", "inputRecord", "and", "set", "it", "to", "HttpOperation", "I...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AvroHttpJoinConverter.java#L77-L95
sockeqwe/AdapterDelegates
library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java
AdapterDelegatesManager.addDelegate
public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate) { // algorithm could be improved since there could be holes, // but it's very unlikely that we reach Integer.MAX_VALUE and run out of unused indexes int viewType = delegates.size(); while (delegates.get(viewType) != null) { viewType++; if (viewType == FALLBACK_DELEGATE_VIEW_TYPE) { throw new IllegalArgumentException( "Oops, we are very close to Integer.MAX_VALUE. It seems that there are no more free and unused view type integers left to add another AdapterDelegate."); } } return addDelegate(viewType, false, delegate); }
java
public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate) { // algorithm could be improved since there could be holes, // but it's very unlikely that we reach Integer.MAX_VALUE and run out of unused indexes int viewType = delegates.size(); while (delegates.get(viewType) != null) { viewType++; if (viewType == FALLBACK_DELEGATE_VIEW_TYPE) { throw new IllegalArgumentException( "Oops, we are very close to Integer.MAX_VALUE. It seems that there are no more free and unused view type integers left to add another AdapterDelegate."); } } return addDelegate(viewType, false, delegate); }
[ "public", "AdapterDelegatesManager", "<", "T", ">", "addDelegate", "(", "@", "NonNull", "AdapterDelegate", "<", "T", ">", "delegate", ")", "{", "// algorithm could be improved since there could be holes,", "// but it's very unlikely that we reach Integer.MAX_VALUE and run out of un...
Adds an {@link AdapterDelegate}. <b>This method automatically assign internally the view type integer by using the next unused</b> <p> Internally calls {@link #addDelegate(int, boolean, AdapterDelegate)} with allowReplacingDelegate = false as parameter. @param delegate the delegate to add @return self @throws NullPointerException if passed delegate is null @see #addDelegate(int, AdapterDelegate) @see #addDelegate(int, boolean, AdapterDelegate)
[ "Adds", "an", "{", "@link", "AdapterDelegate", "}", ".", "<b", ">", "This", "method", "automatically", "assign", "internally", "the", "view", "type", "integer", "by", "using", "the", "next", "unused<", "/", "b", ">", "<p", ">", "Internally", "calls", "{", ...
train
https://github.com/sockeqwe/AdapterDelegates/blob/d18dc609415e5d17a3354bddf4bae62440e017af/library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java#L91-L103
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/util/PropertyTypeNavigator.java
PropertyTypeNavigator.get
public static Object get(final Class<?> rootClass, final String property) { return new PropertyTypeNavigator().getPropertyType(rootClass, property); }
java
public static Object get(final Class<?> rootClass, final String property) { return new PropertyTypeNavigator().getPropertyType(rootClass, property); }
[ "public", "static", "Object", "get", "(", "final", "Class", "<", "?", ">", "rootClass", ",", "final", "String", "property", ")", "{", "return", "new", "PropertyTypeNavigator", "(", ")", ".", "getPropertyType", "(", "rootClass", ",", "property", ")", ";", "...
プロパティの値を取得する。 <p>オプションはデフォルト値で処理する。</p> @param rootClass 取得元となるクラス @param property プロパティの式。 @return プロパティのクラスタイプ。 @throws IllegalArgumentException peropety is null or empty. @throws PropertyAccessException 存在しないプロパティを指定した場合など。 @throws IllegalStateException リストやマップにアクセスする際にGenericsタイプが設定されておらずクラスタイプが取得できない場合。 ただし、オプションignoreNotResolveType = falseのとき。
[ "プロパティの値を取得する。", "<p", ">", "オプションはデフォルト値で処理する。<", "/", "p", ">" ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/PropertyTypeNavigator.java#L61-L63
jenkinsci/jenkins
core/src/main/java/hudson/search/Search.java
Search.findClosestSuggestedItem
static SuggestedItem findClosestSuggestedItem(List<SuggestedItem> r, String query) { for(SuggestedItem curItem : r) { if(LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(String.format("item's searchUrl:%s;query=%s", curItem.item.getSearchUrl(), query)); } if(curItem.item.getSearchUrl().contains(Util.rawEncode(query))) { return curItem; } } // couldn't find an item with the query in the url so just // return the first one return r.get(0); }
java
static SuggestedItem findClosestSuggestedItem(List<SuggestedItem> r, String query) { for(SuggestedItem curItem : r) { if(LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(String.format("item's searchUrl:%s;query=%s", curItem.item.getSearchUrl(), query)); } if(curItem.item.getSearchUrl().contains(Util.rawEncode(query))) { return curItem; } } // couldn't find an item with the query in the url so just // return the first one return r.get(0); }
[ "static", "SuggestedItem", "findClosestSuggestedItem", "(", "List", "<", "SuggestedItem", ">", "r", ",", "String", "query", ")", "{", "for", "(", "SuggestedItem", "curItem", ":", "r", ")", "{", "if", "(", "LOGGER", ".", "isLoggable", "(", "Level", ".", "FI...
When there are multiple suggested items, this method can narrow down the resultset to the SuggestedItem that has a url that contains the query. This is useful is one job has a display name that matches another job's project name. @param r A list of Suggested items. It is assumed that there is at least one SuggestedItem in r. @param query A query string @return Returns the SuggestedItem which has a search url that contains the query. If no SuggestedItems have a search url which contains the query, then the first SuggestedItem in the List is returned.
[ "When", "there", "are", "multiple", "suggested", "items", "this", "method", "can", "narrow", "down", "the", "resultset", "to", "the", "SuggestedItem", "that", "has", "a", "url", "that", "contains", "the", "query", ".", "This", "is", "useful", "is", "one", ...
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L237-L250
SonarOpenCommunity/sonar-cxx
cxx-lint/src/main/java/org/sonar/cxx/cxxlint/CxxLint.java
CxxLint.changeAnnotationValue
@SuppressWarnings("unchecked") public static Object changeAnnotationValue(Annotation annotation, String key, Object newValue) { Object handler = Proxy.getInvocationHandler(annotation); Field f; try { f = handler.getClass().getDeclaredField("memberValues"); } catch (NoSuchFieldException | SecurityException e) { throw new IllegalStateException(e); } f.setAccessible(true); Map<String, Object> memberValues; try { memberValues = (Map<String, Object>) f.get(handler); } catch (IllegalArgumentException | IllegalAccessException e) { throw new IllegalStateException(e); } Object oldValue = memberValues.get(key); if (oldValue == null || oldValue.getClass() != newValue.getClass()) { throw new IllegalArgumentException(); } memberValues.put(key, newValue); return oldValue; }
java
@SuppressWarnings("unchecked") public static Object changeAnnotationValue(Annotation annotation, String key, Object newValue) { Object handler = Proxy.getInvocationHandler(annotation); Field f; try { f = handler.getClass().getDeclaredField("memberValues"); } catch (NoSuchFieldException | SecurityException e) { throw new IllegalStateException(e); } f.setAccessible(true); Map<String, Object> memberValues; try { memberValues = (Map<String, Object>) f.get(handler); } catch (IllegalArgumentException | IllegalAccessException e) { throw new IllegalStateException(e); } Object oldValue = memberValues.get(key); if (oldValue == null || oldValue.getClass() != newValue.getClass()) { throw new IllegalArgumentException(); } memberValues.put(key, newValue); return oldValue; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Object", "changeAnnotationValue", "(", "Annotation", "annotation", ",", "String", "key", ",", "Object", "newValue", ")", "{", "Object", "handler", "=", "Proxy", ".", "getInvocationHandler", "...
Changes the annotation value for the given key of the given annotation to newValue and returns the previous value. from: http://stackoverflow.com/questions/14268981/modify-a-class-definitions-annotation-string-parameter-at-runtime @return updated or old value @param annotation @param key @param newValue
[ "Changes", "the", "annotation", "value", "for", "the", "given", "key", "of", "the", "given", "annotation", "to", "newValue", "and", "returns", "the", "previous", "value", ".", "from", ":", "http", ":", "//", "stackoverflow", ".", "com", "/", "questions", "...
train
https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-lint/src/main/java/org/sonar/cxx/cxxlint/CxxLint.java#L243-L265
OrienteerBAP/wicket-orientdb
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/DBClosure.java
DBClosure.sudo
public static <R> R sudo(Function<ODatabaseDocument, R> func) { return new DBClosure<R>() { @Override protected R execute(ODatabaseDocument db) { return func.apply(db); } }.execute(); }
java
public static <R> R sudo(Function<ODatabaseDocument, R> func) { return new DBClosure<R>() { @Override protected R execute(ODatabaseDocument db) { return func.apply(db); } }.execute(); }
[ "public", "static", "<", "R", ">", "R", "sudo", "(", "Function", "<", "ODatabaseDocument", ",", "R", ">", "func", ")", "{", "return", "new", "DBClosure", "<", "R", ">", "(", ")", "{", "@", "Override", "protected", "R", "execute", "(", "ODatabaseDocumen...
Simplified function to execute under admin @param func function to be executed @param <R> type of returned value @return result of a function
[ "Simplified", "function", "to", "execute", "under", "admin" ]
train
https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/DBClosure.java#L97-L104
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getDatabaseReferences
@Override public LinkedHashMap<String, ArrayList<DBReferenceInfo>> getDatabaseReferences() { LinkedHashMap<String, ArrayList<DBReferenceInfo>> databaseReferencesHashMap = new LinkedHashMap<String, ArrayList<DBReferenceInfo>>(); if (uniprotDoc == null) { return databaseReferencesHashMap; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> dbreferenceElementList = XMLHelper.selectElements(entryElement, "dbReference"); for (Element element : dbreferenceElementList) { String type = element.getAttribute("type"); String id = element.getAttribute("id"); ArrayList<DBReferenceInfo> idlist = databaseReferencesHashMap.get(type); if (idlist == null) { idlist = new ArrayList<DBReferenceInfo>(); databaseReferencesHashMap.put(type, idlist); } DBReferenceInfo dbreferenceInfo = new DBReferenceInfo(type, id); ArrayList<Element> propertyElementList = XMLHelper.selectElements(element, "property"); for (Element propertyElement : propertyElementList) { String propertyType = propertyElement.getAttribute("type"); String propertyValue = propertyElement.getAttribute("value"); dbreferenceInfo.addProperty(propertyType, propertyValue); } idlist.add(dbreferenceInfo); } } catch (XPathExpressionException e) { logger.error("Problems while parsing db references in UniProt XML: {}. No db references will be available.",e.getMessage()); return new LinkedHashMap<String, ArrayList<DBReferenceInfo>>(); } return databaseReferencesHashMap; }
java
@Override public LinkedHashMap<String, ArrayList<DBReferenceInfo>> getDatabaseReferences() { LinkedHashMap<String, ArrayList<DBReferenceInfo>> databaseReferencesHashMap = new LinkedHashMap<String, ArrayList<DBReferenceInfo>>(); if (uniprotDoc == null) { return databaseReferencesHashMap; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> dbreferenceElementList = XMLHelper.selectElements(entryElement, "dbReference"); for (Element element : dbreferenceElementList) { String type = element.getAttribute("type"); String id = element.getAttribute("id"); ArrayList<DBReferenceInfo> idlist = databaseReferencesHashMap.get(type); if (idlist == null) { idlist = new ArrayList<DBReferenceInfo>(); databaseReferencesHashMap.put(type, idlist); } DBReferenceInfo dbreferenceInfo = new DBReferenceInfo(type, id); ArrayList<Element> propertyElementList = XMLHelper.selectElements(element, "property"); for (Element propertyElement : propertyElementList) { String propertyType = propertyElement.getAttribute("type"); String propertyValue = propertyElement.getAttribute("value"); dbreferenceInfo.addProperty(propertyType, propertyValue); } idlist.add(dbreferenceInfo); } } catch (XPathExpressionException e) { logger.error("Problems while parsing db references in UniProt XML: {}. No db references will be available.",e.getMessage()); return new LinkedHashMap<String, ArrayList<DBReferenceInfo>>(); } return databaseReferencesHashMap; }
[ "@", "Override", "public", "LinkedHashMap", "<", "String", ",", "ArrayList", "<", "DBReferenceInfo", ">", ">", "getDatabaseReferences", "(", ")", "{", "LinkedHashMap", "<", "String", ",", "ArrayList", "<", "DBReferenceInfo", ">", ">", "databaseReferencesHashMap", ...
The Uniprot mappings to other database identifiers for this sequence @return
[ "The", "Uniprot", "mappings", "to", "other", "database", "identifiers", "for", "this", "sequence" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L769-L804
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java
FFmpegMuxer.captureH264MetaData
private void captureH264MetaData(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) { mH264MetaSize = bufferInfo.size; mH264Keyframe = ByteBuffer.allocateDirect(encodedData.capacity()); byte[] videoConfig = new byte[bufferInfo.size]; encodedData.get(videoConfig, bufferInfo.offset, bufferInfo.size); encodedData.position(bufferInfo.offset); encodedData.put(videoConfig, 0, bufferInfo.size); encodedData.position(bufferInfo.offset); mH264Keyframe.put(videoConfig, 0, bufferInfo.size); }
java
private void captureH264MetaData(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) { mH264MetaSize = bufferInfo.size; mH264Keyframe = ByteBuffer.allocateDirect(encodedData.capacity()); byte[] videoConfig = new byte[bufferInfo.size]; encodedData.get(videoConfig, bufferInfo.offset, bufferInfo.size); encodedData.position(bufferInfo.offset); encodedData.put(videoConfig, 0, bufferInfo.size); encodedData.position(bufferInfo.offset); mH264Keyframe.put(videoConfig, 0, bufferInfo.size); }
[ "private", "void", "captureH264MetaData", "(", "ByteBuffer", "encodedData", ",", "MediaCodec", ".", "BufferInfo", "bufferInfo", ")", "{", "mH264MetaSize", "=", "bufferInfo", ".", "size", ";", "mH264Keyframe", "=", "ByteBuffer", ".", "allocateDirect", "(", "encodedDa...
Should only be called once, when the encoder produces an output buffer with the BUFFER_FLAG_CODEC_CONFIG flag. For H264 output, this indicates the Sequence Parameter Set and Picture Parameter Set are contained in the buffer. These NAL units are required before every keyframe to ensure playback is possible in a segmented stream. @param encodedData @param bufferInfo
[ "Should", "only", "be", "called", "once", "when", "the", "encoder", "produces", "an", "output", "buffer", "with", "the", "BUFFER_FLAG_CODEC_CONFIG", "flag", ".", "For", "H264", "output", "this", "indicates", "the", "Sequence", "Parameter", "Set", "and", "Picture...
train
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java#L296-L305
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java
WTabSet.addTab
public WTab addTab(final WComponent content, final WDecoratedLabel label, final TabMode mode) { return addTab(new WTab(content, label, mode, (char) 0)); }
java
public WTab addTab(final WComponent content, final WDecoratedLabel label, final TabMode mode) { return addTab(new WTab(content, label, mode, (char) 0)); }
[ "public", "WTab", "addTab", "(", "final", "WComponent", "content", ",", "final", "WDecoratedLabel", "label", ",", "final", "TabMode", "mode", ")", "{", "return", "addTab", "(", "new", "WTab", "(", "content", ",", "label", ",", "mode", ",", "(", "char", "...
Adds a tab to the tab set. @param content the tab set content. @param label the tab's label, which can contain rich content (images or other components). @param mode the tab mode. @return the tab which was added to the tab set.
[ "Adds", "a", "tab", "to", "the", "tab", "set", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java#L275-L277
geomajas/geomajas-project-server
api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java
AssociationValue.setDateAttribute
public void setDateAttribute(String name, Date value) { ensureAttributes(); Attribute attribute = new DateAttribute(value); attribute.setEditable(isEditable(name)); getAllAttributes().put(name, attribute); }
java
public void setDateAttribute(String name, Date value) { ensureAttributes(); Attribute attribute = new DateAttribute(value); attribute.setEditable(isEditable(name)); getAllAttributes().put(name, attribute); }
[ "public", "void", "setDateAttribute", "(", "String", "name", ",", "Date", "value", ")", "{", "ensureAttributes", "(", ")", ";", "Attribute", "attribute", "=", "new", "DateAttribute", "(", "value", ")", ";", "attribute", ".", "setEditable", "(", "isEditable", ...
Sets the specified date attribute to the specified value. @param name name of the attribute @param value value of the attribute @since 1.9.0
[ "Sets", "the", "specified", "date", "attribute", "to", "the", "specified", "value", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java#L246-L251
jdereg/java-util
src/main/java/com/cedarsoftware/util/UrlUtilities.java
UrlUtilities.getContentFromUrl
public static byte[] getContentFromUrl(String url, Map inCookies, Map outCookies) { return getContentFromUrl(url, inCookies, outCookies, true); }
java
public static byte[] getContentFromUrl(String url, Map inCookies, Map outCookies) { return getContentFromUrl(url, inCookies, outCookies, true); }
[ "public", "static", "byte", "[", "]", "getContentFromUrl", "(", "String", "url", ",", "Map", "inCookies", ",", "Map", "outCookies", ")", "{", "return", "getContentFromUrl", "(", "url", ",", "inCookies", ",", "outCookies", ",", "true", ")", ";", "}" ]
Get content from the passed in URL. This code will open a connection to the passed in server, fetch the requested content, and return it as a byte[]. @param url URL to hit @param inCookies Map of session cookies (or null if not needed) @param outCookies Map of session cookies (or null if not needed) @return byte[] of content fetched from URL.
[ "Get", "content", "from", "the", "passed", "in", "URL", ".", "This", "code", "will", "open", "a", "connection", "to", "the", "passed", "in", "server", "fetch", "the", "requested", "content", "and", "return", "it", "as", "a", "byte", "[]", "." ]
train
https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L570-L573
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobClient.java
JobClient.isJobDirValid
public static boolean isJobDirValid(Path jobDirPath, FileSystem fs) throws IOException { FileStatus[] contents = fs.listStatus(jobDirPath); int matchCount = 0; if (contents != null && contents.length >=2) { for (FileStatus status : contents) { if ("job.xml".equals(status.getPath().getName())) { ++matchCount; } if ("job.split".equals(status.getPath().getName())) { ++matchCount; } } if (matchCount == 2) { return true; } } return false; }
java
public static boolean isJobDirValid(Path jobDirPath, FileSystem fs) throws IOException { FileStatus[] contents = fs.listStatus(jobDirPath); int matchCount = 0; if (contents != null && contents.length >=2) { for (FileStatus status : contents) { if ("job.xml".equals(status.getPath().getName())) { ++matchCount; } if ("job.split".equals(status.getPath().getName())) { ++matchCount; } } if (matchCount == 2) { return true; } } return false; }
[ "public", "static", "boolean", "isJobDirValid", "(", "Path", "jobDirPath", ",", "FileSystem", "fs", ")", "throws", "IOException", "{", "FileStatus", "[", "]", "contents", "=", "fs", ".", "listStatus", "(", "jobDirPath", ")", ";", "int", "matchCount", "=", "0...
Checks if the job directory is clean and has all the required components for (re) starting the job
[ "Checks", "if", "the", "job", "directory", "is", "clean", "and", "has", "all", "the", "required", "components", "for", "(", "re", ")", "starting", "the", "job" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1409-L1427
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java
DTMDefaultBase.indexNode
protected void indexNode(int expandedTypeID, int identity) { ExpandedNameTable ent = m_expandedNameTable; short type = ent.getType(expandedTypeID); if (DTM.ELEMENT_NODE == type) { int namespaceID = ent.getNamespaceID(expandedTypeID); int localNameID = ent.getLocalNameID(expandedTypeID); ensureSizeOfIndex(namespaceID, localNameID); int[] index = m_elemIndexes[namespaceID][localNameID]; index[index[0]] = identity; index[0]++; } }
java
protected void indexNode(int expandedTypeID, int identity) { ExpandedNameTable ent = m_expandedNameTable; short type = ent.getType(expandedTypeID); if (DTM.ELEMENT_NODE == type) { int namespaceID = ent.getNamespaceID(expandedTypeID); int localNameID = ent.getLocalNameID(expandedTypeID); ensureSizeOfIndex(namespaceID, localNameID); int[] index = m_elemIndexes[namespaceID][localNameID]; index[index[0]] = identity; index[0]++; } }
[ "protected", "void", "indexNode", "(", "int", "expandedTypeID", ",", "int", "identity", ")", "{", "ExpandedNameTable", "ent", "=", "m_expandedNameTable", ";", "short", "type", "=", "ent", ".", "getType", "(", "expandedTypeID", ")", ";", "if", "(", "DTM", "."...
Add a node to the element indexes. The node will not be added unless it's an element. @param expandedTypeID The expanded type ID of the node. @param identity The node identity index.
[ "Add", "a", "node", "to", "the", "element", "indexes", ".", "The", "node", "will", "not", "be", "added", "unless", "it", "s", "an", "element", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java#L317-L336
ujmp/universal-java-matrix-package
ujmp-core/src/main/java/org/ujmp/core/collections/list/FastArrayList.java
FastArrayList.set
public E set(int index, E element) { hashCodeUpToDate = false; E oldValue = elementData(index); elementData[index] = element; return oldValue; }
java
public E set(int index, E element) { hashCodeUpToDate = false; E oldValue = elementData(index); elementData[index] = element; return oldValue; }
[ "public", "E", "set", "(", "int", "index", ",", "E", "element", ")", "{", "hashCodeUpToDate", "=", "false", ";", "E", "oldValue", "=", "elementData", "(", "index", ")", ";", "elementData", "[", "index", "]", "=", "element", ";", "return", "oldValue", "...
Replaces the element at the specified position in this list with the specified element. @param index index of the element to replace @param element element to be stored at the specified position @return the element previously at the specified position @throws IndexOutOfBoundsException {@inheritDoc}
[ "Replaces", "the", "element", "at", "the", "specified", "position", "in", "this", "list", "with", "the", "specified", "element", "." ]
train
https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/collections/list/FastArrayList.java#L455-L460
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java
ClassDescriptorConstraints.ensureTableIfNecessary
private void ensureTableIfNecessary(ClassDescriptorDef classDef, String checkLevel) { if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_OJB_PERSISTENT, false)) { if (!classDef.hasProperty(PropertyHelper.OJB_PROPERTY_TABLE)) { classDef.setProperty(PropertyHelper.OJB_PROPERTY_TABLE, classDef.getDefaultTableName()); } } }
java
private void ensureTableIfNecessary(ClassDescriptorDef classDef, String checkLevel) { if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_OJB_PERSISTENT, false)) { if (!classDef.hasProperty(PropertyHelper.OJB_PROPERTY_TABLE)) { classDef.setProperty(PropertyHelper.OJB_PROPERTY_TABLE, classDef.getDefaultTableName()); } } }
[ "private", "void", "ensureTableIfNecessary", "(", "ClassDescriptorDef", "classDef", ",", "String", "checkLevel", ")", "{", "if", "(", "classDef", ".", "getBooleanProperty", "(", "PropertyHelper", ".", "OJB_PROPERTY_OJB_PERSISTENT", ",", "false", ")", ")", "{", "if",...
Makes sure that the class descriptor has a table attribute if it requires it (i.e. it is relevant for the repository descriptor). @param classDef The class descriptor @param checkLevel The current check level (this constraint is checked in all levels)
[ "Makes", "sure", "that", "the", "class", "descriptor", "has", "a", "table", "attribute", "if", "it", "requires", "it", "(", "i", ".", "e", ".", "it", "is", "relevant", "for", "the", "repository", "descriptor", ")", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L206-L215
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/json/JsonParser.java
JsonParser.parseAndClose
public final <T> T parseAndClose(Class<T> destinationClass) throws IOException { return parseAndClose(destinationClass, null); }
java
public final <T> T parseAndClose(Class<T> destinationClass) throws IOException { return parseAndClose(destinationClass, null); }
[ "public", "final", "<", "T", ">", "T", "parseAndClose", "(", "Class", "<", "T", ">", "destinationClass", ")", "throws", "IOException", "{", "return", "parseAndClose", "(", "destinationClass", ",", "null", ")", ";", "}" ]
Parse a JSON object, array, or value into a new instance of the given destination class, and then closes the parser. @param <T> destination class @param destinationClass destination class that has a public default constructor to use to create a new instance @return new instance of the parsed destination class @since 1.15
[ "Parse", "a", "JSON", "object", "array", "or", "value", "into", "a", "new", "instance", "of", "the", "given", "destination", "class", "and", "then", "closes", "the", "parser", "." ]
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L145-L147
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java
AbstractAzkabanServlet.setSuccessMessageInCookie
protected void setSuccessMessageInCookie(final HttpServletResponse response, final String message) { final Cookie cookie = new Cookie(AZKABAN_SUCCESS_MESSAGE, message); cookie.setPath("/"); response.addCookie(cookie); }
java
protected void setSuccessMessageInCookie(final HttpServletResponse response, final String message) { final Cookie cookie = new Cookie(AZKABAN_SUCCESS_MESSAGE, message); cookie.setPath("/"); response.addCookie(cookie); }
[ "protected", "void", "setSuccessMessageInCookie", "(", "final", "HttpServletResponse", "response", ",", "final", "String", "message", ")", "{", "final", "Cookie", "cookie", "=", "new", "Cookie", "(", "AZKABAN_SUCCESS_MESSAGE", ",", "message", ")", ";", "cookie", "...
Sets a message in azkaban.success.message in the cookie. This will be used by the web client javascript to somehow display the message
[ "Sets", "a", "message", "in", "azkaban", ".", "success", ".", "message", "in", "the", "cookie", ".", "This", "will", "be", "used", "by", "the", "web", "client", "javascript", "to", "somehow", "display", "the", "message" ]
train
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L219-L224
m-m-m/util
exception/src/main/java/net/sf/mmm/util/exception/api/ValueOutOfRangeException.java
ValueOutOfRangeException.createMessage
public static <V> NlsMessage createMessage(V value, V minimum, V maximum, Object valueSource) { return createBundle(NlsBundleUtilExceptionRoot.class).errorValueOutOfRange(value, (minimum == null) ? "\u2212\u221E" : minimum, (maximum == null) ? "+\u221E" : maximum, valueSource); }
java
public static <V> NlsMessage createMessage(V value, V minimum, V maximum, Object valueSource) { return createBundle(NlsBundleUtilExceptionRoot.class).errorValueOutOfRange(value, (minimum == null) ? "\u2212\u221E" : minimum, (maximum == null) ? "+\u221E" : maximum, valueSource); }
[ "public", "static", "<", "V", ">", "NlsMessage", "createMessage", "(", "V", "value", ",", "V", "minimum", ",", "V", "maximum", ",", "Object", "valueSource", ")", "{", "return", "createBundle", "(", "NlsBundleUtilExceptionRoot", ".", "class", ")", ".", "error...
Creates a new error {@link NlsMessage} that the given {@code value} is not in the range from {@code minimum} to {@code maximum}. @param <V> is the generic type of the values. Needs to be an instance of {@link Number} or {@link Comparable}. @param value is the invalid value. @param minimum is the minimum value or {@code null} if unbounded. @param maximum is the maximum value or {@code null} if unbounded. @param valueSource describes the source of {@code value} or {@code null} if unknown. @return the error {@link NlsMessage}.
[ "Creates", "a", "new", "error", "{", "@link", "NlsMessage", "}", "that", "the", "given", "{", "@code", "value", "}", "is", "not", "in", "the", "range", "from", "{", "@code", "minimum", "}", "to", "{", "@code", "maximum", "}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/exception/src/main/java/net/sf/mmm/util/exception/api/ValueOutOfRangeException.java#L182-L186
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.copyEntries
private static void copyEntries(File zip, final ZipOutputStream out, final Set<String> ignoredEntries) { final Set<String> names = new HashSet<String>(); final Set<String> dirNames = filterDirEntries(zip, ignoredEntries); iterate(zip, new ZipEntryCallback() { public void process(InputStream in, ZipEntry zipEntry) throws IOException { String entryName = zipEntry.getName(); if (ignoredEntries.contains(entryName)) { return; } for (String dirName : dirNames) { if (entryName.startsWith(dirName)) { return; } } if (names.add(entryName)) { ZipEntryUtil.copyEntry(zipEntry, in, out); } else if (log.isDebugEnabled()) { log.debug("Duplicate entry: {}", entryName); } } }); }
java
private static void copyEntries(File zip, final ZipOutputStream out, final Set<String> ignoredEntries) { final Set<String> names = new HashSet<String>(); final Set<String> dirNames = filterDirEntries(zip, ignoredEntries); iterate(zip, new ZipEntryCallback() { public void process(InputStream in, ZipEntry zipEntry) throws IOException { String entryName = zipEntry.getName(); if (ignoredEntries.contains(entryName)) { return; } for (String dirName : dirNames) { if (entryName.startsWith(dirName)) { return; } } if (names.add(entryName)) { ZipEntryUtil.copyEntry(zipEntry, in, out); } else if (log.isDebugEnabled()) { log.debug("Duplicate entry: {}", entryName); } } }); }
[ "private", "static", "void", "copyEntries", "(", "File", "zip", ",", "final", "ZipOutputStream", "out", ",", "final", "Set", "<", "String", ">", "ignoredEntries", ")", "{", "final", "Set", "<", "String", ">", "names", "=", "new", "HashSet", "<", "String", ...
Copies all entries from one ZIP file to another, ignoring entries with path in ignoredEntries @param zip source ZIP file. @param out target ZIP stream. @param ignoredEntries paths of entries not to copy
[ "Copies", "all", "entries", "from", "one", "ZIP", "file", "to", "another", "ignoring", "entries", "with", "path", "in", "ignoredEntries" ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2423-L2447
jronrun/benayn
benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java
Berkeley.from
public static BerkeleyDB from(String envHomePath, String databaseName) { return env(envHomePath).connection(databaseName, null, null); }
java
public static BerkeleyDB from(String envHomePath, String databaseName) { return env(envHomePath).connection(databaseName, null, null); }
[ "public", "static", "BerkeleyDB", "from", "(", "String", "envHomePath", ",", "String", "databaseName", ")", "{", "return", "env", "(", "envHomePath", ")", ".", "connection", "(", "databaseName", ",", "null", ",", "null", ")", ";", "}" ]
Returns a new {@link BerkeleyDB} instance, {@link Environment} with {@link Berkeley#defaultEnvironmentConfig() and {@link Database} with {@link Berkeley#defaultDatabaseConfig()}
[ "Returns", "a", "new", "{" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java#L115-L117
VoltDB/voltdb
src/frontend/org/voltdb/iv2/Scoreboard.java
Scoreboard.isComparable
private static boolean isComparable(CompleteTransactionTask c1, CompleteTransactionTask c2) { return c1.getMsgTxnId() == c2.getMsgTxnId() && MpRestartSequenceGenerator.isForRestart(c1.getTimestamp()) == MpRestartSequenceGenerator.isForRestart(c2.getTimestamp()); }
java
private static boolean isComparable(CompleteTransactionTask c1, CompleteTransactionTask c2) { return c1.getMsgTxnId() == c2.getMsgTxnId() && MpRestartSequenceGenerator.isForRestart(c1.getTimestamp()) == MpRestartSequenceGenerator.isForRestart(c2.getTimestamp()); }
[ "private", "static", "boolean", "isComparable", "(", "CompleteTransactionTask", "c1", ",", "CompleteTransactionTask", "c2", ")", "{", "return", "c1", ".", "getMsgTxnId", "(", ")", "==", "c2", ".", "getMsgTxnId", "(", ")", "&&", "MpRestartSequenceGenerator", ".", ...
4) restart completion and repair completion can't overwrite each other
[ "4", ")", "restart", "completion", "and", "repair", "completion", "can", "t", "overwrite", "each", "other" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/Scoreboard.java#L123-L127
sksamuel/scrimage
scrimage-filters/src/main/java/thirdparty/jhlabs/image/ShearFilter.java
ShearFilter.transformInverse
protected void transformInverse(int x, int y, float[] out) { out[0] = x + xoffset + (y * shx); out[1] = y + yoffset + (x * shy); }
java
protected void transformInverse(int x, int y, float[] out) { out[0] = x + xoffset + (y * shx); out[1] = y + yoffset + (x * shy); }
[ "protected", "void", "transformInverse", "(", "int", "x", ",", "int", "y", ",", "float", "[", "]", "out", ")", "{", "out", "[", "0", "]", "=", "x", "+", "xoffset", "+", "(", "y", "*", "shx", ")", ";", "out", "[", "1", "]", "=", "y", "+", "y...
/* public void imageComplete(int status) { try { if (status == IMAGEERROR || status == IMAGEABORTED) { consumer.imageComplete(status); return; } int width = originalSpace.width; int height = originalSpace.height; float tangent = Math.tan(angle); if (tangent < 0.0) tangent = -tangent; int newWidth = (int)(height * tangent + width + 0.999999); int[] outPixels = new int[height*newWidth]; int inIndex = 0; int yOffset = 0; for (int y = 0; y < height; y++) { float newCol; if (angle >= 0.0) newCol = y * tangent; else newCol = (height-y) * tangent; int iNewCol = (int)newCol; float f = newCol - iNewCol; f = 1.0 - f; int outIndex = yOffset+iNewCol; int lastRGB = inPixels[inIndex]; for (int x = 0; x < width; x++) { int rgb = inPixels[inIndex]; outPixels[outIndex] = ImageMath.mixColors(f, lastRGB, rgb); lastRGB = rgb; inIndex++; outIndex++; } outPixels[outIndex] = ImageMath.mixColors(f, lastRGB, 0); yOffset += newWidth; } consumer.setPixels(0, 0, newWidth, height, defaultRGBModel, outPixels, 0, newWidth); consumer.imageComplete(status); inPixels = null; } catch (Exception e) { e.printStackTrace(); } }
[ "/", "*", "public", "void", "imageComplete", "(", "int", "status", ")", "{", "try", "{", "if", "(", "status", "==", "IMAGEERROR", "||", "status", "==", "IMAGEABORTED", ")", "{", "consumer", ".", "imageComplete", "(", "status", ")", ";", "return", ";", ...
train
https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/ShearFilter.java#L128-L131
jsonld-java/jsonld-java
core/src/main/java/com/github/jsonldjava/core/RDFDataset.java
RDFDataset.addQuad
public void addQuad(final String subject, final String predicate, final String object, String graph) { if (graph == null) { graph = "@default"; } if (!containsKey(graph)) { put(graph, new ArrayList<Quad>()); } ((ArrayList<Quad>) get(graph)).add(new Quad(subject, predicate, object, graph)); }
java
public void addQuad(final String subject, final String predicate, final String object, String graph) { if (graph == null) { graph = "@default"; } if (!containsKey(graph)) { put(graph, new ArrayList<Quad>()); } ((ArrayList<Quad>) get(graph)).add(new Quad(subject, predicate, object, graph)); }
[ "public", "void", "addQuad", "(", "final", "String", "subject", ",", "final", "String", "predicate", ",", "final", "String", "object", ",", "String", "graph", ")", "{", "if", "(", "graph", "==", "null", ")", "{", "graph", "=", "\"@default\"", ";", "}", ...
Adds a triple to the specified graph of this dataset @param subject the subject for the triple @param predicate the predicate for the triple @param object the object for the triple @param graph the graph to add this triple to
[ "Adds", "a", "triple", "to", "the", "specified", "graph", "of", "this", "dataset" ]
train
https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java#L532-L541
apereo/cas
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java
AbstractSaml20ObjectBuilder.newAssertion
public Assertion newAssertion(final AuthnStatement authnStatement, final String issuer, final ZonedDateTime issuedAt, final String id) { val list = new ArrayList<Statement>(); list.add(authnStatement); return newAssertion(list, issuer, issuedAt, id); }
java
public Assertion newAssertion(final AuthnStatement authnStatement, final String issuer, final ZonedDateTime issuedAt, final String id) { val list = new ArrayList<Statement>(); list.add(authnStatement); return newAssertion(list, issuer, issuedAt, id); }
[ "public", "Assertion", "newAssertion", "(", "final", "AuthnStatement", "authnStatement", ",", "final", "String", "issuer", ",", "final", "ZonedDateTime", "issuedAt", ",", "final", "String", "id", ")", "{", "val", "list", "=", "new", "ArrayList", "<", "Statement"...
Create a new SAML1 response object. @param authnStatement the authn statement @param issuer the issuer @param issuedAt the issued at @param id the id @return the assertion
[ "Create", "a", "new", "SAML1", "response", "object", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L170-L175
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/contrib/ComparatorChain.java
ComparatorChain.setComparator
public void setComparator(int index, Comparator<T> comparator, boolean reverse) { checkLocked(); comparatorChain.set(index, comparator); if (reverse == true) { orderingBits.set(index); } else { orderingBits.clear(index); } }
java
public void setComparator(int index, Comparator<T> comparator, boolean reverse) { checkLocked(); comparatorChain.set(index, comparator); if (reverse == true) { orderingBits.set(index); } else { orderingBits.clear(index); } }
[ "public", "void", "setComparator", "(", "int", "index", ",", "Comparator", "<", "T", ">", "comparator", ",", "boolean", "reverse", ")", "{", "checkLocked", "(", ")", ";", "comparatorChain", ".", "set", "(", "index", ",", "comparator", ")", ";", "if", "("...
Replace the Comparator at the given index in the ComparatorChain, using the given sortFields order @param index index of the Comparator to replace @param comparator Comparator to set @param reverse false = forward sortFields order; true = reverse sortFields order
[ "Replace", "the", "Comparator", "at", "the", "given", "index", "in", "the", "ComparatorChain", "using", "the", "given", "sortFields", "order" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L162-L171
Azure/azure-sdk-for-java
policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java
PolicyDefinitionsInner.createOrUpdate
public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) { return createOrUpdateWithServiceResponseAsync(policyDefinitionName, parameters).toBlocking().single().body(); }
java
public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) { return createOrUpdateWithServiceResponseAsync(policyDefinitionName, parameters).toBlocking().single().body(); }
[ "public", "PolicyDefinitionInner", "createOrUpdate", "(", "String", "policyDefinitionName", ",", "PolicyDefinitionInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "policyDefinitionName", ",", "parameters", ")", ".", "toBlocking", "(", ...
Creates or updates a policy definition. @param policyDefinitionName The name of the policy definition to create. @param parameters The policy definition properties. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the PolicyDefinitionInner object if successful.
[ "Creates", "or", "updates", "a", "policy", "definition", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L128-L130
google/closure-templates
java/src/com/google/template/soy/SoyFileSet.java
SoyFileSet.compileToPySrcFiles
void compileToPySrcFiles(String outputPathFormat, SoyPySrcOptions pySrcOptions) throws IOException { resetErrorReporter(); ParseResult result = parse(); throwIfErrorsPresent(); new PySrcMain(scopedData.enterable()) .genPyFiles(result.fileSet(), pySrcOptions, outputPathFormat, errorReporter); throwIfErrorsPresent(); reportWarnings(); }
java
void compileToPySrcFiles(String outputPathFormat, SoyPySrcOptions pySrcOptions) throws IOException { resetErrorReporter(); ParseResult result = parse(); throwIfErrorsPresent(); new PySrcMain(scopedData.enterable()) .genPyFiles(result.fileSet(), pySrcOptions, outputPathFormat, errorReporter); throwIfErrorsPresent(); reportWarnings(); }
[ "void", "compileToPySrcFiles", "(", "String", "outputPathFormat", ",", "SoyPySrcOptions", "pySrcOptions", ")", "throws", "IOException", "{", "resetErrorReporter", "(", ")", ";", "ParseResult", "result", "=", "parse", "(", ")", ";", "throwIfErrorsPresent", "(", ")", ...
Compiles this Soy file set into Python source code files and writes these Python files to disk. @param outputPathFormat The format string defining how to build the output file path corresponding to an input file path. @param pySrcOptions The compilation options for the Python Src output target. @throws SoyCompilationException If compilation fails. @throws IOException If there is an error in opening/reading a message file or opening/writing an output JS file.
[ "Compiles", "this", "Soy", "file", "set", "into", "Python", "source", "code", "files", "and", "writes", "these", "Python", "files", "to", "disk", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/SoyFileSet.java#L950-L960
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java
VisualizeImageData.renderLabeled
public static void renderLabeled(GrayS32 labelImage, int numRegions, Bitmap output , byte[] storage) { if( storage == null ) storage = declareStorage(output,null); int colors[] = new int[numRegions]; Random rand = new Random(123); for( int i = 0; i < colors.length; i++ ) { colors[i] = rand.nextInt(); } int w = labelImage.getWidth(); int h = labelImage.getHeight(); int indexOut = 0; for( int y = 0; y < h; y++ ) { int indexSrc = labelImage.startIndex + y*labelImage.stride; for( int x = 0; x < w; x++ ) { int rgb = colors[labelImage.data[indexSrc++]]; storage[indexOut++] = (byte)(rgb & 0xFF); storage[indexOut++] = (byte)((rgb >> 8) & 0xFF); storage[indexOut++] = (byte)((rgb >> 16) & 0xFF); storage[indexOut++] = (byte)0xFF; } } output.copyPixelsFromBuffer(ByteBuffer.wrap(storage)); }
java
public static void renderLabeled(GrayS32 labelImage, int numRegions, Bitmap output , byte[] storage) { if( storage == null ) storage = declareStorage(output,null); int colors[] = new int[numRegions]; Random rand = new Random(123); for( int i = 0; i < colors.length; i++ ) { colors[i] = rand.nextInt(); } int w = labelImage.getWidth(); int h = labelImage.getHeight(); int indexOut = 0; for( int y = 0; y < h; y++ ) { int indexSrc = labelImage.startIndex + y*labelImage.stride; for( int x = 0; x < w; x++ ) { int rgb = colors[labelImage.data[indexSrc++]]; storage[indexOut++] = (byte)(rgb & 0xFF); storage[indexOut++] = (byte)((rgb >> 8) & 0xFF); storage[indexOut++] = (byte)((rgb >> 16) & 0xFF); storage[indexOut++] = (byte)0xFF; } } output.copyPixelsFromBuffer(ByteBuffer.wrap(storage)); }
[ "public", "static", "void", "renderLabeled", "(", "GrayS32", "labelImage", ",", "int", "numRegions", ",", "Bitmap", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "storage", "==", "null", ")", "storage", "=", "declareStorage", "(", "outpu...
Renders a labeled where each region is assigned a random color. @param labelImage Labeled image with labels from 0 to numRegions-1 @param numRegions Number of labeled in the image @param output Where the output is written to @param storage Optional working buffer for Bitmap image. Can be null.
[ "Renders", "a", "labeled", "where", "each", "region", "is", "assigned", "a", "random", "color", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L545-L574
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/util/graph/GraphEncoder.java
GraphEncoder.decode
public static Graph decode(String encodedGraph, GraphConfiguration config) throws GraphEncodingException { // encoded = "800_35_REGIONDATA_REGIONDATA_REGIONDATA_REGIONDATA_..." String parts[] = encodedGraph.split(DELIM); int numRegions = parts.length - 2; if(parts.length < 1) { throw new GraphEncodingException("No regions defined!"); } int width; int height; try { width = Integer.parseInt(parts[0]); } catch(NumberFormatException e) { throw new GraphEncodingException("Bad integer width:" + parts[0]); } try { height = Integer.parseInt(parts[1]); } catch(NumberFormatException e) { throw new GraphEncodingException("Bad integer width:" + parts[0]); } RegionData data[] = new RegionData[numRegions]; for(int i = 0; i < numRegions; i++) { // REGIONDATA = "2001:-1:0ab3f70023f902f" // LABEL:ACTIVE_IDX:HEXDATA String regionParts[] = parts[i + 2].split(REGION_DELIM); if(regionParts.length != 3) { throw new GraphEncodingException("Wrong number of parts in " + parts[i+2]); } int highlightedValue = Integer.parseInt(regionParts[1]); int values[] = decodeHex(regionParts[2]); data[i] = new RegionData(regionParts[0], highlightedValue, values); } return new Graph(width, height, data, config); }
java
public static Graph decode(String encodedGraph, GraphConfiguration config) throws GraphEncodingException { // encoded = "800_35_REGIONDATA_REGIONDATA_REGIONDATA_REGIONDATA_..." String parts[] = encodedGraph.split(DELIM); int numRegions = parts.length - 2; if(parts.length < 1) { throw new GraphEncodingException("No regions defined!"); } int width; int height; try { width = Integer.parseInt(parts[0]); } catch(NumberFormatException e) { throw new GraphEncodingException("Bad integer width:" + parts[0]); } try { height = Integer.parseInt(parts[1]); } catch(NumberFormatException e) { throw new GraphEncodingException("Bad integer width:" + parts[0]); } RegionData data[] = new RegionData[numRegions]; for(int i = 0; i < numRegions; i++) { // REGIONDATA = "2001:-1:0ab3f70023f902f" // LABEL:ACTIVE_IDX:HEXDATA String regionParts[] = parts[i + 2].split(REGION_DELIM); if(regionParts.length != 3) { throw new GraphEncodingException("Wrong number of parts in " + parts[i+2]); } int highlightedValue = Integer.parseInt(regionParts[1]); int values[] = decodeHex(regionParts[2]); data[i] = new RegionData(regionParts[0], highlightedValue, values); } return new Graph(width, height, data, config); }
[ "public", "static", "Graph", "decode", "(", "String", "encodedGraph", ",", "GraphConfiguration", "config", ")", "throws", "GraphEncodingException", "{", "// encoded = \"800_35_REGIONDATA_REGIONDATA_REGIONDATA_REGIONDATA_...\"", "String", "parts", "[", "]", "=", "encodedGraph"...
convert a String-encoded graph into a usable Graph object, using the provided GraphConfiguration. @param encodedGraph String encoded graph, as returned by getEncoded() @param config the GraphConfiguration to use @return a Graph, ready to use @throws GraphEncodingException if there were problems with the encoded data
[ "convert", "a", "String", "-", "encoded", "graph", "into", "a", "usable", "Graph", "object", "using", "the", "provided", "GraphConfiguration", "." ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphEncoder.java#L56-L90
FXMisc/RichTextFX
richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java
MultiChangeBuilder.insertTextAbsolutely
public MultiChangeBuilder<PS, SEG, S> insertTextAbsolutely(int position, String text) { return replaceTextAbsolutely(position, position, text); }
java
public MultiChangeBuilder<PS, SEG, S> insertTextAbsolutely(int position, String text) { return replaceTextAbsolutely(position, position, text); }
[ "public", "MultiChangeBuilder", "<", "PS", ",", "SEG", ",", "S", ">", "insertTextAbsolutely", "(", "int", "position", ",", "String", "text", ")", "{", "return", "replaceTextAbsolutely", "(", "position", ",", "position", ",", "text", ")", ";", "}" ]
Inserts the given text at the given position. @param position The position to insert the text. @param text The text to insert.
[ "Inserts", "the", "given", "text", "at", "the", "given", "position", "." ]
train
https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java#L150-L152
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java
PathMetadataFactory.forArrayAccess
public static PathMetadata forArrayAccess(Path<?> parent, Expression<Integer> index) { return new PathMetadata(parent, index, PathType.ARRAYVALUE); }
java
public static PathMetadata forArrayAccess(Path<?> parent, Expression<Integer> index) { return new PathMetadata(parent, index, PathType.ARRAYVALUE); }
[ "public", "static", "PathMetadata", "forArrayAccess", "(", "Path", "<", "?", ">", "parent", ",", "Expression", "<", "Integer", ">", "index", ")", "{", "return", "new", "PathMetadata", "(", "parent", ",", "index", ",", "PathType", ".", "ARRAYVALUE", ")", ";...
Create a new PathMetadata instance for indexed array access @param parent parent path @param index index of element @return array access path
[ "Create", "a", "new", "PathMetadata", "instance", "for", "indexed", "array", "access" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java#L33-L35
datastax/java-driver
core/src/main/java/com/datastax/oss/driver/internal/core/util/Strings.java
Strings.isQuoted
private static boolean isQuoted(String value, char quoteChar) { return value != null && value.length() > 1 && value.charAt(0) == quoteChar && value.charAt(value.length() - 1) == quoteChar; }
java
private static boolean isQuoted(String value, char quoteChar) { return value != null && value.length() > 1 && value.charAt(0) == quoteChar && value.charAt(value.length() - 1) == quoteChar; }
[ "private", "static", "boolean", "isQuoted", "(", "String", "value", ",", "char", "quoteChar", ")", "{", "return", "value", "!=", "null", "&&", "value", ".", "length", "(", ")", ">", "1", "&&", "value", ".", "charAt", "(", "0", ")", "==", "quoteChar", ...
Return {@code true} if the given string is surrounded by the quote character given, and {@code false} otherwise. @param value The string to inspect. @return {@code true} if the given string is surrounded by the quote character, and {@code false} otherwise.
[ "Return", "{", "@code", "true", "}", "if", "the", "given", "string", "is", "surrounded", "by", "the", "quote", "character", "given", "and", "{", "@code", "false", "}", "otherwise", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/util/Strings.java#L118-L123
GeoLatte/geolatte-common-hibernate
src/main/java/org/geolatte/common/automapper/ClassLoaderResolver.java
ClassLoaderResolver.newInstance
public ClassLoader newInstance(ClassLoader parent) { String msg = "Cannot create a classloader."; try { return (ClassLoader) constructor.newInstance(parent); } catch (InstantiationException e) { throw new IllegalStateException(msg, e); } catch (IllegalAccessException e) { throw new IllegalStateException(msg, e); } catch (InvocationTargetException e) { throw new IllegalStateException(msg, e); } }
java
public ClassLoader newInstance(ClassLoader parent) { String msg = "Cannot create a classloader."; try { return (ClassLoader) constructor.newInstance(parent); } catch (InstantiationException e) { throw new IllegalStateException(msg, e); } catch (IllegalAccessException e) { throw new IllegalStateException(msg, e); } catch (InvocationTargetException e) { throw new IllegalStateException(msg, e); } }
[ "public", "ClassLoader", "newInstance", "(", "ClassLoader", "parent", ")", "{", "String", "msg", "=", "\"Cannot create a classloader.\"", ";", "try", "{", "return", "(", "ClassLoader", ")", "constructor", ".", "newInstance", "(", "parent", ")", ";", "}", "catch"...
Creates a new <code>ClassLoader</code> instance. @param parent the parent <code>ClassLoader</code> for the created instance. @return an instance of the <code>ClassLoader</code> subtype specified in this instance's constructor, having as parent <code>ClassLoader</code> the instance specified in the <code>parent</code> parameter. @throws IllegalStateException if not such instance can be created.
[ "Creates", "a", "new", "<code", ">", "ClassLoader<", "/", "code", ">", "instance", "." ]
train
https://github.com/GeoLatte/geolatte-common-hibernate/blob/2e871c70e506df2485d91152fbd0955c94de1d39/src/main/java/org/geolatte/common/automapper/ClassLoaderResolver.java#L65-L77
JodaOrg/joda-time
src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java
DateTimeZoneBuilder.addRecurringSavings
public DateTimeZoneBuilder addRecurringSavings(String nameKey, int saveMillis, int fromYear, int toYear, char mode, int monthOfYear, int dayOfMonth, int dayOfWeek, boolean advanceDayOfWeek, int millisOfDay) { if (fromYear <= toYear) { OfYear ofYear = new OfYear (mode, monthOfYear, dayOfMonth, dayOfWeek, advanceDayOfWeek, millisOfDay); Recurrence recurrence = new Recurrence(ofYear, nameKey, saveMillis); Rule rule = new Rule(recurrence, fromYear, toYear); getLastRuleSet().addRule(rule); } return this; }
java
public DateTimeZoneBuilder addRecurringSavings(String nameKey, int saveMillis, int fromYear, int toYear, char mode, int monthOfYear, int dayOfMonth, int dayOfWeek, boolean advanceDayOfWeek, int millisOfDay) { if (fromYear <= toYear) { OfYear ofYear = new OfYear (mode, monthOfYear, dayOfMonth, dayOfWeek, advanceDayOfWeek, millisOfDay); Recurrence recurrence = new Recurrence(ofYear, nameKey, saveMillis); Rule rule = new Rule(recurrence, fromYear, toYear); getLastRuleSet().addRule(rule); } return this; }
[ "public", "DateTimeZoneBuilder", "addRecurringSavings", "(", "String", "nameKey", ",", "int", "saveMillis", ",", "int", "fromYear", ",", "int", "toYear", ",", "char", "mode", ",", "int", "monthOfYear", ",", "int", "dayOfMonth", ",", "int", "dayOfWeek", ",", "b...
Add a recurring daylight saving time rule. @param nameKey the name key of new rule @param saveMillis the milliseconds to add to standard offset @param fromYear the first year that rule is in effect, MIN_VALUE indicates beginning of time @param toYear the last year (inclusive) that rule is in effect, MAX_VALUE indicates end of time @param mode 'u' - transitions are calculated against UTC, 'w' - transitions are calculated against wall offset, 's' - transitions are calculated against standard offset @param monthOfYear the month from 1 (January) to 12 (December) @param dayOfMonth if negative, set to ((last day of month) - ~dayOfMonth). For example, if -1, set to last day of month @param dayOfWeek from 1 (Monday) to 7 (Sunday), if 0 then ignore @param advanceDayOfWeek if dayOfMonth does not fall on dayOfWeek, advance to dayOfWeek when true, retreat when false. @param millisOfDay additional precision for specifying time of day of transitions
[ "Add", "a", "recurring", "daylight", "saving", "time", "rule", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L301-L318
geomajas/geomajas-project-geometry
core/src/main/java/org/geomajas/geometry/service/GeometryService.java
GeometryService.isValid
public static boolean isValid(Geometry geometry, GeometryIndex index) { validate(geometry, index); return validationContext.isValid(); }
java
public static boolean isValid(Geometry geometry, GeometryIndex index) { validate(geometry, index); return validationContext.isValid(); }
[ "public", "static", "boolean", "isValid", "(", "Geometry", "geometry", ",", "GeometryIndex", "index", ")", "{", "validate", "(", "geometry", ",", "index", ")", ";", "return", "validationContext", ".", "isValid", "(", ")", ";", "}" ]
Validates a geometry, focusing on changes at a specific sub-level of the geometry. The sublevel is indicated by passing an index. The only checks are on intersection and containment, we don't check on too few coordinates as we want to support incremental creation of polygons. @param geometry The geometry to check. @param index index that points to a sub-geometry, edge, vertex, etc... @return True or false. @since 1.3.0
[ "Validates", "a", "geometry", "focusing", "on", "changes", "at", "a", "specific", "sub", "-", "level", "of", "the", "geometry", ".", "The", "sublevel", "is", "indicated", "by", "passing", "an", "index", ".", "The", "only", "checks", "are", "on", "intersect...
train
https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryService.java#L276-L279
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.remove_node
private final V remove_node(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son) { if(node.left == null) return remove_semi_leaf(node, prev, son, node.right); if(node.right == null) return remove_semi_leaf(node, prev, son, node.left); // The BinTreeNode to replace node in the tree. This is either the // next or the precedent node (in the order of the hashCode's. // We decide a bit randomly, to gain some balanceness. BinTreeNode<K,V> m = (node.keyHashCode % 2 == 0) ? extract_next(node) : extract_prev(node); return finish_removal(node, prev, son, m); }
java
private final V remove_node(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son) { if(node.left == null) return remove_semi_leaf(node, prev, son, node.right); if(node.right == null) return remove_semi_leaf(node, prev, son, node.left); // The BinTreeNode to replace node in the tree. This is either the // next or the precedent node (in the order of the hashCode's. // We decide a bit randomly, to gain some balanceness. BinTreeNode<K,V> m = (node.keyHashCode % 2 == 0) ? extract_next(node) : extract_prev(node); return finish_removal(node, prev, son, m); }
[ "private", "final", "V", "remove_node", "(", "BinTreeNode", "<", "K", ",", "V", ">", "node", ",", "BinTreeNode", "<", "K", ",", "V", ">", "prev", ",", "int", "son", ")", "{", "if", "(", "node", ".", "left", "==", "null", ")", "return", "remove_semi...
right (son == 1) link. Returns the old value attached to node.
[ "right", "(", "son", "==", "1", ")", "link", ".", "Returns", "the", "old", "value", "attached", "to", "node", "." ]
train
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L184-L198
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/MetaModelBuilder.java
MetaModelBuilder.onDeclaredFields
private <X> void onDeclaredFields(Class<X> clazz, AbstractManagedType<X> managedType) { Field[] embeddedFields = clazz.getDeclaredFields(); for (Field f : embeddedFields) { if (isNonTransient(f)) { new TypeBuilder<T>(f).build(managedType, f.getType()); } } }
java
private <X> void onDeclaredFields(Class<X> clazz, AbstractManagedType<X> managedType) { Field[] embeddedFields = clazz.getDeclaredFields(); for (Field f : embeddedFields) { if (isNonTransient(f)) { new TypeBuilder<T>(f).build(managedType, f.getType()); } } }
[ "private", "<", "X", ">", "void", "onDeclaredFields", "(", "Class", "<", "X", ">", "clazz", ",", "AbstractManagedType", "<", "X", ">", "managedType", ")", "{", "Field", "[", "]", "embeddedFields", "=", "clazz", ".", "getDeclaredFields", "(", ")", ";", "f...
On declared fields. @param <X> the generic type @param clazz the clazz @param managedType the managed type
[ "On", "declared", "fields", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/MetaModelBuilder.java#L798-L808
foundation-runtime/logging
logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java
TransactionLogger.logComponent
public static void logComponent(final String type, final String details) { TransactionLogger instance = getInstance(); logComponent(type, details, instance); }
java
public static void logComponent(final String type, final String details) { TransactionLogger instance = getInstance(); logComponent(type, details, instance); }
[ "public", "static", "void", "logComponent", "(", "final", "String", "type", ",", "final", "String", "details", ")", "{", "TransactionLogger", "instance", "=", "getInstance", "(", ")", ";", "logComponent", "(", "type", ",", "details", ",", "instance", ")", ";...
Log details of component processing (including processing time) to debug for current instance @param type - of component @param details - of component processing
[ "Log", "details", "of", "component", "processing", "(", "including", "processing", "time", ")", "to", "debug", "for", "current", "instance" ]
train
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L123-L127
JodaOrg/joda-money
src/main/java/org/joda/money/BigMoney.java
BigMoney.withCurrencyUnit
public BigMoney withCurrencyUnit(CurrencyUnit currency) { MoneyUtils.checkNotNull(currency, "CurrencyUnit must not be null"); if (this.currency == currency) { return this; } return new BigMoney(currency, amount); }
java
public BigMoney withCurrencyUnit(CurrencyUnit currency) { MoneyUtils.checkNotNull(currency, "CurrencyUnit must not be null"); if (this.currency == currency) { return this; } return new BigMoney(currency, amount); }
[ "public", "BigMoney", "withCurrencyUnit", "(", "CurrencyUnit", "currency", ")", "{", "MoneyUtils", ".", "checkNotNull", "(", "currency", ",", "\"CurrencyUnit must not be null\"", ")", ";", "if", "(", "this", ".", "currency", "==", "currency", ")", "{", "return", ...
Returns a copy of this monetary value with the specified currency. <p> The returned instance will have the specified currency and the amount from this instance. No currency conversion or alteration to the scale occurs. <p> This instance is immutable and unaffected by this method. @param currency the currency to use, not null @return the new instance with the input currency set, never null
[ "Returns", "a", "copy", "of", "this", "monetary", "value", "with", "the", "specified", "currency", ".", "<p", ">", "The", "returned", "instance", "will", "have", "the", "specified", "currency", "and", "the", "amount", "from", "this", "instance", ".", "No", ...
train
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L467-L473
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/PassThruTable.java
PassThruTable.addListener
public void addListener(Record record, FileListener listener) { if (this.getNextTable() != null) this.getNextTable().addListener(record, listener); }
java
public void addListener(Record record, FileListener listener) { if (this.getNextTable() != null) this.getNextTable().addListener(record, listener); }
[ "public", "void", "addListener", "(", "Record", "record", ",", "FileListener", "listener", ")", "{", "if", "(", "this", ".", "getNextTable", "(", ")", "!=", "null", ")", "this", ".", "getNextTable", "(", ")", ".", "addListener", "(", "record", ",", "list...
Add a listener to the chain. The listener must be cloned and added to all records on the list. @param listener The listener to add.
[ "Add", "a", "listener", "to", "the", "chain", ".", "The", "listener", "must", "be", "cloned", "and", "added", "to", "all", "records", "on", "the", "list", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/PassThruTable.java#L138-L142
spring-projects/spring-social
spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java
ConnectController.removeConnections
@RequestMapping(value="/{providerId}", method=RequestMethod.DELETE) public RedirectView removeConnections(@PathVariable String providerId, NativeWebRequest request) { ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(providerId); preDisconnect(connectionFactory, request); connectionRepository.removeConnections(providerId); postDisconnect(connectionFactory, request); return connectionStatusRedirect(providerId, request); }
java
@RequestMapping(value="/{providerId}", method=RequestMethod.DELETE) public RedirectView removeConnections(@PathVariable String providerId, NativeWebRequest request) { ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(providerId); preDisconnect(connectionFactory, request); connectionRepository.removeConnections(providerId); postDisconnect(connectionFactory, request); return connectionStatusRedirect(providerId, request); }
[ "@", "RequestMapping", "(", "value", "=", "\"/{providerId}\"", ",", "method", "=", "RequestMethod", ".", "DELETE", ")", "public", "RedirectView", "removeConnections", "(", "@", "PathVariable", "String", "providerId", ",", "NativeWebRequest", "request", ")", "{", "...
Remove all provider connections for a user account. The user has decided they no longer wish to use the service provider from this application. Note: requires {@link HiddenHttpMethodFilter} to be registered with the '_method' request parameter set to 'DELETE' to convert web browser POSTs to DELETE requests. @param providerId the provider ID to remove the connections for @param request the request @return a RedirectView to the connection status page
[ "Remove", "all", "provider", "connections", "for", "a", "user", "account", ".", "The", "user", "has", "decided", "they", "no", "longer", "wish", "to", "use", "the", "service", "provider", "from", "this", "application", ".", "Note", ":", "requires", "{" ]
train
https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java#L332-L339
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java
CFG.createEdge
public Edge createEdge(BasicBlock source, BasicBlock dest, @Edge.Type int type) { Edge edge = createEdge(source, dest); edge.setType(type); return edge; }
java
public Edge createEdge(BasicBlock source, BasicBlock dest, @Edge.Type int type) { Edge edge = createEdge(source, dest); edge.setType(type); return edge; }
[ "public", "Edge", "createEdge", "(", "BasicBlock", "source", ",", "BasicBlock", "dest", ",", "@", "Edge", ".", "Type", "int", "type", ")", "{", "Edge", "edge", "=", "createEdge", "(", "source", ",", "dest", ")", ";", "edge", ".", "setType", "(", "type"...
Add a unique edge to the graph. There must be no other edge already in the CFG with the same source and destination blocks. @param source the source basic block @param dest the destination basic block @param type the type of edge; see constants in EdgeTypes interface @return the newly created Edge @throws IllegalStateException if there is already an edge in the CFG with the same source and destination block
[ "Add", "a", "unique", "edge", "to", "the", "graph", ".", "There", "must", "be", "no", "other", "edge", "already", "in", "the", "CFG", "with", "the", "same", "source", "and", "destination", "blocks", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L258-L262
alibaba/vlayout
vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java
ExposeLinearLayoutManagerEx.scrollInternalBy
protected int scrollInternalBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) { if (getChildCount() == 0 || dy == 0) { return 0; } // indicate whether need recycle in this pass, true when scrolling, false when layout mLayoutState.mRecycle = true; ensureLayoutStateExpose(); final int layoutDirection = dy > 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START; final int absDy = Math.abs(dy); updateLayoutStateExpose(layoutDirection, absDy, true, state); final int freeScroll = mLayoutState.mScrollingOffset; mLayoutState.mOnRefresLayout = false; final int consumed = freeScroll + fill(recycler, mLayoutState, state, false); if (consumed < 0) { if (DEBUG) { Log.d(TAG, "Don't have any more elements to scroll"); } return 0; } final int scrolled = absDy > consumed ? layoutDirection * consumed : dy; mOrientationHelper.offsetChildren(-scrolled); if (DEBUG) { Log.d(TAG, "scroll req: " + dy + " scrolled: " + scrolled); } return scrolled; }
java
protected int scrollInternalBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) { if (getChildCount() == 0 || dy == 0) { return 0; } // indicate whether need recycle in this pass, true when scrolling, false when layout mLayoutState.mRecycle = true; ensureLayoutStateExpose(); final int layoutDirection = dy > 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START; final int absDy = Math.abs(dy); updateLayoutStateExpose(layoutDirection, absDy, true, state); final int freeScroll = mLayoutState.mScrollingOffset; mLayoutState.mOnRefresLayout = false; final int consumed = freeScroll + fill(recycler, mLayoutState, state, false); if (consumed < 0) { if (DEBUG) { Log.d(TAG, "Don't have any more elements to scroll"); } return 0; } final int scrolled = absDy > consumed ? layoutDirection * consumed : dy; mOrientationHelper.offsetChildren(-scrolled); if (DEBUG) { Log.d(TAG, "scroll req: " + dy + " scrolled: " + scrolled); } return scrolled; }
[ "protected", "int", "scrollInternalBy", "(", "int", "dy", ",", "RecyclerView", ".", "Recycler", "recycler", ",", "RecyclerView", ".", "State", "state", ")", "{", "if", "(", "getChildCount", "(", ")", "==", "0", "||", "dy", "==", "0", ")", "{", "return", ...
Handle scroll event internally, cover both horizontal and vertical @param dy Pixel that will be scrolled @param recycler Recycler hold recycled views @param state Current {@link RecyclerView} state, hold whether in preLayout, etc. @return The actual scrolled pixel, it may not be the same as {@code dy}, like when reaching the edge of view
[ "Handle", "scroll", "event", "internally", "cover", "both", "horizontal", "and", "vertical" ]
train
https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java#L970-L1000
xsonorg/xson
src/main/java/org/xson/core/asm/ClassReader.java
ClassReader.readUTF
private String readUTF(int index, final int utfLen, final char[] buf) { int endIndex = index + utfLen; byte[] b = this.b; int strLen = 0; int c, d, e; while (index < endIndex) { c = b[index++] & 0xFF; switch (c >> 4) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 0xxxxxxx buf[strLen++] = (char) c; break; case 12: case 13: // 110x xxxx 10xx xxxx d = b[index++]; buf[strLen++] = (char) (((c & 0x1F) << 6) | (d & 0x3F)); break; default: // 1110 xxxx 10xx xxxx 10xx xxxx d = b[index++]; e = b[index++]; buf[strLen++] = (char) (((c & 0x0F) << 12) | ((d & 0x3F) << 6) | (e & 0x3F)); break; } } return new String(buf, 0, strLen); }
java
private String readUTF(int index, final int utfLen, final char[] buf) { int endIndex = index + utfLen; byte[] b = this.b; int strLen = 0; int c, d, e; while (index < endIndex) { c = b[index++] & 0xFF; switch (c >> 4) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 0xxxxxxx buf[strLen++] = (char) c; break; case 12: case 13: // 110x xxxx 10xx xxxx d = b[index++]; buf[strLen++] = (char) (((c & 0x1F) << 6) | (d & 0x3F)); break; default: // 1110 xxxx 10xx xxxx 10xx xxxx d = b[index++]; e = b[index++]; buf[strLen++] = (char) (((c & 0x0F) << 12) | ((d & 0x3F) << 6) | (e & 0x3F)); break; } } return new String(buf, 0, strLen); }
[ "private", "String", "readUTF", "(", "int", "index", ",", "final", "int", "utfLen", ",", "final", "char", "[", "]", "buf", ")", "{", "int", "endIndex", "=", "index", "+", "utfLen", ";", "byte", "[", "]", "b", "=", "this", ".", "b", ";", "int", "s...
Reads UTF8 string in {@link #b b}. @param index start offset of the UTF8 string to be read. @param utfLen length of the UTF8 string to be read. @param buf buffer to be used to read the string. This buffer must be sufficiently large. It is not automatically resized. @return the String corresponding to the specified UTF8 string.
[ "Reads", "UTF8", "string", "in", "{", "@link", "#b", "b", "}", "." ]
train
https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/ClassReader.java#L1924-L1959
twitter/cloudhopper-commons
ch-commons-util/src/main/java/com/cloudhopper/commons/util/MetaFieldUtil.java
MetaFieldUtil.toMetaFieldInfoArray
public static MetaFieldInfo[] toMetaFieldInfoArray(Object obj, String stringForNullValues) { return toMetaFieldInfoArray(obj, stringForNullValues, false); }
java
public static MetaFieldInfo[] toMetaFieldInfoArray(Object obj, String stringForNullValues) { return toMetaFieldInfoArray(obj, stringForNullValues, false); }
[ "public", "static", "MetaFieldInfo", "[", "]", "toMetaFieldInfoArray", "(", "Object", "obj", ",", "String", "stringForNullValues", ")", "{", "return", "toMetaFieldInfoArray", "(", "obj", ",", "stringForNullValues", ",", "false", ")", ";", "}" ]
Returns a new MetaFieldInfo array of all Fields annotated with MetaField in the runtime object type. If the object is null, this method will return null. NOTE: This method recursively searches the object. @param obj The runtime instance of the object to search. It must be an instance of the type. If its a subclass of the type, this method will only return MetaFields of the type passed in. @param stringForNullValues If a field is null, this is the string to swap in as the String value vs. "null" showing up. @return The MetaFieldInfo array
[ "Returns", "a", "new", "MetaFieldInfo", "array", "of", "all", "Fields", "annotated", "with", "MetaField", "in", "the", "runtime", "object", "type", ".", "If", "the", "object", "is", "null", "this", "method", "will", "return", "null", ".", "NOTE", ":", "Thi...
train
https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/MetaFieldUtil.java#L95-L97
xvik/dropwizard-guicey
src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/BundleSupport.java
BundleSupport.processBundles
public static void processBundles(final ConfigurationContext context) { final List<GuiceyBundle> bundles = context.getEnabledBundles(); final List<Class<? extends GuiceyBundle>> installedBundles = Lists.newArrayList(); final GuiceyBootstrap guiceyBootstrap = new GuiceyBootstrap(context, bundles); // iterating while no new bundles registered while (!bundles.isEmpty()) { final List<GuiceyBundle> processingBundles = Lists.newArrayList(removeDuplicates(bundles)); bundles.clear(); for (GuiceyBundle bundle : removeTypes(processingBundles, installedBundles)) { final Class<? extends GuiceyBundle> bundleType = bundle.getClass(); Preconditions.checkState(!installedBundles.contains(bundleType), "State error: duplicate bundle '%s' registration", bundleType.getName()); // disabled bundles are not processed (so nothing will be registered from it) // important to check here because transitive bundles may appear to be disabled if (context.isBundleEnabled(bundleType)) { context.setScope(bundleType); bundle.initialize(guiceyBootstrap); context.closeScope(); } installedBundles.add(bundleType); } } context.lifecycle().bundlesProcessed(context.getEnabledBundles(), context.getDisabledBundles()); }
java
public static void processBundles(final ConfigurationContext context) { final List<GuiceyBundle> bundles = context.getEnabledBundles(); final List<Class<? extends GuiceyBundle>> installedBundles = Lists.newArrayList(); final GuiceyBootstrap guiceyBootstrap = new GuiceyBootstrap(context, bundles); // iterating while no new bundles registered while (!bundles.isEmpty()) { final List<GuiceyBundle> processingBundles = Lists.newArrayList(removeDuplicates(bundles)); bundles.clear(); for (GuiceyBundle bundle : removeTypes(processingBundles, installedBundles)) { final Class<? extends GuiceyBundle> bundleType = bundle.getClass(); Preconditions.checkState(!installedBundles.contains(bundleType), "State error: duplicate bundle '%s' registration", bundleType.getName()); // disabled bundles are not processed (so nothing will be registered from it) // important to check here because transitive bundles may appear to be disabled if (context.isBundleEnabled(bundleType)) { context.setScope(bundleType); bundle.initialize(guiceyBootstrap); context.closeScope(); } installedBundles.add(bundleType); } } context.lifecycle().bundlesProcessed(context.getEnabledBundles(), context.getDisabledBundles()); }
[ "public", "static", "void", "processBundles", "(", "final", "ConfigurationContext", "context", ")", "{", "final", "List", "<", "GuiceyBundle", ">", "bundles", "=", "context", ".", "getEnabledBundles", "(", ")", ";", "final", "List", "<", "Class", "<", "?", "...
Process initially registered and all transitive bundles. <ul> <li>Executing initial bundles (registered in {@link ru.vyarus.dropwizard.guice.GuiceBundle} and by bundle lookup)</li> <li>During execution bundles may register other bundles (through {@link GuiceyBootstrap})</li> <li>Execute registered bundles and repeat from previous step until no new bundles registered</li> </ul> Bundles duplicates are checked by type: only one bundle instance may be registered. @param context bundles context
[ "Process", "initially", "registered", "and", "all", "transitive", "bundles", ".", "<ul", ">", "<li", ">", "Executing", "initial", "bundles", "(", "registered", "in", "{", "@link", "ru", ".", "vyarus", ".", "dropwizard", ".", "guice", ".", "GuiceBundle", "}",...
train
https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/BundleSupport.java#L40-L67
threerings/nenya
core/src/main/java/com/threerings/media/sound/SoundLoader.java
SoundLoader.getSound
public InputStream getSound (String bundle, String path) throws IOException { InputStream rsrc; try { rsrc = _rmgr.getResource(bundle, path); } catch (FileNotFoundException notFound) { // try from the classpath try { rsrc = _rmgr.getResource(path); } catch (FileNotFoundException notFoundAgain) { throw notFound; } } return rsrc; }
java
public InputStream getSound (String bundle, String path) throws IOException { InputStream rsrc; try { rsrc = _rmgr.getResource(bundle, path); } catch (FileNotFoundException notFound) { // try from the classpath try { rsrc = _rmgr.getResource(path); } catch (FileNotFoundException notFoundAgain) { throw notFound; } } return rsrc; }
[ "public", "InputStream", "getSound", "(", "String", "bundle", ",", "String", "path", ")", "throws", "IOException", "{", "InputStream", "rsrc", ";", "try", "{", "rsrc", "=", "_rmgr", ".", "getResource", "(", "bundle", ",", "path", ")", ";", "}", "catch", ...
Attempts to load a sound stream from the given path from the given bundle and from the classpath. If nothing is found, a FileNotFoundException is thrown.
[ "Attempts", "to", "load", "a", "sound", "stream", "from", "the", "given", "path", "from", "the", "given", "bundle", "and", "from", "the", "classpath", ".", "If", "nothing", "is", "found", "a", "FileNotFoundException", "is", "thrown", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/SoundLoader.java#L92-L107
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/resource/BatchLinkingService.java
BatchLinkingService.resolveBatched
public EObject resolveBatched(EObject context, EReference reference, String uriFragment, CancelIndicator monitor) { if (reference.isMany()) throw new IllegalArgumentException("Not yet implemented for #many references"); batchTypeResolver.resolveTypes(context, monitor); EObject result = (EObject) context.eGet(reference, false); if (result.eIsProxy()) return null; return result; }
java
public EObject resolveBatched(EObject context, EReference reference, String uriFragment, CancelIndicator monitor) { if (reference.isMany()) throw new IllegalArgumentException("Not yet implemented for #many references"); batchTypeResolver.resolveTypes(context, monitor); EObject result = (EObject) context.eGet(reference, false); if (result.eIsProxy()) return null; return result; }
[ "public", "EObject", "resolveBatched", "(", "EObject", "context", ",", "EReference", "reference", ",", "String", "uriFragment", ",", "CancelIndicator", "monitor", ")", "{", "if", "(", "reference", ".", "isMany", "(", ")", ")", "throw", "new", "IllegalArgumentExc...
@param context the current instance that owns the referenced proxy. @param reference the {@link EReference} that has the proxy value. @param uriFragment the lazy linking fragment. @param monitor used to cancel type resolution @return the resolved object for the given context or <code>null</code> if it couldn't be resolved @since 2.7
[ "@param", "context", "the", "current", "instance", "that", "owns", "the", "referenced", "proxy", ".", "@param", "reference", "the", "{", "@link", "EReference", "}", "that", "has", "the", "proxy", "value", ".", "@param", "uriFragment", "the", "lazy", "linking",...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/resource/BatchLinkingService.java#L57-L65
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
ZooKeeperUtils.createLeaderRetrievalService
public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService( final CuratorFramework client, final Configuration configuration) throws Exception { return createLeaderRetrievalService(client, configuration, ""); }
java
public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService( final CuratorFramework client, final Configuration configuration) throws Exception { return createLeaderRetrievalService(client, configuration, ""); }
[ "public", "static", "ZooKeeperLeaderRetrievalService", "createLeaderRetrievalService", "(", "final", "CuratorFramework", "client", ",", "final", "Configuration", "configuration", ")", "throws", "Exception", "{", "return", "createLeaderRetrievalService", "(", "client", ",", ...
Creates a {@link ZooKeeperLeaderRetrievalService} instance. @param client The {@link CuratorFramework} ZooKeeper client to use @param configuration {@link Configuration} object containing the configuration values @return {@link ZooKeeperLeaderRetrievalService} instance. @throws Exception
[ "Creates", "a", "{", "@link", "ZooKeeperLeaderRetrievalService", "}", "instance", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java#L170-L174
overturetool/overture
core/interpreter/src/main/java/org/overture/interpreter/runtime/Interpreter.java
Interpreter.setBreakpoint
public Breakpoint setBreakpoint(PExp exp, String condition) throws ParserException, LexException { BreakpointManager.setBreakpoint(exp, new Stoppoint(exp.getLocation(), ++nextbreakpoint, condition)); breakpoints.put(nextbreakpoint, BreakpointManager.getBreakpoint(exp)); return BreakpointManager.getBreakpoint(exp); }
java
public Breakpoint setBreakpoint(PExp exp, String condition) throws ParserException, LexException { BreakpointManager.setBreakpoint(exp, new Stoppoint(exp.getLocation(), ++nextbreakpoint, condition)); breakpoints.put(nextbreakpoint, BreakpointManager.getBreakpoint(exp)); return BreakpointManager.getBreakpoint(exp); }
[ "public", "Breakpoint", "setBreakpoint", "(", "PExp", "exp", ",", "String", "condition", ")", "throws", "ParserException", ",", "LexException", "{", "BreakpointManager", ".", "setBreakpoint", "(", "exp", ",", "new", "Stoppoint", "(", "exp", ".", "getLocation", "...
Set an expression breakpoint. A breakpoint stops execution and allows the user to query the environment. @param exp The expression at which to stop. @param condition The condition when to stop. @return The Breakpoint object created. @throws LexException @throws ParserException
[ "Set", "an", "expression", "breakpoint", ".", "A", "breakpoint", "stops", "execution", "and", "allows", "the", "user", "to", "query", "the", "environment", "." ]
train
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/org/overture/interpreter/runtime/Interpreter.java#L487-L493
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.listSiteDetectorsSlotAsync
public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) { return listSiteDetectorsSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot) .map(new Func1<ServiceResponse<Page<DetectorDefinitionInner>>, Page<DetectorDefinitionInner>>() { @Override public Page<DetectorDefinitionInner> call(ServiceResponse<Page<DetectorDefinitionInner>> response) { return response.body(); } }); }
java
public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) { return listSiteDetectorsSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot) .map(new Func1<ServiceResponse<Page<DetectorDefinitionInner>>, Page<DetectorDefinitionInner>>() { @Override public Page<DetectorDefinitionInner> call(ServiceResponse<Page<DetectorDefinitionInner>> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Page", "<", "DetectorDefinitionInner", ">", ">", "listSiteDetectorsSlotAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "siteName", ",", "final", "String", "diagnosticCategory", ",", "final", "String", "slot", ...
Get Detectors. Get Detectors. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Diagnostic Category @param slot Slot Name @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;DetectorDefinitionInner&gt; object
[ "Get", "Detectors", ".", "Get", "Detectors", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L2120-L2128
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.println
public static void println(Object self, Object value) { // we won't get here if we are a PrintWriter if (self instanceof Writer) { final PrintWriter pw = new GroovyPrintWriter((Writer) self); pw.println(value); } else { System.out.println(InvokerHelper.toString(value)); } }
java
public static void println(Object self, Object value) { // we won't get here if we are a PrintWriter if (self instanceof Writer) { final PrintWriter pw = new GroovyPrintWriter((Writer) self); pw.println(value); } else { System.out.println(InvokerHelper.toString(value)); } }
[ "public", "static", "void", "println", "(", "Object", "self", ",", "Object", "value", ")", "{", "// we won't get here if we are a PrintWriter", "if", "(", "self", "instanceof", "Writer", ")", "{", "final", "PrintWriter", "pw", "=", "new", "GroovyPrintWriter", "(",...
Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream. @param self any Object @param value the value to print @since 1.0
[ "Print", "a", "value", "formatted", "Groovy", "style", "(", "followed", "by", "a", "newline", ")", "to", "self", "if", "it", "is", "a", "Writer", "otherwise", "to", "the", "standard", "output", "stream", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L797-L805
Stratio/deep-spark
deep-commons/src/main/java/com/stratio/deep/commons/utils/AnnotationUtils.java
AnnotationUtils.getBeanFieldValue
public static Serializable getBeanFieldValue(IDeepType entity, Field deepField) { try { return (Serializable) PropertyUtils.getProperty(entity, deepField.getName()); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e1) { throw new DeepIOException(e1); } }
java
public static Serializable getBeanFieldValue(IDeepType entity, Field deepField) { try { return (Serializable) PropertyUtils.getProperty(entity, deepField.getName()); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e1) { throw new DeepIOException(e1); } }
[ "public", "static", "Serializable", "getBeanFieldValue", "(", "IDeepType", "entity", ",", "Field", "deepField", ")", "{", "try", "{", "return", "(", "Serializable", ")", "PropertyUtils", ".", "getProperty", "(", "entity", ",", "deepField", ".", "getName", "(", ...
Returns the value of the fields <i>deepField</i> in the instance <i>entity</i> of type T. @param entity the entity to process. @param deepField the Field to process belonging to <i>entity</i> @return the property value.
[ "Returns", "the", "value", "of", "the", "fields", "<i", ">", "deepField<", "/", "i", ">", "in", "the", "instance", "<i", ">", "entity<", "/", "i", ">", "of", "type", "T", "." ]
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/AnnotationUtils.java#L116-L124
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java
BandwidthSchedulesInner.createOrUpdate
public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).toBlocking().last().body(); }
java
public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).toBlocking().last().body(); }
[ "public", "BandwidthScheduleInner", "createOrUpdate", "(", "String", "deviceName", ",", "String", "name", ",", "String", "resourceGroupName", ",", "BandwidthScheduleInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "deviceName", ",", ...
Creates or updates a bandwidth schedule. @param deviceName The device name. @param name The bandwidth schedule name which needs to be added/updated. @param resourceGroupName The resource group name. @param parameters The bandwidth schedule to be added or updated. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the BandwidthScheduleInner object if successful.
[ "Creates", "or", "updates", "a", "bandwidth", "schedule", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java#L322-L324
lucee/Lucee
core/src/main/java/lucee/runtime/schedule/SchedulerImpl.java
SchedulerImpl.setAttributes
private void setAttributes(Element el, ScheduleTask task) { if (el == null) return; NamedNodeMap atts = el.getAttributes(); for (int i = atts.getLength() - 1; i >= 0; i--) { Attr att = (Attr) atts.item(i); el.removeAttribute(att.getName()); } su.setString(el, "name", task.getTask()); su.setFile(el, "file", task.getResource()); su.setDateTime(el, "startDate", task.getStartDate()); su.setDateTime(el, "startTime", task.getStartTime()); su.setDateTime(el, "endDate", task.getEndDate()); su.setDateTime(el, "endTime", task.getEndTime()); su.setString(el, "url", task.getUrl().toExternalForm()); su.setInt(el, "port", task.getUrl().getPort()); su.setString(el, "interval", task.getIntervalAsString()); su.setInt(el, "timeout", (int) task.getTimeout()); su.setCredentials(el, "username", "password", task.getCredentials()); ProxyData pd = task.getProxyData(); su.setString(el, "proxyHost", StringUtil.emptyIfNull(pd == null ? "" : pd.getServer())); su.setString(el, "proxyUser", StringUtil.emptyIfNull(pd == null ? "" : pd.getUsername())); su.setString(el, "proxyPassword", StringUtil.emptyIfNull(pd == null ? "" : pd.getPassword())); su.setInt(el, "proxyPort", pd == null ? 0 : pd.getPort()); su.setBoolean(el, "resolveUrl", task.isResolveURL()); su.setBoolean(el, "publish", task.isPublish()); su.setBoolean(el, "hidden", ((ScheduleTaskImpl) task).isHidden()); su.setBoolean(el, "readonly", ((ScheduleTaskImpl) task).isReadonly()); su.setBoolean(el, "autoDelete", ((ScheduleTaskImpl) task).isAutoDelete()); }
java
private void setAttributes(Element el, ScheduleTask task) { if (el == null) return; NamedNodeMap atts = el.getAttributes(); for (int i = atts.getLength() - 1; i >= 0; i--) { Attr att = (Attr) atts.item(i); el.removeAttribute(att.getName()); } su.setString(el, "name", task.getTask()); su.setFile(el, "file", task.getResource()); su.setDateTime(el, "startDate", task.getStartDate()); su.setDateTime(el, "startTime", task.getStartTime()); su.setDateTime(el, "endDate", task.getEndDate()); su.setDateTime(el, "endTime", task.getEndTime()); su.setString(el, "url", task.getUrl().toExternalForm()); su.setInt(el, "port", task.getUrl().getPort()); su.setString(el, "interval", task.getIntervalAsString()); su.setInt(el, "timeout", (int) task.getTimeout()); su.setCredentials(el, "username", "password", task.getCredentials()); ProxyData pd = task.getProxyData(); su.setString(el, "proxyHost", StringUtil.emptyIfNull(pd == null ? "" : pd.getServer())); su.setString(el, "proxyUser", StringUtil.emptyIfNull(pd == null ? "" : pd.getUsername())); su.setString(el, "proxyPassword", StringUtil.emptyIfNull(pd == null ? "" : pd.getPassword())); su.setInt(el, "proxyPort", pd == null ? 0 : pd.getPort()); su.setBoolean(el, "resolveUrl", task.isResolveURL()); su.setBoolean(el, "publish", task.isPublish()); su.setBoolean(el, "hidden", ((ScheduleTaskImpl) task).isHidden()); su.setBoolean(el, "readonly", ((ScheduleTaskImpl) task).isReadonly()); su.setBoolean(el, "autoDelete", ((ScheduleTaskImpl) task).isAutoDelete()); }
[ "private", "void", "setAttributes", "(", "Element", "el", ",", "ScheduleTask", "task", ")", "{", "if", "(", "el", "==", "null", ")", "return", ";", "NamedNodeMap", "atts", "=", "el", ".", "getAttributes", "(", ")", ";", "for", "(", "int", "i", "=", "...
sets all attributes in XML Element from Schedule Task @param el @param task
[ "sets", "all", "attributes", "in", "XML", "Element", "from", "Schedule", "Task" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/SchedulerImpl.java#L229-L259
duracloud/duracloud
s3storageprovider/src/main/java/org/duracloud/s3storage/S3StorageProvider.java
S3StorageProvider.createHiddenSpace
public String createHiddenSpace(String spaceId, int expirationInDays) { String bucketName = getHiddenBucketName(spaceId); try { Bucket bucket = s3Client.createBucket(bucketName); // Apply lifecycle config to bucket BucketLifecycleConfiguration.Rule expiresRule = new BucketLifecycleConfiguration.Rule() .withId("ExpirationRule") .withExpirationInDays(expirationInDays) .withStatus(BucketLifecycleConfiguration.ENABLED); // Add the rules to a new BucketLifecycleConfiguration. BucketLifecycleConfiguration configuration = new BucketLifecycleConfiguration() .withRules(expiresRule); s3Client.setBucketLifecycleConfiguration(bucketName, configuration); return spaceId; } catch (AmazonClientException e) { String err = "Could not create S3 bucket with name " + bucketName + " due to error: " + e.getMessage(); throw new StorageException(err, e, RETRY); } }
java
public String createHiddenSpace(String spaceId, int expirationInDays) { String bucketName = getHiddenBucketName(spaceId); try { Bucket bucket = s3Client.createBucket(bucketName); // Apply lifecycle config to bucket BucketLifecycleConfiguration.Rule expiresRule = new BucketLifecycleConfiguration.Rule() .withId("ExpirationRule") .withExpirationInDays(expirationInDays) .withStatus(BucketLifecycleConfiguration.ENABLED); // Add the rules to a new BucketLifecycleConfiguration. BucketLifecycleConfiguration configuration = new BucketLifecycleConfiguration() .withRules(expiresRule); s3Client.setBucketLifecycleConfiguration(bucketName, configuration); return spaceId; } catch (AmazonClientException e) { String err = "Could not create S3 bucket with name " + bucketName + " due to error: " + e.getMessage(); throw new StorageException(err, e, RETRY); } }
[ "public", "String", "createHiddenSpace", "(", "String", "spaceId", ",", "int", "expirationInDays", ")", "{", "String", "bucketName", "=", "getHiddenBucketName", "(", "spaceId", ")", ";", "try", "{", "Bucket", "bucket", "=", "s3Client", ".", "createBucket", "(", ...
Creates a "hidden" space. This space will not be returned by the StorageProvider.getSpaces() method. It can be accessed using the getSpace* methods. You must know the name of the space in order to access it. @param spaceId The spaceId @param expirationInDays The number of days before content in the space is automatically deleted. @return
[ "Creates", "a", "hidden", "space", ".", "This", "space", "will", "not", "be", "returned", "by", "the", "StorageProvider", ".", "getSpaces", "()", "method", ".", "It", "can", "be", "accessed", "using", "the", "getSpace", "*", "methods", ".", "You", "must", ...
train
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3storage/S3StorageProvider.java#L282-L306
alkacon/opencms-core
src-modules/org/opencms/workplace/comparison/CmsResourceComparisonDialog.java
CmsResourceComparisonDialog.readResource
protected static CmsResource readResource(CmsObject cms, CmsUUID id, String version) throws CmsException { if (Integer.parseInt(version) == CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION) { return cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION); } else { int ver = Integer.parseInt(version); if (ver < 0) { CmsProject project = cms.getRequestContext().getCurrentProject(); try { cms.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ONLINE_PROJECT_ID)); return cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION); } finally { cms.getRequestContext().setCurrentProject(project); } } return (CmsResource)cms.readResource(id, ver); } }
java
protected static CmsResource readResource(CmsObject cms, CmsUUID id, String version) throws CmsException { if (Integer.parseInt(version) == CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION) { return cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION); } else { int ver = Integer.parseInt(version); if (ver < 0) { CmsProject project = cms.getRequestContext().getCurrentProject(); try { cms.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ONLINE_PROJECT_ID)); return cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION); } finally { cms.getRequestContext().setCurrentProject(project); } } return (CmsResource)cms.readResource(id, ver); } }
[ "protected", "static", "CmsResource", "readResource", "(", "CmsObject", "cms", ",", "CmsUUID", "id", ",", "String", "version", ")", "throws", "CmsException", "{", "if", "(", "Integer", ".", "parseInt", "(", "version", ")", "==", "CmsHistoryResourceHandler", ".",...
Returns either the historical resource or the offline resource, depending on the version number.<p> @param cms the CmsObject to use @param id the structure id of the resource @param version the historical version number @return either the historical resource or the offline resource, depending on the version number @throws CmsException if something goes wrong
[ "Returns", "either", "the", "historical", "resource", "or", "the", "offline", "resource", "depending", "on", "the", "version", "number", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/comparison/CmsResourceComparisonDialog.java#L245-L262
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/utils/HttpUtils.java
HttpUtils.encodePartiallyEncoded
public static String encodePartiallyEncoded(String encoded, boolean query) { if (encoded.length() == 0) { return encoded; } Matcher m = ENCODE_PATTERN.matcher(encoded); if (!m.find()) { return query ? HttpUtils.queryEncode(encoded) : HttpUtils.pathEncode(encoded); } int length = encoded.length(); StringBuilder sb = new StringBuilder(length + 8); int i = 0; do { String before = encoded.substring(i, m.start()); sb.append(query ? HttpUtils.queryEncode(before) : HttpUtils.pathEncode(before)); sb.append(m.group()); i = m.end(); } while (m.find()); String tail = encoded.substring(i, length); sb.append(query ? HttpUtils.queryEncode(tail) : HttpUtils.pathEncode(tail)); return sb.toString(); }
java
public static String encodePartiallyEncoded(String encoded, boolean query) { if (encoded.length() == 0) { return encoded; } Matcher m = ENCODE_PATTERN.matcher(encoded); if (!m.find()) { return query ? HttpUtils.queryEncode(encoded) : HttpUtils.pathEncode(encoded); } int length = encoded.length(); StringBuilder sb = new StringBuilder(length + 8); int i = 0; do { String before = encoded.substring(i, m.start()); sb.append(query ? HttpUtils.queryEncode(before) : HttpUtils.pathEncode(before)); sb.append(m.group()); i = m.end(); } while (m.find()); String tail = encoded.substring(i, length); sb.append(query ? HttpUtils.queryEncode(tail) : HttpUtils.pathEncode(tail)); return sb.toString(); }
[ "public", "static", "String", "encodePartiallyEncoded", "(", "String", "encoded", ",", "boolean", "query", ")", "{", "if", "(", "encoded", ".", "length", "(", ")", "==", "0", ")", "{", "return", "encoded", ";", "}", "Matcher", "m", "=", "ENCODE_PATTERN", ...
Encodes partially encoded string. Encode all values but those matching pattern "percent char followed by two hexadecimal digits". @param encoded fully or partially encoded string. @return fully encoded string
[ "Encodes", "partially", "encoded", "string", ".", "Encode", "all", "values", "but", "those", "matching", "pattern", "percent", "char", "followed", "by", "two", "hexadecimal", "digits", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/utils/HttpUtils.java#L191-L213
BBN-E/bue-common-open
nlp-core-open/src/main/java/com/bbn/nlp/corpora/ere/ERELoader.java
ERELoading.toFiller
private EREFiller toFiller(final Element xml, final String docid) { final String id = generateID(XMLUtils.requiredAttribute(xml, "id"), docid); final String type = XMLUtils.requiredAttribute(xml, "type"); final int extentStart = XMLUtils.requiredIntegerAttribute(xml, "offset"); final int extentEnd = extentStart + XMLUtils.requiredIntegerAttribute(xml, "length") - 1; final String text = xml.getTextContent(); final ERESpan span = ERESpan.from(extentStart, extentEnd, text); final EREFiller ereFiller; if (xml.hasAttribute(NORMALIZED_TIME_ATTR)) { ereFiller = EREFiller.fromTime(id, type, xml.getAttribute(NORMALIZED_TIME_ATTR), span); } else { ereFiller = EREFiller.from(id, type, span); } idMap.put(id, ereFiller); return ereFiller; }
java
private EREFiller toFiller(final Element xml, final String docid) { final String id = generateID(XMLUtils.requiredAttribute(xml, "id"), docid); final String type = XMLUtils.requiredAttribute(xml, "type"); final int extentStart = XMLUtils.requiredIntegerAttribute(xml, "offset"); final int extentEnd = extentStart + XMLUtils.requiredIntegerAttribute(xml, "length") - 1; final String text = xml.getTextContent(); final ERESpan span = ERESpan.from(extentStart, extentEnd, text); final EREFiller ereFiller; if (xml.hasAttribute(NORMALIZED_TIME_ATTR)) { ereFiller = EREFiller.fromTime(id, type, xml.getAttribute(NORMALIZED_TIME_ATTR), span); } else { ereFiller = EREFiller.from(id, type, span); } idMap.put(id, ereFiller); return ereFiller; }
[ "private", "EREFiller", "toFiller", "(", "final", "Element", "xml", ",", "final", "String", "docid", ")", "{", "final", "String", "id", "=", "generateID", "(", "XMLUtils", ".", "requiredAttribute", "(", "xml", ",", "\"id\"", ")", ",", "docid", ")", ";", ...
==== Fillers and transforming them to APF entity/value/time ====
[ "====", "Fillers", "and", "transforming", "them", "to", "APF", "entity", "/", "value", "/", "time", "====" ]
train
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/nlp-core-open/src/main/java/com/bbn/nlp/corpora/ere/ERELoader.java#L239-L256
Bandwidth/java-bandwidth
src/main/java/com/bandwidth/sdk/model/Call.java
Call.create
public static Call create(final BandwidthClient client, final Map <String, Object>params) throws Exception { assert (client != null && params != null); final String callUri = client.getUserResourceUri(BandwidthConstants.CALLS_URI_PATH); final RestResponse response = client.post(callUri, params); // success here, otherwise an exception is generated final String callId = response.getLocation().substring(client.getPath(callUri).length() + 1); return get(client, callId); }
java
public static Call create(final BandwidthClient client, final Map <String, Object>params) throws Exception { assert (client != null && params != null); final String callUri = client.getUserResourceUri(BandwidthConstants.CALLS_URI_PATH); final RestResponse response = client.post(callUri, params); // success here, otherwise an exception is generated final String callId = response.getLocation().substring(client.getPath(callUri).length() + 1); return get(client, callId); }
[ "public", "static", "Call", "create", "(", "final", "BandwidthClient", "client", ",", "final", "Map", "<", "String", ",", "Object", ">", "params", ")", "throws", "Exception", "{", "assert", "(", "client", "!=", "null", "&&", "params", "!=", "null", ")", ...
Dials a call, from a phone number to a phone number. @param client the client @param params the call params @return the call @throws IOException unexpected error.
[ "Dials", "a", "call", "from", "a", "phone", "number", "to", "a", "phone", "number", "." ]
train
https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L153-L163
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java
Journal.refreshCachedData
private synchronized void refreshCachedData() throws IOException { IOUtils.closeStream(committedTxnId); File currentDir = journalStorage.getSingularStorageDir().getCurrentDir(); this.lastPromisedEpoch = new PersistentLongFile( new File(currentDir, LAST_PROMISED_FILENAME), 0); this.lastWriterEpoch = new PersistentLongFile( new File(currentDir, LAST_WRITER_EPOCH), 0); this.committedTxnId = new BestEffortLongFile( new File(currentDir, COMMITTED_TXID_FILENAME), HdfsConstants.INVALID_TXID); metrics.lastWriterEpoch.set(lastWriterEpoch.get()); }
java
private synchronized void refreshCachedData() throws IOException { IOUtils.closeStream(committedTxnId); File currentDir = journalStorage.getSingularStorageDir().getCurrentDir(); this.lastPromisedEpoch = new PersistentLongFile( new File(currentDir, LAST_PROMISED_FILENAME), 0); this.lastWriterEpoch = new PersistentLongFile( new File(currentDir, LAST_WRITER_EPOCH), 0); this.committedTxnId = new BestEffortLongFile( new File(currentDir, COMMITTED_TXID_FILENAME), HdfsConstants.INVALID_TXID); metrics.lastWriterEpoch.set(lastWriterEpoch.get()); }
[ "private", "synchronized", "void", "refreshCachedData", "(", ")", "throws", "IOException", "{", "IOUtils", ".", "closeStream", "(", "committedTxnId", ")", ";", "File", "currentDir", "=", "journalStorage", ".", "getSingularStorageDir", "(", ")", ".", "getCurrentDir",...
Reload any data that may have been cached. This is necessary when we first load the Journal, but also after any formatting operation, since the cached data is no longer relevant. @throws IOException
[ "Reload", "any", "data", "that", "may", "have", "been", "cached", ".", "This", "is", "necessary", "when", "we", "first", "load", "the", "Journal", "but", "also", "after", "any", "formatting", "operation", "since", "the", "cached", "data", "is", "no", "long...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L193-L205
pip-services3-java/pip-services3-components-java
src/org/pipservices3/components/connect/ConnectionParams.java
ConnectionParams.fromConfig
public static ConnectionParams fromConfig(ConfigParams config, boolean configAsDefault) { List<ConnectionParams> connections = manyFromConfig(config, configAsDefault); return connections.size() > 0 ? connections.get(0) : null; }
java
public static ConnectionParams fromConfig(ConfigParams config, boolean configAsDefault) { List<ConnectionParams> connections = manyFromConfig(config, configAsDefault); return connections.size() > 0 ? connections.get(0) : null; }
[ "public", "static", "ConnectionParams", "fromConfig", "(", "ConfigParams", "config", ",", "boolean", "configAsDefault", ")", "{", "List", "<", "ConnectionParams", ">", "connections", "=", "manyFromConfig", "(", "config", ",", "configAsDefault", ")", ";", "return", ...
Retrieves a single ConnectionParams from configuration parameters from "connection" section. If "connections" section is present instead, then is returns only the first connection element. @param config ConnectionParams, containing a section named "connection(s)". @param configAsDefault boolean parameter for default configuration. If "true" the default value will be added to the result. @return the generated ConnectionParams object. @see #manyFromConfig(ConfigParams, boolean)
[ "Retrieves", "a", "single", "ConnectionParams", "from", "configuration", "parameters", "from", "connection", "section", ".", "If", "connections", "section", "is", "present", "instead", "then", "is", "returns", "only", "the", "first", "connection", "element", "." ]
train
https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/ConnectionParams.java#L276-L279
infinispan/infinispan
counter/src/main/java/org/infinispan/counter/impl/entries/CounterValue.java
CounterValue.newCounterValue
public static CounterValue newCounterValue(long currentValue, CounterConfiguration configuration) { return configuration.type() == CounterType.BOUNDED_STRONG ? newCounterValue(currentValue, configuration.lowerBound(), configuration.upperBound()) : newCounterValue(currentValue); }
java
public static CounterValue newCounterValue(long currentValue, CounterConfiguration configuration) { return configuration.type() == CounterType.BOUNDED_STRONG ? newCounterValue(currentValue, configuration.lowerBound(), configuration.upperBound()) : newCounterValue(currentValue); }
[ "public", "static", "CounterValue", "newCounterValue", "(", "long", "currentValue", ",", "CounterConfiguration", "configuration", ")", "{", "return", "configuration", ".", "type", "(", ")", "==", "CounterType", ".", "BOUNDED_STRONG", "?", "newCounterValue", "(", "cu...
Creates the initial {@link CounterValue} based on {@code currentValue} and the {@link CounterConfiguration}. @param currentValue the current counter's value. @param configuration the configuration. @return the {@link CounterValue}.
[ "Creates", "the", "initial", "{", "@link", "CounterValue", "}", "based", "on", "{", "@code", "currentValue", "}", "and", "the", "{", "@link", "CounterConfiguration", "}", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/impl/entries/CounterValue.java#L96-L100
goldmansachs/reladomo
reladomogen/src/main/java/com/gs/fw/common/mithra/generator/queryparser/JJTMithraQLState.java
JJTMithraQLState.closeNodeScope
void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
java
void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
[ "void", "closeNodeScope", "(", "Node", "n", ",", "int", "num", ")", "{", "mk", "=", "(", "(", "Integer", ")", "marks", ".", "pop", "(", ")", ")", ".", "intValue", "(", ")", ";", "while", "(", "num", "--", ">", "0", ")", "{", "Node", "c", "=",...
/* A definite node is constructed from a specified number of children. That number of nodes are popped from the stack and made the children of the definite node. Then the definite node is pushed on to the stack.
[ "/", "*", "A", "definite", "node", "is", "constructed", "from", "a", "specified", "number", "of", "children", ".", "That", "number", "of", "nodes", "are", "popped", "from", "the", "stack", "and", "made", "the", "children", "of", "the", "definite", "node", ...
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogen/src/main/java/com/gs/fw/common/mithra/generator/queryparser/JJTMithraQLState.java#L104-L114
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_save_config.java
ns_save_config.add
public static ns_save_config add(nitro_service client, ns_save_config resource) throws Exception { resource.validate("add"); return ((ns_save_config[]) resource.perform_operation(client, "add"))[0]; }
java
public static ns_save_config add(nitro_service client, ns_save_config resource) throws Exception { resource.validate("add"); return ((ns_save_config[]) resource.perform_operation(client, "add"))[0]; }
[ "public", "static", "ns_save_config", "add", "(", "nitro_service", "client", ",", "ns_save_config", "resource", ")", "throws", "Exception", "{", "resource", ".", "validate", "(", "\"add\"", ")", ";", "return", "(", "(", "ns_save_config", "[", "]", ")", "resour...
<pre> Use this operation to save configuration on NS Instance(s). </pre>
[ "<pre", ">", "Use", "this", "operation", "to", "save", "configuration", "on", "NS", "Instance", "(", "s", ")", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_save_config.java#L85-L89
wso2/transport-http
components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java
Http2ConnectionManager.borrowChannel
public Http2ClientChannel borrowChannel(Http2SourceHandler http2SrcHandler, HttpRoute httpRoute) { EventLoopPool eventLoopPool; String key = generateKey(httpRoute); EventLoopPool.PerRouteConnectionPool perRouteConnectionPool; if (http2SrcHandler != null) { eventLoopPool = getOrCreateEventLoopPool(http2SrcHandler.getChannelHandlerContext().channel().eventLoop()); perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); } else { if (eventLoops.isEmpty()) { return null; } eventLoopPool = getOrCreateEventLoopPool(eventLoops.peek()); perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); } Http2ClientChannel http2ClientChannel = null; if (perRouteConnectionPool != null) { http2ClientChannel = perRouteConnectionPool.fetchTargetChannel(); } return http2ClientChannel; }
java
public Http2ClientChannel borrowChannel(Http2SourceHandler http2SrcHandler, HttpRoute httpRoute) { EventLoopPool eventLoopPool; String key = generateKey(httpRoute); EventLoopPool.PerRouteConnectionPool perRouteConnectionPool; if (http2SrcHandler != null) { eventLoopPool = getOrCreateEventLoopPool(http2SrcHandler.getChannelHandlerContext().channel().eventLoop()); perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); } else { if (eventLoops.isEmpty()) { return null; } eventLoopPool = getOrCreateEventLoopPool(eventLoops.peek()); perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); } Http2ClientChannel http2ClientChannel = null; if (perRouteConnectionPool != null) { http2ClientChannel = perRouteConnectionPool.fetchTargetChannel(); } return http2ClientChannel; }
[ "public", "Http2ClientChannel", "borrowChannel", "(", "Http2SourceHandler", "http2SrcHandler", ",", "HttpRoute", "httpRoute", ")", "{", "EventLoopPool", "eventLoopPool", ";", "String", "key", "=", "generateKey", "(", "httpRoute", ")", ";", "EventLoopPool", ".", "PerRo...
Borrow an HTTP/2 client channel. @param http2SrcHandler Relevant http/2 source handler where the source connection belongs to @param httpRoute the http route @return Http2ClientChannel
[ "Borrow", "an", "HTTP", "/", "2", "client", "channel", "." ]
train
https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java#L111-L133
Azure/azure-sdk-for-java
notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java
NotificationHubsInner.checkNotificationHubAvailabilityAsync
public Observable<CheckAvailabilityResultInner> checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1<ServiceResponse<CheckAvailabilityResultInner>, CheckAvailabilityResultInner>() { @Override public CheckAvailabilityResultInner call(ServiceResponse<CheckAvailabilityResultInner> response) { return response.body(); } }); }
java
public Observable<CheckAvailabilityResultInner> checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1<ServiceResponse<CheckAvailabilityResultInner>, CheckAvailabilityResultInner>() { @Override public CheckAvailabilityResultInner call(ServiceResponse<CheckAvailabilityResultInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "CheckAvailabilityResultInner", ">", "checkNotificationHubAvailabilityAsync", "(", "String", "resourceGroupName", ",", "String", "namespaceName", ",", "CheckAvailabilityParameters", "parameters", ")", "{", "return", "checkNotificationHubAvailabilityWi...
Checks the availability of the given notificationHub in a namespace. @param resourceGroupName The name of the resource group. @param namespaceName The namespace name. @param parameters The notificationHub name. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the CheckAvailabilityResultInner object
[ "Checks", "the", "availability", "of", "the", "given", "notificationHub", "in", "a", "namespace", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L176-L183
geomajas/geomajas-project-server
plugin/staticsecurity/staticsecurity-ldap/src/main/java/org/geomajas/plugin/staticsecurity/ldap/LdapAuthenticationService.java
LdapAuthenticationService.setNamedRoles
@Api public void setNamedRoles(Map<String, List<NamedRoleInfo>> namedRoles) { this.namedRoles = namedRoles; ldapRoleMapping = new HashMap<String, Set<String>>(); for (String roleName : namedRoles.keySet()) { if (!ldapRoleMapping.containsKey(roleName)) { ldapRoleMapping.put(roleName, new HashSet<String>()); } for (NamedRoleInfo role : namedRoles.get(roleName)) { ldapRoleMapping.get(roleName).add(role.getName()); } } }
java
@Api public void setNamedRoles(Map<String, List<NamedRoleInfo>> namedRoles) { this.namedRoles = namedRoles; ldapRoleMapping = new HashMap<String, Set<String>>(); for (String roleName : namedRoles.keySet()) { if (!ldapRoleMapping.containsKey(roleName)) { ldapRoleMapping.put(roleName, new HashSet<String>()); } for (NamedRoleInfo role : namedRoles.get(roleName)) { ldapRoleMapping.get(roleName).add(role.getName()); } } }
[ "@", "Api", "public", "void", "setNamedRoles", "(", "Map", "<", "String", ",", "List", "<", "NamedRoleInfo", ">", ">", "namedRoles", ")", "{", "this", ".", "namedRoles", "=", "namedRoles", ";", "ldapRoleMapping", "=", "new", "HashMap", "<", "String", ",", ...
Set the named roles which may be defined. @param roles map with roles, keys are the values for {@link #rolesAttribute}, probably DN values @since 1.10.0
[ "Set", "the", "named", "roles", "which", "may", "be", "defined", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/staticsecurity/staticsecurity-ldap/src/main/java/org/geomajas/plugin/staticsecurity/ldap/LdapAuthenticationService.java#L284-L296
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.getSite
private String getSite(CmsObject cms, CmsFavoriteEntry entry) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot()); Item item = m_sitesContainer.getItem(entry.getSiteRoot()); if (item != null) { return (String)(item.getItemProperty("caption").getValue()); } String result = entry.getSiteRoot(); if (site != null) { if (!CmsStringUtil.isEmpty(site.getTitle())) { result = site.getTitle(); } } return result; }
java
private String getSite(CmsObject cms, CmsFavoriteEntry entry) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot()); Item item = m_sitesContainer.getItem(entry.getSiteRoot()); if (item != null) { return (String)(item.getItemProperty("caption").getValue()); } String result = entry.getSiteRoot(); if (site != null) { if (!CmsStringUtil.isEmpty(site.getTitle())) { result = site.getTitle(); } } return result; }
[ "private", "String", "getSite", "(", "CmsObject", "cms", ",", "CmsFavoriteEntry", "entry", ")", "{", "CmsSite", "site", "=", "OpenCms", ".", "getSiteManager", "(", ")", ".", "getSiteForRootPath", "(", "entry", ".", "getSiteRoot", "(", ")", ")", ";", "Item", ...
Gets the site label for the entry. @param cms the current CMS context @param entry the entry @return the site label for the entry
[ "Gets", "the", "site", "label", "for", "the", "entry", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L393-L407
eyp/serfj
src/main/java/net/sf/serfj/UrlInspector.java
UrlInspector.isMainId
private Boolean isMainId(String id, String resource, String lastElement) { Boolean isMainId = false; if (id == null) { if (!utils.singularize(utils.cleanURL(lastElement)).equals(resource) && resource == null) { isMainId = true; } } return isMainId; }
java
private Boolean isMainId(String id, String resource, String lastElement) { Boolean isMainId = false; if (id == null) { if (!utils.singularize(utils.cleanURL(lastElement)).equals(resource) && resource == null) { isMainId = true; } } return isMainId; }
[ "private", "Boolean", "isMainId", "(", "String", "id", ",", "String", "resource", ",", "String", "lastElement", ")", "{", "Boolean", "isMainId", "=", "false", ";", "if", "(", "id", "==", "null", ")", "{", "if", "(", "!", "utils", ".", "singularize", "(...
Checks if is the main id, or it is a secondary id. @param id Current id. @param resource Current resource. @param lastElement Last element of the URL. @return true if is the main id, false otherwise.
[ "Checks", "if", "is", "the", "main", "id", "or", "it", "is", "a", "secondary", "id", "." ]
train
https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L117-L125
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.getHexEncoded
@Nonnull public static String getHexEncoded (@Nonnull final byte [] aInput, final int nOfs, final int nLen) { ValueEnforcer.isArrayOfsLen (aInput, nOfs, nLen); final StringBuilder aSB = new StringBuilder (nLen * 2); for (int i = nOfs; i < (nOfs + nLen); ++i) { final byte b = aInput[i]; final char c1 = getHexChar ((b & 0xf0) >> 4); final char c2 = getHexChar (b & 0x0f); aSB.append (c1).append (c2); } return aSB.toString (); }
java
@Nonnull public static String getHexEncoded (@Nonnull final byte [] aInput, final int nOfs, final int nLen) { ValueEnforcer.isArrayOfsLen (aInput, nOfs, nLen); final StringBuilder aSB = new StringBuilder (nLen * 2); for (int i = nOfs; i < (nOfs + nLen); ++i) { final byte b = aInput[i]; final char c1 = getHexChar ((b & 0xf0) >> 4); final char c2 = getHexChar (b & 0x0f); aSB.append (c1).append (c2); } return aSB.toString (); }
[ "@", "Nonnull", "public", "static", "String", "getHexEncoded", "(", "@", "Nonnull", "final", "byte", "[", "]", "aInput", ",", "final", "int", "nOfs", ",", "final", "int", "nLen", ")", "{", "ValueEnforcer", ".", "isArrayOfsLen", "(", "aInput", ",", "nOfs", ...
Convert a byte array to a hexadecimal encoded string. @param aInput The byte array to be converted to a String. May not be <code>null</code>. @param nOfs Byte array offset @param nLen Number of bytes to encode @return The String representation of the byte array.
[ "Convert", "a", "byte", "array", "to", "a", "hexadecimal", "encoded", "string", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L638-L652
wildfly/wildfly-core
security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtensionTransformerRegistration.java
SecurityManagerExtensionTransformerRegistration.registerTransformers
@Override public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) { ResourceTransformationDescriptionBuilder builder = ResourceTransformationDescriptionBuilder.Factory.createSubsystemInstance(); builder.addChildResource(DeploymentPermissionsResourceDefinition.DEPLOYMENT_PERMISSIONS_PATH). getAttributeBuilder().addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() { @Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode value, TransformationContext context) { // reject the maximum set if it is defined and empty as that would result in complete incompatible policies // being used in nodes running earlier versions of the subsystem. if (value.isDefined() && value.asList().isEmpty()) { return true; } return false; } @Override public String getRejectionLogMessage(Map<String, ModelNode> attributes) { return SecurityManagerLogger.ROOT_LOGGER.rejectedEmptyMaximumSet(); } }, DeploymentPermissionsResourceDefinition.MAXIMUM_PERMISSIONS); TransformationDescription.Tools.register(builder.build(), subsystemRegistration, EAP_7_0_0_MODEL_VERSION); }
java
@Override public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) { ResourceTransformationDescriptionBuilder builder = ResourceTransformationDescriptionBuilder.Factory.createSubsystemInstance(); builder.addChildResource(DeploymentPermissionsResourceDefinition.DEPLOYMENT_PERMISSIONS_PATH). getAttributeBuilder().addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() { @Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode value, TransformationContext context) { // reject the maximum set if it is defined and empty as that would result in complete incompatible policies // being used in nodes running earlier versions of the subsystem. if (value.isDefined() && value.asList().isEmpty()) { return true; } return false; } @Override public String getRejectionLogMessage(Map<String, ModelNode> attributes) { return SecurityManagerLogger.ROOT_LOGGER.rejectedEmptyMaximumSet(); } }, DeploymentPermissionsResourceDefinition.MAXIMUM_PERMISSIONS); TransformationDescription.Tools.register(builder.build(), subsystemRegistration, EAP_7_0_0_MODEL_VERSION); }
[ "@", "Override", "public", "void", "registerTransformers", "(", "SubsystemTransformerRegistration", "subsystemRegistration", ")", "{", "ResourceTransformationDescriptionBuilder", "builder", "=", "ResourceTransformationDescriptionBuilder", ".", "Factory", ".", "createSubsystemInstan...
Registers the transformers for JBoss EAP 7.0.0. @param subsystemRegistration contains data about the subsystem registration
[ "Registers", "the", "transformers", "for", "JBoss", "EAP", "7", ".", "0", ".", "0", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtensionTransformerRegistration.java#L50-L70
spring-projects/spring-hateoas
src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java
RepresentationModelProcessorInvoker.invokeProcessorsFor
public <T extends RepresentationModel<T>> T invokeProcessorsFor(T value) { Assert.notNull(value, "Value must not be null!"); return invokeProcessorsFor(value, ResolvableType.forClass(value.getClass())); }
java
public <T extends RepresentationModel<T>> T invokeProcessorsFor(T value) { Assert.notNull(value, "Value must not be null!"); return invokeProcessorsFor(value, ResolvableType.forClass(value.getClass())); }
[ "public", "<", "T", "extends", "RepresentationModel", "<", "T", ">", ">", "T", "invokeProcessorsFor", "(", "T", "value", ")", "{", "Assert", ".", "notNull", "(", "value", ",", "\"Value must not be null!\"", ")", ";", "return", "invokeProcessorsFor", "(", "valu...
Invokes all {@link RepresentationModelProcessor} instances registered for the type of the given value. @param value must not be {@literal null}. @return
[ "Invokes", "all", "{", "@link", "RepresentationModelProcessor", "}", "instances", "registered", "for", "the", "type", "of", "the", "given", "value", "." ]
train
https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java#L86-L91
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.get
private static int get(byte[] block, int offset, byte[] b, int off, int len) { System.arraycopy(block, offset, b, off, len); return len; }
java
private static int get(byte[] block, int offset, byte[] b, int off, int len) { System.arraycopy(block, offset, b, off, len); return len; }
[ "private", "static", "int", "get", "(", "byte", "[", "]", "block", ",", "int", "offset", ",", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "{", "System", ".", "arraycopy", "(", "block", ",", "offset", ",", "b", ",", "off", ...
Reads len bytes starting at the given offset in the given block into the given slice of the given byte array.
[ "Reads", "len", "bytes", "starting", "at", "the", "given", "offset", "in", "the", "given", "block", "into", "the", "given", "slice", "of", "the", "given", "byte", "array", "." ]
train
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L651-L654
joniles/mpxj
src/main/java/net/sf/mpxj/Task.java
Task.addChildTaskBefore
public void addChildTaskBefore(Task child, Task previousSibling) { int index = m_children.indexOf(previousSibling); if (index == -1) { m_children.add(child); } else { m_children.add(index, child); } child.m_parent = this; setSummary(true); if (getParentFile().getProjectConfig().getAutoOutlineLevel() == true) { child.setOutlineLevel(Integer.valueOf(NumberHelper.getInt(getOutlineLevel()) + 1)); } }
java
public void addChildTaskBefore(Task child, Task previousSibling) { int index = m_children.indexOf(previousSibling); if (index == -1) { m_children.add(child); } else { m_children.add(index, child); } child.m_parent = this; setSummary(true); if (getParentFile().getProjectConfig().getAutoOutlineLevel() == true) { child.setOutlineLevel(Integer.valueOf(NumberHelper.getInt(getOutlineLevel()) + 1)); } }
[ "public", "void", "addChildTaskBefore", "(", "Task", "child", ",", "Task", "previousSibling", ")", "{", "int", "index", "=", "m_children", ".", "indexOf", "(", "previousSibling", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "m_children", ".", ...
Inserts a child task prior to a given sibling task. @param child new child task @param previousSibling sibling task
[ "Inserts", "a", "child", "task", "prior", "to", "a", "given", "sibling", "task", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L280-L299
dadoonet/fscrawler
elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java
ElasticsearchClientV6.createIndex
public void createIndex(String index, boolean ignoreErrors, String indexSettings) throws IOException { logger.debug("create index [{}]", index); logger.trace("index settings: [{}]", indexSettings); CreateIndexRequest cir = new CreateIndexRequest(index); if (!isNullOrEmpty(indexSettings)) { cir.source(indexSettings, XContentType.JSON); } try { client.indices().create(cir, RequestOptions.DEFAULT); } catch (ElasticsearchStatusException e) { if (e.getMessage().contains("resource_already_exists_exception") && !ignoreErrors) { throw new RuntimeException("index already exists"); } if (!e.getMessage().contains("resource_already_exists_exception")) { throw e; } } waitForHealthyIndex(index); }
java
public void createIndex(String index, boolean ignoreErrors, String indexSettings) throws IOException { logger.debug("create index [{}]", index); logger.trace("index settings: [{}]", indexSettings); CreateIndexRequest cir = new CreateIndexRequest(index); if (!isNullOrEmpty(indexSettings)) { cir.source(indexSettings, XContentType.JSON); } try { client.indices().create(cir, RequestOptions.DEFAULT); } catch (ElasticsearchStatusException e) { if (e.getMessage().contains("resource_already_exists_exception") && !ignoreErrors) { throw new RuntimeException("index already exists"); } if (!e.getMessage().contains("resource_already_exists_exception")) { throw e; } } waitForHealthyIndex(index); }
[ "public", "void", "createIndex", "(", "String", "index", ",", "boolean", "ignoreErrors", ",", "String", "indexSettings", ")", "throws", "IOException", "{", "logger", ".", "debug", "(", "\"create index [{}]\"", ",", "index", ")", ";", "logger", ".", "trace", "(...
Create an index @param index index name @param ignoreErrors don't fail if the index already exists @param indexSettings index settings if any @throws IOException In case of error
[ "Create", "an", "index" ]
train
https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java#L232-L250
negusoft/holoaccent
HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java
BitmapUtils.changeTintColor
public static Bitmap changeTintColor(Bitmap bitmap, int originalColor, int destinationColor) { // original tint color int[] o = new int[] { Color.red(originalColor), Color.green(originalColor), Color.blue(originalColor) }; // destination tint color int[] d = new int[] { Color.red(destinationColor), Color.green(destinationColor), Color.blue(destinationColor) }; int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[] pixels = new int[width * height]; bitmap.getPixels(pixels, 0, width, 0, 0, width, height); int maxIndex = getMaxIndex(o); int mintIndex = getMinIndex(o); for (int i=0; i<pixels.length; i++) { int color = pixels[i]; // pixel color int[] p = new int[] { Color.red(color), Color.green(color), Color.blue(color) }; int alpha = Color.alpha(color); float[] transformation = calculateTransformation(o[maxIndex], o[mintIndex], p[maxIndex], p[mintIndex]); pixels[i] = applyTransformation(d, alpha, transformation); } return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888); }
java
public static Bitmap changeTintColor(Bitmap bitmap, int originalColor, int destinationColor) { // original tint color int[] o = new int[] { Color.red(originalColor), Color.green(originalColor), Color.blue(originalColor) }; // destination tint color int[] d = new int[] { Color.red(destinationColor), Color.green(destinationColor), Color.blue(destinationColor) }; int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[] pixels = new int[width * height]; bitmap.getPixels(pixels, 0, width, 0, 0, width, height); int maxIndex = getMaxIndex(o); int mintIndex = getMinIndex(o); for (int i=0; i<pixels.length; i++) { int color = pixels[i]; // pixel color int[] p = new int[] { Color.red(color), Color.green(color), Color.blue(color) }; int alpha = Color.alpha(color); float[] transformation = calculateTransformation(o[maxIndex], o[mintIndex], p[maxIndex], p[mintIndex]); pixels[i] = applyTransformation(d, alpha, transformation); } return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888); }
[ "public", "static", "Bitmap", "changeTintColor", "(", "Bitmap", "bitmap", ",", "int", "originalColor", ",", "int", "destinationColor", ")", "{", "// original tint color", "int", "[", "]", "o", "=", "new", "int", "[", "]", "{", "Color", ".", "red", "(", "or...
Creates a copy of the bitmap by calculating the transformation based on the original color and applying it to the the destination color. @param bitmap The original bitmap. @param originalColor Tint color in the original bitmap. @param destinationColor Tint color to be applied. @return A copy of the given bitmap with the tint color changed.
[ "Creates", "a", "copy", "of", "the", "bitmap", "by", "calculating", "the", "transformation", "based", "on", "the", "original", "color", "and", "applying", "it", "to", "the", "the", "destination", "color", "." ]
train
https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java#L79-L112
UrielCh/ovh-java-sdk
ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java
ApiOvhPrice.hpcspot_account_subscription_subscriptionName_GET
public OvhPrice hpcspot_account_subscription_subscriptionName_GET(net.minidev.ovh.api.price.hpcspot.account.OvhSubscriptionEnum subscriptionName) throws IOException { String qPath = "/price/hpcspot/account/subscription/{subscriptionName}"; StringBuilder sb = path(qPath, subscriptionName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPrice.class); }
java
public OvhPrice hpcspot_account_subscription_subscriptionName_GET(net.minidev.ovh.api.price.hpcspot.account.OvhSubscriptionEnum subscriptionName) throws IOException { String qPath = "/price/hpcspot/account/subscription/{subscriptionName}"; StringBuilder sb = path(qPath, subscriptionName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPrice.class); }
[ "public", "OvhPrice", "hpcspot_account_subscription_subscriptionName_GET", "(", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "price", ".", "hpcspot", ".", "account", ".", "OvhSubscriptionEnum", "subscriptionName", ")", "throws", "IOException", "{", "String", ...
Get the price of a HPC Spot Account for 1 month REST: GET /price/hpcspot/account/subscription/{subscriptionName} @param subscriptionName [required] Subscription
[ "Get", "the", "price", "of", "a", "HPC", "Spot", "Account", "for", "1", "month" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L219-L224