repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
wkgcass/Style | src/main/java/net/cassite/style/reflect/Reflect.java | Reflect.readOnly | public static <R> R readOnly(R toReadOnly) {
return proxy((p, m, args) -> If((Method) $($.readOnlyToSearch).forEach(s -> {
if (m.getName().contains(s))
return BreakWithResult(m);
else
return n... | java | public static <R> R readOnly(R toReadOnly) {
return proxy((p, m, args) -> If((Method) $($.readOnlyToSearch).forEach(s -> {
if (m.getName().contains(s))
return BreakWithResult(m);
else
return n... | [
"public",
"static",
"<",
"R",
">",
"R",
"readOnly",
"(",
"R",
"toReadOnly",
")",
"{",
"return",
"proxy",
"(",
"(",
"p",
",",
"m",
",",
"args",
")",
"->",
"If",
"(",
"(",
"Method",
")",
"$",
"(",
"$",
".",
"readOnlyToSearch",
")",
".",
"forEach",
... | Make an object which has interfaces to a read-only one.<br>
When an invocation comes, the InvocatinHandler will check the method.
<p>
<pre>
if methodName.contains elements in $.readOnlyToSearch
Check whether the method has ReadOnly annotation
if has
do invoking
else
throw an exception(ModifyReadOnlyException)
else
Chec... | [
"Make",
"an",
"object",
"which",
"has",
"interfaces",
"to",
"a",
"read",
"-",
"only",
"one",
".",
"<br",
">",
"When",
"an",
"invocation",
"comes",
"the",
"InvocatinHandler",
"will",
"check",
"the",
"method",
".",
"<p",
">",
"<pre",
">",
"if",
"methodName... | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/reflect/Reflect.java#L138-L155 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.putLong | public final void putLong(Object parent, long offset, long value) {
THE_UNSAFE.putLong(parent, offset, value);
} | java | public final void putLong(Object parent, long offset, long value) {
THE_UNSAFE.putLong(parent, offset, value);
} | [
"public",
"final",
"void",
"putLong",
"(",
"Object",
"parent",
",",
"long",
"offset",
",",
"long",
"value",
")",
"{",
"THE_UNSAFE",
".",
"putLong",
"(",
"parent",
",",
"offset",
",",
"value",
")",
";",
"}"
] | Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value long to be put | [
"Puts",
"the",
"value",
"at",
"the",
"given",
"offset",
"of",
"the",
"supplied",
"parent",
"object"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L993-L995 |
mguymon/naether | src/main/java/com/tobedevoured/naether/util/Notation.java | Notation.getLocalPaths | public static List<String> getLocalPaths( String localRepoPath, List<String> notations ) throws NaetherException {
DefaultServiceLocator locator = new DefaultServiceLocator();
SimpleLocalRepositoryManagerFactory factory = new SimpleLocalRepositoryManagerFactory();
factory.initService( locator );... | java | public static List<String> getLocalPaths( String localRepoPath, List<String> notations ) throws NaetherException {
DefaultServiceLocator locator = new DefaultServiceLocator();
SimpleLocalRepositoryManagerFactory factory = new SimpleLocalRepositoryManagerFactory();
factory.initService( locator );... | [
"public",
"static",
"List",
"<",
"String",
">",
"getLocalPaths",
"(",
"String",
"localRepoPath",
",",
"List",
"<",
"String",
">",
"notations",
")",
"throws",
"NaetherException",
"{",
"DefaultServiceLocator",
"locator",
"=",
"new",
"DefaultServiceLocator",
"(",
")"... | Get local paths for notations
@param localRepoPath String path
@param notations List of notations
@return List of paths
@throws NaetherException exception | [
"Get",
"local",
"paths",
"for",
"notations"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/util/Notation.java#L211-L233 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/PriorityQueue.java | PriorityQueue.siftDown | private void siftDown(int k, E x) {
if (comparator != null)
siftDownUsingComparator(k, x);
else
siftDownComparable(k, x);
} | java | private void siftDown(int k, E x) {
if (comparator != null)
siftDownUsingComparator(k, x);
else
siftDownComparable(k, x);
} | [
"private",
"void",
"siftDown",
"(",
"int",
"k",
",",
"E",
"x",
")",
"{",
"if",
"(",
"comparator",
"!=",
"null",
")",
"siftDownUsingComparator",
"(",
"k",
",",
"x",
")",
";",
"else",
"siftDownComparable",
"(",
"k",
",",
"x",
")",
";",
"}"
] | Inserts item x at position k, maintaining heap invariant by
demoting x down the tree repeatedly until it is less than or
equal to its children or is a leaf.
@param k the position to fill
@param x the item to insert | [
"Inserts",
"item",
"x",
"at",
"position",
"k",
"maintaining",
"heap",
"invariant",
"by",
"demoting",
"x",
"down",
"the",
"tree",
"repeatedly",
"until",
"it",
"is",
"less",
"than",
"or",
"equal",
"to",
"its",
"children",
"or",
"is",
"a",
"leaf",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/PriorityQueue.java#L685-L690 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/FunctionsInner.java | FunctionsInner.retrieveDefaultDefinition | public FunctionInner retrieveDefaultDefinition(String resourceGroupName, String jobName, String functionName) {
return retrieveDefaultDefinitionWithServiceResponseAsync(resourceGroupName, jobName, functionName).toBlocking().single().body();
} | java | public FunctionInner retrieveDefaultDefinition(String resourceGroupName, String jobName, String functionName) {
return retrieveDefaultDefinitionWithServiceResponseAsync(resourceGroupName, jobName, functionName).toBlocking().single().body();
} | [
"public",
"FunctionInner",
"retrieveDefaultDefinition",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"functionName",
")",
"{",
"return",
"retrieveDefaultDefinitionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
",",
"func... | Retrieves the default definition of a function based on the parameters specified.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param functionName The name o... | [
"Retrieves",
"the",
"default",
"definition",
"of",
"a",
"function",
"based",
"on",
"the",
"parameters",
"specified",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/FunctionsInner.java#L1300-L1302 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.fetchByG_C | @Override
public CommerceCurrency fetchByG_C(long groupId, String code) {
return fetchByG_C(groupId, code, true);
} | java | @Override
public CommerceCurrency fetchByG_C(long groupId, String code) {
return fetchByG_C(groupId, code, true);
} | [
"@",
"Override",
"public",
"CommerceCurrency",
"fetchByG_C",
"(",
"long",
"groupId",
",",
"String",
"code",
")",
"{",
"return",
"fetchByG_C",
"(",
"groupId",
",",
"code",
",",
"true",
")",
";",
"}"
] | Returns the commerce currency where groupId = ? and code = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param code the code
@return the matching commerce currency, or <code>null</code> if a matching commerce currency could not be found | [
"Returns",
"the",
"commerce",
"currency",
"where",
"groupId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L2046-L2049 |
jhy/jsoup | src/main/java/org/jsoup/parser/Parser.java | Parser.parseBodyFragment | public static Document parseBodyFragment(String bodyHtml, String baseUri) {
Document doc = Document.createShell(baseUri);
Element body = doc.body();
List<Node> nodeList = parseFragment(bodyHtml, body, baseUri);
Node[] nodes = nodeList.toArray(new Node[0]); // the node list gets modified ... | java | public static Document parseBodyFragment(String bodyHtml, String baseUri) {
Document doc = Document.createShell(baseUri);
Element body = doc.body();
List<Node> nodeList = parseFragment(bodyHtml, body, baseUri);
Node[] nodes = nodeList.toArray(new Node[0]); // the node list gets modified ... | [
"public",
"static",
"Document",
"parseBodyFragment",
"(",
"String",
"bodyHtml",
",",
"String",
"baseUri",
")",
"{",
"Document",
"doc",
"=",
"Document",
".",
"createShell",
"(",
"baseUri",
")",
";",
"Element",
"body",
"=",
"doc",
".",
"body",
"(",
")",
";",... | Parse a fragment of HTML into the {@code body} of a Document.
@param bodyHtml fragment of HTML
@param baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
@return Document, with empty head, and HTML parsed into body | [
"Parse",
"a",
"fragment",
"of",
"HTML",
"into",
"the",
"{",
"@code",
"body",
"}",
"of",
"a",
"Document",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/parser/Parser.java#L163-L175 |
apache/incubator-druid | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java | WhiteListBasedConverter.getPrefixKey | private String getPrefixKey(String key, SortedMap<String, ?> whiteList)
{
String prefixKey = null;
if (whiteList.containsKey(key)) {
return key;
}
SortedMap<String, ?> headMap = whiteList.headMap(key);
if (!headMap.isEmpty() && key.startsWith(headMap.lastKey())) {
prefixKey = headMap.l... | java | private String getPrefixKey(String key, SortedMap<String, ?> whiteList)
{
String prefixKey = null;
if (whiteList.containsKey(key)) {
return key;
}
SortedMap<String, ?> headMap = whiteList.headMap(key);
if (!headMap.isEmpty() && key.startsWith(headMap.lastKey())) {
prefixKey = headMap.l... | [
"private",
"String",
"getPrefixKey",
"(",
"String",
"key",
",",
"SortedMap",
"<",
"String",
",",
"?",
">",
"whiteList",
")",
"{",
"String",
"prefixKey",
"=",
"null",
";",
"if",
"(",
"whiteList",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
... | @param key the metric name to lookup
@param whiteList
@return <tt>null</tt> if the key does not match with any of the prefixes keys in @code metricsWhiteList,
or the prefix in @code whiteListDimsMapper | [
"@param",
"key",
"the",
"metric",
"name",
"to",
"lookup",
"@param",
"whiteList"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java#L141-L152 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomDataWriter.java | AtomDataWriter.marshallPrimitive | private void marshallPrimitive(Object value, PrimitiveType primitiveType) throws XMLStreamException {
LOG.trace("Primitive value: {} of type: {}", value, primitiveType);
if (value != null) {
xmlWriter.writeCharacters(value.toString());
}
} | java | private void marshallPrimitive(Object value, PrimitiveType primitiveType) throws XMLStreamException {
LOG.trace("Primitive value: {} of type: {}", value, primitiveType);
if (value != null) {
xmlWriter.writeCharacters(value.toString());
}
} | [
"private",
"void",
"marshallPrimitive",
"(",
"Object",
"value",
",",
"PrimitiveType",
"primitiveType",
")",
"throws",
"XMLStreamException",
"{",
"LOG",
".",
"trace",
"(",
"\"Primitive value: {} of type: {}\"",
",",
"value",
",",
"primitiveType",
")",
";",
"if",
"(",... | Marshall a primitive value.
@param value The value to marshall. Can be {@code null}.
@param primitiveType The OData primitive type. | [
"Marshall",
"a",
"primitive",
"value",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomDataWriter.java#L143-L149 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.registerClonedEntity | public void registerClonedEntity(String sourceEntityId, String targetEntityId) {
CmsEntityBackend.getInstance().getEntity(sourceEntityId).createDeepCopy(targetEntityId);
} | java | public void registerClonedEntity(String sourceEntityId, String targetEntityId) {
CmsEntityBackend.getInstance().getEntity(sourceEntityId).createDeepCopy(targetEntityId);
} | [
"public",
"void",
"registerClonedEntity",
"(",
"String",
"sourceEntityId",
",",
"String",
"targetEntityId",
")",
"{",
"CmsEntityBackend",
".",
"getInstance",
"(",
")",
".",
"getEntity",
"(",
"sourceEntityId",
")",
".",
"createDeepCopy",
"(",
"targetEntityId",
")",
... | Registers a deep copy of the source entity with the given target entity id.<p>
@param sourceEntityId the source entity id
@param targetEntityId the target entity id | [
"Registers",
"a",
"deep",
"copy",
"of",
"the",
"source",
"entity",
"with",
"the",
"given",
"target",
"entity",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L985-L988 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java | OmemoService.createOmemoMessage | OmemoMessage.Sent createOmemoMessage(OmemoManager.LoggedInOmemoManager managerGuard,
Set<OmemoDevice> contactsDevices,
String message)
throws InterruptedException, UndecidedOmemoIdentityException, CryptoFailedException,
... | java | OmemoMessage.Sent createOmemoMessage(OmemoManager.LoggedInOmemoManager managerGuard,
Set<OmemoDevice> contactsDevices,
String message)
throws InterruptedException, UndecidedOmemoIdentityException, CryptoFailedException,
... | [
"OmemoMessage",
".",
"Sent",
"createOmemoMessage",
"(",
"OmemoManager",
".",
"LoggedInOmemoManager",
"managerGuard",
",",
"Set",
"<",
"OmemoDevice",
">",
"contactsDevices",
",",
"String",
"message",
")",
"throws",
"InterruptedException",
",",
"UndecidedOmemoIdentityExcept... | Create an OmemoMessage.
@param managerGuard initialized OmemoManager
@param contactsDevices set of recipient devices
@param message message we want to send
@return encrypted OmemoMessage
@throws InterruptedException
@throws UndecidedOmemoIdentityException if the list of recipient devices contains an undecided device.... | [
"Create",
"an",
"OmemoMessage",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java#L521-L537 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/PropertyMetadata.java | PropertyMetadata.initializeMapper | private Mapper initializeMapper() {
try {
return MapperFactory.getInstance().getMapper(field);
} catch (NoSuitableMapperException exp) {
String message = String.format(
"No suitable mapper found or error occurred creating a mapper for field %s in class %s",
field.getName(), field... | java | private Mapper initializeMapper() {
try {
return MapperFactory.getInstance().getMapper(field);
} catch (NoSuitableMapperException exp) {
String message = String.format(
"No suitable mapper found or error occurred creating a mapper for field %s in class %s",
field.getName(), field... | [
"private",
"Mapper",
"initializeMapper",
"(",
")",
"{",
"try",
"{",
"return",
"MapperFactory",
".",
"getInstance",
"(",
")",
".",
"getMapper",
"(",
"field",
")",
";",
"}",
"catch",
"(",
"NoSuitableMapperException",
"exp",
")",
"{",
"String",
"message",
"=",
... | Initializes the {@link Mapper} for this field.
@return the {@link Mapper} for the field represented by this metadata | [
"Initializes",
"the",
"{",
"@link",
"Mapper",
"}",
"for",
"this",
"field",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/PropertyMetadata.java#L245-L254 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.create | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final Searchable index, @NonNull String variant) {
Searcher instance = instances.get(variant);
if (instance == null || instance.getSearchable() != index) {
instance = new Searcher(in... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final Searchable index, @NonNull String variant) {
Searcher instance = instances.get(variant);
if (instance == null || instance.getSearchable() != index) {
instance = new Searcher(in... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"static",
"Searcher",
"create",
"(",
"@",
"NonNull",
"final",
"Searchable",
"index",
",",
"@",
"NonNull",
"String",
"variant",
")",
"{",
"Search... | Constructs the Searcher from an existing {@link Index}, eventually replacing the existing searcher for {@code variant}.
@param variant an identifier to differentiate this Searcher from eventual others using the same index. Defaults to the index's name.
@param index an Index initialized and eventually configured.
@re... | [
"Constructs",
"the",
"Searcher",
"from",
"an",
"existing",
"{",
"@link",
"Index",
"}",
"eventually",
"replacing",
"the",
"existing",
"searcher",
"for",
"{",
"@code",
"variant",
"}",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L227-L235 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.fromFuture | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> fromFuture(Future<? extends T> future) {
ObjectHelper.requireNonNull(future, "future is null");
return RxJavaPlugins.onAssembly(new FlowableFromFuture<T>(futur... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> fromFuture(Future<? extends T> future) {
ObjectHelper.requireNonNull(future, "future is null");
return RxJavaPlugins.onAssembly(new FlowableFromFuture<T>(futur... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Flowable",
"<",
"T",
">",
"fromFuture",
"(",
"Future",
"<",
... | Converts a {@link Future} into a Publisher.
<p>
<img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.Future.png" alt="">
<p>
You can convert any object that supports the {@link Future} interface into a Publisher that emits the
return value of the {@link Future#get} me... | [
"Converts",
"a",
"{",
"@link",
"Future",
"}",
"into",
"a",
"Publisher",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"315",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
"/",
"ReactiveX",
"/",
"RxJava... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L2012-L2018 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java | SqlGeneratorDefaultImpl.getPreparedInsertStatement | public SqlStatement getPreparedInsertStatement(ClassDescriptor cld)
{
SqlStatement sql;
SqlForClass sfc = getSqlForClass(cld);
sql = sfc.getInsertSql();
if(sql == null)
{
ProcedureDescriptor pd = cld.getInsertProcedure();
if(pd == null)
... | java | public SqlStatement getPreparedInsertStatement(ClassDescriptor cld)
{
SqlStatement sql;
SqlForClass sfc = getSqlForClass(cld);
sql = sfc.getInsertSql();
if(sql == null)
{
ProcedureDescriptor pd = cld.getInsertProcedure();
if(pd == null)
... | [
"public",
"SqlStatement",
"getPreparedInsertStatement",
"(",
"ClassDescriptor",
"cld",
")",
"{",
"SqlStatement",
"sql",
";",
"SqlForClass",
"sfc",
"=",
"getSqlForClass",
"(",
"cld",
")",
";",
"sql",
"=",
"sfc",
".",
"getInsertSql",
"(",
")",
";",
"if",
"(",
... | generate a prepared INSERT-Statement for the Class
described by cld.
@param cld the ClassDescriptor | [
"generate",
"a",
"prepared",
"INSERT",
"-",
"Statement",
"for",
"the",
"Class",
"described",
"by",
"cld",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java#L108-L134 |
zxing/zxing | android/src/com/google/zxing/client/android/result/ResultHandler.java | ResultHandler.searchMap | final void searchMap(String address) {
launchIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(address))));
} | java | final void searchMap(String address) {
launchIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(address))));
} | [
"final",
"void",
"searchMap",
"(",
"String",
"address",
")",
"{",
"launchIntent",
"(",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
",",
"Uri",
".",
"parse",
"(",
"\"geo:0,0?q=\"",
"+",
"Uri",
".",
"encode",
"(",
"address",
")",
")",
")",
")",
"... | Do a geo search using the address as the query.
@param address The address to find | [
"Do",
"a",
"geo",
"search",
"using",
"the",
"address",
"as",
"the",
"query",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/android/src/com/google/zxing/client/android/result/ResultHandler.java#L405-L407 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsMapMessageImpl.java | JsJmsMapMessageImpl.setShort | public void setShort(String name, short value) throws UnsupportedEncodingException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setShort", Short.valueOf(value));
getBodyMap().put(name, Short.valueOf(value));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryE... | java | public void setShort(String name, short value) throws UnsupportedEncodingException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setShort", Short.valueOf(value));
getBodyMap().put(name, Short.valueOf(value));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryE... | [
"public",
"void",
"setShort",
"(",
"String",
"name",
",",
"short",
"value",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
... | /*
Set a short value with the given name, into the Map.
Javadoc description supplied by JsJmsMessage interface. | [
"/",
"*",
"Set",
"a",
"short",
"value",
"with",
"the",
"given",
"name",
"into",
"the",
"Map",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsMapMessageImpl.java#L294-L298 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.backupCertificateAsync | public ServiceFuture<BackupCertificateResult> backupCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<BackupCertificateResult> serviceCallback) {
return ServiceFuture.fromResponse(backupCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback);
} | java | public ServiceFuture<BackupCertificateResult> backupCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<BackupCertificateResult> serviceCallback) {
return ServiceFuture.fromResponse(backupCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"BackupCertificateResult",
">",
"backupCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"final",
"ServiceCallback",
"<",
"BackupCertificateResult",
">",
"serviceCallback",
")",
"{",
"return",
"Service... | Backs up the specified certificate.
Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param ce... | [
"Backs",
"up",
"the",
"specified",
"certificate",
".",
"Requests",
"that",
"a",
"backup",
"of",
"the",
"specified",
"certificate",
"be",
"downloaded",
"to",
"the",
"client",
".",
"All",
"versions",
"of",
"the",
"certificate",
"will",
"be",
"downloaded",
".",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L8129-L8131 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/http/AbstractMfClientHttpRequestFactoryWrapper.java | AbstractMfClientHttpRequestFactoryWrapper.createRequest | public final ClientHttpRequest createRequest(
final URI uri,
final HttpMethod httpMethod) throws IOException {
if (uri.getScheme() == null || uri.getScheme().equals("file") ||
this.matchers.matches(uri, httpMethod)) {
return createRequest(uri, httpMethod, this... | java | public final ClientHttpRequest createRequest(
final URI uri,
final HttpMethod httpMethod) throws IOException {
if (uri.getScheme() == null || uri.getScheme().equals("file") ||
this.matchers.matches(uri, httpMethod)) {
return createRequest(uri, httpMethod, this... | [
"public",
"final",
"ClientHttpRequest",
"createRequest",
"(",
"final",
"URI",
"uri",
",",
"final",
"HttpMethod",
"httpMethod",
")",
"throws",
"IOException",
"{",
"if",
"(",
"uri",
".",
"getScheme",
"(",
")",
"==",
"null",
"||",
"uri",
".",
"getScheme",
"(",
... | This implementation simply calls {@link #createRequest(URI, HttpMethod, MfClientHttpRequestFactory)}
(if the matchers are OK) with the wrapped request factory provided to the {@linkplain
#AbstractMfClientHttpRequestFactoryWrapper(MfClientHttpRequestFactory, UriMatchers, boolean)
constructor}.
@param uri the URI to cr... | [
"This",
"implementation",
"simply",
"calls",
"{",
"@link",
"#createRequest",
"(",
"URI",
"HttpMethod",
"MfClientHttpRequestFactory",
")",
"}",
"(",
"if",
"the",
"matchers",
"are",
"OK",
")",
"with",
"the",
"wrapped",
"request",
"factory",
"provided",
"to",
"the"... | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/http/AbstractMfClientHttpRequestFactoryWrapper.java#L48-L59 |
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.moveToServer | public void moveToServer (String hostname, int[] ports, InvocationService.ConfirmListener obs)
{
moveToServer(hostname, ports, new int[0], obs);
} | java | public void moveToServer (String hostname, int[] ports, InvocationService.ConfirmListener obs)
{
moveToServer(hostname, ports, new int[0], obs);
} | [
"public",
"void",
"moveToServer",
"(",
"String",
"hostname",
",",
"int",
"[",
"]",
"ports",
",",
"InvocationService",
".",
"ConfirmListener",
"obs",
")",
"{",
"moveToServer",
"(",
"hostname",
",",
"ports",
",",
"new",
"int",
"[",
"0",
"]",
",",
"obs",
")... | Transitions a logged on client from its current server to the specified new server.
Currently this simply logs the client off of its current server (if it is logged on) and
logs it onto the new server, but in the future we may aim to do something fancier.
<p> If we fail to connect to the new server, the client <em>wil... | [
"Transitions",
"a",
"logged",
"on",
"client",
"from",
"its",
"current",
"server",
"to",
"the",
"specified",
"new",
"server",
".",
"Currently",
"this",
"simply",
"logs",
"the",
"client",
"off",
"of",
"its",
"current",
"server",
"(",
"if",
"it",
"is",
"logge... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L553-L556 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnintranetapplication.java | vpnintranetapplication.get | public static vpnintranetapplication get(nitro_service service, String intranetapplication) throws Exception{
vpnintranetapplication obj = new vpnintranetapplication();
obj.set_intranetapplication(intranetapplication);
vpnintranetapplication response = (vpnintranetapplication) obj.get_resource(service);
return ... | java | public static vpnintranetapplication get(nitro_service service, String intranetapplication) throws Exception{
vpnintranetapplication obj = new vpnintranetapplication();
obj.set_intranetapplication(intranetapplication);
vpnintranetapplication response = (vpnintranetapplication) obj.get_resource(service);
return ... | [
"public",
"static",
"vpnintranetapplication",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"intranetapplication",
")",
"throws",
"Exception",
"{",
"vpnintranetapplication",
"obj",
"=",
"new",
"vpnintranetapplication",
"(",
")",
";",
"obj",
".",
"set_intranet... | Use this API to fetch vpnintranetapplication resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnintranetapplication",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnintranetapplication.java#L437-L442 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeAddKeySpace | private void executeAddKeySpace(Tree statement)
{
if (!CliMain.isConnected())
return;
// first value is the keyspace name, after that it is all key=value
String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
KsDef ksDef = new KsDef(keyspaceN... | java | private void executeAddKeySpace(Tree statement)
{
if (!CliMain.isConnected())
return;
// first value is the keyspace name, after that it is all key=value
String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
KsDef ksDef = new KsDef(keyspaceN... | [
"private",
"void",
"executeAddKeySpace",
"(",
"Tree",
"statement",
")",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
")",
"return",
";",
"// first value is the keyspace name, after that it is all key=value",
"String",
"keyspaceName",
"=",
"CliUtils",
... | Add a keyspace
@param statement - a token tree representing current statement | [
"Add",
"a",
"keyspace"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1073-L1098 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/service/api/SwaggerAnnotationsReader.java | SwaggerAnnotationsReader.read | public static void read(Swagger swagger, Set<Class<?>> classes) {
final SwaggerAnnotationsReader reader = new SwaggerAnnotationsReader(swagger);
for (Class<?> cls : classes) {
final ReaderContext context = new ReaderContext(swagger, cls, "", null, false, new ArrayList<>(),
... | java | public static void read(Swagger swagger, Set<Class<?>> classes) {
final SwaggerAnnotationsReader reader = new SwaggerAnnotationsReader(swagger);
for (Class<?> cls : classes) {
final ReaderContext context = new ReaderContext(swagger, cls, "", null, false, new ArrayList<>(),
... | [
"public",
"static",
"void",
"read",
"(",
"Swagger",
"swagger",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
")",
"{",
"final",
"SwaggerAnnotationsReader",
"reader",
"=",
"new",
"SwaggerAnnotationsReader",
"(",
"swagger",
")",
";",
"for",
"(",
"... | Scans a set of classes for Swagger annotations.
@param swagger is the Swagger instance
@param classes are a set of classes to scan | [
"Scans",
"a",
"set",
"of",
"classes",
"for",
"Swagger",
"annotations",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/service/api/SwaggerAnnotationsReader.java#L65-L72 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.updateInstances | public OperationStatusResponseInner updateInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body();
} | java | public OperationStatusResponseInner updateInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body();
} | [
"public",
"OperationStatusResponseInner",
"updateInstances",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"List",
"<",
"String",
">",
"instanceIds",
")",
"{",
"return",
"updateInstancesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceIds The virtual machine scale set instance ids.
@throws IllegalArgumentException thrown if parameters fail t... | [
"Upgrades",
"one",
"or",
"more",
"virtual",
"machines",
"to",
"the",
"latest",
"SKU",
"set",
"in",
"the",
"VM",
"scale",
"set",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L2714-L2716 |
jmeter-maven-plugin/jmeter-maven-plugin | src/main/java/com/lazerycode/jmeter/mojo/ConfigureJMeterMojo.java | ConfigureJMeterMojo.copyTransitiveRuntimeDependenciesToLibDirectory | private void copyTransitiveRuntimeDependenciesToLibDirectory(Artifact artifact, boolean getDependenciesOfDependency) throws MojoExecutionException {
copyTransitiveRuntimeDependenciesToLibDirectory(new Dependency(artifact, DEPENDENCIES_DEFAULT_SEARCH_SCOPE), getDependenciesOfDependency);
} | java | private void copyTransitiveRuntimeDependenciesToLibDirectory(Artifact artifact, boolean getDependenciesOfDependency) throws MojoExecutionException {
copyTransitiveRuntimeDependenciesToLibDirectory(new Dependency(artifact, DEPENDENCIES_DEFAULT_SEARCH_SCOPE), getDependenciesOfDependency);
} | [
"private",
"void",
"copyTransitiveRuntimeDependenciesToLibDirectory",
"(",
"Artifact",
"artifact",
",",
"boolean",
"getDependenciesOfDependency",
")",
"throws",
"MojoExecutionException",
"{",
"copyTransitiveRuntimeDependenciesToLibDirectory",
"(",
"new",
"Dependency",
"(",
"artif... | Collate a list of transitive runtime dependencies that need to be copied to the /lib directory and then copy them there.
@param artifact The artifact that is a transitive dependency
@param getDependenciesOfDependency get dependencies of dependency
@throws MojoExecutionException MojoExecutionExceptio... | [
"Collate",
"a",
"list",
"of",
"transitive",
"runtime",
"dependencies",
"that",
"need",
"to",
"be",
"copied",
"to",
"the",
"/",
"lib",
"directory",
"and",
"then",
"copy",
"them",
"there",
"."
] | train | https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/63dc8b49cc6b9542deb681e25a2ada6025ddbf6b/src/main/java/com/lazerycode/jmeter/mojo/ConfigureJMeterMojo.java#L536-L538 |
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.deleteTag | public void deleteTag(UUID projectId, UUID tagId) {
deleteTagWithServiceResponseAsync(projectId, tagId).toBlocking().single().body();
} | java | public void deleteTag(UUID projectId, UUID tagId) {
deleteTagWithServiceResponseAsync(projectId, tagId).toBlocking().single().body();
} | [
"public",
"void",
"deleteTag",
"(",
"UUID",
"projectId",
",",
"UUID",
"tagId",
")",
"{",
"deleteTagWithServiceResponseAsync",
"(",
"projectId",
",",
"tagId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";",
"}"
] | Delete a tag from the project.
@param projectId The project id
@param tagId Id of the tag to be deleted
@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 reque... | [
"Delete",
"a",
"tag",
"from",
"the",
"project",
"."
] | 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#L692-L694 |
FasterXML/jackson-jr | jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/JSONReader.java | JSONReader._with | protected JSONReader _with(int features,
ValueReaderLocator td, TreeCodec tc, CollectionBuilder lb, MapBuilder mb)
{
if (getClass() != JSONReader.class) { // sanity check
throw new IllegalStateException("Sub-classes MUST override _with(...)");
}
return new JSONReader(... | java | protected JSONReader _with(int features,
ValueReaderLocator td, TreeCodec tc, CollectionBuilder lb, MapBuilder mb)
{
if (getClass() != JSONReader.class) { // sanity check
throw new IllegalStateException("Sub-classes MUST override _with(...)");
}
return new JSONReader(... | [
"protected",
"JSONReader",
"_with",
"(",
"int",
"features",
",",
"ValueReaderLocator",
"td",
",",
"TreeCodec",
"tc",
",",
"CollectionBuilder",
"lb",
",",
"MapBuilder",
"mb",
")",
"{",
"if",
"(",
"getClass",
"(",
")",
"!=",
"JSONReader",
".",
"class",
")",
... | Overridable method that all mutant factories call if a new instance
is to be constructed | [
"Overridable",
"method",
"that",
"all",
"mutant",
"factories",
"call",
"if",
"a",
"new",
"instance",
"is",
"to",
"be",
"constructed"
] | train | https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/JSONReader.java#L121-L128 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FuncSystemProperty.java | FuncSystemProperty.loadPropertyFile | public void loadPropertyFile(String file, Properties target)
{
try
{
// Use SecuritySupport class to provide priveleged access to property file
SecuritySupport ss = SecuritySupport.getInstance();
InputStream is = ss.getResourceAsStream(ObjectFactory.findClassLoader(),
... | java | public void loadPropertyFile(String file, Properties target)
{
try
{
// Use SecuritySupport class to provide priveleged access to property file
SecuritySupport ss = SecuritySupport.getInstance();
InputStream is = ss.getResourceAsStream(ObjectFactory.findClassLoader(),
... | [
"public",
"void",
"loadPropertyFile",
"(",
"String",
"file",
",",
"Properties",
"target",
")",
"{",
"try",
"{",
"// Use SecuritySupport class to provide priveleged access to property file",
"SecuritySupport",
"ss",
"=",
"SecuritySupport",
".",
"getInstance",
"(",
")",
";"... | Retrieve a propery bundle from a specified file
@param file The string name of the property file. The name
should already be fully qualified as path/filename
@param target The target property bag the file will be placed into. | [
"Retrieve",
"a",
"propery",
"bundle",
"from",
"a",
"specified",
"file"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FuncSystemProperty.java#L176-L197 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/struct/flow/ImageFlow.java | ImageFlow.reshape | public void reshape( int width , int height ) {
int N = width*height;
if( data.length < N ) {
D tmp[] = new D[N];
System.arraycopy(data,0,tmp,0,data.length);
for( int i = data.length; i < N; i++ )
tmp[i] = new D();
data = tmp;
}
this.width = width;
this.height = height;
} | java | public void reshape( int width , int height ) {
int N = width*height;
if( data.length < N ) {
D tmp[] = new D[N];
System.arraycopy(data,0,tmp,0,data.length);
for( int i = data.length; i < N; i++ )
tmp[i] = new D();
data = tmp;
}
this.width = width;
this.height = height;
} | [
"public",
"void",
"reshape",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"N",
"=",
"width",
"*",
"height",
";",
"if",
"(",
"data",
".",
"length",
"<",
"N",
")",
"{",
"D",
"tmp",
"[",
"]",
"=",
"new",
"D",
"[",
"N",
"]",
";",
... | Changes the shape to match the specified dimension. Memory will only be created/destroyed if the requested
size is larger than any previously requested size
@param width New image width
@param height new image height | [
"Changes",
"the",
"shape",
"to",
"match",
"the",
"specified",
"dimension",
".",
"Memory",
"will",
"only",
"be",
"created",
"/",
"destroyed",
"if",
"the",
"requested",
"size",
"is",
"larger",
"than",
"any",
"previously",
"requested",
"size"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/struct/flow/ImageFlow.java#L44-L56 |
zafarkhaja/jsemver | src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java | ExpressionParser.parseVersion | private Version parseVersion() {
int major = intOf(consumeNextToken(NUMERIC).lexeme);
int minor = 0;
if (tokens.positiveLookahead(DOT)) {
tokens.consume();
minor = intOf(consumeNextToken(NUMERIC).lexeme);
}
int patch = 0;
if (tokens.positiveLookahe... | java | private Version parseVersion() {
int major = intOf(consumeNextToken(NUMERIC).lexeme);
int minor = 0;
if (tokens.positiveLookahead(DOT)) {
tokens.consume();
minor = intOf(consumeNextToken(NUMERIC).lexeme);
}
int patch = 0;
if (tokens.positiveLookahe... | [
"private",
"Version",
"parseVersion",
"(",
")",
"{",
"int",
"major",
"=",
"intOf",
"(",
"consumeNextToken",
"(",
"NUMERIC",
")",
".",
"lexeme",
")",
";",
"int",
"minor",
"=",
"0",
";",
"if",
"(",
"tokens",
".",
"positiveLookahead",
"(",
"DOT",
")",
")"... | Parses the {@literal <version>} non-terminal.
<pre>
{@literal
<version> ::= <major>
| <major> "." <minor>
| <major> "." <minor> "." <patch>
}
</pre>
@return the parsed version | [
"Parses",
"the",
"{",
"@literal",
"<version",
">",
"}",
"non",
"-",
"terminal",
"."
] | train | https://github.com/zafarkhaja/jsemver/blob/1f4996ea3dab06193c378fd66fd4f8fdc8334cc6/src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java#L412-L425 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java | LayoutParser.parseAction | private void parseAction(Element node, LayoutTrigger parent) {
new LayoutTriggerAction(parent, getDefinition(null, node));
} | java | private void parseAction(Element node, LayoutTrigger parent) {
new LayoutTriggerAction(parent, getDefinition(null, node));
} | [
"private",
"void",
"parseAction",
"(",
"Element",
"node",
",",
"LayoutTrigger",
"parent",
")",
"{",
"new",
"LayoutTriggerAction",
"(",
"parent",
",",
"getDefinition",
"(",
"null",
",",
"node",
")",
")",
";",
"}"
] | Parse a trigger action node.
@param node The DOM node.
@param parent The parent layout trigger. | [
"Parse",
"a",
"trigger",
"action",
"node",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java#L324-L326 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/temporal/IntervalUtils.java | IntervalUtils.minus | public static Interval minus(final Interval interval, final Period period) {
return new Interval(interval.getStart().minus(period),
interval.getEnd().minus(period));
} | java | public static Interval minus(final Interval interval, final Period period) {
return new Interval(interval.getStart().minus(period),
interval.getEnd().minus(period));
} | [
"public",
"static",
"Interval",
"minus",
"(",
"final",
"Interval",
"interval",
",",
"final",
"Period",
"period",
")",
"{",
"return",
"new",
"Interval",
"(",
"interval",
".",
"getStart",
"(",
")",
".",
"minus",
"(",
"period",
")",
",",
"interval",
".",
"g... | Move both the start and end of an {@link Interval} into the past by the duration of
{@code period}. | [
"Move",
"both",
"the",
"start",
"and",
"end",
"of",
"an",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/temporal/IntervalUtils.java#L19-L22 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java | GuiRenderer.drawItemStack | public void drawItemStack(ItemStack itemStack, int x, int y, String label)
{
drawItemStack(itemStack, x, y, label, null, true);
} | java | public void drawItemStack(ItemStack itemStack, int x, int y, String label)
{
drawItemStack(itemStack, x, y, label, null, true);
} | [
"public",
"void",
"drawItemStack",
"(",
"ItemStack",
"itemStack",
",",
"int",
"x",
",",
"int",
"y",
",",
"String",
"label",
")",
"{",
"drawItemStack",
"(",
"itemStack",
",",
"x",
",",
"y",
",",
"label",
",",
"null",
",",
"true",
")",
";",
"}"
] | Draws an itemStack to the GUI at the specified coordinates with a custom label.
@param itemStack the item stack
@param x the x
@param y the y
@param label the label | [
"Draws",
"an",
"itemStack",
"to",
"the",
"GUI",
"at",
"the",
"specified",
"coordinates",
"with",
"a",
"custom",
"label",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java#L398-L401 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setURL | public void setURL(final int parameterIndex, final URL x) throws SQLException {
setParameter(parameterIndex, new StringParameter(x.toString()));
} | java | public void setURL(final int parameterIndex, final URL x) throws SQLException {
setParameter(parameterIndex, new StringParameter(x.toString()));
} | [
"public",
"void",
"setURL",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"URL",
"x",
")",
"throws",
"SQLException",
"{",
"setParameter",
"(",
"parameterIndex",
",",
"new",
"StringParameter",
"(",
"x",
".",
"toString",
"(",
")",
")",
")",
";",
"}"
] | Sets the designated parameter to the given <code>java.net.URL</code> value. The driver converts this to an SQL
<code>DATALINK</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the second is 2, ...
@param x the <code>java.net.URL</code> object to be set
@throws ... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"java",
".",
"net",
".",
"URL<",
"/",
"code",
">",
"value",
".",
"The",
"driver",
"converts",
"this",
"to",
"an",
"SQL",
"<code",
">",
"DATALINK<",
"/",
"code",
">",
"value",... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L466-L468 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.appendChildren | public void appendChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
int comments, pis, texts;
comments = pis = texts = 0;
Map<String, Integer> elements = new HashMap<String, Integer>();
for (Level l : current.children) {
String childNa... | java | public void appendChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
int comments, pis, texts;
comments = pis = texts = 0;
Map<String, Integer> elements = new HashMap<String, Integer>();
for (Level l : current.children) {
String childNa... | [
"public",
"void",
"appendChildren",
"(",
"Iterable",
"<",
"?",
"extends",
"NodeInfo",
">",
"children",
")",
"{",
"Level",
"current",
"=",
"path",
".",
"getLast",
"(",
")",
";",
"int",
"comments",
",",
"pis",
",",
"texts",
";",
"comments",
"=",
"pis",
"... | Adds knowledge about the current node's children appending to
the knowledge already present. | [
"Adds",
"knowledge",
"about",
"the",
"current",
"node",
"s",
"children",
"appending",
"to",
"the",
"knowledge",
"already",
"present",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L145-L191 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.startHandleChallenges | private void startHandleChallenges(JSONObject jsonChallenges, Response response) {
ArrayList<String> challenges = getRealmsFromJson(jsonChallenges);
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
if (isAuthorizationRequired(re... | java | private void startHandleChallenges(JSONObject jsonChallenges, Response response) {
ArrayList<String> challenges = getRealmsFromJson(jsonChallenges);
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
if (isAuthorizationRequired(re... | [
"private",
"void",
"startHandleChallenges",
"(",
"JSONObject",
"jsonChallenges",
",",
"Response",
"response",
")",
"{",
"ArrayList",
"<",
"String",
">",
"challenges",
"=",
"getRealmsFromJson",
"(",
"jsonChallenges",
")",
";",
"MCAAuthorizationManager",
"authManager",
... | Handles authentication challenges.
@param jsonChallenges Collection of challenges.
@param response Server response. | [
"Handles",
"authentication",
"challenges",
"."
] | 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/AuthorizationRequestManager.java#L413-L431 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java | MethodBuilder.buildTagInfo | public void buildTagInfo(XMLNode node, Content methodDocTree) {
writer.addTags((MethodDoc) methods.get(currentMethodIndex),
methodDocTree);
} | java | public void buildTagInfo(XMLNode node, Content methodDocTree) {
writer.addTags((MethodDoc) methods.get(currentMethodIndex),
methodDocTree);
} | [
"public",
"void",
"buildTagInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"methodDocTree",
")",
"{",
"writer",
".",
"addTags",
"(",
"(",
"MethodDoc",
")",
"methods",
".",
"get",
"(",
"currentMethodIndex",
")",
",",
"methodDocTree",
")",
";",
"}"
] | Build the tag information.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"tag",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java#L229-L232 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setHost | @Deprecated
public static void setHost(HttpMessage message, String value) {
message.headers().set(HttpHeaderNames.HOST, value);
} | java | @Deprecated
public static void setHost(HttpMessage message, String value) {
message.headers().set(HttpHeaderNames.HOST, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setHost",
"(",
"HttpMessage",
"message",
",",
"String",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"set",
"(",
"HttpHeaderNames",
".",
"HOST",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setHost(HttpMessage, CharSequence) | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1024-L1027 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/IOUtils.java | IOUtils.copyBytes | public static void copyBytes(final InputStream in, final OutputStream out, final boolean close) throws IOException {
copyBytes(in, out, BLOCKSIZE, close);
} | java | public static void copyBytes(final InputStream in, final OutputStream out, final boolean close) throws IOException {
copyBytes(in, out, BLOCKSIZE, close);
} | [
"public",
"static",
"void",
"copyBytes",
"(",
"final",
"InputStream",
"in",
",",
"final",
"OutputStream",
"out",
",",
"final",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"copyBytes",
"(",
"in",
",",
"out",
",",
"BLOCKSIZE",
",",
"close",
")",
"... | Copies from one stream to another.
@param in
InputStream to read from
@param out
OutputStream to write to
@param close
whether or not close the InputStream and OutputStream at the
end. The streams are closed in the finally clause.
@throws IOException
thrown if an I/O error occurs while copying | [
"Copies",
"from",
"one",
"stream",
"to",
"another",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L107-L109 |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BytesUtils.java | BytesUtils.byteArrayToInt | public static int byteArrayToInt(final byte[] byteArray, final int startPos, final int length) {
if (byteArray == null) {
throw new IllegalArgumentException("Parameter 'byteArray' cannot be null");
}
if (length <= 0 || length > 4) {
throw new IllegalArgumentException("Length must be between 1 and 4. Le... | java | public static int byteArrayToInt(final byte[] byteArray, final int startPos, final int length) {
if (byteArray == null) {
throw new IllegalArgumentException("Parameter 'byteArray' cannot be null");
}
if (length <= 0 || length > 4) {
throw new IllegalArgumentException("Length must be between 1 and 4. Le... | [
"public",
"static",
"int",
"byteArrayToInt",
"(",
"final",
"byte",
"[",
"]",
"byteArray",
",",
"final",
"int",
"startPos",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"byteArray",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Method used to convert byte array to int
@param byteArray
byte array to convert
@param startPos
start position in array in the
@param length
length of data
@return int value of byte array | [
"Method",
"used",
"to",
"convert",
"byte",
"array",
"to",
"int"
] | train | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BytesUtils.java#L85-L100 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/rule/NotEqualsRule.java | NotEqualsRule.getRule | public static Rule getRule(final Stack stack) {
if (stack.size() < 2) {
throw new IllegalArgumentException(
"Invalid NOT EQUALS rule - expected two parameters but received "
+ stack.size());
}
String p2 = stack.pop().toString();
String p1 = stack.pop().toString();
if (p1.equa... | java | public static Rule getRule(final Stack stack) {
if (stack.size() < 2) {
throw new IllegalArgumentException(
"Invalid NOT EQUALS rule - expected two parameters but received "
+ stack.size());
}
String p2 = stack.pop().toString();
String p1 = stack.pop().toString();
if (p1.equa... | [
"public",
"static",
"Rule",
"getRule",
"(",
"final",
"Stack",
"stack",
")",
"{",
"if",
"(",
"stack",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid NOT EQUALS rule - expected two parameters but received \"",
... | Get new instance from top two elements of stack.
@param stack stack.
@return new instance. | [
"Get",
"new",
"instance",
"from",
"top",
"two",
"elements",
"of",
"stack",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/NotEqualsRule.java#L88-L103 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/bootbox/client/options/DialogOptions.java | DialogOptions.addButton | public final void addButton(String label, String className, SimpleCallback callback) {
addButton(BUTTON_PREFIX + BUTTON_INDEX++, label, className,
callback != null ? callback : SimpleCallback.DEFAULT_SIMPLE_CALLBACK);
} | java | public final void addButton(String label, String className, SimpleCallback callback) {
addButton(BUTTON_PREFIX + BUTTON_INDEX++, label, className,
callback != null ? callback : SimpleCallback.DEFAULT_SIMPLE_CALLBACK);
} | [
"public",
"final",
"void",
"addButton",
"(",
"String",
"label",
",",
"String",
"className",
",",
"SimpleCallback",
"callback",
")",
"{",
"addButton",
"(",
"BUTTON_PREFIX",
"+",
"BUTTON_INDEX",
"++",
",",
"label",
",",
"className",
",",
"callback",
"!=",
"null"... | Adds a custom button with a class name and a callback.
@param label
@param className
@param callback | [
"Adds",
"a",
"custom",
"button",
"with",
"a",
"class",
"name",
"and",
"a",
"callback",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/bootbox/client/options/DialogOptions.java#L211-L214 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.purchaseReservedVolume | public void purchaseReservedVolume(String volumeId, int reservationLength, String reservationTimeUnit) {
this.purchaseReservedVolume(new PurchaseReservedVolumeRequest()
.withVolumeId(volumeId)
.withBilling(new Billing().withReservation(new Reservation()
.w... | java | public void purchaseReservedVolume(String volumeId, int reservationLength, String reservationTimeUnit) {
this.purchaseReservedVolume(new PurchaseReservedVolumeRequest()
.withVolumeId(volumeId)
.withBilling(new Billing().withReservation(new Reservation()
.w... | [
"public",
"void",
"purchaseReservedVolume",
"(",
"String",
"volumeId",
",",
"int",
"reservationLength",
",",
"String",
"reservationTimeUnit",
")",
"{",
"this",
".",
"purchaseReservedVolume",
"(",
"new",
"PurchaseReservedVolumeRequest",
"(",
")",
".",
"withVolumeId",
"... | PurchaseReserved the instance with fixed duration.
You can not purchaseReserved the instance which is resizing.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getVolume(String)}
@param volumeId The id of volume which will be renew.
@param reservationLength The fixed duration to ren... | [
"PurchaseReserved",
"the",
"instance",
"with",
"fixed",
"duration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1159-L1165 |
Impetus/Kundera | src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/DefaultCouchbaseDataHandler.java | DefaultCouchbaseDataHandler.iterateAndPopulateEntity | private void iterateAndPopulateEntity(Object entity, JsonObject obj, Iterator<Attribute> iterator)
{
while (iterator.hasNext())
{
Attribute attribute = iterator.next();
Field field = (Field) attribute.getJavaMember();
String colName = ((AbstractAttribute) attribut... | java | private void iterateAndPopulateEntity(Object entity, JsonObject obj, Iterator<Attribute> iterator)
{
while (iterator.hasNext())
{
Attribute attribute = iterator.next();
Field field = (Field) attribute.getJavaMember();
String colName = ((AbstractAttribute) attribut... | [
"private",
"void",
"iterateAndPopulateEntity",
"(",
"Object",
"entity",
",",
"JsonObject",
"obj",
",",
"Iterator",
"<",
"Attribute",
">",
"iterator",
")",
"{",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"Attribute",
"attribute",
"=",
"iter... | Iterate and populate entity.
@param entity
the entity
@param obj
the obj
@param iterator
the iterator | [
"Iterate",
"and",
"populate",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/DefaultCouchbaseDataHandler.java#L82-L97 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/operations/common/OrderedChildTypesAttachment.java | OrderedChildTypesAttachment.addOrderedChildResourceTypes | public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) {
Set<String> orderedChildTypes = resource.getOrderedChildTypes();
if (orderedChildTypes.size() > 0) {
orderedChildren.put(resourceAddress, resource.getOrderedChildTypes());
}
} | java | public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) {
Set<String> orderedChildTypes = resource.getOrderedChildTypes();
if (orderedChildTypes.size() > 0) {
orderedChildren.put(resourceAddress, resource.getOrderedChildTypes());
}
} | [
"public",
"void",
"addOrderedChildResourceTypes",
"(",
"PathAddress",
"resourceAddress",
",",
"Resource",
"resource",
")",
"{",
"Set",
"<",
"String",
">",
"orderedChildTypes",
"=",
"resource",
".",
"getOrderedChildTypes",
"(",
")",
";",
"if",
"(",
"orderedChildTypes... | If the resource has ordered child types, those child types will be stored in the attachment. If there are no
ordered child types, this method is a no-op.
@param resourceAddress the address of the resource
@param resource the resource which may or may not have ordered children. | [
"If",
"the",
"resource",
"has",
"ordered",
"child",
"types",
"those",
"child",
"types",
"will",
"be",
"stored",
"in",
"the",
"attachment",
".",
"If",
"there",
"are",
"no",
"ordered",
"child",
"types",
"this",
"method",
"is",
"a",
"no",
"-",
"op",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/common/OrderedChildTypesAttachment.java#L32-L37 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findOptionalInt | public @NotNull OptionalInt findOptionalInt(@NotNull @SQL String sql, Object... args) {
return findOptionalInt(SqlQuery.query(sql, args));
} | java | public @NotNull OptionalInt findOptionalInt(@NotNull @SQL String sql, Object... args) {
return findOptionalInt(SqlQuery.query(sql, args));
} | [
"public",
"@",
"NotNull",
"OptionalInt",
"findOptionalInt",
"(",
"@",
"NotNull",
"@",
"SQL",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"findOptionalInt",
"(",
"SqlQuery",
".",
"query",
"(",
"sql",
",",
"args",
")",
")",
";",
"}"
... | Finds a unique result from database, converting the database row to int using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUniqueResultException if there are multiple result rows | [
"Finds",
"a",
"unique",
"result",
"from",
"database",
"converting",
"the",
"database",
"row",
"to",
"int",
"using",
"default",
"mechanisms",
".",
"Returns",
"empty",
"if",
"there",
"are",
"no",
"results",
"or",
"if",
"single",
"null",
"result",
"is",
"return... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L412-L414 |
microfocus-idol/java-content-parameter-api | src/main/java/com/hp/autonomy/aci/content/fieldtext/FieldTextBuilder.java | FieldTextBuilder.WHEN | @Override
public FieldTextBuilder WHEN(final int depth, final FieldText fieldText) {
Validate.isTrue(depth >= 1, "Depth must be at least 1");
Validate.notNull(fieldText, "FieldText should not be null");
Validate.isTrue(fieldText.size() >= 1, "FieldText must have a size greater or equal to 1... | java | @Override
public FieldTextBuilder WHEN(final int depth, final FieldText fieldText) {
Validate.isTrue(depth >= 1, "Depth must be at least 1");
Validate.notNull(fieldText, "FieldText should not be null");
Validate.isTrue(fieldText.size() >= 1, "FieldText must have a size greater or equal to 1... | [
"@",
"Override",
"public",
"FieldTextBuilder",
"WHEN",
"(",
"final",
"int",
"depth",
",",
"final",
"FieldText",
"fieldText",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"depth",
">=",
"1",
",",
"\"Depth must be at least 1\"",
")",
";",
"Validate",
".",
"notNull"... | Appends the specified fieldtext onto the builder using the WHEN<i>n</i> operator.
@param depth The <i>n</i> in WHEN<i>n</i>
@param fieldText A fieldtext expression or specifier.
@return {@code this}. | [
"Appends",
"the",
"specified",
"fieldtext",
"onto",
"the",
"builder",
"using",
"the",
"WHEN<i",
">",
"n<",
"/",
"i",
">",
"operator",
"."
] | train | https://github.com/microfocus-idol/java-content-parameter-api/blob/8d33dc633f8df2a470a571ac7694e423e7004ad0/src/main/java/com/hp/autonomy/aci/content/fieldtext/FieldTextBuilder.java#L256-L280 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-core/src/main/java/org/ops4j/pax/swissbox/core/BundleClassLoader.java | BundleClassLoader.newPriviledged | public static BundleClassLoader newPriviledged( final Bundle bundle, final ClassLoader parent )
{
return AccessController.doPrivileged( new PrivilegedAction<BundleClassLoader>()
{
public BundleClassLoader run()
{
return new BundleClassLoader( bundle, parent );... | java | public static BundleClassLoader newPriviledged( final Bundle bundle, final ClassLoader parent )
{
return AccessController.doPrivileged( new PrivilegedAction<BundleClassLoader>()
{
public BundleClassLoader run()
{
return new BundleClassLoader( bundle, parent );... | [
"public",
"static",
"BundleClassLoader",
"newPriviledged",
"(",
"final",
"Bundle",
"bundle",
",",
"final",
"ClassLoader",
"parent",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"BundleClassLoader",
">",
"(",
")",
... | Privileged factory method.
@param bundle bundle to be used for class loading. Cannot be null.
@param parent parent class loader
@return created bundle class loader
@see BundleClassLoader#BundleClassLoader(Bundle,ClassLoader) | [
"Privileged",
"factory",
"method",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-core/src/main/java/org/ops4j/pax/swissbox/core/BundleClassLoader.java#L85-L94 |
usc/wechat-mp-sdk | wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/util/JsonRtnUtil.java | JsonRtnUtil.parseJsonRtn | public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) {
T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz);
appendErrorHumanMsg(rtn);
return rtn;
} | java | public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) {
T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz);
appendErrorHumanMsg(rtn);
return rtn;
} | [
"public",
"static",
"<",
"T",
"extends",
"JsonRtn",
">",
"T",
"parseJsonRtn",
"(",
"String",
"jsonRtn",
",",
"Class",
"<",
"T",
">",
"jsonRtnClazz",
")",
"{",
"T",
"rtn",
"=",
"JSONObject",
".",
"parseObject",
"(",
"jsonRtn",
",",
"jsonRtnClazz",
")",
";... | parse json text to specified class
@param jsonRtn
@param jsonRtnClazz
@return | [
"parse",
"json",
"text",
"to",
"specified",
"class"
] | train | https://github.com/usc/wechat-mp-sdk/blob/39d9574a8e3ffa3b61f88b4bef534d93645a825f/wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/util/JsonRtnUtil.java#L33-L37 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserFactory.java | JobHistoryFileParserFactory.getVersion | public static HadoopVersion getVersion(byte[] historyFileContents) {
if(historyFileContents.length > HADOOP2_VERSION_LENGTH) {
// the first 10 bytes in a hadoop2.0 history file contain Avro-Json
String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH);
if (StringUtils.equa... | java | public static HadoopVersion getVersion(byte[] historyFileContents) {
if(historyFileContents.length > HADOOP2_VERSION_LENGTH) {
// the first 10 bytes in a hadoop2.0 history file contain Avro-Json
String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH);
if (StringUtils.equa... | [
"public",
"static",
"HadoopVersion",
"getVersion",
"(",
"byte",
"[",
"]",
"historyFileContents",
")",
"{",
"if",
"(",
"historyFileContents",
".",
"length",
">",
"HADOOP2_VERSION_LENGTH",
")",
"{",
"// the first 10 bytes in a hadoop2.0 history file contain Avro-Json",
"Strin... | determines the verison of hadoop that the history file belongs to
@return
returns 1 for hadoop 1 (pre MAPREDUCE-1016)
returns 2 for newer job history files
(newer job history files have "AVRO-JSON" as the signature at the start of the file,
REFERENCE: https://issues.apache.org/jira/browse/MAPREDUCE-1016? \
focusedComm... | [
"determines",
"the",
"verison",
"of",
"hadoop",
"that",
"the",
"history",
"file",
"belongs",
"to"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserFactory.java#L50-L60 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.pressImage | public static void pressImage(File srcImageFile, File destImageFile, Image pressImg, int x, int y, float alpha) {
pressImage(read(srcImageFile), destImageFile, pressImg, x, y, alpha);
} | java | public static void pressImage(File srcImageFile, File destImageFile, Image pressImg, int x, int y, float alpha) {
pressImage(read(srcImageFile), destImageFile, pressImg, x, y, alpha);
} | [
"public",
"static",
"void",
"pressImage",
"(",
"File",
"srcImageFile",
",",
"File",
"destImageFile",
",",
"Image",
"pressImg",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"{",
"pressImage",
"(",
"read",
"(",
"srcImageFile",
")",
",",
"d... | 给图片添加图片水印
@param srcImageFile 源图像文件
@param destImageFile 目标图像文件
@param pressImg 水印图片
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 | [
"给图片添加图片水印"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L876-L878 |
citrusframework/citrus | modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java | ManagedBeanDefinition.createObjectName | public ObjectName createObjectName() {
try {
if (StringUtils.hasText(objectName)) {
return new ObjectName(objectDomain + ":" + objectName);
}
if (type != null) {
if (StringUtils.hasText(objectDomain)) {
return new ObjectNam... | java | public ObjectName createObjectName() {
try {
if (StringUtils.hasText(objectName)) {
return new ObjectName(objectDomain + ":" + objectName);
}
if (type != null) {
if (StringUtils.hasText(objectDomain)) {
return new ObjectNam... | [
"public",
"ObjectName",
"createObjectName",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"objectName",
")",
")",
"{",
"return",
"new",
"ObjectName",
"(",
"objectDomain",
"+",
"\":\"",
"+",
"objectName",
")",
";",
"}",
"if",
"... | Constructs proper object name either from given domain and name property or
by evaluating the mbean type class information.
@return | [
"Constructs",
"proper",
"object",
"name",
"either",
"from",
"given",
"domain",
"and",
"name",
"property",
"or",
"by",
"evaluating",
"the",
"mbean",
"type",
"class",
"information",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L51-L69 |
aws/aws-sdk-java | aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/StartOutboundVoiceContactRequest.java | StartOutboundVoiceContactRequest.withAttributes | public StartOutboundVoiceContactRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | java | public StartOutboundVoiceContactRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"StartOutboundVoiceContactRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Specify a custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes,
and can be accessed in contact flows just like any other contact attributes.
</p>
<p>
There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only
alphanume... | [
"<p",
">",
"Specify",
"a",
"custom",
"key",
"-",
"value",
"pair",
"using",
"an",
"attribute",
"map",
".",
"The",
"attributes",
"are",
"standard",
"Amazon",
"Connect",
"attributes",
"and",
"can",
"be",
"accessed",
"in",
"contact",
"flows",
"just",
"like",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/StartOutboundVoiceContactRequest.java#L533-L536 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonWriter.java | JsonWriter.value | public JsonWriter value(Map<String, ?> map) throws IOException {
if (map == null) {
nullValue();
} else {
boolean inObject = inObject();
if (!inObject) beginObject();
for (Map.Entry<String, ?> entry : map.entrySet()) {
property(entry.getKey(), entry.getValue()... | java | public JsonWriter value(Map<String, ?> map) throws IOException {
if (map == null) {
nullValue();
} else {
boolean inObject = inObject();
if (!inObject) beginObject();
for (Map.Entry<String, ?> entry : map.entrySet()) {
property(entry.getKey(), entry.getValue()... | [
"public",
"JsonWriter",
"value",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"map",
")",
"throws",
"IOException",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"nullValue",
"(",
")",
";",
"}",
"else",
"{",
"boolean",
"inObject",
"=",
"inObject",
"(",
... | Writes a map
@param map the map to be written
@return This structured writer
@throws IOException Something went wrong writing | [
"Writes",
"a",
"map"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonWriter.java#L403-L416 |
alkacon/opencms-core | src/org/opencms/i18n/CmsLocaleManager.java | CmsLocaleManager.getDefaultLocale | public Locale getDefaultLocale(CmsObject cms, String resourceName) {
List<Locale> defaultLocales = getDefaultLocales(cms, resourceName);
Locale result;
if (defaultLocales.size() > 0) {
result = defaultLocales.get(0);
} else {
result = getDefaultLocale();
... | java | public Locale getDefaultLocale(CmsObject cms, String resourceName) {
List<Locale> defaultLocales = getDefaultLocales(cms, resourceName);
Locale result;
if (defaultLocales.size() > 0) {
result = defaultLocales.get(0);
} else {
result = getDefaultLocale();
... | [
"public",
"Locale",
"getDefaultLocale",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceName",
")",
"{",
"List",
"<",
"Locale",
">",
"defaultLocales",
"=",
"getDefaultLocales",
"(",
"cms",
",",
"resourceName",
")",
";",
"Locale",
"result",
";",
"if",
"(",
"... | Returns the "the" default locale for the given resource.<p>
It's possible to override the system default (see {@link #getDefaultLocale()}) by setting the property
<code>{@link CmsPropertyDefinition#PROPERTY_LOCALE}</code> to a comma separated list of locale names.
This property is inherited from the parent folders.
Th... | [
"Returns",
"the",
"the",
"default",
"locale",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsLocaleManager.java#L764-L774 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/SBGNLayoutManager.java | SBGNLayoutManager.populateCompartmentOccurencesMap | private void populateCompartmentOccurencesMap(Glyph targetGlyph, HashMap<String, Integer> compartmentIDandOccurenceMap)
{
String rootID = "root";
// if compartment ref of targetGlyph node is not null, increment its occurence by 1
if(targetGlyph.getCompartmentRef() != null)
{
... | java | private void populateCompartmentOccurencesMap(Glyph targetGlyph, HashMap<String, Integer> compartmentIDandOccurenceMap)
{
String rootID = "root";
// if compartment ref of targetGlyph node is not null, increment its occurence by 1
if(targetGlyph.getCompartmentRef() != null)
{
... | [
"private",
"void",
"populateCompartmentOccurencesMap",
"(",
"Glyph",
"targetGlyph",
",",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"compartmentIDandOccurenceMap",
")",
"{",
"String",
"rootID",
"=",
"\"root\"",
";",
"// if compartment ref of targetGlyph node is not null... | Updates a hashmap by incrementing the number of nodes in the compartment glyph that includes targetGlyph.
It is assumed that given hashmap includes compartment ids' as keys and number of nodes as values.This method
is an utility method that will be used to populate a hashmap while determining the compartment node of a ... | [
"Updates",
"a",
"hashmap",
"by",
"incrementing",
"the",
"number",
"of",
"nodes",
"in",
"the",
"compartment",
"glyph",
"that",
"includes",
"targetGlyph",
".",
"It",
"is",
"assumed",
"that",
"given",
"hashmap",
"includes",
"compartment",
"ids",
"as",
"keys",
"an... | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/SBGNLayoutManager.java#L311-L341 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderNoteUrl.java | OrderNoteUrl.deleteOrderNoteUrl | public static MozuUrl deleteOrderNoteUrl(String noteId, String orderId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/notes/{noteId}");
formatter.formatUrl("noteId", noteId);
formatter.formatUrl("orderId", orderId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLo... | java | public static MozuUrl deleteOrderNoteUrl(String noteId, String orderId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/notes/{noteId}");
formatter.formatUrl("noteId", noteId);
formatter.formatUrl("orderId", orderId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLo... | [
"public",
"static",
"MozuUrl",
"deleteOrderNoteUrl",
"(",
"String",
"noteId",
",",
"String",
"orderId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/notes/{noteId}\"",
")",
";",
"formatter",
".",
"formatUrl",
... | Get Resource Url for DeleteOrderNote
@param noteId Unique identifier of a particular note to retrieve.
@param orderId Unique identifier of the order.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteOrderNote"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderNoteUrl.java#L80-L86 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java | PGPMessageSigner.signMessage | @Override
public boolean signMessage(InputStream privateKeyOfSender, final String userIdForPrivateKey, String passwordOfPrivateKey, InputStream message, OutputStream signature) {
LOGGER.trace("signMessage(InputStream, String, String, InputStream, OutputStream)");
LOGGER.trace("Private Key: {}, User ID: {}, Pa... | java | @Override
public boolean signMessage(InputStream privateKeyOfSender, final String userIdForPrivateKey, String passwordOfPrivateKey, InputStream message, OutputStream signature) {
LOGGER.trace("signMessage(InputStream, String, String, InputStream, OutputStream)");
LOGGER.trace("Private Key: {}, User ID: {}, Pa... | [
"@",
"Override",
"public",
"boolean",
"signMessage",
"(",
"InputStream",
"privateKeyOfSender",
",",
"final",
"String",
"userIdForPrivateKey",
",",
"String",
"passwordOfPrivateKey",
",",
"InputStream",
"message",
",",
"OutputStream",
"signature",
")",
"{",
"LOGGER",
".... | @see MessageSigner#signMessage(InputStream, String, String, InputStream, OutputStream)
@param privateKeyOfSender
the private key of the sender
@param userIdForPrivateKey
the user id of the sender
@param passwordOfPrivateKey
the password for the private key
@param message
the message / data to verify
@param signature
t... | [
"@see",
"MessageSigner#signMessage",
"(",
"InputStream",
"String",
"String",
"InputStream",
"OutputStream",
")"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java#L106-L152 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.composeMembershipId | String composeMembershipId(Node groupNode, Node refUserNode, Node refTypeNode) throws RepositoryException
{
return groupNode.getUUID()
+ ','
+ refUserNode.getName()
+ ','
+ (refTypeNode.getName().equals(JCROrganizationServiceImpl.JOS_MEMBERSHIP_TYPE_ANY)
? Member... | java | String composeMembershipId(Node groupNode, Node refUserNode, Node refTypeNode) throws RepositoryException
{
return groupNode.getUUID()
+ ','
+ refUserNode.getName()
+ ','
+ (refTypeNode.getName().equals(JCROrganizationServiceImpl.JOS_MEMBERSHIP_TYPE_ANY)
? Member... | [
"String",
"composeMembershipId",
"(",
"Node",
"groupNode",
",",
"Node",
"refUserNode",
",",
"Node",
"refTypeNode",
")",
"throws",
"RepositoryException",
"{",
"return",
"groupNode",
".",
"getUUID",
"(",
")",
"+",
"'",
"'",
"+",
"refUserNode",
".",
"getName",
"(... | Compose membership identifier. For more information see {@link MembershipImpl} | [
"Compose",
"membership",
"identifier",
".",
"For",
"more",
"information",
"see",
"{"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L118-L126 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java | MappedParametrizedObjectEntry.getParameterLong | public Long getParameterLong(String name) throws RepositoryConfigurationException
{
try
{
return StringNumberParser.parseLong(getParameterValue(name));
}
catch (NumberFormatException e)
{
throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);... | java | public Long getParameterLong(String name) throws RepositoryConfigurationException
{
try
{
return StringNumberParser.parseLong(getParameterValue(name));
}
catch (NumberFormatException e)
{
throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);... | [
"public",
"Long",
"getParameterLong",
"(",
"String",
"name",
")",
"throws",
"RepositoryConfigurationException",
"{",
"try",
"{",
"return",
"StringNumberParser",
".",
"parseLong",
"(",
"getParameterValue",
"(",
"name",
")",
")",
";",
"}",
"catch",
"(",
"NumberForma... | Parse named parameter as Long.
@param name
parameter name
@return Long value
@throws RepositoryConfigurationException | [
"Parse",
"named",
"parameter",
"as",
"Long",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java#L226-L236 |
Red5/red5-io | src/main/java/org/red5/io/amf/Output.java | Output.putString | public static void putString(IoBuffer buf, String string) {
final byte[] encoded = encodeString(string);
if (encoded.length < AMF.LONG_STRING_LENGTH) {
// write unsigned short
buf.put((byte) ((encoded.length >> 8) & 0xff));
buf.put((byte) (encoded.length & 0xff));
... | java | public static void putString(IoBuffer buf, String string) {
final byte[] encoded = encodeString(string);
if (encoded.length < AMF.LONG_STRING_LENGTH) {
// write unsigned short
buf.put((byte) ((encoded.length >> 8) & 0xff));
buf.put((byte) (encoded.length & 0xff));
... | [
"public",
"static",
"void",
"putString",
"(",
"IoBuffer",
"buf",
",",
"String",
"string",
")",
"{",
"final",
"byte",
"[",
"]",
"encoded",
"=",
"encodeString",
"(",
"string",
")",
";",
"if",
"(",
"encoded",
".",
"length",
"<",
"AMF",
".",
"LONG_STRING_LEN... | Write out string
@param buf
Byte buffer to write to
@param string
String to write | [
"Write",
"out",
"string"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf/Output.java#L546-L556 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.number_specificNumbers_GET | public ArrayList<OvhSpecificNumber> number_specificNumbers_GET(OvhNumberCountryEnum country, String range, OvhNumberTypeEnum type, String zone) throws IOException {
String qPath = "/telephony/number/specificNumbers";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "range", range);
que... | java | public ArrayList<OvhSpecificNumber> number_specificNumbers_GET(OvhNumberCountryEnum country, String range, OvhNumberTypeEnum type, String zone) throws IOException {
String qPath = "/telephony/number/specificNumbers";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "range", range);
que... | [
"public",
"ArrayList",
"<",
"OvhSpecificNumber",
">",
"number_specificNumbers_GET",
"(",
"OvhNumberCountryEnum",
"country",
",",
"String",
"range",
",",
"OvhNumberTypeEnum",
"type",
",",
"String",
"zone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\... | Get all available specific number from a country
REST: GET /telephony/number/specificNumbers
@param type [required] The type of number
@param country [required] The country
@param zone [required] The zone (geographic number)
@param range [required] The range (special number) | [
"Get",
"all",
"available",
"specific",
"number",
"from",
"a",
"country"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8662-L8671 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java | WebUtilities.percentEncodeUrl | public static String percentEncodeUrl(final String urlStr) {
if (Util.empty(urlStr)) {
return urlStr;
}
try {
// Avoid double encoding
String decode = URIUtil.decode(urlStr);
URI uri = new URI(decode, false);
return uri.getEscapedURIReference();
} catch (Exception e) {
return urlStr;
}
} | java | public static String percentEncodeUrl(final String urlStr) {
if (Util.empty(urlStr)) {
return urlStr;
}
try {
// Avoid double encoding
String decode = URIUtil.decode(urlStr);
URI uri = new URI(decode, false);
return uri.getEscapedURIReference();
} catch (Exception e) {
return urlStr;
}
} | [
"public",
"static",
"String",
"percentEncodeUrl",
"(",
"final",
"String",
"urlStr",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"urlStr",
")",
")",
"{",
"return",
"urlStr",
";",
"}",
"try",
"{",
"// Avoid double encoding",
"String",
"decode",
"=",
"URI... | Percent encode a URL to include in HTML.
@param urlStr the URL to escape
@return the URL percent encoded | [
"Percent",
"encode",
"a",
"URL",
"to",
"include",
"in",
"HTML",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java#L300-L313 |
baratine/baratine | web/src/main/java/com/caucho/v5/web/webapp/MultiMapImpl.java | MultiMapImpl.add | public void add(K key, V value)
{
if (key == null) {
return;
}
K []keys = _keys;
final int size = _size;
for (int i = size - 1; i >= 0; i--) {
if (key.equals(keys[i])) {
_values[i].add(value);
return;
}
}
if (! ensureCapacity(size)) {
return;
... | java | public void add(K key, V value)
{
if (key == null) {
return;
}
K []keys = _keys;
final int size = _size;
for (int i = size - 1; i >= 0; i--) {
if (key.equals(keys[i])) {
_values[i].add(value);
return;
}
}
if (! ensureCapacity(size)) {
return;
... | [
"public",
"void",
"add",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
";",
"}",
"K",
"[",
"]",
"keys",
"=",
"_keys",
";",
"final",
"int",
"size",
"=",
"_size",
";",
"for",
"(",
"int",
"i",
... | Puts a new item in the cache.
@param key key to store data
@param value value to be stored
@return old value stored under the key | [
"Puts",
"a",
"new",
"item",
"in",
"the",
"cache",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/webapp/MultiMapImpl.java#L153-L178 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/TextCharacter.java | TextCharacter.withoutModifier | public TextCharacter withoutModifier(SGR modifier) {
if(!modifiers.contains(modifier)) {
return this;
}
EnumSet<SGR> newSet = EnumSet.copyOf(this.modifiers);
newSet.remove(modifier);
return new TextCharacter(character, foregroundColor, backgroundColor, newSet);
} | java | public TextCharacter withoutModifier(SGR modifier) {
if(!modifiers.contains(modifier)) {
return this;
}
EnumSet<SGR> newSet = EnumSet.copyOf(this.modifiers);
newSet.remove(modifier);
return new TextCharacter(character, foregroundColor, backgroundColor, newSet);
} | [
"public",
"TextCharacter",
"withoutModifier",
"(",
"SGR",
"modifier",
")",
"{",
"if",
"(",
"!",
"modifiers",
".",
"contains",
"(",
"modifier",
")",
")",
"{",
"return",
"this",
";",
"}",
"EnumSet",
"<",
"SGR",
">",
"newSet",
"=",
"EnumSet",
".",
"copyOf",... | Returns a copy of this TextCharacter with an SGR modifier removed. All of the currently active SGR codes
will be carried over to the copy, except for the one specified. If the current TextCharacter doesn't have the
SGR specified, it will return itself.
@param modifier SGR modifiers the copy should not have
@return Copy... | [
"Returns",
"a",
"copy",
"of",
"this",
"TextCharacter",
"with",
"an",
"SGR",
"modifier",
"removed",
".",
"All",
"of",
"the",
"currently",
"active",
"SGR",
"codes",
"will",
"be",
"carried",
"over",
"to",
"the",
"copy",
"except",
"for",
"the",
"one",
"specifi... | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/TextCharacter.java#L280-L287 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.saveDraft | @ObjectiveCName("saveDraftWithPeer:withDraft:")
public void saveDraft(Peer peer, String draft) {
modules.getMessagesModule().saveDraft(peer, draft);
} | java | @ObjectiveCName("saveDraftWithPeer:withDraft:")
public void saveDraft(Peer peer, String draft) {
modules.getMessagesModule().saveDraft(peer, draft);
} | [
"@",
"ObjectiveCName",
"(",
"\"saveDraftWithPeer:withDraft:\"",
")",
"public",
"void",
"saveDraft",
"(",
"Peer",
"peer",
",",
"String",
"draft",
")",
"{",
"modules",
".",
"getMessagesModule",
"(",
")",
".",
"saveDraft",
"(",
"peer",
",",
"draft",
")",
";",
"... | Save message draft
@param peer destination peer
@param draft message draft | [
"Save",
"message",
"draft"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1097-L1100 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java | RuleBasedCollator.getContractionsAndExpansions | public void getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions, boolean addPrefixes)
throws Exception {
if (contractions != null) {
contractions.clear();
}
if (expansions != null) {
expansions.clear();
}
new Contraction... | java | public void getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions, boolean addPrefixes)
throws Exception {
if (contractions != null) {
contractions.clear();
}
if (expansions != null) {
expansions.clear();
}
new Contraction... | [
"public",
"void",
"getContractionsAndExpansions",
"(",
"UnicodeSet",
"contractions",
",",
"UnicodeSet",
"expansions",
",",
"boolean",
"addPrefixes",
")",
"throws",
"Exception",
"{",
"if",
"(",
"contractions",
"!=",
"null",
")",
"{",
"contractions",
".",
"clear",
"... | Gets unicode sets containing contractions and/or expansions of a collator
@param contractions
if not null, set to contain contractions
@param expansions
if not null, set to contain expansions
@param addPrefixes
add the prefix contextual elements to contractions
@throws Exception
Throws an exception if any errors occur... | [
"Gets",
"unicode",
"sets",
"containing",
"contractions",
"and",
"/",
"or",
"expansions",
"of",
"a",
"collator"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java#L989-L998 |
spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.configureURLForProtectedAccess | public URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String, String> additionalParameters) throws OAuthRequestFailedException {
return configureURLForProtectedAccess(url, accessToken, getProtectedResourceDetailsService().loadProtectedResourceDetailsById(accessTok... | java | public URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String, String> additionalParameters) throws OAuthRequestFailedException {
return configureURLForProtectedAccess(url, accessToken, getProtectedResourceDetailsService().loadProtectedResourceDetailsById(accessTok... | [
"public",
"URL",
"configureURLForProtectedAccess",
"(",
"URL",
"url",
",",
"OAuthConsumerToken",
"accessToken",
",",
"String",
"httpMethod",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParameters",
")",
"throws",
"OAuthRequestFailedException",
"{",
"retu... | Create a configured URL. If the HTTP method to access the resource is "POST" or "PUT" and the "Authorization"
header isn't supported, then the OAuth parameters will be expected to be sent in the body of the request. Otherwise,
you can assume that the given URL is ready to be used without further work.
@param url ... | [
"Create",
"a",
"configured",
"URL",
".",
"If",
"the",
"HTTP",
"method",
"to",
"access",
"the",
"resource",
"is",
"POST",
"or",
"PUT",
"and",
"the",
"Authorization",
"header",
"isn",
"t",
"supported",
"then",
"the",
"OAuth",
"parameters",
"will",
"be",
"exp... | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L258-L260 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java | InputMapTemplate.consumeUnless | public static <S, T extends Event, U extends T> InputMapTemplate<S, U> consumeUnless(
EventPattern<? super T, ? extends U> eventPattern,
Predicate<? super S> condition,
BiConsumer<? super S, ? super U> action) {
return consumeWhen(eventPattern, condition.negate(), action);
... | java | public static <S, T extends Event, U extends T> InputMapTemplate<S, U> consumeUnless(
EventPattern<? super T, ? extends U> eventPattern,
Predicate<? super S> condition,
BiConsumer<? super S, ? super U> action) {
return consumeWhen(eventPattern, condition.negate(), action);
... | [
"public",
"static",
"<",
"S",
",",
"T",
"extends",
"Event",
",",
"U",
"extends",
"T",
">",
"InputMapTemplate",
"<",
"S",
",",
"U",
">",
"consumeUnless",
"(",
"EventPattern",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"eventPattern",
",",
... | If the given {@link EventPattern} matches the given event type and {@code condition} is false,
consumes the event and does not attempt to match additional
{@code InputMap}s (if they exist). If {@code condition} is true, continues to try to pattern match
the event type with the next {@code InputMap} (if one exists). | [
"If",
"the",
"given",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java#L292-L297 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.signParams | public static String signParams(DigestAlgorithm digestAlgorithm, Map<?, ?> params, String separator, String keyValueSeparator, boolean isIgnoreNull) {
if (MapUtil.isEmpty(params)) {
return null;
}
final String paramsStr = MapUtil.join(MapUtil.sort(params), separator, keyValueSeparator, isIgnoreNull);
re... | java | public static String signParams(DigestAlgorithm digestAlgorithm, Map<?, ?> params, String separator, String keyValueSeparator, boolean isIgnoreNull) {
if (MapUtil.isEmpty(params)) {
return null;
}
final String paramsStr = MapUtil.join(MapUtil.sort(params), separator, keyValueSeparator, isIgnoreNull);
re... | [
"public",
"static",
"String",
"signParams",
"(",
"DigestAlgorithm",
"digestAlgorithm",
",",
"Map",
"<",
"?",
",",
"?",
">",
"params",
",",
"String",
"separator",
",",
"String",
"keyValueSeparator",
",",
"boolean",
"isIgnoreNull",
")",
"{",
"if",
"(",
"MapUtil"... | 对参数做签名<br>
参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串
@param digestAlgorithm 摘要算法
@param params 参数
@param separator entry之间的连接符
@param keyValueSeparator kv之间的连接符
@param isIgnoreNull 是否忽略null的键和值
@return 签名
@since 4.0.1 | [
"对参数做签名<br",
">",
"参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L920-L926 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_resiliate_POST | public OvhResiliationFollowUpDetail serviceName_resiliate_POST(String serviceName, Date resiliationDate, OvhResiliationSurvey resiliationSurvey) throws IOException {
String qPath = "/xdsl/{serviceName}/resiliate";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>(... | java | public OvhResiliationFollowUpDetail serviceName_resiliate_POST(String serviceName, Date resiliationDate, OvhResiliationSurvey resiliationSurvey) throws IOException {
String qPath = "/xdsl/{serviceName}/resiliate";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>(... | [
"public",
"OvhResiliationFollowUpDetail",
"serviceName_resiliate_POST",
"(",
"String",
"serviceName",
",",
"Date",
"resiliationDate",
",",
"OvhResiliationSurvey",
"resiliationSurvey",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/resiliate\""... | Resiliate the access
REST: POST /xdsl/{serviceName}/resiliate
@param resiliationSurvey [required] Comment about resiliation reasons
@param resiliationDate [required] The desired resiliation date
@param serviceName [required] The internal name of your XDSL offer | [
"Resiliate",
"the",
"access"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L626-L634 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java | ImageLoader.asMatrix | public INDArray asMatrix(InputStream inputStream) throws IOException {
if (channels == 3)
return toBgr(inputStream);
try {
BufferedImage image = ImageIO.read(inputStream);
return asMatrix(image);
} catch (IOException e) {
throw new IOException("Una... | java | public INDArray asMatrix(InputStream inputStream) throws IOException {
if (channels == 3)
return toBgr(inputStream);
try {
BufferedImage image = ImageIO.read(inputStream);
return asMatrix(image);
} catch (IOException e) {
throw new IOException("Una... | [
"public",
"INDArray",
"asMatrix",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channels",
"==",
"3",
")",
"return",
"toBgr",
"(",
"inputStream",
")",
";",
"try",
"{",
"BufferedImage",
"image",
"=",
"ImageIO",
".",
"read",... | Convert an input stream to a matrix
@param inputStream the input stream to convert
@return the input stream to convert | [
"Convert",
"an",
"input",
"stream",
"to",
"a",
"matrix"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java#L261-L270 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/ConnectedCrud.java | ConnectedCrud.create | public <RH extends CheckedConsumer<? super K>> RH create(final T value, final RH keyConsumer) throws SQLException {
transactionTemplate
.doInTransaction(new SQLFunction<Connection, Object>() {
@Override
public Object apply(Connection connection) throws SQLException {
... | java | public <RH extends CheckedConsumer<? super K>> RH create(final T value, final RH keyConsumer) throws SQLException {
transactionTemplate
.doInTransaction(new SQLFunction<Connection, Object>() {
@Override
public Object apply(Connection connection) throws SQLException {
... | [
"public",
"<",
"RH",
"extends",
"CheckedConsumer",
"<",
"?",
"super",
"K",
">",
">",
"RH",
"create",
"(",
"final",
"T",
"value",
",",
"final",
"RH",
"keyConsumer",
")",
"throws",
"SQLException",
"{",
"transactionTemplate",
".",
"doInTransaction",
"(",
"new",... | insert value into the db through the specified connection.
Callback keyConsumer with the generated key if one was.
@param value the value
@param keyConsumer the key consumer
@param <RH> the type of keyConsumer
@return the keyConsumer
@throws SQLException | [
"insert",
"value",
"into",
"the",
"db",
"through",
"the",
"specified",
"connection",
".",
"Callback",
"keyConsumer",
"with",
"the",
"generated",
"key",
"if",
"one",
"was",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/ConnectedCrud.java#L70-L80 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/Parser.java | Parser.processArgs | public void processArgs(Option opt, ListIterator<String> iter) throws ParseException
{
// loop until an option is found
while (iter.hasNext())
{
String str = iter.next();
// found an Option, not an argument
if (getOptions().hasOption(str) && s... | java | public void processArgs(Option opt, ListIterator<String> iter) throws ParseException
{
// loop until an option is found
while (iter.hasNext())
{
String str = iter.next();
// found an Option, not an argument
if (getOptions().hasOption(str) && s... | [
"public",
"void",
"processArgs",
"(",
"Option",
"opt",
",",
"ListIterator",
"<",
"String",
">",
"iter",
")",
"throws",
"ParseException",
"{",
"// loop until an option is found",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"str",
"=",
... | Process the argument values for the specified Option
<code>opt</code> using the values retrieved from the
specified iterator <code>iter</code>.
@param opt The current Option
@param iter The iterator over the flattened command line Options.
@throws ParseException if an argument value is required
and it is has not been... | [
"Process",
"the",
"argument",
"values",
"for",
"the",
"specified",
"Option",
"<code",
">",
"opt<",
"/",
"code",
">",
"using",
"the",
"values",
"retrieved",
"from",
"the",
"specified",
"iterator",
"<code",
">",
"iter<",
"/",
"code",
">",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/Parser.java#L335-L365 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java | MapMessage.with | @SuppressWarnings("unchecked")
public M with(final String key, final short value) {
validate(key, value);
data.putValue(key, value);
return (M) this;
} | java | @SuppressWarnings("unchecked")
public M with(final String key, final short value) {
validate(key, value);
data.putValue(key, value);
return (M) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"M",
"with",
"(",
"final",
"String",
"key",
",",
"final",
"short",
"value",
")",
"{",
"validate",
"(",
"key",
",",
"value",
")",
";",
"data",
".",
"putValue",
"(",
"key",
",",
"value",
")",
... | Adds an item to the data Map.
@param key The name of the data item.
@param value The value of the data item.
@return this object
@since 2.9 | [
"Adds",
"an",
"item",
"to",
"the",
"data",
"Map",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L652-L657 |
killbill/killbill | payment/src/main/java/org/killbill/billing/payment/core/PaymentRefresher.java | PaymentRefresher.toPayment | private Payment toPayment(final PaymentModelDao paymentModelDao, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context, final InternalTenantContext tenantContext) throws PaymentApiException {
final PaymentPluginApi plugin = getPaymentPro... | java | private Payment toPayment(final PaymentModelDao paymentModelDao, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context, final InternalTenantContext tenantContext) throws PaymentApiException {
final PaymentPluginApi plugin = getPaymentPro... | [
"private",
"Payment",
"toPayment",
"(",
"final",
"PaymentModelDao",
"paymentModelDao",
",",
"final",
"boolean",
"withPluginInfo",
",",
"final",
"boolean",
"withAttempts",
",",
"final",
"Iterable",
"<",
"PluginProperty",
">",
"properties",
",",
"final",
"TenantContext"... | Used in single get APIs (getPayment / getPaymentByExternalKey) | [
"Used",
"in",
"single",
"get",
"APIs",
"(",
"getPayment",
"/",
"getPaymentByExternalKey",
")"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/payment/src/main/java/org/killbill/billing/payment/core/PaymentRefresher.java#L388-L393 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createPartialMock | public static synchronized <T> T createPartialMock(Class<T> type, String methodNameToMock,
Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
return doMockSpecific(type, new DefaultMockStrategy(), new String[]{methodNameToMock}, null,
... | java | public static synchronized <T> T createPartialMock(Class<T> type, String methodNameToMock,
Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
return doMockSpecific(type, new DefaultMockStrategy(), new String[]{methodNameToMock}, null,
... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createPartialMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodNameToMock",
",",
"Class",
"<",
"?",
">",
"firstArgumentType",
",",
"Class",
"<",
"?",
">",
"...",
"additionalArgumentType... | Mock a single specific method. Use this to handle overloaded methods.
@param <T> The type of the mock.
@param type The type that'll be used to create a mock instance.
@param methodNameToMock The name of the method to mock
@param firstArgumentType The type of the firs... | [
"Mock",
"a",
"single",
"specific",
"method",
".",
"Use",
"this",
"to",
"handle",
"overloaded",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L467-L471 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.isPrefixPath | public static boolean isPrefixPath(String firstPath, String secondPath) {
firstPath = CmsStringUtil.joinPaths(firstPath, "/");
secondPath = CmsStringUtil.joinPaths(secondPath, "/");
return secondPath.startsWith(firstPath);
} | java | public static boolean isPrefixPath(String firstPath, String secondPath) {
firstPath = CmsStringUtil.joinPaths(firstPath, "/");
secondPath = CmsStringUtil.joinPaths(secondPath, "/");
return secondPath.startsWith(firstPath);
} | [
"public",
"static",
"boolean",
"isPrefixPath",
"(",
"String",
"firstPath",
",",
"String",
"secondPath",
")",
"{",
"firstPath",
"=",
"CmsStringUtil",
".",
"joinPaths",
"(",
"firstPath",
",",
"\"/\"",
")",
";",
"secondPath",
"=",
"CmsStringUtil",
".",
"joinPaths",... | Checks if the first path is a prefix of the second path.<p>
This method is different compared to {@link String#startsWith},
because it considers <code>/foo/bar</code> to
be a prefix path of <code>/foo/bar/baz</code>,
but not of <code>/foo/bar42</code>.
<b>Directly exposed for JSP EL</b>, not through {@link org.opencm... | [
"Checks",
"if",
"the",
"first",
"path",
"is",
"a",
"prefix",
"of",
"the",
"second",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L1099-L1104 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java | InstanceClient.setTagsInstance | @BetaApi
public final Operation setTagsInstance(ProjectZoneInstanceName instance, Tags tagsResource) {
SetTagsInstanceHttpRequest request =
SetTagsInstanceHttpRequest.newBuilder()
.setInstance(instance == null ? null : instance.toString())
.setTagsResource(tagsResource)
... | java | @BetaApi
public final Operation setTagsInstance(ProjectZoneInstanceName instance, Tags tagsResource) {
SetTagsInstanceHttpRequest request =
SetTagsInstanceHttpRequest.newBuilder()
.setInstance(instance == null ? null : instance.toString())
.setTagsResource(tagsResource)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"setTagsInstance",
"(",
"ProjectZoneInstanceName",
"instance",
",",
"Tags",
"tagsResource",
")",
"{",
"SetTagsInstanceHttpRequest",
"request",
"=",
"SetTagsInstanceHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setInstan... | Sets network tags for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
Tags tagsResource = Tags.newBuilder().build(... | [
"Sets",
"network",
"tags",
"for",
"the",
"specified",
"instance",
"to",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java#L3132-L3141 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java | TaskGroup.invokeAfterPostRunAsync | private Observable<Indexable> invokeAfterPostRunAsync(final TaskGroupEntry<TaskItem> entry,
final InvocationContext context) {
return Observable.defer(new Func0<Observable<Indexable>>() {
@Override
public Observable<Indexable> cal... | java | private Observable<Indexable> invokeAfterPostRunAsync(final TaskGroupEntry<TaskItem> entry,
final InvocationContext context) {
return Observable.defer(new Func0<Observable<Indexable>>() {
@Override
public Observable<Indexable> cal... | [
"private",
"Observable",
"<",
"Indexable",
">",
"invokeAfterPostRunAsync",
"(",
"final",
"TaskGroupEntry",
"<",
"TaskItem",
">",
"entry",
",",
"final",
"InvocationContext",
"context",
")",
"{",
"return",
"Observable",
".",
"defer",
"(",
"new",
"Func0",
"<",
"Obs... | Invokes the {@link TaskItem#invokeAfterPostRunAsync(boolean)} method of an actual TaskItem
if the given entry holds a ProxyTaskItem.
@param entry the entry holding a ProxyTaskItem
@param context a group level shared context
@return An Observable that represents asynchronous work started by
{@link TaskItem#invokeAfter... | [
"Invokes",
"the",
"{",
"@link",
"TaskItem#invokeAfterPostRunAsync",
"(",
"boolean",
")",
"}",
"method",
"of",
"an",
"actual",
"TaskItem",
"if",
"the",
"given",
"entry",
"holds",
"a",
"ProxyTaskItem",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java#L433-L471 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/FontUtils.java | FontUtils.getFont | public static Font getFont (int style, Size size) {
return getFont(getDefaultFont(), size).deriveFont(style);
} | java | public static Font getFont (int style, Size size) {
return getFont(getDefaultFont(), size).deriveFont(style);
} | [
"public",
"static",
"Font",
"getFont",
"(",
"int",
"style",
",",
"Size",
"size",
")",
"{",
"return",
"getFont",
"(",
"getDefaultFont",
"(",
")",
",",
"size",
")",
".",
"deriveFont",
"(",
"style",
")",
";",
"}"
] | Gets the default font with the specified style and size, correctly scaled
@param style
@param size
@return | [
"Gets",
"the",
"default",
"font",
"with",
"the",
"specified",
"style",
"and",
"size",
"correctly",
"scaled"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/FontUtils.java#L179-L181 |
jenkinsci/jenkins | core/src/main/java/hudson/model/LargeText.java | LargeText.doProgressText | public void doProgressText(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("text/plain");
rsp.setStatus(HttpServletResponse.SC_OK);
if(!source.exists()) {
// file doesn't exist yet
rsp.addHeader("X-Text-Size","0");
rsp.addHead... | java | public void doProgressText(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("text/plain");
rsp.setStatus(HttpServletResponse.SC_OK);
if(!source.exists()) {
// file doesn't exist yet
rsp.addHeader("X-Text-Size","0");
rsp.addHead... | [
"public",
"void",
"doProgressText",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
"{",
"rsp",
".",
"setContentType",
"(",
"\"text/plain\"",
")",
";",
"rsp",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_OK",
... | Implements the progressive text handling.
This method is used as a "web method" with progressiveText.jelly. | [
"Implements",
"the",
"progressive",
"text",
"handling",
".",
"This",
"method",
"is",
"used",
"as",
"a",
"web",
"method",
"with",
"progressiveText",
".",
"jelly",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/LargeText.java#L178-L213 |
perwendel/spark | src/main/java/spark/staticfiles/StaticFilesConfiguration.java | StaticFilesConfiguration.configureExternal | public synchronized void configureExternal(String folder) {
Assert.notNull(folder, "'folder' must not be null");
if (!externalStaticResourcesSet) {
try {
ExternalResource resource = new ExternalResource(folder);
if (!resource.getFile().isDirectory()) {
... | java | public synchronized void configureExternal(String folder) {
Assert.notNull(folder, "'folder' must not be null");
if (!externalStaticResourcesSet) {
try {
ExternalResource resource = new ExternalResource(folder);
if (!resource.getFile().isDirectory()) {
... | [
"public",
"synchronized",
"void",
"configureExternal",
"(",
"String",
"folder",
")",
"{",
"Assert",
".",
"notNull",
"(",
"folder",
",",
"\"'folder' must not be null\"",
")",
";",
"if",
"(",
"!",
"externalStaticResourcesSet",
")",
"{",
"try",
"{",
"ExternalResource... | Configures location for static resources
@param folder the location | [
"Configures",
"location",
"for",
"static",
"resources"
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/staticfiles/StaticFilesConfiguration.java#L160-L182 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java | LoggerOnThread.renameFile | private void renameFile(File source, File target) {
if (!source.exists()) {
// don't do anything if the source file doesn't exist
return;
}
if (target.exists()) {
target.delete();
}
boolean rc = source.renameTo(target);
if (!rc) {
... | java | private void renameFile(File source, File target) {
if (!source.exists()) {
// don't do anything if the source file doesn't exist
return;
}
if (target.exists()) {
target.delete();
}
boolean rc = source.renameTo(target);
if (!rc) {
... | [
"private",
"void",
"renameFile",
"(",
"File",
"source",
",",
"File",
"target",
")",
"{",
"if",
"(",
"!",
"source",
".",
"exists",
"(",
")",
")",
"{",
"// don't do anything if the source file doesn't exist",
"return",
";",
"}",
"if",
"(",
"target",
".",
"exis... | Rename the source file into the target file, deleting the target if
necessary.
@param source
@param target | [
"Rename",
"the",
"source",
"file",
"into",
"the",
"target",
"file",
"deleting",
"the",
"target",
"if",
"necessary",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java#L347-L361 |
Netflix/spectator | spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/Evaluator.java | Evaluator.addGroupSubscriptions | public Evaluator addGroupSubscriptions(String group, List<Subscription> subs) {
List<Subscription> oldSubs = subscriptions.put(group, subs);
if (oldSubs == null) {
LOGGER.debug("added group {} with {} subscriptions", group, subs.size());
} else {
LOGGER.debug("updated group {}, {} subscriptions ... | java | public Evaluator addGroupSubscriptions(String group, List<Subscription> subs) {
List<Subscription> oldSubs = subscriptions.put(group, subs);
if (oldSubs == null) {
LOGGER.debug("added group {} with {} subscriptions", group, subs.size());
} else {
LOGGER.debug("updated group {}, {} subscriptions ... | [
"public",
"Evaluator",
"addGroupSubscriptions",
"(",
"String",
"group",
",",
"List",
"<",
"Subscription",
">",
"subs",
")",
"{",
"List",
"<",
"Subscription",
">",
"oldSubs",
"=",
"subscriptions",
".",
"put",
"(",
"group",
",",
"subs",
")",
";",
"if",
"(",
... | Add subscriptions for a given group.
@param group
Name of the group. At Netflix this is typically the cluster that includes
the instance reporting data.
@param subs
Set of subscriptions for the group.
@return
This instance for chaining of update operations. | [
"Add",
"subscriptions",
"for",
"a",
"given",
"group",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/Evaluator.java#L69-L78 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/util/SearchHelper.java | SearchHelper.setFilterExists | public void setFilterExists( final Set<String> attributeNames )
{
final StringBuilder sb = new StringBuilder();
sb.append( "(&" );
for ( final String name : attributeNames )
{
sb.append( "(" );
sb.append( new FilterSequence( name, "*", FilterSequence.Matching... | java | public void setFilterExists( final Set<String> attributeNames )
{
final StringBuilder sb = new StringBuilder();
sb.append( "(&" );
for ( final String name : attributeNames )
{
sb.append( "(" );
sb.append( new FilterSequence( name, "*", FilterSequence.Matching... | [
"public",
"void",
"setFilterExists",
"(",
"final",
"Set",
"<",
"String",
">",
"attributeNames",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"(&\"",
")",
";",
"for",
"(",
"final",
"Stri... | Set up an exists filter for attribute name. Consider the following example.
<table border="1"><caption>Example Values</caption>
<tr><td><b>Value</b></td></tr>
<tr><td>givenName</td></tr>
<tr><td>sn</td></tr>
</table>
<p><i>Result</i></p>
<code>(&(givenName=*)(sn=*))</code>
@param attributeNames A valid set of at... | [
"Set",
"up",
"an",
"exists",
"filter",
"for",
"attribute",
"name",
".",
"Consider",
"the",
"following",
"example",
"."
] | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/util/SearchHelper.java#L545-L560 |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java | AbstractConfigObject.peekPath | AbstractConfigValue peekPath(Path path) {
try {
return peekPath(this, path, null);
} catch (NotPossibleToResolve e) {
throw new BugOrBroken(
"NotPossibleToResolve happened though we had no ResolveContext in peekPath");
}
} | java | AbstractConfigValue peekPath(Path path) {
try {
return peekPath(this, path, null);
} catch (NotPossibleToResolve e) {
throw new BugOrBroken(
"NotPossibleToResolve happened though we had no ResolveContext in peekPath");
}
} | [
"AbstractConfigValue",
"peekPath",
"(",
"Path",
"path",
")",
"{",
"try",
"{",
"return",
"peekPath",
"(",
"this",
",",
"path",
",",
"null",
")",
";",
"}",
"catch",
"(",
"NotPossibleToResolve",
"e",
")",
"{",
"throw",
"new",
"BugOrBroken",
"(",
"\"NotPossibl... | Looks up the path. Doesn't do any resolution, will throw if any is
needed. | [
"Looks",
"up",
"the",
"path",
".",
"Doesn",
"t",
"do",
"any",
"resolution",
"will",
"throw",
"if",
"any",
"is",
"needed",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java#L103-L110 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Util.java | Util.toByteArray | public static byte[] toByteArray(String value) {
if (value == null) {
return null;
}
try {
CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder().onMalformedInput(CodingErrorAction.REPORT)
.onUnmappableCharacter(CodingErrorAction.REPORT);
... | java | public static byte[] toByteArray(String value) {
if (value == null) {
return null;
}
try {
CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder().onMalformedInput(CodingErrorAction.REPORT)
.onUnmappableCharacter(CodingErrorAction.REPORT);
... | [
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"CharsetEncoder",
"encoder",
"=",
"Charset",
".",
"forName",
"(",
"\"UTF-8\"",
")... | Encodes the given string in UTF-8.
@param value
the string to encode.
@return A newly allocated array containing the encoding result. | [
"Encodes",
"the",
"given",
"string",
"in",
"UTF",
"-",
"8",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Util.java#L164-L180 |
apache/incubator-heron | heron/api/src/java/org/apache/heron/api/windowing/WindowManager.java | WindowManager.restoreState | @SuppressWarnings("unchecked")
public void restoreState(Map<String, Serializable> state) {
LOG.info("Restoring window manager state");
//restore eviction policy state
if (state.get(EVICTION_STATE_KEY) != null) {
((EvictionPolicy) evictionPolicy).restoreState(state.get(EVICTION_STATE_KEY));
}
... | java | @SuppressWarnings("unchecked")
public void restoreState(Map<String, Serializable> state) {
LOG.info("Restoring window manager state");
//restore eviction policy state
if (state.get(EVICTION_STATE_KEY) != null) {
((EvictionPolicy) evictionPolicy).restoreState(state.get(EVICTION_STATE_KEY));
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"restoreState",
"(",
"Map",
"<",
"String",
",",
"Serializable",
">",
"state",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Restoring window manager state\"",
")",
";",
"//restore eviction policy state",
... | Restore state associated with the window manager
@param state | [
"Restore",
"state",
"associated",
"with",
"the",
"window",
"manager"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/api/windowing/WindowManager.java#L315-L340 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.createHttpRequestFromHttp2Headers | public static HttpRequest createHttpRequestFromHttp2Headers(Http2Headers http2Headers, int streamId)
throws Http2Exception {
String method = Constants.HTTP_GET_METHOD;
if (http2Headers.method() != null) {
method = http2Headers.getAndRemove(Constants.HTTP2_METHOD).toString();
... | java | public static HttpRequest createHttpRequestFromHttp2Headers(Http2Headers http2Headers, int streamId)
throws Http2Exception {
String method = Constants.HTTP_GET_METHOD;
if (http2Headers.method() != null) {
method = http2Headers.getAndRemove(Constants.HTTP2_METHOD).toString();
... | [
"public",
"static",
"HttpRequest",
"createHttpRequestFromHttp2Headers",
"(",
"Http2Headers",
"http2Headers",
",",
"int",
"streamId",
")",
"throws",
"Http2Exception",
"{",
"String",
"method",
"=",
"Constants",
".",
"HTTP_GET_METHOD",
";",
"if",
"(",
"http2Headers",
"."... | Creates a {@link HttpRequest} using a {@link Http2Headers} received over a particular HTTP/2 stream.
@param http2Headers the Http2Headers received over a HTTP/2 stream
@param streamId the stream id
@return the HttpRequest formed using the HttpHeaders
@throws Http2Exception if an error occurs while converting heade... | [
"Creates",
"a",
"{",
"@link",
"HttpRequest",
"}",
"using",
"a",
"{",
"@link",
"Http2Headers",
"}",
"received",
"over",
"a",
"particular",
"HTTP",
"/",
"2",
"stream",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L244-L265 |
phxql/argon2-jvm | src/main/java/de/mkammerer/argon2/Argon2Factory.java | Argon2Factory.createAdvanced | public static Argon2Advanced createAdvanced(Argon2Types type) {
return createInternal(type, Argon2Constants.DEFAULT_SALT_LENGTH, Argon2Constants.DEFAULT_HASH_LENGTH);
} | java | public static Argon2Advanced createAdvanced(Argon2Types type) {
return createInternal(type, Argon2Constants.DEFAULT_SALT_LENGTH, Argon2Constants.DEFAULT_HASH_LENGTH);
} | [
"public",
"static",
"Argon2Advanced",
"createAdvanced",
"(",
"Argon2Types",
"type",
")",
"{",
"return",
"createInternal",
"(",
"type",
",",
"Argon2Constants",
".",
"DEFAULT_SALT_LENGTH",
",",
"Argon2Constants",
".",
"DEFAULT_HASH_LENGTH",
")",
";",
"}"
] | Creates a new {@link Argon2Advanced} instance with the given type.
@param type Argon2 type.
@return Argon2Advanced instance. | [
"Creates",
"a",
"new",
"{",
"@link",
"Argon2Advanced",
"}",
"instance",
"with",
"the",
"given",
"type",
"."
] | train | https://github.com/phxql/argon2-jvm/blob/27a13907729e67e98cca53eba279e109b60f04f1/src/main/java/de/mkammerer/argon2/Argon2Factory.java#L71-L73 |
h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.invokeAll | public static void invokeAll(ForkJoinTask<?> t1, ForkJoinTask<?> t2) {
int s1, s2;
t2.fork();
if ((s1 = t1.doInvoke() & DONE_MASK) != NORMAL)
t1.reportException(s1);
if ((s2 = t2.doJoin() & DONE_MASK) != NORMAL)
t2.reportException(s2);
} | java | public static void invokeAll(ForkJoinTask<?> t1, ForkJoinTask<?> t2) {
int s1, s2;
t2.fork();
if ((s1 = t1.doInvoke() & DONE_MASK) != NORMAL)
t1.reportException(s1);
if ((s2 = t2.doJoin() & DONE_MASK) != NORMAL)
t2.reportException(s2);
} | [
"public",
"static",
"void",
"invokeAll",
"(",
"ForkJoinTask",
"<",
"?",
">",
"t1",
",",
"ForkJoinTask",
"<",
"?",
">",
"t2",
")",
"{",
"int",
"s1",
",",
"s2",
";",
"t2",
".",
"fork",
"(",
")",
";",
"if",
"(",
"(",
"s1",
"=",
"t1",
".",
"doInvok... | Forks the given tasks, returning when {@code isDone} holds for
each task or an (unchecked) exception is encountered, in which
case the exception is rethrown. If more than one task
encounters an exception, then this method throws any one of
these exceptions. If any task encounters an exception, the
other may be cancelle... | [
"Forks",
"the",
"given",
"tasks",
"returning",
"when",
"{",
"@code",
"isDone",
"}",
"holds",
"for",
"each",
"task",
"or",
"an",
"(",
"unchecked",
")",
"exception",
"is",
"encountered",
"in",
"which",
"case",
"the",
"exception",
"is",
"rethrown",
".",
"If",... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L700-L707 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_u2f_POST | public OvhU2FRegisterChallenge accessRestriction_u2f_POST() throws IOException {
String qPath = "/me/accessRestriction/u2f";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhU2FRegisterChallenge.class);
} | java | public OvhU2FRegisterChallenge accessRestriction_u2f_POST() throws IOException {
String qPath = "/me/accessRestriction/u2f";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhU2FRegisterChallenge.class);
} | [
"public",
"OvhU2FRegisterChallenge",
"accessRestriction_u2f_POST",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/u2f\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"exec",
"(",
... | Add a U2F access restriction
REST: POST /me/accessRestriction/u2f | [
"Add",
"a",
"U2F",
"access",
"restriction"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L4166-L4171 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java | ScopedServletUtils.renameScope | public static void renameScope( Object oldScopeKey, Object newScopeKey, HttpServletRequest request )
{
assert ! ( request instanceof ScopedRequest );
String requestAttr = getScopedName( OVERRIDE_REQUEST_ATTR, oldScopeKey );
String responseAttr = getScopedName( OVERRIDE_RESPONSE_ATTR... | java | public static void renameScope( Object oldScopeKey, Object newScopeKey, HttpServletRequest request )
{
assert ! ( request instanceof ScopedRequest );
String requestAttr = getScopedName( OVERRIDE_REQUEST_ATTR, oldScopeKey );
String responseAttr = getScopedName( OVERRIDE_RESPONSE_ATTR... | [
"public",
"static",
"void",
"renameScope",
"(",
"Object",
"oldScopeKey",
",",
"Object",
"newScopeKey",
",",
"HttpServletRequest",
"request",
")",
"{",
"assert",
"!",
"(",
"request",
"instanceof",
"ScopedRequest",
")",
";",
"String",
"requestAttr",
"=",
"getScopedN... | Find all scoped objects ({@link ScopedRequest}, {@link ScopedResponse})
which have a certain scope-key, replaces this scope-key with the new one, and re-caches the objects
the new scope-key.
@param oldScopeKey
@param newScopeKey
@param request the real (outer) request, where the scoped objects are cached. | [
"Find",
"all",
"scoped",
"objects",
"(",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L147-L174 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_game_ipOnGame_rule_POST | public OvhGameMitigationRule ip_game_ipOnGame_rule_POST(String ip, String ipOnGame, OvhRange<Long> ports, OvhGameMitigationRuleProtocolEnum protocol) throws IOException {
String qPath = "/ip/{ip}/game/{ipOnGame}/rule";
StringBuilder sb = path(qPath, ip, ipOnGame);
HashMap<String, Object>o = new HashMap<String, Ob... | java | public OvhGameMitigationRule ip_game_ipOnGame_rule_POST(String ip, String ipOnGame, OvhRange<Long> ports, OvhGameMitigationRuleProtocolEnum protocol) throws IOException {
String qPath = "/ip/{ip}/game/{ipOnGame}/rule";
StringBuilder sb = path(qPath, ip, ipOnGame);
HashMap<String, Object>o = new HashMap<String, Ob... | [
"public",
"OvhGameMitigationRule",
"ip_game_ipOnGame_rule_POST",
"(",
"String",
"ip",
",",
"String",
"ipOnGame",
",",
"OvhRange",
"<",
"Long",
">",
"ports",
",",
"OvhGameMitigationRuleProtocolEnum",
"protocol",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"="... | Add new rule on your IP
REST: POST /ip/{ip}/game/{ipOnGame}/rule
@param protocol [required] The protocol running behind the given port
@param ports [required] The UDP port range to apply the rule on
@param ip [required]
@param ipOnGame [required] | [
"Add",
"new",
"rule",
"on",
"your",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L374-L382 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ExpressionUtil.java | ExpressionUtil.guessParameterType | private static String guessParameterType(Database db, VoltXMLElement elm) {
if (! isParameterized(elm) || ! elm.name.equals("operation")) {
return "";
} else {
final ExpressionType op = mapOfVoltXMLOpType.get(elm.attributes.get("optype"));
assert op != null;
... | java | private static String guessParameterType(Database db, VoltXMLElement elm) {
if (! isParameterized(elm) || ! elm.name.equals("operation")) {
return "";
} else {
final ExpressionType op = mapOfVoltXMLOpType.get(elm.attributes.get("optype"));
assert op != null;
... | [
"private",
"static",
"String",
"guessParameterType",
"(",
"Database",
"db",
",",
"VoltXMLElement",
"elm",
")",
"{",
"if",
"(",
"!",
"isParameterized",
"(",
"elm",
")",
"||",
"!",
"elm",
".",
"name",
".",
"equals",
"(",
"\"operation\"",
")",
")",
"{",
"re... | Guess from a parent node what are the parameter type of its child node, should one of its child node
contain parameter.
@param db catalog
@param elm node under inspection
@return string representation of the type of its child node. | [
"Guess",
"from",
"a",
"parent",
"node",
"what",
"are",
"the",
"parameter",
"type",
"of",
"its",
"child",
"node",
"should",
"one",
"of",
"its",
"child",
"node",
"contain",
"parameter",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L149-L185 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/KeyTable.java | KeyTable.getNodeSetDTMByKey | public XNodeSet getNodeSetDTMByKey(QName name, XMLString ref)
{
XNodeSet refNodes = (XNodeSet) getRefsTable().get(ref);
// clone wiht reset the node set
try
{
if (refNodes != null)
{
refNodes = (XNodeSet) refNodes.cloneWithReset();
}
}
catch (CloneNotSupportedExcept... | java | public XNodeSet getNodeSetDTMByKey(QName name, XMLString ref)
{
XNodeSet refNodes = (XNodeSet) getRefsTable().get(ref);
// clone wiht reset the node set
try
{
if (refNodes != null)
{
refNodes = (XNodeSet) refNodes.cloneWithReset();
}
}
catch (CloneNotSupportedExcept... | [
"public",
"XNodeSet",
"getNodeSetDTMByKey",
"(",
"QName",
"name",
",",
"XMLString",
"ref",
")",
"{",
"XNodeSet",
"refNodes",
"=",
"(",
"XNodeSet",
")",
"getRefsTable",
"(",
")",
".",
"get",
"(",
"ref",
")",
";",
"// clone wiht reset the node set",
"try",
"{",
... | Given a valid element key, return the corresponding node list.
@param name The name of the key, which must match the 'name' attribute on xsl:key.
@param ref The value that must match the value found by the 'match' attribute on xsl:key.
@return a set of nodes referenced by the key named <CODE>name</CODE> and the refere... | [
"Given",
"a",
"valid",
"element",
"key",
"return",
"the",
"corresponding",
"node",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/KeyTable.java#L115-L145 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/BucketPath.java | BucketPath.replaceShorthand | @Deprecated
public static String replaceShorthand(char c, Map<String, String> headers) {
return replaceShorthand(c, headers, false, 0, 0);
} | java | @Deprecated
public static String replaceShorthand(char c, Map<String, String> headers) {
return replaceShorthand(c, headers, false, 0, 0);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"replaceShorthand",
"(",
"char",
"c",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"return",
"replaceShorthand",
"(",
"c",
",",
"headers",
",",
"false",
",",
"0",
",",
"0",
")",
";... | Hardcoded lookups for %x style escape replacement. Add your own!
All shorthands are Date format strings, currently.
Returns the empty string if an escape is not recognized.
Dates follow the same format as unix date, with a few exceptions.
<p>This static method will be REMOVED in a future version of Flume</p> | [
"Hardcoded",
"lookups",
"for",
"%x",
"style",
"escape",
"replacement",
".",
"Add",
"your",
"own!"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/BucketPath.java#L124-L127 |
dbracewell/mango | src/main/java/com/davidbracewell/string/StringUtils.java | StringUtils.randomString | public static String randomString(int length, @NonNull CharMatcher validChar) {
return randomString(length, 0, Integer.MAX_VALUE, validChar);
} | java | public static String randomString(int length, @NonNull CharMatcher validChar) {
return randomString(length, 0, Integer.MAX_VALUE, validChar);
} | [
"public",
"static",
"String",
"randomString",
"(",
"int",
"length",
",",
"@",
"NonNull",
"CharMatcher",
"validChar",
")",
"{",
"return",
"randomString",
"(",
"length",
",",
"0",
",",
"Integer",
".",
"MAX_VALUE",
",",
"validChar",
")",
";",
"}"
] | Generates a random string of a given length
@param length The length of the string
@param validChar CharPredicate that must match for a character to be returned in the string
@return A string of random characters | [
"Generates",
"a",
"random",
"string",
"of",
"a",
"given",
"length"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L388-L390 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/core/launching/VdmLaunchConfigurationDelegate.java | VdmLaunchConfigurationDelegate.prepareCustomOvertureProperties | public static File prepareCustomOvertureProperties(IVdmProject project,
ILaunchConfiguration configuration) throws CoreException
{
List<String> properties = new Vector<String>();
if (VdmDebugPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DBGP_ENABLE_EXPERIMENTAL_MODELCHECKER... | java | public static File prepareCustomOvertureProperties(IVdmProject project,
ILaunchConfiguration configuration) throws CoreException
{
List<String> properties = new Vector<String>();
if (VdmDebugPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DBGP_ENABLE_EXPERIMENTAL_MODELCHECKER... | [
"public",
"static",
"File",
"prepareCustomOvertureProperties",
"(",
"IVdmProject",
"project",
",",
"ILaunchConfiguration",
"configuration",
")",
"throws",
"CoreException",
"{",
"List",
"<",
"String",
">",
"properties",
"=",
"new",
"Vector",
"<",
"String",
">",
"(",
... | Create the custom overture.properties file loaded by the debugger
@param project
@param configuration a configuration or null
@return
@throws CoreException | [
"Create",
"the",
"custom",
"overture",
".",
"properties",
"file",
"loaded",
"by",
"the",
"debugger"
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/core/launching/VdmLaunchConfigurationDelegate.java#L370-L381 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.