repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aggregateknowledge/java-hll | src/main/java/net/agkn/hll/HLL.java | HLL.addRawSparseProbabilistic | private void addRawSparseProbabilistic(final long rawValue) {
// p(w): position of the least significant set bit (one-indexed)
// By contract: p(w) <= 2^(registerValueInBits) - 1 (the max register value)
//
// By construction of pwMaxMask (see #Constructor()),
// lsb(pwMaxMa... | java | private void addRawSparseProbabilistic(final long rawValue) {
// p(w): position of the least significant set bit (one-indexed)
// By contract: p(w) <= 2^(registerValueInBits) - 1 (the max register value)
//
// By construction of pwMaxMask (see #Constructor()),
// lsb(pwMaxMa... | [
"private",
"void",
"addRawSparseProbabilistic",
"(",
"final",
"long",
"rawValue",
")",
"{",
"// p(w): position of the least significant set bit (one-indexed)",
"// By contract: p(w) <= 2^(registerValueInBits) - 1 (the max register value)",
"//",
"// By construction of pwMaxMask (see #Constru... | Adds the raw value to the {@link #sparseProbabilisticStorage}.
{@link #type} must be {@link HLLType#SPARSE}.
@param rawValue the raw value to add to the sparse storage. | [
"Adds",
"the",
"raw",
"value",
"to",
"the",
"{",
"@link",
"#sparseProbabilisticStorage",
"}",
".",
"{",
"@link",
"#type",
"}",
"must",
"be",
"{",
"@link",
"HLLType#SPARSE",
"}",
"."
] | 1f4126e79a85b79581460c75bf1c1634b8a7402d | https://github.com/aggregateknowledge/java-hll/blob/1f4126e79a85b79581460c75bf1c1634b8a7402d/src/main/java/net/agkn/hll/HLL.java#L393-L430 | train | Adds the raw sparse probabilistic value to the sparseProbabilistic storage. | Of course, here is the Java code you requested:
```java
private void addRawSparseProbabilistic(final long rawValue) {
// p(w): position of the least significant set bit (one-indexed)
// By contract: p(w) <= 2^(registerValueInBits) - 1 (the max register value)
//
// By construction of pw... |
jenkinsci/jenkins | core/src/main/java/hudson/model/Label.java | Label.matches | public final boolean matches(final Collection<LabelAtom> labels) {
return matches(new VariableResolver<Boolean>() {
public Boolean resolve(String name) {
for (LabelAtom a : labels)
if (a.getName().equals(name))
return true;
... | java | public final boolean matches(final Collection<LabelAtom> labels) {
return matches(new VariableResolver<Boolean>() {
public Boolean resolve(String name) {
for (LabelAtom a : labels)
if (a.getName().equals(name))
return true;
... | [
"public",
"final",
"boolean",
"matches",
"(",
"final",
"Collection",
"<",
"LabelAtom",
">",
"labels",
")",
"{",
"return",
"matches",
"(",
"new",
"VariableResolver",
"<",
"Boolean",
">",
"(",
")",
"{",
"public",
"Boolean",
"resolve",
"(",
"String",
"name",
... | Evaluates whether the label expression is true when an entity owns the given set of
{@link LabelAtom}s. | [
"Evaluates",
"whether",
"the",
"label",
"expression",
"is",
"true",
"when",
"an",
"entity",
"owns",
"the",
"given",
"set",
"of",
"{"
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Label.java#L178-L187 | train | Checks if the set of labels matches this set. | Of course, here is the Java code you requested:
```java
public final boolean matches(final Collection<LabelAtom> labels) {
return matches(new VariableResolver<Boolean>() {
public Boolean resolve(String name) {
for (LabelAtom a : labels)
if (a.getName().equals(nam... |
plume-lib/bcel-util | src/main/java/org/plumelib/bcelutil/BcelUtil.java | BcelUtil.isMain | public static boolean isMain(MethodGen mg) {
Type[] argTypes = mg.getArgumentTypes();
return mg.isStatic()
&& (mg.getReturnType() == Type.VOID)
&& mg.getName().equals("main")
&& (argTypes.length == 1)
&& argTypes[0].equals(stringArray);
} | java | public static boolean isMain(MethodGen mg) {
Type[] argTypes = mg.getArgumentTypes();
return mg.isStatic()
&& (mg.getReturnType() == Type.VOID)
&& mg.getName().equals("main")
&& (argTypes.length == 1)
&& argTypes[0].equals(stringArray);
} | [
"public",
"static",
"boolean",
"isMain",
"(",
"MethodGen",
"mg",
")",
"{",
"Type",
"[",
"]",
"argTypes",
"=",
"mg",
".",
"getArgumentTypes",
"(",
")",
";",
"return",
"mg",
".",
"isStatic",
"(",
")",
"&&",
"(",
"mg",
".",
"getReturnType",
"(",
")",
"=... | Returns whether or not this is a standard main method (static, void, name is 'main', and one
formal parameter: a string array).
@param mg the method to check
@return true iff the method is a main method | [
"Returns",
"whether",
"or",
"not",
"this",
"is",
"a",
"standard",
"main",
"method",
"(",
"static",
"void",
"name",
"is",
"main",
"and",
"one",
"formal",
"parameter",
":",
"a",
"string",
"array",
")",
"."
] | 29adb7dd273398df7d0a7abbcd85b1c85e207a0e | https://github.com/plume-lib/bcel-util/blob/29adb7dd273398df7d0a7abbcd85b1c85e207a0e/src/main/java/org/plumelib/bcelutil/BcelUtil.java#L298-L305 | valid | Returns true if the method is a main method. | Of course, here is the Java code you requested:
```java
public static boolean isMain(MethodGen mg) {
Type[] argTypes = mg.getArgumentTypes();
return mg.isStatic()
&& (mg.getReturnType() == Type.VOID)
&& mg.getName().equals("main")
&& (argTypes.length == 1)
&& argTypes[0].equals(... |
oblac/jodd | jodd-bean/src/main/java/jodd/bean/BeanCopy.java | BeanCopy.fromMap | public static BeanCopy fromMap(final Map source) {
BeanCopy beanCopy = new BeanCopy(source);
beanCopy.isSourceMap = true;
return beanCopy;
} | java | public static BeanCopy fromMap(final Map source) {
BeanCopy beanCopy = new BeanCopy(source);
beanCopy.isSourceMap = true;
return beanCopy;
} | [
"public",
"static",
"BeanCopy",
"fromMap",
"(",
"final",
"Map",
"source",
")",
"{",
"BeanCopy",
"beanCopy",
"=",
"new",
"BeanCopy",
"(",
"source",
")",
";",
"beanCopy",
".",
"isSourceMap",
"=",
"true",
";",
"return",
"beanCopy",
";",
"}"
] | Creates <code>BeanCopy</code> with given <code>Map</code> as a source. | [
"Creates",
"<code",
">",
"BeanCopy<",
"/",
"code",
">",
"with",
"given",
"<code",
">",
"Map<",
"/",
"code",
">",
"as",
"a",
"source",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanCopy.java#L79-L85 | test | Create a BeanCopy from a Map. | Of course, here is the Java code you requested:
```java
public static BeanCopy fromMap(final Map source) {
BeanCopy beanCopy = new BeanCopy(source);
beanCopy.isSourceMap = true;
return beanCopy;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/DescribeRetentionConfigurationsRequest.java | DescribeRetentionConfigurationsRequest.withRetentionConfigurationNames | public DescribeRetentionConfigurationsRequest withRetentionConfigurationNames(String... retentionConfigurationNames) {
if (this.retentionConfigurationNames == null) {
setRetentionConfigurationNames(new com.amazonaws.internal.SdkInternalList<String>(retentionConfigurationNames.length));
}
... | java | public DescribeRetentionConfigurationsRequest withRetentionConfigurationNames(String... retentionConfigurationNames) {
if (this.retentionConfigurationNames == null) {
setRetentionConfigurationNames(new com.amazonaws.internal.SdkInternalList<String>(retentionConfigurationNames.length));
}
... | [
"public",
"DescribeRetentionConfigurationsRequest",
"withRetentionConfigurationNames",
"(",
"String",
"...",
"retentionConfigurationNames",
")",
"{",
"if",
"(",
"this",
".",
"retentionConfigurationNames",
"==",
"null",
")",
"{",
"setRetentionConfigurationNames",
"(",
"new",
... | <p>
A list of names of retention configurations for which you want details. If you do not specify a name, AWS Config
returns details for all the retention configurations for that account.
</p>
<note>
<p>
Currently, AWS Config supports only one retention configuration per region in your account.
</p>
</note>
<p>
<b>NOTE... | [
"<p",
">",
"A",
"list",
"of",
"names",
"of",
"retention",
"configurations",
"for",
"which",
"you",
"want",
"details",
".",
"If",
"you",
"do",
"not",
"specify",
"a",
"name",
"AWS",
"Config",
"returns",
"details",
"for",
"all",
"the",
"retention",
"configura... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/DescribeRetentionConfigurationsRequest.java#L126-L134 | train | Gets the value of the retentionConfigurationNames property. | Of course, here is the Java code you requested:
```java
public DescribeRetentionConfigurationsRequest withRetentionConfigurationNames(String... retentionConfigurationNames) {
if (this.retentionConfigurationNames == null) {
setRetentionConfigurationNames(new com.amazonaws.internal.SdkInternalList<St... |
aws/aws-sdk-java | aws-java-sdk-kinesisanalyticsv2/src/main/java/com/amazonaws/services/kinesisanalyticsv2/model/SqlApplicationConfiguration.java | SqlApplicationConfiguration.withOutputs | public SqlApplicationConfiguration withOutputs(Output... outputs) {
if (this.outputs == null) {
setOutputs(new java.util.ArrayList<Output>(outputs.length));
}
for (Output ele : outputs) {
this.outputs.add(ele);
}
return this;
} | java | public SqlApplicationConfiguration withOutputs(Output... outputs) {
if (this.outputs == null) {
setOutputs(new java.util.ArrayList<Output>(outputs.length));
}
for (Output ele : outputs) {
this.outputs.add(ele);
}
return this;
} | [
"public",
"SqlApplicationConfiguration",
"withOutputs",
"(",
"Output",
"...",
"outputs",
")",
"{",
"if",
"(",
"this",
".",
"outputs",
"==",
"null",
")",
"{",
"setOutputs",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"Output",
">",
"(",
"outputs... | <p>
The array of <a>Output</a> objects describing the destination streams used by the application.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setOutputs(java.util.Collection)} or {@link #withOutputs(java.util.Collection)} if you want to override
the existing values.
... | [
"<p",
">",
"The",
"array",
"of",
"<a",
">",
"Output<",
"/",
"a",
">",
"objects",
"describing",
"the",
"destination",
"streams",
"used",
"by",
"the",
"application",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"T... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisanalyticsv2/src/main/java/com/amazonaws/services/kinesisanalyticsv2/model/SqlApplicationConfiguration.java#L165-L173 | train | A list of outputs to be used in the SqlApplication. | Of course, here is the Java code you requested:
```java
public SqlApplicationConfiguration withOutputs(Output... outputs) {
if (this.outputs == null) {
setOutputs(new java.util.ArrayList<Output>(outputs.length));
}
for (Output ele : outputs) {
this.outputs.add(ele);
... |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/EditShape.java | EditShape.clearPath | void clearPath(int path) {
int first_vertex = getFirstVertex(path);
if (first_vertex != -1) {
// TODO: can ve do this in one shot?
int vertex = first_vertex;
for (int i = 0, n = getPathSize(path); i < n; i++) {
int v = vertex;
vertex = getNextVertex(vertex);
freeVertex_(v);
}
int geometry... | java | void clearPath(int path) {
int first_vertex = getFirstVertex(path);
if (first_vertex != -1) {
// TODO: can ve do this in one shot?
int vertex = first_vertex;
for (int i = 0, n = getPathSize(path); i < n; i++) {
int v = vertex;
vertex = getNextVertex(vertex);
freeVertex_(v);
}
int geometry... | [
"void",
"clearPath",
"(",
"int",
"path",
")",
"{",
"int",
"first_vertex",
"=",
"getFirstVertex",
"(",
"path",
")",
";",
"if",
"(",
"first_vertex",
"!=",
"-",
"1",
")",
"{",
"// TODO: can ve do this in one shot?",
"int",
"vertex",
"=",
"first_vertex",
";",
"f... | Clears all vertices from the path | [
"Clears",
"all",
"vertices",
"from",
"the",
"path"
] | 494da8ec953d76e7c6072afbc081abfe48ff07cf | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/EditShape.java#L1562-L1577 | train | Clear the path. | Of course, here is the Java code you requested:
```java
void clearPath(int path) {
int first_vertex = getFirstVertex(path);
if (first_vertex != -1) {
// TODO: can ve do this in one shot?
int vertex = first_vertex;
for (int i = 0, n = getPathSize(path); i < n; i++) {
int v = vertex;
vertex = getNex... |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listMultiRolePoolInstanceMetricsAsync | public Observable<Page<ResourceMetricInner>> listMultiRolePoolInstanceMetricsAsync(final String resourceGroupName, final String name, final String instance, final Boolean details) {
return listMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance, details)
.map(new F... | java | public Observable<Page<ResourceMetricInner>> listMultiRolePoolInstanceMetricsAsync(final String resourceGroupName, final String name, final String instance, final Boolean details) {
return listMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance, details)
.map(new F... | [
"public",
"Observable",
"<",
"Page",
"<",
"ResourceMetricInner",
">",
">",
"listMultiRolePoolInstanceMetricsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"instance",
",",
"final",
"Boolean",
"details",
"... | Get metrics for a specific instance of a multi-role pool of an App Service Environment.
Get metrics for a specific instance of a multi-role pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param inst... | [
"Get",
"metrics",
"for",
"a",
"specific",
"instance",
"of",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"metrics",
"for",
"a",
"specific",
"instance",
"of",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2870-L2878 | train | List multi - role pool instance metrics. | Of course, here is the Java code you requested:
```java
public Observable<Page<ResourceMetricInner>> listMultiRolePoolInstanceMetricsAsync(final String resourceGroupName, final String name, final String instance, final Boolean details) {
return listMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceG... |
ysc/word | src/main/java/org/apdplat/word/util/AutoDetector.java | AutoDetector.loadClasspathResource | private static List<String> loadClasspathResource(String resource, ResourceLoader resourceLoader, String resourcePaths) throws IOException{
List<String> result = new ArrayList<>();
LOGGER.info("类路径资源:"+resource);
Enumeration<URL> ps = AutoDetector.class.getClassLoader().getResources(resource);
... | java | private static List<String> loadClasspathResource(String resource, ResourceLoader resourceLoader, String resourcePaths) throws IOException{
List<String> result = new ArrayList<>();
LOGGER.info("类路径资源:"+resource);
Enumeration<URL> ps = AutoDetector.class.getClassLoader().getResources(resource);
... | [
"private",
"static",
"List",
"<",
"String",
">",
"loadClasspathResource",
"(",
"String",
"resource",
",",
"ResourceLoader",
"resourceLoader",
",",
"String",
"resourcePaths",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"Ar... | 加载类路径资源
@param resource 资源名称
@param resourceLoader 资源自定义加载逻辑
@param resourcePaths 资源的所有路径,用于资源监控
@return 资源内容
@throws IOException | [
"加载类路径资源"
] | 5e45607f4e97207f55d1e3bc561abda6b34f7c54 | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/util/AutoDetector.java#L112-L137 | train | Load a resource from the classpath. | Of course, here is the Java code you requested:
```java
private static List<String> loadClasspathResource(String resource, ResourceLoader resourceLoader, String resourcePaths) throws IOException{
List<String> result = new ArrayList<>();
LOGGER.info("类路径资源:"+resource);
Enumeration<URL> ps = Auto... |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/LibertyTracePreprocessInstrumentation.java | LibertyTracePreprocessInstrumentation.isMethodAlreadyInjectedAnnotationPresent | @SuppressWarnings("unchecked")
private boolean isMethodAlreadyInjectedAnnotationPresent(MethodNode methodNode) {
AnnotationNode injectedTraceAnnotation = getAnnotation(INJECTED_TRACE_TYPE.getDescriptor(), methodNode.visibleAnnotations);
AnnotationNode manualTraceAnnotation = getAnnotation(MANUAL_TRA... | java | @SuppressWarnings("unchecked")
private boolean isMethodAlreadyInjectedAnnotationPresent(MethodNode methodNode) {
AnnotationNode injectedTraceAnnotation = getAnnotation(INJECTED_TRACE_TYPE.getDescriptor(), methodNode.visibleAnnotations);
AnnotationNode manualTraceAnnotation = getAnnotation(MANUAL_TRA... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"isMethodAlreadyInjectedAnnotationPresent",
"(",
"MethodNode",
"methodNode",
")",
"{",
"AnnotationNode",
"injectedTraceAnnotation",
"=",
"getAnnotation",
"(",
"INJECTED_TRACE_TYPE",
".",
"getDescriptor"... | Check if the specified method has already been annotated as processed by the
trace injection framework.
@param methodNode the method to examine
@return true if a non-FFDC RAS method adapter processed the specified method | [
"Check",
"if",
"the",
"specified",
"method",
"has",
"already",
"been",
"annotated",
"as",
"processed",
"by",
"the",
"trace",
"injection",
"framework",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/LibertyTracePreprocessInstrumentation.java#L447-L469 | train | Checks if the method has already been injected and has an annotation present. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
private boolean isMethodAlreadyInjectedAnnotationPresent(MethodNode methodNode) {
AnnotationNode injectedTraceAnnotation = getAnnotation(INJECTED_TRACE_TYPE.getDescriptor(), methodNode.visibleAnnotations);
Annota... |
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.getDocumentFromUrl | public static org.jsoup.nodes.Document getDocumentFromUrl(String url) throws IOException {
return Jsoup.connect(url).get();
} | java | public static org.jsoup.nodes.Document getDocumentFromUrl(String url) throws IOException {
return Jsoup.connect(url).get();
} | [
"public",
"static",
"org",
".",
"jsoup",
".",
"nodes",
".",
"Document",
"getDocumentFromUrl",
"(",
"String",
"url",
")",
"throws",
"IOException",
"{",
"return",
"Jsoup",
".",
"connect",
"(",
"url",
")",
".",
"get",
"(",
")",
";",
"}"
] | 获取HTML文档
@param url 链接
@return {@link org.jsoup.nodes.Document}
@throws IOException 异常 | [
"获取HTML文档"
] | 1fc9f0ead1108f4d7208ba7c000df4244f708418 | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L727-L729 | train | Get document from URL. | Of course, here is the Java code you requested:
```java
public static org.jsoup.nodes.Document getDocumentFromUrl(String url) throws IOException {
return Jsoup.connect(url).get();
}
```
Hope this helps! |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassContext.java | ClassContext.getMethodAnalysis | public Object getMethodAnalysis(Class<?> analysisClass, MethodDescriptor methodDescriptor) {
Map<MethodDescriptor, Object> objectMap = getObjectMap(analysisClass);
return objectMap.get(methodDescriptor);
} | java | public Object getMethodAnalysis(Class<?> analysisClass, MethodDescriptor methodDescriptor) {
Map<MethodDescriptor, Object> objectMap = getObjectMap(analysisClass);
return objectMap.get(methodDescriptor);
} | [
"public",
"Object",
"getMethodAnalysis",
"(",
"Class",
"<",
"?",
">",
"analysisClass",
",",
"MethodDescriptor",
"methodDescriptor",
")",
"{",
"Map",
"<",
"MethodDescriptor",
",",
"Object",
">",
"objectMap",
"=",
"getObjectMap",
"(",
"analysisClass",
")",
";",
"r... | Retrieve a method analysis object.
@param analysisClass
class the method analysis object should belong to
@param methodDescriptor
method descriptor identifying the analyzed method
@return the analysis object | [
"Retrieve",
"a",
"method",
"analysis",
"object",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassContext.java#L169-L172 | train | Get the method analysis object for a method. | Of course, here is the Java code you requested:
```java
public Object getMethodAnalysis(Class<?> analysisClass, MethodDescriptor methodDescriptor) {
Map<MethodDescriptor, Object> objectMap = getObjectMap(analysisClass);
return objectMap.get(methodDescriptor);
}
```
Hope this helps! |
SahaginOrg/sahagin-java | src/main/java/org/sahagin/runlib/runresultsgen/StackLineUtils.java | StackLineUtils.getStackLine | private static StackLine getStackLine(SrcTree srcTree,
String classQualifiedName, String methodSimpleName, int line) {
StackLine rootStackLine = getStackLine(
srcTree.getRootMethodTable(), classQualifiedName, methodSimpleName, line);
if (rootStackLine != null) {
r... | java | private static StackLine getStackLine(SrcTree srcTree,
String classQualifiedName, String methodSimpleName, int line) {
StackLine rootStackLine = getStackLine(
srcTree.getRootMethodTable(), classQualifiedName, methodSimpleName, line);
if (rootStackLine != null) {
r... | [
"private",
"static",
"StackLine",
"getStackLine",
"(",
"SrcTree",
"srcTree",
",",
"String",
"classQualifiedName",
",",
"String",
"methodSimpleName",
",",
"int",
"line",
")",
"{",
"StackLine",
"rootStackLine",
"=",
"getStackLine",
"(",
"srcTree",
".",
"getRootMethodT... | null means method does not exists in srcTree | [
"null",
"means",
"method",
"does",
"not",
"exists",
"in",
"srcTree"
] | 7ace428adebe3466ceb5826bc9681f8e3d52be68 | https://github.com/SahaginOrg/sahagin-java/blob/7ace428adebe3466ceb5826bc9681f8e3d52be68/src/main/java/org/sahagin/runlib/runresultsgen/StackLineUtils.java#L92-L105 | train | Get the StackLine object from the SourceTree. | Of course, here is the Java code you requested:
```java
private static StackLine getStackLine(SrcTree srcTree,
String classQualifiedName, String methodSimpleName, int line) {
StackLine rootStackLine = getStackLine(
srcTree.getRootMethodTable(), classQualifiedName, methodSimpleName, ... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java | Vector.elements | public Enumeration<E> elements() {
return new Enumeration<E>() {
int count = 0;
public boolean hasMoreElements() {
return count < elementCount;
}
public E nextElement() {
synchronized (Vector.this) {
if (count ... | java | public Enumeration<E> elements() {
return new Enumeration<E>() {
int count = 0;
public boolean hasMoreElements() {
return count < elementCount;
}
public E nextElement() {
synchronized (Vector.this) {
if (count ... | [
"public",
"Enumeration",
"<",
"E",
">",
"elements",
"(",
")",
"{",
"return",
"new",
"Enumeration",
"<",
"E",
">",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"public",
"boolean",
"hasMoreElements",
"(",
")",
"{",
"return",
"count",
"<",
"elementCount... | Returns an enumeration of the components of this vector. The
returned {@code Enumeration} object will generate all items in
this vector. The first item generated is the item at index {@code 0},
then the item at index {@code 1}, and so on.
@return an enumeration of the components of this vector
@see Iterator | [
"Returns",
"an",
"enumeration",
"of",
"the",
"components",
"of",
"this",
"vector",
".",
"The",
"returned",
"{",
"@code",
"Enumeration",
"}",
"object",
"will",
"generate",
"all",
"items",
"in",
"this",
"vector",
".",
"The",
"first",
"item",
"generated",
"is",... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java#L338-L355 | train | Get an Enumeration of the elements in this Vector. | Of course, here is the Java code you requested:
```java
public Enumeration<E> elements() {
return new Enumeration<E>() {
int count = 0;
public boolean hasMoreElements() {
return count < elementCount;
}
public E nextElement() {
sy... |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/Misc.java | Misc.keyForPrefixMatch | public static Object keyForPrefixMatch(Object key, int depth) {
if (depth < 1)
return key;
if (key instanceof String) {
return (key + "\uFFFF");
} else if (key instanceof List) {
ArrayList<Map<String, Object>> nuKey = new ArrayList<Map<String, Object>>((List<M... | java | public static Object keyForPrefixMatch(Object key, int depth) {
if (depth < 1)
return key;
if (key instanceof String) {
return (key + "\uFFFF");
} else if (key instanceof List) {
ArrayList<Map<String, Object>> nuKey = new ArrayList<Map<String, Object>>((List<M... | [
"public",
"static",
"Object",
"keyForPrefixMatch",
"(",
"Object",
"key",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"depth",
"<",
"1",
")",
"return",
"key",
";",
"if",
"(",
"key",
"instanceof",
"String",
")",
"{",
"return",
"(",
"key",
"+",
"\"\\uFFFF\"... | in CBLMisc.m
id CBLKeyForPrefixMatch(id key, unsigned depth) | [
"in",
"CBLMisc",
".",
"m",
"id",
"CBLKeyForPrefixMatch",
"(",
"id",
"key",
"unsigned",
"depth",
")"
] | 3b275642e2d2f231fd155ad9def9c5e9eff3118e | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Misc.java#L78-L96 | train | keyForPrefixMatch This method is used to get the key for a prefix match. | Of course, here is the Java code you requested:
```java
public static Object keyForPrefixMatch(Object key, int depth) {
if (depth < 1)
return key;
if (key instanceof String) {
return (key + "\uFFFF");
} else if (key instanceof List) {
ArrayList<Map<String, Ob... |
jdereg/json-io | src/main/java/com/cedarsoftware/util/io/Resolver.java | Resolver.convertMapsToObjects | protected Object convertMapsToObjects(final JsonObject<String, Object> root)
{
final Deque<JsonObject<String, Object>> stack = new ArrayDeque<JsonObject<String, Object>>();
stack.addFirst(root);
while (!stack.isEmpty())
{
final JsonObject<String, Object> jsonObj = stack.... | java | protected Object convertMapsToObjects(final JsonObject<String, Object> root)
{
final Deque<JsonObject<String, Object>> stack = new ArrayDeque<JsonObject<String, Object>>();
stack.addFirst(root);
while (!stack.isEmpty())
{
final JsonObject<String, Object> jsonObj = stack.... | [
"protected",
"Object",
"convertMapsToObjects",
"(",
"final",
"JsonObject",
"<",
"String",
",",
"Object",
">",
"root",
")",
"{",
"final",
"Deque",
"<",
"JsonObject",
"<",
"String",
",",
"Object",
">",
">",
"stack",
"=",
"new",
"ArrayDeque",
"<",
"JsonObject",... | Walk a JsonObject (Map of String keys to values) and return the
Java object equivalent filled in as best as possible (everything
except unresolved reference fields or unresolved array/collection elements).
@param root JsonObject reference to a Map-of-Maps representation of the JSON
input after it has been completely r... | [
"Walk",
"a",
"JsonObject",
"(",
"Map",
"of",
"String",
"keys",
"to",
"values",
")",
"and",
"return",
"the",
"Java",
"object",
"equivalent",
"filled",
"in",
"as",
"best",
"as",
"possible",
"(",
"everything",
"except",
"unresolved",
"reference",
"fields",
"or"... | 763da4e6fac93367febfda4c790ab44967054ba7 | https://github.com/jdereg/json-io/blob/763da4e6fac93367febfda4c790ab44967054ba7/src/main/java/com/cedarsoftware/util/io/Resolver.java#L154-L189 | valid | Convert a list of maps to objects. | Of course, here is the Java code you requested:
```java
protected Object convertMapsToObjects(final JsonObject<String, Object> root)
{
final Deque<JsonObject<String, Object>> stack = new ArrayDeque<JsonObject<String, Object>>();
stack.addFirst(root);
while (!stack.isEmpty())
{
... |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/print/thread/SyncPageWorker.java | SyncPageWorker.get | public Object get(String strKey)
{
if (m_map != null)
return m_map.get(strKey);
return null;
} | java | public Object get(String strKey)
{
if (m_map != null)
return m_map.get(strKey);
return null;
} | [
"public",
"Object",
"get",
"(",
"String",
"strKey",
")",
"{",
"if",
"(",
"m_map",
"!=",
"null",
")",
"return",
"m_map",
".",
"get",
"(",
"strKey",
")",
";",
"return",
"null",
";",
"}"
] | Get saved property.
@param strKey
@return | [
"Get",
"saved",
"property",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/print/thread/SyncPageWorker.java#L113-L118 | train | Get the value of this record from the map. | Of course, here is the Java code you requested:
```java
public Object get(String strKey)
{
if (m_map != null)
return m_map.get(strKey);
return null;
}
```
Hope this helps! |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquerydatatransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClient.java | DataTransferServiceClient.updateTransferConfig | public final TransferConfig updateTransferConfig(
TransferConfig transferConfig, FieldMask updateMask) {
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
retur... | java | public final TransferConfig updateTransferConfig(
TransferConfig transferConfig, FieldMask updateMask) {
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
retur... | [
"public",
"final",
"TransferConfig",
"updateTransferConfig",
"(",
"TransferConfig",
"transferConfig",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateTransferConfigRequest",
"request",
"=",
"UpdateTransferConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setTransferConfig... | Updates a data transfer configuration. All fields must be set, even if they are not updated.
<p>Sample code:
<pre><code>
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfig transferConfig = TransferConfig.newBuilder().build();
FieldMask updateMask = FieldMas... | [
"Updates",
"a",
"data",
"transfer",
"configuration",
".",
"All",
"fields",
"must",
"be",
"set",
"even",
"if",
"they",
"are",
"not",
"updated",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquerydatatransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClient.java#L516-L525 | train | Update a transfer configuration. | Of course, here is the Java code you requested:
```java
public final TransferConfig updateTransferConfig(
TransferConfig transferConfig, FieldMask updateMask) {
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.... |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/proto/ProtoUtils.java | ProtoUtils.fromProto | public static SetAclAction fromProto(File.PSetAclAction pSetAclAction) {
if (pSetAclAction == null) {
throw new IllegalStateException("Null proto set acl action.");
}
switch (pSetAclAction) {
case REPLACE:
return SetAclAction.REPLACE;
case MODIFY:
return SetAclAction.MODIFY... | java | public static SetAclAction fromProto(File.PSetAclAction pSetAclAction) {
if (pSetAclAction == null) {
throw new IllegalStateException("Null proto set acl action.");
}
switch (pSetAclAction) {
case REPLACE:
return SetAclAction.REPLACE;
case MODIFY:
return SetAclAction.MODIFY... | [
"public",
"static",
"SetAclAction",
"fromProto",
"(",
"File",
".",
"PSetAclAction",
"pSetAclAction",
")",
"{",
"if",
"(",
"pSetAclAction",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Null proto set acl action.\"",
")",
";",
"}",
"switc... | Converts proto type to wire type.
@param pSetAclAction {@link File.PSetAclAction}
@return {@link SetAclAction} equivalent | [
"Converts",
"proto",
"type",
"to",
"wire",
"type",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/proto/ProtoUtils.java#L433-L451 | train | Converts a proto set acl action to a SetAclAction object. | Of course, here is the Java code you requested:
```java
public static SetAclAction fromProto(File.PSetAclAction pSetAclAction) {
if (pSetAclAction == null) {
throw new IllegalStateException("Null proto set acl action.");
}
switch (pSetAclAction) {
case REPLACE:
return SetAclAction.REPLA... |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt.cdi/src/com/ibm/ws/security/mp/jwt/cdi/ClaimBean.java | ClaimBean.getQualifiers | @Override
public Set<Annotation> getQualifiers() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "getQualifiers");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "getQualifiers", qualifiers);
... | java | @Override
public Set<Annotation> getQualifiers() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "getQualifiers");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "getQualifiers", qualifiers);
... | [
"@",
"Override",
"public",
"Set",
"<",
"Annotation",
">",
"getQualifiers",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"g... | {@inheritDoc} | [
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt.cdi/src/com/ibm/ws/security/mp/jwt/cdi/ClaimBean.java#L391-L401 | train | Returns the qualifiers of this class. | Of course, here is the Java code you requested:
```java
@Override
public Set<Annotation> getQualifiers() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "getQualifiers");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
... |
rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java | OptionsAndArgs.getPid | public String getPid() {
String arg = extraArgs.size() > 0 ? extraArgs.get(0) : null;
return arg != null && arg.matches("^\\d+$") ? arg : null;
} | java | public String getPid() {
String arg = extraArgs.size() > 0 ? extraArgs.get(0) : null;
return arg != null && arg.matches("^\\d+$") ? arg : null;
} | [
"public",
"String",
"getPid",
"(",
")",
"{",
"String",
"arg",
"=",
"extraArgs",
".",
"size",
"(",
")",
">",
"0",
"?",
"extraArgs",
".",
"get",
"(",
"0",
")",
":",
"null",
";",
"return",
"arg",
"!=",
"null",
"&&",
"arg",
".",
"matches",
"(",
"\"^\... | Process id as given as argument (if any). If a pattern for matching the process name is used, this
method returns null.
@return process id or null | [
"Process",
"id",
"as",
"given",
"as",
"argument",
"(",
"if",
"any",
")",
".",
"If",
"a",
"pattern",
"for",
"matching",
"the",
"process",
"name",
"is",
"used",
"this",
"method",
"returns",
"null",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java#L161-L164 | train | Gets the pid. | Of course, here is the Java code you requested:
```java
public String getPid() {
String arg = extraArgs.size() > 0 ? extraArgs.get(0) : null;
return arg != null && arg.matches("^\\d+$") ? arg : null;
}
```
Hope this helps! |
JDBDT/jdbdt | src/main/java/org/jdbdt/Log.java | Log.write | void write(CallInfo callInfo, SimpleAssertion assertion) {
Element rootNode = root(callInfo);
if (assertion.getSource() != null) {
write(rootNode, assertion.getSource());
}
Element saNode = createNode(rootNode, SIMPLE_ASSERTION_TAG);
if (! assertion.passed()) {
Element errorsNode = creat... | java | void write(CallInfo callInfo, SimpleAssertion assertion) {
Element rootNode = root(callInfo);
if (assertion.getSource() != null) {
write(rootNode, assertion.getSource());
}
Element saNode = createNode(rootNode, SIMPLE_ASSERTION_TAG);
if (! assertion.passed()) {
Element errorsNode = creat... | [
"void",
"write",
"(",
"CallInfo",
"callInfo",
",",
"SimpleAssertion",
"assertion",
")",
"{",
"Element",
"rootNode",
"=",
"root",
"(",
"callInfo",
")",
";",
"if",
"(",
"assertion",
".",
"getSource",
"(",
")",
"!=",
"null",
")",
"{",
"write",
"(",
"rootNod... | Log simple assertion.
@param callInfo Call info.
@param assertion Delta assertion. | [
"Log",
"simple",
"assertion",
"."
] | 7e32845ad41dfbc5d6fd0fd561e3613697186df4 | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/Log.java#L298-L312 | train | Write a SimpleAssertion to the XML file. | Of course, here is the Java code you requested:
```java
void write(CallInfo callInfo, SimpleAssertion assertion) {
Element rootNode = root(callInfo);
if (assertion.getSource() != null) {
write(rootNode, assertion.getSource());
}
Element saNode = createNode(rootNode, SIMPLE_ASSERTION_TAG);
if ... |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/log/DULogEntry.java | DULogEntry.addDataUsage | public boolean addDataUsage(DataAttribute attribute, DataUsage usage) throws ParameterException, LockingException {
Validate.notNull(attribute);
if (isFieldLocked(EntryField.DATA)) {
if (!dataUsage.containsKey(attribute)) {
throw n... | java | public boolean addDataUsage(DataAttribute attribute, DataUsage usage) throws ParameterException, LockingException {
Validate.notNull(attribute);
if (isFieldLocked(EntryField.DATA)) {
if (!dataUsage.containsKey(attribute)) {
throw n... | [
"public",
"boolean",
"addDataUsage",
"(",
"DataAttribute",
"attribute",
",",
"DataUsage",
"usage",
")",
"throws",
"ParameterException",
",",
"LockingException",
"{",
"Validate",
".",
"notNull",
"(",
"attribute",
")",
";",
"if",
"(",
"isFieldLocked",
"(",
"EntryFie... | Adds the given attribute to the list of attributes
@param attribute The attribute to add.
@param usage The data usage
@throws ParameterException if the given attribute or usage is
<code>null</code>.
@throws LockingException if the field INPUT_DATA is locked <br>
and the attribute is not already contained in {@link #da... | [
"Adds",
"the",
"given",
"attribute",
"to",
"the",
"list",
"of",
"attributes"
] | e791cb07a6e62ecf837d760d58a25f32fbf6bbca | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/DULogEntry.java#L154-L171 | train | Add a data usage to the entry. | Of course, here is the Java code you requested:
```java
public boolean addDataUsage(DataAttribute attribute, DataUsage usage) throws ParameterException, LockingException {
Validate.notNull(attribute);
if (isFieldLocked(EntryField.DATA)) {
if (!dataUsage.contains... |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/modules/CmsModulesDelete.java | CmsModulesDelete.actionReport | public void actionReport() throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
switch (getAction()) {
case ACTION_CONFIRMED:
default:
... | java | public void actionReport() throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
switch (getAction()) {
case ACTION_CONFIRMED:
default:
... | [
"public",
"void",
"actionReport",
"(",
")",
"throws",
"JspException",
"{",
"// save initialized instance of this class in request attribute for included sub-elements",
"getJsp",
"(",
")",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"SESSION_WORKPLACE_CLASS",
",",
... | Performs the re-initialization report, will be called by the JSP page.<p>
@throws JspException if including the error JSP element fails | [
"Performs",
"the",
"re",
"-",
"initialization",
"report",
"will",
"be",
"called",
"by",
"the",
"JSP",
"page",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsModulesDelete.java#L90-L114 | train | Action called to display the report in correct layout. | Of course, here is the Java code you requested:
```java
public void actionReport() throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
switch (getAction()) {
... |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java | AbstractPacketOutputStream.checkMaxAllowedLength | public void checkMaxAllowedLength(int length) throws MaxAllowedPacketException {
if (cmdLength + length >= maxAllowedPacket && cmdLength == 0) {
//launch exception only if no packet has been send.
throw new MaxAllowedPacketException("query size (" + (cmdLength + length)
+ ") is >= to max_allow... | java | public void checkMaxAllowedLength(int length) throws MaxAllowedPacketException {
if (cmdLength + length >= maxAllowedPacket && cmdLength == 0) {
//launch exception only if no packet has been send.
throw new MaxAllowedPacketException("query size (" + (cmdLength + length)
+ ") is >= to max_allow... | [
"public",
"void",
"checkMaxAllowedLength",
"(",
"int",
"length",
")",
"throws",
"MaxAllowedPacketException",
"{",
"if",
"(",
"cmdLength",
"+",
"length",
">=",
"maxAllowedPacket",
"&&",
"cmdLength",
"==",
"0",
")",
"{",
"//launch exception only if no packet has been send... | Count query size. If query size is greater than max_allowed_packet and nothing has been already
send, throw an exception to avoid having the connection closed.
@param length additional length to query size
@throws MaxAllowedPacketException if query has not to be send. | [
"Count",
"query",
"size",
".",
"If",
"query",
"size",
"is",
"greater",
"than",
"max_allowed_packet",
"and",
"nothing",
"has",
"been",
"already",
"send",
"throw",
"an",
"exception",
"to",
"avoid",
"having",
"the",
"connection",
"closed",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L211-L217 | train | check max allowed length | Of course, here is the Java code you requested:
```java
public void checkMaxAllowedLength(int length) throws MaxAllowedPacketException {
if (cmdLength + length >= maxAllowedPacket && cmdLength == 0) {
//launch exception only if no packet has been send.
throw new MaxAllowedPacketException("query size ("... |
Yubico/yubico-java-client | jaas/src/main/java/com/yubico/jaas/impl/YubikeyToUserMapImpl.java | YubikeyToUserMapImpl.add_yubikey_to_user | private void add_yubikey_to_user(String publicId, String username, String filename) {
try {
File file = new File(filename);
FileWriter writer = new FileWriter(file, true);
writer.write("yk." + publicId + ".user = " + username
+ System.getProperty("line.separator"));
writer.close();
} catch (IOExcep... | java | private void add_yubikey_to_user(String publicId, String username, String filename) {
try {
File file = new File(filename);
FileWriter writer = new FileWriter(file, true);
writer.write("yk." + publicId + ".user = " + username
+ System.getProperty("line.separator"));
writer.close();
} catch (IOExcep... | [
"private",
"void",
"add_yubikey_to_user",
"(",
"String",
"publicId",
",",
"String",
"username",
",",
"String",
"filename",
")",
"{",
"try",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"filename",
")",
";",
"FileWriter",
"writer",
"=",
"new",
"FileWriter",
... | Stores an association between username and YubiKey publicId in filename.
@param publicId YubiKey public ID to associate with user
@param username username to associate with a YubiKey public ID
@param filename name of the file to store to | [
"Stores",
"an",
"association",
"between",
"username",
"and",
"YubiKey",
"publicId",
"in",
"filename",
"."
] | 263b09c6ab0ee54b0dc7d70516989abab981796f | https://github.com/Yubico/yubico-java-client/blob/263b09c6ab0ee54b0dc7d70516989abab981796f/jaas/src/main/java/com/yubico/jaas/impl/YubikeyToUserMapImpl.java#L168-L178 | test | Add a yubikey to the user. | Of course, here is the Java code you requested:
```java
private void add_yubikey_to_user(String publicId, String username, String filename) {
try {
File file = new File(filename);
FileWriter writer = new FileWriter(file, true);
writer.write("yk." + publicId + ".user = " + username
+ System.getProperty(... |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/monad/transformer/builtin/EitherT.java | EitherT.discardR | @Override
public <B> EitherT<M, L, R> discardR(Applicative<B, MonadT<M, Either<L, ?>, ?>> appB) {
return MonadT.super.discardR(appB).coerce();
} | java | @Override
public <B> EitherT<M, L, R> discardR(Applicative<B, MonadT<M, Either<L, ?>, ?>> appB) {
return MonadT.super.discardR(appB).coerce();
} | [
"@",
"Override",
"public",
"<",
"B",
">",
"EitherT",
"<",
"M",
",",
"L",
",",
"R",
">",
"discardR",
"(",
"Applicative",
"<",
"B",
",",
"MonadT",
"<",
"M",
",",
"Either",
"<",
"L",
",",
"?",
">",
",",
"?",
">",
">",
"appB",
")",
"{",
"return",... | {@inheritDoc} | [
"{"
] | b643ba836c5916d1d8193822e5efb4e7b40c489a | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/monad/transformer/builtin/EitherT.java#L98-L101 | train | Coerce to a CTAG type | Of course, here is the Java code you requested:
```java
@Override
public <B> EitherT<M, L, R> discardR(Applicative<B, MonadT<M, Either<L, ?>, ?>> appB) {
return MonadT.super.discardR(appB).coerce();
}
```
Hope this helps! |
rackerlabs/blueflood | blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/AbstractElasticIO.java | AbstractElasticIO.getMetricNamesFromES | private String getMetricNamesFromES(final String tenant, final String regexMetricName) throws IOException {
String metricNamesFromElasticsearchQueryString = String.format(queryToFetchMetricNamesFromElasticsearchFormat,
tenant, regexMetricName, regexMetricName);
return elasticsearchRestH... | java | private String getMetricNamesFromES(final String tenant, final String regexMetricName) throws IOException {
String metricNamesFromElasticsearchQueryString = String.format(queryToFetchMetricNamesFromElasticsearchFormat,
tenant, regexMetricName, regexMetricName);
return elasticsearchRestH... | [
"private",
"String",
"getMetricNamesFromES",
"(",
"final",
"String",
"tenant",
",",
"final",
"String",
"regexMetricName",
")",
"throws",
"IOException",
"{",
"String",
"metricNamesFromElasticsearchQueryString",
"=",
"String",
".",
"format",
"(",
"queryToFetchMetricNamesFro... | Performs terms aggregation by metric_name which returns doc_count by
metric_name index that matches the given regex.
Sample request body:
{
"size": 0,
"query": {
"bool" : {
"must" : [ {
"term" : {
"tenantId" : "ratanasv"
}
}, {
"regexp" : {
"metric_name" : {
"value" : "<regex>"
}
}
} ]
}
},
"aggs": {
"metric_name_tok... | [
"Performs",
"terms",
"aggregation",
"by",
"metric_name",
"which",
"returns",
"doc_count",
"by",
"metric_name",
"index",
"that",
"matches",
"the",
"given",
"regex",
"."
] | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/AbstractElasticIO.java#L232-L241 | test | Get the metric names from elasticsearch. | Of course, here is the Java code you requested:
```java
private String getMetricNamesFromES(final String tenant, final String regexMetricName) throws IOException {
String metricNamesFromElasticsearchQueryString = String.format(queryToFetchMetricNamesFromElasticsearchFormat,
tenant, regexMetricN... |
samskivert/pythagoras | src/main/java/pythagoras/d/QuadCurve.java | QuadCurve.setCurve | public void setCurve (IQuadCurve curve) {
setCurve(curve.x1(), curve.y1(), curve.ctrlX(), curve.ctrlY(),
curve.x2(), curve.y2());
} | java | public void setCurve (IQuadCurve curve) {
setCurve(curve.x1(), curve.y1(), curve.ctrlX(), curve.ctrlY(),
curve.x2(), curve.y2());
} | [
"public",
"void",
"setCurve",
"(",
"IQuadCurve",
"curve",
")",
"{",
"setCurve",
"(",
"curve",
".",
"x1",
"(",
")",
",",
"curve",
".",
"y1",
"(",
")",
",",
"curve",
".",
"ctrlX",
"(",
")",
",",
"curve",
".",
"ctrlY",
"(",
")",
",",
"curve",
".",
... | Configures the start, control, and end points for this curve to be the same as the supplied
curve. | [
"Configures",
"the",
"start",
"control",
"and",
"end",
"points",
"for",
"this",
"curve",
"to",
"be",
"the",
"same",
"as",
"the",
"supplied",
"curve",
"."
] | b8fea743ee8a7d742ad9c06ee4f11f50571fbd32 | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/QuadCurve.java#L90-L93 | train | Set the curve of the tca. | Of course, here is the Java code you requested:
```java
public void setCurve (IQuadCurve curve) {
setCurve(curve.x1(), curve.y1(), curve.ctrlX(), curve.ctrlY(),
curve.x2(), curve.y2());
}
```
Hope this helps! |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/dom/CSSImportRuleImpl.java | CSSImportRuleImpl.getCssText | @Override
public String getCssText() {
final StringBuilder sb = new StringBuilder();
sb.append("@import");
final String href = getHref();
if (null != href) {
sb.append(" url(").append(href).append(")");
}
final MediaListImpl ml = getMedia();
if (... | java | @Override
public String getCssText() {
final StringBuilder sb = new StringBuilder();
sb.append("@import");
final String href = getHref();
if (null != href) {
sb.append(" url(").append(href).append(")");
}
final MediaListImpl ml = getMedia();
if (... | [
"@",
"Override",
"public",
"String",
"getCssText",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"@import\"",
")",
";",
"final",
"String",
"href",
"=",
"getHref",
"(",
")",
";",
"... | {@inheritDoc} | [
"{"
] | 384e4170737169b5b4c87c5766495d9b8a6d3866 | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/dom/CSSImportRuleImpl.java#L56-L72 | train | Get the CSS text of the CRA. | Of course, here is the Java code you requested:
```java
@Override
public String getCssText() {
final StringBuilder sb = new StringBuilder();
sb.append("@import");
final String href = getHref();
if (null != href) {
sb.append(" url(").append(href).append(")");
}
... |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/transform/ParameterReplacer.java | ParameterReplacer.setRowId | public void setRowId(String parameterName, RowId x) {
recordByName(parameterName, getDeclaredMethod(CallableStatement.class, "setRowId", String.class, RowId.class), parameterName, x);
} | java | public void setRowId(String parameterName, RowId x) {
recordByName(parameterName, getDeclaredMethod(CallableStatement.class, "setRowId", String.class, RowId.class), parameterName, x);
} | [
"public",
"void",
"setRowId",
"(",
"String",
"parameterName",
",",
"RowId",
"x",
")",
"{",
"recordByName",
"(",
"parameterName",
",",
"getDeclaredMethod",
"(",
"CallableStatement",
".",
"class",
",",
"\"setRowId\"",
",",
"String",
".",
"class",
",",
"RowId",
"... | since 1.6 | [
"since",
"1",
".",
"6"
] | 62163ccf9a569a99aa3ad9f9151a32567447a62e | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/transform/ParameterReplacer.java#L376-L378 | train | Sets the value of the designated parameter to the given row id. | Of course, here is the Java code you requested:
```java
public void setRowId(String parameterName, RowId x) {
recordByName(parameterName, getDeclaredMethod(CallableStatement.class, "setRowId", String.class, RowId.class), parameterName, x);
}
```
Hope this helps! |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java | Ifc2x3tc1PackageImpl.getIfcDimensionExtentUsage | public EEnum getIfcDimensionExtentUsage() {
if (ifcDimensionExtentUsageEEnum == null) {
ifcDimensionExtentUsageEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(810);
}
return ifcDimensionExtentUsageEEnum;
} | java | public EEnum getIfcDimensionExtentUsage() {
if (ifcDimensionExtentUsageEEnum == null) {
ifcDimensionExtentUsageEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(810);
}
return ifcDimensionExtentUsageEEnum;
} | [
"public",
"EEnum",
"getIfcDimensionExtentUsage",
"(",
")",
"{",
"if",
"(",
"ifcDimensionExtentUsageEEnum",
"==",
"null",
")",
"{",
"ifcDimensionExtentUsageEEnum",
"=",
"(",
"EEnum",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"Ifc2x... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L36843-L36849 | train | Get the EEnum of the Ifc2x3tc1DimensionUsage feature. | Of course, here is the Java code you requested:
```java
public EEnum getIfcDimensionExtentUsage() {
if (ifcDimensionExtentUsageEEnum == null) {
ifcDimensionExtentUsageEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(810);
}
return ifcDimensionEx... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/CryptoHash.java | CryptoHash.hash | public static void hash(byte[] data, byte[] output) {
int len = output.length;
if (len == 0)
return;
int[] code = calculate(data);
for (int outIndex = 0, codeIndex = 0, shift = 24;
outIndex < len && codeIndex < 5;
++outIndex, shift -= 8) {
output[outIndex] = (byte... | java | public static void hash(byte[] data, byte[] output) {
int len = output.length;
if (len == 0)
return;
int[] code = calculate(data);
for (int outIndex = 0, codeIndex = 0, shift = 24;
outIndex < len && codeIndex < 5;
++outIndex, shift -= 8) {
output[outIndex] = (byte... | [
"public",
"static",
"void",
"hash",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"output",
")",
"{",
"int",
"len",
"=",
"output",
".",
"length",
";",
"if",
"(",
"len",
"==",
"0",
")",
"return",
";",
"int",
"[",
"]",
"code",
"=",
"calcu... | Calculates the SHA-1 hash code of the input data and writes up to
20 bytes of it in the output byte array parameter.
@param data the byte array to be hashed
@param output output parameter for the calculated hash code | [
"Calculates",
"the",
"SHA",
"-",
"1",
"hash",
"code",
"of",
"the",
"input",
"data",
"and",
"writes",
"up",
"to",
"20",
"bytes",
"of",
"it",
"in",
"the",
"output",
"byte",
"array",
"parameter",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/CryptoHash.java#L43-L57 | train | This method is used to calculate a hash code from the input byte array and store it in output. | Of course, here is the Java code you requested:
```java
public static void hash(byte[] data, byte[] output) {
int len = output.length;
if (len == 0)
return;
int[] code = calculate(data);
for (int outIndex = 0, codeIndex = 0, shift = 24;
outIndex < len && codeIndex < 5;
... |
jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.dataLinkType | @ConditionalOnClass({Context.class, DataLinkType.class})
//@ConditionalOnBean(Context.class)
@Bean(DATALINK_TYPE_BEAN_NAME)
public DataLinkType dataLinkType(@Qualifier(CONTEXT_BEAN_NAME) Context context) {
DataLinkType dataLinkType = context.pcapDataLink();
if (LOGGER.isDebugEnabled()) {
... | java | @ConditionalOnClass({Context.class, DataLinkType.class})
//@ConditionalOnBean(Context.class)
@Bean(DATALINK_TYPE_BEAN_NAME)
public DataLinkType dataLinkType(@Qualifier(CONTEXT_BEAN_NAME) Context context) {
DataLinkType dataLinkType = context.pcapDataLink();
if (LOGGER.isDebugEnabled()) {
... | [
"@",
"ConditionalOnClass",
"(",
"{",
"Context",
".",
"class",
",",
"DataLinkType",
".",
"class",
"}",
")",
"//@ConditionalOnBean(Context.class)",
"@",
"Bean",
"(",
"DATALINK_TYPE_BEAN_NAME",
")",
"public",
"DataLinkType",
"dataLinkType",
"(",
"@",
"Qualifier",
"(",
... | A handle link type.
@param context application context.
@return returns {@link com.ardikars.jxpacket.common.layer.DataLinkLayer}. | [
"A",
"handle",
"link",
"type",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L216-L225 | train | Data link type. | Of course, here is the Java code you requested:
```java
@ConditionalOnClass({Context.class, DataLinkType.class})
//@ConditionalOnBean(Context.class)
@Bean(DATALINK_TYPE_BEAN_NAME)
public DataLinkType dataLinkType(@Qualifier(CONTEXT_BEAN_NAME) Context context) {
DataLinkType dataLinkType = context.p... |
xm-online/xm-commons | xm-commons-request/src/main/java/com/icthh/xm/commons/request/internal/DataAdapterXmPrivilegedRequestContext.java | DataAdapterXmPrivilegedRequestContext.getValueOrDefault | @Override
public <T> T getValueOrDefault(String key, Class<T> type, T defaultValue) {
return data.getValueOrDefault(key, type, defaultValue);
} | java | @Override
public <T> T getValueOrDefault(String key, Class<T> type, T defaultValue) {
return data.getValueOrDefault(key, type, defaultValue);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"getValueOrDefault",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"defaultValue",
")",
"{",
"return",
"data",
".",
"getValueOrDefault",
"(",
"key",
",",
"type",
",",
"defaultValue",
... | {@inheritDoc} | [
"{"
] | 43eb2273adb96f40830d7b905ee3a767b8715caf | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-request/src/main/java/com/icthh/xm/commons/request/internal/DataAdapterXmPrivilegedRequestContext.java#L53-L56 | train | Get a value from the cache. | Of course, here is the Java code you requested:
```java
@Override
public <T> T getValueOrDefault(String key, Class<T> type, T defaultValue) {
return data.getValueOrDefault(key, type, defaultValue);
}
```
Hope this helps! |
Jasig/uPortal | uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/RemoteUserSecurityContext.java | RemoteUserSecurityContext.authenticate | @Override
public synchronized void authenticate() throws PortalSecurityException {
if (this.remoteUser != null) {
// Set the UID for the principal
this.myPrincipal.setUID(this.remoteUser);
// Check that the principal UID matches the remote user
final String n... | java | @Override
public synchronized void authenticate() throws PortalSecurityException {
if (this.remoteUser != null) {
// Set the UID for the principal
this.myPrincipal.setUID(this.remoteUser);
// Check that the principal UID matches the remote user
final String n... | [
"@",
"Override",
"public",
"synchronized",
"void",
"authenticate",
"(",
")",
"throws",
"PortalSecurityException",
"{",
"if",
"(",
"this",
".",
"remoteUser",
"!=",
"null",
")",
"{",
"// Set the UID for the principal",
"this",
".",
"myPrincipal",
".",
"setUID",
"(",... | Verify that remoteUser is not null and set the principal's UID to this value.
@exception PortalSecurityException | [
"Verify",
"that",
"remoteUser",
"is",
"not",
"null",
"and",
"set",
"the",
"principal",
"s",
"UID",
"to",
"this",
"value",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/RemoteUserSecurityContext.java#L68-L100 | train | Override authenticate to check if the remote user is set. | Of course, here is the Java code you requested:
```java
@Override
public synchronized void authenticate() throws PortalSecurityException {
if (this.remoteUser != null) {
// Set the UID for the principal
this.myPrincipal.setUID(this.remoteUser);
// Check that the princip... |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/proto/ProtoUtils.java | ProtoUtils.toProto | public static File.PSetAclAction toProto(SetAclAction aclAction) {
switch (aclAction) {
case REPLACE:
return File.PSetAclAction.REPLACE;
case MODIFY:
return File.PSetAclAction.MODIFY;
case REMOVE:
return File.PSetAclAction.REMOVE;
case REMOVE_ALL:
return File.... | java | public static File.PSetAclAction toProto(SetAclAction aclAction) {
switch (aclAction) {
case REPLACE:
return File.PSetAclAction.REPLACE;
case MODIFY:
return File.PSetAclAction.MODIFY;
case REMOVE:
return File.PSetAclAction.REMOVE;
case REMOVE_ALL:
return File.... | [
"public",
"static",
"File",
".",
"PSetAclAction",
"toProto",
"(",
"SetAclAction",
"aclAction",
")",
"{",
"switch",
"(",
"aclAction",
")",
"{",
"case",
"REPLACE",
":",
"return",
"File",
".",
"PSetAclAction",
".",
"REPLACE",
";",
"case",
"MODIFY",
":",
"return... | Converts wire type to proto type.
@param aclAction the acl action to convert
@return {@link File.PSetAclAction} equivalent | [
"Converts",
"wire",
"type",
"to",
"proto",
"type",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/proto/ProtoUtils.java#L205-L220 | train | Converts a CBE SetAclAction to a proto type. | Of course, here is the Java code you requested:
```java
public static File.PSetAclAction toProto(SetAclAction aclAction) {
switch (aclAction) {
case REPLACE:
return File.PSetAclAction.REPLACE;
case MODIFY:
return File.PSetAclAction.MODIFY;
case REMOVE:
return File.PSetAclA... |
ZuInnoTe/hadoopoffice | fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/parser/msexcel/internal/XSSFPullParser.java | XSSFPullParser.parseCellInlineStringText | private String parseCellInlineStringText(XMLEventReader xer)
throws XMLStreamException, FormatNotUnderstoodException {
String result = "";
XMLEvent xe;
while ((xe = xer.nextTag()).isStartElement()) {
String elementName = xe.asStartElement().getName().getLocalPart().toUpperCase();
switch (elementName) {
... | java | private String parseCellInlineStringText(XMLEventReader xer)
throws XMLStreamException, FormatNotUnderstoodException {
String result = "";
XMLEvent xe;
while ((xe = xer.nextTag()).isStartElement()) {
String elementName = xe.asStartElement().getName().getLocalPart().toUpperCase();
switch (elementName) {
... | [
"private",
"String",
"parseCellInlineStringText",
"(",
"XMLEventReader",
"xer",
")",
"throws",
"XMLStreamException",
",",
"FormatNotUnderstoodException",
"{",
"String",
"result",
"=",
"\"\"",
";",
"XMLEvent",
"xe",
";",
"while",
"(",
"(",
"xe",
"=",
"xer",
".",
... | Parses an inline string from cell in XML format
@param xer XMLEventReader from which to read the inline string content
@throws XMLStreamException in case the string item cannot be
correctly read from the XML file
@throws FormatNotUnderstoodException in case a string cannot be identified in
cell | [
"Parses",
"an",
"inline",
"string",
"from",
"cell",
"in",
"XML",
"format"
] | 58fc9223ee290bcb14847aaaff3fadf39c465e46 | https://github.com/ZuInnoTe/hadoopoffice/blob/58fc9223ee290bcb14847aaaff3fadf39c465e46/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/parser/msexcel/internal/XSSFPullParser.java#L238-L262 | train | Parse an inline string. | Of course, here is the Java code you requested:
```java
private String parseCellInlineStringText(XMLEventReader xer)
throws XMLStreamException, FormatNotUnderstoodException {
String result = "";
XMLEvent xe;
while ((xe = xer.nextTag()).isStartElement()) {
String elementName = xe.asStartElement().getName().... |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDateTime.java | LocalDateTime.fromDateFields | @SuppressWarnings("deprecation")
public static LocalDateTime fromDateFields(Date date) {
if (date == null) {
throw new IllegalArgumentException("The date must not be null");
}
if (date.getTime() < 0) {
// handle years in era BC
GregorianCalendar cal = new ... | java | @SuppressWarnings("deprecation")
public static LocalDateTime fromDateFields(Date date) {
if (date == null) {
throw new IllegalArgumentException("The date must not be null");
}
if (date.getTime() < 0) {
// handle years in era BC
GregorianCalendar cal = new ... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"LocalDateTime",
"fromDateFields",
"(",
"Date",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The date must not be null\"",
... | Constructs a LocalDateTime from a <code>java.util.Date</code>
using exactly the same field values.
<p>
Each field is queried from the Date and assigned to the LocalDateTime.
This is useful if you have been using the Date as a local date,
ignoring the zone.
<p>
One advantage of this method is that this method is unaffec... | [
"Constructs",
"a",
"LocalDateTime",
"from",
"a",
"<code",
">",
"java",
".",
"util",
".",
"Date<",
"/",
"code",
">",
"using",
"exactly",
"the",
"same",
"field",
"values",
".",
"<p",
">",
"Each",
"field",
"is",
"queried",
"from",
"the",
"Date",
"and",
"a... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDateTime.java#L232-L252 | train | This method is a convenience method for creating a LocalDateTime from a Date object. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
public static LocalDateTime fromDateFields(Date date) {
if (date == null) {
throw new IllegalArgumentException("The date must not be null");
}
if (date.getTime() < 0) {
// handle... |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/StorageCredentialsSharedAccessSignature.java | StorageCredentialsSharedAccessSignature.transformUri | @Override
public StorageUri transformUri(StorageUri resourceUri, OperationContext opContext) throws URISyntaxException,
StorageException {
return new StorageUri(this.transformUri(resourceUri.getPrimaryUri(), opContext), this.transformUri(
resourceUri.getSecondaryUri(), opContext)... | java | @Override
public StorageUri transformUri(StorageUri resourceUri, OperationContext opContext) throws URISyntaxException,
StorageException {
return new StorageUri(this.transformUri(resourceUri.getPrimaryUri(), opContext), this.transformUri(
resourceUri.getSecondaryUri(), opContext)... | [
"@",
"Override",
"public",
"StorageUri",
"transformUri",
"(",
"StorageUri",
"resourceUri",
",",
"OperationContext",
"opContext",
")",
"throws",
"URISyntaxException",
",",
"StorageException",
"{",
"return",
"new",
"StorageUri",
"(",
"this",
".",
"transformUri",
"(",
... | Transforms a resource URI into a shared access signature URI, by appending a shared access token and using the
specified operation context.
@param resourceUri
A <code>StorageUri</code> object that represents the resource URI to be transformed.
@param opContext
An {@link OperationContext} object that represents the con... | [
"Transforms",
"a",
"resource",
"URI",
"into",
"a",
"shared",
"access",
"signature",
"URI",
"by",
"appending",
"a",
"shared",
"access",
"token",
"and",
"using",
"the",
"specified",
"operation",
"context",
"."
] | 2c643c37c6b8c9081058add284c601a2393afc93 | https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/StorageCredentialsSharedAccessSignature.java#L138-L143 | valid | Transform a CRS URI to a CRS URI. | Of course, here is the Java code you requested:
```java
@Override
public StorageUri transformUri(StorageUri resourceUri, OperationContext opContext) throws URISyntaxException,
StorageException {
return new StorageUri(this.transformUri(resourceUri.getPrimaryUri(), opContext), this.transformUri(
... |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java | ChangesKey.writeExternal | @Override
public void writeExternal(ObjectOutput out) throws IOException
{
super.writeExternal(out);
byte[] buf = wsId.getBytes(Constants.DEFAULT_ENCODING);
out.writeInt(buf.length);
out.write(buf);
} | java | @Override
public void writeExternal(ObjectOutput out) throws IOException
{
super.writeExternal(out);
byte[] buf = wsId.getBytes(Constants.DEFAULT_ENCODING);
out.writeInt(buf.length);
out.write(buf);
} | [
"@",
"Override",
"public",
"void",
"writeExternal",
"(",
"ObjectOutput",
"out",
")",
"throws",
"IOException",
"{",
"super",
".",
"writeExternal",
"(",
"out",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"wsId",
".",
"getBytes",
"(",
"Constants",
".",
"DEFAULT_E... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java#L62-L69 | train | Writes the data of the
object to the specified output stream. | Of course, here is the Java code you requested:
```java
@Override
public void writeExternal(ObjectOutput out) throws IOException
{
super.writeExternal(out);
byte[] buf = wsId.getBytes(Constants.DEFAULT_ENCODING);
out.writeInt(buf.length);
out.write(buf);
}
```
Hope this helps! |
meertensinstituut/mtas | src/main/java/mtas/analysis/token/MtasTokenCollection.java | MtasTokenCollection.add | public Integer add(MtasToken token) {
Integer id = token.getId();
tokenCollection.put(id, token);
return id;
} | java | public Integer add(MtasToken token) {
Integer id = token.getId();
tokenCollection.put(id, token);
return id;
} | [
"public",
"Integer",
"add",
"(",
"MtasToken",
"token",
")",
"{",
"Integer",
"id",
"=",
"token",
".",
"getId",
"(",
")",
";",
"tokenCollection",
".",
"put",
"(",
"id",
",",
"token",
")",
";",
"return",
"id",
";",
"}"
] | Adds the.
@param token the token
@return the integer | [
"Adds",
"the",
"."
] | f02ae730848616bd88b553efa7f9eddc32818e64 | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/token/MtasTokenCollection.java#L41-L45 | train | Add a new token to the token collection. | Of course, here is the Java code you requested:
```java
public Integer add(MtasToken token) {
Integer id = token.getId();
tokenCollection.put(id, token);
return id;
}
```
Hope this helps! |
io7m/jtensors | com.io7m.jtensors.generators/src/main/java/com/io7m/jtensors/generators/Vector2FGenerator.java | Vector2FGenerator.create | public static Generator<Vector2F> create()
{
return new Vector2FGenerator(PrimitiveGenerators.doubles(
GeneratorConstants.BOUND_LARGE_FLOAT_LOWER,
GeneratorConstants.BOUND_LARGE_FLOAT_UPPER
));
} | java | public static Generator<Vector2F> create()
{
return new Vector2FGenerator(PrimitiveGenerators.doubles(
GeneratorConstants.BOUND_LARGE_FLOAT_LOWER,
GeneratorConstants.BOUND_LARGE_FLOAT_UPPER
));
} | [
"public",
"static",
"Generator",
"<",
"Vector2F",
">",
"create",
"(",
")",
"{",
"return",
"new",
"Vector2FGenerator",
"(",
"PrimitiveGenerators",
".",
"doubles",
"(",
"GeneratorConstants",
".",
"BOUND_LARGE_FLOAT_LOWER",
",",
"GeneratorConstants",
".",
"BOUND_LARGE_FL... | Create a generator initialized with a default component generator.
@return A generator | [
"Create",
"a",
"generator",
"initialized",
"with",
"a",
"default",
"component",
"generator",
"."
] | c760a2ded2f329c2a3e28bf76df5571c32b595aa | https://github.com/io7m/jtensors/blob/c760a2ded2f329c2a3e28bf76df5571c32b595aa/com.io7m.jtensors.generators/src/main/java/com/io7m/jtensors/generators/Vector2FGenerator.java#L50-L56 | valid | Create a new empty vector2f generator. | Of course, here is the Java code you requested:
```java
public static Generator<Vector2F> create()
{
return new Vector2FGenerator(PrimitiveGenerators.doubles(
GeneratorConstants.BOUND_LARGE_FLOAT_LOWER,
GeneratorConstants.BOUND_LARGE_FLOAT_UPPER
));
}
```
Hope this helps! |
TheHortonMachine/hortonmachine | lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java | TinHandler.filterOnAllData | public void filterOnAllData( final ALasDataManager lasHandler ) throws Exception {
final ConcurrentSkipListSet<Double> angleSet = new ConcurrentSkipListSet<Double>();
final ConcurrentSkipListSet<Double> distanceSet = new ConcurrentSkipListSet<Double>();
if (isFirstStatsCalculation) {
... | java | public void filterOnAllData( final ALasDataManager lasHandler ) throws Exception {
final ConcurrentSkipListSet<Double> angleSet = new ConcurrentSkipListSet<Double>();
final ConcurrentSkipListSet<Double> distanceSet = new ConcurrentSkipListSet<Double>();
if (isFirstStatsCalculation) {
... | [
"public",
"void",
"filterOnAllData",
"(",
"final",
"ALasDataManager",
"lasHandler",
")",
"throws",
"Exception",
"{",
"final",
"ConcurrentSkipListSet",
"<",
"Double",
">",
"angleSet",
"=",
"new",
"ConcurrentSkipListSet",
"<",
"Double",
">",
"(",
")",
";",
"final",
... | Filter data on thresholds of all available data on the tin.
<p><b>Note: At the first run of this method, only thresholds are calculated.</b></p>
@param lasHandler the las data handler of all data.
@throws Exception | [
"Filter",
"data",
"on",
"thresholds",
"of",
"all",
"available",
"data",
"on",
"the",
"tin",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/lesto/src/main/java/org/hortonmachine/lesto/modules/raster/adaptivetinfilter/TinHandler.java#L190-L256 | train | Filter on all data on all seeds. | Of course, here is the Java code you requested:
```java
public void filterOnAllData( final ALasDataManager lasHandler ) throws Exception {
final ConcurrentSkipListSet<Double> angleSet = new ConcurrentSkipListSet<Double>();
final ConcurrentSkipListSet<Double> distanceSet = new ConcurrentSkipListSet<Doub... |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/mwe/NameBasedFilter.java | NameBasedFilter.setRegularExpression | public void setRegularExpression(String regularExpression) {
if (regularExpression != null)
this.regularExpression = Pattern.compile(regularExpression);
else
this.regularExpression = null;
} | java | public void setRegularExpression(String regularExpression) {
if (regularExpression != null)
this.regularExpression = Pattern.compile(regularExpression);
else
this.regularExpression = null;
} | [
"public",
"void",
"setRegularExpression",
"(",
"String",
"regularExpression",
")",
"{",
"if",
"(",
"regularExpression",
"!=",
"null",
")",
"this",
".",
"regularExpression",
"=",
"Pattern",
".",
"compile",
"(",
"regularExpression",
")",
";",
"else",
"this",
".",
... | Filter the URI based on a regular expression.
Can be combined with an additional file-extension filter. | [
"Filter",
"the",
"URI",
"based",
"on",
"a",
"regular",
"expression",
".",
"Can",
"be",
"combined",
"with",
"an",
"additional",
"file",
"-",
"extension",
"filter",
"."
] | bac941cb75cb24706519845ec174cfef874d7557 | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/mwe/NameBasedFilter.java#L54-L59 | train | Sets the regular expression. | Of course, here is the Java code you requested:
```java
public void setRegularExpression(String regularExpression) {
if (regularExpression != null)
this.regularExpression = Pattern.compile(regularExpression);
else
this.regularExpression = null;
}
```
Hope this helps! |
nmdp-bioinformatics/ngs | fca/src/main/java/org/nmdp/ngs/fca/Context.java | Context.antichain | public static <G extends PartiallyOrdered<?>> Context antichain(final List<G> set) {
return new Context(set, set, new Equal());
} | java | public static <G extends PartiallyOrdered<?>> Context antichain(final List<G> set) {
return new Context(set, set, new Equal());
} | [
"public",
"static",
"<",
"G",
"extends",
"PartiallyOrdered",
"<",
"?",
">",
">",
"Context",
"antichain",
"(",
"final",
"List",
"<",
"G",
">",
"set",
")",
"{",
"return",
"new",
"Context",
"(",
"set",
",",
"set",
",",
"new",
"Equal",
"(",
")",
")",
"... | Calculate the antichain lattice.
@param <G> element type
@param set of partially-ordered elements
@return the antichain lattice | [
"Calculate",
"the",
"antichain",
"lattice",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/fca/src/main/java/org/nmdp/ngs/fca/Context.java#L210-L212 | train | Create a new context from a set of objects. | Of course, here is the Java code you requested:
```java
public static <G extends PartiallyOrdered<?>> Context antichain(final List<G> set) {
return new Context(set, set, new Equal());
}
```
Hope this helps! |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/io/SMILESReader.java | SMILESReader.readAtomContainerSet | private IAtomContainerSet readAtomContainerSet(IAtomContainerSet som) {
try {
String line = input.readLine().trim();
while (line != null) {
logger.debug("Line: ", line);
final String name = suffix(line);
try {
IAtomCon... | java | private IAtomContainerSet readAtomContainerSet(IAtomContainerSet som) {
try {
String line = input.readLine().trim();
while (line != null) {
logger.debug("Line: ", line);
final String name = suffix(line);
try {
IAtomCon... | [
"private",
"IAtomContainerSet",
"readAtomContainerSet",
"(",
"IAtomContainerSet",
"som",
")",
"{",
"try",
"{",
"String",
"line",
"=",
"input",
".",
"readLine",
"(",
")",
".",
"trim",
"(",
")",
";",
"while",
"(",
"line",
"!=",
"null",
")",
"{",
"logger",
... | Private method that actually parses the input to read a ChemFile
object.
@param som The set of molecules that came from the file
@return A ChemFile containing the data parsed from input. | [
"Private",
"method",
"that",
"actually",
"parses",
"the",
"input",
"to",
"read",
"a",
"ChemFile",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/io/SMILESReader.java#L163-L194 | train | Read the SMILES file and add it to the given IAtomContainerSet. | Of course, here is the Java code you requested:
```java
private IAtomContainerSet readAtomContainerSet(IAtomContainerSet som) {
try {
String line = input.readLine().trim();
while (line != null) {
logger.debug("Line: ", line);
final String name = suffix(l... |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/validation/DOValidatorModule.java | DOValidatorModule.validate | public void validate(File objectAsFile,
String format,
int validationType,
String phase) throws ServerException {
dov.validate(objectAsFile, format, validationType, phase);
} | java | public void validate(File objectAsFile,
String format,
int validationType,
String phase) throws ServerException {
dov.validate(objectAsFile, format, validationType, phase);
} | [
"public",
"void",
"validate",
"(",
"File",
"objectAsFile",
",",
"String",
"format",
",",
"int",
"validationType",
",",
"String",
"phase",
")",
"throws",
"ServerException",
"{",
"dov",
".",
"validate",
"(",
"objectAsFile",
",",
"format",
",",
"validationType",
... | <p>
Validates a digital object.
</p>
@param objectAsFile
The digital object provided as a file.
@param validationType
The level of validation to perform on the digital object. This is
an integer from 0-2 with the following meanings: 0 = VALIDATE_ALL
(do all validation levels) 1 = VALIDATE_XML_SCHEMA (perform only
XML ... | [
"<p",
">",
"Validates",
"a",
"digital",
"object",
".",
"<",
"/",
"p",
">"
] | 37df51b9b857fd12c6ab8269820d406c3c4ad774 | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/validation/DOValidatorModule.java#L183-L188 | train | Validate the objectAsFile. | Of course, here is the Java code you requested:
```java
public void validate(File objectAsFile,
String format,
int validationType,
String phase) throws ServerException {
dov.validate(objectAsFile, format, validationType, phase);
}
`... |
kiegroup/optaplanner | optaplanner-core/src/main/java/org/optaplanner/core/impl/partitionedsearch/DefaultPartitionedSearchPhase.java | DefaultPartitionedSearchPhase.solve | @Override
public void solve(DefaultSolverScope<Solution_> solverScope) {
PartitionedSearchPhaseScope<Solution_> phaseScope = new PartitionedSearchPhaseScope<>(solverScope);
List<Solution_> partList = solutionPartitioner.splitWorkingSolution(
solverScope.getScoreDirector(), runnablePa... | java | @Override
public void solve(DefaultSolverScope<Solution_> solverScope) {
PartitionedSearchPhaseScope<Solution_> phaseScope = new PartitionedSearchPhaseScope<>(solverScope);
List<Solution_> partList = solutionPartitioner.splitWorkingSolution(
solverScope.getScoreDirector(), runnablePa... | [
"@",
"Override",
"public",
"void",
"solve",
"(",
"DefaultSolverScope",
"<",
"Solution_",
">",
"solverScope",
")",
"{",
"PartitionedSearchPhaseScope",
"<",
"Solution_",
">",
"phaseScope",
"=",
"new",
"PartitionedSearchPhaseScope",
"<>",
"(",
"solverScope",
")",
";",
... | ************************************************************************ | [
"************************************************************************"
] | b8f1459b4e6b0f7aafe941fd165bff640c11d7d5 | https://github.com/kiegroup/optaplanner/blob/b8f1459b4e6b0f7aafe941fd165bff640c11d7d5/optaplanner-core/src/main/java/org/optaplanner/core/impl/partitionedsearch/DefaultPartitionedSearchPhase.java#L91-L151 | valid | Solve the problem. | Of course, here is the Java code you requested:
```java
@Override
public void solve(DefaultSolverScope<Solution_> solverScope) {
PartitionedSearchPhaseScope<Solution_> phaseScope = new PartitionedSearchPhaseScope<>(solverScope);
List<Solution_> partList = solutionPartitioner.splitWorkingSolution(
... |
galenframework/galen | galen-core/src/main/java/com/galenframework/utils/GalenUtils.java | GalenUtils.resizeScreenshotIfNeeded | public static BufferedImage resizeScreenshotIfNeeded(WebDriver driver, BufferedImage screenshotImage) {
Double devicePixelRatio = 1.0;
try {
devicePixelRatio = ((Number) ((JavascriptExecutor) driver).executeScript(JS_RETRIEVE_DEVICE_PIXEL_RATIO)).doubleValue();
} catch (Exception ex... | java | public static BufferedImage resizeScreenshotIfNeeded(WebDriver driver, BufferedImage screenshotImage) {
Double devicePixelRatio = 1.0;
try {
devicePixelRatio = ((Number) ((JavascriptExecutor) driver).executeScript(JS_RETRIEVE_DEVICE_PIXEL_RATIO)).doubleValue();
} catch (Exception ex... | [
"public",
"static",
"BufferedImage",
"resizeScreenshotIfNeeded",
"(",
"WebDriver",
"driver",
",",
"BufferedImage",
"screenshotImage",
")",
"{",
"Double",
"devicePixelRatio",
"=",
"1.0",
";",
"try",
"{",
"devicePixelRatio",
"=",
"(",
"(",
"Number",
")",
"(",
"(",
... | Check the devicePixelRatio and adapts the size of the screenshot as if the ratio was 1.0
@param driver
@param screenshotImage
@return | [
"Check",
"the",
"devicePixelRatio",
"and",
"adapts",
"the",
"size",
"of",
"the",
"screenshot",
"as",
"if",
"the",
"ratio",
"was",
"1",
".",
"0"
] | 6c7dc1f11d097e6aa49c45d6a77ee688741657a4 | https://github.com/galenframework/galen/blob/6c7dc1f11d097e6aa49c45d6a77ee688741657a4/galen-core/src/main/java/com/galenframework/utils/GalenUtils.java#L187-L222 | train | Resize the screenshot image if necessary. | Of course, here is the Java code you requested:
```java
public static BufferedImage resizeScreenshotIfNeeded(WebDriver driver, BufferedImage screenshotImage) {
Double devicePixelRatio = 1.0;
try {
devicePixelRatio = ((Number) ((JavascriptExecutor) driver).executeScript(JS_RETRIEVE_DEVICE_P... |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/CmsListDirectAction.java | CmsListDirectAction.resolveHelpText | protected String resolveHelpText(Locale locale) {
String helpText = getHelpText().key(locale);
if ((getColumnForTexts() != null) && (getItem().get(getColumnForTexts()) != null)) {
helpText = new MessageFormat(helpText, locale).format(new Object[] {getItem().get(getColumnForTexts())});
... | java | protected String resolveHelpText(Locale locale) {
String helpText = getHelpText().key(locale);
if ((getColumnForTexts() != null) && (getItem().get(getColumnForTexts()) != null)) {
helpText = new MessageFormat(helpText, locale).format(new Object[] {getItem().get(getColumnForTexts())});
... | [
"protected",
"String",
"resolveHelpText",
"(",
"Locale",
"locale",
")",
"{",
"String",
"helpText",
"=",
"getHelpText",
"(",
")",
".",
"key",
"(",
"locale",
")",
";",
"if",
"(",
"(",
"getColumnForTexts",
"(",
")",
"!=",
"null",
")",
"&&",
"(",
"getItem",
... | Help method to resolve the help text to use.<p>
@param locale the used locale
@return the help text | [
"Help",
"method",
"to",
"resolve",
"the",
"help",
"text",
"to",
"use",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/CmsListDirectAction.java#L68-L75 | train | Resolves the help text for this locale. | Of course, here is the Java code you requested:
```java
protected String resolveHelpText(Locale locale) {
String helpText = getHelpText().key(locale);
if ((getColumnForTexts() != null) && (getItem().get(getColumnForTexts()) != null)) {
helpText = new MessageFormat(helpText, locale).format(... |
outbrain/ob1k | ob1k-core/src/main/java/com/outbrain/ob1k/server/netty/HttpStaticFileServerHandler.java | HttpStaticFileServerHandler.setContentTypeHeader | private void setContentTypeHeader(final HttpResponse response, final URLConnection connection) {
response.headers().set(CONTENT_TYPE, mimeTypesMap.getContentType(connection.getURL().getPath()));
} | java | private void setContentTypeHeader(final HttpResponse response, final URLConnection connection) {
response.headers().set(CONTENT_TYPE, mimeTypesMap.getContentType(connection.getURL().getPath()));
} | [
"private",
"void",
"setContentTypeHeader",
"(",
"final",
"HttpResponse",
"response",
",",
"final",
"URLConnection",
"connection",
")",
"{",
"response",
".",
"headers",
"(",
")",
".",
"set",
"(",
"CONTENT_TYPE",
",",
"mimeTypesMap",
".",
"getContentType",
"(",
"c... | Sets the content type header for the HTTP Response
@param response HTTP response
@param connection connection to extract content type | [
"Sets",
"the",
"content",
"type",
"header",
"for",
"the",
"HTTP",
"Response"
] | 9e43ab39230c5787065053da0f766d822d0fe4e7 | https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-core/src/main/java/com/outbrain/ob1k/server/netty/HttpStaticFileServerHandler.java#L247-L249 | train | Sets the content type header. | Of course, here is the Java code you requested:
```java
private void setContentTypeHeader(final HttpResponse response, final URLConnection connection) {
response.headers().set(CONTENT_TYPE, mimeTypesMap.getContentType(connection.getURL().getPath()));
}
```
Hope this helps! |
contentful/contentful.java | src/main/java/com/contentful/java/cda/TransformQuery.java | TransformQuery.one | public Flowable<Transformed> one(String id) {
try {
return baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.contentType().id()
.equals(contentTypeId);
}
... | java | public Flowable<Transformed> one(String id) {
try {
return baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.contentType().id()
.equals(contentTypeId);
}
... | [
"public",
"Flowable",
"<",
"Transformed",
">",
"one",
"(",
"String",
"id",
")",
"{",
"try",
"{",
"return",
"baseQuery",
"(",
")",
".",
"one",
"(",
"id",
")",
".",
"filter",
"(",
"new",
"Predicate",
"<",
"CDAEntry",
">",
"(",
")",
"{",
"@",
"Overrid... | Retrieve the transformed entry from Contentful.
@param id the id of the entry of type Transformed.
@return the Transformed entry.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class could not be created.
@throws IllegalStateException ... | [
"Retrieve",
"the",
"transformed",
"entry",
"from",
"Contentful",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/TransformQuery.java#L148-L168 | train | Single entry transformed by a single id | Of course, here is the Java code you requested:
```java
public Flowable<Transformed> one(String id) {
try {
return baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.contentType().id()... |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.verifyDomainOwnershipAsync | public ServiceFuture<Void> verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, certificateOrderName), serviceCallback);
} | java | public ServiceFuture<Void> verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, certificateOrderName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"Void",
">",
"verifyDomainOwnershipAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"final",
"ServiceCallback",
"<",
"Void",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromR... | Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param serviceCallback the async ServiceCallback to handle successful and... | [
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
".",
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L2158-L2160 | train | Verify domain ownership. Verify domain ownership. | Of course, here is the Java code you requested:
```java
public ServiceFuture<Void> verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, ... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/DbEntityColumnDescriptor.java | DbEntityColumnDescriptor.compareTo | @Override
public int compareTo(final Object o) {
DbEntityColumnDescriptor that = (DbEntityColumnDescriptor) o;
if (this.isId != that.isId) {
return this.isId ? -1 : 1; // IDs should be the first in the array
}
return this.columnName.compareTo(that.columnName);
} | java | @Override
public int compareTo(final Object o) {
DbEntityColumnDescriptor that = (DbEntityColumnDescriptor) o;
if (this.isId != that.isId) {
return this.isId ? -1 : 1; // IDs should be the first in the array
}
return this.columnName.compareTo(that.columnName);
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"final",
"Object",
"o",
")",
"{",
"DbEntityColumnDescriptor",
"that",
"=",
"(",
"DbEntityColumnDescriptor",
")",
"o",
";",
"if",
"(",
"this",
".",
"isId",
"!=",
"that",
".",
"isId",
")",
"{",
"return",
... | Compares two column descriptors. Identity columns should be the first on the list.
Each group then will be sorted by column name. | [
"Compares",
"two",
"column",
"descriptors",
".",
"Identity",
"columns",
"should",
"be",
"the",
"first",
"on",
"the",
"list",
".",
"Each",
"group",
"then",
"will",
"be",
"sorted",
"by",
"column",
"name",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/DbEntityColumnDescriptor.java#L141-L148 | test | Compares two entity column descriptors. | Of course, here is the Java code you requested:
```java
@Override
public int compareTo(final Object o) {
DbEntityColumnDescriptor that = (DbEntityColumnDescriptor) o;
if (this.isId != that.isId) {
return this.isId ? -1 : 1; // IDs should be the first in the array
}
return this.columnName.compareTo(tha... |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/wrapper/TableIndexer.java | TableIndexer.getTableIdx | public TableIdx getTableIdx(final String _tableName,
final String... _keys)
{
TableIdx ret = null;
final String key = _tableName + "-" + StringUtils.join(_keys, "-");
final Optional<TableIdx> val = this.tableidxs.stream().filter(t -> t.getKey().equals(key)).fi... | java | public TableIdx getTableIdx(final String _tableName,
final String... _keys)
{
TableIdx ret = null;
final String key = _tableName + "-" + StringUtils.join(_keys, "-");
final Optional<TableIdx> val = this.tableidxs.stream().filter(t -> t.getKey().equals(key)).fi... | [
"public",
"TableIdx",
"getTableIdx",
"(",
"final",
"String",
"_tableName",
",",
"final",
"String",
"...",
"_keys",
")",
"{",
"TableIdx",
"ret",
"=",
"null",
";",
"final",
"String",
"key",
"=",
"_tableName",
"+",
"\"-\"",
"+",
"StringUtils",
".",
"join",
"(... | Gets the table idx.
@param _tableName the table name
@param _keys the key
@return the table idx | [
"Gets",
"the",
"table",
"idx",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/wrapper/TableIndexer.java#L46-L60 | train | Gets the TableIdx. | Of course, here is the Java code you requested:
```java
public TableIdx getTableIdx(final String _tableName,
final String... _keys)
{
TableIdx ret = null;
final String key = _tableName + "-" + StringUtils.join(_keys, "-");
final Optional<TableIdx> val = this.... |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/ListenerList.java | ListenerList.addListener | public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener)
{
ListenerList<L> list = map.get(key);
if (list == null) {
map.put(key, list = new ListenerList<L>());
}
list.add(listener);
} | java | public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener)
{
ListenerList<L> list = map.get(key);
if (list == null) {
map.put(key, list = new ListenerList<L>());
}
list.add(listener);
} | [
"public",
"static",
"<",
"L",
",",
"K",
">",
"void",
"addListener",
"(",
"Map",
"<",
"K",
",",
"ListenerList",
"<",
"L",
">",
">",
"map",
",",
"K",
"key",
",",
"L",
"listener",
")",
"{",
"ListenerList",
"<",
"L",
">",
"list",
"=",
"map",
".",
"... | Adds a listener to the listener list in the supplied map. If no list exists, one will be
created and mapped to the supplied key. | [
"Adds",
"a",
"listener",
"to",
"the",
"listener",
"list",
"in",
"the",
"supplied",
"map",
".",
"If",
"no",
"list",
"exists",
"one",
"will",
"be",
"created",
"and",
"mapped",
"to",
"the",
"supplied",
"key",
"."
] | 31b31a23b667f2a9c683160d77646db259f2aae5 | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/ListenerList.java#L56-L63 | train | Add a listener to the list of listeners for the given key. | Of course, here is the Java code you requested:
```java
public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener)
{
ListenerList<L> list = map.get(key);
if (list == null) {
map.put(key, list = new ListenerList<L>());
}
list.add(listener);
... |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/ExampleUtil.java | ExampleUtil.contentAsList | public static List<String> contentAsList( Iterable<Example> cells )
{
return new ArrayList<String>( Arrays.asList( content( cells ) ) );
} | java | public static List<String> contentAsList( Iterable<Example> cells )
{
return new ArrayList<String>( Arrays.asList( content( cells ) ) );
} | [
"public",
"static",
"List",
"<",
"String",
">",
"contentAsList",
"(",
"Iterable",
"<",
"Example",
">",
"cells",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"Arrays",
".",
"asList",
"(",
"content",
"(",
"cells",
")",
")",
")",
";",
... | <p>contentAsList.</p>
@param cells a {@link java.lang.Iterable} object.
@return a {@link java.util.List} object. | [
"<p",
">",
"contentAsList",
".",
"<",
"/",
"p",
">"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/ExampleUtil.java#L101-L104 | train | Get content as list. | Of course, here is the Java code you requested:
```java
public static List<String> contentAsList( Iterable<Example> cells )
{
return new ArrayList<String>( Arrays.asList( content( cells ) ) );
}
```
Hope this helps! |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/util/SerializableClientProxy.java | SerializableClientProxy.readResolve | Object readResolve() throws ObjectStreamException {
Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId);
if (bean == null) {
throw BeanLogger.LOG.proxyDeserializationFailure(beanId);
}
return Container... | java | Object readResolve() throws ObjectStreamException {
Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId);
if (bean == null) {
throw BeanLogger.LOG.proxyDeserializationFailure(beanId);
}
return Container... | [
"Object",
"readResolve",
"(",
")",
"throws",
"ObjectStreamException",
"{",
"Bean",
"<",
"?",
">",
"bean",
"=",
"Container",
".",
"instance",
"(",
"contextId",
")",
".",
"services",
"(",
")",
".",
"get",
"(",
"ContextualStore",
".",
"class",
")",
".",
"<"... | Always returns the original proxy object that was serialized.
@return the proxy object
@throws java.io.ObjectStreamException | [
"Always",
"returns",
"the",
"original",
"proxy",
"object",
"that",
"was",
"serialized",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/util/SerializableClientProxy.java#L57-L63 | train | readResolve - This method is called by the BeanReader to read the proxy. | Of course, here is the Java code you requested:
```java
Object readResolve() throws ObjectStreamException {
Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId);
if (bean == null) {
throw BeanLogger.LOG.proxyDeseriali... |
baratine/baratine | framework/src/main/java/com/caucho/v5/ramp/events/EventServiceRamp.java | EventServiceRamp.subscriber | public void subscriber(String path,
@Pin ServiceRefAmp serviceRef,
Result<? super Cancel> result)
{
if (path.isEmpty()) {
result.fail(new ServiceException(L.l("Invalid event location '{0}'", path)));
return;
}
String address = address(path);
... | java | public void subscriber(String path,
@Pin ServiceRefAmp serviceRef,
Result<? super Cancel> result)
{
if (path.isEmpty()) {
result.fail(new ServiceException(L.l("Invalid event location '{0}'", path)));
return;
}
String address = address(path);
... | [
"public",
"void",
"subscriber",
"(",
"String",
"path",
",",
"@",
"Pin",
"ServiceRefAmp",
"serviceRef",
",",
"Result",
"<",
"?",
"super",
"Cancel",
">",
"result",
")",
"{",
"if",
"(",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"result",
".",
"fail",
... | Subscribe a callback to a location. | [
"Subscribe",
"a",
"callback",
"to",
"a",
"location",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/events/EventServiceRamp.java#L161-L177 | train | Subscribe to a serviceRef. | Of course, here is the Java code you requested:
```java
public void subscriber(String path,
@Pin ServiceRefAmp serviceRef,
Result<? super Cancel> result)
{
if (path.isEmpty()) {
result.fail(new ServiceException(L.l("Invalid event location '{0}'", path)));
... |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java | ApplicationLauncherApp.handleContextMenu | private void handleContextMenu(JTree tree, int x, int y) {
TreePath path = tree.getPathForLocation(x, y);
tree.setSelectionPath(path);
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node == null)
return;
if (!node.isLeaf()) {
tree.setSelectionPath(null);... | java | private void handleContextMenu(JTree tree, int x, int y) {
TreePath path = tree.getPathForLocation(x, y);
tree.setSelectionPath(path);
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node == null)
return;
if (!node.isLeaf()) {
tree.setSelectionPath(null);... | [
"private",
"void",
"handleContextMenu",
"(",
"JTree",
"tree",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"TreePath",
"path",
"=",
"tree",
".",
"getPathForLocation",
"(",
"x",
",",
"y",
")",
";",
"tree",
".",
"setSelectionPath",
"(",
"path",
")",
";",
... | Displays a context menu for a class leaf node
Allows copying of the name and the path to the source | [
"Displays",
"a",
"context",
"menu",
"for",
"a",
"class",
"leaf",
"node",
"Allows",
"copying",
"of",
"the",
"name",
"and",
"the",
"path",
"to",
"the",
"source"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L337-L371 | train | Handles the context menu items. | Of course, here is the Java code you requested:
```java
private void handleContextMenu(JTree tree, int x, int y) {
TreePath path = tree.getPathForLocation(x, y);
tree.setSelectionPath(path);
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node == null)
return... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/EncodingSchemeIDImpl.java | EncodingSchemeIDImpl.setESidCP | public void setESidCP(Integer newESidCP) {
Integer oldESidCP = eSidCP;
eSidCP = newESidCP;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.ENCODING_SCHEME_ID__ESID_CP, oldESidCP, eSidCP));
} | java | public void setESidCP(Integer newESidCP) {
Integer oldESidCP = eSidCP;
eSidCP = newESidCP;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.ENCODING_SCHEME_ID__ESID_CP, oldESidCP, eSidCP));
} | [
"public",
"void",
"setESidCP",
"(",
"Integer",
"newESidCP",
")",
"{",
"Integer",
"oldESidCP",
"=",
"eSidCP",
";",
"eSidCP",
"=",
"newESidCP",
";",
"if",
"(",
"eNotificationRequired",
"(",
")",
")",
"eNotify",
"(",
"new",
"ENotificationImpl",
"(",
"this",
","... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/EncodingSchemeIDImpl.java#L104-L109 | train | Sets the value of the ESidCP property. | Of course, here is the Java code you requested:
```java
public void setESidCP(Integer newESidCP) {
Integer oldESidCP = eSidCP;
eSidCP = newESidCP;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.ENCODING_SCHEME_ID__ESID_CP, oldESidCP, eSidCP));
}
```
Hope thi... |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_monitor/SLAEventKafkaJobMonitor.java | Factory.forConfig | public JobSpecMonitor forConfig(Config localScopeConfig, MutableJobCatalog jobCatalog) throws IOException {
Preconditions.checkArgument(localScopeConfig.hasPath(TEMPLATE_KEY));
Preconditions.checkArgument(localScopeConfig.hasPath(TOPIC_KEY));
String topic = localScopeConfig.getString(TOPIC_KEY);
... | java | public JobSpecMonitor forConfig(Config localScopeConfig, MutableJobCatalog jobCatalog) throws IOException {
Preconditions.checkArgument(localScopeConfig.hasPath(TEMPLATE_KEY));
Preconditions.checkArgument(localScopeConfig.hasPath(TOPIC_KEY));
String topic = localScopeConfig.getString(TOPIC_KEY);
... | [
"public",
"JobSpecMonitor",
"forConfig",
"(",
"Config",
"localScopeConfig",
",",
"MutableJobCatalog",
"jobCatalog",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"localScopeConfig",
".",
"hasPath",
"(",
"TEMPLATE_KEY",
")",
")",
";",
... | Create a {@link SLAEventKafkaJobMonitor} from an input {@link Config}. Useful for multiple monitors, where
the configuration of each monitor is scoped.
@param localScopeConfig The sub-{@link Config} for this monitor without any namespacing (e.g. the key for
topic should simply be "topic").
@throws IOException | [
"Create",
"a",
"{"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_monitor/SLAEventKafkaJobMonitor.java#L102-L153 | train | Creates a new JobSpecMonitor instance for the given configuration. | Of course, here is the Java code you requested:
```java
public JobSpecMonitor forConfig(Config localScopeConfig, MutableJobCatalog jobCatalog) throws IOException {
Preconditions.checkArgument(localScopeConfig.hasPath(TEMPLATE_KEY));
Preconditions.checkArgument(localScopeConfig.hasPath(TOPIC_KEY));
... |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/model/impl/CommercePriceListUserSegmentEntryRelModelImpl.java | CommercePriceListUserSegmentEntryRelModelImpl.toModels | public static List<CommercePriceListUserSegmentEntryRel> toModels(
CommercePriceListUserSegmentEntryRelSoap[] soapModels) {
if (soapModels == null) {
return null;
}
List<CommercePriceListUserSegmentEntryRel> models = new ArrayList<CommercePriceListUserSegmentEntryRel>(soapModels.length);
for (CommercePri... | java | public static List<CommercePriceListUserSegmentEntryRel> toModels(
CommercePriceListUserSegmentEntryRelSoap[] soapModels) {
if (soapModels == null) {
return null;
}
List<CommercePriceListUserSegmentEntryRel> models = new ArrayList<CommercePriceListUserSegmentEntryRel>(soapModels.length);
for (CommercePri... | [
"public",
"static",
"List",
"<",
"CommercePriceListUserSegmentEntryRel",
">",
"toModels",
"(",
"CommercePriceListUserSegmentEntryRelSoap",
"[",
"]",
"soapModels",
")",
"{",
"if",
"(",
"soapModels",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
... | Converts the soap model instances into normal model instances.
@param soapModels the soap model instances to convert
@return the normal model instances | [
"Converts",
"the",
"soap",
"model",
"instances",
"into",
"normal",
"model",
"instances",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/model/impl/CommercePriceListUserSegmentEntryRelModelImpl.java#L165-L178 | train | Converts the commerce price list user segment entry rels to the generic models. | Of course, here is the Java code you requested:
```java
public static List<CommercePriceListUserSegmentEntryRel> toModels(
CommercePriceListUserSegmentEntryRelSoap[] soapModels) {
if (soapModels == null) {
return null;
}
List<CommercePriceListUserSegmentEntryRel> models = new ArrayList<CommercePriceListUse... |
google/guava | android/guava/src/com/google/common/graph/EndpointPair.java | EndpointPair.adjacentNode | public final N adjacentNode(Object node) {
if (node.equals(nodeU)) {
return nodeV;
} else if (node.equals(nodeV)) {
return nodeU;
} else {
throw new IllegalArgumentException("EndpointPair " + this + " does not contain node " + node);
}
} | java | public final N adjacentNode(Object node) {
if (node.equals(nodeU)) {
return nodeV;
} else if (node.equals(nodeV)) {
return nodeU;
} else {
throw new IllegalArgumentException("EndpointPair " + this + " does not contain node " + node);
}
} | [
"public",
"final",
"N",
"adjacentNode",
"(",
"Object",
"node",
")",
"{",
"if",
"(",
"node",
".",
"equals",
"(",
"nodeU",
")",
")",
"{",
"return",
"nodeV",
";",
"}",
"else",
"if",
"(",
"node",
".",
"equals",
"(",
"nodeV",
")",
")",
"{",
"return",
... | Returns the node that is adjacent to {@code node} along the origin edge.
@throws IllegalArgumentException if this {@link EndpointPair} does not contain {@code node} | [
"Returns",
"the",
"node",
"that",
"is",
"adjacent",
"to",
"{",
"@code",
"node",
"}",
"along",
"the",
"origin",
"edge",
"."
] | 7155d12b70a2406fa84d94d4b8b3bc108e89abfd | https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/android/guava/src/com/google/common/graph/EndpointPair.java#L107-L115 | valid | Get the adjacent node of this pair. | Of course, here is the Java code you requested:
```java
public final N adjacentNode(Object node) {
if (node.equals(nodeU)) {
return nodeV;
} else if (node.equals(nodeV)) {
return nodeU;
} else {
throw new IllegalArgumentException("EndpointPair " + this + " does not contain node " + node);... |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/ArtifactManagingServiceImpl.java | ArtifactManagingServiceImpl.importResource | private void importResource(Node parentNode, InputStream file_in, String resourceType, ArtifactDescriptor artifact)
throws RepositoryException
{
// Note that artifactBean been initialized within constructor
// resourceType can be jar, pom, metadata
String filename;
if (resourceTy... | java | private void importResource(Node parentNode, InputStream file_in, String resourceType, ArtifactDescriptor artifact)
throws RepositoryException
{
// Note that artifactBean been initialized within constructor
// resourceType can be jar, pom, metadata
String filename;
if (resourceTy... | [
"private",
"void",
"importResource",
"(",
"Node",
"parentNode",
",",
"InputStream",
"file_in",
",",
"String",
"resourceType",
",",
"ArtifactDescriptor",
"artifact",
")",
"throws",
"RepositoryException",
"{",
"// Note that artifactBean been initialized within constructor",
"//... | this method used for writing to repo jars, poms and their checksums | [
"this",
"method",
"used",
"for",
"writing",
"to",
"repo",
"jars",
"poms",
"and",
"their",
"checksums"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/ArtifactManagingServiceImpl.java#L858-L911 | train | Import a resource from an input stream to the parent node. | Of course, here is the Java code you requested:
```java
private void importResource(Node parentNode, InputStream file_in, String resourceType, ArtifactDescriptor artifact)
throws RepositoryException
{
// Note that artifactBean been initialized within constructor
// resourceType can be jar, p... |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/transformer/Transformer.java | Transformer.setViewHeight | public void setViewHeight(int newHeight) {
if (newHeight > 0) {
originalHeight = newHeight;
RelativeLayout.LayoutParams layoutParams =
(RelativeLayout.LayoutParams) view.getLayoutParams();
layoutParams.height = newHeight;
view.setLayoutParams(layoutParams);
}
} | java | public void setViewHeight(int newHeight) {
if (newHeight > 0) {
originalHeight = newHeight;
RelativeLayout.LayoutParams layoutParams =
(RelativeLayout.LayoutParams) view.getLayoutParams();
layoutParams.height = newHeight;
view.setLayoutParams(layoutParams);
}
} | [
"public",
"void",
"setViewHeight",
"(",
"int",
"newHeight",
")",
"{",
"if",
"(",
"newHeight",
">",
"0",
")",
"{",
"originalHeight",
"=",
"newHeight",
";",
"RelativeLayout",
".",
"LayoutParams",
"layoutParams",
"=",
"(",
"RelativeLayout",
".",
"LayoutParams",
"... | Change view height using the LayoutParams of the view.
@param newHeight to change.. | [
"Change",
"view",
"height",
"using",
"the",
"LayoutParams",
"of",
"the",
"view",
"."
] | 6b6d1806fa4140113f31307a2571bf02435aa53a | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/transformer/Transformer.java#L91-L99 | train | Sets the height of the view. | Of course, here is the Java code you requested:
```java
public void setViewHeight(int newHeight) {
if (newHeight > 0) {
originalHeight = newHeight;
RelativeLayout.LayoutParams layoutParams =
(RelativeLayout.LayoutParams) view.getLayoutParams();
layoutParams.height = newHeight;
vie... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.all | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<Boolean> all(Predicate<? super T> predicate) {
ObjectHelper.requireNonNull(predicate, "predicate is null");
return RxJavaPlugins.onAssembly(new ObservableAllSingle<T>(this, predicate));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<Boolean> all(Predicate<? super T> predicate) {
ObjectHelper.requireNonNull(predicate, "predicate is null");
return RxJavaPlugins.onAssembly(new ObservableAllSingle<T>(this, predicate));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Single",
"<",
"Boolean",
">",
"all",
"(",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
... | Returns a Single that emits a Boolean that indicates whether all of the items emitted by the source
ObservableSource satisfy a condition.
<p>
<img width="640" height="264" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/all.o.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code all} does not op... | [
"Returns",
"a",
"Single",
"that",
"emits",
"a",
"Boolean",
"that",
"indicates",
"whether",
"all",
"of",
"the",
"items",
"emitted",
"by",
"the",
"source",
"ObservableSource",
"satisfy",
"a",
"condition",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L5020-L5025 | test | Single - operation that returns true if all elements of the source sequence match the given predicate. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<Boolean> all(Predicate<? super T> predicate) {
ObjectHelper.requireNonNull(predicate, "predicate is null");
return RxJavaPlugins.onAssembly(new ObservableAllSin... |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/IsotopeFactory.java | IsotopeFactory.getIsotopes | public IIsotope[] getIsotopes(double exactMass, double difference) {
List<IIsotope> list = new ArrayList<>();
for (List<IIsotope> isotopes : this.isotopes) {
if (isotopes == null) continue;
for (IIsotope isotope : isotopes) {
if (Math.abs(isotope.getExactMass() - ... | java | public IIsotope[] getIsotopes(double exactMass, double difference) {
List<IIsotope> list = new ArrayList<>();
for (List<IIsotope> isotopes : this.isotopes) {
if (isotopes == null) continue;
for (IIsotope isotope : isotopes) {
if (Math.abs(isotope.getExactMass() - ... | [
"public",
"IIsotope",
"[",
"]",
"getIsotopes",
"(",
"double",
"exactMass",
",",
"double",
"difference",
")",
"{",
"List",
"<",
"IIsotope",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"List",
"<",
"IIsotope",
">",
"isotopes",
... | Gets an array of all isotopes matching the searched exact mass within
a certain difference.
@param exactMass search mass
@param difference mass the isotope is allowed to differ from the search mass
@return An array of all isotopes | [
"Gets",
"an",
"array",
"of",
"all",
"isotopes",
"matching",
"the",
"searched",
"exact",
"mass",
"within",
"a",
"certain",
"difference",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/IsotopeFactory.java#L132-L143 | train | Gets the isotopes of the IIsotopeSet with the specified exact mass and difference. | Of course, here is the Java code you requested:
```java
public IIsotope[] getIsotopes(double exactMass, double difference) {
List<IIsotope> list = new ArrayList<>();
for (List<IIsotope> isotopes : this.isotopes) {
if (isotopes == null) continue;
for (IIsotope isotope : isotopes)... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java | AbstractPlainSocketImpl.connect | protected void connect(SocketAddress address, int timeout)
throws IOException {
boolean connected = false;
try {
if (address == null || !(address instanceof InetSocketAddress))
throw new IllegalArgumentException("unsupported address type");
InetSocketA... | java | protected void connect(SocketAddress address, int timeout)
throws IOException {
boolean connected = false;
try {
if (address == null || !(address instanceof InetSocketAddress))
throw new IllegalArgumentException("unsupported address type");
InetSocketA... | [
"protected",
"void",
"connect",
"(",
"SocketAddress",
"address",
",",
"int",
"timeout",
")",
"throws",
"IOException",
"{",
"boolean",
"connected",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"address",
"==",
"null",
"||",
"!",
"(",
"address",
"instanceof",
"... | Creates a socket and connects it to the specified address on
the specified port.
@param address the address
@param timeout the timeout value in milliseconds, or zero for no timeout.
@throws IOException if connection fails
@throws IllegalArgumentException if address is null or is a
SocketAddress subclass not supported ... | [
"Creates",
"a",
"socket",
"and",
"connects",
"it",
"to",
"the",
"specified",
"address",
"on",
"the",
"specified",
"port",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java#L169-L193 | train | Connect to the specified address. | Of course, here is the Java code you requested:
```java
protected void connect(SocketAddress address, int timeout)
throws IOException {
boolean connected = false;
try {
if (address == null || !(address instanceof InetSocketAddress))
throw new IllegalArgumentExcep... |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/MatrixIO.java | MatrixIO.readMatrix | public static Matrix readMatrix(File matrix, Format format)
throws IOException {
switch (format) {
// Assume all sparse formats will fit in memory.
case SVDLIBC_SPARSE_TEXT:
case SVDLIBC_SPARSE_BINARY:
case MATLAB_SPARSE:
case CLUTO_... | java | public static Matrix readMatrix(File matrix, Format format)
throws IOException {
switch (format) {
// Assume all sparse formats will fit in memory.
case SVDLIBC_SPARSE_TEXT:
case SVDLIBC_SPARSE_BINARY:
case MATLAB_SPARSE:
case CLUTO_... | [
"public",
"static",
"Matrix",
"readMatrix",
"(",
"File",
"matrix",
",",
"Format",
"format",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"format",
")",
"{",
"// Assume all sparse formats will fit in memory.",
"case",
"SVDLIBC_SPARSE_TEXT",
":",
"case",
"SVDLIBC_S... | Converts the contents of a matrix file as a {@link Matrix} object, using
the provided format as a hint for what kind to create. The
type of {@code Matrix} object created will assuming that the entire
matrix can fit in memory based on the format of the file speicfied
Note that the returned {@link Matrix} instance is no... | [
"Converts",
"the",
"contents",
"of",
"a",
"matrix",
"file",
"as",
"a",
"{",
"@link",
"Matrix",
"}",
"object",
"using",
"the",
"provided",
"format",
"as",
"a",
"hint",
"for",
"what",
"kind",
"to",
"create",
".",
"The",
"type",
"of",
"{",
"@code",
"Matri... | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/MatrixIO.java#L716-L740 | train | Read the matrix of the specified format from the specified file. | Of course, here is the Java code you requested:
```java
public static Matrix readMatrix(File matrix, Format format)
throws IOException {
switch (format) {
// Assume all sparse formats will fit in memory.
case SVDLIBC_SPARSE_TEXT:
case SVDLIBC_SPARSE_BINARY:
... |
jdereg/java-util | src/main/java/com/cedarsoftware/util/UrlUtilities.java | UrlUtilities.getContentFromUrlAsString | public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts)
{
byte[] bytes = getContentFromUrl(url, inCookies, outCookies, trustAllCerts);
return bytes == null ? null : StringUtilities.createString(bytes, "UTF-8");
} | java | public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts)
{
byte[] bytes = getContentFromUrl(url, inCookies, outCookies, trustAllCerts);
return bytes == null ? null : StringUtilities.createString(bytes, "UTF-8");
} | [
"public",
"static",
"String",
"getContentFromUrlAsString",
"(",
"String",
"url",
",",
"Map",
"inCookies",
",",
"Map",
"outCookies",
",",
"boolean",
"trustAllCerts",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"getContentFromUrl",
"(",
"url",
",",
"inCookies",
",... | Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
String.
@param url URL to hit
@param inCookies Map of session cookies (or null if not needed)
@param outCookies Map of session cookies (or null if not needed)
@param trustAllCe... | [
"Get",
"content",
"from",
"the",
"passed",
"in",
"URL",
".",
"This",
"code",
"will",
"open",
"a",
"connection",
"to",
"the",
"passed",
"in",
"server",
"fetch",
"the",
"requested",
"content",
"and",
"return",
"it",
"as",
"a",
"String",
"."
] | a2dce61aed16d6454ee575174dda1ba6bff0015c | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L439-L443 | train | Get content from url string. | Of course, here is the Java code you requested:
```java
public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts)
{
byte[] bytes = getContentFromUrl(url, inCookies, outCookies, trustAllCerts);
return bytes == null ? null : StringUtilities.creat... |
mbeiter/util | db/src/main/java/org/beiter/michael/db/ConnectionProperties.java | ConnectionProperties.setAdditionalProperties | public final void setAdditionalProperties(final Map<String, String> additionalProperties) {
// no need for validation, the method will create a new (empty) object if the provided parameter is null.
// create a defensive copy of the map and all its properties
if (additionalProperties == null) {... | java | public final void setAdditionalProperties(final Map<String, String> additionalProperties) {
// no need for validation, the method will create a new (empty) object if the provided parameter is null.
// create a defensive copy of the map and all its properties
if (additionalProperties == null) {... | [
"public",
"final",
"void",
"setAdditionalProperties",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"additionalProperties",
")",
"{",
"// no need for validation, the method will create a new (empty) object if the provided parameter is null.",
"// create a defensive copy of ... | Any additional properties which have not been parsed, and for which no getter/setter exists, but are to be
stored in this object nevertheless.
<p>
This property is commonly used to preserve original properties from upstream components that are to be passed
on to downstream components unchanged. This properties set may ... | [
"Any",
"additional",
"properties",
"which",
"have",
"not",
"been",
"parsed",
"and",
"for",
"which",
"no",
"getter",
"/",
"setter",
"exists",
"but",
"are",
"to",
"be",
"stored",
"in",
"this",
"object",
"nevertheless",
".",
"<p",
">",
"This",
"property",
"is... | 490fcebecb936e00c2f2ce2096b679b2fd10865e | https://github.com/mbeiter/util/blob/490fcebecb936e00c2f2ce2096b679b2fd10865e/db/src/main/java/org/beiter/michael/db/ConnectionProperties.java#L889-L912 | train | Sets the additional properties. | Of course, here is the Java code you requested:
```java
public final void setAdditionalProperties(final Map<String, String> additionalProperties) {
// no need for validation, the method will create a new (empty) object if the provided parameter is null.
// create a defensive copy of the map and all i... |
BellaDati/belladati-sdk-java | src/main/java/com/belladati/sdk/dashboard/impl/DashletImpl.java | DashletImpl.findType | private Type findType(String typeString) throws UnknownDashletTypeException {
if ("viewReport".equalsIgnoreCase(typeString)) {
return Type.VIEW;
} else if ("textContent".equalsIgnoreCase(typeString)) {
return Type.TEXT;
}
throw new UnknownDashletTypeException(typeString);
} | java | private Type findType(String typeString) throws UnknownDashletTypeException {
if ("viewReport".equalsIgnoreCase(typeString)) {
return Type.VIEW;
} else if ("textContent".equalsIgnoreCase(typeString)) {
return Type.TEXT;
}
throw new UnknownDashletTypeException(typeString);
} | [
"private",
"Type",
"findType",
"(",
"String",
"typeString",
")",
"throws",
"UnknownDashletTypeException",
"{",
"if",
"(",
"\"viewReport\"",
".",
"equalsIgnoreCase",
"(",
"typeString",
")",
")",
"{",
"return",
"Type",
".",
"VIEW",
";",
"}",
"else",
"if",
"(",
... | Determines the dashlet type from the given type string.
@param typeString string to parse (from JSON)
@return the dashlet type
@throws UnknownDashletTypeException if no such type was found | [
"Determines",
"the",
"dashlet",
"type",
"from",
"the",
"given",
"type",
"string",
"."
] | 1a732a57ebc825ddf47ce405723cc958adb1a43f | https://github.com/BellaDati/belladati-sdk-java/blob/1a732a57ebc825ddf47ce405723cc958adb1a43f/src/main/java/com/belladati/sdk/dashboard/impl/DashletImpl.java#L47-L54 | train | Find the type of the dashlet type. | Of course, here is the Java code you requested:
```java
private Type findType(String typeString) throws UnknownDashletTypeException {
if ("viewReport".equalsIgnoreCase(typeString)) {
return Type.VIEW;
} else if ("textContent".equalsIgnoreCase(typeString)) {
return Type.TEXT;
}
throw new UnknownDashletTyp... |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/Flags.java | Flags.isSuperSenseFeatures | public static boolean isSuperSenseFeatures(final TrainingParameters params) {
final String mfsFeatures = getSuperSenseFeatures(params);
return !mfsFeatures.equalsIgnoreCase(Flags.DEFAULT_FEATURE_FLAG);
} | java | public static boolean isSuperSenseFeatures(final TrainingParameters params) {
final String mfsFeatures = getSuperSenseFeatures(params);
return !mfsFeatures.equalsIgnoreCase(Flags.DEFAULT_FEATURE_FLAG);
} | [
"public",
"static",
"boolean",
"isSuperSenseFeatures",
"(",
"final",
"TrainingParameters",
"params",
")",
"{",
"final",
"String",
"mfsFeatures",
"=",
"getSuperSenseFeatures",
"(",
"params",
")",
";",
"return",
"!",
"mfsFeatures",
".",
"equalsIgnoreCase",
"(",
"Flags... | Check if supersense tagger features are active.
@param params
the parameters
@return whether the supersense features are activated or not | [
"Check",
"if",
"supersense",
"tagger",
"features",
"are",
"active",
"."
] | c817fa1e40e96ed15fc79d22c3a7c25f1a40d172 | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/Flags.java#L910-L913 | train | Checks if the superSense features are set. | Of course, here is the Java code you requested:
```java
public static boolean isSuperSenseFeatures(final TrainingParameters params) {
final String mfsFeatures = getSuperSenseFeatures(params);
return !mfsFeatures.equalsIgnoreCase(Flags.DEFAULT_FEATURE_FLAG);
}
```
Hope this helps! |
VoltDB/voltdb | src/frontend/org/voltdb/ClientInterface.java | ClientInterface.shutdown | protected void shutdown() throws InterruptedException {
if (m_deadConnectionFuture != null) {
m_deadConnectionFuture.cancel(false);
try {m_deadConnectionFuture.get();} catch (Throwable t) {}
}
if (m_topologyCheckFuture != null) {
m_topologyCheckFuture.cancel(f... | java | protected void shutdown() throws InterruptedException {
if (m_deadConnectionFuture != null) {
m_deadConnectionFuture.cancel(false);
try {m_deadConnectionFuture.get();} catch (Throwable t) {}
}
if (m_topologyCheckFuture != null) {
m_topologyCheckFuture.cancel(f... | [
"protected",
"void",
"shutdown",
"(",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"m_deadConnectionFuture",
"!=",
"null",
")",
"{",
"m_deadConnectionFuture",
".",
"cancel",
"(",
"false",
")",
";",
"try",
"{",
"m_deadConnectionFuture",
".",
"get",
"(",... | all your read buffers" events .. or something .. | [
"all",
"your",
"read",
"buffers",
"events",
"..",
"or",
"something",
".."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ClientInterface.java#L1717-L1744 | train | Shutdown all the resources. | Of course, here is the Java code you requested:
```java
protected void shutdown() throws InterruptedException {
if (m_deadConnectionFuture != null) {
m_deadConnectionFuture.cancel(false);
try {m_deadConnectionFuture.get();} catch (Throwable t) {}
}
if (m_topologyCheckFut... |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.nextAfter | public static FloatBinding nextAfter(final float start, final ObservableFloatValue direction) {
return createFloatBinding(() -> Math.nextAfter(start, direction.get()), direction);
} | java | public static FloatBinding nextAfter(final float start, final ObservableFloatValue direction) {
return createFloatBinding(() -> Math.nextAfter(start, direction.get()), direction);
} | [
"public",
"static",
"FloatBinding",
"nextAfter",
"(",
"final",
"float",
"start",
",",
"final",
"ObservableFloatValue",
"direction",
")",
"{",
"return",
"createFloatBinding",
"(",
"(",
")",
"->",
"Math",
".",
"nextAfter",
"(",
"start",
",",
"direction",
".",
"g... | Binding for {@link java.lang.Math#nextAfter(float, double)}
@param start starting floating-point value
@param direction value indicating which of
{@code start}'s neighbors or {@code start} should
be returned
@return The floating-point number adjacent to {@code start} in the
direction of {@code direction}. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#nextAfter",
"(",
"float",
"double",
")",
"}"
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L1141-L1143 | train | Create a float binding that is the next value after the specified value. | Of course, here is the Java code you requested:
```java
public static FloatBinding nextAfter(final float start, final ObservableFloatValue direction) {
return createFloatBinding(() -> Math.nextAfter(start, direction.get()), direction);
}
```
Hope this helps! |
baidubce/bce-sdk-java | src/main/java/com/baidubce/AbstractBceClient.java | AbstractBceClient.computeEndpoint | private URI computeEndpoint() {
String endpoint = this.config.getEndpoint();
try {
if (endpoint == null) {
if (this.isRegionSupported()) {
endpoint = String.format("%s://%s.%s.%s", this.config.getProtocol(), this.serviceId,
this... | java | private URI computeEndpoint() {
String endpoint = this.config.getEndpoint();
try {
if (endpoint == null) {
if (this.isRegionSupported()) {
endpoint = String.format("%s://%s.%s.%s", this.config.getProtocol(), this.serviceId,
this... | [
"private",
"URI",
"computeEndpoint",
"(",
")",
"{",
"String",
"endpoint",
"=",
"this",
".",
"config",
".",
"getEndpoint",
"(",
")",
";",
"try",
"{",
"if",
"(",
"endpoint",
"==",
"null",
")",
"{",
"if",
"(",
"this",
".",
"isRegionSupported",
"(",
")",
... | Returns the default target service endpoint.
<p>
The endpoint will be in the form of "http(s)://<Service ID>[.<Region>].baidubce.com".
@return the computed service endpoint
@throws IllegalArgumentException if the endpoint specified in the client configuration is not a valid URI. | [
"Returns",
"the",
"default",
"target",
"service",
"endpoint",
".",
"<p",
">",
"The",
"endpoint",
"will",
"be",
"in",
"the",
"form",
"of",
"http",
"(",
"s",
")",
":",
"//",
"<Service",
"ID",
">",
"[",
".",
"<Region",
">",
"]",
".",
"baidubce",
".",
... | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/AbstractBceClient.java#L236-L253 | train | Compute the endpoint. | Of course, here is the Java code you requested:
```java
private URI computeEndpoint() {
String endpoint = this.config.getEndpoint();
try {
if (endpoint == null) {
if (this.isRegionSupported()) {
endpoint = String.format("%s://%s.%s.%s", this.config.getPro... |
awltech/org.parallelj | parallelj-launching-parent/parallelj-launching-api/src/main/java/org/parallelj/launching/transport/jmx/JmxServer.java | JmxServer.stop | public final synchronized void stop() {
LaunchingMessageKind.IJMX0003.format();
unRegisterMBeans();
try {
if (this.jmxConnectorServer != null) {
this.jmxConnectorServer.stop();
}
} catch (IOException e1) {
// Do nothing
}
try {
UnicastRemoteObject.unexportObject(register, true);
} catch (... | java | public final synchronized void stop() {
LaunchingMessageKind.IJMX0003.format();
unRegisterMBeans();
try {
if (this.jmxConnectorServer != null) {
this.jmxConnectorServer.stop();
}
} catch (IOException e1) {
// Do nothing
}
try {
UnicastRemoteObject.unexportObject(register, true);
} catch (... | [
"public",
"final",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"LaunchingMessageKind",
".",
"IJMX0003",
".",
"format",
"(",
")",
";",
"unRegisterMBeans",
"(",
")",
";",
"try",
"{",
"if",
"(",
"this",
".",
"jmxConnectorServer",
"!=",
"null",
")",
"{",
... | Stop the JMX Server | [
"Stop",
"the",
"JMX",
"Server"
] | 2a2498cc4ac6227df6f45d295ec568cad3cffbc4 | https://github.com/awltech/org.parallelj/blob/2a2498cc4ac6227df6f45d295ec568cad3cffbc4/parallelj-launching-parent/parallelj-launching-api/src/main/java/org/parallelj/launching/transport/jmx/JmxServer.java#L131-L147 | train | Stop the JMX connector server. | Of course, here is the Java code you requested:
```java
public final synchronized void stop() {
LaunchingMessageKind.IJMX0003.format();
unRegisterMBeans();
try {
if (this.jmxConnectorServer != null) {
this.jmxConnectorServer.stop();
}
} catch (IOException e1) {
// Do nothing
}
try {
Unicas... |
aws/aws-sdk-java | aws-java-sdk-lex/src/main/java/com/amazonaws/services/lexruntime/model/GenericAttachment.java | GenericAttachment.setButtons | public void setButtons(java.util.Collection<Button> buttons) {
if (buttons == null) {
this.buttons = null;
return;
}
this.buttons = new java.util.ArrayList<Button>(buttons);
} | java | public void setButtons(java.util.Collection<Button> buttons) {
if (buttons == null) {
this.buttons = null;
return;
}
this.buttons = new java.util.ArrayList<Button>(buttons);
} | [
"public",
"void",
"setButtons",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"Button",
">",
"buttons",
")",
"{",
"if",
"(",
"buttons",
"==",
"null",
")",
"{",
"this",
".",
"buttons",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"buttons",
... | <p>
The list of options to show to the user.
</p>
@param buttons
The list of options to show to the user. | [
"<p",
">",
"The",
"list",
"of",
"options",
"to",
"show",
"to",
"the",
"user",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lex/src/main/java/com/amazonaws/services/lexruntime/model/GenericAttachment.java#L243-L250 | train | Sets the value of the buttons property. | Of course, here is the Java code you requested:
```java
public void setButtons(java.util.Collection<Button> buttons) {
if (buttons == null) {
this.buttons = null;
return;
}
this.buttons = new java.util.ArrayList<Button>(buttons);
}
```
Hope this helps! |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.runJavaCompiler | @SuppressWarnings({ "resource" })
protected boolean runJavaCompiler(File classDirectory, Iterable<File> sourcePathDirectories,
Iterable<File> classPathEntries, boolean enableCompilerOutput,
boolean enableOptimization, IProgressMonitor progress) {
String encoding = this.encodingProvider.getDefaultEncoding();
... | java | @SuppressWarnings({ "resource" })
protected boolean runJavaCompiler(File classDirectory, Iterable<File> sourcePathDirectories,
Iterable<File> classPathEntries, boolean enableCompilerOutput,
boolean enableOptimization, IProgressMonitor progress) {
String encoding = this.encodingProvider.getDefaultEncoding();
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"resource\"",
"}",
")",
"protected",
"boolean",
"runJavaCompiler",
"(",
"File",
"classDirectory",
",",
"Iterable",
"<",
"File",
">",
"sourcePathDirectories",
",",
"Iterable",
"<",
"File",
">",
"classPathEntries",
",",
"boolean"... | Run the Java compiler.
@param classDirectory the output directory.
@param sourcePathDirectories the source directories.
@param classPathEntries classpath entries.
@param enableCompilerOutput indicates if the Java compiler output is displayed.
@param enableOptimization indicates if the Java compiler must applied optimi... | [
"Run",
"the",
"Java",
"compiler",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1747-L1781 | train | Run the Java compiler. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "resource" })
protected boolean runJavaCompiler(File classDirectory, Iterable<File> sourcePathDirectories,
Iterable<File> classPathEntries, boolean enableCompilerOutput,
boolean enableOptimization, IProgressMonitor progress) {
String ... |
moleculer-java/moleculer-java | src/main/java/services/moleculer/util/FastBuildTree.java | FastBuildTree.putUnsafe | public FastBuildTree putUnsafe(String name, Object value) {
map.put(name, value);
return this;
} | java | public FastBuildTree putUnsafe(String name, Object value) {
map.put(name, value);
return this;
} | [
"public",
"FastBuildTree",
"putUnsafe",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"map",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | --- FAST AND UNSAFE PUT --- | [
"---",
"FAST",
"AND",
"UNSAFE",
"PUT",
"---"
] | 27575c44b9ecacc17c4456ceacf5d1851abf1cc4 | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/util/FastBuildTree.java#L59-L62 | train | Put a value into the map. | Of course, here is the Java code you requested:
```java
public FastBuildTree putUnsafe(String name, Object value) {
map.put(name, value);
return this;
}
```
Hope this helps! |
demidenko05/beigesoft-bcommon | src/main/java/org/beigesoft/service/UtlReflection.java | UtlReflection.retrieveFields | @Override
public final Field[] retrieveFields(final Class<?> clazz) {
Set<Field> fieldsSet = new HashSet<Field>();
for (Field fld : clazz.getDeclaredFields()) {
int modifiersMask = fld.getModifiers();
if ((modifiersMask & Modifier.PRIVATE) > 0
&& (modifiersMask & Modifier.STATIC) == 0)... | java | @Override
public final Field[] retrieveFields(final Class<?> clazz) {
Set<Field> fieldsSet = new HashSet<Field>();
for (Field fld : clazz.getDeclaredFields()) {
int modifiersMask = fld.getModifiers();
if ((modifiersMask & Modifier.PRIVATE) > 0
&& (modifiersMask & Modifier.STATIC) == 0)... | [
"@",
"Override",
"public",
"final",
"Field",
"[",
"]",
"retrieveFields",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Set",
"<",
"Field",
">",
"fieldsSet",
"=",
"new",
"HashSet",
"<",
"Field",
">",
"(",
")",
";",
"for",
"(",
"Field",
"... | <p>Retrieve all nonstatic private members from given class.</p>
@param clazz - class
@return Field[] fields. | [
"<p",
">",
"Retrieve",
"all",
"nonstatic",
"private",
"members",
"from",
"given",
"class",
".",
"<",
"/",
"p",
">"
] | bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf | https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/service/UtlReflection.java#L36-L53 | train | Retrieve the fields from the given class. | Of course, here is the Java code you requested:
```java
@Override
public final Field[] retrieveFields(final Class<?> clazz) {
Set<Field> fieldsSet = new HashSet<Field>();
for (Field fld : clazz.getDeclaredFields()) {
int modifiersMask = fld.getModifiers();
if ((modifiersMask & Modifier.PRIVATE) >... |
KostyaSha/yet-another-docker-plugin | yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/DockerCloud.java | DockerCloud.provisionWithWait | private DockerSlave provisionWithWait(DockerSlaveTemplate template, ProvisioningActivity.Id id)
throws Exception {
final DockerContainerLifecycle dockerContainerLifecycle = template.getDockerContainerLifecycle();
final String imageId = dockerContainerLifecycle.getImage();
final Docke... | java | private DockerSlave provisionWithWait(DockerSlaveTemplate template, ProvisioningActivity.Id id)
throws Exception {
final DockerContainerLifecycle dockerContainerLifecycle = template.getDockerContainerLifecycle();
final String imageId = dockerContainerLifecycle.getImage();
final Docke... | [
"private",
"DockerSlave",
"provisionWithWait",
"(",
"DockerSlaveTemplate",
"template",
",",
"ProvisioningActivity",
".",
"Id",
"id",
")",
"throws",
"Exception",
"{",
"final",
"DockerContainerLifecycle",
"dockerContainerLifecycle",
"=",
"template",
".",
"getDockerContainerLi... | Provision slave container and wait for it's availability. | [
"Provision",
"slave",
"container",
"and",
"wait",
"for",
"it",
"s",
"availability",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/DockerCloud.java#L222-L267 | train | Provision with wait. | Of course, here is the Java code you requested:
```java
private DockerSlave provisionWithWait(DockerSlaveTemplate template, ProvisioningActivity.Id id)
throws Exception {
final DockerContainerLifecycle dockerContainerLifecycle = template.getDockerContainerLifecycle();
final String imageId =... |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java | CommerceWishListPersistenceImpl.findByG_U_D | @Override
public List<CommerceWishList> findByG_U_D(long groupId, long userId,
boolean defaultWishList, int start, int end) {
return findByG_U_D(groupId, userId, defaultWishList, start, end, null);
} | java | @Override
public List<CommerceWishList> findByG_U_D(long groupId, long userId,
boolean defaultWishList, int start, int end) {
return findByG_U_D(groupId, userId, defaultWishList, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWishList",
">",
"findByG_U_D",
"(",
"long",
"groupId",
",",
"long",
"userId",
",",
"boolean",
"defaultWishList",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByG_U_D",
"(",
"groupId",
",",
... | Returns a range of all the commerce wish lists where groupId = ? and userId = ? and defaultWishList = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"wish",
"lists",
"where",
"groupId",
"=",
"?",
";",
"and",
"userId",
"=",
"?",
";",
"and",
"defaultWishList",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java#L3673-L3677 | train | Returns a range of commerce wish lists where the user has permission to view the commerce wish lists. | Of course, here is the Java code you requested:
```java
@Override
public List<CommerceWishList> findByG_U_D(long groupId, long userId,
boolean defaultWishList, int start, int end) {
return findByG_U_D(groupId, userId, defaultWishList, start, end, null);
}
```
Hope this helps! |
taimos/dvalin | jaxrs/src/main/java/de/taimos/dvalin/jaxrs/providers/AuthorizationProvider.java | AuthorizationProvider.createSC | protected static SecurityContext createSC(String user, String... roles) {
final Subject subject = new Subject();
final Principal principal = new SimplePrincipal(user);
subject.getPrincipals().add(principal);
if (roles != null) {
for (final String role : roles) {
... | java | protected static SecurityContext createSC(String user, String... roles) {
final Subject subject = new Subject();
final Principal principal = new SimplePrincipal(user);
subject.getPrincipals().add(principal);
if (roles != null) {
for (final String role : roles) {
... | [
"protected",
"static",
"SecurityContext",
"createSC",
"(",
"String",
"user",
",",
"String",
"...",
"roles",
")",
"{",
"final",
"Subject",
"subject",
"=",
"new",
"Subject",
"(",
")",
";",
"final",
"Principal",
"principal",
"=",
"new",
"SimplePrincipal",
"(",
... | Create a {@link SecurityContext} to return to the provider
@param user the user principal
@param roles the roles of the user
@return the {@link SecurityContext} | [
"Create",
"a",
"{",
"@link",
"SecurityContext",
"}",
"to",
"return",
"to",
"the",
"provider"
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/jaxrs/src/main/java/de/taimos/dvalin/jaxrs/providers/AuthorizationProvider.java#L144-L156 | train | Create a new security context. | Of course, here is the Java code you requested:
```java
protected static SecurityContext createSC(String user, String... roles) {
final Subject subject = new Subject();
final Principal principal = new SimplePrincipal(user);
subject.getPrincipals().add(principal);
if (roles != null) {
... |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java | CommercePriceEntryPersistenceImpl.findByGroupId | @Override
public List<CommercePriceEntry> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | java | @Override
public List<CommercePriceEntry> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
... | Returns a range of all the commerce price entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L1535-L1539 | train | Returns a range of commerce price entries matching the group id. | Of course, here is the Java code you requested:
```java
@Override
public List<CommercePriceEntry> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
}
```
Hope this helps! |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/DependencyList.java | DependencyList.getLabel | public String getLabel() {
if (log.isLoggable(Level.FINER)) {
final String methodName = "getLabel"; //$NON-NLS-1$
log.entering(DependencyList.class.getName(), methodName);
log.exiting(DependencyList.class.getName(), methodName, label);
}
return label;
} | java | public String getLabel() {
if (log.isLoggable(Level.FINER)) {
final String methodName = "getLabel"; //$NON-NLS-1$
log.entering(DependencyList.class.getName(), methodName);
log.exiting(DependencyList.class.getName(), methodName, label);
}
return label;
} | [
"public",
"String",
"getLabel",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"getLabel\"",
";",
"//$NON-NLS-1$\r",
"log",
".",
"entering",
"(",
"DependencyList",
".",... | Returns the label set by {@link #setLabel(String)}
@return The previously set label string | [
"Returns",
"the",
"label",
"set",
"by",
"{"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/DependencyList.java#L336-L343 | train | Returns the label of the dependency list. | Of course, here is the Java code you requested:
```java
public String getLabel() {
if (log.isLoggable(Level.FINER)) {
final String methodName = "getLabel"; //$NON-NLS-1$
log.entering(DependencyList.class.getName(), methodName);
log.exiting(DependencyList.class.getName(), methodName, label);
}
retu... |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/rolling/helper/FileRenameAction.java | FileRenameAction.execute | public static boolean execute(
final File source, final File destination, boolean renameEmptyFiles) {
if (renameEmptyFiles || (source.length() > 0)) {
return source.renameTo(destination);
}
return source.delete();
} | java | public static boolean execute(
final File source, final File destination, boolean renameEmptyFiles) {
if (renameEmptyFiles || (source.length() > 0)) {
return source.renameTo(destination);
}
return source.delete();
} | [
"public",
"static",
"boolean",
"execute",
"(",
"final",
"File",
"source",
",",
"final",
"File",
"destination",
",",
"boolean",
"renameEmptyFiles",
")",
"{",
"if",
"(",
"renameEmptyFiles",
"||",
"(",
"source",
".",
"length",
"(",
")",
">",
"0",
")",
")",
... | Rename file.
@param source current file name.
@param destination new file name.
@param renameEmptyFiles if true, rename file even if empty, otherwise delete empty files.
@return true if successfully renamed. | [
"Rename",
"file",
"."
] | 493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/helper/FileRenameAction.java#L74-L81 | train | Execute a CRA - CENT rename or delete. | Of course, here is the Java code you requested:
```java
public static boolean execute(
final File source, final File destination, boolean renameEmptyFiles) {
if (renameEmptyFiles || (source.length() > 0)) {
return source.renameTo(destination);
}
return source.delete();
}
```
Hope this helps! |
linkedin/Spyglass | spyglass/src/main/java/com/linkedin/android/spyglass/suggestions/SuggestionsAdapter.java | SuggestionsAdapter.addSuggestions | public void addSuggestions(final @NonNull SuggestionsResult result,
final @NonNull String bucket,
final @NonNull TokenSource source) {
// Add result to proper bucket and remove from waiting
QueryToken query = result.getQueryToken();
s... | java | public void addSuggestions(final @NonNull SuggestionsResult result,
final @NonNull String bucket,
final @NonNull TokenSource source) {
// Add result to proper bucket and remove from waiting
QueryToken query = result.getQueryToken();
s... | [
"public",
"void",
"addSuggestions",
"(",
"final",
"@",
"NonNull",
"SuggestionsResult",
"result",
",",
"final",
"@",
"NonNull",
"String",
"bucket",
",",
"final",
"@",
"NonNull",
"TokenSource",
"source",
")",
"{",
"// Add result to proper bucket and remove from waiting",
... | Add mention suggestions to a given bucket in the adapter. The adapter tracks the latest result for every given
bucket, and passes this information to the SuggestionsManager to construct the list of suggestions in the
appropriate order.
<p>
Note: This should be called exactly once for every bucket returned from the quer... | [
"Add",
"mention",
"suggestions",
"to",
"a",
"given",
"bucket",
"in",
"the",
"adapter",
".",
"The",
"adapter",
"tracks",
"the",
"latest",
"result",
"for",
"every",
"given",
"bucket",
"and",
"passes",
"this",
"information",
"to",
"the",
"SuggestionsManager",
"to... | 3816f2da13b75e1a20b2911d1b780b73f44e1150 | https://github.com/linkedin/Spyglass/blob/3816f2da13b75e1a20b2911d1b780b73f44e1150/spyglass/src/main/java/com/linkedin/android/spyglass/suggestions/SuggestionsAdapter.java#L103-L135 | valid | Add suggestions to a specific bucket. | Of course, here is the Java code you requested:
```java
public void addSuggestions(final @NonNull SuggestionsResult result,
final @NonNull String bucket,
final @NonNull TokenSource source) {
// Add result to proper bucket and remove from waiting
... |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/live/internal/AsteriskQueueImpl.java | AsteriskQueueImpl.fireMemberAdded | void fireMemberAdded(AsteriskQueueMemberImpl member)
{
synchronized (listeners)
{
for (AsteriskQueueListener listener : listeners)
{
try
{
listener.onMemberAdded(member);
}
catch (Exception e)... | java | void fireMemberAdded(AsteriskQueueMemberImpl member)
{
synchronized (listeners)
{
for (AsteriskQueueListener listener : listeners)
{
try
{
listener.onMemberAdded(member);
}
catch (Exception e)... | [
"void",
"fireMemberAdded",
"(",
"AsteriskQueueMemberImpl",
"member",
")",
"{",
"synchronized",
"(",
"listeners",
")",
"{",
"for",
"(",
"AsteriskQueueListener",
"listener",
":",
"listeners",
")",
"{",
"try",
"{",
"listener",
".",
"onMemberAdded",
"(",
"member",
"... | Notifies all registered listener that a member has been added to the queue.
@param member added to the queue | [
"Notifies",
"all",
"registered",
"listener",
"that",
"a",
"member",
"has",
"been",
"added",
"to",
"the",
"queue",
"."
] | cdc9849270d97ef75afa447a02c5194ed29121eb | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/live/internal/AsteriskQueueImpl.java#L531-L547 | train | Notifies all registered listeners that a member has been added to the Asterisk Queue. | Of course, here is the Java code you requested:
```java
void fireMemberAdded(AsteriskQueueMemberImpl member)
{
synchronized (listeners)
{
for (AsteriskQueueListener listener : listeners)
{
try
{
listener.onMemberAdded(membe... |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/common/ProcessUtil.java | ProcessUtil.getLocalConnectorAddress | public static JMXServiceURL getLocalConnectorAddress(Process p, boolean startAgent) {
return getLocalConnectorAddress(Integer.toString(getPid(p)), startAgent);
} | java | public static JMXServiceURL getLocalConnectorAddress(Process p, boolean startAgent) {
return getLocalConnectorAddress(Integer.toString(getPid(p)), startAgent);
} | [
"public",
"static",
"JMXServiceURL",
"getLocalConnectorAddress",
"(",
"Process",
"p",
",",
"boolean",
"startAgent",
")",
"{",
"return",
"getLocalConnectorAddress",
"(",
"Integer",
".",
"toString",
"(",
"getPid",
"(",
"p",
")",
")",
",",
"startAgent",
")",
";",
... | Returns the JMX connector address of a child process.
@param p the process to which to connect
@param startAgent whether to installed the JMX agent in the target process if not already in place
@return a {@link JMXServiceURL} to the process's MBean server | [
"Returns",
"the",
"JMX",
"connector",
"address",
"of",
"a",
"child",
"process",
"."
] | 291a54e501a32aaf0284707b8c1fbff6a566822b | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/common/ProcessUtil.java#L85-L87 | train | Get the JMXConnectorAddress for the given process. | Of course, here is the Java code you requested:
```java
public static JMXServiceURL getLocalConnectorAddress(Process p, boolean startAgent) {
return getLocalConnectorAddress(Integer.toString(getPid(p)), startAgent);
}
```
Hope this helps! |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java | BusNetwork.removeBusLine | public boolean removeBusLine(String name) {
final Iterator<BusLine> iterator = this.busLines.iterator();
BusLine busLine;
int i = 0;
while (iterator.hasNext()) {
busLine = iterator.next();
if (name.equals(busLine.getName())) {
iterator.remove();
busLine.setContainer(null);
busLine.setEventFira... | java | public boolean removeBusLine(String name) {
final Iterator<BusLine> iterator = this.busLines.iterator();
BusLine busLine;
int i = 0;
while (iterator.hasNext()) {
busLine = iterator.next();
if (name.equals(busLine.getName())) {
iterator.remove();
busLine.setContainer(null);
busLine.setEventFira... | [
"public",
"boolean",
"removeBusLine",
"(",
"String",
"name",
")",
"{",
"final",
"Iterator",
"<",
"BusLine",
">",
"iterator",
"=",
"this",
".",
"busLines",
".",
"iterator",
"(",
")",
";",
"BusLine",
"busLine",
";",
"int",
"i",
"=",
"0",
";",
"while",
"(... | Remove the bus line with the given name.
All the itineraries and the associated stops will be removed also.
If this bus line removal implies empty hubs, these hubs
will be also removed.
@param name is the name of the bus line to remove.
@return <code>true</code> if the bus line was successfully removed, otherwise <cod... | [
"Remove",
"the",
"bus",
"line",
"with",
"the",
"given",
"name",
".",
"All",
"the",
"itineraries",
"and",
"the",
"associated",
"stops",
"will",
"be",
"removed",
"also",
".",
"If",
"this",
"bus",
"line",
"removal",
"implies",
"empty",
"hubs",
"these",
"hubs"... | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java#L568-L591 | train | Remove the bus line with the given name. | Of course, here is the Java code you requested:
```java
public boolean removeBusLine(String name) {
final Iterator<BusLine> iterator = this.busLines.iterator();
BusLine busLine;
int i = 0;
while (iterator.hasNext()) {
busLine = iterator.next();
if (name.equals(busLine.getName())) {
iterator.remove();... |
dickschoeller/gedbrowser | gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/repository/SubmitterDocumentRepositoryMongoImpl.java | SubmitterDocumentRepositoryMongoImpl.findByRootAndString | @Override
public final SubmitterDocument findByRootAndString(
final RootDocument rootDocument, final String string) {
final SubmitterDocument submitterDocument =
findByFileAndString(rootDocument.getFilename(), string);
if (submitterDocument == null) {
return n... | java | @Override
public final SubmitterDocument findByRootAndString(
final RootDocument rootDocument, final String string) {
final SubmitterDocument submitterDocument =
findByFileAndString(rootDocument.getFilename(), string);
if (submitterDocument == null) {
return n... | [
"@",
"Override",
"public",
"final",
"SubmitterDocument",
"findByRootAndString",
"(",
"final",
"RootDocument",
"rootDocument",
",",
"final",
"String",
"string",
")",
"{",
"final",
"SubmitterDocument",
"submitterDocument",
"=",
"findByFileAndString",
"(",
"rootDocument",
... | {@inheritDoc} | [
"{"
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/repository/SubmitterDocumentRepositoryMongoImpl.java#L54-L65 | train | Find by root document and string. | Of course, here is the Java code you requested:
```java
@Override
public final SubmitterDocument findByRootAndString(
final RootDocument rootDocument, final String string) {
final SubmitterDocument submitterDocument =
findByFileAndString(rootDocument.getFilename(), string);
... |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/ddl/CassandraThriftFacade.java | CassandraThriftFacade.forSeedsAndPort | public static CassandraThriftFacade forSeedsAndPort(String seeds, int defaultPort) {
final String seed = seeds.contains(",") ? seeds.substring(0, seeds.indexOf(',')) : seeds;
HostAndPort host = HostAndPort.fromString(seed).withDefaultPort(defaultPort);
return new CassandraThriftFacade(new TFrame... | java | public static CassandraThriftFacade forSeedsAndPort(String seeds, int defaultPort) {
final String seed = seeds.contains(",") ? seeds.substring(0, seeds.indexOf(',')) : seeds;
HostAndPort host = HostAndPort.fromString(seed).withDefaultPort(defaultPort);
return new CassandraThriftFacade(new TFrame... | [
"public",
"static",
"CassandraThriftFacade",
"forSeedsAndPort",
"(",
"String",
"seeds",
",",
"int",
"defaultPort",
")",
"{",
"final",
"String",
"seed",
"=",
"seeds",
".",
"contains",
"(",
"\",\"",
")",
"?",
"seeds",
".",
"substring",
"(",
"0",
",",
"seeds",
... | Note: <code>seeds</code> may be a single host or comma-delimited list. | [
"Note",
":",
"<code",
">",
"seeds<",
"/",
"code",
">",
"may",
"be",
"a",
"single",
"host",
"or",
"comma",
"-",
"delimited",
"list",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/ddl/CassandraThriftFacade.java#L24-L28 | train | Create a CassandraThriftFacade for the given seed and port. | Of course, here is the Java code you requested:
```java
public static CassandraThriftFacade forSeedsAndPort(String seeds, int defaultPort) {
final String seed = seeds.contains(",") ? seeds.substring(0, seeds.indexOf(',')) : seeds;
HostAndPort host = HostAndPort.fromString(seed).withDefaultPort(defaultP... |
calimero-project/calimero-core | src/tuwien/auto/calimero/xml/XmlOutputFactory.java | XmlOutputFactory.createXMLWriter | public XmlWriter createXMLWriter(final String systemId) throws KNXMLException
{
final XmlResolver res = new XmlResolver();
final OutputStream os = res.resolveOutput(systemId);
return create(os, true);
} | java | public XmlWriter createXMLWriter(final String systemId) throws KNXMLException
{
final XmlResolver res = new XmlResolver();
final OutputStream os = res.resolveOutput(systemId);
return create(os, true);
} | [
"public",
"XmlWriter",
"createXMLWriter",
"(",
"final",
"String",
"systemId",
")",
"throws",
"KNXMLException",
"{",
"final",
"XmlResolver",
"res",
"=",
"new",
"XmlResolver",
"(",
")",
";",
"final",
"OutputStream",
"os",
"=",
"res",
".",
"resolveOutput",
"(",
"... | Creates a {@link XmlWriter} to write into the XML resource located by the specified identifier.
@param systemId location identifier of the XML resource
@return XML writer
@throws KNXMLException if creation of the writer failed or XML resource can't be resolved | [
"Creates",
"a",
"{",
"@link",
"XmlWriter",
"}",
"to",
"write",
"into",
"the",
"XML",
"resource",
"located",
"by",
"the",
"specified",
"identifier",
"."
] | 7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8 | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/xml/XmlOutputFactory.java#L74-L79 | train | Create an XML writer. | Of course, here is the Java code you requested:
```java
public XmlWriter createXMLWriter(final String systemId) throws KNXMLException
{
final XmlResolver res = new XmlResolver();
final OutputStream os = res.resolveOutput(systemId);
return create(os, true);
}
```
Hope this helps! |
cverges/expect4j | src/main/java/tcl/lang/SubstCrCommand.java | SubstCrCommand.cmdProc | public void cmdProc(Interp interp, TclObject argv[])
throws TclException {
int currentObjIndex, len, i;
int objc = argv.length - 1;
boolean doBackslashes = true;
boolean doCmds = true;
boolean doVars = true;
StringBuffer result = new StringBuffer();
String s;
... | java | public void cmdProc(Interp interp, TclObject argv[])
throws TclException {
int currentObjIndex, len, i;
int objc = argv.length - 1;
boolean doBackslashes = true;
boolean doCmds = true;
boolean doVars = true;
StringBuffer result = new StringBuffer();
String s;
... | [
"public",
"void",
"cmdProc",
"(",
"Interp",
"interp",
",",
"TclObject",
"argv",
"[",
"]",
")",
"throws",
"TclException",
"{",
"int",
"currentObjIndex",
",",
"len",
",",
"i",
";",
"int",
"objc",
"=",
"argv",
".",
"length",
"-",
"1",
";",
"boolean",
"doB... | This procedure is invoked to process the "subst" Tcl command.
See the user documentation for details on what it does.
@param interp the current interpreter.
@param argv command arguments.
@exception TclException if wrong # of args or invalid argument(s). | [
"This",
"procedure",
"is",
"invoked",
"to",
"process",
"the",
"subst",
"Tcl",
"command",
".",
"See",
"the",
"user",
"documentation",
"for",
"details",
"on",
"what",
"it",
"does",
"."
] | 97b1da9b7bd231344cd7b7ce26d14caf8bb16cd6 | https://github.com/cverges/expect4j/blob/97b1da9b7bd231344cd7b7ce26d14caf8bb16cd6/src/main/java/tcl/lang/SubstCrCommand.java#L41-L133 | train | cmdProc - Process the command line. | Of course, here is the Java code you requested:
```java
public void cmdProc(Interp interp, TclObject argv[])
throws TclException {
int currentObjIndex, len, i;
int objc = argv.length - 1;
boolean doBackslashes = true;
boolean doCmds = true;
boolean doVars = true;
Str... |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.addGrant | public boolean addGrant(
ClusterNode node, String sessionId, ResourceRequestInfo req) {
synchronized (node) {
if (node.deleted) {
return false;
}
if (!node.checkForGrant(Utilities.getUnitResourceRequest(
req.getType()), resourceLimit)) {
return false;
}
n... | java | public boolean addGrant(
ClusterNode node, String sessionId, ResourceRequestInfo req) {
synchronized (node) {
if (node.deleted) {
return false;
}
if (!node.checkForGrant(Utilities.getUnitResourceRequest(
req.getType()), resourceLimit)) {
return false;
}
n... | [
"public",
"boolean",
"addGrant",
"(",
"ClusterNode",
"node",
",",
"String",
"sessionId",
",",
"ResourceRequestInfo",
"req",
")",
"{",
"synchronized",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"deleted",
")",
"{",
"return",
"false",
";",
"}",
"if",
"... | Add a grant to a node
@param node the node the grant is on
@param sessionId the session the grant is given to
@param req the request this grant satisfies
@return true if the grant can be added to the node, false otherwise | [
"Add",
"a",
"grant",
"to",
"a",
"node"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L866-L887 | train | Add a grant to a ClusterNode. | Of course, here is the Java code you requested:
```java
public boolean addGrant(
ClusterNode node, String sessionId, ResourceRequestInfo req) {
synchronized (node) {
if (node.deleted) {
return false;
}
if (!node.checkForGrant(Utilities.getUnitResourceRequest(
req.getType()),... |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/DataSetIteratorSplitter.java | DataSetIteratorSplitter.getTrainIterator | public DataSetIterator getTrainIterator() {
return new DataSetIterator() {
@Override
public DataSet next(int i) {
throw new UnsupportedOperationException();
}
@Override
public List<String> getLabels() {
return backedIte... | java | public DataSetIterator getTrainIterator() {
return new DataSetIterator() {
@Override
public DataSet next(int i) {
throw new UnsupportedOperationException();
}
@Override
public List<String> getLabels() {
return backedIte... | [
"public",
"DataSetIterator",
"getTrainIterator",
"(",
")",
"{",
"return",
"new",
"DataSetIterator",
"(",
")",
"{",
"@",
"Override",
"public",
"DataSet",
"next",
"(",
"int",
"i",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
")",
";",
"}",
"... | This method returns train iterator instance
@return | [
"This",
"method",
"returns",
"train",
"iterator",
"instance"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/DataSetIteratorSplitter.java#L85-L180 | train | Get an iterator for training data sets. | Of course, here is the Java code you requested:
```java
public DataSetIterator getTrainIterator() {
return new DataSetIterator() {
@Override
public DataSet next(int i) {
throw new UnsupportedOperationException();
}
@Override
public Li... |
verhas/License3j | src/main/java/javax0/license3j/License.java | License.sign | public void sign(PrivateKey key, String digest) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
add(Feature.Create.stringFeature(DIGEST_KEY, digest));
final var digester = MessageDigest.getInstance(digest);
fi... | java | public void sign(PrivateKey key, String digest) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
add(Feature.Create.stringFeature(DIGEST_KEY, digest));
final var digester = MessageDigest.getInstance(digest);
fi... | [
"public",
"void",
"sign",
"(",
"PrivateKey",
"key",
",",
"String",
"digest",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchPaddingException",
",",
"InvalidKeyException",
",",
"BadPaddingException",
",",
"IllegalBlockSizeException",
"{",
"add",
"(",
"Feature",
... | Sign the license.
<p>
The license is signed the following way:
<ol>
<li>Add the digest algorithm string to the license as a feature. The feature name is {@code signatureDigest}
(name is defined in the constant {@link #DIGEST_KEY} in this class).
</li>
<li>The license is converted to binary format</li>
<li>A digest is c... | [
"Sign",
"the",
"license",
".",
"<p",
">",
"The",
"license",
"is",
"signed",
"the",
"following",
"way",
":",
"<ol",
">",
"<li",
">",
"Add",
"the",
"digest",
"algorithm",
"string",
"to",
"the",
"license",
"as",
"a",
"feature",
".",
"The",
"feature",
"nam... | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/License.java#L101-L111 | train | Sign a string using the specified private key. | Of course, here is the Java code you requested:
```java
public void sign(PrivateKey key, String digest) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
add(Feature.Create.stringFeature(DIGEST_KEY, digest));
final var... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.