repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.opacify | public static Expression opacify(Generator generator, FunctionCall input) {
Color color = input.getExpectedColorParam(0);
float amount = input.getExpectedFloatParam(1);
return new Color(color.getR(), color.getG(), color.getB(), color.getA() + amount);
} | java | public static Expression opacify(Generator generator, FunctionCall input) {
Color color = input.getExpectedColorParam(0);
float amount = input.getExpectedFloatParam(1);
return new Color(color.getR(), color.getG(), color.getB(), color.getA() + amount);
} | [
"public",
"static",
"Expression",
"opacify",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"Color",
"color",
"=",
"input",
".",
"getExpectedColorParam",
"(",
"0",
")",
";",
"float",
"amount",
"=",
"input",
".",
"getExpectedFloatParam",
... | Increases the opacity of the given color by the given amount.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Increases",
"the",
"opacity",
"of",
"the",
"given",
"color",
"by",
"the",
"given",
"amount",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L169-L173 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/utils/Utils.java | Utils.createTempDirectory | public static File createTempDirectory(String prefix) {
File temp = null;
try {
temp = File.createTempFile(prefix != null ? prefix : "temp", Long.toString(System.nanoTime()));
if (!(temp.delete())) {
throw new IOException("Could not delete temp file: "
+ temp.getAbsolutePath());
}
if (!(tem... | java | public static File createTempDirectory(String prefix) {
File temp = null;
try {
temp = File.createTempFile(prefix != null ? prefix : "temp", Long.toString(System.nanoTime()));
if (!(temp.delete())) {
throw new IOException("Could not delete temp file: "
+ temp.getAbsolutePath());
}
if (!(tem... | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"prefix",
")",
"{",
"File",
"temp",
"=",
"null",
";",
"try",
"{",
"temp",
"=",
"File",
".",
"createTempFile",
"(",
"prefix",
"!=",
"null",
"?",
"prefix",
":",
"\"temp\"",
",",
"Long",
".",... | Creates a temporary folder using the given prefix to generate its name.
@param prefix the prefix string to be used in generating the directory's name; may be <i>null</i>
@return the <code>File</code> to the newly created folder
@throws IOException | [
"Creates",
"a",
"temporary",
"folder",
"using",
"the",
"given",
"prefix",
"to",
"generate",
"its",
"name",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/utils/Utils.java#L36-L56 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/junit/TakeScreenshotOnFailureRule.java | TakeScreenshotOnFailureRule.filenameFor | private File filenameFor(final Description method) {
String className = method.getClassName();
String methodName = method.getMethodName();
return new File(directory, className + "_" + methodName + ".png");
} | java | private File filenameFor(final Description method) {
String className = method.getClassName();
String methodName = method.getMethodName();
return new File(directory, className + "_" + methodName + ".png");
} | [
"private",
"File",
"filenameFor",
"(",
"final",
"Description",
"method",
")",
"{",
"String",
"className",
"=",
"method",
".",
"getClassName",
"(",
")",
";",
"String",
"methodName",
"=",
"method",
".",
"getMethodName",
"(",
")",
";",
"return",
"new",
"File",
... | Gets the name of the image file with the screenshot.
@param method
the method name
@return the file that will cotain the screenshot | [
"Gets",
"the",
"name",
"of",
"the",
"image",
"file",
"with",
"the",
"screenshot",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/junit/TakeScreenshotOnFailureRule.java#L129-L134 |
i-net-software/jlessc | src/com/inet/lib/less/Rule.java | Rule.appendMixinsTo | void appendMixinsTo( String[] parentSelector, CssFormatter formatter ) {
for( Formattable prop : properties ) {
switch( prop.getType()) {
case MIXIN:
((Mixin)prop).appendSubRules( parentSelector, formatter );
break;
case CSS_AT_... | java | void appendMixinsTo( String[] parentSelector, CssFormatter formatter ) {
for( Formattable prop : properties ) {
switch( prop.getType()) {
case MIXIN:
((Mixin)prop).appendSubRules( parentSelector, formatter );
break;
case CSS_AT_... | [
"void",
"appendMixinsTo",
"(",
"String",
"[",
"]",
"parentSelector",
",",
"CssFormatter",
"formatter",
")",
"{",
"for",
"(",
"Formattable",
"prop",
":",
"properties",
")",
"{",
"switch",
"(",
"prop",
".",
"getType",
"(",
")",
")",
"{",
"case",
"MIXIN",
"... | Append the mixins of this rule to current output.
@param parentSelector the resulting parent selector
@param formatter current formatter | [
"Append",
"the",
"mixins",
"of",
"this",
"rule",
"to",
"current",
"output",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/Rule.java#L298-L310 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/management/JmxRegistration.java | JmxRegistration.registerMXBean | public static void registerMXBean(Cache<?, ?> cache, Object mxbean, MBeanType type) {
ObjectName objectName = getObjectName(cache, type);
register(objectName, mxbean);
} | java | public static void registerMXBean(Cache<?, ?> cache, Object mxbean, MBeanType type) {
ObjectName objectName = getObjectName(cache, type);
register(objectName, mxbean);
} | [
"public",
"static",
"void",
"registerMXBean",
"(",
"Cache",
"<",
"?",
",",
"?",
">",
"cache",
",",
"Object",
"mxbean",
",",
"MBeanType",
"type",
")",
"{",
"ObjectName",
"objectName",
"=",
"getObjectName",
"(",
"cache",
",",
"type",
")",
";",
"register",
... | Registers the JMX management bean for the cache.
@param cache the cache to register
@param mxbean the management bean
@param type the mxbean type | [
"Registers",
"the",
"JMX",
"management",
"bean",
"for",
"the",
"cache",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/management/JmxRegistration.java#L49-L52 |
kiswanij/jk-util | src/main/java/com/jk/util/JK.java | JK.validateNull | public static void validateNull(String name, Object object) {
if (object == null) {
throw new IllegalStateException(name.concat(" cannot be null"));
}
} | java | public static void validateNull(String name, Object object) {
if (object == null) {
throw new IllegalStateException(name.concat(" cannot be null"));
}
} | [
"public",
"static",
"void",
"validateNull",
"(",
"String",
"name",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"name",
".",
"concat",
"(",
"\" cannot be null\"",
")",
")",
";... | Validate null.
@param name the name
@param object the object | [
"Validate",
"null",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JK.java#L307-L311 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/CellConstraints.java | CellConstraints.concreteAlignment | private static Alignment concreteAlignment(Alignment cellAlignment, FormSpec formSpec) {
return formSpec == null
? cellAlignment == DEFAULT ? FILL : cellAlignment
: usedAlignment(cellAlignment, formSpec);
} | java | private static Alignment concreteAlignment(Alignment cellAlignment, FormSpec formSpec) {
return formSpec == null
? cellAlignment == DEFAULT ? FILL : cellAlignment
: usedAlignment(cellAlignment, formSpec);
} | [
"private",
"static",
"Alignment",
"concreteAlignment",
"(",
"Alignment",
"cellAlignment",
",",
"FormSpec",
"formSpec",
")",
"{",
"return",
"formSpec",
"==",
"null",
"?",
"cellAlignment",
"==",
"DEFAULT",
"?",
"FILL",
":",
"cellAlignment",
":",
"usedAlignment",
"("... | Computes and returns the concrete alignment. Takes into account the cell alignment and
<i>the</i> {@code FormSpec} if applicable.<p>
If this constraints object doesn't belong to a single column or row, the {@code formSpec}
parameter is {@code null}. In this case the cell alignment is answered, but {@code DEFAULT}
is m... | [
"Computes",
"and",
"returns",
"the",
"concrete",
"alignment",
".",
"Takes",
"into",
"account",
"the",
"cell",
"alignment",
"and",
"<i",
">",
"the<",
"/",
"i",
">",
"{",
"@code",
"FormSpec",
"}",
"if",
"applicable",
".",
"<p",
">"
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/CellConstraints.java#L978-L982 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.newPermission | @Override
public IPermission newPermission(String owner, IAuthorizationPrincipal principal) {
IPermission p = getPermissionStore().newInstance(owner);
if (principal != null) {
String pString = getPrincipalString(principal);
p.setPrincipal(pString);
}
return p;... | java | @Override
public IPermission newPermission(String owner, IAuthorizationPrincipal principal) {
IPermission p = getPermissionStore().newInstance(owner);
if (principal != null) {
String pString = getPrincipalString(principal);
p.setPrincipal(pString);
}
return p;... | [
"@",
"Override",
"public",
"IPermission",
"newPermission",
"(",
"String",
"owner",
",",
"IAuthorizationPrincipal",
"principal",
")",
"{",
"IPermission",
"p",
"=",
"getPermissionStore",
"(",
")",
".",
"newInstance",
"(",
"owner",
")",
";",
"if",
"(",
"principal",... | Factory method for an <code>IPermission</code>.
@param owner String
@param principal IAuthorizationPrincipal
@return org.apereo.portal.security.IPermission | [
"Factory",
"method",
"for",
"an",
"<code",
">",
"IPermission<",
"/",
"code",
">",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L899-L907 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/AuthResourceRepresentation.java | AuthResourceRepresentation.ofReaderGroupInScope | public static String ofReaderGroupInScope(String scopeName, String readerGroupName) {
Exceptions.checkNotNullOrEmpty(readerGroupName, "readerGroupName");
return String.format("%s/%s", ofReaderGroupsInScope(scopeName), readerGroupName);
} | java | public static String ofReaderGroupInScope(String scopeName, String readerGroupName) {
Exceptions.checkNotNullOrEmpty(readerGroupName, "readerGroupName");
return String.format("%s/%s", ofReaderGroupsInScope(scopeName), readerGroupName);
} | [
"public",
"static",
"String",
"ofReaderGroupInScope",
"(",
"String",
"scopeName",
",",
"String",
"readerGroupName",
")",
"{",
"Exceptions",
".",
"checkNotNullOrEmpty",
"(",
"readerGroupName",
",",
"\"readerGroupName\"",
")",
";",
"return",
"String",
".",
"format",
"... | Creates a resource representation for use in authorization of actions pertaining to the specified reader group
within the specified scope.
@param scopeName the name of the scope
@param readerGroupName the name of the reader group
@return a string representing the specified reader group
@throws NullPointerException if ... | [
"Creates",
"a",
"resource",
"representation",
"for",
"use",
"in",
"authorization",
"of",
"actions",
"pertaining",
"to",
"the",
"specified",
"reader",
"group",
"within",
"the",
"specified",
"scope",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/AuthResourceRepresentation.java#L106-L109 |
scireum/parsii | src/main/java/parsii/tokenizer/Tokenizer.java | Tokenizer.canConsumeThisString | protected boolean canConsumeThisString(String string, boolean consume) {
if (string == null) {
return false;
}
for (int i = 0; i < string.length(); i++) {
if (!input.next(i).is(string.charAt(i))) {
return false;
}
}
if (consume)... | java | protected boolean canConsumeThisString(String string, boolean consume) {
if (string == null) {
return false;
}
for (int i = 0; i < string.length(); i++) {
if (!input.next(i).is(string.charAt(i))) {
return false;
}
}
if (consume)... | [
"protected",
"boolean",
"canConsumeThisString",
"(",
"String",
"string",
",",
"boolean",
"consume",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"string",
".",
"l... | Checks if the next characters, starting from the current, match the given string.
@param string the string to check
@param consume determines if the matched string should be consumed immediately
@return <tt>true</tt> if the next characters of the input match the given string, <tt>false</tt>
otherwise | [
"Checks",
"if",
"the",
"next",
"characters",
"starting",
"from",
"the",
"current",
"match",
"the",
"given",
"string",
"."
] | train | https://github.com/scireum/parsii/blob/fbf686155b1147b9e07ae21dcd02820b15c79a8c/src/main/java/parsii/tokenizer/Tokenizer.java#L242-L255 |
Waikato/moa | moa/src/main/java/moa/core/Utils.java | Utils.getOption | public static /*@non_null@*/ String getOption(String flag, String[] options)
throws Exception {
String newString;
int i = getOptionPos(flag, options);
if (i > -1) {
if (options[i].equals("-" + flag)) {
if (i + 1 == options.length) {
throw new Exception("No value given for -" + flag + " opti... | java | public static /*@non_null@*/ String getOption(String flag, String[] options)
throws Exception {
String newString;
int i = getOptionPos(flag, options);
if (i > -1) {
if (options[i].equals("-" + flag)) {
if (i + 1 == options.length) {
throw new Exception("No value given for -" + flag + " opti... | [
"public",
"static",
"/*@non_null@*/",
"String",
"getOption",
"(",
"String",
"flag",
",",
"String",
"[",
"]",
"options",
")",
"throws",
"Exception",
"{",
"String",
"newString",
";",
"int",
"i",
"=",
"getOptionPos",
"(",
"flag",
",",
"options",
")",
";",
"if... | Gets an option indicated by a flag "-String" from the given array
of strings. Stops searching at the first marker "--". Replaces
flag and option with empty strings.
@param flag the String indicating the option.
@param options the array of strings containing all the options.
@return the indicated option or an empty str... | [
"Gets",
"an",
"option",
"indicated",
"by",
"a",
"flag",
"-",
"String",
"from",
"the",
"given",
"array",
"of",
"strings",
".",
"Stops",
"searching",
"at",
"the",
"first",
"marker",
"--",
".",
"Replaces",
"flag",
"and",
"option",
"with",
"empty",
"strings",
... | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/core/Utils.java#L519-L541 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/spex/SXTag.java | SXTag.addChildNode | public synchronized SXTag addChildNode(String tagName) throws IOException {
// reject modification of already closed node
if(isOpen==false) {
throw new IOException("Attempted to add child node '" + tagName + "' to already closed tag '" + name + "'!");
}
if(lastChildNode==null) {
// no child nodes yet, clo... | java | public synchronized SXTag addChildNode(String tagName) throws IOException {
// reject modification of already closed node
if(isOpen==false) {
throw new IOException("Attempted to add child node '" + tagName + "' to already closed tag '" + name + "'!");
}
if(lastChildNode==null) {
// no child nodes yet, clo... | [
"public",
"synchronized",
"SXTag",
"addChildNode",
"(",
"String",
"tagName",
")",
"throws",
"IOException",
"{",
"// reject modification of already closed node",
"if",
"(",
"isOpen",
"==",
"false",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Attempted to add child n... | Adds a regular tag child node with the specified tag name to this node.
<b>WARNING:</b> This will close the last added child node, if applicable!
<b>NOTICE:</b> Use this method to add child nodes, do <b>NOT</b> attempt to instantiate them manually!
@param tagName Name of the tag node to be added
@return The newly crea... | [
"Adds",
"a",
"regular",
"tag",
"child",
"node",
"with",
"the",
"specified",
"tag",
"name",
"to",
"this",
"node",
".",
"<b",
">",
"WARNING",
":",
"<",
"/",
"b",
">",
"This",
"will",
"close",
"the",
"last",
"added",
"child",
"node",
"if",
"applicable!",
... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/spex/SXTag.java#L144-L161 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java | BasicAtomGenerator.getAtomColor | protected Color getAtomColor(IAtom atom, RendererModel model) {
Color atomColor = model.get(AtomColor.class);
if ((Boolean) model.get(ColorByType.class)) {
atomColor = ((IAtomColorer) model.get(AtomColorer.class)).getAtomColor(atom);
}
return atomColor;
} | java | protected Color getAtomColor(IAtom atom, RendererModel model) {
Color atomColor = model.get(AtomColor.class);
if ((Boolean) model.get(ColorByType.class)) {
atomColor = ((IAtomColorer) model.get(AtomColorer.class)).getAtomColor(atom);
}
return atomColor;
} | [
"protected",
"Color",
"getAtomColor",
"(",
"IAtom",
"atom",
",",
"RendererModel",
"model",
")",
"{",
"Color",
"atomColor",
"=",
"model",
".",
"get",
"(",
"AtomColor",
".",
"class",
")",
";",
"if",
"(",
"(",
"Boolean",
")",
"model",
".",
"get",
"(",
"Co... | Returns the drawing color of the given atom. An atom is colored as
highlighted if highlighted. The atom is color marked if in a
substructure. If not, the color from the CDK2DAtomColor is used (if
selected). Otherwise, the atom is colored black. | [
"Returns",
"the",
"drawing",
"color",
"of",
"the",
"given",
"atom",
".",
"An",
"atom",
"is",
"colored",
"as",
"highlighted",
"if",
"highlighted",
".",
"The",
"atom",
"is",
"color",
"marked",
"if",
"in",
"a",
"substructure",
".",
"If",
"not",
"the",
"colo... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L405-L411 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/jdbc/Util.java | Util.autoMap | private static <T> T autoMap(ResultSet rs, Constructor<T> c) {
Class<?>[] types = c.getParameterTypes();
List<Object> list = new ArrayList<Object>();
for (int i = 0; i < types.length; i++) {
list.add(autoMap(getObject(rs, types[i], i + 1), types[i]));
}
try {
... | java | private static <T> T autoMap(ResultSet rs, Constructor<T> c) {
Class<?>[] types = c.getParameterTypes();
List<Object> list = new ArrayList<Object>();
for (int i = 0; i < types.length; i++) {
list.add(autoMap(getObject(rs, types[i], i + 1), types[i]));
}
try {
... | [
"private",
"static",
"<",
"T",
">",
"T",
"autoMap",
"(",
"ResultSet",
"rs",
",",
"Constructor",
"<",
"T",
">",
"c",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
"=",
"c",
".",
"getParameterTypes",
"(",
")",
";",
"List",
"<",
"Object",
">"... | Converts the ResultSet column values into parameters to the given
constructor (with number of parameters equals the number of columns) of
type <code>T</code> then returns an instance of type <code>T</code>. See
See {@link Builder#autoMap(Class)}.
@param rs
the result set row
@param c
constructor to use for instantiati... | [
"Converts",
"the",
"ResultSet",
"column",
"values",
"into",
"parameters",
"to",
"the",
"given",
"constructor",
"(",
"with",
"number",
"of",
"parameters",
"equals",
"the",
"number",
"of",
"columns",
")",
"of",
"type",
"<code",
">",
"T<",
"/",
"code",
">",
"... | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/Util.java#L423-L437 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.createOrUpdate | public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().body();
} | java | public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().body();
} | [
"public",
"PublicIPAddressInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"publicIpAddressName",
",",
"PublicIPAddressInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"publicIpAddress... | Creates or updates a static or dynamic public IP address.
@param resourceGroupName The name of the resource group.
@param publicIpAddressName The name of the public IP address.
@param parameters Parameters supplied to the create or update public IP address operation.
@throws IllegalArgumentException thrown if paramete... | [
"Creates",
"or",
"updates",
"a",
"static",
"or",
"dynamic",
"public",
"IP",
"address",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L464-L466 |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java | OsgiUtils.getFilterForLocation | public static Filter getFilterForLocation(Class<?> clazz, String location) throws IllegalArgumentException {
return getFilterForLocation(clazz, location, ContextHolder.get().getCurrentContextId());
} | java | public static Filter getFilterForLocation(Class<?> clazz, String location) throws IllegalArgumentException {
return getFilterForLocation(clazz, location, ContextHolder.get().getCurrentContextId());
} | [
"public",
"static",
"Filter",
"getFilterForLocation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"location",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"getFilterForLocation",
"(",
"clazz",
",",
"location",
",",
"ContextHolder",
".",
"get"... | returns a filter that matches services with the given class and location in both the current context and the
root-context
@throws IllegalArgumentException if the location contains special characters that prevent the filter from
compiling | [
"returns",
"a",
"filter",
"that",
"matches",
"services",
"with",
"the",
"given",
"class",
"and",
"location",
"in",
"both",
"the",
"current",
"context",
"and",
"the",
"root",
"-",
"context"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java#L53-L55 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/mapping/MappingUtils.java | MappingUtils.getMappingColumn | public static MappingColumn getMappingColumn(final Class<?> entityType, final String camelColumnName) {
return getMappingColumn(entityType, SqlKind.NONE, camelColumnName);
} | java | public static MappingColumn getMappingColumn(final Class<?> entityType, final String camelColumnName) {
return getMappingColumn(entityType, SqlKind.NONE, camelColumnName);
} | [
"public",
"static",
"MappingColumn",
"getMappingColumn",
"(",
"final",
"Class",
"<",
"?",
">",
"entityType",
",",
"final",
"String",
"camelColumnName",
")",
"{",
"return",
"getMappingColumn",
"(",
"entityType",
",",
"SqlKind",
".",
"NONE",
",",
"camelColumnName",
... | カラムマッピング情報取得
@param entityType エンティティ型
@param camelColumnName 取得するカラムのキャメルケース名
@return カラムマッピング情報
@exception UroborosqlRuntimeException 指定したキャメルケースカラム名に該当する{@link MappingColumn}が見つからなかった場合 | [
"カラムマッピング情報取得"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/mapping/MappingUtils.java#L260-L262 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.getLong | public static Long getLong(Map<?, ?> map, Object key) {
return get(map, key, Long.class);
} | java | public static Long getLong(Map<?, ?> map, Object key) {
return get(map, key, Long.class);
} | [
"public",
"static",
"Long",
"getLong",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Object",
"key",
")",
"{",
"return",
"get",
"(",
"map",
",",
"key",
",",
"Long",
".",
"class",
")",
";",
"}"
] | 获取Map指定key的值,并转换为Long
@param map Map
@param key 键
@return 值
@since 4.0.6 | [
"获取Map指定key的值,并转换为Long"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L840-L842 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/csv/CsvFileExtensions.java | CsvFileExtensions.getDataFromLine | public static String[] getDataFromLine(final String line, final String seperator,
final boolean trim)
{
final StringTokenizer tokenizer = new StringTokenizer(line, seperator);
final List<String> data = new ArrayList<>();
while (tokenizer.hasMoreElements())
{
final String string = tokenizer.nextToken();
... | java | public static String[] getDataFromLine(final String line, final String seperator,
final boolean trim)
{
final StringTokenizer tokenizer = new StringTokenizer(line, seperator);
final List<String> data = new ArrayList<>();
while (tokenizer.hasMoreElements())
{
final String string = tokenizer.nextToken();
... | [
"public",
"static",
"String",
"[",
"]",
"getDataFromLine",
"(",
"final",
"String",
"line",
",",
"final",
"String",
"seperator",
",",
"final",
"boolean",
"trim",
")",
"{",
"final",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"line",
",",... | Gets the data from line.
@param line
the line
@param seperator
the seperator
@param trim
the trim
@return the data from line | [
"Gets",
"the",
"data",
"from",
"line",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/csv/CsvFileExtensions.java#L222-L242 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/sort/CSNodeSorter.java | CSNodeSorter.findLastEntry | private static <T extends Node> Map.Entry<CSNodeWrapper, T> findLastEntry(Map<CSNodeWrapper, T> map) {
Map.Entry<CSNodeWrapper, T> nodeEntry = null;
// Find the initial entry
for (final Map.Entry<CSNodeWrapper, T> entry : map.entrySet()) {
if (entry.getKey().getNextNode() == null) {... | java | private static <T extends Node> Map.Entry<CSNodeWrapper, T> findLastEntry(Map<CSNodeWrapper, T> map) {
Map.Entry<CSNodeWrapper, T> nodeEntry = null;
// Find the initial entry
for (final Map.Entry<CSNodeWrapper, T> entry : map.entrySet()) {
if (entry.getKey().getNextNode() == null) {... | [
"private",
"static",
"<",
"T",
"extends",
"Node",
">",
"Map",
".",
"Entry",
"<",
"CSNodeWrapper",
",",
"T",
">",
"findLastEntry",
"(",
"Map",
"<",
"CSNodeWrapper",
",",
"T",
">",
"map",
")",
"{",
"Map",
".",
"Entry",
"<",
"CSNodeWrapper",
",",
"T",
"... | Finds the initial entry for the unordered map.
@param map The unordered map.
@return The initial entry to start sorting the map from. | [
"Finds",
"the",
"initial",
"entry",
"for",
"the",
"unordered",
"map",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/sort/CSNodeSorter.java#L86-L98 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java | GVRTransform.setPosition | public GVRTransform setPosition(float x, float y, float z) {
NativeTransform.setPosition(getNative(), x, y, z);
return this;
} | java | public GVRTransform setPosition(float x, float y, float z) {
NativeTransform.setPosition(getNative(), x, y, z);
return this;
} | [
"public",
"GVRTransform",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"NativeTransform",
".",
"setPosition",
"(",
"getNative",
"(",
")",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"return",
"this",
";",
"}"
] | Set absolute position.
Use {@link #translate(float, float, float)} to <em>move</em> the object.
@param x
'X' component of the absolute position.
@param y
'Y' component of the absolute position.
@param z
'Z' component of the absolute position. | [
"Set",
"absolute",
"position",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java#L91-L94 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/plugins/ws/PluginWSCommons.java | PluginWSCommons.writeUpdateProperties | public static void writeUpdateProperties(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
jsonWriter.prop(PROPERTY_STATUS, toJSon(pluginUpdate.getStatus()));
jsonWriter.name(ARRAY_REQUIRES).beginArray();
Release release = pluginUpdate.getRelease();
for (Plugin child : filter(transform(release.getOut... | java | public static void writeUpdateProperties(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
jsonWriter.prop(PROPERTY_STATUS, toJSon(pluginUpdate.getStatus()));
jsonWriter.name(ARRAY_REQUIRES).beginArray();
Release release = pluginUpdate.getRelease();
for (Plugin child : filter(transform(release.getOut... | [
"public",
"static",
"void",
"writeUpdateProperties",
"(",
"JsonWriter",
"jsonWriter",
",",
"PluginUpdate",
"pluginUpdate",
")",
"{",
"jsonWriter",
".",
"prop",
"(",
"PROPERTY_STATUS",
",",
"toJSon",
"(",
"pluginUpdate",
".",
"getStatus",
"(",
")",
")",
")",
";",... | Write the update properties to the specified jsonwriter.
<pre>
"status": "COMPATIBLE",
"requires": [
{
"key": "java",
"name": "Java",
"description": "SonarQube rule engine."
}
]
</pre> | [
"Write",
"the",
"update",
"properties",
"to",
"the",
"specified",
"jsonwriter",
".",
"<pre",
">",
"status",
":",
"COMPATIBLE",
"requires",
":",
"[",
"{",
"key",
":",
"java",
"name",
":",
"Java",
"description",
":",
"SonarQube",
"rule",
"engine",
".",
"}",
... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/PluginWSCommons.java#L195-L208 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/namespace/NamespaceContextBuilder.java | NamespaceContextBuilder.buildContext | public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) {
SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext();
//first add default namespace definitions
if (namespaceMappings.size() > 0) {
simpleNamespaceContext.... | java | public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) {
SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext();
//first add default namespace definitions
if (namespaceMappings.size() > 0) {
simpleNamespaceContext.... | [
"public",
"NamespaceContext",
"buildContext",
"(",
"Message",
"receivedMessage",
",",
"Map",
"<",
"String",
",",
"String",
">",
"namespaces",
")",
"{",
"SimpleNamespaceContext",
"simpleNamespaceContext",
"=",
"new",
"SimpleNamespaceContext",
"(",
")",
";",
"//first ad... | Construct a basic namespace context from the received message and explicit namespace mappings.
@param receivedMessage the actual message received.
@param namespaces explicit namespace mappings for this construction.
@return the constructed namespace context. | [
"Construct",
"a",
"basic",
"namespace",
"context",
"from",
"the",
"received",
"message",
"and",
"explicit",
"namespace",
"mappings",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/namespace/NamespaceContextBuilder.java#L52-L76 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.requestOidAdd | protected void requestOidAdd (String name, OidList list, int oid)
{
// if we're on the authoritative server, we update the set immediately
boolean applyImmediately = isAuthoritative();
if (applyImmediately) {
list.add(oid);
}
postEvent(new ObjectAddedEvent(_oid, n... | java | protected void requestOidAdd (String name, OidList list, int oid)
{
// if we're on the authoritative server, we update the set immediately
boolean applyImmediately = isAuthoritative();
if (applyImmediately) {
list.add(oid);
}
postEvent(new ObjectAddedEvent(_oid, n... | [
"protected",
"void",
"requestOidAdd",
"(",
"String",
"name",
",",
"OidList",
"list",
",",
"int",
"oid",
")",
"{",
"// if we're on the authoritative server, we update the set immediately",
"boolean",
"applyImmediately",
"=",
"isAuthoritative",
"(",
")",
";",
"if",
"(",
... | Calls by derived instances when an oid adder method was called. | [
"Calls",
"by",
"derived",
"instances",
"when",
"an",
"oid",
"adder",
"method",
"was",
"called",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L851-L859 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.removeAccessControlEntry | public void removeAccessControlEntry(CmsRequestContext context, CmsResource resource, CmsUUID principal)
throws CmsException, CmsSecurityException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkOfflineProject(dbc);
checkPermissions(dbc, resource, C... | java | public void removeAccessControlEntry(CmsRequestContext context, CmsResource resource, CmsUUID principal)
throws CmsException, CmsSecurityException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkOfflineProject(dbc);
checkPermissions(dbc, resource, C... | [
"public",
"void",
"removeAccessControlEntry",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"CmsUUID",
"principal",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDb... | Removes an access control entry for a given resource and principal.<p>
@param context the current request context
@param resource the resource
@param principal the id of the principal to remove the the access control entry for
@throws CmsException if something goes wrong
@throws CmsSecurityException if the user has i... | [
"Removes",
"an",
"access",
"control",
"entry",
"for",
"a",
"given",
"resource",
"and",
"principal",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5548-L5567 |
evernote/android-job | library/src/main/java/com/evernote/android/job/WakeLockUtil.java | WakeLockUtil.startWakefulService | public static ComponentName startWakefulService(Context context, Intent intent) {
synchronized (ACTIVE_WAKE_LOCKS) {
int id = nextId;
nextId++;
if (nextId <= 0) {
nextId = 1;
}
intent.putExtra(EXTRA_WAKE_LOCK_ID, id);
Compo... | java | public static ComponentName startWakefulService(Context context, Intent intent) {
synchronized (ACTIVE_WAKE_LOCKS) {
int id = nextId;
nextId++;
if (nextId <= 0) {
nextId = 1;
}
intent.putExtra(EXTRA_WAKE_LOCK_ID, id);
Compo... | [
"public",
"static",
"ComponentName",
"startWakefulService",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"synchronized",
"(",
"ACTIVE_WAKE_LOCKS",
")",
"{",
"int",
"id",
"=",
"nextId",
";",
"nextId",
"++",
";",
"if",
"(",
"nextId",
"<=",
"0"... | Do a {@link android.content.Context#startService(android.content.Intent)
Context.startService}, but holding a wake lock while the service starts.
This will modify the Intent to hold an extra identifying the wake lock;
when the service receives it in {@link android.app.Service#onStartCommand
Service.onStartCommand}, it ... | [
"Do",
"a",
"{",
"@link",
"android",
".",
"content",
".",
"Context#startService",
"(",
"android",
".",
"content",
".",
"Intent",
")",
"Context",
".",
"startService",
"}",
"but",
"holding",
"a",
"wake",
"lock",
"while",
"the",
"service",
"starts",
".",
"This... | train | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/WakeLockUtil.java#L102-L124 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/ChangedByHandler.java | ChangedByHandler.syncClonedListener | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled)
{
bInitCalled = super.syncClonedListener(field, listener, bInitCalled);
((ChangedByHandler)listener).setMainFilesFieldSeq(m_iMainFilesFieldSeq);
return bInitCalled;
} | java | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled)
{
bInitCalled = super.syncClonedListener(field, listener, bInitCalled);
((ChangedByHandler)listener).setMainFilesFieldSeq(m_iMainFilesFieldSeq);
return bInitCalled;
} | [
"public",
"boolean",
"syncClonedListener",
"(",
"BaseField",
"field",
",",
"FieldListener",
"listener",
",",
"boolean",
"bInitCalled",
")",
"{",
"bInitCalled",
"=",
"super",
".",
"syncClonedListener",
"(",
"field",
",",
"listener",
",",
"bInitCalled",
")",
";",
... | Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return True if I called init. | [
"Set",
"this",
"cloned",
"listener",
"to",
"the",
"same",
"state",
"at",
"this",
"listener",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/ChangedByHandler.java#L76-L81 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/RectangularPrism.java | RectangularPrism.getVertices | @Override
public Point3d[] getVertices() {
double x = 0.5 * width;
double y = 0.5 * height;
double z = 0.5 * length;
Point3d[] vertices = new Point3d[8];
vertices[0] = new Point3d(-x, -y, z);
vertices[1] = new Point3d(-x, y, z);
vertices[2] = new Point3d( x, y, z);
vertices[3] = new Point3d( x, -y... | java | @Override
public Point3d[] getVertices() {
double x = 0.5 * width;
double y = 0.5 * height;
double z = 0.5 * length;
Point3d[] vertices = new Point3d[8];
vertices[0] = new Point3d(-x, -y, z);
vertices[1] = new Point3d(-x, y, z);
vertices[2] = new Point3d( x, y, z);
vertices[3] = new Point3d( x, -y... | [
"@",
"Override",
"public",
"Point3d",
"[",
"]",
"getVertices",
"(",
")",
"{",
"double",
"x",
"=",
"0.5",
"*",
"width",
";",
"double",
"y",
"=",
"0.5",
"*",
"height",
";",
"double",
"z",
"=",
"0.5",
"*",
"length",
";",
"Point3d",
"[",
"]",
"vertices... | Returns the vertices of an n-fold polygon of given radius and center
@param n
@param radius
@param center
@return | [
"Returns",
"the",
"vertices",
"of",
"an",
"n",
"-",
"fold",
"polygon",
"of",
"given",
"radius",
"and",
"center"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/RectangularPrism.java#L90-L106 |
recommenders/rival | rival-examples/src/main/java/net/recommenders/rival/examples/movielens100k/CrossValidatedMahoutKNNRecommenderEvaluator.java | CrossValidatedMahoutKNNRecommenderEvaluator.prepareSplits | public static void prepareSplits(final String url, final int nFolds, final String inFile, final String folder, final String outPath) {
DataDownloader dd = new DataDownloader(url, folder);
dd.downloadAndUnzip();
boolean perUser = true;
long seed = SEED;
Parser<Long, Long> parser ... | java | public static void prepareSplits(final String url, final int nFolds, final String inFile, final String folder, final String outPath) {
DataDownloader dd = new DataDownloader(url, folder);
dd.downloadAndUnzip();
boolean perUser = true;
long seed = SEED;
Parser<Long, Long> parser ... | [
"public",
"static",
"void",
"prepareSplits",
"(",
"final",
"String",
"url",
",",
"final",
"int",
"nFolds",
",",
"final",
"String",
"inFile",
",",
"final",
"String",
"folder",
",",
"final",
"String",
"outPath",
")",
"{",
"DataDownloader",
"dd",
"=",
"new",
... | Downloads a dataset and stores the splits generated from it.
@param url url where dataset can be downloaded from
@param nFolds number of folds
@param inFile file to be used once the dataset has been downloaded
@param folder folder where dataset will be stored
@param outPath path where the splits will be stored | [
"Downloads",
"a",
"dataset",
"and",
"stores",
"the",
"splits",
"generated",
"from",
"it",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-examples/src/main/java/net/recommenders/rival/examples/movielens100k/CrossValidatedMahoutKNNRecommenderEvaluator.java#L109-L147 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.beginObject | public String beginObject() throws IOException {
String name = null;
if (currentValue.getKey() == NAME) {
name = currentValue.getValue().asString();
consume();
}
if (currentValue.getKey() == BEGIN_OBJECT) {
consume();
} else if (readStack.peek() != BEGIN_OBJECT) ... | java | public String beginObject() throws IOException {
String name = null;
if (currentValue.getKey() == NAME) {
name = currentValue.getValue().asString();
consume();
}
if (currentValue.getKey() == BEGIN_OBJECT) {
consume();
} else if (readStack.peek() != BEGIN_OBJECT) ... | [
"public",
"String",
"beginObject",
"(",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"null",
";",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"==",
"NAME",
")",
"{",
"name",
"=",
"currentValue",
".",
"getValue",
"(",
")",
".",
"asS... | Begins the document
@return The object's name
@throws IOException Something went wrong reading | [
"Begins",
"the",
"document"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L140-L152 |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateNode | public Node findOrCreateNode( Session session,
String path,
String nodeType ) throws RepositoryException {
return findOrCreateNode(session, path, nodeType, nodeType);
} | java | public Node findOrCreateNode( Session session,
String path,
String nodeType ) throws RepositoryException {
return findOrCreateNode(session, path, nodeType, nodeType);
} | [
"public",
"Node",
"findOrCreateNode",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"String",
"nodeType",
")",
"throws",
"RepositoryException",
"{",
"return",
"findOrCreateNode",
"(",
"session",
",",
"path",
",",
"nodeType",
",",
"nodeType",
")",
";",
... | Get or create a node at the specified path and node type.
@param session the JCR session. may not be null
@param path the path of the desired node to be found or created. may not be null
@param nodeType the node type. may be null
@return the existing or newly created node
@throws RepositoryException
@throws IllegalArg... | [
"Get",
"or",
"create",
"a",
"node",
"at",
"the",
"specified",
"path",
"and",
"node",
"type",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L354-L358 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/resourceresolver/DefaultResourceResolver.java | DefaultResourceResolver.getResolvedResource | @Nonnull
public static IReadableResource getResolvedResource (@Nullable final String sSystemId,
@Nullable final String sBaseURI)
{
return getResolvedResource (sSystemId, sBaseURI, (ClassLoader) null);
} | java | @Nonnull
public static IReadableResource getResolvedResource (@Nullable final String sSystemId,
@Nullable final String sBaseURI)
{
return getResolvedResource (sSystemId, sBaseURI, (ClassLoader) null);
} | [
"@",
"Nonnull",
"public",
"static",
"IReadableResource",
"getResolvedResource",
"(",
"@",
"Nullable",
"final",
"String",
"sSystemId",
",",
"@",
"Nullable",
"final",
"String",
"sBaseURI",
")",
"{",
"return",
"getResolvedResource",
"(",
"sSystemId",
",",
"sBaseURI",
... | Do the standard resource resolving of sSystemId relative to sBaseURI
@param sSystemId
The resource to search. May be <code>null</code> if base URI is set.
@param sBaseURI
The base URI from where the search is initiated. May be
<code>null</code> if systemId is set.
@return The non-<code>null</code> resource. May be non... | [
"Do",
"the",
"standard",
"resource",
"resolving",
"of",
"sSystemId",
"relative",
"to",
"sBaseURI"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/resourceresolver/DefaultResourceResolver.java#L89-L94 |
carewebframework/carewebframework-core | org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSService.java | JMSService.decorateMessage | public Message decorateMessage(Message message, String sender, String recipients) throws JMSException {
message.setStringProperty("sender", sender);
message.setStringProperty("recipients", StringUtils.isEmpty(recipients) ? null : "," + recipients + ",");
return message;
} | java | public Message decorateMessage(Message message, String sender, String recipients) throws JMSException {
message.setStringProperty("sender", sender);
message.setStringProperty("recipients", StringUtils.isEmpty(recipients) ? null : "," + recipients + ",");
return message;
} | [
"public",
"Message",
"decorateMessage",
"(",
"Message",
"message",
",",
"String",
"sender",
",",
"String",
"recipients",
")",
"throws",
"JMSException",
"{",
"message",
".",
"setStringProperty",
"(",
"\"sender\"",
",",
"sender",
")",
";",
"message",
".",
"setStri... | Given a message, supplement the message with additional properties/attributes.
@param message The message
@param sender Sender client ID.
@param recipients Comma-delimited list of recipient client IDs
@return The decorated Message
@throws JMSException if error thrown setting properties | [
"Given",
"a",
"message",
"supplement",
"the",
"message",
"with",
"additional",
"properties",
"/",
"attributes",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSService.java#L223-L227 |
softindex/datakernel | core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java | ByteBufQueue.drainTo | public int drainTo(@NotNull ByteBuf dest, int maxSize) {
int actualSize = drainTo(dest.array(), dest.tail(), maxSize);
dest.moveTail(actualSize);
return actualSize;
} | java | public int drainTo(@NotNull ByteBuf dest, int maxSize) {
int actualSize = drainTo(dest.array(), dest.tail(), maxSize);
dest.moveTail(actualSize);
return actualSize;
} | [
"public",
"int",
"drainTo",
"(",
"@",
"NotNull",
"ByteBuf",
"dest",
",",
"int",
"maxSize",
")",
"{",
"int",
"actualSize",
"=",
"drainTo",
"(",
"dest",
".",
"array",
"(",
")",
",",
"dest",
".",
"tail",
"(",
")",
",",
"maxSize",
")",
";",
"dest",
"."... | Adds {@code maxSize} bytes from this queue to ByteBuf {@code dest} if
queue contains more than {@code maxSize} bytes. Otherwise adds all
bytes from queue to dest. In both cases increases queue's position to
number of drained bytes.
@param dest {@code ByteBuf} for draining
@param maxSize number of bytes for adding
@... | [
"Adds",
"{",
"@code",
"maxSize",
"}",
"bytes",
"from",
"this",
"queue",
"to",
"ByteBuf",
"{",
"@code",
"dest",
"}",
"if",
"queue",
"contains",
"more",
"than",
"{",
"@code",
"maxSize",
"}",
"bytes",
".",
"Otherwise",
"adds",
"all",
"bytes",
"from",
"queue... | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java#L571-L575 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java | GenericConversionService.canBypassConvert | public boolean canBypassConvert(TypeDescriptor sourceType, TypeDescriptor targetType) {
Assert.notNull(targetType, "The targetType to convert to cannot be null");
if (sourceType == null) {
return true;
}
GenericConverter converter = getConverter(sourceType, targetType);
return (converter == NO_OP_CONVERTER... | java | public boolean canBypassConvert(TypeDescriptor sourceType, TypeDescriptor targetType) {
Assert.notNull(targetType, "The targetType to convert to cannot be null");
if (sourceType == null) {
return true;
}
GenericConverter converter = getConverter(sourceType, targetType);
return (converter == NO_OP_CONVERTER... | [
"public",
"boolean",
"canBypassConvert",
"(",
"TypeDescriptor",
"sourceType",
",",
"TypeDescriptor",
"targetType",
")",
"{",
"Assert",
".",
"notNull",
"(",
"targetType",
",",
"\"The targetType to convert to cannot be null\"",
")",
";",
"if",
"(",
"sourceType",
"==",
"... | Returns true if conversion between the sourceType and targetType can be bypassed.
More precisely this method will return true if objects of sourceType can be
converted to the targetType by returning the source object unchanged.
@param sourceType context about the source type to convert from (may be null if source is nu... | [
"Returns",
"true",
"if",
"conversion",
"between",
"the",
"sourceType",
"and",
"targetType",
"can",
"be",
"bypassed",
".",
"More",
"precisely",
"this",
"method",
"will",
"return",
"true",
"if",
"objects",
"of",
"sourceType",
"can",
"be",
"converted",
"to",
"the... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java#L140-L147 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java | DataServiceVisitorJsBuilder.writeArgumentsComment | void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException {
while(argumentsType.hasNext()) {
String type = argumentsType.next();
String name = argumentsName.next();
writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).a... | java | void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException {
while(argumentsType.hasNext()) {
String type = argumentsType.next();
String name = argumentsName.next();
writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).a... | [
"void",
"writeArgumentsComment",
"(",
"Iterator",
"<",
"String",
">",
"argumentsType",
",",
"Iterator",
"<",
"String",
">",
"argumentsName",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"while",
"(",
"argumentsType",
".",
"hasNext",
"(",
")",
")... | write js documentation for arguments
@param argumentsType
@param argumentsName
@param writer
@throws IOException | [
"write",
"js",
"documentation",
"for",
"arguments"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java#L141-L147 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Annotations.java | Annotations.inRange | public static boolean inRange(Range range, double val) {
return val >= range.min() && val <= range.max();
} | java | public static boolean inRange(Range range, double val) {
return val >= range.min() && val <= range.max();
} | [
"public",
"static",
"boolean",
"inRange",
"(",
"Range",
"range",
",",
"double",
"val",
")",
"{",
"return",
"val",
">=",
"range",
".",
"min",
"(",
")",
"&&",
"val",
"<=",
"range",
".",
"max",
"(",
")",
";",
"}"
] | Check if a certain value is in range
@param range range info
@param val the value to check;
@return true if it is in range, false otherwise. | [
"Check",
"if",
"a",
"certain",
"value",
"is",
"in",
"range"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Annotations.java#L87-L89 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java | MapTilePathModel.isTileNotAvailable | private boolean isTileNotAvailable(Pathfindable mover, int ctx, int cty, Integer ignoreObjectId)
{
final Collection<Integer> ids = getObjectsId(ctx, cty);
final Tile tile = map.getTile(ctx, cty);
if (tile != null)
{
final TilePath tilePath = tile.getFeature(TilePath.class... | java | private boolean isTileNotAvailable(Pathfindable mover, int ctx, int cty, Integer ignoreObjectId)
{
final Collection<Integer> ids = getObjectsId(ctx, cty);
final Tile tile = map.getTile(ctx, cty);
if (tile != null)
{
final TilePath tilePath = tile.getFeature(TilePath.class... | [
"private",
"boolean",
"isTileNotAvailable",
"(",
"Pathfindable",
"mover",
",",
"int",
"ctx",
",",
"int",
"cty",
",",
"Integer",
"ignoreObjectId",
")",
"{",
"final",
"Collection",
"<",
"Integer",
">",
"ids",
"=",
"getObjectsId",
"(",
"ctx",
",",
"cty",
")",
... | Check if area if used.
@param mover The object moving on map.
@param ctx The horizontal tile index.
@param cty The vertical tile index.
@param ignoreObjectId The object ID to ignore.
@return <code>true</code> if area is used, <code>false</code> else. | [
"Check",
"if",
"area",
"if",
"used",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java#L84-L98 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/comparator/CompoundComparator.java | CompoundComparator.setComparator | public void setComparator(int index, Comparator<T> comparator) {
if (comparator instanceof InvertibleComparator) {
this.comparators.set(index, (InvertibleComparator<T>) comparator);
}
else {
this.comparators.set(index, new InvertibleComparator<T>(comparator));
}
} | java | public void setComparator(int index, Comparator<T> comparator) {
if (comparator instanceof InvertibleComparator) {
this.comparators.set(index, (InvertibleComparator<T>) comparator);
}
else {
this.comparators.set(index, new InvertibleComparator<T>(comparator));
}
} | [
"public",
"void",
"setComparator",
"(",
"int",
"index",
",",
"Comparator",
"<",
"T",
">",
"comparator",
")",
"{",
"if",
"(",
"comparator",
"instanceof",
"InvertibleComparator",
")",
"{",
"this",
".",
"comparators",
".",
"set",
"(",
"index",
",",
"(",
"Inve... | Replace the Comparator at the given index.
<p>The Comparator will default to ascending sort order,
unless it is a InvertibleComparator.
@param index the index of the Comparator to replace
@param comparator the Comparator to place at the given index
@see InvertibleComparator | [
"Replace",
"the",
"Comparator",
"at",
"the",
"given",
"index",
".",
"<p",
">",
"The",
"Comparator",
"will",
"default",
"to",
"ascending",
"sort",
"order",
"unless",
"it",
"is",
"a",
"InvertibleComparator",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/comparator/CompoundComparator.java#L105-L112 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.triangulateNView | public static TriangulateNViewsProjective triangulateNView( @Nullable ConfigTriangulation config ) {
if( config == null )
config = new ConfigTriangulation();
switch( config.type) {
case DLT:
return new WrapNViewsTriangulateProjectiveDLT();
case ALGEBRAIC:
case GEOMETRIC: {
TriangulateNViewsPro... | java | public static TriangulateNViewsProjective triangulateNView( @Nullable ConfigTriangulation config ) {
if( config == null )
config = new ConfigTriangulation();
switch( config.type) {
case DLT:
return new WrapNViewsTriangulateProjectiveDLT();
case ALGEBRAIC:
case GEOMETRIC: {
TriangulateNViewsPro... | [
"public",
"static",
"TriangulateNViewsProjective",
"triangulateNView",
"(",
"@",
"Nullable",
"ConfigTriangulation",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"new",
"ConfigTriangulation",
"(",
")",
";",
"switch",
"(",
"config",
"... | Triangulate N views using the Discrete Linear Transform (DLT) with an uncalibrated camera
@see TriangulateProjectiveLinearDLT
@return Two view triangulation algorithm | [
"Triangulate",
"N",
"views",
"using",
"the",
"Discrete",
"Linear",
"Transform",
"(",
"DLT",
")",
"with",
"an",
"uncalibrated",
"camera"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L610-L626 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java | Option.hasMoreFlags | private static boolean hasMoreFlags(String[] args, int start, Option[] templates) {
for (int i = start; i < args.length; i++) {
Option template = findTemplate(args[i], templates);
if (((template == null) || (!Type.LIST.equals(template.getType())))) {
return true;
... | java | private static boolean hasMoreFlags(String[] args, int start, Option[] templates) {
for (int i = start; i < args.length; i++) {
Option template = findTemplate(args[i], templates);
if (((template == null) || (!Type.LIST.equals(template.getType())))) {
return true;
... | [
"private",
"static",
"boolean",
"hasMoreFlags",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"start",
",",
"Option",
"[",
"]",
"templates",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",
... | Determines if a String array representation of option names contains an option whose name matches a FLAG_TYPE option in the supplied array of
Option templates. The search starts from the supplied starting index and ends with the last element in <code>args[]</code>
@param args A String array containing option n... | [
"Determines",
"if",
"a",
"String",
"array",
"representation",
"of",
"option",
"names",
"contains",
"an",
"option",
"whose",
"name",
"matches",
"a",
"FLAG_TYPE",
"option",
"in",
"the",
"supplied",
"array",
"of",
"Option",
"templates",
".",
"The",
"search",
"sta... | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Option.java#L263-L276 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/ResourceUtils.java | ResourceUtils.findInstanceResourcesDirectory | public static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ) {
return findInstanceResourcesDirectory( applicationFilesDirectory, instance.getComponent());
} | java | public static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ) {
return findInstanceResourcesDirectory( applicationFilesDirectory, instance.getComponent());
} | [
"public",
"static",
"File",
"findInstanceResourcesDirectory",
"(",
"File",
"applicationFilesDirectory",
",",
"Instance",
"instance",
")",
"{",
"return",
"findInstanceResourcesDirectory",
"(",
"applicationFilesDirectory",
",",
"instance",
".",
"getComponent",
"(",
")",
")"... | Finds the resource directory for an instance.
@param applicationFilesDirectory the application's directory
@param instance an instance
@return a non-null file (that may not exist) | [
"Finds",
"the",
"resource",
"directory",
"for",
"an",
"instance",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ResourceUtils.java#L116-L118 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectory.java | ServiceDirectory.setUser | public static void setUser(String userName, String password){
getImpl().getDirectoryServiceClient().setUser(userName, password);
} | java | public static void setUser(String userName, String password){
getImpl().getDirectoryServiceClient().setUser(userName, password);
} | [
"public",
"static",
"void",
"setUser",
"(",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"getImpl",
"(",
")",
".",
"getDirectoryServiceClient",
"(",
")",
".",
"setUser",
"(",
"userName",
",",
"password",
")",
";",
"}"
] | Set the Directory User.
@param userName
the user name.
@param password
the password of the user.
@throws ServiceException | [
"Set",
"the",
"Directory",
"User",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectory.java#L124-L126 |
Azure/azure-sdk-for-java | dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java | RecordSetsInner.listByDnsZoneAsync | public Observable<Page<RecordSetInner>> listByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordsetnamesuffix) {
return listByDnsZoneWithServiceResponseAsync(resourceGroupName, zoneName, top, recordsetnamesuffix)
.map(new Func1<ServiceResponse<... | java | public Observable<Page<RecordSetInner>> listByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordsetnamesuffix) {
return listByDnsZoneWithServiceResponseAsync(resourceGroupName, zoneName, top, recordsetnamesuffix)
.map(new Func1<ServiceResponse<... | [
"public",
"Observable",
"<",
"Page",
"<",
"RecordSetInner",
">",
">",
"listByDnsZoneAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"zoneName",
",",
"final",
"Integer",
"top",
",",
"final",
"String",
"recordsetnamesuffix",
")",
"{",
... | Lists all record sets in a DNS zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param top The maximum number of record sets to return. If not specified, returns up to 100 record sets.
@param recordsetnamesuffix The suffix label of the... | [
"Lists",
"all",
"record",
"sets",
"in",
"a",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java#L1271-L1279 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/tree/gbm/GBMModel.java | GBMModel.score0 | @Override protected double[] score0(double data[/*ncols*/], double preds[/*nclasses+1*/], double offset, int ntrees) {
super.score0(data, preds, offset, ntrees); // These are f_k(x) in Algorithm 10.4
return score0Probabilities(preds, offset);
} | java | @Override protected double[] score0(double data[/*ncols*/], double preds[/*nclasses+1*/], double offset, int ntrees) {
super.score0(data, preds, offset, ntrees); // These are f_k(x) in Algorithm 10.4
return score0Probabilities(preds, offset);
} | [
"@",
"Override",
"protected",
"double",
"[",
"]",
"score0",
"(",
"double",
"data",
"[",
"/*ncols*/",
"]",
",",
"double",
"preds",
"[",
"/*nclasses+1*/",
"]",
",",
"double",
"offset",
",",
"int",
"ntrees",
")",
"{",
"super",
".",
"score0",
"(",
"data",
... | Bulk scoring API for one row. Chunks are all compatible with the model,
and expect the last Chunks are for the final distribution and prediction.
Default method is to just load the data into the tmp array, then call
subclass scoring logic. | [
"Bulk",
"scoring",
"API",
"for",
"one",
"row",
".",
"Chunks",
"are",
"all",
"compatible",
"with",
"the",
"model",
"and",
"expect",
"the",
"last",
"Chunks",
"are",
"for",
"the",
"final",
"distribution",
"and",
"prediction",
".",
"Default",
"method",
"is",
"... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/gbm/GBMModel.java#L264-L267 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/permission/SharedObjectPermissionSet.java | SharedObjectPermissionSet.getPermissions | private static Set<ObjectPermission> getPermissions(Collection<String> identifiers) {
// Include one READ permission for each of the given identifiers
Set<ObjectPermission> permissions = new HashSet<ObjectPermission>();
for (String identifier : identifiers)
permissions.add(new Objec... | java | private static Set<ObjectPermission> getPermissions(Collection<String> identifiers) {
// Include one READ permission for each of the given identifiers
Set<ObjectPermission> permissions = new HashSet<ObjectPermission>();
for (String identifier : identifiers)
permissions.add(new Objec... | [
"private",
"static",
"Set",
"<",
"ObjectPermission",
">",
"getPermissions",
"(",
"Collection",
"<",
"String",
">",
"identifiers",
")",
"{",
"// Include one READ permission for each of the given identifiers",
"Set",
"<",
"ObjectPermission",
">",
"permissions",
"=",
"new",
... | Returns a new Set of ObjectPermissions defining READ access for each of
the given identifiers.
@param identifiers
The identifiers of the objects for which READ permission should be
granted.
@return
A new Set of ObjectPermissions granting READ access for each of the
given identifiers. | [
"Returns",
"a",
"new",
"Set",
"of",
"ObjectPermissions",
"defining",
"READ",
"access",
"for",
"each",
"of",
"the",
"given",
"identifiers",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/permission/SharedObjectPermissionSet.java#L46-L70 |
alipay/sofa-rpc | core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java | AbstractCluster.resolveTimeout | private int resolveTimeout(SofaRequest request, ConsumerConfig consumerConfig, ProviderInfo providerInfo) {
// 先去调用级别配置
Integer timeout = request.getTimeout();
if (timeout == null) {
// 取客户端配置(先方法级别再接口级别)
timeout = consumerConfig.getMethodTimeout(request.getMethodName());... | java | private int resolveTimeout(SofaRequest request, ConsumerConfig consumerConfig, ProviderInfo providerInfo) {
// 先去调用级别配置
Integer timeout = request.getTimeout();
if (timeout == null) {
// 取客户端配置(先方法级别再接口级别)
timeout = consumerConfig.getMethodTimeout(request.getMethodName());... | [
"private",
"int",
"resolveTimeout",
"(",
"SofaRequest",
"request",
",",
"ConsumerConfig",
"consumerConfig",
",",
"ProviderInfo",
"providerInfo",
")",
"{",
"// 先去调用级别配置",
"Integer",
"timeout",
"=",
"request",
".",
"getTimeout",
"(",
")",
";",
"if",
"(",
"timeout",
... | 决定超时时间
@param request 请求
@param consumerConfig 客户端配置
@param providerInfo 服务提供者信息
@return 调用超时 | [
"决定超时时间"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java#L589-L605 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java | MarkdownParser.handleRawText | private void handleRawText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
while (true) {
BasicUrl url = findUrl(cursor, limit);
if (url != null) {
String link = cursor.text.substring(url.getStart(), url.getEnd());
// Handling text before url ... | java | private void handleRawText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
while (true) {
BasicUrl url = findUrl(cursor, limit);
if (url != null) {
String link = cursor.text.substring(url.getStart(), url.getEnd());
// Handling text before url ... | [
"private",
"void",
"handleRawText",
"(",
"TextCursor",
"cursor",
",",
"int",
"limit",
",",
"ArrayList",
"<",
"MDText",
">",
"elements",
")",
"{",
"while",
"(",
"true",
")",
"{",
"BasicUrl",
"url",
"=",
"findUrl",
"(",
"cursor",
",",
"limit",
")",
";",
... | Handling raw text block
@param cursor text cursor
@param limit text end
@param elements current elements | [
"Handling",
"raw",
"text",
"block"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java#L189-L211 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.notNaN | public static void notNaN(final double value, final String message, final Object... values) {
if (Double.isNaN(value)) {
throw new IllegalArgumentException(StringUtils.simpleFormat(message, values));
}
} | java | public static void notNaN(final double value, final String message, final Object... values) {
if (Double.isNaN(value)) {
throw new IllegalArgumentException(StringUtils.simpleFormat(message, values));
}
} | [
"public",
"static",
"void",
"notNaN",
"(",
"final",
"double",
"value",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | <p>Validates that the specified argument is not {@code NaN}; otherwise
throwing an exception with the specified message.</p>
<pre>Validate.notNaN(myDouble, "The value must be a number");</pre>
@param value the value to validate
@param message the {@link String#format(String, Object...)} exception message if invalid... | [
"<p",
">",
"Validates",
"that",
"the",
"specified",
"argument",
"is",
"not",
"{",
"@code",
"NaN",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L924-L928 |
plume-lib/options | src/main/java/org/plumelib/options/OptionsDoclet.java | OptionsDoclet.optionsToJavadoc | public String optionsToJavadoc(int padding, int refillWidth) {
StringJoiner b = new StringJoiner(lineSep);
Scanner s = new Scanner(optionsToHtml(refillWidth - padding - 2));
while (s.hasNextLine()) {
String line = s.nextLine();
StringBuilder bb = new StringBuilder();
bb.append(StringUtils... | java | public String optionsToJavadoc(int padding, int refillWidth) {
StringJoiner b = new StringJoiner(lineSep);
Scanner s = new Scanner(optionsToHtml(refillWidth - padding - 2));
while (s.hasNextLine()) {
String line = s.nextLine();
StringBuilder bb = new StringBuilder();
bb.append(StringUtils... | [
"public",
"String",
"optionsToJavadoc",
"(",
"int",
"padding",
",",
"int",
"refillWidth",
")",
"{",
"StringJoiner",
"b",
"=",
"new",
"StringJoiner",
"(",
"lineSep",
")",
";",
"Scanner",
"s",
"=",
"new",
"Scanner",
"(",
"optionsToHtml",
"(",
"refillWidth",
"-... | Get the HTML documentation for the underlying Options instance, formatted as a Javadoc comment.
@param padding the number of leading spaces to add in the Javadoc output, before "* "
@param refillWidth the number of columns to fit the text into, by breaking lines
@return the HTML documentation for the underlying Option... | [
"Get",
"the",
"HTML",
"documentation",
"for",
"the",
"underlying",
"Options",
"instance",
"formatted",
"as",
"a",
"Javadoc",
"comment",
"."
] | train | https://github.com/plume-lib/options/blob/1bdd0ac7a1794bdf9dd373e279f69d43395154f0/src/main/java/org/plumelib/options/OptionsDoclet.java#L677-L694 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/MapFuncSup.java | MapFuncSup.forEach | @SuppressWarnings("unchecked")
public <R> R forEach(VFunc3<K, V, IteratorInfo<R>> func) {
return (R) forEach(Style.$(func));
} | java | @SuppressWarnings("unchecked")
public <R> R forEach(VFunc3<K, V, IteratorInfo<R>> func) {
return (R) forEach(Style.$(func));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"R",
">",
"R",
"forEach",
"(",
"VFunc3",
"<",
"K",
",",
"V",
",",
"IteratorInfo",
"<",
"R",
">",
">",
"func",
")",
"{",
"return",
"(",
"R",
")",
"forEach",
"(",
"Style",
".",
"$",
... | define a function to deal with each entry in the map
@param func a function takes in each entry from map and iterator
info
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Style/">tutorial</a> for
more info about 'last loop value' | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"entry",
"in",
"the",
"map"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/MapFuncSup.java#L52-L55 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getMirage | public Mirage getMirage (ImageKey key, Rectangle bounds)
{
return getMirage(key, bounds, null);
} | java | public Mirage getMirage (ImageKey key, Rectangle bounds)
{
return getMirage(key, bounds, null);
} | [
"public",
"Mirage",
"getMirage",
"(",
"ImageKey",
"key",
",",
"Rectangle",
"bounds",
")",
"{",
"return",
"getMirage",
"(",
"key",
",",
"bounds",
",",
"null",
")",
";",
"}"
] | Like {@link #getMirage(ImageKey)} but that only the specified subimage of the source image
is used to build the mirage. | [
"Like",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L338-L341 |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java | AllureReportUtils.createDirectory | public static File createDirectory(File parent, String name) {
File created = new File(parent, name);
checkDirectory(created);
return created;
} | java | public static File createDirectory(File parent, String name) {
File created = new File(parent, name);
checkDirectory(created);
return created;
} | [
"public",
"static",
"File",
"createDirectory",
"(",
"File",
"parent",
",",
"String",
"name",
")",
"{",
"File",
"created",
"=",
"new",
"File",
"(",
"parent",
",",
"name",
")",
";",
"checkDirectory",
"(",
"created",
")",
";",
"return",
"created",
";",
"}"
... | Create directory with given name in specified directory. Check created directory using
{@link #checkDirectory(java.io.File)}
@param parent specified parent directory
@param name given name for directory to create
@return created directory
@throws ReportGenerationException if can't create specified directory | [
"Create",
"directory",
"with",
"given",
"name",
"in",
"specified",
"directory",
".",
"Check",
"created",
"directory",
"using",
"{",
"@link",
"#checkDirectory",
"(",
"java",
".",
"io",
".",
"File",
")",
"}"
] | train | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java#L38-L42 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_migration_offers_POST | public OvhAsyncTask<OvhMigrationOfferResponse> packName_migration_offers_POST(String packName) throws IOException {
String qPath = "/pack/xdsl/{packName}/migration/offers";
StringBuilder sb = path(qPath, packName);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, t11);
} | java | public OvhAsyncTask<OvhMigrationOfferResponse> packName_migration_offers_POST(String packName) throws IOException {
String qPath = "/pack/xdsl/{packName}/migration/offers";
StringBuilder sb = path(qPath, packName);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, t11);
} | [
"public",
"OvhAsyncTask",
"<",
"OvhMigrationOfferResponse",
">",
"packName_migration_offers_POST",
"(",
"String",
"packName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/migration/offers\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Get the possibilities of migration offers available
REST: POST /pack/xdsl/{packName}/migration/offers
@param packName [required] The internal name of your pack | [
"Get",
"the",
"possibilities",
"of",
"migration",
"offers",
"available"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L957-L962 |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/mml/MathDoc.java | MathDoc.highlightConsecutiveIdentifiers | public void highlightConsecutiveIdentifiers(List<Integer> hashes, boolean backward) {
final int startPos = highlightFirstIdentifier(hashes.get(0), backward);
if (startPos >= 0) {
highlightRemainingIdentifiers(hashes.subList(1, hashes.size()), startPos);
}
} | java | public void highlightConsecutiveIdentifiers(List<Integer> hashes, boolean backward) {
final int startPos = highlightFirstIdentifier(hashes.get(0), backward);
if (startPos >= 0) {
highlightRemainingIdentifiers(hashes.subList(1, hashes.size()), startPos);
}
} | [
"public",
"void",
"highlightConsecutiveIdentifiers",
"(",
"List",
"<",
"Integer",
">",
"hashes",
",",
"boolean",
"backward",
")",
"{",
"final",
"int",
"startPos",
"=",
"highlightFirstIdentifier",
"(",
"hashes",
".",
"get",
"(",
"0",
")",
",",
"backward",
")",
... | Highlights consecutive occurrences of identifiers.
@param hashes list of content identifier hashes to highlight
@param backward if true the first identifier is searched from the end of the expression | [
"Highlights",
"consecutive",
"occurrences",
"of",
"identifiers",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/mml/MathDoc.java#L290-L295 |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java | PermissionController.hasPanelAccess | private boolean hasPanelAccess(Panel panel, DelfoiAction action, UserRole userRole) {
return panelUserRoleActionDAO.hasPanelActionAccess(panel, userRole, action);
} | java | private boolean hasPanelAccess(Panel panel, DelfoiAction action, UserRole userRole) {
return panelUserRoleActionDAO.hasPanelActionAccess(panel, userRole, action);
} | [
"private",
"boolean",
"hasPanelAccess",
"(",
"Panel",
"panel",
",",
"DelfoiAction",
"action",
",",
"UserRole",
"userRole",
")",
"{",
"return",
"panelUserRoleActionDAO",
".",
"hasPanelActionAccess",
"(",
"panel",
",",
"userRole",
",",
"action",
")",
";",
"}"
] | Returns whether user role required action access
@param panel panel
@param action action
@param userRole role
@return whether user role required action access | [
"Returns",
"whether",
"user",
"role",
"required",
"action",
"access"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L188-L190 |
google/closure-compiler | src/com/google/javascript/jscomp/deps/DepsFileParser.java | DepsFileParser.parseFile | public List<DependencyInfo> parseFile(String filePath) throws IOException {
return parseFileReader(filePath, Files.newReader(new File(filePath), StandardCharsets.UTF_8));
} | java | public List<DependencyInfo> parseFile(String filePath) throws IOException {
return parseFileReader(filePath, Files.newReader(new File(filePath), StandardCharsets.UTF_8));
} | [
"public",
"List",
"<",
"DependencyInfo",
">",
"parseFile",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"return",
"parseFileReader",
"(",
"filePath",
",",
"Files",
".",
"newReader",
"(",
"new",
"File",
"(",
"filePath",
")",
",",
"StandardChars... | Parses the given file and returns a list of dependency information that it
contained.
@param filePath Path to the file to parse.
@return A list of DependencyInfo objects.
@throws IOException Thrown if the file could not be read. | [
"Parses",
"the",
"given",
"file",
"and",
"returns",
"a",
"list",
"of",
"dependency",
"information",
"that",
"it",
"contained",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsFileParser.java#L105-L107 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java | GenomicsFactory.fromCredential | public <T extends AbstractGoogleJsonClient.Builder> T fromCredential(T builder, Credential credential) {
Preconditions.checkNotNull(builder);
Preconditions.checkNotNull(credential);
return prepareBuilder(builder, credential, null);
} | java | public <T extends AbstractGoogleJsonClient.Builder> T fromCredential(T builder, Credential credential) {
Preconditions.checkNotNull(builder);
Preconditions.checkNotNull(credential);
return prepareBuilder(builder, credential, null);
} | [
"public",
"<",
"T",
"extends",
"AbstractGoogleJsonClient",
".",
"Builder",
">",
"T",
"fromCredential",
"(",
"T",
"builder",
",",
"Credential",
"credential",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"builder",
")",
";",
"Preconditions",
".",
"checkNot... | Prepare an AbstractGoogleJsonClient.Builder using a credential.
@param builder The builder to be prepared.
@param credential The credential to be used for requests.
@return The passed in builder, for easy chaining. | [
"Prepare",
"an",
"AbstractGoogleJsonClient",
".",
"Builder",
"using",
"a",
"credential",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java#L405-L409 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java | NNStorage.isPreferred | static boolean isPreferred(StorageLocationType type, StorageDirectory sd) {
if ((sd instanceof NNStorageDirectory)) {
return ((NNStorageDirectory) sd).type == type;
}
// by default all are preferred
return true;
} | java | static boolean isPreferred(StorageLocationType type, StorageDirectory sd) {
if ((sd instanceof NNStorageDirectory)) {
return ((NNStorageDirectory) sd).type == type;
}
// by default all are preferred
return true;
} | [
"static",
"boolean",
"isPreferred",
"(",
"StorageLocationType",
"type",
",",
"StorageDirectory",
"sd",
")",
"{",
"if",
"(",
"(",
"sd",
"instanceof",
"NNStorageDirectory",
")",
")",
"{",
"return",
"(",
"(",
"NNStorageDirectory",
")",
"sd",
")",
".",
"type",
"... | Checks if we have information about this directory
that it is preferred.
@param type preferred type
@param sd storage directory | [
"Checks",
"if",
"we",
"have",
"information",
"about",
"this",
"directory",
"that",
"it",
"is",
"preferred",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L818-L824 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/storage/FormUploader.java | FormUploader.syncUpload | public static ResponseInfo syncUpload(Client client, Configuration config, byte[] data, String key, UpToken token, UploadOptions options) {
try {
return syncUpload0(client, config, data, null, key, token, options);
} catch (Exception e) {
return ResponseInfo.create(null, Respons... | java | public static ResponseInfo syncUpload(Client client, Configuration config, byte[] data, String key, UpToken token, UploadOptions options) {
try {
return syncUpload0(client, config, data, null, key, token, options);
} catch (Exception e) {
return ResponseInfo.create(null, Respons... | [
"public",
"static",
"ResponseInfo",
"syncUpload",
"(",
"Client",
"client",
",",
"Configuration",
"config",
",",
"byte",
"[",
"]",
"data",
",",
"String",
"key",
",",
"UpToken",
"token",
",",
"UploadOptions",
"options",
")",
"{",
"try",
"{",
"return",
"syncUpl... | 上传数据,并以指定的key保存文件
@param client HTTP连接管理器
@param data 上传的数据
@param key 上传的数据保存的文件名
@param token 上传凭证
@param options 上传时的可选参数
@return 响应信息 ResponseInfo#response 响应体,序列化后 json 格式 | [
"上传数据,并以指定的key保存文件"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/storage/FormUploader.java#L174-L182 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.updateServerProperties | public MetadataEnvelope updateServerProperties(String did, Object deviceProperties) throws ApiException {
ApiResponse<MetadataEnvelope> resp = updateServerPropertiesWithHttpInfo(did, deviceProperties);
return resp.getData();
} | java | public MetadataEnvelope updateServerProperties(String did, Object deviceProperties) throws ApiException {
ApiResponse<MetadataEnvelope> resp = updateServerPropertiesWithHttpInfo(did, deviceProperties);
return resp.getData();
} | [
"public",
"MetadataEnvelope",
"updateServerProperties",
"(",
"String",
"did",
",",
"Object",
"deviceProperties",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"MetadataEnvelope",
">",
"resp",
"=",
"updateServerPropertiesWithHttpInfo",
"(",
"did",
",",
"deviceP... | Updates a device's server properties.
Updates a device's server properties.
@param did Device ID. (required)
@param deviceProperties Device properties object to be set (required)
@return MetadataEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Updates",
"a",
"device'",
";",
"s",
"server",
"properties",
".",
"Updates",
"a",
"device'",
";",
"s",
"server",
"properties",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L1681-L1684 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.queryBean | public static <T> T queryBean(String sql, Class<T> beanType, Object[] params)
throws YankSQLException {
return queryBean(YankPoolManager.DEFAULT_POOL_NAME, sql, beanType, params);
} | java | public static <T> T queryBean(String sql, Class<T> beanType, Object[] params)
throws YankSQLException {
return queryBean(YankPoolManager.DEFAULT_POOL_NAME, sql, beanType, params);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"queryBean",
"(",
"String",
"sql",
",",
"Class",
"<",
"T",
">",
"beanType",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"YankSQLException",
"{",
"return",
"queryBean",
"(",
"YankPoolManager",
".",
"DEFAULT_POOL... | Return just one Bean given an SQL statement. If more than one row match the query, only the
first row is returned using the default connection pool.
@param sql The SQL statement
@param params The replacement parameters
@param beanType The Class of the desired return Object matching the table
@return The Object | [
"Return",
"just",
"one",
"Bean",
"given",
"an",
"SQL",
"statement",
".",
"If",
"more",
"than",
"one",
"row",
"match",
"the",
"query",
"only",
"the",
"first",
"row",
"is",
"returned",
"using",
"the",
"default",
"connection",
"pool",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L379-L383 |
zanata/openprops | src/main/java/org/fedorahosted/openprops/Properties.java | Properties.setComment | public void setComment(String key, String comment) {
if (comment == null)
throw new NullPointerException();
setRawComment(key, uncookComment(comment));
} | java | public void setComment(String key, String comment) {
if (comment == null)
throw new NullPointerException();
setRawComment(key, uncookComment(comment));
} | [
"public",
"void",
"setComment",
"(",
"String",
"key",
",",
"String",
"comment",
")",
"{",
"if",
"(",
"comment",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"setRawComment",
"(",
"key",
",",
"uncookComment",
"(",
"comment",
")"... | Sets the comment for the specified key. Each line of the comment
will be preceded by the comment marker "#", and leading and
trailing whitespace will not be preserved.
<br>
Note: if you set a comment, you must set a corresponding value before
calling store or storeToXML.
@param key property key whose comment should b... | [
"Sets",
"the",
"comment",
"for",
"the",
"specified",
"key",
".",
"Each",
"line",
"of",
"the",
"comment",
"will",
"be",
"preceded",
"by",
"the",
"comment",
"marker",
"#",
"and",
"leading",
"and",
"trailing",
"whitespace",
"will",
"not",
"be",
"preserved",
"... | train | https://github.com/zanata/openprops/blob/46510e610a765e4a91b302fc0d6a2123ed589603/src/main/java/org/fedorahosted/openprops/Properties.java#L1276-L1280 |
alkacon/opencms-core | src/org/opencms/db/CmsPublishList.java | CmsPublishList.checkContainsSubResources | protected CmsResource checkContainsSubResources(CmsObject cms, List<CmsResource> folders) throws CmsException {
for (CmsResource folder : folders) {
if (!containsSubResources(cms, folder)) {
return folder;
}
}
return null;
} | java | protected CmsResource checkContainsSubResources(CmsObject cms, List<CmsResource> folders) throws CmsException {
for (CmsResource folder : folders) {
if (!containsSubResources(cms, folder)) {
return folder;
}
}
return null;
} | [
"protected",
"CmsResource",
"checkContainsSubResources",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"folders",
")",
"throws",
"CmsException",
"{",
"for",
"(",
"CmsResource",
"folder",
":",
"folders",
")",
"{",
"if",
"(",
"!",
"containsSubReso... | Checks whether the publish list contains all sub-resources of a list of folders.<p>
@param cms the current CMS context
@param folders the folders which should be checked
@return a folder from the list if one of its sub-resources is not contained in the publish list, otherwise null
@throws CmsException if something go... | [
"Checks",
"whether",
"the",
"publish",
"list",
"contains",
"all",
"sub",
"-",
"resources",
"of",
"a",
"list",
"of",
"folders",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsPublishList.java#L594-L603 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java | SLINK.step2 | private void step2(DBIDRef id, DBIDArrayIter it, int n, DistanceQuery<? super O> distQuery, WritableDoubleDataStore m) {
for(it.seek(0); it.getOffset() < n; it.advance()) {
// M(i) = dist(i, n+1)
m.putDouble(it, distQuery.distance(it, id));
}
} | java | private void step2(DBIDRef id, DBIDArrayIter it, int n, DistanceQuery<? super O> distQuery, WritableDoubleDataStore m) {
for(it.seek(0); it.getOffset() < n; it.advance()) {
// M(i) = dist(i, n+1)
m.putDouble(it, distQuery.distance(it, id));
}
} | [
"private",
"void",
"step2",
"(",
"DBIDRef",
"id",
",",
"DBIDArrayIter",
"it",
",",
"int",
"n",
",",
"DistanceQuery",
"<",
"?",
"super",
"O",
">",
"distQuery",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"for",
"(",
"it",
".",
"seek",
"(",
"0",
")",
... | Second step: Determine the pairwise distances from all objects in the
pointer representation to the new object with the specified id.
@param id the id of the object to be inserted into the pointer
representation
@param it Array iterator
@param n Last object
@param distQuery Distance query
@param m Data store | [
"Second",
"step",
":",
"Determine",
"the",
"pairwise",
"distances",
"from",
"all",
"objects",
"in",
"the",
"pointer",
"representation",
"to",
"the",
"new",
"object",
"with",
"the",
"specified",
"id",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java#L162-L167 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java | Instance.setTags | public Operation setTags(Iterable<String> tags, OperationOption... options) {
return setTags(getTags().toBuilder().setValues(tags).build(), options);
} | java | public Operation setTags(Iterable<String> tags, OperationOption... options) {
return setTags(getTags().toBuilder().setValues(tags).build(), options);
} | [
"public",
"Operation",
"setTags",
"(",
"Iterable",
"<",
"String",
">",
"tags",
",",
"OperationOption",
"...",
"options",
")",
"{",
"return",
"setTags",
"(",
"getTags",
"(",
")",
".",
"toBuilder",
"(",
")",
".",
"setValues",
"(",
"tags",
")",
".",
"build"... | Sets the tags for this instance, fingerprint value is taken from this instance's {@code
tags().fingerprint()}.
@return a zone operation if the set request was issued correctly, {@code null} if the instance
was not found
@throws ComputeException upon failure | [
"Sets",
"the",
"tags",
"for",
"this",
"instance",
"fingerprint",
"value",
"is",
"taken",
"from",
"this",
"instance",
"s",
"{",
"@code",
"tags",
"()",
".",
"fingerprint",
"()",
"}",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java#L405-L407 |
cdk/cdk | tool/hash/src/main/java/org/openscience/cdk/hash/HashGeneratorMaker.java | HashGeneratorMaker.makeStereoEncoderFactory | private StereoEncoderFactory makeStereoEncoderFactory() {
if (stereoEncoders.isEmpty()) {
return StereoEncoderFactory.EMPTY;
} else if (stereoEncoders.size() == 1) {
return stereoEncoders.get(0);
} else {
StereoEncoderFactory factory = new ConjugatedEncoderFac... | java | private StereoEncoderFactory makeStereoEncoderFactory() {
if (stereoEncoders.isEmpty()) {
return StereoEncoderFactory.EMPTY;
} else if (stereoEncoders.size() == 1) {
return stereoEncoders.get(0);
} else {
StereoEncoderFactory factory = new ConjugatedEncoderFac... | [
"private",
"StereoEncoderFactory",
"makeStereoEncoderFactory",
"(",
")",
"{",
"if",
"(",
"stereoEncoders",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"StereoEncoderFactory",
".",
"EMPTY",
";",
"}",
"else",
"if",
"(",
"stereoEncoders",
".",
"size",
"(",
")",... | Combines the separate stereo encoder factories into a single factory.
@return a single stereo encoder factory | [
"Combines",
"the",
"separate",
"stereo",
"encoder",
"factories",
"into",
"a",
"single",
"factory",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/HashGeneratorMaker.java#L277-L289 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/dns/dnspolicylabel_stats.java | dnspolicylabel_stats.get | public static dnspolicylabel_stats get(nitro_service service, String labelname) throws Exception{
dnspolicylabel_stats obj = new dnspolicylabel_stats();
obj.set_labelname(labelname);
dnspolicylabel_stats response = (dnspolicylabel_stats) obj.stat_resource(service);
return response;
} | java | public static dnspolicylabel_stats get(nitro_service service, String labelname) throws Exception{
dnspolicylabel_stats obj = new dnspolicylabel_stats();
obj.set_labelname(labelname);
dnspolicylabel_stats response = (dnspolicylabel_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"dnspolicylabel_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"dnspolicylabel_stats",
"obj",
"=",
"new",
"dnspolicylabel_stats",
"(",
")",
";",
"obj",
".",
"set_labelname",
"(",
"la... | Use this API to fetch statistics of dnspolicylabel_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"dnspolicylabel_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/dns/dnspolicylabel_stats.java#L149-L154 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java | RouteFilterRulesInner.getAsync | public Observable<RouteFilterRuleInner> getAsync(String resourceGroupName, String routeFilterName, String ruleName) {
return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1<ServiceResponse<RouteFilterRuleInner>, RouteFilterRuleInner>() {
@Override
... | java | public Observable<RouteFilterRuleInner> getAsync(String resourceGroupName, String routeFilterName, String ruleName) {
return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1<ServiceResponse<RouteFilterRuleInner>, RouteFilterRuleInner>() {
@Override
... | [
"public",
"Observable",
"<",
"RouteFilterRuleInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
",",
"String",
"ruleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"routeFilterName",
",... | Gets the specified rule from a route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@param ruleName The name of the rule.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RouteFilterRuleInner o... | [
"Gets",
"the",
"specified",
"rule",
"from",
"a",
"route",
"filter",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java#L307-L314 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/RestSpec.java | RestSpec.setupRestClient | @Given("^I( securely)? send requests to '([^:]+?)(:.+?)?'$")
public void setupRestClient(String isSecured, String restHost, String restPort) {
String restProtocol = "http://";
if (isSecured != null) {
restProtocol = "https://";
}
if (restHost == null) {
res... | java | @Given("^I( securely)? send requests to '([^:]+?)(:.+?)?'$")
public void setupRestClient(String isSecured, String restHost, String restPort) {
String restProtocol = "http://";
if (isSecured != null) {
restProtocol = "https://";
}
if (restHost == null) {
res... | [
"@",
"Given",
"(",
"\"^I( securely)? send requests to '([^:]+?)(:.+?)?'$\"",
")",
"public",
"void",
"setupRestClient",
"(",
"String",
"isSecured",
",",
"String",
"restHost",
",",
"String",
"restPort",
")",
"{",
"String",
"restProtocol",
"=",
"\"http://\"",
";",
"if",
... | Send requests to {@code restHost @code restPort}.
@param restHost host where api is running
@param restPort port where api is running | [
"Send",
"requests",
"to",
"{",
"@code",
"restHost",
"@code",
"restPort",
"}",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/RestSpec.java#L59-L83 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getProjectBadge | public GitlabBadge getProjectBadge(Serializable projectId, Integer badgeId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBadge.URL
+ "/" + badgeId;
return retrieve().to(tailUrl, GitlabBadge.class);
} | java | public GitlabBadge getProjectBadge(Serializable projectId, Integer badgeId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBadge.URL
+ "/" + badgeId;
return retrieve().to(tailUrl, GitlabBadge.class);
} | [
"public",
"GitlabBadge",
"getProjectBadge",
"(",
"Serializable",
"projectId",
",",
"Integer",
"badgeId",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"sanitizeProjectId",
"(",
"projectId",
")",
"+",
... | Get project badge
@param projectId The id of the project for which the badge should be retrieved
@param badgeId The id of the badge that should be retrieved
@return The badge with a given id
@throws IOException on GitLab API call error | [
"Get",
"project",
"badge"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2617-L2621 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.receiveMessage | public ReceiveMessageResult receiveMessage(ReceiveMessageRequest receiveMessageRequest) throws JMSException {
try {
prepareRequest(receiveMessageRequest);
return amazonSQSClient.receiveMessage(receiveMessageRequest);
} catch (AmazonClientException e) {
throw handleExc... | java | public ReceiveMessageResult receiveMessage(ReceiveMessageRequest receiveMessageRequest) throws JMSException {
try {
prepareRequest(receiveMessageRequest);
return amazonSQSClient.receiveMessage(receiveMessageRequest);
} catch (AmazonClientException e) {
throw handleExc... | [
"public",
"ReceiveMessageResult",
"receiveMessage",
"(",
"ReceiveMessageRequest",
"receiveMessageRequest",
")",
"throws",
"JMSException",
"{",
"try",
"{",
"prepareRequest",
"(",
"receiveMessageRequest",
")",
";",
"return",
"amazonSQSClient",
".",
"receiveMessage",
"(",
"r... | Calls <code>receiveMessage</code> and wraps <code>AmazonClientException</code>. Used by
{@link SQSMessageConsumerPrefetch} to receive up to minimum of
(<code>numberOfMessagesToPrefetch</code>,10) messages from SQS queue into consumer
prefetch buffers.
@param receiveMessageRequest
Container for the necessary parameters... | [
"Calls",
"<code",
">",
"receiveMessage<",
"/",
"code",
">",
"and",
"wraps",
"<code",
">",
"AmazonClientException<",
"/",
"code",
">",
".",
"Used",
"by",
"{",
"@link",
"SQSMessageConsumerPrefetch",
"}",
"to",
"receive",
"up",
"to",
"minimum",
"of",
"(",
"<cod... | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L348-L355 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.filterFindByG_A | @Override
public List<CommerceUserSegmentEntry> filterFindByG_A(long groupId,
boolean active, int start, int end) {
return filterFindByG_A(groupId, active, start, end, null);
} | java | @Override
public List<CommerceUserSegmentEntry> filterFindByG_A(long groupId,
boolean active, int start, int end) {
return filterFindByG_A(groupId, active, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceUserSegmentEntry",
">",
"filterFindByG_A",
"(",
"long",
"groupId",
",",
"boolean",
"active",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"filterFindByG_A",
"(",
"groupId",
",",
"active",
",",
"... | Returns a range of all the commerce user segment entries that the user has permission to view where groupId = ? and active = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the resu... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"user",
"segment",
"entries",
"that",
"the",
"user",
"has",
"permission",
"to",
"view",
"where",
"groupId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L1732-L1736 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java | DeployerResolverOverriderConverter.overrideResolverDetails | private void overrideResolverDetails(T overrider, Class overriderClass) {
if (overrider instanceof ResolverOverrider) {
try {
Field resolverDetailsField = overriderClass.getDeclaredField("resolverDetails");
resolverDetailsField.setAccessible(true);
Obj... | java | private void overrideResolverDetails(T overrider, Class overriderClass) {
if (overrider instanceof ResolverOverrider) {
try {
Field resolverDetailsField = overriderClass.getDeclaredField("resolverDetails");
resolverDetailsField.setAccessible(true);
Obj... | [
"private",
"void",
"overrideResolverDetails",
"(",
"T",
"overrider",
",",
"Class",
"overriderClass",
")",
"{",
"if",
"(",
"overrider",
"instanceof",
"ResolverOverrider",
")",
"{",
"try",
"{",
"Field",
"resolverDetailsField",
"=",
"overriderClass",
".",
"getDeclaredF... | Convert the (ServerDetails)details to (ServerDetails)resolverDetails if it doesn't exists already
This conversion comes after a separation to two ServerDetails (resolver and deployer).
Incase the configuration has only one ServerDetails instance called "details", create a new one for resolver.
In ArtifactoryMaven3Nativ... | [
"Convert",
"the",
"(",
"ServerDetails",
")",
"details",
"to",
"(",
"ServerDetails",
")",
"resolverDetails",
"if",
"it",
"doesn",
"t",
"exists",
"already",
"This",
"conversion",
"comes",
"after",
"a",
"separation",
"to",
"two",
"ServerDetails",
"(",
"resolver",
... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L130-L150 |
biezhi/anima | src/main/java/io/github/biezhi/anima/Anima.java | Anima.open | public static Anima open(String url, String user, String pass, Quirks quirks) {
return open(new Sql2o(url, user, pass, quirks));
} | java | public static Anima open(String url, String user, String pass, Quirks quirks) {
return open(new Sql2o(url, user, pass, quirks));
} | [
"public",
"static",
"Anima",
"open",
"(",
"String",
"url",
",",
"String",
"user",
",",
"String",
"pass",
",",
"Quirks",
"quirks",
")",
"{",
"return",
"open",
"(",
"new",
"Sql2o",
"(",
"url",
",",
"user",
",",
"pass",
",",
"quirks",
")",
")",
";",
"... | Create anima with url and db info
@param url jdbc url
@param user database username
@param pass database password
@param quirks DBQuirks
@return Anima | [
"Create",
"anima",
"with",
"url",
"and",
"db",
"info"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/Anima.java#L212-L214 |
lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.getCollection | @Override
public Object getCollection(Object coll, String key) throws PageException {
return variableUtil.getCollection(this, coll, key);
} | java | @Override
public Object getCollection(Object coll, String key) throws PageException {
return variableUtil.getCollection(this, coll, key);
} | [
"@",
"Override",
"public",
"Object",
"getCollection",
"(",
"Object",
"coll",
",",
"String",
"key",
")",
"throws",
"PageException",
"{",
"return",
"variableUtil",
".",
"getCollection",
"(",
"this",
",",
"coll",
",",
"key",
")",
";",
"}"
] | /*
private Object _touch(Scope scope, String key) throws PageException { Object
o=scope.get(key,null); if(o!=null) return o; return scope.set(key, new StructImpl()); } | [
"/",
"*",
"private",
"Object",
"_touch",
"(",
"Scope",
"scope",
"String",
"key",
")",
"throws",
"PageException",
"{",
"Object",
"o",
"=",
"scope",
".",
"get",
"(",
"key",
"null",
")",
";",
"if",
"(",
"o!",
"=",
"null",
")",
"return",
"o",
";",
"ret... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L1433-L1436 |
apache/incubator-druid | server/src/main/java/org/apache/druid/segment/realtime/appenderator/AppenderatorImpl.java | AppenderatorImpl.persistHydrant | private int persistHydrant(FireHydrant indexToPersist, SegmentIdWithShardSpec identifier)
{
synchronized (indexToPersist) {
if (indexToPersist.hasSwapped()) {
log.info(
"Segment[%s], Hydrant[%s] already swapped. Ignoring request to persist.",
identifier, indexToPersist
... | java | private int persistHydrant(FireHydrant indexToPersist, SegmentIdWithShardSpec identifier)
{
synchronized (indexToPersist) {
if (indexToPersist.hasSwapped()) {
log.info(
"Segment[%s], Hydrant[%s] already swapped. Ignoring request to persist.",
identifier, indexToPersist
... | [
"private",
"int",
"persistHydrant",
"(",
"FireHydrant",
"indexToPersist",
",",
"SegmentIdWithShardSpec",
"identifier",
")",
"{",
"synchronized",
"(",
"indexToPersist",
")",
"{",
"if",
"(",
"indexToPersist",
".",
"hasSwapped",
"(",
")",
")",
"{",
"log",
".",
"inf... | Persists the given hydrant and returns the number of rows persisted. Must only be called in the single-threaded
persistExecutor.
@param indexToPersist hydrant to persist
@param identifier the segment this hydrant is going to be part of
@return the number of rows persisted | [
"Persists",
"the",
"given",
"hydrant",
"and",
"returns",
"the",
"number",
"of",
"rows",
"persisted",
".",
"Must",
"only",
"be",
"called",
"in",
"the",
"single",
"-",
"threaded",
"persistExecutor",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/segment/realtime/appenderator/AppenderatorImpl.java#L1245-L1286 |
parship/roperty | src/main/java/com/parship/roperty/Ensure.java | Ensure.notEmpty | public static void notEmpty(final CharSequence str, final String parameterName) {
if (str == null || str.length() == 0) {
throw new IllegalArgumentException('"' + parameterName + "\" must not be null or empty, but was: " + str);
}
} | java | public static void notEmpty(final CharSequence str, final String parameterName) {
if (str == null || str.length() == 0) {
throw new IllegalArgumentException('"' + parameterName + "\" must not be null or empty, but was: " + str);
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"final",
"CharSequence",
"str",
",",
"final",
"String",
"parameterName",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentExc... | Check that the provided string is not empty (not null, not "").
@param str string to check
@param parameterName name of the parameter to display in the error message | [
"Check",
"that",
"the",
"provided",
"string",
"is",
"not",
"empty",
"(",
"not",
"null",
"not",
")",
"."
] | train | https://github.com/parship/roperty/blob/d25fb0ff9707d944aa1900180861b43c8f77ea33/src/main/java/com/parship/roperty/Ensure.java#L34-L38 |
Jasig/uPortal | uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonQueryValidator.java | PersonQueryValidator.validatePersonLookup | public void validatePersonLookup(PersonQuery personQuery, MessageContext context) {
final RequestContext requestContext = RequestContextHolder.getRequestContext();
final ExternalContext externalContext = requestContext.getExternalContext();
final Set<String> queryAttributes = personLookupHelper.... | java | public void validatePersonLookup(PersonQuery personQuery, MessageContext context) {
final RequestContext requestContext = RequestContextHolder.getRequestContext();
final ExternalContext externalContext = requestContext.getExternalContext();
final Set<String> queryAttributes = personLookupHelper.... | [
"public",
"void",
"validatePersonLookup",
"(",
"PersonQuery",
"personQuery",
",",
"MessageContext",
"context",
")",
"{",
"final",
"RequestContext",
"requestContext",
"=",
"RequestContextHolder",
".",
"getRequestContext",
"(",
")",
";",
"final",
"ExternalContext",
"exter... | Ensures all passed attributes are part of the valid query attribute set. | [
"Ensures",
"all",
"passed",
"attributes",
"are",
"part",
"of",
"the",
"valid",
"query",
"attribute",
"set",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonQueryValidator.java#L45-L63 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificate | public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion) {
return getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).toBlocking().single().body();
} | java | public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion) {
return getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).toBlocking().single().body();
} | [
"public",
"CertificateBundle",
"getCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"certificateVersion",
")",
"{",
"return",
"getCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
",",
"certificat... | Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate in the given vault.
@param certificateVersion... | [
"Gets",
"information",
"about",
"a",
"certificate",
".",
"Gets",
"information",
"about",
"a",
"specific",
"certificate",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"get",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7546-L7548 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeBytes | public static File writeBytes(byte[] data, File dest, int off, int len, boolean isAppend) throws IORuntimeException {
return FileWriter.create(dest).write(data, off, len, isAppend);
} | java | public static File writeBytes(byte[] data, File dest, int off, int len, boolean isAppend) throws IORuntimeException {
return FileWriter.create(dest).write(data, off, len, isAppend);
} | [
"public",
"static",
"File",
"writeBytes",
"(",
"byte",
"[",
"]",
"data",
",",
"File",
"dest",
",",
"int",
"off",
",",
"int",
"len",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileWriter",
".",
"create",
"(",
"dest",
... | 写入数据到文件
@param data 数据
@param dest 目标文件
@param off 数据开始位置
@param len 数据长度
@param isAppend 是否追加模式
@return 目标文件
@throws IORuntimeException IO异常 | [
"写入数据到文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3141-L3143 |
PinaeOS/timon | src/main/java/org/pinae/timon/cache/CacheFactory.java | CacheFactory.createCache | public Cache createCache(String name, CacheConfiguration config) throws CacheException {
// 默认使用同步缓存
int type = Cache.SYN_CACHE;
if (config instanceof EhCacheConfiguration) {
type = Cache.EHCACHE_CACHE;
} else if (config instanceof MemcachedCacheConfiguration) {
type = Cache.MEMCACHED_CACHE... | java | public Cache createCache(String name, CacheConfiguration config) throws CacheException {
// 默认使用同步缓存
int type = Cache.SYN_CACHE;
if (config instanceof EhCacheConfiguration) {
type = Cache.EHCACHE_CACHE;
} else if (config instanceof MemcachedCacheConfiguration) {
type = Cache.MEMCACHED_CACHE... | [
"public",
"Cache",
"createCache",
"(",
"String",
"name",
",",
"CacheConfiguration",
"config",
")",
"throws",
"CacheException",
"{",
"// 默认使用同步缓存\r",
"int",
"type",
"=",
"Cache",
".",
"SYN_CACHE",
";",
"if",
"(",
"config",
"instanceof",
"EhCacheConfiguration",
")",... | 生成缓存
@param name 缓存名称
@param config 缓存配置
@return 生成的缓存对象
@throws CacheException 缓存异常 | [
"生成缓存"
] | train | https://github.com/PinaeOS/timon/blob/b8c66868624e3eb1b36f6ecda3c556c456a30cd3/src/main/java/org/pinae/timon/cache/CacheFactory.java#L114-L125 |
arxanchain/java-common | src/main/java/com/arxanfintech/common/crypto/core/ECKey.java | ECKey.fromPrivate | public static ECKey fromPrivate(BigInteger privKey) {
return new ECKey(privKey, CURVE.getG().multiply(privKey));
} | java | public static ECKey fromPrivate(BigInteger privKey) {
return new ECKey(privKey, CURVE.getG().multiply(privKey));
} | [
"public",
"static",
"ECKey",
"fromPrivate",
"(",
"BigInteger",
"privKey",
")",
"{",
"return",
"new",
"ECKey",
"(",
"privKey",
",",
"CURVE",
".",
"getG",
"(",
")",
".",
"multiply",
"(",
"privKey",
")",
")",
";",
"}"
] | Creates an ECKey given the private key only.
@param privKey
-
@return - | [
"Creates",
"an",
"ECKey",
"given",
"the",
"private",
"key",
"only",
"."
] | train | https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/crypto/core/ECKey.java#L312-L314 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java | KeywordParser.getKeyword | private JSONObject getKeyword(final JSONArray keywords, final int index) {
JSONObject object = new JSONObject();
try {
object = (JSONObject) keywords.get(index);
}
catch(JSONException e) {
e.printStackTrace();
}
return object;
} | java | private JSONObject getKeyword(final JSONArray keywords, final int index) {
JSONObject object = new JSONObject();
try {
object = (JSONObject) keywords.get(index);
}
catch(JSONException e) {
e.printStackTrace();
}
return object;
} | [
"private",
"JSONObject",
"getKeyword",
"(",
"final",
"JSONArray",
"keywords",
",",
"final",
"int",
"index",
")",
"{",
"JSONObject",
"object",
"=",
"new",
"JSONObject",
"(",
")",
";",
"try",
"{",
"object",
"=",
"(",
"JSONObject",
")",
"keywords",
".",
"get"... | Return a json object from the provided array. Return an empty object if
there is any problems fetching the keyword data.
@param keywords array of keyword data
@param index of the object to fetch
@return json object from the provided array | [
"Return",
"a",
"json",
"object",
"from",
"the",
"provided",
"array",
".",
"Return",
"an",
"empty",
"object",
"if",
"there",
"is",
"any",
"problems",
"fetching",
"the",
"keyword",
"data",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java#L61-L70 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.CustomArray | public JBBPDslBuilder CustomArray(final String type, final String size) {
return this.CustomArray(type, null, size, null);
} | java | public JBBPDslBuilder CustomArray(final String type, final String size) {
return this.CustomArray(type, null, size, null);
} | [
"public",
"JBBPDslBuilder",
"CustomArray",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"size",
")",
"{",
"return",
"this",
".",
"CustomArray",
"(",
"type",
",",
"null",
",",
"size",
",",
"null",
")",
";",
"}"
] | Create anonymous custom type array with fixed size.
@param type custom type, must not be null
@param size expression to calculate size of the array, must not be null.
@return the builder instance, must not be null | [
"Create",
"anonymous",
"custom",
"type",
"array",
"with",
"fixed",
"size",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L496-L498 |
hexagonframework/spring-data-ebean | src/main/java/org/springframework/data/ebean/repository/query/EbeanQueryCreator.java | EbeanQueryCreator.complete | @Override
protected final Query complete(Expression expression, Sort sort) {
return root.add(expression).query();
} | java | @Override
protected final Query complete(Expression expression, Sort sort) {
return root.add(expression).query();
} | [
"@",
"Override",
"protected",
"final",
"Query",
"complete",
"(",
"Expression",
"expression",
",",
"Sort",
"sort",
")",
"{",
"return",
"root",
".",
"add",
"(",
"expression",
")",
".",
"query",
"(",
")",
";",
"}"
] | Finalizes the given {@link ExpressionList} and applies the given sort. | [
"Finalizes",
"the",
"given",
"{"
] | train | https://github.com/hexagonframework/spring-data-ebean/blob/dd11b97654982403b50dd1d5369cadad71fce410/src/main/java/org/springframework/data/ebean/repository/query/EbeanQueryCreator.java#L104-L107 |
unbescape/unbescape | src/main/java/org/unbescape/csv/CsvEscape.java | CsvEscape.unescapeCsv | public static void unescapeCsv(final Reader reader, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
CsvEscapeUtil.unescape(reader, writer);
} | java | public static void unescapeCsv(final Reader reader, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
CsvEscapeUtil.unescape(reader, writer);
} | [
"public",
"static",
"void",
"unescapeCsv",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'writer' c... | <p>
Perform a CSV <strong>unescape</strong> operation on a <tt>Reader</tt> input, writing results
to a <tt>Writer</tt>.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>
@param reader the <tt>Reader</tt> reading the text to be unescaped.
@param writer the <tt>java.io.Writer</tt> to which the unescaped result ... | [
"<p",
">",
"Perform",
"a",
"CSV",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
".",
"<",
"/",
"p",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/csv/CsvEscape.java#L303-L312 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java | AtomTetrahedralLigandPlacer3D.getTorsionAngle | public double getTorsionAngle(Point3d a, Point3d b, Point3d c, Point3d d) {
Vector3d ab = new Vector3d(a.x - b.x, a.y - b.y, a.z - b.z);
Vector3d cb = new Vector3d(c.x - b.x, c.y - b.y, c.z - b.z);
Vector3d dc = new Vector3d(d.x - c.x, d.y - c.y, d.z - c.z);
Vector3d bc = new Vector3d(b.... | java | public double getTorsionAngle(Point3d a, Point3d b, Point3d c, Point3d d) {
Vector3d ab = new Vector3d(a.x - b.x, a.y - b.y, a.z - b.z);
Vector3d cb = new Vector3d(c.x - b.x, c.y - b.y, c.z - b.z);
Vector3d dc = new Vector3d(d.x - c.x, d.y - c.y, d.z - c.z);
Vector3d bc = new Vector3d(b.... | [
"public",
"double",
"getTorsionAngle",
"(",
"Point3d",
"a",
",",
"Point3d",
"b",
",",
"Point3d",
"c",
",",
"Point3d",
"d",
")",
"{",
"Vector3d",
"ab",
"=",
"new",
"Vector3d",
"(",
"a",
".",
"x",
"-",
"b",
".",
"x",
",",
"a",
".",
"y",
"-",
"b",
... | Calculates the torsionAngle of a-b-c-d.
@param a Point3d
@param b Point3d
@param c Point3d
@param d Point3d
@return The torsionAngle value | [
"Calculates",
"the",
"torsionAngle",
"of",
"a",
"-",
"b",
"-",
"c",
"-",
"d",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java#L787-L806 |
simbiose/Encryption | Encryption/main/se/simbio/encryption/Encryption.java | Encryption.decryptAsync | public void decryptAsync(final String data, final Callback callback) {
if (callback == null) return;
new Thread(new Runnable() {
@Override
public void run() {
try {
String decrypt = decrypt(data);
if (decrypt == null) {
... | java | public void decryptAsync(final String data, final Callback callback) {
if (callback == null) return;
new Thread(new Runnable() {
@Override
public void run() {
try {
String decrypt = decrypt(data);
if (decrypt == null) {
... | [
"public",
"void",
"decryptAsync",
"(",
"final",
"String",
"data",
",",
"final",
"Callback",
"callback",
")",
"{",
"if",
"(",
"callback",
"==",
"null",
")",
"return",
";",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
... | This is a sugar method that calls decrypt method in background, it is a good idea to use this
one instead the default method because decryption can take several time and with this method
the process occurs in a AsyncTask, other advantage is the Callback with separated methods,
one for success and other for the exceptio... | [
"This",
"is",
"a",
"sugar",
"method",
"that",
"calls",
"decrypt",
"method",
"in",
"background",
"it",
"is",
"a",
"good",
"idea",
"to",
"use",
"this",
"one",
"instead",
"the",
"default",
"method",
"because",
"decryption",
"can",
"take",
"several",
"time",
"... | train | https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L209-L225 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.get | public T get(String json, OnJsonObjectAddListener listener) throws IOException,
JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return get(parser);
} | java | public T get(String json, OnJsonObjectAddListener listener) throws IOException,
JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return get(parser);
} | [
"public",
"T",
"get",
"(",
"String",
"json",
",",
"OnJsonObjectAddListener",
"listener",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"JsonPullParser",
"parser",
"=",
"JsonPullParser",
".",
"newParser",
"(",
"json",
")",
";",
"return",
"get",
"... | Attempts to parse the given data as an object.<br>
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param json JSON-formatted data
@param listener {@link OnJsonObjectAddListener} to notify
@return An object instance
@throws IOException
@throws JsonFormatExcep... | [
"Attempts",
"to",
"parse",
"the",
"given",
"data",
"as",
"an",
"object",
".",
"<br",
">",
"Accepts",
"{",
"@link",
"OnJsonObjectAddListener",
"}",
";",
"allows",
"you",
"to",
"peek",
"various",
"intermittent",
"instances",
"as",
"parsing",
"goes",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L172-L176 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java | SecStrucCalc.hasBulge | private boolean hasBulge(Ladder l1, Ladder l2) {
boolean bulge = ((l1.btype.equals(l2.btype)) &&
(l2.from - l1.to < 6) &&
(l1.to < l2.from) &&
(l2.connectedTo == 0));
if (!bulge) return bulge;
switch(l1.btype){
case parallel:
bulge = ( (l2.lfrom - l1.lto > 0) &&
((( l2.lfrom -l1.lto < 6) ... | java | private boolean hasBulge(Ladder l1, Ladder l2) {
boolean bulge = ((l1.btype.equals(l2.btype)) &&
(l2.from - l1.to < 6) &&
(l1.to < l2.from) &&
(l2.connectedTo == 0));
if (!bulge) return bulge;
switch(l1.btype){
case parallel:
bulge = ( (l2.lfrom - l1.lto > 0) &&
((( l2.lfrom -l1.lto < 6) ... | [
"private",
"boolean",
"hasBulge",
"(",
"Ladder",
"l1",
",",
"Ladder",
"l2",
")",
"{",
"boolean",
"bulge",
"=",
"(",
"(",
"l1",
".",
"btype",
".",
"equals",
"(",
"l2",
".",
"btype",
")",
")",
"&&",
"(",
"l2",
".",
"from",
"-",
"l1",
".",
"to",
"... | For beta structures, we define explicitly: a bulge-linked
ladder consists of two (perfect) ladder or bridges of the
same type connected by at most one extra residue on one
strand and at most four extra residues on the other strand,
all residues in bulge-linked ladders are marked "E,"
including the extra residues. | [
"For",
"beta",
"structures",
"we",
"define",
"explicitly",
":",
"a",
"bulge",
"-",
"linked",
"ladder",
"consists",
"of",
"two",
"(",
"perfect",
")",
"ladder",
"or",
"bridges",
"of",
"the",
"same",
"type",
"connected",
"by",
"at",
"most",
"one",
"extra",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L327-L355 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlBaseTag.java | HtmlBaseTag.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (facet != null) {
String s = Bundle.getString("Tags_AttributeFacetNotSupported", new Object[]{facet});
registerTagError(s, null);
}
AbstractHtmlState tsh = getState(... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (facet != null) {
String s = Bundle.getString("Tags_AttributeFacetNotSupported", new Object[]{facet});
registerTagError(s, null);
}
AbstractHtmlState tsh = getState(... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"facet",
"!=",
"null",
")",
"{",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_AttributeF... | Base support for the <code>attribute</code> tag. This requires that the tag buffer their body and
write attribute in the end tag. For the HTML tags it is not legal to set
the <code>id</code> or <code>name</code> attributes. In addition, the base tag does
not allow facets to be set. If the attribute is legal it will... | [
"Base",
"support",
"for",
"the",
"<code",
">",
"attribute<",
"/",
"code",
">",
"tag",
".",
"This",
"requires",
"that",
"the",
"tag",
"buffer",
"their",
"body",
"and",
"write",
"attribute",
"in",
"the",
"end",
"tag",
".",
"For",
"the",
"HTML",
"tags",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlBaseTag.java#L488-L497 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.prewrite | public void prewrite(byte[] b,int offset, int length)
{
ensureReserve(length);
System.arraycopy(b,offset,_buf,_start-length,length);
_start-=length;
} | java | public void prewrite(byte[] b,int offset, int length)
{
ensureReserve(length);
System.arraycopy(b,offset,_buf,_start-length,length);
_start-=length;
} | [
"public",
"void",
"prewrite",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"ensureReserve",
"(",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"b",
",",
"offset",
",",
"_buf",
",",
"_start",
"-",
"length",
... | Write byte range to start of the buffer.
@param b
@param offset
@param length | [
"Write",
"byte",
"range",
"to",
"start",
"of",
"the",
"buffer",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L230-L235 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java | WDataTableRenderer.paintRowExpansionElement | private void paintRowExpansionElement(final WDataTable table, final XmlStringBuilder xml) {
xml.appendTagOpen("ui:rowexpansion");
switch (table.getExpandMode()) {
case CLIENT:
xml.appendAttribute("mode", "client");
break;
case LAZY:
xml.appendAttribute("mode", "lazy");
break;
case SERVER:
... | java | private void paintRowExpansionElement(final WDataTable table, final XmlStringBuilder xml) {
xml.appendTagOpen("ui:rowexpansion");
switch (table.getExpandMode()) {
case CLIENT:
xml.appendAttribute("mode", "client");
break;
case LAZY:
xml.appendAttribute("mode", "lazy");
break;
case SERVER:
... | [
"private",
"void",
"paintRowExpansionElement",
"(",
"final",
"WDataTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"xml",
".",
"appendTagOpen",
"(",
"\"ui:rowexpansion\"",
")",
";",
"switch",
"(",
"table",
".",
"getExpandMode",
"(",
")",
")",... | Paint the rowSelection aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use | [
"Paint",
"the",
"rowSelection",
"aspects",
"of",
"the",
"WDataTable",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L190-L213 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/Story.java | Story.choosePathString | public void choosePathString(String path, boolean resetCallstack, Object[] arguments) throws Exception {
ifAsyncWeCant("call ChoosePathString right now");
if (resetCallstack) {
resetCallstack();
} else {
// ChoosePathString is potentially dangerous since you can call it when the
// stack is
// pretty... | java | public void choosePathString(String path, boolean resetCallstack, Object[] arguments) throws Exception {
ifAsyncWeCant("call ChoosePathString right now");
if (resetCallstack) {
resetCallstack();
} else {
// ChoosePathString is potentially dangerous since you can call it when the
// stack is
// pretty... | [
"public",
"void",
"choosePathString",
"(",
"String",
"path",
",",
"boolean",
"resetCallstack",
",",
"Object",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",
"ifAsyncWeCant",
"(",
"\"call ChoosePathString right now\"",
")",
";",
"if",
"(",
"resetCallstack",
... | Change the current position of the story to the given path. From here you can
call Continue() to evaluate the next line.
The path String is a dot-separated path as used ly by the engine. These
examples should work:
myKnot myKnot.myStitch
Note however that this won't necessarily work:
myKnot.myStitch.myLabelledChoic... | [
"Change",
"the",
"current",
"position",
"of",
"the",
"story",
"to",
"the",
"given",
"path",
".",
"From",
"here",
"you",
"can",
"call",
"Continue",
"()",
"to",
"evaluate",
"the",
"next",
"line",
"."
] | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/Story.java#L472-L495 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/internal/Utils.java | Utils.coerceToFloat | public static float coerceToFloat(Object value, float defaultValue) {
if (value instanceof Float) {
return (float) value;
}
if (value instanceof Number) {
return ((Number) value).floatValue();
} else if (value instanceof String) {
try {
return Float.valueOf((String) value);
... | java | public static float coerceToFloat(Object value, float defaultValue) {
if (value instanceof Float) {
return (float) value;
}
if (value instanceof Number) {
return ((Number) value).floatValue();
} else if (value instanceof String) {
try {
return Float.valueOf((String) value);
... | [
"public",
"static",
"float",
"coerceToFloat",
"(",
"Object",
"value",
",",
"float",
"defaultValue",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Float",
")",
"{",
"return",
"(",
"float",
")",
"value",
";",
"}",
"if",
"(",
"value",
"instanceof",
"Number",
... | Returns the float representation at {@code value} if it exists and is a float or can be coerced
to a float. Returns {@code defaultValue} otherwise. | [
"Returns",
"the",
"float",
"representation",
"at",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L123-L136 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsMemoryObjectCache.java | CmsVfsMemoryObjectCache.putCachedObject | public void putCachedObject(CmsObject cms, String rootPath, Object value) {
String key = getCacheKeyForCurrentProject(cms, rootPath);
OpenCms.getMemoryMonitor().cacheVfsObject(key, value);
} | java | public void putCachedObject(CmsObject cms, String rootPath, Object value) {
String key = getCacheKeyForCurrentProject(cms, rootPath);
OpenCms.getMemoryMonitor().cacheVfsObject(key, value);
} | [
"public",
"void",
"putCachedObject",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"Object",
"value",
")",
"{",
"String",
"key",
"=",
"getCacheKeyForCurrentProject",
"(",
"cms",
",",
"rootPath",
")",
";",
"OpenCms",
".",
"getMemoryMonitor",
"(",
")"... | Puts an object into the cache.<p>
@param cms the CmsObject
@param rootPath the rootPath of the VFS resource to store the object for
@param value the object to store | [
"Puts",
"an",
"object",
"into",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsMemoryObjectCache.java#L122-L126 |
Alluxio/alluxio | core/common/src/main/java/alluxio/master/ZkMasterInquireClient.java | ZkMasterInquireClient.getClient | public static synchronized ZkMasterInquireClient getClient(String zookeeperAddress,
String electionPath, String leaderPath, int inquireRetryCount) {
ZkMasterConnectDetails connectDetails =
new ZkMasterConnectDetails(zookeeperAddress, leaderPath);
if (!sCreatedClients.containsKey(connectDetails)) {... | java | public static synchronized ZkMasterInquireClient getClient(String zookeeperAddress,
String electionPath, String leaderPath, int inquireRetryCount) {
ZkMasterConnectDetails connectDetails =
new ZkMasterConnectDetails(zookeeperAddress, leaderPath);
if (!sCreatedClients.containsKey(connectDetails)) {... | [
"public",
"static",
"synchronized",
"ZkMasterInquireClient",
"getClient",
"(",
"String",
"zookeeperAddress",
",",
"String",
"electionPath",
",",
"String",
"leaderPath",
",",
"int",
"inquireRetryCount",
")",
"{",
"ZkMasterConnectDetails",
"connectDetails",
"=",
"new",
"Z... | Gets the client.
@param zookeeperAddress the address for Zookeeper
@param electionPath the path of the master election
@param leaderPath the path of the leader
@param inquireRetryCount the number of times to retry connections
@return the client | [
"Gets",
"the",
"client",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/master/ZkMasterInquireClient.java#L65-L74 |
wirecardBrasil/moip-sdk-java | src/main/java/br/com/moip/api/request/RequestTools.java | RequestTools.getBody | String getBody(Object object, ContentType contentType) {
if (contentType == ContentType.APPLICATION_FORM_URLENCODED) {
return jsonToUrlEncodedString((JsonObject) new JsonParser().parse(gson.toJson(object)));
}
return gson.toJson(object);
} | java | String getBody(Object object, ContentType contentType) {
if (contentType == ContentType.APPLICATION_FORM_URLENCODED) {
return jsonToUrlEncodedString((JsonObject) new JsonParser().parse(gson.toJson(object)));
}
return gson.toJson(object);
} | [
"String",
"getBody",
"(",
"Object",
"object",
",",
"ContentType",
"contentType",
")",
"{",
"if",
"(",
"contentType",
"==",
"ContentType",
".",
"APPLICATION_FORM_URLENCODED",
")",
"{",
"return",
"jsonToUrlEncodedString",
"(",
"(",
"JsonObject",
")",
"new",
"JsonPar... | This method is used to get a serialized object into its equivalent JSON representation.
@param object
{@code Object} the body object.
@param contentType
{@ContentType} the content type header.
@return {@code String} | [
"This",
"method",
"is",
"used",
"to",
"get",
"a",
"serialized",
"object",
"into",
"its",
"equivalent",
"JSON",
"representation",
"."
] | train | https://github.com/wirecardBrasil/moip-sdk-java/blob/5bee84fa9457d7becfd18954bf5105037f49829c/src/main/java/br/com/moip/api/request/RequestTools.java#L62-L68 |
michael-rapp/AndroidPreferenceActivity | example/src/main/java/de/mrapp/android/preference/activity/example/MainActivity.java | MainActivity.createWizardButtonListener | private OnClickListener createWizardButtonListener() {
return new OnClickListener() {
@Override
public void onClick(final View v) {
Intent intent = new Intent(MainActivity.this, WizardActivity.class);
intent.putExtra(PreferenceActivity.EXTRA_SHOW_BUTTON_B... | java | private OnClickListener createWizardButtonListener() {
return new OnClickListener() {
@Override
public void onClick(final View v) {
Intent intent = new Intent(MainActivity.this, WizardActivity.class);
intent.putExtra(PreferenceActivity.EXTRA_SHOW_BUTTON_B... | [
"private",
"OnClickListener",
"createWizardButtonListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"View",
"v",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"M... | Creates and returns a listener, which allows to show a {@link PreferenceActivity}, which is
used as a wizard.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"show",
"a",
"{",
"@link",
"PreferenceActivity",
"}",
"which",
"is",
"used",
"as",
"a",
"wizard",
"."
] | train | https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/MainActivity.java#L155-L171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.