repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/HashmapDatabase.java | HashmapDatabase.alignColumns | protected Relation<?>[] alignColumns(ObjectBundle pack) {
// align representations.
Relation<?>[] targets = new Relation<?>[pack.metaLength()];
long[] used = BitsUtil.zero(relations.size());
for(int i = 0; i < targets.length; i++) {
SimpleTypeInformation<?> meta = pack.meta(i);
// TODO: aggr... | java | protected Relation<?>[] alignColumns(ObjectBundle pack) {
// align representations.
Relation<?>[] targets = new Relation<?>[pack.metaLength()];
long[] used = BitsUtil.zero(relations.size());
for(int i = 0; i < targets.length; i++) {
SimpleTypeInformation<?> meta = pack.meta(i);
// TODO: aggr... | [
"protected",
"Relation",
"<",
"?",
">",
"[",
"]",
"alignColumns",
"(",
"ObjectBundle",
"pack",
")",
"{",
"// align representations.",
"Relation",
"<",
"?",
">",
"[",
"]",
"targets",
"=",
"new",
"Relation",
"<",
"?",
">",
"[",
"pack",
".",
"metaLength",
"... | Find a mapping from package columns to database columns, eventually adding
new database columns when needed.
@param pack Package to process
@return Column mapping | [
"Find",
"a",
"mapping",
"from",
"package",
"columns",
"to",
"database",
"columns",
"eventually",
"adding",
"new",
"database",
"columns",
"when",
"needed",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/HashmapDatabase.java#L170-L192 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(CharBuffer charValue, CacheScope cacheScope) {
int keyLength = charValue.length();
if ((lengthLimit < 0 || keyLength <= lengthLimit)) {
Map<CharBuffer, String> cache = (cacheScope == CacheScope.GLOBAL_SCOPE) ? globalCache : applicationCache;
String value = cac... | java | public String apply(CharBuffer charValue, CacheScope cacheScope) {
int keyLength = charValue.length();
if ((lengthLimit < 0 || keyLength <= lengthLimit)) {
Map<CharBuffer, String> cache = (cacheScope == CacheScope.GLOBAL_SCOPE) ? globalCache : applicationCache;
String value = cac... | [
"public",
"String",
"apply",
"(",
"CharBuffer",
"charValue",
",",
"CacheScope",
"cacheScope",
")",
"{",
"int",
"keyLength",
"=",
"charValue",
".",
"length",
"(",
")",
";",
"if",
"(",
"(",
"lengthLimit",
"<",
"0",
"||",
"keyLength",
"<=",
"lengthLimit",
")"... | returns a object of type T that may be interned at the specified scope to
reduce heap consumption
@param charValue
@param cacheScope
@param trabsform
@return a possibly interned instance of T | [
"returns",
"a",
"object",
"of",
"type",
"T",
"that",
"may",
"be",
"interned",
"at",
"the",
"specified",
"scope",
"to",
"reduce",
"heap",
"consumption"
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L233-L248 |
grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.addArtefact | public GrailsClass addArtefact(String artefactType, GrailsClass artefactGrailsClass) {
ArtefactHandler handler = artefactHandlersByName.get(artefactType);
if (handler.isArtefactGrailsClass(artefactGrailsClass)) {
// Store the GrailsClass in cache
DefaultArtefactInfo info = getArt... | java | public GrailsClass addArtefact(String artefactType, GrailsClass artefactGrailsClass) {
ArtefactHandler handler = artefactHandlersByName.get(artefactType);
if (handler.isArtefactGrailsClass(artefactGrailsClass)) {
// Store the GrailsClass in cache
DefaultArtefactInfo info = getArt... | [
"public",
"GrailsClass",
"addArtefact",
"(",
"String",
"artefactType",
",",
"GrailsClass",
"artefactGrailsClass",
")",
"{",
"ArtefactHandler",
"handler",
"=",
"artefactHandlersByName",
".",
"get",
"(",
"artefactType",
")",
";",
"if",
"(",
"handler",
".",
"isArtefact... | Adds an artefact of the given type for the given GrailsClass.
@param artefactType The type of the artefact as defined by a ArtefactHandler instance
@param artefactGrailsClass A GrailsClass instance that matches the type defined by the ArtefactHandler
@return The GrailsClass if successful or null if it couldn't ... | [
"Adds",
"an",
"artefact",
"of",
"the",
"given",
"type",
"for",
"the",
"given",
"GrailsClass",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L516-L531 |
Metrink/croquet | croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java | CroquetRestBuilder.checkLoggingSettings | protected void checkLoggingSettings() {
final LoggingSettings logSettings = settings.getLoggingSettings();
final LogFile logFileSettings = logSettings.getLogFile();
if(logFileSettings.getCurrentLogFilename() != null &&
logFileSettings.isEnabled() == false) {
LOG.warn("You... | java | protected void checkLoggingSettings() {
final LoggingSettings logSettings = settings.getLoggingSettings();
final LogFile logFileSettings = logSettings.getLogFile();
if(logFileSettings.getCurrentLogFilename() != null &&
logFileSettings.isEnabled() == false) {
LOG.warn("You... | [
"protected",
"void",
"checkLoggingSettings",
"(",
")",
"{",
"final",
"LoggingSettings",
"logSettings",
"=",
"settings",
".",
"getLoggingSettings",
"(",
")",
";",
"final",
"LogFile",
"logFileSettings",
"=",
"logSettings",
".",
"getLogFile",
"(",
")",
";",
"if",
"... | Runs some checks over the log settings before building a {@link Corquet} instance. | [
"Runs",
"some",
"checks",
"over",
"the",
"log",
"settings",
"before",
"building",
"a",
"{"
] | train | https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java#L138-L151 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallClientVersionSummary | public static ClientVersionSummaryBean unmarshallClientVersionSummary(Map<String, Object> source) {
if (source == null) {
return null;
}
ClientVersionSummaryBean bean = new ClientVersionSummaryBean();
bean.setDescription(asString(source.get("clientDescription")));
bea... | java | public static ClientVersionSummaryBean unmarshallClientVersionSummary(Map<String, Object> source) {
if (source == null) {
return null;
}
ClientVersionSummaryBean bean = new ClientVersionSummaryBean();
bean.setDescription(asString(source.get("clientDescription")));
bea... | [
"public",
"static",
"ClientVersionSummaryBean",
"unmarshallClientVersionSummary",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ClientVersionSummaryBean",
"bean",
"=",... | Unmarshals the given map source into a bean.
@param source the source
@return the client version summary | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1084-L1099 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_ip_duration_POST | public OvhOrder dedicatedCloud_serviceName_ip_duration_POST(String serviceName, String duration, OvhIpCountriesEnum country, String description, Long estimatedClientsNumber, String networkName, OvhOrderableIpBlockRangeEnum size, String usage) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/ip... | java | public OvhOrder dedicatedCloud_serviceName_ip_duration_POST(String serviceName, String duration, OvhIpCountriesEnum country, String description, Long estimatedClientsNumber, String networkName, OvhOrderableIpBlockRangeEnum size, String usage) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/ip... | [
"public",
"OvhOrder",
"dedicatedCloud_serviceName_ip_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhIpCountriesEnum",
"country",
",",
"String",
"description",
",",
"Long",
"estimatedClientsNumber",
",",
"String",
"networkName",
",",
"Ovh... | Create order
REST: POST /order/dedicatedCloud/{serviceName}/ip/{duration}
@param size [required] The network ranges orderable
@param usage [required] Basic information of how will this bloc be used (as "web","ssl","cloud" or other things)
@param description [required] Information visible on whois (minimum 3 and maximu... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5850-L5862 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java | RoaringBitmap.maximumSerializedSize | public static long maximumSerializedSize(long cardinality, long universe_size) {
long contnbr = (universe_size + 65535) / 65536;
if (contnbr > cardinality) {
contnbr = cardinality;
// we can't have more containers than we have values
}
final long headermax = Math.max(8, 4 + (contnbr + 7) / 8... | java | public static long maximumSerializedSize(long cardinality, long universe_size) {
long contnbr = (universe_size + 65535) / 65536;
if (contnbr > cardinality) {
contnbr = cardinality;
// we can't have more containers than we have values
}
final long headermax = Math.max(8, 4 + (contnbr + 7) / 8... | [
"public",
"static",
"long",
"maximumSerializedSize",
"(",
"long",
"cardinality",
",",
"long",
"universe_size",
")",
"{",
"long",
"contnbr",
"=",
"(",
"universe_size",
"+",
"65535",
")",
"/",
"65536",
";",
"if",
"(",
"contnbr",
">",
"cardinality",
")",
"{",
... | Assume that one wants to store "cardinality" integers in [0, universe_size), this function
returns an upper bound on the serialized size in bytes.
@param cardinality maximal cardinality
@param universe_size maximal value
@return upper bound on the serialized size in bytes of the bitmap | [
"Assume",
"that",
"one",
"wants",
"to",
"store",
"cardinality",
"integers",
"in",
"[",
"0",
"universe_size",
")",
"this",
"function",
"returns",
"an",
"upper",
"bound",
"on",
"the",
"serialized",
"size",
"in",
"bytes",
"."
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L2532-L2543 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java | Preconditions.checkPreconditionL | public static long checkPreconditionL(
final long value,
final boolean condition,
final LongFunction<String> describer)
{
return innerCheckL(value, condition, describer);
} | java | public static long checkPreconditionL(
final long value,
final boolean condition,
final LongFunction<String> describer)
{
return innerCheckL(value, condition, describer);
} | [
"public",
"static",
"long",
"checkPreconditionL",
"(",
"final",
"long",
"value",
",",
"final",
"boolean",
"condition",
",",
"final",
"LongFunction",
"<",
"String",
">",
"describer",
")",
"{",
"return",
"innerCheckL",
"(",
"value",
",",
"condition",
",",
"descr... | A {@code long} specialized version of {@link #checkPrecondition(Object,
Predicate, Function)}
@param condition The predicate
@param value The value
@param describer The describer of the predicate
@return value
@throws PreconditionViolationException If the predicate is false | [
"A",
"{",
"@code",
"long",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPrecondition",
"(",
"Object",
"Predicate",
"Function",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java#L479-L485 |
jbundle/jbundle | base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/message/trx/transport/xml/XMLMessageTransport.java | XMLMessageTransport.createExternalMessage | public ExternalMessage createExternalMessage(BaseMessage message, Object rawData)
{
ExternalMessage externalTrxMessageOut = super.createExternalMessage(message, rawData);
if (externalTrxMessageOut == null)
{
if (MessageTypeModel.MESSAGE_IN.equalsIgnoreCase((String)message.get(Trx... | java | public ExternalMessage createExternalMessage(BaseMessage message, Object rawData)
{
ExternalMessage externalTrxMessageOut = super.createExternalMessage(message, rawData);
if (externalTrxMessageOut == null)
{
if (MessageTypeModel.MESSAGE_IN.equalsIgnoreCase((String)message.get(Trx... | [
"public",
"ExternalMessage",
"createExternalMessage",
"(",
"BaseMessage",
"message",
",",
"Object",
"rawData",
")",
"{",
"ExternalMessage",
"externalTrxMessageOut",
"=",
"super",
".",
"createExternalMessage",
"(",
"message",
",",
"rawData",
")",
";",
"if",
"(",
"ext... | Get the external message container for this Internal message.
Typically, the overriding class supplies a default format for the transport type.
<br/>NOTE: The message header from the internal message is copies, but not the message itself.
@param The internalTrxMessage that I will convert to this external format.
@retur... | [
"Get",
"the",
"external",
"message",
"container",
"for",
"this",
"Internal",
"message",
".",
"Typically",
"the",
"overriding",
"class",
"supplies",
"a",
"default",
"format",
"for",
"the",
"transport",
"type",
".",
"<br",
"/",
">",
"NOTE",
":",
"The",
"messag... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/message/trx/transport/xml/XMLMessageTransport.java#L79-L90 |
andrehertwig/admintool | admin-tools-dbbrowser/src/main/java/de/chandre/admintool/db/AdminToolDBBrowserServiceImpl.java | AdminToolDBBrowserServiceImpl.getClobString | protected String getClobString(Clob clobObject, String encoding) throws IOException, SQLException, UnsupportedEncodingException
{
if (null == clobObject) {
return "";
}
InputStream in = clobObject.getAsciiStream();
Reader read = new InputStreamReader(in, encoding);
StringWriter... | java | protected String getClobString(Clob clobObject, String encoding) throws IOException, SQLException, UnsupportedEncodingException
{
if (null == clobObject) {
return "";
}
InputStream in = clobObject.getAsciiStream();
Reader read = new InputStreamReader(in, encoding);
StringWriter... | [
"protected",
"String",
"getClobString",
"(",
"Clob",
"clobObject",
",",
"String",
"encoding",
")",
"throws",
"IOException",
",",
"SQLException",
",",
"UnsupportedEncodingException",
"{",
"if",
"(",
"null",
"==",
"clobObject",
")",
"{",
"return",
"\"\"",
";",
"}"... | turns clob into a string
@param clobObject
@param encoding
@return
@throws IOException
@throws SQLException
@throws UnsupportedEncodingException | [
"turns",
"clob",
"into",
"a",
"string"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-dbbrowser/src/main/java/de/chandre/admintool/db/AdminToolDBBrowserServiceImpl.java#L391-L414 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.countByG_A_P | @Override
public int countByG_A_P(long groupId, boolean active, boolean primary) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_A_P;
Object[] finderArgs = new Object[] { groupId, active, primary };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundle... | java | @Override
public int countByG_A_P(long groupId, boolean active, boolean primary) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_A_P;
Object[] finderArgs = new Object[] { groupId, active, primary };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundle... | [
"@",
"Override",
"public",
"int",
"countByG_A_P",
"(",
"long",
"groupId",
",",
"boolean",
"active",
",",
"boolean",
"primary",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_A_P",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
... | Returns the number of commerce warehouses where groupId = ? and active = ? and primary = ?.
@param groupId the group ID
@param active the active
@param primary the primary
@return the number of matching commerce warehouses | [
"Returns",
"the",
"number",
"of",
"commerce",
"warehouses",
"where",
"groupId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"and",
"primary",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L3374-L3425 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDAttribute.java | DTDAttribute.checkEntity | protected void checkEntity(InputProblemReporter rep, String id, EntityDecl ent)
throws XMLStreamException
{
if (ent == null) {
rep.reportValidationProblem("Referenced entity '"+id+"' not defined");
} else if (ent.isParsed()) {
rep.reportValidationProblem("Referenced e... | java | protected void checkEntity(InputProblemReporter rep, String id, EntityDecl ent)
throws XMLStreamException
{
if (ent == null) {
rep.reportValidationProblem("Referenced entity '"+id+"' not defined");
} else if (ent.isParsed()) {
rep.reportValidationProblem("Referenced e... | [
"protected",
"void",
"checkEntity",
"(",
"InputProblemReporter",
"rep",
",",
"String",
"id",
",",
"EntityDecl",
"ent",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"ent",
"==",
"null",
")",
"{",
"rep",
".",
"reportValidationProblem",
"(",
"\"Referenced e... | /* Too bad this method can not be combined with previous segment --
the reason is that DTDValidator does not implement
InputProblemReporter... | [
"/",
"*",
"Too",
"bad",
"this",
"method",
"can",
"not",
"be",
"combined",
"with",
"previous",
"segment",
"--",
"the",
"reason",
"is",
"that",
"DTDValidator",
"does",
"not",
"implement",
"InputProblemReporter",
"..."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java#L469-L477 |
soabase/exhibitor | exhibitor-core/src/main/java/com/netflix/exhibitor/core/config/DefaultProperties.java | DefaultProperties.getFromInstanceConfig | public static Properties getFromInstanceConfig(InstanceConfig defaultInstanceConfig)
{
PropertyBasedInstanceConfig config = new PropertyBasedInstanceConfig(new ConfigCollectionImpl(defaultInstanceConfig, null));
return config.getProperties();
} | java | public static Properties getFromInstanceConfig(InstanceConfig defaultInstanceConfig)
{
PropertyBasedInstanceConfig config = new PropertyBasedInstanceConfig(new ConfigCollectionImpl(defaultInstanceConfig, null));
return config.getProperties();
} | [
"public",
"static",
"Properties",
"getFromInstanceConfig",
"(",
"InstanceConfig",
"defaultInstanceConfig",
")",
"{",
"PropertyBasedInstanceConfig",
"config",
"=",
"new",
"PropertyBasedInstanceConfig",
"(",
"new",
"ConfigCollectionImpl",
"(",
"defaultInstanceConfig",
",",
"nul... | Return the default properties given an instance config
@param defaultInstanceConfig the default properties as an object
@return default properties | [
"Return",
"the",
"default",
"properties",
"given",
"an",
"instance",
"config"
] | train | https://github.com/soabase/exhibitor/blob/d345d2d45c75b0694b562b6c346f8594f3a5d166/exhibitor-core/src/main/java/com/netflix/exhibitor/core/config/DefaultProperties.java#L58-L62 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/AbstractChronology.java | AbstractChronology.registerChrono | static Chronology registerChrono(Chronology chrono, String id) {
Chronology prev = CHRONOS_BY_ID.putIfAbsent(id, chrono);
if (prev == null) {
String type = chrono.getCalendarType();
if (type != null) {
CHRONOS_BY_TYPE.putIfAbsent(type, chrono);
}
... | java | static Chronology registerChrono(Chronology chrono, String id) {
Chronology prev = CHRONOS_BY_ID.putIfAbsent(id, chrono);
if (prev == null) {
String type = chrono.getCalendarType();
if (type != null) {
CHRONOS_BY_TYPE.putIfAbsent(type, chrono);
}
... | [
"static",
"Chronology",
"registerChrono",
"(",
"Chronology",
"chrono",
",",
"String",
"id",
")",
"{",
"Chronology",
"prev",
"=",
"CHRONOS_BY_ID",
".",
"putIfAbsent",
"(",
"id",
",",
"chrono",
")",
";",
"if",
"(",
"prev",
"==",
"null",
")",
"{",
"String",
... | Register a Chronology by ID and type for lookup by {@link #of(String)}.
Chronos must not be registered until they are completely constructed.
Specifically, not in the constructor of Chronology.
@param chrono the chronology to register; not null
@param id the ID to register the chronology; not null
@return the already ... | [
"Register",
"a",
"Chronology",
"by",
"ID",
"and",
"type",
"for",
"lookup",
"by",
"{",
"@link",
"#of",
"(",
"String",
")",
"}",
".",
"Chronos",
"must",
"not",
"be",
"registered",
"until",
"they",
"are",
"completely",
"constructed",
".",
"Specifically",
"not... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/AbstractChronology.java#L189-L198 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertTableExists | @SafeVarargs
public static void assertTableExists(DB db, String... tableNames) throws DBAssertionError {
multipleTableExistenceAssertions(CallInfo.create(), db, tableNames, true);
} | java | @SafeVarargs
public static void assertTableExists(DB db, String... tableNames) throws DBAssertionError {
multipleTableExistenceAssertions(CallInfo.create(), db, tableNames, true);
} | [
"@",
"SafeVarargs",
"public",
"static",
"void",
"assertTableExists",
"(",
"DB",
"db",
",",
"String",
"...",
"tableNames",
")",
"throws",
"DBAssertionError",
"{",
"multipleTableExistenceAssertions",
"(",
"CallInfo",
".",
"create",
"(",
")",
",",
"db",
",",
"table... | Assert that tables exist in the database.
@param db Database.
@param tableNames Table names.
@throws DBAssertionError If the assertion fails.
@see #assertTableDoesNotExist(DB, String...)
@see #drop(Table...)
@since 1.2 | [
"Assert",
"that",
"tables",
"exist",
"in",
"the",
"database",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L794-L797 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java | CommerceRegionPersistenceImpl.findByC_A | @Override
public List<CommerceRegion> findByC_A(long commerceCountryId,
boolean active, int start, int end) {
return findByC_A(commerceCountryId, active, start, end, null);
} | java | @Override
public List<CommerceRegion> findByC_A(long commerceCountryId,
boolean active, int start, int end) {
return findByC_A(commerceCountryId, active, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceRegion",
">",
"findByC_A",
"(",
"long",
"commerceCountryId",
",",
"boolean",
"active",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByC_A",
"(",
"commerceCountryId",
",",
"active",
",",
"st... | Returns a range of all the commerce regions where commerceCountryId = ? and active = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to t... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"regions",
"where",
"commerceCountryId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L2300-L2304 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final String name, final A rs) {
return register(true, name, rs);
} | java | public <A> A register(final String name, final A rs) {
return register(true, name, rs);
} | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"String",
"name",
",",
"final",
"A",
"rs",
")",
"{",
"return",
"register",
"(",
"true",
",",
"name",
",",
"rs",
")",
";",
"}"
] | 将对象以指定资源名注入到资源池中,并同步已被注入的资源
@param <A> 泛型
@param name 资源名
@param rs 资源对象
@return 旧资源对象 | [
"将对象以指定资源名注入到资源池中,并同步已被注入的资源"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L334-L336 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java | TileBoundingBoxJavaUtils.getFloatRectangle | public static ImageRectangleF getFloatRectangle(long width, long height,
BoundingBox boundingBox, BoundingBox boundingBoxSection) {
float left = TileBoundingBoxUtils.getXPixel(width, boundingBox,
boundingBoxSection.getMinLongitude());
float right = TileBoundingBoxUtils.getXPixel(width, boundingBox,
boun... | java | public static ImageRectangleF getFloatRectangle(long width, long height,
BoundingBox boundingBox, BoundingBox boundingBoxSection) {
float left = TileBoundingBoxUtils.getXPixel(width, boundingBox,
boundingBoxSection.getMinLongitude());
float right = TileBoundingBoxUtils.getXPixel(width, boundingBox,
boun... | [
"public",
"static",
"ImageRectangleF",
"getFloatRectangle",
"(",
"long",
"width",
",",
"long",
"height",
",",
"BoundingBox",
"boundingBox",
",",
"BoundingBox",
"boundingBoxSection",
")",
"{",
"float",
"left",
"=",
"TileBoundingBoxUtils",
".",
"getXPixel",
"(",
"widt... | Get a rectangle with floating point boundaries using the tile width,
height, bounding box, and the bounding box section within the outer box
to build the rectangle from
@param width
width
@param height
height
@param boundingBox
full bounding box
@param boundingBoxSection
rectangle bounding box section
@return floating... | [
"Get",
"a",
"rectangle",
"with",
"floating",
"point",
"boundaries",
"using",
"the",
"tile",
"width",
"height",
"bounding",
"box",
"and",
"the",
"bounding",
"box",
"section",
"within",
"the",
"outer",
"box",
"to",
"build",
"the",
"rectangle",
"from"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java#L81-L96 |
HubSpot/Singularity | SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java | SingularityClient.getTaskLogs | public Collection<SingularityS3Log> getTaskLogs(String taskId) {
final Function<String, String> requestUri = (host) -> String.format(S3_LOG_GET_TASK_LOGS, getApiBase(host), taskId);
final String type = String.format("S3 logs for task %s", taskId);
return getCollection(requestUri, type, S3_LOG_COLLECTION);... | java | public Collection<SingularityS3Log> getTaskLogs(String taskId) {
final Function<String, String> requestUri = (host) -> String.format(S3_LOG_GET_TASK_LOGS, getApiBase(host), taskId);
final String type = String.format("S3 logs for task %s", taskId);
return getCollection(requestUri, type, S3_LOG_COLLECTION);... | [
"public",
"Collection",
"<",
"SingularityS3Log",
">",
"getTaskLogs",
"(",
"String",
"taskId",
")",
"{",
"final",
"Function",
"<",
"String",
",",
"String",
">",
"requestUri",
"=",
"(",
"host",
")",
"-",
">",
"String",
".",
"format",
"(",
"S3_LOG_GET_TASK_LOGS... | Retrieve the list of logs stored in S3 for a specific task
@param taskId
The task ID to search for
@return
A collection of {@link SingularityS3Log} | [
"Retrieve",
"the",
"list",
"of",
"logs",
"stored",
"in",
"S3",
"for",
"a",
"specific",
"task"
] | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L1338-L1344 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.removeByG_P | @Override
public void removeByG_P(long groupId, boolean primary) {
for (CommerceWarehouse commerceWarehouse : findByG_P(groupId, primary,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceWarehouse);
}
} | java | @Override
public void removeByG_P(long groupId, boolean primary) {
for (CommerceWarehouse commerceWarehouse : findByG_P(groupId, primary,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceWarehouse);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_P",
"(",
"long",
"groupId",
",",
"boolean",
"primary",
")",
"{",
"for",
"(",
"CommerceWarehouse",
"commerceWarehouse",
":",
"findByG_P",
"(",
"groupId",
",",
"primary",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"Query... | Removes all the commerce warehouses where groupId = ? and primary = ? from the database.
@param groupId the group ID
@param primary the primary | [
"Removes",
"all",
"the",
"commerce",
"warehouses",
"where",
"groupId",
"=",
"?",
";",
"and",
"primary",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L2182-L2188 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4AddressSection.java | IPv4AddressSection.getIPv4Count | private long getIPv4Count(boolean excludeZeroHosts, int segCount) {
if(!isMultiple()) {
if(excludeZeroHosts && isZero()) {
return 0L;
}
return 1L;
}
long result = getCount(i -> getSegment(i).getValueCount(), segCount);
if(excludeZeroHosts && includesZeroHost()) {
int prefixedSegment = getNetwork... | java | private long getIPv4Count(boolean excludeZeroHosts, int segCount) {
if(!isMultiple()) {
if(excludeZeroHosts && isZero()) {
return 0L;
}
return 1L;
}
long result = getCount(i -> getSegment(i).getValueCount(), segCount);
if(excludeZeroHosts && includesZeroHost()) {
int prefixedSegment = getNetwork... | [
"private",
"long",
"getIPv4Count",
"(",
"boolean",
"excludeZeroHosts",
",",
"int",
"segCount",
")",
"{",
"if",
"(",
"!",
"isMultiple",
"(",
")",
")",
"{",
"if",
"(",
"excludeZeroHosts",
"&&",
"isZero",
"(",
")",
")",
"{",
"return",
"0L",
";",
"}",
"ret... | This was added so count available as a long and not as BigInteger | [
"This",
"was",
"added",
"so",
"count",
"available",
"as",
"a",
"long",
"and",
"not",
"as",
"BigInteger"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4AddressSection.java#L768-L790 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplates.java | URLTemplates.getTemplateNameByRef | public String getTemplateNameByRef( String refGroupName, String key )
{
String templateName = null;
Map/*< String, String >*/ templateRefGroup = ( Map ) _templateRefGroups.get( refGroupName );
if ( templateRefGroup != null )
{
templateName = ( String ) templateRefGroup.ge... | java | public String getTemplateNameByRef( String refGroupName, String key )
{
String templateName = null;
Map/*< String, String >*/ templateRefGroup = ( Map ) _templateRefGroups.get( refGroupName );
if ( templateRefGroup != null )
{
templateName = ( String ) templateRefGroup.ge... | [
"public",
"String",
"getTemplateNameByRef",
"(",
"String",
"refGroupName",
",",
"String",
"key",
")",
"{",
"String",
"templateName",
"=",
"null",
";",
"Map",
"/*< String, String >*/",
"templateRefGroup",
"=",
"(",
"Map",
")",
"_templateRefGroups",
".",
"get",
"(",... | Retrieve a template name from a reference group in url-template-config.
@param refGroupName the name of the template reference group.
@param key the key to the particular template reference in the group.
@return a template name from the reference group. | [
"Retrieve",
"a",
"template",
"name",
"from",
"a",
"reference",
"group",
"in",
"url",
"-",
"template",
"-",
"config",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplates.java#L129-L139 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/DateUtil.java | DateUtil.fromISO8601 | public static Date fromISO8601(String pDateString) {
if (datatypeFactory != null) {
return datatypeFactory.newXMLGregorianCalendar(pDateString.trim()).toGregorianCalendar().getTime();
} else {
try {
// Try on our own, works for most cases
String da... | java | public static Date fromISO8601(String pDateString) {
if (datatypeFactory != null) {
return datatypeFactory.newXMLGregorianCalendar(pDateString.trim()).toGregorianCalendar().getTime();
} else {
try {
// Try on our own, works for most cases
String da... | [
"public",
"static",
"Date",
"fromISO8601",
"(",
"String",
"pDateString",
")",
"{",
"if",
"(",
"datatypeFactory",
"!=",
"null",
")",
"{",
"return",
"datatypeFactory",
".",
"newXMLGregorianCalendar",
"(",
"pDateString",
".",
"trim",
"(",
")",
")",
".",
"toGregor... | Parse an ISO-8601 string into an date object
@param pDateString date string to parse
@return the parse date
@throws IllegalArgumentException if the provided string does not conform to ISO-8601 | [
"Parse",
"an",
"ISO",
"-",
"8601",
"string",
"into",
"an",
"date",
"object"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DateUtil.java#L55-L69 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addCalendar | private void addCalendar(MpxjTreeNode parentNode, final ProjectCalendar calendar)
{
MpxjTreeNode calendarNode = new MpxjTreeNode(calendar, CALENDAR_EXCLUDED_METHODS)
{
@Override public String toString()
{
return calendar.getName();
}
};
parentNode.add(ca... | java | private void addCalendar(MpxjTreeNode parentNode, final ProjectCalendar calendar)
{
MpxjTreeNode calendarNode = new MpxjTreeNode(calendar, CALENDAR_EXCLUDED_METHODS)
{
@Override public String toString()
{
return calendar.getName();
}
};
parentNode.add(ca... | [
"private",
"void",
"addCalendar",
"(",
"MpxjTreeNode",
"parentNode",
",",
"final",
"ProjectCalendar",
"calendar",
")",
"{",
"MpxjTreeNode",
"calendarNode",
"=",
"new",
"MpxjTreeNode",
"(",
"calendar",
",",
"CALENDAR_EXCLUDED_METHODS",
")",
"{",
"@",
"Override",
"pub... | Add a calendar node.
@param parentNode parent node
@param calendar calendar | [
"Add",
"a",
"calendar",
"node",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L257-L283 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/config/ClientConfig.java | ClientConfig.setProperty | public ClientConfig setProperty(String name, String value) {
properties.put(name, value);
return this;
} | java | public ClientConfig setProperty(String name, String value) {
properties.put(name, value);
return this;
} | [
"public",
"ClientConfig",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"properties",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of a named property.
@param name property name
@param value value of the property
@return configured {@link com.hazelcast.client.config.ClientConfig} for chaining | [
"Sets",
"the",
"value",
"of",
"a",
"named",
"property",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/config/ClientConfig.java#L218-L221 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.deposit_depositId_details_depositDetailId_GET | public OvhDepositDetail deposit_depositId_details_depositDetailId_GET(String depositId, String depositDetailId) throws IOException {
String qPath = "/me/deposit/{depositId}/details/{depositDetailId}";
StringBuilder sb = path(qPath, depositId, depositDetailId);
String resp = exec(qPath, "GET", sb.toString(), null)... | java | public OvhDepositDetail deposit_depositId_details_depositDetailId_GET(String depositId, String depositDetailId) throws IOException {
String qPath = "/me/deposit/{depositId}/details/{depositDetailId}";
StringBuilder sb = path(qPath, depositId, depositDetailId);
String resp = exec(qPath, "GET", sb.toString(), null)... | [
"public",
"OvhDepositDetail",
"deposit_depositId_details_depositDetailId_GET",
"(",
"String",
"depositId",
",",
"String",
"depositDetailId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/deposit/{depositId}/details/{depositDetailId}\"",
";",
"StringBuilder",
... | Get this object properties
REST: GET /me/deposit/{depositId}/details/{depositDetailId}
@param depositId [required]
@param depositDetailId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3278-L3283 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java | CopyFileExtensions.copyFileToDirectory | public static boolean copyFileToDirectory(final File source, final File destinationDir)
throws FileIsNotADirectoryException, IOException, FileIsADirectoryException
{
return copyFileToDirectory(source, destinationDir, true);
} | java | public static boolean copyFileToDirectory(final File source, final File destinationDir)
throws FileIsNotADirectoryException, IOException, FileIsADirectoryException
{
return copyFileToDirectory(source, destinationDir, true);
} | [
"public",
"static",
"boolean",
"copyFileToDirectory",
"(",
"final",
"File",
"source",
",",
"final",
"File",
"destinationDir",
")",
"throws",
"FileIsNotADirectoryException",
",",
"IOException",
",",
"FileIsADirectoryException",
"{",
"return",
"copyFileToDirectory",
"(",
... | Copies the given source file to the given destination directory.
@param source
The source file to copy in the destination directory.
@param destinationDir
The destination directory.
@return 's true if the file is copied to the destination directory, otherwise false.
@throws FileIsNotADirectoryException
Is thrown if ... | [
"Copies",
"the",
"given",
"source",
"file",
"to",
"the",
"given",
"destination",
"directory",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java#L593-L597 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/images/ImageHandlerBuilder.java | ImageHandlerBuilder.cropToAspect | public ImageHandlerBuilder cropToAspect(int width, int height) {
int original_width = image.getWidth();
int original_height = image.getHeight();
int bound_width = width;
int bound_height = height;
int new_width = original_width;
int new_height = original_height;
... | java | public ImageHandlerBuilder cropToAspect(int width, int height) {
int original_width = image.getWidth();
int original_height = image.getHeight();
int bound_width = width;
int bound_height = height;
int new_width = original_width;
int new_height = original_height;
... | [
"public",
"ImageHandlerBuilder",
"cropToAspect",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"original_width",
"=",
"image",
".",
"getWidth",
"(",
")",
";",
"int",
"original_height",
"=",
"image",
".",
"getHeight",
"(",
")",
";",
"int",
"bo... | Crop the image to a given aspect.
<br>
The aspect is the desired proportions of the image, which will be kept when cropping.
<p>
The usecase for this method is when you have an image, that you want to crop into a certain proportion,
but want to keep the original dimensions as much as possible.
@param width
@param heigh... | [
"Crop",
"the",
"image",
"to",
"a",
"given",
"aspect",
".",
"<br",
">",
"The",
"aspect",
"is",
"the",
"desired",
"proportions",
"of",
"the",
"image",
"which",
"will",
"be",
"kept",
"when",
"cropping",
".",
"<p",
">",
"The",
"usecase",
"for",
"this",
"me... | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/images/ImageHandlerBuilder.java#L123-L171 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java | BytecodeUtils.newHashMap | public static Expression newHashMap(
Iterable<? extends Expression> keys, Iterable<? extends Expression> values) {
return newMap(keys, values, ConstructorRef.HASH_MAP_CAPACITY, HASH_MAP_TYPE);
} | java | public static Expression newHashMap(
Iterable<? extends Expression> keys, Iterable<? extends Expression> values) {
return newMap(keys, values, ConstructorRef.HASH_MAP_CAPACITY, HASH_MAP_TYPE);
} | [
"public",
"static",
"Expression",
"newHashMap",
"(",
"Iterable",
"<",
"?",
"extends",
"Expression",
">",
"keys",
",",
"Iterable",
"<",
"?",
"extends",
"Expression",
">",
"values",
")",
"{",
"return",
"newMap",
"(",
"keys",
",",
"values",
",",
"ConstructorRef... | Returns an expression that returns a new {@link HashMap} containing all the given entries. | [
"Returns",
"an",
"expression",
"that",
"returns",
"a",
"new",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L898-L901 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/SessionProtocolNegotiationCache.java | SessionProtocolNegotiationCache.isUnsupported | public static boolean isUnsupported(SocketAddress remoteAddress, SessionProtocol protocol) {
final String key = key(remoteAddress);
final CacheEntry e;
final long stamp = lock.readLock();
try {
e = cache.get(key);
} finally {
lock.unlockRead(stamp);
... | java | public static boolean isUnsupported(SocketAddress remoteAddress, SessionProtocol protocol) {
final String key = key(remoteAddress);
final CacheEntry e;
final long stamp = lock.readLock();
try {
e = cache.get(key);
} finally {
lock.unlockRead(stamp);
... | [
"public",
"static",
"boolean",
"isUnsupported",
"(",
"SocketAddress",
"remoteAddress",
",",
"SessionProtocol",
"protocol",
")",
"{",
"final",
"String",
"key",
"=",
"key",
"(",
"remoteAddress",
")",
";",
"final",
"CacheEntry",
"e",
";",
"final",
"long",
"stamp",
... | Returns {@code true} if the specified {@code remoteAddress} is known to have no support for
the specified {@link SessionProtocol}. | [
"Returns",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/SessionProtocolNegotiationCache.java#L63-L79 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.createArea3DEffectGradient | protected RadialGradientPaint createArea3DEffectGradient(final int WIDTH, final float RADIUS_FACTOR) {
final float[] FRACTIONS;
final Color[] COLORS;
FRACTIONS = new float[]{
0.0f,
0.6f,
1.0f
};
COLORS = new Color[]{
new Color(1.0f... | java | protected RadialGradientPaint createArea3DEffectGradient(final int WIDTH, final float RADIUS_FACTOR) {
final float[] FRACTIONS;
final Color[] COLORS;
FRACTIONS = new float[]{
0.0f,
0.6f,
1.0f
};
COLORS = new Color[]{
new Color(1.0f... | [
"protected",
"RadialGradientPaint",
"createArea3DEffectGradient",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"float",
"RADIUS_FACTOR",
")",
"{",
"final",
"float",
"[",
"]",
"FRACTIONS",
";",
"final",
"Color",
"[",
"]",
"COLORS",
";",
"FRACTIONS",
"=",
"new",
... | Returns a radial gradient paint that will be used as overlay for the track or area image
to achieve some kind of a 3d effect.
@param WIDTH
@param RADIUS_FACTOR
@return a radial gradient paint that will be used as overlay for the track or area image | [
"Returns",
"a",
"radial",
"gradient",
"paint",
"that",
"will",
"be",
"used",
"as",
"overlay",
"for",
"the",
"track",
"or",
"area",
"image",
"to",
"achieve",
"some",
"kind",
"of",
"a",
"3d",
"effect",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L1238-L1255 |
shrinkwrap/resolver | api/src/main/java/org/jboss/shrinkwrap/resolver/api/ResolverSystemFactory.java | ResolverSystemFactory.createFromUserView | static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE createFromUserView(
final Class<RESOLVERSYSTEMTYPE> userViewClass, final ClassLoader cl) {
assert userViewClass != null : "user view class must be specified";
assert cl != null : "ClassLoader must be specified";
... | java | static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE createFromUserView(
final Class<RESOLVERSYSTEMTYPE> userViewClass, final ClassLoader cl) {
assert userViewClass != null : "user view class must be specified";
assert cl != null : "ClassLoader must be specified";
... | [
"static",
"<",
"RESOLVERSYSTEMTYPE",
"extends",
"ResolverSystem",
">",
"RESOLVERSYSTEMTYPE",
"createFromUserView",
"(",
"final",
"Class",
"<",
"RESOLVERSYSTEMTYPE",
">",
"userViewClass",
",",
"final",
"ClassLoader",
"cl",
")",
"{",
"assert",
"userViewClass",
"!=",
"nu... | Creates a new {@link ResolverSystem} instance of the specified user view type using the specified {@link ClassLoader}.
Will consult a configuration file visible to the specified {@link ClassLoader} named
"META-INF/services/$fullyQualfiedClassName" which should contain a key=value format with the key
{@link ResolverSyst... | [
"Creates",
"a",
"new",
"{",
"@link",
"ResolverSystem",
"}",
"instance",
"of",
"the",
"specified",
"user",
"view",
"type",
"using",
"the",
"specified",
"{",
"@link",
"ClassLoader",
"}",
".",
"Will",
"consult",
"a",
"configuration",
"file",
"visible",
"to",
"t... | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/api/src/main/java/org/jboss/shrinkwrap/resolver/api/ResolverSystemFactory.java#L69-L98 |
ddf-project/DDF | core/src/main/java/io/ddf/util/DDFUtils.java | DDFUtils.generateObjectName | public static String generateObjectName(Object obj, String sourceName, String operation, String desiredName) {
if (Strings.isNullOrEmpty(desiredName)) {
if (Strings.isNullOrEmpty(sourceName)) {
return generateUniqueName(obj);
} else if (Strings.isNullOrEmpty(operation)) {
desiredName =... | java | public static String generateObjectName(Object obj, String sourceName, String operation, String desiredName) {
if (Strings.isNullOrEmpty(desiredName)) {
if (Strings.isNullOrEmpty(sourceName)) {
return generateUniqueName(obj);
} else if (Strings.isNullOrEmpty(operation)) {
desiredName =... | [
"public",
"static",
"String",
"generateObjectName",
"(",
"Object",
"obj",
",",
"String",
"sourceName",
",",
"String",
"operation",
",",
"String",
"desiredName",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"desiredName",
")",
")",
"{",
"if",
"(... | Heuristic: if the source/parent already has a table name then we can add something that identifies the operation.
Plus a unique extension if needed. If the starting name is already too long, we call that a degenerate case, for
which we go back to UUID-based. All this is overridden if the caller specifies a desired name... | [
"Heuristic",
":",
"if",
"the",
"source",
"/",
"parent",
"already",
"has",
"a",
"table",
"name",
"then",
"we",
"can",
"add",
"something",
"that",
"identifies",
"the",
"operation",
".",
"Plus",
"a",
"unique",
"extension",
"if",
"needed",
".",
"If",
"the",
... | train | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/util/DDFUtils.java#L26-L44 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/common/ValueListMap.java | ValueListMap.addValuesToKey | public void addValuesToKey(K key, Collection<V> valueCollection) {
if (!valueCollection.isEmpty()) {
// Create a new collection to store the values (will be changed to internal type by call
// to putIfAbsent anyway)
List<V> collectionToAppendValuesOn = new ArrayList<V>();
... | java | public void addValuesToKey(K key, Collection<V> valueCollection) {
if (!valueCollection.isEmpty()) {
// Create a new collection to store the values (will be changed to internal type by call
// to putIfAbsent anyway)
List<V> collectionToAppendValuesOn = new ArrayList<V>();
... | [
"public",
"void",
"addValuesToKey",
"(",
"K",
"key",
",",
"Collection",
"<",
"V",
">",
"valueCollection",
")",
"{",
"if",
"(",
"!",
"valueCollection",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Create a new collection to store the values (will be changed to internal type... | Add a collection of one or more values to the map under the existing key or creating a new key
if it does not yet exist in the map.
@param key the key to associate the values with
@param valueCollection a collection of values to add to the key | [
"Add",
"a",
"collection",
"of",
"one",
"or",
"more",
"values",
"to",
"the",
"map",
"under",
"the",
"existing",
"key",
"or",
"creating",
"a",
"new",
"key",
"if",
"it",
"does",
"not",
"yet",
"exist",
"in",
"the",
"map",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/common/ValueListMap.java#L66-L78 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllWeight.java | MatchAllWeight.createScorer | @Override
protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
return new MatchAllScorer(reader, field);
} | java | @Override
protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
return new MatchAllScorer(reader, field);
} | [
"@",
"Override",
"protected",
"Scorer",
"createScorer",
"(",
"IndexReader",
"reader",
",",
"boolean",
"scoreDocsInOrder",
",",
"boolean",
"topScorer",
")",
"throws",
"IOException",
"{",
"return",
"new",
"MatchAllScorer",
"(",
"reader",
",",
"field",
")",
";",
"}... | Creates a {@link MatchAllScorer} instance.
@param reader index reader
@return a {@link MatchAllScorer} instance | [
"Creates",
"a",
"{",
"@link",
"MatchAllScorer",
"}",
"instance",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllWeight.java#L80-L83 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java | AccountsInner.listWithServiceResponseAsync | public Observable<ServiceResponse<Page<DataLakeStoreAccountBasicInner>>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
return listSinglePageAsync(filter, top, skip, select, orderby, count)
.c... | java | public Observable<ServiceResponse<Page<DataLakeStoreAccountBasicInner>>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
return listSinglePageAsync(filter, top, skip, select, orderby, count)
.c... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DataLakeStoreAccountBasicInner",
">",
">",
">",
"listWithServiceResponseAsync",
"(",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
",",
"final",
"Integer",
"skip",
",",
"final",
"Str... | Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any.
@param filter OData filter. Optional.
@param top The number of items to return. Optional.
@param skip The number of items to skip over before returning elements. Optional.
@param select OData S... | [
"Lists",
"the",
"Data",
"Lake",
"Store",
"accounts",
"within",
"the",
"subscription",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"of",
"results",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java#L315-L327 |
junit-team/junit4 | src/main/java/org/junit/runners/model/FrameworkMethod.java | FrameworkMethod.validatePublicVoid | public void validatePublicVoid(boolean isStatic, List<Throwable> errors) {
if (isStatic() != isStatic) {
String state = isStatic ? "should" : "should not";
errors.add(new Exception("Method " + method.getName() + "() " + state + " be static"));
}
if (!isPublic()) {
... | java | public void validatePublicVoid(boolean isStatic, List<Throwable> errors) {
if (isStatic() != isStatic) {
String state = isStatic ? "should" : "should not";
errors.add(new Exception("Method " + method.getName() + "() " + state + " be static"));
}
if (!isPublic()) {
... | [
"public",
"void",
"validatePublicVoid",
"(",
"boolean",
"isStatic",
",",
"List",
"<",
"Throwable",
">",
"errors",
")",
"{",
"if",
"(",
"isStatic",
"(",
")",
"!=",
"isStatic",
")",
"{",
"String",
"state",
"=",
"isStatic",
"?",
"\"should\"",
":",
"\"should n... | Adds to {@code errors} if this method:
<ul>
<li>is not public, or
<li>returns something other than void, or
<li>is static (given {@code isStatic is false}), or
<li>is not static (given {@code isStatic is true}).
</ul> | [
"Adds",
"to",
"{"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/model/FrameworkMethod.java#L99-L110 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java | PrivateKeyReader.readPemPrivateKey | public static PrivateKey readPemPrivateKey(final String privateKeyAsString,
final String algorithm)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
{
final byte[] decoded = new Base64().decode(privateKeyAsString);
return readPrivateKey(decoded, algorithm);
} | java | public static PrivateKey readPemPrivateKey(final String privateKeyAsString,
final String algorithm)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
{
final byte[] decoded = new Base64().decode(privateKeyAsString);
return readPrivateKey(decoded, algorithm);
} | [
"public",
"static",
"PrivateKey",
"readPemPrivateKey",
"(",
"final",
"String",
"privateKeyAsString",
",",
"final",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchProviderException",
"{",
"final",
"byte",
"[",
... | Reads the given {@link String}( in *.pem format) with given algorithm and returns the
{@link PrivateKey} object.
@param privateKeyAsString
the private key as string( in *.pem format)
@param algorithm
the algorithm
@return the {@link PrivateKey} object
@throws NoSuchAlgorithmException
is thrown if instantiation of the... | [
"Reads",
"the",
"given",
"{",
"@link",
"String",
"}",
"(",
"in",
"*",
".",
"pem",
"format",
")",
"with",
"given",
"algorithm",
"and",
"returns",
"the",
"{",
"@link",
"PrivateKey",
"}",
"object",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java#L307-L313 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java | ExtendedByteBuf.readMaybeString | public static Optional<String> readMaybeString(ByteBuf bf) {
Optional<byte[]> bytes = readMaybeRangedBytes(bf);
return bytes.map(b -> {
if (b.length == 0) return "";
else return new String(b, CharsetUtil.UTF_8);
});
} | java | public static Optional<String> readMaybeString(ByteBuf bf) {
Optional<byte[]> bytes = readMaybeRangedBytes(bf);
return bytes.map(b -> {
if (b.length == 0) return "";
else return new String(b, CharsetUtil.UTF_8);
});
} | [
"public",
"static",
"Optional",
"<",
"String",
">",
"readMaybeString",
"(",
"ByteBuf",
"bf",
")",
"{",
"Optional",
"<",
"byte",
"[",
"]",
">",
"bytes",
"=",
"readMaybeRangedBytes",
"(",
"bf",
")",
";",
"return",
"bytes",
".",
"map",
"(",
"b",
"->",
"{"... | Reads a string if possible. If not present the reader index is reset to the last mark.
@param bf
@return | [
"Reads",
"a",
"string",
"if",
"possible",
".",
"If",
"not",
"present",
"the",
"reader",
"index",
"is",
"reset",
"to",
"the",
"last",
"mark",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java#L244-L250 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXField | public static XField createXField(@DottedClassName String className, String fieldName, String fieldSignature, boolean isStatic) {
FieldDescriptor fieldDesc = DescriptorFactory.instance().getFieldDescriptor(ClassName.toSlashedClassName(className),
fieldName, fieldSignature, isStatic);
re... | java | public static XField createXField(@DottedClassName String className, String fieldName, String fieldSignature, boolean isStatic) {
FieldDescriptor fieldDesc = DescriptorFactory.instance().getFieldDescriptor(ClassName.toSlashedClassName(className),
fieldName, fieldSignature, isStatic);
re... | [
"public",
"static",
"XField",
"createXField",
"(",
"@",
"DottedClassName",
"String",
"className",
",",
"String",
"fieldName",
",",
"String",
"fieldSignature",
",",
"boolean",
"isStatic",
")",
"{",
"FieldDescriptor",
"fieldDesc",
"=",
"DescriptorFactory",
".",
"insta... | Create an XField object
@param className
@param fieldName
@param fieldSignature
@param isStatic
@return the created XField | [
"Create",
"an",
"XField",
"object"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L459-L464 |
JOML-CI/JOML | src/org/joml/Vector4i.java | Vector4i.set | public Vector4i set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | java | public Vector4i set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector4i",
"set",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link ByteBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
values will be read in <code>x, y, z, w</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4i.java#L375-L378 |
sdl/odata | odata_client/src/main/java/com/sdl/odata/client/marshall/AtomEntityUnmarshaller.java | AtomEntityUnmarshaller.atomUnmarshall | public Object atomUnmarshall(String oDataEntityXml, String fullResponse, ODataClientQuery query)
throws UnsupportedEncodingException, ODataClientException {
Object unmarshalledEntity;
// build a dummy request context which contains the Xml
ODataRequest request = buildODataRequestFrom... | java | public Object atomUnmarshall(String oDataEntityXml, String fullResponse, ODataClientQuery query)
throws UnsupportedEncodingException, ODataClientException {
Object unmarshalledEntity;
// build a dummy request context which contains the Xml
ODataRequest request = buildODataRequestFrom... | [
"public",
"Object",
"atomUnmarshall",
"(",
"String",
"oDataEntityXml",
",",
"String",
"fullResponse",
",",
"ODataClientQuery",
"query",
")",
"throws",
"UnsupportedEncodingException",
",",
"ODataClientException",
"{",
"Object",
"unmarshalledEntity",
";",
"// build a dummy re... | Unmarshalls an Atom XML form of on OData entity into the actual entity (DTO) object.
@param oDataEntityXml the Atom XML form of on OData entity
@return an entity (DTO) object
@throws java.io.UnsupportedEncodingException
@throws ODataClientException | [
"Unmarshalls",
"an",
"Atom",
"XML",
"form",
"of",
"on",
"OData",
"entity",
"into",
"the",
"actual",
"entity",
"(",
"DTO",
")",
"object",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client/src/main/java/com/sdl/odata/client/marshall/AtomEntityUnmarshaller.java#L147-L165 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.streamToOptional | public final static <T> Optional<Seq<T>> streamToOptional(final Stream<T> stream) {
final List<T> collected = stream.collect(java.util.stream.Collectors.toList());
if (collected.size() == 0)
return Optional.empty();
return Optional.of(Seq.fromIterable(collected));
} | java | public final static <T> Optional<Seq<T>> streamToOptional(final Stream<T> stream) {
final List<T> collected = stream.collect(java.util.stream.Collectors.toList());
if (collected.size() == 0)
return Optional.empty();
return Optional.of(Seq.fromIterable(collected));
} | [
"public",
"final",
"static",
"<",
"T",
">",
"Optional",
"<",
"Seq",
"<",
"T",
">",
">",
"streamToOptional",
"(",
"final",
"Stream",
"<",
"T",
">",
"stream",
")",
"{",
"final",
"List",
"<",
"T",
">",
"collected",
"=",
"stream",
".",
"collect",
"(",
... | Create an Optional containing a List materialized from a Stream
<pre>
{@code
Optional<Seq<Integer>> opt = Streams.streamToOptional(Stream.of(1,2,3));
//Optional[[1,2,3]]
}
</pre>
@param stream To convert into an Optional
@return Optional with a List of values | [
"Create",
"an",
"Optional",
"containing",
"a",
"List",
"materialized",
"from",
"a",
"Stream"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L473-L479 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELProcessor.java | ELProcessor.defineFunction | public void defineFunction(String prefix, String function, Method method)
throws NoSuchMethodException {
if (prefix == null || function == null || method == null) {
throw new NullPointerException("Null argument for defineFunction");
}
if (! Modifier.isStatic(method.getMod... | java | public void defineFunction(String prefix, String function, Method method)
throws NoSuchMethodException {
if (prefix == null || function == null || method == null) {
throw new NullPointerException("Null argument for defineFunction");
}
if (! Modifier.isStatic(method.getMod... | [
"public",
"void",
"defineFunction",
"(",
"String",
"prefix",
",",
"String",
"function",
",",
"Method",
"method",
")",
"throws",
"NoSuchMethodException",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"function",
"==",
"null",
"||",
"method",
"==",
"null",
")"... | Define an EL function in the local function mapper.
@param prefix The namespace for the function or "" for no namesapce.
@param function The name of the function.
If empty (""), the method name is used as the function name.
@param method The <code>java.lang.reflect.Method</code> instance of
the method that implements t... | [
"Define",
"an",
"EL",
"function",
"in",
"the",
"local",
"function",
"mapper",
"."
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELProcessor.java#L257-L269 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.listSkusWithServiceResponseAsync | public Observable<ServiceResponse<Page<VirtualMachineScaleSetSkuInner>>> listSkusWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName) {
return listSkusSinglePageAsync(resourceGroupName, vmScaleSetName)
.concatMap(new Func1<ServiceResponse<Page<VirtualMachineScaleSetS... | java | public Observable<ServiceResponse<Page<VirtualMachineScaleSetSkuInner>>> listSkusWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName) {
return listSkusSinglePageAsync(resourceGroupName, vmScaleSetName)
.concatMap(new Func1<ServiceResponse<Page<VirtualMachineScaleSetS... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"VirtualMachineScaleSetSkuInner",
">",
">",
">",
"listSkusWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"vmScaleSetName",
")",
"{",
"return",
"listSkusSin... | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ob... | [
"Gets",
"a",
"list",
"of",
"SKUs",
"available",
"for",
"your",
"VM",
"scale",
"set",
"including",
"the",
"minimum",
"and",
"maximum",
"VM",
"instances",
"allowed",
"for",
"each",
"SKU",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1660-L1672 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/http/MultipartBody.java | MultipartBody.appendQuotedString | static StringBuilder appendQuotedString(StringBuilder target, String key) {
target.append('"');
for (int i = 0, len = key.length(); i < len; i++) {
char ch = key.charAt(i);
switch (ch) {
case '\n':
target.append("%0A");
brea... | java | static StringBuilder appendQuotedString(StringBuilder target, String key) {
target.append('"');
for (int i = 0, len = key.length(); i < len; i++) {
char ch = key.charAt(i);
switch (ch) {
case '\n':
target.append("%0A");
brea... | [
"static",
"StringBuilder",
"appendQuotedString",
"(",
"StringBuilder",
"target",
",",
"String",
"key",
")",
"{",
"target",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"len",
"=",
"key",
".",
"length",
"(",
")",
";",... | Appends a quoted-string to a StringBuilder.
<p>RFC 2388 is rather vague about how one should escape special characters in form-data
parameters, and as it turns out Firefox and Chrome actually do rather different things, and
both say in their comments that they're not really sure what the right approach is. We go with
... | [
"Appends",
"a",
"quoted",
"-",
"string",
"to",
"a",
"StringBuilder",
"."
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/http/MultipartBody.java#L97-L118 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/codec/TimedSQLEncoder.java | TimedSQLEncoder.encodeDiff | protected String encodeDiff(final Task<Diff> task, final Diff diff)
throws ConfigurationException, UnsupportedEncodingException,
DecodingException, EncodingException, SQLConsumerException
{
String encoding = super.encodeDiff(task, diff);
this.encodedSize += encoding.length();
return encoding;
} | java | protected String encodeDiff(final Task<Diff> task, final Diff diff)
throws ConfigurationException, UnsupportedEncodingException,
DecodingException, EncodingException, SQLConsumerException
{
String encoding = super.encodeDiff(task, diff);
this.encodedSize += encoding.length();
return encoding;
} | [
"protected",
"String",
"encodeDiff",
"(",
"final",
"Task",
"<",
"Diff",
">",
"task",
",",
"final",
"Diff",
"diff",
")",
"throws",
"ConfigurationException",
",",
"UnsupportedEncodingException",
",",
"DecodingException",
",",
"EncodingException",
",",
"SQLConsumerExcept... | Encodes the diff.
@param task
Reference to the DiffTask
@param diff
Diff to encode
@return Base 64 encoded Diff
@throws ConfigurationException
if an error occurred while accessing the configuration
@throws UnsupportedEncodingException
if the character encoding is unsupported
@throws DecodingException
if the decoding ... | [
"Encodes",
"the",
"diff",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/codec/TimedSQLEncoder.java#L121-L131 |
infinispan/infinispan | object-filter/src/main/java/org/infinispan/objectfilter/impl/util/IntervalTree.java | IntervalTree.compareIntervals | private int compareIntervals(Interval<K> i1, Interval<K> i2) {
int res1 = compare(i1.up, i2.low);
if (res1 < 0 || res1 <= 0 && (!i1.includeUpper || !i2.includeLower)) {
return -1;
}
int res2 = compare(i2.up, i1.low);
if (res2 < 0 || res2 <= 0 && (!i2.includeUpper || !i1.includeLow... | java | private int compareIntervals(Interval<K> i1, Interval<K> i2) {
int res1 = compare(i1.up, i2.low);
if (res1 < 0 || res1 <= 0 && (!i1.includeUpper || !i2.includeLower)) {
return -1;
}
int res2 = compare(i2.up, i1.low);
if (res2 < 0 || res2 <= 0 && (!i2.includeUpper || !i1.includeLow... | [
"private",
"int",
"compareIntervals",
"(",
"Interval",
"<",
"K",
">",
"i1",
",",
"Interval",
"<",
"K",
">",
"i2",
")",
"{",
"int",
"res1",
"=",
"compare",
"(",
"i1",
".",
"up",
",",
"i2",
".",
"low",
")",
";",
"if",
"(",
"res1",
"<",
"0",
"||",... | Compare two Intervals.
@return a negative integer, zero, or a positive integer depending if Interval i1 is to the left of i2, overlaps
with it, or is to the right of i2. | [
"Compare",
"two",
"Intervals",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/object-filter/src/main/java/org/infinispan/objectfilter/impl/util/IntervalTree.java#L102-L112 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_voipLine_options_customShippingAddress_POST | public Long packName_voipLine_options_customShippingAddress_POST(String packName, String address, String cityName, String firstName, String lastName, String zipCode) throws IOException {
String qPath = "/pack/xdsl/{packName}/voipLine/options/customShippingAddress";
StringBuilder sb = path(qPath, packName);
HashMa... | java | public Long packName_voipLine_options_customShippingAddress_POST(String packName, String address, String cityName, String firstName, String lastName, String zipCode) throws IOException {
String qPath = "/pack/xdsl/{packName}/voipLine/options/customShippingAddress";
StringBuilder sb = path(qPath, packName);
HashMa... | [
"public",
"Long",
"packName_voipLine_options_customShippingAddress_POST",
"(",
"String",
"packName",
",",
"String",
"address",
",",
"String",
"cityName",
",",
"String",
"firstName",
",",
"String",
"lastName",
",",
"String",
"zipCode",
")",
"throws",
"IOException",
"{"... | Create a new shippingId to be used for voipLine service creation
REST: POST /pack/xdsl/{packName}/voipLine/options/customShippingAddress
@param address [required] Address, including street name
@param lastName [required] Last name
@param firstName [required] First name
@param cityName [required] City name
@param zipCo... | [
"Create",
"a",
"new",
"shippingId",
"to",
"be",
"used",
"for",
"voipLine",
"service",
"creation"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L320-L331 |
TestFX/Monocle | src/main/java/com/sun/glass/ui/monocle/LinuxInput.java | LinuxInput.codeToString | static String codeToString(String type, short code) {
int i = type.indexOf("_");
if (i >= 0) {
String prefix = type.substring(i + 1);
String altPrefix = prefix.equals("KEY") ? "BTN" : prefix;
for (Field field : LinuxInput.class.getDeclaredFields()) {
S... | java | static String codeToString(String type, short code) {
int i = type.indexOf("_");
if (i >= 0) {
String prefix = type.substring(i + 1);
String altPrefix = prefix.equals("KEY") ? "BTN" : prefix;
for (Field field : LinuxInput.class.getDeclaredFields()) {
S... | [
"static",
"String",
"codeToString",
"(",
"String",
"type",
",",
"short",
"code",
")",
"{",
"int",
"i",
"=",
"type",
".",
"indexOf",
"(",
"\"_\"",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"String",
"prefix",
"=",
"type",
".",
"substring",
"(",... | Convert an event code to its equivalent string, given its type string.
The type string is needed because event codes are context sensitive. For
example, the code 1 is "SYN_CONFIG" for an EV_SYN event but "KEY_ESC" for
an EV_KEY event. This method is inefficient and is for debugging use
only. | [
"Convert",
"an",
"event",
"code",
"to",
"its",
"equivalent",
"string",
"given",
"its",
"type",
"string",
".",
"The",
"type",
"string",
"is",
"needed",
"because",
"event",
"codes",
"are",
"context",
"sensitive",
".",
"For",
"example",
"the",
"code",
"1",
"i... | train | https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxInput.java#L759-L777 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.appendDocumentType | protected boolean appendDocumentType(StringBuilder sb, DocumentType type) {
if (type == null) {
return false;
}
sb.append("<!DOCTYPE ").append(type.getName());
boolean hasNoPublicId = true;
if (type.getPublicId() != null && type.getPublicId().length() > 0) {
... | java | protected boolean appendDocumentType(StringBuilder sb, DocumentType type) {
if (type == null) {
return false;
}
sb.append("<!DOCTYPE ").append(type.getName());
boolean hasNoPublicId = true;
if (type.getPublicId() != null && type.getPublicId().length() > 0) {
... | [
"protected",
"boolean",
"appendDocumentType",
"(",
"StringBuilder",
"sb",
",",
"DocumentType",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"sb",
".",
"append",
"(",
"\"<!DOCTYPE \"",
")",
".",
"append",
"(",
... | Appends the XML DOCTYPE for {@link #getShortString} or {@link #appendFullDocumentHeader} if present.
@param sb the builder to append to
@param type the document type
@return true if the DOCTPYE has been appended
@since XMLUnit 2.4.0 | [
"Appends",
"the",
"XML",
"DOCTYPE",
"for",
"{",
"@link",
"#getShortString",
"}",
"or",
"{",
"@link",
"#appendFullDocumentHeader",
"}",
"if",
"present",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L220-L238 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/OverlapResolver.java | OverlapResolver.areIntersected | public boolean areIntersected(IBond bond1, IBond bond2) {
double x1 = 0, x2 = 0, x3 = 0, x4 = 0;
double y1 = 0, y2 = 0, y3 = 0, y4 = 0;
//Point2D.Double p1 = null, p2 = null, p3 = null, p4 = null;
x1 = bond1.getBegin().getPoint2d().x;
x2 = bond1.getEnd().getPoint2d().x;
... | java | public boolean areIntersected(IBond bond1, IBond bond2) {
double x1 = 0, x2 = 0, x3 = 0, x4 = 0;
double y1 = 0, y2 = 0, y3 = 0, y4 = 0;
//Point2D.Double p1 = null, p2 = null, p3 = null, p4 = null;
x1 = bond1.getBegin().getPoint2d().x;
x2 = bond1.getEnd().getPoint2d().x;
... | [
"public",
"boolean",
"areIntersected",
"(",
"IBond",
"bond1",
",",
"IBond",
"bond2",
")",
"{",
"double",
"x1",
"=",
"0",
",",
"x2",
"=",
"0",
",",
"x3",
"=",
"0",
",",
"x4",
"=",
"0",
";",
"double",
"y1",
"=",
"0",
",",
"y2",
"=",
"0",
",",
"... | Checks if two bonds cross each other.
@param bond1 Description of the Parameter
@param bond2 Description of the Parameter
@return Description of the Return Value | [
"Checks",
"if",
"two",
"bonds",
"cross",
"each",
"other",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/OverlapResolver.java#L245-L268 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java | BigtableClusterUtilities.lookupInstanceId | public static String lookupInstanceId(String projectId, String clusterId, String zoneId)
throws IOException {
BigtableClusterUtilities utils;
try {
utils = BigtableClusterUtilities.forAllInstances(projectId);
} catch (GeneralSecurityException e) {
throw new RuntimeException("Could not initia... | java | public static String lookupInstanceId(String projectId, String clusterId, String zoneId)
throws IOException {
BigtableClusterUtilities utils;
try {
utils = BigtableClusterUtilities.forAllInstances(projectId);
} catch (GeneralSecurityException e) {
throw new RuntimeException("Could not initia... | [
"public",
"static",
"String",
"lookupInstanceId",
"(",
"String",
"projectId",
",",
"String",
"clusterId",
",",
"String",
"zoneId",
")",
"throws",
"IOException",
"{",
"BigtableClusterUtilities",
"utils",
";",
"try",
"{",
"utils",
"=",
"BigtableClusterUtilities",
".",... | @return The instance id associated with the given project, zone and cluster. We expect instance
and cluster to have one-to-one relationship.
@throws IllegalStateException if the cluster is not found | [
"@return",
"The",
"instance",
"id",
"associated",
"with",
"the",
"given",
"project",
"zone",
"and",
"cluster",
".",
"We",
"expect",
"instance",
"and",
"cluster",
"to",
"have",
"one",
"-",
"to",
"-",
"one",
"relationship",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java#L79-L98 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.appendln | @GwtIncompatible("incompatible method")
public StrBuilder appendln(final String format, final Object... objs) {
return append(format, objs).appendNewLine();
} | java | @GwtIncompatible("incompatible method")
public StrBuilder appendln(final String format, final Object... objs) {
return append(format, objs).appendNewLine();
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"StrBuilder",
"appendln",
"(",
"final",
"String",
"format",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"return",
"append",
"(",
"format",
",",
"objs",
")",
".",
"appendNewLine",
"(",
... | Calls {@link String#format(String, Object...)} and appends the result.
@param format the format string
@param objs the objects to use in the format string
@return {@code this} to enable chaining
@see String#format(String, Object...)
@since 3.2 | [
"Calls",
"{",
"@link",
"String#format",
"(",
"String",
"Object",
"...",
")",
"}",
"and",
"appends",
"the",
"result",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1003-L1006 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final boolean autoSync, final String name, final Type clazz, final A rs) {
checkResourceName(name);
ConcurrentHashMap<String, ResourceEntry> map = this.store.get(clazz);
if (map == null) {
synchronized (clazz) {
map = this.store.get(clazz);
... | java | public <A> A register(final boolean autoSync, final String name, final Type clazz, final A rs) {
checkResourceName(name);
ConcurrentHashMap<String, ResourceEntry> map = this.store.get(clazz);
if (map == null) {
synchronized (clazz) {
map = this.store.get(clazz);
... | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"boolean",
"autoSync",
",",
"final",
"String",
"name",
",",
"final",
"Type",
"clazz",
",",
"final",
"A",
"rs",
")",
"{",
"checkResourceName",
"(",
"name",
")",
";",
"ConcurrentHashMap",
"<",
"String... | 将对象以指定资源名和类型注入到资源池中
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param name 资源名
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象 | [
"将对象以指定资源名和类型注入到资源池中"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L401-L420 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.setAlign | public static CellStyle setAlign(CellStyle cellStyle, HorizontalAlignment halign, VerticalAlignment valign) {
cellStyle.setAlignment(halign);
cellStyle.setVerticalAlignment(valign);
return cellStyle;
} | java | public static CellStyle setAlign(CellStyle cellStyle, HorizontalAlignment halign, VerticalAlignment valign) {
cellStyle.setAlignment(halign);
cellStyle.setVerticalAlignment(valign);
return cellStyle;
} | [
"public",
"static",
"CellStyle",
"setAlign",
"(",
"CellStyle",
"cellStyle",
",",
"HorizontalAlignment",
"halign",
",",
"VerticalAlignment",
"valign",
")",
"{",
"cellStyle",
".",
"setAlignment",
"(",
"halign",
")",
";",
"cellStyle",
".",
"setVerticalAlignment",
"(",
... | 设置cell文本对齐样式
@param cellStyle {@link CellStyle}
@param halign 横向位置
@param valign 纵向位置
@return {@link CellStyle} | [
"设置cell文本对齐样式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L55-L59 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.toSortedString | public static <T> String toSortedString(Counter<T> counter, int k, String itemFormat, String joiner) {
return toSortedString(counter, k, itemFormat, joiner, "%s");
} | java | public static <T> String toSortedString(Counter<T> counter, int k, String itemFormat, String joiner) {
return toSortedString(counter, k, itemFormat, joiner, "%s");
} | [
"public",
"static",
"<",
"T",
">",
"String",
"toSortedString",
"(",
"Counter",
"<",
"T",
">",
"counter",
",",
"int",
"k",
",",
"String",
"itemFormat",
",",
"String",
"joiner",
")",
"{",
"return",
"toSortedString",
"(",
"counter",
",",
"k",
",",
"itemForm... | Returns a string representation of a Counter, displaying the keys and their
counts in decreasing order of count. At most k keys are displayed.
@param counter
A Counter.
@param k
The number of keys to include. Use Integer.MAX_VALUE to include
all keys.
@param itemFormat
The format string for key/count pairs, where the ... | [
"Returns",
"a",
"string",
"representation",
"of",
"a",
"Counter",
"displaying",
"the",
"keys",
"and",
"their",
"counts",
"in",
"decreasing",
"order",
"of",
"count",
".",
"At",
"most",
"k",
"keys",
"are",
"displayed",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1792-L1794 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CategoryUrl.java | CategoryUrl.deleteCategoryByIdUrl | public static MozuUrl deleteCategoryByIdUrl(Boolean cascadeDelete, Integer categoryId, Boolean forceDelete, Boolean reassignToParent)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/?cascadeDelete={cascadeDelete}&forceDelete={forceDelete}&reassignToParent={reassignT... | java | public static MozuUrl deleteCategoryByIdUrl(Boolean cascadeDelete, Integer categoryId, Boolean forceDelete, Boolean reassignToParent)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/?cascadeDelete={cascadeDelete}&forceDelete={forceDelete}&reassignToParent={reassignT... | [
"public",
"static",
"MozuUrl",
"deleteCategoryByIdUrl",
"(",
"Boolean",
"cascadeDelete",
",",
"Integer",
"categoryId",
",",
"Boolean",
"forceDelete",
",",
"Boolean",
"reassignToParent",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/co... | Get Resource Url for DeleteCategoryById
@param cascadeDelete Specifies whether to also delete all subcategories associated with the specified category.If you set this value is false, only the specified category is deleted.The default value is false.
@param categoryId Unique identifier of the category to modify.
@param ... | [
"Get",
"Resource",
"Url",
"for",
"DeleteCategoryById"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CategoryUrl.java#L152-L160 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPolyline.java | MapPolyline.getNearestEndIndex | @Pure
public final int getNearestEndIndex(double x, double y, OutputParameter<Double> distance) {
final int count = getPointCount();
final Point2d firstPoint = getPointAt(0);
final Point2d lastPoint = getPointAt(count - 1);
final double d1 = Point2D.getDistancePointPoint(firstPoint.getX(), firstPoint.getY(), x... | java | @Pure
public final int getNearestEndIndex(double x, double y, OutputParameter<Double> distance) {
final int count = getPointCount();
final Point2d firstPoint = getPointAt(0);
final Point2d lastPoint = getPointAt(count - 1);
final double d1 = Point2D.getDistancePointPoint(firstPoint.getX(), firstPoint.getY(), x... | [
"@",
"Pure",
"public",
"final",
"int",
"getNearestEndIndex",
"(",
"double",
"x",
",",
"double",
"y",
",",
"OutputParameter",
"<",
"Double",
">",
"distance",
")",
"{",
"final",
"int",
"count",
"=",
"getPointCount",
"(",
")",
";",
"final",
"Point2d",
"firstP... | Replies the index of the nearest end of line according to the specified point.
@param x is the point coordinate from which the distance must be computed
@param y is the point coordinate from which the distance must be computed
@param distance is the distance value that will be set by this function (if the parameter is... | [
"Replies",
"the",
"index",
"of",
"the",
"nearest",
"end",
"of",
"line",
"according",
"to",
"the",
"specified",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPolyline.java#L248-L265 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.saveCounter | public static <E> void saveCounter(Counter<E> c, OutputStream stream) {
PrintStream out = new PrintStream(stream);
for (E key : c.keySet()) {
out.println(key + " " + c.getCount(key));
}
} | java | public static <E> void saveCounter(Counter<E> c, OutputStream stream) {
PrintStream out = new PrintStream(stream);
for (E key : c.keySet()) {
out.println(key + " " + c.getCount(key));
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"saveCounter",
"(",
"Counter",
"<",
"E",
">",
"c",
",",
"OutputStream",
"stream",
")",
"{",
"PrintStream",
"out",
"=",
"new",
"PrintStream",
"(",
"stream",
")",
";",
"for",
"(",
"E",
"key",
":",
"c",
".",
... | Saves a Counter as one key/count pair per line separated by white space to
the given OutputStream. Does not close the stream. | [
"Saves",
"a",
"Counter",
"as",
"one",
"key",
"/",
"count",
"pair",
"per",
"line",
"separated",
"by",
"white",
"space",
"to",
"the",
"given",
"OutputStream",
".",
"Does",
"not",
"close",
"the",
"stream",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1632-L1637 |
recommenders/rival | rival-split/src/main/java/net/recommenders/rival/split/parser/AbstractLastfmCelmaParser.java | AbstractLastfmCelmaParser.getIndexMap | public static long getIndexMap(final File in, final Map<String, Long> map) throws IOException {
long id = 0;
if (in.exists()) {
BufferedReader br = SimpleParser.getBufferedReader(in);
String line;
while ((line = br.readLine()) != null) {
String[] toks ... | java | public static long getIndexMap(final File in, final Map<String, Long> map) throws IOException {
long id = 0;
if (in.exists()) {
BufferedReader br = SimpleParser.getBufferedReader(in);
String line;
while ((line = br.readLine()) != null) {
String[] toks ... | [
"public",
"static",
"long",
"getIndexMap",
"(",
"final",
"File",
"in",
",",
"final",
"Map",
"<",
"String",
",",
"Long",
">",
"map",
")",
"throws",
"IOException",
"{",
"long",
"id",
"=",
"0",
";",
"if",
"(",
"in",
".",
"exists",
"(",
")",
")",
"{",
... | Read a user/item mapping (user/item original value, user/item internal
id) from a file and return the maximum index number in that file.
@param in The file with id mapping.
@param map The user/item mapping
@return The largest id number.
@throws IOException if file does not exist. | [
"Read",
"a",
"user",
"/",
"item",
"mapping",
"(",
"user",
"/",
"item",
"original",
"value",
"user",
"/",
"item",
"internal",
"id",
")",
"from",
"a",
"file",
"and",
"return",
"the",
"maximum",
"index",
"number",
"in",
"that",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-split/src/main/java/net/recommenders/rival/split/parser/AbstractLastfmCelmaParser.java#L56-L70 |
pac4j/pac4j | pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPPostSimpleSignEncoder.java | Pac4jHTTPPostSimpleSignEncoder.getEndpointURL | @Override
protected URI getEndpointURL(MessageContext<SAMLObject> messageContext) throws MessageEncodingException {
try {
return SAMLBindingSupport.getEndpointURL(messageContext);
} catch (BindingException e) {
throw new MessageEncodingException("Could not obtain message endp... | java | @Override
protected URI getEndpointURL(MessageContext<SAMLObject> messageContext) throws MessageEncodingException {
try {
return SAMLBindingSupport.getEndpointURL(messageContext);
} catch (BindingException e) {
throw new MessageEncodingException("Could not obtain message endp... | [
"@",
"Override",
"protected",
"URI",
"getEndpointURL",
"(",
"MessageContext",
"<",
"SAMLObject",
">",
"messageContext",
")",
"throws",
"MessageEncodingException",
"{",
"try",
"{",
"return",
"SAMLBindingSupport",
".",
"getEndpointURL",
"(",
"messageContext",
")",
";",
... | Gets the response URL from the message context.
@param messageContext current message context
@return response URL from the message context
@throws MessageEncodingException throw if no relying party endpoint is available | [
"Gets",
"the",
"response",
"URL",
"from",
"the",
"message",
"context",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPPostSimpleSignEncoder.java#L40-L47 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleUiExtensions.java | ModuleUiExtensions.fetchAll | public CMAArray<CMAUiExtension> fetchAll(String spaceId, String environmentId) {
return fetchAll(spaceId, environmentId, null);
} | java | public CMAArray<CMAUiExtension> fetchAll(String spaceId, String environmentId) {
return fetchAll(spaceId, environmentId, null);
} | [
"public",
"CMAArray",
"<",
"CMAUiExtension",
">",
"fetchAll",
"(",
"String",
"spaceId",
",",
"String",
"environmentId",
")",
"{",
"return",
"fetchAll",
"(",
"spaceId",
",",
"environmentId",
",",
"null",
")",
";",
"}"
] | Fetch ui extensions from a given space.
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId the id of the space this is valid on.
@param environmentId the id of the environment this is valid on.
@return all the ui extensions for a specif... | [
"Fetch",
"ui",
"extensions",
"from",
"a",
"given",
"space",
".",
"{",
"@link",
"CMAClient",
".",
"Builder#setSpaceId",
"(",
"String",
")",
"}",
"and",
"will",
"ignore",
"{",
"@link",
"CMAClient",
".",
"Builder#setEnvironmentId",
"(",
"String",
")",
"}",
"."
... | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleUiExtensions.java#L137-L139 |
FINRAOS/DataGenerator | dg-core/src/main/java/org/finra/datagenerator/consumer/DataPipe.java | DataPipe.getDelimited | public String getDelimited(String[] outTemplate, String separator) {
StringBuilder b = new StringBuilder(1024);
for (String var : outTemplate) {
if (b.length() > 0) {
b.append(separator);
}
b.append(getDataMap().get(var));
}
r... | java | public String getDelimited(String[] outTemplate, String separator) {
StringBuilder b = new StringBuilder(1024);
for (String var : outTemplate) {
if (b.length() > 0) {
b.append(separator);
}
b.append(getDataMap().get(var));
}
r... | [
"public",
"String",
"getDelimited",
"(",
"String",
"[",
"]",
"outTemplate",
",",
"String",
"separator",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
"1024",
")",
";",
"for",
"(",
"String",
"var",
":",
"outTemplate",
")",
"{",
"if",
"... | Given an array of variable names, returns a delimited {@link String}
of values.
@param outTemplate an array of {@link String}s containing the variable
names.
@param separator the delimiter to use
@return a pipe delimited {@link String} of values | [
"Given",
"an",
"array",
"of",
"variable",
"names",
"returns",
"a",
"delimited",
"{",
"@link",
"String",
"}",
"of",
"values",
"."
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/consumer/DataPipe.java#L88-L99 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.addPatternAsync | public Observable<PatternRuleInfo> addPatternAsync(UUID appId, String versionId, PatternRuleCreateObject pattern) {
return addPatternWithServiceResponseAsync(appId, versionId, pattern).map(new Func1<ServiceResponse<PatternRuleInfo>, PatternRuleInfo>() {
@Override
public PatternRuleInfo c... | java | public Observable<PatternRuleInfo> addPatternAsync(UUID appId, String versionId, PatternRuleCreateObject pattern) {
return addPatternWithServiceResponseAsync(appId, versionId, pattern).map(new Func1<ServiceResponse<PatternRuleInfo>, PatternRuleInfo>() {
@Override
public PatternRuleInfo c... | [
"public",
"Observable",
"<",
"PatternRuleInfo",
">",
"addPatternAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"PatternRuleCreateObject",
"pattern",
")",
"{",
"return",
"addPatternWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"pattern... | Adds one pattern to the specified application.
@param appId The application ID.
@param versionId The version ID.
@param pattern The input pattern.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PatternRuleInfo object | [
"Adds",
"one",
"pattern",
"to",
"the",
"specified",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java#L141-L148 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/util/xml/ObjectTreeParser.java | ObjectTreeParser.setField | private void setField(Field field, Object instance, Object value) throws SlickXMLException {
try {
field.setAccessible(true);
field.set(instance, value);
} catch (IllegalArgumentException e) {
throw new SlickXMLException("Failed to set: "+field+" for an XML attribute, is it valid?", e);
} catch (Il... | java | private void setField(Field field, Object instance, Object value) throws SlickXMLException {
try {
field.setAccessible(true);
field.set(instance, value);
} catch (IllegalArgumentException e) {
throw new SlickXMLException("Failed to set: "+field+" for an XML attribute, is it valid?", e);
} catch (Il... | [
"private",
"void",
"setField",
"(",
"Field",
"field",
",",
"Object",
"instance",
",",
"Object",
"value",
")",
"throws",
"SlickXMLException",
"{",
"try",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"field",
".",
"set",
"(",
"instance",
",",
... | Set a field value on a object instance
@param field The field to be set
@param instance The instance of the object to set it on
@param value The value to set
@throws SlickXMLException Indicates a failure to set or access the field | [
"Set",
"a",
"field",
"value",
"on",
"a",
"object",
"instance"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/xml/ObjectTreeParser.java#L429-L440 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetResourceDefinitionResult.java | GetResourceDefinitionResult.withTags | public GetResourceDefinitionResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | java | public GetResourceDefinitionResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"GetResourceDefinitionResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"tags",
"for",
"the",
"definition",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetResourceDefinitionResult.java#L310-L313 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.roundWithTrailingZeroes | public static BigDecimal roundWithTrailingZeroes(BigDecimal value, MathContext mathContext) {
if (value.precision() == mathContext.getPrecision()) {
return value;
}
if (value.signum() == 0) {
return BigDecimal.ZERO.setScale(mathContext.getPrecision() - 1);
}
try {
BigDecimal stripped = valu... | java | public static BigDecimal roundWithTrailingZeroes(BigDecimal value, MathContext mathContext) {
if (value.precision() == mathContext.getPrecision()) {
return value;
}
if (value.signum() == 0) {
return BigDecimal.ZERO.setScale(mathContext.getPrecision() - 1);
}
try {
BigDecimal stripped = valu... | [
"public",
"static",
"BigDecimal",
"roundWithTrailingZeroes",
"(",
"BigDecimal",
"value",
",",
"MathContext",
"mathContext",
")",
"{",
"if",
"(",
"value",
".",
"precision",
"(",
")",
"==",
"mathContext",
".",
"getPrecision",
"(",
")",
")",
"{",
"return",
"value... | Rounds the specified {@link BigDecimal} to the precision of the specified {@link MathContext} including trailing zeroes.
<p>This method is similar to {@link BigDecimal#round(MathContext)} but does <strong>not</strong> remove the trailing zeroes.</p>
<p>Example:</p>
<pre>
MathContext mc = new MathContext(5);
System.ou... | [
"Rounds",
"the",
"specified",
"{",
"@link",
"BigDecimal",
"}",
"to",
"the",
"precision",
"of",
"the",
"specified",
"{",
"@link",
"MathContext",
"}",
"including",
"trailing",
"zeroes",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L428-L450 |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.addCertAndPrivateKey | public synchronized void addCertAndPrivateKey(String hostname, final X509Certificate cert, final PrivateKey privKey)
throws KeyStoreException, CertificateException, NoSuchAlgorithmException
{
// String alias = ThumbprintUtil.getThumbprint(cert);
_ks.deleteEntry(hostname);
_ks.setCertificateEntry(hostname... | java | public synchronized void addCertAndPrivateKey(String hostname, final X509Certificate cert, final PrivateKey privKey)
throws KeyStoreException, CertificateException, NoSuchAlgorithmException
{
// String alias = ThumbprintUtil.getThumbprint(cert);
_ks.deleteEntry(hostname);
_ks.setCertificateEntry(hostname... | [
"public",
"synchronized",
"void",
"addCertAndPrivateKey",
"(",
"String",
"hostname",
",",
"final",
"X509Certificate",
"cert",
",",
"final",
"PrivateKey",
"privKey",
")",
"throws",
"KeyStoreException",
",",
"CertificateException",
",",
"NoSuchAlgorithmException",
"{",
"/... | Stores a new certificate and its associated private key in the keystore.
@param hostname
@param cert
@param privKey @throws KeyStoreException
@throws CertificateException
@throws NoSuchAlgorithmException | [
"Stores",
"a",
"new",
"certificate",
"and",
"its",
"associated",
"private",
"key",
"in",
"the",
"keystore",
"."
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L547-L562 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/well/WellRenderer.java | WellRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Well well = (Well) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = well.getClientId();
String sz = well.getSize();
rw.startElemen... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Well well = (Well) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = well.getClientId();
String sz = well.getSize();
rw.startElemen... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Well",
"well",
"=... | This methods generates the HTML code of the current b:well.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the
HTML code between the beginning and the end of the component. For
instance, in the case of a panel component the con... | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"well",
".",
"<code",
">",
"encodeBegin<",
"/",
"code",
">",
"generates",
"the",
"start",
"of",
"the",
"component",
".",
"After",
"the",
"the",
"JSF",
"framework",
"... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/well/WellRenderer.java#L52-L88 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.buildGetPropertyExpression | public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final boolean useBooleanGetter) {
String methodName = (useBooleanGetter ? "is" : "get") + MetaClassHelper.capitalize(propertyName);
MethodCallExpre... | java | public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final boolean useBooleanGetter) {
String methodName = (useBooleanGetter ? "is" : "get") + MetaClassHelper.capitalize(propertyName);
MethodCallExpre... | [
"public",
"static",
"MethodCallExpression",
"buildGetPropertyExpression",
"(",
"final",
"Expression",
"objectExpression",
",",
"final",
"String",
"propertyName",
",",
"final",
"ClassNode",
"targetClassNode",
",",
"final",
"boolean",
"useBooleanGetter",
")",
"{",
"String",... | Build static direct call to getter of a property
@param objectExpression
@param propertyName
@param targetClassNode
@param useBooleanGetter
@return The method call expression | [
"Build",
"static",
"direct",
"call",
"to",
"getter",
"of",
"a",
"property"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1314-L1322 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/ConnectionData.java | ConnectionData.createUri | private static URI createUri(String protocol, String host, int port) {
try {
return new URI(protocol, null, host, port, null, null, null);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
} | java | private static URI createUri(String protocol, String host, int port) {
try {
return new URI(protocol, null, host, port, null, null, null);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
} | [
"private",
"static",
"URI",
"createUri",
"(",
"String",
"protocol",
",",
"String",
"host",
",",
"int",
"port",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"protocol",
",",
"null",
",",
"host",
",",
"port",
",",
"null",
",",
"null",
",",
"null"... | A convenience method to create a new {@link URI} out of a protocol, host and port, hiding the
{@link URISyntaxException} behind a {@link RuntimeException}.
@param protocol the protocol such as http
@param host hostname or IP address
@param port port number
@return a new {@link URI} | [
"A",
"convenience",
"method",
"to",
"create",
"a",
"new",
"{",
"@link",
"URI",
"}",
"out",
"of",
"a",
"protocol",
"host",
"and",
"port",
"hiding",
"the",
"{",
"@link",
"URISyntaxException",
"}",
"behind",
"a",
"{",
"@link",
"RuntimeException",
"}",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/ConnectionData.java#L39-L45 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_availableFarmProbes_GET | public ArrayList<OvhFarmAvailableProbe> serviceName_availableFarmProbes_GET(String serviceName) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/availableFarmProbes";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t5)... | java | public ArrayList<OvhFarmAvailableProbe> serviceName_availableFarmProbes_GET(String serviceName) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/availableFarmProbes";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t5)... | [
"public",
"ArrayList",
"<",
"OvhFarmAvailableProbe",
">",
"serviceName_availableFarmProbes_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/availableFarmProbes\"",
";",
"StringBuilder",
"sb",
"=",... | Available farm probes for health checks
REST: GET /ipLoadbalancing/{serviceName}/availableFarmProbes
@param serviceName [required] The internal name of your IP load balancing | [
"Available",
"farm",
"probes",
"for",
"health",
"checks"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L710-L715 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallRoleMembership | public static RoleMembershipBean unmarshallRoleMembership(Map<String, Object> source) {
if (source == null) {
return null;
}
RoleMembershipBean bean = new RoleMembershipBean();
bean.setId(asLong(source.get("id")));
bean.setOrganizationId(asString(source.get("organizat... | java | public static RoleMembershipBean unmarshallRoleMembership(Map<String, Object> source) {
if (source == null) {
return null;
}
RoleMembershipBean bean = new RoleMembershipBean();
bean.setId(asLong(source.get("id")));
bean.setOrganizationId(asString(source.get("organizat... | [
"public",
"static",
"RoleMembershipBean",
"unmarshallRoleMembership",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"RoleMembershipBean",
"bean",
"=",
"new",
"RoleM... | Unmarshals the given map source into a bean.
@param source the source
@return the role membership | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1190-L1202 |
alkacon/opencms-core | src/org/opencms/db/CmsAliasManager.java | CmsAliasManager.checkPermissionsForMassEdit | private void checkPermissionsForMassEdit(CmsObject cms, String siteRoot) throws CmsException {
String originalSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot(siteRoot);
checkPermissionsForMassEdit(cms);
} finally {
... | java | private void checkPermissionsForMassEdit(CmsObject cms, String siteRoot) throws CmsException {
String originalSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot(siteRoot);
checkPermissionsForMassEdit(cms);
} finally {
... | [
"private",
"void",
"checkPermissionsForMassEdit",
"(",
"CmsObject",
"cms",
",",
"String",
"siteRoot",
")",
"throws",
"CmsException",
"{",
"String",
"originalSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
";",
"try",
"{",... | Checks that the user has permissions for a mass edit operation in a given site.<p>
@param cms the current CMS context
@param siteRoot the site for which the permissions should be checked
@throws CmsException if something goes wrong | [
"Checks",
"that",
"the",
"user",
"has",
"permissions",
"for",
"a",
"mass",
"edit",
"operation",
"in",
"a",
"given",
"site",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L512-L521 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomInstantAfter | public static Instant randomInstantAfter(Instant after) {
checkArgument(after != null, "After must be non-null");
checkArgument(after.isBefore(MAX_INSTANT), "Cannot produce date after %s", MAX_INSTANT);
return randomInstant(after.plus(1, MILLIS), MAX_INSTANT);
} | java | public static Instant randomInstantAfter(Instant after) {
checkArgument(after != null, "After must be non-null");
checkArgument(after.isBefore(MAX_INSTANT), "Cannot produce date after %s", MAX_INSTANT);
return randomInstant(after.plus(1, MILLIS), MAX_INSTANT);
} | [
"public",
"static",
"Instant",
"randomInstantAfter",
"(",
"Instant",
"after",
")",
"{",
"checkArgument",
"(",
"after",
"!=",
"null",
",",
"\"After must be non-null\"",
")",
";",
"checkArgument",
"(",
"after",
".",
"isBefore",
"(",
"MAX_INSTANT",
")",
",",
"\"Can... | Returns a random {@link Instant} that is after the given {@link Instant}.
@param after the value that returned {@link Instant} must be after
@return the random {@link Instant}
@throws IllegalArgumentException if after is null or if after is equal to or after {@link
RandomDateUtils#MAX_INSTANT} | [
"Returns",
"a",
"random",
"{",
"@link",
"Instant",
"}",
"that",
"is",
"after",
"the",
"given",
"{",
"@link",
"Instant",
"}",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L487-L491 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.getOperationStatusAsync | public Observable<OperationStatusResponseInner> getOperationStatusAsync(String userName, String operationUrl) {
return getOperationStatusWithServiceResponseAsync(userName, operationUrl).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
... | java | public Observable<OperationStatusResponseInner> getOperationStatusAsync(String userName, String operationUrl) {
return getOperationStatusWithServiceResponseAsync(userName, operationUrl).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"getOperationStatusAsync",
"(",
"String",
"userName",
",",
"String",
"operationUrl",
")",
"{",
"return",
"getOperationStatusWithServiceResponseAsync",
"(",
"userName",
",",
"operationUrl",
")",
".",
"map",
... | Gets the status of long running operation.
@param userName The name of the user.
@param operationUrl The operation url of long running operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatusResponseInner object | [
"Gets",
"the",
"status",
"of",
"long",
"running",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L407-L414 |
bwkimmel/jdcp | jdcp-worker/src/main/java/ca/eandb/jdcp/worker/DbCachingJobServiceClassLoaderStrategy.java | DbCachingJobServiceClassLoaderStrategy.prepareDataSource | public static void prepareDataSource(DataSource ds) throws SQLException {
Connection con = null;
String sql;
try {
con = ds.getConnection();
con.setAutoCommit(false);
DatabaseMetaData meta = con.getMetaData();
ResultSet rs = meta.getTables(null, null, null, new String[]{"TABLE"});
... | java | public static void prepareDataSource(DataSource ds) throws SQLException {
Connection con = null;
String sql;
try {
con = ds.getConnection();
con.setAutoCommit(false);
DatabaseMetaData meta = con.getMetaData();
ResultSet rs = meta.getTables(null, null, null, new String[]{"TABLE"});
... | [
"public",
"static",
"void",
"prepareDataSource",
"(",
"DataSource",
"ds",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
"=",
"null",
";",
"String",
"sql",
";",
"try",
"{",
"con",
"=",
"ds",
".",
"getConnection",
"(",
")",
";",
"con",
".",
"set... | Prepares the data source to store cached class definitions.
@param ds The <code>DataSource</code> to prepare.
@throws SQLException If an error occurs while communicating with the
database. | [
"Prepares",
"the",
"data",
"source",
"to",
"store",
"cached",
"class",
"definitions",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker/src/main/java/ca/eandb/jdcp/worker/DbCachingJobServiceClassLoaderStrategy.java#L63-L103 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/RtfWriter2.java | RtfWriter2.importRtfFragment | public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events ) throws IOException, DocumentException {
if(!this.open) {
throw new DocumentException("The document must be open to import RTF fragments.");
}
RtfParser rtfImport = new RtfParse... | java | public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events ) throws IOException, DocumentException {
if(!this.open) {
throw new DocumentException("The document must be open to import RTF fragments.");
}
RtfParser rtfImport = new RtfParse... | [
"public",
"void",
"importRtfFragment",
"(",
"InputStream",
"documentSource",
",",
"RtfImportMappings",
"mappings",
",",
"EventListener",
"[",
"]",
"events",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"if",
"(",
"!",
"this",
".",
"open",
")",
"{... | Adds a fragment of an RTF document to the current RTF document being generated.
Since this fragment doesn't contain font or color tables, all fonts and colors
are mapped to the default font and color. If the font and color mappings are
known, they can be specified via the mappings parameter.
Uses new RtfParser object.
... | [
"Adds",
"a",
"fragment",
"of",
"an",
"RTF",
"document",
"to",
"the",
"current",
"RTF",
"document",
"being",
"generated",
".",
"Since",
"this",
"fragment",
"doesn",
"t",
"contain",
"font",
"or",
"color",
"tables",
"all",
"fonts",
"and",
"colors",
"are",
"ma... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/RtfWriter2.java#L335-L346 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/databasetype/SybaseIqDatabaseType.java | SybaseIqDatabaseType.getTableColumnInfo | public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException
{
if (schema == null || schema.length() == 0 || schema.equals(this.getTempDbSchemaName()))
{
schema = this.getCurrentSchema(connection);
}
return TableC... | java | public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException
{
if (schema == null || schema.length() == 0 || schema.equals(this.getTempDbSchemaName()))
{
schema = this.getCurrentSchema(connection);
}
return TableC... | [
"public",
"TableColumnInfo",
"getTableColumnInfo",
"(",
"Connection",
"connection",
",",
"String",
"schema",
",",
"String",
"table",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"schema",
"==",
"null",
"||",
"schema",
".",
"length",
"(",
")",
"==",
"0",
"|... | <p>Overridden to create the table metadata by hand rather than using the JDBC
<code>DatabaseMetadata.getColumns()</code> method. This is because the Sybase driver fails
when the connection is an XA connection unless you allow transactional DDL in tempdb.</p> | [
"<p",
">",
"Overridden",
"to",
"create",
"the",
"table",
"metadata",
"by",
"hand",
"rather",
"than",
"using",
"the",
"JDBC",
"<code",
">",
"DatabaseMetadata",
".",
"getColumns",
"()",
"<",
"/",
"code",
">",
"method",
".",
"This",
"is",
"because",
"the",
... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/databasetype/SybaseIqDatabaseType.java#L225-L232 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/RowColumnOps.java | RowColumnOps.divRow | public static void divRow(Matrix A, int i, int start, int to, double c)
{
for(int j = start; j < to; j++)
A.set(i, j, A.get(i, j)/c);
} | java | public static void divRow(Matrix A, int i, int start, int to, double c)
{
for(int j = start; j < to; j++)
A.set(i, j, A.get(i, j)/c);
} | [
"public",
"static",
"void",
"divRow",
"(",
"Matrix",
"A",
",",
"int",
"i",
",",
"int",
"start",
",",
"int",
"to",
",",
"double",
"c",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"start",
";",
"j",
"<",
"to",
";",
"j",
"++",
")",
"A",
".",
"set",
... | Updates the values of row <tt>i</tt> in the given matrix to be A[i,:] = A[i,:] / c
@param A the matrix to perform he update on
@param i the row to update
@param start the first index of the row to update from (inclusive)
@param to the last index of the row to update (exclusive)
@param c the constant to divide each ele... | [
"Updates",
"the",
"values",
"of",
"row",
"<tt",
">",
"i<",
"/",
"tt",
">",
"in",
"the",
"given",
"matrix",
"to",
"be",
"A",
"[",
"i",
":",
"]",
"=",
"A",
"[",
"i",
":",
"]",
"/",
"c"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L150-L154 |
lawloretienne/ImageGallery | library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java | TouchImageView.translateMatrixAfterRotate | private void translateMatrixAfterRotate(int axis, float trans, float prevImageSize, float imageSize, int prevViewSize, int viewSize, int drawableSize) {
if (imageSize < viewSize) {
//
// The width/height of image is less than the view's width/height. Center it.
//
... | java | private void translateMatrixAfterRotate(int axis, float trans, float prevImageSize, float imageSize, int prevViewSize, int viewSize, int drawableSize) {
if (imageSize < viewSize) {
//
// The width/height of image is less than the view's width/height. Center it.
//
... | [
"private",
"void",
"translateMatrixAfterRotate",
"(",
"int",
"axis",
",",
"float",
"trans",
",",
"float",
"prevImageSize",
",",
"float",
"imageSize",
",",
"int",
"prevViewSize",
",",
"int",
"viewSize",
",",
"int",
"drawableSize",
")",
"{",
"if",
"(",
"imageSiz... | After rotating, the matrix needs to be translated. This function finds the area of image
which was previously centered and adjusts translations so that is again the center, post-rotation.
@param axis Matrix.MTRANS_X or Matrix.MTRANS_Y
@param trans the value of trans in that axis before the rotation
@p... | [
"After",
"rotating",
"the",
"matrix",
"needs",
"to",
"be",
"translated",
".",
"This",
"function",
"finds",
"the",
"area",
"of",
"image",
"which",
"was",
"previously",
"centered",
"and",
"adjusts",
"translations",
"so",
"that",
"is",
"again",
"the",
"center",
... | train | https://github.com/lawloretienne/ImageGallery/blob/960d68dfb2b81d05322a576723ac4f090e10eda7/library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java#L710-L732 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.listByLocationAsync | public Observable<Page<InstanceFailoverGroupInner>> listByLocationAsync(final String resourceGroupName, final String locationName) {
return listByLocationWithServiceResponseAsync(resourceGroupName, locationName)
.map(new Func1<ServiceResponse<Page<InstanceFailoverGroupInner>>, Page<InstanceFailoverG... | java | public Observable<Page<InstanceFailoverGroupInner>> listByLocationAsync(final String resourceGroupName, final String locationName) {
return listByLocationWithServiceResponseAsync(resourceGroupName, locationName)
.map(new Func1<ServiceResponse<Page<InstanceFailoverGroupInner>>, Page<InstanceFailoverG... | [
"public",
"Observable",
"<",
"Page",
"<",
"InstanceFailoverGroupInner",
">",
">",
"listByLocationAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"locationName",
")",
"{",
"return",
"listByLocationWithServiceResponseAsync",
"(",
"resourceGroupN... | Lists the failover groups in a location.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the region where the resource is located.
@throws IllegalArgumentException thrown if ... | [
"Lists",
"the",
"failover",
"groups",
"in",
"a",
"location",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L609-L617 |
airomem/airomem | airomem-core/src/main/java/pl/setblack/airomem/core/impl/PersistenceControllerImpl.java | PersistenceControllerImpl.executeAndQuery | @Override
public <R> R executeAndQuery(Command<ROOT, R> cmd) {
return this.executeAndQuery((ContextCommand<ROOT, R>) cmd);
} | java | @Override
public <R> R executeAndQuery(Command<ROOT, R> cmd) {
return this.executeAndQuery((ContextCommand<ROOT, R>) cmd);
} | [
"@",
"Override",
"public",
"<",
"R",
">",
"R",
"executeAndQuery",
"(",
"Command",
"<",
"ROOT",
",",
"R",
">",
"cmd",
")",
"{",
"return",
"this",
".",
"executeAndQuery",
"(",
"(",
"ContextCommand",
"<",
"ROOT",
",",
"R",
">",
")",
"cmd",
")",
";",
"... | Perform command on system.
<p>
Inside command can be any code doing any changes. Such changes are
guaranteed to be preserved (if only command ended without exception).
@param cmd | [
"Perform",
"command",
"on",
"system",
".",
"<p",
">",
"Inside",
"command",
"can",
"be",
"any",
"code",
"doing",
"any",
"changes",
".",
"Such",
"changes",
"are",
"guaranteed",
"to",
"be",
"preserved",
"(",
"if",
"only",
"command",
"ended",
"without",
"excep... | train | https://github.com/airomem/airomem/blob/281ce18ff64836fccfb0edab18b8d677f1101a32/airomem-core/src/main/java/pl/setblack/airomem/core/impl/PersistenceControllerImpl.java#L108-L111 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SignatureParser.java | SignatureParser.getNumParametersForInvocation | public static int getNumParametersForInvocation(InvokeInstruction inv, ConstantPoolGen cpg) {
SignatureParser sigParser = new SignatureParser(inv.getSignature(cpg));
return sigParser.getNumParameters();
} | java | public static int getNumParametersForInvocation(InvokeInstruction inv, ConstantPoolGen cpg) {
SignatureParser sigParser = new SignatureParser(inv.getSignature(cpg));
return sigParser.getNumParameters();
} | [
"public",
"static",
"int",
"getNumParametersForInvocation",
"(",
"InvokeInstruction",
"inv",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"SignatureParser",
"sigParser",
"=",
"new",
"SignatureParser",
"(",
"inv",
".",
"getSignature",
"(",
"cpg",
")",
")",
";",
"return... | Get the number of parameters passed to method invocation.
@param inv
@param cpg
@return int number of parameters | [
"Get",
"the",
"number",
"of",
"parameters",
"passed",
"to",
"method",
"invocation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SignatureParser.java#L249-L252 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.doOnResponse | public final HttpClient doOnResponse(BiConsumer<? super HttpClientResponse, ? super Connection> doOnResponse) {
Objects.requireNonNull(doOnResponse, "doOnResponse");
return new HttpClientDoOn(this, null, null, doOnResponse, null);
} | java | public final HttpClient doOnResponse(BiConsumer<? super HttpClientResponse, ? super Connection> doOnResponse) {
Objects.requireNonNull(doOnResponse, "doOnResponse");
return new HttpClientDoOn(this, null, null, doOnResponse, null);
} | [
"public",
"final",
"HttpClient",
"doOnResponse",
"(",
"BiConsumer",
"<",
"?",
"super",
"HttpClientResponse",
",",
"?",
"super",
"Connection",
">",
"doOnResponse",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"doOnResponse",
",",
"\"doOnResponse\"",
")",
";",
... | Setup a callback called after {@link HttpClientResponse} headers have been
received
@param doOnResponse a consumer observing connected events
@return a new {@link HttpClient} | [
"Setup",
"a",
"callback",
"called",
"after",
"{",
"@link",
"HttpClientResponse",
"}",
"headers",
"have",
"been",
"received"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L556-L559 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_service_serviceName_faxConsumption_consumptionId_GET | public OvhFaxConsumption billingAccount_service_serviceName_faxConsumption_consumptionId_GET(String billingAccount, String serviceName, Long consumptionId) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/faxConsumption/{consumptionId}";
StringBuilder sb = path(qPath, billingAc... | java | public OvhFaxConsumption billingAccount_service_serviceName_faxConsumption_consumptionId_GET(String billingAccount, String serviceName, Long consumptionId) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/faxConsumption/{consumptionId}";
StringBuilder sb = path(qPath, billingAc... | [
"public",
"OvhFaxConsumption",
"billingAccount_service_serviceName_faxConsumption_consumptionId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"consumptionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAc... | Get this object properties
REST: GET /telephony/{billingAccount}/service/{serviceName}/faxConsumption/{consumptionId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param consumptionId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4053-L4058 |
calimero-project/calimero-core | src/tuwien/auto/calimero/knxnetip/ConnectionBase.java | ConnectionBase.fireFrameReceived | protected void fireFrameReceived(final CEMI frame)
{
final FrameEvent fe = new FrameEvent(this, frame);
listeners.fire(l -> l.frameReceived(fe));
} | java | protected void fireFrameReceived(final CEMI frame)
{
final FrameEvent fe = new FrameEvent(this, frame);
listeners.fire(l -> l.frameReceived(fe));
} | [
"protected",
"void",
"fireFrameReceived",
"(",
"final",
"CEMI",
"frame",
")",
"{",
"final",
"FrameEvent",
"fe",
"=",
"new",
"FrameEvent",
"(",
"this",
",",
"frame",
")",
";",
"listeners",
".",
"fire",
"(",
"l",
"->",
"l",
".",
"frameReceived",
"(",
"fe",... | Fires a frame received event ({@link KNXListener#frameReceived(FrameEvent)}) for the supplied cEMI
<code>frame</code>.
@param frame the cEMI to generate the event for | [
"Fires",
"a",
"frame",
"received",
"event",
"(",
"{",
"@link",
"KNXListener#frameReceived",
"(",
"FrameEvent",
")",
"}",
")",
"for",
"the",
"supplied",
"cEMI",
"<code",
">",
"frame<",
"/",
"code",
">",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L355-L359 |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java | VelocityEngineFactory.initSpringResourceLoader | protected void initSpringResourceLoader(VelocityEngine velocityEngine, String resourceLoaderPath) {
velocityEngine.setProperty(
RuntimeConstants.RESOURCE_LOADER, SpringResourceLoader.NAME);
velocityEngine.setProperty(
SpringResourceLoader.SPRING_RESOURCE_LOADER_CLASS, SpringResourceLoader.class.getName());
... | java | protected void initSpringResourceLoader(VelocityEngine velocityEngine, String resourceLoaderPath) {
velocityEngine.setProperty(
RuntimeConstants.RESOURCE_LOADER, SpringResourceLoader.NAME);
velocityEngine.setProperty(
SpringResourceLoader.SPRING_RESOURCE_LOADER_CLASS, SpringResourceLoader.class.getName());
... | [
"protected",
"void",
"initSpringResourceLoader",
"(",
"VelocityEngine",
"velocityEngine",
",",
"String",
"resourceLoaderPath",
")",
"{",
"velocityEngine",
".",
"setProperty",
"(",
"RuntimeConstants",
".",
"RESOURCE_LOADER",
",",
"SpringResourceLoader",
".",
"NAME",
")",
... | Initialize a SpringResourceLoader for the given VelocityEngine.
<p>Called by {@code initVelocityResourceLoader}.
@param velocityEngine the VelocityEngine to configure
@param resourceLoaderPath the path to load Velocity resources from
@see SpringResourceLoader
@see #initVelocityResourceLoader | [
"Initialize",
"a",
"SpringResourceLoader",
"for",
"the",
"given",
"VelocityEngine",
".",
"<p",
">",
"Called",
"by",
"{"
] | train | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java#L329-L340 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java | SeaGlassRootPaneUI.installBorder | public void installBorder(JRootPane root) {
int style = root.getWindowDecorationStyle();
if (style == JRootPane.NONE) {
LookAndFeel.uninstallBorder(root);
} else {
root.setBorder(new SeaGlassBorder(this, new Insets(0, 1, 1, 1)));
}
} | java | public void installBorder(JRootPane root) {
int style = root.getWindowDecorationStyle();
if (style == JRootPane.NONE) {
LookAndFeel.uninstallBorder(root);
} else {
root.setBorder(new SeaGlassBorder(this, new Insets(0, 1, 1, 1)));
}
} | [
"public",
"void",
"installBorder",
"(",
"JRootPane",
"root",
")",
"{",
"int",
"style",
"=",
"root",
".",
"getWindowDecorationStyle",
"(",
")",
";",
"if",
"(",
"style",
"==",
"JRootPane",
".",
"NONE",
")",
"{",
"LookAndFeel",
".",
"uninstallBorder",
"(",
"r... | Installs the appropriate <code>Border</code> onto the <code>
JRootPane</code>.
@param root the root pane. | [
"Installs",
"the",
"appropriate",
"<code",
">",
"Border<",
"/",
"code",
">",
"onto",
"the",
"<code",
">",
"JRootPane<",
"/",
"code",
">",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java#L318-L326 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.beginCreateOrUpdate | public EventSubscriptionInner beginCreateOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().single().body();
} | java | public EventSubscriptionInner beginCreateOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().single().body();
} | [
"public",
"EventSubscriptionInner",
"beginCreateOrUpdate",
"(",
"String",
"scope",
",",
"String",
"eventSubscriptionName",
",",
"EventSubscriptionInner",
"eventSubscriptionInfo",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"scope",
",",
"eventSubscri... | Create or update an event subscription.
Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
@param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource grou... | [
"Create",
"or",
"update",
"an",
"event",
"subscription",
".",
"Asynchronously",
"creates",
"a",
"new",
"event",
"subscription",
"or",
"updates",
"an",
"existing",
"event",
"subscription",
"based",
"on",
"the",
"specified",
"scope",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L313-L315 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java | DTMDefaultBase.getExpandedTypeID | public int getExpandedTypeID(String namespace, String localName, int type)
{
ExpandedNameTable ent = m_expandedNameTable;
return ent.getExpandedTypeID(namespace, localName, type);
} | java | public int getExpandedTypeID(String namespace, String localName, int type)
{
ExpandedNameTable ent = m_expandedNameTable;
return ent.getExpandedTypeID(namespace, localName, type);
} | [
"public",
"int",
"getExpandedTypeID",
"(",
"String",
"namespace",
",",
"String",
"localName",
",",
"int",
"type",
")",
"{",
"ExpandedNameTable",
"ent",
"=",
"m_expandedNameTable",
";",
"return",
"ent",
".",
"getExpandedTypeID",
"(",
"namespace",
",",
"localName",
... | Given an expanded name, return an ID. If the expanded-name does not
exist in the internal tables, the entry will be created, and the ID will
be returned. Any additional nodes that are created that have this
expanded name will use this ID.
@param type The simple type, i.e. one of ELEMENT, ATTRIBUTE, etc.
@param name... | [
"Given",
"an",
"expanded",
"name",
"return",
"an",
"ID",
".",
"If",
"the",
"expanded",
"-",
"name",
"does",
"not",
"exist",
"in",
"the",
"internal",
"tables",
"the",
"entry",
"will",
"be",
"created",
"and",
"the",
"ID",
"will",
"be",
"returned",
".",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java#L1704-L1710 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java | PebbleKit.registerReceivedAckHandler | public static BroadcastReceiver registerReceivedAckHandler(final Context context,
final PebbleAckReceiver receiver) {
return registerBroadcastReceiverInternal(context, INTENT_APP_RECEIVE_ACK, receiver);
} | java | public static BroadcastReceiver registerReceivedAckHandler(final Context context,
final PebbleAckReceiver receiver) {
return registerBroadcastReceiverInternal(context, INTENT_APP_RECEIVE_ACK, receiver);
} | [
"public",
"static",
"BroadcastReceiver",
"registerReceivedAckHandler",
"(",
"final",
"Context",
"context",
",",
"final",
"PebbleAckReceiver",
"receiver",
")",
"{",
"return",
"registerBroadcastReceiverInternal",
"(",
"context",
",",
"INTENT_APP_RECEIVE_ACK",
",",
"receiver",... | A convenience function to assist in programatically registering a broadcast receiver for the 'RECEIVE_ACK'
intent.
To avoid leaking memory, activities registering BroadcastReceivers <em>must</em> unregister them in the
Activity's {@link android.app.Activity#onPause()} method.
@param context
The context in which to re... | [
"A",
"convenience",
"function",
"to",
"assist",
"in",
"programatically",
"registering",
"a",
"broadcast",
"receiver",
"for",
"the",
"RECEIVE_ACK",
"intent",
"."
] | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L448-L451 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbPooledConnection.java | MariaDbPooledConnection.fireConnectionErrorOccured | public void fireConnectionErrorOccured(SQLException ex) {
ConnectionEvent event = new ConnectionEvent(this, ex);
for (ConnectionEventListener listener : connectionEventListeners) {
listener.connectionErrorOccurred(event);
}
} | java | public void fireConnectionErrorOccured(SQLException ex) {
ConnectionEvent event = new ConnectionEvent(this, ex);
for (ConnectionEventListener listener : connectionEventListeners) {
listener.connectionErrorOccurred(event);
}
} | [
"public",
"void",
"fireConnectionErrorOccured",
"(",
"SQLException",
"ex",
")",
"{",
"ConnectionEvent",
"event",
"=",
"new",
"ConnectionEvent",
"(",
"this",
",",
"ex",
")",
";",
"for",
"(",
"ConnectionEventListener",
"listener",
":",
"connectionEventListeners",
")",... | Fire connection error to listening listeners.
@param ex exception | [
"Fire",
"connection",
"error",
"to",
"listening",
"listeners",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbPooledConnection.java#L228-L233 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spyRes | public static <T1, T2, R> BiFunction<T1, T2, R> spyRes(BiFunction<T1, T2, R> function, Box<R> result) {
return spy(function, result, Box.<T1>empty(), Box.<T2>empty());
} | java | public static <T1, T2, R> BiFunction<T1, T2, R> spyRes(BiFunction<T1, T2, R> function, Box<R> result) {
return spy(function, result, Box.<T1>empty(), Box.<T2>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"BiFunction",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"spyRes",
"(",
"BiFunction",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"function",
",",
"Box",
"<",
"R",
">",
"result",
")",
"{",
"return",
... | Proxies a binary function spying for result.
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <R> the function result type
@param function the function that will be spied
@param result a box that will be containing spied result
@return the proxied function | [
"Proxies",
"a",
"binary",
"function",
"spying",
"for",
"result",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L253-L255 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.generateKeyPair | public static KeyPair generateKeyPair(String algorithm, int keySize, byte[] seed) {
return KeyUtil.generateKeyPair(algorithm, keySize, seed);
} | java | public static KeyPair generateKeyPair(String algorithm, int keySize, byte[] seed) {
return KeyUtil.generateKeyPair(algorithm, keySize, seed);
} | [
"public",
"static",
"KeyPair",
"generateKeyPair",
"(",
"String",
"algorithm",
",",
"int",
"keySize",
",",
"byte",
"[",
"]",
"seed",
")",
"{",
"return",
"KeyUtil",
".",
"generateKeyPair",
"(",
"algorithm",
",",
"keySize",
",",
"seed",
")",
";",
"}"
] | 生成用于非对称加密的公钥和私钥<br>
密钥对生成算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator
@param algorithm 非对称加密算法
@param keySize 密钥模(modulus )长度
@param seed 种子
@return {@link KeyPair} | [
"生成用于非对称加密的公钥和私钥<br",
">",
"密钥对生成算法见:https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"technotes",
"/",
"guides",
"/",
"security",
"/",
"StandardNames",
".",
"html#KeyPairGenerator"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L227-L229 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.printTo | public void printTo(Writer out, ReadableInstant instant) throws IOException {
printTo((Appendable) out, instant);
} | java | public void printTo(Writer out, ReadableInstant instant) throws IOException {
printTo((Appendable) out, instant);
} | [
"public",
"void",
"printTo",
"(",
"Writer",
"out",
",",
"ReadableInstant",
"instant",
")",
"throws",
"IOException",
"{",
"printTo",
"(",
"(",
"Appendable",
")",
"out",
",",
"instant",
")",
";",
"}"
] | Prints a ReadableInstant, using the chronology supplied by the instant.
@param out the destination to format to, not null
@param instant instant to format, null means now | [
"Prints",
"a",
"ReadableInstant",
"using",
"the",
"chronology",
"supplied",
"by",
"the",
"instant",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L521-L523 |
allengeorge/libraft | libraft-agent/src/main/java/io/libraft/agent/RaftAgent.java | RaftAgent.setupCustomCommandSerializationAndDeserialization | public synchronized void setupCustomCommandSerializationAndDeserialization(CommandSerializer commandSerializer, CommandDeserializer commandDeserializer) {
checkState(!running);
checkState(!initialized);
checkState(!setupConversion);
jdbcLog.setupCustomCommandSerializerAndDeserializer(co... | java | public synchronized void setupCustomCommandSerializationAndDeserialization(CommandSerializer commandSerializer, CommandDeserializer commandDeserializer) {
checkState(!running);
checkState(!initialized);
checkState(!setupConversion);
jdbcLog.setupCustomCommandSerializerAndDeserializer(co... | [
"public",
"synchronized",
"void",
"setupCustomCommandSerializationAndDeserialization",
"(",
"CommandSerializer",
"commandSerializer",
",",
"CommandDeserializer",
"commandDeserializer",
")",
"{",
"checkState",
"(",
"!",
"running",
")",
";",
"checkState",
"(",
"!",
"initializ... | Setup custom serialization and deserialization for POJO {@link Command} objects.
This method should <strong>only</strong> be called once.
@param commandSerializer {@code CommandSerializer} that can serialize a POJO {@code Command} into binary
@param commandDeserializer {@code CommandDeserializer} that can deserialize ... | [
"Setup",
"custom",
"serialization",
"and",
"deserialization",
"for",
"POJO",
"{",
"@link",
"Command",
"}",
"objects",
".",
"This",
"method",
"should",
"<strong",
">",
"only<",
"/",
"strong",
">",
"be",
"called",
"once",
"."
] | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/RaftAgent.java#L315-L324 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.perspectiveLH | public Matrix4d perspectiveLH(double fovy, double aspect, double zNear, double zFar, boolean zZeroToOne) {
return perspectiveLH(fovy, aspect, zNear, zFar, zZeroToOne, this);
} | java | public Matrix4d perspectiveLH(double fovy, double aspect, double zNear, double zFar, boolean zZeroToOne) {
return perspectiveLH(fovy, aspect, zNear, zFar, zZeroToOne, this);
} | [
"public",
"Matrix4d",
"perspectiveLH",
"(",
"double",
"fovy",
",",
"double",
"aspect",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"return",
"perspectiveLH",
"(",
"fovy",
",",
"aspect",
",",
"zNear",
",",
"zFar",
... | Apply a symmetric perspective projection frustum transformation for a left-handed coordinate system
using the given NDC z range to this matrix.
<p>
If <code>M</code> is <code>this</code> matrix and <code>P</code> the perspective projection matrix,
then the new matrix will be <code>M * P</code>. So when transforming a
v... | [
"Apply",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L12917-L12919 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/xpath/XPathQueryBuilder.java | XPathQueryBuilder.createLocationStep | private LocationStepQueryNode createLocationStep(SimpleNode node, NAryQueryNode parent) {
LocationStepQueryNode queryNode = null;
boolean descendant = false;
Node p = node.jjtGetParent();
for (int i = 0; i < p.jjtGetNumChildren(); i++) {
SimpleNode c = (SimpleNode) p.jjtGetCh... | java | private LocationStepQueryNode createLocationStep(SimpleNode node, NAryQueryNode parent) {
LocationStepQueryNode queryNode = null;
boolean descendant = false;
Node p = node.jjtGetParent();
for (int i = 0; i < p.jjtGetNumChildren(); i++) {
SimpleNode c = (SimpleNode) p.jjtGetCh... | [
"private",
"LocationStepQueryNode",
"createLocationStep",
"(",
"SimpleNode",
"node",
",",
"NAryQueryNode",
"parent",
")",
"{",
"LocationStepQueryNode",
"queryNode",
"=",
"null",
";",
"boolean",
"descendant",
"=",
"false",
";",
"Node",
"p",
"=",
"node",
".",
"jjtGe... | Creates a <code>LocationStepQueryNode</code> at the current position
in parent.
@param node the current node in the xpath syntax tree.
@param parent the parent <code>PathQueryNode</code>.
@return the created <code>LocationStepQueryNode</code>. | [
"Creates",
"a",
"<code",
">",
"LocationStepQueryNode<",
"/",
"code",
">",
"at",
"the",
"current",
"position",
"in",
"parent",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/xpath/XPathQueryBuilder.java#L603-L623 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.