repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
kaazing/gateway | transport/bio/src/main/java/org/kaazing/gateway/transport/bio/AbstractBioConnector.java | AbstractBioConnector.connectInternal | protected <F extends ConnectFuture> ConnectFuture connectInternal(final ResourceAddress remoteAddress, final IoHandler handler, final IoSessionInitializer<F> initializer) {
"""
THIS IS A BUG IN JAVA, should not need two methods just to capture the type
"""
ConnectFuture future;
final ... | java | protected <F extends ConnectFuture> ConnectFuture connectInternal(final ResourceAddress remoteAddress, final IoHandler handler, final IoSessionInitializer<F> initializer) {
ConnectFuture future;
final String nextProtocol = remoteAddress.getOption(ResourceAddress.NEXT_PROTOCOL);
Resourc... | [
"protected",
"<",
"F",
"extends",
"ConnectFuture",
">",
"ConnectFuture",
"connectInternal",
"(",
"final",
"ResourceAddress",
"remoteAddress",
",",
"final",
"IoHandler",
"handler",
",",
"final",
"IoSessionInitializer",
"<",
"F",
">",
"initializer",
")",
"{",
"Connect... | THIS IS A BUG IN JAVA, should not need two methods just to capture the type | [
"THIS",
"IS",
"A",
"BUG",
"IN",
"JAVA",
"should",
"not",
"need",
"two",
"methods",
"just",
"to",
"capture",
"the",
"type"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/bio/src/main/java/org/kaazing/gateway/transport/bio/AbstractBioConnector.java#L110-L151 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.scaleAroundLocal | public Matrix4f scaleAroundLocal(float factor, float ox, float oy, float oz) {
"""
Pre-multiply scaling to this matrix by scaling all three base axes by the given <code>factor</code>
while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code>... | java | public Matrix4f scaleAroundLocal(float factor, float ox, float oy, float oz) {
return scaleAroundLocal(factor, factor, factor, ox, oy, oz, thisOrNew());
} | [
"public",
"Matrix4f",
"scaleAroundLocal",
"(",
"float",
"factor",
",",
"float",
"ox",
",",
"float",
"oy",
",",
"float",
"oz",
")",
"{",
"return",
"scaleAroundLocal",
"(",
"factor",
",",
"factor",
",",
"factor",
",",
"ox",
",",
"oy",
",",
"oz",
",",
"th... | Pre-multiply scaling to this matrix by scaling all three base axes by the given <code>factor</code>
while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>S * M</code>. So when transforming a... | [
"Pre",
"-",
"multiply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"all",
"three",
"base",
"axes",
"by",
"the",
"given",
"<code",
">",
"factor<",
"/",
"code",
">",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L5044-L5046 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/pbx/internal/activity/RedirectToActivityImpl.java | RedirectToActivityImpl.splitTwo | private boolean splitTwo() throws PBXException {
"""
Splits two channels moving them to defined endpoints.
@param lhs
@param lhsTarget
@param lhsTargetContext
@param rhs
@param rhsTarget
@param rhsTargetContext
@return
@throws PBXException
"""
final AsteriskSettings profile = PBXFactory.getA... | java | private boolean splitTwo() throws PBXException
{
final AsteriskSettings profile = PBXFactory.getActiveProfile();
AsteriskPBX pbx = (AsteriskPBX) PBXFactory.getActivePBX();
List<Channel> channels = new LinkedList<>();
channels.add(channel1);
if (!pbx.waitForChannelsToQ... | [
"private",
"boolean",
"splitTwo",
"(",
")",
"throws",
"PBXException",
"{",
"final",
"AsteriskSettings",
"profile",
"=",
"PBXFactory",
".",
"getActiveProfile",
"(",
")",
";",
"AsteriskPBX",
"pbx",
"=",
"(",
"AsteriskPBX",
")",
"PBXFactory",
".",
"getActivePBX",
"... | Splits two channels moving them to defined endpoints.
@param lhs
@param lhsTarget
@param lhsTargetContext
@param rhs
@param rhsTarget
@param rhsTargetContext
@return
@throws PBXException | [
"Splits",
"two",
"channels",
"moving",
"them",
"to",
"defined",
"endpoints",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/pbx/internal/activity/RedirectToActivityImpl.java#L138-L197 |
sdl/Testy | src/main/java/com/sdl/selenium/extjs6/grid/Grid.java | Grid.setHeaders | public <T extends Table> T setHeaders(boolean strictPosition, final String... headers) {
"""
<pre>{@code
Grid grid = new Grid().setHeaders(true, "Company", "Price", "Change");
}</pre>
@param strictPosition true if grid's headers is order
@param headers grid's headers in order, if grid has no header pu... | java | public <T extends Table> T setHeaders(boolean strictPosition, final String... headers) {
List<WebLocator> list = new ArrayList<>();
for (int i = 0; i < headers.length; i++) {
WebLocator headerEL = new WebLocator(this).setClasses("x-column-header").
setText(headers[i], Sea... | [
"public",
"<",
"T",
"extends",
"Table",
">",
"T",
"setHeaders",
"(",
"boolean",
"strictPosition",
",",
"final",
"String",
"...",
"headers",
")",
"{",
"List",
"<",
"WebLocator",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int... | <pre>{@code
Grid grid = new Grid().setHeaders(true, "Company", "Price", "Change");
}</pre>
@param strictPosition true if grid's headers is order
@param headers grid's headers in order, if grid has no header put empty string
@param <T> element which extended the Table
@return this Grid | [
"<pre",
">",
"{",
"@code",
"Grid",
"grid",
"=",
"new",
"Grid",
"()",
".",
"setHeaders",
"(",
"true",
"Company",
"Price",
"Change",
")",
";",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/extjs6/grid/Grid.java#L66-L78 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/graph/GraphEncoder.java | GraphEncoder.decode | public static Graph decode(String encodedGraph, GraphConfiguration config)
throws GraphEncodingException {
"""
convert a String-encoded graph into a usable Graph object, using
the provided GraphConfiguration.
@param encodedGraph String encoded graph, as returned by getEncoded()
@param config the GraphConfigur... | java | public static Graph decode(String encodedGraph, GraphConfiguration config)
throws GraphEncodingException {
// encoded = "800_35_REGIONDATA_REGIONDATA_REGIONDATA_REGIONDATA_..."
String parts[] = encodedGraph.split(DELIM);
int numRegions = parts.length - 2;
if(parts.length < 1) {
throw new GraphEncodingExcep... | [
"public",
"static",
"Graph",
"decode",
"(",
"String",
"encodedGraph",
",",
"GraphConfiguration",
"config",
")",
"throws",
"GraphEncodingException",
"{",
"// encoded = \"800_35_REGIONDATA_REGIONDATA_REGIONDATA_REGIONDATA_...\"",
"String",
"parts",
"[",
"]",
"=",
"encodedGraph"... | convert a String-encoded graph into a usable Graph object, using
the provided GraphConfiguration.
@param encodedGraph String encoded graph, as returned by getEncoded()
@param config the GraphConfiguration to use
@return a Graph, ready to use
@throws GraphEncodingException if there were problems with the encoded
data | [
"convert",
"a",
"String",
"-",
"encoded",
"graph",
"into",
"a",
"usable",
"Graph",
"object",
"using",
"the",
"provided",
"GraphConfiguration",
"."
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphEncoder.java#L56-L90 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/HttpChannelUtils.java | HttpChannelUtils.getEnglishString | static public String getEnglishString(byte[] data, int start, int end) {
"""
Utility method to get the ISO English string from the given bytes.
@param data
@param start
@param end
@return String
"""
int len = end - start;
if (0 >= len || null == data) {
return null;
}
... | java | static public String getEnglishString(byte[] data, int start, int end) {
int len = end - start;
if (0 >= len || null == data) {
return null;
}
char chars[] = new char[len];
for (int i = start; i < end; i++) {
chars[i] = (char) (data[i] & 0xff);
}
... | [
"static",
"public",
"String",
"getEnglishString",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"len",
"=",
"end",
"-",
"start",
";",
"if",
"(",
"0",
">=",
"len",
"||",
"null",
"==",
"data",
")",
"{",
"re... | Utility method to get the ISO English string from the given bytes.
@param data
@param start
@param end
@return String | [
"Utility",
"method",
"to",
"get",
"the",
"ISO",
"English",
"string",
"from",
"the",
"given",
"bytes",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/HttpChannelUtils.java#L172-L182 |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.loadInitialPage | private void loadInitialPage(App app, String url, Reporter reporter) {
"""
Loads the initial app specified by the url, and ensures the app loads
successfully
@param app - the application to be tested, contains all control elements
@param url - the initial url to load
@param reporter - the output fi... | java | private void loadInitialPage(App app, String url, Reporter reporter) {
String startingPage = "The initial url of <i>";
String act = "Opening new browser and loading up initial url";
String expected = startingPage + url + "</i> will successfully load";
if (app != null) {
try ... | [
"private",
"void",
"loadInitialPage",
"(",
"App",
"app",
",",
"String",
"url",
",",
"Reporter",
"reporter",
")",
"{",
"String",
"startingPage",
"=",
"\"The initial url of <i>\"",
";",
"String",
"act",
"=",
"\"Opening new browser and loading up initial url\"",
";",
"St... | Loads the initial app specified by the url, and ensures the app loads
successfully
@param app - the application to be tested, contains all control elements
@param url - the initial url to load
@param reporter - the output file to write everything to | [
"Loads",
"the",
"initial",
"app",
"specified",
"by",
"the",
"url",
"and",
"ensures",
"the",
"app",
"loads",
"successfully"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L405-L425 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addClass | @Nonnull
public BugInstance addClass(String className, String sourceFileName) {
"""
Add a class annotation. If this is the first class annotation added, it
becomes the primary class annotation.
@param className
the name of the class
@param sourceFileName
the source file of the class
@return this object... | java | @Nonnull
public BugInstance addClass(String className, String sourceFileName) {
ClassAnnotation classAnnotation = new ClassAnnotation(className, sourceFileName);
add(classAnnotation);
return this;
} | [
"@",
"Nonnull",
"public",
"BugInstance",
"addClass",
"(",
"String",
"className",
",",
"String",
"sourceFileName",
")",
"{",
"ClassAnnotation",
"classAnnotation",
"=",
"new",
"ClassAnnotation",
"(",
"className",
",",
"sourceFileName",
")",
";",
"add",
"(",
"classAn... | Add a class annotation. If this is the first class annotation added, it
becomes the primary class annotation.
@param className
the name of the class
@param sourceFileName
the source file of the class
@return this object | [
"Add",
"a",
"class",
"annotation",
".",
"If",
"this",
"is",
"the",
"first",
"class",
"annotation",
"added",
"it",
"becomes",
"the",
"primary",
"class",
"annotation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L930-L935 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.readMetadata | void readMetadata(DataInputStream in, VersionAndOpcode versionAndOpcode)
throws IOException {
"""
Reads the metadata and sends the data in one 'DATA_CHUNK'.
@param in
"""
ReadMetadataHeader readMetadataHeader =
new ReadMetadataHeader(versionAndOpcode);
readMetadataHeader.readFields(in);... | java | void readMetadata(DataInputStream in, VersionAndOpcode versionAndOpcode)
throws IOException {
ReadMetadataHeader readMetadataHeader =
new ReadMetadataHeader(versionAndOpcode);
readMetadataHeader.readFields(in);
final int namespaceId = readMetadataHeader.getNamespaceId();
Block block = new... | [
"void",
"readMetadata",
"(",
"DataInputStream",
"in",
",",
"VersionAndOpcode",
"versionAndOpcode",
")",
"throws",
"IOException",
"{",
"ReadMetadataHeader",
"readMetadataHeader",
"=",
"new",
"ReadMetadataHeader",
"(",
"versionAndOpcode",
")",
";",
"readMetadataHeader",
"."... | Reads the metadata and sends the data in one 'DATA_CHUNK'.
@param in | [
"Reads",
"the",
"metadata",
"and",
"sends",
"the",
"data",
"in",
"one",
"DATA_CHUNK",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L891-L924 |
datacleaner/AnalyzerBeans | components/javascript/src/main/java/org/eobjects/analyzer/beans/script/JavaScriptUtils.java | JavaScriptUtils.addToScope | public static void addToScope(Scriptable scope, InputRow inputRow, InputColumn<?>[] columns, String arrayName) {
"""
Adds the values of a row to the JavaScript scope
@param scope
@param inputRow
@param columns
@param arrayName
"""
NativeArray values = new NativeArray(columns.length * 2);
for (int i =... | java | public static void addToScope(Scriptable scope, InputRow inputRow, InputColumn<?>[] columns, String arrayName) {
NativeArray values = new NativeArray(columns.length * 2);
for (int i = 0; i < columns.length; i++) {
InputColumn<?> column = columns[i];
Object value = inputRow.getValue(column);
if (value != n... | [
"public",
"static",
"void",
"addToScope",
"(",
"Scriptable",
"scope",
",",
"InputRow",
"inputRow",
",",
"InputColumn",
"<",
"?",
">",
"[",
"]",
"columns",
",",
"String",
"arrayName",
")",
"{",
"NativeArray",
"values",
"=",
"new",
"NativeArray",
"(",
"columns... | Adds the values of a row to the JavaScript scope
@param scope
@param inputRow
@param columns
@param arrayName | [
"Adds",
"the",
"values",
"of",
"a",
"row",
"to",
"the",
"JavaScript",
"scope"
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/components/javascript/src/main/java/org/eobjects/analyzer/beans/script/JavaScriptUtils.java#L64-L86 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java | BinaryImageOps.relabel | public static void relabel(GrayS32 input , int labels[] ) {
"""
Used to change the labels in a labeled binary image.
@param input Labeled binary image.
@param labels Look up table where the indexes are the current label and the value are its new value.
"""
if( BoofConcurrency.USE_CONCURRENT ) {
ImplBi... | java | public static void relabel(GrayS32 input , int labels[] ) {
if( BoofConcurrency.USE_CONCURRENT ) {
ImplBinaryImageOps_MT.relabel(input, labels);
} else {
ImplBinaryImageOps.relabel(input, labels);
}
} | [
"public",
"static",
"void",
"relabel",
"(",
"GrayS32",
"input",
",",
"int",
"labels",
"[",
"]",
")",
"{",
"if",
"(",
"BoofConcurrency",
".",
"USE_CONCURRENT",
")",
"{",
"ImplBinaryImageOps_MT",
".",
"relabel",
"(",
"input",
",",
"labels",
")",
";",
"}",
... | Used to change the labels in a labeled binary image.
@param input Labeled binary image.
@param labels Look up table where the indexes are the current label and the value are its new value. | [
"Used",
"to",
"change",
"the",
"labels",
"in",
"a",
"labeled",
"binary",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L509-L515 |
alkacon/opencms-core | src/org/opencms/security/CmsRoleManager.java | CmsRoleManager.removeUserFromRole | public void removeUserFromRole(CmsObject cms, CmsRole role, String username) throws CmsException {
"""
Removes a user from a role, in the given organizational unit.<p>
@param cms the opencms context
@param role the role to remove the user from
@param username the name of the user that is to be removed from th... | java | public void removeUserFromRole(CmsObject cms, CmsRole role, String username) throws CmsException {
m_securityManager.removeUserFromGroup(cms.getRequestContext(), username, role.getGroupName(), true);
} | [
"public",
"void",
"removeUserFromRole",
"(",
"CmsObject",
"cms",
",",
"CmsRole",
"role",
",",
"String",
"username",
")",
"throws",
"CmsException",
"{",
"m_securityManager",
".",
"removeUserFromGroup",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
",",
"username"... | Removes a user from a role, in the given organizational unit.<p>
@param cms the opencms context
@param role the role to remove the user from
@param username the name of the user that is to be removed from the group
@throws CmsException if operation was not successful | [
"Removes",
"a",
"user",
"from",
"a",
"role",
"in",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsRoleManager.java#L533-L536 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java | ReplyFactory.addAirlineItineraryTemplate | public static ReceiptTemplateBuilder addAirlineItineraryTemplate(
String recipientName, String orderNumber, String currency,
String paymentMethod) {
"""
Adds a Receipt Template to the response.
@param recipientName
the recipient's name.
@param orderNumber
the order number.Must be unique for each user.
... | java | public static ReceiptTemplateBuilder addAirlineItineraryTemplate(
String recipientName, String orderNumber, String currency,
String paymentMethod) {
return new ReceiptTemplateBuilder(recipientName, orderNumber, currency,
paymentMethod);
} | [
"public",
"static",
"ReceiptTemplateBuilder",
"addAirlineItineraryTemplate",
"(",
"String",
"recipientName",
",",
"String",
"orderNumber",
",",
"String",
"currency",
",",
"String",
"paymentMethod",
")",
"{",
"return",
"new",
"ReceiptTemplateBuilder",
"(",
"recipientName",... | Adds a Receipt Template to the response.
@param recipientName
the recipient's name.
@param orderNumber
the order number.Must be unique for each user.
@param currency
the currency for the price. It can't be empty. The currency
must be a three digit ISO-4217-3 code in format [A-Z]{3}. For
more information see <a href=
"... | [
"Adds",
"a",
"Receipt",
"Template",
"to",
"the",
"response",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java#L259-L264 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/AbstractConverter.java | AbstractConverter.getPartialValues | public int[] getPartialValues(ReadablePartial fieldSource,
Object object, Chronology chrono, DateTimeFormatter parser) {
"""
Extracts the values of the partial from an object of this converter's type.
The chrono parameter is a hint to the converter, should it require a
chronology to aid in conversion... | java | public int[] getPartialValues(ReadablePartial fieldSource,
Object object, Chronology chrono, DateTimeFormatter parser) {
return getPartialValues(fieldSource, object, chrono);
} | [
"public",
"int",
"[",
"]",
"getPartialValues",
"(",
"ReadablePartial",
"fieldSource",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
",",
"DateTimeFormatter",
"parser",
")",
"{",
"return",
"getPartialValues",
"(",
"fieldSource",
",",
"object",
",",
"chrono"... | Extracts the values of the partial from an object of this converter's type.
The chrono parameter is a hint to the converter, should it require a
chronology to aid in conversion.
<p>
This implementation calls {@link #getPartialValues(ReadablePartial, Object, Chronology)}.
@param fieldSource a partial that provides acc... | [
"Extracts",
"the",
"values",
"of",
"the",
"partial",
"from",
"an",
"object",
"of",
"this",
"converter",
"s",
"type",
".",
"The",
"chrono",
"parameter",
"is",
"a",
"hint",
"to",
"the",
"converter",
"should",
"it",
"require",
"a",
"chronology",
"to",
"aid",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/AbstractConverter.java#L121-L124 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java | MultiChangeBuilder.insertTextAbsolutely | public MultiChangeBuilder<PS, SEG, S> insertTextAbsolutely(int position, String text) {
"""
Inserts the given text at the given position.
@param position The position to insert the text.
@param text The text to insert.
"""
return replaceTextAbsolutely(position, position, text);
} | java | public MultiChangeBuilder<PS, SEG, S> insertTextAbsolutely(int position, String text) {
return replaceTextAbsolutely(position, position, text);
} | [
"public",
"MultiChangeBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"insertTextAbsolutely",
"(",
"int",
"position",
",",
"String",
"text",
")",
"{",
"return",
"replaceTextAbsolutely",
"(",
"position",
",",
"position",
",",
"text",
")",
";",
"}"
] | Inserts the given text at the given position.
@param position The position to insert the text.
@param text The text to insert. | [
"Inserts",
"the",
"given",
"text",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java#L150-L152 |
BioPAX/Paxtools | normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java | MiriamLink.getIdentifiersOrgURI | public static String getIdentifiersOrgURI(String name, String id) {
"""
Gets the Identifiers.org URI/URL of the entity (example: "http://identifiers.org/obo.go/GO:0045202").
@param name - name, URI/URL, or ID of a data type (examples: "ChEBI", "MIR:00000005")
@param id identifier of an entity within the data t... | java | public static String getIdentifiersOrgURI(String name, String id)
{
String url = null;
Datatype datatype = getDatatype(name);
String db = datatype.getName();
if(checkRegExp(id, db)) {
uris:
for(Uris uris : datatype.getUris()) {
for(Uri uri : uris.getUri()) {
if(uri.ge... | [
"public",
"static",
"String",
"getIdentifiersOrgURI",
"(",
"String",
"name",
",",
"String",
"id",
")",
"{",
"String",
"url",
"=",
"null",
";",
"Datatype",
"datatype",
"=",
"getDatatype",
"(",
"name",
")",
";",
"String",
"db",
"=",
"datatype",
".",
"getName... | Gets the Identifiers.org URI/URL of the entity (example: "http://identifiers.org/obo.go/GO:0045202").
@param name - name, URI/URL, or ID of a data type (examples: "ChEBI", "MIR:00000005")
@param id identifier of an entity within the data type (examples: "GO:0045202", "P62158")
@return Identifiers.org URL for the id
@... | [
"Gets",
"the",
"Identifiers",
".",
"org",
"URI",
"/",
"URL",
"of",
"the",
"entity",
"(",
"example",
":",
"http",
":",
"//",
"identifiers",
".",
"org",
"/",
"obo",
".",
"go",
"/",
"GO",
":",
"0045202",
")",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L569-L590 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateKeyAsync | public ServiceFuture<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback<KeyBundle> serviceCallback) {
"""
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
In orde... | java | public ServiceFuture<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"updateKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"final",
"ServiceCallback",
"<",
"KeyBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
... | The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires... | [
"The",
"update",
"key",
"operation",
"changes",
"specified",
"attributes",
"of",
"a",
"stored",
"key",
"and",
"can",
"be",
"applied",
"to",
"any",
"key",
"type",
"and",
"key",
"version",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"In",
"order",
"to",
... | 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#L1191-L1193 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/ExceptionUtil.java | ExceptionUtil.createExceptionByteArray | public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) {
"""
create ByteArrayEntity with specified name and payload and make sure it's
persisted
used in Jobs and ExternalTasks
@param name - type\source of the exception
@param byteArray - payload of the exce... | java | public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) {
ByteArrayEntity result = null;
if (byteArray != null) {
result = new ByteArrayEntity(name, byteArray, type);
Context.getCommandContext()
.getByteArrayManager()
.insertByteArray... | [
"public",
"static",
"ByteArrayEntity",
"createExceptionByteArray",
"(",
"String",
"name",
",",
"byte",
"[",
"]",
"byteArray",
",",
"ResourceType",
"type",
")",
"{",
"ByteArrayEntity",
"result",
"=",
"null",
";",
"if",
"(",
"byteArray",
"!=",
"null",
")",
"{",
... | create ByteArrayEntity with specified name and payload and make sure it's
persisted
used in Jobs and ExternalTasks
@param name - type\source of the exception
@param byteArray - payload of the exception
@param type - resource type of the exception
@return persisted entity | [
"create",
"ByteArrayEntity",
"with",
"specified",
"name",
"and",
"payload",
"and",
"make",
"sure",
"it",
"s",
"persisted"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/ExceptionUtil.java#L66-L77 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java | XPathParser.QName | protected void QName() throws javax.xml.transform.TransformerException {
"""
QName ::= (Prefix ':')? LocalPart
Prefix ::= NCName
LocalPart ::= NCName
@throws javax.xml.transform.TransformerException
"""
// Namespace
if(lookahead(':', 1))
{
m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH... | java | protected void QName() throws javax.xml.transform.TransformerException
{
// Namespace
if(lookahead(':', 1))
{
m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
nextToken();
consumeExpected(... | [
"protected",
"void",
"QName",
"(",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"// Namespace",
"if",
"(",
"lookahead",
"(",
"'",
"'",
",",
"1",
")",
")",
"{",
"m_ops",
".",
"setOp",
"(",
"m_ops",
".",
"getOp"... | QName ::= (Prefix ':')? LocalPart
Prefix ::= NCName
LocalPart ::= NCName
@throws javax.xml.transform.TransformerException | [
"QName",
"::",
"=",
"(",
"Prefix",
":",
")",
"?",
"LocalPart",
"Prefix",
"::",
"=",
"NCName",
"LocalPart",
"::",
"=",
"NCName"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java#L1970-L1992 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.enterText | public void enterText(int index, String text) {
"""
Enters text in an EditText matching the specified index.
@param index the index of the {@link EditText}. {@code 0} if only one is available
@param text the text to enter in the {@link EditText} field
"""
if(config.commandLogging){
Log.d(config.comman... | java | public void enterText(int index, String text) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "enterText("+index+", \""+text+"\")");
}
textEnterer.setEditText(waiter.waitForAndGetView(index, EditText.class), text);
} | [
"public",
"void",
"enterText",
"(",
"int",
"index",
",",
"String",
"text",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"enterText(\"",
"+",
"index",
"+",
"\", \\\"\"",
"... | Enters text in an EditText matching the specified index.
@param index the index of the {@link EditText}. {@code 0} if only one is available
@param text the text to enter in the {@link EditText} field | [
"Enters",
"text",
"in",
"an",
"EditText",
"matching",
"the",
"specified",
"index",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2664-L2670 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/IOUtils.java | IOUtils.copyBytes | public static void copyBytes(InputStream in, OutputStream out, Configuration conf)
throws IOException {
"""
Copies from one stream to another. <strong>closes the input and output streams
at the end</strong>.
@param in InputStrem to read from
@param out OutputStream to write to
@param conf the Configuration... | java | public static void copyBytes(InputStream in, OutputStream out, Configuration conf)
throws IOException {
copyBytes(in, out, conf.getInt("io.file.buffer.size", 4096), true);
} | [
"public",
"static",
"void",
"copyBytes",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"copyBytes",
"(",
"in",
",",
"out",
",",
"conf",
".",
"getInt",
"(",
"\"io.file.buffer.size\"",
",",... | Copies from one stream to another. <strong>closes the input and output streams
at the end</strong>.
@param in InputStrem to read from
@param out OutputStream to write to
@param conf the Configuration object | [
"Copies",
"from",
"one",
"stream",
"to",
"another",
".",
"<strong",
">",
"closes",
"the",
"input",
"and",
"output",
"streams",
"at",
"the",
"end<",
"/",
"strong",
">",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/IOUtils.java#L155-L158 |
mockito/mockito | src/main/java/org/mockito/Mockito.java | Mockito.doThrow | @SuppressWarnings ( {
"""
Additional method helps users of JDK7+ to hide heap pollution / unchecked generics array creation
""""unchecked", "varargs"})
@CheckReturnValue
public static Stubber doThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwable>... toBeThrownNext) {
return M... | java | @SuppressWarnings ({"unchecked", "varargs"})
@CheckReturnValue
public static Stubber doThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwable>... toBeThrownNext) {
return MOCKITO_CORE.stubber().doThrow(toBeThrown, toBeThrownNext);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"varargs\"",
"}",
")",
"@",
"CheckReturnValue",
"public",
"static",
"Stubber",
"doThrow",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"toBeThrown",
",",
"Class",
"<",
"?",
"extends",
"Throwabl... | Additional method helps users of JDK7+ to hide heap pollution / unchecked generics array creation | [
"Additional",
"method",
"helps",
"users",
"of",
"JDK7",
"+",
"to",
"hide",
"heap",
"pollution",
"/",
"unchecked",
"generics",
"array",
"creation"
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/Mockito.java#L2320-L2324 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.multiply | public static String multiply(CharSequence self, Number factor) {
"""
Repeat a CharSequence a certain number of times.
@param self a CharSequence to be repeated
@param factor the number of times the CharSequence should be repeated
@return a String composed of a repetition
@throws IllegalArgumentException i... | java | public static String multiply(CharSequence self, Number factor) {
String s = self.toString();
int size = factor.intValue();
if (size == 0)
return "";
else if (size < 0) {
throw new IllegalArgumentException("multiply() should be called with a number of 0 or greater... | [
"public",
"static",
"String",
"multiply",
"(",
"CharSequence",
"self",
",",
"Number",
"factor",
")",
"{",
"String",
"s",
"=",
"self",
".",
"toString",
"(",
")",
";",
"int",
"size",
"=",
"factor",
".",
"intValue",
"(",
")",
";",
"if",
"(",
"size",
"==... | Repeat a CharSequence a certain number of times.
@param self a CharSequence to be repeated
@param factor the number of times the CharSequence should be repeated
@return a String composed of a repetition
@throws IllegalArgumentException if the number of repetitions is < 0
@since 1.8.2 | [
"Repeat",
"a",
"CharSequence",
"a",
"certain",
"number",
"of",
"times",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L2042-L2055 |
jbossas/remoting-jmx | src/main/java/org/jboss/remotingjmx/protocol/v1/Common.java | Common.getUnMarshaller | private Unmarshaller getUnMarshaller(final MarshallerFactory marshallerFactory, final ClassResolver classResolver)
throws IOException {
"""
Creates and returns a {@link Unmarshaller}
@param marshallerFactory The marshaller factory
@return
@throws IOException
"""
final MarshallingConf... | java | private Unmarshaller getUnMarshaller(final MarshallerFactory marshallerFactory, final ClassResolver classResolver)
throws IOException {
final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration();
marshallingConfiguration.setVersion(2);
marshallingConfigu... | [
"private",
"Unmarshaller",
"getUnMarshaller",
"(",
"final",
"MarshallerFactory",
"marshallerFactory",
",",
"final",
"ClassResolver",
"classResolver",
")",
"throws",
"IOException",
"{",
"final",
"MarshallingConfiguration",
"marshallingConfiguration",
"=",
"new",
"MarshallingCo... | Creates and returns a {@link Unmarshaller}
@param marshallerFactory The marshaller factory
@return
@throws IOException | [
"Creates",
"and",
"returns",
"a",
"{",
"@link",
"Unmarshaller",
"}"
] | train | https://github.com/jbossas/remoting-jmx/blob/dbc87bfed47e5bb9e37c355a77ca0ae9a6ea1363/src/main/java/org/jboss/remotingjmx/protocol/v1/Common.java#L178-L184 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java | PathMetadataFactory.forArrayAccess | public static PathMetadata forArrayAccess(Path<?> parent, Expression<Integer> index) {
"""
Create a new PathMetadata instance for indexed array access
@param parent parent path
@param index index of element
@return array access path
"""
return new PathMetadata(parent, index, PathType.ARRAYVALUE);
... | java | public static PathMetadata forArrayAccess(Path<?> parent, Expression<Integer> index) {
return new PathMetadata(parent, index, PathType.ARRAYVALUE);
} | [
"public",
"static",
"PathMetadata",
"forArrayAccess",
"(",
"Path",
"<",
"?",
">",
"parent",
",",
"Expression",
"<",
"Integer",
">",
"index",
")",
"{",
"return",
"new",
"PathMetadata",
"(",
"parent",
",",
"index",
",",
"PathType",
".",
"ARRAYVALUE",
")",
";... | Create a new PathMetadata instance for indexed array access
@param parent parent path
@param index index of element
@return array access path | [
"Create",
"a",
"new",
"PathMetadata",
"instance",
"for",
"indexed",
"array",
"access"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java#L33-L35 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateMobile | public static <T extends CharSequence> T validateMobile(T value, String errorMsg) throws ValidateException {
"""
验证是否为手机号码(中国)
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isMobile(value)) {
throw new ValidateException(error... | java | public static <T extends CharSequence> T validateMobile(T value, String errorMsg) throws ValidateException {
if (false == isMobile(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateMobile",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isMobile",
"(",
"value",
")",
")",
"{",
"throw",
"new",
... | 验证是否为手机号码(中国)
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为手机号码(中国)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L677-L682 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.cloneRepository | public Git cloneRepository(final String remoteUrl, final Path localPath, final String passphrase,
final Path privateKey) {
"""
Clones a private remote git repository. Caller is responsible of closing git repository.
@param remoteUrl
to connect.
@param localPath
where to clone the repo.
@param passph... | java | public Git cloneRepository(final String remoteUrl, final Path localPath, final String passphrase,
final Path privateKey) {
SshSessionFactory sshSessionFactory = new JschConfigSessionFactory() {
@Override
protected void configure(OpenSshConfig.Host host, Session session) {
... | [
"public",
"Git",
"cloneRepository",
"(",
"final",
"String",
"remoteUrl",
",",
"final",
"Path",
"localPath",
",",
"final",
"String",
"passphrase",
",",
"final",
"Path",
"privateKey",
")",
"{",
"SshSessionFactory",
"sshSessionFactory",
"=",
"new",
"JschConfigSessionFa... | Clones a private remote git repository. Caller is responsible of closing git repository.
@param remoteUrl
to connect.
@param localPath
where to clone the repo.
@param passphrase
to access private key.
@param privateKey
file location. If null default (~.ssh/id_rsa) location is used.
@return Git instance. Caller is res... | [
"Clones",
"a",
"private",
"remote",
"git",
"repository",
".",
"Caller",
"is",
"responsible",
"of",
"closing",
"git",
"repository",
"."
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L522-L555 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sslGateway/src/main/java/net/minidev/ovh/api/ApiOvhSslGateway.java | ApiOvhSslGateway.serviceName_server_POST | public OvhServer serviceName_server_POST(String serviceName, String address, Long port) throws IOException {
"""
Add a new server to your SSL Gateway
REST: POST /sslGateway/{serviceName}/server
@param address [required] IPv4 address of your server
@param port [required] Port of your server
@param serviceName... | java | public OvhServer serviceName_server_POST(String serviceName, String address, Long port) throws IOException {
String qPath = "/sslGateway/{serviceName}/server";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "address", address);
addBody(o, "por... | [
"public",
"OvhServer",
"serviceName_server_POST",
"(",
"String",
"serviceName",
",",
"String",
"address",
",",
"Long",
"port",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sslGateway/{serviceName}/server\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Add a new server to your SSL Gateway
REST: POST /sslGateway/{serviceName}/server
@param address [required] IPv4 address of your server
@param port [required] Port of your server
@param serviceName [required] The internal name of your SSL Gateway
API beta | [
"Add",
"a",
"new",
"server",
"to",
"your",
"SSL",
"Gateway"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sslGateway/src/main/java/net/minidev/ovh/api/ApiOvhSslGateway.java#L361-L369 |
termsuite/termsuite-core | src/main/java/fr/univnantes/termsuite/uima/engines/preproc/OccurrenceBuffer.java | OccurrenceBuffer.findDuplicates | public Collection<Collection<RegexOccurrence>> findDuplicates() {
"""
Finds duplicated occurrences in this buffer and returns them
as a collection of dups lists.
@return
"""
Collection<Collection<RegexOccurrence>> setToReturn = Lists.newArrayList();
if(! this.occurrences.isEmpty()) {
List<RegexOccurre... | java | public Collection<Collection<RegexOccurrence>> findDuplicates() {
Collection<Collection<RegexOccurrence>> setToReturn = Lists.newArrayList();
if(! this.occurrences.isEmpty()) {
List<RegexOccurrence> sortedOcc = Lists.newArrayList(this.occurrences);
Collections.sort(sortedOcc, new Comparator<RegexOccurrence>()... | [
"public",
"Collection",
"<",
"Collection",
"<",
"RegexOccurrence",
">",
">",
"findDuplicates",
"(",
")",
"{",
"Collection",
"<",
"Collection",
"<",
"RegexOccurrence",
">>",
"setToReturn",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"if",
"(",
"!",
"thi... | Finds duplicated occurrences in this buffer and returns them
as a collection of dups lists.
@return | [
"Finds",
"duplicated",
"occurrences",
"in",
"this",
"buffer",
"and",
"returns",
"them",
"as",
"a",
"collection",
"of",
"dups",
"lists",
"."
] | train | https://github.com/termsuite/termsuite-core/blob/731e5d0bc7c14180713c01a9c7dffe1925f26130/src/main/java/fr/univnantes/termsuite/uima/engines/preproc/OccurrenceBuffer.java#L79-L112 |
netty/netty | common/src/main/java/io/netty/util/internal/ObjectUtil.java | ObjectUtil.checkNonEmpty | public static <T extends Collection<?>> T checkNonEmpty(T collection, String name) {
"""
Checks that the given argument is neither null nor empty.
If it is, throws {@link NullPointerException} or {@link IllegalArgumentException}.
Otherwise, returns the argument.
"""
checkNotNull(collection, name);
... | java | public static <T extends Collection<?>> T checkNonEmpty(T collection, String name) {
checkNotNull(collection, name);
checkPositive(collection.size(), name + ".size");
return collection;
} | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"?",
">",
">",
"T",
"checkNonEmpty",
"(",
"T",
"collection",
",",
"String",
"name",
")",
"{",
"checkNotNull",
"(",
"collection",
",",
"name",
")",
";",
"checkPositive",
"(",
"collection",
".",
"... | Checks that the given argument is neither null nor empty.
If it is, throws {@link NullPointerException} or {@link IllegalArgumentException}.
Otherwise, returns the argument. | [
"Checks",
"that",
"the",
"given",
"argument",
"is",
"neither",
"null",
"nor",
"empty",
".",
"If",
"it",
"is",
"throws",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ObjectUtil.java#L98-L102 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java | ListIterate.forEachWithIndex | public static <T> void forEachWithIndex(List<T> list, int from, int to, ObjectIntProcedure<? super T> objectIntProcedure) {
"""
Iterates over the section of the list covered by the specified indexes. The indexes are both inclusive. If the
from is less than the to, the list is iterated in forward order. If the f... | java | public static <T> void forEachWithIndex(List<T> list, int from, int to, ObjectIntProcedure<? super T> objectIntProcedure)
{
ListIterate.rangeCheck(from, to, list.size());
if (list instanceof RandomAccess)
{
RandomAccessListIterate.forEachWithIndex(list, from, to, objectIntProced... | [
"public",
"static",
"<",
"T",
">",
"void",
"forEachWithIndex",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"from",
",",
"int",
"to",
",",
"ObjectIntProcedure",
"<",
"?",
"super",
"T",
">",
"objectIntProcedure",
")",
"{",
"ListIterate",
".",
"rangeChe... | Iterates over the section of the list covered by the specified indexes. The indexes are both inclusive. If the
from is less than the to, the list is iterated in forward order. If the from is greater than the to, then the
list is iterated in the reverse order. The index passed into the ObjectIntProcedure is the actual... | [
"Iterates",
"over",
"the",
"section",
"of",
"the",
"list",
"covered",
"by",
"the",
"specified",
"indexes",
".",
"The",
"indexes",
"are",
"both",
"inclusive",
".",
"If",
"the",
"from",
"is",
"less",
"than",
"the",
"to",
"the",
"list",
"is",
"iterated",
"i... | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java#L754-L781 |
groovy/groovy-core | src/main/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.preInstantiate | protected void preInstantiate(Object name, Map attributes, Object value) {
"""
A hook before the factory creates the node.<br>
It will call any registered preInstantiateDelegates, if you override this
method be sure to call this impl somewhere in your code.
@param name the name of the node
@param attri... | java | protected void preInstantiate(Object name, Map attributes, Object value) {
for (Closure preInstantiateDelegate : getProxyBuilder().getPreInstantiateDelegates()) {
(preInstantiateDelegate).call(new Object[]{this, attributes, value});
}
} | [
"protected",
"void",
"preInstantiate",
"(",
"Object",
"name",
",",
"Map",
"attributes",
",",
"Object",
"value",
")",
"{",
"for",
"(",
"Closure",
"preInstantiateDelegate",
":",
"getProxyBuilder",
"(",
")",
".",
"getPreInstantiateDelegates",
"(",
")",
")",
"{",
... | A hook before the factory creates the node.<br>
It will call any registered preInstantiateDelegates, if you override this
method be sure to call this impl somewhere in your code.
@param name the name of the node
@param attributes the attributes of the node
@param value the value argument(s) of the node | [
"A",
"hook",
"before",
"the",
"factory",
"creates",
"the",
"node",
".",
"<br",
">",
"It",
"will",
"call",
"any",
"registered",
"preInstantiateDelegates",
"if",
"you",
"override",
"this",
"method",
"be",
"sure",
"to",
"call",
"this",
"impl",
"somewhere",
"in"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/util/FactoryBuilderSupport.java#L1056-L1060 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/LinearClassifier.java | LinearClassifier.getTopFeatures | public List<Triple<F,L,Double>> getTopFeatures(double threshold, boolean useMagnitude, int numFeatures) {
"""
Returns list of top features with weight above a certain threshold
(list is descending and across all labels)
@param threshold Threshold above which we will count the feature
@param useMagnitude Whethe... | java | public List<Triple<F,L,Double>> getTopFeatures(double threshold, boolean useMagnitude, int numFeatures)
{
return getTopFeatures(null, threshold, useMagnitude, numFeatures, true);
} | [
"public",
"List",
"<",
"Triple",
"<",
"F",
",",
"L",
",",
"Double",
">",
">",
"getTopFeatures",
"(",
"double",
"threshold",
",",
"boolean",
"useMagnitude",
",",
"int",
"numFeatures",
")",
"{",
"return",
"getTopFeatures",
"(",
"null",
",",
"threshold",
",",... | Returns list of top features with weight above a certain threshold
(list is descending and across all labels)
@param threshold Threshold above which we will count the feature
@param useMagnitude Whether the notion of "large" should ignore
the sign of the feature weight.
@param numFeatures How many top features to ret... | [
"Returns",
"list",
"of",
"top",
"features",
"with",
"weight",
"above",
"a",
"certain",
"threshold",
"(",
"list",
"is",
"descending",
"and",
"across",
"all",
"labels",
")"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L435-L438 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByCPDefinitionId | @Override
public List<CPInstance> findByCPDefinitionId(long CPDefinitionId,
int start, int end) {
"""
Returns a range of all the cp instances where CPDefinitionId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are... | java | @Override
public List<CPInstance> findByCPDefinitionId(long CPDefinitionId,
int start, int end) {
return findByCPDefinitionId(CPDefinitionId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPInstance",
">",
"findByCPDefinitionId",
"(",
"long",
"CPDefinitionId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPDefinitionId",
"(",
"CPDefinitionId",
",",
"start",
",",
"end",
",",
"null",
... | Returns a range of all the cp instances where CPDefinitionId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"instances",
"where",
"CPDefinitionId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L2535-L2539 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/util/Strings.java | Strings.isQuoted | private static boolean isQuoted(String value, char quoteChar) {
"""
Return {@code true} if the given string is surrounded by the quote character given, and {@code
false} otherwise.
@param value The string to inspect.
@return {@code true} if the given string is surrounded by the quote character, and {@code
fa... | java | private static boolean isQuoted(String value, char quoteChar) {
return value != null
&& value.length() > 1
&& value.charAt(0) == quoteChar
&& value.charAt(value.length() - 1) == quoteChar;
} | [
"private",
"static",
"boolean",
"isQuoted",
"(",
"String",
"value",
",",
"char",
"quoteChar",
")",
"{",
"return",
"value",
"!=",
"null",
"&&",
"value",
".",
"length",
"(",
")",
">",
"1",
"&&",
"value",
".",
"charAt",
"(",
"0",
")",
"==",
"quoteChar",
... | Return {@code true} if the given string is surrounded by the quote character given, and {@code
false} otherwise.
@param value The string to inspect.
@return {@code true} if the given string is surrounded by the quote character, and {@code
false} otherwise. | [
"Return",
"{",
"@code",
"true",
"}",
"if",
"the",
"given",
"string",
"is",
"surrounded",
"by",
"the",
"quote",
"character",
"given",
"and",
"{",
"@code",
"false",
"}",
"otherwise",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/util/Strings.java#L118-L123 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/TimeZoneNames.java | TimeZoneNames.getDisplayName | public static String getDisplayName(String[][] zoneStrings, String id, boolean daylight, int style) {
"""
Returns the appropriate string from 'zoneStrings'. Used with getZoneStrings.
"""
String[] needle = new String[] { id };
int index = Arrays.binarySearch(zoneStrings, needle, ZONE_STRINGS_COM... | java | public static String getDisplayName(String[][] zoneStrings, String id, boolean daylight, int style) {
String[] needle = new String[] { id };
int index = Arrays.binarySearch(zoneStrings, needle, ZONE_STRINGS_COMPARATOR);
if (index >= 0) {
String[] row = zoneStrings[index];
... | [
"public",
"static",
"String",
"getDisplayName",
"(",
"String",
"[",
"]",
"[",
"]",
"zoneStrings",
",",
"String",
"id",
",",
"boolean",
"daylight",
",",
"int",
"style",
")",
"{",
"String",
"[",
"]",
"needle",
"=",
"new",
"String",
"[",
"]",
"{",
"id",
... | Returns the appropriate string from 'zoneStrings'. Used with getZoneStrings. | [
"Returns",
"the",
"appropriate",
"string",
"from",
"zoneStrings",
".",
"Used",
"with",
"getZoneStrings",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/TimeZoneNames.java#L114-L126 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java | AssertMessages.lowerEqualParameter | @Pure
public static String lowerEqualParameter(int aindex, Object avalue, Object value) {
"""
Parameter A must be lower than or equal to the given value.
@param aindex the index of the parameter A.
@param avalue the value of the parameter A.
@param value the value.
@return the error message.
"""
retur... | java | @Pure
public static String lowerEqualParameter(int aindex, Object avalue, Object value) {
return msg("A11", aindex, avalue, value); //$NON-NLS-1$
} | [
"@",
"Pure",
"public",
"static",
"String",
"lowerEqualParameter",
"(",
"int",
"aindex",
",",
"Object",
"avalue",
",",
"Object",
"value",
")",
"{",
"return",
"msg",
"(",
"\"A11\"",
",",
"aindex",
",",
"avalue",
",",
"value",
")",
";",
"//$NON-NLS-1$",
"}"
] | Parameter A must be lower than or equal to the given value.
@param aindex the index of the parameter A.
@param avalue the value of the parameter A.
@param value the value.
@return the error message. | [
"Parameter",
"A",
"must",
"be",
"lower",
"than",
"or",
"equal",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java#L126-L129 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRActivity.java | LRActivity.addMeasureToVerb | public boolean addMeasureToVerb(String measureType, Number value, Number scaleMin, Number scaleMax, Number sampleSize) {
"""
Add a mesure object to the verb within this activity
@param measureType The name of the type of measure to be added (required)
@param value The value of this measure (required)
@param s... | java | public boolean addMeasureToVerb(String measureType, Number value, Number scaleMin, Number scaleMax, Number sampleSize)
{
Map<String, Object> container = new HashMap<String, Object>();
if (measureType != null)
{
container.put("measureType", measureType);
}
... | [
"public",
"boolean",
"addMeasureToVerb",
"(",
"String",
"measureType",
",",
"Number",
"value",
",",
"Number",
"scaleMin",
",",
"Number",
"scaleMax",
",",
"Number",
"sampleSize",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"container",
"=",
"new",
"Ha... | Add a mesure object to the verb within this activity
@param measureType The name of the type of measure to be added (required)
@param value The value of this measure (required)
@param scaleMin The low end of the scale represented
@param scaleMax The high end of the scale represented
@param sampleSize the number of sam... | [
"Add",
"a",
"mesure",
"object",
"to",
"the",
"verb",
"within",
"this",
"activity"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRActivity.java#L182-L216 |
Ardesco/selenium-standalone-server-plugin | src/main/java/com/lazerycode/selenium/extract/FileExtractor.java | FileExtractor.extractFileFromArchive | public String extractFileFromArchive(File downloadedCompressedFile, String extractedToFilePath, BinaryType possibleFilenames) throws IOException, IllegalArgumentException, MojoFailureException {
"""
Extract binary from a downloaded archive file
@param downloadedCompressedFile The downloaded compressed file
@pa... | java | public String extractFileFromArchive(File downloadedCompressedFile, String extractedToFilePath, BinaryType possibleFilenames) throws IOException, IllegalArgumentException, MojoFailureException {
DownloadableFileType fileType = DownloadableFileType.valueOf(FilenameUtils.getExtension(downloadedCompressedFile.getN... | [
"public",
"String",
"extractFileFromArchive",
"(",
"File",
"downloadedCompressedFile",
",",
"String",
"extractedToFilePath",
",",
"BinaryType",
"possibleFilenames",
")",
"throws",
"IOException",
",",
"IllegalArgumentException",
",",
"MojoFailureException",
"{",
"DownloadableF... | Extract binary from a downloaded archive file
@param downloadedCompressedFile The downloaded compressed file
@param extractedToFilePath Path to extracted file
@param possibleFilenames Names of the files we want to extract
@return boolean
@throws IOException Unable to write to filesystem
@throw... | [
"Extract",
"binary",
"from",
"a",
"downloaded",
"archive",
"file"
] | train | https://github.com/Ardesco/selenium-standalone-server-plugin/blob/e0ecfad426c1a28115cab60def84731d7a4d7e6f/src/main/java/com/lazerycode/selenium/extract/FileExtractor.java#L49-L72 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/Vertigo.java | Vertigo.getCluster | public Vertigo getCluster(String address, Handler<AsyncResult<Cluster>> resultHandler) {
"""
Loads a cluster.
@param address The cluster address.
@param resultHandler An asynchronous handler to be called once complete.
@return The Vertigo instance.
"""
Cluster cluster = new DefaultCluster(address, ver... | java | public Vertigo getCluster(String address, Handler<AsyncResult<Cluster>> resultHandler) {
Cluster cluster = new DefaultCluster(address, vertx, container);
cluster.ping(resultHandler);
return this;
} | [
"public",
"Vertigo",
"getCluster",
"(",
"String",
"address",
",",
"Handler",
"<",
"AsyncResult",
"<",
"Cluster",
">",
">",
"resultHandler",
")",
"{",
"Cluster",
"cluster",
"=",
"new",
"DefaultCluster",
"(",
"address",
",",
"vertx",
",",
"container",
")",
";"... | Loads a cluster.
@param address The cluster address.
@param resultHandler An asynchronous handler to be called once complete.
@return The Vertigo instance. | [
"Loads",
"a",
"cluster",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L299-L303 |
joniles/mpxj | src/main/java/net/sf/mpxj/conceptdraw/ConceptDrawProjectReader.java | ConceptDrawProjectReader.readTask | private void readTask(String projectIdentifier, Map<String, Task> map, Document.Projects.Project.Task task) {
"""
Read a task from a ConceptDraw PROJECT file.
@param projectIdentifier parent project identifier
@param map outline number to task map
@param task ConceptDraw PROJECT task
"""
Task parent... | java | private void readTask(String projectIdentifier, Map<String, Task> map, Document.Projects.Project.Task task)
{
Task parentTask = map.get(getParentOutlineNumber(task.getOutlineNumber()));
Task mpxjTask = parentTask.addTask();
TimeUnit units = task.getBaseDurationTimeUnit();
mpxjTask.setCost(t... | [
"private",
"void",
"readTask",
"(",
"String",
"projectIdentifier",
",",
"Map",
"<",
"String",
",",
"Task",
">",
"map",
",",
"Document",
".",
"Projects",
".",
"Project",
".",
"Task",
"task",
")",
"{",
"Task",
"parentTask",
"=",
"map",
".",
"get",
"(",
"... | Read a task from a ConceptDraw PROJECT file.
@param projectIdentifier parent project identifier
@param map outline number to task map
@param task ConceptDraw PROJECT task | [
"Read",
"a",
"task",
"from",
"a",
"ConceptDraw",
"PROJECT",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/ConceptDrawProjectReader.java#L406-L458 |
google/closure-compiler | src/com/google/javascript/jscomp/MaybeReachingVariableUse.java | MaybeReachingVariableUse.addToUseIfLocal | private void addToUseIfLocal(String name, Node node, ReachingUses use) {
"""
Sets the variable for the given name to the node value in the upward
exposed lattice. Do nothing if the variable name is one of the escaped
variable.
"""
Var var = allVarsInFn.get(name);
if (var == null) {
return;
... | java | private void addToUseIfLocal(String name, Node node, ReachingUses use) {
Var var = allVarsInFn.get(name);
if (var == null) {
return;
}
if (!escaped.contains(var)) {
use.mayUseMap.put(var, node);
}
} | [
"private",
"void",
"addToUseIfLocal",
"(",
"String",
"name",
",",
"Node",
"node",
",",
"ReachingUses",
"use",
")",
"{",
"Var",
"var",
"=",
"allVarsInFn",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"var",
"==",
"null",
")",
"{",
"return",
";",
"}",... | Sets the variable for the given name to the node value in the upward
exposed lattice. Do nothing if the variable name is one of the escaped
variable. | [
"Sets",
"the",
"variable",
"for",
"the",
"given",
"name",
"to",
"the",
"node",
"value",
"in",
"the",
"upward",
"exposed",
"lattice",
".",
"Do",
"nothing",
"if",
"the",
"variable",
"name",
"is",
"one",
"of",
"the",
"escaped",
"variable",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/MaybeReachingVariableUse.java#L308-L316 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java | ContainerGroupsInner.stopAsync | public Observable<Void> stopAsync(String resourceGroupName, String containerGroupName) {
"""
Stops all containers in a container group.
Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
@param resourceGroupName The name of the resource group.
@param contai... | java | public Observable<Void> stopAsync(String resourceGroupName, String containerGroupName) {
return stopWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"stopAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
")",
"{",
"return",
"stopWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroupName",
")",
".",
"map",
"(",
"new",
"Fun... | Stops all containers in a container group.
Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@throws IllegalArgumentException thrown if parameters fa... | [
"Stops",
"all",
"containers",
"in",
"a",
"container",
"group",
".",
"Stops",
"all",
"containers",
"in",
"a",
"container",
"group",
".",
"Compute",
"resources",
"will",
"be",
"deallocated",
"and",
"billing",
"will",
"stop",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java#L1009-L1016 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLNotEqual | public static void assertXMLNotEqual(String err, Reader control, Reader test)
throws SAXException, IOException {
"""
Assert that two XML documents are NOT similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested
@throws SAXEx... | java | public static void assertXMLNotEqual(String err, Reader control, Reader test)
throws SAXException, IOException {
Diff diff = new Diff(control, test);
assertXMLEqual(err, diff, false);
} | [
"public",
"static",
"void",
"assertXMLNotEqual",
"(",
"String",
"err",
",",
"Reader",
"control",
",",
"Reader",
"test",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"Diff",
"diff",
"=",
"new",
"Diff",
"(",
"control",
",",
"test",
")",
";",
"asse... | Assert that two XML documents are NOT similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"NOT",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L356-L360 |
GeoLatte/geolatte-common-hibernate | src/main/java/org/geolatte/common/automapper/ClassLoaderResolver.java | ClassLoaderResolver.newInstance | public ClassLoader newInstance(ClassLoader parent) {
"""
Creates a new <code>ClassLoader</code> instance.
@param parent the parent <code>ClassLoader</code> for the created instance.
@return an instance of the <code>ClassLoader</code> subtype specified in this instance's constructor, having
as parent <code>Cla... | java | public ClassLoader newInstance(ClassLoader parent) {
String msg = "Cannot create a classloader.";
try {
return (ClassLoader) constructor.newInstance(parent);
} catch (InstantiationException e) {
throw new IllegalStateException(msg, e);
} catch (IllegalAccessExcept... | [
"public",
"ClassLoader",
"newInstance",
"(",
"ClassLoader",
"parent",
")",
"{",
"String",
"msg",
"=",
"\"Cannot create a classloader.\"",
";",
"try",
"{",
"return",
"(",
"ClassLoader",
")",
"constructor",
".",
"newInstance",
"(",
"parent",
")",
";",
"}",
"catch"... | Creates a new <code>ClassLoader</code> instance.
@param parent the parent <code>ClassLoader</code> for the created instance.
@return an instance of the <code>ClassLoader</code> subtype specified in this instance's constructor, having
as parent <code>ClassLoader</code> the instance specified in the <code>parent</code> ... | [
"Creates",
"a",
"new",
"<code",
">",
"ClassLoader<",
"/",
"code",
">",
"instance",
"."
] | train | https://github.com/GeoLatte/geolatte-common-hibernate/blob/2e871c70e506df2485d91152fbd0955c94de1d39/src/main/java/org/geolatte/common/automapper/ClassLoaderResolver.java#L65-L77 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.createAllOrganizations | private void createAllOrganizations(Map<String, JsonObject> foundCertificateAuthorities) throws NetworkConfigurationException {
"""
Creates JsonObjects representing all the Organizations defined in the config file
"""
// Sanity check
if (organizations != null) {
throw new NetworkCo... | java | private void createAllOrganizations(Map<String, JsonObject> foundCertificateAuthorities) throws NetworkConfigurationException {
// Sanity check
if (organizations != null) {
throw new NetworkConfigurationException("INTERNAL ERROR: organizations has already been initialized!");
}
... | [
"private",
"void",
"createAllOrganizations",
"(",
"Map",
"<",
"String",
",",
"JsonObject",
">",
"foundCertificateAuthorities",
")",
"throws",
"NetworkConfigurationException",
"{",
"// Sanity check",
"if",
"(",
"organizations",
"!=",
"null",
")",
"{",
"throw",
"new",
... | Creates JsonObjects representing all the Organizations defined in the config file | [
"Creates",
"JsonObjects",
"representing",
"all",
"the",
"Organizations",
"defined",
"in",
"the",
"config",
"file"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L591-L618 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/TextGenerator.java | TextGenerator.generateMarkov | public String generateMarkov(int length, int context, String seed) {
"""
Generate markov string.
@param length the length
@param context the context
@param seed the seed
@return the string
"""
String str = seed;
while (str.length() < length) {
String prefix = str.substring(Math.max(str.... | java | public String generateMarkov(int length, int context, String seed) {
String str = seed;
while (str.length() < length) {
String prefix = str.substring(Math.max(str.length() - context, 0), str.length());
TrieNode node = inner.matchPredictor(prefix);
long cursorCount = node.getCursorCount();
... | [
"public",
"String",
"generateMarkov",
"(",
"int",
"length",
",",
"int",
"context",
",",
"String",
"seed",
")",
"{",
"String",
"str",
"=",
"seed",
";",
"while",
"(",
"str",
".",
"length",
"(",
")",
"<",
"length",
")",
"{",
"String",
"prefix",
"=",
"st... | Generate markov string.
@param length the length
@param context the context
@param seed the seed
@return the string | [
"Generate",
"markov",
"string",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/TextGenerator.java#L53-L80 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/crf/CRFCliqueTree.java | CRFCliqueTree.logProb | public double logProb(int position, int[] labels) {
"""
returns the log probability for the given labels (indexed using
classIndex), where the last label corresponds to the label at the specified
position. For instance if you called logProb(5, {1,2,3}) it will return the
marginal log prob that the label at posi... | java | public double logProb(int position, int[] labels) {
if (labels.length < windowSize) {
return factorTables[position].unnormalizedLogProbEnd(labels) - z;
} else if (labels.length == windowSize) {
return factorTables[position].unnormalizedLogProb(labels) - z;
} else {
int[] l = new int[... | [
"public",
"double",
"logProb",
"(",
"int",
"position",
",",
"int",
"[",
"]",
"labels",
")",
"{",
"if",
"(",
"labels",
".",
"length",
"<",
"windowSize",
")",
"{",
"return",
"factorTables",
"[",
"position",
"]",
".",
"unnormalizedLogProbEnd",
"(",
"labels",
... | returns the log probability for the given labels (indexed using
classIndex), where the last label corresponds to the label at the specified
position. For instance if you called logProb(5, {1,2,3}) it will return the
marginal log prob that the label at position 3 is 1, the label at position
4 is 2 and the label at posit... | [
"returns",
"the",
"log",
"probability",
"for",
"the",
"given",
"labels",
"(",
"indexed",
"using",
"classIndex",
")",
"where",
"the",
"last",
"label",
"corresponds",
"to",
"the",
"label",
"at",
"the",
"specified",
"position",
".",
"For",
"instance",
"if",
"yo... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFCliqueTree.java#L262-L282 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.cursorRowToContentValues | public static void cursorRowToContentValues(Cursor cursor, ContentValues values) {
"""
Read the entire contents of a cursor row and store them in a ContentValues.
@param cursor the cursor to read from.
@param values the {@link ContentValues} to put the row into.
"""
String[] columns = cursor.getCol... | java | public static void cursorRowToContentValues(Cursor cursor, ContentValues values) {
String[] columns = cursor.getColumnNames();
int length = columns.length;
for (int i = 0; i < length; i++) {
if (cursor.getType(i) == Cursor.FIELD_TYPE_BLOB) {
values.put(columns[i], cur... | [
"public",
"static",
"void",
"cursorRowToContentValues",
"(",
"Cursor",
"cursor",
",",
"ContentValues",
"values",
")",
"{",
"String",
"[",
"]",
"columns",
"=",
"cursor",
".",
"getColumnNames",
"(",
")",
";",
"int",
"length",
"=",
"columns",
".",
"length",
";"... | Read the entire contents of a cursor row and store them in a ContentValues.
@param cursor the cursor to read from.
@param values the {@link ContentValues} to put the row into. | [
"Read",
"the",
"entire",
"contents",
"of",
"a",
"cursor",
"row",
"and",
"store",
"them",
"in",
"a",
"ContentValues",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L735-L745 |
infinispan/infinispan | counter/src/main/java/org/infinispan/counter/impl/strong/AbstractStrongCounter.java | AbstractStrongCounter.removeStrongCounter | public static void removeStrongCounter(Cache<StrongCounterKey, CounterValue> cache, String counterName) {
"""
It removes a strong counter from the {@code cache}, identified by the {@code counterName}.
@param cache The {@link Cache} to remove the counter from.
@param counterName The counter's name.
""... | java | public static void removeStrongCounter(Cache<StrongCounterKey, CounterValue> cache, String counterName) {
cache.remove(new StrongCounterKey(counterName));
} | [
"public",
"static",
"void",
"removeStrongCounter",
"(",
"Cache",
"<",
"StrongCounterKey",
",",
"CounterValue",
">",
"cache",
",",
"String",
"counterName",
")",
"{",
"cache",
".",
"remove",
"(",
"new",
"StrongCounterKey",
"(",
"counterName",
")",
")",
";",
"}"
... | It removes a strong counter from the {@code cache}, identified by the {@code counterName}.
@param cache The {@link Cache} to remove the counter from.
@param counterName The counter's name. | [
"It",
"removes",
"a",
"strong",
"counter",
"from",
"the",
"{",
"@code",
"cache",
"}",
"identified",
"by",
"the",
"{",
"@code",
"counterName",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/impl/strong/AbstractStrongCounter.java#L84-L86 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java | QPath.makeChildPath | public static QPath makeChildPath(final QPath parent, final QName name, final int itemIndex) {
"""
Make child path using QName and Item index. <br>
@param parent
- parent QPath
@param name
- Item QName
@param itemIndex
- Item index
@return new QPath
"""
QPathEntry[] parentEntries = parent.getEn... | java | public static QPath makeChildPath(final QPath parent, final QName name, final int itemIndex)
{
QPathEntry[] parentEntries = parent.getEntries();
QPathEntry[] names = new QPathEntry[parentEntries.length + 1];
int index = 0;
for (QPathEntry pname : parentEntries)
{
names[index++... | [
"public",
"static",
"QPath",
"makeChildPath",
"(",
"final",
"QPath",
"parent",
",",
"final",
"QName",
"name",
",",
"final",
"int",
"itemIndex",
")",
"{",
"QPathEntry",
"[",
"]",
"parentEntries",
"=",
"parent",
".",
"getEntries",
"(",
")",
";",
"QPathEntry",
... | Make child path using QName and Item index. <br>
@param parent
- parent QPath
@param name
- Item QName
@param itemIndex
- Item index
@return new QPath | [
"Make",
"child",
"path",
"using",
"QName",
"and",
"Item",
"index",
".",
"<br",
">"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java#L425-L439 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java | WatchUtil.createAll | public static WatchMonitor createAll(File file, int maxDepth, Watcher watcher) {
"""
创建并初始化监听,监听所有事件
@param file 被监听文件
@param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录
@param watcher {@link Watcher}
@return {@link WatchMonitor}
"""
return createAll(file.toPath(), 0, watcher);
} | java | public static WatchMonitor createAll(File file, int maxDepth, Watcher watcher) {
return createAll(file.toPath(), 0, watcher);
} | [
"public",
"static",
"WatchMonitor",
"createAll",
"(",
"File",
"file",
",",
"int",
"maxDepth",
",",
"Watcher",
"watcher",
")",
"{",
"return",
"createAll",
"(",
"file",
".",
"toPath",
"(",
")",
",",
"0",
",",
"watcher",
")",
";",
"}"
] | 创建并初始化监听,监听所有事件
@param file 被监听文件
@param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录
@param watcher {@link Watcher}
@return {@link WatchMonitor} | [
"创建并初始化监听,监听所有事件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java#L201-L203 |
RallyTools/RallyRestToolkitForJava | src/main/java/com/rallydev/rest/request/GetRequest.java | GetRequest.toUrl | @Override
public String toUrl() {
"""
<p>Convert this request into a url compatible with the WSAPI.</p>
The current fetch and any other parameters will be included.
@return the url representing this request.
"""
List<NameValuePair> params = new ArrayList<NameValuePair>(getParams());
par... | java | @Override
public String toUrl() {
List<NameValuePair> params = new ArrayList<NameValuePair>(getParams());
params.add(new BasicNameValuePair("fetch", fetch.toString()));
return String.format("%s.js?%s", getEndpoint(),
URLEncodedUtils.format(params, "utf-8"));
} | [
"@",
"Override",
"public",
"String",
"toUrl",
"(",
")",
"{",
"List",
"<",
"NameValuePair",
">",
"params",
"=",
"new",
"ArrayList",
"<",
"NameValuePair",
">",
"(",
"getParams",
"(",
")",
")",
";",
"params",
".",
"add",
"(",
"new",
"BasicNameValuePair",
"(... | <p>Convert this request into a url compatible with the WSAPI.</p>
The current fetch and any other parameters will be included.
@return the url representing this request. | [
"<p",
">",
"Convert",
"this",
"request",
"into",
"a",
"url",
"compatible",
"with",
"the",
"WSAPI",
".",
"<",
"/",
"p",
">",
"The",
"current",
"fetch",
"and",
"any",
"other",
"parameters",
"will",
"be",
"included",
"."
] | train | https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/request/GetRequest.java#L55-L61 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/FmtNumber.java | FmtNumber.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or not a Number, or if an invalid decimalFormat String was supplied
"""
validateInputNotNull(value, context);
if( !(value instanceof Number) ) {
throw ne... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if( !(value instanceof Number) ) {
throw new SuperCsvCellProcessorException(Number.class, value, context, this);
}
// create a new DecimalFormat if one is not supplied
final DecimalFormat decim... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"Number",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or not a Number, or if an invalid decimalFormat String was supplied | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/FmtNumber.java#L160-L179 |
JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.addRecurringSavings | public DateTimeZoneBuilder addRecurringSavings(String nameKey, int saveMillis,
int fromYear, int toYear,
char mode,
int monthOfYear,
... | java | public DateTimeZoneBuilder addRecurringSavings(String nameKey, int saveMillis,
int fromYear, int toYear,
char mode,
int monthOfYear,
... | [
"public",
"DateTimeZoneBuilder",
"addRecurringSavings",
"(",
"String",
"nameKey",
",",
"int",
"saveMillis",
",",
"int",
"fromYear",
",",
"int",
"toYear",
",",
"char",
"mode",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
",",
"int",
"dayOfWeek",
",",
"b... | Add a recurring daylight saving time rule.
@param nameKey the name key of new rule
@param saveMillis the milliseconds to add to standard offset
@param fromYear the first year that rule is in effect, MIN_VALUE indicates
beginning of time
@param toYear the last year (inclusive) that rule is in effect, MAX_VALUE
indi... | [
"Add",
"a",
"recurring",
"daylight",
"saving",
"time",
"rule",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L301-L318 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java | StreamingEndpointsInner.listAsync | public Observable<Page<StreamingEndpointInner>> listAsync(final String resourceGroupName, final String accountName) {
"""
List StreamingEndpoints.
Lists the StreamingEndpoints in the account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Se... | java | public Observable<Page<StreamingEndpointInner>> listAsync(final String resourceGroupName, final String accountName) {
return listWithServiceResponseAsync(resourceGroupName, accountName)
.map(new Func1<ServiceResponse<Page<StreamingEndpointInner>>, Page<StreamingEndpointInner>>() {
@O... | [
"public",
"Observable",
"<",
"Page",
"<",
"StreamingEndpointInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountNa... | List StreamingEndpoints.
Lists the StreamingEndpoints in the account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedL... | [
"List",
"StreamingEndpoints",
".",
"Lists",
"the",
"StreamingEndpoints",
"in",
"the",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java#L181-L189 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericMessageImpl.java | GenericMessageImpl.parseMessage | public boolean parseMessage(WsByteBuffer buffer, boolean bExtractValue) throws Exception {
"""
Parse a message from the input buffer. The input flag is whether or not
to save the header value immediately or delay the extraction until the
header value is queried.
@param buffer
@param bExtractValue
@return bo... | java | public boolean parseMessage(WsByteBuffer buffer, boolean bExtractValue) throws Exception {
final boolean bTrace = TraceComponent.isAnyTracingEnabled();
boolean rc = false;
if (!isFirstLineComplete()) {
if (bTrace && tc.isDebugEnabled()) {
Tr.debug(tc, "Parsing First L... | [
"public",
"boolean",
"parseMessage",
"(",
"WsByteBuffer",
"buffer",
",",
"boolean",
"bExtractValue",
")",
"throws",
"Exception",
"{",
"final",
"boolean",
"bTrace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"boolean",
"rc",
"=",
"false",
"... | Parse a message from the input buffer. The input flag is whether or not
to save the header value immediately or delay the extraction until the
header value is queried.
@param buffer
@param bExtractValue
@return boolean (true means parsed entire message)
@throws Exception | [
"Parse",
"a",
"message",
"from",
"the",
"input",
"buffer",
".",
"The",
"input",
"flag",
"is",
"whether",
"or",
"not",
"to",
"save",
"the",
"header",
"value",
"immediately",
"or",
"delay",
"the",
"extraction",
"until",
"the",
"header",
"value",
"is",
"queri... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericMessageImpl.java#L328-L349 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberingSystem.java | NumberingSystem.getInstance | private static NumberingSystem getInstance(String name_in, int radix_in, boolean isAlgorithmic_in, String desc_in ) {
"""
Factory method for creating a numbering system.
@param name_in The string representing the name of the numbering system.
@param radix_in The radix for this numbering system. ICU currently
s... | java | private static NumberingSystem getInstance(String name_in, int radix_in, boolean isAlgorithmic_in, String desc_in ) {
if ( radix_in < 2 ) {
throw new IllegalArgumentException("Invalid radix for numbering system");
}
if ( !isAlgorithmic_in ) {
if ( desc_in.length() != rad... | [
"private",
"static",
"NumberingSystem",
"getInstance",
"(",
"String",
"name_in",
",",
"int",
"radix_in",
",",
"boolean",
"isAlgorithmic_in",
",",
"String",
"desc_in",
")",
"{",
"if",
"(",
"radix_in",
"<",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException"... | Factory method for creating a numbering system.
@param name_in The string representing the name of the numbering system.
@param radix_in The radix for this numbering system. ICU currently
supports only numbering systems whose radix is 10.
@param isAlgorithmic_in Specifies whether the numbering system is algorithmic
(t... | [
"Factory",
"method",
"for",
"creating",
"a",
"numbering",
"system",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberingSystem.java#L82-L98 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java | Debugger.printError | public static void printError(Object caller, Object message) {
"""
Print a error message.
The stack trace will be printed if
the given message is an exception.
@param caller the calling object
@param message the message/object to print
"""
StringBuilder text = new StringBuilder();
Class<?> c = ... | java | public static void printError(Object caller, Object message)
{
StringBuilder text = new StringBuilder();
Class<?> c = callerBuilder(caller, text);
if(message instanceof Throwable)
getLog(c).error(text.append(stackTrace((Throwable)message)));
else
getLog(c).error(text.append(message));
... | [
"public",
"static",
"void",
"printError",
"(",
"Object",
"caller",
",",
"Object",
"message",
")",
"{",
"StringBuilder",
"text",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Class",
"<",
"?",
">",
"c",
"=",
"callerBuilder",
"(",
"caller",
",",
"text",
")"... | Print a error message.
The stack trace will be printed if
the given message is an exception.
@param caller the calling object
@param message the message/object to print | [
"Print",
"a",
"error",
"message",
".",
"The",
"stack",
"trace",
"will",
"be",
"printed",
"if",
"the",
"given",
"message",
"is",
"an",
"exception",
"."
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java#L411-L423 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java | IntentUtils.sendMessage | public static void sendMessage(final Context context, final String subject, final String body, final String toAddress) {
"""
Starts a {@code ACTION_SENDTO} system {@code Intent} used to create a message (email, sms, text, etc).
@param subject Optional subject line.
@param body Optional message body.
@par... | java | public static void sendMessage(final Context context, final String subject, final String body, final String toAddress) {
final Intent intent;
if (toAddress != null && !"".equals(toAddress)) {
intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", toAddress, null));
} else ... | [
"public",
"static",
"void",
"sendMessage",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"subject",
",",
"final",
"String",
"body",
",",
"final",
"String",
"toAddress",
")",
"{",
"final",
"Intent",
"intent",
";",
"if",
"(",
"toAddress",
"!=",
... | Starts a {@code ACTION_SENDTO} system {@code Intent} used to create a message (email, sms, text, etc).
@param subject Optional subject line.
@param body Optional message body.
@param toAddress Optional "to" address. | [
"Starts",
"a",
"{"
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java#L113-L128 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_timeConditions_conditions_GET | public ArrayList<Long> billingAccount_easyHunting_serviceName_timeConditions_conditions_GET(String billingAccount, String serviceName, OvhTimeConditionsPolicyEnum policy) throws IOException {
"""
Time conditions checked when a call is received
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/time... | java | public ArrayList<Long> billingAccount_easyHunting_serviceName_timeConditions_conditions_GET(String billingAccount, String serviceName, OvhTimeConditionsPolicyEnum policy) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions";
StringBuilder sb = path(qP... | [
"public",
"ArrayList",
"<",
"Long",
">",
"billingAccount_easyHunting_serviceName_timeConditions_conditions_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhTimeConditionsPolicyEnum",
"policy",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Time conditions checked when a call is received
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions
@param policy [required] Filter the value of policy property (=)
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Time",
"conditions",
"checked",
"when",
"a",
"call",
"is",
"received"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3369-L3375 |
mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Main.java | Main.readFileOrUrl | private static Object readFileOrUrl(String path, boolean convertToString)
throws IOException {
"""
Read file or url specified by <tt>path</tt>.
@return file or url content as <tt>byte[]</tt> or as <tt>String</tt> if
<tt>convertToString</tt> is true.
"""
return SourceReader.readFileOrUrl(p... | java | private static Object readFileOrUrl(String path, boolean convertToString)
throws IOException
{
return SourceReader.readFileOrUrl(path, convertToString,
shellContextFactory.getCharacterEncoding());
} | [
"private",
"static",
"Object",
"readFileOrUrl",
"(",
"String",
"path",
",",
"boolean",
"convertToString",
")",
"throws",
"IOException",
"{",
"return",
"SourceReader",
".",
"readFileOrUrl",
"(",
"path",
",",
"convertToString",
",",
"shellContextFactory",
".",
"getCha... | Read file or url specified by <tt>path</tt>.
@return file or url content as <tt>byte[]</tt> or as <tt>String</tt> if
<tt>convertToString</tt> is true. | [
"Read",
"file",
"or",
"url",
"specified",
"by",
"<tt",
">",
"path<",
"/",
"tt",
">",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Main.java#L698-L703 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java | Whitebox.getInternalState | public static <T> T getInternalState(Object object, String fieldName, Class<?> where) {
"""
Get the value of a field using reflection. Use this method when you need
to specify in which class the field is declared. This might be useful
when you have mocked the instance you are trying to access.
@param object
... | java | public static <T> T getInternalState(Object object, String fieldName, Class<?> where) {
return WhiteboxImpl.getInternalState(object, fieldName, where);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getInternalState",
"(",
"Object",
"object",
",",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"where",
")",
"{",
"return",
"WhiteboxImpl",
".",
"getInternalState",
"(",
"object",
",",
"fieldName",
",",
"where... | Get the value of a field using reflection. Use this method when you need
to specify in which class the field is declared. This might be useful
when you have mocked the instance you are trying to access.
@param object
the object to modify
@param fieldName
the name of the field
@param where
which class the field is defi... | [
"Get",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
".",
"Use",
"this",
"method",
"when",
"you",
"need",
"to",
"specify",
"in",
"which",
"class",
"the",
"field",
"is",
"declared",
".",
"This",
"might",
"be",
"useful",
"when",
"you",
"have",... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L307-L309 |
spring-projects/spring-social-facebook | spring-social-facebook/src/main/java/org/springframework/social/facebook/api/FqlResult.java | FqlResult.getInteger | public Integer getInteger(String fieldName) {
"""
Returns the value of the identified field as an Integer.
@param fieldName the name of the field
@return the value of the field as an Integer
@throws FqlException if the field cannot be expressed as an Integer
"""
try {
return hasValue(fieldName) ? Integ... | java | public Integer getInteger(String fieldName) {
try {
return hasValue(fieldName) ? Integer.valueOf(String.valueOf(resultMap.get(fieldName))) : null;
} catch (NumberFormatException e) {
throw new FqlException("Field '" + fieldName +"' is not a number.", e);
}
} | [
"public",
"Integer",
"getInteger",
"(",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"hasValue",
"(",
"fieldName",
")",
"?",
"Integer",
".",
"valueOf",
"(",
"String",
".",
"valueOf",
"(",
"resultMap",
".",
"get",
"(",
"fieldName",
")",
")",
")"... | Returns the value of the identified field as an Integer.
@param fieldName the name of the field
@return the value of the field as an Integer
@throws FqlException if the field cannot be expressed as an Integer | [
"Returns",
"the",
"value",
"of",
"the",
"identified",
"field",
"as",
"an",
"Integer",
"."
] | train | https://github.com/spring-projects/spring-social-facebook/blob/ae2234d94367eaa3adbba251ec7790d5ba7ffa41/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/FqlResult.java#L55-L61 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryService.java | GeometryService.isValid | public static boolean isValid(Geometry geometry, GeometryIndex index) {
"""
Validates a geometry, focusing on changes at a specific sub-level of the geometry. The sublevel is indicated by
passing an index. The only checks are on intersection and containment, we don't check on too few coordinates as
we want to su... | java | public static boolean isValid(Geometry geometry, GeometryIndex index) {
validate(geometry, index);
return validationContext.isValid();
} | [
"public",
"static",
"boolean",
"isValid",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"{",
"validate",
"(",
"geometry",
",",
"index",
")",
";",
"return",
"validationContext",
".",
"isValid",
"(",
")",
";",
"}"
] | Validates a geometry, focusing on changes at a specific sub-level of the geometry. The sublevel is indicated by
passing an index. The only checks are on intersection and containment, we don't check on too few coordinates as
we want to support incremental creation of polygons.
@param geometry The geometry to check.
@pa... | [
"Validates",
"a",
"geometry",
"focusing",
"on",
"changes",
"at",
"a",
"specific",
"sub",
"-",
"level",
"of",
"the",
"geometry",
".",
"The",
"sublevel",
"is",
"indicated",
"by",
"passing",
"an",
"index",
".",
"The",
"only",
"checks",
"are",
"on",
"intersect... | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryService.java#L276-L279 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getInterpolatedString | public String getInterpolatedString(String name, String defaultValue) {
"""
Returns a string value that has been interpolated from System Properties
and Environment Variables using the ${name} or @{name} syntax.
@param name
@param defaultValue
@return an interpolated string
"""
String value = get... | java | public String getInterpolatedString(String name, String defaultValue) {
String value = getString(name, defaultValue);
return interpolateString(value);
} | [
"public",
"String",
"getInterpolatedString",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"defaultValue",
")",
";",
"return",
"interpolateString",
"(",
"value",
")",
";",
"}"
] | Returns a string value that has been interpolated from System Properties
and Environment Variables using the ${name} or @{name} syntax.
@param name
@param defaultValue
@return an interpolated string | [
"Returns",
"a",
"string",
"value",
"that",
"has",
"been",
"interpolated",
"from",
"System",
"Properties",
"and",
"Environment",
"Variables",
"using",
"the",
"$",
"{",
"name",
"}",
"or",
"@",
"{",
"name",
"}",
"syntax",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L463-L466 |
rythmengine/rythmengine | src/main/java/org/rythmengine/Rythm.java | Rythm.getTemplate | public static final ITemplate getTemplate(String tmpl, Object ... args) {
"""
get a template with the given params
@param tmpl
@param args
@return the template
"""
return engine().getTemplate(tmpl, args);
} | java | public static final ITemplate getTemplate(String tmpl, Object ... args) {
return engine().getTemplate(tmpl, args);
} | [
"public",
"static",
"final",
"ITemplate",
"getTemplate",
"(",
"String",
"tmpl",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"engine",
"(",
")",
".",
"getTemplate",
"(",
"tmpl",
",",
"args",
")",
";",
"}"
] | get a template with the given params
@param tmpl
@param args
@return the template | [
"get",
"a",
"template",
"with",
"the",
"given",
"params"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/Rythm.java#L279-L281 |
scireum/s3ninja | src/main/java/ninja/StoredObject.java | StoredObject.storeProperties | public void storeProperties(Map<String, String> properties) throws IOException {
"""
Stores the given meta infos for the stored object.
@param properties properties to store
@throws IOException in case of an IO error
"""
Properties props = new Properties();
properties.forEach(props::setProp... | java | public void storeProperties(Map<String, String> properties) throws IOException {
Properties props = new Properties();
properties.forEach(props::setProperty);
try (FileOutputStream out = new FileOutputStream(getPropertiesFile())) {
props.store(out, "");
}
} | [
"public",
"void",
"storeProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"throws",
"IOException",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"forEach",
"(",
"props",
"::",
"setPropert... | Stores the given meta infos for the stored object.
@param properties properties to store
@throws IOException in case of an IO error | [
"Stores",
"the",
"given",
"meta",
"infos",
"for",
"the",
"stored",
"object",
"."
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/StoredObject.java#L134-L140 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.addValue | private static void addValue(CBuilder builder, ColumnDefinition def, ByteBuffer value) throws InvalidRequestException {
"""
Adds the specified value to the specified builder
@param builder the CBuilder to which the value must be added
@param def the column associated to the value
@param value the value to add... | java | private static void addValue(CBuilder builder, ColumnDefinition def, ByteBuffer value) throws InvalidRequestException
{
if (value == null)
throw new InvalidRequestException(String.format("Invalid null value in condition for column %s", def.name));
builder.add(value);
} | [
"private",
"static",
"void",
"addValue",
"(",
"CBuilder",
"builder",
",",
"ColumnDefinition",
"def",
",",
"ByteBuffer",
"value",
")",
"throws",
"InvalidRequestException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"InvalidRequestException",
"(",
... | Adds the specified value to the specified builder
@param builder the CBuilder to which the value must be added
@param def the column associated to the value
@param value the value to add
@throws InvalidRequestException if the value is null | [
"Adds",
"the",
"specified",
"value",
"to",
"the",
"specified",
"builder"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L992-L997 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Stage.java | Stage.actorFor | public Protocols actorFor(final Class<?>[] protocols, final Class<? extends Actor> type, final Object...parameters) {
"""
Answers a {@code Protocols} that provides one or more supported {@code protocols} for the
newly created {@code Actor} according to {@code definition}.
@param protocols the {@code Class<?>}[] ... | java | public Protocols actorFor(final Class<?>[] protocols, final Class<? extends Actor> type, final Object...parameters) {
return actorFor(protocols, Definition.has(type, Arrays.asList(parameters)));
} | [
"public",
"Protocols",
"actorFor",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"protocols",
",",
"final",
"Class",
"<",
"?",
"extends",
"Actor",
">",
"type",
",",
"final",
"Object",
"...",
"parameters",
")",
"{",
"return",
"actorFor",
"(",
"protocols... | Answers a {@code Protocols} that provides one or more supported {@code protocols} for the
newly created {@code Actor} according to {@code definition}.
@param protocols the {@code Class<?>}[] array of protocols that the {@code Actor} supports
@param type the {@code Class<? extends Actor>} of the {@code Actor} to create
... | [
"Answers",
"a",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L187-L189 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.createActivityOnScope | public ActivityImpl createActivityOnScope(Element activityElement, ScopeImpl scopeElement) {
"""
Parses the generic information of an activity element (id, name,
documentation, etc.), and creates a new {@link ActivityImpl} on the given
scope element.
"""
String id = activityElement.attribute("id");
... | java | public ActivityImpl createActivityOnScope(Element activityElement, ScopeImpl scopeElement) {
String id = activityElement.attribute("id");
LOG.parsingElement("activity", id);
ActivityImpl activity = scopeElement.createActivity(id);
activity.setProperty("name", activityElement.attribute("name"));
ac... | [
"public",
"ActivityImpl",
"createActivityOnScope",
"(",
"Element",
"activityElement",
",",
"ScopeImpl",
"scopeElement",
")",
"{",
"String",
"id",
"=",
"activityElement",
".",
"attribute",
"(",
"\"id\"",
")",
";",
"LOG",
".",
"parsingElement",
"(",
"\"activity\"",
... | Parses the generic information of an activity element (id, name,
documentation, etc.), and creates a new {@link ActivityImpl} on the given
scope element. | [
"Parses",
"the",
"generic",
"information",
"of",
"an",
"activity",
"element",
"(",
"id",
"name",
"documentation",
"etc",
".",
")",
"and",
"creates",
"a",
"new",
"{"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1770-L1789 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java | DataLakeStoreAccountsInner.addAsync | public Observable<Void> addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) {
"""
Updates the specified Data Lake Analytics account to include the additional Data Lake Store account.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name o... | java | public Observable<Void> addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) {
return addWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(Service... | [
"public",
"Observable",
"<",
"Void",
">",
"addAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"dataLakeStoreAccountName",
")",
"{",
"return",
"addWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"da... | Updates the specified Data Lake Analytics account to include the additional Data Lake Store account.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@param dataLakeStoreAccountName The name of the Data Lake Store account to add.
@throws Ill... | [
"Updates",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"to",
"include",
"the",
"additional",
"Data",
"Lake",
"Store",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java#L399-L406 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java | WebUtilities.renderWithTransformToHTML | public static String renderWithTransformToHTML(final Request request, final WComponent component, final boolean includePageShell) {
"""
Renders and transforms the given WComponent to a HTML String outside of the context of a Servlet.
@param request the request being responded to
@param component the root WComp... | java | public static String renderWithTransformToHTML(final Request request, final WComponent component, final boolean includePageShell) {
// Setup a context (if needed)
boolean needsContext = UIContextHolder.getCurrent() == null;
if (needsContext) {
UIContextHolder.pushContext(new UIContextImpl());
}
try {
... | [
"public",
"static",
"String",
"renderWithTransformToHTML",
"(",
"final",
"Request",
"request",
",",
"final",
"WComponent",
"component",
",",
"final",
"boolean",
"includePageShell",
")",
"{",
"// Setup a context (if needed)",
"boolean",
"needsContext",
"=",
"UIContextHolde... | Renders and transforms the given WComponent to a HTML String outside of the context of a Servlet.
@param request the request being responded to
@param component the root WComponent to render
@param includePageShell true if include page shell
@return the rendered output as a String. | [
"Renders",
"and",
"transforms",
"the",
"given",
"WComponent",
"to",
"a",
"HTML",
"String",
"outside",
"of",
"the",
"context",
"of",
"a",
"Servlet",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java#L766-L801 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageRequest.java | SendUsersMessageRequest.withContext | public SendUsersMessageRequest withContext(java.util.Map<String, String> context) {
"""
A map of custom attribute-value pairs. Amazon Pinpoint adds these attributes to the data.pinpoint object in the
body of the push notification payload. Amazon Pinpoint also provides these attributes in the events that it
gener... | java | public SendUsersMessageRequest withContext(java.util.Map<String, String> context) {
setContext(context);
return this;
} | [
"public",
"SendUsersMessageRequest",
"withContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"context",
")",
"{",
"setContext",
"(",
"context",
")",
";",
"return",
"this",
";",
"}"
] | A map of custom attribute-value pairs. Amazon Pinpoint adds these attributes to the data.pinpoint object in the
body of the push notification payload. Amazon Pinpoint also provides these attributes in the events that it
generates for users-messages deliveries.
@param context
A map of custom attribute-value pairs. Amaz... | [
"A",
"map",
"of",
"custom",
"attribute",
"-",
"value",
"pairs",
".",
"Amazon",
"Pinpoint",
"adds",
"these",
"attributes",
"to",
"the",
"data",
".",
"pinpoint",
"object",
"in",
"the",
"body",
"of",
"the",
"push",
"notification",
"payload",
".",
"Amazon",
"P... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageRequest.java#L86-L89 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/NoCompTreeMap.java | NoCompTreeMap.remove_node | private final V remove_node(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son) {
"""
right (son == 1) link. Returns the old value attached to node.
"""
if(node.left == null)
return remove_semi_leaf(node, prev, son, node.right);
if(node.right == null)
return remove_semi_leaf(node, prev, son, nod... | java | private final V remove_node(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son) {
if(node.left == null)
return remove_semi_leaf(node, prev, son, node.right);
if(node.right == null)
return remove_semi_leaf(node, prev, son, node.left);
// The BinTreeNode to replace node in the tree. This is either the
/... | [
"private",
"final",
"V",
"remove_node",
"(",
"BinTreeNode",
"<",
"K",
",",
"V",
">",
"node",
",",
"BinTreeNode",
"<",
"K",
",",
"V",
">",
"prev",
",",
"int",
"son",
")",
"{",
"if",
"(",
"node",
".",
"left",
"==",
"null",
")",
"return",
"remove_semi... | right (son == 1) link. Returns the old value attached to node. | [
"right",
"(",
"son",
"==",
"1",
")",
"link",
".",
"Returns",
"the",
"old",
"value",
"attached",
"to",
"node",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L184-L198 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java | GenericLogicDiscoverer.findServicesProducingSome | @Override
public Map<URI, MatchResult> findServicesProducingSome(Set<URI> outputTypes) {
"""
Discover registered services that produce some (i.e., at least one) of the types of output provided. That is, all
those for which at least one output can be matched to the output types provided.
@param outputTypes ... | java | @Override
public Map<URI, MatchResult> findServicesProducingSome(Set<URI> outputTypes) {
return findServicesProducingSome(outputTypes, LogicConceptMatchType.Plugin);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"findServicesProducingSome",
"(",
"Set",
"<",
"URI",
">",
"outputTypes",
")",
"{",
"return",
"findServicesProducingSome",
"(",
"outputTypes",
",",
"LogicConceptMatchType",
".",
"Plugin",
")",
... | Discover registered services that produce some (i.e., at least one) of the types of output provided. That is, all
those for which at least one output can be matched to the output types provided.
@param outputTypes the types of output to be produced
@return a Set containing all the matching services. If there are no so... | [
"Discover",
"registered",
"services",
"that",
"produce",
"some",
"(",
"i",
".",
"e",
".",
"at",
"least",
"one",
")",
"of",
"the",
"types",
"of",
"output",
"provided",
".",
"That",
"is",
"all",
"those",
"for",
"which",
"at",
"least",
"one",
"output",
"c... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java#L418-L421 |
netty/netty | buffer/src/main/java/io/netty/buffer/Unpooled.java | Unpooled.wrappedBuffer | public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers) {
"""
Creates a new big-endian composite buffer which wraps the slices of the specified
NIO buffers without copying them. A modification on the content of the
specified buffers will be visible to the returned buffer.
"""
... | java | public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers) {
return wrappedBuffer(maxNumComponents, CompositeByteBuf.BYTE_BUFFER_WRAPPER, buffers);
} | [
"public",
"static",
"ByteBuf",
"wrappedBuffer",
"(",
"int",
"maxNumComponents",
",",
"ByteBuffer",
"...",
"buffers",
")",
"{",
"return",
"wrappedBuffer",
"(",
"maxNumComponents",
",",
"CompositeByteBuf",
".",
"BYTE_BUFFER_WRAPPER",
",",
"buffers",
")",
";",
"}"
] | Creates a new big-endian composite buffer which wraps the slices of the specified
NIO buffers without copying them. A modification on the content of the
specified buffers will be visible to the returned buffer. | [
"Creates",
"a",
"new",
"big",
"-",
"endian",
"composite",
"buffer",
"which",
"wraps",
"the",
"slices",
"of",
"the",
"specified",
"NIO",
"buffers",
"without",
"copying",
"them",
".",
"A",
"modification",
"on",
"the",
"content",
"of",
"the",
"specified",
"buff... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L336-L338 |
jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java | GalaxyProperties.getConfigPathFromRoot | private String getConfigPathFromRoot(File galaxyRoot, String configFileName) throws IOException {
"""
Gets path to a config file for Galaxy relative to the Galaxy root directory.
This will check for the existence of the file and attempt to copy it from a *.sample file
if it does not exist.
@param galaxyRoot Th... | java | private String getConfigPathFromRoot(File galaxyRoot, String configFileName) throws IOException {
if (isPre20141006Release(galaxyRoot)) {
return configFileName;
} else {
File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME);
File toolConf = new File(configDirectory, configFileName);
... | [
"private",
"String",
"getConfigPathFromRoot",
"(",
"File",
"galaxyRoot",
",",
"String",
"configFileName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isPre20141006Release",
"(",
"galaxyRoot",
")",
")",
"{",
"return",
"configFileName",
";",
"}",
"else",
"{",
"... | Gets path to a config file for Galaxy relative to the Galaxy root directory.
This will check for the existence of the file and attempt to copy it from a *.sample file
if it does not exist.
@param galaxyRoot The Galaxy root directory.
@param configFileName The name of the config file to get.
@return The path to the c... | [
"Gets",
"path",
"to",
"a",
"config",
"file",
"for",
"Galaxy",
"relative",
"to",
"the",
"Galaxy",
"root",
"directory",
".",
"This",
"will",
"check",
"for",
"the",
"existence",
"of",
"the",
"file",
"and",
"attempt",
"to",
"copy",
"it",
"from",
"a",
"*",
... | train | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L174-L189 |
lucmoreau/ProvToolbox | prov-interop/src/main/java/org/openprovenance/prov/interop/InteropFramework.java | InteropFramework.readDocument | public Document readDocument(String url) {
"""
Reads a document from a URL. Uses the Content-type header field to determine the
mime-type of the resource, and therefore the parser to read the document.
@param url a URL
@return a Document
"""
try {
URL theURL = new URL(url);
U... | java | public Document readDocument(String url) {
try {
URL theURL = new URL(url);
URLConnection conn = connectWithRedirect(theURL);
if (conn == null)
return null;
ProvFormat format = null;
String content_type = conn.getContentType();
... | [
"public",
"Document",
"readDocument",
"(",
"String",
"url",
")",
"{",
"try",
"{",
"URL",
"theURL",
"=",
"new",
"URL",
"(",
"url",
")",
";",
"URLConnection",
"conn",
"=",
"connectWithRedirect",
"(",
"theURL",
")",
";",
"if",
"(",
"conn",
"==",
"null",
"... | Reads a document from a URL. Uses the Content-type header field to determine the
mime-type of the resource, and therefore the parser to read the document.
@param url a URL
@return a Document | [
"Reads",
"a",
"document",
"from",
"a",
"URL",
".",
"Uses",
"the",
"Content",
"-",
"type",
"header",
"field",
"to",
"determine",
"the",
"mime",
"-",
"type",
"of",
"the",
"resource",
"and",
"therefore",
"the",
"parser",
"to",
"read",
"the",
"document",
"."... | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-interop/src/main/java/org/openprovenance/prov/interop/InteropFramework.java#L638-L677 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tagStyle | public static String tagStyle(String tag, String style, String... content) {
"""
Build a String containing a HTML opening tag with given CSS style attribute(s), content and closing tag.
Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
... | java | public static String tagStyle(String tag, String style, String... content) {
return openTagStyle(tag, style, content) + closeTag(tag);
} | [
"public",
"static",
"String",
"tagStyle",
"(",
"String",
"tag",
",",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTagStyle",
"(",
"tag",
",",
"style",
",",
"content",
")",
"+",
"closeTag",
"(",
"tag",
")",
";",
"}"
] | Build a String containing a HTML opening tag with given CSS style attribute(s), content and closing tag.
Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
@param style style for tag (plain CSS)
@param content content string
@return HTML tag elem... | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"style",
"attribute",
"(",
"s",
")",
"content",
"and",
"closing",
"tag",
".",
"Content",
"should",
"contain",
"no",
"HTML",
"because",
"it",
"is",
"prepared",
"wit... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L288-L290 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java | XMLContentHandler.endElement | @Override
public void endElement(final String uri, final String localName, final String qName) throws SAXException {
"""
Depending on the element, which has to be in the correct namespace, the method adds a property to the node or
removes completed nodes from the node stack.
"""
LOG.trace("endEle... | java | @Override
public void endElement(final String uri, final String localName, final String qName) throws SAXException {
LOG.trace("endElement uri={} localName={} qName={}", uri, localName, qName);
if (this.isNotInkstandNamespace(uri)) {
return;
}
switch (localName) {
... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"final",
"String",
"uri",
",",
"final",
"String",
"localName",
",",
"final",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"LOG",
".",
"trace",
"(",
"\"endElement uri={} localName={} qName={}\"",
",",
... | Depending on the element, which has to be in the correct namespace, the method adds a property to the node or
removes completed nodes from the node stack. | [
"Depending",
"on",
"the",
"element",
"which",
"has",
"to",
"be",
"in",
"the",
"correct",
"namespace",
"the",
"method",
"adds",
"a",
"property",
"to",
"the",
"node",
"or",
"removes",
"completed",
"nodes",
"from",
"the",
"node",
"stack",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java#L194-L219 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.newDataSet | public static DataSet newDataSet(final String keyColumnName, final String valueColumnName, final Map<?, ?> m) {
"""
Convert the specified Map to a two columns <code>DataSet</code>: one column is for keys and one column is for values
@param keyColumnName
@param valueColumnName
@param m
@return
"""
... | java | public static DataSet newDataSet(final String keyColumnName, final String valueColumnName, final Map<?, ?> m) {
final List<Object> keyColumn = new ArrayList<>(m.size());
final List<Object> valueColumn = new ArrayList<>(m.size());
for (Map.Entry<?, ?> entry : m.entrySet()) {
key... | [
"public",
"static",
"DataSet",
"newDataSet",
"(",
"final",
"String",
"keyColumnName",
",",
"final",
"String",
"valueColumnName",
",",
"final",
"Map",
"<",
"?",
",",
"?",
">",
"m",
")",
"{",
"final",
"List",
"<",
"Object",
">",
"keyColumn",
"=",
"new",
"A... | Convert the specified Map to a two columns <code>DataSet</code>: one column is for keys and one column is for values
@param keyColumnName
@param valueColumnName
@param m
@return | [
"Convert",
"the",
"specified",
"Map",
"to",
"a",
"two",
"columns",
"<code",
">",
"DataSet<",
"/",
"code",
">",
":",
"one",
"column",
"is",
"for",
"keys",
"and",
"one",
"column",
"is",
"for",
"values"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L1251-L1264 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexClientFactory.java | BitfinexClientFactory.newSimpleClient | public static BitfinexWebsocketClient newSimpleClient(final BitfinexWebsocketConfiguration config) {
"""
bitfinex client
@param config - config
@return {@link SimpleBitfinexApiBroker} client
"""
final BitfinexApiCallbackRegistry callbackRegistry = new BitfinexApiCallbackRegistry();
final Sequence... | java | public static BitfinexWebsocketClient newSimpleClient(final BitfinexWebsocketConfiguration config) {
final BitfinexApiCallbackRegistry callbackRegistry = new BitfinexApiCallbackRegistry();
final SequenceNumberAuditor sequenceNumberAuditor = new SequenceNumberAuditor();
sequenceNumberAuditor.setErrorPolic... | [
"public",
"static",
"BitfinexWebsocketClient",
"newSimpleClient",
"(",
"final",
"BitfinexWebsocketConfiguration",
"config",
")",
"{",
"final",
"BitfinexApiCallbackRegistry",
"callbackRegistry",
"=",
"new",
"BitfinexApiCallbackRegistry",
"(",
")",
";",
"final",
"SequenceNumber... | bitfinex client
@param config - config
@return {@link SimpleBitfinexApiBroker} client | [
"bitfinex",
"client"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexClientFactory.java#L27-L34 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobHistory.java | JobHistory.parseLine | private static void parseLine(String line, Listener l, boolean isEscaped)
throws IOException {
"""
Parse a single line of history.
@param line
@param l
@throws IOException
"""
// extract the record type
int idx = line.indexOf(' ');
String recType = line.substring(0, idx);
String data = ... | java | private static void parseLine(String line, Listener l, boolean isEscaped)
throws IOException{
// extract the record type
int idx = line.indexOf(' ');
String recType = line.substring(0, idx);
String data = line.substring(idx+1, line.length());
Matcher matcher = pattern.matcher(data);
M... | [
"private",
"static",
"void",
"parseLine",
"(",
"String",
"line",
",",
"Listener",
"l",
",",
"boolean",
"isEscaped",
")",
"throws",
"IOException",
"{",
"// extract the record type ",
"int",
"idx",
"=",
"line",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"String"... | Parse a single line of history.
@param line
@param l
@throws IOException | [
"Parse",
"a",
"single",
"line",
"of",
"history",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobHistory.java#L619-L643 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/MetaModelBuilder.java | MetaModelBuilder.onDeclaredFields | private <X> void onDeclaredFields(Class<X> clazz, AbstractManagedType<X> managedType) {
"""
On declared fields.
@param <X>
the generic type
@param clazz
the clazz
@param managedType
the managed type
"""
Field[] embeddedFields = clazz.getDeclaredFields();
for (Field f : embeddedFields)
... | java | private <X> void onDeclaredFields(Class<X> clazz, AbstractManagedType<X> managedType)
{
Field[] embeddedFields = clazz.getDeclaredFields();
for (Field f : embeddedFields)
{
if (isNonTransient(f))
{
new TypeBuilder<T>(f).build(managedType, f.getType());... | [
"private",
"<",
"X",
">",
"void",
"onDeclaredFields",
"(",
"Class",
"<",
"X",
">",
"clazz",
",",
"AbstractManagedType",
"<",
"X",
">",
"managedType",
")",
"{",
"Field",
"[",
"]",
"embeddedFields",
"=",
"clazz",
".",
"getDeclaredFields",
"(",
")",
";",
"f... | On declared fields.
@param <X>
the generic type
@param clazz
the clazz
@param managedType
the managed type | [
"On",
"declared",
"fields",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/MetaModelBuilder.java#L798-L808 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AlpineQueryManager.java | AlpineQueryManager.addUserToTeam | public boolean addUserToTeam(final UserPrincipal user, final Team team) {
"""
Associates a UserPrincipal to a Team.
@param user The user to bind
@param team The team to bind
@return true if operation was successful, false if not. This is not an indication of team association,
an unsuccessful return value may b... | java | public boolean addUserToTeam(final UserPrincipal user, final Team team) {
List<Team> teams = user.getTeams();
boolean found = false;
if (teams == null) {
teams = new ArrayList<>();
}
for (final Team t: teams) {
if (team.getUuid().equals(t.getUuid())) {
... | [
"public",
"boolean",
"addUserToTeam",
"(",
"final",
"UserPrincipal",
"user",
",",
"final",
"Team",
"team",
")",
"{",
"List",
"<",
"Team",
">",
"teams",
"=",
"user",
".",
"getTeams",
"(",
")",
";",
"boolean",
"found",
"=",
"false",
";",
"if",
"(",
"team... | Associates a UserPrincipal to a Team.
@param user The user to bind
@param team The team to bind
@return true if operation was successful, false if not. This is not an indication of team association,
an unsuccessful return value may be due to the team or user not existing, or a binding that already
exists between the tw... | [
"Associates",
"a",
"UserPrincipal",
"to",
"a",
"Team",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L393-L412 |
jenkinsci/blueocean-display-url-plugin | src/main/java/org/jenkinsci/plugins/blueoceandisplayurl/BlueOceanDisplayURLImpl.java | BlueOceanDisplayURLImpl.getFullNameForItem | private static String getFullNameForItem(@Nullable BlueOrganization org, @Nonnull Item item) {
"""
Returns full name relative to the <code>BlueOrganization</code> base. Each name is separated by '/'
@param org the organization the item belongs to
@param item to return the full name of
@return
"""
... | java | private static String getFullNameForItem(@Nullable BlueOrganization org, @Nonnull Item item) {
ItemGroup<?> group = getBaseGroup(org);
return Functions.getRelativeNameFrom(item, group);
} | [
"private",
"static",
"String",
"getFullNameForItem",
"(",
"@",
"Nullable",
"BlueOrganization",
"org",
",",
"@",
"Nonnull",
"Item",
"item",
")",
"{",
"ItemGroup",
"<",
"?",
">",
"group",
"=",
"getBaseGroup",
"(",
"org",
")",
";",
"return",
"Functions",
".",
... | Returns full name relative to the <code>BlueOrganization</code> base. Each name is separated by '/'
@param org the organization the item belongs to
@param item to return the full name of
@return | [
"Returns",
"full",
"name",
"relative",
"to",
"the",
"<code",
">",
"BlueOrganization<",
"/",
"code",
">",
"base",
".",
"Each",
"name",
"is",
"separated",
"by",
"/"
] | train | https://github.com/jenkinsci/blueocean-display-url-plugin/blob/d6515117712c9b30a32f32bb6e1a977711b9b037/src/main/java/org/jenkinsci/plugins/blueoceandisplayurl/BlueOceanDisplayURLImpl.java#L136-L139 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/Equation.java | Equation.createFunction | protected TokenList.Token createFunction( TokenList.Token name , List<TokenList.Token> inputs , TokenList tokens , Sequence sequence ) {
"""
Adds a new operation to the list from the operation and two variables. The inputs are removed
from the token list and replaced by their output.
"""
Operation.In... | java | protected TokenList.Token createFunction( TokenList.Token name , List<TokenList.Token> inputs , TokenList tokens , Sequence sequence )
{
Operation.Info info;
if( inputs.size() == 1 )
info = functions.create(name.getFunction().getName(),inputs.get(0).getVariable());
else {
... | [
"protected",
"TokenList",
".",
"Token",
"createFunction",
"(",
"TokenList",
".",
"Token",
"name",
",",
"List",
"<",
"TokenList",
".",
"Token",
">",
"inputs",
",",
"TokenList",
"tokens",
",",
"Sequence",
"sequence",
")",
"{",
"Operation",
".",
"Info",
"info",... | Adds a new operation to the list from the operation and two variables. The inputs are removed
from the token list and replaced by their output. | [
"Adds",
"a",
"new",
"operation",
"to",
"the",
"list",
"from",
"the",
"operation",
"and",
"two",
"variables",
".",
"The",
"inputs",
"are",
"removed",
"from",
"the",
"token",
"list",
"and",
"replaced",
"by",
"their",
"output",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L1333-L1353 |
jayantk/jklol | src/com/jayantkrish/jklol/evaluation/Example.java | Example.inputGetter | public static <A> Function<Example<A, ?>, A> inputGetter() {
"""
Gets a function which maps {@code Example}s to their input value.
@return
"""
return new Function<Example<A, ?>, A>() {
@Override
public A apply(Example<A, ?> item) {
return item.getInput();
}
};
} | java | public static <A> Function<Example<A, ?>, A> inputGetter() {
return new Function<Example<A, ?>, A>() {
@Override
public A apply(Example<A, ?> item) {
return item.getInput();
}
};
} | [
"public",
"static",
"<",
"A",
">",
"Function",
"<",
"Example",
"<",
"A",
",",
"?",
">",
",",
"A",
">",
"inputGetter",
"(",
")",
"{",
"return",
"new",
"Function",
"<",
"Example",
"<",
"A",
",",
"?",
">",
",",
"A",
">",
"(",
")",
"{",
"@",
"Ove... | Gets a function which maps {@code Example}s to their input value.
@return | [
"Gets",
"a",
"function",
"which",
"maps",
"{",
"@code",
"Example",
"}",
"s",
"to",
"their",
"input",
"value",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/evaluation/Example.java#L94-L101 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.authenticateDCOSpem | @Given("^I authenticate to DCOS cluster '(.+?)' using email '(.+?)'( with user '(.+?)'( and password '(.+?)'| and pem file '(.+?)'))?$")
public void authenticateDCOSpem(String remoteHost, String email, String foo, String user, String bar, String password, String pemFile) throws Exception {
"""
Authenticate in ... | java | @Given("^I authenticate to DCOS cluster '(.+?)' using email '(.+?)'( with user '(.+?)'( and password '(.+?)'| and pem file '(.+?)'))?$")
public void authenticateDCOSpem(String remoteHost, String email, String foo, String user, String bar, String password, String pemFile) throws Exception {
String DCOSsecret... | [
"@",
"Given",
"(",
"\"^I authenticate to DCOS cluster '(.+?)' using email '(.+?)'( with user '(.+?)'( and password '(.+?)'| and pem file '(.+?)'))?$\"",
")",
"public",
"void",
"authenticateDCOSpem",
"(",
"String",
"remoteHost",
",",
"String",
"email",
",",
"String",
"foo",
",",
"... | Authenticate in a DCOS cluster
@param remoteHost remote host
@param email email for JWT singing
@param user remote user
@param password (required if pemFile null)
@param pemFile (required if password null)
@throws Exception exception | [
"Authenticate",
"in",
"a",
"DCOS",
"cluster"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L63-L74 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java | ThreadUtil.newThread | public static Thread newThread(Runnable runnable, String name) {
"""
创建新线程,非守护线程,正常优先级,线程组与当前线程的线程组一致
@param runnable {@link Runnable}
@param name 线程名
@return {@link Thread}
@since 3.1.2
"""
final Thread t = newThread(runnable, name, false);
if (t.getPriority() != Thread.NORM_PRIORITY) {
t.setP... | java | public static Thread newThread(Runnable runnable, String name) {
final Thread t = newThread(runnable, name, false);
if (t.getPriority() != Thread.NORM_PRIORITY) {
t.setPriority(Thread.NORM_PRIORITY);
}
return t;
} | [
"public",
"static",
"Thread",
"newThread",
"(",
"Runnable",
"runnable",
",",
"String",
"name",
")",
"{",
"final",
"Thread",
"t",
"=",
"newThread",
"(",
"runnable",
",",
"name",
",",
"false",
")",
";",
"if",
"(",
"t",
".",
"getPriority",
"(",
")",
"!=",... | 创建新线程,非守护线程,正常优先级,线程组与当前线程的线程组一致
@param runnable {@link Runnable}
@param name 线程名
@return {@link Thread}
@since 3.1.2 | [
"创建新线程,非守护线程,正常优先级,线程组与当前线程的线程组一致"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L179-L185 |
lucasr/probe | library/src/main/java/org/lucasr/probe/Interceptor.java | Interceptor.onLayout | public void onLayout(View view, boolean changed, int l, int t, int r, int b) {
"""
Intercepts an {@link View#onLayout(boolean, int, int, int, int)} call on the
given {@link View}. By default, it simply calls the view's original method.
"""
invokeOnLayout(view, changed, l, t, r, b);
} | java | public void onLayout(View view, boolean changed, int l, int t, int r, int b) {
invokeOnLayout(view, changed, l, t, r, b);
} | [
"public",
"void",
"onLayout",
"(",
"View",
"view",
",",
"boolean",
"changed",
",",
"int",
"l",
",",
"int",
"t",
",",
"int",
"r",
",",
"int",
"b",
")",
"{",
"invokeOnLayout",
"(",
"view",
",",
"changed",
",",
"l",
",",
"t",
",",
"r",
",",
"b",
"... | Intercepts an {@link View#onLayout(boolean, int, int, int, int)} call on the
given {@link View}. By default, it simply calls the view's original method. | [
"Intercepts",
"an",
"{"
] | train | https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/Interceptor.java#L67-L69 |
radkovo/SwingBox | src/main/java/org/fit/cssbox/swingbox/BrowserPane.java | BrowserPane.tryScrollToReference | public boolean tryScrollToReference(String reference) {
"""
This method has the same purpose as {@link BrowserPane#scrollToReference(String)}.
However, it allows checking whether the reference exists in the document.
@param reference the named location to scroll to
@return <code>true</code> when the location ex... | java | public boolean tryScrollToReference(String reference)
{
Element dst = findElementToScroll(reference, getDocument().getDefaultRootElement());
if (dst != null)
{
try
{
Rectangle bottom = new Rectangle(0, getHeight() - 1, 1, 1);
Rectangle ... | [
"public",
"boolean",
"tryScrollToReference",
"(",
"String",
"reference",
")",
"{",
"Element",
"dst",
"=",
"findElementToScroll",
"(",
"reference",
",",
"getDocument",
"(",
")",
".",
"getDefaultRootElement",
"(",
")",
")",
";",
"if",
"(",
"dst",
"!=",
"null",
... | This method has the same purpose as {@link BrowserPane#scrollToReference(String)}.
However, it allows checking whether the reference exists in the document.
@param reference the named location to scroll to
@return <code>true</code> when the location exists in the document, <code>false</code> when not found. | [
"This",
"method",
"has",
"the",
"same",
"purpose",
"as",
"{"
] | train | https://github.com/radkovo/SwingBox/blob/ff370f3dc54d248e4c8852c17513618c83c25984/src/main/java/org/fit/cssbox/swingbox/BrowserPane.java#L331-L354 |
biezhi/anima | src/main/java/io/github/biezhi/anima/Anima.java | Anima.open | public static Anima open(DataSource dataSource, Quirks quirks) {
"""
Create anima with datasource and quirks
@param dataSource datasource instance
@return Anima
"""
return open(new Sql2o(dataSource, quirks));
} | java | public static Anima open(DataSource dataSource, Quirks quirks) {
return open(new Sql2o(dataSource, quirks));
} | [
"public",
"static",
"Anima",
"open",
"(",
"DataSource",
"dataSource",
",",
"Quirks",
"quirks",
")",
"{",
"return",
"open",
"(",
"new",
"Sql2o",
"(",
"dataSource",
",",
"quirks",
")",
")",
";",
"}"
] | Create anima with datasource and quirks
@param dataSource datasource instance
@return Anima | [
"Create",
"anima",
"with",
"datasource",
"and",
"quirks"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/Anima.java#L187-L189 |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.logComponent | public static void logComponent(final String type, final String details) {
"""
Log details of component processing (including processing time) to debug for current instance
@param type - of component
@param details - of component processing
"""
TransactionLogger instance = getInstance();
logComponen... | java | public static void logComponent(final String type, final String details) {
TransactionLogger instance = getInstance();
logComponent(type, details, instance);
} | [
"public",
"static",
"void",
"logComponent",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"details",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"logComponent",
"(",
"type",
",",
"details",
",",
"instance",
")",
";... | Log details of component processing (including processing time) to debug for current instance
@param type - of component
@param details - of component processing | [
"Log",
"details",
"of",
"component",
"processing",
"(",
"including",
"processing",
"time",
")",
"to",
"debug",
"for",
"current",
"instance"
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L123-L127 |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/AbstractEDBService.java | AbstractEDBService.performCommit | private Long performCommit(JPACommit commit) throws EDBException {
"""
Does the actual commit work (JPA related actions) and returns the timestamp when the commit was done. Throws an
EDBException if an error occurs.
"""
synchronized (entityManager) {
long timestamp = System.currentTimeMill... | java | private Long performCommit(JPACommit commit) throws EDBException {
synchronized (entityManager) {
long timestamp = System.currentTimeMillis();
try {
beginTransaction();
persistCommitChanges(commit, timestamp);
commitTransaction();
... | [
"private",
"Long",
"performCommit",
"(",
"JPACommit",
"commit",
")",
"throws",
"EDBException",
"{",
"synchronized",
"(",
"entityManager",
")",
"{",
"long",
"timestamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"try",
"{",
"beginTransaction",
"(",
... | Does the actual commit work (JPA related actions) and returns the timestamp when the commit was done. Throws an
EDBException if an error occurs. | [
"Does",
"the",
"actual",
"commit",
"work",
"(",
"JPA",
"related",
"actions",
")",
"and",
"returns",
"the",
"timestamp",
"when",
"the",
"commit",
"was",
"done",
".",
"Throws",
"an",
"EDBException",
"if",
"an",
"error",
"occurs",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/AbstractEDBService.java#L90-L107 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getGridCellsAround | @Pure
public AroundCellIterable<P> getGridCellsAround(Point2D<?, ?> position, double maximalDistance) {
"""
Replies the cells around the specified point.
The order of the replied cells follows cocentric circles
around the cell that contains the specified point.
@param position the position.
@param maximalDi... | java | @Pure
public AroundCellIterable<P> getGridCellsAround(Point2D<?, ?> position, double maximalDistance) {
final int column = getColumnFor(position.getX());
final int row = getRowFor(position.getY());
return new AroundIterable(row, column, position, maximalDistance);
} | [
"@",
"Pure",
"public",
"AroundCellIterable",
"<",
"P",
">",
"getGridCellsAround",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"position",
",",
"double",
"maximalDistance",
")",
"{",
"final",
"int",
"column",
"=",
"getColumnFor",
"(",
"position",
".",
"getX",
... | Replies the cells around the specified point.
The order of the replied cells follows cocentric circles
around the cell that contains the specified point.
@param position the position.
@param maximalDistance is the distance above which the cells are not replied.
@return the iterator on the cells. | [
"Replies",
"the",
"cells",
"around",
"the",
"specified",
"point",
".",
"The",
"order",
"of",
"the",
"replied",
"cells",
"follows",
"cocentric",
"circles",
"around",
"the",
"cell",
"that",
"contains",
"the",
"specified",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L364-L369 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java | AtomPlacer3D.getUnplacedRingHeavyAtom | public IAtom getUnplacedRingHeavyAtom(IAtomContainer molecule, IAtom atom) {
"""
Gets the unplacedRingHeavyAtom attribute of the AtomPlacer3D object.
@param molecule
@param atom Description of the Parameter
@return The unplacedRingHeavyAtom value
"""
List<IBond> bonds = molecule.getConnect... | java | public IAtom getUnplacedRingHeavyAtom(IAtomContainer molecule, IAtom atom) {
List<IBond> bonds = molecule.getConnectedBondsList(atom);
IAtom connectedAtom = null;
for (IBond bond : bonds) {
connectedAtom = bond.getOther(atom);
if (isUnplacedHeavyAtom(connectedAtom) && con... | [
"public",
"IAtom",
"getUnplacedRingHeavyAtom",
"(",
"IAtomContainer",
"molecule",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IBond",
">",
"bonds",
"=",
"molecule",
".",
"getConnectedBondsList",
"(",
"atom",
")",
";",
"IAtom",
"connectedAtom",
"=",
"null",
"... | Gets the unplacedRingHeavyAtom attribute of the AtomPlacer3D object.
@param molecule
@param atom Description of the Parameter
@return The unplacedRingHeavyAtom value | [
"Gets",
"the",
"unplacedRingHeavyAtom",
"attribute",
"of",
"the",
"AtomPlacer3D",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L490-L500 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/DebugStore.java | DebugStore.log | public void log(String pMessage, Throwable pThrowable) {
"""
Store the given message in this store if debug is switched on
@param pMessage message to store
@param pThrowable exception to store
"""
add(System.currentTimeMillis() / 1000,pMessage,pThrowable);
} | java | public void log(String pMessage, Throwable pThrowable) {
add(System.currentTimeMillis() / 1000,pMessage,pThrowable);
} | [
"public",
"void",
"log",
"(",
"String",
"pMessage",
",",
"Throwable",
"pThrowable",
")",
"{",
"add",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000",
",",
"pMessage",
",",
"pThrowable",
")",
";",
"}"
] | Store the given message in this store if debug is switched on
@param pMessage message to store
@param pThrowable exception to store | [
"Store",
"the",
"given",
"message",
"in",
"this",
"store",
"if",
"debug",
"is",
"switched",
"on"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/DebugStore.java#L68-L70 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setText | public static void setText(EfficientCacheView cacheView, int viewId, @StringRes int resid) {
"""
Equivalent to calling TextView.setText
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose text should change
@param resid The new text for the view
"""
... | java | public static void setText(EfficientCacheView cacheView, int viewId, @StringRes int resid) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof TextView) {
((TextView) view).setText(resid);
}
} | [
"public",
"static",
"void",
"setText",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"@",
"StringRes",
"int",
"resid",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
... | Equivalent to calling TextView.setText
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose text should change
@param resid The new text for the view | [
"Equivalent",
"to",
"calling",
"TextView",
".",
"setText"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L129-L134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.