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 |
|---|---|---|---|---|---|---|---|---|---|---|
geomajas/geomajas-project-client-gwt2 | plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java | TileBasedLayerClient.createOsmMap | public MapConfiguration createOsmMap(int nrOfLevels) {
"""
Create an OSM compliant map configuration with this number of zoom levels.
@param nrOfLevels
@return
"""
MapConfiguration configuration = new MapConfigurationImpl();
Bbox bounds = new Bbox(-OSM_HALF_WIDTH, -OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH, 2... | java | public MapConfiguration createOsmMap(int nrOfLevels) {
MapConfiguration configuration = new MapConfigurationImpl();
Bbox bounds = new Bbox(-OSM_HALF_WIDTH, -OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH);
configuration.setCrs(OSM_EPSG, CrsType.METRIC);
configuration.setHintValue(MapConfiguration.INITIA... | [
"public",
"MapConfiguration",
"createOsmMap",
"(",
"int",
"nrOfLevels",
")",
"{",
"MapConfiguration",
"configuration",
"=",
"new",
"MapConfigurationImpl",
"(",
")",
";",
"Bbox",
"bounds",
"=",
"new",
"Bbox",
"(",
"-",
"OSM_HALF_WIDTH",
",",
"-",
"OSM_HALF_WIDTH",
... | Create an OSM compliant map configuration with this number of zoom levels.
@param nrOfLevels
@return | [
"Create",
"an",
"OSM",
"compliant",
"map",
"configuration",
"with",
"this",
"number",
"of",
"zoom",
"levels",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java#L94-L106 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/message/ReceiveQueueSession.java | ReceiveQueueSession.updateRemoteFilterProperties | public void updateRemoteFilterProperties(BaseMessageFilter messageFilter, Object[][] mxProperties, Map<String,Object> propFilter) throws RemoteException {
"""
Update this filter with this new information.
@param messageFilter The message filter I am updating.
@param properties New filter information (ie, bookmar... | java | public void updateRemoteFilterProperties(BaseMessageFilter messageFilter, Object[][] mxProperties, Map<String,Object> propFilter) throws RemoteException
{
Utility.getLogger().info("EJB updateRemoteFilter properties: " + mxProperties);
// Give the filter the remote environment
MessageManager ... | [
"public",
"void",
"updateRemoteFilterProperties",
"(",
"BaseMessageFilter",
"messageFilter",
",",
"Object",
"[",
"]",
"[",
"]",
"mxProperties",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"propFilter",
")",
"throws",
"RemoteException",
"{",
"Utility",
".",
"g... | Update this filter with this new information.
@param messageFilter The message filter I am updating.
@param properties New filter information (ie, bookmark=345). | [
"Update",
"this",
"filter",
"with",
"this",
"new",
"information",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/message/ReceiveQueueSession.java#L199-L215 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.first | private static Sort first(String columnName, Sort.Order order) {
"""
Returns a sort Key that can be used for simple or chained comparator sorting
<p>
You can extend the sort key by using .next() to fill more columns to the sort order
"""
return Sort.on(columnName, order);
} | java | private static Sort first(String columnName, Sort.Order order) {
return Sort.on(columnName, order);
} | [
"private",
"static",
"Sort",
"first",
"(",
"String",
"columnName",
",",
"Sort",
".",
"Order",
"order",
")",
"{",
"return",
"Sort",
".",
"on",
"(",
"columnName",
",",
"order",
")",
";",
"}"
] | Returns a sort Key that can be used for simple or chained comparator sorting
<p>
You can extend the sort key by using .next() to fill more columns to the sort order | [
"Returns",
"a",
"sort",
"Key",
"that",
"can",
"be",
"used",
"for",
"simple",
"or",
"chained",
"comparator",
"sorting",
"<p",
">",
"You",
"can",
"extend",
"the",
"sort",
"key",
"by",
"using",
".",
"next",
"()",
"to",
"fill",
"more",
"columns",
"to",
"th... | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L171-L173 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java | VersionsImpl.cloneWithServiceResponseAsync | public Observable<ServiceResponse<String>> cloneWithServiceResponseAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) {
"""
Creates a new version using the current snapshot of the selected application version.
@param appId The application ID.
@param versionId The version ID.
@p... | java | public Observable<ServiceResponse<String>> cloneWithServiceResponseAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"String",
">",
">",
"cloneWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"CloneOptionalParameter",
"cloneOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"e... | Creates a new version using the current snapshot of the selected application version.
@param appId The application ID.
@param versionId The version ID.
@param cloneOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters f... | [
"Creates",
"a",
"new",
"version",
"using",
"the",
"current",
"snapshot",
"of",
"the",
"selected",
"application",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L162-L175 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/InApplicationMonitor.java | InApplicationMonitor.incrementCounter | public void incrementCounter(String name, int increment) {
"""
<p>Increase the specified counter by a variable amount.</p>
@param name
the name of the {@code Counter} to increase
@param increment
the added to add
"""
if (monitorActive) {
String escapedName = keyHandler.handle(name);
... | java | public void incrementCounter(String name, int increment) {
if (monitorActive) {
String escapedName = keyHandler.handle(name);
for (MonitorPlugin p : getPlugins()) {
p.incrementCounter(escapedName, increment);
}
}
} | [
"public",
"void",
"incrementCounter",
"(",
"String",
"name",
",",
"int",
"increment",
")",
"{",
"if",
"(",
"monitorActive",
")",
"{",
"String",
"escapedName",
"=",
"keyHandler",
".",
"handle",
"(",
"name",
")",
";",
"for",
"(",
"MonitorPlugin",
"p",
":",
... | <p>Increase the specified counter by a variable amount.</p>
@param name
the name of the {@code Counter} to increase
@param increment
the added to add | [
"<p",
">",
"Increase",
"the",
"specified",
"counter",
"by",
"a",
"variable",
"amount",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/InApplicationMonitor.java#L197-L204 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java | JSField.estimateSizeOfUnassembledValue | public int estimateSizeOfUnassembledValue(byte[] frame, int offset, int indirect) {
"""
estimateSizeOfUnassembledValue
Return the estimated size of the value if unassembled.
This size includes a guess at the heap overhead of the object(s) which
would be created.
@param frame the byte array from which the obj... | java | public int estimateSizeOfUnassembledValue(byte[] frame, int offset, int indirect) {
if (indirect == 0)
return estimateUnassembledSize(frame, offset);
else
return coder.estimateUnassembledSize(frame, offset);
} | [
"public",
"int",
"estimateSizeOfUnassembledValue",
"(",
"byte",
"[",
"]",
"frame",
",",
"int",
"offset",
",",
"int",
"indirect",
")",
"{",
"if",
"(",
"indirect",
"==",
"0",
")",
"return",
"estimateUnassembledSize",
"(",
"frame",
",",
"offset",
")",
";",
"e... | estimateSizeOfUnassembledValue
Return the estimated size of the value if unassembled.
This size includes a guess at the heap overhead of the object(s) which
would be created.
@param frame the byte array from which the object would be deserialized.
@param offset the byte at which to start in frame
@param indirect the l... | [
"estimateSizeOfUnassembledValue",
"Return",
"the",
"estimated",
"size",
"of",
"the",
"value",
"if",
"unassembled",
".",
"This",
"size",
"includes",
"a",
"guess",
"at",
"the",
"heap",
"overhead",
"of",
"the",
"object",
"(",
"s",
")",
"which",
"would",
"be",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java#L222-L227 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java | Fastpath.getID | public int getID(String name) throws SQLException {
"""
<p>This returns the function id associated by its name.</p>
<p>If addFunction() or addFunctions() have not been called for this name, then an SQLException is
thrown.</p>
@param name Function name to lookup
@return Function ID for fastpath call
@throw... | java | public int getID(String name) throws SQLException {
Integer id = func.get(name);
// may be we could add a lookup to the database here, and store the result
// in our lookup table, throwing the exception if that fails.
// We must, however, ensure that if we do, any existing ResultSet is
// unaffecte... | [
"public",
"int",
"getID",
"(",
"String",
"name",
")",
"throws",
"SQLException",
"{",
"Integer",
"id",
"=",
"func",
".",
"get",
"(",
"name",
")",
";",
"// may be we could add a lookup to the database here, and store the result",
"// in our lookup table, throwing the exceptio... | <p>This returns the function id associated by its name.</p>
<p>If addFunction() or addFunctions() have not been called for this name, then an SQLException is
thrown.</p>
@param name Function name to lookup
@return Function ID for fastpath call
@throws SQLException is function is unknown. | [
"<p",
">",
"This",
"returns",
"the",
"function",
"id",
"associated",
"by",
"its",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java#L286-L302 |
soabase/exhibitor | exhibitor-core/src/main/java/com/netflix/exhibitor/core/Exhibitor.java | Exhibitor.getLocalConnection | public synchronized CuratorFramework getLocalConnection() throws IOException {
"""
Return a connection ot the ZK instance (creating it if needed)
@return connection
@throws IOException errors
"""
if ( localConnection == null )
{
CuratorFrameworkFactory.Builder builder = CuratorF... | java | public synchronized CuratorFramework getLocalConnection() throws IOException
{
if ( localConnection == null )
{
CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
.connectString("localhost:" + configManager.getConfig().getInt(IntConfigs.CLIENT_POR... | [
"public",
"synchronized",
"CuratorFramework",
"getLocalConnection",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"localConnection",
"==",
"null",
")",
"{",
"CuratorFrameworkFactory",
".",
"Builder",
"builder",
"=",
"CuratorFrameworkFactory",
".",
"builder",
"(",... | Return a connection ot the ZK instance (creating it if needed)
@return connection
@throws IOException errors | [
"Return",
"a",
"connection",
"ot",
"the",
"ZK",
"instance",
"(",
"creating",
"it",
"if",
"needed",
")"
] | train | https://github.com/soabase/exhibitor/blob/d345d2d45c75b0694b562b6c346f8594f3a5d166/exhibitor-core/src/main/java/com/netflix/exhibitor/core/Exhibitor.java#L305-L324 |
aws/aws-sdk-java | aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/ListObjectChildrenResult.java | ListObjectChildrenResult.withChildren | public ListObjectChildrenResult withChildren(java.util.Map<String, String> children) {
"""
<p>
Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code> as the
value.
</p>
@param children
Children structure, which is a map with key as the <code>LinkName</code... | java | public ListObjectChildrenResult withChildren(java.util.Map<String, String> children) {
setChildren(children);
return this;
} | [
"public",
"ListObjectChildrenResult",
"withChildren",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"children",
")",
"{",
"setChildren",
"(",
"children",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code> as the
value.
</p>
@param children
Children structure, which is a map with key as the <code>LinkName</code> and <code>ObjectIdentifier</code>
as the value.
@return Returns a reference to this object so that m... | [
"<p",
">",
"Children",
"structure",
"which",
"is",
"a",
"map",
"with",
"key",
"as",
"the",
"<code",
">",
"LinkName<",
"/",
"code",
">",
"and",
"<code",
">",
"ObjectIdentifier<",
"/",
"code",
">",
"as",
"the",
"value",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/ListObjectChildrenResult.java#L81-L84 |
dwdyer/watchmaker | swing/src/java/main/org/uncommons/watchmaker/swing/evolutionmonitor/EvolutionMonitor.java | EvolutionMonitor.showInDialog | public void showInDialog(final JFrame owner,
final String title,
final boolean modal) {
"""
Displays the evolution monitor component in a new {@link JDialog}. There is no
need to make sure this method is invoked from the Event Dispatch Thread, the
method... | java | public void showInDialog(final JFrame owner,
final String title,
final boolean modal)
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
JDialog dialog = new JDialog(owner, title, modal);... | [
"public",
"void",
"showInDialog",
"(",
"final",
"JFrame",
"owner",
",",
"final",
"String",
"title",
",",
"final",
"boolean",
"modal",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
... | Displays the evolution monitor component in a new {@link JDialog}. There is no
need to make sure this method is invoked from the Event Dispatch Thread, the
method itself ensures that the window is created and displayed from the EDT.
@param owner The owning frame for the new dialog.
@param title The title for the new d... | [
"Displays",
"the",
"evolution",
"monitor",
"component",
"in",
"a",
"new",
"{"
] | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/swing/src/java/main/org/uncommons/watchmaker/swing/evolutionmonitor/EvolutionMonitor.java#L216-L229 |
graknlabs/grakn | server/src/graql/executor/ComputeExecutor.java | ComputeExecutor.initStatisticsVertexProgram | private VertexProgram initStatisticsVertexProgram(GraqlCompute query, Set<LabelId> targetTypes, AttributeType.DataType<?> targetDataType) {
"""
Helper method to intialise the vertex program for compute statistics queries
@param query representing the compute query
@param targetTypes representing th... | java | private VertexProgram initStatisticsVertexProgram(GraqlCompute query, Set<LabelId> targetTypes, AttributeType.DataType<?> targetDataType) {
if (query.method().equals(MEDIAN)) return new MedianVertexProgram(targetTypes, targetDataType);
else return new DegreeStatisticsVertexProgram(targetTypes);
} | [
"private",
"VertexProgram",
"initStatisticsVertexProgram",
"(",
"GraqlCompute",
"query",
",",
"Set",
"<",
"LabelId",
">",
"targetTypes",
",",
"AttributeType",
".",
"DataType",
"<",
"?",
">",
"targetDataType",
")",
"{",
"if",
"(",
"query",
".",
"method",
"(",
"... | Helper method to intialise the vertex program for compute statistics queries
@param query representing the compute query
@param targetTypes representing the attribute types in which the statistics computation is targeted for
@param targetDataType representing the data type of the target attribute types
@re... | [
"Helper",
"method",
"to",
"intialise",
"the",
"vertex",
"program",
"for",
"compute",
"statistics",
"queries"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/executor/ComputeExecutor.java#L263-L266 |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/texts/Fonts.java | Fonts.apply | public static void apply(@NonNull TextView textView, @NonNull String fontPath) {
"""
Applies font to provided TextView.<br/>
Note: this class will only accept fonts under <code>fonts/</code> directory
and fonts starting with <code>font:</code> prefix.
"""
if (!textView.isInEditMode()) {
s... | java | public static void apply(@NonNull TextView textView, @NonNull String fontPath) {
if (!textView.isInEditMode()) {
setTypeface(textView, getFontFromString
(textView.getContext().getAssets(), fontPath, true));
}
} | [
"public",
"static",
"void",
"apply",
"(",
"@",
"NonNull",
"TextView",
"textView",
",",
"@",
"NonNull",
"String",
"fontPath",
")",
"{",
"if",
"(",
"!",
"textView",
".",
"isInEditMode",
"(",
")",
")",
"{",
"setTypeface",
"(",
"textView",
",",
"getFontFromStr... | Applies font to provided TextView.<br/>
Note: this class will only accept fonts under <code>fonts/</code> directory
and fonts starting with <code>font:</code> prefix. | [
"Applies",
"font",
"to",
"provided",
"TextView",
".",
"<br",
"/",
">",
"Note",
":",
"this",
"class",
"will",
"only",
"accept",
"fonts",
"under",
"<code",
">",
"fonts",
"/",
"<",
"/",
"code",
">",
"directory",
"and",
"fonts",
"starting",
"with",
"<code",
... | train | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/texts/Fonts.java#L102-L107 |
jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractItem.java | AbstractItem.onLoad | public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
"""
Called right after when a {@link Item} is loaded from disk.
This is an opportunity to do a post load processing.
"""
this.parent = parent;
doSetName(name);
} | java | public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
this.parent = parent;
doSetName(name);
} | [
"public",
"void",
"onLoad",
"(",
"ItemGroup",
"<",
"?",
"extends",
"Item",
">",
"parent",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"this",
".",
"parent",
"=",
"parent",
";",
"doSetName",
"(",
"name",
")",
";",
"}"
] | Called right after when a {@link Item} is loaded from disk.
This is an opportunity to do a post load processing. | [
"Called",
"right",
"after",
"when",
"a",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L505-L508 |
joniles/mpxj | src/main/java/net/sf/mpxj/sample/MpxjConvert.java | MpxjConvert.process | public void process(String inputFile, String outputFile) throws Exception {
"""
Convert one project file format to another.
@param inputFile input file
@param outputFile output file
@throws Exception
"""
System.out.println("Reading input file started.");
long start = System.currentTimeMillis()... | java | public void process(String inputFile, String outputFile) throws Exception
{
System.out.println("Reading input file started.");
long start = System.currentTimeMillis();
ProjectFile projectFile = readFile(inputFile);
long elapsed = System.currentTimeMillis() - start;
System.out.println("R... | [
"public",
"void",
"process",
"(",
"String",
"inputFile",
",",
"String",
"outputFile",
")",
"throws",
"Exception",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Reading input file started.\"",
")",
";",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis... | Convert one project file format to another.
@param inputFile input file
@param outputFile output file
@throws Exception | [
"Convert",
"one",
"project",
"file",
"format",
"to",
"another",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/sample/MpxjConvert.java#L80-L94 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java | RegistryConfig.setParameters | public RegistryConfig setParameters(Map<String, String> parameters) {
"""
Sets parameters.
@param parameters the parameters
@return the RegistryConfig
"""
if (this.parameters == null) {
this.parameters = new ConcurrentHashMap<String, String>();
this.parameters.putAll(paramet... | java | public RegistryConfig setParameters(Map<String, String> parameters) {
if (this.parameters == null) {
this.parameters = new ConcurrentHashMap<String, String>();
this.parameters.putAll(parameters);
}
return this;
} | [
"public",
"RegistryConfig",
"setParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"if",
"(",
"this",
".",
"parameters",
"==",
"null",
")",
"{",
"this",
".",
"parameters",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
","... | Sets parameters.
@param parameters the parameters
@return the RegistryConfig | [
"Sets",
"parameters",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java#L368-L374 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/ConcurrentBoundedWorkUnitList.java | ConcurrentBoundedWorkUnitList.addFileSet | public boolean addFileSet(FileSet<CopyEntity> fileSet, List<WorkUnit> workUnits) {
"""
Add a file set to the container.
@param fileSet File set, expressed as a {@link org.apache.gobblin.data.management.partition.FileSet} of {@link CopyEntity}s.
@param workUnits List of {@link WorkUnit}s corresponding to this fil... | java | public boolean addFileSet(FileSet<CopyEntity> fileSet, List<WorkUnit> workUnits) {
boolean addedWorkunits = addFileSetImpl(fileSet, workUnits);
if (!addedWorkunits) {
this.rejectedFileSet = true;
}
return addedWorkunits;
} | [
"public",
"boolean",
"addFileSet",
"(",
"FileSet",
"<",
"CopyEntity",
">",
"fileSet",
",",
"List",
"<",
"WorkUnit",
">",
"workUnits",
")",
"{",
"boolean",
"addedWorkunits",
"=",
"addFileSetImpl",
"(",
"fileSet",
",",
"workUnits",
")",
";",
"if",
"(",
"!",
... | Add a file set to the container.
@param fileSet File set, expressed as a {@link org.apache.gobblin.data.management.partition.FileSet} of {@link CopyEntity}s.
@param workUnits List of {@link WorkUnit}s corresponding to this file set.
@return true if the file set was added to the container, false otherwise (i.e. has reac... | [
"Add",
"a",
"file",
"set",
"to",
"the",
"container",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/ConcurrentBoundedWorkUnitList.java#L108-L114 |
apache/groovy | src/main/groovy/groovy/lang/BenchmarkInterceptor.java | BenchmarkInterceptor.beforeInvoke | public Object beforeInvoke(Object object, String methodName, Object[] arguments) {
"""
This code is executed before the method is called.
@param object receiver object for the method call
@param methodName name of the method to call
@param arguments arguments to the method call
@return null
rela... | java | public Object beforeInvoke(Object object, String methodName, Object[] arguments) {
if (!calls.containsKey(methodName)) calls.put(methodName, new LinkedList());
((List) calls.get(methodName)).add(System.currentTimeMillis());
return null;
} | [
"public",
"Object",
"beforeInvoke",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"if",
"(",
"!",
"calls",
".",
"containsKey",
"(",
"methodName",
")",
")",
"calls",
".",
"put",
"(",
"methodName",
",... | This code is executed before the method is called.
@param object receiver object for the method call
@param methodName name of the method to call
@param arguments arguments to the method call
@return null
relays this result. | [
"This",
"code",
"is",
"executed",
"before",
"the",
"method",
"is",
"called",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/BenchmarkInterceptor.java#L75-L80 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.element | public JSONObject element( String key, Object value, JsonConfig jsonConfig ) {
"""
Put a key/value pair in the JSONObject. If the value is null, then the key
will be removed from the JSONObject if it is present.<br>
If there is a previous value assigned to the key, it will call accumulate.
@param key A key st... | java | public JSONObject element( String key, Object value, JsonConfig jsonConfig ) {
verifyIsNull();
if( key == null ){
throw new JSONException( "Null key." );
}
if( value != null ){
value = processValue( key, value, jsonConfig );
_setInternal( key, value, jsonConfig );
... | [
"public",
"JSONObject",
"element",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"verifyIsNull",
"(",
")",
";",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"JSONException",
"(",
"\"Null key.\"",
")",... | Put a key/value pair in the JSONObject. If the value is null, then the key
will be removed from the JSONObject if it is present.<br>
If there is a previous value assigned to the key, it will call accumulate.
@param key A key string.
@param value An object which is the value. It should be of one of these
types: Boolean... | [
"Put",
"a",
"key",
"/",
"value",
"pair",
"in",
"the",
"JSONObject",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"key",
"will",
"be",
"removed",
"from",
"the",
"JSONObject",
"if",
"it",
"is",
"present",
".",
"<br",
">",
"If",
"there",
"is"... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1706-L1718 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/QueryRecord.java | QueryRecord.addRelationship | public void addRelationship(int iLinkType, Record recLeft, Record recRight, int ifldLeft1, int ifldRight1) {
"""
Add this table link to this query.
Creates a new tablelink and adds it to the link list.
"""
String fldLeft1 = recLeft.getField(ifldLeft1).getFieldName();
String fldRight1 = recRigh... | java | public void addRelationship(int iLinkType, Record recLeft, Record recRight, int ifldLeft1, int ifldRight1)
{
String fldLeft1 = recLeft.getField(ifldLeft1).getFieldName();
String fldRight1 = recRight.getField(ifldRight1).getFieldName();
this.addRelationship(iLinkType, recLeft, recRight, fldLe... | [
"public",
"void",
"addRelationship",
"(",
"int",
"iLinkType",
",",
"Record",
"recLeft",
",",
"Record",
"recRight",
",",
"int",
"ifldLeft1",
",",
"int",
"ifldRight1",
")",
"{",
"String",
"fldLeft1",
"=",
"recLeft",
".",
"getField",
"(",
"ifldLeft1",
")",
".",... | Add this table link to this query.
Creates a new tablelink and adds it to the link list. | [
"Add",
"this",
"table",
"link",
"to",
"this",
"query",
".",
"Creates",
"a",
"new",
"tablelink",
"and",
"adds",
"it",
"to",
"the",
"link",
"list",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/QueryRecord.java#L144-L149 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.applyList | public static final <T> T applyList(Object bean, String property, BiFunction<Class<T>,String,T> factory) {
"""
Applies bean action by using given factory
<p>Bean actions are:
<p>List item property remove by adding '#' to the end of pattern.
<p>E.g. list.3- - list.remove(3)
<p>List item creation to the end of t... | java | public static final <T> T applyList(Object bean, String property, BiFunction<Class<T>,String,T> factory)
{
int addIdx = property.lastIndexOf(Add);
if (addIdx != -1)
{
String hint = property.substring(addIdx+1);
return addList(bean, property.substring(0, addIdx),... | [
"public",
"static",
"final",
"<",
"T",
">",
"T",
"applyList",
"(",
"Object",
"bean",
",",
"String",
"property",
",",
"BiFunction",
"<",
"Class",
"<",
"T",
">",
",",
"String",
",",
"T",
">",
"factory",
")",
"{",
"int",
"addIdx",
"=",
"property",
".",
... | Applies bean action by using given factory
<p>Bean actions are:
<p>List item property remove by adding '#' to the end of pattern.
<p>E.g. list.3- - list.remove(3)
<p>List item creation to the end of the list.
<p>E.g. list+ - add(factory.get(cls, null))
<p>E.g. list+hint - add(factory.get(cls, hint))
@param <T>
@param b... | [
"Applies",
"bean",
"action",
"by",
"using",
"given",
"factory",
"<p",
">",
"Bean",
"actions",
"are",
":",
"<p",
">",
"List",
"item",
"property",
"remove",
"by",
"adding",
"#",
"to",
"the",
"end",
"of",
"pattern",
".",
"<p",
">",
"E",
".",
"g",
".",
... | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L461-L489 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/model/monitor/ServiceLevelAgreement.java | ServiceLevelAgreement.unitsToSeconds | public static int unitsToSeconds(String interval, String unit) {
"""
Convert interval of specified unit to seconds
@param interval
@param unit
@return
"""
if (interval == null || interval.isEmpty()) return 0;
else if (unit == null) return (int)(Double.parseDouble(interval));
else if (un... | java | public static int unitsToSeconds(String interval, String unit) {
if (interval == null || interval.isEmpty()) return 0;
else if (unit == null) return (int)(Double.parseDouble(interval));
else if (unit.equals(INTERVAL_DAYS)) return (int)(Double.parseDouble(interval)*86400);
else if (unit.equal... | [
"public",
"static",
"int",
"unitsToSeconds",
"(",
"String",
"interval",
",",
"String",
"unit",
")",
"{",
"if",
"(",
"interval",
"==",
"null",
"||",
"interval",
".",
"isEmpty",
"(",
")",
")",
"return",
"0",
";",
"else",
"if",
"(",
"unit",
"==",
"null",
... | Convert interval of specified unit to seconds
@param interval
@param unit
@return | [
"Convert",
"interval",
"of",
"specified",
"unit",
"to",
"seconds"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/model/monitor/ServiceLevelAgreement.java#L68-L75 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.intToBytes | public static final void intToBytes( int i, byte[] data, int[] offset ) {
"""
Write the bytes representing <code>i</code> into the byte array
<code>data</code>, starting at index <code>offset [0]</code>, and
increment <code>offset [0]</code> by the number of bytes written; if
<code>data == null</code>, incremen... | java | public static final void intToBytes( int i, byte[] data, int[] offset ) {
/**
* TODO: We use network-order within OceanStore, but temporarily
* supporting intel-order to work with some JNI code until JNI code is
* set to interoperate with network-order.
*/
if (data !=... | [
"public",
"static",
"final",
"void",
"intToBytes",
"(",
"int",
"i",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"offset",
")",
"{",
"/**\n * TODO: We use network-order within OceanStore, but temporarily\n * supporting intel-order to work with some JNI... | Write the bytes representing <code>i</code> into the byte array
<code>data</code>, starting at index <code>offset [0]</code>, and
increment <code>offset [0]</code> by the number of bytes written; if
<code>data == null</code>, increment <code>offset [0]</code> by the
number of bytes that would have been written otherwis... | [
"Write",
"the",
"bytes",
"representing",
"<code",
">",
"i<",
"/",
"code",
">",
"into",
"the",
"byte",
"array",
"<code",
">",
"data<",
"/",
"code",
">",
"starting",
"at",
"index",
"<code",
">",
"offset",
"[",
"0",
"]",
"<",
"/",
"code",
">",
"and",
... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L79-L93 |
kobakei/Android-RateThisApp | ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java | RateThisApp.storeInstallDate | private static void storeInstallDate(final Context context, SharedPreferences.Editor editor) {
"""
Store install date.
Install date is retrieved from package manager if possible.
@param context
@param editor
"""
Date installDate = new Date();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.... | java | private static void storeInstallDate(final Context context, SharedPreferences.Editor editor) {
Date installDate = new Date();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
PackageManager packMan = context.getPackageManager();
try {
PackageInfo pk... | [
"private",
"static",
"void",
"storeInstallDate",
"(",
"final",
"Context",
"context",
",",
"SharedPreferences",
".",
"Editor",
"editor",
")",
"{",
"Date",
"installDate",
"=",
"new",
"Date",
"(",
")",
";",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
... | Store install date.
Install date is retrieved from package manager if possible.
@param context
@param editor | [
"Store",
"install",
"date",
".",
"Install",
"date",
"is",
"retrieved",
"from",
"package",
"manager",
"if",
"possible",
"."
] | train | https://github.com/kobakei/Android-RateThisApp/blob/c3d007c8c02beb6ff196745c2310c259737f5c81/ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java#L338-L351 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SFTrustManager.java | SFTrustManager.validateRevocationStatus | void validateRevocationStatus(X509Certificate[] chain, String peerHost) throws CertificateException {
"""
Certificate Revocation checks
@param chain chain of certificates attached.
@param peerHost Hostname of the server
@throws CertificateException if any certificate validation fails
"""
final List... | java | void validateRevocationStatus(X509Certificate[] chain, String peerHost) throws CertificateException
{
final List<Certificate> bcChain = convertToBouncyCastleCertificate(chain);
final List<SFPair<Certificate, Certificate>> pairIssuerSubjectList =
getPairIssuerSubject(bcChain);
if (peerHost.startsW... | [
"void",
"validateRevocationStatus",
"(",
"X509Certificate",
"[",
"]",
"chain",
",",
"String",
"peerHost",
")",
"throws",
"CertificateException",
"{",
"final",
"List",
"<",
"Certificate",
">",
"bcChain",
"=",
"convertToBouncyCastleCertificate",
"(",
"chain",
")",
";"... | Certificate Revocation checks
@param chain chain of certificates attached.
@param peerHost Hostname of the server
@throws CertificateException if any certificate validation fails | [
"Certificate",
"Revocation",
"checks"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SFTrustManager.java#L585-L631 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/internal/summary/InternalResultSummary.java | InternalResultSummary.resolvePlan | private static Plan resolvePlan( Plan plan, ProfiledPlan profiledPlan ) {
"""
Profiled plan is a superset of plan. This method returns profiled plan if plan is {@code null}.
@param plan the given plan, possibly {@code null}.
@param profiledPlan the given profiled plan, possibly {@code null}.
@return available... | java | private static Plan resolvePlan( Plan plan, ProfiledPlan profiledPlan )
{
return plan == null ? profiledPlan : plan;
} | [
"private",
"static",
"Plan",
"resolvePlan",
"(",
"Plan",
"plan",
",",
"ProfiledPlan",
"profiledPlan",
")",
"{",
"return",
"plan",
"==",
"null",
"?",
"profiledPlan",
":",
"plan",
";",
"}"
] | Profiled plan is a superset of plan. This method returns profiled plan if plan is {@code null}.
@param plan the given plan, possibly {@code null}.
@param profiledPlan the given profiled plan, possibly {@code null}.
@return available plan. | [
"Profiled",
"plan",
"is",
"a",
"superset",
"of",
"plan",
".",
"This",
"method",
"returns",
"profiled",
"plan",
"if",
"plan",
"is",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/summary/InternalResultSummary.java#L183-L186 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.beginCreateOrUpdateAsync | public Observable<DomainInner> beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo) {
"""
Create a domain.
Asynchronously creates a new domain with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param ... | java | public Observable<DomainInner> beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() {
@Override
... | [
"public",
"Observable",
"<",
"DomainInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"DomainInner",
"domainInfo",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Create a domain.
Asynchronously creates a new domain with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@param domainInfo Domain information
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Create",
"a",
"domain",
".",
"Asynchronously",
"creates",
"a",
"new",
"domain",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L327-L334 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/PropertyConnectionCalculator.java | PropertyConnectionCalculator.resolveTemporaryProperties | private void resolveTemporaryProperties(Map<String, Set<String>> map) {
"""
Resolves the temporary properties of the given property map. It replaces the temporary properties in the values
of the given map with the values of the temporary property it replaces. This procedure is done until there are no
more tempor... | java | private void resolveTemporaryProperties(Map<String, Set<String>> map) {
boolean temporaryPresent = false;
do {
temporaryPresent = false;
for (Map.Entry<String, Set<String>> entry : map.entrySet()) {
Set<String> newProperties = new HashSet<String>();
... | [
"private",
"void",
"resolveTemporaryProperties",
"(",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"map",
")",
"{",
"boolean",
"temporaryPresent",
"=",
"false",
";",
"do",
"{",
"temporaryPresent",
"=",
"false",
";",
"for",
"(",
"Map",
".",
... | Resolves the temporary properties of the given property map. It replaces the temporary properties in the values
of the given map with the values of the temporary property it replaces. This procedure is done until there are no
more temporary fields present in the values of the map. | [
"Resolves",
"the",
"temporary",
"properties",
"of",
"the",
"given",
"property",
"map",
".",
"It",
"replaces",
"the",
"temporary",
"properties",
"in",
"the",
"values",
"of",
"the",
"given",
"map",
"with",
"the",
"values",
"of",
"the",
"temporary",
"property",
... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/PropertyConnectionCalculator.java#L119-L138 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeURLWithDefault | @Pure
public static URL getAttributeURLWithDefault(Node document, boolean caseSensitive, URL defaultValue, String... path) {
"""
Replies the URL that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the X... | java | @Pure
public static URL getAttributeURLWithDefault(Node document, boolean caseSensitive, URL defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
final String v = getAttributeValue(document, caseSensitive, 0, path);
if (v != null && !v.isEmpty()) {
final URL url = File... | [
"@",
"Pure",
"public",
"static",
"URL",
"getAttributeURLWithDefault",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"URL",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
... | Replies the URL that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param defaultValue is the defau... | [
"Replies",
"the",
"URL",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L997-L1008 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java | Sources.asProperties | public static Properties asProperties(Class<?> contextClass, String resourceName) throws IOException {
"""
Returns the given source as a {@link Properties}
@param contextClass
@param resourceName
@return
@throws IOException
"""
Closer closer = Closer.create();
try {
Properties p = new Properties()... | java | public static Properties asProperties(Class<?> contextClass, String resourceName) throws IOException {
Closer closer = Closer.create();
try {
Properties p = new Properties();
p.load(closer.register(asCharSource(contextClass, resourceName).openStream()));
return p;
} catch (Throwable e) {
throw closer.... | [
"public",
"static",
"Properties",
"asProperties",
"(",
"Class",
"<",
"?",
">",
"contextClass",
",",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"Closer",
"closer",
"=",
"Closer",
".",
"create",
"(",
")",
";",
"try",
"{",
"Properties",
"p",
... | Returns the given source as a {@link Properties}
@param contextClass
@param resourceName
@return
@throws IOException | [
"Returns",
"the",
"given",
"source",
"as",
"a",
"{",
"@link",
"Properties",
"}"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java#L43-L54 |
MenoData/Time4J | base/src/main/java/net/time4j/format/expert/AttributeSet.java | AttributeSet.withAttributes | AttributeSet withAttributes(Attributes attributes) {
"""
<p>Setzt die Attribute neu. </p>
@param attributes new format attributes
"""
return new AttributeSet(attributes, this.locale, this.level, this.section, this.printCondition, this.internals);
} | java | AttributeSet withAttributes(Attributes attributes) {
return new AttributeSet(attributes, this.locale, this.level, this.section, this.printCondition, this.internals);
} | [
"AttributeSet",
"withAttributes",
"(",
"Attributes",
"attributes",
")",
"{",
"return",
"new",
"AttributeSet",
"(",
"attributes",
",",
"this",
".",
"locale",
",",
"this",
".",
"level",
",",
"this",
".",
"section",
",",
"this",
".",
"printCondition",
",",
"thi... | <p>Setzt die Attribute neu. </p>
@param attributes new format attributes | [
"<p",
">",
"Setzt",
"die",
"Attribute",
"neu",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/AttributeSet.java#L314-L318 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/TimeZoneNames.java | TimeZoneNames.fillZoneStrings | private static void fillZoneStrings(String localeId, String[][] result) {
"""
/* J2ObjC: unused.
public static native String getExemplarLocation(String locale, String tz);
"""
for (int i = 0; i < result.length; i++) {
fillZoneStringNames(localeId, result[i]);
}
} | java | private static void fillZoneStrings(String localeId, String[][] result) {
for (int i = 0; i < result.length; i++) {
fillZoneStringNames(localeId, result[i]);
}
} | [
"private",
"static",
"void",
"fillZoneStrings",
"(",
"String",
"localeId",
",",
"String",
"[",
"]",
"[",
"]",
"result",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"result",
".",
"length",
";",
"i",
"++",
")",
"{",
"fillZoneStringNames... | /* J2ObjC: unused.
public static native String getExemplarLocation(String locale, String tz); | [
"/",
"*",
"J2ObjC",
":",
"unused",
".",
"public",
"static",
"native",
"String",
"getExemplarLocation",
"(",
"String",
"locale",
"String",
"tz",
")",
";"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/TimeZoneNames.java#L164-L168 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java | ReferrerURLCookieHandler.clearReferrerURLCookie | public void clearReferrerURLCookie(HttpServletRequest req, HttpServletResponse res, String cookieName) {
"""
Removes the referrer URL cookie from the HttpServletResponse if set in the
HttpServletRequest.
@param req
@param res
"""
String url = CookieHelper.getCookieValue(req.getCookies(), cookieNa... | java | public void clearReferrerURLCookie(HttpServletRequest req, HttpServletResponse res, String cookieName) {
String url = CookieHelper.getCookieValue(req.getCookies(), cookieName);
if (url != null && url.length() > 0) {
invalidateReferrerURLCookie(req, res, cookieName);
}
} | [
"public",
"void",
"clearReferrerURLCookie",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"String",
"cookieName",
")",
"{",
"String",
"url",
"=",
"CookieHelper",
".",
"getCookieValue",
"(",
"req",
".",
"getCookies",
"(",
")",
",",
"co... | Removes the referrer URL cookie from the HttpServletResponse if set in the
HttpServletRequest.
@param req
@param res | [
"Removes",
"the",
"referrer",
"URL",
"cookie",
"from",
"the",
"HttpServletResponse",
"if",
"set",
"in",
"the",
"HttpServletRequest",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java#L154-L160 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java | MamManager.retrieveFormFields | public List<FormField> retrieveFormFields(String node)
throws NoResponseException, XMPPErrorException, NotConnectedException,
InterruptedException, NotLoggedInException {
"""
Get the form fields supported by the server.
@param node The PubSub node name, can be null
@return the l... | java | public List<FormField> retrieveFormFields(String node)
throws NoResponseException, XMPPErrorException, NotConnectedException,
InterruptedException, NotLoggedInException {
String queryId = UUID.randomUUID().toString();
MamQueryIQ mamQueryIq = new MamQueryIQ(queryId, node, ... | [
"public",
"List",
"<",
"FormField",
">",
"retrieveFormFields",
"(",
"String",
"node",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
",",
"NotLoggedInException",
"{",
"String",
"queryId",
"=",
... | Get the form fields supported by the server.
@param node The PubSub node name, can be null
@return the list of form fields.
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException
@throws NotLoggedInException | [
"Get",
"the",
"form",
"fields",
"supported",
"by",
"the",
"server",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java#L524-L534 |
the-fascinator/plugin-indexer-solr | src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java | SolrIndexer.cacheConfig | private void cacheConfig(String oid, JsonSimpleConfig config) {
"""
Add a config class to the cache if caching if configured
@param oid
: The config OID to use as an index
@param config
: The instantiated JsonConfigHelper to cache
"""
if (useCache && config != null) {
configCache.put(oid, config);
... | java | private void cacheConfig(String oid, JsonSimpleConfig config) {
if (useCache && config != null) {
configCache.put(oid, config);
}
} | [
"private",
"void",
"cacheConfig",
"(",
"String",
"oid",
",",
"JsonSimpleConfig",
"config",
")",
"{",
"if",
"(",
"useCache",
"&&",
"config",
"!=",
"null",
")",
"{",
"configCache",
".",
"put",
"(",
"oid",
",",
"config",
")",
";",
"}",
"}"
] | Add a config class to the cache if caching if configured
@param oid
: The config OID to use as an index
@param config
: The instantiated JsonConfigHelper to cache | [
"Add",
"a",
"config",
"class",
"to",
"the",
"cache",
"if",
"caching",
"if",
"configured"
] | train | https://github.com/the-fascinator/plugin-indexer-solr/blob/001159b18b78a87daa5d8b2a17ced28694bae156/src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java#L1163-L1167 |
nominanuda/zen-project | zen-dataobject/src/main/java/com/nominanuda/dataobject/DataStructHelper.java | DataStructHelper.sort | @SuppressWarnings("unchecked")
public <T> void sort(Arr arr, Comparator<T> c) {
"""
can lead to classcastexception if comparator is not of the right type
"""
int l = arr.getLength();
Object[] objs = new Object[l];
for (int i=0; i<l; i++) {
objs[i] = arr.get(i);
}
Arrays.sort((T[])objs, c);
for ... | java | @SuppressWarnings("unchecked")
public <T> void sort(Arr arr, Comparator<T> c) {
int l = arr.getLength();
Object[] objs = new Object[l];
for (int i=0; i<l; i++) {
objs[i] = arr.get(i);
}
Arrays.sort((T[])objs, c);
for (int i=0; i<l; i++) {
arr.put(i, objs[i]);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"void",
"sort",
"(",
"Arr",
"arr",
",",
"Comparator",
"<",
"T",
">",
"c",
")",
"{",
"int",
"l",
"=",
"arr",
".",
"getLength",
"(",
")",
";",
"Object",
"[",
"]",
"objs",
... | can lead to classcastexception if comparator is not of the right type | [
"can",
"lead",
"to",
"classcastexception",
"if",
"comparator",
"is",
"not",
"of",
"the",
"right",
"type"
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-dataobject/src/main/java/com/nominanuda/dataobject/DataStructHelper.java#L859-L870 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlUtils.java | CmsXmlUtils.createXpath | public static String createXpath(String path, int index) {
"""
Translates a simple lookup path to the simplified Xpath format used for
the internal bookmarks.<p>
Examples:<br>
<code>title</code> becomes <code>title[1]</code><br>
<code>title[1]</code> is left untouched<br>
<code>title/subtitle</code> becomes... | java | public static String createXpath(String path, int index) {
if (path.indexOf('/') > -1) {
// this is a complex path over more then 1 node
StringBuffer result = new StringBuffer(path.length() + 32);
// split the path into sub elements
List<String> elements = CmsSt... | [
"public",
"static",
"String",
"createXpath",
"(",
"String",
"path",
",",
"int",
"index",
")",
"{",
"if",
"(",
"path",
".",
"indexOf",
"(",
"'",
"'",
")",
">",
"-",
"1",
")",
"{",
"// this is a complex path over more then 1 node",
"StringBuffer",
"result",
"=... | Translates a simple lookup path to the simplified Xpath format used for
the internal bookmarks.<p>
Examples:<br>
<code>title</code> becomes <code>title[1]</code><br>
<code>title[1]</code> is left untouched<br>
<code>title/subtitle</code> becomes <code>title[1]/subtitle[1]</code><br>
<code>title/subtitle[1]</code> beco... | [
"Translates",
"a",
"simple",
"lookup",
"path",
"to",
"the",
"simplified",
"Xpath",
"format",
"used",
"for",
"the",
"internal",
"bookmarks",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L177-L199 |
phax/ph-web | ph-httpclient/src/main/java/com/helger/httpclient/HttpDebugger.java | HttpDebugger.beforeRequest | public static void beforeRequest (@Nonnull final HttpUriRequest aRequest, @Nullable final HttpContext aHttpContext) {
"""
Call before an invocation
@param aRequest
The request to be executed. May not be <code>null</code>.
@param aHttpContext
The special HTTP content for this call. May be <code>null</code>.
... | java | public static void beforeRequest (@Nonnull final HttpUriRequest aRequest, @Nullable final HttpContext aHttpContext)
{
if (isEnabled ())
if (LOGGER.isInfoEnabled ())
LOGGER.info ("Before HTTP call: " +
aRequest.getMethod () +
" " +
... | [
"public",
"static",
"void",
"beforeRequest",
"(",
"@",
"Nonnull",
"final",
"HttpUriRequest",
"aRequest",
",",
"@",
"Nullable",
"final",
"HttpContext",
"aHttpContext",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"if",
"(",
"LOGGER",
".",
"isInfoEnabled",
... | Call before an invocation
@param aRequest
The request to be executed. May not be <code>null</code>.
@param aHttpContext
The special HTTP content for this call. May be <code>null</code>. | [
"Call",
"before",
"an",
"invocation"
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-httpclient/src/main/java/com/helger/httpclient/HttpDebugger.java#L66-L75 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.removeHdrInstances | private void removeHdrInstances(HeaderElement root, boolean bFilter) {
"""
Remove all instances of this header.
@param root
@param bFilter
"""
if (null == root) {
return;
}
HeaderKeys key = root.getKey();
if (bFilter && key.useFilters()) {
filterRemov... | java | private void removeHdrInstances(HeaderElement root, boolean bFilter) {
if (null == root) {
return;
}
HeaderKeys key = root.getKey();
if (bFilter && key.useFilters()) {
filterRemove(key, null);
}
HeaderElement elem = root;
while (null != ele... | [
"private",
"void",
"removeHdrInstances",
"(",
"HeaderElement",
"root",
",",
"boolean",
"bFilter",
")",
"{",
"if",
"(",
"null",
"==",
"root",
")",
"{",
"return",
";",
"}",
"HeaderKeys",
"key",
"=",
"root",
".",
"getKey",
"(",
")",
";",
"if",
"(",
"bFilt... | Remove all instances of this header.
@param root
@param bFilter | [
"Remove",
"all",
"instances",
"of",
"this",
"header",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2290-L2303 |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/AtomicHistogram.java | AtomicHistogram.decodeFromCompressedByteBuffer | public static AtomicHistogram decodeFromCompressedByteBuffer(final ByteBuffer buffer,
final long minBarForHighestTrackableValue) throws DataFormatException {
"""
Construct a new histogram by decoding it from a compressed form in a ByteBuffer.
@param... | java | public static AtomicHistogram decodeFromCompressedByteBuffer(final ByteBuffer buffer,
final long minBarForHighestTrackableValue) throws DataFormatException {
return decodeFromCompressedByteBuffer(buffer, AtomicHistogram.class, minBarForHighestTrac... | [
"public",
"static",
"AtomicHistogram",
"decodeFromCompressedByteBuffer",
"(",
"final",
"ByteBuffer",
"buffer",
",",
"final",
"long",
"minBarForHighestTrackableValue",
")",
"throws",
"DataFormatException",
"{",
"return",
"decodeFromCompressedByteBuffer",
"(",
"buffer",
",",
... | Construct a new histogram by decoding it from a compressed form in a ByteBuffer.
@param buffer The buffer to decode from
@param minBarForHighestTrackableValue Force highestTrackableValue to be set at least this high
@return The newly constructed histogram
@throws DataFormatException on error parsing/decompressing the b... | [
"Construct",
"a",
"new",
"histogram",
"by",
"decoding",
"it",
"from",
"a",
"compressed",
"form",
"in",
"a",
"ByteBuffer",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/AtomicHistogram.java#L219-L222 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putLongLittleEndian | public final void putLongLittleEndian(int index, long value) {
"""
Writes the given long value (64bit, 8 bytes) to the given position in little endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putLong(int, long)}. For most cases (such as
tr... | java | public final void putLongLittleEndian(int index, long value) {
if (LITTLE_ENDIAN) {
putLong(index, value);
} else {
putLong(index, Long.reverseBytes(value));
}
} | [
"public",
"final",
"void",
"putLongLittleEndian",
"(",
"int",
"index",
",",
"long",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putLong",
"(",
"index",
",",
"value",
")",
";",
"}",
"else",
"{",
"putLong",
"(",
"index",
",",
"Long",
".",
... | Writes the given long value (64bit, 8 bytes) to the given position in little endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putLong(int, long)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffice... | [
"Writes",
"the",
"given",
"long",
"value",
"(",
"64bit",
"8",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"little",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
"order"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L934-L940 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.minusRetainScale | public BigMoney minusRetainScale(BigMoneyProvider moneyToSubtract, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value with the amount in the same currency subtracted
retaining the scale by rounding the result.
<p>
The scale of the result will be the same as the scale of this instance.
For e... | java | public BigMoney minusRetainScale(BigMoneyProvider moneyToSubtract, RoundingMode roundingMode) {
BigMoney toSubtract = checkCurrencyEqual(moneyToSubtract);
return minusRetainScale(toSubtract.getAmount(), roundingMode);
} | [
"public",
"BigMoney",
"minusRetainScale",
"(",
"BigMoneyProvider",
"moneyToSubtract",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"BigMoney",
"toSubtract",
"=",
"checkCurrencyEqual",
"(",
"moneyToSubtract",
")",
";",
"return",
"minusRetainScale",
"(",
"toSubtract",
"... | Returns a copy of this monetary value with the amount in the same currency subtracted
retaining the scale by rounding the result.
<p>
The scale of the result will be the same as the scale of this instance.
For example,'USD 25.95' minus 'USD 3.029' gives 'USD 22.92 with most rounding modes.
<p>
This instance is immutabl... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"amount",
"in",
"the",
"same",
"currency",
"subtracted",
"retaining",
"the",
"scale",
"by",
"rounding",
"the",
"result",
".",
"<p",
">",
"The",
"scale",
"of",
"the",
"result",
"will"... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1179-L1182 |
actorapp/actor-platform | actor-server/actor-frontend/src/main/java/im/actor/crypto/primitives/kuznechik/KuznechikCipher.java | KuznechikCipher.encryptBlock | public void encryptBlock(byte[] data, int offset, byte[] dest, int destOffset) {
"""
Encrypting Block with KuznechikImpl encryption
@param data 16-byte block for encryption
@param offset offset in block
@param dest destination array
@param destOffset destinaation offset
"""
// w12... | java | public void encryptBlock(byte[] data, int offset, byte[] dest, int destOffset) {
// w128_t x;
// x.q[0] = ((uint64_t *) blk)[0];
// x.q[1] = ((uint64_t *) blk)[1];
Kuz128 x = new Kuz128();
x.setQ(0, ByteStrings.bytesToLong(data, offset));
x.setQ(1, ByteStrings.bytesToLong... | [
"public",
"void",
"encryptBlock",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"byte",
"[",
"]",
"dest",
",",
"int",
"destOffset",
")",
"{",
"// w128_t x;",
"// x.q[0] = ((uint64_t *) blk)[0];",
"// x.q[1] = ((uint64_t *) blk)[1];",
"Kuz128",
"x",
"="... | Encrypting Block with KuznechikImpl encryption
@param data 16-byte block for encryption
@param offset offset in block
@param dest destination array
@param destOffset destinaation offset | [
"Encrypting",
"Block",
"with",
"KuznechikImpl",
"encryption"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-server/actor-frontend/src/main/java/im/actor/crypto/primitives/kuznechik/KuznechikCipher.java#L31-L57 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transaction/entry/Modification.java | Modification.writeTo | public void writeTo(ByteBuf byteBuf, Codec codec) {
"""
Writes this modification to the {@link ByteBuf}.
@param byteBuf the {@link ByteBuf} to write to.
@param codec the {@link Codec} to use.
"""
writeArray(byteBuf, key);
byteBuf.writeByte(control);
if (!ControlByte.NON_EXISTING.hasFlag... | java | public void writeTo(ByteBuf byteBuf, Codec codec) {
writeArray(byteBuf, key);
byteBuf.writeByte(control);
if (!ControlByte.NON_EXISTING.hasFlag(control) && !ControlByte.NOT_READ.hasFlag(control)) {
byteBuf.writeLong(versionRead);
}
if (ControlByte.REMOVE_OP.hasFlag(control)) {
... | [
"public",
"void",
"writeTo",
"(",
"ByteBuf",
"byteBuf",
",",
"Codec",
"codec",
")",
"{",
"writeArray",
"(",
"byteBuf",
",",
"key",
")",
";",
"byteBuf",
".",
"writeByte",
"(",
"control",
")",
";",
"if",
"(",
"!",
"ControlByte",
".",
"NON_EXISTING",
".",
... | Writes this modification to the {@link ByteBuf}.
@param byteBuf the {@link ByteBuf} to write to.
@param codec the {@link Codec} to use. | [
"Writes",
"this",
"modification",
"to",
"the",
"{",
"@link",
"ByteBuf",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transaction/entry/Modification.java#L47-L59 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java | AuthenticationApi.retrieveTokenWithHttpInfo | public ApiResponse<DefaultOAuth2AccessToken> retrieveTokenWithHttpInfo(String grantType, String accept, String authorization, String clientId, String password, String refreshToken, String scope, String username) throws ApiException {
"""
Retrieve access token
Retrieve an access token based on the grant type &... | java | public ApiResponse<DefaultOAuth2AccessToken> retrieveTokenWithHttpInfo(String grantType, String accept, String authorization, String clientId, String password, String refreshToken, String scope, String username) throws ApiException {
com.squareup.okhttp.Call call = retrieveTokenValidateBeforeCall(grantType, acc... | [
"public",
"ApiResponse",
"<",
"DefaultOAuth2AccessToken",
">",
"retrieveTokenWithHttpInfo",
"(",
"String",
"grantType",
",",
"String",
"accept",
",",
"String",
"authorization",
",",
"String",
"clientId",
",",
"String",
"password",
",",
"String",
"refreshToken",
",",
... | Retrieve access token
Retrieve an access token based on the grant type &mdash; Authorization Code Grant, Resource Owner Password Credentials Grant or Client Credentials Grant. For more information, see [Token Endpoint](https://tools.ietf.org/html/rfc6749). **Note:** For the optional **scope** parameter, the Authent... | [
"Retrieve",
"access",
"token",
"Retrieve",
"an",
"access",
"token",
"based",
"on",
"the",
"grant",
"type",
"&",
";",
"mdash",
";",
"Authorization",
"Code",
"Grant",
"Resource",
"Owner",
"Password",
"Credentials",
"Grant",
"or",
"Client",
"Credentials",
"Grant... | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1068-L1072 |
mpetazzoni/ttorrent | common/src/main/java/com/turn/ttorrent/common/protocol/http/HTTPAnnounceResponseMessage.java | HTTPAnnounceResponseMessage.toPeerList | private static List<Peer> toPeerList(byte[] data)
throws InvalidBEncodingException, UnknownHostException {
"""
Build a peer list as a list of {@link Peer}s from the
announce response's binary compact peer list.
@param data The bytes representing the compact peer list from the
announce response.
@re... | java | private static List<Peer> toPeerList(byte[] data)
throws InvalidBEncodingException, UnknownHostException {
if (data.length % 6 != 0) {
throw new InvalidBEncodingException("Invalid peers " +
"binary information string!");
}
List<Peer> result = new LinkedList<Peer>();
ByteBu... | [
"private",
"static",
"List",
"<",
"Peer",
">",
"toPeerList",
"(",
"byte",
"[",
"]",
"data",
")",
"throws",
"InvalidBEncodingException",
",",
"UnknownHostException",
"{",
"if",
"(",
"data",
".",
"length",
"%",
"6",
"!=",
"0",
")",
"{",
"throw",
"new",
"In... | Build a peer list as a list of {@link Peer}s from the
announce response's binary compact peer list.
@param data The bytes representing the compact peer list from the
announce response.
@return A {@link List} of {@link Peer}s representing the
peers' addresses. Peer IDs are lost, but they are not crucial. | [
"Build",
"a",
"peer",
"list",
"as",
"a",
"list",
"of",
"{",
"@link",
"Peer",
"}",
"s",
"from",
"the",
"announce",
"response",
"s",
"binary",
"compact",
"peer",
"list",
"."
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/common/src/main/java/com/turn/ttorrent/common/protocol/http/HTTPAnnounceResponseMessage.java#L167-L188 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BuddhistChronology.java | BuddhistChronology.getInstance | public static BuddhistChronology getInstance(DateTimeZone zone) {
"""
Standard instance of a Buddhist Chronology, that matches
Sun's BuddhistCalendar class. This means that it follows the
GregorianJulian calendar rules with a cutover date.
@param zone the time zone to use, null is default
"""
if ... | java | public static BuddhistChronology getInstance(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
BuddhistChronology chrono = cCache.get(zone);
if (chrono == null) {
// First create without a lower limit.
chrono = new BuddhistCh... | [
"public",
"static",
"BuddhistChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"BuddhistChronology",
"chrono",
"=",
"cCache",
".",... | Standard instance of a Buddhist Chronology, that matches
Sun's BuddhistCalendar class. This means that it follows the
GregorianJulian calendar rules with a cutover date.
@param zone the time zone to use, null is default | [
"Standard",
"instance",
"of",
"a",
"Buddhist",
"Chronology",
"that",
"matches",
"Sun",
"s",
"BuddhistCalendar",
"class",
".",
"This",
"means",
"that",
"it",
"follows",
"the",
"GregorianJulian",
"calendar",
"rules",
"with",
"a",
"cutover",
"date",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BuddhistChronology.java#L104-L121 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getJmolScript | public String getJmolScript(Atom[] atoms, int axisID) {
"""
Returns a Jmol script which will display the axis of rotation. This
consists of a cyan arrow along the axis, plus an arc showing the angle
of rotation.
<p>
As the rotation angle gets smaller, the axis of rotation becomes poorly
defined and would need... | java | public String getJmolScript(Atom[] atoms, int axisID){
final double width=.5;// width of JMol object
final String axisColor = "yellow"; //axis color
final String screwColor = "orange"; //screw translation color
Pair<Atom> endPoints = getAxisEnds(atoms);
Atom axisMin = endPoints.getFirst();
Atom axisMax = e... | [
"public",
"String",
"getJmolScript",
"(",
"Atom",
"[",
"]",
"atoms",
",",
"int",
"axisID",
")",
"{",
"final",
"double",
"width",
"=",
".5",
";",
"// width of JMol object",
"final",
"String",
"axisColor",
"=",
"\"yellow\"",
";",
"//axis color",
"final",
"String... | Returns a Jmol script which will display the axis of rotation. This
consists of a cyan arrow along the axis, plus an arc showing the angle
of rotation.
<p>
As the rotation angle gets smaller, the axis of rotation becomes poorly
defined and would need to get farther and farther away from the protein.
This is not particu... | [
"Returns",
"a",
"Jmol",
"script",
"which",
"will",
"display",
"the",
"axis",
"of",
"rotation",
".",
"This",
"consists",
"of",
"a",
"cyan",
"arrow",
"along",
"the",
"axis",
"plus",
"an",
"arc",
"showing",
"the",
"angle",
"of",
"rotation",
".",
"<p",
">",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L447-L497 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java | LatLongUtils.parseCoordinateString | public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) {
"""
Parses a given number of comma-separated coordinate values from the supplied string.
@param coordinatesString a comma-separated string of coordinate values.
@param numberOfCoordinates the expected number of ... | java | public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) {
StringTokenizer stringTokenizer = new StringTokenizer(coordinatesString, DELIMITER, true);
boolean isDelimiter = true;
List<String> tokens = new ArrayList<>(numberOfCoordinates);
while (str... | [
"public",
"static",
"double",
"[",
"]",
"parseCoordinateString",
"(",
"String",
"coordinatesString",
",",
"int",
"numberOfCoordinates",
")",
"{",
"StringTokenizer",
"stringTokenizer",
"=",
"new",
"StringTokenizer",
"(",
"coordinatesString",
",",
"DELIMITER",
",",
"tru... | Parses a given number of comma-separated coordinate values from the supplied string.
@param coordinatesString a comma-separated string of coordinate values.
@param numberOfCoordinates the expected number of coordinate values in the string.
@return the coordinate values in the order they have been parsed from the str... | [
"Parses",
"a",
"given",
"number",
"of",
"comma",
"-",
"separated",
"coordinate",
"values",
"from",
"the",
"supplied",
"string",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L249-L275 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/utils/URIBuilder.java | URIBuilder.addParameter | public URIBuilder addParameter( String key, String value ) {
"""
Add a single query parameter. Parameter is ignored if it has null value.
@param key The parameter key (not url encoded)
@param value The parameter value (not url encoded)
@return The builder
"""
if ( key != null && value != null ) {
... | java | public URIBuilder addParameter( String key, String value )
{
if ( key != null && value != null ) {
queryParams.put( key, value );
}
return this;
} | [
"public",
"URIBuilder",
"addParameter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
"&&",
"value",
"!=",
"null",
")",
"{",
"queryParams",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"return",
"this... | Add a single query parameter. Parameter is ignored if it has null value.
@param key The parameter key (not url encoded)
@param value The parameter value (not url encoded)
@return The builder | [
"Add",
"a",
"single",
"query",
"parameter",
".",
"Parameter",
"is",
"ignored",
"if",
"it",
"has",
"null",
"value",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/utils/URIBuilder.java#L115-L122 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/StencilEngine.java | StencilEngine.loadInline | public Template loadInline(String text) throws IOException, ParseException {
"""
Loads the given text as a template
@param text Template text
@return Loaded template
@throws IOException
@throws ParseException
"""
try(InlineTemplateSource templateSource = new InlineTemplateSource(text)) {
retur... | java | public Template loadInline(String text) throws IOException, ParseException {
try(InlineTemplateSource templateSource = new InlineTemplateSource(text)) {
return load("inline", templateSource);
}
} | [
"public",
"Template",
"loadInline",
"(",
"String",
"text",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"try",
"(",
"InlineTemplateSource",
"templateSource",
"=",
"new",
"InlineTemplateSource",
"(",
"text",
")",
")",
"{",
"return",
"load",
"(",
"\"i... | Loads the given text as a template
@param text Template text
@return Loaded template
@throws IOException
@throws ParseException | [
"Loads",
"the",
"given",
"text",
"as",
"a",
"template"
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/StencilEngine.java#L324-L331 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PDatabase.java | PDatabase.getPTable | public synchronized PTable getPTable(FieldList record, boolean bCreateIfNotFound, boolean bEnableGridAccess) {
"""
Get the physical table that matches this BaseTable and create it if it doesn't exist.
Note: If the bCreateIfNotFound flag was set, create the new table or bump the use count.
@param table The table... | java | public synchronized PTable getPTable(FieldList record, boolean bCreateIfNotFound, boolean bEnableGridAccess)
{
Object objKey = this.generateKey(record);
PTable physicalTable = (PTable)m_htTableList.get(objKey);
if (bCreateIfNotFound)
if (physicalTable == null)
ph... | [
"public",
"synchronized",
"PTable",
"getPTable",
"(",
"FieldList",
"record",
",",
"boolean",
"bCreateIfNotFound",
",",
"boolean",
"bEnableGridAccess",
")",
"{",
"Object",
"objKey",
"=",
"this",
".",
"generateKey",
"(",
"record",
")",
";",
"PTable",
"physicalTable"... | Get the physical table that matches this BaseTable and create it if it doesn't exist.
Note: If the bCreateIfNotFound flag was set, create the new table or bump the use count.
@param table The table to create a raw data table from.
@return The raw data table (creates a new one if it doesn't already exist). | [
"Get",
"the",
"physical",
"table",
"that",
"matches",
"this",
"BaseTable",
"and",
"create",
"it",
"if",
"it",
"doesn",
"t",
"exist",
".",
"Note",
":",
"If",
"the",
"bCreateIfNotFound",
"flag",
"was",
"set",
"create",
"the",
"new",
"table",
"or",
"bump",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PDatabase.java#L265-L275 |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/RunningWorkers.java | RunningWorkers.doneTasklets | void doneTasklets(final String workerId, final List<Integer> taskletIds) {
"""
Concurrency: Called by multiple threads.
Parameter: Same arguments can come in multiple times.
(e.g. preemption message coming before tasklet completion message multiple times)
"""
lock.lock();
try {
if (!terminated ... | java | void doneTasklets(final String workerId, final List<Integer> taskletIds) {
lock.lock();
try {
if (!terminated && runningWorkers.containsKey(workerId)) { // Preemption can come before
final VortexWorkerManager worker = this.runningWorkers.get(workerId);
final List<Tasklet> tasklets = worker... | [
"void",
"doneTasklets",
"(",
"final",
"String",
"workerId",
",",
"final",
"List",
"<",
"Integer",
">",
"taskletIds",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"terminated",
"&&",
"runningWorkers",
".",
"containsKey",
"(",
... | Concurrency: Called by multiple threads.
Parameter: Same arguments can come in multiple times.
(e.g. preemption message coming before tasklet completion message multiple times) | [
"Concurrency",
":",
"Called",
"by",
"multiple",
"threads",
".",
"Parameter",
":",
"Same",
"arguments",
"can",
"come",
"in",
"multiple",
"times",
".",
"(",
"e",
".",
"g",
".",
"preemption",
"message",
"coming",
"before",
"tasklet",
"completion",
"message",
"m... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/RunningWorkers.java#L211-L227 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMFiles.java | JMFiles.writeString | public static boolean writeString(String inputString, File targetFile) {
"""
Write string boolean.
@param inputString the input string
@param targetFile the target file
@return the boolean
"""
if (!targetFile.exists()) {
try {
Files.write(targetFile.toPath(), inputStri... | java | public static boolean writeString(String inputString, File targetFile) {
if (!targetFile.exists()) {
try {
Files.write(targetFile.toPath(), inputString.getBytes());
} catch (IOException e) {
return JMExceptionManager.handleExceptionAndReturnFalse(log, e,
... | [
"public",
"static",
"boolean",
"writeString",
"(",
"String",
"inputString",
",",
"File",
"targetFile",
")",
"{",
"if",
"(",
"!",
"targetFile",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{",
"Files",
".",
"write",
"(",
"targetFile",
".",
"toPath",
"(",
... | Write string boolean.
@param inputString the input string
@param targetFile the target file
@return the boolean | [
"Write",
"string",
"boolean",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMFiles.java#L91-L101 |
janvanbesien/java-ipv6 | src/main/java/com/googlecode/ipv6/IPv6Network.java | IPv6Network.fromTwoAddresses | public static IPv6Network fromTwoAddresses(IPv6Address one, IPv6Address two) {
"""
Create an IPv6 network from the two addresses within the network. This will construct the smallest possible network ("longest prefix
length") which contains both addresses.
@param one address one
@param two address two, should ... | java | public static IPv6Network fromTwoAddresses(IPv6Address one, IPv6Address two)
{
final IPv6NetworkMask longestPrefixLength = IPv6NetworkMask.fromPrefixLength(IPv6NetworkHelpers.longestPrefixLength(one, two));
return new IPv6Network(one.maskWithNetworkMask(longestPrefixLength), longestPrefixLength);
... | [
"public",
"static",
"IPv6Network",
"fromTwoAddresses",
"(",
"IPv6Address",
"one",
",",
"IPv6Address",
"two",
")",
"{",
"final",
"IPv6NetworkMask",
"longestPrefixLength",
"=",
"IPv6NetworkMask",
".",
"fromPrefixLength",
"(",
"IPv6NetworkHelpers",
".",
"longestPrefixLength"... | Create an IPv6 network from the two addresses within the network. This will construct the smallest possible network ("longest prefix
length") which contains both addresses.
@param one address one
@param two address two, should be bigger than address one
@return ipv6 network | [
"Create",
"an",
"IPv6",
"network",
"from",
"the",
"two",
"addresses",
"within",
"the",
"network",
".",
"This",
"will",
"construct",
"the",
"smallest",
"possible",
"network",
"(",
"longest",
"prefix",
"length",
")",
"which",
"contains",
"both",
"addresses",
"."... | train | https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6Network.java#L76-L80 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SchemasInner.java | SchemasInner.createOrUpdate | public IntegrationAccountSchemaInner createOrUpdate(String resourceGroupName, String integrationAccountName, String schemaName, IntegrationAccountSchemaInner schema) {
"""
Creates or updates an integration account schema.
@param resourceGroupName The resource group name.
@param integrationAccountName The integ... | java | public IntegrationAccountSchemaInner createOrUpdate(String resourceGroupName, String integrationAccountName, String schemaName, IntegrationAccountSchemaInner schema) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, schemaName, schema).toBlocking().single().body();
} | [
"public",
"IntegrationAccountSchemaInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"schemaName",
",",
"IntegrationAccountSchemaInner",
"schema",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"... | Creates or updates an integration account schema.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param schemaName The integration account schema name.
@param schema The integration account schema.
@throws IllegalArgumentException thrown if parameters fail... | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SchemasInner.java#L448-L450 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertClob | public static Object convertClob(Connection conn, String value) throws SQLException {
"""
Transfers data from String into sql.Blob
@param conn connection for which sql.Blob object would be created
@param value String
@return sql.Clob from String
@throws SQLException
"""
return convertClob(conn, ... | java | public static Object convertClob(Connection conn, String value) throws SQLException {
return convertClob(conn, value.getBytes());
} | [
"public",
"static",
"Object",
"convertClob",
"(",
"Connection",
"conn",
",",
"String",
"value",
")",
"throws",
"SQLException",
"{",
"return",
"convertClob",
"(",
"conn",
",",
"value",
".",
"getBytes",
"(",
")",
")",
";",
"}"
] | Transfers data from String into sql.Blob
@param conn connection for which sql.Blob object would be created
@param value String
@return sql.Clob from String
@throws SQLException | [
"Transfers",
"data",
"from",
"String",
"into",
"sql",
".",
"Blob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L189-L191 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/ListUtils.java | ListUtils.getRandomSublistMin | public static <T> List<T> getRandomSublistMin(List<T> list, int minCount) {
"""
Generates a random sublist of <code>list</code>, that contains at least
<code>maxCount</code> elements.
@param <T>
Type of list elements
@param list
Basic list for operation
@param minCount
Minimum number of items
@return A s... | java | public static <T> List<T> getRandomSublistMin(List<T> list, int minCount) {
int count = RandomUtils.randomIntBetween(minCount, list.size());
return getRandomSublist(list, count);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getRandomSublistMin",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"minCount",
")",
"{",
"int",
"count",
"=",
"RandomUtils",
".",
"randomIntBetween",
"(",
"minCount",
",",
"list",
".",
"size... | Generates a random sublist of <code>list</code>, that contains at least
<code>maxCount</code> elements.
@param <T>
Type of list elements
@param list
Basic list for operation
@param minCount
Minimum number of items
@return A sublist with at least <code>minCount</code> elements | [
"Generates",
"a",
"random",
"sublist",
"of",
"<code",
">",
"list<",
"/",
"code",
">",
"that",
"contains",
"at",
"least",
"<code",
">",
"maxCount<",
"/",
"code",
">",
"elements",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ListUtils.java#L501-L504 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/location/CmsLocationController.java | CmsLocationController.setPosition | private void setPosition(float latitude, float longitude, boolean updateMap, boolean updateAddress) {
"""
Sets the position values and updates the map view.<p>
@param latitude the latitude
@param longitude the longitude
@param updateMap <code>true</code> to update the map
@param updateAddress <code>true</cod... | java | private void setPosition(float latitude, float longitude, boolean updateMap, boolean updateAddress) {
m_editValue.setLatitude(latitude);
m_editValue.setLongitude(longitude);
m_popupContent.displayValues(m_editValue);
if (updateMap) {
updateMarkerPosition();
}
... | [
"private",
"void",
"setPosition",
"(",
"float",
"latitude",
",",
"float",
"longitude",
",",
"boolean",
"updateMap",
",",
"boolean",
"updateAddress",
")",
"{",
"m_editValue",
".",
"setLatitude",
"(",
"latitude",
")",
";",
"m_editValue",
".",
"setLongitude",
"(",
... | Sets the position values and updates the map view.<p>
@param latitude the latitude
@param longitude the longitude
@param updateMap <code>true</code> to update the map
@param updateAddress <code>true</code> to update the address from the new position data | [
"Sets",
"the",
"position",
"values",
"and",
"updates",
"the",
"map",
"view",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/location/CmsLocationController.java#L793-L804 |
atomix/copycat | client/src/main/java/io/atomix/copycat/client/util/ClientConnection.java | ClientConnection.resendRequest | @SuppressWarnings("unchecked")
private <T extends Request> void resendRequest(Throwable cause, T request, BiFunction sender, Connection connection, CompletableFuture future) {
"""
Resends a request due to a request failure, resetting the connection if necessary.
"""
// If the connection has not changed, ... | java | @SuppressWarnings("unchecked")
private <T extends Request> void resendRequest(Throwable cause, T request, BiFunction sender, Connection connection, CompletableFuture future) {
// If the connection has not changed, reset it and connect to the next server.
if (this.connection == connection) {
LOGGER.trace... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
"extends",
"Request",
">",
"void",
"resendRequest",
"(",
"Throwable",
"cause",
",",
"T",
"request",
",",
"BiFunction",
"sender",
",",
"Connection",
"connection",
",",
"CompletableFuture",
"... | Resends a request due to a request failure, resetting the connection if necessary. | [
"Resends",
"a",
"request",
"due",
"to",
"a",
"request",
"failure",
"resetting",
"the",
"connection",
"if",
"necessary",
"."
] | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/client/src/main/java/io/atomix/copycat/client/util/ClientConnection.java#L155-L167 |
wealthfront/magellan | magellan-library/src/main/java/com/wealthfront/magellan/Navigator.java | Navigator.resetWithRoot | public void resetWithRoot(Activity activity, final Screen root) {
"""
Clears the back stack of this Navigator and adds the input Screen as the new root of the back stack.
@param activity activity used to verify this Navigator is in an acceptable state when resetWithRoot is called
@param root new root screen ... | java | public void resetWithRoot(Activity activity, final Screen root) {
checkOnCreateNotYetCalled(activity, "resetWithRoot() must be called before onCreate()");
backStack.clear();
backStack.push(root);
} | [
"public",
"void",
"resetWithRoot",
"(",
"Activity",
"activity",
",",
"final",
"Screen",
"root",
")",
"{",
"checkOnCreateNotYetCalled",
"(",
"activity",
",",
"\"resetWithRoot() must be called before onCreate()\"",
")",
";",
"backStack",
".",
"clear",
"(",
")",
";",
"... | Clears the back stack of this Navigator and adds the input Screen as the new root of the back stack.
@param activity activity used to verify this Navigator is in an acceptable state when resetWithRoot is called
@param root new root screen for this Navigator
@throws IllegalStateException if {@link #onCreate(Activity,... | [
"Clears",
"the",
"back",
"stack",
"of",
"this",
"Navigator",
"and",
"adds",
"the",
"input",
"Screen",
"as",
"the",
"new",
"root",
"of",
"the",
"back",
"stack",
"."
] | train | https://github.com/wealthfront/magellan/blob/f690979161a97e40fb9d11dc9d7e3c8cf85ba312/magellan-library/src/main/java/com/wealthfront/magellan/Navigator.java#L253-L257 |
davetcc/tcMenu | tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/state/MenuTree.java | MenuTree.changeItem | public <T> void changeItem(MenuItem<T> item, MenuState<T> menuState) {
"""
Change the value that's associated with a menu item. if you are changing
a value, just send a command to the device, it will automatically update
the tree.
@param item the item to change
@param menuState the new state
@param <T> the ... | java | public <T> void changeItem(MenuItem<T> item, MenuState<T> menuState) {
menuStates.put(item.getId(), menuState);
} | [
"public",
"<",
"T",
">",
"void",
"changeItem",
"(",
"MenuItem",
"<",
"T",
">",
"item",
",",
"MenuState",
"<",
"T",
">",
"menuState",
")",
"{",
"menuStates",
".",
"put",
"(",
"item",
".",
"getId",
"(",
")",
",",
"menuState",
")",
";",
"}"
] | Change the value that's associated with a menu item. if you are changing
a value, just send a command to the device, it will automatically update
the tree.
@param item the item to change
@param menuState the new state
@param <T> the type of the state, picked up automatically | [
"Change",
"the",
"value",
"that",
"s",
"associated",
"with",
"a",
"menu",
"item",
".",
"if",
"you",
"are",
"changing",
"a",
"value",
"just",
"send",
"a",
"command",
"to",
"the",
"device",
"it",
"will",
"automatically",
"update",
"the",
"tree",
"."
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/state/MenuTree.java#L258-L260 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/io/random/RandomAccessReader.java | RandomAccessReader.readContent | protected String readContent(int record) throws IOException, CDKException {
"""
Reads the record text content into a String.
@param record The record number
@return A String representation of the record
@throws java.io.IOException if error occurs during reading
@throws org.openscience.cdk.exception.CDKExcep... | java | protected String readContent(int record) throws IOException, CDKException {
logger.debug("Current record ", record);
if ((record < 0) || (record >= records)) {
throw new CDKException("No such record " + record);
}
//fireFrameRead();
raFile.seek(index[record][0]);
... | [
"protected",
"String",
"readContent",
"(",
"int",
"record",
")",
"throws",
"IOException",
",",
"CDKException",
"{",
"logger",
".",
"debug",
"(",
"\"Current record \"",
",",
"record",
")",
";",
"if",
"(",
"(",
"record",
"<",
"0",
")",
"||",
"(",
"record",
... | Reads the record text content into a String.
@param record The record number
@return A String representation of the record
@throws java.io.IOException if error occurs during reading
@throws org.openscience.cdk.exception.CDKException if the record number is invalid | [
"Reads",
"the",
"record",
"text",
"content",
"into",
"a",
"String",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/io/random/RandomAccessReader.java#L145-L157 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java | PrivateZonesInner.createOrUpdateAsync | public Observable<PrivateZoneInner> createOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) {
"""
Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
@param resourceGroupNa... | java | public Observable<PrivateZoneInner> createOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).map(new Func1<ServiceRe... | [
"public",
"Observable",
"<",
"PrivateZoneInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"PrivateZoneInner",
"parameters",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"return",
"creat... | Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param parameters Parameters supplied to the CreateOrUpdate oper... | [
"Creates",
"or",
"updates",
"a",
"Private",
"DNS",
"zone",
".",
"Does",
"not",
"modify",
"Links",
"to",
"virtual",
"networks",
"or",
"DNS",
"records",
"within",
"the",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java#L236-L243 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java | MetricStore.getSubtaskMetricStore | public synchronized ComponentMetricStore getSubtaskMetricStore(String jobID, String taskID, int subtaskIndex) {
"""
Returns the {@link ComponentMetricStore} for the given job/task ID and subtask index.
@param jobID job ID
@param taskID task ID
@param subtaskIndex subtask index
@return SubtaskMet... | java | public synchronized ComponentMetricStore getSubtaskMetricStore(String jobID, String taskID, int subtaskIndex) {
JobMetricStore job = jobID == null ? null : jobs.get(jobID);
if (job == null) {
return null;
}
TaskMetricStore task = job.getTaskMetricStore(taskID);
if (task == null) {
return null;
}
ret... | [
"public",
"synchronized",
"ComponentMetricStore",
"getSubtaskMetricStore",
"(",
"String",
"jobID",
",",
"String",
"taskID",
",",
"int",
"subtaskIndex",
")",
"{",
"JobMetricStore",
"job",
"=",
"jobID",
"==",
"null",
"?",
"null",
":",
"jobs",
".",
"get",
"(",
"j... | Returns the {@link ComponentMetricStore} for the given job/task ID and subtask index.
@param jobID job ID
@param taskID task ID
@param subtaskIndex subtask index
@return SubtaskMetricStore for the given IDs and index, or null if no store for the given arguments exists | [
"Returns",
"the",
"{",
"@link",
"ComponentMetricStore",
"}",
"for",
"the",
"given",
"job",
"/",
"task",
"ID",
"and",
"subtask",
"index",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java#L145-L155 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigWebFactory.java | XMLConfigWebFactory.loadExtensionBundles | private static void loadExtensionBundles(ConfigServerImpl cs, ConfigImpl config, Document doc, Log log) {
"""
loads the bundles defined in the extensions
@param cs
@param config
@param doc
@param log
"""
try {
Element parent = getChildByName(doc.getDocumentElement(), "extensions");
Element[] c... | java | private static void loadExtensionBundles(ConfigServerImpl cs, ConfigImpl config, Document doc, Log log) {
try {
Element parent = getChildByName(doc.getDocumentElement(), "extensions");
Element[] children = getChildren(parent, "rhextension");
String strBundles;
List<RHExtension> extensions = new Arr... | [
"private",
"static",
"void",
"loadExtensionBundles",
"(",
"ConfigServerImpl",
"cs",
",",
"ConfigImpl",
"config",
",",
"Document",
"doc",
",",
"Log",
"log",
")",
"{",
"try",
"{",
"Element",
"parent",
"=",
"getChildByName",
"(",
"doc",
".",
"getDocumentElement",
... | loads the bundles defined in the extensions
@param cs
@param config
@param doc
@param log | [
"loads",
"the",
"bundles",
"defined",
"in",
"the",
"extensions"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigWebFactory.java#L4229-L4255 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/GeomFactory1dfx.java | GeomFactory1dfx.newVector | @SuppressWarnings("static-method")
public Vector1dfx newVector(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
"""
Create a vector with properties.
@param segment the segment property.
@param x the x property.
@param y the y property.
@return the vector.
"""... | java | @SuppressWarnings("static-method")
public Vector1dfx newVector(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
return new Vector1dfx(segment, x, y);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"Vector1dfx",
"newVector",
"(",
"ObjectProperty",
"<",
"WeakReference",
"<",
"Segment1D",
"<",
"?",
",",
"?",
">",
">",
">",
"segment",
",",
"DoubleProperty",
"x",
",",
"DoubleProperty",
"y",
")... | Create a vector with properties.
@param segment the segment property.
@param x the x property.
@param y the y property.
@return the vector. | [
"Create",
"a",
"vector",
"with",
"properties",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/GeomFactory1dfx.java#L131-L134 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putIntBigEndian | public final void putIntBigEndian(int index, int value) {
"""
Writes the given int value (32bit, 4 bytes) to the given position in big endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putInt(int, int)}. For most cases (such as
transient sto... | java | public final void putIntBigEndian(int index, int value) {
if (LITTLE_ENDIAN) {
putInt(index, Integer.reverseBytes(value));
} else {
putInt(index, value);
}
} | [
"public",
"final",
"void",
"putIntBigEndian",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putInt",
"(",
"index",
",",
"Integer",
".",
"reverseBytes",
"(",
"value",
")",
")",
";",
"}",
"else",
"{",
"putInt"... | Writes the given int value (32bit, 4 bytes) to the given position in big endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putInt(int, int)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffices to k... | [
"Writes",
"the",
"given",
"int",
"value",
"(",
"32bit",
"4",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"big",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
"order",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L812-L818 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.removeByG_C | @Override
public void removeByG_C(long groupId, long commerceCountryId) {
"""
Removes all the commerce warehouses where groupId = ? and commerceCountryId = ? from the database.
@param groupId the group ID
@param commerceCountryId the commerce country ID
"""
for (CommerceWarehouse commerceWarehou... | java | @Override
public void removeByG_C(long groupId, long commerceCountryId) {
for (CommerceWarehouse commerceWarehouse : findByG_C(groupId,
commerceCountryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceWarehouse);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_C",
"(",
"long",
"groupId",
",",
"long",
"commerceCountryId",
")",
"{",
"for",
"(",
"CommerceWarehouse",
"commerceWarehouse",
":",
"findByG_C",
"(",
"groupId",
",",
"commerceCountryId",
",",
"QueryUtil",
".",
"ALL_POS"... | Removes all the commerce warehouses where groupId = ? and commerceCountryId = ? from the database.
@param groupId the group ID
@param commerceCountryId the commerce country ID | [
"Removes",
"all",
"the",
"commerce",
"warehouses",
"where",
"groupId",
"=",
"?",
";",
"and",
"commerceCountryId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L1636-L1642 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.resolveBinaryNameOrIdent | public Symbol resolveBinaryNameOrIdent(String name) {
"""
Resolve an identifier which may be the binary name of a class or
the Java name of a class or package.
@param name The name to resolve
"""
ModuleSymbol msym;
String typeName;
int sep = name.indexOf('/');
if (sep == ... | java | public Symbol resolveBinaryNameOrIdent(String name) {
ModuleSymbol msym;
String typeName;
int sep = name.indexOf('/');
if (sep == -1) {
msym = modules.getDefaultModule();
typeName = name;
} else if (source.allowModules()) {
Name modName = names... | [
"public",
"Symbol",
"resolveBinaryNameOrIdent",
"(",
"String",
"name",
")",
"{",
"ModuleSymbol",
"msym",
";",
"String",
"typeName",
";",
"int",
"sep",
"=",
"name",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"sep",
"==",
"-",
"1",
")",
"{",
"... | Resolve an identifier which may be the binary name of a class or
the Java name of a class or package.
@param name The name to resolve | [
"Resolve",
"an",
"identifier",
"which",
"may",
"be",
"the",
"binary",
"name",
"of",
"a",
"class",
"or",
"the",
"Java",
"name",
"of",
"a",
"class",
"or",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L675-L693 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/date/DateCaster.java | DateCaster.toDateAdvanced | public static DateTime toDateAdvanced(String str, short convertingType, TimeZone timeZone, DateTime defaultValue) {
"""
converts a String to a DateTime Object (Advanced but slower), returns null if invalid string
@param str String to convert
@param convertingType one of the following values: - CONVERTING_TYPE_... | java | public static DateTime toDateAdvanced(String str, short convertingType, TimeZone timeZone, DateTime defaultValue) {
str = str.trim();
if (StringUtil.isEmpty(str)) return defaultValue;
if (!hasDigits(str)) return defaultValue; // every format has digits
timeZone = ThreadLocalPageContext.getTimeZone(timeZone);
DateT... | [
"public",
"static",
"DateTime",
"toDateAdvanced",
"(",
"String",
"str",
",",
"short",
"convertingType",
",",
"TimeZone",
"timeZone",
",",
"DateTime",
"defaultValue",
")",
"{",
"str",
"=",
"str",
".",
"trim",
"(",
")",
";",
"if",
"(",
"StringUtil",
".",
"is... | converts a String to a DateTime Object (Advanced but slower), returns null if invalid string
@param str String to convert
@param convertingType one of the following values: - CONVERTING_TYPE_NONE: number are not
converted at all - CONVERTING_TYPE_YEAR: integers are handled as years -
CONVERTING_TYPE_OFFSET: numbers ar... | [
"converts",
"a",
"String",
"to",
"a",
"DateTime",
"Object",
"(",
"Advanced",
"but",
"slower",
")",
"returns",
"null",
"if",
"invalid",
"string"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/date/DateCaster.java#L144-L168 |
RestComm/media-core | stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java | StunMessage.setTransactionID | public void setTransactionID(byte[] tranID) throws StunException {
"""
Copies the specified tranID and sets it as this message's transactionID.
@param tranID
the transaction id to set in this message.
@throws StunException
ILLEGAL_ARGUMENT if the transaction id is not valid.
"""
if (tranID == null ||... | java | public void setTransactionID(byte[] tranID) throws StunException {
if (tranID == null || (tranID.length != TRANSACTION_ID_LENGTH && tranID.length != RFC3489_TRANSACTION_ID_LENGTH))
throw new StunException(StunException.ILLEGAL_ARGUMENT, "Invalid transaction id length");
int tranIDLength = tranID.length;
this.... | [
"public",
"void",
"setTransactionID",
"(",
"byte",
"[",
"]",
"tranID",
")",
"throws",
"StunException",
"{",
"if",
"(",
"tranID",
"==",
"null",
"||",
"(",
"tranID",
".",
"length",
"!=",
"TRANSACTION_ID_LENGTH",
"&&",
"tranID",
".",
"length",
"!=",
"RFC3489_TR... | Copies the specified tranID and sets it as this message's transactionID.
@param tranID
the transaction id to set in this message.
@throws StunException
ILLEGAL_ARGUMENT if the transaction id is not valid. | [
"Copies",
"the",
"specified",
"tranID",
"and",
"sets",
"it",
"as",
"this",
"message",
"s",
"transactionID",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunMessage.java#L439-L446 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java | PredictionsImpl.resolveAsync | public Observable<LuisResult> resolveAsync(String appId, String query, ResolveOptionalParameter resolveOptionalParameter) {
"""
Gets predictions for a given utterance, in the form of intents and entities. The current maximum query size is 500 characters.
@param appId The LUIS application ID (Guid).
@param quer... | java | public Observable<LuisResult> resolveAsync(String appId, String query, ResolveOptionalParameter resolveOptionalParameter) {
return resolveWithServiceResponseAsync(appId, query, resolveOptionalParameter).map(new Func1<ServiceResponse<LuisResult>, LuisResult>() {
@Override
public LuisResul... | [
"public",
"Observable",
"<",
"LuisResult",
">",
"resolveAsync",
"(",
"String",
"appId",
",",
"String",
"query",
",",
"ResolveOptionalParameter",
"resolveOptionalParameter",
")",
"{",
"return",
"resolveWithServiceResponseAsync",
"(",
"appId",
",",
"query",
",",
"resolv... | Gets predictions for a given utterance, in the form of intents and entities. The current maximum query size is 500 characters.
@param appId The LUIS application ID (Guid).
@param query The utterance to predict.
@param resolveOptionalParameter the object representing the optional parameters to be set before calling thi... | [
"Gets",
"predictions",
"for",
"a",
"given",
"utterance",
"in",
"the",
"form",
"of",
"intents",
"and",
"entities",
".",
"The",
"current",
"maximum",
"query",
"size",
"is",
"500",
"characters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java#L104-L111 |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GraphvizMojo.java | GraphvizMojo.executeDot | protected boolean executeDot(Set<String> dotFiles)
throws MojoExecutionException {
"""
Executes the command line tool <code>dot</code>.
@param dotFiles
list of dot files from the
{@link AbstractGeneratorMojo#statusFile}
"""
// Build executor for projects base directory
MavenLogOutputStream stdout ... | java | protected boolean executeDot(Set<String> dotFiles)
throws MojoExecutionException {
// Build executor for projects base directory
MavenLogOutputStream stdout = getStdoutStream();
MavenLogOutputStream stderr = getStderrStream();
Executor exec = getExecutor();
exec.setWorkingDirectory(project.getBasedir());
... | [
"protected",
"boolean",
"executeDot",
"(",
"Set",
"<",
"String",
">",
"dotFiles",
")",
"throws",
"MojoExecutionException",
"{",
"// Build executor for projects base directory",
"MavenLogOutputStream",
"stdout",
"=",
"getStdoutStream",
"(",
")",
";",
"MavenLogOutputStream",
... | Executes the command line tool <code>dot</code>.
@param dotFiles
list of dot files from the
{@link AbstractGeneratorMojo#statusFile} | [
"Executes",
"the",
"command",
"line",
"tool",
"<code",
">",
"dot<",
"/",
"code",
">",
"."
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GraphvizMojo.java#L161-L183 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExampleSection.java | ExampleSection.selectExample | public void selectExample(final WComponent example, final String exampleName) {
"""
Selects an example.
@param example the example to select.
@param exampleName the name of the example being selected.
"""
WComponent currentExample = container.getChildAt(0).getParent();
if (currentExample != null && cu... | java | public void selectExample(final WComponent example, final String exampleName) {
WComponent currentExample = container.getChildAt(0).getParent();
if (currentExample != null && currentExample.getClass().equals(example.getClass())) {
// Same example selected, do nothing
return;
}
resetExample();
containe... | [
"public",
"void",
"selectExample",
"(",
"final",
"WComponent",
"example",
",",
"final",
"String",
"exampleName",
")",
"{",
"WComponent",
"currentExample",
"=",
"container",
".",
"getChildAt",
"(",
"0",
")",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"curren... | Selects an example.
@param example the example to select.
@param exampleName the name of the example being selected. | [
"Selects",
"an",
"example",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExampleSection.java#L149-L183 |
sockeqwe/AdapterDelegates | library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java | AdapterDelegatesManager.addDelegate | public AdapterDelegatesManager<T> addDelegate(int viewType,
@NonNull AdapterDelegate<T> delegate) {
"""
Adds an {@link AdapterDelegate} with the specified view type.
<p>
Internally calls {@link #addDelegate(int, boolean, AdapterDelegate)} with
allowReplacingDele... | java | public AdapterDelegatesManager<T> addDelegate(int viewType,
@NonNull AdapterDelegate<T> delegate) {
return addDelegate(viewType, false, delegate);
} | [
"public",
"AdapterDelegatesManager",
"<",
"T",
">",
"addDelegate",
"(",
"int",
"viewType",
",",
"@",
"NonNull",
"AdapterDelegate",
"<",
"T",
">",
"delegate",
")",
"{",
"return",
"addDelegate",
"(",
"viewType",
",",
"false",
",",
"delegate",
")",
";",
"}"
] | Adds an {@link AdapterDelegate} with the specified view type.
<p>
Internally calls {@link #addDelegate(int, boolean, AdapterDelegate)} with
allowReplacingDelegate = false as parameter.
@param viewType the view type integer if you want to assign manually the view type. Otherwise
use {@link #addDelegate(AdapterDelegate)... | [
"Adds",
"an",
"{",
"@link",
"AdapterDelegate",
"}",
"with",
"the",
"specified",
"view",
"type",
".",
"<p",
">",
"Internally",
"calls",
"{",
"@link",
"#addDelegate",
"(",
"int",
"boolean",
"AdapterDelegate",
")",
"}",
"with",
"allowReplacingDelegate",
"=",
"fal... | train | https://github.com/sockeqwe/AdapterDelegates/blob/d18dc609415e5d17a3354bddf4bae62440e017af/library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java#L119-L122 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_publicFolder_path_PUT | public void organizationName_service_exchangeService_publicFolder_path_PUT(String organizationName, String exchangeService, String path, OvhPublicFolder body) throws IOException {
"""
Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}
@param ... | java | public void organizationName_service_exchangeService_publicFolder_path_PUT(String organizationName, String exchangeService, String path, OvhPublicFolder body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}";
StringBuilder sb = path(qPath, organi... | [
"public",
"void",
"organizationName_service_exchangeService_publicFolder_path_PUT",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"path",
",",
"OvhPublicFolder",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/e... | Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}
@param body [required] New object properties
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange se... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L182-L186 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java | AbstractService.bindProgressBar | private void bindProgressBar(final ServiceTaskBase<?> task, final ProgressBar progressBar) {
"""
Bind a task to a progress bar widget to follow its progression.
@param task the service task that we need to follow the progression
@param progressBar graphical progress bar
"""
// Perform this binding... | java | private void bindProgressBar(final ServiceTaskBase<?> task, final ProgressBar progressBar) {
// Perform this binding into the JAT to respect widget and task API
JRebirth.runIntoJAT("Bind ProgressBar to " + task.getServiceHandlerName(),
() -> {
... | [
"private",
"void",
"bindProgressBar",
"(",
"final",
"ServiceTaskBase",
"<",
"?",
">",
"task",
",",
"final",
"ProgressBar",
"progressBar",
")",
"{",
"// Perform this binding into the JAT to respect widget and task API",
"JRebirth",
".",
"runIntoJAT",
"(",
"\"Bind ProgressBar... | Bind a task to a progress bar widget to follow its progression.
@param task the service task that we need to follow the progression
@param progressBar graphical progress bar | [
"Bind",
"a",
"task",
"to",
"a",
"progress",
"bar",
"widget",
"to",
"follow",
"its",
"progression",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java#L205-L216 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCertificateRequest | public byte[] createCertificateRequest(String subject, KeyPair keyPair) throws GeneralSecurityException {
"""
Creates a certificate request from the specified subject DN and a key pair. The
<I>"MD5WithRSAEncryption"</I> is used as the signing algorithm of the certificate request.
@param subject
the subject of... | java | public byte[] createCertificateRequest(String subject, KeyPair keyPair) throws GeneralSecurityException {
X509Name name = new X509Name(subject);
return createCertificateRequest(name, "MD5WithRSAEncryption", keyPair);
} | [
"public",
"byte",
"[",
"]",
"createCertificateRequest",
"(",
"String",
"subject",
",",
"KeyPair",
"keyPair",
")",
"throws",
"GeneralSecurityException",
"{",
"X509Name",
"name",
"=",
"new",
"X509Name",
"(",
"subject",
")",
";",
"return",
"createCertificateRequest",
... | Creates a certificate request from the specified subject DN and a key pair. The
<I>"MD5WithRSAEncryption"</I> is used as the signing algorithm of the certificate request.
@param subject
the subject of the certificate request
@param keyPair
the key pair of the certificate request
@return the certificate request.
@excep... | [
"Creates",
"a",
"certificate",
"request",
"from",
"the",
"specified",
"subject",
"DN",
"and",
"a",
"key",
"pair",
".",
"The",
"<I",
">",
"MD5WithRSAEncryption",
"<",
"/",
"I",
">",
"is",
"used",
"as",
"the",
"signing",
"algorithm",
"of",
"the",
"certificat... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L943-L946 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/Address.java | Address.getByAddress | public static InetAddress
getByAddress(String addr, int family) throws UnknownHostException {
"""
Converts an address from its string representation to an IP address in
a particular family.
@param addr The address, in string form
@param family The address family, either IPv4 or IPv6.
@return The IP add... | java | public static InetAddress
getByAddress(String addr, int family) throws UnknownHostException {
if (family != IPv4 && family != IPv6)
throw new IllegalArgumentException("unknown address family");
byte[] bytes;
bytes = toByteArray(addr, family);
if (bytes != null)
... | [
"public",
"static",
"InetAddress",
"getByAddress",
"(",
"String",
"addr",
",",
"int",
"family",
")",
"throws",
"UnknownHostException",
"{",
"if",
"(",
"family",
"!=",
"IPv4",
"&&",
"family",
"!=",
"IPv6",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Converts an address from its string representation to an IP address in
a particular family.
@param addr The address, in string form
@param family The address family, either IPv4 or IPv6.
@return The IP addresses
@throws UnknownHostException The address is not a valid IP address in
the specified address family. | [
"Converts",
"an",
"address",
"from",
"its",
"string",
"representation",
"to",
"an",
"IP",
"address",
"in",
"a",
"particular",
"family",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L329-L338 |
SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setDateFormat | public void setDateFormat(java.text.DateFormat dateFormat, java.text.DateFormat numbersDateFormat) {
"""
Sets the custom date format to use for formatting Calendar objects to displayable strings.
@param dateFormat The new DateFormat, or null to use the default format.
@param numbersDateFormat The DateFormat for ... | java | public void setDateFormat(java.text.DateFormat dateFormat, java.text.DateFormat numbersDateFormat) {
this.customDateFormat = dateFormat;
this.secondaryDateFormat = numbersDateFormat;
// update the spinner with the new date format:
// the only spinner item that will be affected is the mo... | [
"public",
"void",
"setDateFormat",
"(",
"java",
".",
"text",
".",
"DateFormat",
"dateFormat",
",",
"java",
".",
"text",
".",
"DateFormat",
"numbersDateFormat",
")",
"{",
"this",
".",
"customDateFormat",
"=",
"dateFormat",
";",
"this",
".",
"secondaryDateFormat",... | Sets the custom date format to use for formatting Calendar objects to displayable strings.
@param dateFormat The new DateFormat, or null to use the default format.
@param numbersDateFormat The DateFormat for formatting the secondary date when both FLAG_NUMBERS
and FLAG_WEEKDAY_NAMES are set, or null to use the default ... | [
"Sets",
"the",
"custom",
"date",
"format",
"to",
"use",
"for",
"formatting",
"Calendar",
"objects",
"to",
"displayable",
"strings",
"."
] | train | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L333-L351 |
BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GIS.java | GIS.trainModel | public static GISModel trainModel(int iterations, DataIndexer indexer, boolean printMessagesWhileTraining, boolean smoothing) {
"""
Train a model using the GIS algorithm.
@param iterations The number of GIS iterations to perform.
@param indexer The object which will be used for event compilation.
@param printMe... | java | public static GISModel trainModel(int iterations, DataIndexer indexer, boolean printMessagesWhileTraining, boolean smoothing) {
GISTrainer trainer = new GISTrainer(printMessagesWhileTraining);
trainer.setSmoothing(smoothing);
trainer.setSmoothingObservation(SMOOTHING_OBSERVATION);
return trainer... | [
"public",
"static",
"GISModel",
"trainModel",
"(",
"int",
"iterations",
",",
"DataIndexer",
"indexer",
",",
"boolean",
"printMessagesWhileTraining",
",",
"boolean",
"smoothing",
")",
"{",
"GISTrainer",
"trainer",
"=",
"new",
"GISTrainer",
"(",
"printMessagesWhileTrain... | Train a model using the GIS algorithm.
@param iterations The number of GIS iterations to perform.
@param indexer The object which will be used for event compilation.
@param printMessagesWhileTraining Determines whether training status messages are written to STDOUT.
@param smoothing Defines whether the created trainer ... | [
"Train",
"a",
"model",
"using",
"the",
"GIS",
"algorithm",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GIS.java#L130-L135 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/util/Hex.java | Hex.getProtectedConstructor | public static Constructor getProtectedConstructor(Class klass, Class... paramTypes) {
"""
Used to get access to protected/private constructor of the specified class
@param klass - name of the class
@param paramTypes - types of the constructor parameters
@return Constructor if successful, null if the cons... | java | public static Constructor getProtectedConstructor(Class klass, Class... paramTypes) {
Constructor c;
try {
c = klass.getDeclaredConstructor(paramTypes);
c.setAccessible(true);
return c;
} catch (Exception e) {
return null;
}
} | [
"public",
"static",
"Constructor",
"getProtectedConstructor",
"(",
"Class",
"klass",
",",
"Class",
"...",
"paramTypes",
")",
"{",
"Constructor",
"c",
";",
"try",
"{",
"c",
"=",
"klass",
".",
"getDeclaredConstructor",
"(",
"paramTypes",
")",
";",
"c",
".",
"s... | Used to get access to protected/private constructor of the specified class
@param klass - name of the class
@param paramTypes - types of the constructor parameters
@return Constructor if successful, null if the constructor cannot be
accessed | [
"Used",
"to",
"get",
"access",
"to",
"protected",
"/",
"private",
"constructor",
"of",
"the",
"specified",
"class"
] | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/util/Hex.java#L86-L95 |
jMotif/GI | src/main/java/net/seninp/gi/logic/GIUtils.java | GIUtils.getZeroIntervals | public static List<RuleInterval> getZeroIntervals(int[] coverageArray) {
"""
Run a quick scan along the time series coverage to find a zeroed intervals.
@param coverageArray the coverage to analyze.
@return set of zeroed intervals (if found).
"""
ArrayList<RuleInterval> res = new ArrayList<RuleInterva... | java | public static List<RuleInterval> getZeroIntervals(int[] coverageArray) {
ArrayList<RuleInterval> res = new ArrayList<RuleInterval>();
int start = -1;
boolean inInterval = false;
int intervalsCounter = -1;
// slide over the array from left to the right
//
for (int i = 0; i < coverageArray.... | [
"public",
"static",
"List",
"<",
"RuleInterval",
">",
"getZeroIntervals",
"(",
"int",
"[",
"]",
"coverageArray",
")",
"{",
"ArrayList",
"<",
"RuleInterval",
">",
"res",
"=",
"new",
"ArrayList",
"<",
"RuleInterval",
">",
"(",
")",
";",
"int",
"start",
"=",
... | Run a quick scan along the time series coverage to find a zeroed intervals.
@param coverageArray the coverage to analyze.
@return set of zeroed intervals (if found). | [
"Run",
"a",
"quick",
"scan",
"along",
"the",
"time",
"series",
"coverage",
"to",
"find",
"a",
"zeroed",
"intervals",
"."
] | train | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/logic/GIUtils.java#L42-L74 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassInfo.java | ClassInfo.addImplementedInterface | void addImplementedInterface(final String interfaceName, final Map<String, ClassInfo> classNameToClassInfo) {
"""
Add an implemented interface to this class.
@param interfaceName
the interface name
@param classNameToClassInfo
the map from class name to class info
"""
final ClassInfo interfaceClas... | java | void addImplementedInterface(final String interfaceName, final Map<String, ClassInfo> classNameToClassInfo) {
final ClassInfo interfaceClassInfo = getOrCreateClassInfo(interfaceName,
/* classModifiers = */ Modifier.INTERFACE, classNameToClassInfo);
interfaceClassInfo.isInterface = true;
... | [
"void",
"addImplementedInterface",
"(",
"final",
"String",
"interfaceName",
",",
"final",
"Map",
"<",
"String",
",",
"ClassInfo",
">",
"classNameToClassInfo",
")",
"{",
"final",
"ClassInfo",
"interfaceClassInfo",
"=",
"getOrCreateClassInfo",
"(",
"interfaceName",
",",... | Add an implemented interface to this class.
@param interfaceName
the interface name
@param classNameToClassInfo
the map from class name to class info | [
"Add",
"an",
"implemented",
"interface",
"to",
"this",
"class",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfo.java#L383-L390 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/Endpoint.java | Endpoint.withIpAddr | public Endpoint withIpAddr(@Nullable String ipAddr) {
"""
Returns a new host endpoint with the specified IP address.
@return the new endpoint with the specified IP address.
{@code this} if this endpoint has the same IP address.
@throws IllegalStateException if this endpoint is not a host but a group
"""... | java | public Endpoint withIpAddr(@Nullable String ipAddr) {
ensureSingle();
if (ipAddr == null) {
return withoutIpAddr();
}
if (NetUtil.isValidIpV4Address(ipAddr)) {
return withIpAddr(ipAddr, StandardProtocolFamily.INET);
}
if (NetUtil.isValidIpV6Addre... | [
"public",
"Endpoint",
"withIpAddr",
"(",
"@",
"Nullable",
"String",
"ipAddr",
")",
"{",
"ensureSingle",
"(",
")",
";",
"if",
"(",
"ipAddr",
"==",
"null",
")",
"{",
"return",
"withoutIpAddr",
"(",
")",
";",
"}",
"if",
"(",
"NetUtil",
".",
"isValidIpV4Addr... | Returns a new host endpoint with the specified IP address.
@return the new endpoint with the specified IP address.
{@code this} if this endpoint has the same IP address.
@throws IllegalStateException if this endpoint is not a host but a group | [
"Returns",
"a",
"new",
"host",
"endpoint",
"with",
"the",
"specified",
"IP",
"address",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/Endpoint.java#L336-L354 |
mapsforge/mapsforge | mapsforge-poi/src/main/java/org/mapsforge/poi/storage/PoiCategoryRangeQueryGenerator.java | PoiCategoryRangeQueryGenerator.getSQLSelectString | public static String getSQLSelectString(PoiCategoryFilter filter, int count, int version) {
"""
Gets the SQL query that looks up POI entries.
@param filter The filter object for determining all wanted categories.
@param count Count of patterns to search in points of interest names (may be 0).
@param versio... | java | public static String getSQLSelectString(PoiCategoryFilter filter, int count, int version) {
StringBuilder sb = new StringBuilder();
sb.append(DbConstants.FIND_IN_BOX_CLAUSE_SELECT);
if (version < 2) {
sb.append(DbConstants.JOIN_DATA_CLAUSE);
} else {
sb.append(DbC... | [
"public",
"static",
"String",
"getSQLSelectString",
"(",
"PoiCategoryFilter",
"filter",
",",
"int",
"count",
",",
"int",
"version",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"DbConstants",
".",
"FI... | Gets the SQL query that looks up POI entries.
@param filter The filter object for determining all wanted categories.
@param count Count of patterns to search in points of interest names (may be 0).
@param version POI specification version.
@return The SQL query. | [
"Gets",
"the",
"SQL",
"query",
"that",
"looks",
"up",
"POI",
"entries",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-poi/src/main/java/org/mapsforge/poi/storage/PoiCategoryRangeQueryGenerator.java#L40-L57 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectWorkplaceSearchResult | public String buildSelectWorkplaceSearchResult(String htmlAttributes) {
"""
Builds the html for the workplace search result list type select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace search result list type select box
"""
... | java | public String buildSelectWorkplaceSearchResult(String htmlAttributes) {
List<String> options = new ArrayList<String>(3);
List<String> values = new ArrayList<String>(3);
int checkedIndex = 0;
// add all styles to the select box
options.add(key(CmsSearchResultStyle.STYLE_EXPLORER... | [
"public",
"String",
"buildSelectWorkplaceSearchResult",
"(",
"String",
"htmlAttributes",
")",
"{",
"List",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"3",
")",
";",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"Ar... | Builds the html for the workplace search result list type select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace search result list type select box | [
"Builds",
"the",
"html",
"for",
"the",
"workplace",
"search",
"result",
"list",
"type",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L1013-L1040 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/RestAction.java | RestAction.submitAfter | public ScheduledFuture<T> submitAfter(long delay, TimeUnit unit) {
"""
Schedules a call to {@link #complete()} to be executed after the specified {@code delay}.
<br>This is an <b>asynchronous</b> operation that will return a
{@link java.util.concurrent.ScheduledFuture ScheduledFuture} representing the task.
<... | java | public ScheduledFuture<T> submitAfter(long delay, TimeUnit unit)
{
return submitAfter(delay, unit, api.get().getRateLimitPool());
} | [
"public",
"ScheduledFuture",
"<",
"T",
">",
"submitAfter",
"(",
"long",
"delay",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"submitAfter",
"(",
"delay",
",",
"unit",
",",
"api",
".",
"get",
"(",
")",
".",
"getRateLimitPool",
"(",
")",
")",
";",
"}"
] | Schedules a call to {@link #complete()} to be executed after the specified {@code delay}.
<br>This is an <b>asynchronous</b> operation that will return a
{@link java.util.concurrent.ScheduledFuture ScheduledFuture} representing the task.
<p>The returned Future will provide the return type of a {@link #complete()} oper... | [
"Schedules",
"a",
"call",
"to",
"{",
"@link",
"#complete",
"()",
"}",
"to",
"be",
"executed",
"after",
"the",
"specified",
"{",
"@code",
"delay",
"}",
".",
"<br",
">",
"This",
"is",
"an",
"<b",
">",
"asynchronous<",
"/",
"b",
">",
"operation",
"that",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/RestAction.java#L474-L477 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.splitAsList | public static List<String> splitAsList(String source, char delimiter) {
"""
Splits a String into substrings along the provided char delimiter and returns
the result as a List of Substrings.<p>
@param source the String to split
@param delimiter the delimiter to split at
@return the List of splitted Substrin... | java | public static List<String> splitAsList(String source, char delimiter) {
return splitAsList(source, delimiter, false);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"splitAsList",
"(",
"String",
"source",
",",
"char",
"delimiter",
")",
"{",
"return",
"splitAsList",
"(",
"source",
",",
"delimiter",
",",
"false",
")",
";",
"}"
] | Splits a String into substrings along the provided char delimiter and returns
the result as a List of Substrings.<p>
@param source the String to split
@param delimiter the delimiter to split at
@return the List of splitted Substrings | [
"Splits",
"a",
"String",
"into",
"substrings",
"along",
"the",
"provided",
"char",
"delimiter",
"and",
"returns",
"the",
"result",
"as",
"a",
"List",
"of",
"Substrings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L1492-L1495 |
apache/incubator-atlas | addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java | HiveMetaStoreBridge.importTables | private int importTables(Referenceable databaseReferenceable, String databaseName, final boolean failOnError) throws Exception {
"""
Imports all tables for the given db
@param databaseReferenceable
@param databaseName
@param failOnError
@throws Exception
"""
int tablesImported = 0;
List<Str... | java | private int importTables(Referenceable databaseReferenceable, String databaseName, final boolean failOnError) throws Exception {
int tablesImported = 0;
List<String> hiveTables = hiveClient.getAllTables(databaseName);
LOG.info("Importing tables {} for db {}", hiveTables.toString(), databaseName)... | [
"private",
"int",
"importTables",
"(",
"Referenceable",
"databaseReferenceable",
",",
"String",
"databaseName",
",",
"final",
"boolean",
"failOnError",
")",
"throws",
"Exception",
"{",
"int",
"tablesImported",
"=",
"0",
";",
"List",
"<",
"String",
">",
"hiveTables... | Imports all tables for the given db
@param databaseReferenceable
@param databaseName
@param failOnError
@throws Exception | [
"Imports",
"all",
"tables",
"for",
"the",
"given",
"db"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java#L267-L283 |
dita-ot/dita-ot | src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java | EclipseIndexWriter.outputIndexTermStartElement | private void outputIndexTermStartElement(final IndexTerm term, final XMLStreamWriter serializer, final boolean indexsee) throws XMLStreamException {
"""
/*
Logic for adding various start index entry elements for Eclipse help.
@param term The indexterm to be processed.
@param printWriter The Writer used for w... | java | private void outputIndexTermStartElement(final IndexTerm term, final XMLStreamWriter serializer, final boolean indexsee) throws XMLStreamException {
//RFE 2987769 Eclipse index-see
if (indexsee){
if (term.getTermPrefix() != null) {
inIndexsee = true;
serialize... | [
"private",
"void",
"outputIndexTermStartElement",
"(",
"final",
"IndexTerm",
"term",
",",
"final",
"XMLStreamWriter",
"serializer",
",",
"final",
"boolean",
"indexsee",
")",
"throws",
"XMLStreamException",
"{",
"//RFE 2987769 Eclipse index-see",
"if",
"(",
"indexsee",
"... | /*
Logic for adding various start index entry elements for Eclipse help.
@param term The indexterm to be processed.
@param printWriter The Writer used for writing content to disk.
@param indexsee Boolean value for using the new markup for see references. | [
"/",
"*",
"Logic",
"for",
"adding",
"various",
"start",
"index",
"entry",
"elements",
"for",
"Eclipse",
"help",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java#L316-L337 |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.caseStatement | private final boolean caseStatement(Data data, Switch swit) throws TemplateException {
"""
Liest ein Case Statement ein
@return case Statement
@throws TemplateException
"""
if (!data.srcCode.forwardIfCurrentAndNoWordAfter("case")) return false;
// int line=data.srcCode.getLine();
comments(data);
Expre... | java | private final boolean caseStatement(Data data, Switch swit) throws TemplateException {
if (!data.srcCode.forwardIfCurrentAndNoWordAfter("case")) return false;
// int line=data.srcCode.getLine();
comments(data);
Expression expr = super.expression(data);
comments(data);
if (!data.srcCode.forwardIfCurrent(':')) th... | [
"private",
"final",
"boolean",
"caseStatement",
"(",
"Data",
"data",
",",
"Switch",
"swit",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"data",
".",
"srcCode",
".",
"forwardIfCurrentAndNoWordAfter",
"(",
"\"case\"",
")",
")",
"return",
"false",
";... | Liest ein Case Statement ein
@return case Statement
@throws TemplateException | [
"Liest",
"ein",
"Case",
"Statement",
"ein"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L495-L509 |
bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/impl/DefaultFsService.java | DefaultFsService.findRecursively | private Collection<FsItemEx> findRecursively(FsItemFilter filter,
FsItem root) {
"""
find files recursively in specific folder
@param filter
The filter to apply to select files.
@param root
The location in the hierarchy to search from.
@return A collection of files that match the filter and have the root... | java | private Collection<FsItemEx> findRecursively(FsItemFilter filter,
FsItem root)
{
List<FsItemEx> results = new ArrayList<FsItemEx>();
FsVolume vol = root.getVolume();
for (FsItem child : vol.listChildren(root))
{
if (vol.isFolder(child))
{
results.addAll(findRecursively(filter, child));
}
els... | [
"private",
"Collection",
"<",
"FsItemEx",
">",
"findRecursively",
"(",
"FsItemFilter",
"filter",
",",
"FsItem",
"root",
")",
"{",
"List",
"<",
"FsItemEx",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"FsItemEx",
">",
"(",
")",
";",
"FsVolume",
"vol",
"=",... | find files recursively in specific folder
@param filter
The filter to apply to select files.
@param root
The location in the hierarchy to search from.
@return A collection of files that match the filter and have the root as
a parent. | [
"find",
"files",
"recursively",
"in",
"specific",
"folder"
] | train | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/impl/DefaultFsService.java#L66-L86 |
super-csv/super-csv | super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/ParseDateTimeZone.java | ParseDateTimeZone.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or is not a String
"""
validateInputNotNull(value, context);
if (!(value instanceof String)) {
throw new SuperCsvCellProcessorException(String.class, value,... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if (!(value instanceof String)) {
throw new SuperCsvCellProcessorException(String.class, value,
context, this);
}
final DateTimeZone result;
try {
result = DateTimeZone.forID((String) value);... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"String",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or is not a String | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/ParseDateTimeZone.java#L59-L74 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/AtomicGrowingSparseHashMatrix.java | AtomicGrowingSparseHashMatrix.checkIndices | private void checkIndices(int row, int col, boolean expand) {
"""
Verify that the given row and column value is non-negative, and
optionally expand the size of the matrix if the row or column are outside
the current bounds.
@param row the row index to check.
@param the the column index to check.
@param expa... | java | private void checkIndices(int row, int col, boolean expand) {
if (row < 0 || col < 0) {
throw new ArrayIndexOutOfBoundsException();
}
if (expand) {
int r = row + 1;
int cur = 0;
while (r > (cur = rows.get()) && !rows.compareAndSet(cur, r))
... | [
"private",
"void",
"checkIndices",
"(",
"int",
"row",
",",
"int",
"col",
",",
"boolean",
"expand",
")",
"{",
"if",
"(",
"row",
"<",
"0",
"||",
"col",
"<",
"0",
")",
"{",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
")",
";",
"}",
"if",
"(",... | Verify that the given row and column value is non-negative, and
optionally expand the size of the matrix if the row or column are outside
the current bounds.
@param row the row index to check.
@param the the column index to check.
@param expand {@code true} if the current dimensions of the matrix should
be updated if ... | [
"Verify",
"that",
"the",
"given",
"row",
"and",
"column",
"value",
"is",
"non",
"-",
"negative",
"and",
"optionally",
"expand",
"the",
"size",
"of",
"the",
"matrix",
"if",
"the",
"row",
"or",
"column",
"are",
"outside",
"the",
"current",
"bounds",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/AtomicGrowingSparseHashMatrix.java#L191-L205 |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/ForecastIO.java | ForecastIO.setHTTPProxy | public void setHTTPProxy(String PROXYNAME, int PROXYPORT) {
"""
Sets the http-proxy to use.
@param PROXYNAME hostname or ip of the proxy to use (e.g. "127.0.0.1"). If proxyname equals null, no proxy will be used.
@param PROXYPORT port of the proxy to use (e.g. 8080)
"""
if (PROXYNAME == null) {
this.pro... | java | public void setHTTPProxy(String PROXYNAME, int PROXYPORT) {
if (PROXYNAME == null) {
this.proxy_to_use = null;
}
else {
this.proxy_to_use = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXYNAME, PROXYPORT));
}
} | [
"public",
"void",
"setHTTPProxy",
"(",
"String",
"PROXYNAME",
",",
"int",
"PROXYPORT",
")",
"{",
"if",
"(",
"PROXYNAME",
"==",
"null",
")",
"{",
"this",
".",
"proxy_to_use",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"proxy_to_use",
"=",
"new",
"... | Sets the http-proxy to use.
@param PROXYNAME hostname or ip of the proxy to use (e.g. "127.0.0.1"). If proxyname equals null, no proxy will be used.
@param PROXYPORT port of the proxy to use (e.g. 8080) | [
"Sets",
"the",
"http",
"-",
"proxy",
"to",
"use",
"."
] | train | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/ForecastIO.java#L285-L292 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.postDoNotUseArtifact | public void postDoNotUseArtifact(final String gavc, final Boolean doNotUse, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Post boolean flag "DO_NOT_USE" to an artifact
@param gavc
@param doNotUse
@param user
@param password
@throws GrapesCommuni... | java | public void postDoNotUseArtifact(final String gavc, final Boolean doNotUse, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.... | [
"public",
"void",
"postDoNotUseArtifact",
"(",
"final",
"String",
"gavc",
",",
"final",
"Boolean",
"doNotUse",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"fi... | Post boolean flag "DO_NOT_USE" to an artifact
@param gavc
@param doNotUse
@param user
@param password
@throws GrapesCommunicationException | [
"Post",
"boolean",
"flag",
"DO_NOT_USE",
"to",
"an",
"artifact"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L513-L527 |
hector-client/hector | core/src/main/java/me/prettyprint/cassandra/io/ChunkOutputStream.java | ChunkOutputStream.writeData | private void writeData(boolean close) throws IOException {
"""
Write the data to column if the configured chunk size is reached or if the
stream should be closed
@param close
@throws IOException
"""
if (pos != 0 && (close || pos == chunk.length - 1)) {
byte[] data;
if (pos != chunk.length ... | java | private void writeData(boolean close) throws IOException {
if (pos != 0 && (close || pos == chunk.length - 1)) {
byte[] data;
if (pos != chunk.length - 1) {
data = new byte[(int) pos + 1];
// we need to adjust the array
System.arraycopy(chunk, 0, data, 0, data.length);
} el... | [
"private",
"void",
"writeData",
"(",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pos",
"!=",
"0",
"&&",
"(",
"close",
"||",
"pos",
"==",
"chunk",
".",
"length",
"-",
"1",
")",
")",
"{",
"byte",
"[",
"]",
"data",
";",
"if",
... | Write the data to column if the configured chunk size is reached or if the
stream should be closed
@param close
@throws IOException | [
"Write",
"the",
"data",
"to",
"column",
"if",
"the",
"configured",
"chunk",
"size",
"is",
"reached",
"or",
"if",
"the",
"stream",
"should",
"be",
"closed"
] | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/io/ChunkOutputStream.java#L72-L91 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/ExceptionMethod.java | ExceptionMethod.throwing | public static Implementation throwing(TypeDescription throwableType, String message) {
"""
Creates an implementation that creates a new instance of the given {@link Throwable} type on each method
invocation which is then thrown immediately. For this to be possible, the given type must define a
constructor that t... | java | public static Implementation throwing(TypeDescription throwableType, String message) {
if (!throwableType.isAssignableTo(Throwable.class)) {
throw new IllegalArgumentException(throwableType + " does not extend throwable");
}
return new ExceptionMethod(new ConstructionDelegate.ForStri... | [
"public",
"static",
"Implementation",
"throwing",
"(",
"TypeDescription",
"throwableType",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"throwableType",
".",
"isAssignableTo",
"(",
"Throwable",
".",
"class",
")",
")",
"{",
"throw",
"new",
"IllegalArgument... | Creates an implementation that creates a new instance of the given {@link Throwable} type on each method
invocation which is then thrown immediately. For this to be possible, the given type must define a
constructor that takes a single {@link java.lang.String} as its argument.
@param throwableType The type of the {@li... | [
"Creates",
"an",
"implementation",
"that",
"creates",
"a",
"new",
"instance",
"of",
"the",
"given",
"{",
"@link",
"Throwable",
"}",
"type",
"on",
"each",
"method",
"invocation",
"which",
"is",
"then",
"thrown",
"immediately",
".",
"For",
"this",
"to",
"be",
... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/ExceptionMethod.java#L105-L110 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java | PackageIndexWriter.addPackagesList | protected void addPackagesList(Collection<PackageDoc> packages, Content tbody) {
"""
Adds list of packages in the index table. Generate link to each package.
@param packages Packages to which link is to be generated
@param tbody the documentation tree to which the list will be added
"""
boolean alt... | java | protected void addPackagesList(Collection<PackageDoc> packages, Content tbody) {
boolean altColor = true;
for (PackageDoc pkg : packages) {
if (pkg != null && !pkg.name().isEmpty()) {
if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
Content ... | [
"protected",
"void",
"addPackagesList",
"(",
"Collection",
"<",
"PackageDoc",
">",
"packages",
",",
"Content",
"tbody",
")",
"{",
"boolean",
"altColor",
"=",
"true",
";",
"for",
"(",
"PackageDoc",
"pkg",
":",
"packages",
")",
"{",
"if",
"(",
"pkg",
"!=",
... | Adds list of packages in the index table. Generate link to each package.
@param packages Packages to which link is to be generated
@param tbody the documentation tree to which the list will be added | [
"Adds",
"list",
"of",
"packages",
"in",
"the",
"index",
"table",
".",
"Generate",
"link",
"to",
"each",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java#L153-L171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.