repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
scalecube/socketio | src/main/java/io/scalecube/socketio/SocketIOServer.java | SocketIOServer.newInstance | public static SocketIOServer newInstance(int port, SslContext sslContext) {
"""
Creates instance of Socket.IO server with the given secure port.
"""
return new SocketIOServer(ServerConfiguration.builder()
.port(port)
.sslContext(sslContext)
.build());
} | java | public static SocketIOServer newInstance(int port, SslContext sslContext) {
return new SocketIOServer(ServerConfiguration.builder()
.port(port)
.sslContext(sslContext)
.build());
} | [
"public",
"static",
"SocketIOServer",
"newInstance",
"(",
"int",
"port",
",",
"SslContext",
"sslContext",
")",
"{",
"return",
"new",
"SocketIOServer",
"(",
"ServerConfiguration",
".",
"builder",
"(",
")",
".",
"port",
"(",
"port",
")",
".",
"sslContext",
"(",
... | Creates instance of Socket.IO server with the given secure port. | [
"Creates",
"instance",
"of",
"Socket",
".",
"IO",
"server",
"with",
"the",
"given",
"secure",
"port",
"."
] | train | https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/SocketIOServer.java#L83-L88 |
samskivert/pythagoras | src/main/java/pythagoras/d/Points.java | Points.pointToString | public static String pointToString (double x, double y) {
"""
Returns a string describing the supplied point, of the form <code>+x+y</code>,
<code>+x-y</code>, <code>-x-y</code>, etc.
"""
return MathUtil.toString(x) + MathUtil.toString(y);
} | java | public static String pointToString (double x, double y) {
return MathUtil.toString(x) + MathUtil.toString(y);
} | [
"public",
"static",
"String",
"pointToString",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"MathUtil",
".",
"toString",
"(",
"x",
")",
"+",
"MathUtil",
".",
"toString",
"(",
"y",
")",
";",
"}"
] | Returns a string describing the supplied point, of the form <code>+x+y</code>,
<code>+x-y</code>, <code>-x-y</code>, etc. | [
"Returns",
"a",
"string",
"describing",
"the",
"supplied",
"point",
"of",
"the",
"form",
"<code",
">",
"+",
"x",
"+",
"y<",
"/",
"code",
">",
"<code",
">",
"+",
"x",
"-",
"y<",
"/",
"code",
">",
"<code",
">",
"-",
"x",
"-",
"y<",
"/",
"code",
"... | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Points.java#L77-L79 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.logDebug | @Deprecated
public static void logDebug(String tag, String message, Throwable t) {
"""
Convenience method for logging debug by the library
@param tag
@param message
@param t
@deprecated This will be removed in a later release. Use
{@link org.altbeacon.beacon.logging.LogManager#d(Throwable, String, Strin... | java | @Deprecated
public static void logDebug(String tag, String message, Throwable t) {
LogManager.d(t, tag, message);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"logDebug",
"(",
"String",
"tag",
",",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"LogManager",
".",
"d",
"(",
"t",
",",
"tag",
",",
"message",
")",
";",
"}"
] | Convenience method for logging debug by the library
@param tag
@param message
@param t
@deprecated This will be removed in a later release. Use
{@link org.altbeacon.beacon.logging.LogManager#d(Throwable, String, String, Object...)}
instead. | [
"Convenience",
"method",
"for",
"logging",
"debug",
"by",
"the",
"library"
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L1138-L1141 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/database/CursorUtils.java | CursorUtils.getLong | public static long getLong(Cursor cursor, String columnName) {
"""
Read the long data for the column.
@see android.database.Cursor#getLong(int).
@see android.database.Cursor#getColumnIndex(String).
@param cursor the cursor.
@param columnName the column name.
@return the long value.
"""
if (cursor ... | java | public static long getLong(Cursor cursor, String columnName) {
if (cursor == null) {
return -1;
}
return cursor.getLong(cursor.getColumnIndex(columnName));
} | [
"public",
"static",
"long",
"getLong",
"(",
"Cursor",
"cursor",
",",
"String",
"columnName",
")",
"{",
"if",
"(",
"cursor",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"cursor",
".",
"getLong",
"(",
"cursor",
".",
"getColumnIndex",
... | Read the long data for the column.
@see android.database.Cursor#getLong(int).
@see android.database.Cursor#getColumnIndex(String).
@param cursor the cursor.
@param columnName the column name.
@return the long value. | [
"Read",
"the",
"long",
"data",
"for",
"the",
"column",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/database/CursorUtils.java#L112-L118 |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/lookup/SoftDictionary.java | SoftDictionary.put | public void put(String id,String string,Object value) {
"""
Insert a string into the dictionary.
<p>Id is a special tag used to handle 'leave one out'
lookups. If you do a lookup on a string with a non-null
id, you get the closest matches that do not have the same
id.
"""
if (DEBUG && id!=null) System.... | java | public void put(String id,String string,Object value)
{
if (DEBUG && id!=null) System.out.println(id+":"+string+" => "+value);
put(id, new MyWrapper(string), value);
} | [
"public",
"void",
"put",
"(",
"String",
"id",
",",
"String",
"string",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"DEBUG",
"&&",
"id",
"!=",
"null",
")",
"System",
".",
"out",
".",
"println",
"(",
"id",
"+",
"\":\"",
"+",
"string",
"+",
"\" => \"... | Insert a string into the dictionary.
<p>Id is a special tag used to handle 'leave one out'
lookups. If you do a lookup on a string with a non-null
id, you get the closest matches that do not have the same
id. | [
"Insert",
"a",
"string",
"into",
"the",
"dictionary",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/lookup/SoftDictionary.java#L144-L148 |
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 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/ipc/RPC.java | RPC.getServer | public static Server getServer(final Object instance, final String bindAddress, final int port, Configuration conf)
throws IOException {
"""
Construct a server for a protocol implementation instance listening on a
port and address.
"""
return getServer(instance, bindAddress, port, 1, false, conf);
... | java | public static Server getServer(final Object instance, final String bindAddress, final int port, Configuration conf)
throws IOException {
return getServer(instance, bindAddress, port, 1, false, conf);
} | [
"public",
"static",
"Server",
"getServer",
"(",
"final",
"Object",
"instance",
",",
"final",
"String",
"bindAddress",
",",
"final",
"int",
"port",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"return",
"getServer",
"(",
"instance",
",",
"bi... | Construct a server for a protocol implementation instance listening on a
port and address. | [
"Construct",
"a",
"server",
"for",
"a",
"protocol",
"implementation",
"instance",
"listening",
"on",
"a",
"port",
"and",
"address",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/RPC.java#L716-L719 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java | CPMeasurementUnitPersistenceImpl.removeByG_T | @Override
public void removeByG_T(long groupId, int type) {
"""
Removes all the cp measurement units where groupId = ? and type = ? from the database.
@param groupId the group ID
@param type the type
"""
for (CPMeasurementUnit cpMeasurementUnit : findByG_T(groupId, type,
QueryUtil.ALL_POS, Q... | java | @Override
public void removeByG_T(long groupId, int type) {
for (CPMeasurementUnit cpMeasurementUnit : findByG_T(groupId, type,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpMeasurementUnit);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_T",
"(",
"long",
"groupId",
",",
"int",
"type",
")",
"{",
"for",
"(",
"CPMeasurementUnit",
"cpMeasurementUnit",
":",
"findByG_T",
"(",
"groupId",
",",
"type",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
"... | Removes all the cp measurement units where groupId = ? and type = ? from the database.
@param groupId the group ID
@param type the type | [
"Removes",
"all",
"the",
"cp",
"measurement",
"units",
"where",
"groupId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java#L2473-L2479 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.switchMapMaybe | @CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Flowable<R> switchMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends R>> mapper) {
"""
Maps the upstream items into {@link MaybeSource}s and switches (subsc... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Flowable<R> switchMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends R>> mapper) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
return ... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"UNBOUNDED_IN",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"R",
">",
"Flowable",
"<",
"R",
">",
"switchMapMaybe",
"(",
"@",
... | Maps the upstream items into {@link MaybeSource}s and switches (subscribes) to the newer ones
while disposing the older ones (and ignoring their signals) and emits the latest success value of the current one if
available while failing immediately if this {@code Flowable} or any of the
active inner {@code MaybeSource}s ... | [
"Maps",
"the",
"upstream",
"items",
"into",
"{"
] | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L14917-L14923 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/registry/MalisisRegistry.java | MalisisRegistry.onRenderBlock | @SideOnly(Side.CLIENT)
public static void onRenderBlock(IRenderBlockCallback callback, CallbackOption<IRenderBlockCallbackPredicate> option) {
"""
Registers a {@link IRenderBlockCallback} with the specified {@link CallbackOption} to be called when rendering blocks.
@param callback the callback
@param option t... | java | @SideOnly(Side.CLIENT)
public static void onRenderBlock(IRenderBlockCallback callback, CallbackOption<IRenderBlockCallbackPredicate> option)
{
renderBlockRegistry.registerCallback(callback, option);
} | [
"@",
"SideOnly",
"(",
"Side",
".",
"CLIENT",
")",
"public",
"static",
"void",
"onRenderBlock",
"(",
"IRenderBlockCallback",
"callback",
",",
"CallbackOption",
"<",
"IRenderBlockCallbackPredicate",
">",
"option",
")",
"{",
"renderBlockRegistry",
".",
"registerCallback"... | Registers a {@link IRenderBlockCallback} with the specified {@link CallbackOption} to be called when rendering blocks.
@param callback the callback
@param option the option | [
"Registers",
"a",
"{",
"@link",
"IRenderBlockCallback",
"}",
"with",
"the",
"specified",
"{",
"@link",
"CallbackOption",
"}",
"to",
"be",
"called",
"when",
"rendering",
"blocks",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/registry/MalisisRegistry.java#L162-L166 |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/Script.java | Script.getImportable | public BtrpOperand getImportable(String label, String namespace) {
"""
Get the exported operand from its label.
@param label the operand label
@param namespace the namespace of the script that ask for this operand.
@return the operand if exists or {@code null}
"""
if (canImport(label, namespac... | java | public BtrpOperand getImportable(String label, String namespace) {
if (canImport(label, namespace)) {
return exported.get(label);
}
return null;
} | [
"public",
"BtrpOperand",
"getImportable",
"(",
"String",
"label",
",",
"String",
"namespace",
")",
"{",
"if",
"(",
"canImport",
"(",
"label",
",",
"namespace",
")",
")",
"{",
"return",
"exported",
".",
"get",
"(",
"label",
")",
";",
"}",
"return",
"null"... | Get the exported operand from its label.
@param label the operand label
@param namespace the namespace of the script that ask for this operand.
@return the operand if exists or {@code null} | [
"Get",
"the",
"exported",
"operand",
"from",
"its",
"label",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L224-L229 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeVariableUtils.java | TypeVariableUtils.matchVariables | public static Map<TypeVariable, Type> matchVariables(final Type template, final Type real) {
"""
Match explicit variables ({@link ExplicitTypeVariable}) in type with provided type. For example, suppose
you have type {@code List<E>} (with {@link ExplicitTypeVariable} as E variable) and
real type {@code List<Strin... | java | public static Map<TypeVariable, Type> matchVariables(final Type template, final Type real) {
final MatchVariablesVisitor visitor = new MatchVariablesVisitor();
TypesWalker.walk(template, real, visitor);
if (visitor.isHierarchyError()) {
throw new IllegalArgumentException(String.forma... | [
"public",
"static",
"Map",
"<",
"TypeVariable",
",",
"Type",
">",
"matchVariables",
"(",
"final",
"Type",
"template",
",",
"final",
"Type",
"real",
")",
"{",
"final",
"MatchVariablesVisitor",
"visitor",
"=",
"new",
"MatchVariablesVisitor",
"(",
")",
";",
"Type... | Match explicit variables ({@link ExplicitTypeVariable}) in type with provided type. For example, suppose
you have type {@code List<E>} (with {@link ExplicitTypeVariable} as E variable) and
real type {@code List<String>}. This method will match variable E to String from real type.
<p>
WARNING: if provided template type ... | [
"Match",
"explicit",
"variables",
"(",
"{",
"@link",
"ExplicitTypeVariable",
"}",
")",
"in",
"type",
"with",
"provided",
"type",
".",
"For",
"example",
"suppose",
"you",
"have",
"type",
"{",
"@code",
"List<E",
">",
"}",
"(",
"with",
"{",
"@link",
"Explicit... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeVariableUtils.java#L98-L114 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java | MSPDIReader.readException | private void readException(ProjectCalendar bc, Project.Calendars.Calendar.Exceptions.Exception exception) {
"""
Read a single calendar exception.
@param bc parent calendar
@param exception exception data
"""
Date fromDate = exception.getTimePeriod().getFromDate();
Date toDate = exception.getTim... | java | private void readException(ProjectCalendar bc, Project.Calendars.Calendar.Exceptions.Exception exception)
{
Date fromDate = exception.getTimePeriod().getFromDate();
Date toDate = exception.getTimePeriod().getToDate();
// Vico Schedule Planner seems to write start and end dates to FromTime and ToTi... | [
"private",
"void",
"readException",
"(",
"ProjectCalendar",
"bc",
",",
"Project",
".",
"Calendars",
".",
"Calendar",
".",
"Exceptions",
".",
"Exception",
"exception",
")",
"{",
"Date",
"fromDate",
"=",
"exception",
".",
"getTimePeriod",
"(",
")",
".",
"getFrom... | Read a single calendar exception.
@param bc parent calendar
@param exception exception data | [
"Read",
"a",
"single",
"calendar",
"exception",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L604-L638 |
cfg4j/cfg4j | cfg4j-core/src/main/java/org/cfg4j/source/context/propertiesprovider/YamlBasedPropertiesProvider.java | YamlBasedPropertiesProvider.getProperties | @Override
public Properties getProperties(InputStream inputStream) {
"""
Get {@link Properties} for a given {@code inputStream} treating it as a YAML file.
@param inputStream input stream representing YAML file
@return properties representing values from {@code inputStream}
@throws IllegalStateException whe... | java | @Override
public Properties getProperties(InputStream inputStream) {
requireNonNull(inputStream);
Yaml yaml = new Yaml();
Properties properties = new Properties();
try (Reader reader = new UnicodeReader(inputStream)) {
Object object = yaml.load(reader);
if (object != null) {
M... | [
"@",
"Override",
"public",
"Properties",
"getProperties",
"(",
"InputStream",
"inputStream",
")",
"{",
"requireNonNull",
"(",
"inputStream",
")",
";",
"Yaml",
"yaml",
"=",
"new",
"Yaml",
"(",
")",
";",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",... | Get {@link Properties} for a given {@code inputStream} treating it as a YAML file.
@param inputStream input stream representing YAML file
@return properties representing values from {@code inputStream}
@throws IllegalStateException when unable to read properties | [
"Get",
"{",
"@link",
"Properties",
"}",
"for",
"a",
"given",
"{",
"@code",
"inputStream",
"}",
"treating",
"it",
"as",
"a",
"YAML",
"file",
"."
] | train | https://github.com/cfg4j/cfg4j/blob/47d4f63e5fc820c62631e557adc34a29d8ab396d/cfg4j-core/src/main/java/org/cfg4j/source/context/propertiesprovider/YamlBasedPropertiesProvider.java#L46-L68 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/ParallelMultiInstanceBehavior.java | ParallelMultiInstanceBehavior.createInstances | protected int createInstances(DelegateExecution execution) {
"""
Handles the parallel case of spawning the instances. Will create child executions accordingly for every instance needed.
"""
int nrOfInstances = resolveNrOfInstances(execution);
if (nrOfInstances < 0) {
throw new ActivitiIllegalArgu... | java | protected int createInstances(DelegateExecution execution) {
int nrOfInstances = resolveNrOfInstances(execution);
if (nrOfInstances < 0) {
throw new ActivitiIllegalArgumentException("Invalid number of instances: must be non-negative integer value" + ", but was " + nrOfInstances);
}
execution.setM... | [
"protected",
"int",
"createInstances",
"(",
"DelegateExecution",
"execution",
")",
"{",
"int",
"nrOfInstances",
"=",
"resolveNrOfInstances",
"(",
"execution",
")",
";",
"if",
"(",
"nrOfInstances",
"<",
"0",
")",
"{",
"throw",
"new",
"ActivitiIllegalArgumentException... | Handles the parallel case of spawning the instances. Will create child executions accordingly for every instance needed. | [
"Handles",
"the",
"parallel",
"case",
"of",
"spawning",
"the",
"instances",
".",
"Will",
"create",
"child",
"executions",
"accordingly",
"for",
"every",
"instance",
"needed",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/ParallelMultiInstanceBehavior.java#L52-L99 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/PropertyMetadata.java | PropertyMetadata.initializeMapper | private Mapper initializeMapper() {
"""
Initializes the {@link Mapper} for this field.
@return the {@link Mapper} for the field represented by this metadata
"""
try {
return MapperFactory.getInstance().getMapper(field);
} catch (NoSuitableMapperException exp) {
String message = String.fo... | 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 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileSet.java | TileSet.initTile | protected void initTile (Tile tile, int tileIndex, Colorization[] zations) {
"""
Initializes the supplied tile. Derived classes can override this method to add in their own
tile information, but should be sure to call <code>super.initTile()</code>.
@param tile the tile to initialize.
@param tileIndex the inde... | java | protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
{
if (_improv != null) {
tile.setImage(getTileMirage(tileIndex, zations));
}
} | [
"protected",
"void",
"initTile",
"(",
"Tile",
"tile",
",",
"int",
"tileIndex",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"if",
"(",
"_improv",
"!=",
"null",
")",
"{",
"tile",
".",
"setImage",
"(",
"getTileMirage",
"(",
"tileIndex",
",",
"zation... | Initializes the supplied tile. Derived classes can override this method to add in their own
tile information, but should be sure to call <code>super.initTile()</code>.
@param tile the tile to initialize.
@param tileIndex the index of the tile.
@param zations the colorizations to be used when generating the tile image. | [
"Initializes",
"the",
"supplied",
"tile",
".",
"Derived",
"classes",
"can",
"override",
"this",
"method",
"to",
"add",
"in",
"their",
"own",
"tile",
"information",
"but",
"should",
"be",
"sure",
"to",
"call",
"<code",
">",
"super",
".",
"initTile",
"()",
"... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileSet.java#L362-L367 |
prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java | DoubleAdder.fn | final long fn(long v, long x) {
"""
Update function. Note that we must use "long" for underlying
representations, because there is no compareAndSet for double,
due to the fact that the bitwise equals used in any CAS
implementation is not the same as double-precision equals.
However, we use CAS only to detect a... | java | final long fn(long v, long x) {
return Double.doubleToRawLongBits
(Double.longBitsToDouble(v) +
Double.longBitsToDouble(x));
} | [
"final",
"long",
"fn",
"(",
"long",
"v",
",",
"long",
"x",
")",
"{",
"return",
"Double",
".",
"doubleToRawLongBits",
"(",
"Double",
".",
"longBitsToDouble",
"(",
"v",
")",
"+",
"Double",
".",
"longBitsToDouble",
"(",
"x",
")",
")",
";",
"}"
] | Update function. Note that we must use "long" for underlying
representations, because there is no compareAndSet for double,
due to the fact that the bitwise equals used in any CAS
implementation is not the same as double-precision equals.
However, we use CAS only to detect and alleviate contention,
for which bitwise eq... | [
"Update",
"function",
".",
"Note",
"that",
"we",
"must",
"use",
"long",
"for",
"underlying",
"representations",
"because",
"there",
"is",
"no",
"compareAndSet",
"for",
"double",
"due",
"to",
"the",
"fact",
"that",
"the",
"bitwise",
"equals",
"used",
"in",
"a... | train | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java#L50-L54 |
actframework/actframework | src/main/java/act/ws/WebSocketConnectionRegistry.java | WebSocketConnectionRegistry.signOff | public void signOff(String key, Collection<WebSocketConnection> connections) {
"""
Sign off a group of connections from the registry by key
@param key
the key
@param connections
a collection of websocket connections
"""
if (connections.isEmpty()) {
return;
}
Concurrent... | java | public void signOff(String key, Collection<WebSocketConnection> connections) {
if (connections.isEmpty()) {
return;
}
ConcurrentMap<WebSocketConnection, WebSocketConnection> bag = ensureConnectionList(key);
bag.keySet().removeAll(connections);
} | [
"public",
"void",
"signOff",
"(",
"String",
"key",
",",
"Collection",
"<",
"WebSocketConnection",
">",
"connections",
")",
"{",
"if",
"(",
"connections",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"ConcurrentMap",
"<",
"WebSocketConnection",
","... | Sign off a group of connections from the registry by key
@param key
the key
@param connections
a collection of websocket connections | [
"Sign",
"off",
"a",
"group",
"of",
"connections",
"from",
"the",
"registry",
"by",
"key"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketConnectionRegistry.java#L243-L249 |
paymill/paymill-java | src/main/java/com/paymill/services/TransactionService.java | TransactionService.createWithPreauthorization | public Transaction createWithPreauthorization( String preauthorizationId, Integer amount, String currency, String description ) {
"""
Executes a {@link Transaction} with {@link Preauthorization} for the given amount in the given currency.
@param preauthorizationId
The Id of a {@link Preauthorization}, which has ... | java | public Transaction createWithPreauthorization( String preauthorizationId, Integer amount, String currency, String description ) {
ValidationUtils.validatesId( preauthorizationId );
ValidationUtils.validatesAmount( amount );
ValidationUtils.validatesCurrency( currency );
ParameterMap<String, String> par... | [
"public",
"Transaction",
"createWithPreauthorization",
"(",
"String",
"preauthorizationId",
",",
"Integer",
"amount",
",",
"String",
"currency",
",",
"String",
"description",
")",
"{",
"ValidationUtils",
".",
"validatesId",
"(",
"preauthorizationId",
")",
";",
"Valida... | Executes a {@link Transaction} with {@link Preauthorization} for the given amount in the given currency.
@param preauthorizationId
The Id of a {@link Preauthorization}, which has reserved some money from the client’s credit card.
@param amount
Amount (in cents) which will be charged.
@param currency
ISO 4217 formatted ... | [
"Executes",
"a",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/TransactionService.java#L385-L400 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java | HttpAuthServiceBuilder.addOAuth1a | public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) {
"""
Adds an OAuth1a {@link Authorizer} for the given {@code header}.
"""
return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")),
r... | java | public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) {
return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")),
requireNonNull(authorizer, "authorizer"));
} | [
"public",
"HttpAuthServiceBuilder",
"addOAuth1a",
"(",
"Authorizer",
"<",
"?",
"super",
"OAuth1aToken",
">",
"authorizer",
",",
"AsciiString",
"header",
")",
"{",
"return",
"addTokenAuthorizer",
"(",
"new",
"OAuth1aTokenExtractor",
"(",
"requireNonNull",
"(",
"header"... | Adds an OAuth1a {@link Authorizer} for the given {@code header}. | [
"Adds",
"an",
"OAuth1a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java#L101-L104 |
phax/ph-web | ph-xservlet/src/main/java/com/helger/xservlet/AbstractXServlet.java | AbstractXServlet.logInvalidRequestSetup | @OverrideOnDemand
protected void logInvalidRequestSetup (@Nonnull final String sMsg, @Nonnull final HttpServletRequest aHttpRequest) {
"""
This method logs errors, in case a HttpServletRequest object is missing basic
information or uses unsupported values for e.g. HTTP version and HTTP method.
@param sMsg
T... | java | @OverrideOnDemand
protected void logInvalidRequestSetup (@Nonnull final String sMsg, @Nonnull final HttpServletRequest aHttpRequest)
{
log (sMsg + ":\n" + RequestLogger.getRequestDebugString (aHttpRequest).toString ());
} | [
"@",
"OverrideOnDemand",
"protected",
"void",
"logInvalidRequestSetup",
"(",
"@",
"Nonnull",
"final",
"String",
"sMsg",
",",
"@",
"Nonnull",
"final",
"HttpServletRequest",
"aHttpRequest",
")",
"{",
"log",
"(",
"sMsg",
"+",
"\":\\n\"",
"+",
"RequestLogger",
".",
... | This method logs errors, in case a HttpServletRequest object is missing basic
information or uses unsupported values for e.g. HTTP version and HTTP method.
@param sMsg
The concrete message to emit. May not be <code>null</code>.
@param aHttpRequest
The current HTTP request. May not be <code>null</code>. | [
"This",
"method",
"logs",
"errors",
"in",
"case",
"a",
"HttpServletRequest",
"object",
"is",
"missing",
"basic",
"information",
"or",
"uses",
"unsupported",
"values",
"for",
"e",
".",
"g",
".",
"HTTP",
"version",
"and",
"HTTP",
"method",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-xservlet/src/main/java/com/helger/xservlet/AbstractXServlet.java#L419-L423 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/layout/BaseLayoutHelper.java | BaseLayoutHelper.layoutChildWithMargin | protected void layoutChildWithMargin(final View child, int left, int top, int right, int bottom, @NonNull LayoutManagerHelper helper) {
"""
Helper function which do layout children and also update layoutRegion
but it won't consider margin in layout, so you need take care of margin if you apply margin to your layo... | java | protected void layoutChildWithMargin(final View child, int left, int top, int right, int bottom, @NonNull LayoutManagerHelper helper) {
layoutChildWithMargin(child, left, top, right, bottom, helper, false);
} | [
"protected",
"void",
"layoutChildWithMargin",
"(",
"final",
"View",
"child",
",",
"int",
"left",
",",
"int",
"top",
",",
"int",
"right",
",",
"int",
"bottom",
",",
"@",
"NonNull",
"LayoutManagerHelper",
"helper",
")",
"{",
"layoutChildWithMargin",
"(",
"child"... | Helper function which do layout children and also update layoutRegion
but it won't consider margin in layout, so you need take care of margin if you apply margin to your layoutView
@param child child that will be laid
@param left left position
@param top top position
@param right right position
@param bottom bo... | [
"Helper",
"function",
"which",
"do",
"layout",
"children",
"and",
"also",
"update",
"layoutRegion",
"but",
"it",
"won",
"t",
"consider",
"margin",
"in",
"layout",
"so",
"you",
"need",
"take",
"care",
"of",
"margin",
"if",
"you",
"apply",
"margin",
"to",
"y... | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/layout/BaseLayoutHelper.java#L332-L334 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/hash/CompactingHashTable.java | CompactingHashTable.open | public void open() {
"""
Build the hash table
@throws IOException Thrown, if an I/O problem occurs while spilling a partition.
"""
// sanity checks
if (!this.closed.compareAndSet(true, false)) {
throw new IllegalStateException("Hash Table cannot be opened, because it is currently not closed.");
}
... | java | public void open() {
// sanity checks
if (!this.closed.compareAndSet(true, false)) {
throw new IllegalStateException("Hash Table cannot be opened, because it is currently not closed.");
}
// create the partitions
final int partitionFanOut = getPartitioningFanOutNoEstimates(this.availableMemory.size()); ... | [
"public",
"void",
"open",
"(",
")",
"{",
"// sanity checks",
"if",
"(",
"!",
"this",
".",
"closed",
".",
"compareAndSet",
"(",
"true",
",",
"false",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Hash Table cannot be opened, because it is currentl... | Build the hash table
@throws IOException Thrown, if an I/O problem occurs while spilling a partition. | [
"Build",
"the",
"hash",
"table"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/hash/CompactingHashTable.java#L276-L291 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/SplineColormap.java | SplineColormap.setKnotPosition | public void setKnotPosition(int n, int x) {
"""
Set a knot position.
@param n the knot index
@param x the knot position
"""
xKnots[n] = PixelUtils.clamp(x);
sortKnots();
rebuildGradient();
} | java | public void setKnotPosition(int n, int x) {
xKnots[n] = PixelUtils.clamp(x);
sortKnots();
rebuildGradient();
} | [
"public",
"void",
"setKnotPosition",
"(",
"int",
"n",
",",
"int",
"x",
")",
"{",
"xKnots",
"[",
"n",
"]",
"=",
"PixelUtils",
".",
"clamp",
"(",
"x",
")",
";",
"sortKnots",
"(",
")",
";",
"rebuildGradient",
"(",
")",
";",
"}"
] | Set a knot position.
@param n the knot index
@param x the knot position | [
"Set",
"a",
"knot",
"position",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/SplineColormap.java#L115-L119 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.create | @SuppressWarnings( {
"""
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 initializ... | 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 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mox/VirtualMachineDeviceManager.java | VirtualMachineDeviceManager.removeDevice | public Task removeDevice(VirtualDevice device, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException {
"""
Remove the device. Make sure the VM is powered ... | java | public Task removeDevice(VirtualDevice device, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException {
ArrayList<VirtualDevice> deviceList = new Array... | [
"public",
"Task",
"removeDevice",
"(",
"VirtualDevice",
"device",
",",
"boolean",
"destroyDeviceBacking",
")",
"throws",
"InvalidName",
",",
"VmConfigFault",
",",
"DuplicateName",
",",
"TaskInProgress",
",",
"FileFault",
",",
"InvalidState",
",",
"ConcurrentAccess",
"... | Remove the device. Make sure the VM is powered off before calling this method.
If destroyDeviceBacking is true, it deletes backings for example files in datastore. BE CAREFUL! | [
"Remove",
"the",
"device",
".",
"Make",
"sure",
"the",
"VM",
"is",
"powered",
"off",
"before",
"calling",
"this",
"method",
".",
"If",
"destroyDeviceBacking",
"is",
"true",
"it",
"deletes",
"backings",
"for",
"example",
"files",
"in",
"datastore",
".",
"BE",... | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mox/VirtualMachineDeviceManager.java#L673-L677 |
graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/Polygon.java | Polygon.contains | public boolean contains(double lat, double lon) {
"""
Implements the ray casting algorithm
Code is inspired from here: http://stackoverflow.com/a/218081/1548788
@param lat Latitude of the point to be checked
@param lon Longitude of the point to be checked
@return true if point is inside polygon
"""
... | java | public boolean contains(double lat, double lon) {
if (lat < minLat || lat > maxLat || lon < minLon || lon > maxLon) {
return false;
}
double rayStartLat = maxLat - (minLat / 2);
double rayStartLon = minLon - epsilon;
boolean inside = false;
int len = this.la... | [
"public",
"boolean",
"contains",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"if",
"(",
"lat",
"<",
"minLat",
"||",
"lat",
">",
"maxLat",
"||",
"lon",
"<",
"minLon",
"||",
"lon",
">",
"maxLon",
")",
"{",
"return",
"false",
";",
"}",
"doub... | Implements the ray casting algorithm
Code is inspired from here: http://stackoverflow.com/a/218081/1548788
@param lat Latitude of the point to be checked
@param lon Longitude of the point to be checked
@return true if point is inside polygon | [
"Implements",
"the",
"ray",
"casting",
"algorithm",
"Code",
"is",
"inspired",
"from",
"here",
":",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"218081",
"/",
"1548788"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/Polygon.java#L115-L131 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andContent | public Response andContent(String name, Object object) {
"""
Adds a value to the template that can be accessed using ${name} in the template
@param name The name of the value
@param object The actual value
@return A response object {@link io.mangoo.routing.Response}
"""
Objects.requireNonNull(name... | java | public Response andContent(String name, Object object) {
Objects.requireNonNull(name, Required.NAME.toString());
this.content.put(name, object);
return this;
} | [
"public",
"Response",
"andContent",
"(",
"String",
"name",
",",
"Object",
"object",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"name",
",",
"Required",
".",
"NAME",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"content",
".",
"put",
"(",
"na... | Adds a value to the template that can be accessed using ${name} in the template
@param name The name of the value
@param object The actual value
@return A response object {@link io.mangoo.routing.Response} | [
"Adds",
"a",
"value",
"to",
"the",
"template",
"that",
"can",
"be",
"accessed",
"using",
"$",
"{",
"name",
"}",
"in",
"the",
"template"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L270-L275 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/live/internal/AsteriskChannelImpl.java | AsteriskChannelImpl.nameChanged | void nameChanged(Date date, String name) {
"""
Changes the name of this channel.
@param date date of the name change.
@param name the new name of this channel.
"""
final String oldName = this.name;
if (oldName != null && oldName.equals(name))
{
return;
}
... | java | void nameChanged(Date date, String name)
{
final String oldName = this.name;
if (oldName != null && oldName.equals(name))
{
return;
}
this.name = name;
firePropertyChange(PROPERTY_NAME, oldName, name);
} | [
"void",
"nameChanged",
"(",
"Date",
"date",
",",
"String",
"name",
")",
"{",
"final",
"String",
"oldName",
"=",
"this",
".",
"name",
";",
"if",
"(",
"oldName",
"!=",
"null",
"&&",
"oldName",
".",
"equals",
"(",
"name",
")",
")",
"{",
"return",
";",
... | Changes the name of this channel.
@param date date of the name change.
@param name the new name of this channel. | [
"Changes",
"the",
"name",
"of",
"this",
"channel",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/live/internal/AsteriskChannelImpl.java#L239-L250 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java | AutoResizeTextView.onSizeChanged | @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
"""
If the text view size changed, set the force resize flag to true
"""
if (w != oldw || h != oldh) {
mNeedsResize = true;
}
} | java | @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
if (w != oldw || h != oldh) {
mNeedsResize = true;
}
} | [
"@",
"Override",
"protected",
"void",
"onSizeChanged",
"(",
"int",
"w",
",",
"int",
"h",
",",
"int",
"oldw",
",",
"int",
"oldh",
")",
"{",
"if",
"(",
"w",
"!=",
"oldw",
"||",
"h",
"!=",
"oldh",
")",
"{",
"mNeedsResize",
"=",
"true",
";",
"}",
"}"... | If the text view size changed, set the force resize flag to true | [
"If",
"the",
"text",
"view",
"size",
"changed",
"set",
"the",
"force",
"resize",
"flag",
"to",
"true"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L97-L102 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.matchFileInputWithServiceResponseAsync | public Observable<ServiceResponse<MatchResponse>> matchFileInputWithServiceResponseAsync(byte[] imageStream, MatchFileInputOptionalParameter matchFileInputOptionalParameter) {
"""
Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href="/doc... | java | public Observable<ServiceResponse<MatchResponse>> matchFileInputWithServiceResponseAsync(byte[] imageStream, MatchFileInputOptionalParameter matchFileInputOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and can... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"MatchResponse",
">",
">",
"matchFileInputWithServiceResponseAsync",
"(",
"byte",
"[",
"]",
"imageStream",
",",
"MatchFileInputOptionalParameter",
"matchFileInputOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"... | Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> API.
Returns ID and tags of matching image.<br/>
<br/>
Note: Refresh Index must be... | [
"Fuzzily",
"match",
"an",
"image",
"against",
"one",
"of",
"your",
"custom",
"Image",
"Lists",
".",
"You",
"can",
"create",
"and",
"manage",
"your",
"custom",
"image",
"lists",
"using",
"<",
";",
"a",
"href",
"=",
"/",
"docs",
"/",
"services",
"/",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1998-L2009 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.intFunction | public static <R> IntFunction<R> intFunction(CheckedIntFunction<R> function) {
"""
Wrap a {@link CheckedIntFunction} in a {@link IntFunction}.
<p>
Example:
<code><pre>
IntStream.of(1, 2, 3).mapToObj(Unchecked.intFunction(i -> {
if (i < 0)
throw new Exception("Only positive numbers allowed");
return "" ... | java | public static <R> IntFunction<R> intFunction(CheckedIntFunction<R> function) {
return intFunction(function, THROWABLE_TO_RUNTIME_EXCEPTION);
} | [
"public",
"static",
"<",
"R",
">",
"IntFunction",
"<",
"R",
">",
"intFunction",
"(",
"CheckedIntFunction",
"<",
"R",
">",
"function",
")",
"{",
"return",
"intFunction",
"(",
"function",
",",
"THROWABLE_TO_RUNTIME_EXCEPTION",
")",
";",
"}"
] | Wrap a {@link CheckedIntFunction} in a {@link IntFunction}.
<p>
Example:
<code><pre>
IntStream.of(1, 2, 3).mapToObj(Unchecked.intFunction(i -> {
if (i < 0)
throw new Exception("Only positive numbers allowed");
return "" + i;
});
</pre></code> | [
"Wrap",
"a",
"{",
"@link",
"CheckedIntFunction",
"}",
"in",
"a",
"{",
"@link",
"IntFunction",
"}",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"IntStream",
".",
"of",
"(",
"1",
"2",
"3",
")",
".",
"mapToObj",
"(",
"Unchecked",
".",
"... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1045-L1047 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java | EnumConstantBuilder.getInstance | public static EnumConstantBuilder getInstance(Context context,
ClassDoc classDoc, EnumConstantWriter writer) {
"""
Construct a new EnumConstantsBuilder.
@param context the build context.
@param classDoc the class whoses members are being documented.
@param writer the doclet specific writer.
"... | java | public static EnumConstantBuilder getInstance(Context context,
ClassDoc classDoc, EnumConstantWriter writer) {
return new EnumConstantBuilder(context, classDoc, writer);
} | [
"public",
"static",
"EnumConstantBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"ClassDoc",
"classDoc",
",",
"EnumConstantWriter",
"writer",
")",
"{",
"return",
"new",
"EnumConstantBuilder",
"(",
"context",
",",
"classDoc",
",",
"writer",
")",
";",
"}"
] | Construct a new EnumConstantsBuilder.
@param context the build context.
@param classDoc the class whoses members are being documented.
@param writer the doclet specific writer. | [
"Construct",
"a",
"new",
"EnumConstantsBuilder",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java#L105-L108 |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.processMethodBulk | protected static MPResourceArray processMethodBulk(Class clazz, String methodName, HashMap<String, String> mapParams, Boolean useCache) throws MPException {
"""
Process the method to call the api
@param clazz a MPBase extended class
@param methodName a String with the decorated method to be ... | java | protected static MPResourceArray processMethodBulk(Class clazz, String methodName, HashMap<String, String> mapParams, Boolean useCache) throws MPException {
//Validates the method executed
if (!ALLOWED_BULK_METHODS.contains(methodName)) {
throw new MPException("Method \"" + methodName + "\"... | [
"protected",
"static",
"MPResourceArray",
"processMethodBulk",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"mapParams",
",",
"Boolean",
"useCache",
")",
"throws",
"MPException",
"{",
"//Validates the method ... | Process the method to call the api
@param clazz a MPBase extended class
@param methodName a String with the decorated method to be processed
@param mapParams a hashmap with the args passed in the call of the method
@param useCache a Boolean flag that indicates if the cache must be u... | [
"Process",
"the",
"method",
"to",
"call",
"the",
"api"
] | train | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L254-L287 |
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) {
"""
Converts a {@link Future} into a Publisher.
<p>
<img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/Rx... | 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 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getKeysAsync | public Observable<Page<KeyItem>> getKeysAsync(final String vaultBaseUrl, final Integer maxresults) {
"""
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, howev... | java | public Observable<Page<KeyItem>> getKeysAsync(final String vaultBaseUrl, final Integer maxresults) {
return getKeysWithServiceResponseAsync(vaultBaseUrl, maxresults)
.map(new Func1<ServiceResponse<Page<KeyItem>>, Page<KeyItem>>() {
@Override
public Page<KeyItem> call(... | [
"public",
"Observable",
"<",
"Page",
"<",
"KeyItem",
">",
">",
"getKeysAsync",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"Integer",
"maxresults",
")",
"{",
"return",
"getKeysWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"maxresults",
")",
".",
... | List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a ke... | [
"List",
"keys",
"in",
"the",
"specified",
"vault",
".",
"Retrieves",
"a",
"list",
"of",
"the",
"keys",
"in",
"the",
"Key",
"Vault",
"as",
"JSON",
"Web",
"Key",
"structures",
"that",
"contain",
"the",
"public",
"part",
"of",
"a",
"stored",
"key",
".",
"... | 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#L1883-L1891 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/invalidation/RepairingHandler.java | RepairingHandler.checkOrRepairUuid | public void checkOrRepairUuid(final int partition, final UUID newUuid) {
"""
multiple threads can concurrently call this method: one is anti-entropy, other one is event service thread
"""
assert newUuid != null;
MetaDataContainer metaData = getMetaDataContainer(partition);
while (true)... | java | public void checkOrRepairUuid(final int partition, final UUID newUuid) {
assert newUuid != null;
MetaDataContainer metaData = getMetaDataContainer(partition);
while (true) {
UUID prevUuid = metaData.getUuid();
if (prevUuid != null && prevUuid.equals(newUuid)) {
... | [
"public",
"void",
"checkOrRepairUuid",
"(",
"final",
"int",
"partition",
",",
"final",
"UUID",
"newUuid",
")",
"{",
"assert",
"newUuid",
"!=",
"null",
";",
"MetaDataContainer",
"metaData",
"=",
"getMetaDataContainer",
"(",
"partition",
")",
";",
"while",
"(",
... | multiple threads can concurrently call this method: one is anti-entropy, other one is event service thread | [
"multiple",
"threads",
"can",
"concurrently",
"call",
"this",
"method",
":",
"one",
"is",
"anti",
"-",
"entropy",
"other",
"one",
"is",
"event",
"service",
"thread"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/invalidation/RepairingHandler.java#L148-L167 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/create/CreateFileExtensions.java | CreateFileExtensions.newDirectories | public static boolean newDirectories(Path dir, FileAttribute<?>... attrs) throws IOException {
"""
Creates a new directory from the given {@link Path} object and the optional
{@link FileAttribute}.<br>
<br>
Note: this method decorates the {@link Files#createDirectories(Path, FileAttribute...)} and
returns if t... | java | public static boolean newDirectories(Path dir, FileAttribute<?>... attrs) throws IOException
{
Path directory = Files.createDirectories(dir, attrs);
return Files.exists(directory);
} | [
"public",
"static",
"boolean",
"newDirectories",
"(",
"Path",
"dir",
",",
"FileAttribute",
"<",
"?",
">",
"...",
"attrs",
")",
"throws",
"IOException",
"{",
"Path",
"directory",
"=",
"Files",
".",
"createDirectories",
"(",
"dir",
",",
"attrs",
")",
";",
"r... | Creates a new directory from the given {@link Path} object and the optional
{@link FileAttribute}.<br>
<br>
Note: this method decorates the {@link Files#createDirectories(Path, FileAttribute...)} and
returns if the directory is created or not.
@param dir
the dir the directory to create
@param attrs
an optional list of... | [
"Creates",
"a",
"new",
"directory",
"from",
"the",
"given",
"{",
"@link",
"Path",
"}",
"object",
"and",
"the",
"optional",
"{",
"@link",
"FileAttribute",
"}",
".",
"<br",
">",
"<br",
">",
"Note",
":",
"this",
"method",
"decorates",
"the",
"{",
"@link",
... | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/create/CreateFileExtensions.java#L86-L90 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java | ExperimentsInner.beginCreate | public ExperimentInner beginCreate(String resourceGroupName, String workspaceName, String experimentName) {
"""
Creates an Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combinatio... | java | public ExperimentInner beginCreate(String resourceGroupName, String workspaceName, String experimentName) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).toBlocking().single().body();
} | [
"public",
"ExperimentInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workspaceName",
",",
"experimentName",... | Creates an Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.... | [
"Creates",
"an",
"Experiment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java#L432-L434 |
bremersee/sms | src/main/java/org/bremersee/sms/GoyyaSmsService.java | GoyyaSmsService.createTrustAllManagers | protected TrustManager[] createTrustAllManagers() {
"""
Creates an array of trust managers which trusts all X509 certificates.
@return the trust manager [ ]
"""
return new TrustManager[]{
new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
... | java | protected TrustManager[] createTrustAllManagers() {
return new TrustManager[]{
new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, ... | [
"protected",
"TrustManager",
"[",
"]",
"createTrustAllManagers",
"(",
")",
"{",
"return",
"new",
"TrustManager",
"[",
"]",
"{",
"new",
"X509TrustManager",
"(",
")",
"{",
"@",
"Override",
"public",
"X509Certificate",
"[",
"]",
"getAcceptedIssuers",
"(",
")",
"{... | Creates an array of trust managers which trusts all X509 certificates.
@return the trust manager [ ] | [
"Creates",
"an",
"array",
"of",
"trust",
"managers",
"which",
"trusts",
"all",
"X509",
"certificates",
"."
] | train | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L464-L482 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/SdkHttpUtils.java | SdkHttpUtils.appendUri | public static String appendUri(String baseUri, String path) {
"""
Append the given path to the given baseUri.
By default, all slash characters in path will not be url-encoded.
"""
return appendUri(baseUri, path, false);
} | java | public static String appendUri(String baseUri, String path) {
return appendUri(baseUri, path, false);
} | [
"public",
"static",
"String",
"appendUri",
"(",
"String",
"baseUri",
",",
"String",
"path",
")",
"{",
"return",
"appendUri",
"(",
"baseUri",
",",
"path",
",",
"false",
")",
";",
"}"
] | Append the given path to the given baseUri.
By default, all slash characters in path will not be url-encoded. | [
"Append",
"the",
"given",
"path",
"to",
"the",
"given",
"baseUri",
".",
"By",
"default",
"all",
"slash",
"characters",
"in",
"path",
"will",
"not",
"be",
"url",
"-",
"encoded",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/SdkHttpUtils.java#L182-L184 |
julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.closeall | public void closeall(String line, DispatchCallback callback) {
"""
Closes all connections.
@param line Command line
@param callback Callback for command status
"""
close(null, callback);
if (callback.isSuccess()) {
while (callback.isSuccess()) {
close(null, callback);
}
//... | java | public void closeall(String line, DispatchCallback callback) {
close(null, callback);
if (callback.isSuccess()) {
while (callback.isSuccess()) {
close(null, callback);
}
// the last "close" will set it to fail so reset it to success.
callback.setToSuccess();
}
// probably... | [
"public",
"void",
"closeall",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"close",
"(",
"null",
",",
"callback",
")",
";",
"if",
"(",
"callback",
".",
"isSuccess",
"(",
")",
")",
"{",
"while",
"(",
"callback",
".",
"isSuccess",
... | Closes all connections.
@param line Command line
@param callback Callback for command status | [
"Closes",
"all",
"connections",
"."
] | train | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1028-L1039 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Row.java | Row.compareByKey | public static Comparator<Row> compareByKey() {
"""
Returns a comparator that compares two Row objects by comparing the result of {@link
#getKey()}} for each.
"""
return new Comparator<Row>() {
@Override
public int compare(Row r1, Row r2) {
return ByteStringComparator.INSTANCE.compare(r... | java | public static Comparator<Row> compareByKey() {
return new Comparator<Row>() {
@Override
public int compare(Row r1, Row r2) {
return ByteStringComparator.INSTANCE.compare(r1.getKey(), r2.getKey());
}
};
} | [
"public",
"static",
"Comparator",
"<",
"Row",
">",
"compareByKey",
"(",
")",
"{",
"return",
"new",
"Comparator",
"<",
"Row",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"Row",
"r1",
",",
"Row",
"r2",
")",
"{",
"return",
"Byt... | Returns a comparator that compares two Row objects by comparing the result of {@link
#getKey()}} for each. | [
"Returns",
"a",
"comparator",
"that",
"compares",
"two",
"Row",
"objects",
"by",
"comparing",
"the",
"result",
"of",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Row.java#L44-L51 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/query/algebra/multibuffer/BufferNeeds.java | BufferNeeds.bestFactor | public static int bestFactor(long size, Transaction tx) {
"""
This method considers the various factors of the specified output size
(in blocks), and returns the highest factor that is less than the number
of available buffers.
@param size
the size of the output file
@param tx
the tx to execute
@return th... | java | public static int bestFactor(long size, Transaction tx) {
int avail = tx.bufferMgr().available();
if (avail <= 1)
return 1;
long k = size;
double i = 1.0;
while (k > avail) {
i++;
k = (int) Math.ceil(size / i);
}
return (int) k;
} | [
"public",
"static",
"int",
"bestFactor",
"(",
"long",
"size",
",",
"Transaction",
"tx",
")",
"{",
"int",
"avail",
"=",
"tx",
".",
"bufferMgr",
"(",
")",
".",
"available",
"(",
")",
";",
"if",
"(",
"avail",
"<=",
"1",
")",
"return",
"1",
";",
"long"... | This method considers the various factors of the specified output size
(in blocks), and returns the highest factor that is less than the number
of available buffers.
@param size
the size of the output file
@param tx
the tx to execute
@return the highest number less than the number of available buffers,
that is a facto... | [
"This",
"method",
"considers",
"the",
"various",
"factors",
"of",
"the",
"specified",
"output",
"size",
"(",
"in",
"blocks",
")",
"and",
"returns",
"the",
"highest",
"factor",
"that",
"is",
"less",
"than",
"the",
"number",
"of",
"available",
"buffers",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/multibuffer/BufferNeeds.java#L63-L74 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java | SqlGeneratorDefaultImpl.getPreparedInsertStatement | public SqlStatement getPreparedInsertStatement(ClassDescriptor cld) {
"""
generate a prepared INSERT-Statement for the Class
described by cld.
@param cld the ClassDescriptor
"""
SqlStatement sql;
SqlForClass sfc = getSqlForClass(cld);
sql = sfc.getInsertSql();
if(sql == ... | 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 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.withHeader | public HttpResponse withHeader(NottableString name, NottableString... values) {
"""
Add a header to return as a Header object, if a header with
the same name already exists this will NOT be modified but
two headers will exist
@param name the header name as a NottableString
@param values the header values w... | java | public HttpResponse withHeader(NottableString name, NottableString... values) {
this.headers.withEntry(header(name, values));
return this;
} | [
"public",
"HttpResponse",
"withHeader",
"(",
"NottableString",
"name",
",",
"NottableString",
"...",
"values",
")",
"{",
"this",
".",
"headers",
".",
"withEntry",
"(",
"header",
"(",
"name",
",",
"values",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a header to return as a Header object, if a header with
the same name already exists this will NOT be modified but
two headers will exist
@param name the header name as a NottableString
@param values the header values which can be a varags of NottableStrings | [
"Add",
"a",
"header",
"to",
"return",
"as",
"a",
"Header",
"object",
"if",
"a",
"header",
"with",
"the",
"same",
"name",
"already",
"exists",
"this",
"will",
"NOT",
"be",
"modified",
"but",
"two",
"headers",
"will",
"exist"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L235-L238 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingreseller/src/main/java/net/minidev/ovh/api/ApiOvhHostingreseller.java | ApiOvhHostingreseller.serviceName_reboot_POST | public String serviceName_reboot_POST(String serviceName, Boolean hard) throws IOException {
"""
Restart instance
REST: POST /hosting/reseller/{serviceName}/reboot
@param serviceName [required] The internal name of your reseller service
@param hard [required] Force a hard reboot
"""
String qPath = "/hos... | java | public String serviceName_reboot_POST(String serviceName, Boolean hard) throws IOException {
String qPath = "/hosting/reseller/{serviceName}/reboot";
StringBuilder sb = path(qPath, serviceName);
query(sb, "hard", hard);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, String.clas... | [
"public",
"String",
"serviceName_reboot_POST",
"(",
"String",
"serviceName",
",",
"Boolean",
"hard",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/reseller/{serviceName}/reboot\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | Restart instance
REST: POST /hosting/reseller/{serviceName}/reboot
@param serviceName [required] The internal name of your reseller service
@param hard [required] Force a hard reboot | [
"Restart",
"instance"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingreseller/src/main/java/net/minidev/ovh/api/ApiOvhHostingreseller.java#L145-L151 |
Wikidata/Wikidata-Toolkit | wdtk-examples/src/main/java/org/wikidata/wdtk/examples/GenderRatioProcessor.java | GenderRatioProcessor.countGender | private void countGender(EntityIdValue gender, SiteRecord siteRecord) {
"""
Counts a single page of the specified gender. If this is the first page
of that gender on this site, a suitable key is added to the list of the
site's genders.
@param gender
the gender to count
@param siteRecord
the site record to ... | java | private void countGender(EntityIdValue gender, SiteRecord siteRecord) {
Integer curValue = siteRecord.genderCounts.get(gender);
if (curValue == null) {
siteRecord.genderCounts.put(gender, 1);
} else {
siteRecord.genderCounts.put(gender, curValue + 1);
}
} | [
"private",
"void",
"countGender",
"(",
"EntityIdValue",
"gender",
",",
"SiteRecord",
"siteRecord",
")",
"{",
"Integer",
"curValue",
"=",
"siteRecord",
".",
"genderCounts",
".",
"get",
"(",
"gender",
")",
";",
"if",
"(",
"curValue",
"==",
"null",
")",
"{",
... | Counts a single page of the specified gender. If this is the first page
of that gender on this site, a suitable key is added to the list of the
site's genders.
@param gender
the gender to count
@param siteRecord
the site record to count it for | [
"Counts",
"a",
"single",
"page",
"of",
"the",
"specified",
"gender",
".",
"If",
"this",
"is",
"the",
"first",
"page",
"of",
"that",
"gender",
"on",
"this",
"site",
"a",
"suitable",
"key",
"is",
"added",
"to",
"the",
"list",
"of",
"the",
"site",
"s",
... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/GenderRatioProcessor.java#L447-L454 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/location/GeoLocationUtil.java | GeoLocationUtil.makeInternalId | @Pure
public static String makeInternalId(float x, float y) {
"""
Compute and replies the internal identifier that may
be used to create a GeoId from the given point.
@param x x coordinate.
@param y y coordinate
@return the internal identifier.
"""
final StringBuilder buf = new StringBuilder("point");... | java | @Pure
public static String makeInternalId(float x, float y) {
final StringBuilder buf = new StringBuilder("point"); //$NON-NLS-1$
buf.append(x);
buf.append(';');
buf.append(y);
return Encryption.md5(buf.toString());
} | [
"@",
"Pure",
"public",
"static",
"String",
"makeInternalId",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"\"point\"",
")",
";",
"//$NON-NLS-1$",
"buf",
".",
"append",
"(",
"x",
")",
"... | Compute and replies the internal identifier that may
be used to create a GeoId from the given point.
@param x x coordinate.
@param y y coordinate
@return the internal identifier. | [
"Compute",
"and",
"replies",
"the",
"internal",
"identifier",
"that",
"may",
"be",
"used",
"to",
"create",
"a",
"GeoId",
"from",
"the",
"given",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/location/GeoLocationUtil.java#L343-L350 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java | RegionForwardingRuleId.of | public static RegionForwardingRuleId of(RegionId regionId, String rule) {
"""
Returns a region forwarding rule identity given the region identity and the rule name. The
forwarding rule name must be 1-63 characters long and comply with RFC1035. Specifically, the
name must match the regular expression {@code [a-z]... | java | public static RegionForwardingRuleId of(RegionId regionId, String rule) {
return new RegionForwardingRuleId(regionId.getProject(), regionId.getRegion(), rule);
} | [
"public",
"static",
"RegionForwardingRuleId",
"of",
"(",
"RegionId",
"regionId",
",",
"String",
"rule",
")",
"{",
"return",
"new",
"RegionForwardingRuleId",
"(",
"regionId",
".",
"getProject",
"(",
")",
",",
"regionId",
".",
"getRegion",
"(",
")",
",",
"rule",... | Returns a region forwarding rule identity given the region identity and the rule name. The
forwarding rule name must be 1-63 characters long and comply with RFC1035. Specifically, the
name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first
character must be a lowercase letter, an... | [
"Returns",
"a",
"region",
"forwarding",
"rule",
"identity",
"given",
"the",
"region",
"identity",
"and",
"the",
"rule",
"name",
".",
"The",
"forwarding",
"rule",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java#L115-L117 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginDelete | public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Deletes the specified virtual network gateway.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if... | java | public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
... | Deletes the specified virtual network gateway.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
... | [
"Deletes",
"the",
"specified",
"virtual",
"network",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L525-L527 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/FileSystemContext.java | FileSystemContext.writeToFile | public void writeToFile(String filePath, String fileData)
throws IOException {
"""
Write the contents of the given file data to the file at the given path.
This will replace any existing data.
@param filePath The path to the file to write to
@param fileData The data to write to the given file
@thro... | java | public void writeToFile(String filePath, String fileData)
throws IOException {
writeToFile(filePath, fileData, false);
} | [
"public",
"void",
"writeToFile",
"(",
"String",
"filePath",
",",
"String",
"fileData",
")",
"throws",
"IOException",
"{",
"writeToFile",
"(",
"filePath",
",",
"fileData",
",",
"false",
")",
";",
"}"
] | Write the contents of the given file data to the file at the given path.
This will replace any existing data.
@param filePath The path to the file to write to
@param fileData The data to write to the given file
@throws IOException if an error occurs writing the data
@see #writeToFile(String, String, boolean) | [
"Write",
"the",
"contents",
"of",
"the",
"given",
"file",
"data",
"to",
"the",
"file",
"at",
"the",
"given",
"path",
".",
"This",
"will",
"replace",
"any",
"existing",
"data",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/FileSystemContext.java#L250-L254 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java | PathNormalizer.concatWebPath | public static String concatWebPath(String basePath, String fullFilenameToAdd) {
"""
Concatenates a filename to a base web path. If the base path doesn't end
with "/", it will consider as base path the parent folder of the base
path passed as parameter.
<pre>
PathUtils.concatWebPath("", null)); =... | java | public static String concatWebPath(String basePath, String fullFilenameToAdd) {
if (fullFilenameToAdd == null || basePath == null && (fullFilenameToAdd.length() == 0
|| fullFilenameToAdd.charAt(0) != JawrConstant.URL_SEPARATOR_CHAR)) {
return null;
}
if (basePath == null) {
basePath = "";
}
// If ... | [
"public",
"static",
"String",
"concatWebPath",
"(",
"String",
"basePath",
",",
"String",
"fullFilenameToAdd",
")",
"{",
"if",
"(",
"fullFilenameToAdd",
"==",
"null",
"||",
"basePath",
"==",
"null",
"&&",
"(",
"fullFilenameToAdd",
".",
"length",
"(",
")",
"==",... | Concatenates a filename to a base web path. If the base path doesn't end
with "/", it will consider as base path the parent folder of the base
path passed as parameter.
<pre>
PathUtils.concatWebPath("", null)); = null
PathUtils.concatWebPath(null, null)); = null
PathUtils.concatWebPath(null, "... | [
"Concatenates",
"a",
"filename",
"to",
"a",
"base",
"web",
"path",
".",
"If",
"the",
"base",
"path",
"doesn",
"t",
"end",
"with",
"/",
"it",
"will",
"consider",
"as",
"base",
"path",
"the",
"parent",
"folder",
"of",
"the",
"base",
"path",
"passed",
"as... | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java#L615-L646 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/SubPlanAssembler.java | SubPlanAssembler.getAccessPlanForTable | protected static AbstractPlanNode getAccessPlanForTable(JoinNode tableNode) {
"""
Given an access path, build the single-site or distributed plan that will
assess the data from the table according to the path.
@param table The table to get data from.
@return The root of a plan graph to get the data.
"""
... | java | protected static AbstractPlanNode getAccessPlanForTable(JoinNode tableNode) {
StmtTableScan tableScan = tableNode.getTableScan();
// Access path to access the data in the table (index/scan/etc).
AccessPath path = tableNode.m_currentAccessPath;
assert(path != null);
// if no inde... | [
"protected",
"static",
"AbstractPlanNode",
"getAccessPlanForTable",
"(",
"JoinNode",
"tableNode",
")",
"{",
"StmtTableScan",
"tableScan",
"=",
"tableNode",
".",
"getTableScan",
"(",
")",
";",
"// Access path to access the data in the table (index/scan/etc).",
"AccessPath",
"p... | Given an access path, build the single-site or distributed plan that will
assess the data from the table according to the path.
@param table The table to get data from.
@return The root of a plan graph to get the data. | [
"Given",
"an",
"access",
"path",
"build",
"the",
"single",
"-",
"site",
"or",
"distributed",
"plan",
"that",
"will",
"assess",
"the",
"data",
"from",
"the",
"table",
"according",
"to",
"the",
"path",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/SubPlanAssembler.java#L2150-L2161 |
zxing/zxing | android/src/com/google/zxing/client/android/result/ResultHandler.java | ResultHandler.searchMap | final void searchMap(String address) {
"""
Do a geo search using the address as the query.
@param address The address to find
"""
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 |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngine.java | ExecutionEngine.crashVoltDB | public static void crashVoltDB(String reason, String traces[], String filename, int lineno) {
"""
Call VoltDB.crashVoltDB on behalf of the EE
@param reason Reason the EE crashed
"""
VoltLogger hostLog = new VoltLogger("HOST");
String fn = (filename == null) ? "unknown" : filename;
Stri... | java | public static void crashVoltDB(String reason, String traces[], String filename, int lineno) {
VoltLogger hostLog = new VoltLogger("HOST");
String fn = (filename == null) ? "unknown" : filename;
String re = (reason == null) ? "Fatal EE error." : reason;
hostLog.fatal(re + " In " + fn + ":... | [
"public",
"static",
"void",
"crashVoltDB",
"(",
"String",
"reason",
",",
"String",
"traces",
"[",
"]",
",",
"String",
"filename",
",",
"int",
"lineno",
")",
"{",
"VoltLogger",
"hostLog",
"=",
"new",
"VoltLogger",
"(",
"\"HOST\"",
")",
";",
"String",
"fn",
... | Call VoltDB.crashVoltDB on behalf of the EE
@param reason Reason the EE crashed | [
"Call",
"VoltDB",
".",
"crashVoltDB",
"on",
"behalf",
"of",
"the",
"EE"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L385-L396 |
belaban/JGroups | src/org/jgroups/stack/Configurator.java | Configurator.removeProvidedDownServices | protected static void removeProvidedDownServices(Protocol protocol, List<Integer> events) {
"""
Removes all events provided by the protocol above protocol from events
@param protocol
@param events
"""
if(protocol == null || events == null)
return;
for(Protocol prot=protocol.getUpP... | java | protected static void removeProvidedDownServices(Protocol protocol, List<Integer> events) {
if(protocol == null || events == null)
return;
for(Protocol prot=protocol.getUpProtocol(); prot != null && !events.isEmpty(); prot=prot.getUpProtocol()) {
List<Integer> provided_down_servi... | [
"protected",
"static",
"void",
"removeProvidedDownServices",
"(",
"Protocol",
"protocol",
",",
"List",
"<",
"Integer",
">",
"events",
")",
"{",
"if",
"(",
"protocol",
"==",
"null",
"||",
"events",
"==",
"null",
")",
"return",
";",
"for",
"(",
"Protocol",
"... | Removes all events provided by the protocol above protocol from events
@param protocol
@param events | [
"Removes",
"all",
"events",
"provided",
"by",
"the",
"protocol",
"above",
"protocol",
"from",
"events"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/stack/Configurator.java#L358-L366 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java | MithraManager.zLazyInitObjectsWithCallback | public void zLazyInitObjectsWithCallback(MithraRuntimeType mithraRuntimeType, MithraConfigurationManager.PostInitializeHook hook) {
"""
only used for MithraTestResource. Do not use. use readConfiguration instead.
@param mithraRuntimeType
@param hook
"""
configManager.lazyInitObjectsWithCallback(mith... | java | public void zLazyInitObjectsWithCallback(MithraRuntimeType mithraRuntimeType, MithraConfigurationManager.PostInitializeHook hook)
{
configManager.lazyInitObjectsWithCallback(mithraRuntimeType, hook);
} | [
"public",
"void",
"zLazyInitObjectsWithCallback",
"(",
"MithraRuntimeType",
"mithraRuntimeType",
",",
"MithraConfigurationManager",
".",
"PostInitializeHook",
"hook",
")",
"{",
"configManager",
".",
"lazyInitObjectsWithCallback",
"(",
"mithraRuntimeType",
",",
"hook",
")",
... | only used for MithraTestResource. Do not use. use readConfiguration instead.
@param mithraRuntimeType
@param hook | [
"only",
"used",
"for",
"MithraTestResource",
".",
"Do",
"not",
"use",
".",
"use",
"readConfiguration",
"instead",
"."
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L702-L705 |
sannies/mp4parser | muxer/src/main/java/org/mp4parser/muxer/container/mp4/MovieCreator.java | MovieCreator.build | public static Movie build(ReadableByteChannel readableByteChannel, RandomAccessSource randomAccessSource, String name) throws IOException {
"""
Creates <code>Movie</code> object from a <code>ReadableByteChannel</code>.
@param name track name to identify later
@param readableByteChannel the box s... | java | public static Movie build(ReadableByteChannel readableByteChannel, RandomAccessSource randomAccessSource, String name) throws IOException {
IsoFile isoFile = new IsoFile(readableByteChannel);
Movie m = new Movie();
List<TrackBox> trackBoxes = isoFile.getMovieBox().getBoxes(TrackBox.class);
... | [
"public",
"static",
"Movie",
"build",
"(",
"ReadableByteChannel",
"readableByteChannel",
",",
"RandomAccessSource",
"randomAccessSource",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"IsoFile",
"isoFile",
"=",
"new",
"IsoFile",
"(",
"readableByteChannel",
... | Creates <code>Movie</code> object from a <code>ReadableByteChannel</code>.
@param name track name to identify later
@param readableByteChannel the box structure is read from this channel
@param randomAccessSource the samples or read from this randomAccessSource
@return a representation of the movie
@th... | [
"Creates",
"<code",
">",
"Movie<",
"/",
"code",
">",
"object",
"from",
"a",
"<code",
">",
"ReadableByteChannel<",
"/",
"code",
">",
"."
] | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/muxer/src/main/java/org/mp4parser/muxer/container/mp4/MovieCreator.java#L53-L75 |
alkacon/opencms-core | src/org/opencms/util/CmsManyToOneMap.java | CmsManyToOneMap.put | public void put(K key, V value) {
"""
Associates a value with a key.<p>
@param key the key
@param value the value
"""
m_forwardMap.put(key, value);
m_reverseMap.put(value, key);
} | java | public void put(K key, V value) {
m_forwardMap.put(key, value);
m_reverseMap.put(value, key);
} | [
"public",
"void",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"m_forwardMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"m_reverseMap",
".",
"put",
"(",
"value",
",",
"key",
")",
";",
"}"
] | Associates a value with a key.<p>
@param key the key
@param value the value | [
"Associates",
"a",
"value",
"with",
"a",
"key",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsManyToOneMap.java#L92-L97 |
gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.failMsg | protected String failMsg(final Throwable thrwbl, final String queue, final Job job) throws IOException {
"""
Create and serialize a JobFailure.
@param thrwbl the Throwable that occurred
@param queue the queue the job came from
@param job the Job that failed
@return the JSON representation of a new JobFailure... | java | protected String failMsg(final Throwable thrwbl, final String queue, final Job job) throws IOException {
final JobFailure failure = new JobFailure();
failure.setFailedAt(new Date());
failure.setWorker(this.name);
failure.setQueue(queue);
failure.setPayload(job);
failure.s... | [
"protected",
"String",
"failMsg",
"(",
"final",
"Throwable",
"thrwbl",
",",
"final",
"String",
"queue",
",",
"final",
"Job",
"job",
")",
"throws",
"IOException",
"{",
"final",
"JobFailure",
"failure",
"=",
"new",
"JobFailure",
"(",
")",
";",
"failure",
".",
... | Create and serialize a JobFailure.
@param thrwbl the Throwable that occurred
@param queue the queue the job came from
@param job the Job that failed
@return the JSON representation of a new JobFailure
@throws IOException if there was an error serializing the JobFailure | [
"Create",
"and",
"serialize",
"a",
"JobFailure",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L722-L730 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/function/MonetaryFunctions.java | MonetaryFunctions.min | static MonetaryAmount min(MonetaryAmount a, MonetaryAmount b) {
"""
Returns the smaller of two {@code MonetaryAmount} values. If the arguments
have the same value, the result is that same value.
@param a an argument.
@param b another argument.
@return the smaller of {@code a} and {@code b}.
"""
Mon... | java | static MonetaryAmount min(MonetaryAmount a, MonetaryAmount b) {
MoneyUtils.checkAmountParameter(Objects.requireNonNull(a), Objects.requireNonNull(b.getCurrency()));
return a.isLessThan(b) ? a : b;
} | [
"static",
"MonetaryAmount",
"min",
"(",
"MonetaryAmount",
"a",
",",
"MonetaryAmount",
"b",
")",
"{",
"MoneyUtils",
".",
"checkAmountParameter",
"(",
"Objects",
".",
"requireNonNull",
"(",
"a",
")",
",",
"Objects",
".",
"requireNonNull",
"(",
"b",
".",
"getCurr... | Returns the smaller of two {@code MonetaryAmount} values. If the arguments
have the same value, the result is that same value.
@param a an argument.
@param b another argument.
@return the smaller of {@code a} and {@code b}. | [
"Returns",
"the",
"smaller",
"of",
"two",
"{"
] | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/function/MonetaryFunctions.java#L285-L288 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java | Datamodel.makeItemIdValue | public static ItemIdValue makeItemIdValue(String id, String siteIri) {
"""
Creates an {@link ItemIdValue}.
@param id
a string of the form Qn... where n... is the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI of the site ... | java | public static ItemIdValue makeItemIdValue(String id, String siteIri) {
return factory.getItemIdValue(id, siteIri);
} | [
"public",
"static",
"ItemIdValue",
"makeItemIdValue",
"(",
"String",
"id",
",",
"String",
"siteIri",
")",
"{",
"return",
"factory",
".",
"getItemIdValue",
"(",
"id",
",",
"siteIri",
")",
";",
"}"
] | Creates an {@link ItemIdValue}.
@param id
a string of the form Qn... where n... is the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"
@return an {@link ItemIdValue}... | [
"Creates",
"an",
"{",
"@link",
"ItemIdValue",
"}",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java#L58-L60 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.bigDecimalAvg | public static <Key, Value> Aggregation<Key, BigDecimal, BigDecimal> bigDecimalAvg() {
"""
Returns an aggregation to calculate the {@link java.math.BigDecimal} average
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Val... | java | public static <Key, Value> Aggregation<Key, BigDecimal, BigDecimal> bigDecimalAvg() {
return new AggregationAdapter(new BigDecimalAvgAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"BigDecimal",
",",
"BigDecimal",
">",
"bigDecimalAvg",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"BigDecimalAvgAggregation",
"<",
"Key",
",",
"Value",
... | Returns an aggregation to calculate the {@link java.math.BigDecimal} average
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the average over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"calculate",
"the",
"{",
"@link",
"java",
".",
"math",
".",
"BigDecimal",
"}",
"average",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELE... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L247-L249 |
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 {
"""
/*
Set a short value with the given name, into the Map.
Javadoc description supplied by JsJmsMessage interface.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setShort",... | 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 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_runningconfig.java | ns_ns_runningconfig.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_ns_runningconfig_responses result = (ns_ns_runningconfig_responses) ... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_ns_runningconfig_responses result = (ns_ns_runningconfig_responses) service.get_payload_formatter().string_to_resource(ns_ns_runningconfig_responses.class, response);
if(result.errorcode != 0)
{
... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_ns_runningconfig_responses",
"result",
"=",
"(",
"ns_ns_runningconfig_responses",
")",
"service",
".",
"ge... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_runningconfig.java#L215-L232 |
sarxos/v4l4j | src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java | ImageFormatList.getFormat | private ImageFormat getFormat(List<ImageFormat> l, int i) {
"""
this method returns a format in a list given its index
@param l the image format list
@param i the index of the format
@return the image format with the given index, or null
"""
for(ImageFormat f:l)
if(f.getIndex()==i)
return f;
retu... | java | private ImageFormat getFormat(List<ImageFormat> l, int i){
for(ImageFormat f:l)
if(f.getIndex()==i)
return f;
return null;
} | [
"private",
"ImageFormat",
"getFormat",
"(",
"List",
"<",
"ImageFormat",
">",
"l",
",",
"int",
"i",
")",
"{",
"for",
"(",
"ImageFormat",
"f",
":",
"l",
")",
"if",
"(",
"f",
".",
"getIndex",
"(",
")",
"==",
"i",
")",
"return",
"f",
";",
"return",
"... | this method returns a format in a list given its index
@param l the image format list
@param i the index of the format
@return the image format with the given index, or null | [
"this",
"method",
"returns",
"a",
"format",
"in",
"a",
"list",
"given",
"its",
"index"
] | train | https://github.com/sarxos/v4l4j/blob/4fc0eec2c3a1a4260593f6ac03b7a8013e3804c9/src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java#L221-L226 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/CmsGalleryTreeItem.java | CmsGalleryTreeItem.updateParentPath | private void updateParentPath(String newParentPath, String oldParentPath) {
"""
Updates the site path info.<p>
@param newParentPath the new parent path
@param oldParentPath the previous parent path
"""
String oldPath = getSitePath();
String newPath = oldPath.replaceFirst(oldParentPath, new... | java | private void updateParentPath(String newParentPath, String oldParentPath) {
String oldPath = getSitePath();
String newPath = oldPath.replaceFirst(oldParentPath, newParentPath);
getListItemWidget().setSubtitleLabel(newPath);
for (Widget child : getChildren()) {
((CmsGalleryTr... | [
"private",
"void",
"updateParentPath",
"(",
"String",
"newParentPath",
",",
"String",
"oldParentPath",
")",
"{",
"String",
"oldPath",
"=",
"getSitePath",
"(",
")",
";",
"String",
"newPath",
"=",
"oldPath",
".",
"replaceFirst",
"(",
"oldParentPath",
",",
"newPare... | Updates the site path info.<p>
@param newParentPath the new parent path
@param oldParentPath the previous parent path | [
"Updates",
"the",
"site",
"path",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/CmsGalleryTreeItem.java#L314-L322 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONObject.java | JSONObject.putOnce | public JSONObject putOnce(String key, Object value) throws JSONException {
"""
一次性Put 键值对,如果key已经存在抛出异常,如果键值中有null值,忽略
@param key 键
@param value 值对象,可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
@return this.
@throws JSONException 值是无穷数字、键重复抛出异常
"""
if (... | java | public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (rawHashMap.containsKey(key)) {
throw new JSONException("Duplicate key \"{}\"", key);
}
this.put(key, value);
}
return this;
} | [
"public",
"JSONObject",
"putOnce",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"key",
"!=",
"null",
"&&",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"rawHashMap",
".",
"containsKey",
"(",
"key",
")",
"... | 一次性Put 键值对,如果key已经存在抛出异常,如果键值中有null值,忽略
@param key 键
@param value 值对象,可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
@return this.
@throws JSONException 值是无穷数字、键重复抛出异常 | [
"一次性Put",
"键值对,如果key已经存在抛出异常,如果键值中有null值,忽略"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONObject.java#L404-L412 |
netty/netty | example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java | HttpStaticFileServerHandler.sendNotModified | private void sendNotModified(ChannelHandlerContext ctx) {
"""
When file timestamp is the same as what the browser is sending up, send a "304 Not Modified"
@param ctx
Context
"""
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED);
setDateHeader(response);
... | java | private void sendNotModified(ChannelHandlerContext ctx) {
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED);
setDateHeader(response);
this.sendAndCleanupConnection(ctx, response);
} | [
"private",
"void",
"sendNotModified",
"(",
"ChannelHandlerContext",
"ctx",
")",
"{",
"FullHttpResponse",
"response",
"=",
"new",
"DefaultFullHttpResponse",
"(",
"HTTP_1_1",
",",
"NOT_MODIFIED",
")",
";",
"setDateHeader",
"(",
"response",
")",
";",
"this",
".",
"se... | When file timestamp is the same as what the browser is sending up, send a "304 Not Modified"
@param ctx
Context | [
"When",
"file",
"timestamp",
"is",
"the",
"same",
"as",
"what",
"the",
"browser",
"is",
"sending",
"up",
"send",
"a",
"304",
"Not",
"Modified"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java#L338-L343 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listDataLakeStoreAccountsWithServiceResponseAsync | public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean co... | java | public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean co... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DataLakeStoreAccountInfoInner",
">",
">",
">",
"listDataLakeStoreAccountsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String... | Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Store",
"accounts",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L1742-L1754 |
easymock/objenesis | tck/src/main/java/org/objenesis/tck/AbstractLoader.java | AbstractLoader.loadFromResource | public void loadFromResource(String resource, Candidate.CandidateType type) throws IOException {
"""
Load a candidate property file
@param resource File name
@param type Type of the candidate loaded from the stream
@throws IOException If there's problem reading the file
"""
InputStream candidatesCon... | java | public void loadFromResource(String resource, Candidate.CandidateType type) throws IOException {
InputStream candidatesConfig = classloader.getResourceAsStream(resource);
if(candidatesConfig == null) {
throw new IOException("Resource '" + resource + "' not found");
}
try {
load... | [
"public",
"void",
"loadFromResource",
"(",
"String",
"resource",
",",
"Candidate",
".",
"CandidateType",
"type",
")",
"throws",
"IOException",
"{",
"InputStream",
"candidatesConfig",
"=",
"classloader",
".",
"getResourceAsStream",
"(",
"resource",
")",
";",
"if",
... | Load a candidate property file
@param resource File name
@param type Type of the candidate loaded from the stream
@throws IOException If there's problem reading the file | [
"Load",
"a",
"candidate",
"property",
"file"
] | train | https://github.com/easymock/objenesis/blob/8f601c8ba1aa20bbc640e2c2bc48d55df52c489f/tck/src/main/java/org/objenesis/tck/AbstractLoader.java#L103-L114 |
neo4j-contrib/neo4j-apoc-procedures | src/main/java/apoc/periodic/Periodic.java | Periodic.submit | public static <T> JobInfo submit(String name, Runnable task) {
"""
Call from a procedure that gets a <code>@Context GraphDatbaseAPI db;</code> injected and provide that db to the runnable.
"""
JobInfo info = new JobInfo(name);
Future<T> future = list.remove(info);
if (future != null && ... | java | public static <T> JobInfo submit(String name, Runnable task) {
JobInfo info = new JobInfo(name);
Future<T> future = list.remove(info);
if (future != null && !future.isDone()) future.cancel(false);
Future newFuture = Pools.SCHEDULED.submit(task);
list.put(info,newFuture);
... | [
"public",
"static",
"<",
"T",
">",
"JobInfo",
"submit",
"(",
"String",
"name",
",",
"Runnable",
"task",
")",
"{",
"JobInfo",
"info",
"=",
"new",
"JobInfo",
"(",
"name",
")",
";",
"Future",
"<",
"T",
">",
"future",
"=",
"list",
".",
"remove",
"(",
"... | Call from a procedure that gets a <code>@Context GraphDatbaseAPI db;</code> injected and provide that db to the runnable. | [
"Call",
"from",
"a",
"procedure",
"that",
"gets",
"a",
"<code",
">"
] | train | https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/apoc/periodic/Periodic.java#L189-L197 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/publisher/CopyEventSubmitterHelper.java | CopyEventSubmitterHelper.submitSuccessfulFilePublish | static void submitSuccessfulFilePublish(EventSubmitter eventSubmitter, CopyableFile cf, WorkUnitState workUnitState) {
"""
Submit an sla event when a {@link org.apache.gobblin.data.management.copy.CopyableFile} is published. The <code>workUnitState</code> passed should have the
required {@link SlaEventKeys} set.
... | java | static void submitSuccessfulFilePublish(EventSubmitter eventSubmitter, CopyableFile cf, WorkUnitState workUnitState) {
String datasetUrn = workUnitState.getProp(SlaEventKeys.DATASET_URN_KEY);
String partition = workUnitState.getProp(SlaEventKeys.PARTITION_KEY);
String completenessPercentage = workUnitState.... | [
"static",
"void",
"submitSuccessfulFilePublish",
"(",
"EventSubmitter",
"eventSubmitter",
",",
"CopyableFile",
"cf",
",",
"WorkUnitState",
"workUnitState",
")",
"{",
"String",
"datasetUrn",
"=",
"workUnitState",
".",
"getProp",
"(",
"SlaEventKeys",
".",
"DATASET_URN_KEY... | Submit an sla event when a {@link org.apache.gobblin.data.management.copy.CopyableFile} is published. The <code>workUnitState</code> passed should have the
required {@link SlaEventKeys} set.
@see SlaEventSubmitter#submit()
@param eventSubmitter
@param workUnitState | [
"Submit",
"an",
"sla",
"event",
"when",
"a",
"{",
"@link",
"org",
".",
"apache",
".",
"gobblin",
".",
"data",
".",
"management",
".",
"copy",
".",
"CopyableFile",
"}",
"is",
"published",
".",
"The",
"<code",
">",
"workUnitState<",
"/",
"code",
">",
"pa... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/publisher/CopyEventSubmitterHelper.java#L68-L82 |
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) {
"""
Backs up the specified certificate.
Requests that a backup of the specified certificate be downloaded to the client. All versions ... | 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 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_monitor.java | xen_health_monitor.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_health_monitor_responses result = (xen_health_monitor_responses) se... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_monitor_responses result = (xen_health_monitor_responses) service.get_payload_formatter().string_to_resource(xen_health_monitor_responses.class, response);
if(result.errorcode != 0)
{
i... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_health_monitor_responses",
"result",
"=",
"(",
"xen_health_monitor_responses",
")",
"service",
".",
"get_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_monitor.java#L292-L309 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/URI.java | URI.indexFirstOf | protected int indexFirstOf(char[] s, char delim, int offset) {
"""
Get the earlier index that to be searched for the first occurrance in
one of any of the given array.
@param s the character array to be indexed
@param delim the delimiter used to index
@param offset The offset.
@return the ealier index if th... | java | protected int indexFirstOf(char[] s, char delim, int offset) {
if (s == null || s.length == 0) {
return -1;
}
// check boundaries
if (offset < 0) {
offset = 0;
} else if (offset > s.length) {
return -1;
}
for (int i = offset; i ... | [
"protected",
"int",
"indexFirstOf",
"(",
"char",
"[",
"]",
"s",
",",
"char",
"delim",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"==",
"0",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// check boundaries",
... | Get the earlier index that to be searched for the first occurrance in
one of any of the given array.
@param s the character array to be indexed
@param delim the delimiter used to index
@param offset The offset.
@return the ealier index if there is a delimiter | [
"Get",
"the",
"earlier",
"index",
"that",
"to",
"be",
"searched",
"for",
"the",
"first",
"occurrance",
"in",
"one",
"of",
"any",
"of",
"the",
"given",
"array",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/URI.java#L2170-L2186 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.removeJob | @Override
public boolean removeJob(JobKey jobKey, Jedis jedis) throws JobPersistenceException {
"""
Remove the given job from Redis
@param jobKey the job to be removed
@param jedis a thread-safe Redis connection
@return true if the job was removed; false if it did not exist
"""
final String jobH... | java | @Override
public boolean removeJob(JobKey jobKey, Jedis jedis) throws JobPersistenceException {
final String jobHashKey = redisSchema.jobHashKey(jobKey);
final String jobBlockedKey = redisSchema.jobBlockedKey(jobKey);
final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobKey);
... | [
"@",
"Override",
"public",
"boolean",
"removeJob",
"(",
"JobKey",
"jobKey",
",",
"Jedis",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"jobHashKey",
"=",
"redisSchema",
".",
"jobHashKey",
"(",
"jobKey",
")",
";",
"final",
"String",
... | Remove the given job from Redis
@param jobKey the job to be removed
@param jedis a thread-safe Redis connection
@return true if the job was removed; false if it did not exist | [
"Remove",
"the",
"given",
"job",
"from",
"Redis"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L40-L90 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java | ElementMatchers.takesGenericArgument | public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, TypeDescription.Generic type) {
"""
Matches {@link MethodDescription}s that define a given generic type as a parameter at the given index.
@param index The index of the parameter.
@param type The generic typ... | java | public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, TypeDescription.Generic type) {
return takesGenericArgument(index, is(type));
} | [
"public",
"static",
"<",
"T",
"extends",
"MethodDescription",
">",
"ElementMatcher",
".",
"Junction",
"<",
"T",
">",
"takesGenericArgument",
"(",
"int",
"index",
",",
"TypeDescription",
".",
"Generic",
"type",
")",
"{",
"return",
"takesGenericArgument",
"(",
"in... | Matches {@link MethodDescription}s that define a given generic type as a parameter at the given index.
@param index The index of the parameter.
@param type The generic type the matched method is expected to define as a parameter type.
@param <T> The type of the matched object.
@return An element matcher that matche... | [
"Matches",
"{",
"@link",
"MethodDescription",
"}",
"s",
"that",
"define",
"a",
"given",
"generic",
"type",
"as",
"a",
"parameter",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java#L1170-L1172 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java | ExpressionToken.mapLookup | protected final Object mapLookup(Map map, Object key) {
"""
Lookup the <code>key</code> in the <code>map</code>.
@param map the map
@param key the key
@return the value found at <code>map.get(key)</code> or <code>null</code> if no value was found
"""
LOGGER.trace("get value from Map");
retur... | java | protected final Object mapLookup(Map map, Object key) {
LOGGER.trace("get value from Map");
return map.get(key);
} | [
"protected",
"final",
"Object",
"mapLookup",
"(",
"Map",
"map",
",",
"Object",
"key",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"get value from Map\"",
")",
";",
"return",
"map",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Lookup the <code>key</code> in the <code>map</code>.
@param map the map
@param key the key
@return the value found at <code>map.get(key)</code> or <code>null</code> if no value was found | [
"Lookup",
"the",
"<code",
">",
"key<",
"/",
"code",
">",
"in",
"the",
"<code",
">",
"map<",
"/",
"code",
">",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java#L50-L53 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getParameterByName | public static QueryParameter getParameterByName(List<QueryParameter> params, String parameterName) {
"""
Get parameter by name
@param params list of parameters
@param parameterName parameter name
@return return paramater with the specified name, null if parameter not found
"""
for (QueryPar... | java | public static QueryParameter getParameterByName(List<QueryParameter> params, String parameterName) {
for (QueryParameter parameter : params) {
if (parameter.getName().equals(parameterName)) {
return parameter;
}
}
return null;
} | [
"public",
"static",
"QueryParameter",
"getParameterByName",
"(",
"List",
"<",
"QueryParameter",
">",
"params",
",",
"String",
"parameterName",
")",
"{",
"for",
"(",
"QueryParameter",
"parameter",
":",
"params",
")",
"{",
"if",
"(",
"parameter",
".",
"getName",
... | Get parameter by name
@param params list of parameters
@param parameterName parameter name
@return return paramater with the specified name, null if parameter not found | [
"Get",
"parameter",
"by",
"name"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L626-L633 |
wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java | AbstractUrlMode.getUrlConfigForTarget | protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Page targetPage) {
"""
Get URL configuration for target page. If this is invalid or not available, get it from adaptable.
@param adaptable Adaptable (request or resource)
@param targetPage Target page (may be null)
@return Url config (never null)
... | java | protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Page targetPage) {
Resource targetResource = null;
if (targetPage != null) {
targetResource = targetPage.adaptTo(Resource.class);
}
return getUrlConfigForTarget(adaptable, targetResource);
} | [
"protected",
"UrlConfig",
"getUrlConfigForTarget",
"(",
"Adaptable",
"adaptable",
",",
"Page",
"targetPage",
")",
"{",
"Resource",
"targetResource",
"=",
"null",
";",
"if",
"(",
"targetPage",
"!=",
"null",
")",
"{",
"targetResource",
"=",
"targetPage",
".",
"ada... | Get URL configuration for target page. If this is invalid or not available, get it from adaptable.
@param adaptable Adaptable (request or resource)
@param targetPage Target page (may be null)
@return Url config (never null) | [
"Get",
"URL",
"configuration",
"for",
"target",
"page",
".",
"If",
"this",
"is",
"invalid",
"or",
"not",
"available",
"get",
"it",
"from",
"adaptable",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java#L55-L61 |
apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/DoubleParameter.java | DoubleParameter.setMaximumValue | public DoubleParameter setMaximumValue(double maximumValue, boolean inclusive) {
"""
Set the maximum value. The maximum value is an acceptable value if and
only if inclusive is set to true.
@param maximumValue the maximum value
@param inclusive whether the maximum value is a valid value
@return this
"""
... | java | public DoubleParameter setMaximumValue(double maximumValue, boolean inclusive) {
if (hasDefaultValue) {
if (inclusive) {
Util.checkParameter(maximumValue >= defaultValue,
"Maximum value (" + maximumValue + ") must be greater than or equal to default (" + defaultValue + ")");
} else {
Util.checkPara... | [
"public",
"DoubleParameter",
"setMaximumValue",
"(",
"double",
"maximumValue",
",",
"boolean",
"inclusive",
")",
"{",
"if",
"(",
"hasDefaultValue",
")",
"{",
"if",
"(",
"inclusive",
")",
"{",
"Util",
".",
"checkParameter",
"(",
"maximumValue",
">=",
"defaultValu... | Set the maximum value. The maximum value is an acceptable value if and
only if inclusive is set to true.
@param maximumValue the maximum value
@param inclusive whether the maximum value is a valid value
@return this | [
"Set",
"the",
"maximum",
"value",
".",
"The",
"maximum",
"value",
"is",
"an",
"acceptable",
"value",
"if",
"and",
"only",
"if",
"inclusive",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/DoubleParameter.java#L122-L146 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/TileSheetsConfig.java | TileSheetsConfig.imports | public static TileSheetsConfig imports(Media configSheets) {
"""
Import the sheets data from configuration.
@param configSheets The file that define the sheets configuration (must not be <code>null</code>).
@return The tile sheet configuration.
@throws LionEngineException If unable to read data.
"""
... | java | public static TileSheetsConfig imports(Media configSheets)
{
final Xml nodeSheets = new Xml(configSheets);
final Xml nodeTileSize = nodeSheets.getChild(NODE_TILE_SIZE);
final int tileWidth = nodeTileSize.readInteger(ATT_TILE_WIDTH);
final int tileHeight = nodeTileSize.readInte... | [
"public",
"static",
"TileSheetsConfig",
"imports",
"(",
"Media",
"configSheets",
")",
"{",
"final",
"Xml",
"nodeSheets",
"=",
"new",
"Xml",
"(",
"configSheets",
")",
";",
"final",
"Xml",
"nodeTileSize",
"=",
"nodeSheets",
".",
"getChild",
"(",
"NODE_TILE_SIZE",
... | Import the sheets data from configuration.
@param configSheets The file that define the sheets configuration (must not be <code>null</code>).
@return The tile sheet configuration.
@throws LionEngineException If unable to read data. | [
"Import",
"the",
"sheets",
"data",
"from",
"configuration",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/TileSheetsConfig.java#L58-L69 |
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 {
"""
This implementation simply calls {@link #createRequest(URI, HttpMethod, MfClientHttpRequestFactory)}
(if the matchers are OK) with the wrapped request factory provided to the... | 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 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.notifyChildMoved | @UiThread
public void notifyChildMoved(int parentPosition, int fromChildPosition, int toChildPosition) {
"""
Notify any registered observers that the child list item contained within the parent
at {@code parentPosition} has moved from {@code fromChildPosition} to {@code toChildPosition}.
<p>
<p>This is a st... | java | @UiThread
public void notifyChildMoved(int parentPosition, int fromChildPosition, int toChildPosition) {
P parent = mParentList.get(parentPosition);
int flatParentPosition = getFlatParentPosition(parentPosition);
ExpandableWrapper<P, C> parentWrapper = mFlatItemList.get(flatParentPosition);... | [
"@",
"UiThread",
"public",
"void",
"notifyChildMoved",
"(",
"int",
"parentPosition",
",",
"int",
"fromChildPosition",
",",
"int",
"toChildPosition",
")",
"{",
"P",
"parent",
"=",
"mParentList",
".",
"get",
"(",
"parentPosition",
")",
";",
"int",
"flatParentPosit... | Notify any registered observers that the child list item contained within the parent
at {@code parentPosition} has moved from {@code fromChildPosition} to {@code toChildPosition}.
<p>
<p>This is a structural change event. Representations of other existing items in the
data set are still considered up to date and will n... | [
"Notify",
"any",
"registered",
"observers",
"that",
"the",
"child",
"list",
"item",
"contained",
"within",
"the",
"parent",
"at",
"{",
"@code",
"parentPosition",
"}",
"has",
"moved",
"from",
"{",
"@code",
"fromChildPosition",
"}",
"to",
"{",
"@code",
"toChildP... | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L1297-L1309 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.unbox | public static byte[] unbox(final Byte[] a, final byte valueForNull) {
"""
<p>
Converts an array of object Bytes to primitives handling {@code null}.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code Byte} array, may be {@code null}
@param valueForNull
the... | java | public static byte[] unbox(final Byte[] a, final byte valueForNull) {
if (a == null) {
return null;
}
return unbox(a, 0, a.length, valueForNull);
} | [
"public",
"static",
"byte",
"[",
"]",
"unbox",
"(",
"final",
"Byte",
"[",
"]",
"a",
",",
"final",
"byte",
"valueForNull",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"unbox",
"(",
"a",
",",
"0",
",",
... | <p>
Converts an array of object Bytes to primitives handling {@code null}.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code Byte} array, may be {@code null}
@param valueForNull
the value to insert if {@code null} found
@return a {@code byte} array, {@code null} if null ... | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"object",
"Bytes",
"to",
"primitives",
"handling",
"{",
"@code",
"null",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L901-L907 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsNotFoundOnFileSystem | public FessMessages addErrorsNotFoundOnFileSystem(String property, String arg0) {
"""
Add the created action message for the key 'errors.not_found_on_file_system' with parameters.
<pre>
message: Not Found: {0}
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 f... | java | public FessMessages addErrorsNotFoundOnFileSystem(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_not_found_on_file_system, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsNotFoundOnFileSystem",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_not_found_on_file_system",
",",
... | Add the created action message for the key 'errors.not_found_on_file_system' with parameters.
<pre>
message: Not Found: {0}
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"not_found_on_file_system",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Not",
"Found",
":",
"{",
"0",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1403-L1407 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DB.java | DB.teardown | void teardown(CallInfo callInfo, boolean closeConn) {
"""
Tear down the database handle, freeing any internal
resources.
@param callInfo Call info.
@param closeConn Close underlying connection.
"""
logSetup(callInfo);
if (pool != null) {
for (WrappedStatement ws : pool.values()) {
igno... | java | void teardown(CallInfo callInfo, boolean closeConn) {
logSetup(callInfo);
if (pool != null) {
for (WrappedStatement ws : pool.values()) {
ignoreSQLException(ws.getStatement()::close);
}
pool.clear();
pool = null;
}
clearSavePointIfSet();
log.close();
log = null;
... | [
"void",
"teardown",
"(",
"CallInfo",
"callInfo",
",",
"boolean",
"closeConn",
")",
"{",
"logSetup",
"(",
"callInfo",
")",
";",
"if",
"(",
"pool",
"!=",
"null",
")",
"{",
"for",
"(",
"WrappedStatement",
"ws",
":",
"pool",
".",
"values",
"(",
")",
")",
... | Tear down the database handle, freeing any internal
resources.
@param callInfo Call info.
@param closeConn Close underlying connection. | [
"Tear",
"down",
"the",
"database",
"handle",
"freeing",
"any",
"internal",
"resources",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DB.java#L401-L416 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java | AuthorizationProcessManager.authorizationRequestSend | private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) {
"""
Use authorization request agent for sending the request
@param context android activity that will handle authentication (facebook, google)
@param path pat... | java | private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) {
try {
AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager();
authorizationRequestManager.initia... | [
"private",
"void",
"authorizationRequestSend",
"(",
"final",
"Context",
"context",
",",
"String",
"path",
",",
"AuthorizationRequestManager",
".",
"RequestOptions",
"options",
",",
"ResponseListener",
"listener",
")",
"{",
"try",
"{",
"AuthorizationRequestManager",
"aut... | Use authorization request agent for sending the request
@param context android activity that will handle authentication (facebook, google)
@param path path to the server
@param options send options
@param listener response listener | [
"Use",
"authorization",
"request",
"agent",
"for",
"sending",
"the",
"request"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java#L418-L426 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentService.java | CmsContentService.transferInvisibleValues | protected void transferInvisibleValues(CmsEntity original, CmsEntity target, CmsContentTypeVisitor visitor) {
"""
Transfers values marked as invisible from the original entity to the target entity.<p>
@param original the original entity
@param target the target entiy
@param visitor the type visitor holding th... | java | protected void transferInvisibleValues(CmsEntity original, CmsEntity target, CmsContentTypeVisitor visitor) {
List<String> invisibleAttributes = new ArrayList<String>();
for (Entry<String, CmsAttributeConfiguration> configEntry : visitor.getAttributeConfigurations().entrySet()) {
if (!confi... | [
"protected",
"void",
"transferInvisibleValues",
"(",
"CmsEntity",
"original",
",",
"CmsEntity",
"target",
",",
"CmsContentTypeVisitor",
"visitor",
")",
"{",
"List",
"<",
"String",
">",
"invisibleAttributes",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
... | Transfers values marked as invisible from the original entity to the target entity.<p>
@param original the original entity
@param target the target entiy
@param visitor the type visitor holding the content type configuration | [
"Transfers",
"values",
"marked",
"as",
"invisible",
"from",
"the",
"original",
"entity",
"to",
"the",
"target",
"entity",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentService.java#L1230-L1245 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java | AbstractTypeCheckingExtension.makeDynamic | public MethodNode makeDynamic(MethodCall call, ClassNode returnType) {
"""
Used to instruct the type checker that the call is a dynamic method call.
Calling this method automatically sets the handled flag to true.
@param call the method call which is a dynamic method call
@param returnType the expected return t... | java | public MethodNode makeDynamic(MethodCall call, ClassNode returnType) {
TypeCheckingContext.EnclosingClosure enclosingClosure = context.getEnclosingClosure();
MethodNode enclosingMethod = context.getEnclosingMethod();
((ASTNode)call).putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, returnTyp... | [
"public",
"MethodNode",
"makeDynamic",
"(",
"MethodCall",
"call",
",",
"ClassNode",
"returnType",
")",
"{",
"TypeCheckingContext",
".",
"EnclosingClosure",
"enclosingClosure",
"=",
"context",
".",
"getEnclosingClosure",
"(",
")",
";",
"MethodNode",
"enclosingMethod",
... | Used to instruct the type checker that the call is a dynamic method call.
Calling this method automatically sets the handled flag to true.
@param call the method call which is a dynamic method call
@param returnType the expected return type of the dynamic call
@return a virtual method node with the same name as the exp... | [
"Used",
"to",
"instruct",
"the",
"type",
"checker",
"that",
"the",
"call",
"is",
"a",
"dynamic",
"method",
"call",
".",
"Calling",
"this",
"method",
"automatically",
"sets",
"the",
"handled",
"flag",
"to",
"true",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java#L275-L289 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/IOUtils.java | IOUtils.copyStream | public static void copyStream(final InputStream aInStream, final OutputStream aOutStream) throws IOException {
"""
Writes from an input stream to an output stream; you're responsible for closing the <code>InputStream</code>
and <code>OutputStream</code>.
@param aInStream The stream from which to read
@param a... | java | public static void copyStream(final InputStream aInStream, final OutputStream aOutStream) throws IOException {
final BufferedOutputStream outStream = new BufferedOutputStream(aOutStream);
final BufferedInputStream inStream = new BufferedInputStream(aInStream);
final ByteArrayOutputStream byteStr... | [
"public",
"static",
"void",
"copyStream",
"(",
"final",
"InputStream",
"aInStream",
",",
"final",
"OutputStream",
"aOutStream",
")",
"throws",
"IOException",
"{",
"final",
"BufferedOutputStream",
"outStream",
"=",
"new",
"BufferedOutputStream",
"(",
"aOutStream",
")",... | Writes from an input stream to an output stream; you're responsible for closing the <code>InputStream</code>
and <code>OutputStream</code>.
@param aInStream The stream from which to read
@param aOutStream The stream from which to write
@throws IOException If there is trouble reading or writing | [
"Writes",
"from",
"an",
"input",
"stream",
"to",
"an",
"output",
"stream",
";",
"you",
"re",
"responsible",
"for",
"closing",
"the",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"and",
"<code",
">",
"OutputStream<",
"/",
"code",
">",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/IOUtils.java#L147-L166 |
onepf/OPFUtils | opfutils/src/main/java/org/onepf/opfutils/OPFChecks.java | OPFChecks.hasMetadata | public static boolean hasMetadata(@NonNull final Context context, @NonNull final String metadataKey) {
"""
Checks if metadata is added in AndroidManifest.xml file.
@param context The instance of {@link android.content.Context}.
@param metadataKey The checked metadata key.
@return True if metadata is added... | java | public static boolean hasMetadata(@NonNull final Context context, @NonNull final String metadataKey) {
if (TextUtils.isEmpty(metadataKey)) {
throw new IllegalArgumentException("Meta data key can't be null or empty.");
}
try {
final PackageInfo info = context.getPackageMa... | [
"public",
"static",
"boolean",
"hasMetadata",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"String",
"metadataKey",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"metadataKey",
")",
")",
"{",
"throw",
"new",
"I... | Checks if metadata is added in AndroidManifest.xml file.
@param context The instance of {@link android.content.Context}.
@param metadataKey The checked metadata key.
@return True if metadata is added, false otherwise. | [
"Checks",
"if",
"metadata",
"is",
"added",
"in",
"AndroidManifest",
".",
"xml",
"file",
"."
] | train | https://github.com/onepf/OPFUtils/blob/e30c2c64077c5d577c0cd7d3cead809d31f7dab1/opfutils/src/main/java/org/onepf/opfutils/OPFChecks.java#L150-L166 |
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.moveToServer | public void moveToServer (String hostname, int[] ports, InvocationService.ConfirmListener 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... | 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 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java | FundamentalLinear.createA | protected void createA(List<AssociatedPair> points, DMatrixRMaj A ) {
"""
Reorganizes the epipolar constraint equation (x<sup>T</sup><sub>2</sub>*F*x<sub>1</sub> = 0) such that it
is formulated as a standard linear system of the form Ax=0. Where A contains the pixel locations and x is
the reformatted fundamenta... | java | protected void createA(List<AssociatedPair> points, DMatrixRMaj A ) {
A.reshape(points.size(),9, false);
A.zero();
Point2D_F64 f_norm = new Point2D_F64();
Point2D_F64 s_norm = new Point2D_F64();
final int size = points.size();
for( int i = 0; i < size; i++ ) {
AssociatedPair p = points.get(i);
Poin... | [
"protected",
"void",
"createA",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"DMatrixRMaj",
"A",
")",
"{",
"A",
".",
"reshape",
"(",
"points",
".",
"size",
"(",
")",
",",
"9",
",",
"false",
")",
";",
"A",
".",
"zero",
"(",
")",
";",
"P... | Reorganizes the epipolar constraint equation (x<sup>T</sup><sub>2</sub>*F*x<sub>1</sub> = 0) such that it
is formulated as a standard linear system of the form Ax=0. Where A contains the pixel locations and x is
the reformatted fundamental matrix.
@param points Set of associated points in left and right images.
@para... | [
"Reorganizes",
"the",
"epipolar",
"constraint",
"equation",
"(",
"x<sup",
">",
"T<",
"/",
"sup",
">",
"<sub",
">",
"2<",
"/",
"sub",
">",
"*",
"F",
"*",
"x<sub",
">",
"1<",
"/",
"sub",
">",
"=",
"0",
")",
"such",
"that",
"it",
"is",
"formulated",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java#L141-L171 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/http/HttpHeaders.java | HttpHeaders.varyHeaders | public static Headers varyHeaders(Headers requestHeaders, Headers responseHeaders) {
"""
Returns the subset of the headers in {@code requestHeaders} that impact the content of
response's body.
"""
Set<String> varyFields = varyFields(responseHeaders);
if (varyFields.isEmpty()) return EMPTY_HEADERS;
... | java | public static Headers varyHeaders(Headers requestHeaders, Headers responseHeaders) {
Set<String> varyFields = varyFields(responseHeaders);
if (varyFields.isEmpty()) return EMPTY_HEADERS;
Headers.Builder result = new Headers.Builder();
for (int i = 0, size = requestHeaders.size(); i < size; i++) {
... | [
"public",
"static",
"Headers",
"varyHeaders",
"(",
"Headers",
"requestHeaders",
",",
"Headers",
"responseHeaders",
")",
"{",
"Set",
"<",
"String",
">",
"varyFields",
"=",
"varyFields",
"(",
"responseHeaders",
")",
";",
"if",
"(",
"varyFields",
".",
"isEmpty",
... | Returns the subset of the headers in {@code requestHeaders} that impact the content of
response's body. | [
"Returns",
"the",
"subset",
"of",
"the",
"headers",
"in",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/http/HttpHeaders.java#L135-L147 |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrDocument.java | CmsSolrDocument.addDocumentDependency | public void addDocumentDependency(CmsObject cms, CmsDocumentDependency resDeps) {
"""
Adds the given document dependency to this document.<p>
@param cms the current CmsObject
@param resDeps the dependency
"""
if (resDeps != null) {
m_doc.addField(CmsSearchField.FIELD_DEPENDENCY_TYPE, r... | java | public void addDocumentDependency(CmsObject cms, CmsDocumentDependency resDeps) {
if (resDeps != null) {
m_doc.addField(CmsSearchField.FIELD_DEPENDENCY_TYPE, resDeps.getType());
if ((resDeps.getMainDocument() != null) && (resDeps.getType() != null)) {
m_doc.addField(
... | [
"public",
"void",
"addDocumentDependency",
"(",
"CmsObject",
"cms",
",",
"CmsDocumentDependency",
"resDeps",
")",
"{",
"if",
"(",
"resDeps",
"!=",
"null",
")",
"{",
"m_doc",
".",
"addField",
"(",
"CmsSearchField",
".",
"FIELD_DEPENDENCY_TYPE",
",",
"resDeps",
".... | Adds the given document dependency to this document.<p>
@param cms the current CmsObject
@param resDeps the dependency | [
"Adds",
"the",
"given",
"document",
"dependency",
"to",
"this",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrDocument.java#L150-L170 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java | Partition.createRangePartitionWithSubPartition | static Partition createRangePartitionWithSubPartition(
SqlgGraph sqlgGraph,
AbstractLabel abstractLabel,
String name,
String from,
String to,
PartitionType partitionType,
String partitionExpression) {
"""
Create a range partition o... | java | static Partition createRangePartitionWithSubPartition(
SqlgGraph sqlgGraph,
AbstractLabel abstractLabel,
String name,
String from,
String to,
PartitionType partitionType,
String partitionExpression) {
Preconditions.checkArgumen... | [
"static",
"Partition",
"createRangePartitionWithSubPartition",
"(",
"SqlgGraph",
"sqlgGraph",
",",
"AbstractLabel",
"abstractLabel",
",",
"String",
"name",
",",
"String",
"from",
",",
"String",
"to",
",",
"PartitionType",
"partitionType",
",",
"String",
"partitionExpres... | Create a range partition on an {@link AbstractLabel} that will itself be sub-partitioned
@param sqlgGraph
@param abstractLabel
@param name
@param from
@param to
@param partitionType
@param partitionExpression
@return | [
"Create",
"a",
"range",
"partition",
"on",
"an",
"{",
"@link",
"AbstractLabel",
"}",
"that",
"will",
"itself",
"be",
"sub",
"-",
"partitioned"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java#L256-L284 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.