repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeCall.java | RespokeCall.startCall | public void startCall(final Context context, GLSurfaceView glView, boolean isAudioOnly) {
caller = true;
audioOnly = isAudioOnly;
if (directConnectionOnly) {
if (null == directConnection) {
actuallyAddDirectConnection();
}
directConnectionDid... | java | public void startCall(final Context context, GLSurfaceView glView, boolean isAudioOnly) {
caller = true;
audioOnly = isAudioOnly;
if (directConnectionOnly) {
if (null == directConnection) {
actuallyAddDirectConnection();
}
directConnectionDid... | [
"public",
"void",
"startCall",
"(",
"final",
"Context",
"context",
",",
"GLSurfaceView",
"glView",
",",
"boolean",
"isAudioOnly",
")",
"{",
"caller",
"=",
"true",
";",
"audioOnly",
"=",
"isAudioOnly",
";",
"if",
"(",
"directConnectionOnly",
")",
"{",
"if",
"... | Start the outgoing call process. This method is used internally by the SDK and should never be called directly from your client application
@param context An application context with which to access shared resources
@param glView The GLSurfaceView on which to render video if applicable
@param isAudioOnly S... | [
"Start",
"the",
"outgoing",
"call",
"process",
".",
"This",
"method",
"is",
"used",
"internally",
"by",
"the",
"SDK",
"and",
"should",
"never",
"be",
"called",
"directly",
"from",
"your",
"client",
"application"
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeCall.java#L278-L306 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/extensions/ChocoUtils.java | ChocoUtils.postImplies | public static void postImplies(ReconfigurationProblem rp, BoolVar b1, Constraint c2) {
Model s = rp.getModel();
BoolVar bC2 = s.boolVar(rp.makeVarLabel(c2.toString(), " satisfied"));
c2.reifyWith(bC2);
BoolVar notB1 = b1.not();
s.post(rp.getModel().arithm(b1, "!=", notB1));
... | java | public static void postImplies(ReconfigurationProblem rp, BoolVar b1, Constraint c2) {
Model s = rp.getModel();
BoolVar bC2 = s.boolVar(rp.makeVarLabel(c2.toString(), " satisfied"));
c2.reifyWith(bC2);
BoolVar notB1 = b1.not();
s.post(rp.getModel().arithm(b1, "!=", notB1));
... | [
"public",
"static",
"void",
"postImplies",
"(",
"ReconfigurationProblem",
"rp",
",",
"BoolVar",
"b1",
",",
"Constraint",
"c2",
")",
"{",
"Model",
"s",
"=",
"rp",
".",
"getModel",
"(",
")",
";",
"BoolVar",
"bC2",
"=",
"s",
".",
"boolVar",
"(",
"rp",
"."... | Make and post an implies constraint where the first operand is a boolean: b1 -> c2.
The constraint is translated into (or(not(b1,c2))
@param rp the problem to solve
@param b1 the first constraint as boolean
@param c2 the second constraint | [
"Make",
"and",
"post",
"an",
"implies",
"constraint",
"where",
"the",
"first",
"operand",
"is",
"a",
"boolean",
":",
"b1",
"-",
">",
"c2",
".",
"The",
"constraint",
"is",
"translated",
"into",
"(",
"or",
"(",
"not",
"(",
"b1",
"c2",
"))"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/ChocoUtils.java#L45-L54 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/uri/BitcoinURI.java | BitcoinURI.putWithValidation | private void putWithValidation(String key, Object value) throws BitcoinURIParseException {
if (parameterMap.containsKey(key)) {
throw new BitcoinURIParseException(String.format(Locale.US, "'%s' is duplicated, URI is invalid", key));
} else {
parameterMap.put(key, value);
... | java | private void putWithValidation(String key, Object value) throws BitcoinURIParseException {
if (parameterMap.containsKey(key)) {
throw new BitcoinURIParseException(String.format(Locale.US, "'%s' is duplicated, URI is invalid", key));
} else {
parameterMap.put(key, value);
... | [
"private",
"void",
"putWithValidation",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"BitcoinURIParseException",
"{",
"if",
"(",
"parameterMap",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"BitcoinURIParseException",
"(",
"Stri... | Put the value against the key in the map checking for duplication. This avoids address field overwrite etc.
@param key The key for the map
@param value The value to store | [
"Put",
"the",
"value",
"against",
"the",
"key",
"in",
"the",
"map",
"checking",
"for",
"duplication",
".",
"This",
"avoids",
"address",
"field",
"overwrite",
"etc",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/uri/BitcoinURI.java#L250-L256 |
cdapio/tigon | tigon-hbase-compat-0.94/src/main/java/co/cask/tigon/data/transaction/queue/hbase/HBase94QueueConsumer.java | HBase94QueueConsumer.createStateFilter | private Filter createStateFilter() {
byte[] processedMask = new byte[Ints.BYTES * 2 + 1];
processedMask[processedMask.length - 1] = ConsumerEntryState.PROCESSED.getState();
return new SingleColumnValueFilter(QueueEntryRow.COLUMN_FAMILY, stateColumnName,
CompareFilter.C... | java | private Filter createStateFilter() {
byte[] processedMask = new byte[Ints.BYTES * 2 + 1];
processedMask[processedMask.length - 1] = ConsumerEntryState.PROCESSED.getState();
return new SingleColumnValueFilter(QueueEntryRow.COLUMN_FAMILY, stateColumnName,
CompareFilter.C... | [
"private",
"Filter",
"createStateFilter",
"(",
")",
"{",
"byte",
"[",
"]",
"processedMask",
"=",
"new",
"byte",
"[",
"Ints",
".",
"BYTES",
"*",
"2",
"+",
"1",
"]",
";",
"processedMask",
"[",
"processedMask",
".",
"length",
"-",
"1",
"]",
"=",
"Consumer... | Creates a HBase filter that will filter out rows with state column state = PROCESSED (ignoring transaction). | [
"Creates",
"a",
"HBase",
"filter",
"that",
"will",
"filter",
"out",
"rows",
"with",
"state",
"column",
"state",
"=",
"PROCESSED",
"(",
"ignoring",
"transaction",
")",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-hbase-compat-0.94/src/main/java/co/cask/tigon/data/transaction/queue/hbase/HBase94QueueConsumer.java#L76-L82 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/MapboxNavigation.java | MapboxNavigation.startNavigation | public void startNavigation(@NonNull DirectionsRoute directionsRoute, @NonNull DirectionsRouteType routeType) {
startNavigationWith(directionsRoute, routeType);
} | java | public void startNavigation(@NonNull DirectionsRoute directionsRoute, @NonNull DirectionsRouteType routeType) {
startNavigationWith(directionsRoute, routeType);
} | [
"public",
"void",
"startNavigation",
"(",
"@",
"NonNull",
"DirectionsRoute",
"directionsRoute",
",",
"@",
"NonNull",
"DirectionsRouteType",
"routeType",
")",
"{",
"startNavigationWith",
"(",
"directionsRoute",
",",
"routeType",
")",
";",
"}"
] | Calling this method with {@link DirectionsRouteType#NEW_ROUTE} begins a new navigation session using the
provided directions route. If called with {@link DirectionsRouteType#FRESH_ROUTE}, only leg annotation data
will be update - can be used with {@link RouteRefresh}.
@param directionsRoute a {@link DirectionsRoute} ... | [
"Calling",
"this",
"method",
"with",
"{",
"@link",
"DirectionsRouteType#NEW_ROUTE",
"}",
"begins",
"a",
"new",
"navigation",
"session",
"using",
"the",
"provided",
"directions",
"route",
".",
"If",
"called",
"with",
"{",
"@link",
"DirectionsRouteType#FRESH_ROUTE",
"... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/MapboxNavigation.java#L359-L361 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/MessageDigestSpi.java | MessageDigestSpi.engineDigest | protected int engineDigest(byte[] buf, int offset, int len)
throws DigestException {
byte[] digest = engineDigest();
if (len < digest.length)
throw new DigestException("partial digests not returned");
if (buf.length - offset < dige... | java | protected int engineDigest(byte[] buf, int offset, int len)
throws DigestException {
byte[] digest = engineDigest();
if (len < digest.length)
throw new DigestException("partial digests not returned");
if (buf.length - offset < dige... | [
"protected",
"int",
"engineDigest",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"DigestException",
"{",
"byte",
"[",
"]",
"digest",
"=",
"engineDigest",
"(",
")",
";",
"if",
"(",
"len",
"<",
"digest",
".",
"l... | Completes the hash computation by performing final
operations such as padding. Once {@code engineDigest} has
been called, the engine should be reset (see
{@link #engineReset() engineReset}).
Resetting is the responsibility of the
engine implementor.
This method should be abstract, but we leave it concrete for
binary c... | [
"Completes",
"the",
"hash",
"computation",
"by",
"performing",
"final",
"operations",
"such",
"as",
"padding",
".",
"Once",
"{",
"@code",
"engineDigest",
"}",
"has",
"been",
"called",
"the",
"engine",
"should",
"be",
"reset",
"(",
"see",
"{",
"@link",
"#engi... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/MessageDigestSpi.java#L173-L184 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java | BitfinexApiCallbackListeners.onOrderbookEvent | public Closeable onOrderbookEvent(final BiConsumer<BitfinexOrderBookSymbol, Collection<BitfinexOrderBookEntry>> listener) {
orderbookEntryConsumers.offer(listener);
return () -> orderbookEntryConsumers.remove(listener);
} | java | public Closeable onOrderbookEvent(final BiConsumer<BitfinexOrderBookSymbol, Collection<BitfinexOrderBookEntry>> listener) {
orderbookEntryConsumers.offer(listener);
return () -> orderbookEntryConsumers.remove(listener);
} | [
"public",
"Closeable",
"onOrderbookEvent",
"(",
"final",
"BiConsumer",
"<",
"BitfinexOrderBookSymbol",
",",
"Collection",
"<",
"BitfinexOrderBookEntry",
">",
">",
"listener",
")",
"{",
"orderbookEntryConsumers",
".",
"offer",
"(",
"listener",
")",
";",
"return",
"("... | registers listener for orderbook events
@param listener of event
@return hook of this listener | [
"registers",
"listener",
"for",
"orderbook",
"events"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L168-L171 |
Zappos/zappos-json | src/main/java/com/zappos/json/JsonReaderCodeGenerator.java | JsonReaderCodeGenerator.getTypeInfo | private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) {
TypeInfo typeInfo = typeMaps.get(path);
if (typeInfo == null) {
typeInfo = new TypeInfo(superType);
typeMaps.put(path, typeInfo);
}
return typeInfo;
} | java | private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) {
TypeInfo typeInfo = typeMaps.get(path);
if (typeInfo == null) {
typeInfo = new TypeInfo(superType);
typeMaps.put(path, typeInfo);
}
return typeInfo;
} | [
"private",
"TypeInfo",
"getTypeInfo",
"(",
"Map",
"<",
"String",
",",
"TypeInfo",
">",
"typeMaps",
",",
"String",
"path",
",",
"Class",
"<",
"?",
">",
"superType",
")",
"{",
"TypeInfo",
"typeInfo",
"=",
"typeMaps",
".",
"get",
"(",
"path",
")",
";",
"i... | Get the TypeInfo object from specified path or return the new one if it does not exist.
@param typeMaps
@param path
@param superType
@return | [
"Get",
"the",
"TypeInfo",
"object",
"from",
"specified",
"path",
"or",
"return",
"the",
"new",
"one",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/Zappos/zappos-json/blob/340633f5db75c2e09ce49bfc3e5f67e8823f5a37/src/main/java/com/zappos/json/JsonReaderCodeGenerator.java#L354-L364 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.parseTime | public static Time parseTime(final String date, final String format, final TimeZone timeZone) {
if (N.isNullOrEmpty(date) || (date.length() == 4 && "null".equalsIgnoreCase(date))) {
return null;
}
return createTime(parse(date, format, timeZone));
} | java | public static Time parseTime(final String date, final String format, final TimeZone timeZone) {
if (N.isNullOrEmpty(date) || (date.length() == 4 && "null".equalsIgnoreCase(date))) {
return null;
}
return createTime(parse(date, format, timeZone));
} | [
"public",
"static",
"Time",
"parseTime",
"(",
"final",
"String",
"date",
",",
"final",
"String",
"format",
",",
"final",
"TimeZone",
"timeZone",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"date",
")",
"||",
"(",
"date",
".",
"length",
"(",
")... | Converts the specified <code>date</code> with the specified {@code format} to a new instance of Time.
<code>null</code> is returned if the specified <code>date</code> is null or empty.
@param date
@param format
@param timeZone
@return | [
"Converts",
"the",
"specified",
"<code",
">",
"date<",
"/",
"code",
">",
"with",
"the",
"specified",
"{",
"@code",
"format",
"}",
"to",
"a",
"new",
"instance",
"of",
"Time",
".",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
"if",
"the",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L433-L439 |
rainu/dbc | src/main/java/de/raysha/lib/dbc/meta/MetadataManager.java | MetadataManager.updateMetadata | public void updateMetadata(String tableName, String metadata){
try {
updateStatement.setString(1, metadata);
updateStatement.setLong(2, tableName.hashCode());
updateStatement.executeUpdate();
} catch (SQLException e) {
throw new BackendException("Could not update metadata for table '" + tableName + "'",... | java | public void updateMetadata(String tableName, String metadata){
try {
updateStatement.setString(1, metadata);
updateStatement.setLong(2, tableName.hashCode());
updateStatement.executeUpdate();
} catch (SQLException e) {
throw new BackendException("Could not update metadata for table '" + tableName + "'",... | [
"public",
"void",
"updateMetadata",
"(",
"String",
"tableName",
",",
"String",
"metadata",
")",
"{",
"try",
"{",
"updateStatement",
".",
"setString",
"(",
"1",
",",
"metadata",
")",
";",
"updateStatement",
".",
"setLong",
"(",
"2",
",",
"tableName",
".",
"... | Aktualisiert die Metadaten eines Eintrages.
@param tableName Name der Tabelle
@param metadata Metadaten die eingetragen werden sollen. | [
"Aktualisiert",
"die",
"Metadaten",
"eines",
"Eintrages",
"."
] | train | https://github.com/rainu/dbc/blob/bdf1d1945ccaa8db8ed0b91bd08d5ef9802777f7/src/main/java/de/raysha/lib/dbc/meta/MetadataManager.java#L159-L167 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendFraction | public DateTimeFormatterBuilder appendFraction(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | java | public DateTimeFormatterBuilder appendFraction(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | [
"public",
"DateTimeFormatterBuilder",
"appendFraction",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"minDigits",
",",
"int",
"maxDigits",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type ... | Instructs the printer to emit a remainder of time as a decimal fraction,
without decimal point. For example, if the field is specified as
minuteOfHour and the time is 12:30:45, the value printed is 75. A
decimal point is implied, so the fraction is 0.75, or three-quarters of
a minute.
@param fieldType type of field t... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"remainder",
"of",
"time",
"as",
"a",
"decimal",
"fraction",
"without",
"decimal",
"point",
".",
"For",
"example",
"if",
"the",
"field",
"is",
"specified",
"as",
"minuteOfHour",
"and",
"the",
"time",
"is",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L569-L581 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/antlr4/CSSLexerState.java | CSSLexerState.isBalanced | public boolean isBalanced(RecoveryMode mode, CSSLexerState state, CSSToken t) {
if (mode == RecoveryMode.BALANCED)
return !aposOpen && !quotOpen && curlyNest == 0 && parenNest == 0 && sqNest == 0;
else if (mode == RecoveryMode.FUNCTION)
return parenNest == 0 && sqNest == 0;
... | java | public boolean isBalanced(RecoveryMode mode, CSSLexerState state, CSSToken t) {
if (mode == RecoveryMode.BALANCED)
return !aposOpen && !quotOpen && curlyNest == 0 && parenNest == 0 && sqNest == 0;
else if (mode == RecoveryMode.FUNCTION)
return parenNest == 0 && sqNest == 0;
... | [
"public",
"boolean",
"isBalanced",
"(",
"RecoveryMode",
"mode",
",",
"CSSLexerState",
"state",
",",
"CSSToken",
"t",
")",
"{",
"if",
"(",
"mode",
"==",
"RecoveryMode",
".",
"BALANCED",
")",
"return",
"!",
"aposOpen",
"&&",
"!",
"quotOpen",
"&&",
"curlyNest",... | Checks whether some pair characters are balanced. Modes are:
<ul>
<li>BALANCED - everything must be balanced: single and double quotatation marks, curly braces, parentheses
<li>FUNCTION - within the function arguments: parentheses must be balanced
<li>RULE - within the CSS rule: all but curly braces
<li>DECL - within d... | [
"Checks",
"whether",
"some",
"pair",
"characters",
"are",
"balanced",
".",
"Modes",
"are",
":",
"<ul",
">",
"<li",
">",
"BALANCED",
"-",
"everything",
"must",
"be",
"balanced",
":",
"single",
"and",
"double",
"quotatation",
"marks",
"curly",
"braces",
"paren... | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/antlr4/CSSLexerState.java#L69-L83 |
apache/incubator-heron | storm-compatibility/src/java/org/apache/storm/utils/ConfigUtils.java | ConfigUtils.translateConfig | @SuppressWarnings({"rawtypes", "unchecked"})
public static Config translateConfig(Map stormConfig) {
Config heronConfig;
if (stormConfig != null) {
heronConfig = new Config((Map<String, Object>) stormConfig);
} else {
heronConfig = new Config();
}
// Look at serialization stuff first
... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static Config translateConfig(Map stormConfig) {
Config heronConfig;
if (stormConfig != null) {
heronConfig = new Config((Map<String, Object>) stormConfig);
} else {
heronConfig = new Config();
}
// Look at serialization stuff first
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"Config",
"translateConfig",
"(",
"Map",
"stormConfig",
")",
"{",
"Config",
"heronConfig",
";",
"if",
"(",
"stormConfig",
"!=",
"null",
")",
"{",
"heronConfi... | Translate storm config to heron config for topology
@param stormConfig the storm config
@return a heron config | [
"Translate",
"storm",
"config",
"to",
"heron",
"config",
"for",
"topology"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/storm-compatibility/src/java/org/apache/storm/utils/ConfigUtils.java#L38-L58 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.paymentMean_creditCard_POST | public OvhPaymentMeanValidation paymentMean_creditCard_POST(String description, String returnUrl, Boolean setDefault) throws IOException {
String qPath = "/me/paymentMean/creditCard";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description)... | java | public OvhPaymentMeanValidation paymentMean_creditCard_POST(String description, String returnUrl, Boolean setDefault) throws IOException {
String qPath = "/me/paymentMean/creditCard";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description)... | [
"public",
"OvhPaymentMeanValidation",
"paymentMean_creditCard_POST",
"(",
"String",
"description",
",",
"String",
"returnUrl",
",",
"Boolean",
"setDefault",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/paymentMean/creditCard\"",
";",
"StringBuilder",
... | Add a new credit card
REST: POST /me/paymentMean/creditCard
@param returnUrl [required] Callback URL where the customer will be redirected to after validation
@param setDefault [required] Set as default payment mean once validated
@param description [required] Custom description of this account | [
"Add",
"a",
"new",
"credit",
"card"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L801-L810 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/InterceptorMetaDataHelper.java | InterceptorMetaDataHelper.validateAroundSignature | public static void validateAroundSignature(InterceptorMethodKind kind, Method m, J2EEName name)
throws EJBConfigurationException
{
// Get the modifers for the interceptor method and verify that the
// method is neither final nor static as required by EJB specification.
i... | java | public static void validateAroundSignature(InterceptorMethodKind kind, Method m, J2EEName name)
throws EJBConfigurationException
{
// Get the modifers for the interceptor method and verify that the
// method is neither final nor static as required by EJB specification.
i... | [
"public",
"static",
"void",
"validateAroundSignature",
"(",
"InterceptorMethodKind",
"kind",
",",
"Method",
"m",
",",
"J2EEName",
"name",
")",
"throws",
"EJBConfigurationException",
"{",
"// Get the modifers for the interceptor method and verify that the",
"// method is neither f... | Verify a specified AroundInvoke interceptor method has correct method
modifiers and signature.
@param kind the interceptor kind
@param m is the java reflection Method object for the around invoke method.
@param ejbClass is true if the interceptor is defined on the enterprise bean class
@param name is the {@link J2EENa... | [
"Verify",
"a",
"specified",
"AroundInvoke",
"interceptor",
"method",
"has",
"correct",
"method",
"modifiers",
"and",
"signature",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/InterceptorMetaDataHelper.java#L617-L675 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/CounterGroup.java | CounterGroup.localize | private String localize(String key, String defaultValue) {
String result = defaultValue;
if (bundle != null) {
try {
result = bundle.getString(key);
}
catch (MissingResourceException mre) {
}
}
return result;
} | java | private String localize(String key, String defaultValue) {
String result = defaultValue;
if (bundle != null) {
try {
result = bundle.getString(key);
}
catch (MissingResourceException mre) {
}
}
return result;
} | [
"private",
"String",
"localize",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"defaultValue",
";",
"if",
"(",
"bundle",
"!=",
"null",
")",
"{",
"try",
"{",
"result",
"=",
"bundle",
".",
"getString",
"(",
"key",
... | Looks up key in the ResourceBundle and returns the corresponding value.
If the bundle or the key doesn't exist, returns the default value. | [
"Looks",
"up",
"key",
"in",
"the",
"ResourceBundle",
"and",
"returns",
"the",
"corresponding",
"value",
".",
"If",
"the",
"bundle",
"or",
"the",
"key",
"doesn",
"t",
"exist",
"returns",
"the",
"default",
"value",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/CounterGroup.java#L140-L150 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java | AbstractCachedGenerator.addLinkedResources | protected void addLinkedResources(String path, GeneratorContext context, List<FilePathMapping> fMappings) {
linkedResourceMap.put(getResourceCacheKey(path, context), new CopyOnWriteArrayList<>(fMappings));
JoinableResourceBundle bundle = context.getBundle();
if (bundle != null) {
List<FilePathMapping> bundleF... | java | protected void addLinkedResources(String path, GeneratorContext context, List<FilePathMapping> fMappings) {
linkedResourceMap.put(getResourceCacheKey(path, context), new CopyOnWriteArrayList<>(fMappings));
JoinableResourceBundle bundle = context.getBundle();
if (bundle != null) {
List<FilePathMapping> bundleF... | [
"protected",
"void",
"addLinkedResources",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
",",
"List",
"<",
"FilePathMapping",
">",
"fMappings",
")",
"{",
"linkedResourceMap",
".",
"put",
"(",
"getResourceCacheKey",
"(",
"path",
",",
"context",
")",
... | Adds the linked resource to the linked resource map
@param path
the resource path
@param context
the generator context
@param fMappings
the list of mappings linked to the resource | [
"Adds",
"the",
"linked",
"resource",
"to",
"the",
"linked",
"resource",
"map"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java#L375-L389 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/sdcard.java | sdcard.copyFile | public static void copyFile(File fromFile, File toFile) throws IOException {
copyFile(new FileInputStream(fromFile), new FileOutputStream(toFile));
} | java | public static void copyFile(File fromFile, File toFile) throws IOException {
copyFile(new FileInputStream(fromFile), new FileOutputStream(toFile));
} | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"fromFile",
",",
"File",
"toFile",
")",
"throws",
"IOException",
"{",
"copyFile",
"(",
"new",
"FileInputStream",
"(",
"fromFile",
")",
",",
"new",
"FileOutputStream",
"(",
"toFile",
")",
")",
";",
"}"
] | Creates the specified <code>toFile</code> as a byte for byte copy of the
<code>fromFile</code>. If <code>toFile</code> already exists, then it
will be replaced with a copy of <code>fromFile</code>. The name and path
of <code>toFile</code> will be that of <code>toFile</code>.<br/>
<br/>
<i> Note: <code>fromFile</code> a... | [
"Creates",
"the",
"specified",
"<code",
">",
"toFile<",
"/",
"code",
">",
"as",
"a",
"byte",
"for",
"byte",
"copy",
"of",
"the",
"<code",
">",
"fromFile<",
"/",
"code",
">",
".",
"If",
"<code",
">",
"toFile<",
"/",
"code",
">",
"already",
"exists",
"... | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/sdcard.java#L163-L165 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java | Calendar.addEntryToResult | private void addEntryToResult(Map<LocalDate, List<Entry<?>>> result, Entry<?> entry, LocalDate startDate, LocalDate endDate) {
LocalDate entryStartDate = entry.getStartDate();
LocalDate entryEndDate = entry.getEndDate();
// entry does not intersect with time interval
if (entryEndDate.is... | java | private void addEntryToResult(Map<LocalDate, List<Entry<?>>> result, Entry<?> entry, LocalDate startDate, LocalDate endDate) {
LocalDate entryStartDate = entry.getStartDate();
LocalDate entryEndDate = entry.getEndDate();
// entry does not intersect with time interval
if (entryEndDate.is... | [
"private",
"void",
"addEntryToResult",
"(",
"Map",
"<",
"LocalDate",
",",
"List",
"<",
"Entry",
"<",
"?",
">",
">",
">",
"result",
",",
"Entry",
"<",
"?",
">",
"entry",
",",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
")",
"{",
"LocalDate",
... | /*
Assign the given entry to each date that it intersects with in the given search interval. | [
"/",
"*",
"Assign",
"the",
"given",
"entry",
"to",
"each",
"date",
"that",
"it",
"intersects",
"with",
"in",
"the",
"given",
"search",
"interval",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java#L389-L411 |
fabric8io/ipaas-quickstarts | archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java | ArchetypeBuilder.fileIncludesLine | private boolean fileIncludesLine(File file, String matches) throws IOException {
for (String line: Files.readLines(file)) {
String trimmed = line.trim();
if (trimmed.equals(matches)) {
return true;
}
}
return false;
} | java | private boolean fileIncludesLine(File file, String matches) throws IOException {
for (String line: Files.readLines(file)) {
String trimmed = line.trim();
if (trimmed.equals(matches)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"fileIncludesLine",
"(",
"File",
"file",
",",
"String",
"matches",
")",
"throws",
"IOException",
"{",
"for",
"(",
"String",
"line",
":",
"Files",
".",
"readLines",
"(",
"file",
")",
")",
"{",
"String",
"trimmed",
"=",
"line",
".",
"... | Checks whether the file contains specific line. Partial matches do not count. | [
"Checks",
"whether",
"the",
"file",
"contains",
"specific",
"line",
".",
"Partial",
"matches",
"do",
"not",
"count",
"."
] | train | https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java#L683-L691 |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/sense/SenseData.java | SenseData.getReponseCodeFor | public static final int getReponseCodeFor (final ErrorType errorType, final SenseDataFormat senseDataFormat) {
if (senseDataFormat == SenseDataFormat.FIXED) {
if (errorType == ErrorType.CURRENT)
return 0x70;
else
// errorType == DEFERRED
... | java | public static final int getReponseCodeFor (final ErrorType errorType, final SenseDataFormat senseDataFormat) {
if (senseDataFormat == SenseDataFormat.FIXED) {
if (errorType == ErrorType.CURRENT)
return 0x70;
else
// errorType == DEFERRED
... | [
"public",
"static",
"final",
"int",
"getReponseCodeFor",
"(",
"final",
"ErrorType",
"errorType",
",",
"final",
"SenseDataFormat",
"senseDataFormat",
")",
"{",
"if",
"(",
"senseDataFormat",
"==",
"SenseDataFormat",
".",
"FIXED",
")",
"{",
"if",
"(",
"errorType",
... | Returns the proper response code for the given error type and sense data format.
@param errorType a sense data error type
@param senseDataFormat a sense data format
@return the proper response code | [
"Returns",
"the",
"proper",
"response",
"code",
"for",
"the",
"given",
"error",
"type",
"and",
"sense",
"data",
"format",
"."
] | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/sense/SenseData.java#L77-L94 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/authentication/impl/AuthenticationRequiredHandlerImpl.java | AuthenticationRequiredHandlerImpl.handle | public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
IOException {
saveRequest(context);
String loginFormUrl = getLoginFormUrl();
if (StringUtils.isNotEmpty(loginFormUrl)) {
RedirectUtils.redirect(context.getRequest(), ... | java | public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
IOException {
saveRequest(context);
String loginFormUrl = getLoginFormUrl();
if (StringUtils.isNotEmpty(loginFormUrl)) {
RedirectUtils.redirect(context.getRequest(), ... | [
"public",
"void",
"handle",
"(",
"RequestContext",
"context",
",",
"AuthenticationException",
"e",
")",
"throws",
"SecurityProviderException",
",",
"IOException",
"{",
"saveRequest",
"(",
"context",
")",
";",
"String",
"loginFormUrl",
"=",
"getLoginFormUrl",
"(",
")... | Saves the current request in the request cache and then redirects to the login form page.
@param context the request security context
@param e the exception with the reason for requiring authentication | [
"Saves",
"the",
"current",
"request",
"in",
"the",
"request",
"cache",
"and",
"then",
"redirects",
"to",
"the",
"login",
"form",
"page",
"."
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/authentication/impl/AuthenticationRequiredHandlerImpl.java#L82-L93 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java | TitlePaneCloseButtonPainter.decodeCloseGradient | private Paint decodeCloseGradient(Shape s, Color top, Color bottom) {
Rectangle r = s.getBounds();
int width = r.width;
int height = r.height;
return createGradient(r.x + width / 2, r.y, r.x + width / 2, r.y + height - 1, new float[] { 0f, 1f }, new Color[] { top, bott... | java | private Paint decodeCloseGradient(Shape s, Color top, Color bottom) {
Rectangle r = s.getBounds();
int width = r.width;
int height = r.height;
return createGradient(r.x + width / 2, r.y, r.x + width / 2, r.y + height - 1, new float[] { 0f, 1f }, new Color[] { top, bott... | [
"private",
"Paint",
"decodeCloseGradient",
"(",
"Shape",
"s",
",",
"Color",
"top",
",",
"Color",
"bottom",
")",
"{",
"Rectangle",
"r",
"=",
"s",
".",
"getBounds",
"(",
")",
";",
"int",
"width",
"=",
"r",
".",
"width",
";",
"int",
"height",
"=",
"r",
... | Create the gradient for the close button.
@param s the shape to fill.
@param top the top color.
@param bottom the bottom color.
@return the gradient. | [
"Create",
"the",
"gradient",
"for",
"the",
"close",
"button",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java#L186-L192 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java | OgmEntityEntryState.setAssociation | public void setAssociation(String collectionRole, Association association) {
if ( associations == null ) {
associations = new HashMap<>();
}
associations.put( collectionRole, association );
} | java | public void setAssociation(String collectionRole, Association association) {
if ( associations == null ) {
associations = new HashMap<>();
}
associations.put( collectionRole, association );
} | [
"public",
"void",
"setAssociation",
"(",
"String",
"collectionRole",
",",
"Association",
"association",
")",
"{",
"if",
"(",
"associations",
"==",
"null",
")",
"{",
"associations",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"associations",
".",
"put",
... | Set the association in the entry state.
@param collectionRole the role of the association
@param association the association | [
"Set",
"the",
"association",
"in",
"the",
"entry",
"state",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java#L76-L81 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/shared/RenderContext.java | RenderContext.usePrimaryMsg | public boolean usePrimaryMsg(long msgId, long fallbackId) {
// Note: we need to make sure the fallback msg is actually present if we are going to fallback.
// use getMsgParts() since if the bundle is a RenderOnlySoyMsgBundleImpl then this will be
// allocation free.
return !msgBundle.getMsgParts(msgId).... | java | public boolean usePrimaryMsg(long msgId, long fallbackId) {
// Note: we need to make sure the fallback msg is actually present if we are going to fallback.
// use getMsgParts() since if the bundle is a RenderOnlySoyMsgBundleImpl then this will be
// allocation free.
return !msgBundle.getMsgParts(msgId).... | [
"public",
"boolean",
"usePrimaryMsg",
"(",
"long",
"msgId",
",",
"long",
"fallbackId",
")",
"{",
"// Note: we need to make sure the fallback msg is actually present if we are going to fallback.",
"// use getMsgParts() since if the bundle is a RenderOnlySoyMsgBundleImpl then this will be",
... | Returns {@code true} if the primary msg should be used instead of the fallback. | [
"Returns",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/shared/RenderContext.java#L179-L184 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java | SshUtilities.getRunningDockerContainerId | public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException {
String command = "docker ps | grep " + containerName;
String remoteResponseStr = launchACommand(session, command);
if (remoteResponseStr.length() == 0) {
retu... | java | public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException {
String command = "docker ps | grep " + containerName;
String remoteResponseStr = launchACommand(session, command);
if (remoteResponseStr.length() == 0) {
retu... | [
"public",
"static",
"String",
"getRunningDockerContainerId",
"(",
"Session",
"session",
",",
"String",
"containerName",
")",
"throws",
"JSchException",
",",
"IOException",
"{",
"String",
"command",
"=",
"\"docker ps | grep \"",
"+",
"containerName",
";",
"String",
"re... | Get the container id of a running docker container.
@param session the session to use.
@param containerName the name of the container, used in a grep filter.
@return the id of the container or null.
@throws JSchException
@throws IOException | [
"Get",
"the",
"container",
"id",
"of",
"a",
"running",
"docker",
"container",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L162-L185 |
m-m-m/util | resource/src/main/java/net/sf/mmm/util/resource/base/AbstractBrowsableResourceFactory.java | AbstractBrowsableResourceFactory.registerProvider | public void registerProvider(DataResourceProvider<? extends DataResource> provider, String schemaPrefix) {
getInitializationState().requireNotInitilized();
Objects.requireNonNull(provider, "provider");
Objects.requireNonNull(provider.getResourceType(), "provider.resourceType");
String[] schemaPrefixes;... | java | public void registerProvider(DataResourceProvider<? extends DataResource> provider, String schemaPrefix) {
getInitializationState().requireNotInitilized();
Objects.requireNonNull(provider, "provider");
Objects.requireNonNull(provider.getResourceType(), "provider.resourceType");
String[] schemaPrefixes;... | [
"public",
"void",
"registerProvider",
"(",
"DataResourceProvider",
"<",
"?",
"extends",
"DataResource",
">",
"provider",
",",
"String",
"schemaPrefix",
")",
"{",
"getInitializationState",
"(",
")",
".",
"requireNotInitilized",
"(",
")",
";",
"Objects",
".",
"requi... | This method registers the given {@code provider} for the given {@code schemaPrefix}.
@param provider is the {@link DataResourceProvider} to register.
@param schemaPrefix is the {@link ResourceUriImpl#getSchemePrefix() scheme-prefix} for which the provider
shall be registered. | [
"This",
"method",
"registers",
"the",
"given",
"{",
"@code",
"provider",
"}",
"for",
"the",
"given",
"{",
"@code",
"schemaPrefix",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/resource/src/main/java/net/sf/mmm/util/resource/base/AbstractBrowsableResourceFactory.java#L52-L73 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java | ZipExploder.processJars | public void processJars(File[] jarFiles, File destDir) throws IOException {
for (int i = 0; i < jarFiles.length; i++) {
processFile(jarFiles[i], destDir);
}
} | java | public void processJars(File[] jarFiles, File destDir) throws IOException {
for (int i = 0; i < jarFiles.length; i++) {
processFile(jarFiles[i], destDir);
}
} | [
"public",
"void",
"processJars",
"(",
"File",
"[",
"]",
"jarFiles",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"jarFiles",
".",
"length",
";",
"i",
"++",
")",
"{",
"processFile",
"(",
... | Explode source JAR files into a target directory
@param jarFiles
list of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file | [
"Explode",
"source",
"JAR",
"files",
"into",
"a",
"target",
"directory"
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L168-L172 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/Util.java | Util.readString | static String readString(final InputStream is) {
try (final Scanner s = new Scanner(is, "UTF-8")) {
s.useDelimiter("\\A");
if (s.hasNext()) {
return s.next();
} else {
return "";
}
}
} | java | static String readString(final InputStream is) {
try (final Scanner s = new Scanner(is, "UTF-8")) {
s.useDelimiter("\\A");
if (s.hasNext()) {
return s.next();
} else {
return "";
}
}
} | [
"static",
"String",
"readString",
"(",
"final",
"InputStream",
"is",
")",
"{",
"try",
"(",
"final",
"Scanner",
"s",
"=",
"new",
"Scanner",
"(",
"is",
",",
"\"UTF-8\"",
")",
")",
"{",
"s",
".",
"useDelimiter",
"(",
"\"\\\\A\"",
")",
";",
"if",
"(",
"s... | Reads a string from an input stream.
@param is The input stream.,
@return A string. | [
"Reads",
"a",
"string",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/Util.java#L32-L41 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public int getRequstURIPath(String prefix, int defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Integer.parseInt(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | java | public int getRequstURIPath(String prefix, int defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Integer.parseInt(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | [
"public",
"int",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"int",
"defvalue",
")",
"{",
"String",
"val",
"=",
"getRequstURIPath",
"(",
"prefix",
",",
"null",
")",
";",
"try",
"{",
"return",
"val",
"==",
"null",
"?",
"defvalue",
":",
"Integer",
".... | 获取请求URL分段中含prefix段的int值 <br>
例如请求URL /pipes/record/query/offset:0/limit:50 <br>
获取offset参数: int offset = request.getRequstURIPath("offset:", 0); <br>
获取limit参数: int limit = request.getRequstURIPath("limit:", 20); <br>
@param prefix prefix段前缀
@param defvalue 默认int值
@return int值 | [
"获取请求URL分段中含prefix段的int值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"offset",
":",
"0",
"/",
"limit",
":",
"50",
"<br",
">",
"获取offset参数",
":",
"int",
"offset",
"=",
"request",
".",
"getRequstURIPath",
"(",
"offset",
":",
"0... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L857-L864 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.getPayLoad | private String getPayLoad(Key key, Application app) {
if (app == null) {
return EMPTY_PAYLOAD;
}
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
try {
return encoderWrapper.encode(app);
} catch (Exception e) ... | java | private String getPayLoad(Key key, Application app) {
if (app == null) {
return EMPTY_PAYLOAD;
}
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
try {
return encoderWrapper.encode(app);
} catch (Exception e) ... | [
"private",
"String",
"getPayLoad",
"(",
"Key",
"key",
",",
"Application",
"app",
")",
"{",
"if",
"(",
"app",
"==",
"null",
")",
"{",
"return",
"EMPTY_PAYLOAD",
";",
"}",
"EncoderWrapper",
"encoderWrapper",
"=",
"serverCodecs",
".",
"getEncoder",
"(",
"key",
... | Generate pay load with both JSON and XML formats for a given application. | [
"Generate",
"pay",
"load",
"with",
"both",
"JSON",
"and",
"XML",
"formats",
"for",
"a",
"given",
"application",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L385-L397 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java | DialogFragmentUtils.showOnLoaderCallback | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void showOnLoaderCallback(final android.app.FragmentManager manager, final android.app.DialogFragment fragment, final String tag) {
showOnLoaderCallback(HandlerUtils.getMainHandler(), manager, fragment, tag);
} | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void showOnLoaderCallback(final android.app.FragmentManager manager, final android.app.DialogFragment fragment, final String tag) {
showOnLoaderCallback(HandlerUtils.getMainHandler(), manager, fragment, tag);
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"void",
"showOnLoaderCallback",
"(",
"final",
"android",
".",
"app",
".",
"FragmentManager",
"manager",
",",
"final",
"android",
".",
"app",
".",
"DialogFragment",
... | Show {@link android.app.DialogFragment} with the specified tag on the loader callbacks.
@param manager the manager.
@param fragment the fragment.
@param tag the tag string that is related to the {@link android.app.DialogFragment}. | [
"Show",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L122-L125 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.ofIndices | public static <T> IntStreamEx ofIndices(T[] array, Predicate<T> predicate) {
return seq(IntStream.range(0, array.length).filter(i -> predicate.test(array[i])));
} | java | public static <T> IntStreamEx ofIndices(T[] array, Predicate<T> predicate) {
return seq(IntStream.range(0, array.length).filter(i -> predicate.test(array[i])));
} | [
"public",
"static",
"<",
"T",
">",
"IntStreamEx",
"ofIndices",
"(",
"T",
"[",
"]",
"array",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"return",
"seq",
"(",
"IntStream",
".",
"range",
"(",
"0",
",",
"array",
".",
"length",
")",
".",
"f... | Returns a sequential ordered {@code IntStreamEx} containing all the
indices of the supplied array elements which match given predicate.
@param <T> array element type
@param array array to get the stream of its indices
@param predicate a predicate to test array elements
@return a sequential {@code IntStreamEx} of the m... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"IntStreamEx",
"}",
"containing",
"all",
"the",
"indices",
"of",
"the",
"supplied",
"array",
"elements",
"which",
"match",
"given",
"predicate",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L2057-L2059 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/map/JodaBeanSimpleMapReader.java | JodaBeanSimpleMapReader.parseRoot | private <T> T parseRoot(Map<String, Object> input, Class<T> declaredType) throws Exception {
Object parsed = parseBean(input, declaredType);
return declaredType.cast(parsed);
} | java | private <T> T parseRoot(Map<String, Object> input, Class<T> declaredType) throws Exception {
Object parsed = parseBean(input, declaredType);
return declaredType.cast(parsed);
} | [
"private",
"<",
"T",
">",
"T",
"parseRoot",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"input",
",",
"Class",
"<",
"T",
">",
"declaredType",
")",
"throws",
"Exception",
"{",
"Object",
"parsed",
"=",
"parseBean",
"(",
"input",
",",
"declaredType",
"... | Parses the root bean.
@param input the map input, not null
@param declaredType the declared type, not null
@return the bean, not null
@throws Exception if an error occurs | [
"Parses",
"the",
"root",
"bean",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/map/JodaBeanSimpleMapReader.java#L90-L93 |
awin/rabbiteasy | rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/publisher/DiscretePublisher.java | DiscretePublisher.handleIoException | protected void handleIoException(int attempt, IOException ioException) throws IOException {
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (IOException e) {
LOGGER.warn("Failed to close channel after failed publish", e);
... | java | protected void handleIoException(int attempt, IOException ioException) throws IOException {
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (IOException e) {
LOGGER.warn("Failed to close channel after failed publish", e);
... | [
"protected",
"void",
"handleIoException",
"(",
"int",
"attempt",
",",
"IOException",
"ioException",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"!=",
"null",
"&&",
"channel",
".",
"isOpen",
"(",
")",
")",
"{",
"try",
"{",
"channel",
".",
"clos... | Handles an IOException depending on the already used attempts to
send a message. Also performs a soft reset of the currently used channel.
@param attempt Current attempt count
@param ioException The thrown exception
@throws IOException if the maximum amount of attempts is exceeded | [
"Handles",
"an",
"IOException",
"depending",
"on",
"the",
"already",
"used",
"attempts",
"to",
"send",
"a",
"message",
".",
"Also",
"performs",
"a",
"soft",
"reset",
"of",
"the",
"currently",
"used",
"channel",
"."
] | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/publisher/DiscretePublisher.java#L89-L106 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java | MetatypeUtils.parseBoolean | public static boolean parseBoolean(Object configAlias, String propertyKey, Object obj, boolean defaultValue) {
if (obj != null) {
if (obj instanceof String) {
String value = (String) obj;
if (value.equalsIgnoreCase("true")) {
return true;
... | java | public static boolean parseBoolean(Object configAlias, String propertyKey, Object obj, boolean defaultValue) {
if (obj != null) {
if (obj instanceof String) {
String value = (String) obj;
if (value.equalsIgnoreCase("true")) {
return true;
... | [
"public",
"static",
"boolean",
"parseBoolean",
"(",
"Object",
"configAlias",
",",
"String",
"propertyKey",
",",
"Object",
"obj",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"obj",
"!=",
"null",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"String",
"... | Parse a boolean from the provided config value: checks for whether or not
the object read from the Service/Component configuration is a String
or a Metatype converted boolean.
<p>
If an exception occurs converting the object parameter:
A translated warning message will be issued using the provided propertyKey and objec... | [
"Parse",
"a",
"boolean",
"from",
"the",
"provided",
"config",
"value",
":",
"checks",
"for",
"whether",
"or",
"not",
"the",
"object",
"read",
"from",
"the",
"Service",
"/",
"Component",
"configuration",
"is",
"a",
"String",
"or",
"a",
"Metatype",
"converted"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java#L113-L134 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.getShort | public static Short getShort(Map<?, ?> map, Object key) {
return get(map, key, Short.class);
} | java | public static Short getShort(Map<?, ?> map, Object key) {
return get(map, key, Short.class);
} | [
"public",
"static",
"Short",
"getShort",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Object",
"key",
")",
"{",
"return",
"get",
"(",
"map",
",",
"key",
",",
"Short",
".",
"class",
")",
";",
"}"
] | 获取Map指定key的值,并转换为Short
@param map Map
@param key 键
@return 值
@since 4.0.6 | [
"获取Map指定key的值,并转换为Short"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L804-L806 |
jhipster/jhipster | jhipster-framework/src/main/java/io/github/jhipster/service/QueryService.java | QueryService.buildRangeSpecification | protected <X extends Comparable<? super X>> Specification<ENTITY> buildRangeSpecification(RangeFilter<X> filter,
SingularAttribute<? super ENTITY, X> field) {
return buildSpecification(filter, root -> root.get(field));... | java | protected <X extends Comparable<? super X>> Specification<ENTITY> buildRangeSpecification(RangeFilter<X> filter,
SingularAttribute<? super ENTITY, X> field) {
return buildSpecification(filter, root -> root.get(field));... | [
"protected",
"<",
"X",
"extends",
"Comparable",
"<",
"?",
"super",
"X",
">",
">",
"Specification",
"<",
"ENTITY",
">",
"buildRangeSpecification",
"(",
"RangeFilter",
"<",
"X",
">",
"filter",
",",
"SingularAttribute",
"<",
"?",
"super",
"ENTITY",
",",
"X",
... | Helper function to return a specification for filtering on a single {@link Comparable}, where equality, less
than, greater than and less-than-or-equal-to and greater-than-or-equal-to and null/non-null conditions are
supported.
@param filter the individual attribute filter coming from the frontend.
@param field the JP... | [
"Helper",
"function",
"to",
"return",
"a",
"specification",
"for",
"filtering",
"on",
"a",
"single",
"{",
"@link",
"Comparable",
"}",
"where",
"equality",
"less",
"than",
"greater",
"than",
"and",
"less",
"-",
"than",
"-",
"or",
"-",
"equal",
"-",
"to",
... | train | https://github.com/jhipster/jhipster/blob/5dcf4239c7cc035e188ef02447d3c628fac5c5d9/jhipster-framework/src/main/java/io/github/jhipster/service/QueryService.java#L124-L127 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/CaffeineCacheMetrics.java | CaffeineCacheMetrics.monitor | public static <C extends AsyncCache<?, ?>> C monitor(MeterRegistry registry, C cache, String cacheName, String... tags) {
return monitor(registry, cache, cacheName, Tags.of(tags));
} | java | public static <C extends AsyncCache<?, ?>> C monitor(MeterRegistry registry, C cache, String cacheName, String... tags) {
return monitor(registry, cache, cacheName, Tags.of(tags));
} | [
"public",
"static",
"<",
"C",
"extends",
"AsyncCache",
"<",
"?",
",",
"?",
">",
">",
"C",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"C",
"cache",
",",
"String",
"cacheName",
",",
"String",
"...",
"tags",
")",
"{",
"return",
"monitor",
"(",
"reg... | Record metrics on a Caffeine cache. You must call {@link Caffeine#recordStats()} prior to building the cache
for metrics to be recorded.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param cacheName Will be used to tag metrics with "cache".
@param tags Tags to apply ... | [
"Record",
"metrics",
"on",
"a",
"Caffeine",
"cache",
".",
"You",
"must",
"call",
"{",
"@link",
"Caffeine#recordStats",
"()",
"}",
"prior",
"to",
"building",
"the",
"cache",
"for",
"metrics",
"to",
"be",
"recorded",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/CaffeineCacheMetrics.java#L99-L101 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.maxByDouble | public OptionalInt maxByDouble(IntToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
double key = keyExtractor.applyAsDouble(i);
if (!box.b || Double.compare(box.d, key) < 0) {
box.b = true;
box.d = key;
box.i ... | java | public OptionalInt maxByDouble(IntToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
double key = keyExtractor.applyAsDouble(i);
if (!box.b || Double.compare(box.d, key) < 0) {
box.b = true;
box.d = key;
box.i ... | [
"public",
"OptionalInt",
"maxByDouble",
"(",
"IntToDoubleFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"i",
")",
"->",
"{",
"double",
"key",
"=",
"keyExtractor",
".",
"applyAsDouble",
"(",
"... | Returns the maximum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing the first element of this
stream for which the highest value was returned by key extractor,... | [
"Returns",
"the",
"maximum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L1188-L1197 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_databaseAvailableVersion_GET | public OvhAvailableVersionStruct serviceName_databaseAvailableVersion_GET(String serviceName, OvhDatabaseTypeEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/databaseAvailableVersion";
StringBuilder sb = path(qPath, serviceName);
query(sb, "type", type);
String resp = exec(qPath, "GET"... | java | public OvhAvailableVersionStruct serviceName_databaseAvailableVersion_GET(String serviceName, OvhDatabaseTypeEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/databaseAvailableVersion";
StringBuilder sb = path(qPath, serviceName);
query(sb, "type", type);
String resp = exec(qPath, "GET"... | [
"public",
"OvhAvailableVersionStruct",
"serviceName_databaseAvailableVersion_GET",
"(",
"String",
"serviceName",
",",
"OvhDatabaseTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/databaseAvailableVersion\"",
";",
"StringB... | List available database version following a type
REST: GET /hosting/web/{serviceName}/databaseAvailableVersion
@param type [required] Type of the database
@param serviceName [required] The internal name of your hosting | [
"List",
"available",
"database",
"version",
"following",
"a",
"type"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L753-L759 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java | ValueStore.addAndGetPosition | public int addAndGetPosition(Type type, Block block, int position, long valueHash)
{
if (values.getPositionCount() >= maxFill) {
rehash();
}
int bucketId = getBucketId(valueHash, mask);
int valuePointer;
// look for an empty slot or a slot containing this key
... | java | public int addAndGetPosition(Type type, Block block, int position, long valueHash)
{
if (values.getPositionCount() >= maxFill) {
rehash();
}
int bucketId = getBucketId(valueHash, mask);
int valuePointer;
// look for an empty slot or a slot containing this key
... | [
"public",
"int",
"addAndGetPosition",
"(",
"Type",
"type",
",",
"Block",
"block",
",",
"int",
"position",
",",
"long",
"valueHash",
")",
"{",
"if",
"(",
"values",
".",
"getPositionCount",
"(",
")",
">=",
"maxFill",
")",
"{",
"rehash",
"(",
")",
";",
"}... | This will add an item if not already in the system. It returns a pointer that is unique for multiple instances of the value. If item present,
returns the pointer into the system | [
"This",
"will",
"add",
"an",
"item",
"if",
"not",
"already",
"in",
"the",
"system",
".",
"It",
"returns",
"a",
"pointer",
"that",
"is",
"unique",
"for",
"multiple",
"instances",
"of",
"the",
"value",
".",
"If",
"item",
"present",
"returns",
"the",
"point... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java#L71-L105 |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/serialization/AvroUtils.java | AvroUtils.toBytes | static <T> byte[] toBytes(final T avroObject, final Class<T> theClass) {
final DatumWriter<T> datumWriter = new SpecificDatumWriter<>(theClass);
final byte[] theBytes;
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final BinaryEncoder encoder = EncoderFactory.get().binaryEncoder... | java | static <T> byte[] toBytes(final T avroObject, final Class<T> theClass) {
final DatumWriter<T> datumWriter = new SpecificDatumWriter<>(theClass);
final byte[] theBytes;
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final BinaryEncoder encoder = EncoderFactory.get().binaryEncoder... | [
"static",
"<",
"T",
">",
"byte",
"[",
"]",
"toBytes",
"(",
"final",
"T",
"avroObject",
",",
"final",
"Class",
"<",
"T",
">",
"theClass",
")",
"{",
"final",
"DatumWriter",
"<",
"T",
">",
"datumWriter",
"=",
"new",
"SpecificDatumWriter",
"<>",
"(",
"theC... | Serializes the given avro object to a byte[].
@param avroObject
@param theClass
@param <T>
@return | [
"Serializes",
"the",
"given",
"avro",
"object",
"to",
"a",
"byte",
"[]",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/serialization/AvroUtils.java#L44-L57 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java | TwoPhaseAnnotationProcessor.printWarning | public void printWarning( Declaration d, String id, Object... args )
{
addWarning( d, id, args );
} | java | public void printWarning( Declaration d, String id, Object... args )
{
addWarning( d, id, args );
} | [
"public",
"void",
"printWarning",
"(",
"Declaration",
"d",
",",
"String",
"id",
",",
"Object",
"...",
"args",
")",
"{",
"addWarning",
"(",
"d",
",",
"id",
",",
"args",
")",
";",
"}"
] | Report a warning detected during the "check" phase. The presence of warnings
will not affect execution of the "generate" phase. | [
"Report",
"a",
"warning",
"detected",
"during",
"the",
"check",
"phase",
".",
"The",
"presence",
"of",
"warnings",
"will",
"not",
"affect",
"execution",
"of",
"the",
"generate",
"phase",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L166-L169 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/link/KNXNetworkLinkIP.java | KNXNetworkLinkIP.sendRequest | public void sendRequest(KNXAddress dst, Priority p, byte[] nsdu)
throws KNXLinkClosedException, KNXTimeoutException
{
send(dst, p, nsdu, false);
} | java | public void sendRequest(KNXAddress dst, Priority p, byte[] nsdu)
throws KNXLinkClosedException, KNXTimeoutException
{
send(dst, p, nsdu, false);
} | [
"public",
"void",
"sendRequest",
"(",
"KNXAddress",
"dst",
",",
"Priority",
"p",
",",
"byte",
"[",
"]",
"nsdu",
")",
"throws",
"KNXLinkClosedException",
",",
"KNXTimeoutException",
"{",
"send",
"(",
"dst",
",",
"p",
",",
"nsdu",
",",
"false",
")",
";",
"... | {@inheritDoc} When communicating with a KNX network which uses open medium,
messages are broadcasted within domain (as opposite to system broadcast) by
default. Specify <code>dst null</code> for system broadcast. | [
"{"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/link/KNXNetworkLinkIP.java#L352-L356 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Subtract | public static ComplexNumber Subtract(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real - z2.real, z1.imaginary - z2.imaginary);
} | java | public static ComplexNumber Subtract(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real - z2.real, z1.imaginary - z2.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Subtract",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"-",
"z2",
".",
"real",
",",
"z1",
".",
"imaginary",
"-",
"z2",
".",
"imaginary",
... | Subtract two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the subtract of specified complex numbers. | [
"Subtract",
"two",
"complex",
"numbers",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L272-L274 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.generateLockToken | private String generateLockToken(HttpServletRequest req, CmsRepositoryLockInfo lock) {
String lockTokenStr = req.getServletPath()
+ "-"
+ req.getUserPrincipal()
+ "-"
+ lock.getOwner()
+ "-"
+ lock.getPath()
+ "-"
+... | java | private String generateLockToken(HttpServletRequest req, CmsRepositoryLockInfo lock) {
String lockTokenStr = req.getServletPath()
+ "-"
+ req.getUserPrincipal()
+ "-"
+ lock.getOwner()
+ "-"
+ lock.getPath()
+ "-"
+... | [
"private",
"String",
"generateLockToken",
"(",
"HttpServletRequest",
"req",
",",
"CmsRepositoryLockInfo",
"lock",
")",
"{",
"String",
"lockTokenStr",
"=",
"req",
".",
"getServletPath",
"(",
")",
"+",
"\"-\"",
"+",
"req",
".",
"getUserPrincipal",
"(",
")",
"+",
... | Generates a lock token out of the lock and some information out of the
request to make it unique.<p>
@param req the servlet request we are processing
@param lock the lock with the information for the lock token
@return the generated lock token | [
"Generates",
"a",
"lock",
"token",
"out",
"of",
"the",
"lock",
"and",
"some",
"information",
"out",
"of",
"the",
"request",
"to",
"make",
"it",
"unique",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L3053-L3066 |
MenoData/Time4J | base/src/main/java/net/time4j/SystemClock.java | SystemClock.synchronizedWith | public SystemClock synchronizedWith(TimeSource<?> clock) {
Moment time = Moment.from(clock.currentTime());
long compare = (MONOTON_MODE ? System.nanoTime() : PROVIDER.getNanos());
long utc = time.getElapsedTime(TimeScale.UTC);
long instantNanos = Math.multiplyExact(utc, MRD) + time.get... | java | public SystemClock synchronizedWith(TimeSource<?> clock) {
Moment time = Moment.from(clock.currentTime());
long compare = (MONOTON_MODE ? System.nanoTime() : PROVIDER.getNanos());
long utc = time.getElapsedTime(TimeScale.UTC);
long instantNanos = Math.multiplyExact(utc, MRD) + time.get... | [
"public",
"SystemClock",
"synchronizedWith",
"(",
"TimeSource",
"<",
"?",
">",
"clock",
")",
"{",
"Moment",
"time",
"=",
"Moment",
".",
"from",
"(",
"clock",
".",
"currentTime",
"(",
")",
")",
";",
"long",
"compare",
"=",
"(",
"MONOTON_MODE",
"?",
"Syste... | /*[deutsch]
<p>Synchronisiert diese Instanz mit der angegebenen Zeitquelle und liefert eine neue Kopie. </p>
<p>Diese Methode ist nur relevant, wenn diese Uhr im monotonen Modus läuft. Es wird dringend
angeraten, nicht während oder nahe einer Schaltsekunde zu eichen. Achtung: Diese Methode kann
Zeitsprü... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Synchronisiert",
"diese",
"Instanz",
"mit",
"der",
"angegebenen",
"Zeitquelle",
"und",
"liefert",
"eine",
"neue",
"Kopie",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/SystemClock.java#L454-L465 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/CrudDSL.java | CrudDSL.to | public Crud<T, K> to(Connection connection) throws SQLException {
return table(connection, getTable(connection, target));
} | java | public Crud<T, K> to(Connection connection) throws SQLException {
return table(connection, getTable(connection, target));
} | [
"public",
"Crud",
"<",
"T",
",",
"K",
">",
"to",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"return",
"table",
"(",
"connection",
",",
"getTable",
"(",
"connection",
",",
"target",
")",
")",
";",
"}"
] | Create a connected crud validating it against the specified connection.
The table name is derived from the jpa annotation or from the class name.
@param connection the connection
@return a new crud instance
@throws SQLException if an error occurred | [
"Create",
"a",
"connected",
"crud",
"validating",
"it",
"against",
"the",
"specified",
"connection",
".",
"The",
"table",
"name",
"is",
"derived",
"from",
"the",
"jpa",
"annotation",
"or",
"from",
"the",
"class",
"name",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/CrudDSL.java#L99-L101 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.getMavenArtifactDescriptor | private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) {
DependencyCoordinates coordinates = new DependencyCoordinates(dependency);
return getArtifactResolver(context).resolve(coordinates, context);
} | java | private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) {
DependencyCoordinates coordinates = new DependencyCoordinates(dependency);
return getArtifactResolver(context).resolve(coordinates, context);
} | [
"private",
"MavenArtifactDescriptor",
"getMavenArtifactDescriptor",
"(",
"Dependency",
"dependency",
",",
"ScannerContext",
"context",
")",
"{",
"DependencyCoordinates",
"coordinates",
"=",
"new",
"DependencyCoordinates",
"(",
"dependency",
")",
";",
"return",
"getArtifactR... | Creates a MavenArtifactDescriptor and fills it with all information from
given dependency.
@param dependency
Dependency.
@param context
The scanner context.
@return The MavenArtifactDescriptor. | [
"Creates",
"a",
"MavenArtifactDescriptor",
"and",
"fills",
"it",
"with",
"all",
"information",
"from",
"given",
"dependency",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L635-L638 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE | public OvhTask serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE(String serviceName, String lanName, String dhcpName, String MACAddress) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses/{MACAddress}";
StringBuilder sb = ... | java | public OvhTask serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE(String serviceName, String lanName, String dhcpName, String MACAddress) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses/{MACAddress}";
StringBuilder sb = ... | [
"public",
"OvhTask",
"serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"lanName",
",",
"String",
"dhcpName",
",",
"String",
"MACAddress",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=... | Delete this port mapping
REST: DELETE /xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses/{MACAddress}
@param serviceName [required] The internal name of your XDSL offer
@param lanName [required] Name of the LAN
@param dhcpName [required] Name of the DHCP
@param MACAddress [required] The MAC ad... | [
"Delete",
"this",
"port",
"mapping"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1122-L1127 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java | Validators.validEnum | public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) {
String[] ex = new String[excludes.length];
for (int i = 0; i < ex.length; i++) {
ex[i] = excludes[i].toString();
}
return ValidEnum.of(enumClass, ex);
} | java | public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) {
String[] ex = new String[excludes.length];
for (int i = 0; i < ex.length; i++) {
ex[i] = excludes[i].toString();
}
return ValidEnum.of(enumClass, ex);
} | [
"public",
"static",
"Validator",
"validEnum",
"(",
"Class",
"<",
"?",
"extends",
"Enum",
">",
"enumClass",
",",
"Enum",
"...",
"excludes",
")",
"{",
"String",
"[",
"]",
"ex",
"=",
"new",
"String",
"[",
"excludes",
".",
"length",
"]",
";",
"for",
"(",
... | Method is used to create a new INSTANCE of the enum validator.
@param enumClass Enum class with the entries to validate for.
@param excludes Enum entries to exclude from the validator.
@return validator | [
"Method",
"is",
"used",
"to",
"create",
"a",
"new",
"INSTANCE",
"of",
"the",
"enum",
"validator",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L134-L140 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.stripAndTrim | public static String stripAndTrim(String str, String replaceWith) {
return stripAndTrim(str, replaceWith, false);
} | java | public static String stripAndTrim(String str, String replaceWith) {
return stripAndTrim(str, replaceWith, false);
} | [
"public",
"static",
"String",
"stripAndTrim",
"(",
"String",
"str",
",",
"String",
"replaceWith",
")",
"{",
"return",
"stripAndTrim",
"(",
"str",
",",
"replaceWith",
",",
"false",
")",
";",
"}"
] | Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@param replaceWith a string to replace spaces with
@return a clean string | [
"Strips",
"all",
"symbols",
"punctuation",
"whitespace",
"and",
"control",
"chars",
"from",
"a",
"string",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L336-L338 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.getPropertyValue | public Object getPropertyValue(String pKey, Object pDefaultValue) {
Object value = super.get(pKey); // super.get() is EXTREMELEY IMPORTANT
if (value != null) {
return value;
}
if (defaults instanceof XMLProperties) {
return (((XMLProperties) defaults).getPropertyValue(pKey));
... | java | public Object getPropertyValue(String pKey, Object pDefaultValue) {
Object value = super.get(pKey); // super.get() is EXTREMELEY IMPORTANT
if (value != null) {
return value;
}
if (defaults instanceof XMLProperties) {
return (((XMLProperties) defaults).getPropertyValue(pKey));
... | [
"public",
"Object",
"getPropertyValue",
"(",
"String",
"pKey",
",",
"Object",
"pDefaultValue",
")",
"{",
"Object",
"value",
"=",
"super",
".",
"get",
"(",
"pKey",
")",
";",
"// super.get() is EXTREMELEY IMPORTANT\r",
"if",
"(",
"value",
"!=",
"null",
")",
"{",... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property
list, and its defaults, recursively, are then checked. The method
returns the default value argument if the property is not found.
@param pKey the property key.
@param pDefaultVal... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L551-L562 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getDateParameter | public static long getDateParameter(final ServletRequest pReq, final String pName, final long pDefault) {
String str = pReq.getParameter(pName);
try {
return str != null ? StringUtil.toDate(str).getTime() : pDefault;
}
catch (IllegalArgumentException iae) {
... | java | public static long getDateParameter(final ServletRequest pReq, final String pName, final long pDefault) {
String str = pReq.getParameter(pName);
try {
return str != null ? StringUtil.toDate(str).getTime() : pDefault;
}
catch (IllegalArgumentException iae) {
... | [
"public",
"static",
"long",
"getDateParameter",
"(",
"final",
"ServletRequest",
"pReq",
",",
"final",
"String",
"pName",
",",
"final",
"long",
"pDefault",
")",
"{",
"String",
"str",
"=",
"pReq",
".",
"getParameter",
"(",
"pName",
")",
";",
"try",
"{",
"ret... | Gets the value of the given parameter from the request converted to
a {@code Date}. If the parameter is not set or not parseable, the
default value is returned.
@param pReq the servlet request
@param pName the parameter name
@param pDefault the default value
@return the value of the parameter converted to ... | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"parameter",
"from",
"the",
"request",
"converted",
"to",
"a",
"{",
"@code",
"Date",
"}",
".",
" ",
";",
"If",
"the",
"parameter",
"is",
"not",
"set",
"or",
"not",
"parseable",
"the",
"default",
"value",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L295-L303 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java | TransferLearningHelper.featurize | public DataSet featurize(DataSet input) {
if (isGraph) {
//trying to featurize for a computation graph
if (origGraph.getNumInputArrays() > 1 || origGraph.getNumOutputArrays() > 1) {
throw new IllegalArgumentException(
"Input or output size ... | java | public DataSet featurize(DataSet input) {
if (isGraph) {
//trying to featurize for a computation graph
if (origGraph.getNumInputArrays() > 1 || origGraph.getNumOutputArrays() > 1) {
throw new IllegalArgumentException(
"Input or output size ... | [
"public",
"DataSet",
"featurize",
"(",
"DataSet",
"input",
")",
"{",
"if",
"(",
"isGraph",
")",
"{",
"//trying to featurize for a computation graph",
"if",
"(",
"origGraph",
".",
"getNumInputArrays",
"(",
")",
">",
"1",
"||",
"origGraph",
".",
"getNumOutputArrays"... | During training frozen vertices/layers can be treated as "featurizing" the input
The forward pass through these frozen layer/vertices can be done in advance and the dataset saved to disk to iterate
quickly on the smaller unfrozen part of the model
Currently does not support datasets with feature masks
@param input mul... | [
"During",
"training",
"frozen",
"vertices",
"/",
"layers",
"can",
"be",
"treated",
"as",
"featurizing",
"the",
"input",
"The",
"forward",
"pass",
"through",
"these",
"frozen",
"layer",
"/",
"vertices",
"can",
"be",
"done",
"in",
"advance",
"and",
"the",
"dat... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java#L360-L383 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java | HttpSupport.sendCookie | public void sendCookie(String name, String value) {
RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(new Cookie(name, value)));
} | java | public void sendCookie(String name, String value) {
RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(new Cookie(name, value)));
} | [
"public",
"void",
"sendCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"RequestContext",
".",
"getHttpResponse",
"(",
")",
".",
"addCookie",
"(",
"Cookie",
".",
"toServletCookie",
"(",
"new",
"Cookie",
"(",
"name",
",",
"value",
")",
")",... | Sends cookie to browse with response.
@param name name of cookie
@param value value of cookie. | [
"Sends",
"cookie",
"to",
"browse",
"with",
"response",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java#L1319-L1321 |
powermock/powermock | powermock-core/src/main/java/org/powermock/mockpolicies/support/LogPolicySupport.java | LogPolicySupport.getType | public Class<?> getType(String name, String logFramework) throws Exception {
final Class<?> loggerType;
try {
loggerType = Class.forName(name);
} catch (ClassNotFoundException e) {
final String message = String.format("Cannot find %s in the classpath which the %s policy requires.", logFramework, getClass()
... | java | public Class<?> getType(String name, String logFramework) throws Exception {
final Class<?> loggerType;
try {
loggerType = Class.forName(name);
} catch (ClassNotFoundException e) {
final String message = String.format("Cannot find %s in the classpath which the %s policy requires.", logFramework, getClass()
... | [
"public",
"Class",
"<",
"?",
">",
"getType",
"(",
"String",
"name",
",",
"String",
"logFramework",
")",
"throws",
"Exception",
"{",
"final",
"Class",
"<",
"?",
">",
"loggerType",
";",
"try",
"{",
"loggerType",
"=",
"Class",
".",
"forName",
"(",
"name",
... | Get the class type representing the fully-qualified name.
@param name
The fully-qualified name of a class to get.
@param logFramework
The log framework that should be printed if the class cannot
be found.
@return The class representing the fully-qualified name.
@throws Exception
If something unexpected goes wrong, for... | [
"Get",
"the",
"class",
"type",
"representing",
"the",
"fully",
"-",
"qualified",
"name",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-core/src/main/java/org/powermock/mockpolicies/support/LogPolicySupport.java#L62-L72 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java | MLEDependencyGrammar.getCachedITW | private IntTaggedWord getCachedITW(short tag) {
// The +2 below is because -1 and -2 are used with special meanings (see IntTaggedWord).
if (tagITWList == null) {
tagITWList = new ArrayList<IntTaggedWord>(numTagBins + 2);
for (int i=0; i<numTagBins + 2; i++) {
tagITWList.add(i, null);
... | java | private IntTaggedWord getCachedITW(short tag) {
// The +2 below is because -1 and -2 are used with special meanings (see IntTaggedWord).
if (tagITWList == null) {
tagITWList = new ArrayList<IntTaggedWord>(numTagBins + 2);
for (int i=0; i<numTagBins + 2; i++) {
tagITWList.add(i, null);
... | [
"private",
"IntTaggedWord",
"getCachedITW",
"(",
"short",
"tag",
")",
"{",
"// The +2 below is because -1 and -2 are used with special meanings (see IntTaggedWord).\r",
"if",
"(",
"tagITWList",
"==",
"null",
")",
"{",
"tagITWList",
"=",
"new",
"ArrayList",
"<",
"IntTaggedWo... | This maps from a tag to a cached IntTagWord that represents the
tag by having the wildcard word ANY_WORD_INT and the tag in the
reduced tag space.
The argument is in terms of the full tag space; internally this
function maps to the reduced space.
@param tag short representation of tag in full tag space
@return an IntT... | [
"This",
"maps",
"from",
"a",
"tag",
"to",
"a",
"cached",
"IntTagWord",
"that",
"represents",
"the",
"tag",
"by",
"having",
"the",
"wildcard",
"word",
"ANY_WORD_INT",
"and",
"the",
"tag",
"in",
"the",
"reduced",
"tag",
"space",
".",
"The",
"argument",
"is",... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java#L373-L387 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.formatHex | @Pure
@Inline(value = "$3.formatHex($1, $2)", imported = {StringEscaper.class})
public static String formatHex(int amount, int digits) {
return StringEscaper.formatHex(amount, digits);
} | java | @Pure
@Inline(value = "$3.formatHex($1, $2)", imported = {StringEscaper.class})
public static String formatHex(int amount, int digits) {
return StringEscaper.formatHex(amount, digits);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"$3.formatHex($1, $2)\"",
",",
"imported",
"=",
"{",
"StringEscaper",
".",
"class",
"}",
")",
"public",
"static",
"String",
"formatHex",
"(",
"int",
"amount",
",",
"int",
"digits",
")",
"{",
"return",
"Strin... | Format the given int value to hexadecimal.
@param amount the value to convert.
@param digits the minimal number of digits.
@return a string representation of the given value.
@since 15.0 | [
"Format",
"the",
"given",
"int",
"value",
"to",
"hexadecimal",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L1627-L1631 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionLoader.java | MapTileCollisionLoader.loadTileCollisions | private void loadTileCollisions(MapTileCollision mapCollision, Tile tile)
{
final TileCollision tileCollision;
if (!tile.hasFeature(TileCollision.class))
{
tileCollision = new TileCollisionModel(tile);
tile.addFeature(tileCollision);
}
else
... | java | private void loadTileCollisions(MapTileCollision mapCollision, Tile tile)
{
final TileCollision tileCollision;
if (!tile.hasFeature(TileCollision.class))
{
tileCollision = new TileCollisionModel(tile);
tile.addFeature(tileCollision);
}
else
... | [
"private",
"void",
"loadTileCollisions",
"(",
"MapTileCollision",
"mapCollision",
",",
"Tile",
"tile",
")",
"{",
"final",
"TileCollision",
"tileCollision",
";",
"if",
"(",
"!",
"tile",
".",
"hasFeature",
"(",
"TileCollision",
".",
"class",
")",
")",
"{",
"tile... | Load the tile collisions.
@param mapCollision The map tile collision owner.
@param tile The tile reference. | [
"Load",
"the",
"tile",
"collisions",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionLoader.java#L264-L278 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java | DbcHelper.registerJdbcDataSource | public static boolean registerJdbcDataSource(String name, DataSource dataSource) {
return jdbcDataSources.putIfAbsent(name, dataSource) == null;
} | java | public static boolean registerJdbcDataSource(String name, DataSource dataSource) {
return jdbcDataSources.putIfAbsent(name, dataSource) == null;
} | [
"public",
"static",
"boolean",
"registerJdbcDataSource",
"(",
"String",
"name",
",",
"DataSource",
"dataSource",
")",
"{",
"return",
"jdbcDataSources",
".",
"putIfAbsent",
"(",
"name",
",",
"dataSource",
")",
"==",
"null",
";",
"}"
] | Registers a named JDBC datasource.
@param name
@param dataSource
@return | [
"Registers",
"a",
"named",
"JDBC",
"datasource",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java#L39-L41 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java | CudaZeroHandler.fallback | @Override
@Deprecated
public void fallback(AllocationPoint point, AllocationShape shape) {
throw new IllegalStateException("Can't fallback from [" + point.getAllocationStatus() + "]");
} | java | @Override
@Deprecated
public void fallback(AllocationPoint point, AllocationShape shape) {
throw new IllegalStateException("Can't fallback from [" + point.getAllocationStatus() + "]");
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"void",
"fallback",
"(",
"AllocationPoint",
"point",
",",
"AllocationShape",
"shape",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Can't fallback from [\"",
"+",
"point",
".",
"getAllocationStatus",
"(",
")... | Copies memory from device to zero-copy memory
@param point
@param shape | [
"Copies",
"memory",
"from",
"device",
"to",
"zero",
"-",
"copy",
"memory"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java#L487-L491 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsMetaClassUtils.java | GrailsMetaClassUtils.getPropertyIfExists | @SuppressWarnings("unchecked")
public static <T> T getPropertyIfExists(Object instance, String property, Class<T> requiredType) {
MetaClass metaClass = getMetaClass(instance);
MetaProperty metaProperty = metaClass.getMetaProperty(property);
if (metaProperty != null) {
Object val... | java | @SuppressWarnings("unchecked")
public static <T> T getPropertyIfExists(Object instance, String property, Class<T> requiredType) {
MetaClass metaClass = getMetaClass(instance);
MetaProperty metaProperty = metaClass.getMetaProperty(property);
if (metaProperty != null) {
Object val... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getPropertyIfExists",
"(",
"Object",
"instance",
",",
"String",
"property",
",",
"Class",
"<",
"T",
">",
"requiredType",
")",
"{",
"MetaClass",
"metaClass",
"=",
"ge... | Obtains a property of an instance if it exists
@param instance The instance
@param property The property
@param requiredType The required type of the property
@return The property value | [
"Obtains",
"a",
"property",
"of",
"an",
"instance",
"if",
"it",
"exists"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsMetaClassUtils.java#L207-L219 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.email_exchange_organizationName_service_exchangeService_account_duration_GET | public OvhOrder email_exchange_organizationName_service_exchangeService_account_duration_GET(String organizationName, String exchangeService, String duration, OvhOvhLicenceEnum licence, Long number, OvhAccountQuotaEnum storageQuota) throws IOException {
String qPath = "/order/email/exchange/{organizationName}/service... | java | public OvhOrder email_exchange_organizationName_service_exchangeService_account_duration_GET(String organizationName, String exchangeService, String duration, OvhOvhLicenceEnum licence, Long number, OvhAccountQuotaEnum storageQuota) throws IOException {
String qPath = "/order/email/exchange/{organizationName}/service... | [
"public",
"OvhOrder",
"email_exchange_organizationName_service_exchangeService_account_duration_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"duration",
",",
"OvhOvhLicenceEnum",
"licence",
",",
"Long",
"number",
",",
"OvhAccountQuot... | Get prices and contracts information
REST: GET /order/email/exchange/{organizationName}/service/{exchangeService}/account/{duration}
@param storageQuota [required] The storage quota for the account(s) in GB (default = 50)
@param number [required] Number of Accounts to order
@param licence [required] Licence type for t... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3924-L3932 |
trello/RxLifecycle | rxlifecycle/src/main/java/com/trello/rxlifecycle3/RxLifecycle.java | RxLifecycle.bindUntilEvent | @Nonnull
@CheckReturnValue
public static <T, R> LifecycleTransformer<T> bindUntilEvent(@Nonnull final Observable<R> lifecycle,
@Nonnull final R event) {
checkNotNull(lifecycle, "lifecycle == null");
checkNotNull(event, "event == nul... | java | @Nonnull
@CheckReturnValue
public static <T, R> LifecycleTransformer<T> bindUntilEvent(@Nonnull final Observable<R> lifecycle,
@Nonnull final R event) {
checkNotNull(lifecycle, "lifecycle == null");
checkNotNull(event, "event == nul... | [
"@",
"Nonnull",
"@",
"CheckReturnValue",
"public",
"static",
"<",
"T",
",",
"R",
">",
"LifecycleTransformer",
"<",
"T",
">",
"bindUntilEvent",
"(",
"@",
"Nonnull",
"final",
"Observable",
"<",
"R",
">",
"lifecycle",
",",
"@",
"Nonnull",
"final",
"R",
"event... | Binds the given source to a lifecycle.
<p>
When the lifecycle event occurs, the source will cease to emit any notifications.
@param lifecycle the lifecycle sequence
@param event the event which should conclude notifications from the source
@return a reusable {@link LifecycleTransformer} that unsubscribes the source at... | [
"Binds",
"the",
"given",
"source",
"to",
"a",
"lifecycle",
".",
"<p",
">",
"When",
"the",
"lifecycle",
"event",
"occurs",
"the",
"source",
"will",
"cease",
"to",
"emit",
"any",
"notifications",
"."
] | train | https://github.com/trello/RxLifecycle/blob/b0a9eb54867f0d72b9614d24091c59dfd4b2d5c1/rxlifecycle/src/main/java/com/trello/rxlifecycle3/RxLifecycle.java#L42-L49 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/checkouts/OrderItemUrl.java | OrderItemUrl.updateItemDestinationUrl | public static MozuUrl updateItemDestinationUrl(String checkoutId, String destinationId, String itemId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/checkouts/{checkoutId}/items/{itemId}/destination/{destinationId}?responseFields={responseFields}");
formatter.formatUrl("check... | java | public static MozuUrl updateItemDestinationUrl(String checkoutId, String destinationId, String itemId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/checkouts/{checkoutId}/items/{itemId}/destination/{destinationId}?responseFields={responseFields}");
formatter.formatUrl("check... | [
"public",
"static",
"MozuUrl",
"updateItemDestinationUrl",
"(",
"String",
"checkoutId",
",",
"String",
"destinationId",
",",
"String",
"itemId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/c... | Get Resource Url for UpdateItemDestination
@param checkoutId The unique identifier of the checkout.
@param destinationId The unique identifier of the destination.
@param itemId The unique identifier of the item.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data re... | [
"Get",
"Resource",
"Url",
"for",
"UpdateItemDestination"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/checkouts/OrderItemUrl.java#L70-L78 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.postCompileJava | protected boolean postCompileJava(IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_52);
final File classOutputPath = getClassOutputPath();
if (classOutputPath == null) {
getLogger().info(Messages.SarlBatchCompiler_24);
return true;
}
getLogger().info(Me... | java | protected boolean postCompileJava(IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_52);
final File classOutputPath = getClassOutputPath();
if (classOutputPath == null) {
getLogger().info(Messages.SarlBatchCompiler_24);
return true;
}
getLogger().info(Me... | [
"protected",
"boolean",
"postCompileJava",
"(",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_52",
")",
";",
"final",
"File",
"classOutputPath",
"=",
"getClas... | Compile the java files after the compilation of the project's files.
@param progress monitor of the progress of the compilation.
@return the success status. Replies <code>false</code> if the activity is canceled. | [
"Compile",
"the",
"java",
"files",
"after",
"the",
"compilation",
"of",
"the",
"project",
"s",
"files",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1705-L1723 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setLeftButton | public JQMButton setLeftButton(String text) {
return setLeftButton(text, (String) null, (DataIcon) null);
} | java | public JQMButton setLeftButton(String text) {
return setLeftButton(text, (String) null, (DataIcon) null);
} | [
"public",
"JQMButton",
"setLeftButton",
"(",
"String",
"text",
")",
"{",
"return",
"setLeftButton",
"(",
"text",
",",
"(",
"String",
")",
"null",
",",
"(",
"DataIcon",
")",
"null",
")",
";",
"}"
] | Creates a new {@link JQMButton} with the given text and then sets that
button in the left slot. Any existing right button will be replaced.
This button will not link to a page by default and therefore will only
react if a click handler is registered. This is useful if you want the
button to do something other than nav... | [
"Creates",
"a",
"new",
"{",
"@link",
"JQMButton",
"}",
"with",
"the",
"given",
"text",
"and",
"then",
"sets",
"that",
"button",
"in",
"the",
"left",
"slot",
".",
"Any",
"existing",
"right",
"button",
"will",
"be",
"replaced",
"."
] | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L147-L149 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/Noun.java | Noun.addPlural | public static void addPlural(String match, String rule, boolean insensitive){
plurals.add(0, new Replacer(match, rule, insensitive));
} | java | public static void addPlural(String match, String rule, boolean insensitive){
plurals.add(0, new Replacer(match, rule, insensitive));
} | [
"public",
"static",
"void",
"addPlural",
"(",
"String",
"match",
",",
"String",
"rule",
",",
"boolean",
"insensitive",
")",
"{",
"plurals",
".",
"add",
"(",
"0",
",",
"new",
"Replacer",
"(",
"match",
",",
"rule",
",",
"insensitive",
")",
")",
";",
"}"
... | <p>Add a match pattern and replacement rule for converting addPlural
forms to addSingular forms.</p>
@param match Match pattern regular expression
@param rule Replacement rule
@param insensitive Flag indicating this match should be case insensitive | [
"<p",
">",
"Add",
"a",
"match",
"pattern",
"and",
"replacement",
"rule",
"for",
"converting",
"addPlural",
"forms",
"to",
"addSingular",
"forms",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/Noun.java#L75-L77 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRenderer.java | TreeRenderer.renderIndentation | protected void renderIndentation(AbstractRenderAppender writer, TreeElement node, int level, InheritableState state)
{
InternalStringBuilder img = new InternalStringBuilder(32);
// Create the appropriate number of indents
// These are either the spacer.gif if the parent is the last in the l... | java | protected void renderIndentation(AbstractRenderAppender writer, TreeElement node, int level, InheritableState state)
{
InternalStringBuilder img = new InternalStringBuilder(32);
// Create the appropriate number of indents
// These are either the spacer.gif if the parent is the last in the l... | [
"protected",
"void",
"renderIndentation",
"(",
"AbstractRenderAppender",
"writer",
",",
"TreeElement",
"node",
",",
"int",
"level",
",",
"InheritableState",
"state",
")",
"{",
"InternalStringBuilder",
"img",
"=",
"new",
"InternalStringBuilder",
"(",
"32",
")",
";",
... | Write out the images that create the leading indentation for the given node.
@param writer the appender where the node indentation images are appended
@param node the node to render
@param level the level or depth of the node within the tree
@param state the set of tree properties that are used to render the tree marku... | [
"Write",
"out",
"the",
"images",
"that",
"create",
"the",
"leading",
"indentation",
"for",
"the",
"given",
"node",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRenderer.java#L263-L304 |
j256/simplejmx | src/main/java/com/j256/simplejmx/client/JmxClient.java | JmxClient.getAttributeString | public String getAttributeString(ObjectName name, String attributeName) throws Exception {
Object bean = getAttribute(name, attributeName);
if (bean == null) {
return null;
} else {
return ClientUtils.valueToString(bean);
}
} | java | public String getAttributeString(ObjectName name, String attributeName) throws Exception {
Object bean = getAttribute(name, attributeName);
if (bean == null) {
return null;
} else {
return ClientUtils.valueToString(bean);
}
} | [
"public",
"String",
"getAttributeString",
"(",
"ObjectName",
"name",
",",
"String",
"attributeName",
")",
"throws",
"Exception",
"{",
"Object",
"bean",
"=",
"getAttribute",
"(",
"name",
",",
"attributeName",
")",
";",
"if",
"(",
"bean",
"==",
"null",
")",
"{... | Return the value of a JMX attribute as a String or null if attribute has a null value. | [
"Return",
"the",
"value",
"of",
"a",
"JMX",
"attribute",
"as",
"a",
"String",
"or",
"null",
"if",
"attribute",
"has",
"a",
"null",
"value",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L327-L334 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java | AssertMessages.invalidFalseValue | @Pure
@Inline(value = "AssertMessages.invalidFalseValue(0, $1)", imported = {AssertMessages.class})
public static String invalidFalseValue(String functionName) {
return invalidFalseValue(0, functionName);
} | java | @Pure
@Inline(value = "AssertMessages.invalidFalseValue(0, $1)", imported = {AssertMessages.class})
public static String invalidFalseValue(String functionName) {
return invalidFalseValue(0, functionName);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"AssertMessages.invalidFalseValue(0, $1)\"",
",",
"imported",
"=",
"{",
"AssertMessages",
".",
"class",
"}",
")",
"public",
"static",
"String",
"invalidFalseValue",
"(",
"String",
"functionName",
")",
"{",
"return",... | The value of first Parameter must be <code>true</code>.
@param functionName the name of the function that should reply <code>true</code>.
@return the error message. | [
"The",
"value",
"of",
"first",
"Parameter",
"must",
"be",
"<code",
">",
"true<",
"/",
"code",
">",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java#L71-L75 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java | Ui.isTrueFromAttribute | public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) {
return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue);
} | java | public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) {
return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue);
} | [
"public",
"static",
"boolean",
"isTrueFromAttribute",
"(",
"AttributeSet",
"attrs",
",",
"String",
"attribute",
",",
"boolean",
"defaultValue",
")",
"{",
"return",
"attrs",
".",
"getAttributeBooleanValue",
"(",
"Ui",
".",
"androidStyleNameSpace",
",",
"attribute",
"... | Get the attribute have enabled value
Form android styles namespace
@param attrs AttributeSet
@param attribute The attribute to retrieve
@param defaultValue What to return if the attribute isn't found
@return Resulting value | [
"Get",
"the",
"attribute",
"have",
"enabled",
"value",
"Form",
"android",
"styles",
"namespace"
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L140-L142 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java | ProjectedCentroid.make | public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation) {
ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation));
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
c.put(relation.get(iditer));
}
re... | java | public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation) {
ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation));
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
c.put(relation.get(iditer));
}
re... | [
"public",
"static",
"ProjectedCentroid",
"make",
"(",
"long",
"[",
"]",
"dims",
",",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
")",
"{",
"ProjectedCentroid",
"c",
"=",
"new",
"ProjectedCentroid",
"(",
"dims",
",",
"RelationUtil",
".",
... | Static Constructor from a relation.
@param dims Dimensions to use (indexed with 0)
@param relation Relation to process
@return Centroid | [
"Static",
"Constructor",
"from",
"a",
"relation",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java#L138-L144 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/MessageUtil.java | MessageUtil.isMessageExcluded | public static boolean isMessageExcluded(Message message, RecipientType recipientType, String recipientValue) {
Recipient[] recipients = (Recipient[]) message.getMetadata("cwf.pub.recipients");
if (recipients == null || recipients.length == 0) {
return false;
}
... | java | public static boolean isMessageExcluded(Message message, RecipientType recipientType, String recipientValue) {
Recipient[] recipients = (Recipient[]) message.getMetadata("cwf.pub.recipients");
if (recipients == null || recipients.length == 0) {
return false;
}
... | [
"public",
"static",
"boolean",
"isMessageExcluded",
"(",
"Message",
"message",
",",
"RecipientType",
"recipientType",
",",
"String",
"recipientValue",
")",
"{",
"Recipient",
"[",
"]",
"recipients",
"=",
"(",
"Recipient",
"[",
"]",
")",
"message",
".",
"getMetada... | Returns true if the message should be excluded based on the given recipient values. A message
is considered excluded if it has any constraint on the recipient type and does not have a
matching recipient for that type.
@param message The message to examine.
@param recipientType The type of recipient.
@param recipientVa... | [
"Returns",
"true",
"if",
"the",
"message",
"should",
"be",
"excluded",
"based",
"on",
"the",
"given",
"recipient",
"values",
".",
"A",
"message",
"is",
"considered",
"excluded",
"if",
"it",
"has",
"any",
"constraint",
"on",
"the",
"recipient",
"type",
"and",... | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/MessageUtil.java#L58-L78 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/SegwitAddress.java | SegwitAddress.fromBech32 | public static SegwitAddress fromBech32(@Nullable NetworkParameters params, String bech32)
throws AddressFormatException {
Bech32.Bech32Data bechData = Bech32.decode(bech32);
if (params == null) {
for (NetworkParameters p : Networks.get()) {
if (bechData.hrp.equals... | java | public static SegwitAddress fromBech32(@Nullable NetworkParameters params, String bech32)
throws AddressFormatException {
Bech32.Bech32Data bechData = Bech32.decode(bech32);
if (params == null) {
for (NetworkParameters p : Networks.get()) {
if (bechData.hrp.equals... | [
"public",
"static",
"SegwitAddress",
"fromBech32",
"(",
"@",
"Nullable",
"NetworkParameters",
"params",
",",
"String",
"bech32",
")",
"throws",
"AddressFormatException",
"{",
"Bech32",
".",
"Bech32Data",
"bechData",
"=",
"Bech32",
".",
"decode",
"(",
"bech32",
")"... | Construct a {@link SegwitAddress} from its textual form.
@param params
expected network this address is valid for, or null if the network should be derived from the bech32
@param bech32
bech32-encoded textual form of the address
@return constructed address
@throws AddressFormatException
if something about the given be... | [
"Construct",
"a",
"{",
"@link",
"SegwitAddress",
"}",
"from",
"its",
"textual",
"form",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/SegwitAddress.java#L165-L179 |
google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/RawTextContextUpdater.java | RawTextContextUpdater.makeTransitionToSelf | private static Transition makeTransitionToSelf(Pattern regex) {
return new Transition(regex) {
@Override
Context computeNextContext(Context prior, Matcher matcher) {
return prior;
}
};
} | java | private static Transition makeTransitionToSelf(Pattern regex) {
return new Transition(regex) {
@Override
Context computeNextContext(Context prior, Matcher matcher) {
return prior;
}
};
} | [
"private",
"static",
"Transition",
"makeTransitionToSelf",
"(",
"Pattern",
"regex",
")",
"{",
"return",
"new",
"Transition",
"(",
"regex",
")",
"{",
"@",
"Override",
"Context",
"computeNextContext",
"(",
"Context",
"prior",
",",
"Matcher",
"matcher",
")",
"{",
... | A transition that consumes some content without changing state. | [
"A",
"transition",
"that",
"consumes",
"some",
"content",
"without",
"changing",
"state",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/RawTextContextUpdater.java#L336-L343 |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java | ProvidenceHelper.parseDebugString | @Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes(UTF_8));
return DEBUG_STRING... | java | @Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes(UTF_8));
return DEBUG_STRING... | [
"@",
"Nonnull",
"public",
"static",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"Message",
"parseDebugString",
"(",
"String",
"string",
",",
"PMessageDescriptor",
"<",
"Message",
",",
"Field... | Parses a pretty formatted string, and makes exceptions unchecked.
@param string The message string to parse.
@param descriptor The message descriptor.
@param <Message> The message type.
@param <Field> The message field type.
@return The parsed message. | [
"Parses",
"a",
"pretty",
"formatted",
"string",
"and",
"makes",
"exceptions",
"unchecked",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java#L134-L143 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java | RetryOption.mergeToSettings | public static RetrySettings mergeToSettings(RetrySettings settings, RetryOption... options) {
if (options.length <= 0) {
return settings;
}
RetrySettings.Builder builder = settings.toBuilder();
for (RetryOption option : options) {
switch (option.type) {
case TOTAL_TIMEOUT:
... | java | public static RetrySettings mergeToSettings(RetrySettings settings, RetryOption... options) {
if (options.length <= 0) {
return settings;
}
RetrySettings.Builder builder = settings.toBuilder();
for (RetryOption option : options) {
switch (option.type) {
case TOTAL_TIMEOUT:
... | [
"public",
"static",
"RetrySettings",
"mergeToSettings",
"(",
"RetrySettings",
"settings",
",",
"RetryOption",
"...",
"options",
")",
"{",
"if",
"(",
"options",
".",
"length",
"<=",
"0",
")",
"{",
"return",
"settings",
";",
"}",
"RetrySettings",
".",
"Builder",... | Creates a new {@code RetrySettings} instance, merging provided settings and multiple {@code
RetryOptions}, each of which represents a single property in {@code RetrySettings}. It is an
alternative way of initializing {@link RetrySettings} instances.
@param settings retry settings
@param options zero or more Retry
@ret... | [
"Creates",
"a",
"new",
"{",
"@code",
"RetrySettings",
"}",
"instance",
"merging",
"provided",
"settings",
"and",
"multiple",
"{",
"@code",
"RetryOptions",
"}",
"each",
"of",
"which",
"represents",
"a",
"single",
"property",
"in",
"{",
"@code",
"RetrySettings",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java#L119-L149 |
alexruiz/fest-reflect | src/main/java/org/fest/reflect/util/Accessibles.java | Accessibles.setAccessibleIgnoringExceptions | public static void setAccessibleIgnoringExceptions(@NotNull AccessibleObject o, boolean accessible) {
try {
setAccessible(o, accessible);
} catch (RuntimeException ignored) {
String format = "Failed to set 'accessible' flag of %s to %s";
logger.log(Level.SEVERE, String.format(format, o.toStrin... | java | public static void setAccessibleIgnoringExceptions(@NotNull AccessibleObject o, boolean accessible) {
try {
setAccessible(o, accessible);
} catch (RuntimeException ignored) {
String format = "Failed to set 'accessible' flag of %s to %s";
logger.log(Level.SEVERE, String.format(format, o.toStrin... | [
"public",
"static",
"void",
"setAccessibleIgnoringExceptions",
"(",
"@",
"NotNull",
"AccessibleObject",
"o",
",",
"boolean",
"accessible",
")",
"{",
"try",
"{",
"setAccessible",
"(",
"o",
",",
"accessible",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"ignor... | Sets the {@code accessible} flag of the given {@code AccessibleObject} to the given {@code boolean} value, ignoring
any thrown exception.
@param o the given {@code AccessibleObject}.
@param accessible the value to set the {@code accessible} flag to. | [
"Sets",
"the",
"{",
"@code",
"accessible",
"}",
"flag",
"of",
"the",
"given",
"{",
"@code",
"AccessibleObject",
"}",
"to",
"the",
"given",
"{",
"@code",
"boolean",
"}",
"value",
"ignoring",
"any",
"thrown",
"exception",
"."
] | train | https://github.com/alexruiz/fest-reflect/blob/6db30716808633ef880e439b3dc6602ecb3f1b08/src/main/java/org/fest/reflect/util/Accessibles.java#L44-L51 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.revokeImpersonationToken | public void revokeImpersonationToken(Object userIdOrUsername, Integer tokenId) throws GitLabApiException {
if (tokenId == null) {
throw new RuntimeException("tokenId cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.St... | java | public void revokeImpersonationToken(Object userIdOrUsername, Integer tokenId) throws GitLabApiException {
if (tokenId == null) {
throw new RuntimeException("tokenId cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.St... | [
"public",
"void",
"revokeImpersonationToken",
"(",
"Object",
"userIdOrUsername",
",",
"Integer",
"tokenId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"tokenId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"tokenId cannot be null\"",
... | Revokes an impersonation token. Available only for admin users.
<pre><code>GitLab Endpoint: DELETE /users/:user_id/impersonation_tokens/:impersonation_token_id</code></pre>
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param tokenId the impersonation token ID to r... | [
"Revokes",
"an",
"impersonation",
"token",
".",
"Available",
"only",
"for",
"admin",
"users",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L834-L842 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java | MsgDestEncodingUtilsImpl.encodeOtherProperties | private static void encodeOtherProperties(ByteArrayOutputStream baos, Map<String,Object> destProps) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeOtherProperties", new Object[]{baos, destProps});
// Deal with each remaining property in turn.
I... | java | private static void encodeOtherProperties(ByteArrayOutputStream baos, Map<String,Object> destProps) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeOtherProperties", new Object[]{baos, destProps});
// Deal with each remaining property in turn.
I... | [
"private",
"static",
"void",
"encodeOtherProperties",
"(",
"ByteArrayOutputStream",
"baos",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"destProps",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"... | encodeOtherProperties
Encode the more interesting JmsDestination properties, which may or may not be set:
Queue/Topic name
TopicSpace
ReadAhead
Cluster properties
@param baos The ByteArrayOutputStream to encode into
@param destProps The Map of properties to be encoded
@exception JMSExceptio... | [
"encodeOtherProperties",
"Encode",
"the",
"more",
"interesting",
"JmsDestination",
"properties",
"which",
"may",
"or",
"may",
"not",
"be",
"set",
":",
"Queue",
"/",
"Topic",
"name",
"TopicSpace",
"ReadAhead",
"Cluster",
"properties"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java#L657-L693 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/LoggedOutTokenCacheImpl.java | LoggedOutTokenCacheImpl.putDistributedObjectLoggedOutToken | @Override
public Object putDistributedObjectLoggedOutToken(Object key, Object value, int timeToLive) {
DistributedMap map = getDMLoggedOutTokenMap();
if (map != null)
{
Object dist_object = map.put(key, value, 1, timeToLive, EntryInfo.SHARED_PUSH, null);
return dist... | java | @Override
public Object putDistributedObjectLoggedOutToken(Object key, Object value, int timeToLive) {
DistributedMap map = getDMLoggedOutTokenMap();
if (map != null)
{
Object dist_object = map.put(key, value, 1, timeToLive, EntryInfo.SHARED_PUSH, null);
return dist... | [
"@",
"Override",
"public",
"Object",
"putDistributedObjectLoggedOutToken",
"(",
"Object",
"key",
",",
"Object",
"value",
",",
"int",
"timeToLive",
")",
"{",
"DistributedMap",
"map",
"=",
"getDMLoggedOutTokenMap",
"(",
")",
";",
"if",
"(",
"map",
"!=",
"null",
... | /*
Add the token to the DistributedMap
key is the token string
value is the subject
timeToLive is the about of time left before the token expires, to become the expiring time of the distributed map entry | [
"/",
"*",
"Add",
"the",
"token",
"to",
"the",
"DistributedMap"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/LoggedOutTokenCacheImpl.java#L94-L105 |
icode/ameba | src/main/java/ameba/lib/Strands.java | Strands.printStackTrace | public static void printStackTrace(StackTraceElement[] trace, java.io.PrintWriter out) {
Strand.printStackTrace(trace, out);
} | java | public static void printStackTrace(StackTraceElement[] trace, java.io.PrintWriter out) {
Strand.printStackTrace(trace, out);
} | [
"public",
"static",
"void",
"printStackTrace",
"(",
"StackTraceElement",
"[",
"]",
"trace",
",",
"java",
".",
"io",
".",
"PrintWriter",
"out",
")",
"{",
"Strand",
".",
"printStackTrace",
"(",
"trace",
",",
"out",
")",
";",
"}"
] | This utility method prints a stack-trace into a {@link java.io.PrintWriter}
@param trace a stack trace (such as returned from {@link Strand#getStackTrace()}.
@param out the {@link java.io.PrintWriter} into which the stack trace will be printed. | [
"This",
"utility",
"method",
"prints",
"a",
"stack",
"-",
"trace",
"into",
"a",
"{",
"@link",
"java",
".",
"io",
".",
"PrintWriter",
"}"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Strands.java#L537-L539 |
ModeShape/modeshape | modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnectionFactory.java | JcrManagedConnectionFactory.createConnectionFactory | @Override
public Object createConnectionFactory( ConnectionManager cxManager ) throws ResourceException {
JcrRepositoryHandle handle = new JcrRepositoryHandle(this, cxManager);
return handle;
} | java | @Override
public Object createConnectionFactory( ConnectionManager cxManager ) throws ResourceException {
JcrRepositoryHandle handle = new JcrRepositoryHandle(this, cxManager);
return handle;
} | [
"@",
"Override",
"public",
"Object",
"createConnectionFactory",
"(",
"ConnectionManager",
"cxManager",
")",
"throws",
"ResourceException",
"{",
"JcrRepositoryHandle",
"handle",
"=",
"new",
"JcrRepositoryHandle",
"(",
"this",
",",
"cxManager",
")",
";",
"return",
"hand... | Creates a Connection Factory instance.
@param cxManager ConnectionManager to be associated with created EIS connection factory instance
@return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
@throws ResourceException Generic exception | [
"Creates",
"a",
"Connection",
"Factory",
"instance",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnectionFactory.java#L153-L157 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static File generate(String content, QrConfig config, File targetFile) {
final BufferedImage image = generate(content, config);
ImgUtil.write(image, targetFile);
return targetFile;
} | java | public static File generate(String content, QrConfig config, File targetFile) {
final BufferedImage image = generate(content, config);
ImgUtil.write(image, targetFile);
return targetFile;
} | [
"public",
"static",
"File",
"generate",
"(",
"String",
"content",
",",
"QrConfig",
"config",
",",
"File",
"targetFile",
")",
"{",
"final",
"BufferedImage",
"image",
"=",
"generate",
"(",
"content",
",",
"config",
")",
";",
"ImgUtil",
".",
"write",
"(",
"im... | 生成二维码到文件,二维码图片格式取决于文件的扩展名
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@param targetFile 目标文件,扩展名决定输出格式
@return 目标文件
@since 4.1.2 | [
"生成二维码到文件,二维码图片格式取决于文件的扩展名"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L91-L95 |
cdk/cdk | storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGeneratorFactory.java | InChIGeneratorFactory.getInChIGenerator | public InChIGenerator getInChIGenerator(IAtomContainer container, String options) throws CDKException {
return (new InChIGenerator(container, options, ignoreAromaticBonds));
} | java | public InChIGenerator getInChIGenerator(IAtomContainer container, String options) throws CDKException {
return (new InChIGenerator(container, options, ignoreAromaticBonds));
} | [
"public",
"InChIGenerator",
"getInChIGenerator",
"(",
"IAtomContainer",
"container",
",",
"String",
"options",
")",
"throws",
"CDKException",
"{",
"return",
"(",
"new",
"InChIGenerator",
"(",
"container",
",",
"options",
",",
"ignoreAromaticBonds",
")",
")",
";",
... | Gets InChI generator for CDK IAtomContainer.
@param container AtomContainer to generate InChI for.
@param options String of options for InChI generation.
@return the InChI generator object
@throws CDKException if the generator cannot be instantiated | [
"Gets",
"InChI",
"generator",
"for",
"CDK",
"IAtomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGeneratorFactory.java#L158-L160 |
99soft/sameas4j | src/main/java/org/nnsoft/sameas4j/AbstractEquivalenceDeserializer.java | AbstractEquivalenceDeserializer.getEquivalence | public Equivalence getEquivalence(JsonElement json) {
Equivalence equivalence;
String uriString = json.getAsJsonObject().getAsJsonPrimitive(URI).getAsString();
URI uri;
try {
uri = new URI(urlEncode(uriString));
} catch (Exception e) {
throw new JsonParseE... | java | public Equivalence getEquivalence(JsonElement json) {
Equivalence equivalence;
String uriString = json.getAsJsonObject().getAsJsonPrimitive(URI).getAsString();
URI uri;
try {
uri = new URI(urlEncode(uriString));
} catch (Exception e) {
throw new JsonParseE... | [
"public",
"Equivalence",
"getEquivalence",
"(",
"JsonElement",
"json",
")",
"{",
"Equivalence",
"equivalence",
";",
"String",
"uriString",
"=",
"json",
".",
"getAsJsonObject",
"(",
")",
".",
"getAsJsonPrimitive",
"(",
"URI",
")",
".",
"getAsString",
"(",
")",
... | Deserialize a single {@link org.nnsoft.sameas4j.Equivalence}
from its Json serialization.
@param json object to be deserialized
@return a not null {@link org.nnsoft.sameas4j.Equivalence} instance | [
"Deserialize",
"a",
"single",
"{",
"@link",
"org",
".",
"nnsoft",
".",
"sameas4j",
".",
"Equivalence",
"}",
"from",
"its",
"Json",
"serialization",
"."
] | train | https://github.com/99soft/sameas4j/blob/d6fcb6a137c5a80278001a6d11ee917be4f5ea41/src/main/java/org/nnsoft/sameas4j/AbstractEquivalenceDeserializer.java#L144-L164 |
virgo47/javasimon | core/src/main/java/org/javasimon/utils/SLF4JLoggingCallback.java | SLF4JLoggingCallback.onStopwatchStop | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
logger.debug(marker, "SIMON STOP: {} ({})", sample.toString(), split.runningFor());
} | java | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
logger.debug(marker, "SIMON STOP: {} ({})", sample.toString(), split.runningFor());
} | [
"@",
"Override",
"public",
"void",
"onStopwatchStop",
"(",
"Split",
"split",
",",
"StopwatchSample",
"sample",
")",
"{",
"logger",
".",
"debug",
"(",
"marker",
",",
"\"SIMON STOP: {} ({})\"",
",",
"sample",
".",
"toString",
"(",
")",
",",
"split",
".",
"runn... | Logs Simon stop on a specified log marker.
@param split stopped split
@param sample stopwatch sample | [
"Logs",
"Simon",
"stop",
"on",
"a",
"specified",
"log",
"marker",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/utils/SLF4JLoggingCallback.java#L40-L43 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java | GlobalInterlock.releaseLock | public static void releaseLock(EntityManager em, long type, String key) {
EntityTransaction tx = null;
/* remove the existing lock if it matches the key. */
try {
tx = em.getTransaction();
tx.begin();
GlobalInterlock lock = _findAndRefreshLock(em, type);
... | java | public static void releaseLock(EntityManager em, long type, String key) {
EntityTransaction tx = null;
/* remove the existing lock if it matches the key. */
try {
tx = em.getTransaction();
tx.begin();
GlobalInterlock lock = _findAndRefreshLock(em, type);
... | [
"public",
"static",
"void",
"releaseLock",
"(",
"EntityManager",
"em",
",",
"long",
"type",
",",
"String",
"key",
")",
"{",
"EntityTransaction",
"tx",
"=",
"null",
";",
"/* remove the existing lock if it matches the key. */",
"try",
"{",
"tx",
"=",
"em",
".",
"g... | Releases a global lock of the indicated type if the supplied key is a match for the lock.
@param em The entity manager factory to use. Cannot be null.
@param type The type of key to release.
@param key The key value obtained from the lock creation.
@throws GlobalInterlockException If the lock cannot be ... | [
"Releases",
"a",
"global",
"lock",
"of",
"the",
"indicated",
"type",
"if",
"the",
"supplied",
"key",
"is",
"a",
"match",
"for",
"the",
"lock",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java#L193-L221 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/rest/RestRepository.java | RestRepository.lazyInitWriting | private void lazyInitWriting() {
if (!writeInitialized) {
this.writeInitialized = true;
this.bulkProcessor = new BulkProcessor(client, resources.getResourceWrite(), settings);
this.trivialBytesRef = new BytesRef();
this.bulkEntryWriter = new BulkEntryWriter(settin... | java | private void lazyInitWriting() {
if (!writeInitialized) {
this.writeInitialized = true;
this.bulkProcessor = new BulkProcessor(client, resources.getResourceWrite(), settings);
this.trivialBytesRef = new BytesRef();
this.bulkEntryWriter = new BulkEntryWriter(settin... | [
"private",
"void",
"lazyInitWriting",
"(",
")",
"{",
"if",
"(",
"!",
"writeInitialized",
")",
"{",
"this",
".",
"writeInitialized",
"=",
"true",
";",
"this",
".",
"bulkProcessor",
"=",
"new",
"BulkProcessor",
"(",
"client",
",",
"resources",
".",
"getResourc... | postpone writing initialization since we can do only reading so there's no need to allocate buffers | [
"postpone",
"writing",
"initialization",
"since",
"we",
"can",
"do",
"only",
"reading",
"so",
"there",
"s",
"no",
"need",
"to",
"allocate",
"buffers"
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/RestRepository.java#L133-L140 |
gallandarakhneorg/afc | core/maths/mathgen/src/main/java/org/arakhne/afc/math/MathUtil.java | MathUtil.compareEpsilon | @Pure
public static int compareEpsilon(double v1, double v2) {
final double v = v1 - v2;
if (Math.abs(v) < Math.ulp(v)) {
return 0;
}
if (v <= 0.) {
return -1;
}
return 1;
} | java | @Pure
public static int compareEpsilon(double v1, double v2) {
final double v = v1 - v2;
if (Math.abs(v) < Math.ulp(v)) {
return 0;
}
if (v <= 0.) {
return -1;
}
return 1;
} | [
"@",
"Pure",
"public",
"static",
"int",
"compareEpsilon",
"(",
"double",
"v1",
",",
"double",
"v2",
")",
"{",
"final",
"double",
"v",
"=",
"v1",
"-",
"v2",
";",
"if",
"(",
"Math",
".",
"abs",
"(",
"v",
")",
"<",
"Math",
".",
"ulp",
"(",
"v",
")... | Compares its two arguments for order.
Returns a negative integer,
zero, or a positive integer as the first argument is less than, equal
to, or greater than the second.
@param v1 first value.
@param v2 second value.
@return a negative integer, zero, or a positive integer as the
first argument is less than, equal to, or... | [
"Compares",
"its",
"two",
"arguments",
"for",
"order",
".",
"Returns",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"as",
"the",
"first",
"argument",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
".... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgen/src/main/java/org/arakhne/afc/math/MathUtil.java#L189-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/MessageProcessor.java | MessageProcessor.createProxyHandler | private void createProxyHandler() throws MessageStoreException {
if (TraceComponent.isAnyTracingEnabled()
&& tc.isEntryEnabled())
SibTr.entry(tc, "createProxyHandler");
_multiMEProxyHandler = new MultiMEProxyHandler(this, _txManager);
_persistentStore.addItemStream(_mult... | java | private void createProxyHandler() throws MessageStoreException {
if (TraceComponent.isAnyTracingEnabled()
&& tc.isEntryEnabled())
SibTr.entry(tc, "createProxyHandler");
_multiMEProxyHandler = new MultiMEProxyHandler(this, _txManager);
_persistentStore.addItemStream(_mult... | [
"private",
"void",
"createProxyHandler",
"(",
")",
"throws",
"MessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createProx... | In a cold start ME Environment, the proxy handler needs to be created. | [
"In",
"a",
"cold",
"start",
"ME",
"Environment",
"the",
"proxy",
"handler",
"needs",
"to",
"be",
"created",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/MessageProcessor.java#L2340-L2352 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XScreenField.java | XScreenField.printControlEndForm | public void printControlEndForm(PrintWriter out, int iPrintOptions)
{
out.println(Utility.endTag(XMLTags.CONTROLS));
} | java | public void printControlEndForm(PrintWriter out, int iPrintOptions)
{
out.println(Utility.endTag(XMLTags.CONTROLS));
} | [
"public",
"void",
"printControlEndForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"out",
".",
"println",
"(",
"Utility",
".",
"endTag",
"(",
"XMLTags",
".",
"CONTROLS",
")",
")",
";",
"}"
] | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XScreenField.java#L139-L142 |
junit-team/junit4 | src/main/java/org/junit/runners/model/FrameworkMethod.java | FrameworkMethod.invokeExplosively | public Object invokeExplosively(final Object target, final Object... params)
throws Throwable {
return new ReflectiveCallable() {
@Override
protected Object runReflectiveCall() throws Throwable {
return method.invoke(target, params);
}
}.ru... | java | public Object invokeExplosively(final Object target, final Object... params)
throws Throwable {
return new ReflectiveCallable() {
@Override
protected Object runReflectiveCall() throws Throwable {
return method.invoke(target, params);
}
}.ru... | [
"public",
"Object",
"invokeExplosively",
"(",
"final",
"Object",
"target",
",",
"final",
"Object",
"...",
"params",
")",
"throws",
"Throwable",
"{",
"return",
"new",
"ReflectiveCallable",
"(",
")",
"{",
"@",
"Override",
"protected",
"Object",
"runReflectiveCall",
... | Returns the result of invoking this method on {@code target} with
parameters {@code params}. {@link InvocationTargetException}s thrown are
unwrapped, and their causes rethrown. | [
"Returns",
"the",
"result",
"of",
"invoking",
"this",
"method",
"on",
"{"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/model/FrameworkMethod.java#L54-L62 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/painter/ImagePainter.java | ImagePainter.deleteShape | public void deleteShape(Paintable paintable, Object group, MapContext context) {
Image image = (Image) paintable;
context.getVectorContext().deleteElement(group, image.getId());
} | java | public void deleteShape(Paintable paintable, Object group, MapContext context) {
Image image = (Image) paintable;
context.getVectorContext().deleteElement(group, image.getId());
} | [
"public",
"void",
"deleteShape",
"(",
"Paintable",
"paintable",
",",
"Object",
"group",
",",
"MapContext",
"context",
")",
"{",
"Image",
"image",
"=",
"(",
"Image",
")",
"paintable",
";",
"context",
".",
"getVectorContext",
"(",
")",
".",
"deleteElement",
"(... | Delete a {@link Paintable} object from the given {@link MapContext}. It the object does not exist,
nothing will be done.
@param paintable
The object to be painted.
@param group
The group where the object resides in (optional).
@param context
The context to paint on. | [
"Delete",
"a",
"{",
"@link",
"Paintable",
"}",
"object",
"from",
"the",
"given",
"{",
"@link",
"MapContext",
"}",
".",
"It",
"the",
"object",
"does",
"not",
"exist",
"nothing",
"will",
"be",
"done",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/painter/ImagePainter.java#L65-L68 |
skuzzle/semantic-version | src/it/java/de/skuzzle/semantic/VersionRegEx.java | VersionRegEx.parseVersion | public static final VersionRegEx parseVersion(String versionString) {
require(versionString != null, "versionString is null");
final Matcher m = VERSION_PATTERN.matcher(versionString);
if (!m.matches()) {
throw new VersionFormatException(versionString);
}
final int m... | java | public static final VersionRegEx parseVersion(String versionString) {
require(versionString != null, "versionString is null");
final Matcher m = VERSION_PATTERN.matcher(versionString);
if (!m.matches()) {
throw new VersionFormatException(versionString);
}
final int m... | [
"public",
"static",
"final",
"VersionRegEx",
"parseVersion",
"(",
"String",
"versionString",
")",
"{",
"require",
"(",
"versionString",
"!=",
"null",
",",
"\"versionString is null\"",
")",
";",
"final",
"Matcher",
"m",
"=",
"VERSION_PATTERN",
".",
"matcher",
"(",
... | Tries to parse the provided String as a semantic version. If the string does not
conform to the semantic version specification, a {@link VersionFormatException}
will be thrown.
@param versionString The String to parse.
@return The parsed version.
@throws VersionFormatException If the String is no valid version
@throws... | [
"Tries",
"to",
"parse",
"the",
"provided",
"String",
"as",
"a",
"semantic",
"version",
".",
"If",
"the",
"string",
"does",
"not",
"conform",
"to",
"the",
"semantic",
"version",
"specification",
"a",
"{",
"@link",
"VersionFormatException",
"}",
"will",
"be",
... | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/it/java/de/skuzzle/semantic/VersionRegEx.java#L528-L556 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.setFieldValue | public static void setFieldValue(Object object, Field field, Object value) throws IllegalArgumentException, BugError
{
Params.notNull(field, "Field");
Class<?> type = field.getType();
if(!type.equals(String.class) && value instanceof String) {
value = ConverterRegistry.getConverter().asObject... | java | public static void setFieldValue(Object object, Field field, Object value) throws IllegalArgumentException, BugError
{
Params.notNull(field, "Field");
Class<?> type = field.getType();
if(!type.equals(String.class) && value instanceof String) {
value = ConverterRegistry.getConverter().asObject... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"object",
",",
"Field",
"field",
",",
"Object",
"value",
")",
"throws",
"IllegalArgumentException",
",",
"BugError",
"{",
"Params",
".",
"notNull",
"(",
"field",
",",
"\"Field\"",
")",
";",
"Class",
... | Set field value for object instance, or class if given object instance is null. This setter takes care to enable
accessibility for private fields. Also it tries to adapt <code>value</code> to field type: if <code>value</code> is
a string and field type is not, delegates {@link Converter#asObject(String, Class)}. Anyway... | [
"Set",
"field",
"value",
"for",
"object",
"instance",
"or",
"class",
"if",
"given",
"object",
"instance",
"is",
"null",
".",
"This",
"setter",
"takes",
"care",
"to",
"enable",
"accessibility",
"for",
"private",
"fields",
".",
"Also",
"it",
"tries",
"to",
"... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L828-L847 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitOperandDef | public T visitOperandDef(OperandDef elm, C context) {
if (elm.getOperandTypeSpecifier() != null) {
visitElement(elm.getOperandTypeSpecifier(), context);
}
return null;
} | java | public T visitOperandDef(OperandDef elm, C context) {
if (elm.getOperandTypeSpecifier() != null) {
visitElement(elm.getOperandTypeSpecifier(), context);
}
return null;
} | [
"public",
"T",
"visitOperandDef",
"(",
"OperandDef",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
".",
"getOperandTypeSpecifier",
"(",
")",
"!=",
"null",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getOperandTypeSpecifier",
"(",
")",
",",
"conte... | Visit a OperandDef. This method will be called for
every node in the tree that is a OperandDef.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"OperandDef",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"OperandDef",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L404-L409 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.