repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
218
func_name
stringlengths
5
140
whole_func_string
stringlengths
79
3.99k
language
stringclasses
1 value
func_code_string
stringlengths
79
3.99k
func_code_tokens
listlengths
20
624
func_documentation_string
stringlengths
61
1.96k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
107
339
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java
IdRange.parseRangeSequence
public static List<IdRange> parseRangeSequence(String idRangeSequence) { StringTokenizer tokenizer = new StringTokenizer(idRangeSequence, " "); List<IdRange> ranges = new ArrayList<>(); while (tokenizer.hasMoreTokens()) { ranges.add(parseRange(tokenizer.nextToken())); } return ranges; }
java
public static List<IdRange> parseRangeSequence(String idRangeSequence) { StringTokenizer tokenizer = new StringTokenizer(idRangeSequence, " "); List<IdRange> ranges = new ArrayList<>(); while (tokenizer.hasMoreTokens()) { ranges.add(parseRange(tokenizer.nextToken())); } return ranges; }
[ "public", "static", "List", "<", "IdRange", ">", "parseRangeSequence", "(", "String", "idRangeSequence", ")", "{", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "idRangeSequence", ",", "\" \"", ")", ";", "List", "<", "IdRange", ">", "ranges...
Parses a uid sequence, a comma separated list of uid ranges. <p/> Example: 1 2:5 8:* @param idRangeSequence the sequence @return a list of ranges, never null.
[ "Parses", "a", "uid", "sequence", "a", "comma", "separated", "list", "of", "uid", "ranges", ".", "<p", "/", ">", "Example", ":", "1", "2", ":", "5", "8", ":", "*" ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java#L52-L59
alkacon/opencms-core
src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java
CmsSiteManager.openDeleteDialog
public void openDeleteDialog(Set<String> data) { CmsDeleteSiteDialog form = new CmsDeleteSiteDialog(this, data); openDialog(form, CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_0)); }
java
public void openDeleteDialog(Set<String> data) { CmsDeleteSiteDialog form = new CmsDeleteSiteDialog(this, data); openDialog(form, CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_0)); }
[ "public", "void", "openDeleteDialog", "(", "Set", "<", "String", ">", "data", ")", "{", "CmsDeleteSiteDialog", "form", "=", "new", "CmsDeleteSiteDialog", "(", "this", ",", "data", ")", ";", "openDialog", "(", "form", ",", "CmsVaadinUtils", ".", "getMessageText...
Opens the delete dialog for the given sites.<p> @param data the site roots
[ "Opens", "the", "delete", "dialog", "for", "the", "given", "sites", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java#L292-L296
zanata/openprops
src/main/java/org/fedorahosted/openprops/Properties.java
Properties.setProperty
public synchronized Object setProperty(String key, String value) { if (key == null || value == null) throw new NullPointerException(); Entry entry = props.get(key); if (entry == null) { entry = new Entry("", value); props.put(key, entry); return null; } else { String result = entry.getValue(); entry.setValue(value); return result; } }
java
public synchronized Object setProperty(String key, String value) { if (key == null || value == null) throw new NullPointerException(); Entry entry = props.get(key); if (entry == null) { entry = new Entry("", value); props.put(key, entry); return null; } else { String result = entry.getValue(); entry.setValue(value); return result; } }
[ "public", "synchronized", "Object", "setProperty", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "key", "==", "null", "||", "value", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "Entry", "entry", "=", "pr...
Calls the <tt>Hashtable</tt> method <code>put</code>. Provided for parallelism with the <tt>getProperty</tt> method. Enforces use of strings for property keys and values. The value returned is the result of the <tt>Hashtable</tt> call to <code>put</code>. @param key the key to be placed into this property list. @param value the value corresponding to <tt>key</tt>. @return the previous value of the specified key in this property list, or <code>null</code> if it did not have one. @see #getProperty @since 1.2
[ "Calls", "the", "<tt", ">", "Hashtable<", "/", "tt", ">", "method", "<code", ">", "put<", "/", "code", ">", ".", "Provided", "for", "parallelism", "with", "the", "<tt", ">", "getProperty<", "/", "tt", ">", "method", ".", "Enforces", "use", "of", "strin...
train
https://github.com/zanata/openprops/blob/46510e610a765e4a91b302fc0d6a2123ed589603/src/main/java/org/fedorahosted/openprops/Properties.java#L154-L167
graphql-java/graphql-java
src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java
SchemaTypeExtensionsChecker.checkUnionTypeExtensions
private void checkUnionTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) { typeRegistry.unionTypeExtensions() .forEach((name, extensions) -> { checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, UnionTypeDefinition.class); checkTypeExtensionDirectiveRedefinition(errors, typeRegistry, name, extensions, UnionTypeDefinition.class); extensions.forEach(extension -> { List<TypeName> memberTypes = extension.getMemberTypes().stream() .map(t -> TypeInfo.typeInfo(t).getTypeName()).collect(Collectors.toList()); checkNamedUniqueness(errors, memberTypes, TypeName::getName, (namedMember, memberType) -> new NonUniqueNameError(extension, namedMember)); memberTypes.forEach( memberType -> { Optional<ObjectTypeDefinition> unionTypeDefinition = typeRegistry.getType(memberType, ObjectTypeDefinition.class); if (!unionTypeDefinition.isPresent()) { errors.add(new MissingTypeError("union member", extension, memberType)); } } ); }); }); }
java
private void checkUnionTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) { typeRegistry.unionTypeExtensions() .forEach((name, extensions) -> { checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, UnionTypeDefinition.class); checkTypeExtensionDirectiveRedefinition(errors, typeRegistry, name, extensions, UnionTypeDefinition.class); extensions.forEach(extension -> { List<TypeName> memberTypes = extension.getMemberTypes().stream() .map(t -> TypeInfo.typeInfo(t).getTypeName()).collect(Collectors.toList()); checkNamedUniqueness(errors, memberTypes, TypeName::getName, (namedMember, memberType) -> new NonUniqueNameError(extension, namedMember)); memberTypes.forEach( memberType -> { Optional<ObjectTypeDefinition> unionTypeDefinition = typeRegistry.getType(memberType, ObjectTypeDefinition.class); if (!unionTypeDefinition.isPresent()) { errors.add(new MissingTypeError("union member", extension, memberType)); } } ); }); }); }
[ "private", "void", "checkUnionTypeExtensions", "(", "List", "<", "GraphQLError", ">", "errors", ",", "TypeDefinitionRegistry", "typeRegistry", ")", "{", "typeRegistry", ".", "unionTypeExtensions", "(", ")", ".", "forEach", "(", "(", "name", ",", "extensions", ")",...
/* Union type extensions have the potential to be invalid if incorrectly defined. The named type must already be defined and must be a Union type. The member types of a Union type extension must all be Object base types; Scalar, Interface and Union types must not be member types of a Union. Similarly, wrapping types must not be member types of a Union. All member types of a Union type extension must be unique. All member types of a Union type extension must not already be a member of the original Union type. Any directives provided must not already apply to the original Union type.
[ "/", "*", "Union", "type", "extensions", "have", "the", "potential", "to", "be", "invalid", "if", "incorrectly", "defined", "." ]
train
https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java#L174-L197
atomix/catalyst
serializer/src/main/java/io/atomix/catalyst/serializer/Serializer.java
Serializer.registerAbstract
public Serializer registerAbstract(Class<?> abstractType, Class<? extends TypeSerializer> serializer) { registry.registerAbstract(abstractType, serializer); return this; }
java
public Serializer registerAbstract(Class<?> abstractType, Class<? extends TypeSerializer> serializer) { registry.registerAbstract(abstractType, serializer); return this; }
[ "public", "Serializer", "registerAbstract", "(", "Class", "<", "?", ">", "abstractType", ",", "Class", "<", "?", "extends", "TypeSerializer", ">", "serializer", ")", "{", "registry", ".", "registerAbstract", "(", "abstractType", ",", "serializer", ")", ";", "r...
Registers an abstract type serializer for the given abstract type. <p> Abstract serializers allow abstract types to be serialized without explicitly registering a concrete type. The concept of abstract serializers differs from {@link #registerDefault(Class, TypeSerializerFactory) default serializers} in that abstract serializers can be registered with a serializable type ID, and types {@link #register(Class) registered} without a specific {@link TypeSerializer} do not inheret from abstract serializers. <pre> {@code serializer.registerAbstract(List.class, AbstractListSerializer.class); } </pre> @param abstractType The abstract type for which to register the abstract serializer. Types that extend the abstract type will be serialized using the given abstract serializer unless a serializer has been registered for the specific concrete type. @param serializer The abstract type serializer with which to serialize instances of the abstract type. @return The serializer. @throws NullPointerException if the {@code abstractType} or {@code serializer} is {@code null}
[ "Registers", "an", "abstract", "type", "serializer", "for", "the", "given", "abstract", "type", ".", "<p", ">", "Abstract", "serializers", "allow", "abstract", "types", "to", "be", "serialized", "without", "explicitly", "registering", "a", "concrete", "type", "....
train
https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/serializer/src/main/java/io/atomix/catalyst/serializer/Serializer.java#L504-L507
agmip/ace-core
src/main/java/org/agmip/ace/AceComponent.java
AceComponent.getRawSubcomponent
public byte[] getRawSubcomponent(String key) throws IOException { JsonParser p = this.getParser(); JsonToken t = p.nextToken(); while (t != null) { if (t == JsonToken.FIELD_NAME && p.getCurrentName().equals(key)) { t = p.nextToken(); if (t == JsonToken.START_OBJECT) { JsonGenerator g = this.getGenerator(); g.copyCurrentStructure(p); g.flush(); byte[] subcomponent = ((ByteArrayOutputStream) g .getOutputTarget()).toByteArray(); g.close(); p.close(); return subcomponent; } else { log.error("Key {} does not start an object.", key); return AceFunctions.getBlankComponent(); } } t = p.nextToken(); } // log.debug("Did not find key: {} in {}", key, new String(this.component, "UTF-8")); return AceFunctions.getBlankComponent(); }
java
public byte[] getRawSubcomponent(String key) throws IOException { JsonParser p = this.getParser(); JsonToken t = p.nextToken(); while (t != null) { if (t == JsonToken.FIELD_NAME && p.getCurrentName().equals(key)) { t = p.nextToken(); if (t == JsonToken.START_OBJECT) { JsonGenerator g = this.getGenerator(); g.copyCurrentStructure(p); g.flush(); byte[] subcomponent = ((ByteArrayOutputStream) g .getOutputTarget()).toByteArray(); g.close(); p.close(); return subcomponent; } else { log.error("Key {} does not start an object.", key); return AceFunctions.getBlankComponent(); } } t = p.nextToken(); } // log.debug("Did not find key: {} in {}", key, new String(this.component, "UTF-8")); return AceFunctions.getBlankComponent(); }
[ "public", "byte", "[", "]", "getRawSubcomponent", "(", "String", "key", ")", "throws", "IOException", "{", "JsonParser", "p", "=", "this", ".", "getParser", "(", ")", ";", "JsonToken", "t", "=", "p", ".", "nextToken", "(", ")", ";", "while", "(", "t", ...
Return the {@code byte[]} JSON object for the key in this component. Like {@link #getValueOr} for subcomponents. This will grab the JSON object for a subcomponent (for example: {@code initial_condition} for {@link AceExperiment}). If the key is not found or is not a JSON object, a blank subcomponent is returned. @param key key for a JSON object in this component. @return {@code byte[]} for the JSON object or {@code {}} @throws IOException if there is an I/O error
[ "Return", "the", "{", "@code", "byte", "[]", "}", "JSON", "object", "for", "the", "key", "in", "this", "component", "." ]
train
https://github.com/agmip/ace-core/blob/51957e79b4567d0083c52d0720f4a268c3a02f44/src/main/java/org/agmip/ace/AceComponent.java#L275-L300
mozilla/rhino
src/org/mozilla/javascript/ScriptRuntime.java
ScriptRuntime.enumInit
@Deprecated public static Object enumInit(Object value, Context cx, boolean enumValues) { return enumInit(value, cx, enumValues ? ENUMERATE_VALUES : ENUMERATE_KEYS); }
java
@Deprecated public static Object enumInit(Object value, Context cx, boolean enumValues) { return enumInit(value, cx, enumValues ? ENUMERATE_VALUES : ENUMERATE_KEYS); }
[ "@", "Deprecated", "public", "static", "Object", "enumInit", "(", "Object", "value", ",", "Context", "cx", ",", "boolean", "enumValues", ")", "{", "return", "enumInit", "(", "value", ",", "cx", ",", "enumValues", "?", "ENUMERATE_VALUES", ":", "ENUMERATE_KEYS",...
For backwards compatibility with generated class files @deprecated Use {@link #enumInit(Object, Context, Scriptable, int)} instead
[ "For", "backwards", "compatibility", "with", "generated", "class", "files" ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2215-L2220
urbanairship/datacube
src/main/java/com/urbanairship/datacube/Util.java
Util.hashByteArray
public static byte hashByteArray(byte[] array, int startInclusive, int endExclusive) { if (array == null) { return 0; } int range = endExclusive - startInclusive; if (range < 0) { throw new IllegalArgumentException(startInclusive + " > " + endExclusive); } int result = 1; for (int i=startInclusive; i<endExclusive; i++){ result = 31 * result + array[i]; } return (byte)result; }
java
public static byte hashByteArray(byte[] array, int startInclusive, int endExclusive) { if (array == null) { return 0; } int range = endExclusive - startInclusive; if (range < 0) { throw new IllegalArgumentException(startInclusive + " > " + endExclusive); } int result = 1; for (int i=startInclusive; i<endExclusive; i++){ result = 31 * result + array[i]; } return (byte)result; }
[ "public", "static", "byte", "hashByteArray", "(", "byte", "[", "]", "array", ",", "int", "startInclusive", ",", "int", "endExclusive", ")", "{", "if", "(", "array", "==", "null", ")", "{", "return", "0", ";", "}", "int", "range", "=", "endExclusive", "...
A utility to allow hashing of a portion of an array without having to copy it. @param array @param startInclusive @param endExclusive @return hash byte
[ "A", "utility", "to", "allow", "hashing", "of", "a", "portion", "of", "an", "array", "without", "having", "to", "copy", "it", "." ]
train
https://github.com/urbanairship/datacube/blob/89c6b68744cc384c8b49f921cdb0a0f9f414ada6/src/main/java/com/urbanairship/datacube/Util.java#L87-L103
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java
ConnectionManagerServiceImpl.validateProperty
private static final <E extends Enum<E>> E validateProperty(Map<String, Object> map, String propName, E defaultVal, Class<E> type, ConnectorService connectorSvc) { String strVal = (String) map.remove(propName); if (strVal == null) return defaultVal; try { return E.valueOf(type, strVal); } catch (RuntimeException x) { x = connectorSvc.ignoreWarnOrFail(tc, x, x.getClass(), "UNSUPPORTED_VALUE_J2CA8011", strVal, propName, CONNECTION_MANAGER); if (x == null) return defaultVal; else throw x; } }
java
private static final <E extends Enum<E>> E validateProperty(Map<String, Object> map, String propName, E defaultVal, Class<E> type, ConnectorService connectorSvc) { String strVal = (String) map.remove(propName); if (strVal == null) return defaultVal; try { return E.valueOf(type, strVal); } catch (RuntimeException x) { x = connectorSvc.ignoreWarnOrFail(tc, x, x.getClass(), "UNSUPPORTED_VALUE_J2CA8011", strVal, propName, CONNECTION_MANAGER); if (x == null) return defaultVal; else throw x; } }
[ "private", "static", "final", "<", "E", "extends", "Enum", "<", "E", ">", ">", "E", "validateProperty", "(", "Map", "<", "String", ",", "Object", ">", "map", ",", "String", "propName", ",", "E", "defaultVal", ",", "Class", "<", "E", ">", "type", ",",...
Method tests whether a property's value is valid or not.<p> This method will also handle raising an exception or Tr message if the property is invalid. @param map map of configured properties @param propName the name of the property being tested @param defaultVal the default value @param type enumeration consisting of the valid values @param connectorSvc connector service @return the configured value if the value is valid, else the default value
[ "Method", "tests", "whether", "a", "property", "s", "value", "is", "valid", "or", "not", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java#L644-L658
erizet/SignalA
SignalA/src/main/java/com/zsoft/signala/Hubs/HubProxy.java
HubProxy.InvokeEvent
public void InvokeEvent(String eventName, JSONArray args) { HubOnDataCallback subscription; if(mSubscriptions.containsKey(eventName)) { subscription = mSubscriptions.get(eventName); subscription.OnReceived(args); } }
java
public void InvokeEvent(String eventName, JSONArray args) { HubOnDataCallback subscription; if(mSubscriptions.containsKey(eventName)) { subscription = mSubscriptions.get(eventName); subscription.OnReceived(args); } }
[ "public", "void", "InvokeEvent", "(", "String", "eventName", ",", "JSONArray", "args", ")", "{", "HubOnDataCallback", "subscription", ";", "if", "(", "mSubscriptions", ".", "containsKey", "(", "eventName", ")", ")", "{", "subscription", "=", "mSubscriptions", "....
K�r event lokalt som anropas fr�n servern och som registrerats i ON-metod.
[ "K�r", "event", "lokalt", "som", "anropas", "fr�n", "servern", "och", "som", "registrerats", "i", "ON", "-", "metod", "." ]
train
https://github.com/erizet/SignalA/blob/d33bf49dbcf7249f826c5dbb3411cfe4f5d97dd4/SignalA/src/main/java/com/zsoft/signala/Hubs/HubProxy.java#L94-L102
scalecube/socketio
src/main/java/io/scalecube/socketio/SocketIOServer.java
SocketIOServer.newInstance
public static SocketIOServer newInstance(int port, SslContext sslContext) { return new SocketIOServer(ServerConfiguration.builder() .port(port) .sslContext(sslContext) .build()); }
java
public static SocketIOServer newInstance(int port, SslContext sslContext) { return new SocketIOServer(ServerConfiguration.builder() .port(port) .sslContext(sslContext) .build()); }
[ "public", "static", "SocketIOServer", "newInstance", "(", "int", "port", ",", "SslContext", "sslContext", ")", "{", "return", "new", "SocketIOServer", "(", "ServerConfiguration", ".", "builder", "(", ")", ".", "port", "(", "port", ")", ".", "sslContext", "(", ...
Creates instance of Socket.IO server with the given secure port.
[ "Creates", "instance", "of", "Socket", ".", "IO", "server", "with", "the", "given", "secure", "port", "." ]
train
https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/SocketIOServer.java#L83-L88
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.getImportable
public BtrpOperand getImportable(String label, String namespace) { if (canImport(label, namespace)) { return exported.get(label); } return null; }
java
public BtrpOperand getImportable(String label, String namespace) { if (canImport(label, namespace)) { return exported.get(label); } return null; }
[ "public", "BtrpOperand", "getImportable", "(", "String", "label", ",", "String", "namespace", ")", "{", "if", "(", "canImport", "(", "label", ",", "namespace", ")", ")", "{", "return", "exported", ".", "get", "(", "label", ")", ";", "}", "return", "null"...
Get the exported operand from its label. @param label the operand label @param namespace the namespace of the script that ask for this operand. @return the operand if exists or {@code null}
[ "Get", "the", "exported", "operand", "from", "its", "label", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L224-L229
line/armeria
core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java
HttpAuthServiceBuilder.addOAuth1a
public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) { return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")), requireNonNull(authorizer, "authorizer")); }
java
public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) { return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")), requireNonNull(authorizer, "authorizer")); }
[ "public", "HttpAuthServiceBuilder", "addOAuth1a", "(", "Authorizer", "<", "?", "super", "OAuth1aToken", ">", "authorizer", ",", "AsciiString", "header", ")", "{", "return", "addTokenAuthorizer", "(", "new", "OAuth1aTokenExtractor", "(", "requireNonNull", "(", "header"...
Adds an OAuth1a {@link Authorizer} for the given {@code header}.
[ "Adds", "an", "OAuth1a", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java#L101-L104
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.onSizeChanged
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { if (w != oldw || h != oldh) { mNeedsResize = true; } }
java
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { if (w != oldw || h != oldh) { mNeedsResize = true; } }
[ "@", "Override", "protected", "void", "onSizeChanged", "(", "int", "w", ",", "int", "h", ",", "int", "oldw", ",", "int", "oldh", ")", "{", "if", "(", "w", "!=", "oldw", "||", "h", "!=", "oldh", ")", "{", "mNeedsResize", "=", "true", ";", "}", "}"...
If the text view size changed, set the force resize flag to true
[ "If", "the", "text", "view", "size", "changed", "set", "the", "force", "resize", "flag", "to", "true" ]
train
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L97-L102
bremersee/sms
src/main/java/org/bremersee/sms/GoyyaSmsService.java
GoyyaSmsService.createTrustAllManagers
protected TrustManager[] createTrustAllManagers() { return new TrustManager[]{ new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } }}; }
java
protected TrustManager[] createTrustAllManagers() { return new TrustManager[]{ new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } }}; }
[ "protected", "TrustManager", "[", "]", "createTrustAllManagers", "(", ")", "{", "return", "new", "TrustManager", "[", "]", "{", "new", "X509TrustManager", "(", ")", "{", "@", "Override", "public", "X509Certificate", "[", "]", "getAcceptedIssuers", "(", ")", "{...
Creates an array of trust managers which trusts all X509 certificates. @return the trust manager [ ]
[ "Creates", "an", "array", "of", "trust", "managers", "which", "trusts", "all", "X509", "certificates", "." ]
train
https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L464-L482
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java
RegionForwardingRuleId.of
public static RegionForwardingRuleId of(RegionId regionId, String rule) { return new RegionForwardingRuleId(regionId.getProject(), regionId.getRegion(), rule); }
java
public static RegionForwardingRuleId of(RegionId regionId, String rule) { return new RegionForwardingRuleId(regionId.getProject(), regionId.getRegion(), rule); }
[ "public", "static", "RegionForwardingRuleId", "of", "(", "RegionId", "regionId", ",", "String", "rule", ")", "{", "return", "new", "RegionForwardingRuleId", "(", "regionId", ".", "getProject", "(", ")", ",", "regionId", ".", "getRegion", "(", ")", ",", "rule",...
Returns a region forwarding rule identity given the region identity and the rule name. The forwarding rule name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. @see <a href="https://www.ietf.org/rfc/rfc1035.txt">RFC1035</a>
[ "Returns", "a", "region", "forwarding", "rule", "identity", "given", "the", "region", "identity", "and", "the", "rule", "name", ".", "The", "forwarding", "rule", "name", "must", "be", "1", "-", "63", "characters", "long", "and", "comply", "with", "RFC1035", ...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java#L115-L117
alkacon/opencms-core
src/org/opencms/util/CmsManyToOneMap.java
CmsManyToOneMap.put
public void put(K key, V value) { m_forwardMap.put(key, value); m_reverseMap.put(value, key); }
java
public void put(K key, V value) { m_forwardMap.put(key, value); m_reverseMap.put(value, key); }
[ "public", "void", "put", "(", "K", "key", ",", "V", "value", ")", "{", "m_forwardMap", ".", "put", "(", "key", ",", "value", ")", ";", "m_reverseMap", ".", "put", "(", "value", ",", "key", ")", ";", "}" ]
Associates a value with a key.<p> @param key the key @param value the value
[ "Associates", "a", "value", "with", "a", "key", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsManyToOneMap.java#L92-L97
netty/netty
example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java
HttpStaticFileServerHandler.sendNotModified
private void sendNotModified(ChannelHandlerContext ctx) { FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED); setDateHeader(response); this.sendAndCleanupConnection(ctx, response); }
java
private void sendNotModified(ChannelHandlerContext ctx) { FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED); setDateHeader(response); this.sendAndCleanupConnection(ctx, response); }
[ "private", "void", "sendNotModified", "(", "ChannelHandlerContext", "ctx", ")", "{", "FullHttpResponse", "response", "=", "new", "DefaultFullHttpResponse", "(", "HTTP_1_1", ",", "NOT_MODIFIED", ")", ";", "setDateHeader", "(", "response", ")", ";", "this", ".", "se...
When file timestamp is the same as what the browser is sending up, send a "304 Not Modified" @param ctx Context
[ "When", "file", "timestamp", "is", "the", "same", "as", "what", "the", "browser", "is", "sending", "up", "send", "a", "304", "Not", "Modified" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java#L338-L343
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java
ExpressionToken.mapLookup
protected final Object mapLookup(Map map, Object key) { LOGGER.trace("get value from Map"); return map.get(key); }
java
protected final Object mapLookup(Map map, Object key) { LOGGER.trace("get value from Map"); return map.get(key); }
[ "protected", "final", "Object", "mapLookup", "(", "Map", "map", ",", "Object", "key", ")", "{", "LOGGER", ".", "trace", "(", "\"get value from Map\"", ")", ";", "return", "map", ".", "get", "(", "key", ")", ";", "}" ]
Lookup the <code>key</code> in the <code>map</code>. @param map the map @param key the key @return the value found at <code>map.get(key)</code> or <code>null</code> if no value was found
[ "Lookup", "the", "<code", ">", "key<", "/", "code", ">", "in", "the", "<code", ">", "map<", "/", "code", ">", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java#L50-L53
ibm-bluemix-mobile-services/bms-clientsdk-android-core
lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java
AuthorizationProcessManager.authorizationRequestSend
private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) { try { AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager(); authorizationRequestManager.initialize(context, listener); authorizationRequestManager.sendRequest(path, options); } catch (Exception e) { throw new RuntimeException("Failed to send authorization request", e); } }
java
private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) { try { AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager(); authorizationRequestManager.initialize(context, listener); authorizationRequestManager.sendRequest(path, options); } catch (Exception e) { throw new RuntimeException("Failed to send authorization request", e); } }
[ "private", "void", "authorizationRequestSend", "(", "final", "Context", "context", ",", "String", "path", ",", "AuthorizationRequestManager", ".", "RequestOptions", "options", ",", "ResponseListener", "listener", ")", "{", "try", "{", "AuthorizationRequestManager", "aut...
Use authorization request agent for sending the request @param context android activity that will handle authentication (facebook, google) @param path path to the server @param options send options @param listener response listener
[ "Use", "authorization", "request", "agent", "for", "sending", "the", "request" ]
train
https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java#L418-L426
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel1D_F64.java
Kernel1D_F64.wrap
public static Kernel1D_F64 wrap(double data[], int width, int offset ) { Kernel1D_F64 ret = new Kernel1D_F64(); ret.data = data; ret.width = width; ret.offset = offset; return ret; }
java
public static Kernel1D_F64 wrap(double data[], int width, int offset ) { Kernel1D_F64 ret = new Kernel1D_F64(); ret.data = data; ret.width = width; ret.offset = offset; return ret; }
[ "public", "static", "Kernel1D_F64", "wrap", "(", "double", "data", "[", "]", ",", "int", "width", ",", "int", "offset", ")", "{", "Kernel1D_F64", "ret", "=", "new", "Kernel1D_F64", "(", ")", ";", "ret", ".", "data", "=", "data", ";", "ret", ".", "wid...
Creates a kernel whose elements are the specified data array and has the specified width. @param data The array who will be the kernel's data. Reference is saved. @param width The kernel's width. @param offset Location of the origin in the array @return A new kernel.
[ "Creates", "a", "kernel", "whose", "elements", "are", "the", "specified", "data", "array", "and", "has", "the", "specified", "width", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel1D_F64.java#L103-L110
jbake-org/jbake
jbake-core/src/main/java/org/jbake/util/HtmlUtil.java
HtmlUtil.fixImageSourceUrls
public static void fixImageSourceUrls(Map<String, Object> fileContents, JBakeConfiguration configuration) { String htmlContent = fileContents.get(Attributes.BODY).toString(); boolean prependSiteHost = configuration.getImgPathPrependHost(); String siteHost = configuration.getSiteHost(); String uri = getDocumentUri(fileContents); Document document = Jsoup.parseBodyFragment(htmlContent); Elements allImgs = document.getElementsByTag("img"); for (Element img : allImgs) { transformImageSource(img, uri, siteHost, prependSiteHost); } //Use body().html() to prevent adding <body></body> from parsed fragment. fileContents.put(Attributes.BODY, document.body().html()); }
java
public static void fixImageSourceUrls(Map<String, Object> fileContents, JBakeConfiguration configuration) { String htmlContent = fileContents.get(Attributes.BODY).toString(); boolean prependSiteHost = configuration.getImgPathPrependHost(); String siteHost = configuration.getSiteHost(); String uri = getDocumentUri(fileContents); Document document = Jsoup.parseBodyFragment(htmlContent); Elements allImgs = document.getElementsByTag("img"); for (Element img : allImgs) { transformImageSource(img, uri, siteHost, prependSiteHost); } //Use body().html() to prevent adding <body></body> from parsed fragment. fileContents.put(Attributes.BODY, document.body().html()); }
[ "public", "static", "void", "fixImageSourceUrls", "(", "Map", "<", "String", ",", "Object", ">", "fileContents", ",", "JBakeConfiguration", "configuration", ")", "{", "String", "htmlContent", "=", "fileContents", ".", "get", "(", "Attributes", ".", "BODY", ")", ...
Image paths are specified as w.r.t. assets folder. This function prefix site host to all img src except the ones that starts with http://, https://. <p> If image path starts with "./", i.e. relative to the source file, then it first replace that with output file directory and the add site host. @param fileContents Map representing file contents @param configuration Configuration object
[ "Image", "paths", "are", "specified", "as", "w", ".", "r", ".", "t", ".", "assets", "folder", ".", "This", "function", "prefix", "site", "host", "to", "all", "img", "src", "except", "the", "ones", "that", "starts", "with", "http", ":", "//", "https", ...
train
https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/util/HtmlUtil.java#L29-L44
grails/grails-core
grails-encoder/src/main/groovy/org/grails/buffer/StreamCharBuffer.java
StreamCharBuffer.methodMissing
public Object methodMissing(String name, Object args) { String str = this.toString(); return InvokerHelper.invokeMethod(str, name, args); }
java
public Object methodMissing(String name, Object args) { String str = this.toString(); return InvokerHelper.invokeMethod(str, name, args); }
[ "public", "Object", "methodMissing", "(", "String", "name", ",", "Object", "args", ")", "{", "String", "str", "=", "this", ".", "toString", "(", ")", ";", "return", "InvokerHelper", ".", "invokeMethod", "(", "str", ",", "name", ",", "args", ")", ";", "...
Delegates methodMissing to String object @param name The name of the method @param args The arguments @return The return value
[ "Delegates", "methodMissing", "to", "String", "object" ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/buffer/StreamCharBuffer.java#L2910-L2913
SimiaCryptus/utilities
java-util/src/main/java/com/simiacryptus/util/Util.java
Util.binaryStream
public static Stream<byte[]> binaryStream(final String path, @javax.annotation.Nonnull final String name, final int skip, final int recordSize) throws IOException { @javax.annotation.Nonnull final File file = new File(path, name); final byte[] fileData = IOUtils.toByteArray(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(file))))); @javax.annotation.Nonnull final DataInputStream in = new DataInputStream(new ByteArrayInputStream(fileData)); in.skip(skip); return com.simiacryptus.util.Util.toIterator(new BinaryChunkIterator(in, recordSize)); }
java
public static Stream<byte[]> binaryStream(final String path, @javax.annotation.Nonnull final String name, final int skip, final int recordSize) throws IOException { @javax.annotation.Nonnull final File file = new File(path, name); final byte[] fileData = IOUtils.toByteArray(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(file))))); @javax.annotation.Nonnull final DataInputStream in = new DataInputStream(new ByteArrayInputStream(fileData)); in.skip(skip); return com.simiacryptus.util.Util.toIterator(new BinaryChunkIterator(in, recordSize)); }
[ "public", "static", "Stream", "<", "byte", "[", "]", ">", "binaryStream", "(", "final", "String", "path", ",", "@", "javax", ".", "annotation", ".", "Nonnull", "final", "String", "name", ",", "final", "int", "skip", ",", "final", "int", "recordSize", ")"...
Binary stream stream. @param path the path @param name the name @param skip the skip @param recordSize the record size @return the stream @throws IOException the io exception
[ "Binary", "stream", "stream", "." ]
train
https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/Util.java#L97-L103
dbracewell/hermes
hermes-core/src/main/java/com/davidbracewell/hermes/ml/BIOTrainer.java
BIOTrainer.getDataset
protected Dataset<Sequence> getDataset(SequenceFeaturizer<Annotation> featurizer) { Corpus c = Corpus .builder() .corpusType(corpusType) .source(corpus) .format(corpusFormat) .build(); AnnotatableType[] required = required(); if (required.length > 0) { c = c.annotate(required); } return c.asSequenceDataSet(new BIOLabelMaker(trainingAnnotation, validTags()), featurizer); }
java
protected Dataset<Sequence> getDataset(SequenceFeaturizer<Annotation> featurizer) { Corpus c = Corpus .builder() .corpusType(corpusType) .source(corpus) .format(corpusFormat) .build(); AnnotatableType[] required = required(); if (required.length > 0) { c = c.annotate(required); } return c.asSequenceDataSet(new BIOLabelMaker(trainingAnnotation, validTags()), featurizer); }
[ "protected", "Dataset", "<", "Sequence", ">", "getDataset", "(", "SequenceFeaturizer", "<", "Annotation", ">", "featurizer", ")", "{", "Corpus", "c", "=", "Corpus", ".", "builder", "(", ")", ".", "corpusType", "(", "corpusType", ")", ".", "source", "(", "c...
Gets dataset. @param featurizer the featurizer @return the dataset
[ "Gets", "dataset", "." ]
train
https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/ml/BIOTrainer.java#L107-L119
m-m-m/util
io/src/main/java/net/sf/mmm/util/file/base/FileAccessPermissions.java
FileAccessPermissions.setBits
private void setBits(int bitMask, boolean set) { if (set) { this.maskBits = this.maskBits | bitMask; } else { this.maskBits = this.maskBits & ~bitMask; } }
java
private void setBits(int bitMask, boolean set) { if (set) { this.maskBits = this.maskBits | bitMask; } else { this.maskBits = this.maskBits & ~bitMask; } }
[ "private", "void", "setBits", "(", "int", "bitMask", ",", "boolean", "set", ")", "{", "if", "(", "set", ")", "{", "this", ".", "maskBits", "=", "this", ".", "maskBits", "|", "bitMask", ";", "}", "else", "{", "this", ".", "maskBits", "=", "this", "....
This method sets or unsets the flags given by {@code bitMask} in this {@link #getMaskBits() mask} according to the given {@code flag}. @param bitMask is the bit-mask of the flag(s) to set or unset. @param set - if {@code true} the flag(s) will be set, if {@code false} they will be unset.
[ "This", "method", "sets", "or", "unsets", "the", "flags", "given", "by", "{", "@code", "bitMask", "}", "in", "this", "{", "@link", "#getMaskBits", "()", "mask", "}", "according", "to", "the", "given", "{", "@code", "flag", "}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/io/src/main/java/net/sf/mmm/util/file/base/FileAccessPermissions.java#L374-L381
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.getSiteDiagnosticCategoryAsync
public Observable<DiagnosticCategoryInner> getSiteDiagnosticCategoryAsync(String resourceGroupName, String siteName, String diagnosticCategory) { return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).map(new Func1<ServiceResponse<DiagnosticCategoryInner>, DiagnosticCategoryInner>() { @Override public DiagnosticCategoryInner call(ServiceResponse<DiagnosticCategoryInner> response) { return response.body(); } }); }
java
public Observable<DiagnosticCategoryInner> getSiteDiagnosticCategoryAsync(String resourceGroupName, String siteName, String diagnosticCategory) { return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).map(new Func1<ServiceResponse<DiagnosticCategoryInner>, DiagnosticCategoryInner>() { @Override public DiagnosticCategoryInner call(ServiceResponse<DiagnosticCategoryInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "DiagnosticCategoryInner", ">", "getSiteDiagnosticCategoryAsync", "(", "String", "resourceGroupName", ",", "String", "siteName", ",", "String", "diagnosticCategory", ")", "{", "return", "getSiteDiagnosticCategoryWithServiceResponseAsync", "(", "re...
Get Diagnostics Category. Get Diagnostics Category. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Diagnostic Category @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the DiagnosticCategoryInner object
[ "Get", "Diagnostics", "Category", ".", "Get", "Diagnostics", "Category", "." ]
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#L329-L336
UrielCh/ovh-java-sdk
ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java
ApiOvhDomain.data_extension_GET
public ArrayList<String> data_extension_GET(OvhCountryEnum country) throws IOException { String qPath = "/domain/data/extension"; StringBuilder sb = path(qPath); query(sb, "country", country); String resp = execN(qPath, "GET", sb.toString(), null); return convertTo(resp, t2); }
java
public ArrayList<String> data_extension_GET(OvhCountryEnum country) throws IOException { String qPath = "/domain/data/extension"; StringBuilder sb = path(qPath); query(sb, "country", country); String resp = execN(qPath, "GET", sb.toString(), null); return convertTo(resp, t2); }
[ "public", "ArrayList", "<", "String", ">", "data_extension_GET", "(", "OvhCountryEnum", "country", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/domain/data/extension\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ")", ";", "query", ...
List all the extensions for a specific country REST: GET /domain/data/extension @param country [required] Country targeted
[ "List", "all", "the", "extensions", "for", "a", "specific", "country" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L230-L236
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
DefaultGroovyMethodsSupport.tryClose
static Throwable tryClose(AutoCloseable closeable, boolean logWarning) { Throwable thrown = null; if (closeable != null) { try { closeable.close(); } catch (Exception e) { thrown = e; if (logWarning) { LOG.warning("Caught exception during close(): " + e); } } } return thrown; }
java
static Throwable tryClose(AutoCloseable closeable, boolean logWarning) { Throwable thrown = null; if (closeable != null) { try { closeable.close(); } catch (Exception e) { thrown = e; if (logWarning) { LOG.warning("Caught exception during close(): " + e); } } } return thrown; }
[ "static", "Throwable", "tryClose", "(", "AutoCloseable", "closeable", ",", "boolean", "logWarning", ")", "{", "Throwable", "thrown", "=", "null", ";", "if", "(", "closeable", "!=", "null", ")", "{", "try", "{", "closeable", ".", "close", "(", ")", ";", "...
Attempts to close the closeable returning rather than throwing any Exception that may occur. @param closeable the thing to close @param logWarning if true will log a warning if an exception occurs @return throwable Exception from the close method, else null
[ "Attempts", "to", "close", "the", "closeable", "returning", "rather", "than", "throwing", "any", "Exception", "that", "may", "occur", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java#L132-L145
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/storage/DefaultExternalContentManager.java
DefaultExternalContentManager.getFileDatastreamHeaders
private static Property[] getFileDatastreamHeaders(String canonicalPath, long lastModified) { Property[] result = new Property[3]; String eTag = MD5Utility.getBase16Hash(canonicalPath.concat(Long.toString(lastModified))); result[0] = new Property(HttpHeaders.ACCEPT_RANGES,"bytes"); result[1] = new Property(HttpHeaders.ETAG, eTag); result[2] = new Property(HttpHeaders.LAST_MODIFIED, DateUtil.formatDate(new Date(lastModified))); return result; }
java
private static Property[] getFileDatastreamHeaders(String canonicalPath, long lastModified) { Property[] result = new Property[3]; String eTag = MD5Utility.getBase16Hash(canonicalPath.concat(Long.toString(lastModified))); result[0] = new Property(HttpHeaders.ACCEPT_RANGES,"bytes"); result[1] = new Property(HttpHeaders.ETAG, eTag); result[2] = new Property(HttpHeaders.LAST_MODIFIED, DateUtil.formatDate(new Date(lastModified))); return result; }
[ "private", "static", "Property", "[", "]", "getFileDatastreamHeaders", "(", "String", "canonicalPath", ",", "long", "lastModified", ")", "{", "Property", "[", "]", "result", "=", "new", "Property", "[", "3", "]", ";", "String", "eTag", "=", "MD5Utility", "."...
Content-Length is determined elsewhere Content-Type is determined elsewhere Last-Modified ETag @param String canonicalPath: the canonical path to a file system resource @param lastModified lastModified: the date of last modification @return
[ "Content", "-", "Length", "is", "determined", "elsewhere", "Content", "-", "Type", "is", "determined", "elsewhere", "Last", "-", "Modified", "ETag" ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/DefaultExternalContentManager.java#L437-L446
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/xpath/XPathQueryBuilder.java
XPathQueryBuilder.assignValue
private void assignValue(SimpleNode node, RelationQueryNode queryNode) { if (node.getId() == JJTSTRINGLITERAL) { queryNode.setStringValue(unescapeQuotes(node.getValue())); } else if (node.getId() == JJTDECIMALLITERAL) { queryNode.setDoubleValue(Double.parseDouble(node.getValue())); } else if (node.getId() == JJTDOUBLELITERAL) { queryNode.setDoubleValue(Double.parseDouble(node.getValue())); } else if (node.getId() == JJTINTEGERLITERAL) { // if this is an expression that contains position() do not change // the type. if (queryNode.getValueType() == QueryConstants.TYPE_POSITION) { queryNode.setPositionValue(Integer.parseInt(node.getValue())); } else { queryNode.setLongValue(Long.parseLong(node.getValue())); } } else { exceptions.add(new InvalidQueryException("Unsupported literal type:" + node.toString())); } }
java
private void assignValue(SimpleNode node, RelationQueryNode queryNode) { if (node.getId() == JJTSTRINGLITERAL) { queryNode.setStringValue(unescapeQuotes(node.getValue())); } else if (node.getId() == JJTDECIMALLITERAL) { queryNode.setDoubleValue(Double.parseDouble(node.getValue())); } else if (node.getId() == JJTDOUBLELITERAL) { queryNode.setDoubleValue(Double.parseDouble(node.getValue())); } else if (node.getId() == JJTINTEGERLITERAL) { // if this is an expression that contains position() do not change // the type. if (queryNode.getValueType() == QueryConstants.TYPE_POSITION) { queryNode.setPositionValue(Integer.parseInt(node.getValue())); } else { queryNode.setLongValue(Long.parseLong(node.getValue())); } } else { exceptions.add(new InvalidQueryException("Unsupported literal type:" + node.toString())); } }
[ "private", "void", "assignValue", "(", "SimpleNode", "node", ",", "RelationQueryNode", "queryNode", ")", "{", "if", "(", "node", ".", "getId", "(", ")", "==", "JJTSTRINGLITERAL", ")", "{", "queryNode", ".", "setStringValue", "(", "unescapeQuotes", "(", "node",...
Assigns a value to the <code>queryNode</code>. @param node must be of type string, decimal, double or integer; otherwise an InvalidQueryException is added to {@link #exceptions}. @param queryNode current node in the query tree.
[ "Assigns", "a", "value", "to", "the", "<code", ">", "queryNode<", "/", "code", ">", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/xpath/XPathQueryBuilder.java#L765-L783
iobeam/iobeam-client-java
src/main/java/com/iobeam/api/client/Iobeam.java
Iobeam._addDataWithoutLock
private void _addDataWithoutLock(String seriesName, DataPoint dataPoint) { if (dataStore == null) { dataStore = new Import(deviceId, projectId); } dataStore.addDataPoint(seriesName, dataPoint); DataStore store = seriesToBatch.get(seriesName); if (store == null) { store = new DataStore(seriesName); seriesToBatch.put(seriesName, store); dataBatches.add(store); } store.add(dataPoint.getTime(), seriesName, dataPoint.getValue()); }
java
private void _addDataWithoutLock(String seriesName, DataPoint dataPoint) { if (dataStore == null) { dataStore = new Import(deviceId, projectId); } dataStore.addDataPoint(seriesName, dataPoint); DataStore store = seriesToBatch.get(seriesName); if (store == null) { store = new DataStore(seriesName); seriesToBatch.put(seriesName, store); dataBatches.add(store); } store.add(dataPoint.getTime(), seriesName, dataPoint.getValue()); }
[ "private", "void", "_addDataWithoutLock", "(", "String", "seriesName", ",", "DataPoint", "dataPoint", ")", "{", "if", "(", "dataStore", "==", "null", ")", "{", "dataStore", "=", "new", "Import", "(", "deviceId", ",", "projectId", ")", ";", "}", "dataStore", ...
/* A lock should always be acquired before calling this method!
[ "/", "*", "A", "lock", "should", "always", "be", "acquired", "before", "calling", "this", "method!" ]
train
https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/client/Iobeam.java#L731-L744
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java
BaseApplet.pushBrowserHistory
public void pushBrowserHistory(String strHistory, String browserTitle, boolean bPushToBrowser) { if (bPushToBrowser) if (this.getBrowserManager() != null) this.getBrowserManager().pushBrowserHistory(strHistory, browserTitle); // Let browser know about the new screen }
java
public void pushBrowserHistory(String strHistory, String browserTitle, boolean bPushToBrowser) { if (bPushToBrowser) if (this.getBrowserManager() != null) this.getBrowserManager().pushBrowserHistory(strHistory, browserTitle); // Let browser know about the new screen }
[ "public", "void", "pushBrowserHistory", "(", "String", "strHistory", ",", "String", "browserTitle", ",", "boolean", "bPushToBrowser", ")", "{", "if", "(", "bPushToBrowser", ")", "if", "(", "this", ".", "getBrowserManager", "(", ")", "!=", "null", ")", "this", ...
Push this command onto the history stack. @param strHistory The history command to push onto the stack.
[ "Push", "this", "command", "onto", "the", "history", "stack", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L1249-L1254
Azure/azure-sdk-for-java
policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java
PolicyStatesInner.summarizeForResourceGroup
public SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, String resourceGroupName, QueryOptions queryOptions) { return summarizeForResourceGroupWithServiceResponseAsync(subscriptionId, resourceGroupName, queryOptions).toBlocking().single().body(); }
java
public SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, String resourceGroupName, QueryOptions queryOptions) { return summarizeForResourceGroupWithServiceResponseAsync(subscriptionId, resourceGroupName, queryOptions).toBlocking().single().body(); }
[ "public", "SummarizeResultsInner", "summarizeForResourceGroup", "(", "String", "subscriptionId", ",", "String", "resourceGroupName", ",", "QueryOptions", "queryOptions", ")", "{", "return", "summarizeForResourceGroupWithServiceResponseAsync", "(", "subscriptionId", ",", "resour...
Summarizes policy states for the resources under the resource group. @param subscriptionId Microsoft Azure subscription ID. @param resourceGroupName Resource group name. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws QueryFailureException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the SummarizeResultsInner object if successful.
[ "Summarizes", "policy", "states", "for", "the", "resources", "under", "the", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L1186-L1188
jglobus/JGlobus
gridftp/src/main/java/org/globus/ftp/GridFTPClient.java
GridFTPClient.setDataChannelAuthentication
public void setDataChannelAuthentication(DataChannelAuthentication type) throws IOException, ServerException { Command cmd = new Command("DCAU", type.toFtpCmdArgument()); try{ controlChannel.execute(cmd); } catch (UnexpectedReplyCodeException urce) { if(!type.toFtpCmdArgument().equals("N")) { throw ServerException.embedUnexpectedReplyCodeException(urce); } } catch(FTPReplyParseException rpe) { throw ServerException.embedFTPReplyParseException(rpe); } this.gSession.dataChannelAuthentication = type; gLocalServer.setDataChannelAuthentication(type); }
java
public void setDataChannelAuthentication(DataChannelAuthentication type) throws IOException, ServerException { Command cmd = new Command("DCAU", type.toFtpCmdArgument()); try{ controlChannel.execute(cmd); } catch (UnexpectedReplyCodeException urce) { if(!type.toFtpCmdArgument().equals("N")) { throw ServerException.embedUnexpectedReplyCodeException(urce); } } catch(FTPReplyParseException rpe) { throw ServerException.embedFTPReplyParseException(rpe); } this.gSession.dataChannelAuthentication = type; gLocalServer.setDataChannelAuthentication(type); }
[ "public", "void", "setDataChannelAuthentication", "(", "DataChannelAuthentication", "type", ")", "throws", "IOException", ",", "ServerException", "{", "Command", "cmd", "=", "new", "Command", "(", "\"DCAU\"", ",", "type", ".", "toFtpCmdArgument", "(", ")", ")", ";...
Sets data channel authentication mode (DCAU) @param type for 2-party transfer must be DataChannelAuthentication.SELF or DataChannelAuthentication.NONE
[ "Sets", "data", "channel", "authentication", "mode", "(", "DCAU", ")" ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/GridFTPClient.java#L792-L813
apache/flink
flink-core/src/main/java/org/apache/flink/types/StringValue.java
StringValue.setValue
public void setValue(CharSequence value, int offset, int len) { checkNotNull(value); if (offset < 0 || len < 0 || offset > value.length() - len) { throw new IndexOutOfBoundsException("offset: " + offset + " len: " + len + " value.len: " + len); } ensureSize(len); this.len = len; for (int i = 0; i < len; i++) { this.value[i] = value.charAt(offset + i); } this.hashCode = 0; }
java
public void setValue(CharSequence value, int offset, int len) { checkNotNull(value); if (offset < 0 || len < 0 || offset > value.length() - len) { throw new IndexOutOfBoundsException("offset: " + offset + " len: " + len + " value.len: " + len); } ensureSize(len); this.len = len; for (int i = 0; i < len; i++) { this.value[i] = value.charAt(offset + i); } this.hashCode = 0; }
[ "public", "void", "setValue", "(", "CharSequence", "value", ",", "int", "offset", ",", "int", "len", ")", "{", "checkNotNull", "(", "value", ")", ";", "if", "(", "offset", "<", "0", "||", "len", "<", "0", "||", "offset", ">", "value", ".", "length", ...
Sets the value of the StringValue to a substring of the given string. @param value The new string value. @param offset The position to start the substring. @param len The length of the substring.
[ "Sets", "the", "value", "of", "the", "StringValue", "to", "a", "substring", "of", "the", "given", "string", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L184-L196
dain/leveldb
leveldb/src/main/java/org/iq80/leveldb/util/Slice.java
Slice.getBytes
public void getBytes(int index, ByteBuffer destination) { checkPositionIndex(index, this.length); index += offset; destination.put(data, index, Math.min(length, destination.remaining())); }
java
public void getBytes(int index, ByteBuffer destination) { checkPositionIndex(index, this.length); index += offset; destination.put(data, index, Math.min(length, destination.remaining())); }
[ "public", "void", "getBytes", "(", "int", "index", ",", "ByteBuffer", "destination", ")", "{", "checkPositionIndex", "(", "index", ",", "this", ".", "length", ")", ";", "index", "+=", "offset", ";", "destination", ".", "put", "(", "data", ",", "index", "...
Transfers this buffer's data to the specified destination starting at the specified absolute {@code index} until the destination's position reaches its limit. @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if {@code index + dst.remaining()} is greater than {@code this.capacity}
[ "Transfers", "this", "buffer", "s", "data", "to", "the", "specified", "destination", "starting", "at", "the", "specified", "absolute", "{", "@code", "index", "}", "until", "the", "destination", "s", "position", "reaches", "its", "limit", "." ]
train
https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L242-L247
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java
ComponentAnnotationLoader.getDeclaredComponents
public List<ComponentDeclaration> getDeclaredComponents(InputStream componentListStream) throws IOException { List<ComponentDeclaration> annotatedClassNames = new ArrayList<>(); // Read all components definition from the URL // Always force UTF-8 as the encoding, since these files are read from the official jars, and those are // generated on an 8-bit system. BufferedReader in = new BufferedReader(new InputStreamReader(componentListStream, COMPONENT_LIST_ENCODING)); String inputLine; while ((inputLine = in.readLine()) != null) { // Make sure we don't add empty lines if (inputLine.trim().length() > 0) { try { String[] chunks = inputLine.split(":"); ComponentDeclaration componentDeclaration; if (chunks.length > 1) { componentDeclaration = new ComponentDeclaration(chunks[1], Integer.parseInt(chunks[0])); } else { componentDeclaration = new ComponentDeclaration(chunks[0]); } LOGGER.debug(" - Adding component definition [{}] with priority [{}]", componentDeclaration.getImplementationClassName(), componentDeclaration.getPriority()); annotatedClassNames.add(componentDeclaration); } catch (Exception e) { getLogger().error("Failed to parse component declaration from [{}]", inputLine, e); } } } return annotatedClassNames; }
java
public List<ComponentDeclaration> getDeclaredComponents(InputStream componentListStream) throws IOException { List<ComponentDeclaration> annotatedClassNames = new ArrayList<>(); // Read all components definition from the URL // Always force UTF-8 as the encoding, since these files are read from the official jars, and those are // generated on an 8-bit system. BufferedReader in = new BufferedReader(new InputStreamReader(componentListStream, COMPONENT_LIST_ENCODING)); String inputLine; while ((inputLine = in.readLine()) != null) { // Make sure we don't add empty lines if (inputLine.trim().length() > 0) { try { String[] chunks = inputLine.split(":"); ComponentDeclaration componentDeclaration; if (chunks.length > 1) { componentDeclaration = new ComponentDeclaration(chunks[1], Integer.parseInt(chunks[0])); } else { componentDeclaration = new ComponentDeclaration(chunks[0]); } LOGGER.debug(" - Adding component definition [{}] with priority [{}]", componentDeclaration.getImplementationClassName(), componentDeclaration.getPriority()); annotatedClassNames.add(componentDeclaration); } catch (Exception e) { getLogger().error("Failed to parse component declaration from [{}]", inputLine, e); } } } return annotatedClassNames; }
[ "public", "List", "<", "ComponentDeclaration", ">", "getDeclaredComponents", "(", "InputStream", "componentListStream", ")", "throws", "IOException", "{", "List", "<", "ComponentDeclaration", ">", "annotatedClassNames", "=", "new", "ArrayList", "<>", "(", ")", ";", ...
Get all components listed in the passed resource stream. The format is: {@code (priority level):(fully qualified component implementation name)}. @param componentListStream the stream to parse @return the list of component declaration (implementation class names and priorities) @throws IOException in case of an error loading the component list resource @since 3.3M1
[ "Get", "all", "components", "listed", "in", "the", "passed", "resource", "stream", ".", "The", "format", "is", ":", "{", "@code", "(", "priority", "level", ")", ":", "(", "fully", "qualified", "component", "implementation", "name", ")", "}", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java#L497-L527
javagl/ND
nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java
DoubleTuples.normalizeElements
public static MutableDoubleTuple normalizeElements( DoubleTuple t, double min, double max, MutableDoubleTuple result) { return rescaleElements(t, min(t), max(t), min, max, result); }
java
public static MutableDoubleTuple normalizeElements( DoubleTuple t, double min, double max, MutableDoubleTuple result) { return rescaleElements(t, min(t), max(t), min, max, result); }
[ "public", "static", "MutableDoubleTuple", "normalizeElements", "(", "DoubleTuple", "t", ",", "double", "min", ",", "double", "max", ",", "MutableDoubleTuple", "result", ")", "{", "return", "rescaleElements", "(", "t", ",", "min", "(", "t", ")", ",", "max", "...
Normalize the elements of the given tuple, so that its minimum and maximum elements match the given minimum and maximum values. @param t The input tuple @param min The minimum value @param max The maximum value @param result The tuple that will store the result @return The result tuple @throws IllegalArgumentException If the given tuples do not have the same {@link Tuple#getSize() size}
[ "Normalize", "the", "elements", "of", "the", "given", "tuple", "so", "that", "its", "minimum", "and", "maximum", "elements", "match", "the", "given", "minimum", "and", "maximum", "values", "." ]
train
https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1595-L1599
j256/ormlite-core
src/main/java/com/j256/ormlite/dao/DaoManager.java
DaoManager.createDaoFromConfig
private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException { // no loaded configs if (configMap == null) { return null; } @SuppressWarnings("unchecked") DatabaseTableConfig<T> config = (DatabaseTableConfig<T>) configMap.get(clazz); // if we don't config information cached return null if (config == null) { return null; } // else create a DAO using configuration Dao<T, ?> configedDao = doCreateDao(connectionSource, config); @SuppressWarnings("unchecked") D castDao = (D) configedDao; return castDao; }
java
private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException { // no loaded configs if (configMap == null) { return null; } @SuppressWarnings("unchecked") DatabaseTableConfig<T> config = (DatabaseTableConfig<T>) configMap.get(clazz); // if we don't config information cached return null if (config == null) { return null; } // else create a DAO using configuration Dao<T, ?> configedDao = doCreateDao(connectionSource, config); @SuppressWarnings("unchecked") D castDao = (D) configedDao; return castDao; }
[ "private", "static", "<", "D", ",", "T", ">", "D", "createDaoFromConfig", "(", "ConnectionSource", "connectionSource", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "SQLException", "{", "// no loaded configs", "if", "(", "configMap", "==", "null", ")", ...
Creates the DAO if we have config information cached and caches the DAO.
[ "Creates", "the", "DAO", "if", "we", "have", "config", "information", "cached", "and", "caches", "the", "DAO", "." ]
train
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/DaoManager.java#L334-L352
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/user/UserCoreDao.java
UserCoreDao.buildColumnsAs
public String[] buildColumnsAs(List<TColumn> columns, String value) { String[] columnsArray = buildColumnsArray(columns); return buildColumnsAs(columnsArray, value); }
java
public String[] buildColumnsAs(List<TColumn> columns, String value) { String[] columnsArray = buildColumnsArray(columns); return buildColumnsAs(columnsArray, value); }
[ "public", "String", "[", "]", "buildColumnsAs", "(", "List", "<", "TColumn", ">", "columns", ",", "String", "value", ")", "{", "String", "[", "]", "columnsArray", "=", "buildColumnsArray", "(", "columns", ")", ";", "return", "buildColumnsAs", "(", "columnsAr...
Build "columns as" values for the table columns with the specified columns as the specified value @param columns columns to include as value @param value "columns as" value for specified columns @return "columns as" values @since 2.0.0
[ "Build", "columns", "as", "values", "for", "the", "table", "columns", "with", "the", "specified", "columns", "as", "the", "specified", "value" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L1553-L1558
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java
ExecutionGraph.jobHasFailedOrCanceledStatus
private boolean jobHasFailedOrCanceledStatus() { final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true); while (it.hasNext()) { final ExecutionState state = it.next().getExecutionState(); if (state != ExecutionState.CANCELED && state != ExecutionState.FAILED && state != ExecutionState.FINISHED) { return false; } } return true; }
java
private boolean jobHasFailedOrCanceledStatus() { final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true); while (it.hasNext()) { final ExecutionState state = it.next().getExecutionState(); if (state != ExecutionState.CANCELED && state != ExecutionState.FAILED && state != ExecutionState.FINISHED) { return false; } } return true; }
[ "private", "boolean", "jobHasFailedOrCanceledStatus", "(", ")", "{", "final", "Iterator", "<", "ExecutionVertex", ">", "it", "=", "new", "ExecutionGraphIterator", "(", "this", ",", "true", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "...
Checks whether the job represented by the execution graph has the status <code>CANCELED</code> or <code>FAILED</code>. @return <code>true</code> if the job has the status <code>CANCELED</code> or <code>FAILED</code>, <code>false</code> otherwise
[ "Checks", "whether", "the", "job", "represented", "by", "the", "execution", "graph", "has", "the", "status", "<code", ">", "CANCELED<", "/", "code", ">", "or", "<code", ">", "FAILED<", "/", "code", ">", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java#L1082-L1096
google/closure-compiler
src/com/google/javascript/jscomp/TypeCheck.java
TypeCheck.visitBinaryOperator
private void visitBinaryOperator(Token op, Node n) { Node left = n.getFirstChild(); JSType leftType = getJSType(left); Node right = n.getLastChild(); JSType rightType = getJSType(right); switch (op) { case ASSIGN_LSH: case ASSIGN_RSH: case LSH: case RSH: case ASSIGN_URSH: case URSH: String opStr = NodeUtil.opToStr(n.getToken()); if (!leftType.matchesNumberContext()) { report(left, BIT_OPERATION, opStr, leftType.toString()); } else { this.validator.expectNumberStrict(n, leftType, "operator " + opStr); } if (!rightType.matchesNumberContext()) { report(right, BIT_OPERATION, opStr, rightType.toString()); } else { this.validator.expectNumberStrict(n, rightType, "operator " + opStr); } break; case ASSIGN_DIV: case ASSIGN_MOD: case ASSIGN_MUL: case ASSIGN_SUB: case ASSIGN_EXPONENT: case DIV: case MOD: case MUL: case SUB: case EXPONENT: validator.expectNumber(left, leftType, "left operand"); validator.expectNumber(right, rightType, "right operand"); break; case ASSIGN_BITAND: case ASSIGN_BITXOR: case ASSIGN_BITOR: case BITAND: case BITXOR: case BITOR: validator.expectBitwiseable(left, leftType, "bad left operand to bitwise operator"); validator.expectBitwiseable(right, rightType, "bad right operand to bitwise operator"); break; case ASSIGN_ADD: case ADD: break; default: report(n, UNEXPECTED_TOKEN, op.toString()); } ensureTyped(n); }
java
private void visitBinaryOperator(Token op, Node n) { Node left = n.getFirstChild(); JSType leftType = getJSType(left); Node right = n.getLastChild(); JSType rightType = getJSType(right); switch (op) { case ASSIGN_LSH: case ASSIGN_RSH: case LSH: case RSH: case ASSIGN_URSH: case URSH: String opStr = NodeUtil.opToStr(n.getToken()); if (!leftType.matchesNumberContext()) { report(left, BIT_OPERATION, opStr, leftType.toString()); } else { this.validator.expectNumberStrict(n, leftType, "operator " + opStr); } if (!rightType.matchesNumberContext()) { report(right, BIT_OPERATION, opStr, rightType.toString()); } else { this.validator.expectNumberStrict(n, rightType, "operator " + opStr); } break; case ASSIGN_DIV: case ASSIGN_MOD: case ASSIGN_MUL: case ASSIGN_SUB: case ASSIGN_EXPONENT: case DIV: case MOD: case MUL: case SUB: case EXPONENT: validator.expectNumber(left, leftType, "left operand"); validator.expectNumber(right, rightType, "right operand"); break; case ASSIGN_BITAND: case ASSIGN_BITXOR: case ASSIGN_BITOR: case BITAND: case BITXOR: case BITOR: validator.expectBitwiseable(left, leftType, "bad left operand to bitwise operator"); validator.expectBitwiseable(right, rightType, "bad right operand to bitwise operator"); break; case ASSIGN_ADD: case ADD: break; default: report(n, UNEXPECTED_TOKEN, op.toString()); } ensureTyped(n); }
[ "private", "void", "visitBinaryOperator", "(", "Token", "op", ",", "Node", "n", ")", "{", "Node", "left", "=", "n", ".", "getFirstChild", "(", ")", ";", "JSType", "leftType", "=", "getJSType", "(", "left", ")", ";", "Node", "right", "=", "n", ".", "g...
This function unifies the type checking involved in the core binary operators and the corresponding assignment operators. The representation used internally is such that common code can handle both kinds of operators easily. @param op The operator. @param t The traversal object, needed to report errors. @param n The node being checked.
[ "This", "function", "unifies", "the", "type", "checking", "involved", "in", "the", "core", "binary", "operators", "and", "the", "corresponding", "assignment", "operators", ".", "The", "representation", "used", "internally", "is", "such", "that", "common", "code", ...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L2884-L2941
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java
ExtendedListeningPoint.createRecordRouteURI
public javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress) { try { String host = getIpAddress(usePublicAddress); SipURI sipUri = SipFactoryImpl.addressFactory.createSipURI(null, host); sipUri.setPort(port); sipUri.setTransportParam(transport); // Do we want to add an ID here? return sipUri; } catch (ParseException ex) { logger.error ("Unexpected error while creating a record route URI",ex); throw new IllegalArgumentException("Unexpected exception when creating a record route URI", ex); } }
java
public javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress) { try { String host = getIpAddress(usePublicAddress); SipURI sipUri = SipFactoryImpl.addressFactory.createSipURI(null, host); sipUri.setPort(port); sipUri.setTransportParam(transport); // Do we want to add an ID here? return sipUri; } catch (ParseException ex) { logger.error ("Unexpected error while creating a record route URI",ex); throw new IllegalArgumentException("Unexpected exception when creating a record route URI", ex); } }
[ "public", "javax", ".", "sip", ".", "address", ".", "SipURI", "createRecordRouteURI", "(", "boolean", "usePublicAddress", ")", "{", "try", "{", "String", "host", "=", "getIpAddress", "(", "usePublicAddress", ")", ";", "SipURI", "sipUri", "=", "SipFactoryImpl", ...
Create a Record Route URI based on the host, port and transport of this listening point @param usePublicAddress if true, the host will be the global ip address found by STUN otherwise it will be the local network interface ipaddress @return the record route uri
[ "Create", "a", "Record", "Route", "URI", "based", "on", "the", "host", "port", "and", "transport", "of", "this", "listening", "point" ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java#L203-L215
mongodb/stitch-android-sdk
server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java
RemoteMongoCollectionImpl.findOne
public <ResultT> ResultT findOne(final Bson filter, final Class<ResultT> resultClass) { return proxy.findOne(filter, resultClass); }
java
public <ResultT> ResultT findOne(final Bson filter, final Class<ResultT> resultClass) { return proxy.findOne(filter, resultClass); }
[ "public", "<", "ResultT", ">", "ResultT", "findOne", "(", "final", "Bson", "filter", ",", "final", "Class", "<", "ResultT", ">", "resultClass", ")", "{", "return", "proxy", ".", "findOne", "(", "filter", ",", "resultClass", ")", ";", "}" ]
Finds a document in the collection. @param filter the query filter @param resultClass the class to decode each document into @param <ResultT> the target document type of the iterable. @return a task containing the result of the find one operation
[ "Finds", "a", "document", "in", "the", "collection", "." ]
train
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java#L159-L161
apache/groovy
src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
EnumCompletionVisitor.addImplicitConstructors
private static void addImplicitConstructors(ClassNode enumClass, boolean aic) { if (aic) { ClassNode sn = enumClass.getSuperClass(); List<ConstructorNode> sctors = new ArrayList<ConstructorNode>(sn.getDeclaredConstructors()); if (sctors.isEmpty()) { addMapConstructors(enumClass); } else { for (ConstructorNode constructorNode : sctors) { ConstructorNode init = new ConstructorNode(ACC_PUBLIC, constructorNode.getParameters(), ClassNode.EMPTY_ARRAY, new BlockStatement()); enumClass.addConstructor(init); } } } else { addMapConstructors(enumClass); } }
java
private static void addImplicitConstructors(ClassNode enumClass, boolean aic) { if (aic) { ClassNode sn = enumClass.getSuperClass(); List<ConstructorNode> sctors = new ArrayList<ConstructorNode>(sn.getDeclaredConstructors()); if (sctors.isEmpty()) { addMapConstructors(enumClass); } else { for (ConstructorNode constructorNode : sctors) { ConstructorNode init = new ConstructorNode(ACC_PUBLIC, constructorNode.getParameters(), ClassNode.EMPTY_ARRAY, new BlockStatement()); enumClass.addConstructor(init); } } } else { addMapConstructors(enumClass); } }
[ "private", "static", "void", "addImplicitConstructors", "(", "ClassNode", "enumClass", ",", "boolean", "aic", ")", "{", "if", "(", "aic", ")", "{", "ClassNode", "sn", "=", "enumClass", ".", "getSuperClass", "(", ")", ";", "List", "<", "ConstructorNode", ">",...
Add map and no-arg constructor or mirror those of the superclass (i.e. base enum).
[ "Add", "map", "and", "no", "-", "arg", "constructor", "or", "mirror", "those", "of", "the", "superclass", "(", "i", ".", "e", ".", "base", "enum", ")", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java#L81-L96
onepf/OpenIAB
library/src/main/java/org/onepf/oms/util/Utils.java
Utils.isPackageInstaller
public static boolean isPackageInstaller(@NotNull final Context context, final String packageName) { final PackageManager packageManager = context.getPackageManager(); final String installerPackageName = packageManager.getInstallerPackageName(context.getPackageName()); boolean isPackageInstaller = TextUtils.equals(installerPackageName, packageName); Logger.d("isPackageInstaller() is ", isPackageInstaller, " for ", packageName); return isPackageInstaller; }
java
public static boolean isPackageInstaller(@NotNull final Context context, final String packageName) { final PackageManager packageManager = context.getPackageManager(); final String installerPackageName = packageManager.getInstallerPackageName(context.getPackageName()); boolean isPackageInstaller = TextUtils.equals(installerPackageName, packageName); Logger.d("isPackageInstaller() is ", isPackageInstaller, " for ", packageName); return isPackageInstaller; }
[ "public", "static", "boolean", "isPackageInstaller", "(", "@", "NotNull", "final", "Context", "context", ",", "final", "String", "packageName", ")", "{", "final", "PackageManager", "packageManager", "=", "context", ".", "getPackageManager", "(", ")", ";", "final",...
Checks if an application with the passed name is the installer of the calling app. @param packageName The package name of the tested application. @return true if the application with the passed package is the installer.
[ "Checks", "if", "an", "application", "with", "the", "passed", "name", "is", "the", "installer", "of", "the", "calling", "app", "." ]
train
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/util/Utils.java#L71-L77
Ordinastie/MalisisCore
src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java
GuiRenderer.drawItemStack
public void drawItemStack(ItemStack itemStack, int x, int y) { drawItemStack(itemStack, x, y, null, null, true); }
java
public void drawItemStack(ItemStack itemStack, int x, int y) { drawItemStack(itemStack, x, y, null, null, true); }
[ "public", "void", "drawItemStack", "(", "ItemStack", "itemStack", ",", "int", "x", ",", "int", "y", ")", "{", "drawItemStack", "(", "itemStack", ",", "x", ",", "y", ",", "null", ",", "null", ",", "true", ")", ";", "}" ]
Draws an itemStack to the GUI at the specified coordinates. @param itemStack the item stack @param x the x @param y the y
[ "Draws", "an", "itemStack", "to", "the", "GUI", "at", "the", "specified", "coordinates", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java#L372-L375
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/ChatApi.java
ChatApi.updateNickname
public ApiSuccessResponse updateNickname(String id, UpdateNicknameData updateNicknameData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = updateNicknameWithHttpInfo(id, updateNicknameData); return resp.getData(); }
java
public ApiSuccessResponse updateNickname(String id, UpdateNicknameData updateNicknameData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = updateNicknameWithHttpInfo(id, updateNicknameData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "updateNickname", "(", "String", "id", ",", "UpdateNicknameData", "updateNicknameData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "updateNicknameWithHttpInfo", "(", "id", ",", "updateN...
Update an agent&#39;s nickname Update the agent&#39;s nickname for the specified chat. @param id The ID of the chat interaction. (required) @param updateNicknameData Request parameters. (optional) @return ApiSuccessResponse @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Update", "an", "agent&#39", ";", "s", "nickname", "Update", "the", "agent&#39", ";", "s", "nickname", "for", "the", "specified", "chat", "." ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L2207-L2210
jenkinsci/jenkins
core/src/main/java/hudson/tasks/BuildWrapper.java
BuildWrapper.decorateLogger
public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { return logger; }
java
public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { return logger; }
[ "public", "OutputStream", "decorateLogger", "(", "AbstractBuild", "build", ",", "OutputStream", "logger", ")", "throws", "IOException", ",", "InterruptedException", ",", "RunnerAbortedException", "{", "return", "logger", ";", "}" ]
Provides an opportunity for a {@link BuildWrapper} to decorate the {@link BuildListener} logger to be used by the build. <p> This hook is called very early on in the build (even before {@link #setUp(AbstractBuild, Launcher, BuildListener)} is invoked.) <p> The default implementation is no-op, which just returns the {@code logger} parameter as-is. <p>({@link ArgumentListBuilder#add(String, boolean)} is a simpler way to suppress a single password.) @param build The build in progress for which this {@link BuildWrapper} is called. Never null. @param logger The default logger. Never null. This method is expected to wrap this logger. This makes sure that when multiple {@link BuildWrapper}s attempt to decorate the same logger it will sort of work. @return Must not be null. If a fatal error happens, throw an exception. @throws RunnerAbortedException If a fatal error is detected but the implementation handled it gracefully, throw this exception to suppress stack trace. @since 1.374 @see ConsoleLogFilter
[ "Provides", "an", "opportunity", "for", "a", "{", "@link", "BuildWrapper", "}", "to", "decorate", "the", "{", "@link", "BuildListener", "}", "logger", "to", "be", "used", "by", "the", "build", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildWrapper.java#L214-L216
onelogin/onelogin-java-sdk
src/main/java/com/onelogin/sdk/conn/Client.java
Client.getGroupsBatch
public OneLoginResponse<Group> getGroupsBatch(int batchSize, String afterCursor) throws OAuthSystemException, OAuthProblemException, URISyntaxException { return getGroupsBatch(new HashMap<String, String>(), batchSize, afterCursor); }
java
public OneLoginResponse<Group> getGroupsBatch(int batchSize, String afterCursor) throws OAuthSystemException, OAuthProblemException, URISyntaxException { return getGroupsBatch(new HashMap<String, String>(), batchSize, afterCursor); }
[ "public", "OneLoginResponse", "<", "Group", ">", "getGroupsBatch", "(", "int", "batchSize", ",", "String", "afterCursor", ")", "throws", "OAuthSystemException", ",", "OAuthProblemException", ",", "URISyntaxException", "{", "return", "getGroupsBatch", "(", "new", "Hash...
Get a batch of Groups. @param batchSize Size of the Batch @param afterCursor Reference to continue collecting items of next page @return OneLoginResponse of Group @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled @throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor @see com.onelogin.sdk.model.Group @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/groups/get-groups">Get Groups documentation</a>
[ "Get", "a", "batch", "of", "Groups", "." ]
train
https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2272-L2275
riversun/bigdoc
src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java
BigFileSearcher.searchBigFile
public List<Long> searchBigFile(File f, byte[] searchBytes, OnProgressListener listener) { this.onRealtimeResultListener = null; this.onProgressListener = listener; int numOfThreadsOptimized = (int) (f.length() / (long) blockSize); if (numOfThreadsOptimized == 0) { numOfThreadsOptimized = 1; } return searchBigFile(f, searchBytes, numOfThreadsOptimized, this.useOptimization, 0); }
java
public List<Long> searchBigFile(File f, byte[] searchBytes, OnProgressListener listener) { this.onRealtimeResultListener = null; this.onProgressListener = listener; int numOfThreadsOptimized = (int) (f.length() / (long) blockSize); if (numOfThreadsOptimized == 0) { numOfThreadsOptimized = 1; } return searchBigFile(f, searchBytes, numOfThreadsOptimized, this.useOptimization, 0); }
[ "public", "List", "<", "Long", ">", "searchBigFile", "(", "File", "f", ",", "byte", "[", "]", "searchBytes", ",", "OnProgressListener", "listener", ")", "{", "this", ".", "onRealtimeResultListener", "=", "null", ";", "this", ".", "onProgressListener", "=", "...
Search bytes from big file faster in a concurrent processing with progress callback @param f target file @param searchBytes sequence of bytes you want to search @param listener callback for progress @return
[ "Search", "bytes", "from", "big", "file", "faster", "in", "a", "concurrent", "processing", "with", "progress", "callback" ]
train
https://github.com/riversun/bigdoc/blob/46bd7c9a8667be23acdb1ad8286027e4b08cff3a/src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java#L287-L299
pietermartin/sqlg
sqlg-core/src/main/java/org/umlg/sqlg/structure/TransactionCache.java
TransactionCache.putVertexIfAbsent
SqlgVertex putVertexIfAbsent(SqlgGraph sqlgGraph, String schema, String table, Long id) { RecordId recordId = RecordId.from(SchemaTable.of(schema, table), id); SqlgVertex sqlgVertex; if (this.cacheVertices) { sqlgVertex = this.vertexCache.get(recordId); if (sqlgVertex == null) { sqlgVertex = new SqlgVertex(sqlgGraph, id, schema, table); this.vertexCache.put(recordId, sqlgVertex); return sqlgVertex; } } else { sqlgVertex = new SqlgVertex(sqlgGraph, id, schema, table); } return sqlgVertex; }
java
SqlgVertex putVertexIfAbsent(SqlgGraph sqlgGraph, String schema, String table, Long id) { RecordId recordId = RecordId.from(SchemaTable.of(schema, table), id); SqlgVertex sqlgVertex; if (this.cacheVertices) { sqlgVertex = this.vertexCache.get(recordId); if (sqlgVertex == null) { sqlgVertex = new SqlgVertex(sqlgGraph, id, schema, table); this.vertexCache.put(recordId, sqlgVertex); return sqlgVertex; } } else { sqlgVertex = new SqlgVertex(sqlgGraph, id, schema, table); } return sqlgVertex; }
[ "SqlgVertex", "putVertexIfAbsent", "(", "SqlgGraph", "sqlgGraph", ",", "String", "schema", ",", "String", "table", ",", "Long", "id", ")", "{", "RecordId", "recordId", "=", "RecordId", ".", "from", "(", "SchemaTable", ".", "of", "(", "schema", ",", "table", ...
The recordId is not referenced in the SqlgVertex. It is important that the value of the WeakHashMap does not reference the key. @param sqlgGraph The graph @return the vertex. If cacheVertices is true and the vertex is cached then the cached vertex will be returned else a the vertex will be instantiated.
[ "The", "recordId", "is", "not", "referenced", "in", "the", "SqlgVertex", ".", "It", "is", "important", "that", "the", "value", "of", "the", "WeakHashMap", "does", "not", "reference", "the", "key", "." ]
train
https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/TransactionCache.java#L105-L119
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/NamespaceResources.java
NamespaceResources.createNamespace
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Description("Creates a new namepsace.") public NamespaceDto createNamespace(@Context HttpServletRequest req, NamespaceDto namespaceDto) { if (namespaceDto == null) { throw new WebApplicationException("Null namespace object cannot be created.", Status.BAD_REQUEST); } PrincipalUser remoteUser = validateAndGetOwner(req, null); Set<PrincipalUser> users = _getPrincipalUserByUserName(namespaceDto.getUsernames()); Namespace namespace = new Namespace(remoteUser, namespaceDto.getQualifier(), remoteUser, users); return NamespaceDto.transformToDto(_namespaceService.createNamespace(namespace)); }
java
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Description("Creates a new namepsace.") public NamespaceDto createNamespace(@Context HttpServletRequest req, NamespaceDto namespaceDto) { if (namespaceDto == null) { throw new WebApplicationException("Null namespace object cannot be created.", Status.BAD_REQUEST); } PrincipalUser remoteUser = validateAndGetOwner(req, null); Set<PrincipalUser> users = _getPrincipalUserByUserName(namespaceDto.getUsernames()); Namespace namespace = new Namespace(remoteUser, namespaceDto.getQualifier(), remoteUser, users); return NamespaceDto.transformToDto(_namespaceService.createNamespace(namespace)); }
[ "@", "POST", "@", "Consumes", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Description", "(", "\"Creates a new namepsace.\"", ")", "public", "NamespaceDto", "createNamespace", "(", "@", "Con...
Creates a new namespace. @param req The HTTP request. @param namespaceDto The namespace to create. @return The updated namespace DTO for the created namespace. @throws WebApplicationException If an error occurs.
[ "Creates", "a", "new", "namespace", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/NamespaceResources.java#L102-L116
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java
Check.notEmpty
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) public static <T extends Map<?, ?>> T notEmpty(@Nonnull final T map, @Nullable final String name) { notNull(map); notEmpty(map, map.isEmpty(), name); return map; }
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) public static <T extends Map<?, ?>> T notEmpty(@Nonnull final T map, @Nullable final String name) { notNull(map); notEmpty(map, map.isEmpty(), name); return map; }
[ "@", "ArgumentsChecked", "@", "Throws", "(", "{", "IllegalNullArgumentException", ".", "class", ",", "IllegalEmptyArgumentException", ".", "class", "}", ")", "public", "static", "<", "T", "extends", "Map", "<", "?", ",", "?", ">", ">", "T", "notEmpty", "(", ...
Ensures that a passed map as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(Collection, String)} and pass as second argument the name of the parameter to enhance the exception message. @param map a map which should not be empty @param name name of object reference (in source code) @return the passed reference that is not empty @throws IllegalNullArgumentException if the given argument {@code map} is {@code null} @throws IllegalEmptyArgumentException if the given argument {@code map} is empty
[ "Ensures", "that", "a", "passed", "map", "as", "a", "parameter", "of", "the", "calling", "method", "is", "not", "empty", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2116-L2122
esigate/esigate
esigate-core/src/main/java/org/esigate/extension/surrogate/Surrogate.java
Surrogate.processSurrogateControlContent
private static void processSurrogateControlContent(HttpResponse response, boolean keepHeader) { if (!response.containsHeader(H_SURROGATE_CONTROL)) { return; } if (!keepHeader) { response.removeHeaders(H_SURROGATE_CONTROL); return; } MoveResponseHeader.moveHeader(response, H_X_NEXT_SURROGATE_CONTROL, H_SURROGATE_CONTROL); }
java
private static void processSurrogateControlContent(HttpResponse response, boolean keepHeader) { if (!response.containsHeader(H_SURROGATE_CONTROL)) { return; } if (!keepHeader) { response.removeHeaders(H_SURROGATE_CONTROL); return; } MoveResponseHeader.moveHeader(response, H_X_NEXT_SURROGATE_CONTROL, H_SURROGATE_CONTROL); }
[ "private", "static", "void", "processSurrogateControlContent", "(", "HttpResponse", "response", ",", "boolean", "keepHeader", ")", "{", "if", "(", "!", "response", ".", "containsHeader", "(", "H_SURROGATE_CONTROL", ")", ")", "{", "return", ";", "}", "if", "(", ...
Remove Surrogate-Control header or replace by its new value. @param response backend HTTP response. @param keepHeader should the Surrogate-Control header be forwarded to the client.
[ "Remove", "Surrogate", "-", "Control", "header", "or", "replace", "by", "its", "new", "value", "." ]
train
https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/extension/surrogate/Surrogate.java#L509-L520
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java
JschUtil.openSession
public static Session openSession(String sshHost, int sshPort, String sshUser, String sshPass) { final Session session = createSession(sshHost, sshPort, sshUser, sshPass); try { session.connect(); } catch (JSchException e) { throw new JschRuntimeException(e); } return session; }
java
public static Session openSession(String sshHost, int sshPort, String sshUser, String sshPass) { final Session session = createSession(sshHost, sshPort, sshUser, sshPass); try { session.connect(); } catch (JSchException e) { throw new JschRuntimeException(e); } return session; }
[ "public", "static", "Session", "openSession", "(", "String", "sshHost", ",", "int", "sshPort", ",", "String", "sshUser", ",", "String", "sshPass", ")", "{", "final", "Session", "session", "=", "createSession", "(", "sshHost", ",", "sshPort", ",", "sshUser", ...
打开一个新的SSH会话 @param sshHost 主机 @param sshPort 端口 @param sshUser 用户名 @param sshPass 密码 @return SSH会话
[ "打开一个新的SSH会话" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L69-L77
voldemort/voldemort
src/java/voldemort/utils/JmxUtils.java
JmxUtils.extractParameterInfo
public static MBeanParameterInfo[] extractParameterInfo(Method m) { Class<?>[] types = m.getParameterTypes(); Annotation[][] annotations = m.getParameterAnnotations(); MBeanParameterInfo[] params = new MBeanParameterInfo[types.length]; for(int i = 0; i < params.length; i++) { boolean hasAnnotation = false; for(int j = 0; j < annotations[i].length; j++) { if(annotations[i][j] instanceof JmxParam) { JmxParam param = (JmxParam) annotations[i][j]; params[i] = new MBeanParameterInfo(param.name(), types[i].getName(), param.description()); hasAnnotation = true; break; } } if(!hasAnnotation) { params[i] = new MBeanParameterInfo("", types[i].getName(), ""); } } return params; }
java
public static MBeanParameterInfo[] extractParameterInfo(Method m) { Class<?>[] types = m.getParameterTypes(); Annotation[][] annotations = m.getParameterAnnotations(); MBeanParameterInfo[] params = new MBeanParameterInfo[types.length]; for(int i = 0; i < params.length; i++) { boolean hasAnnotation = false; for(int j = 0; j < annotations[i].length; j++) { if(annotations[i][j] instanceof JmxParam) { JmxParam param = (JmxParam) annotations[i][j]; params[i] = new MBeanParameterInfo(param.name(), types[i].getName(), param.description()); hasAnnotation = true; break; } } if(!hasAnnotation) { params[i] = new MBeanParameterInfo("", types[i].getName(), ""); } } return params; }
[ "public", "static", "MBeanParameterInfo", "[", "]", "extractParameterInfo", "(", "Method", "m", ")", "{", "Class", "<", "?", ">", "[", "]", "types", "=", "m", ".", "getParameterTypes", "(", ")", ";", "Annotation", "[", "]", "[", "]", "annotations", "=", ...
Extract the parameters from a method using the Jmx annotation if present, or just the raw types otherwise @param m The method to extract parameters from @return An array of parameter infos
[ "Extract", "the", "parameters", "from", "a", "method", "using", "the", "Jmx", "annotation", "if", "present", "or", "just", "the", "raw", "types", "otherwise" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L207-L229
google/error-prone
check_api/src/main/java/com/google/errorprone/matchers/Description.java
Description.applySeverityOverride
@CheckReturnValue public Description applySeverityOverride(SeverityLevel severity) { return new Description(position, checkName, rawMessage, linkUrl, fixes, severity); }
java
@CheckReturnValue public Description applySeverityOverride(SeverityLevel severity) { return new Description(position, checkName, rawMessage, linkUrl, fixes, severity); }
[ "@", "CheckReturnValue", "public", "Description", "applySeverityOverride", "(", "SeverityLevel", "severity", ")", "{", "return", "new", "Description", "(", "position", ",", "checkName", ",", "rawMessage", ",", "linkUrl", ",", "fixes", ",", "severity", ")", ";", ...
Internal-only. Has no effect if applied to a Description within a BugChecker.
[ "Internal", "-", "only", ".", "Has", "no", "effect", "if", "applied", "to", "a", "Description", "within", "a", "BugChecker", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Description.java#L126-L129
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java
DbPersistenceManager.createCheckSchemaOperation
protected CheckSchemaOperation createCheckSchemaOperation() { InputStream in = AbstractBundlePersistenceManager.class.getResourceAsStream( databaseType + ".ddl"); return new CheckSchemaOperation(conHelper, in, schemaObjectPrefix + "BUNDLE").addVariableReplacement( CheckSchemaOperation.SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix); }
java
protected CheckSchemaOperation createCheckSchemaOperation() { InputStream in = AbstractBundlePersistenceManager.class.getResourceAsStream( databaseType + ".ddl"); return new CheckSchemaOperation(conHelper, in, schemaObjectPrefix + "BUNDLE").addVariableReplacement( CheckSchemaOperation.SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix); }
[ "protected", "CheckSchemaOperation", "createCheckSchemaOperation", "(", ")", "{", "InputStream", "in", "=", "AbstractBundlePersistenceManager", ".", "class", ".", "getResourceAsStream", "(", "databaseType", "+", "\".ddl\"", ")", ";", "return", "new", "CheckSchemaOperation...
This method is called from {@link #init(PMContext)} after the {@link #createConnectionHelper(DataSource)} method, and returns a default {@link CheckSchemaOperation}. Subclasses can overrride this implementation to get a customized implementation. @return a new {@link CheckSchemaOperation} instance
[ "This", "method", "is", "called", "from", "{", "@link", "#init", "(", "PMContext", ")", "}", "after", "the", "{", "@link", "#createConnectionHelper", "(", "DataSource", ")", "}", "method", "and", "returns", "a", "default", "{", "@link", "CheckSchemaOperation",...
train
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java#L577-L583
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuDeviceGetName
public static int cuDeviceGetName(byte name[], int len, CUdevice dev) { return checkResult(cuDeviceGetNameNative(name, len, dev)); }
java
public static int cuDeviceGetName(byte name[], int len, CUdevice dev) { return checkResult(cuDeviceGetNameNative(name, len, dev)); }
[ "public", "static", "int", "cuDeviceGetName", "(", "byte", "name", "[", "]", ",", "int", "len", ",", "CUdevice", "dev", ")", "{", "return", "checkResult", "(", "cuDeviceGetNameNative", "(", "name", ",", "len", ",", "dev", ")", ")", ";", "}" ]
Returns an identifer string for the device. <pre> CUresult cuDeviceGetName ( char* name, int len, CUdevice dev ) </pre> <div> <p>Returns an identifer string for the device. Returns an ASCII string identifying the device <tt>dev</tt> in the NULL-terminated string pointed to by <tt>name</tt>. <tt>len</tt> specifies the maximum length of the string that may be returned. </p> <div> <span>Note:</span> <p>Note that this function may also return error codes from previous, asynchronous launches. </p> </div> </p> </div> @param name Returned identifier string for the device @param len Maximum length of string to store in name @param dev Device to get identifier string for @return CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_INVALID_DEVICE @see JCudaDriver#cuDeviceGetAttribute @see JCudaDriver#cuDeviceGetCount @see JCudaDriver#cuDeviceGet @see JCudaDriver#cuDeviceTotalMem
[ "Returns", "an", "identifer", "string", "for", "the", "device", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L655-L658
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/LuceneKey2StringMapper.java
LuceneKey2StringMapper.getKeyMapping
@Override public Object getKeyMapping(String key) { if (key == null) { throw new IllegalArgumentException("Not supporting null keys"); } // ChunkCacheKey: "C|" + fileName + "|" + chunkId + "|" + bufferSize "|" + indexName + "|" + affinitySegmentId; // FileCacheKey : "M|" + fileName + "|"+ indexName + "|" + affinitySegmentId; // FileListCacheKey : "*|" + indexName + "|" + affinitySegmentId; // FileReadLockKey : "RL|" + fileName + "|"+ indexName + "|" + affinitySegmentId; String[] split = singlePipePattern.split(key); switch (split[0]) { case "C": { if (split.length != 6) { throw log.keyMappperUnexpectedStringFormat(key); } final String indexName = split[4]; final String fileName = split[1]; final int chunkId = toInt(split[2], key); final int bufferSize = toInt(split[3], key); final int affinitySegmentId = toInt(split[5], key); return new ChunkCacheKey(indexName, fileName, chunkId, bufferSize, affinitySegmentId); } case "M": { if (split.length != 4) throw log.keyMappperUnexpectedStringFormat(key); final String indexName = split[2]; final String fileName = split[1]; final int affinitySegmentId = toInt(split[3], key); return new FileCacheKey(indexName, fileName, affinitySegmentId); } case "*": { if (split.length != 3) throw log.keyMappperUnexpectedStringFormat(key); final String indexName = split[1]; final int affinitySegmentId = toInt(split[2], key); return new FileListCacheKey(indexName, affinitySegmentId); } case "RL": { if (split.length != 4) throw log.keyMappperUnexpectedStringFormat(key); final String indexName = split[2]; final String fileName = split[1]; final int affinitySegmentId = toInt(split[3], key); return new FileReadLockKey(indexName, fileName, affinitySegmentId); } default: throw log.keyMappperUnexpectedStringFormat(key); } }
java
@Override public Object getKeyMapping(String key) { if (key == null) { throw new IllegalArgumentException("Not supporting null keys"); } // ChunkCacheKey: "C|" + fileName + "|" + chunkId + "|" + bufferSize "|" + indexName + "|" + affinitySegmentId; // FileCacheKey : "M|" + fileName + "|"+ indexName + "|" + affinitySegmentId; // FileListCacheKey : "*|" + indexName + "|" + affinitySegmentId; // FileReadLockKey : "RL|" + fileName + "|"+ indexName + "|" + affinitySegmentId; String[] split = singlePipePattern.split(key); switch (split[0]) { case "C": { if (split.length != 6) { throw log.keyMappperUnexpectedStringFormat(key); } final String indexName = split[4]; final String fileName = split[1]; final int chunkId = toInt(split[2], key); final int bufferSize = toInt(split[3], key); final int affinitySegmentId = toInt(split[5], key); return new ChunkCacheKey(indexName, fileName, chunkId, bufferSize, affinitySegmentId); } case "M": { if (split.length != 4) throw log.keyMappperUnexpectedStringFormat(key); final String indexName = split[2]; final String fileName = split[1]; final int affinitySegmentId = toInt(split[3], key); return new FileCacheKey(indexName, fileName, affinitySegmentId); } case "*": { if (split.length != 3) throw log.keyMappperUnexpectedStringFormat(key); final String indexName = split[1]; final int affinitySegmentId = toInt(split[2], key); return new FileListCacheKey(indexName, affinitySegmentId); } case "RL": { if (split.length != 4) throw log.keyMappperUnexpectedStringFormat(key); final String indexName = split[2]; final String fileName = split[1]; final int affinitySegmentId = toInt(split[3], key); return new FileReadLockKey(indexName, fileName, affinitySegmentId); } default: throw log.keyMappperUnexpectedStringFormat(key); } }
[ "@", "Override", "public", "Object", "getKeyMapping", "(", "String", "key", ")", "{", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Not supporting null keys\"", ")", ";", "}", "// ChunkCacheKey: \"C|\" + fileName + \"|...
This method has to perform the inverse transformation of the keys used in the Lucene Directory from String to object. So this implementation is strongly coupled to the toString method of each key type. @see ChunkCacheKey#toString() @see FileCacheKey#toString() @see FileListCacheKey#toString() @see FileReadLockKey#toString()
[ "This", "method", "has", "to", "perform", "the", "inverse", "transformation", "of", "the", "keys", "used", "in", "the", "Lucene", "Directory", "from", "String", "to", "object", ".", "So", "this", "implementation", "is", "strongly", "coupled", "to", "the", "t...
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/LuceneKey2StringMapper.java#L52-L97
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java
CommsUtils.getRuntimeBooleanProperty
public static boolean getRuntimeBooleanProperty(String property, String defaultValue) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeBooleanProperty", new Object[] {property, defaultValue}); boolean runtimeProp = Boolean.valueOf(RuntimeInfo.getPropertyWithMsg(property, defaultValue)).booleanValue(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getRuntimeBooleanProperty", ""+runtimeProp); return runtimeProp; }
java
public static boolean getRuntimeBooleanProperty(String property, String defaultValue) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeBooleanProperty", new Object[] {property, defaultValue}); boolean runtimeProp = Boolean.valueOf(RuntimeInfo.getPropertyWithMsg(property, defaultValue)).booleanValue(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getRuntimeBooleanProperty", ""+runtimeProp); return runtimeProp; }
[ "public", "static", "boolean", "getRuntimeBooleanProperty", "(", "String", "property", ",", "String", "defaultValue", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "...
This method will get a runtime property from the sib.properties file as a boolean. @param property The property key used to look up in the file. @param defaultValue The default value if the property is not in the file. @return Returns the property value.
[ "This", "method", "will", "get", "a", "runtime", "property", "from", "the", "sib", ".", "properties", "file", "as", "a", "boolean", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L77-L86
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java
LogAnalyticsInner.beginExportRequestRateByIntervalAsync
public Observable<LogAnalyticsOperationResultInner> beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) { return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1<ServiceResponse<LogAnalyticsOperationResultInner>, LogAnalyticsOperationResultInner>() { @Override public LogAnalyticsOperationResultInner call(ServiceResponse<LogAnalyticsOperationResultInner> response) { return response.body(); } }); }
java
public Observable<LogAnalyticsOperationResultInner> beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) { return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1<ServiceResponse<LogAnalyticsOperationResultInner>, LogAnalyticsOperationResultInner>() { @Override public LogAnalyticsOperationResultInner call(ServiceResponse<LogAnalyticsOperationResultInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "LogAnalyticsOperationResultInner", ">", "beginExportRequestRateByIntervalAsync", "(", "String", "location", ",", "RequestRateByIntervalInput", "parameters", ")", "{", "return", "beginExportRequestRateByIntervalWithServiceResponseAsync", "(", "location"...
Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @param location The location upon which virtual-machine-sizes is queried. @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the LogAnalyticsOperationResultInner object
[ "Export", "logs", "that", "show", "Api", "requests", "made", "by", "this", "subscription", "in", "the", "given", "time", "window", "to", "show", "throttling", "activities", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java#L181-L188
rundeck/rundeck
core/src/main/java/com/dtolabs/shared/resources/ResourceXMLParser.java
ResourceXMLParser.parseEnt
private Entity parseEnt(final Node node, final EntitySet set) throws ResourceXMLParserException { final Entity ent = parseResourceRef(set, node); ent.setResourceType(node.getName()); parseEntProperties(ent, node); parseEntSubAttributes(ent, node); return ent; }
java
private Entity parseEnt(final Node node, final EntitySet set) throws ResourceXMLParserException { final Entity ent = parseResourceRef(set, node); ent.setResourceType(node.getName()); parseEntProperties(ent, node); parseEntSubAttributes(ent, node); return ent; }
[ "private", "Entity", "parseEnt", "(", "final", "Node", "node", ",", "final", "EntitySet", "set", ")", "throws", "ResourceXMLParserException", "{", "final", "Entity", "ent", "=", "parseResourceRef", "(", "set", ",", "node", ")", ";", "ent", ".", "setResourceTyp...
Given xml Node and EntitySet, parse the entity defined in the Node @param node DOM node @param set entity set holder @return parsed Entity object @throws ResourceXMLParserException if entity definition was previously found, or another error occurs
[ "Given", "xml", "Node", "and", "EntitySet", "parse", "the", "entity", "defined", "in", "the", "Node" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/shared/resources/ResourceXMLParser.java#L183-L189
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/registry/JMXBridgeListener.java
JMXBridgeListener.createName
private String createName(String producerId, String statName) { String appName = encodeAppName(MoskitoConfigurationHolder.getConfiguration().getApplicationName()); return "MoSKito."+(appName.length()>0 ? appName+ '.' :"")+"producers:type="+producerId+ '.' +statName; }
java
private String createName(String producerId, String statName) { String appName = encodeAppName(MoskitoConfigurationHolder.getConfiguration().getApplicationName()); return "MoSKito."+(appName.length()>0 ? appName+ '.' :"")+"producers:type="+producerId+ '.' +statName; }
[ "private", "String", "createName", "(", "String", "producerId", ",", "String", "statName", ")", "{", "String", "appName", "=", "encodeAppName", "(", "MoskitoConfigurationHolder", ".", "getConfiguration", "(", ")", ".", "getApplicationName", "(", ")", ")", ";", "...
Creates JMX name for a producer. @param producerId target producerId. @param statName target statName. @return the name for JMXBean.
[ "Creates", "JMX", "name", "for", "a", "producer", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/JMXBridgeListener.java#L65-L68
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java
StructuredQueryBuilder.temporalPeriodRange
public StructuredQueryDefinition temporalPeriodRange(Axis axis, TemporalOperator operator, Period period, String... options) { if ( axis == null ) throw new IllegalArgumentException("axis cannot be null"); if ( period == null ) throw new IllegalArgumentException("period cannot be null"); return temporalPeriodRange(new Axis[] {axis}, operator, new Period[] {period}, options); }
java
public StructuredQueryDefinition temporalPeriodRange(Axis axis, TemporalOperator operator, Period period, String... options) { if ( axis == null ) throw new IllegalArgumentException("axis cannot be null"); if ( period == null ) throw new IllegalArgumentException("period cannot be null"); return temporalPeriodRange(new Axis[] {axis}, operator, new Period[] {period}, options); }
[ "public", "StructuredQueryDefinition", "temporalPeriodRange", "(", "Axis", "axis", ",", "TemporalOperator", "operator", ",", "Period", "period", ",", "String", "...", "options", ")", "{", "if", "(", "axis", "==", "null", ")", "throw", "new", "IllegalArgumentExcept...
Matches documents that have a value in the specified axis that matches the specified period using the specified operator. @param axis the axis of document temporal values used to determine which documents have values that match this query @param operator the operator used to determine if values in the axis match the specified period @param period the period considered using the operator @param options string options from the list for <a href="http://docs.marklogic.com/cts:period-range-query">cts:period-range-query calls</a> @return a query to filter by comparing a temporal axis to period values @see <a href="http://docs.marklogic.com/cts:period-range-query">cts:period-range-query</a> @see <a href="http://docs.marklogic.com/guide/search-dev/structured-query#id_91434"> Structured Queries: period-range-query</a>
[ "Matches", "documents", "that", "have", "a", "value", "in", "the", "specified", "axis", "that", "matches", "the", "specified", "period", "using", "the", "specified", "operator", "." ]
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L2779-L2785
gallandarakhneorg/afc
core/vmutils/src/main/java/org/arakhne/afc/vmutil/DynamicURLClassLoader.java
DynamicURLClassLoader.findClass
@Override @Pure protected Class<?> findClass(final String name) throws ClassNotFoundException { try { return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() { @Override public Class<?> run() throws ClassNotFoundException { final String path = name.replace('.', '/').concat(".class"); //$NON-NLS-1$ final sun.misc.Resource res = DynamicURLClassLoader.this.ucp.getResource(path, false); if (res != null) { try { return defineClass(name, res); } catch (IOException e) { throw new ClassNotFoundException(name, e); } } throw new ClassNotFoundException(name); } }, this.acc); } catch (java.security.PrivilegedActionException pae) { throw (ClassNotFoundException) pae.getException(); } }
java
@Override @Pure protected Class<?> findClass(final String name) throws ClassNotFoundException { try { return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() { @Override public Class<?> run() throws ClassNotFoundException { final String path = name.replace('.', '/').concat(".class"); //$NON-NLS-1$ final sun.misc.Resource res = DynamicURLClassLoader.this.ucp.getResource(path, false); if (res != null) { try { return defineClass(name, res); } catch (IOException e) { throw new ClassNotFoundException(name, e); } } throw new ClassNotFoundException(name); } }, this.acc); } catch (java.security.PrivilegedActionException pae) { throw (ClassNotFoundException) pae.getException(); } }
[ "@", "Override", "@", "Pure", "protected", "Class", "<", "?", ">", "findClass", "(", "final", "String", "name", ")", "throws", "ClassNotFoundException", "{", "try", "{", "return", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedExceptionAction", ...
Finds and loads the class with the specified name from the URL search path. Any URLs referring to JAR files are loaded and opened as needed until the class is found. @param name the name of the class @return the resulting class @exception ClassNotFoundException if the class could not be found
[ "Finds", "and", "loads", "the", "class", "with", "the", "specified", "name", "from", "the", "URL", "search", "path", ".", "Any", "URLs", "referring", "to", "JAR", "files", "are", "loaded", "and", "opened", "as", "needed", "until", "the", "class", "is", "...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/DynamicURLClassLoader.java#L177-L199
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java
MBTilesHelper.readGridcoverageImageForTile
public static BufferedImage readGridcoverageImageForTile( AbstractGridCoverage2DReader reader, int x, int y, int zoom, CoordinateReferenceSystem resampleCrs ) throws IOException { double north = tile2lat(y, zoom); double south = tile2lat(y + 1, zoom); double west = tile2lon(x, zoom); double east = tile2lon(x + 1, zoom); Coordinate ll = new Coordinate(west, south); Coordinate ur = new Coordinate(east, north); try { CoordinateReferenceSystem sourceCRS = DefaultGeographicCRS.WGS84; MathTransform transform = CRS.findMathTransform(sourceCRS, resampleCrs); ll = JTS.transform(ll, null, transform); ur = JTS.transform(ur, null, transform); } catch (Exception e) { e.printStackTrace(); } BufferedImage image = ImageUtilities.imageFromReader(reader, TILESIZE, TILESIZE, ll.x, ur.x, ll.y, ur.y, resampleCrs); return image; }
java
public static BufferedImage readGridcoverageImageForTile( AbstractGridCoverage2DReader reader, int x, int y, int zoom, CoordinateReferenceSystem resampleCrs ) throws IOException { double north = tile2lat(y, zoom); double south = tile2lat(y + 1, zoom); double west = tile2lon(x, zoom); double east = tile2lon(x + 1, zoom); Coordinate ll = new Coordinate(west, south); Coordinate ur = new Coordinate(east, north); try { CoordinateReferenceSystem sourceCRS = DefaultGeographicCRS.WGS84; MathTransform transform = CRS.findMathTransform(sourceCRS, resampleCrs); ll = JTS.transform(ll, null, transform); ur = JTS.transform(ur, null, transform); } catch (Exception e) { e.printStackTrace(); } BufferedImage image = ImageUtilities.imageFromReader(reader, TILESIZE, TILESIZE, ll.x, ur.x, ll.y, ur.y, resampleCrs); return image; }
[ "public", "static", "BufferedImage", "readGridcoverageImageForTile", "(", "AbstractGridCoverage2DReader", "reader", ",", "int", "x", ",", "int", "y", ",", "int", "zoom", ",", "CoordinateReferenceSystem", "resampleCrs", ")", "throws", "IOException", "{", "double", "nor...
Read the image of a tile from a generic geotools coverage reader. @param reader the reader, expected to be in CRS 3857. @param x the tile x. @param y the tile y. @param zoom the zoomlevel. @return the image. @throws IOException
[ "Read", "the", "image", "of", "a", "tile", "from", "a", "generic", "geotools", "coverage", "reader", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java#L341-L363
Javacord/Javacord
javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java
UserImpl.getAvatar
public static Icon getAvatar(DiscordApi api, String avatarHash, String discriminator, long userId) { StringBuilder url = new StringBuilder("https://cdn.discordapp.com/"); if (avatarHash == null) { url.append("embed/avatars/") .append(Integer.parseInt(discriminator) % 5) .append(".png"); } else { url.append("avatars/") .append(userId).append('/').append(avatarHash) .append(avatarHash.startsWith("a_") ? ".gif" : ".png"); } try { return new IconImpl(api, new URL(url.toString())); } catch (MalformedURLException e) { logger.warn("Seems like the url of the avatar is malformed! Please contact the developer!", e); return null; } }
java
public static Icon getAvatar(DiscordApi api, String avatarHash, String discriminator, long userId) { StringBuilder url = new StringBuilder("https://cdn.discordapp.com/"); if (avatarHash == null) { url.append("embed/avatars/") .append(Integer.parseInt(discriminator) % 5) .append(".png"); } else { url.append("avatars/") .append(userId).append('/').append(avatarHash) .append(avatarHash.startsWith("a_") ? ".gif" : ".png"); } try { return new IconImpl(api, new URL(url.toString())); } catch (MalformedURLException e) { logger.warn("Seems like the url of the avatar is malformed! Please contact the developer!", e); return null; } }
[ "public", "static", "Icon", "getAvatar", "(", "DiscordApi", "api", ",", "String", "avatarHash", ",", "String", "discriminator", ",", "long", "userId", ")", "{", "StringBuilder", "url", "=", "new", "StringBuilder", "(", "\"https://cdn.discordapp.com/\"", ")", ";", ...
Gets the avatar for the given details. @param api The discord api instance. @param avatarHash The avatar hash or {@code null} for default avatar. @param discriminator The discriminator if default avatar is wanted. @param userId The user id. @return The avatar for the given details.
[ "Gets", "the", "avatar", "for", "the", "given", "details", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java#L245-L262
astrapi69/jaulp-wicket
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java
ComponentFactory.newLabel
public static <T> Label newLabel(final String id, final String forId, final IModel<T> model) { final Label label = new Label(id, model); label.add(new AttributeAppender("for", Model.of(forId), " ")); label.setOutputMarkupId(true); return label; }
java
public static <T> Label newLabel(final String id, final String forId, final IModel<T> model) { final Label label = new Label(id, model); label.add(new AttributeAppender("for", Model.of(forId), " ")); label.setOutputMarkupId(true); return label; }
[ "public", "static", "<", "T", ">", "Label", "newLabel", "(", "final", "String", "id", ",", "final", "String", "forId", ",", "final", "IModel", "<", "T", ">", "model", ")", "{", "final", "Label", "label", "=", "new", "Label", "(", "id", ",", "model", ...
Factory method for create a new {@link Label} with the for attribute. @param <T> the generic type of the model @param id the id @param forId the for id @param model the model @return the new {@link Label}
[ "Factory", "method", "for", "create", "a", "new", "{", "@link", "Label", "}", "with", "the", "for", "attribute", "." ]
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L461-L467
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java
BundlePathMappingBuilder.addFilePathMapping
protected void addFilePathMapping(BundlePathMapping bundlePathMapping, String pathMapping) { long timestamp = 0; String filePath = resourceReaderHandler.getFilePath(pathMapping); if (filePath != null) { timestamp = resourceReaderHandler.getLastModified(filePath); List<FilePathMapping> filePathMappings = bundlePathMapping.getFilePathMappings(); boolean found = false; for (FilePathMapping filePathMapping : filePathMappings) { if (filePathMapping.getPath().equals(filePath)) { found = true; break; } } if (!found) { filePathMappings.add(new FilePathMapping(bundle, filePath, timestamp)); } } }
java
protected void addFilePathMapping(BundlePathMapping bundlePathMapping, String pathMapping) { long timestamp = 0; String filePath = resourceReaderHandler.getFilePath(pathMapping); if (filePath != null) { timestamp = resourceReaderHandler.getLastModified(filePath); List<FilePathMapping> filePathMappings = bundlePathMapping.getFilePathMappings(); boolean found = false; for (FilePathMapping filePathMapping : filePathMappings) { if (filePathMapping.getPath().equals(filePath)) { found = true; break; } } if (!found) { filePathMappings.add(new FilePathMapping(bundle, filePath, timestamp)); } } }
[ "protected", "void", "addFilePathMapping", "(", "BundlePathMapping", "bundlePathMapping", ",", "String", "pathMapping", ")", "{", "long", "timestamp", "=", "0", ";", "String", "filePath", "=", "resourceReaderHandler", ".", "getFilePath", "(", "pathMapping", ")", ";"...
Adds the path mapping to the file path mapping @param bundlePathMapping the bundle path mapping @param pathMapping the path mapping to add
[ "Adds", "the", "path", "mapping", "to", "the", "file", "path", "mapping" ]
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/BundlePathMappingBuilder.java#L195-L213
javagl/CommonUI
src/main/java/de/javagl/common/ui/JTrees.java
JTrees.translatePath
public static TreePath translatePath( TreeModel newTreeModel, TreePath oldPath) { return translatePath(newTreeModel, oldPath, Objects::equals); }
java
public static TreePath translatePath( TreeModel newTreeModel, TreePath oldPath) { return translatePath(newTreeModel, oldPath, Objects::equals); }
[ "public", "static", "TreePath", "translatePath", "(", "TreeModel", "newTreeModel", ",", "TreePath", "oldPath", ")", "{", "return", "translatePath", "(", "newTreeModel", ",", "oldPath", ",", "Objects", "::", "equals", ")", ";", "}" ]
Translates one TreePath to a new TreeModel. This methods assumes DefaultMutableTreeNodes. @param newTreeModel The new tree model @param oldPath The old tree path @return The new tree path, or <code>null</code> if there is no corresponding path in the new tree model
[ "Translates", "one", "TreePath", "to", "a", "new", "TreeModel", ".", "This", "methods", "assumes", "DefaultMutableTreeNodes", "." ]
train
https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L489-L493
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.createImageRegions
public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).toBlocking().single().body(); }
java
public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).toBlocking().single().body(); }
[ "public", "ImageRegionCreateSummary", "createImageRegions", "(", "UUID", "projectId", ",", "CreateImageRegionsOptionalParameter", "createImageRegionsOptionalParameter", ")", "{", "return", "createImageRegionsWithServiceResponseAsync", "(", "projectId", ",", "createImageRegionsOptiona...
Create a set of image regions. This API accepts a batch of image regions, and optionally tags, to update existing images with region information. There is a limit of 64 entries in the batch. @param projectId The project id @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API @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 ImageRegionCreateSummary object if successful.
[ "Create", "a", "set", "of", "image", "regions", ".", "This", "API", "accepts", "a", "batch", "of", "image", "regions", "and", "optionally", "tags", "to", "update", "existing", "images", "with", "region", "information", ".", "There", "is", "a", "limit", "of...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3345-L3347
keenon/loglinear
src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java
GraphicalModel.addBinaryFactor
public Factor addBinaryFactor(int a, int b, BiFunction<Integer, Integer, ConcatVector> featurizer) { int[] variableDims = getVariableSizes(); assert a < variableDims.length; assert b < variableDims.length; return addFactor(new int[]{a, b}, new int[]{variableDims[a], variableDims[b]}, assignment -> featurizer.apply(assignment[0], assignment[1]) ); }
java
public Factor addBinaryFactor(int a, int b, BiFunction<Integer, Integer, ConcatVector> featurizer) { int[] variableDims = getVariableSizes(); assert a < variableDims.length; assert b < variableDims.length; return addFactor(new int[]{a, b}, new int[]{variableDims[a], variableDims[b]}, assignment -> featurizer.apply(assignment[0], assignment[1]) ); }
[ "public", "Factor", "addBinaryFactor", "(", "int", "a", ",", "int", "b", ",", "BiFunction", "<", "Integer", ",", "Integer", ",", "ConcatVector", ">", "featurizer", ")", "{", "int", "[", "]", "variableDims", "=", "getVariableSizes", "(", ")", ";", "assert",...
A simple helper function for defining a binary factor. That is, a factor between two variables in the graphical model. @param a The index of the first variable. @param b The index of the second variable @param featurizer The featurizer. This takes as input two assignments for the two variables, and returns the features on those variables. @return a reference to the created factor. This can be safely ignored, as the factor is already saved in the model
[ "A", "simple", "helper", "function", "for", "defining", "a", "binary", "factor", ".", "That", "is", "a", "factor", "between", "two", "variables", "in", "the", "graphical", "model", "." ]
train
https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java#L437-L442
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/SubsequentRequestDispatcher.java
SubsequentRequestDispatcher.handleOrphanRequest
private static void handleOrphanRequest(final SipProvider sipProvider, final SipServletRequestImpl sipServletRequest, String applicationId, final SipContext sipContext) throws DispatcherException { final String applicationName = sipContext.getApplicationName(); final Request request = (Request) sipServletRequest.getMessage(); // Making sure to nullify those ref so that if there is a race condition as in // http://code.google.com/p/mobicents/issues/detail?id=2937 // we return null instead of the invalidated sip application session sipServletRequest.setSipSession(null); sipServletRequest.setSipSessionKey(null); sipServletRequest.setOrphan(true); sipServletRequest.setAppSessionId(applicationId); sipServletRequest.setCurrentApplicationName(applicationName); try { MessageDispatcher.callServletForOrphanRequest(sipContext, sipServletRequest); try { String transport = JainSipUtils.findTransport(request); SipConnector connector = StaticServiceHolder.sipStandardService.findSipConnector(transport); String branch = ((ViaHeader)sipServletRequest.getMessage().getHeader(ViaHeader.NAME)).getBranch(); ViaHeader via = JainSipUtils.createViaHeader(sipContext.getSipApplicationDispatcher().getSipNetworkInterfaceManager(), request, JainSipUtils.createBranch("orphan", sipContext.getSipApplicationDispatcher().getHashFromApplicationName(applicationName), Integer.toString(branch.hashCode()) + branch.substring(branch.length()/2)), null) ; if(connector.isUseStaticAddress()) { try { via.setHost(connector.getStaticServerAddress()); via.setPort(connector.getStaticServerPort()); } catch (Exception e) { throw new RuntimeException(e); } } sipServletRequest.getMessage().addHeader(via); sipProvider.sendRequest((Request) sipServletRequest.getMessage()); sipContext.getSipApplicationDispatcher().updateRequestsStatistics(request, false); } catch (SipException e) { logger.error("Error routing orphaned request" ,e); } return; } catch (ServletException e) { throw new DispatcherException(Response.SERVER_INTERNAL_ERROR, "An unexpected servlet exception occured while processing the following subsequent request " + request, e); } catch (IOException e) { throw new DispatcherException(Response.SERVER_INTERNAL_ERROR, "An unexpected servlet exception occured while processing the following subsequent request " + request, e); } }
java
private static void handleOrphanRequest(final SipProvider sipProvider, final SipServletRequestImpl sipServletRequest, String applicationId, final SipContext sipContext) throws DispatcherException { final String applicationName = sipContext.getApplicationName(); final Request request = (Request) sipServletRequest.getMessage(); // Making sure to nullify those ref so that if there is a race condition as in // http://code.google.com/p/mobicents/issues/detail?id=2937 // we return null instead of the invalidated sip application session sipServletRequest.setSipSession(null); sipServletRequest.setSipSessionKey(null); sipServletRequest.setOrphan(true); sipServletRequest.setAppSessionId(applicationId); sipServletRequest.setCurrentApplicationName(applicationName); try { MessageDispatcher.callServletForOrphanRequest(sipContext, sipServletRequest); try { String transport = JainSipUtils.findTransport(request); SipConnector connector = StaticServiceHolder.sipStandardService.findSipConnector(transport); String branch = ((ViaHeader)sipServletRequest.getMessage().getHeader(ViaHeader.NAME)).getBranch(); ViaHeader via = JainSipUtils.createViaHeader(sipContext.getSipApplicationDispatcher().getSipNetworkInterfaceManager(), request, JainSipUtils.createBranch("orphan", sipContext.getSipApplicationDispatcher().getHashFromApplicationName(applicationName), Integer.toString(branch.hashCode()) + branch.substring(branch.length()/2)), null) ; if(connector.isUseStaticAddress()) { try { via.setHost(connector.getStaticServerAddress()); via.setPort(connector.getStaticServerPort()); } catch (Exception e) { throw new RuntimeException(e); } } sipServletRequest.getMessage().addHeader(via); sipProvider.sendRequest((Request) sipServletRequest.getMessage()); sipContext.getSipApplicationDispatcher().updateRequestsStatistics(request, false); } catch (SipException e) { logger.error("Error routing orphaned request" ,e); } return; } catch (ServletException e) { throw new DispatcherException(Response.SERVER_INTERNAL_ERROR, "An unexpected servlet exception occured while processing the following subsequent request " + request, e); } catch (IOException e) { throw new DispatcherException(Response.SERVER_INTERNAL_ERROR, "An unexpected servlet exception occured while processing the following subsequent request " + request, e); } }
[ "private", "static", "void", "handleOrphanRequest", "(", "final", "SipProvider", "sipProvider", ",", "final", "SipServletRequestImpl", "sipServletRequest", ",", "String", "applicationId", ",", "final", "SipContext", "sipContext", ")", "throws", "DispatcherException", "{",...
/* http://code.google.com/p/mobicents/issues/detail?id=2547 Allows to route subsequent requests statelessly to proxy applications to improve perf and mem usage.
[ "/", "*", "http", ":", "//", "code", ".", "google", ".", "com", "/", "p", "/", "mobicents", "/", "issues", "/", "detail?id", "=", "2547", "Allows", "to", "route", "subsequent", "requests", "statelessly", "to", "proxy", "applications", "to", "improve", "p...
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/SubsequentRequestDispatcher.java#L558-L607
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicatedCloud_serviceName_upgradeRessource_duration_POST
public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_POST(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException { String qPath = "/order/dedicatedCloud/{serviceName}/upgradeRessource/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "upgradeType", upgradeType); addBody(o, "upgradedRessourceId", upgradedRessourceId); addBody(o, "upgradedRessourceType", upgradedRessourceType); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhOrder.class); }
java
public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_POST(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException { String qPath = "/order/dedicatedCloud/{serviceName}/upgradeRessource/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "upgradeType", upgradeType); addBody(o, "upgradedRessourceId", upgradedRessourceId); addBody(o, "upgradedRessourceType", upgradedRessourceType); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhOrder.class); }
[ "public", "OvhOrder", "dedicatedCloud_serviceName_upgradeRessource_duration_POST", "(", "String", "serviceName", ",", "String", "duration", ",", "OvhUpgradeTypeEnum", "upgradeType", ",", "Long", "upgradedRessourceId", ",", "OvhUpgradeRessourceTypeEnum", "upgradedRessourceType", "...
Create order REST: POST /order/dedicatedCloud/{serviceName}/upgradeRessource/{duration} @param upgradedRessourceType [required] The type of ressource you want to upgrade. @param upgradedRessourceId [required] The id of a particular ressource you want to upgrade in your Private Cloud (useless for "all" UpgradeRessourceTypeEnum) @param upgradeType [required] The type of upgrade you want to process on the ressource(s) @param serviceName [required] @param duration [required] Duration
[ "Create", "order" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5775-L5784
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/filters/DateSearcher.java
DateSearcher.addTerm
@Override public void addTerm(FilterTerm.Operator op, DB.DateTime date) throws IllegalStateException { final GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date.getValue()); cal.set(MILLISECOND, 0); switch (op) { case GreaterThan: cal.add(Calendar.SECOND, 1); super.addTerm(GreaterThanOrEqual, new DB.DateTime(cal.getTime())); break; case GreaterThanOrEqual: super.addTerm(GreaterThanOrEqual, new DB.DateTime(cal.getTime())); break; case LessThan: super.addTerm(LessThan, new DB.DateTime(cal.getTime())); break; case LessThanOrEqual: cal.add(Calendar.SECOND, 1); super.addTerm(LessThan, new DB.DateTime(cal.getTime())); break; case Equal: super.addTerm(GreaterThanOrEqual, new DB.DateTime(cal.getTime())); cal.add(Calendar.SECOND, 1); super.addTerm(LessThan, new DB.DateTime(cal.getTime())); break; default: throw new IllegalStateException("This operation is not supported: " + op); } }
java
@Override public void addTerm(FilterTerm.Operator op, DB.DateTime date) throws IllegalStateException { final GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date.getValue()); cal.set(MILLISECOND, 0); switch (op) { case GreaterThan: cal.add(Calendar.SECOND, 1); super.addTerm(GreaterThanOrEqual, new DB.DateTime(cal.getTime())); break; case GreaterThanOrEqual: super.addTerm(GreaterThanOrEqual, new DB.DateTime(cal.getTime())); break; case LessThan: super.addTerm(LessThan, new DB.DateTime(cal.getTime())); break; case LessThanOrEqual: cal.add(Calendar.SECOND, 1); super.addTerm(LessThan, new DB.DateTime(cal.getTime())); break; case Equal: super.addTerm(GreaterThanOrEqual, new DB.DateTime(cal.getTime())); cal.add(Calendar.SECOND, 1); super.addTerm(LessThan, new DB.DateTime(cal.getTime())); break; default: throw new IllegalStateException("This operation is not supported: " + op); } }
[ "@", "Override", "public", "void", "addTerm", "(", "FilterTerm", ".", "Operator", "op", ",", "DB", ".", "DateTime", "date", ")", "throws", "IllegalStateException", "{", "final", "GregorianCalendar", "cal", "=", "new", "GregorianCalendar", "(", ")", ";", "cal",...
Adds comparison term. Only specified {@link com.versionone.apiclient.FilterTerm.Operator} supported: <ul> <li>GreaterThan <li>GreaterThanOrEqual <li>LessThan <li>LessThanOrEqual <li>equal </ul> @param op comparison operator. @param date value to compare with. @throws IllegalStateException if wrong operator or wrong operators composition supplied.
[ "Adds", "comparison", "term", ".", "Only", "specified", "{", "@link", "com", ".", "versionone", ".", "apiclient", ".", "FilterTerm", ".", "Operator", "}", "supported", ":", "<ul", ">", "<li", ">", "GreaterThan", "<li", ">", "GreaterThanOrEqual", "<li", ">", ...
train
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/filters/DateSearcher.java#L39-L67
OpenLiberty/open-liberty
dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java
StaticTraceInstrumentation.processClassConfiguration
protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException { if (introspectAnnotations == false) { return new ClassConfigData(inputStream); } ClassReader cr = new ClassReader(inputStream); ClassWriter cw = new ClassWriter(cr, 0); // Don't compute anything - read only mode TraceConfigClassVisitor cv = new TraceConfigClassVisitor(cw); cr.accept(cv, 0); ClassInfo classInfo = cv.getClassInfo(); InputStream classInputStream = new ByteArrayInputStream(cw.toByteArray()); return new ClassConfigData(classInputStream, classInfo); }
java
protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException { if (introspectAnnotations == false) { return new ClassConfigData(inputStream); } ClassReader cr = new ClassReader(inputStream); ClassWriter cw = new ClassWriter(cr, 0); // Don't compute anything - read only mode TraceConfigClassVisitor cv = new TraceConfigClassVisitor(cw); cr.accept(cv, 0); ClassInfo classInfo = cv.getClassInfo(); InputStream classInputStream = new ByteArrayInputStream(cw.toByteArray()); return new ClassConfigData(classInputStream, classInfo); }
[ "protected", "ClassConfigData", "processClassConfiguration", "(", "final", "InputStream", "inputStream", ")", "throws", "IOException", "{", "if", "(", "introspectAnnotations", "==", "false", ")", "{", "return", "new", "ClassConfigData", "(", "inputStream", ")", ";", ...
Introspect configuration information from the class in the provided InputStream.
[ "Introspect", "configuration", "information", "from", "the", "class", "in", "the", "provided", "InputStream", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java#L206-L219
zafarkhaja/jsemver
src/main/java/com/github/zafarkhaja/semver/Version.java
Version.forIntegers
public static Version forIntegers(int major, int minor, int patch) { return new Version(new NormalVersion(major, minor, patch)); }
java
public static Version forIntegers(int major, int minor, int patch) { return new Version(new NormalVersion(major, minor, patch)); }
[ "public", "static", "Version", "forIntegers", "(", "int", "major", ",", "int", "minor", ",", "int", "patch", ")", "{", "return", "new", "Version", "(", "new", "NormalVersion", "(", "major", ",", "minor", ",", "patch", ")", ")", ";", "}" ]
Creates a new instance of {@code Version} for the specified version numbers. @param major the major version number @param minor the minor version number @param patch the patch version number @return a new instance of the {@code Version} class @throws IllegalArgumentException if a negative integer is passed @since 0.7.0
[ "Creates", "a", "new", "instance", "of", "{", "@code", "Version", "}", "for", "the", "specified", "version", "numbers", "." ]
train
https://github.com/zafarkhaja/jsemver/blob/1f4996ea3dab06193c378fd66fd4f8fdc8334cc6/src/main/java/com/github/zafarkhaja/semver/Version.java#L306-L308
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners() { List returnList = new ArrayList(); // Add all the PropertyChangeListeners if (listeners != null) { returnList.addAll(Arrays.asList(listeners.getListeners(PropertyChangeListener.class))); } // Add all the PropertyChangeListenerProxys if (children != null) { Iterator iterator = children.keySet().iterator(); while (iterator.hasNext()) { String key = (String) iterator.next(); PropertyChangeSupport child = (PropertyChangeSupport) children.get(key); PropertyChangeListener[] childListeners = child.getPropertyChangeListeners(); for (int index = childListeners.length - 1; index >= 0; index--) { returnList.add(new PropertyChangeListenerProxy(key, childListeners[index])); } } } return (PropertyChangeListener[]) returnList.toArray(new PropertyChangeListener[returnList.size()]); }
java
public PropertyChangeListener[] getPropertyChangeListeners() { List returnList = new ArrayList(); // Add all the PropertyChangeListeners if (listeners != null) { returnList.addAll(Arrays.asList(listeners.getListeners(PropertyChangeListener.class))); } // Add all the PropertyChangeListenerProxys if (children != null) { Iterator iterator = children.keySet().iterator(); while (iterator.hasNext()) { String key = (String) iterator.next(); PropertyChangeSupport child = (PropertyChangeSupport) children.get(key); PropertyChangeListener[] childListeners = child.getPropertyChangeListeners(); for (int index = childListeners.length - 1; index >= 0; index--) { returnList.add(new PropertyChangeListenerProxy(key, childListeners[index])); } } } return (PropertyChangeListener[]) returnList.toArray(new PropertyChangeListener[returnList.size()]); }
[ "public", "PropertyChangeListener", "[", "]", "getPropertyChangeListeners", "(", ")", "{", "List", "returnList", "=", "new", "ArrayList", "(", ")", ";", "// Add all the PropertyChangeListeners", "if", "(", "listeners", "!=", "null", ")", "{", "returnList", ".", "a...
Returns an array of all the listeners that were added to the SwingPropertyChangeSupport object with addPropertyChangeListener(). <p> If some listeners have been added with a named property, then the returned array will be a mixture of PropertyChangeListeners and <code>PropertyChangeListenerProxy</code>s. If the calling method is interested in distinguishing the listeners then it must test each element to see if it's a <code>PropertyChangeListenerProxy</code> perform the cast and examine the parameter. <pre> PropertyChangeListener[] listeners = support.getPropertyChangeListeners(); for (int i = 0; i &lt; listeners.length; i++) { if (listeners[i] instanceof PropertyChangeListenerProxy) { PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listeners[i]; if (proxy.getPropertyName().equals(&quot;foo&quot;)) { // proxy is a PropertyChangeListener which was associated // with the property named &quot;foo&quot; } } } </pre> @see java.beans.PropertyChangeListenerProxy @see java.beans.PropertyChangeSupport#getPropertyChangeListeners @return all of the <code>PropertyChangeListener</code> s added or an empty array if no listeners have been added @since 1.4
[ "Returns", "an", "array", "of", "all", "the", "listeners", "that", "were", "added", "to", "the", "SwingPropertyChangeSupport", "object", "with", "addPropertyChangeListener", "()", ".", "<p", ">", "If", "some", "listeners", "have", "been", "added", "with", "a", ...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L129-L150
alibaba/otter
shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java
ZkClientx.createEphemeralSequential
public String createEphemeralSequential(final String path, final Object data) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException { return create(path, data, CreateMode.EPHEMERAL_SEQUENTIAL); }
java
public String createEphemeralSequential(final String path, final Object data) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException { return create(path, data, CreateMode.EPHEMERAL_SEQUENTIAL); }
[ "public", "String", "createEphemeralSequential", "(", "final", "String", "path", ",", "final", "Object", "data", ")", "throws", "ZkInterruptedException", ",", "IllegalArgumentException", ",", "ZkException", ",", "RuntimeException", "{", "return", "create", "(", "path"...
Create an ephemeral, sequential node. @param path @param data @return created path @throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted @throws IllegalArgumentException if called from anything except the ZooKeeper event thread @throws ZkException if any ZooKeeper exception occurred @throws RuntimeException if any other exception occurs
[ "Create", "an", "ephemeral", "sequential", "node", "." ]
train
https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L440-L444
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.generateSyntaxErrorMessage
private void generateSyntaxErrorMessage(SourceUnit sourceUnit, AnnotationNode node, String msg) { SyntaxException error = new SyntaxException(msg, node.getLineNumber(), node.getColumnNumber()); sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(error, sourceUnit)); }
java
private void generateSyntaxErrorMessage(SourceUnit sourceUnit, AnnotationNode node, String msg) { SyntaxException error = new SyntaxException(msg, node.getLineNumber(), node.getColumnNumber()); sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(error, sourceUnit)); }
[ "private", "void", "generateSyntaxErrorMessage", "(", "SourceUnit", "sourceUnit", ",", "AnnotationNode", "node", ",", "String", "msg", ")", "{", "SyntaxException", "error", "=", "new", "SyntaxException", "(", "msg", ",", "node", ".", "getLineNumber", "(", ")", "...
Generates a SyntaxErrorMessage based on the current SourceUnit, AnnotationNode, and a specified error message. @param sourceUnit The SourceUnit @param node The node that was annotated @param msg The error message to display
[ "Generates", "a", "SyntaxErrorMessage", "based", "on", "the", "current", "SourceUnit", "AnnotationNode", "and", "a", "specified", "error", "message", "." ]
train
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L645-L648
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java
ChartResources.getChartByID
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/{chartId}") @Description("Finds a chart, given its id.") public ChartDto getChartByID(@Context HttpServletRequest req, @PathParam("chartId") BigInteger chartId, @QueryParam("fields") List<String> fields) { if (chartId == null || chartId.compareTo(BigInteger.ZERO) < 1) { throw new WebApplicationException("chartId cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST); } Chart chart; if(fields == null || fields.isEmpty()) { chart = _chartService.getChartByPrimaryKey(chartId); } else { chart = _chartService.getChartByPrimaryKey(chartId); } if (chart == null) { throw new WebApplicationException("Chart with ID: " + chartId + " does not exist. Please use a valid chartId.", Response.Status.NOT_FOUND); } PrincipalUser remoteUser = getRemoteUser(req); _validateResourceAuthorization(remoteUser, chart.getOwner()); ChartDto chartDto = ChartDto.transformToDto(chart); chartDto.setHref(req.getRequestURL().toString()); return chartDto; }
java
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/{chartId}") @Description("Finds a chart, given its id.") public ChartDto getChartByID(@Context HttpServletRequest req, @PathParam("chartId") BigInteger chartId, @QueryParam("fields") List<String> fields) { if (chartId == null || chartId.compareTo(BigInteger.ZERO) < 1) { throw new WebApplicationException("chartId cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST); } Chart chart; if(fields == null || fields.isEmpty()) { chart = _chartService.getChartByPrimaryKey(chartId); } else { chart = _chartService.getChartByPrimaryKey(chartId); } if (chart == null) { throw new WebApplicationException("Chart with ID: " + chartId + " does not exist. Please use a valid chartId.", Response.Status.NOT_FOUND); } PrincipalUser remoteUser = getRemoteUser(req); _validateResourceAuthorization(remoteUser, chart.getOwner()); ChartDto chartDto = ChartDto.transformToDto(chart); chartDto.setHref(req.getRequestURL().toString()); return chartDto; }
[ "@", "GET", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Path", "(", "\"/{chartId}\"", ")", "@", "Description", "(", "\"Finds a chart, given its id.\"", ")", "public", "ChartDto", "getChartByID", "(", "@", "Context", "HttpServletRequest", ...
Find a chart, given its id. @param req The HttpServlet request object. Cannot be null. @param chartId The chart Id. Cannot be null and must be a positive non-zero number. @param fields The fields (unused parameter) @return The chart object. @throws WebApplicationException An exception with 404 NOT_FOUND will be thrown if the chart does not exist.
[ "Find", "a", "chart", "given", "its", "id", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java#L221-L249
Azure/azure-sdk-for-java
servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java
ClientFactory.createMessageReceiverFromConnectionStringBuilder
public static IMessageReceiver createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, receiveMode)); }
java
public static IMessageReceiver createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, receiveMode)); }
[ "public", "static", "IMessageReceiver", "createMessageReceiverFromConnectionStringBuilder", "(", "ConnectionStringBuilder", "amqpConnectionStringBuilder", ",", "ReceiveMode", "receiveMode", ")", "throws", "InterruptedException", ",", "ServiceBusException", "{", "return", "Utils", ...
Create {@link IMessageReceiver} from ConnectionStringBuilder <pre> IMessageReceiver messageReceiver = ClientFactory.createMessageReceiverFromConnectionStringBuilder(new ConnectionStringBuilder(connectionString, queueName), ReceiveMode.PEEKLOCK); </pre> @param amqpConnectionStringBuilder {@link ConnectionStringBuilder} @param receiveMode {@link ReceiveMode} PeekLock or ReceiveAndDelete @return The {@link IMessageReceiver} instance @throws InterruptedException if the current thread was interrupted while waiting @throws ServiceBusException if the receiver cannot be created
[ "Create", "{", "@link", "IMessageReceiver", "}", "from", "ConnectionStringBuilder", "<pre", ">", "IMessageReceiver", "messageReceiver", "=", "ClientFactory", ".", "createMessageReceiverFromConnectionStringBuilder", "(", "new", "ConnectionStringBuilder", "(", "connectionString",...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L268-L270
weld/core
modules/jsf/src/main/java/org/jboss/weld/module/jsf/ConversationAwareViewHandler.java
ConversationAwareViewHandler.getActionURL
@Override public String getActionURL(FacesContext facesContext, String viewId) { if (contextId == null) { if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY)) { contextId = (String) facesContext.getAttributes().get(Container.CONTEXT_ID_KEY); } else { contextId = RegistrySingletonProvider.STATIC_INSTANCE; } } String actionUrl = super.getActionURL(facesContext, viewId); final ConversationContext ctx = getConversationContext(contextId); if (ctx!= null && ctx.isActive() && !getSource().equals(Source.BOOKMARKABLE) && !ctx.getCurrentConversation().isTransient()) { return new FacesUrlTransformer(actionUrl, facesContext) .appendConversationIdIfNecessary(getConversationContext(contextId).getParameterName(), ctx.getCurrentConversation().getId()) .getUrl(); } else { return actionUrl; } }
java
@Override public String getActionURL(FacesContext facesContext, String viewId) { if (contextId == null) { if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY)) { contextId = (String) facesContext.getAttributes().get(Container.CONTEXT_ID_KEY); } else { contextId = RegistrySingletonProvider.STATIC_INSTANCE; } } String actionUrl = super.getActionURL(facesContext, viewId); final ConversationContext ctx = getConversationContext(contextId); if (ctx!= null && ctx.isActive() && !getSource().equals(Source.BOOKMARKABLE) && !ctx.getCurrentConversation().isTransient()) { return new FacesUrlTransformer(actionUrl, facesContext) .appendConversationIdIfNecessary(getConversationContext(contextId).getParameterName(), ctx.getCurrentConversation().getId()) .getUrl(); } else { return actionUrl; } }
[ "@", "Override", "public", "String", "getActionURL", "(", "FacesContext", "facesContext", ",", "String", "viewId", ")", "{", "if", "(", "contextId", "==", "null", ")", "{", "if", "(", "facesContext", ".", "getAttributes", "(", ")", ".", "containsKey", "(", ...
Allow the delegate to produce the action URL. If the conversation is long-running, append the conversation id request parameter to the query string part of the URL, but only if the request parameter is not already present. <p/> This covers form actions Ajax calls, and redirect URLs (which we want) and link hrefs (which we don't) @see {@link ViewHandler#getActionURL(FacesContext, String)}
[ "Allow", "the", "delegate", "to", "produce", "the", "action", "URL", ".", "If", "the", "conversation", "is", "long", "-", "running", "append", "the", "conversation", "id", "request", "parameter", "to", "the", "query", "string", "part", "of", "the", "URL", ...
train
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/jsf/src/main/java/org/jboss/weld/module/jsf/ConversationAwareViewHandler.java#L103-L121
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ComparisonExpression.java
ComparisonExpression.getLtFilterFromPrefixLike
public ComparisonExpression getLtFilterFromPrefixLike() { ExpressionType rangeComparator = ExpressionType.COMPARE_LESSTHAN; String comparand = extractAndIncrementLikePatternPrefix(); return rangeFilterFromPrefixLike(m_left, rangeComparator, comparand); }
java
public ComparisonExpression getLtFilterFromPrefixLike() { ExpressionType rangeComparator = ExpressionType.COMPARE_LESSTHAN; String comparand = extractAndIncrementLikePatternPrefix(); return rangeFilterFromPrefixLike(m_left, rangeComparator, comparand); }
[ "public", "ComparisonExpression", "getLtFilterFromPrefixLike", "(", ")", "{", "ExpressionType", "rangeComparator", "=", "ExpressionType", ".", "COMPARE_LESSTHAN", ";", "String", "comparand", "=", "extractAndIncrementLikePatternPrefix", "(", ")", ";", "return", "rangeFilterF...
/ Construct the upper bound comparison filter implied by a prefix LIKE comparison.
[ "/", "Construct", "the", "upper", "bound", "comparison", "filter", "implied", "by", "a", "prefix", "LIKE", "comparison", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ComparisonExpression.java#L196-L200
mbrade/prefixedproperties
pp-spring/src/main/java/net/sf/prefixedproperties/spring/PrefixedPropertiesPersister.java
PrefixedPropertiesPersister.loadFromYAML
public void loadFromYAML(final Properties props, final Reader rd) throws IOException { try { ((PrefixedProperties) props).loadFromYAML(rd); } catch (final NoSuchMethodError err) { throw new IOException( "Cannot load properties JSON file - not using PrefixedProperties: " + err.getMessage()); } }
java
public void loadFromYAML(final Properties props, final Reader rd) throws IOException { try { ((PrefixedProperties) props).loadFromYAML(rd); } catch (final NoSuchMethodError err) { throw new IOException( "Cannot load properties JSON file - not using PrefixedProperties: " + err.getMessage()); } }
[ "public", "void", "loadFromYAML", "(", "final", "Properties", "props", ",", "final", "Reader", "rd", ")", "throws", "IOException", "{", "try", "{", "(", "(", "PrefixedProperties", ")", "props", ")", ".", "loadFromYAML", "(", "rd", ")", ";", "}", "catch", ...
Load from json. @param props the props @param rd the rd @throws IOException Signals that an I/O exception has occurred.
[ "Load", "from", "json", "." ]
train
https://github.com/mbrade/prefixedproperties/blob/ac430409ea37e244158002b3cf1504417835a0b2/pp-spring/src/main/java/net/sf/prefixedproperties/spring/PrefixedPropertiesPersister.java#L109-L116
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java
JvmTypesBuilder.newTypeRef
@Deprecated public JvmTypeReference newTypeRef(EObject ctx, String typeName, JvmTypeReference... typeArgs) { return references.getTypeForName(typeName, ctx, typeArgs); }
java
@Deprecated public JvmTypeReference newTypeRef(EObject ctx, String typeName, JvmTypeReference... typeArgs) { return references.getTypeForName(typeName, ctx, typeArgs); }
[ "@", "Deprecated", "public", "JvmTypeReference", "newTypeRef", "(", "EObject", "ctx", ",", "String", "typeName", ",", "JvmTypeReference", "...", "typeArgs", ")", "{", "return", "references", ".", "getTypeForName", "(", "typeName", ",", "ctx", ",", "typeArgs", ")...
Creates a new {@link JvmTypeReference} pointing to the given class and containing the given type arguments. @param ctx an EMF context, which is used to look up the {@link org.eclipse.xtext.common.types.JvmType} for the given clazz. @param typeName the name of the type the reference shall point to. @param typeArgs type arguments @return the newly created {@link JvmTypeReference} @deprecated use {@link JvmTypeReferenceBuilder#typeRef(String, JvmTypeReference...)}
[ "Creates", "a", "new", "{", "@link", "JvmTypeReference", "}", "pointing", "to", "the", "given", "class", "and", "containing", "the", "given", "type", "arguments", "." ]
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L1317-L1320
btaz/data-util
src/main/java/com/btaz/util/tf/Strings.java
Strings.asTokenSeparatedValues
public static String asTokenSeparatedValues(String token, Collection<String> strings) { StringBuilder newString = new StringBuilder(); boolean first = true; for(String str : strings) { if(! first) { newString.append(token); } first = false; newString.append(str); } return newString.toString(); }
java
public static String asTokenSeparatedValues(String token, Collection<String> strings) { StringBuilder newString = new StringBuilder(); boolean first = true; for(String str : strings) { if(! first) { newString.append(token); } first = false; newString.append(str); } return newString.toString(); }
[ "public", "static", "String", "asTokenSeparatedValues", "(", "String", "token", ",", "Collection", "<", "String", ">", "strings", ")", "{", "StringBuilder", "newString", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "first", "=", "true", ";", "for", ...
This method converts a collection of strings to a token separated list of strings @param strings Collection of strings @return {@code String} new token separated string
[ "This", "method", "converts", "a", "collection", "of", "strings", "to", "a", "token", "separated", "list", "of", "strings" ]
train
https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/tf/Strings.java#L79-L90
OpenLiberty/open-liberty
dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java
Director.installFeature
public void installFeature(Collection<String> featureIds, File fromDir, String toExtension, boolean acceptLicense, boolean offlineOnly) throws InstallException { //fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING")); this.installAssets = new ArrayList<List<InstallAsset>>(); ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>(); ArrayList<String> unresolvedFeatures = new ArrayList<String>(); Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, toExtension); getResolveDirector().resolve(featureIds, fromDir, toExtension, offlineOnly, installAssets, unresolvedFeatures); if (!offlineOnly && !unresolvedFeatures.isEmpty()) { log(Level.FINEST, "installFeature() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath()); installFeatures(unresolvedFeatures, toExtension, acceptLicense, null, null, 5); } if (!installAssets.isEmpty()) { getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets); this.installAssets.add(installAssets); } if (this.installAssets.isEmpty()) { throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ALREADY_INSTALLED", featureIds.toString()); } }
java
public void installFeature(Collection<String> featureIds, File fromDir, String toExtension, boolean acceptLicense, boolean offlineOnly) throws InstallException { //fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING")); this.installAssets = new ArrayList<List<InstallAsset>>(); ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>(); ArrayList<String> unresolvedFeatures = new ArrayList<String>(); Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, toExtension); getResolveDirector().resolve(featureIds, fromDir, toExtension, offlineOnly, installAssets, unresolvedFeatures); if (!offlineOnly && !unresolvedFeatures.isEmpty()) { log(Level.FINEST, "installFeature() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath()); installFeatures(unresolvedFeatures, toExtension, acceptLicense, null, null, 5); } if (!installAssets.isEmpty()) { getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets); this.installAssets.add(installAssets); } if (this.installAssets.isEmpty()) { throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ALREADY_INSTALLED", featureIds.toString()); } }
[ "public", "void", "installFeature", "(", "Collection", "<", "String", ">", "featureIds", ",", "File", "fromDir", ",", "String", "toExtension", ",", "boolean", "acceptLicense", ",", "boolean", "offlineOnly", ")", "throws", "InstallException", "{", "//fireProgressEven...
Installs the features found in the inputed featureIds collection @param featureIds the feature ids @param fromDir where the features are located @param toExtension location of a product extension @param acceptLicense if license is accepted @param offlineOnly if features should be installed from local source only @throws InstallException
[ "Installs", "the", "features", "found", "in", "the", "inputed", "featureIds", "collection" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L421-L439
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java
FastMultidimensionalScalingTransform.updateEigenvector
protected double updateEigenvector(double[] in, double[] out, double l) { double s = 1. / (l > 0. ? l : l < 0. ? -l : 1.); s = (in[0] > 0.) ? s : -s; // Reduce flipping vectors double diff = 0.; for(int d = 0; d < in.length; d++) { in[d] *= s; // Scale to unit length // Compute change from previous iteration: double delta = in[d] - out[d]; diff += delta * delta; out[d] = in[d]; // Update output storage } return diff; }
java
protected double updateEigenvector(double[] in, double[] out, double l) { double s = 1. / (l > 0. ? l : l < 0. ? -l : 1.); s = (in[0] > 0.) ? s : -s; // Reduce flipping vectors double diff = 0.; for(int d = 0; d < in.length; d++) { in[d] *= s; // Scale to unit length // Compute change from previous iteration: double delta = in[d] - out[d]; diff += delta * delta; out[d] = in[d]; // Update output storage } return diff; }
[ "protected", "double", "updateEigenvector", "(", "double", "[", "]", "in", ",", "double", "[", "]", "out", ",", "double", "l", ")", "{", "double", "s", "=", "1.", "/", "(", "l", ">", "0.", "?", "l", ":", "l", "<", "0.", "?", "-", "l", ":", "1...
Compute the change in the eigenvector, and normalize the output vector while doing so. @param in Input vector @param out Output vector @param l Eigenvalue @return Change
[ "Compute", "the", "change", "in", "the", "eigenvector", "and", "normalize", "the", "output", "vector", "while", "doing", "so", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L260-L272
s1-platform/s1
s1-core/src/java/org/s1/weboperation/UploadWebOperation.java
UploadWebOperation.downloadAsFile
@WebOperationMethod public Map<String,Object> downloadAsFile(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) throws Exception { String database = Objects.get(params, "database"); String collection = Objects.get(params, "collection", COLLECTION); String id = Objects.get(params, "id"); String name = Objects.get(params, "name"); FileStorage.FileReadBean b = null; try{ b = FileStorage.read(new Id(database,collection,id)); response.setContentType(b.getMeta().getContentType()); if (Objects.isNullOrEmpty(name)) { name = b.getMeta().getName(); if (name.length() > 100) name = name.substring(0, 100); if (!Objects.isNullOrEmpty(b.getMeta().getExt())) name += "." + b.getMeta().getExt(); } response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(name, "UTF-8")); try { IOUtils.copy(b.getInputStream(), response.getOutputStream()); } catch (IOException e) { throw S1SystemError.wrap(e); } }catch (NotFoundException e) { response.setStatus(404); }finally { FileStorage.closeAfterRead(b); } return null; }
java
@WebOperationMethod public Map<String,Object> downloadAsFile(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) throws Exception { String database = Objects.get(params, "database"); String collection = Objects.get(params, "collection", COLLECTION); String id = Objects.get(params, "id"); String name = Objects.get(params, "name"); FileStorage.FileReadBean b = null; try{ b = FileStorage.read(new Id(database,collection,id)); response.setContentType(b.getMeta().getContentType()); if (Objects.isNullOrEmpty(name)) { name = b.getMeta().getName(); if (name.length() > 100) name = name.substring(0, 100); if (!Objects.isNullOrEmpty(b.getMeta().getExt())) name += "." + b.getMeta().getExt(); } response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(name, "UTF-8")); try { IOUtils.copy(b.getInputStream(), response.getOutputStream()); } catch (IOException e) { throw S1SystemError.wrap(e); } }catch (NotFoundException e) { response.setStatus(404); }finally { FileStorage.closeAfterRead(b); } return null; }
[ "@", "WebOperationMethod", "public", "Map", "<", "String", ",", "Object", ">", "downloadAsFile", "(", "Map", "<", "String", ",", "Object", ">", "params", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "Exception", "{...
Download file from storage with content-disposition @param params {group:"...default is GROUP...", id:"...", name:"...default will be taken from FileMetaBean.name ..."} @param response
[ "Download", "file", "from", "storage", "with", "content", "-", "disposition" ]
train
https://github.com/s1-platform/s1/blob/370101c13fef01af524bc171bcc1a97e5acc76e8/s1-core/src/java/org/s1/weboperation/UploadWebOperation.java#L176-L206
aws/aws-sdk-java
aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/message/SignatureVerifier.java
SignatureVerifier.verifyHostname
private void verifyHostname(X509Certificate cer) { try { hostnameVerifier.verify(expectedCertCommonName, cer); } catch (SSLException e) { throw new SdkClientException("Certificate does not match expected common name: " + expectedCertCommonName, e); } }
java
private void verifyHostname(X509Certificate cer) { try { hostnameVerifier.verify(expectedCertCommonName, cer); } catch (SSLException e) { throw new SdkClientException("Certificate does not match expected common name: " + expectedCertCommonName, e); } }
[ "private", "void", "verifyHostname", "(", "X509Certificate", "cer", ")", "{", "try", "{", "hostnameVerifier", ".", "verify", "(", "expectedCertCommonName", ",", "cer", ")", ";", "}", "catch", "(", "SSLException", "e", ")", "{", "throw", "new", "SdkClientExcept...
Verifies the hostname in the certificate matches {@link #expectedCertCommonName}. @param cer Certificate to validate.
[ "Verifies", "the", "hostname", "in", "the", "certificate", "matches", "{", "@link", "#expectedCertCommonName", "}", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/message/SignatureVerifier.java#L227-L233
mijecu25/dsa
src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java
BinarySearch.searchDescending
public static int searchDescending(double[] doubleArray, double value) { int start = 0; int end = doubleArray.length - 1; int middle = 0; while(start <= end) { middle = (start + end) >> 1; if(value == doubleArray[middle]) { return middle; } if(value > doubleArray[middle]) { end = middle - 1 ; } else { start = middle + 1; } } return -1; }
java
public static int searchDescending(double[] doubleArray, double value) { int start = 0; int end = doubleArray.length - 1; int middle = 0; while(start <= end) { middle = (start + end) >> 1; if(value == doubleArray[middle]) { return middle; } if(value > doubleArray[middle]) { end = middle - 1 ; } else { start = middle + 1; } } return -1; }
[ "public", "static", "int", "searchDescending", "(", "double", "[", "]", "doubleArray", ",", "double", "value", ")", "{", "int", "start", "=", "0", ";", "int", "end", "=", "doubleArray", ".", "length", "-", "1", ";", "int", "middle", "=", "0", ";", "w...
Search for the value in the reverse sorted double array and return the index. @param doubleArray array that we are searching in. @param value value that is being searched in the array. @return the index where the value is found in the array, else -1.
[ "Search", "for", "the", "value", "in", "the", "reverse", "sorted", "double", "array", "and", "return", "the", "index", "." ]
train
https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L601-L623
mozilla/rhino
src/org/mozilla/javascript/ScriptableObject.java
ScriptableObject.getTopScopeValue
public static Object getTopScopeValue(Scriptable scope, Object key) { scope = ScriptableObject.getTopLevelScope(scope); for (;;) { if (scope instanceof ScriptableObject) { ScriptableObject so = (ScriptableObject)scope; Object value = so.getAssociatedValue(key); if (value != null) { return value; } } scope = scope.getPrototype(); if (scope == null) { return null; } } }
java
public static Object getTopScopeValue(Scriptable scope, Object key) { scope = ScriptableObject.getTopLevelScope(scope); for (;;) { if (scope instanceof ScriptableObject) { ScriptableObject so = (ScriptableObject)scope; Object value = so.getAssociatedValue(key); if (value != null) { return value; } } scope = scope.getPrototype(); if (scope == null) { return null; } } }
[ "public", "static", "Object", "getTopScopeValue", "(", "Scriptable", "scope", ",", "Object", "key", ")", "{", "scope", "=", "ScriptableObject", ".", "getTopLevelScope", "(", "scope", ")", ";", "for", "(", ";", ";", ")", "{", "if", "(", "scope", "instanceof...
Get arbitrary application-specific value associated with the top scope of the given scope. The method first calls {@link #getTopLevelScope(Scriptable scope)} and then searches the prototype chain of the top scope for the first object containing the associated value with the given key. @param scope the starting scope. @param key key object to select particular value. @see #getAssociatedValue(Object key)
[ "Get", "arbitrary", "application", "-", "specific", "value", "associated", "with", "the", "top", "scope", "of", "the", "given", "scope", ".", "The", "method", "first", "calls", "{", "@link", "#getTopLevelScope", "(", "Scriptable", "scope", ")", "}", "and", "...
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2752-L2768
sjamesr/jfreesane
src/main/java/au/com/southsky/jfreesane/SaneSession.java
SaneSession.withRemoteSane
public static SaneSession withRemoteSane( InetAddress saneAddress, int port, long timeout, TimeUnit timeUnit, long soTimeout, TimeUnit soTimeUnit) throws IOException { long millis = timeUnit.toMillis(timeout); Preconditions.checkArgument( millis >= 0 && millis <= Integer.MAX_VALUE, "Timeout must be between 0 and Integer.MAX_VALUE milliseconds"); // If the user specifies a non-zero timeout that rounds to 0 milliseconds, // set the timeout to 1 millisecond instead. if (timeout > 0 && millis == 0) { Logger.getLogger(SaneSession.class.getName()) .log( Level.WARNING, "Specified timeout of {0} {1} rounds to 0ms and was clamped to 1ms", new Object[] {timeout, timeUnit}); } Socket socket = new Socket(); socket.setTcpNoDelay(true); if (soTimeUnit != null && soTimeout > 0) { long soTimeoutMillis = soTimeUnit.toMillis(soTimeout); Preconditions.checkArgument( soTimeoutMillis >= 0 && soTimeoutMillis <= Integer.MAX_VALUE, "Socket timeout must be between 0 and Integer.MAX_VALUE milliseconds"); socket.setSoTimeout((int) soTimeoutMillis); } socket.connect(new InetSocketAddress(saneAddress, port), (int) millis); SaneSession session = new SaneSession(socket); session.initSane(); return session; }
java
public static SaneSession withRemoteSane( InetAddress saneAddress, int port, long timeout, TimeUnit timeUnit, long soTimeout, TimeUnit soTimeUnit) throws IOException { long millis = timeUnit.toMillis(timeout); Preconditions.checkArgument( millis >= 0 && millis <= Integer.MAX_VALUE, "Timeout must be between 0 and Integer.MAX_VALUE milliseconds"); // If the user specifies a non-zero timeout that rounds to 0 milliseconds, // set the timeout to 1 millisecond instead. if (timeout > 0 && millis == 0) { Logger.getLogger(SaneSession.class.getName()) .log( Level.WARNING, "Specified timeout of {0} {1} rounds to 0ms and was clamped to 1ms", new Object[] {timeout, timeUnit}); } Socket socket = new Socket(); socket.setTcpNoDelay(true); if (soTimeUnit != null && soTimeout > 0) { long soTimeoutMillis = soTimeUnit.toMillis(soTimeout); Preconditions.checkArgument( soTimeoutMillis >= 0 && soTimeoutMillis <= Integer.MAX_VALUE, "Socket timeout must be between 0 and Integer.MAX_VALUE milliseconds"); socket.setSoTimeout((int) soTimeoutMillis); } socket.connect(new InetSocketAddress(saneAddress, port), (int) millis); SaneSession session = new SaneSession(socket); session.initSane(); return session; }
[ "public", "static", "SaneSession", "withRemoteSane", "(", "InetAddress", "saneAddress", ",", "int", "port", ",", "long", "timeout", ",", "TimeUnit", "timeUnit", ",", "long", "soTimeout", ",", "TimeUnit", "soTimeUnit", ")", "throws", "IOException", "{", "long", "...
Establishes a connection to the SANE daemon running on the given host on the given port. If the connection cannot be established within the given timeout, {@link java.net.SocketTimeoutException} is thrown. @param saneAddress @param port @param timeout Connection timeout @param timeUnit Connection timeout unit @param soTimeout Socket timeout (for read on socket) @param soTimeUnit Socket timeout unit @return @throws IOException
[ "Establishes", "a", "connection", "to", "the", "SANE", "daemon", "running", "on", "the", "given", "host", "on", "the", "given", "port", ".", "If", "the", "connection", "cannot", "be", "established", "within", "the", "given", "timeout", "{", "@link", "java", ...
train
https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L104-L139
apiman/apiman
manager/api/beans/src/main/java/io/apiman/manager/api/beans/search/SearchCriteriaBean.java
SearchCriteriaBean.addFilter
public void addFilter(String name, String value, SearchCriteriaFilterOperator operator) { SearchCriteriaFilterBean filter = new SearchCriteriaFilterBean(); filter.setName(name); filter.setValue(value); filter.setOperator(operator); filters.add(filter); }
java
public void addFilter(String name, String value, SearchCriteriaFilterOperator operator) { SearchCriteriaFilterBean filter = new SearchCriteriaFilterBean(); filter.setName(name); filter.setValue(value); filter.setOperator(operator); filters.add(filter); }
[ "public", "void", "addFilter", "(", "String", "name", ",", "String", "value", ",", "SearchCriteriaFilterOperator", "operator", ")", "{", "SearchCriteriaFilterBean", "filter", "=", "new", "SearchCriteriaFilterBean", "(", ")", ";", "filter", ".", "setName", "(", "na...
Adds a single filter to the criteria. @param name the filter name @param value the filter value @param operator the operator type
[ "Adds", "a", "single", "filter", "to", "the", "criteria", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/beans/src/main/java/io/apiman/manager/api/beans/search/SearchCriteriaBean.java#L47-L53
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/authorization/AclsUtil.java
AclsUtil.append
public static Authorization append(Authorization a, Authorization b) { if (a instanceof AclRuleSetSource && b instanceof AclRuleSetSource) { return RuleEvaluator.createRuleEvaluator( merge((AclRuleSetSource) a, (AclRuleSetSource) b) ); } return new MultiAuthorization(a, b); }
java
public static Authorization append(Authorization a, Authorization b) { if (a instanceof AclRuleSetSource && b instanceof AclRuleSetSource) { return RuleEvaluator.createRuleEvaluator( merge((AclRuleSetSource) a, (AclRuleSetSource) b) ); } return new MultiAuthorization(a, b); }
[ "public", "static", "Authorization", "append", "(", "Authorization", "a", ",", "Authorization", "b", ")", "{", "if", "(", "a", "instanceof", "AclRuleSetSource", "&&", "b", "instanceof", "AclRuleSetSource", ")", "{", "return", "RuleEvaluator", ".", "createRuleEvalu...
Merge to authorization resources @param a authorization @param b authorization @return a new Authorization that merges both authorization a and b
[ "Merge", "to", "authorization", "resources" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/authorization/AclsUtil.java#L54-L61
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/util/EventListeners.java
EventListeners.fireEvent
public final void fireEvent(EventObject evt, EventListenerV visitor){ EventListener[] list = getListenerArray(); for(int i=0; i<list.length; i++){ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) logger.logp(Level.FINE, CLASS_NAME,"fireEvent", "Use visitor " + visitor + " to fire event to " + list[i] + ", class:" +list[i].getClass()); visitor.fireEvent(evt, list[i]); } }
java
public final void fireEvent(EventObject evt, EventListenerV visitor){ EventListener[] list = getListenerArray(); for(int i=0; i<list.length; i++){ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) logger.logp(Level.FINE, CLASS_NAME,"fireEvent", "Use visitor " + visitor + " to fire event to " + list[i] + ", class:" +list[i].getClass()); visitor.fireEvent(evt, list[i]); } }
[ "public", "final", "void", "fireEvent", "(", "EventObject", "evt", ",", "EventListenerV", "visitor", ")", "{", "EventListener", "[", "]", "list", "=", "getListenerArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "list", ".", "len...
Fire the event to all listeners by allowing the visitor to visit each listener. The visitor is responsible for implementing the actual firing of the event to each listener.
[ "Fire", "the", "event", "to", "all", "listeners", "by", "allowing", "the", "visitor", "to", "visit", "each", "listener", ".", "The", "visitor", "is", "responsible", "for", "implementing", "the", "actual", "firing", "of", "the", "event", "to", "each", "listen...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/util/EventListeners.java#L52-L59