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 |
|---|---|---|---|---|---|---|---|---|---|---|
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshConnectionFactory.java | SshConnectionFactory.getConnection | public static SshConnection getConnection(String host, int port, String proxy,
Authentication authentication, int connectionTimeout) throws IOException {
"""
Creates a {@link SshConnection}.
@param host the host name
@param port the port
@param... | java | public static SshConnection getConnection(String host, int port, String proxy,
Authentication authentication, int connectionTimeout) throws IOException {
return getConnection(host, port, proxy, authentication, null, connectionTimeout);
} | [
"public",
"static",
"SshConnection",
"getConnection",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"proxy",
",",
"Authentication",
"authentication",
",",
"int",
"connectionTimeout",
")",
"throws",
"IOException",
"{",
"return",
"getConnection",
"(",
"h... | Creates a {@link SshConnection}.
@param host the host name
@param port the port
@param proxy the proxy url
@param authentication the credentials
@param connectionTimeout the connection timeout
@return a new connection.
@throws IOException if so.
@see SshConnection
@see SshConnectionImpl | [
"Creates",
"a",
"{",
"@link",
"SshConnection",
"}",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshConnectionFactory.java#L95-L98 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseBigInteger | @Nullable
public static BigInteger parseBigInteger (@Nullable final String sStr, @Nullable final BigInteger aDefault) {
"""
Parse the given {@link String} as {@link BigInteger} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The String to parse. May be <code>null</code>.
@param aDefault
The default value ... | java | @Nullable
public static BigInteger parseBigInteger (@Nullable final String sStr, @Nullable final BigInteger aDefault)
{
return parseBigInteger (sStr, DEFAULT_RADIX, aDefault);
} | [
"@",
"Nullable",
"public",
"static",
"BigInteger",
"parseBigInteger",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nullable",
"final",
"BigInteger",
"aDefault",
")",
"{",
"return",
"parseBigInteger",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"aDefau... | Parse the given {@link String} as {@link BigInteger} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The String to parse. May be <code>null</code>.
@param aDefault
The default value to be returned if the passed string could not be
converted to a valid value. May be <code>null</code>.
@return <code>aDefault</code> if t... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"BigInteger",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1417-L1421 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Parallelogram2dfx.java | Parallelogram2dfx.firstAxisExtentProperty | @Pure
public DoubleProperty firstAxisExtentProperty() {
"""
Replies the property for the extent of the first axis.
@return the firstAxisExtent property.
"""
if (this.extentR == null) {
this.extentR = new SimpleDoubleProperty(this, MathFXAttributeNames.FIRST_AXIS_EXTENT) {
@Override
protected v... | java | @Pure
public DoubleProperty firstAxisExtentProperty() {
if (this.extentR == null) {
this.extentR = new SimpleDoubleProperty(this, MathFXAttributeNames.FIRST_AXIS_EXTENT) {
@Override
protected void invalidated() {
if (get() < 0.) {
set(0.);
}
}
};
}
return this.extentR;
} | [
"@",
"Pure",
"public",
"DoubleProperty",
"firstAxisExtentProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"extentR",
"==",
"null",
")",
"{",
"this",
".",
"extentR",
"=",
"new",
"SimpleDoubleProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"FIRST_AXIS... | Replies the property for the extent of the first axis.
@return the firstAxisExtent property. | [
"Replies",
"the",
"property",
"for",
"the",
"extent",
"of",
"the",
"first",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Parallelogram2dfx.java#L309-L322 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.strings2DateTimeISO | public static Date strings2DateTimeISO(String date, String time) {
"""
Erzeugt ein Datums-Objekt aus Datum und Uhrzeit in der String-Darstellung.
Die String-Darstellung von Datum und Uhrzeit müssen dabei im ISO-Format
vorlegen (Datum als yyyy-mm-dd, Zeit als hh:mm:ss). Der Parameter <code>time</code>
darf auch ... | java | public static Date strings2DateTimeISO(String date, String time) {
if (date == null) {
throw new InvalidArgumentException("*** date must not be null");
}
Date result;
try {
if (time != null) {
result = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").p... | [
"public",
"static",
"Date",
"strings2DateTimeISO",
"(",
"String",
"date",
",",
"String",
"time",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"*** date must not be null\"",
")",
";",
"}",
"Date",
"resu... | Erzeugt ein Datums-Objekt aus Datum und Uhrzeit in der String-Darstellung.
Die String-Darstellung von Datum und Uhrzeit müssen dabei im ISO-Format
vorlegen (Datum als yyyy-mm-dd, Zeit als hh:mm:ss). Der Parameter <code>time</code>
darf auch <code>null</code> sein, <code>date</code> jedoch nicht.
@param date ein Datum ... | [
"Erzeugt",
"ein",
"Datums",
"-",
"Objekt",
"aus",
"Datum",
"und",
"Uhrzeit",
"in",
"der",
"String",
"-",
"Darstellung",
".",
"Die",
"String",
"-",
"Darstellung",
"von",
"Datum",
"und",
"Uhrzeit",
"müssen",
"dabei",
"im",
"ISO",
"-",
"Format",
"vorlegen",
"... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L500-L517 |
Jasig/uPortal | uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java | FileSystemGroupStore.fileContains | private boolean fileContains(File file, IGroupMember member) throws GroupsException {
"""
Answers if <code>file</code> contains <code>member</code>.
@param file
@param member
@return boolean
"""
Collection ids = null;
try {
ids = member.isGroup() ? getGroupIdsFromFile(file) : g... | java | private boolean fileContains(File file, IGroupMember member) throws GroupsException {
Collection ids = null;
try {
ids = member.isGroup() ? getGroupIdsFromFile(file) : getEntityIdsFromFile(file);
} catch (Exception ex) {
throw new GroupsException("Error retrieving ids fro... | [
"private",
"boolean",
"fileContains",
"(",
"File",
"file",
",",
"IGroupMember",
"member",
")",
"throws",
"GroupsException",
"{",
"Collection",
"ids",
"=",
"null",
";",
"try",
"{",
"ids",
"=",
"member",
".",
"isGroup",
"(",
")",
"?",
"getGroupIdsFromFile",
"(... | Answers if <code>file</code> contains <code>member</code>.
@param file
@param member
@return boolean | [
"Answers",
"if",
"<code",
">",
"file<",
"/",
"code",
">",
"contains",
"<code",
">",
"member<",
"/",
"code",
">",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java#L866-L874 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCircuitPeeringsInner.java | ExpressRouteCircuitPeeringsInner.getAsync | public Observable<ExpressRouteCircuitPeeringInner> getAsync(String resourceGroupName, String circuitName, String peeringName) {
"""
Gets the specified peering for the express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@para... | java | public Observable<ExpressRouteCircuitPeeringInner> getAsync(String resourceGroupName, String circuitName, String peeringName) {
return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1<ServiceResponse<ExpressRouteCircuitPeeringInner>, ExpressRouteCircuitPeeringInner>() {
... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitPeeringInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"circuitName"... | Gets the specified peering for the express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to th... | [
"Gets",
"the",
"specified",
"peering",
"for",
"the",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCircuitPeeringsInner.java#L297-L304 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/config/classification/Classification.java | Classification.resolvePayload | @Override
public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload) {
"""
Set the payload to the fileModel of the given instance even though the variable is not directly referencing it. This is mainly to simplify the
creation of the rule, when the FileModel itse... | java | @Override
public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload)
{
checkVariableName(event, context);
if (payload instanceof FileReferenceModel)
{
return ((FileReferenceModel) payload).getFile();
}
if (payload... | [
"@",
"Override",
"public",
"FileModel",
"resolvePayload",
"(",
"GraphRewrite",
"event",
",",
"EvaluationContext",
"context",
",",
"WindupVertexFrame",
"payload",
")",
"{",
"checkVariableName",
"(",
"event",
",",
"context",
")",
";",
"if",
"(",
"payload",
"instance... | Set the payload to the fileModel of the given instance even though the variable is not directly referencing it. This is mainly to simplify the
creation of the rule, when the FileModel itself is not being iterated but just a model referencing it. | [
"Set",
"the",
"payload",
"to",
"the",
"fileModel",
"of",
"the",
"given",
"instance",
"even",
"though",
"the",
"variable",
"is",
"not",
"directly",
"referencing",
"it",
".",
"This",
"is",
"mainly",
"to",
"simplify",
"the",
"creation",
"of",
"the",
"rule",
"... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/config/classification/Classification.java#L102-L115 |
CloudSlang/cs-actions | cs-xml/src/main/java/io/cloudslang/content/xml/utils/ValidateUtils.java | ValidateUtils.validateInputs | public static void validateInputs(EditXmlInputs inputs) throws Exception {
"""
Validates the operation inputs.
@param inputs@throws Exception for invalid inputs
"""
validateXmlAndFilePathInputs(inputs.getXml(), inputs.getFilePath());
if (Constants.Inputs.MOVE_ACTION.equals(inputs.getAction(... | java | public static void validateInputs(EditXmlInputs inputs) throws Exception {
validateXmlAndFilePathInputs(inputs.getXml(), inputs.getFilePath());
if (Constants.Inputs.MOVE_ACTION.equals(inputs.getAction())) {
validateIsNotEmpty(inputs.getXpath2(), "xpath2 input is required for action 'move' "... | [
"public",
"static",
"void",
"validateInputs",
"(",
"EditXmlInputs",
"inputs",
")",
"throws",
"Exception",
"{",
"validateXmlAndFilePathInputs",
"(",
"inputs",
".",
"getXml",
"(",
")",
",",
"inputs",
".",
"getFilePath",
"(",
")",
")",
";",
"if",
"(",
"Constants"... | Validates the operation inputs.
@param inputs@throws Exception for invalid inputs | [
"Validates",
"the",
"operation",
"inputs",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-xml/src/main/java/io/cloudslang/content/xml/utils/ValidateUtils.java#L33-L48 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.getServiceStatus | @Given("^I get service '(.+?)' status in cluster '(.+?)' and save it in variable '(.+?)'")
public void getServiceStatus(String service, String cluster, String envVar) throws Exception {
"""
Get service status
@param service name of the service to be checked
@param cluster URI of the cluster
@param envVar ... | java | @Given("^I get service '(.+?)' status in cluster '(.+?)' and save it in variable '(.+?)'")
public void getServiceStatus(String service, String cluster, String envVar) throws Exception {
String status = commonspec.retrieveServiceStatus(service, cluster);
ThreadProperty.set(envVar, status);
} | [
"@",
"Given",
"(",
"\"^I get service '(.+?)' status in cluster '(.+?)' and save it in variable '(.+?)'\"",
")",
"public",
"void",
"getServiceStatus",
"(",
"String",
"service",
",",
"String",
"cluster",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"String",
"s... | Get service status
@param service name of the service to be checked
@param cluster URI of the cluster
@param envVar environment variable where to store result
@throws Exception exception * | [
"Get",
"service",
"status"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L336-L341 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.prepareHadoopJob | private void prepareHadoopJob(List<WorkUnit> workUnits) throws IOException {
"""
Prepare the Hadoop MR job, including configuring the job and setting up the input/output paths.
"""
TimingEvent mrJobSetupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.RunJobTimings.MR_JOB_SETUP);
// Add dependen... | java | private void prepareHadoopJob(List<WorkUnit> workUnits) throws IOException {
TimingEvent mrJobSetupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.RunJobTimings.MR_JOB_SETUP);
// Add dependent jars/files
addDependencies(this.job.getConfiguration());
this.job.setJarByClass(MRJobLauncher.class);
... | [
"private",
"void",
"prepareHadoopJob",
"(",
"List",
"<",
"WorkUnit",
">",
"workUnits",
")",
"throws",
"IOException",
"{",
"TimingEvent",
"mrJobSetupTimer",
"=",
"this",
".",
"eventSubmitter",
".",
"getTimingEvent",
"(",
"TimingEvent",
".",
"RunJobTimings",
".",
"M... | Prepare the Hadoop MR job, including configuring the job and setting up the input/output paths. | [
"Prepare",
"the",
"Hadoop",
"MR",
"job",
"including",
"configuring",
"the",
"job",
"and",
"setting",
"up",
"the",
"input",
"/",
"output",
"paths",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L401-L444 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/ReflectionUtils.java | ReflectionUtils.getAccessibleMethod | public static Method getAccessibleMethod(final Object obj, final String methodName, final Class<?>... parameterTypes) {
"""
循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
如向上转型到Object仍无法找到, 返回null.
用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
"""
Asserts.notNull(obj, "object cannot... | java | public static Method getAccessibleMethod(final Object obj, final String methodName, final Class<?>... parameterTypes) {
Asserts.notNull(obj, "object cannot be null.");
for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) {
try {
Method method = supe... | [
"public",
"static",
"Method",
"getAccessibleMethod",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"methodName",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"Asserts",
".",
"notNull",
"(",
"obj",
",",
"\"object cannot be n... | 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
如向上转型到Object仍无法找到, 返回null.
用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) | [
"循环向上转型",
"获取对象的DeclaredMethod",
"并强制设置为可访问",
".",
"如向上转型到Object仍无法找到",
"返回null",
".",
"用于方法需要被多次调用的情况",
".",
"先使用本函数先取得Method",
"然后调用Method",
".",
"invoke",
"(",
"Object",
"obj",
"Object",
"...",
"args",
")"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/ReflectionUtils.java#L143-L156 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java | VirtualNetworksInner.listUsageAsync | public Observable<Page<VirtualNetworkUsageInner>> listUsageAsync(final String resourceGroupName, final String virtualNetworkName) {
"""
Lists usage stats.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thrown... | java | public Observable<Page<VirtualNetworkUsageInner>> listUsageAsync(final String resourceGroupName, final String virtualNetworkName) {
return listUsageWithServiceResponseAsync(resourceGroupName, virtualNetworkName)
.map(new Func1<ServiceResponse<Page<VirtualNetworkUsageInner>>, Page<VirtualNetworkUsage... | [
"public",
"Observable",
"<",
"Page",
"<",
"VirtualNetworkUsageInner",
">",
">",
"listUsageAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualNetworkName",
")",
"{",
"return",
"listUsageWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Lists usage stats.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<VirtualNetworkUsageInner> object | [
"Lists",
"usage",
"stats",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java#L1360-L1368 |
banq/jdonframework | src/main/java/com/jdon/util/ObjectCreator.java | ObjectCreator.createObject | public static Object createObject(String className, Object[] params) throws Exception {
"""
Instantaite an Object instance, requires a constructor with parameters
@param className
full qualified name of the class
@param params
an array including the required parameters to instantaite the
object
@return the... | java | public static Object createObject(String className, Object[] params) throws Exception {
return createObject(Class.forName(className), params);
} | [
"public",
"static",
"Object",
"createObject",
"(",
"String",
"className",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"Exception",
"{",
"return",
"createObject",
"(",
"Class",
".",
"forName",
"(",
"className",
")",
",",
"params",
")",
";",
"}"
] | Instantaite an Object instance, requires a constructor with parameters
@param className
full qualified name of the class
@param params
an array including the required parameters to instantaite the
object
@return the instantaited Object
@exception java.lang.Exception
if instantiation failed | [
"Instantaite",
"an",
"Object",
"instance",
"requires",
"a",
"constructor",
"with",
"parameters"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/ObjectCreator.java#L59-L61 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationEntry.java | NotificationEntry.setWhen | public void setWhen(CharSequence format, long when) {
"""
Set a timestamp pertaining to this notification.
Only used for:
@see NotificationLocal
@see NotificationGlobal
@param format
@param when
"""
if (format == null) format = DEFAULT_DATE_FORMAT;
this.whenFormatted = DateFormat.forma... | java | public void setWhen(CharSequence format, long when) {
if (format == null) format = DEFAULT_DATE_FORMAT;
this.whenFormatted = DateFormat.format(format, when);
} | [
"public",
"void",
"setWhen",
"(",
"CharSequence",
"format",
",",
"long",
"when",
")",
"{",
"if",
"(",
"format",
"==",
"null",
")",
"format",
"=",
"DEFAULT_DATE_FORMAT",
";",
"this",
".",
"whenFormatted",
"=",
"DateFormat",
".",
"format",
"(",
"format",
","... | Set a timestamp pertaining to this notification.
Only used for:
@see NotificationLocal
@see NotificationGlobal
@param format
@param when | [
"Set",
"a",
"timestamp",
"pertaining",
"to",
"this",
"notification",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationEntry.java#L309-L312 |
ben-manes/caffeine | caffeine/src/jmh/java/com/github/benmanes/caffeine/cache/impl/ConcurrentHashMapV7.java | ConcurrentHashMapV7.put | @Override
@SuppressWarnings("unchecked")
public V put(K key, V value) {
"""
Maps the specified key to the specified value in this table.
Neither the key nor the value can be null.
<p> The value can be retrieved by calling the <tt>get</tt> method
with a key that is equal to the original key.
@param ... | java | @Override
@SuppressWarnings("unchecked")
public V put(K key, V value) {
Segment<K,V> s;
if (value == null) {
throw new NullPointerException();
}
int hash = hash(key);
int j = (hash >>> segmentShift) & segmentMask;
if ((s = (Segment<K,V>)UNSAFE.getObject ... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"Segment",
"<",
"K",
",",
"V",
">",
"s",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"Nu... | Maps the specified key to the specified value in this table.
Neither the key nor the value can be null.
<p> The value can be retrieved by calling the <tt>get</tt> method
with a key that is equal to the original key.
@param key key with which the specified value is to be associated
@param value value to be associated ... | [
"Maps",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"in",
"this",
"table",
".",
"Neither",
"the",
"key",
"nor",
"the",
"value",
"can",
"be",
"null",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/jmh/java/com/github/benmanes/caffeine/cache/impl/ConcurrentHashMapV7.java#L1182-L1196 |
relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/server/BaseHttp2ServerBuilder.java | BaseHttp2ServerBuilder.setServerCredentials | public BaseHttp2ServerBuilder setServerCredentials(final InputStream certificatePemInputStream, final InputStream privateKeyPkcs8InputStream, final String privateKeyPassword) {
"""
<p>Sets the credentials for the server under construction using the certificates in the given PEM input stream
and the private key in... | java | public BaseHttp2ServerBuilder setServerCredentials(final InputStream certificatePemInputStream, final InputStream privateKeyPkcs8InputStream, final String privateKeyPassword) {
this.certificateChain = null;
this.privateKey = null;
this.certificateChainPemFile = null;
this.privateKeyPkcs... | [
"public",
"BaseHttp2ServerBuilder",
"setServerCredentials",
"(",
"final",
"InputStream",
"certificatePemInputStream",
",",
"final",
"InputStream",
"privateKeyPkcs8InputStream",
",",
"final",
"String",
"privateKeyPassword",
")",
"{",
"this",
".",
"certificateChain",
"=",
"nu... | <p>Sets the credentials for the server under construction using the certificates in the given PEM input stream
and the private key in the given PKCS#8 input stream.</p>
@param certificatePemInputStream a PEM input stream containing the certificate chain for the server under
construction
@param privateKeyPkcs8InputStre... | [
"<p",
">",
"Sets",
"the",
"credentials",
"for",
"the",
"server",
"under",
"construction",
"using",
"the",
"certificates",
"in",
"the",
"given",
"PEM",
"input",
"stream",
"and",
"the",
"private",
"key",
"in",
"the",
"given",
"PKCS#8",
"input",
"stream",
".",
... | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/server/BaseHttp2ServerBuilder.java#L112-L125 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/PathPattern.java | PathPattern.matches | public static boolean matches(Collection<PathPattern> patterns, List<String> path) {
"""
Return true if the given path elements match at least one of the given pattern.
"""
for (PathPattern pattern : patterns)
if (pattern.matches(path))
return true;
return false;
} | java | public static boolean matches(Collection<PathPattern> patterns, List<String> path) {
for (PathPattern pattern : patterns)
if (pattern.matches(path))
return true;
return false;
} | [
"public",
"static",
"boolean",
"matches",
"(",
"Collection",
"<",
"PathPattern",
">",
"patterns",
",",
"List",
"<",
"String",
">",
"path",
")",
"{",
"for",
"(",
"PathPattern",
"pattern",
":",
"patterns",
")",
"if",
"(",
"pattern",
".",
"matches",
"(",
"p... | Return true if the given path elements match at least one of the given pattern. | [
"Return",
"true",
"if",
"the",
"given",
"path",
"elements",
"match",
"at",
"least",
"one",
"of",
"the",
"given",
"pattern",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/PathPattern.java#L103-L108 |
shrinkwrap/descriptors | metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/Metadata.java | Metadata.addClassReference | public void addClassReference(final String className, final MetadataElement classReference) {
"""
Adds a new reference to the specific element class. If no element class is found, then a new element class. will
be created.
@param className
the class name
@param classReference
the new reference to be added.
... | java | public void addClassReference(final String className, final MetadataElement classReference) {
classReference.setRef(getNamespaceValue(classReference.getRef()));
for (MetadataItem item : classList) {
if (item.getName().equals(className) && item.getNamespace().equals(getCurrentNamespace())
... | [
"public",
"void",
"addClassReference",
"(",
"final",
"String",
"className",
",",
"final",
"MetadataElement",
"classReference",
")",
"{",
"classReference",
".",
"setRef",
"(",
"getNamespaceValue",
"(",
"classReference",
".",
"getRef",
"(",
")",
")",
")",
";",
"fo... | Adds a new reference to the specific element class. If no element class is found, then a new element class. will
be created.
@param className
the class name
@param classReference
the new reference to be added. | [
"Adds",
"a",
"new",
"reference",
"to",
"the",
"specific",
"element",
"class",
".",
"If",
"no",
"element",
"class",
"is",
"found",
"then",
"a",
"new",
"element",
"class",
".",
"will",
"be",
"created",
"."
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/Metadata.java#L237-L254 |
m-m-m/util | exception/src/main/java/net/sf/mmm/util/exception/api/ValueOutOfRangeException.java | ValueOutOfRangeException.verifyNumber | private void verifyNumber(Number value, Number minimum, Number maximum) {
"""
Verifies that the {@code value} is actually out of range.
@param value is the number that is out of range.
@param minimum is the minimum value allowed
@param maximum is the maximum value allowed.
"""
if (minimum != null) {
... | java | private void verifyNumber(Number value, Number minimum, Number maximum) {
if (minimum != null) {
if (maximum != null) {
assert ((value.doubleValue() >= minimum.doubleValue()) || (value.doubleValue() <= maximum.doubleValue()));
} else {
assert (value.doubleValue() >= minimum.doubleValue(... | [
"private",
"void",
"verifyNumber",
"(",
"Number",
"value",
",",
"Number",
"minimum",
",",
"Number",
"maximum",
")",
"{",
"if",
"(",
"minimum",
"!=",
"null",
")",
"{",
"if",
"(",
"maximum",
"!=",
"null",
")",
"{",
"assert",
"(",
"(",
"value",
".",
"do... | Verifies that the {@code value} is actually out of range.
@param value is the number that is out of range.
@param minimum is the minimum value allowed
@param maximum is the maximum value allowed. | [
"Verifies",
"that",
"the",
"{",
"@code",
"value",
"}",
"is",
"actually",
"out",
"of",
"range",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/exception/src/main/java/net/sf/mmm/util/exception/api/ValueOutOfRangeException.java#L105-L118 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/OptionalSslHandler.java | OptionalSslHandler.newSslHandler | protected SslHandler newSslHandler(ChannelHandlerContext context, SslContext sslContext) {
"""
Override to configure the SslHandler eg. {@link SSLParameters#setEndpointIdentificationAlgorithm(String)}.
The hostname and port is not known by this method so servers may want to override this method and use the
{@lin... | java | protected SslHandler newSslHandler(ChannelHandlerContext context, SslContext sslContext) {
return sslContext.newHandler(context.alloc());
} | [
"protected",
"SslHandler",
"newSslHandler",
"(",
"ChannelHandlerContext",
"context",
",",
"SslContext",
"sslContext",
")",
"{",
"return",
"sslContext",
".",
"newHandler",
"(",
"context",
".",
"alloc",
"(",
")",
")",
";",
"}"
] | Override to configure the SslHandler eg. {@link SSLParameters#setEndpointIdentificationAlgorithm(String)}.
The hostname and port is not known by this method so servers may want to override this method and use the
{@link SslContext#newHandler(ByteBufAllocator, String, int)} variant.
@param context the {@link ChannelHan... | [
"Override",
"to",
"configure",
"the",
"SslHandler",
"eg",
".",
"{",
"@link",
"SSLParameters#setEndpointIdentificationAlgorithm",
"(",
"String",
")",
"}",
".",
"The",
"hostname",
"and",
"port",
"is",
"not",
"known",
"by",
"this",
"method",
"so",
"servers",
"may",... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OptionalSslHandler.java#L96-L98 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Filters.java | Filters.retainAll | public static <E> void retainAll(Collection<E> elems, Filter<? super E> filter) {
"""
Removes all elems in the given Collection that aren't accepted by the given Filter.
"""
for (Iterator<E> iter = elems.iterator(); iter.hasNext();) {
E elem = iter.next();
if ( ! filter.accept(elem)) {
... | java | public static <E> void retainAll(Collection<E> elems, Filter<? super E> filter) {
for (Iterator<E> iter = elems.iterator(); iter.hasNext();) {
E elem = iter.next();
if ( ! filter.accept(elem)) {
iter.remove();
}
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"retainAll",
"(",
"Collection",
"<",
"E",
">",
"elems",
",",
"Filter",
"<",
"?",
"super",
"E",
">",
"filter",
")",
"{",
"for",
"(",
"Iterator",
"<",
"E",
">",
"iter",
"=",
"elems",
".",
"iterator",
"(",
... | Removes all elems in the given Collection that aren't accepted by the given Filter. | [
"Removes",
"all",
"elems",
"in",
"the",
"given",
"Collection",
"that",
"aren",
"t",
"accepted",
"by",
"the",
"given",
"Filter",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Filters.java#L268-L275 |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.createBlob | private acolyte.jdbc.Blob createBlob(InputStream stream, long length)
throws SQLException {
"""
Creates BLOB from input stream.
@param stream Input stream
@param length
"""
final acolyte.jdbc.Blob blob = acolyte.jdbc.Blob.Nil();
blob.setBytes(0L, createBytes(stream, length));
... | java | private acolyte.jdbc.Blob createBlob(InputStream stream, long length)
throws SQLException {
final acolyte.jdbc.Blob blob = acolyte.jdbc.Blob.Nil();
blob.setBytes(0L, createBytes(stream, length));
return blob;
} | [
"private",
"acolyte",
".",
"jdbc",
".",
"Blob",
"createBlob",
"(",
"InputStream",
"stream",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"final",
"acolyte",
".",
"jdbc",
".",
"Blob",
"blob",
"=",
"acolyte",
".",
"jdbc",
".",
"Blob",
".",
"N... | Creates BLOB from input stream.
@param stream Input stream
@param length | [
"Creates",
"BLOB",
"from",
"input",
"stream",
"."
] | train | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L1079-L1087 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.addGaussian | public static void addGaussian(GrayS16 input, Random rand , double sigma , int lowerBound , int upperBound ) {
"""
Adds Gaussian/normal i.i.d noise to each pixel in the image. If a value exceeds the specified
it will be set to the closest bound.
@param input Input image. Modified.
@param rand Random number ge... | java | public static void addGaussian(GrayS16 input, Random rand , double sigma , int lowerBound , int upperBound ) {
for (int y = 0; y < input.height; y++) {
int index = input.getStartIndex() + y * input.getStride();
for (int x = 0; x < input.width; x++) {
int value = (input.data[index] ) + (int)(rand.nextGaussi... | [
"public",
"static",
"void",
"addGaussian",
"(",
"GrayS16",
"input",
",",
"Random",
"rand",
",",
"double",
"sigma",
",",
"int",
"lowerBound",
",",
"int",
"upperBound",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"input",
".",
"height",
... | Adds Gaussian/normal i.i.d noise to each pixel in the image. If a value exceeds the specified
it will be set to the closest bound.
@param input Input image. Modified.
@param rand Random number generator.
@param sigma Distributions standard deviation.
@param lowerBound Allowed lower bound
@param upperBound Allowed upp... | [
"Adds",
"Gaussian",
"/",
"normal",
"i",
".",
"i",
".",
"d",
"noise",
"to",
"each",
"pixel",
"in",
"the",
"image",
".",
"If",
"a",
"value",
"exceeds",
"the",
"specified",
"it",
"will",
"be",
"set",
"to",
"the",
"closest",
"bound",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L3586-L3597 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.maxByLong | public OptionalInt maxByLong(IntToLongFunction keyExtractor) {
"""
Returns the maximum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing the first el... | java | public OptionalInt maxByLong(IntToLongFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
long key = keyExtractor.applyAsLong(i);
if (!box.b || box.l < key) {
box.b = true;
box.l = key;
box.i = i;
}
... | [
"public",
"OptionalInt",
"maxByLong",
"(",
"IntToLongFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"i",
")",
"->",
"{",
"long",
"key",
"=",
"keyExtractor",
".",
"applyAsLong",
"(",
"i",
")... | Returns the maximum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing the first element of this
stream for which the highest value was returned by key extractor,... | [
"Returns",
"the",
"maximum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L1164-L1173 |
lightblueseas/email-tails | src/main/java/de/alpharogroup/email/messages/EmailMessage.java | EmailMessage.setSubject | @Override
public void setSubject(final String subject, final String charset) throws MessagingException {
"""
Sets the subject.
@param subject
the subject
@param charset
the charset
@throws MessagingException
is thrown if the underlying implementation does not support modification of
existing values
@s... | java | @Override
public void setSubject(final String subject, final String charset) throws MessagingException
{
super.setSubject(subject, charset);
} | [
"@",
"Override",
"public",
"void",
"setSubject",
"(",
"final",
"String",
"subject",
",",
"final",
"String",
"charset",
")",
"throws",
"MessagingException",
"{",
"super",
".",
"setSubject",
"(",
"subject",
",",
"charset",
")",
";",
"}"
] | Sets the subject.
@param subject
the subject
@param charset
the charset
@throws MessagingException
is thrown if the underlying implementation does not support modification of
existing values
@see javax.mail.internet.MimeMessage#setSubject(java.lang.String, java.lang.String) | [
"Sets",
"the",
"subject",
"."
] | train | https://github.com/lightblueseas/email-tails/blob/7be6fee3548e61e697cc8e64e90603cb1f505be2/src/main/java/de/alpharogroup/email/messages/EmailMessage.java#L369-L373 |
h2oai/h2o-2 | src/main/java/hex/gbm/DTreeUtils.java | DTreeUtils.scoreTree | public static void scoreTree(double data[], float preds[], CompressedTree[] ts) {
"""
Score given tree on the row of data.
@param data row of data
@param preds array to hold resulting prediction
@param ts a tree representation (single regression tree, or multi tree)
"""
for( int c=0; c<ts.length; c++ ... | java | public static void scoreTree(double data[], float preds[], CompressedTree[] ts) {
for( int c=0; c<ts.length; c++ )
if( ts[c] != null )
preds[ts.length==1?0:c+1] += ts[c].score(data);
} | [
"public",
"static",
"void",
"scoreTree",
"(",
"double",
"data",
"[",
"]",
",",
"float",
"preds",
"[",
"]",
",",
"CompressedTree",
"[",
"]",
"ts",
")",
"{",
"for",
"(",
"int",
"c",
"=",
"0",
";",
"c",
"<",
"ts",
".",
"length",
";",
"c",
"++",
")... | Score given tree on the row of data.
@param data row of data
@param preds array to hold resulting prediction
@param ts a tree representation (single regression tree, or multi tree) | [
"Score",
"given",
"tree",
"on",
"the",
"row",
"of",
"data",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DTreeUtils.java#L15-L19 |
phax/ph-css | ph-css/src/main/java/com/helger/css/handler/CSSHandler.java | CSSHandler.readDeclarationListFromNode | @Nonnull
@Deprecated
public static CSSDeclarationList readDeclarationListFromNode (@Nonnull final ECSSVersion eVersion,
@Nonnull final CSSNode aNode) {
"""
Create a {@link CSSDeclarationList} object from a parsed object.
@param eVersion
The CS... | java | @Nonnull
@Deprecated
public static CSSDeclarationList readDeclarationListFromNode (@Nonnull final ECSSVersion eVersion,
@Nonnull final CSSNode aNode)
{
return readDeclarationListFromNode (eVersion, aNode, CSSReader.getDefaultInterpretErrorHandler... | [
"@",
"Nonnull",
"@",
"Deprecated",
"public",
"static",
"CSSDeclarationList",
"readDeclarationListFromNode",
"(",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
",",
"@",
"Nonnull",
"final",
"CSSNode",
"aNode",
")",
"{",
"return",
"readDeclarationListFromNode",
"(... | Create a {@link CSSDeclarationList} object from a parsed object.
@param eVersion
The CSS version to use. May not be <code>null</code>.
@param aNode
The parsed CSS object to read. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"{",
"@link",
"CSSDeclarationList",
"}",
"object",
"from",
"a",
"parsed",
"object",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/handler/CSSHandler.java#L98-L104 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addEqualToField | public void addEqualToField(String attribute, String fieldName) {
"""
Adds and equals (=) criteria for field comparison.
The field name will be translated into the appropriate columnName by SqlStatement.
<br>
name = boss.name
@param attribute The field name to be used
@param fieldName The field name t... | java | public void addEqualToField(String attribute, String fieldName)
{
// PAW
// FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, fieldName, getAlias());
FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, fieldName, getUserAlias(attribute));
addSelectionCriteria(c);
} | [
"public",
"void",
"addEqualToField",
"(",
"String",
"attribute",
",",
"String",
"fieldName",
")",
"{",
"// PAW\r",
"// FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, fieldName, getAlias());\r",
"FieldCriteria",
"c",
"=",
"FieldCriteria",
".",
"buildEqualToCriteri... | Adds and equals (=) criteria for field comparison.
The field name will be translated into the appropriate columnName by SqlStatement.
<br>
name = boss.name
@param attribute The field name to be used
@param fieldName The field name to compare with | [
"Adds",
"and",
"equals",
"(",
"=",
")",
"criteria",
"for",
"field",
"comparison",
".",
"The",
"field",
"name",
"will",
"be",
"translated",
"into",
"the",
"appropriate",
"columnName",
"by",
"SqlStatement",
".",
"<br",
">",
"name",
"=",
"boss",
".",
"name"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L340-L346 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java | UnImplNode.importNode | public Node importNode(Node importedNode, boolean deep) throws DOMException {
"""
Unimplemented. See org.w3c.dom.Document
@param importedNode The node to import.
@param deep If <code>true</code>, recursively import the subtree under
the specified node; if <code>false</code>, import only the node
itse... | java | public Node importNode(Node importedNode, boolean deep) throws DOMException
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
} | [
"public",
"Node",
"importNode",
"(",
"Node",
"importedNode",
",",
"boolean",
"deep",
")",
"throws",
"DOMException",
"{",
"error",
"(",
"XMLErrorResources",
".",
"ER_FUNCTION_NOT_SUPPORTED",
")",
";",
"return",
"null",
";",
"}"
] | Unimplemented. See org.w3c.dom.Document
@param importedNode The node to import.
@param deep If <code>true</code>, recursively import the subtree under
the specified node; if <code>false</code>, import only the node
itself, as explained above. This has no effect on <code>Attr</code>
, <code>EntityReference</cod... | [
"Unimplemented",
".",
"See",
"org",
".",
"w3c",
".",
"dom",
".",
"Document"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java#L952-L958 |
jamesagnew/hapi-fhir | hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/IniFile.java | IniFile.addSection | public void addSection(String pstrSection, String pstrComments) {
"""
Sets the comments associated with a section.
@param pstrSection the section name
@param pstrComments the comments.
"""
INISection objSec = null;
objSec = (INISection) this.mhmapSections.get(pstrSection);
if (... | java | public void addSection(String pstrSection, String pstrComments)
{
INISection objSec = null;
objSec = (INISection) this.mhmapSections.get(pstrSection);
if (objSec == null)
{
objSec = new INISection(pstrSection);
this.mhmapSections.put(pstrSection, ob... | [
"public",
"void",
"addSection",
"(",
"String",
"pstrSection",
",",
"String",
"pstrComments",
")",
"{",
"INISection",
"objSec",
"=",
"null",
";",
"objSec",
"=",
"(",
"INISection",
")",
"this",
".",
"mhmapSections",
".",
"get",
"(",
"pstrSection",
")",
";",
... | Sets the comments associated with a section.
@param pstrSection the section name
@param pstrComments the comments. | [
"Sets",
"the",
"comments",
"associated",
"with",
"a",
"section",
"."
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/IniFile.java#L379-L391 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/GameLoginSignUtil.java | GameLoginSignUtil.callbackResult | private static void callbackResult(String str, String pubKey, ICheckLoginSignHandler callback) {
"""
回调验签请求结果
@param str 验签请求结果字符串
@param pubKey 公钥
@param callback 回调
"""
JSONObject json = null;
try {
json = new JSONObject(str);
} catch (JSONException e) {
... | java | private static void callbackResult(String str, String pubKey, ICheckLoginSignHandler callback){
JSONObject json = null;
try {
json = new JSONObject(str);
} catch (JSONException e) {
callback.onCheckResult(null, "json parse fail:" + e.getMessage(), false);
... | [
"private",
"static",
"void",
"callbackResult",
"(",
"String",
"str",
",",
"String",
"pubKey",
",",
"ICheckLoginSignHandler",
"callback",
")",
"{",
"JSONObject",
"json",
"=",
"null",
";",
"try",
"{",
"json",
"=",
"new",
"JSONObject",
"(",
"str",
")",
";",
"... | 回调验签请求结果
@param str 验签请求结果字符串
@param pubKey 公钥
@param callback 回调 | [
"回调验签请求结果"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/GameLoginSignUtil.java#L166-L188 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.findMax | private static double findMax(DistanceQuery<?> dq, DBIDIter i, DBIDs cy, double maxDist, double minMaxDist) {
"""
Find the maximum distance of one object to a set.
@param dq Distance query
@param i Current object
@param cy Set of candidates
@param maxDist Known maximum to others
@param minMaxDist Early stop... | java | private static double findMax(DistanceQuery<?> dq, DBIDIter i, DBIDs cy, double maxDist, double minMaxDist) {
for(DBIDIter j = cy.iter(); j.valid(); j.advance()) {
double dist = dq.distance(i, j);
if(dist > maxDist) {
// Stop early, if we already know a better candidate.
if(dist >= minMa... | [
"private",
"static",
"double",
"findMax",
"(",
"DistanceQuery",
"<",
"?",
">",
"dq",
",",
"DBIDIter",
"i",
",",
"DBIDs",
"cy",
",",
"double",
"maxDist",
",",
"double",
"minMaxDist",
")",
"{",
"for",
"(",
"DBIDIter",
"j",
"=",
"cy",
".",
"iter",
"(",
... | Find the maximum distance of one object to a set.
@param dq Distance query
@param i Current object
@param cy Set of candidates
@param maxDist Known maximum to others
@param minMaxDist Early stopping threshold
@return Maximum distance | [
"Find",
"the",
"maximum",
"distance",
"of",
"one",
"object",
"to",
"a",
"set",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L380-L392 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByCreatedBy | public Iterable<DConnection> queryByCreatedBy(java.lang.String createdBy) {
"""
query-by method for field createdBy
@param createdBy the specified attribute
@return an Iterable of DConnections for the specified createdBy
"""
return queryByField(null, DConnectionMapper.Field.CREATEDBY.getFieldName(), crea... | java | public Iterable<DConnection> queryByCreatedBy(java.lang.String createdBy) {
return queryByField(null, DConnectionMapper.Field.CREATEDBY.getFieldName(), createdBy);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByCreatedBy",
"(",
"java",
".",
"lang",
".",
"String",
"createdBy",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"CREATEDBY",
".",
"getFieldName",
"(",
")",
... | query-by method for field createdBy
@param createdBy the specified attribute
@return an Iterable of DConnections for the specified createdBy | [
"query",
"-",
"by",
"method",
"for",
"field",
"createdBy"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L61-L63 |
Stratio/bdt | src/main/java/com/stratio/qa/utils/MongoDBUtils.java | MongoDBUtils.insertIntoMongoDBCollection | public void insertIntoMongoDBCollection(String collection, DataTable table) {
"""
Insert data in a MongoDB Collection.
@param collection
@param table
"""
// Primero pasamos la fila del datatable a un hashmap de ColumnName-Type
List<String[]> colRel = coltoArrayList(table);
// Vamos ... | java | public void insertIntoMongoDBCollection(String collection, DataTable table) {
// Primero pasamos la fila del datatable a un hashmap de ColumnName-Type
List<String[]> colRel = coltoArrayList(table);
// Vamos insertando fila a fila
for (int i = 1; i < table.raw().size(); i++) {
... | [
"public",
"void",
"insertIntoMongoDBCollection",
"(",
"String",
"collection",
",",
"DataTable",
"table",
")",
"{",
"// Primero pasamos la fila del datatable a un hashmap de ColumnName-Type",
"List",
"<",
"String",
"[",
"]",
">",
"colRel",
"=",
"coltoArrayList",
"(",
"tabl... | Insert data in a MongoDB Collection.
@param collection
@param table | [
"Insert",
"data",
"in",
"a",
"MongoDB",
"Collection",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/MongoDBUtils.java#L200-L215 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/VersionMessage.java | VersionMessage.appendToSubVer | public void appendToSubVer(String name, String version, @Nullable String comments) {
"""
<p>Appends the given user-agent information to the subVer field. The subVer is composed of a series of
name:version pairs separated by slashes in the form of a path. For example a typical subVer field for bitcoinj
users migh... | java | public void appendToSubVer(String name, String version, @Nullable String comments) {
checkSubVerComponent(name);
checkSubVerComponent(version);
if (comments != null) {
checkSubVerComponent(comments);
subVer = subVer.concat(String.format(Locale.US, "%s:%s(%s)/", name, vers... | [
"public",
"void",
"appendToSubVer",
"(",
"String",
"name",
",",
"String",
"version",
",",
"@",
"Nullable",
"String",
"comments",
")",
"{",
"checkSubVerComponent",
"(",
"name",
")",
";",
"checkSubVerComponent",
"(",
"version",
")",
";",
"if",
"(",
"comments",
... | <p>Appends the given user-agent information to the subVer field. The subVer is composed of a series of
name:version pairs separated by slashes in the form of a path. For example a typical subVer field for bitcoinj
users might look like "/bitcoinj:0.13/MultiBit:1.2/" where libraries come further to the left.</p>
<p>The... | [
"<p",
">",
"Appends",
"the",
"given",
"user",
"-",
"agent",
"information",
"to",
"the",
"subVer",
"field",
".",
"The",
"subVer",
"is",
"composed",
"of",
"a",
"series",
"of",
"name",
":",
"version",
"pairs",
"separated",
"by",
"slashes",
"in",
"the",
"for... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/VersionMessage.java#L253-L262 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSONObject.java | JSONObject.putValue | public JSONObject putValue(String key, float value) {
"""
Add a {@link JSONFloat} representing the supplied {@code float} to the
{@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerExce... | java | public JSONObject putValue(String key, float value) {
put(key, JSONFloat.valueOf(value));
return this;
} | [
"public",
"JSONObject",
"putValue",
"(",
"String",
"key",
",",
"float",
"value",
")",
"{",
"put",
"(",
"key",
",",
"JSONFloat",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link JSONFloat} representing the supplied {@code float} to the
{@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerException if key is {@code null} | [
"Add",
"a",
"{",
"@link",
"JSONFloat",
"}",
"representing",
"the",
"supplied",
"{",
"@code",
"float",
"}",
"to",
"the",
"{",
"@code",
"JSONObject",
"}",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSONObject.java#L144-L147 |
apereo/cas | support/cas-server-support-mongo-core/src/main/java/org/apereo/cas/mongo/MongoDbConnectionFactory.java | MongoDbConnectionFactory.buildMongoDbClient | public static MongoClient buildMongoDbClient(final BaseMongoDbProperties mongo) {
"""
Build mongo db client.
@param mongo the mongo
@return the mongo client
"""
if (StringUtils.isNotBlank(mongo.getClientUri())) {
LOGGER.debug("Using MongoDb client URI [{}] to connect to MongoDb instanc... | java | public static MongoClient buildMongoDbClient(final BaseMongoDbProperties mongo) {
if (StringUtils.isNotBlank(mongo.getClientUri())) {
LOGGER.debug("Using MongoDb client URI [{}] to connect to MongoDb instance", mongo.getClientUri());
return buildMongoDbClient(mongo.getClientUri(), build... | [
"public",
"static",
"MongoClient",
"buildMongoDbClient",
"(",
"final",
"BaseMongoDbProperties",
"mongo",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"mongo",
".",
"getClientUri",
"(",
")",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Using Mo... | Build mongo db client.
@param mongo the mongo
@return the mongo client | [
"Build",
"mongo",
"db",
"client",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-mongo-core/src/main/java/org/apereo/cas/mongo/MongoDbConnectionFactory.java#L276-L305 |
agmip/ace-lookup | src/main/java/org/agmip/ace/util/AcePathfinderUtil.java | AcePathfinderUtil.newRecord | public static void newRecord(HashMap m, String path) {
"""
Creates a new record in a series, such as daily
weather records, soil layers, etc. If the multi-line dataset space
is not already in the <pre>m</pre> parameter, it will be created.
@param m The {@link HashMap} to be modified.
@param path The path to ... | java | public static void newRecord(HashMap m, String path) {
if( path != null ) {
String[] paths = path.split(",");
int l = paths.length;
for(int i=0; i < l; i++) {
if( paths[i].contains("@") ) {
String temp[] = paths[i].split("[@!]");
... | [
"public",
"static",
"void",
"newRecord",
"(",
"HashMap",
"m",
",",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"paths",
"=",
"path",
".",
"split",
"(",
"\",\"",
")",
";",
"int",
"l",
"=",
"paths",
".... | Creates a new record in a series, such as daily
weather records, soil layers, etc. If the multi-line dataset space
is not already in the <pre>m</pre> parameter, it will be created.
@param m The {@link HashMap} to be modified.
@param path The path to lookup and see if a multi-line record is
supported for this field. | [
"Creates",
"a",
"new",
"record",
"in",
"a",
"series",
"such",
"as",
"daily",
"weather",
"records",
"soil",
"layers",
"etc",
".",
"If",
"the",
"multi",
"-",
"line",
"dataset",
"space",
"is",
"not",
"already",
"in",
"the",
"<pre",
">",
"m<",
"/",
"pre",
... | train | https://github.com/agmip/ace-lookup/blob/d8224a231cb8c01729e63010916a2a85517ce4c1/src/main/java/org/agmip/ace/util/AcePathfinderUtil.java#L209-L223 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java | MultiUserChatLightManager.blockUser | public void blockUser(DomainBareJid mucLightService, Jid userJid)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Block a user.
@param mucLightService
@param userJid
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedExcep... | java | public void blockUser(DomainBareJid mucLightService, Jid userJid)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
HashMap<Jid, Boolean> users = new HashMap<>();
users.put(userJid, false);
sendBlockUsers(mucLightService, users);
} | [
"public",
"void",
"blockUser",
"(",
"DomainBareJid",
"mucLightService",
",",
"Jid",
"userJid",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"HashMap",
"<",
"Jid",
",",
"Boolean",
">",
... | Block a user.
@param mucLightService
@param userJid
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException | [
"Block",
"a",
"user",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java#L296-L301 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.readDefaultFile | public CmsResource readDefaultFile(String resourceNameOrID) throws CmsException, CmsSecurityException {
"""
Returns the default resource for the given folder.<p>
If the given resource name or id identifies a file, then this file is returned.<p>
Otherwise, in case of a folder:<br>
<ol>
<li>the {@link CmsPro... | java | public CmsResource readDefaultFile(String resourceNameOrID) throws CmsException, CmsSecurityException {
return readDefaultFile(resourceNameOrID, CmsResourceFilter.DEFAULT);
} | [
"public",
"CmsResource",
"readDefaultFile",
"(",
"String",
"resourceNameOrID",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"return",
"readDefaultFile",
"(",
"resourceNameOrID",
",",
"CmsResourceFilter",
".",
"DEFAULT",
")",
";",
"}"
] | Returns the default resource for the given folder.<p>
If the given resource name or id identifies a file, then this file is returned.<p>
Otherwise, in case of a folder:<br>
<ol>
<li>the {@link CmsPropertyDefinition#PROPERTY_DEFAULT_FILE} is checked, and
<li>if still no file could be found, the configured default file... | [
"Returns",
"the",
"default",
"resource",
"for",
"the",
"given",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2409-L2412 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.addAll | public static <T> boolean addAll(List<T> self, int index, T[] items) {
"""
Modifies this list by inserting all of the elements in the specified array into the
list at the specified position. Shifts the
element currently at that position (if any) and any subsequent
elements to the right (increases their indices... | java | public static <T> boolean addAll(List<T> self, int index, T[] items) {
return self.addAll(index, Arrays.asList(items));
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"List",
"<",
"T",
">",
"self",
",",
"int",
"index",
",",
"T",
"[",
"]",
"items",
")",
"{",
"return",
"self",
".",
"addAll",
"(",
"index",
",",
"Arrays",
".",
"asList",
"(",
"items",
")"... | Modifies this list by inserting all of the elements in the specified array into the
list at the specified position. Shifts the
element currently at that position (if any) and any subsequent
elements to the right (increases their indices). The new elements
will appear in this list in the order that they occur in the a... | [
"Modifies",
"this",
"list",
"by",
"inserting",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"array",
"into",
"the",
"list",
"at",
"the",
"specified",
"position",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5160-L5162 |
knowm/Sundial | src/main/java/org/quartz/core/RAMJobStore.java | RAMJobStore.storeJob | @Override
public void storeJob(JobDetail newJob, boolean replaceExisting)
throws ObjectAlreadyExistsException {
"""
Store the given <code>{@link org.quartz.jobs.Job}</code>.
@param newJob The <code>Job</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>Job</code> existing in th... | java | @Override
public void storeJob(JobDetail newJob, boolean replaceExisting)
throws ObjectAlreadyExistsException {
JobWrapper jw = new JobWrapper((JobDetail) newJob.clone());
boolean repl = false;
synchronized (lock) {
if (jobsByKey.get(jw.key) != null) {
if (!replaceExisting) {
... | [
"@",
"Override",
"public",
"void",
"storeJob",
"(",
"JobDetail",
"newJob",
",",
"boolean",
"replaceExisting",
")",
"throws",
"ObjectAlreadyExistsException",
"{",
"JobWrapper",
"jw",
"=",
"new",
"JobWrapper",
"(",
"(",
"JobDetail",
")",
"newJob",
".",
"clone",
"(... | Store the given <code>{@link org.quartz.jobs.Job}</code>.
@param newJob The <code>Job</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>Job</code> existing in the <code>
JobStore</code> with the same name & group should be over-written.
@throws ObjectAlreadyExistsException if a <code>Job</cod... | [
"Store",
"the",
"given",
"<code",
">",
"{",
"@link",
"org",
".",
"quartz",
".",
"jobs",
".",
"Job",
"}",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/core/RAMJobStore.java#L141-L167 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/DescribeStackProvisioningParametersResult.java | DescribeStackProvisioningParametersResult.withParameters | public DescribeStackProvisioningParametersResult withParameters(java.util.Map<String, String> parameters) {
"""
<p>
An embedded object that contains the provisioning parameters.
</p>
@param parameters
An embedded object that contains the provisioning parameters.
@return Returns a reference to this object so... | java | public DescribeStackProvisioningParametersResult withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"DescribeStackProvisioningParametersResult",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
An embedded object that contains the provisioning parameters.
</p>
@param parameters
An embedded object that contains the provisioning parameters.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"An",
"embedded",
"object",
"that",
"contains",
"the",
"provisioning",
"parameters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/DescribeStackProvisioningParametersResult.java#L121-L124 |
yshrsmz/KeyboardVisibilityEvent | keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java | KeyboardVisibilityEvent.registerEventListener | public static Unregistrar registerEventListener(final Activity activity,
final KeyboardVisibilityEventListener listener) {
"""
Set keyboard visibility change event listener.
@param activity Activity
@param listener KeyboardVisibilityEventListener
@return Unr... | java | public static Unregistrar registerEventListener(final Activity activity,
final KeyboardVisibilityEventListener listener) {
if (activity == null) {
throw new NullPointerException("Parameter:activity must not be null");
}
int softIn... | [
"public",
"static",
"Unregistrar",
"registerEventListener",
"(",
"final",
"Activity",
"activity",
",",
"final",
"KeyboardVisibilityEventListener",
"listener",
")",
"{",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Pa... | Set keyboard visibility change event listener.
@param activity Activity
@param listener KeyboardVisibilityEventListener
@return Unregistrar | [
"Set",
"keyboard",
"visibility",
"change",
"event",
"listener",
"."
] | train | https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java#L47-L99 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleFastFindForEntities | protected FastFindListWrapper handleFastFindForEntities(String query, FastFindParams params) {
"""
Makes the "fast find" api call
<p>
HTTP Method: GET
@param query fast find query string
@param params optional FastFindParams .
@return a ListWrapper containing the records plus some additional information
... | java | protected FastFindListWrapper handleFastFindForEntities(String query, FastFindParams params) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForFastFind(query, params);
String url = restUrlFactory.assembleFastFindUrl(params);
String jsonString = this.performGetReque... | [
"protected",
"FastFindListWrapper",
"handleFastFindForEntities",
"(",
"String",
"query",
",",
"FastFindParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFactory",
".",
"getUriVariablesForFastFind",
"(",
"query",... | Makes the "fast find" api call
<p>
HTTP Method: GET
@param query fast find query string
@param params optional FastFindParams .
@return a ListWrapper containing the records plus some additional information | [
"Makes",
"the",
"fast",
"find",
"api",
"call",
"<p",
">",
"HTTP",
"Method",
":",
"GET"
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1104-L1112 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.writeSimpleField | private void writeSimpleField(XMLStreamWriter xmlOut, String columnName, String columnType) throws XMLStreamException {
"""
The declaration of the custom field, which must specify both the type and
the name of this field. If either the type or the name is omitted, the
field is ignored. The type can be one of the... | java | private void writeSimpleField(XMLStreamWriter xmlOut, String columnName, String columnType) throws XMLStreamException {
xmlOut.writeStartElement("SimpleField");
xmlOut.writeAttribute("name", columnName);
xmlOut.writeAttribute("type", columnType);
xmlOut.writeEndElement();//Write schema
... | [
"private",
"void",
"writeSimpleField",
"(",
"XMLStreamWriter",
"xmlOut",
",",
"String",
"columnName",
",",
"String",
"columnType",
")",
"throws",
"XMLStreamException",
"{",
"xmlOut",
".",
"writeStartElement",
"(",
"\"SimpleField\"",
")",
";",
"xmlOut",
".",
"writeAt... | The declaration of the custom field, which must specify both the type and
the name of this field. If either the type or the name is omitted, the
field is ignored. The type can be one of the following : string, int,
uint, short, ushort, float, double, bool.
Syntax :
<SimpleField type="string" name="string">
@param xm... | [
"The",
"declaration",
"of",
"the",
"custom",
"field",
"which",
"must",
"specify",
"both",
"the",
"type",
"and",
"the",
"name",
"of",
"this",
"field",
".",
"If",
"either",
"the",
"type",
"or",
"the",
"name",
"is",
"omitted",
"the",
"field",
"is",
"ignored... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L257-L262 |
ReactiveX/RxApacheHttp | src/main/java/rx/apache/http/ObservableHttp.java | ObservableHttp.createRequest | public static ObservableHttp<ObservableHttpResponse> createRequest(final HttpAsyncRequestProducer requestProducer, final HttpAsyncClient client, final HttpContext context) {
"""
Execute request using {@link HttpAsyncRequestProducer} to define HTTP Method, URI and payload (if applicable).
<p>
If the response is c... | java | public static ObservableHttp<ObservableHttpResponse> createRequest(final HttpAsyncRequestProducer requestProducer, final HttpAsyncClient client, final HttpContext context) {
return ObservableHttp.create(new OnSubscribe<ObservableHttpResponse>() {
@Override
public void call(final Subscr... | [
"public",
"static",
"ObservableHttp",
"<",
"ObservableHttpResponse",
">",
"createRequest",
"(",
"final",
"HttpAsyncRequestProducer",
"requestProducer",
",",
"final",
"HttpAsyncClient",
"client",
",",
"final",
"HttpContext",
"context",
")",
"{",
"return",
"ObservableHttp",... | Execute request using {@link HttpAsyncRequestProducer} to define HTTP Method, URI and payload (if applicable).
<p>
If the response is chunked (or flushed progressively such as with <i>text/event-stream</i> <a href="http://www.w3.org/TR/2009/WD-eventsource-20091029/">Server-Sent Events</a>) this will call
{@link Observe... | [
"Execute",
"request",
"using",
"{",
"@link",
"HttpAsyncRequestProducer",
"}",
"to",
"define",
"HTTP",
"Method",
"URI",
"and",
"payload",
"(",
"if",
"applicable",
")",
".",
"<p",
">",
"If",
"the",
"response",
"is",
"chunked",
"(",
"or",
"flushed",
"progressiv... | train | https://github.com/ReactiveX/RxApacheHttp/blob/7494169cdc1199f11ca9744f18c28e6fcb694a6e/src/main/java/rx/apache/http/ObservableHttp.java#L174-L206 |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ReflectUtils.java | ReflectUtils.setValue | public static void setValue(Field field, Object self, Object value) {
"""
Sets the specified value into the specified field while wrapping checked exception in a {@link
ShedException}.
@param field the field.
@param self the instance to set the field on.
@param value the value to set.
"""
try {
... | java | public static void setValue(Field field, Object self, Object value) {
try {
field.set(self, value);
} catch (IllegalAccessException e) {
throw ShedException.wrap(e, ShedErrorCode.UNABLE_TO_SET_FIELD)
.put("field", field.toGenericString());
}
} | [
"public",
"static",
"void",
"setValue",
"(",
"Field",
"field",
",",
"Object",
"self",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"field",
".",
"set",
"(",
"self",
",",
"value",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
... | Sets the specified value into the specified field while wrapping checked exception in a {@link
ShedException}.
@param field the field.
@param self the instance to set the field on.
@param value the value to set. | [
"Sets",
"the",
"specified",
"value",
"into",
"the",
"specified",
"field",
"while",
"wrapping",
"checked",
"exception",
"in",
"a",
"{",
"@link",
"ShedException",
"}",
"."
] | train | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ReflectUtils.java#L68-L75 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/core/ws/CallServiceManager.java | CallServiceManager.sendMessageToClient | @Override
public boolean sendMessageToClient(MessageFromClient message, Session client) {
"""
Build and send response messages after call request
@param message
@param client
@return
"""
MessageToClient mtc = messageToClientService.createMessageToClient(message, client);
if (mtc != null) {
cli... | java | @Override
public boolean sendMessageToClient(MessageFromClient message, Session client) {
MessageToClient mtc = messageToClientService.createMessageToClient(message, client);
if (mtc != null) {
client.getAsyncRemote().sendObject(mtc);
return true;
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"sendMessageToClient",
"(",
"MessageFromClient",
"message",
",",
"Session",
"client",
")",
"{",
"MessageToClient",
"mtc",
"=",
"messageToClientService",
".",
"createMessageToClient",
"(",
"message",
",",
"client",
")",
";",
"if"... | Build and send response messages after call request
@param message
@param client
@return | [
"Build",
"and",
"send",
"response",
"messages",
"after",
"call",
"request"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/core/ws/CallServiceManager.java#L30-L38 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java | FastaWriterHelper.writeSequence | public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception {
"""
Write a sequence to OutputStream
@param outputStream
@param sequence
@throws Exception
"""
writeSequences(outputStream, singleSeqToCollection(sequence));
} | java | public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception {
writeSequences(outputStream, singleSeqToCollection(sequence));
} | [
"public",
"static",
"void",
"writeSequence",
"(",
"OutputStream",
"outputStream",
",",
"Sequence",
"<",
"?",
">",
"sequence",
")",
"throws",
"Exception",
"{",
"writeSequences",
"(",
"outputStream",
",",
"singleSeqToCollection",
"(",
"sequence",
")",
")",
";",
"}... | Write a sequence to OutputStream
@param outputStream
@param sequence
@throws Exception | [
"Write",
"a",
"sequence",
"to",
"OutputStream"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java#L162-L164 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.countByCPD_T | @Override
public int countByCPD_T(long CPDefinitionId, String type) {
"""
Returns the number of cp definition links where CPDefinitionId = ? and type = ?.
@param CPDefinitionId the cp definition ID
@param type the type
@return the number of matching cp definition links
"""
FinderPath finderPath... | java | @Override
public int countByCPD_T(long CPDefinitionId, String type) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_CPD_T;
Object[] finderArgs = new Object[] { CPDefinitionId, type };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new Str... | [
"@",
"Override",
"public",
"int",
"countByCPD_T",
"(",
"long",
"CPDefinitionId",
",",
"String",
"type",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_CPD_T",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"CPDefi... | Returns the number of cp definition links where CPDefinitionId = ? and type = ?.
@param CPDefinitionId the cp definition ID
@param type the type
@return the number of matching cp definition links | [
"Returns",
"the",
"number",
"of",
"cp",
"definition",
"links",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3037-L3098 |
nominanuda/zen-project | zen-webservice/src/main/java/com/nominanuda/hyperapi/HttpClientHyperApiFactory.java | HttpClientHyperApiFactory.getInstance | public <T> T getInstance(String instanceHint, Class<? extends T> apiInterface, T apiImpl) {
"""
This one allows to spring-configure both remote prefix and local implementation of apiInterface:
if remote url is blank then local implementation will be used.
@param instanceHint
@param apiImpl
@param apiInterface
... | java | public <T> T getInstance(String instanceHint, Class<? extends T> apiInterface, T apiImpl) {
return STR.notNullOrBlank(instanceHint) ? getInstance(instanceHint, apiInterface) : allowExceptions ? apiImpl : getInstance(apiImpl, apiInterface);
} | [
"public",
"<",
"T",
">",
"T",
"getInstance",
"(",
"String",
"instanceHint",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"apiInterface",
",",
"T",
"apiImpl",
")",
"{",
"return",
"STR",
".",
"notNullOrBlank",
"(",
"instanceHint",
")",
"?",
"getInstance",
... | This one allows to spring-configure both remote prefix and local implementation of apiInterface:
if remote url is blank then local implementation will be used.
@param instanceHint
@param apiImpl
@param apiInterface
@return | [
"This",
"one",
"allows",
"to",
"spring",
"-",
"configure",
"both",
"remote",
"prefix",
"and",
"local",
"implementation",
"of",
"apiInterface",
":",
"if",
"remote",
"url",
"is",
"blank",
"then",
"local",
"implementation",
"will",
"be",
"used",
"."
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-webservice/src/main/java/com/nominanuda/hyperapi/HttpClientHyperApiFactory.java#L46-L48 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/DOMProcessing.java | DOMProcessing.stringToQualifiedName | final public QualifiedName stringToQualifiedName(String str, org.w3c.dom.Element el) {
"""
Converts a string to a QualifiedName, extracting namespace from the DOM. Ensures that the generated qualified name is
properly escaped, according to PROV-N syntax.
@param str
string to convert to QualifiedName
@param ... | java | final public QualifiedName stringToQualifiedName(String str, org.w3c.dom.Element el) {
if (str == null)
return null;
int index = str.indexOf(':');
if (index == -1) {
QualifiedName qn = pFactory.newQualifiedName(el.lookupNamespaceURI(null), // find default namespace
... | [
"final",
"public",
"QualifiedName",
"stringToQualifiedName",
"(",
"String",
"str",
",",
"org",
".",
"w3c",
".",
"dom",
".",
"Element",
"el",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"null",
";",
"int",
"index",
"=",
"str",
".",
"indexOf... | Converts a string to a QualifiedName, extracting namespace from the DOM. Ensures that the generated qualified name is
properly escaped, according to PROV-N syntax.
@param str
string to convert to QualifiedName
@param el
current Element in which this string was found (as attribute
or attribute value)
@return a qualifi... | [
"Converts",
"a",
"string",
"to",
"a",
"QualifiedName",
"extracting",
"namespace",
"from",
"the",
"DOM",
".",
"Ensures",
"that",
"the",
"generated",
"qualified",
"name",
"is",
"properly",
"escaped",
"according",
"to",
"PROV",
"-",
"N",
"syntax",
"."
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/DOMProcessing.java#L87-L103 |
kiuwan/java-api-client | src/main/java/com/kiuwan/client/KiuwanRestApiClient.java | KiuwanRestApiClient.initializeConnection | private void initializeConnection(String user, String password, String restApiBaseUrl) {
"""
Initializes the connection.
@param user The user name in Kiuwan.
@param password The password in Kiuwan.
@param restApiBaseUrl Base URL for REST-API.
"""
csrfToken = null;
cookies = new HashMap<String, Cookie>()... | java | private void initializeConnection(String user, String password, String restApiBaseUrl) {
csrfToken = null;
cookies = new HashMap<String, Cookie>();
connection = ClientHelper.createClient().register(HttpAuthenticationFeature.basic(user, password)).target(restApiBaseUrl);
} | [
"private",
"void",
"initializeConnection",
"(",
"String",
"user",
",",
"String",
"password",
",",
"String",
"restApiBaseUrl",
")",
"{",
"csrfToken",
"=",
"null",
";",
"cookies",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Cookie",
">",
"(",
")",
";",
"conn... | Initializes the connection.
@param user The user name in Kiuwan.
@param password The password in Kiuwan.
@param restApiBaseUrl Base URL for REST-API. | [
"Initializes",
"the",
"connection",
"."
] | train | https://github.com/kiuwan/java-api-client/blob/5cda6a6ed9f37a03f9418a1846d349f6d59e14f7/src/main/java/com/kiuwan/client/KiuwanRestApiClient.java#L1085-L1090 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/DomUtils.java | DomUtils.setEnabled | public static void setEnabled(Element element, boolean enabled) {
"""
It's enough to just set the disabled attribute on the
element, but we want to also add a "disabled" class so that we can
style it.
At some point we'll just be able to use .button:disabled,
but that doesn't work in IE8-
"""
elem... | java | public static void setEnabled(Element element, boolean enabled) {
element.setPropertyBoolean("disabled", !enabled);
setStyleName(element, "disabled", !enabled);
} | [
"public",
"static",
"void",
"setEnabled",
"(",
"Element",
"element",
",",
"boolean",
"enabled",
")",
"{",
"element",
".",
"setPropertyBoolean",
"(",
"\"disabled\"",
",",
"!",
"enabled",
")",
";",
"setStyleName",
"(",
"element",
",",
"\"disabled\"",
",",
"!",
... | It's enough to just set the disabled attribute on the
element, but we want to also add a "disabled" class so that we can
style it.
At some point we'll just be able to use .button:disabled,
but that doesn't work in IE8- | [
"It",
"s",
"enough",
"to",
"just",
"set",
"the",
"disabled",
"attribute",
"on",
"the",
"element",
"but",
"we",
"want",
"to",
"also",
"add",
"a",
"disabled",
"class",
"so",
"that",
"we",
"can",
"style",
"it",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/DomUtils.java#L45-L48 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.setGroupName | public void setGroupName(String name, int id) {
"""
Set the group name
@param name new name of server group
@param id ID of group
"""
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
... | java | public void setGroupName(String name, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVER_GROUPS +
" SET " + Constant... | [
"public",
"void",
"setGroupName",
"(",
"String",
"name",
",",
"int",
"id",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"statement",
"=",... | Set the group name
@param name new name of server group
@param id ID of group | [
"Set",
"the",
"group",
"name"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L413-L436 |
authlete/authlete-java-common | src/main/java/com/authlete/common/api/AuthleteApiImpl.java | AuthleteApiImpl.createBaseUrl | private static String createBaseUrl(AuthleteConfiguration configuration) {
"""
Get 'Base URL' from the configuration. If the base URL ends with '/',
it is dropped.
"""
String baseUrl = configuration.getBaseUrl();
// If the configuration does not contain a base URL.
if (baseUrl == null... | java | private static String createBaseUrl(AuthleteConfiguration configuration)
{
String baseUrl = configuration.getBaseUrl();
// If the configuration does not contain a base URL.
if (baseUrl == null)
{
throw new IllegalArgumentException("The configuration does not have informa... | [
"private",
"static",
"String",
"createBaseUrl",
"(",
"AuthleteConfiguration",
"configuration",
")",
"{",
"String",
"baseUrl",
"=",
"configuration",
".",
"getBaseUrl",
"(",
")",
";",
"// If the configuration does not contain a base URL.",
"if",
"(",
"baseUrl",
"==",
"nul... | Get 'Base URL' from the configuration. If the base URL ends with '/',
it is dropped. | [
"Get",
"Base",
"URL",
"from",
"the",
"configuration",
".",
"If",
"the",
"base",
"URL",
"ends",
"with",
"/",
"it",
"is",
"dropped",
"."
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/api/AuthleteApiImpl.java#L215-L246 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.trStyle | public static String trStyle(String style, String... content) {
"""
Build a HTML TableRow with given CSS style attributes for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for tr element
@param c... | java | public static String trStyle(String style, String... content) {
return tagStyle(Html.Tag.TR, style, content);
} | [
"public",
"static",
"String",
"trStyle",
"(",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagStyle",
"(",
"Html",
".",
"Tag",
".",
"TR",
",",
"style",
",",
"content",
")",
";",
"}"
] | Build a HTML TableRow with given CSS style attributes for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for tr element
@param content content string
@return HTML tr element as string | [
"Build",
"a",
"HTML",
"TableRow",
"with",
"given",
"CSS",
"style",
"attributes",
"for",
"a",
"string",
".",
"Given",
"content",
"does",
"<b",
">",
"not<",
"/",
"b",
">",
"consists",
"of",
"HTML",
"snippets",
"and",
"as",
"such",
"is",
"being",
"prepared"... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L153-L155 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.copyParagraphAnnotations | public static void copyParagraphAnnotations(JCas source, JCas target)
throws IllegalArgumentException {
"""
Creates paragraph annotations in {@code target} by copying paragraphs from the {@code source}.
@param source source jcas
@param target target jcas
@throws IllegalArgumentException if source ... | java | public static void copyParagraphAnnotations(JCas source, JCas target)
throws IllegalArgumentException
{
if (!source.getDocumentText().equals(target.getDocumentText())) {
throw new IllegalArgumentException(
"source.documentText and target.documentText are not equal... | [
"public",
"static",
"void",
"copyParagraphAnnotations",
"(",
"JCas",
"source",
",",
"JCas",
"target",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"source",
".",
"getDocumentText",
"(",
")",
".",
"equals",
"(",
"target",
".",
"getDocumentText"... | Creates paragraph annotations in {@code target} by copying paragraphs from the {@code source}.
@param source source jcas
@param target target jcas
@throws IllegalArgumentException if source text and target text are different or if target
already contains paragraph annotations | [
"Creates",
"paragraph",
"annotations",
"in",
"{",
"@code",
"target",
"}",
"by",
"copying",
"paragraphs",
"from",
"the",
"{",
"@code",
"source",
"}",
"."
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L528-L547 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java | NameSpaceSliceStorage.setFields | @Override
protected void setFields(Properties props, StorageDirectory sd)
throws IOException {
"""
Set layoutVersion, namespaceID and blockpoolID into namespace storage
VERSION file
"""
props.setProperty(NAMESPACE_ID, String.valueOf(namespaceID));
props.setProperty(CHECK_TIME, String.valueOf(c... | java | @Override
protected void setFields(Properties props, StorageDirectory sd)
throws IOException {
props.setProperty(NAMESPACE_ID, String.valueOf(namespaceID));
props.setProperty(CHECK_TIME, String.valueOf(cTime));
props.setProperty(LAYOUT_VERSION, String.valueOf(layoutVersion));
} | [
"@",
"Override",
"protected",
"void",
"setFields",
"(",
"Properties",
"props",
",",
"StorageDirectory",
"sd",
")",
"throws",
"IOException",
"{",
"props",
".",
"setProperty",
"(",
"NAMESPACE_ID",
",",
"String",
".",
"valueOf",
"(",
"namespaceID",
")",
")",
";",... | Set layoutVersion, namespaceID and blockpoolID into namespace storage
VERSION file | [
"Set",
"layoutVersion",
"namespaceID",
"and",
"blockpoolID",
"into",
"namespace",
"storage",
"VERSION",
"file"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java#L191-L197 |
alkacon/opencms-core | src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java | CmsSiteManager.openEditDialog | public void openEditDialog(String siteRoot) {
"""
Opens the edit site dialog.<p>
@param siteRoot the site root of the site to edit, if <code>null</code>
"""
CmsEditSiteForm form;
String caption;
if (siteRoot != null) {
form = new CmsEditSiteForm(m_rootCms, this, siteRoot... | java | public void openEditDialog(String siteRoot) {
CmsEditSiteForm form;
String caption;
if (siteRoot != null) {
form = new CmsEditSiteForm(m_rootCms, this, siteRoot);
caption = CmsVaadinUtils.getMessageText(
Messages.GUI_SITE_CONFIGURATION_EDIT_1,
... | [
"public",
"void",
"openEditDialog",
"(",
"String",
"siteRoot",
")",
"{",
"CmsEditSiteForm",
"form",
";",
"String",
"caption",
";",
"if",
"(",
"siteRoot",
"!=",
"null",
")",
"{",
"form",
"=",
"new",
"CmsEditSiteForm",
"(",
"m_rootCms",
",",
"this",
",",
"si... | Opens the edit site dialog.<p>
@param siteRoot the site root of the site to edit, if <code>null</code> | [
"Opens",
"the",
"edit",
"site",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java#L303-L317 |
apache/incubator-druid | server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java | LookupReferencesManager.getLookupListFromCoordinator | @Nullable
private List<LookupBean> getLookupListFromCoordinator(String tier) {
"""
Returns a list of lookups from the coordinator if the coordinator is available. If it's not available, returns null.
@param tier lookup tier name
@return list of LookupBean objects, or null
"""
try {
MutableBoo... | java | @Nullable
private List<LookupBean> getLookupListFromCoordinator(String tier)
{
try {
MutableBoolean firstAttempt = new MutableBoolean(true);
Map<String, LookupExtractorFactoryContainer> lookupMap = RetryUtils.retry(
() -> {
if (firstAttempt.isTrue()) {
firstAttemp... | [
"@",
"Nullable",
"private",
"List",
"<",
"LookupBean",
">",
"getLookupListFromCoordinator",
"(",
"String",
"tier",
")",
"{",
"try",
"{",
"MutableBoolean",
"firstAttempt",
"=",
"new",
"MutableBoolean",
"(",
"true",
")",
";",
"Map",
"<",
"String",
",",
"LookupEx... | Returns a list of lookups from the coordinator if the coordinator is available. If it's not available, returns null.
@param tier lookup tier name
@return list of LookupBean objects, or null | [
"Returns",
"a",
"list",
"of",
"lookups",
"from",
"the",
"coordinator",
"if",
"the",
"coordinator",
"is",
"available",
".",
"If",
"it",
"s",
"not",
"available",
"returns",
"null",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java#L385-L417 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/ImportPdf.java | ImportPdf.createImage | @Override
protected com.itextpdf.text.Image createImage(PdfContentByte canvas, Object data, float opacity) throws VectorPrintException, BadElementException {
"""
calls {@link #processImage(com.itextpdf.text.Image) } on pages imported from the pdf in the URL, always returns null, because each page from a pdf is ... | java | @Override
protected com.itextpdf.text.Image createImage(PdfContentByte canvas, Object data, float opacity) throws VectorPrintException, BadElementException {
if (getImageBeingProcessed()!=null) {
return getImageBeingProcessed();
}
this.data = data;
boolean doFooter = getSettings().ge... | [
"@",
"Override",
"protected",
"com",
".",
"itextpdf",
".",
"text",
".",
"Image",
"createImage",
"(",
"PdfContentByte",
"canvas",
",",
"Object",
"data",
",",
"float",
"opacity",
")",
"throws",
"VectorPrintException",
",",
"BadElementException",
"{",
"if",
"(",
... | calls {@link #processImage(com.itextpdf.text.Image) } on pages imported from the pdf in the URL, always returns null, because each page from a pdf is imported as an image.
@param canvas
@param data
@param opacity the value of opacity
@throws VectorPrintException
@throws BadElementException
@return the com.itextpdf.text... | [
"calls",
"{"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/ImportPdf.java#L88-L132 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.appendUtf8String | public static File appendUtf8String(String content, File file) throws IORuntimeException {
"""
将String写入文件,UTF-8编码追加模式
@param content 写入的内容
@param file 文件
@return 写入的文件
@throws IORuntimeException IO异常
@since 3.1.2
"""
return appendString(content, file, CharsetUtil.CHARSET_UTF_8);
} | java | public static File appendUtf8String(String content, File file) throws IORuntimeException {
return appendString(content, file, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"File",
"appendUtf8String",
"(",
"String",
"content",
",",
"File",
"file",
")",
"throws",
"IORuntimeException",
"{",
"return",
"appendString",
"(",
"content",
",",
"file",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 将String写入文件,UTF-8编码追加模式
@param content 写入的内容
@param file 文件
@return 写入的文件
@throws IORuntimeException IO异常
@since 3.1.2 | [
"将String写入文件,UTF",
"-",
"8编码追加模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2813-L2815 |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.writeStringToFile | public static void writeStringToFile(File file, String data, String charset) throws IOException {
"""
Writes a String to a file creating the file if it does not exist.
@param file the file to write
@param data the content to write to the file
@param charset the encoding to use, {@code null} means platform def... | java | public static void writeStringToFile(File file, String data, String charset) throws IOException {
FileOutputStream fos = openOutputStream(file, false);
fos.write(data.getBytes(charset));
fos.close();
} | [
"public",
"static",
"void",
"writeStringToFile",
"(",
"File",
"file",
",",
"String",
"data",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"fos",
"=",
"openOutputStream",
"(",
"file",
",",
"false",
")",
";",
"fos",
".",
"wr... | Writes a String to a file creating the file if it does not exist.
@param file the file to write
@param data the content to write to the file
@param charset the encoding to use, {@code null} means platform default
@throws IOException in case of an I/O error | [
"Writes",
"a",
"String",
"to",
"a",
"file",
"creating",
"the",
"file",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L305-L309 |
revapi/revapi | revapi/src/main/java/org/revapi/Revapi.java | Revapi.analyze | @SuppressWarnings("unchecked")
public AnalysisResult analyze(@Nonnull AnalysisContext analysisContext) {
"""
Performs the analysis configured by the given analysis context.
<p>
Make sure to call the {@link AnalysisResult#close()} method (or perform the analysis in try-with-resources
block).
@param analys... | java | @SuppressWarnings("unchecked")
public AnalysisResult analyze(@Nonnull AnalysisContext analysisContext) {
TIMING_LOG.debug("Analysis starts");
AnalysisResult.Extensions extensions = prepareAnalysis(analysisContext);
if (extensions.getAnalyzers().isEmpty()) {
throw new IllegalArg... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"AnalysisResult",
"analyze",
"(",
"@",
"Nonnull",
"AnalysisContext",
"analysisContext",
")",
"{",
"TIMING_LOG",
".",
"debug",
"(",
"\"Analysis starts\"",
")",
";",
"AnalysisResult",
".",
"Extensions",
"ex... | Performs the analysis configured by the given analysis context.
<p>
Make sure to call the {@link AnalysisResult#close()} method (or perform the analysis in try-with-resources
block).
@param analysisContext describes the analysis to be performed
@return a result object that has to be closed for the analysis to conclude | [
"Performs",
"the",
"analysis",
"configured",
"by",
"the",
"given",
"analysis",
"context",
".",
"<p",
">",
"Make",
"sure",
"to",
"call",
"the",
"{",
"@link",
"AnalysisResult#close",
"()",
"}",
"method",
"(",
"or",
"perform",
"the",
"analysis",
"in",
"try",
... | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi/src/main/java/org/revapi/Revapi.java#L138-L169 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java | MongoDS.initCloud | synchronized public void initCloud() {
"""
初始化集群<br>
集群的其它客户端设定参数使用全局设定<br>
集群中每一个实例成员用一个group表示,例如:
<pre>
user = test1
pass = 123456
database = test
[db0]
host = 192.168.1.1:27117
[db1]
host = 192.168.1.1:27118
[db2]
host = 192.168.1.1:27119
</pre>
"""
if (groups == null || groups.length == ... | java | synchronized public void initCloud() {
if (groups == null || groups.length == 0) {
throw new DbRuntimeException("Please give replication set groups!");
}
if (setting == null) {
// 若未指定配置文件,则使用默认配置文件
setting = new Setting(MONGO_CONFIG_PATH, true);
}
final List<ServerAddress> addrList = new... | [
"synchronized",
"public",
"void",
"initCloud",
"(",
")",
"{",
"if",
"(",
"groups",
"==",
"null",
"||",
"groups",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"DbRuntimeException",
"(",
"\"Please give replication set groups!\"",
")",
";",
"}",
"if",
"(... | 初始化集群<br>
集群的其它客户端设定参数使用全局设定<br>
集群中每一个实例成员用一个group表示,例如:
<pre>
user = test1
pass = 123456
database = test
[db0]
host = 192.168.1.1:27117
[db1]
host = 192.168.1.1:27118
[db2]
host = 192.168.1.1:27119
</pre> | [
"初始化集群<br",
">",
"集群的其它客户端设定参数使用全局设定<br",
">",
"集群中每一个实例成员用一个group表示,例如:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java#L181-L209 |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseProperties | private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException {
"""
Delivers the correct JSON Object for properties
@param properties
@throws org.json.JSONException
"""
if (properties != null) {
JSONObject propertiesObject = new JSONObject();
... | java | private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException {
if (properties != null) {
JSONObject propertiesObject = new JSONObject();
for (String key : properties.keySet()) {
String propertyValue = properties.get(key);
... | [
"private",
"static",
"JSONObject",
"parseProperties",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"properties",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"JSONObject",
"propertiesObject",
"=",
"new",
"JSONObject... | Delivers the correct JSON Object for properties
@param properties
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"properties"
] | train | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L190-L222 |
CloudSlang/cs-actions | cs-amazon/src/main/java/io/cloudslang/content/amazon/services/helpers/AwsSignatureHelper.java | AwsSignatureHelper.getSignedHeadersString | public String getSignedHeadersString(Map<String, String> headers) {
"""
Creates a comma separated list of headers.
@param headers Headers to be signed.
@return Comma separated list of headers to be signed.
"""
List<String> sortedList = new ArrayList<>(headers.keySet());
Collections.sort(sor... | java | public String getSignedHeadersString(Map<String, String> headers) {
List<String> sortedList = new ArrayList<>(headers.keySet());
Collections.sort(sortedList, String.CASE_INSENSITIVE_ORDER);
StringBuilder signedHeaderString = new StringBuilder();
for (String header : sortedList) {
... | [
"public",
"String",
"getSignedHeadersString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"List",
"<",
"String",
">",
"sortedList",
"=",
"new",
"ArrayList",
"<>",
"(",
"headers",
".",
"keySet",
"(",
")",
")",
";",
"Collections",
"... | Creates a comma separated list of headers.
@param headers Headers to be signed.
@return Comma separated list of headers to be signed. | [
"Creates",
"a",
"comma",
"separated",
"list",
"of",
"headers",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-amazon/src/main/java/io/cloudslang/content/amazon/services/helpers/AwsSignatureHelper.java#L111-L123 |
borball/weixin-sdk | weixin-mp/src/main/java/com/riversoft/weixin/mp/media/Materials.java | Materials.addVoice | public Material addVoice(InputStream inputStream, String fileName) {
"""
上传voice
@param inputStream voice
@param fileName 文件名
@return 上传结果
"""
return upload(MediaType.voice, inputStream, fileName);
} | java | public Material addVoice(InputStream inputStream, String fileName) {
return upload(MediaType.voice, inputStream, fileName);
} | [
"public",
"Material",
"addVoice",
"(",
"InputStream",
"inputStream",
",",
"String",
"fileName",
")",
"{",
"return",
"upload",
"(",
"MediaType",
".",
"voice",
",",
"inputStream",
",",
"fileName",
")",
";",
"}"
] | 上传voice
@param inputStream voice
@param fileName 文件名
@return 上传结果 | [
"上传voice"
] | train | https://github.com/borball/weixin-sdk/blob/32bf5e45cdd8d0d28074e83954e1ec62dcf25cb7/weixin-mp/src/main/java/com/riversoft/weixin/mp/media/Materials.java#L133-L135 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readResources | public List<CmsResource> readResources(
CmsRequestContext context,
CmsResource parent,
CmsResourceFilter filter,
boolean readTree)
throws CmsException, CmsSecurityException {
"""
Reads all resources below the given path matching the filter criteria,
including the full tree belo... | java | public List<CmsResource> readResources(
CmsRequestContext context,
CmsResource parent,
CmsResourceFilter filter,
boolean readTree)
throws CmsException, CmsSecurityException {
List<CmsResource> result = null;
CmsDbContext dbc = m_dbContextFactory.getDbContext(context)... | [
"public",
"List",
"<",
"CmsResource",
">",
"readResources",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"parent",
",",
"CmsResourceFilter",
"filter",
",",
"boolean",
"readTree",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"List",
"<... | Reads all resources below the given path matching the filter criteria,
including the full tree below the path only in case the <code>readTree</code>
parameter is <code>true</code>.<p>
@param context the current request context
@param parent the parent path to read the resources from
@param filter the filter
@param rea... | [
"Reads",
"all",
"resources",
"below",
"the",
"given",
"path",
"matching",
"the",
"filter",
"criteria",
"including",
"the",
"full",
"tree",
"below",
"the",
"path",
"only",
"in",
"case",
"the",
"<code",
">",
"readTree<",
"/",
"code",
">",
"parameter",
"is",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5096-L5118 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java | LocaleUtils.getLocalizedBundleName | public static String getLocalizedBundleName(String bundleName, String localeKey) {
"""
Returns the localized bundle name
@param bundleName
the bundle name
@param localeKey
the locale key
@return the localized bundle name
"""
String newName = bundleName;
int idxSeparator = bundleName.lastIndexOf('.'... | java | public static String getLocalizedBundleName(String bundleName, String localeKey) {
String newName = bundleName;
int idxSeparator = bundleName.lastIndexOf('.');
if (StringUtils.isNotEmpty(localeKey) && idxSeparator != -1) {
newName = bundleName.substring(0, idxSeparator);
newName += '_' + localeKey;
newN... | [
"public",
"static",
"String",
"getLocalizedBundleName",
"(",
"String",
"bundleName",
",",
"String",
"localeKey",
")",
"{",
"String",
"newName",
"=",
"bundleName",
";",
"int",
"idxSeparator",
"=",
"bundleName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",... | Returns the localized bundle name
@param bundleName
the bundle name
@param localeKey
the locale key
@return the localized bundle name | [
"Returns",
"the",
"localized",
"bundle",
"name"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java#L74-L85 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitTracker.java | InputSplitTracker.unregisterJob | void unregisterJob(final ExecutionGraph eg) {
"""
Unregisters a job from the input split tracker.
@param eg
the execution graph of the job to be unregistered
"""
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, true);
while (it.hasNext()) {
this.splitMap.remove(it.next().getID())... | java | void unregisterJob(final ExecutionGraph eg) {
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, true);
while (it.hasNext()) {
this.splitMap.remove(it.next().getID());
}
} | [
"void",
"unregisterJob",
"(",
"final",
"ExecutionGraph",
"eg",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionVertex",
">",
"it",
"=",
"new",
"ExecutionGraphIterator",
"(",
"eg",
",",
"true",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{... | Unregisters a job from the input split tracker.
@param eg
the execution graph of the job to be unregistered | [
"Unregisters",
"a",
"job",
"from",
"the",
"input",
"split",
"tracker",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitTracker.java#L96-L102 |
Jasig/uPortal | uPortal-groups/uPortal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/PagsService.java | PagsService.deletePagsDefinition | public void deletePagsDefinition(IPerson person, IPersonAttributesGroupDefinition pagsDef) {
"""
NOTE -- This method assumes that pagsDef is an existing JPA-managed entity.
"""
// Verify permission
if (!hasPermission(
person,
IPermission.DELETE_GROUP_ACTIVITY,
... | java | public void deletePagsDefinition(IPerson person, IPersonAttributesGroupDefinition pagsDef) {
// Verify permission
if (!hasPermission(
person,
IPermission.DELETE_GROUP_ACTIVITY,
pagsDef.getCompositeEntityIdentifierForGroup().getKey())) {
throw ... | [
"public",
"void",
"deletePagsDefinition",
"(",
"IPerson",
"person",
",",
"IPersonAttributesGroupDefinition",
"pagsDef",
")",
"{",
"// Verify permission",
"if",
"(",
"!",
"hasPermission",
"(",
"person",
",",
"IPermission",
".",
"DELETE_GROUP_ACTIVITY",
",",
"pagsDef",
... | NOTE -- This method assumes that pagsDef is an existing JPA-managed entity. | [
"NOTE",
"--",
"This",
"method",
"assumes",
"that",
"pagsDef",
"is",
"an",
"existing",
"JPA",
"-",
"managed",
"entity",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/PagsService.java#L211-L225 |
bmwcarit/joynr | java/jeeintegration/src/main/java/io/joynr/jeeintegration/messaging/JeeMessagingEndpoint.java | JeeMessagingEndpoint.postMessageWithoutContentType | @POST
@Consumes( {
"""
Receives a message for the given channel ID, parses the binary content as SMRF, and forwards to
{@link #postMessage(String, byte[], UriInfo)}.
@param ccid
the channel id.
@param serializedMessage
a serialized SMRF message to be send.
@param uriInfo
the URI Information for the re... | java | @POST
@Consumes({ MediaType.APPLICATION_OCTET_STREAM })
@Path("/{ccid: [A-Z,a-z,0-9,_,\\-,\\.]+}/messageWithoutContentType")
public Response postMessageWithoutContentType(@PathParam("ccid") String ccid,
byte[] serializedMessage,
... | [
"@",
"POST",
"@",
"Consumes",
"(",
"{",
"MediaType",
".",
"APPLICATION_OCTET_STREAM",
"}",
")",
"@",
"Path",
"(",
"\"/{ccid: [A-Z,a-z,0-9,_,\\\\-,\\\\.]+}/messageWithoutContentType\"",
")",
"public",
"Response",
"postMessageWithoutContentType",
"(",
"@",
"PathParam",
"(",... | Receives a message for the given channel ID, parses the binary content as SMRF, and forwards to
{@link #postMessage(String, byte[], UriInfo)}.
@param ccid
the channel id.
@param serializedMessage
a serialized SMRF message to be send.
@param uriInfo
the URI Information for the request being processed.
@return Response ... | [
"Receives",
"a",
"message",
"for",
"the",
"given",
"channel",
"ID",
"parses",
"the",
"binary",
"content",
"as",
"SMRF",
"and",
"forwards",
"to",
"{",
"@link",
"#postMessage",
"(",
"String",
"byte",
"[]",
"UriInfo",
")",
"}",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/jeeintegration/src/main/java/io/joynr/jeeintegration/messaging/JeeMessagingEndpoint.java#L98-L105 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/WikipediaInfo.java | WikipediaInfo.getOverlapping | public void getOverlapping(Wikipedia pWiki, CategoryGraph catGraph) throws WikiApiException {
"""
Articles in wikipedia may be tagged with multiple categories.
It may be interesting to know how many articles have at least one category in common.
Such articles would have a very high semantic relatedness even if t... | java | public void getOverlapping(Wikipedia pWiki, CategoryGraph catGraph) throws WikiApiException {
double startTime = System.currentTimeMillis();
int articlesWithOverlappingCategories = getArticlesWithOverlappingCategories(pWiki, catGraph);
double overlappingCategoriesRatio = (double) articlesWithOv... | [
"public",
"void",
"getOverlapping",
"(",
"Wikipedia",
"pWiki",
",",
"CategoryGraph",
"catGraph",
")",
"throws",
"WikiApiException",
"{",
"double",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"int",
"articlesWithOverlappingCategories",
"=",
"... | Articles in wikipedia may be tagged with multiple categories.
It may be interesting to know how many articles have at least one category in common.
Such articles would have a very high semantic relatedness even if they share a quite secondary category.
@param pWiki The wikipedia object.
@param catGraph The category gra... | [
"Articles",
"in",
"wikipedia",
"may",
"be",
"tagged",
"with",
"multiple",
"categories",
".",
"It",
"may",
"be",
"interesting",
"to",
"know",
"how",
"many",
"articles",
"have",
"at",
"least",
"one",
"category",
"in",
"common",
".",
"Such",
"articles",
"would"... | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/WikipediaInfo.java#L195-L204 |
motown-io/motown | ocpp/view-model/src/main/java/io/motown/ocpp/viewmodel/domain/DomainService.java | DomainService.changeConfiguration | public void changeConfiguration(ChargingStationId chargingStationId, ConfigurationItem configurationItem, CorrelationToken correlationToken, AddOnIdentity addOnIdentity) {
"""
Change the configuration in the charging station. It has already happened on the physical charging station, but
the Domain has not been up... | java | public void changeConfiguration(ChargingStationId chargingStationId, ConfigurationItem configurationItem, CorrelationToken correlationToken, AddOnIdentity addOnIdentity) {
IdentityContext identityContext = new IdentityContext(addOnIdentity, new NullUserIdentity());
commandGateway.send(new ChangeConfigu... | [
"public",
"void",
"changeConfiguration",
"(",
"ChargingStationId",
"chargingStationId",
",",
"ConfigurationItem",
"configurationItem",
",",
"CorrelationToken",
"correlationToken",
",",
"AddOnIdentity",
"addOnIdentity",
")",
"{",
"IdentityContext",
"identityContext",
"=",
"new... | Change the configuration in the charging station. It has already happened on the physical charging station, but
the Domain has not been updated yet.
@param chargingStationId the charging station id.
@param configurationItem the configuration item which has changed.
@param correlationToken the token to correlate comma... | [
"Change",
"the",
"configuration",
"in",
"the",
"charging",
"station",
".",
"It",
"has",
"already",
"happened",
"on",
"the",
"physical",
"charging",
"station",
"but",
"the",
"Domain",
"has",
"not",
"been",
"updated",
"yet",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpp/view-model/src/main/java/io/motown/ocpp/viewmodel/domain/DomainService.java#L353-L357 |
m-m-m/util | contenttype/src/main/java/net/sf/mmm/util/contenttype/base/format/SegmentConstant.java | SegmentConstant.parseBytes | static byte[] parseBytes(String bytes, String source) {
"""
This method parses the given {@code bytes} from {@code source} to {@code byte[]}.
@param bytes are the bytes encoded as {@link String} in the form {@code HH([-]HH)*} where {@code HH} is a hex
encoded byte ([0-9A-F]{2}). Example: "FE-7A-32-BB".
@param... | java | static byte[] parseBytes(String bytes, String source) {
NlsNullPointerException.checkNotNull(source, bytes);
int length = bytes.length();
if ((length == 0) || (length % 3 != 0)) {
throw new NlsIllegalArgumentException(bytes, source);
}
length = length / 3;
byte[] result = new byte... | [
"static",
"byte",
"[",
"]",
"parseBytes",
"(",
"String",
"bytes",
",",
"String",
"source",
")",
"{",
"NlsNullPointerException",
".",
"checkNotNull",
"(",
"source",
",",
"bytes",
")",
";",
"int",
"length",
"=",
"bytes",
".",
"length",
"(",
")",
";",
"if",... | This method parses the given {@code bytes} from {@code source} to {@code byte[]}.
@param bytes are the bytes encoded as {@link String} in the form {@code HH([-]HH)*} where {@code HH} is a hex
encoded byte ([0-9A-F]{2}). Example: "FE-7A-32-BB".
@param source describes where the given {@code bytes} origin from. This is ... | [
"This",
"method",
"parses",
"the",
"given",
"{",
"@code",
"bytes",
"}",
"from",
"{",
"@code",
"source",
"}",
"to",
"{",
"@code",
"byte",
"[]",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/contenttype/src/main/java/net/sf/mmm/util/contenttype/base/format/SegmentConstant.java#L90-L109 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java | AnalyticsQuery.parameterized | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonObject namedParams, final AnalyticsParams params) {
"""
Creates an {@link AnalyticsQuery} with named parameters as part of the query.
@param statement the statement to send.
@param namedParams the named parameters... | java | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonObject namedParams, final AnalyticsParams params) {
return new ParameterizedAnalyticsQuery(statement, null, namedParams, params);
} | [
"public",
"static",
"ParameterizedAnalyticsQuery",
"parameterized",
"(",
"final",
"String",
"statement",
",",
"final",
"JsonObject",
"namedParams",
",",
"final",
"AnalyticsParams",
"params",
")",
"{",
"return",
"new",
"ParameterizedAnalyticsQuery",
"(",
"statement",
","... | Creates an {@link AnalyticsQuery} with named parameters as part of the query.
@param statement the statement to send.
@param namedParams the named parameters which will be put in for the placeholders.
@param params the parameters to provide to the server in addition.
@return a {@link AnalyticsQuery}. | [
"Creates",
"an",
"{",
"@link",
"AnalyticsQuery",
"}",
"with",
"named",
"parameters",
"as",
"part",
"of",
"the",
"query",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java#L118-L121 |
OpenLiberty/open-liberty | dev/com.ibm.ws.filetransfer/src/com/ibm/ws/filetransfer/util/FileServiceUtil.java | FileServiceUtil.expandArchive | public boolean expandArchive(String sourcePath, String targetPath) {
"""
Expand the specified archive to the specified location
<p>
@param sourcePath path of the archive to be expanded.
@param targetPath location to where the archive is to be expanded.
<p>
@returns true if the archive was successfully expan... | java | public boolean expandArchive(String sourcePath, String targetPath) {
try {
return ArchiveExpander.coreExpandArchive(sourcePath, targetPath);
} catch (IOException e) {
FFDCFilter.processException(e, getClass().getName(), "expandArchive");
}
return false;
} | [
"public",
"boolean",
"expandArchive",
"(",
"String",
"sourcePath",
",",
"String",
"targetPath",
")",
"{",
"try",
"{",
"return",
"ArchiveExpander",
".",
"coreExpandArchive",
"(",
"sourcePath",
",",
"targetPath",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
... | Expand the specified archive to the specified location
<p>
@param sourcePath path of the archive to be expanded.
@param targetPath location to where the archive is to be expanded.
<p>
@returns true if the archive was successfully expanded, false otherwise. | [
"Expand",
"the",
"specified",
"archive",
"to",
"the",
"specified",
"location",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.filetransfer/src/com/ibm/ws/filetransfer/util/FileServiceUtil.java#L161-L168 |
haraldk/TwelveMonkeys | imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/util/IIOUtil.java | IIOUtil.lookupProviderByName | public static <T> T lookupProviderByName(final ServiceRegistry registry, final String providerClassName, Class<T> category) {
"""
THIS METHOD WILL ME MOVED/RENAMED, DO NOT USE.
@param registry the registry to lookup from.
@param providerClassName name of the provider class.
@param category provider category
... | java | public static <T> T lookupProviderByName(final ServiceRegistry registry, final String providerClassName, Class<T> category) {
try {
return category.cast(registry.getServiceProviderByClass(Class.forName(providerClassName)));
}
catch (ClassNotFoundException ignore) {
return... | [
"public",
"static",
"<",
"T",
">",
"T",
"lookupProviderByName",
"(",
"final",
"ServiceRegistry",
"registry",
",",
"final",
"String",
"providerClassName",
",",
"Class",
"<",
"T",
">",
"category",
")",
"{",
"try",
"{",
"return",
"category",
".",
"cast",
"(",
... | THIS METHOD WILL ME MOVED/RENAMED, DO NOT USE.
@param registry the registry to lookup from.
@param providerClassName name of the provider class.
@param category provider category
@return the provider instance, or {@code null}. | [
"THIS",
"METHOD",
"WILL",
"ME",
"MOVED",
"/",
"RENAMED",
"DO",
"NOT",
"USE",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/util/IIOUtil.java#L180-L187 |
aws/aws-sdk-java | aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/PollForJobsRequest.java | PollForJobsRequest.withQueryParam | public PollForJobsRequest withQueryParam(java.util.Map<String, String> queryParam) {
"""
<p>
A map of property names and values. For an action type with no queryable properties, this value must be null or
an empty map. For an action type with a queryable property, you must supply that property as a key in the ma... | java | public PollForJobsRequest withQueryParam(java.util.Map<String, String> queryParam) {
setQueryParam(queryParam);
return this;
} | [
"public",
"PollForJobsRequest",
"withQueryParam",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"queryParam",
")",
"{",
"setQueryParam",
"(",
"queryParam",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of property names and values. For an action type with no queryable properties, this value must be null or
an empty map. For an action type with a queryable property, you must supply that property as a key in the map.
Only jobs whose action configuration matches the mapped value will be returned.
</p>
@param ... | [
"<p",
">",
"A",
"map",
"of",
"property",
"names",
"and",
"values",
".",
"For",
"an",
"action",
"type",
"with",
"no",
"queryable",
"properties",
"this",
"value",
"must",
"be",
"null",
"or",
"an",
"empty",
"map",
".",
"For",
"an",
"action",
"type",
"with... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/PollForJobsRequest.java#L179-L182 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.pixelYToLatitude | public static double pixelYToLatitude(double pixelY, long mapSize) {
"""
Converts a pixel Y coordinate at a certain map size to a latitude coordinate.
@param pixelY the pixel Y coordinate that should be converted.
@param mapSize precomputed size of map.
@return the latitude value of the pixel Y coordinate.
... | java | public static double pixelYToLatitude(double pixelY, long mapSize) {
if (pixelY < 0 || pixelY > mapSize) {
throw new IllegalArgumentException("invalid pixelY coordinate " + mapSize + ": " + pixelY);
}
double y = 0.5 - (pixelY / mapSize);
return 90 - 360 * Math.atan(Math.exp(-... | [
"public",
"static",
"double",
"pixelYToLatitude",
"(",
"double",
"pixelY",
",",
"long",
"mapSize",
")",
"{",
"if",
"(",
"pixelY",
"<",
"0",
"||",
"pixelY",
">",
"mapSize",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"invalid pixelY coordinate \"... | Converts a pixel Y coordinate at a certain map size to a latitude coordinate.
@param pixelY the pixel Y coordinate that should be converted.
@param mapSize precomputed size of map.
@return the latitude value of the pixel Y coordinate.
@throws IllegalArgumentException if the given pixelY coordinate is invalid. | [
"Converts",
"a",
"pixel",
"Y",
"coordinate",
"at",
"a",
"certain",
"map",
"size",
"to",
"a",
"latitude",
"coordinate",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L407-L413 |
ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java | ZWaveController.handleSerialAPIGetCapabilitiesResponse | private void handleSerialAPIGetCapabilitiesResponse(SerialMessage incomingMessage) {
"""
Handles the response of the SerialAPIGetCapabilities request.
@param incomingMessage the response message to process.
"""
logger.trace("Handle Message Serial API Get Capabilities");
this.serialAPIVersion = String.for... | java | private void handleSerialAPIGetCapabilitiesResponse(SerialMessage incomingMessage) {
logger.trace("Handle Message Serial API Get Capabilities");
this.serialAPIVersion = String.format("%d.%d", incomingMessage.getMessagePayloadByte(0), incomingMessage.getMessagePayloadByte(1));
this.manufactureId = ((incomingMessa... | [
"private",
"void",
"handleSerialAPIGetCapabilitiesResponse",
"(",
"SerialMessage",
"incomingMessage",
")",
"{",
"logger",
".",
"trace",
"(",
"\"Handle Message Serial API Get Capabilities\"",
")",
";",
"this",
".",
"serialAPIVersion",
"=",
"String",
".",
"format",
"(",
"... | Handles the response of the SerialAPIGetCapabilities request.
@param incomingMessage the response message to process. | [
"Handles",
"the",
"response",
"of",
"the",
"SerialAPIGetCapabilities",
"request",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java#L615-L630 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.createReviews | public List<String> createReviews(String teamName, String urlContentType, List<CreateReviewBodyItem> createReviewBody, CreateReviewsOptionalParameter createReviewsOptionalParameter) {
"""
The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be P... | java | public List<String> createReviews(String teamName, String urlContentType, List<CreateReviewBodyItem> createReviewBody, CreateReviewsOptionalParameter createReviewsOptionalParameter) {
return createReviewsWithServiceResponseAsync(teamName, urlContentType, createReviewBody, createReviewsOptionalParameter).toBlock... | [
"public",
"List",
"<",
"String",
">",
"createReviews",
"(",
"String",
"teamName",
",",
"String",
"urlContentType",
",",
"List",
"<",
"CreateReviewBodyItem",
">",
"createReviewBody",
",",
"CreateReviewsOptionalParameter",
"createReviewsOptionalParameter",
")",
"{",
"retu... | The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.
<h3>CallBack Schemas </h3>
<h4>Review Completion CallBack Sample</h4>
<p>
{<br/>
"ReviewId": "<R... | [
"The",
"reviews",
"created",
"would",
"show",
"up",
"for",
"Reviewers",
"on",
"your",
"team",
".",
"As",
"Reviewers",
"complete",
"reviewing",
"results",
"of",
"the",
"Review",
"would",
"be",
"POSTED",
"(",
"i",
".",
"e",
".",
"HTTP",
"POST",
")",
"on",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L333-L335 |
Netflix/conductor | mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/Query.java | Query.executeScalarList | public <V> List<V> executeScalarList(Class<V> returnType) {
"""
Execute the PreparedStatement and return a List of 'primitive' values from the ResultSet.
@param returnType The type Class return a List of.
@param <V> The type parameter to return a List of.
@return A {@code List<returnType>}.
@throws Applica... | java | public <V> List<V> executeScalarList(Class<V> returnType) {
try (ResultSet rs = executeQuery()) {
List<V> values = new ArrayList<>();
while (rs.next()) {
values.add(getScalarFromResultSet(rs, returnType));
}
return values;
} catch (SQLExcep... | [
"public",
"<",
"V",
">",
"List",
"<",
"V",
">",
"executeScalarList",
"(",
"Class",
"<",
"V",
">",
"returnType",
")",
"{",
"try",
"(",
"ResultSet",
"rs",
"=",
"executeQuery",
"(",
")",
")",
"{",
"List",
"<",
"V",
">",
"values",
"=",
"new",
"ArrayLis... | Execute the PreparedStatement and return a List of 'primitive' values from the ResultSet.
@param returnType The type Class return a List of.
@param <V> The type parameter to return a List of.
@return A {@code List<returnType>}.
@throws ApplicationException {@literal returnType} is unsupported, cannot be cast to from ... | [
"Execute",
"the",
"PreparedStatement",
"and",
"return",
"a",
"List",
"of",
"primitive",
"values",
"from",
"the",
"ResultSet",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/Query.java#L362-L372 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspStandardContextBean.java | CmsJspStandardContextBean.getFunctionFormatFromContent | public Map<CmsJspContentAccessBean, CmsDynamicFunctionFormatWrapper> getFunctionFormatFromContent() {
"""
Returns a lazy map which creates a wrapper object for a dynamic function format when given an XML content
as a key.<p>
@return a lazy map for accessing function formats for a content
"""
Trans... | java | public Map<CmsJspContentAccessBean, CmsDynamicFunctionFormatWrapper> getFunctionFormatFromContent() {
Transformer transformer = new Transformer() {
@Override
public Object transform(Object contentAccess) {
CmsXmlContent content = (CmsXmlContent)(((CmsJspContentAccessBe... | [
"public",
"Map",
"<",
"CmsJspContentAccessBean",
",",
"CmsDynamicFunctionFormatWrapper",
">",
"getFunctionFormatFromContent",
"(",
")",
"{",
"Transformer",
"transformer",
"=",
"new",
"Transformer",
"(",
")",
"{",
"@",
"Override",
"public",
"Object",
"transform",
"(",
... | Returns a lazy map which creates a wrapper object for a dynamic function format when given an XML content
as a key.<p>
@return a lazy map for accessing function formats for a content | [
"Returns",
"a",
"lazy",
"map",
"which",
"creates",
"a",
"wrapper",
"object",
"for",
"a",
"dynamic",
"function",
"format",
"when",
"given",
"an",
"XML",
"content",
"as",
"a",
"key",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspStandardContextBean.java#L1123-L1153 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.lockInodePathPair | public InodePathPair lockInodePathPair(AlluxioURI path1, LockPattern lockPattern1,
AlluxioURI path2, LockPattern lockPattern2) throws InvalidPathException {
"""
Locks existing inodes on the two specified paths. The two paths will be locked in the correct
order. The target inodes are not required to exist.
... | java | public InodePathPair lockInodePathPair(AlluxioURI path1, LockPattern lockPattern1,
AlluxioURI path2, LockPattern lockPattern2) throws InvalidPathException {
LockedInodePath lockedPath1 = null;
LockedInodePath lockedPath2 = null;
boolean valid = false;
try {
// Lock paths in a deterministic o... | [
"public",
"InodePathPair",
"lockInodePathPair",
"(",
"AlluxioURI",
"path1",
",",
"LockPattern",
"lockPattern1",
",",
"AlluxioURI",
"path2",
",",
"LockPattern",
"lockPattern2",
")",
"throws",
"InvalidPathException",
"{",
"LockedInodePath",
"lockedPath1",
"=",
"null",
";"... | Locks existing inodes on the two specified paths. The two paths will be locked in the correct
order. The target inodes are not required to exist.
@param path1 the first path to lock
@param lockPattern1 the locking pattern for the first path
@param path2 the second path to lock
@param lockPattern2 the locking pattern f... | [
"Locks",
"existing",
"inodes",
"on",
"the",
"two",
"specified",
"paths",
".",
"The",
"two",
"paths",
"will",
"be",
"locked",
"in",
"the",
"correct",
"order",
".",
"The",
"target",
"inodes",
"are",
"not",
"required",
"to",
"exist",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L459-L485 |
Alluxio/alluxio | core/common/src/main/java/alluxio/extensions/ExtensionFactoryRegistry.java | ExtensionFactoryRegistry.scanExtensions | private void scanExtensions(List<T> factories, String extensionsDir) {
"""
Finds all factory from the extensions directory.
@param factories list of factories to add to
"""
LOG.info("Loading extension jars from {}", extensionsDir);
scan(Arrays.asList(ExtensionUtils.listExtensions(extensionsDir)), fa... | java | private void scanExtensions(List<T> factories, String extensionsDir) {
LOG.info("Loading extension jars from {}", extensionsDir);
scan(Arrays.asList(ExtensionUtils.listExtensions(extensionsDir)), factories);
} | [
"private",
"void",
"scanExtensions",
"(",
"List",
"<",
"T",
">",
"factories",
",",
"String",
"extensionsDir",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Loading extension jars from {}\"",
",",
"extensionsDir",
")",
";",
"scan",
"(",
"Arrays",
".",
"asList",
"(",
... | Finds all factory from the extensions directory.
@param factories list of factories to add to | [
"Finds",
"all",
"factory",
"from",
"the",
"extensions",
"directory",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/extensions/ExtensionFactoryRegistry.java#L159-L162 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/nexus/MavenArtifact.java | MavenArtifact.derivePomUrl | public static String derivePomUrl(String artifactId, String version, String artifactUrl) {
"""
Tries to determine the URL to the pom.xml.
@param artifactId the artifact id
@param version the version
@param artifactUrl the artifact URL
@return the string representation of the URL
"""
return artifa... | java | public static String derivePomUrl(String artifactId, String version, String artifactUrl) {
return artifactUrl.substring(0, artifactUrl.lastIndexOf('/')) + '/' + artifactId + '-' + version + ".pom";
} | [
"public",
"static",
"String",
"derivePomUrl",
"(",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"artifactUrl",
")",
"{",
"return",
"artifactUrl",
".",
"substring",
"(",
"0",
",",
"artifactUrl",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
")",... | Tries to determine the URL to the pom.xml.
@param artifactId the artifact id
@param version the version
@param artifactUrl the artifact URL
@return the string representation of the URL | [
"Tries",
"to",
"determine",
"the",
"URL",
"to",
"the",
"pom",
".",
"xml",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nexus/MavenArtifact.java#L145-L147 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryUtils.java | QueryUtils.appendQueryPageComments | public static void appendQueryPageComments(RequestContext requestContext, QueryPage queryPage) {
"""
Loads the whole comment tree and appends it to requestContext for JSP to read.
@param requestContext Smvcj request context
@param queryPage query page
"""
QueryQuestionCommentDAO queryQuestionCommentDAO... | java | public static void appendQueryPageComments(RequestContext requestContext, QueryPage queryPage) {
QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO();
PanelStamp activeStamp = RequestUtils.getActiveStamp(requestContext);
List<QueryQuestionComment> rootComments = queryQuestionComme... | [
"public",
"static",
"void",
"appendQueryPageComments",
"(",
"RequestContext",
"requestContext",
",",
"QueryPage",
"queryPage",
")",
"{",
"QueryQuestionCommentDAO",
"queryQuestionCommentDAO",
"=",
"new",
"QueryQuestionCommentDAO",
"(",
")",
";",
"PanelStamp",
"activeStamp",
... | Loads the whole comment tree and appends it to requestContext for JSP to read.
@param requestContext Smvcj request context
@param queryPage query page | [
"Loads",
"the",
"whole",
"comment",
"tree",
"and",
"appends",
"it",
"to",
"requestContext",
"for",
"JSP",
"to",
"read",
"."
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryUtils.java#L137-L155 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identity.java | Identity.distinguishedNameEquals | private boolean distinguishedNameEquals(String dsn1, String dsn2) {
"""
Compare two DSN
@param dsn1 Distinguished name (X.500 DSN) string
@param dsn2 Distinguished name (X.500 DSN) string
@return boolean true if both DSN are equal
@since 0.1.5
"""
return new X500Principal(dsn1).equals(new X500Principal... | java | private boolean distinguishedNameEquals(String dsn1, String dsn2) {
return new X500Principal(dsn1).equals(new X500Principal(dsn2));
} | [
"private",
"boolean",
"distinguishedNameEquals",
"(",
"String",
"dsn1",
",",
"String",
"dsn2",
")",
"{",
"return",
"new",
"X500Principal",
"(",
"dsn1",
")",
".",
"equals",
"(",
"new",
"X500Principal",
"(",
"dsn2",
")",
")",
";",
"}"
] | Compare two DSN
@param dsn1 Distinguished name (X.500 DSN) string
@param dsn2 Distinguished name (X.500 DSN) string
@return boolean true if both DSN are equal
@since 0.1.5 | [
"Compare",
"two",
"DSN"
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identity.java#L198-L200 |
Wikidata/Wikidata-Toolkit | wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/RdfConverter.java | RdfConverter.writeStatementRankTriple | void writeStatementRankTriple(Resource subject, StatementRank rank) {
"""
Writes a triple for the {@link StatementRank} of a {@link Statement} to
the dump.
@param subject
@param rank
"""
try {
this.rdfWriter.writeTripleUriObject(subject, RdfWriter.WB_RANK,
getUriStringForRank(rank));
this.ran... | java | void writeStatementRankTriple(Resource subject, StatementRank rank) {
try {
this.rdfWriter.writeTripleUriObject(subject, RdfWriter.WB_RANK,
getUriStringForRank(rank));
this.rankBuffer.add(rank, subject);
} catch (RDFHandlerException e) {
throw new RuntimeException(e.getMessage(), e);
}
} | [
"void",
"writeStatementRankTriple",
"(",
"Resource",
"subject",
",",
"StatementRank",
"rank",
")",
"{",
"try",
"{",
"this",
".",
"rdfWriter",
".",
"writeTripleUriObject",
"(",
"subject",
",",
"RdfWriter",
".",
"WB_RANK",
",",
"getUriStringForRank",
"(",
"rank",
... | Writes a triple for the {@link StatementRank} of a {@link Statement} to
the dump.
@param subject
@param rank | [
"Writes",
"a",
"triple",
"for",
"the",
"{",
"@link",
"StatementRank",
"}",
"of",
"a",
"{",
"@link",
"Statement",
"}",
"to",
"the",
"dump",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/RdfConverter.java#L337-L346 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/HarFileSystem.java | HarFileSystem.open | @Override
public FSDataInputStream open(Path f, int bufferSize) throws IOException {
"""
Returns a har input stream which fakes end of
file. It reads the index files to get the part
file name and the size and start of the file.
"""
HarStatus hstatus = getFileHarStatus(f, null);
// we got it.. woo h... | java | @Override
public FSDataInputStream open(Path f, int bufferSize) throws IOException {
HarStatus hstatus = getFileHarStatus(f, null);
// we got it.. woo hooo!!!
if (hstatus.isDir()) {
throw new FileNotFoundException(f + " : not a file in " +
archivePath);
}
return new HarFSData... | [
"@",
"Override",
"public",
"FSDataInputStream",
"open",
"(",
"Path",
"f",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"HarStatus",
"hstatus",
"=",
"getFileHarStatus",
"(",
"f",
",",
"null",
")",
";",
"// we got it.. woo hooo!!!",
"if",
"(",
"h... | Returns a har input stream which fakes end of
file. It reads the index files to get the part
file name and the size and start of the file. | [
"Returns",
"a",
"har",
"input",
"stream",
"which",
"fakes",
"end",
"of",
"file",
".",
"It",
"reads",
"the",
"index",
"files",
"to",
"get",
"the",
"part",
"file",
"name",
"and",
"the",
"size",
"and",
"start",
"of",
"the",
"file",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L681-L692 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.setMethod | public SoapClient setMethod(QName name, Map<String, Object> params, boolean useMethodPrefix) {
"""
设置请求方法
@param name 方法名及其命名空间
@param params 参数
@param useMethodPrefix 是否使用方法的命名空间前缀
@return this
"""
setMethod(name);
final String prefix = name.getPrefix();
final SOAPBodyElement methodEle = this.m... | java | public SoapClient setMethod(QName name, Map<String, Object> params, boolean useMethodPrefix) {
setMethod(name);
final String prefix = name.getPrefix();
final SOAPBodyElement methodEle = this.methodEle;
for (Entry<String, Object> entry : MapUtil.wrap(params)) {
setParam(methodEle, entry.getKey(), entry.g... | [
"public",
"SoapClient",
"setMethod",
"(",
"QName",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"boolean",
"useMethodPrefix",
")",
"{",
"setMethod",
"(",
"name",
")",
";",
"final",
"String",
"prefix",
"=",
"name",
".",
"getPrefix",... | 设置请求方法
@param name 方法名及其命名空间
@param params 参数
@param useMethodPrefix 是否使用方法的命名空间前缀
@return this | [
"设置请求方法"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L236-L245 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java | WorkspacePersistentDataManager.doUpdate | protected void doUpdate(final ItemData item, final WorkspaceStorageConnection con, ChangedSizeHandler sizeHandler)
throws RepositoryException, InvalidItemStateException {
"""
Performs actual item data updating.
@param item
to update
@param con
connection
@param sizeHandler
@throws RepositoryException... | java | protected void doUpdate(final ItemData item, final WorkspaceStorageConnection con, ChangedSizeHandler sizeHandler)
throws RepositoryException, InvalidItemStateException
{
if (item.isNode())
{
con.update((NodeData)item);
}
else
{
con.update((PropertyData)item, si... | [
"protected",
"void",
"doUpdate",
"(",
"final",
"ItemData",
"item",
",",
"final",
"WorkspaceStorageConnection",
"con",
",",
"ChangedSizeHandler",
"sizeHandler",
")",
"throws",
"RepositoryException",
",",
"InvalidItemStateException",
"{",
"if",
"(",
"item",
".",
"isNode... | Performs actual item data updating.
@param item
to update
@param con
connection
@param sizeHandler
@throws RepositoryException
@throws InvalidItemStateException
if the item not found | [
"Performs",
"actual",
"item",
"data",
"updating",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java#L1163-L1175 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java | BasePGPCommon.findPrivateKey | protected PGPPrivateKey findPrivateKey(InputStream secretKey, final String userId, String password) throws PGPException, IOException {
"""
read a private key and unlock it with the given password
@param secretKey
the secret key stream
@param userId
the required user id
@param password
the password to unloc... | java | protected PGPPrivateKey findPrivateKey(InputStream secretKey, final String userId, String password) throws PGPException, IOException {
LOGGER.trace("findPrivateKey(InputStream, String, String)");
LOGGER.trace("Secret Key: {}, User ID: {}, Password: {}", secretKey == null ? "not set" : "set", userId, password ==... | [
"protected",
"PGPPrivateKey",
"findPrivateKey",
"(",
"InputStream",
"secretKey",
",",
"final",
"String",
"userId",
",",
"String",
"password",
")",
"throws",
"PGPException",
",",
"IOException",
"{",
"LOGGER",
".",
"trace",
"(",
"\"findPrivateKey(InputStream, String, Stri... | read a private key and unlock it with the given password
@param secretKey
the secret key stream
@param userId
the required user id
@param password
the password to unlock the private key
@return the applicable private key or null if none is found
@throws PGPException
@throws IOException | [
"read",
"a",
"private",
"key",
"and",
"unlock",
"it",
"with",
"the",
"given",
"password"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java#L190-L206 |
redkale/redkale-plugins | src/org/redkalex/source/mysql/SQLError.java | SQLError.createSQLException | public static SQLException createSQLException(String message, String sqlState, ExceptionInterceptor interceptor) {
"""
/*
SQL State Class SQLNonTransientException Subclass 08
SQLNonTransientConnectionException 22 SQLDataException 23
SQLIntegrityConstraintViolationException N/A
SQLInvalidAuthorizationException ... | java | public static SQLException createSQLException(String message, String sqlState, ExceptionInterceptor interceptor) {
return createSQLException(message, sqlState, 0, interceptor);
} | [
"public",
"static",
"SQLException",
"createSQLException",
"(",
"String",
"message",
",",
"String",
"sqlState",
",",
"ExceptionInterceptor",
"interceptor",
")",
"{",
"return",
"createSQLException",
"(",
"message",
",",
"sqlState",
",",
"0",
",",
"interceptor",
")",
... | /*
SQL State Class SQLNonTransientException Subclass 08
SQLNonTransientConnectionException 22 SQLDataException 23
SQLIntegrityConstraintViolationException N/A
SQLInvalidAuthorizationException 42 SQLSyntaxErrorException
SQL State Class SQLTransientException Subclass 08
SQLTransientConnectionException 40 SQLTransactionR... | [
"/",
"*",
"SQL",
"State",
"Class",
"SQLNonTransientException",
"Subclass",
"08",
"SQLNonTransientConnectionException",
"22",
"SQLDataException",
"23",
"SQLIntegrityConstraintViolationException",
"N",
"/",
"A",
"SQLInvalidAuthorizationException",
"42",
"SQLSyntaxErrorException"
] | train | https://github.com/redkale/redkale-plugins/blob/a1edfc906a444ae19fe6aababce2957c9b5ea9d2/src/org/redkalex/source/mysql/SQLError.java#L815-L817 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java | EncodedElement.packInt | public EncodedElement packInt(int[] inputArray, int bitSize,
int start, int skip, int countA) {
"""
Append an equal number of bits from each int in an array within given
limits to the end of this list.
@param inputArray Array storing input values.
@param bitSize number of bits to store from each value.
... | java | public EncodedElement packInt(int[] inputArray, int bitSize,
int start, int skip, int countA) {
//go to end if we're not there.
if(next != null) {
EncodedElement end = EncodedElement.getEnd_S(next);
return end.packInt(inputArray, bitSize, start, skip, countA);
}
//calculate how many we... | [
"public",
"EncodedElement",
"packInt",
"(",
"int",
"[",
"]",
"inputArray",
",",
"int",
"bitSize",
",",
"int",
"start",
",",
"int",
"skip",
",",
"int",
"countA",
")",
"{",
"//go to end if we're not there.",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"Encode... | Append an equal number of bits from each int in an array within given
limits to the end of this list.
@param inputArray Array storing input values.
@param bitSize number of bits to store from each value.
@param start index of first usable index.
@param skip number of indices to skip between values(in case input data
i... | [
"Append",
"an",
"equal",
"number",
"of",
"bits",
"from",
"each",
"int",
"in",
"an",
"array",
"within",
"given",
"limits",
"to",
"the",
"end",
"of",
"this",
"list",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java#L376-L404 |
grobmeier/postmark4j | src/main/java/de/grobmeier/postmark/PostmarkClient.java | PostmarkClient.sendMessage | public PostmarkResponse sendMessage(String from, String to, String replyTo, String cc, String subject, String body, boolean isHTML, String tag) throws PostmarkException {
"""
Sends a message through the Postmark API.
All email addresses must be valid, and the sender must be
a valid sender signature according to ... | java | public PostmarkResponse sendMessage(String from, String to, String replyTo, String cc, String subject, String body, boolean isHTML, String tag) throws PostmarkException {
return sendMessage(from, to, replyTo, cc, null, subject, body, isHTML, tag, null);
} | [
"public",
"PostmarkResponse",
"sendMessage",
"(",
"String",
"from",
",",
"String",
"to",
",",
"String",
"replyTo",
",",
"String",
"cc",
",",
"String",
"subject",
",",
"String",
"body",
",",
"boolean",
"isHTML",
",",
"String",
"tag",
")",
"throws",
"PostmarkE... | Sends a message through the Postmark API.
All email addresses must be valid, and the sender must be
a valid sender signature according to Postmark. To obtain a valid
sender signature, log in to Postmark and navigate to:
http://postmarkapp.com/signatures.
@param from An email address for a sender
@param to An e... | [
"Sends",
"a",
"message",
"through",
"the",
"Postmark",
"API",
".",
"All",
"email",
"addresses",
"must",
"be",
"valid",
"and",
"the",
"sender",
"must",
"be",
"a",
"valid",
"sender",
"signature",
"according",
"to",
"Postmark",
".",
"To",
"obtain",
"a",
"vali... | train | https://github.com/grobmeier/postmark4j/blob/245732bd03c67c1eb1ad734625838f4ffe2a96f0/src/main/java/de/grobmeier/postmark/PostmarkClient.java#L114-L116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.