repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jenkinsci/jenkins | core/src/main/java/jenkins/model/ParameterizedJobMixIn.java | ParameterizedJobMixIn.getTrigger | public static @CheckForNull <T extends Trigger<?>> T getTrigger(Job<?,?> job, Class<T> clazz) {
if (!(job instanceof ParameterizedJob)) {
return null;
}
for (Trigger<?> t : ((ParameterizedJob<?, ?>) job).getTriggers().values()) {
if (clazz.isInstance(t)) {
... | java | public static @CheckForNull <T extends Trigger<?>> T getTrigger(Job<?,?> job, Class<T> clazz) {
if (!(job instanceof ParameterizedJob)) {
return null;
}
for (Trigger<?> t : ((ParameterizedJob<?, ?>) job).getTriggers().values()) {
if (clazz.isInstance(t)) {
... | [
"public",
"static",
"@",
"CheckForNull",
"<",
"T",
"extends",
"Trigger",
"<",
"?",
">",
">",
"T",
"getTrigger",
"(",
"Job",
"<",
"?",
",",
"?",
">",
"job",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"!",
"(",
"job",
"instanceof",
... | Checks for the existence of a specific trigger on a job.
@param <T> a trigger type
@param job a job
@param clazz the type of the trigger
@return a configured trigger of the requested type, or null if there is none such, or {@code job} is not a {@link ParameterizedJob}
@since 1.621 | [
"Checks",
"for",
"the",
"existence",
"of",
"a",
"specific",
"trigger",
"on",
"a",
"job",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java#L306-L316 | train | Get a trigger from a ParameterizedJob. | Create a Java method that does the following: "Get a trigger from a ParameterizedJob.". | Of course, here is the Java code you requested:
```java
public static @CheckForNull <T extends Trigger<?>> T getTrigger(Job<?,?> job, Class<T> clazz) {
if (!(job instanceof ParameterizedJob)) {
return null;
}
for (Trigger<?> t : ((ParameterizedJob<?, ?>) job).getTriggers().values())... | |
XDean/Java-EX | src/main/java/xdean/jex/util/reflect/ReflectUtil.java | ReflectUtil.getAllMethods | public static Method[] getAllMethods(Class<?> clz) {
Set<Method> set = new HashSet<>();
List<Class<?>> classes = new ArrayList<>();
classes.add(clz);
classes.addAll(Arrays.asList(getAllSuperClasses(clz)));
classes.addAll(Arrays.asList(getAllInterfaces(clz)));
for (Class<?> c : classes) {
... | java | public static Method[] getAllMethods(Class<?> clz) {
Set<Method> set = new HashSet<>();
List<Class<?>> classes = new ArrayList<>();
classes.add(clz);
classes.addAll(Arrays.asList(getAllSuperClasses(clz)));
classes.addAll(Arrays.asList(getAllInterfaces(clz)));
for (Class<?> c : classes) {
... | [
"public",
"static",
"Method",
"[",
"]",
"getAllMethods",
"(",
"Class",
"<",
"?",
">",
"clz",
")",
"{",
"Set",
"<",
"Method",
">",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
"=",
"new",
... | Get all methods
@param clz
@return | [
"Get",
"all",
"methods"
] | 9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7 | https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/reflect/ReflectUtil.java#L140-L150 | train | Returns all methods of a class including all super interfaces and interfaces. | Create a Java method that does the following: "Returns all methods of a class including all super interfaces and interfaces.". | Of course, here is the Java code you requested:
```java
public static Method[] getAllMethods(Class<?> clz) {
Set<Method> set = new HashSet<>();
List<Class<?>> classes = new ArrayList<>();
classes.add(clz);
classes.addAll(Arrays.asList(getAllSuperClasses(clz)));
classes.addAll(Arrays.asList(get... | |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java | CmsGalleriesTab.createTreeItem | protected CmsTreeItem createTreeItem(
CmsGalleryFolderBean galleryInfo,
List<String> selectedGalleries,
boolean forTree) {
CmsListItemWidget listItemWidget = new CmsListItemWidget(galleryInfo);
listItemWidget.setUnselectable();
CmsCheckBox checkBox = new CmsCheckBox();
... | java | protected CmsTreeItem createTreeItem(
CmsGalleryFolderBean galleryInfo,
List<String> selectedGalleries,
boolean forTree) {
CmsListItemWidget listItemWidget = new CmsListItemWidget(galleryInfo);
listItemWidget.setUnselectable();
CmsCheckBox checkBox = new CmsCheckBox();
... | [
"protected",
"CmsTreeItem",
"createTreeItem",
"(",
"CmsGalleryFolderBean",
"galleryInfo",
",",
"List",
"<",
"String",
">",
"selectedGalleries",
",",
"boolean",
"forTree",
")",
"{",
"CmsListItemWidget",
"listItemWidget",
"=",
"new",
"CmsListItemWidget",
"(",
"galleryInfo... | Creates a tree item widget used in list and tree view of this tab.<p>
@param galleryInfo the gallery folder bean
@param selectedGalleries the selected galleries
@param forTree <code>true</code> if the item is used within tree view
@return the tree item | [
"Creates",
"a",
"tree",
"item",
"widget",
"used",
"in",
"list",
"and",
"tree",
"view",
"of",
"this",
"tab",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java#L473-L511 | train | Creates a tree item. | Create a Java method that does the following: "Creates a tree item.". | Of course, here is the Java code you requested:
```java
protected CmsTreeItem createTreeItem(
CmsGalleryFolderBean galleryInfo,
List<String> selectedGalleries,
boolean forTree) {
CmsListItemWidget listItemWidget = new CmsListItemWidget(galleryInfo);
listItemWidget.setUnselectab... | |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java | MonetaryFormat.roundingMode | public MonetaryFormat roundingMode(RoundingMode roundingMode) {
if (roundingMode == this.roundingMode)
return this;
else
return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
shift, roundingMode, codes, codeS... | java | public MonetaryFormat roundingMode(RoundingMode roundingMode) {
if (roundingMode == this.roundingMode)
return this;
else
return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
shift, roundingMode, codes, codeS... | [
"public",
"MonetaryFormat",
"roundingMode",
"(",
"RoundingMode",
"roundingMode",
")",
"{",
"if",
"(",
"roundingMode",
"==",
"this",
".",
"roundingMode",
")",
"return",
"this",
";",
"else",
"return",
"new",
"MonetaryFormat",
"(",
"negativeSign",
",",
"positiveSign"... | Set rounding mode to use when it becomes necessary. | [
"Set",
"rounding",
"mode",
"to",
"use",
"when",
"it",
"becomes",
"necessary",
"."
] | 9cf13d29315014ed59cf4fc5944e5f227e8df9a6 | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java#L215-L221 | train | Returns a copy of this object with the specified rounding mode. | Create a Java method that does the following: "Returns a copy of this object with the specified rounding mode.". | Of course, here is the Java code you requested:
```java
public MonetaryFormat roundingMode(RoundingMode roundingMode) {
if (roundingMode == this.roundingMode)
return this;
else
return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGrou... | |
aws/aws-sdk-java | aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/GetCostAndUsageResult.java | GetCostAndUsageResult.withGroupDefinitions | public GetCostAndUsageResult withGroupDefinitions(GroupDefinition... groupDefinitions) {
if (this.groupDefinitions == null) {
setGroupDefinitions(new java.util.ArrayList<GroupDefinition>(groupDefinitions.length));
}
for (GroupDefinition ele : groupDefinitions) {
this.grou... | java | public GetCostAndUsageResult withGroupDefinitions(GroupDefinition... groupDefinitions) {
if (this.groupDefinitions == null) {
setGroupDefinitions(new java.util.ArrayList<GroupDefinition>(groupDefinitions.length));
}
for (GroupDefinition ele : groupDefinitions) {
this.grou... | [
"public",
"GetCostAndUsageResult",
"withGroupDefinitions",
"(",
"GroupDefinition",
"...",
"groupDefinitions",
")",
"{",
"if",
"(",
"this",
".",
"groupDefinitions",
"==",
"null",
")",
"{",
"setGroupDefinitions",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<... | <p>
The groups that are specified by the <code>Filter</code> or <code>GroupBy</code> parameters in the request.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setGroupDefinitions(java.util.Collection)} or {@link #withGroupDefinitions(java.util.Collection)} if you
want to... | [
"<p",
">",
"The",
"groups",
"that",
"are",
"specified",
"by",
"the",
"<code",
">",
"Filter<",
"/",
"code",
">",
"or",
"<code",
">",
"GroupBy<",
"/",
"code",
">",
"parameters",
"in",
"the",
"request",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/GetCostAndUsageResult.java#L140-L148 | train | A list of the group definitions that you want to retrieve. | Create a Java method that does the following: "A list of the group definitions that you want to retrieve.". | Of course, here is the Java code you requested:
```java
public GetCostAndUsageResult withGroupDefinitions(GroupDefinition... groupDefinitions) {
if (this.groupDefinitions == null) {
setGroupDefinitions(new java.util.ArrayList<GroupDefinition>(groupDefinitions.length));
}
for (GroupD... | |
MaxxtonGroup/microdocs | example/customer-service/src/main/java/com/example/service/customer/service/CustomerService.java | CustomerService.removeCustomer | public boolean removeCustomer(Long customerId) {
Customer customer = getCustomer(customerId);
if(customer != null){
customerRepository.delete(customer);
return true;
}
return false;
} | java | public boolean removeCustomer(Long customerId) {
Customer customer = getCustomer(customerId);
if(customer != null){
customerRepository.delete(customer);
return true;
}
return false;
} | [
"public",
"boolean",
"removeCustomer",
"(",
"Long",
"customerId",
")",
"{",
"Customer",
"customer",
"=",
"getCustomer",
"(",
"customerId",
")",
";",
"if",
"(",
"customer",
"!=",
"null",
")",
"{",
"customerRepository",
".",
"delete",
"(",
"customer",
")",
";"... | Remove customer from the repository
@param customerId the id of the customer
@return true if the customer is removed, false if no customer with the given id exists | [
"Remove",
"customer",
"from",
"the",
"repository"
] | fdc80f203d68145af3e8d28d13de63ddfa3e6953 | https://github.com/MaxxtonGroup/microdocs/blob/fdc80f203d68145af3e8d28d13de63ddfa3e6953/example/customer-service/src/main/java/com/example/service/customer/service/CustomerService.java#L64-L71 | train | Remove a customer from the database | Create a Java method that does the following: "Remove a customer from the database". | Of course, here is the Java code you requested:
```java
public boolean removeCustomer(Long customerId) {
Customer customer = getCustomer(customerId);
if(customer != null){
customerRepository.delete(customer);
return true;
}
return false;
}
```
Hope this help... | |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/GrammaticalStructure.java | GrammaticalStructure.getDep | private static void getDep(TreeGraphNode t, List<TypedDependency> basicDep,
Filter<TypedDependency> f) {
if (t.isPhrasal()) { // don't do leaves of POS tags (chris changed this from numChildren > 0 in 2010)
Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> depMa... | java | private static void getDep(TreeGraphNode t, List<TypedDependency> basicDep,
Filter<TypedDependency> f) {
if (t.isPhrasal()) { // don't do leaves of POS tags (chris changed this from numChildren > 0 in 2010)
Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> depMa... | [
"private",
"static",
"void",
"getDep",
"(",
"TreeGraphNode",
"t",
",",
"List",
"<",
"TypedDependency",
">",
"basicDep",
",",
"Filter",
"<",
"TypedDependency",
">",
"f",
")",
"{",
"if",
"(",
"t",
".",
"isPhrasal",
"(",
")",
")",
"{",
"// don't do leaves of ... | Look through the tree t and adds to the List basicDep dependencies
which aren't in it but which satisfy the filter f.
@param t The tree to examine (not changed)
@param basicDep The list of dependencies which may be augmented
@param f Additional dependencies are added only if they pass this filter | [
"Look",
"through",
"the",
"tree",
"t",
"and",
"adds",
"to",
"the",
"List",
"basicDep",
"dependencies",
"which",
"aren",
"t",
"in",
"it",
"but",
"which",
"satisfy",
"the",
"filter",
"f",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/GrammaticalStructure.java#L336-L363 | train | Get the basic dependency list from a TreeGraphNode | Create a Java method that does the following: "Get the basic dependency list from a TreeGraphNode". | Of course, here is the Java code you requested:
```java
private static void getDep(TreeGraphNode t, List<TypedDependency> basicDep,
Filter<TypedDependency> f) {
if (t.isPhrasal()) { // don't do leaves of POS tags (chris changed this from numChildren > 0 in 2010)
Map<C... | |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performBooleanQuery | public boolean performBooleanQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) {
SPARQLQueryDefinition qdef = sparqlManager.newQueryDefinition(queryString);
if(notNull(baseURI) && !baseURI.isEmpty()){ qdef.setBaseUri(baseURI);}
qde... | java | public boolean performBooleanQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) {
SPARQLQueryDefinition qdef = sparqlManager.newQueryDefinition(queryString);
if(notNull(baseURI) && !baseURI.isEmpty()){ qdef.setBaseUri(baseURI);}
qde... | [
"public",
"boolean",
"performBooleanQuery",
"(",
"String",
"queryString",
",",
"SPARQLQueryBindingSet",
"bindings",
",",
"Transaction",
"tx",
",",
"boolean",
"includeInferred",
",",
"String",
"baseURI",
")",
"{",
"SPARQLQueryDefinition",
"qdef",
"=",
"sparqlManager",
... | executes BooleanQuery
@param queryString
@param bindings
@param tx
@param includeInferred
@param baseURI
@return | [
"executes",
"BooleanQuery"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L228-L242 | train | Perform a boolean query. | Create a Java method that does the following: "Perform a boolean query.". | Of course, here is the Java code you requested:
```java
public boolean performBooleanQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) {
SPARQLQueryDefinition qdef = sparqlManager.newQueryDefinition(queryString);
if(notNull(baseURI) && !b... | |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java | GeoPackageManagerImpl.externalDatabaseSet | @Override
public Set<String> externalDatabaseSet() {
Set<String> databases = new HashSet<String>();
addExternalDatabases(databases);
return databases;
} | java | @Override
public Set<String> externalDatabaseSet() {
Set<String> databases = new HashSet<String>();
addExternalDatabases(databases);
return databases;
} | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"externalDatabaseSet",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"databases",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"addExternalDatabases",
"(",
"databases",
")",
";",
"return",
"d... | {@inheritDoc} | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java#L235-L240 | test | Get the set of external databases. | Create a Java method that does the following: "Get the set of external databases.". | Of course, here is the Java code you requested:
```java
@Override
public Set<String> externalDatabaseSet() {
Set<String> databases = new HashSet<String>();
addExternalDatabases(databases);
return databases;
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeAssessmentRunsResult.java | DescribeAssessmentRunsResult.setAssessmentRuns | public void setAssessmentRuns(java.util.Collection<AssessmentRun> assessmentRuns) {
if (assessmentRuns == null) {
this.assessmentRuns = null;
return;
}
this.assessmentRuns = new java.util.ArrayList<AssessmentRun>(assessmentRuns);
} | java | public void setAssessmentRuns(java.util.Collection<AssessmentRun> assessmentRuns) {
if (assessmentRuns == null) {
this.assessmentRuns = null;
return;
}
this.assessmentRuns = new java.util.ArrayList<AssessmentRun>(assessmentRuns);
} | [
"public",
"void",
"setAssessmentRuns",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"AssessmentRun",
">",
"assessmentRuns",
")",
"{",
"if",
"(",
"assessmentRuns",
"==",
"null",
")",
"{",
"this",
".",
"assessmentRuns",
"=",
"null",
";",
"return",
";",
... | <p>
Information about the assessment run.
</p>
@param assessmentRuns
Information about the assessment run. | [
"<p",
">",
"Information",
"about",
"the",
"assessment",
"run",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeAssessmentRunsResult.java#L60-L67 | train | Sets the value of the assessmentRuns property. | Create a Java method that does the following: "Sets the value of the assessmentRuns property.". | Of course, here is the Java code you requested:
```java
public void setAssessmentRuns(java.util.Collection<AssessmentRun> assessmentRuns) {
if (assessmentRuns == null) {
this.assessmentRuns = null;
return;
}
this.assessmentRuns = new java.util.ArrayList<AssessmentRun>(a... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/visitor/smap/SmapVisitor.java | SmapVisitor.addScriptingLineInfo | private void addScriptingLineInfo(Element jspElement) {
JspId jspId = new JspId(jspElement.getAttributeNS(Constants.JSP_NAMESPACE, "id"));
if (fileList.contains(jspId.getFilePath()) == false) {
smapStratum.addFile(jspId.getFileName(), jspId.getFilePath());
fileList.add(jspId.getF... | java | private void addScriptingLineInfo(Element jspElement) {
JspId jspId = new JspId(jspElement.getAttributeNS(Constants.JSP_NAMESPACE, "id"));
if (fileList.contains(jspId.getFilePath()) == false) {
smapStratum.addFile(jspId.getFileName(), jspId.getFilePath());
fileList.add(jspId.getF... | [
"private",
"void",
"addScriptingLineInfo",
"(",
"Element",
"jspElement",
")",
"{",
"JspId",
"jspId",
"=",
"new",
"JspId",
"(",
"jspElement",
".",
"getAttributeNS",
"(",
"Constants",
".",
"JSP_NAMESPACE",
",",
"\"id\"",
")",
")",
";",
"if",
"(",
"fileList",
"... | /* New method for Defect 260728 | [
"/",
"*",
"New",
"method",
"for",
"Defect",
"260728"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/visitor/smap/SmapVisitor.java#L429-L466 | train | Add scripting line info. | Create a Java method that does the following: "Add scripting line info.". | Of course, here is the Java code you requested:
```java
private void addScriptingLineInfo(Element jspElement) {
JspId jspId = new JspId(jspElement.getAttributeNS(Constants.JSP_NAMESPACE, "id"));
if (fileList.contains(jspId.getFilePath()) == false) {
smapStratum.addFile(jspId.getFileName(), ... | |
knightliao/disconf | disconf-web/src/main/java/com/baidu/disconf/web/web/config/controller/ConfigFetcherController.java | ConfigFetcherController.getItem | @NoAuth
@RequestMapping(value = "/item", method = RequestMethod.GET)
@ResponseBody
public ValueVo getItem(ConfForm confForm) {
LOG.info(confForm.toString());
//
// 校验
//
ConfigFullModel configModel = null;
try {
configModel = configValidator4Fetc... | java | @NoAuth
@RequestMapping(value = "/item", method = RequestMethod.GET)
@ResponseBody
public ValueVo getItem(ConfForm confForm) {
LOG.info(confForm.toString());
//
// 校验
//
ConfigFullModel configModel = null;
try {
configModel = configValidator4Fetc... | [
"@",
"NoAuth",
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/item\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"@",
"ResponseBody",
"public",
"ValueVo",
"getItem",
"(",
"ConfForm",
"confForm",
")",
"{",
"LOG",
".",
"info",
"(",
"confForm",
"."... | 获取配置项 Item
@param confForm
@return | [
"获取配置项",
"Item"
] | d413cbce9334fe38a5a24982ce4db3a6ed8e98ea | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-web/src/main/java/com/baidu/disconf/web/web/config/controller/ConfigFetcherController.java#L81-L101 | train | Get a value vo for a single item | Create a Java method that does the following: "Get a value vo for a single item". | Of course, here is the Java code you requested:
```java
@NoAuth
@RequestMapping(value = "/item", method = RequestMethod.GET)
@ResponseBody
public ValueVo getItem(ConfForm confForm) {
LOG.info(confForm.toString());
//
// 校验
//
ConfigFullModel configModel = null;
... | |
wildfly/wildfly | connector/src/main/java/org/jboss/as/connector/util/ConnectorServices.java | ConnectorServices.getDeploymentServiceName | public static synchronized ServiceName getDeploymentServiceName(final String raName, final Activation raxml) {
if (raName == null)
throw ConnectorLogger.ROOT_LOGGER.undefinedVar("RaName");
ServiceName serviceName = null;
ModifiableResourceAdapter ra = (ModifiableResourceAdapter) rax... | java | public static synchronized ServiceName getDeploymentServiceName(final String raName, final Activation raxml) {
if (raName == null)
throw ConnectorLogger.ROOT_LOGGER.undefinedVar("RaName");
ServiceName serviceName = null;
ModifiableResourceAdapter ra = (ModifiableResourceAdapter) rax... | [
"public",
"static",
"synchronized",
"ServiceName",
"getDeploymentServiceName",
"(",
"final",
"String",
"raName",
",",
"final",
"Activation",
"raxml",
")",
"{",
"if",
"(",
"raName",
"==",
"null",
")",
"throw",
"ConnectorLogger",
".",
"ROOT_LOGGER",
".",
"undefinedV... | resource-adapter DMR resource | [
"resource",
"-",
"adapter",
"DMR",
"resource"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/connector/src/main/java/org/jboss/as/connector/util/ConnectorServices.java#L142-L155 | test | Get the service name for the resource adapter. | Create a Java method that does the following: "Get the service name for the resource adapter.". | Of course, here is the Java code you requested:
```java
public static synchronized ServiceName getDeploymentServiceName(final String raName, final Activation raxml) {
if (raName == null)
throw ConnectorLogger.ROOT_LOGGER.undefinedVar("RaName");
ServiceName serviceName = null;
Modif... | |
irmen/Serpent | java/src/main/java/net/razorvine/serpent/Parser.java | Parser.parse | public Ast parse(byte[] serialized) throws ParseException
{
try {
return parse(new String(serialized, "utf-8"));
} catch (UnsupportedEncodingException e) {
throw new ParseException(e.toString());
}
} | java | public Ast parse(byte[] serialized) throws ParseException
{
try {
return parse(new String(serialized, "utf-8"));
} catch (UnsupportedEncodingException e) {
throw new ParseException(e.toString());
}
} | [
"public",
"Ast",
"parse",
"(",
"byte",
"[",
"]",
"serialized",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"return",
"parse",
"(",
"new",
"String",
"(",
"serialized",
",",
"\"utf-8\"",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
... | Parse from a byte array (containing utf-8 encoded string with the Python literal expression in it) | [
"Parse",
"from",
"a",
"byte",
"array",
"(",
"containing",
"utf",
"-",
"8",
"encoded",
"string",
"with",
"the",
"Python",
"literal",
"expression",
"in",
"it",
")"
] | 763a6e15f75c4d5937cd16dfc70b0930a442b541 | https://github.com/irmen/Serpent/blob/763a6e15f75c4d5937cd16dfc70b0930a442b541/java/src/main/java/net/razorvine/serpent/Parser.java#L31-L38 | train | Parse a byte array of bytes into an Ast object. | Create a Java method that does the following: "Parse a byte array of bytes into an Ast object.". | Of course, here is the Java code you requested:
```java
public Ast parse(byte[] serialized) throws ParseException
{
try {
return parse(new String(serialized, "utf-8"));
} catch (UnsupportedEncodingException e) {
throw new ParseException(e.toString());
}
}
```
Hope this helps! | |
shrinkwrap/resolver | maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/bootstrap/MavenSettingsBuilder.java | MavenSettingsBuilder.enrichWithOfflineMode | private Settings enrichWithOfflineMode(Settings settings) {
String goOffline = SecurityActions.getProperty(ALT_MAVEN_OFFLINE);
if (goOffline != null && goOffline.length() > 0) {
settings.setOffline(Boolean.valueOf(goOffline));
}
return settings;
} | java | private Settings enrichWithOfflineMode(Settings settings) {
String goOffline = SecurityActions.getProperty(ALT_MAVEN_OFFLINE);
if (goOffline != null && goOffline.length() > 0) {
settings.setOffline(Boolean.valueOf(goOffline));
}
return settings;
} | [
"private",
"Settings",
"enrichWithOfflineMode",
"(",
"Settings",
"settings",
")",
"{",
"String",
"goOffline",
"=",
"SecurityActions",
".",
"getProperty",
"(",
"ALT_MAVEN_OFFLINE",
")",
";",
"if",
"(",
"goOffline",
"!=",
"null",
"&&",
"goOffline",
".",
"length",
... | adds offline mode from system property | [
"adds",
"offline",
"mode",
"from",
"system",
"property"
] | e881a84b8cff5b0a014f2a5ebf612be3eb9db01f | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/bootstrap/MavenSettingsBuilder.java#L267-L275 | train | Enrich with offline mode. | Create a Java method that does the following: "Enrich with offline mode.". | Of course, here is the Java code you requested:
```java
private Settings enrichWithOfflineMode(Settings settings) {
String goOffline = SecurityActions.getProperty(ALT_MAVEN_OFFLINE);
if (goOffline != null && goOffline.length() > 0) {
settings.setOffline(Boolean.valueOf(goOffline));
... | |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.getRowKeyValueAsString | protected String getRowKeyValueAsString(final Object key) {
final String result = key.toString();
return "r_" + StringUtils.deleteWhitespace(result);
} | java | protected String getRowKeyValueAsString(final Object key) {
final String result = key.toString();
return "r_" + StringUtils.deleteWhitespace(result);
} | [
"protected",
"String",
"getRowKeyValueAsString",
"(",
"final",
"Object",
"key",
")",
"{",
"final",
"String",
"result",
"=",
"key",
".",
"toString",
"(",
")",
";",
"return",
"\"r_\"",
"+",
"StringUtils",
".",
"deleteWhitespace",
"(",
"result",
")",
";",
"}"
] | Gets the row key value as a String suitable for use in javascript rendering.
@param context
@return | [
"Gets",
"the",
"row",
"key",
"value",
"as",
"a",
"String",
"suitable",
"for",
"use",
"in",
"javascript",
"rendering",
"."
] | afdbca591f60f47898e3517e1e939bc2f63d5355 | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L617-L620 | train | Get the row key value as string. | Create a Java method that does the following: "Get the row key value as string.". | Of course, here is the Java code you requested:
```java
protected String getRowKeyValueAsString(final Object key) {
final String result = key.toString();
return "r_" + StringUtils.deleteWhitespace(result);
}
```
Hope this helps! | |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java | PermissionTemplateService.applyDefault | public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
PermissionTemplateDto template = findTemplate(dbSession, component);
checkArgument(template != null, "Cannot retrieve default permission template");
copyPermissions(dbSession, template, component,... | java | public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
PermissionTemplateDto template = findTemplate(dbSession, component);
checkArgument(template != null, "Cannot retrieve default permission template");
copyPermissions(dbSession, template, component,... | [
"public",
"void",
"applyDefault",
"(",
"DbSession",
"dbSession",
",",
"ComponentDto",
"component",
",",
"@",
"Nullable",
"Integer",
"projectCreatorUserId",
")",
"{",
"PermissionTemplateDto",
"template",
"=",
"findTemplate",
"(",
"dbSession",
",",
"component",
")",
"... | Apply the default permission template to project. The project can already exist (so it has permissions) or
can be provisioned (so has no permissions yet).
@param projectCreatorUserId id of the user who creates the project, only if project is provisioned. He will | [
"Apply",
"the",
"default",
"permission",
"template",
"to",
"project",
".",
"The",
"project",
"can",
"already",
"exist",
"(",
"so",
"it",
"has",
"permissions",
")",
"or",
"can",
"be",
"provisioned",
"(",
"so",
"has",
"no",
"permissions",
"yet",
")",
"."
] | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java#L108-L112 | train | Apply default permissions to a component. | Create a Java method that does the following: "Apply default permissions to a component.". | Of course, here is the Java code you requested:
```java
public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
PermissionTemplateDto template = findTemplate(dbSession, component);
checkArgument(template != null, "Cannot retrieve default permission templa... | |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2Engine.java | SM2Engine.xor | private void xor(byte[] data, byte[] kdfOut, int dOff, int dRemaining) {
for (int i = 0; i != dRemaining; i++) {
data[dOff + i] ^= kdfOut[i];
}
} | java | private void xor(byte[] data, byte[] kdfOut, int dOff, int dRemaining) {
for (int i = 0; i != dRemaining; i++) {
data[dOff + i] ^= kdfOut[i];
}
} | [
"private",
"void",
"xor",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"kdfOut",
",",
"int",
"dOff",
",",
"int",
"dRemaining",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"!=",
"dRemaining",
";",
"i",
"++",
")",
"{",
"data",
... | 异或
@param data 数据
@param kdfOut kdf输出值
@param dOff d偏移
@param dRemaining d剩余 | [
"异或"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2Engine.java#L326-L330 | train | XOR data with the KDF output | Create a Java method that does the following: "XOR data with the KDF output". | Of course, here is the Java code you requested:
```java
private void xor(byte[] data, byte[] kdfOut, int dOff, int dRemaining) {
for (int i = 0; i != dRemaining; i++) {
data[dOff + i] ^= kdfOut[i];
}
}
```
Hope this helps! | |
bazaarvoice/ostrich | zookeeper/registry/src/main/java/com/bazaarvoice/ostrich/registry/zookeeper/ZooKeeperServiceRegistry.java | ZooKeeperServiceRegistry.makeEndPointPath | @VisibleForTesting
static String makeEndPointPath(ServiceEndPoint endPoint) {
String servicePath = makeServicePath(endPoint.getServiceName());
String id = endPoint.getId();
return ZKPaths.makePath(servicePath, id);
} | java | @VisibleForTesting
static String makeEndPointPath(ServiceEndPoint endPoint) {
String servicePath = makeServicePath(endPoint.getServiceName());
String id = endPoint.getId();
return ZKPaths.makePath(servicePath, id);
} | [
"@",
"VisibleForTesting",
"static",
"String",
"makeEndPointPath",
"(",
"ServiceEndPoint",
"endPoint",
")",
"{",
"String",
"servicePath",
"=",
"makeServicePath",
"(",
"endPoint",
".",
"getServiceName",
"(",
")",
")",
";",
"String",
"id",
"=",
"endPoint",
".",
"ge... | Convert a <code>ServiceEndPoint</code> into the path in ZooKeeper where it will be registered.
@param endPoint The service end point to get the ZooKeeper path for.
@return The ZooKeeper path. | [
"Convert",
"a",
"<code",
">",
"ServiceEndPoint<",
"/",
"code",
">",
"into",
"the",
"path",
"in",
"ZooKeeper",
"where",
"it",
"will",
"be",
"registered",
"."
] | 13591867870ab23445253f11fc872662a8028191 | https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/zookeeper/registry/src/main/java/com/bazaarvoice/ostrich/registry/zookeeper/ZooKeeperServiceRegistry.java#L164-L169 | train | Create a path to the service end point. | Create a Java method that does the following: "Create a path to the service end point.". | Of course, here is the Java code you requested:
```java
@VisibleForTesting
static String makeEndPointPath(ServiceEndPoint endPoint) {
String servicePath = makeServicePath(endPoint.getServiceName());
String id = endPoint.getId();
return ZKPaths.makePath(servicePath, id);
}
```
Hope this... | |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java | GVRPose.combine | public void combine(GVRPose src)
{
int numbones = getNumBones();
if (getSkeleton() != src.getSkeleton())
throw new IllegalArgumentException("GVRPose.copy: input pose is incompatible with this pose");
mNeedSync = false;
src.sync();
for (int i = 0; i < numbones; +... | java | public void combine(GVRPose src)
{
int numbones = getNumBones();
if (getSkeleton() != src.getSkeleton())
throw new IllegalArgumentException("GVRPose.copy: input pose is incompatible with this pose");
mNeedSync = false;
src.sync();
for (int i = 0; i < numbones; +... | [
"public",
"void",
"combine",
"(",
"GVRPose",
"src",
")",
"{",
"int",
"numbones",
"=",
"getNumBones",
"(",
")",
";",
"if",
"(",
"getSkeleton",
"(",
")",
"!=",
"src",
".",
"getSkeleton",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"GV... | Combines the input pose with this pose.
<p>
The matrices of each pose are multiplied together
to produce the combined pose.
@param src pose to combine. | [
"Combines",
"the",
"input",
"pose",
"with",
"this",
"pose",
".",
"<p",
">",
"The",
"matrices",
"of",
"each",
"pose",
"are",
"multiplied",
"together",
"to",
"produce",
"the",
"combined",
"pose",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L753-L774 | train | Combine this sphere with another sphere. | Create a Java method that does the following: "Combine this sphere with another sphere.". | Of course, here is the Java code you requested:
```java
public void combine(GVRPose src)
{
int numbones = getNumBones();
if (getSkeleton() != src.getSkeleton())
throw new IllegalArgumentException("GVRPose.copy: input pose is incompatible with this pose");
mNeedSync = false;
... | |
DigitalPebble/storm-crawler | core/src/main/java/com/digitalpebble/stormcrawler/util/URLUtil.java | URLUtil.fixPureQueryTargets | static URL fixPureQueryTargets(URL base, String target)
throws MalformedURLException {
if (!target.startsWith("?"))
return new URL(base, target);
String basePath = base.getPath();
String baseRightMost = "";
int baseRightMostIdx = basePath.lastIndexOf("/");
... | java | static URL fixPureQueryTargets(URL base, String target)
throws MalformedURLException {
if (!target.startsWith("?"))
return new URL(base, target);
String basePath = base.getPath();
String baseRightMost = "";
int baseRightMostIdx = basePath.lastIndexOf("/");
... | [
"static",
"URL",
"fixPureQueryTargets",
"(",
"URL",
"base",
",",
"String",
"target",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"!",
"target",
".",
"startsWith",
"(",
"\"?\"",
")",
")",
"return",
"new",
"URL",
"(",
"base",
",",
"target",
")",
... | Handle the case in RFC3986 section 5.4.1 example 7, and similar. | [
"Handle",
"the",
"case",
"in",
"RFC3986",
"section",
"5",
".",
"4",
".",
"1",
"example",
"7",
"and",
"similar",
"."
] | 5d0465192ab8fbd89a90db32cb20960a282411ea | https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/core/src/main/java/com/digitalpebble/stormcrawler/util/URLUtil.java#L56-L72 | test | Fix the Pure Query Target. | Create a Java method that does the following: "Fix the Pure Query Target.". | Of course, here is the Java code you requested:
```java
static URL fixPureQueryTargets(URL base, String target)
throws MalformedURLException {
if (!target.startsWith("?"))
return new URL(base, target);
String basePath = base.getPath();
String baseRightMost = "";
... | |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsSetupBean.java | CmsSetupBean.setWorkplaceSite | public void setWorkplaceSite(String newSite) {
String oldSite = getWorkplaceSite();
// get the site list
String siteList = getExtProperty("site.root.list");
// replace old site URL in site list with new site URL
siteList = CmsStringUtil.substitute(siteList, oldSite, newSite);
... | java | public void setWorkplaceSite(String newSite) {
String oldSite = getWorkplaceSite();
// get the site list
String siteList = getExtProperty("site.root.list");
// replace old site URL in site list with new site URL
siteList = CmsStringUtil.substitute(siteList, oldSite, newSite);
... | [
"public",
"void",
"setWorkplaceSite",
"(",
"String",
"newSite",
")",
"{",
"String",
"oldSite",
"=",
"getWorkplaceSite",
"(",
")",
";",
"// get the site list",
"String",
"siteList",
"=",
"getExtProperty",
"(",
"\"site.root.list\"",
")",
";",
"// replace old site URL in... | Sets the OpenCms workplace site.<p>
@param newSite the OpenCms workplace site | [
"Sets",
"the",
"OpenCms",
"workplace",
"site",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L2257-L2266 | train | Sets the workplace site. | Create a Java method that does the following: "Sets the workplace site.". | Of course, here is the Java code you requested:
```java
public void setWorkplaceSite(String newSite) {
String oldSite = getWorkplaceSite();
// get the site list
String siteList = getExtProperty("site.root.list");
// replace old site URL in site list with new site URL
siteList =... | |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_disk.java | xen_health_disk.get | public static xen_health_disk[] get(nitro_service client) throws Exception
{
xen_health_disk resource = new xen_health_disk();
resource.validate("get");
return (xen_health_disk[]) resource.get_resources(client);
} | java | public static xen_health_disk[] get(nitro_service client) throws Exception
{
xen_health_disk resource = new xen_health_disk();
resource.validate("get");
return (xen_health_disk[]) resource.get_resources(client);
} | [
"public",
"static",
"xen_health_disk",
"[",
"]",
"get",
"(",
"nitro_service",
"client",
")",
"throws",
"Exception",
"{",
"xen_health_disk",
"resource",
"=",
"new",
"xen_health_disk",
"(",
")",
";",
"resource",
".",
"validate",
"(",
"\"get\"",
")",
";",
"return... | <pre>
Use this operation to get disk IO statistics.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"get",
"disk",
"IO",
"statistics",
".",
"<",
"/",
"pre",
">"
] | c840919f1a8f7c0a5634c0f23d34fa14d1765ff1 | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_disk.java#L273-L278 | train | Use this API to fetch all the xen_health_disk resources that are configured on netscaler. | Create a Java method that does the following: "Use this API to fetch all the xen_health_disk resources that are configured on netscaler.". | Of course, here is the Java code you requested:
```java
public static xen_health_disk[] get(nitro_service client) throws Exception
{
xen_health_disk resource = new xen_health_disk();
resource.validate("get");
return (xen_health_disk[]) resource.get_resources(client);
}
```
Hope this helps! | |
grzesiek-galezowski/AutoFixtureGenerator | src/main/java/autofixture/publicinterface/Any.java | Any.sortedSetOf | @NonNull
public static <T> SortedSet<T> sortedSetOf(final Class<T> clazz) {
assertIsNotParameterized(clazz, ErrorMessages.msg("sortedSetOf"));
return PrivateGenerate.manyAsSortedSetOf(TypeToken.of(clazz));
} | java | @NonNull
public static <T> SortedSet<T> sortedSetOf(final Class<T> clazz) {
assertIsNotParameterized(clazz, ErrorMessages.msg("sortedSetOf"));
return PrivateGenerate.manyAsSortedSetOf(TypeToken.of(clazz));
} | [
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"SortedSet",
"<",
"T",
">",
"sortedSetOf",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"assertIsNotParameterized",
"(",
"clazz",
",",
"ErrorMessages",
".",
"msg",
"(",
"\"sortedSetOf\"",
")",
... | sorted sets: incomplete | [
"sorted",
"sets",
":",
"incomplete"
] | a5e1146ec5109e6505f8aff604a20461ec86a57d | https://github.com/grzesiek-galezowski/AutoFixtureGenerator/blob/a5e1146ec5109e6505f8aff604a20461ec86a57d/src/main/java/autofixture/publicinterface/Any.java#L574-L578 | test | Returns a SortedSet of the specified type. | Create a Java method that does the following: "Returns a SortedSet of the specified type.". | Of course, here is the Java code you requested:
```java
@NonNull
public static <T> SortedSet<T> sortedSetOf(final Class<T> clazz) {
assertIsNotParameterized(clazz, ErrorMessages.msg("sortedSetOf"));
return PrivateGenerate.manyAsSortedSetOf(TypeToken.of(clazz));
}
```
Hope this helps! | |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-datasources/src/main/java/org/wisdom/database/jdbc/impl/Patterns.java | Patterns.populate | public static boolean populate(HikariConfig datasource, String url, boolean isDev) {
Matcher matcher = MYSQL_URL.matcher(url);
if (matcher.matches()) {
populateForMySQLFull(matcher, url, datasource);
return true;
}
matcher = H2_URL.matcher(url);
if (match... | java | public static boolean populate(HikariConfig datasource, String url, boolean isDev) {
Matcher matcher = MYSQL_URL.matcher(url);
if (matcher.matches()) {
populateForMySQLFull(matcher, url, datasource);
return true;
}
matcher = H2_URL.matcher(url);
if (match... | [
"public",
"static",
"boolean",
"populate",
"(",
"HikariConfig",
"datasource",
",",
"String",
"url",
",",
"boolean",
"isDev",
")",
"{",
"Matcher",
"matcher",
"=",
"MYSQL_URL",
".",
"matcher",
"(",
"url",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
... | Checks if the given url is matching one of the known pattern (MySQL and H2),
if so try to extract information from the url and populate the data source.
<p/>
In all case, this method set the data source url, even if none known pattern match.
@param datasource the data source to populate
@param url the jdbc url
... | [
"Checks",
"if",
"the",
"given",
"url",
"is",
"matching",
"one",
"of",
"the",
"known",
"pattern",
"(",
"MySQL",
"and",
"H2",
")",
"if",
"so",
"try",
"to",
"extract",
"information",
"from",
"the",
"url",
"and",
"populate",
"the",
"data",
"source",
".",
"... | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-datasources/src/main/java/org/wisdom/database/jdbc/impl/Patterns.java#L50-L67 | train | Populate the HikariConfig with the data from the url. | Create a Java method that does the following: "Populate the HikariConfig with the data from the url.". | Of course, here is the Java code you requested:
```java
public static boolean populate(HikariConfig datasource, String url, boolean isDev) {
Matcher matcher = MYSQL_URL.matcher(url);
if (matcher.matches()) {
populateForMySQLFull(matcher, url, datasource);
return true;
}
... | |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java | SipMessageStreamBuilder.process | public boolean process(final byte[] newData) {
if (newData != null) {
buffer.write(newData);
}
boolean done = false;
while (!done) {
final int index = buffer.getReaderIndex();
final State currentState = state;
state = actions[state.ordinal... | java | public boolean process(final byte[] newData) {
if (newData != null) {
buffer.write(newData);
}
boolean done = false;
while (!done) {
final int index = buffer.getReaderIndex();
final State currentState = state;
state = actions[state.ordinal... | [
"public",
"boolean",
"process",
"(",
"final",
"byte",
"[",
"]",
"newData",
")",
"{",
"if",
"(",
"newData",
"!=",
"null",
")",
"{",
"buffer",
".",
"write",
"(",
"newData",
")",
";",
"}",
"boolean",
"done",
"=",
"false",
";",
"while",
"(",
"!",
"done... | Process more incoming data.
@param newData
@return | [
"Process",
"more",
"incoming",
"data",
"."
] | 0f06bb0dac76c812187829f580a8d476ca99a1a1 | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java#L205-L219 | train | Process the data. | Create a Java method that does the following: "Process the data.". | Of course, here is the Java code you requested:
```java
public boolean process(final byte[] newData) {
if (newData != null) {
buffer.write(newData);
}
boolean done = false;
while (!done) {
final int index = buffer.getReaderIndex();
final State curren... | |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/AvailabilityFilteringRule.java | AvailabilityFilteringRule.choose | @Override
public Server choose(Object key) {
int count = 0;
Server server = roundRobinRule.choose(key);
while (count++ <= 10) {
if (server != null && predicate.apply(new PredicateKey(server))) {
return server;
}
server = roundRobinRule.choo... | java | @Override
public Server choose(Object key) {
int count = 0;
Server server = roundRobinRule.choose(key);
while (count++ <= 10) {
if (server != null && predicate.apply(new PredicateKey(server))) {
return server;
}
server = roundRobinRule.choo... | [
"@",
"Override",
"public",
"Server",
"choose",
"(",
"Object",
"key",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Server",
"server",
"=",
"roundRobinRule",
".",
"choose",
"(",
"key",
")",
";",
"while",
"(",
"count",
"++",
"<=",
"10",
")",
"{",
"if",
"... | This method is overridden to provide a more efficient implementation which does not iterate through
all servers. This is under the assumption that in most cases, there are more available instances
than not. | [
"This",
"method",
"is",
"overridden",
"to",
"provide",
"a",
"more",
"efficient",
"implementation",
"which",
"does",
"not",
"iterate",
"through",
"all",
"servers",
".",
"This",
"is",
"under",
"the",
"assumption",
"that",
"in",
"most",
"cases",
"there",
"are",
... | d15cd7715b0bf2f64ae6ca98c5e4d184f178e261 | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/AvailabilityFilteringRule.java#L81-L92 | train | Override method to return a server from the round robin rule. | Create a Java method that does the following: "Override method to return a server from the round robin rule.". | Of course, here is the Java code you requested:
```java
@Override
public Server choose(Object key) {
int count = 0;
Server server = roundRobinRule.choose(key);
while (count++ <= 10) {
if (server != null && predicate.apply(new PredicateKey(server))) {
return serve... | |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java | ChainingIterator.containsIteratorForTable | public boolean containsIteratorForTable(String aTable)
{
boolean result = false;
if (m_rsIterators != null)
{
for (int i = 0; i < m_rsIterators.size(); i++)
{
OJBIterator it = (OJBIterator) m_rsIterators.get(i);
if (it instanc... | java | public boolean containsIteratorForTable(String aTable)
{
boolean result = false;
if (m_rsIterators != null)
{
for (int i = 0; i < m_rsIterators.size(); i++)
{
OJBIterator it = (OJBIterator) m_rsIterators.get(i);
if (it instanc... | [
"public",
"boolean",
"containsIteratorForTable",
"(",
"String",
"aTable",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"m_rsIterators",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m_rsIterators",
".",
"size",... | Answer true if an Iterator for a Table is already available
@param aTable
@return | [
"Answer",
"true",
"if",
"an",
"Iterator",
"for",
"a",
"Table",
"is",
"already",
"available"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java#L373-L398 | train | Returns true if the iterator for the table is a subset of the iterator for the table. | Create a Java method that does the following: "Returns true if the iterator for the table is a subset of the iterator for the table.". | Of course, here is the Java code you requested:
```java
public boolean containsIteratorForTable(String aTable)
{
boolean result = false;
if (m_rsIterators != null)
{
for (int i = 0; i < m_rsIterators.size(); i++)
{
OJBIterator it = (OJBIterat... | |
tvesalainen/util | util/src/main/java/org/vesalainen/util/SimpleMatcher.java | SimpleMatcher.match | @Override
public Status match(int cc)
{
if (expression[idx] == '*')
{
okStatus = Status.WillMatch;
if (cc == expression[idx+1])
{
idx++;
}
else
{
return okStatus;
}
... | java | @Override
public Status match(int cc)
{
if (expression[idx] == '*')
{
okStatus = Status.WillMatch;
if (cc == expression[idx+1])
{
idx++;
}
else
{
return okStatus;
}
... | [
"@",
"Override",
"public",
"Status",
"match",
"(",
"int",
"cc",
")",
"{",
"if",
"(",
"expression",
"[",
"idx",
"]",
"==",
"'",
"'",
")",
"{",
"okStatus",
"=",
"Status",
".",
"WillMatch",
";",
"if",
"(",
"cc",
"==",
"expression",
"[",
"idx",
"+",
... | Matches input. Returns Error if in doesn't match. Ok if all matched chars
are ok. WillMatch if all matched chars are ok and matching algorythm is
in '*' phase. Matched when whole input has matched.
<p>WillMatch is meant for cases where partial matched input needs to be
processed before all input is available.
@param cc... | [
"Matches",
"input",
".",
"Returns",
"Error",
"if",
"in",
"doesn",
"t",
"match",
".",
"Ok",
"if",
"all",
"matched",
"chars",
"are",
"ok",
".",
"WillMatch",
"if",
"all",
"matched",
"chars",
"are",
"ok",
"and",
"matching",
"algorythm",
"is",
"in",
"*",
"p... | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/SimpleMatcher.java#L92-L127 | train | Override the method to check if the
condition is met. | Create a Java method that does the following: "Override the method to check if the
condition is met.". | Of course, here is the Java code you requested:
```java
@Override
public Status match(int cc)
{
if (expression[idx] == '*')
{
okStatus = Status.WillMatch;
if (cc == expression[idx+1])
{
idx++;
}
else
... | |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java | IdentityFactoryImpl.createException | private PersistenceBrokerException createException(final Exception ex, String message, final Object objectToIdentify, Class topLevelClass, Class realClass, Object[] pks)
{
final String eol = SystemUtils.LINE_SEPARATOR;
StringBuffer msg = new StringBuffer();
if(message == null)
{... | java | private PersistenceBrokerException createException(final Exception ex, String message, final Object objectToIdentify, Class topLevelClass, Class realClass, Object[] pks)
{
final String eol = SystemUtils.LINE_SEPARATOR;
StringBuffer msg = new StringBuffer();
if(message == null)
{... | [
"private",
"PersistenceBrokerException",
"createException",
"(",
"final",
"Exception",
"ex",
",",
"String",
"message",
",",
"final",
"Object",
"objectToIdentify",
",",
"Class",
"topLevelClass",
",",
"Class",
"realClass",
",",
"Object",
"[",
"]",
"pks",
")",
"{",
... | Helper method which supports creation of proper error messages.
@param ex An exception to include or <em>null</em>.
@param message The error message or <em>null</em>.
@param objectToIdentify The current used object or <em>null</em>.
@param topLevelClass The object top-level class or <em>null</em>.
@param realClass The... | [
"Helper",
"method",
"which",
"supports",
"creation",
"of",
"proper",
"error",
"messages",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java#L263-L296 | train | Creates an exception object from the given information. | Create a Java method that does the following: "Creates an exception object from the given information.". | Of course, here is the Java code you requested:
```java
private PersistenceBrokerException createException(final Exception ex, String message, final Object objectToIdentify, Class topLevelClass, Class realClass, Object[] pks)
{
final String eol = SystemUtils.LINE_SEPARATOR;
StringBuffer msg = ne... | |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.findByCommerceOrderItemId | @Override
public CommerceVirtualOrderItem findByCommerceOrderItemId(
long commerceOrderItemId) throws NoSuchVirtualOrderItemException {
CommerceVirtualOrderItem commerceVirtualOrderItem = fetchByCommerceOrderItemId(commerceOrderItemId);
if (commerceVirtualOrderItem == null) {
StringBundler msg = new StringBu... | java | @Override
public CommerceVirtualOrderItem findByCommerceOrderItemId(
long commerceOrderItemId) throws NoSuchVirtualOrderItemException {
CommerceVirtualOrderItem commerceVirtualOrderItem = fetchByCommerceOrderItemId(commerceOrderItemId);
if (commerceVirtualOrderItem == null) {
StringBundler msg = new StringBu... | [
"@",
"Override",
"public",
"CommerceVirtualOrderItem",
"findByCommerceOrderItemId",
"(",
"long",
"commerceOrderItemId",
")",
"throws",
"NoSuchVirtualOrderItemException",
"{",
"CommerceVirtualOrderItem",
"commerceVirtualOrderItem",
"=",
"fetchByCommerceOrderItemId",
"(",
"commerceOr... | Returns the commerce virtual order item where commerceOrderItemId = ? or throws a {@link NoSuchVirtualOrderItemException} if it could not be found.
@param commerceOrderItemId the commerce order item ID
@return the matching commerce virtual order item
@throws NoSuchVirtualOrderItemException if a matching commerce v... | [
"Returns",
"the",
"commerce",
"virtual",
"order",
"item",
"where",
"commerceOrderItemId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchVirtualOrderItemException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L1518-L1541 | train | Returns the commerce virtual order item with the primary key. | Create a Java method that does the following: "Returns the commerce virtual order item with the primary key.". | Of course, here is the Java code you requested:
```java
@Override
public CommerceVirtualOrderItem findByCommerceOrderItemId(
long commerceOrderItemId) throws NoSuchVirtualOrderItemException {
CommerceVirtualOrderItem commerceVirtualOrderItem = fetchByCommerceOrderItemId(commerceOrderItemId);
if (commerceVirtua... | |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/action/EditableCellFocusAction.java | EditableCellFocusAction.actionPerformed | @Override
public void actionPerformed(ActionEvent e) {
invokeOriginalAction(e);
int row = table.getSelectedRow();
int column = table.getSelectedColumn();
if (table.isCellEditable(row, column)) {
table.editCellAt(row, column, e);
}
} | java | @Override
public void actionPerformed(ActionEvent e) {
invokeOriginalAction(e);
int row = table.getSelectedRow();
int column = table.getSelectedColumn();
if (table.isCellEditable(row, column)) {
table.editCellAt(row, column, e);
}
} | [
"@",
"Override",
"public",
"void",
"actionPerformed",
"(",
"ActionEvent",
"e",
")",
"{",
"invokeOriginalAction",
"(",
"e",
")",
";",
"int",
"row",
"=",
"table",
".",
"getSelectedRow",
"(",
")",
";",
"int",
"column",
"=",
"table",
".",
"getSelectedColumn",
... | /*
Provide the custom behaviour of the Action | [
"/",
"*",
"Provide",
"the",
"custom",
"behaviour",
"of",
"the",
"Action"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/action/EditableCellFocusAction.java#L42-L52 | train | Override actionPerformed to edit cell at or below. | Create a Java method that does the following: "Override actionPerformed to edit cell at or below.". | Of course, here is the Java code you requested:
```java
@Override
public void actionPerformed(ActionEvent e) {
invokeOriginalAction(e);
int row = table.getSelectedRow();
int column = table.getSelectedColumn();
if (table.isCellEditable(row, column)) {
table.editCellAt(row, column, e);
}
}
```
Hope... | |
dmurph/jgoogleanalyticstracker | src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java | JGoogleAnalyticsTracker.trackPageViewFromReferrer | public void trackPageViewFromReferrer(String argPageURL, String argPageTitle, String argHostName, String argReferrerSite, String argReferrerPage) {
if (argPageURL == null) {
throw new IllegalArgumentException("Page URL cannot be null, Google will not track the data.");
}
AnalyticsReq... | java | public void trackPageViewFromReferrer(String argPageURL, String argPageTitle, String argHostName, String argReferrerSite, String argReferrerPage) {
if (argPageURL == null) {
throw new IllegalArgumentException("Page URL cannot be null, Google will not track the data.");
}
AnalyticsReq... | [
"public",
"void",
"trackPageViewFromReferrer",
"(",
"String",
"argPageURL",
",",
"String",
"argPageTitle",
",",
"String",
"argHostName",
",",
"String",
"argReferrerSite",
",",
"String",
"argReferrerPage",
")",
"{",
"if",
"(",
"argPageURL",
"==",
"null",
")",
"{",
... | Tracks a page view.
@param argPageURL
required, Google won't track without it. Ex:
<code>"org/me/javaclass.java"</code>, or anything you want as
the page url.
@param argPageTitle
content title
@param argHostName
the host name for the url
@param argReferrerSite
site of the referrer. ex, www.dmurph.com
@param argReferre... | [
"Tracks",
"a",
"page",
"view",
"."
] | 69f68caf8e09a53e6f6076477bf05b84bc80e386 | https://github.com/dmurph/jgoogleanalyticstracker/blob/69f68caf8e09a53e6f6076477bf05b84bc80e386/src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java#L316-L326 | train | Track a page view from a referrer. | Create a Java method that does the following: "Track a page view from a referrer.". | Of course, here is the Java code you requested:
```java
public void trackPageViewFromReferrer(String argPageURL, String argPageTitle, String argHostName, String argReferrerSite, String argReferrerPage) {
if (argPageURL == null) {
throw new IllegalArgumentException("Page URL cannot be null, Google w... | |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_mitigationProfiles_ipMitigationProfile_DELETE | public void ip_mitigationProfiles_ipMitigationProfile_DELETE(String ip, String ipMitigationProfile) throws IOException {
String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}";
StringBuilder sb = path(qPath, ip, ipMitigationProfile);
exec(qPath, "DELETE", sb.toString(), null);
} | java | public void ip_mitigationProfiles_ipMitigationProfile_DELETE(String ip, String ipMitigationProfile) throws IOException {
String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}";
StringBuilder sb = path(qPath, ip, ipMitigationProfile);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"ip_mitigationProfiles_ipMitigationProfile_DELETE",
"(",
"String",
"ip",
",",
"String",
"ipMitigationProfile",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/mitigationProfiles/{ipMitigationProfile}\"",
";",
"StringBuilder",
"sb",
"="... | Delete mitigation profile
REST: DELETE /ip/{ip}/mitigationProfiles/{ipMitigationProfile}
@param ip [required]
@param ipMitigationProfile [required] | [
"Delete",
"mitigation",
"profile"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L928-L932 | train | Delete a specific IPmitigation profile | Create a Java method that does the following: "Delete a specific IPmitigation profile". | Of course, here is the Java code you requested:
```java
public void ip_mitigationProfiles_ipMitigationProfile_DELETE(String ip, String ipMitigationProfile) throws IOException {
String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}";
StringBuilder sb = path(qPath, ip, ipMitigationProfile);
exec(qPath,... | |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java | JavaParser.synpred174_Java_fragment | public final void synpred174_Java_fragment() throws RecognitionException {
Token id=null;
Token z=null;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:820:9: ( ( ( variableModifier )* type id= Identifier z= ':' expression ) )
// src/main/resources/org/drools/compiler/semantics/java/pars... | java | public final void synpred174_Java_fragment() throws RecognitionException {
Token id=null;
Token z=null;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:820:9: ( ( ( variableModifier )* type id= Identifier z= ':' expression ) )
// src/main/resources/org/drools/compiler/semantics/java/pars... | [
"public",
"final",
"void",
"synpred174_Java_fragment",
"(",
")",
"throws",
"RecognitionException",
"{",
"Token",
"id",
"=",
"null",
";",
"Token",
"z",
"=",
"null",
";",
"// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:820:9: ( ( ( variableModifier )* type... | $ANTLR start synpred174_Java | [
"$ANTLR",
"start",
"synpred174_Java"
] | 22b0275d6dbe93070b8090948502cf46eda543c4 | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java#L13074-L13123 | train | synpred174_Java_fragment returns true if synpred174_Java was called. | Create a Java method that does the following: "synpred174_Java_fragment returns true if synpred174_Java was called.". | Of course, here is the Java code you requested:
```java
public final void synpred174_Java_fragment() throws RecognitionException {
Token id=null;
Token z=null;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:820:9: ( ( ( variableModifier )* type id= Identifier z= ':' expression ) )
// s... | |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/binary/codes/Gaussian.java | Gaussian.decode | public long decode(final BitInputStream in, final long max)
throws IOException {
if (0 == max) {
return 0;
}
int bits = (int) (Math.round(log2(2 * this.stdDev)) - 1);
if (0 > bits) {
bits = 0;
}
final long centralWindow = 1l << bits;
if (centralWindow >= (max + 1) / 2.) {
... | java | public long decode(final BitInputStream in, final long max)
throws IOException {
if (0 == max) {
return 0;
}
int bits = (int) (Math.round(log2(2 * this.stdDev)) - 1);
if (0 > bits) {
bits = 0;
}
final long centralWindow = 1l << bits;
if (centralWindow >= (max + 1) / 2.) {
... | [
"public",
"long",
"decode",
"(",
"final",
"BitInputStream",
"in",
",",
"final",
"long",
"max",
")",
"throws",
"IOException",
"{",
"if",
"(",
"0",
"==",
"max",
")",
"{",
"return",
"0",
";",
"}",
"int",
"bits",
"=",
"(",
"int",
")",
"(",
"Math",
".",... | Decode long.
@param in the in
@param max the max
@return the long
@throws IOException the io exception | [
"Decode",
"long",
"."
] | b5a5e73449aae57de7dbfca2ed7a074432c5b17e | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/binary/codes/Gaussian.java#L119-L166 | train | Decode a single long from the BitInputStream. | Create a Java method that does the following: "Decode a single long from the BitInputStream.". | Of course, here is the Java code you requested:
```java
public long decode(final BitInputStream in, final long max)
throws IOException {
if (0 == max) {
return 0;
}
int bits = (int) (Math.round(log2(2 * this.stdDev)) - 1);
if (0 > bits) {
bits = 0;
}
final long centralWindow = 1... | |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/AmazonPinpointClient.java | AmazonPinpointClient.deleteCampaign | @Override
public DeleteCampaignResult deleteCampaign(DeleteCampaignRequest request) {
request = beforeClientExecution(request);
return executeDeleteCampaign(request);
} | java | @Override
public DeleteCampaignResult deleteCampaign(DeleteCampaignRequest request) {
request = beforeClientExecution(request);
return executeDeleteCampaign(request);
} | [
"@",
"Override",
"public",
"DeleteCampaignResult",
"deleteCampaign",
"(",
"DeleteCampaignRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteCampaign",
"(",
"request",
")",
";",
"}"
] | Deletes a campaign.
@param deleteCampaignRequest
@return Result of the DeleteCampaign operation returned by the service.
@throws BadRequestException
400 response
@throws InternalServerErrorException
500 response
@throws ForbiddenException
403 response
@throws NotFoundException
404 response
@throws MethodNotAllowedExce... | [
"Deletes",
"a",
"campaign",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/AmazonPinpointClient.java#L1067-L1071 | train | Deletes an existing CDN coding language. | Create a Java method that does the following: "Deletes an existing CDN coding language.". | Of course, here is the Java code you requested:
```java
@Override
public DeleteCampaignResult deleteCampaign(DeleteCampaignRequest request) {
request = beforeClientExecution(request);
return executeDeleteCampaign(request);
}
```
Hope this helps! | |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.op | public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) {
Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec());
if (rop.getBranchingness() == BRANCH_NONE) {
addInstruction(ne... | java | public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) {
Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec());
if (rop.getBranchingness() == BRANCH_NONE) {
addInstruction(ne... | [
"public",
"<",
"T1",
",",
"T2",
">",
"void",
"op",
"(",
"BinaryOp",
"op",
",",
"Local",
"<",
"T1",
">",
"target",
",",
"Local",
"<",
"T1",
">",
"a",
",",
"Local",
"<",
"T2",
">",
"b",
")",
"{",
"Rop",
"rop",
"=",
"op",
".",
"rop",
"(",
"Std... | Executes {@code op} and sets {@code target} to the result. For most
binary operations, the types of {@code a} and {@code b} must be the same.
Shift operations (like {@link BinaryOp#SHIFT_LEFT}) require {@code b} to
be an {@code int}, even when {@code a} is a {@code long}. | [
"Executes",
"{"
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L516-L526 | train | Generate a binary operation instruction. | Create a Java method that does the following: "Generate a binary operation instruction.". | Of course, here is the Java code you requested:
```java
public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) {
Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec());
if (rop.getBranch... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java | InternalTransaction.requestCallback | protected synchronized void requestCallback(Token token,
Transaction transaction)
throws ObjectManagerException
{
final String methodName = "requestCallback";
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
... | java | protected synchronized void requestCallback(Token token,
Transaction transaction)
throws ObjectManagerException
{
final String methodName = "requestCallback";
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
... | [
"protected",
"synchronized",
"void",
"requestCallback",
"(",
"Token",
"token",
",",
"Transaction",
"transaction",
")",
"throws",
"ObjectManagerException",
"{",
"final",
"String",
"methodName",
"=",
"\"requestCallback\"",
";",
"if",
"(",
"Tracing",
".",
"isAnyTracingEn... | Note a request for the Token in the transaction to be called at prePrepare,
preCommit, preBackout, postCommit and postBackout.
@param token who's ManagedObject is to be called back.
@param transaction the external transaction.
@throws ObjectManagerException
@throws InvalidStateException if the tansaction has started i... | [
"Note",
"a",
"request",
"for",
"the",
"Token",
"in",
"the",
"transaction",
"to",
"be",
"called",
"at",
"prePrepare",
"preCommit",
"preBackout",
"postCommit",
"and",
"postBackout",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L615-L654 | train | This method is called by the ObjectManager when a request is received from a callback. | Create a Java method that does the following: "This method is called by the ObjectManager when a request is received from a callback.". | Of course, here is the Java code you requested:
```java
protected synchronized void requestCallback(Token token,
Transaction transaction)
throws ObjectManagerException
{
final String methodName = "requestCallback";
if (Tracing.isAn... | |
OpenTSDB/opentsdb | src/utils/Config.java | Config.loadConfig | protected void loadConfig(final String file) throws FileNotFoundException,
IOException {
final FileInputStream file_stream = new FileInputStream(file);
try {
final Properties props = new Properties();
props.load(file_stream);
// load the hash map
loadHashMap(props);
// no e... | java | protected void loadConfig(final String file) throws FileNotFoundException,
IOException {
final FileInputStream file_stream = new FileInputStream(file);
try {
final Properties props = new Properties();
props.load(file_stream);
// load the hash map
loadHashMap(props);
// no e... | [
"protected",
"void",
"loadConfig",
"(",
"final",
"String",
"file",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"final",
"FileInputStream",
"file_stream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"try",
"{",
"final",
"Properties",
... | Attempts to load the configuration from the given location
@param file Path to the file to load
@throws IOException Thrown if there was an issue reading the file
@throws FileNotFoundException Thrown if the config file was not found | [
"Attempts",
"to",
"load",
"the",
"configuration",
"from",
"the",
"given",
"location"
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/Config.java#L695-L711 | train | Load the configuration file. | Create a Java method that does the following: "Load the configuration file.". | Of course, here is the Java code you requested:
```java
protected void loadConfig(final String file) throws FileNotFoundException,
IOException {
final FileInputStream file_stream = new FileInputStream(file);
try {
final Properties props = new Properties();
props.load(file_stream);
// l... | |
pmwmedia/tinylog | log4j1.2-api/src/main/java/org/apache/log4j/Logger.java | Logger.getLogger | public static Logger getLogger(final String name, final LoggerFactory factory) {
return LogManager.getLogger(name, factory);
} | java | public static Logger getLogger(final String name, final LoggerFactory factory) {
return LogManager.getLogger(name, factory);
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"final",
"String",
"name",
",",
"final",
"LoggerFactory",
"factory",
")",
"{",
"return",
"LogManager",
".",
"getLogger",
"(",
"name",
",",
"factory",
")",
";",
"}"
] | Like {@link #getLogger(String)} except that the type of logger instantiated depends on the type returned by the
{@link LoggerFactory#makeNewLoggerInstance} method of the {@code factory} parameter.
<p>
This method is intended to be used by sub-classes.
</p>
@param name
The name of the logger to retrieve.
@param facto... | [
"Like",
"{",
"@link",
"#getLogger",
"(",
"String",
")",
"}",
"except",
"that",
"the",
"type",
"of",
"logger",
"instantiated",
"depends",
"on",
"the",
"type",
"returned",
"by",
"the",
"{",
"@link",
"LoggerFactory#makeNewLoggerInstance",
"}",
"method",
"of",
"th... | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/log4j1.2-api/src/main/java/org/apache/log4j/Logger.java#L114-L116 | train | Get a Logger with the specified name and LoggerFactory. | Create a Java method that does the following: "Get a Logger with the specified name and LoggerFactory.". | Of course, here is the Java code you requested:
```java
public static Logger getLogger(final String name, final LoggerFactory factory) {
return LogManager.getLogger(name, factory);
}
```
Hope this helps! | |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/filters/ChemicalFilters.java | ChemicalFilters.convertBondOrder | public static int convertBondOrder(IBond bond) {
int value = 0;
switch (bond.getOrder()) {
case QUADRUPLE:
value = 4;
break;
case TRIPLE:
value = 3;
break;
case DOUBLE:
value = 2;
... | java | public static int convertBondOrder(IBond bond) {
int value = 0;
switch (bond.getOrder()) {
case QUADRUPLE:
value = 4;
break;
case TRIPLE:
value = 3;
break;
case DOUBLE:
value = 2;
... | [
"public",
"static",
"int",
"convertBondOrder",
"(",
"IBond",
"bond",
")",
"{",
"int",
"value",
"=",
"0",
";",
"switch",
"(",
"bond",
".",
"getOrder",
"(",
")",
")",
"{",
"case",
"QUADRUPLE",
":",
"value",
"=",
"4",
";",
"break",
";",
"case",
"TRIPLE"... | Get bond order value as {@code int} value.
@param bond The {@link IBond} for which the order is returned.
@return 1 for a single bond, 2 for a double bond, 3 for a triple bond, 4 for a quadruple bond,
and 0 for any other bond type. | [
"Get",
"bond",
"order",
"value",
"as",
"{",
"@code",
"int",
"}",
"value",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/filters/ChemicalFilters.java#L848-L867 | train | Convert the bond order to the CRTC int. | Create a Java method that does the following: "Convert the bond order to the CRTC int.". | Of course, here is the Java code you requested:
```java
public static int convertBondOrder(IBond bond) {
int value = 0;
switch (bond.getOrder()) {
case QUADRUPLE:
value = 4;
break;
case TRIPLE:
value = 3;
break;
... | |
operasoftware/operaprestodriver | src/com/opera/core/systems/scope/ScopeServices.java | ScopeServices.connect | private void connect() {
ClientInfo.Builder info = ClientInfo.newBuilder().setFormat("protobuf");
executeMessage(ScopeMessage.CONNECT, info);
} | java | private void connect() {
ClientInfo.Builder info = ClientInfo.newBuilder().setFormat("protobuf");
executeMessage(ScopeMessage.CONNECT, info);
} | [
"private",
"void",
"connect",
"(",
")",
"{",
"ClientInfo",
".",
"Builder",
"info",
"=",
"ClientInfo",
".",
"newBuilder",
"(",
")",
".",
"setFormat",
"(",
"\"protobuf\"",
")",
";",
"executeMessage",
"(",
"ScopeMessage",
".",
"CONNECT",
",",
"info",
")",
";"... | Connects and resets any settings and services that the client used earlier. | [
"Connects",
"and",
"resets",
"any",
"settings",
"and",
"services",
"that",
"the",
"client",
"used",
"earlier",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/ScopeServices.java#L236-L239 | train | Connect to the server. | Create a Java method that does the following: "Connect to the server.". | Of course, here is the Java code you requested:
```java
private void connect() {
ClientInfo.Builder info = ClientInfo.newBuilder().setFormat("protobuf");
executeMessage(ScopeMessage.CONNECT, info);
}
```
Hope this helps! | |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/JettyTlsUtil.java | JettyTlsUtil.isJettyAlpnConfigured | static synchronized boolean isJettyAlpnConfigured() {
try {
Class.forName("org.eclipse.jetty.alpn.ALPN", true, null);
return true;
} catch (ClassNotFoundException e) {
jettyAlpnUnavailabilityCause = e;
return false;
}
} | java | static synchronized boolean isJettyAlpnConfigured() {
try {
Class.forName("org.eclipse.jetty.alpn.ALPN", true, null);
return true;
} catch (ClassNotFoundException e) {
jettyAlpnUnavailabilityCause = e;
return false;
}
} | [
"static",
"synchronized",
"boolean",
"isJettyAlpnConfigured",
"(",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"\"org.eclipse.jetty.alpn.ALPN\"",
",",
"true",
",",
"null",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",... | Indicates whether or not the Jetty ALPN jar is installed in the boot classloader. | [
"Indicates",
"whether",
"or",
"not",
"the",
"Jetty",
"ALPN",
"jar",
"is",
"installed",
"in",
"the",
"boot",
"classloader",
"."
] | 973885457f9609de232d2553b82c67f6c3ff57bf | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/JettyTlsUtil.java#L62-L70 | train | Check if Jetty ALPN is configured. | Create a Java method that does the following: "Check if Jetty ALPN is configured.". | Of course, here is the Java code you requested:
```java
static synchronized boolean isJettyAlpnConfigured() {
try {
Class.forName("org.eclipse.jetty.alpn.ALPN", true, null);
return true;
} catch (ClassNotFoundException e) {
jettyAlpnUnavailabilityCause = e;
return false;
}
}
```
... | |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/attr/DBaseFileAttributePool.java | DBaseFileAttributePool.getAllAttributeNames | @SuppressWarnings("resource")
@Pure
public Collection<String> getAllAttributeNames(int recordNumber) {
try {
final DBaseFileReader dbReader = getReader();
synchronized (dbReader) {
final List<DBaseFileField> fields = dbReader.getDBFFields();
if (fields == null) {
return Collections.emptyList();
... | java | @SuppressWarnings("resource")
@Pure
public Collection<String> getAllAttributeNames(int recordNumber) {
try {
final DBaseFileReader dbReader = getReader();
synchronized (dbReader) {
final List<DBaseFileField> fields = dbReader.getDBFFields();
if (fields == null) {
return Collections.emptyList();
... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"@",
"Pure",
"public",
"Collection",
"<",
"String",
">",
"getAllAttributeNames",
"(",
"int",
"recordNumber",
")",
"{",
"try",
"{",
"final",
"DBaseFileReader",
"dbReader",
"=",
"getReader",
"(",
")",
";",
"sync... | Replies the names of all the attributes that corresponds to the specified
record number.
<p>The parameter is not used because, in a dBase file, all the record
have the same attribute names.
@param recordNumber the number of the record.
@return the collection of attribute names | [
"Replies",
"the",
"names",
"of",
"all",
"the",
"attributes",
"that",
"corresponds",
"to",
"the",
"specified",
"record",
"number",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/attr/DBaseFileAttributePool.java#L368-L387 | train | Returns a collection of all attribute names for the specified record number. | Create a Java method that does the following: "Returns a collection of all attribute names for the specified record number.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("resource")
@Pure
public Collection<String> getAllAttributeNames(int recordNumber) {
try {
final DBaseFileReader dbReader = getReader();
synchronized (dbReader) {
final List<DBaseFileField> fields = dbReader.getDBFFields();
if ... | |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/buff/str/StrBuffer.java | StrBuffer.getNextField | public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls
{
String string = this.getNextString();
if (string == null)
return Constants.ERROR_RETURN;
if (string == DATA_SKIP)
return Constants.NORMAL_RETURN; //... | java | public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls
{
String string = this.getNextString();
if (string == null)
return Constants.ERROR_RETURN;
if (string == DATA_SKIP)
return Constants.NORMAL_RETURN; //... | [
"public",
"int",
"getNextField",
"(",
"FieldInfo",
"field",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"// Must be to call right Get calls",
"{",
"String",
"string",
"=",
"this",
".",
"getNextString",
"(",
")",
";",
"if",
"(",
"string",
"=="... | Get the next field and fill it with data from this buffer.
You must override this method.
@param field The field to set.
@param bDisplayOption The display option for setting the field.
@param iMoveMove The move mode for setting the field.
@return The error code. | [
"Get",
"the",
"next",
"field",
"and",
"fill",
"it",
"with",
"data",
"from",
"this",
"buffer",
".",
"You",
"must",
"override",
"this",
"method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/buff/str/StrBuffer.java#L145-L153 | train | Get the next field from the record. | Create a Java method that does the following: "Get the next field from the record.". | Of course, here is the Java code you requested:
```java
public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls
{
String string = this.getNextString();
if (string == null)
return Constants.ERROR_RETURN;
if (string == D... | |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java | JcrSession.save | void save( AbstractJcrNode node ) throws RepositoryException {
// first check the node is valid from a cache perspective
Set<NodeKey> keysToBeSaved = null;
try {
if (node.isNew()) {
// expected by TCK
throw new RepositoryException(JcrI18n.unableToSaveN... | java | void save( AbstractJcrNode node ) throws RepositoryException {
// first check the node is valid from a cache perspective
Set<NodeKey> keysToBeSaved = null;
try {
if (node.isNew()) {
// expected by TCK
throw new RepositoryException(JcrI18n.unableToSaveN... | [
"void",
"save",
"(",
"AbstractJcrNode",
"node",
")",
"throws",
"RepositoryException",
"{",
"// first check the node is valid from a cache perspective",
"Set",
"<",
"NodeKey",
">",
"keysToBeSaved",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"node",
".",
"isNew",
"(",
... | Save a subset of the changes made within this session.
@param node the node at or below which the changes are to be saved; may not be null
@throws RepositoryException if there is a problem saving the changes
@see AbstractJcrNode#save() | [
"Save",
"a",
"subset",
"of",
"the",
"changes",
"made",
"within",
"this",
"session",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java#L1231-L1293 | train | Save the node. | Create a Java method that does the following: "Save the node.". | Of course, here is the Java code you requested:
```java
void save( AbstractJcrNode node ) throws RepositoryException {
// first check the node is valid from a cache perspective
Set<NodeKey> keysToBeSaved = null;
try {
if (node.isNew()) {
// expected by TCK
... | |
aws/aws-sdk-java | aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/ModifySnapshotScheduleResult.java | ModifySnapshotScheduleResult.withNextInvocations | public ModifySnapshotScheduleResult withNextInvocations(java.util.Collection<java.util.Date> nextInvocations) {
setNextInvocations(nextInvocations);
return this;
} | java | public ModifySnapshotScheduleResult withNextInvocations(java.util.Collection<java.util.Date> nextInvocations) {
setNextInvocations(nextInvocations);
return this;
} | [
"public",
"ModifySnapshotScheduleResult",
"withNextInvocations",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Date",
">",
"nextInvocations",
")",
"{",
"setNextInvocations",
"(",
"nextInvocations",
")",
";",
"return",
"this",
";",
... | <p/>
@param nextInvocations
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
"/",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/ModifySnapshotScheduleResult.java#L352-L355 | train | Sets the next invocations for this snapshot schedule. | Create a Java method that does the following: "Sets the next invocations for this snapshot schedule.". | Of course, here is the Java code you requested:
```java
public ModifySnapshotScheduleResult withNextInvocations(java.util.Collection<java.util.Date> nextInvocations) {
setNextInvocations(nextInvocations);
return this;
}
```
Hope this helps! | |
zeromq/jeromq | src/main/java/zmq/util/Z85.java | Z85.decode | public static byte[] decode(String string)
{
if (string.length() % 5 != 0) {
return null;
}
ByteBuffer buf = ByteBuffer.allocate(string.length() * 4 / 5);
int byteNbr = 0;
int charNbr = 0;
int stringLen = string.length();
long value = 0;
w... | java | public static byte[] decode(String string)
{
if (string.length() % 5 != 0) {
return null;
}
ByteBuffer buf = ByteBuffer.allocate(string.length() * 4 / 5);
int byteNbr = 0;
int charNbr = 0;
int stringLen = string.length();
long value = 0;
w... | [
"public",
"static",
"byte",
"[",
"]",
"decode",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
".",
"length",
"(",
")",
"%",
"5",
"!=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"allocate",
"("... | Returns NULL and sets errno = EINVAL for invalid input. | [
"Returns",
"NULL",
"and",
"sets",
"errno",
"=",
"EINVAL",
"for",
"invalid",
"input",
"."
] | 8b4a2960b468d08b7aebb0d40bfb947e08fed040 | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/util/Z85.java#L64-L90 | train | Decodes a string into a byte array. | Create a Java method that does the following: "Decodes a string into a byte array.". | Of course, here is the Java code you requested:
```java
public static byte[] decode(String string)
{
if (string.length() % 5 != 0) {
return null;
}
ByteBuffer buf = ByteBuffer.allocate(string.length() * 4 / 5);
int byteNbr = 0;
int charNbr = 0;
int strin... | |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/bind/BindUploader.java | BindUploader.newInstance | public synchronized static BindUploader newInstance(SFSession session, String stageDir)
throws BindException
{
try
{
Path bindDir = Files.createTempDirectory(PREFIX);
return new BindUploader(session, stageDir, bindDir);
}
catch (IOException ex)
{
throw new BindException(
... | java | public synchronized static BindUploader newInstance(SFSession session, String stageDir)
throws BindException
{
try
{
Path bindDir = Files.createTempDirectory(PREFIX);
return new BindUploader(session, stageDir, bindDir);
}
catch (IOException ex)
{
throw new BindException(
... | [
"public",
"synchronized",
"static",
"BindUploader",
"newInstance",
"(",
"SFSession",
"session",
",",
"String",
"stageDir",
")",
"throws",
"BindException",
"{",
"try",
"{",
"Path",
"bindDir",
"=",
"Files",
".",
"createTempDirectory",
"(",
"PREFIX",
")",
";",
"ret... | Create a new BindUploader which will upload to the given stage path
Ensure temporary directory for file writing exists
@param session the session to use for uploading binds
@param stageDir the stage path to upload to
@return BindUploader instance
@throws BindException if temporary directory could not be created | [
"Create",
"a",
"new",
"BindUploader",
"which",
"will",
"upload",
"to",
"the",
"given",
"stage",
"path",
"Ensure",
"temporary",
"directory",
"for",
"file",
"writing",
"exists"
] | 98567b5a57753f29d51446809640b969a099658f | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/bind/BindUploader.java#L174-L187 | train | Create a new instance of the BindUploader class. | Create a Java method that does the following: "Create a new instance of the BindUploader class.". | Of course, here is the Java code you requested:
```java
public synchronized static BindUploader newInstance(SFSession session, String stageDir)
throws BindException
{
try
{
Path bindDir = Files.createTempDirectory(PREFIX);
return new BindUploader(session, stageDir, bindDir);
}
catch (IO... | |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java | MithraManager.executeTransactionalCommandInSeparateThread | public Object executeTransactionalCommandInSeparateThread(final TransactionalCommand command, final int retries)
throws MithraBusinessException
{
return executeTransactionalCommandInSeparateThread(command, new TransactionStyle(this.transactionTimeout, retries));
} | java | public Object executeTransactionalCommandInSeparateThread(final TransactionalCommand command, final int retries)
throws MithraBusinessException
{
return executeTransactionalCommandInSeparateThread(command, new TransactionStyle(this.transactionTimeout, retries));
} | [
"public",
"Object",
"executeTransactionalCommandInSeparateThread",
"(",
"final",
"TransactionalCommand",
"command",
",",
"final",
"int",
"retries",
")",
"throws",
"MithraBusinessException",
"{",
"return",
"executeTransactionalCommandInSeparateThread",
"(",
"command",
",",
"ne... | Use this method very carefully. It can easily lead to a deadlock.
executes the transactional command in a separate thread with a custom number of retries. Using a separate thread
creates a brand new transactional context and therefore this transaction will not join
the context of any outer transactions. For example, if... | [
"Use",
"this",
"method",
"very",
"carefully",
".",
"It",
"can",
"easily",
"lead",
"to",
"a",
"deadlock",
".",
"executes",
"the",
"transactional",
"command",
"in",
"a",
"separate",
"thread",
"with",
"a",
"custom",
"number",
"of",
"retries",
".",
"Using",
"a... | e9a069452eece7a6ef9551caf81a69d3d9a3d990 | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L470-L474 | train | Executes a TransactionalCommand in a separate thread. | Create a Java method that does the following: "Executes a TransactionalCommand in a separate thread.". | Of course, here is the Java code you requested:
```java
public Object executeTransactionalCommandInSeparateThread(final TransactionalCommand command, final int retries)
throws MithraBusinessException
{
return executeTransactionalCommandInSeparateThread(command, new TransactionStyle(this.tran... | |
skuzzle/jeve | jeve/src/it/java/de/skuzzle/jeve/SynchronousEventProviderIT.java | SynchronousEventProviderIT.getParameters | @Parameters
public static final Collection<Object[]> getParameters() {
return Arrays.asList(
new Object[] {
(Function<ListenerStore, ? extends EventProvider>) SequentialEventProvider::new,
(Supplier<ListenerStore>) DefaultListenerStore::create
... | java | @Parameters
public static final Collection<Object[]> getParameters() {
return Arrays.asList(
new Object[] {
(Function<ListenerStore, ? extends EventProvider>) SequentialEventProvider::new,
(Supplier<ListenerStore>) DefaultListenerStore::create
... | [
"@",
"Parameters",
"public",
"static",
"final",
"Collection",
"<",
"Object",
"[",
"]",
">",
"getParameters",
"(",
")",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"new",
"Object",
"[",
"]",
"{",
"(",
"Function",
"<",
"ListenerStore",
",",
"?",
"extends"... | Parameterizes the test instances.
@return Collection of parameters for the constructor of
{@link EventProviderTestBase}. | [
"Parameterizes",
"the",
"test",
"instances",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/it/java/de/skuzzle/jeve/SynchronousEventProviderIT.java#L29-L41 | train | Returns the parameters of the sequence of event providers. | Create a Java method that does the following: "Returns the parameters of the sequence of event providers.". | Of course, here is the Java code you requested:
```java
@Parameters
public static final Collection<Object[]> getParameters() {
return Arrays.asList(
new Object[] {
(Function<ListenerStore, ? extends EventProvider>) SequentialEventProvider::new,
... | |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java | Scheduler.delete | public synchronized boolean delete(final Job job) {
// if already shutdown in the process of shutdown, there is no
// need to remove Jobs as they will never be executed.
if (shutdown) {
return false;
}
int i = findIndex(job);
if (i != -1) {
Schedul... | java | public synchronized boolean delete(final Job job) {
// if already shutdown in the process of shutdown, there is no
// need to remove Jobs as they will never be executed.
if (shutdown) {
return false;
}
int i = findIndex(job);
if (i != -1) {
Schedul... | [
"public",
"synchronized",
"boolean",
"delete",
"(",
"final",
"Job",
"job",
")",
"{",
"// if already shutdown in the process of shutdown, there is no",
"// need to remove Jobs as they will never be executed.",
"if",
"(",
"shutdown",
")",
"{",
"return",
"false",
";",
"}",
"in... | Delete the given job.
@param job job.
@return true if the job could be deleted, and
false if the job could not be found or if the Scheduler is about to
shutdown in which case deletions are not permitted. | [
"Delete",
"the",
"given",
"job",
"."
] | 493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L83-L104 | train | Delete a Job from the scheduler. | Create a Java method that does the following: "Delete a Job from the scheduler.". | Of course, here is the Java code you requested:
```java
public synchronized boolean delete(final Job job) {
// if already shutdown in the process of shutdown, there is no
// need to remove Jobs as they will never be executed.
if (shutdown) {
return false;
}
int i = f... | |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.numOfSelectOptions | public int numOfSelectOptions() {
if (isNotPresentSelect()) {
return -1;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
List<WebElement> options = dropdown.getOptions();
return options.size();
} | java | public int numOfSelectOptions() {
if (isNotPresentSelect()) {
return -1;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
List<WebElement> options = dropdown.getOptions();
return options.size();
} | [
"public",
"int",
"numOfSelectOptions",
"(",
")",
"{",
"if",
"(",
"isNotPresentSelect",
"(",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"WebElement",
"webElement",
"=",
"element",
".",
"getWebElement",
"(",
")",
";",
"Select",
"dropdown",
"=",
"new",
"S... | Retrieves the number of select options in the element. If the element
isn't present or a select, the returned response will be negative 1.
@return Integer: how many select options are available in the select
element | [
"Retrieves",
"the",
"number",
"of",
"select",
"options",
"in",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"the",
"returned",
"response",
"will",
"be",
"negative",
"1",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L279-L287 | train | Gets the number of select options. | Create a Java method that does the following: "Gets the number of select options.". | Of course, here is the Java code you requested:
```java
public int numOfSelectOptions() {
if (isNotPresentSelect()) {
return -1;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
List<WebElement> options = dropdown.getOption... | |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getAuthor | private String getAuthor(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Author");
} | java | private String getAuthor(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Author");
} | [
"private",
"String",
"getAuthor",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"return",
"(",
"String",
")",
"context",
".",
"getAttribute",
"(",
"clazz",
"+",
"\"Author\"",
")",
";",
"}"
] | Obtains the author of the current test suite being executed. If no author
was set, null will be returned
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associ... | [
"Obtains",
"the",
"author",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"If",
"no",
"author",
"was",
"set",
"null",
"will",
"be",
"returned"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L150-L152 | train | Get the author of the test class | Create a Java method that does the following: "Get the author of the test class". | Of course, here is the Java code you requested:
```java
private String getAuthor(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Author");
}
```
Hope this helps! | |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.setDirectChildrenLoaded | public void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir) {
mState.applyAndJournal(context, UpdateInodeDirectoryEntry.newBuilder()
.setId(dir.getId())
.setDirectChildrenLoaded(true)
.build());
} | java | public void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir) {
mState.applyAndJournal(context, UpdateInodeDirectoryEntry.newBuilder()
.setId(dir.getId())
.setDirectChildrenLoaded(true)
.build());
} | [
"public",
"void",
"setDirectChildrenLoaded",
"(",
"Supplier",
"<",
"JournalContext",
">",
"context",
",",
"InodeDirectory",
"dir",
")",
"{",
"mState",
".",
"applyAndJournal",
"(",
"context",
",",
"UpdateInodeDirectoryEntry",
".",
"newBuilder",
"(",
")",
".",
"setI... | Marks an inode directory as having its direct children loaded.
@param context journal context supplier
@param dir the inode directory | [
"Marks",
"an",
"inode",
"directory",
"as",
"having",
"its",
"direct",
"children",
"loaded",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L257-L262 | train | Set the direct children loaded state of the inode directory. | Create a Java method that does the following: "Set the direct children loaded state of the inode directory.". | Of course, here is the Java code you requested:
```java
public void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir) {
mState.applyAndJournal(context, UpdateInodeDirectoryEntry.newBuilder()
.setId(dir.getId())
.setDirectChildrenLoaded(true)
.build());
}
```
H... | |
Waikato/moa | moa/src/main/java/moa/gui/experimentertab/PlotTab.java | PlotTab.cleanTables | public void cleanTables() {
try {
DefaultTableModel algModel = (DefaultTableModel) jTableAlgoritms.getModel();
DefaultTableModel strModel = (DefaultTableModel) jTableStreams.getModel();
int rows = jTableAlgoritms.getRowCount();
int srow = jTableStreams.getRowCount... | java | public void cleanTables() {
try {
DefaultTableModel algModel = (DefaultTableModel) jTableAlgoritms.getModel();
DefaultTableModel strModel = (DefaultTableModel) jTableStreams.getModel();
int rows = jTableAlgoritms.getRowCount();
int srow = jTableStreams.getRowCount... | [
"public",
"void",
"cleanTables",
"(",
")",
"{",
"try",
"{",
"DefaultTableModel",
"algModel",
"=",
"(",
"DefaultTableModel",
")",
"jTableAlgoritms",
".",
"getModel",
"(",
")",
";",
"DefaultTableModel",
"strModel",
"=",
"(",
"DefaultTableModel",
")",
"jTableStreams"... | Clean the tables | [
"Clean",
"the",
"tables"
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/experimentertab/PlotTab.java#L1005-L1021 | train | Clean the tables. | Create a Java method that does the following: "Clean the tables.". | Of course, here is the Java code you requested:
```java
public void cleanTables() {
try {
DefaultTableModel algModel = (DefaultTableModel) jTableAlgoritms.getModel();
DefaultTableModel strModel = (DefaultTableModel) jTableStreams.getModel();
int rows = jTableAlgoritms.getRow... | |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.memberExpr | private AstNode memberExpr(boolean allowCallSyntax)
throws IOException
{
int tt = peekToken(), lineno = ts.lineno;
AstNode pn;
if (tt != Token.NEW) {
pn = primaryExpr();
} else {
consumeToken();
int pos = ts.tokenBeg;
NewExpres... | java | private AstNode memberExpr(boolean allowCallSyntax)
throws IOException
{
int tt = peekToken(), lineno = ts.lineno;
AstNode pn;
if (tt != Token.NEW) {
pn = primaryExpr();
} else {
consumeToken();
int pos = ts.tokenBeg;
NewExpres... | [
"private",
"AstNode",
"memberExpr",
"(",
"boolean",
"allowCallSyntax",
")",
"throws",
"IOException",
"{",
"int",
"tt",
"=",
"peekToken",
"(",
")",
",",
"lineno",
"=",
"ts",
".",
"lineno",
";",
"AstNode",
"pn",
";",
"if",
"(",
"tt",
"!=",
"Token",
".",
... | Parse a new-expression, or if next token isn't {@link Token#NEW},
a primary expression.
@param allowCallSyntax passed down to {@link #memberExprTail} | [
"Parse",
"a",
"new",
"-",
"expression",
"or",
"if",
"next",
"token",
"isn",
"t",
"{"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L2731-L2776 | train | Member Expression. | Create a Java method that does the following: "Member Expression.". | Of course, here is the Java code you requested:
```java
private AstNode memberExpr(boolean allowCallSyntax)
throws IOException
{
int tt = peekToken(), lineno = ts.lineno;
AstNode pn;
if (tt != Token.NEW) {
pn = primaryExpr();
} else {
consumeToken();... | |
RuedigerMoeller/kontraktor | src/main/java/org/nustaq/kontraktor/Promise.java | Promise.then | @Override
public <OUT> IPromise<OUT> then(Consumer<T> function) {
Promise res = new Promise<>();
then( new Callback<T>() {
@Override
public void complete(T result, Object error) {
if ( Actor.isError(error) ) {
res.complete(null, error);
... | java | @Override
public <OUT> IPromise<OUT> then(Consumer<T> function) {
Promise res = new Promise<>();
then( new Callback<T>() {
@Override
public void complete(T result, Object error) {
if ( Actor.isError(error) ) {
res.complete(null, error);
... | [
"@",
"Override",
"public",
"<",
"OUT",
">",
"IPromise",
"<",
"OUT",
">",
"then",
"(",
"Consumer",
"<",
"T",
">",
"function",
")",
"{",
"Promise",
"res",
"=",
"new",
"Promise",
"<>",
"(",
")",
";",
"then",
"(",
"new",
"Callback",
"<",
"T",
">",
"(... | see IPromise (inheriting Callback) interface | [
"see",
"IPromise",
"(",
"inheriting",
"Callback",
")",
"interface"
] | d5f3817f9476f3786187b8ef00400b7a4f25a404 | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/src/main/java/org/nustaq/kontraktor/Promise.java#L159-L174 | train | A method to allow the user to override the then method. | Create a Java method that does the following: "A method to allow the user to override the then method.". | Of course, here is the Java code you requested:
```java
@Override
public <OUT> IPromise<OUT> then(Consumer<T> function) {
Promise res = new Promise<>();
then( new Callback<T>() {
@Override
public void complete(T result, Object error) {
if ( Actor.isError(erro... | |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ConstraintsBase.java | ConstraintsBase.checkProxyPrefetchingLimit | protected void checkProxyPrefetchingLimit(DefBase def, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
if (def.hasProperty(PropertyHelper.OJB_PROPERTY_PROXY_PREFETCHING_LIMIT))
{
if (!def.hasP... | java | protected void checkProxyPrefetchingLimit(DefBase def, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
if (def.hasProperty(PropertyHelper.OJB_PROPERTY_PROXY_PREFETCHING_LIMIT))
{
if (!def.hasP... | [
"protected",
"void",
"checkProxyPrefetchingLimit",
"(",
"DefBase",
"def",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"def... | Constraint that ensures that the proxy-prefetching-limit has a valid value.
@param def The descriptor (class, reference, collection)
@param checkLevel The current check level (this constraint is checked in basic and strict) | [
"Constraint",
"that",
"ensures",
"that",
"the",
"proxy",
"-",
"prefetching",
"-",
"limit",
"has",
"a",
"valid",
"value",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ConstraintsBase.java#L41-L97 | train | Checks the proxy - prefetching - limit property of the class. | Create a Java method that does the following: "Checks the proxy - prefetching - limit property of the class.". | Of course, here is the Java code you requested:
```java
protected void checkProxyPrefetchingLimit(DefBase def, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
if (def.hasProperty(PropertyHelper.OJB_PROPERTY_PROXY_... | |
lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java | TagLibFactory.loadFromStream | public static TagLib loadFromStream(InputStream is, Identification id) throws TagLibException {
return new TagLibFactory(null, is, id).getLib();
} | java | public static TagLib loadFromStream(InputStream is, Identification id) throws TagLibException {
return new TagLibFactory(null, is, id).getLib();
} | [
"public",
"static",
"TagLib",
"loadFromStream",
"(",
"InputStream",
"is",
",",
"Identification",
"id",
")",
"throws",
"TagLibException",
"{",
"return",
"new",
"TagLibFactory",
"(",
"null",
",",
"is",
",",
"id",
")",
".",
"getLib",
"(",
")",
";",
"}"
] | Laedt eine einzelne TagLib.
@param file TLD die geladen werden soll.
@param saxParser Definition des Sax Parser mit dem die TagLib eingelsesen werden soll.
@return TagLib
@throws TagLibException | [
"Laedt",
"eine",
"einzelne",
"TagLib",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java#L509-L511 | train | Load a TagLib from an input stream. | Create a Java method that does the following: "Load a TagLib from an input stream.". | Of course, here is the Java code you requested:
```java
public static TagLib loadFromStream(InputStream is, Identification id) throws TagLibException {
return new TagLibFactory(null, is, id).getLib();
}
```
Hope this helps! | |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/storage/StorageManager.java | StorageManager.getProjectFile | public ProjectFileHandler getProjectFile(final int projectId, final int version) {
log.info(
String.format("Fetching project file. project ID: %d version: %d", projectId, version));
// TODO spyne: remove huge hack ! There should not be any special handling for Database Storage.
if (this.storage inst... | java | public ProjectFileHandler getProjectFile(final int projectId, final int version) {
log.info(
String.format("Fetching project file. project ID: %d version: %d", projectId, version));
// TODO spyne: remove huge hack ! There should not be any special handling for Database Storage.
if (this.storage inst... | [
"public",
"ProjectFileHandler",
"getProjectFile",
"(",
"final",
"int",
"projectId",
",",
"final",
"int",
"version",
")",
"{",
"log",
".",
"info",
"(",
"String",
".",
"format",
"(",
"\"Fetching project file. project ID: %d version: %d\"",
",",
"projectId",
",",
"vers... | Fetch project file from storage.
@param projectId required project ID
@param version version to be fetched
@return Handler object containing hooks to fetched project file | [
"Fetch",
"project",
"file",
"from",
"storage",
"."
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/storage/StorageManager.java#L152-L185 | train | Get a project file from the database. | Create a Java method that does the following: "Get a project file from the database.". | Of course, here is the Java code you requested:
```java
public ProjectFileHandler getProjectFile(final int projectId, final int version) {
log.info(
String.format("Fetching project file. project ID: %d version: %d", projectId, version));
// TODO spyne: remove huge hack ! There should not be any special... | |
eFaps/eFaps-WebApp | src/main/java/org/efaps/ui/wicket/models/field/UICmdField.java | UICmdField.executeEvents | public List<Return> executeEvents(final Object _others,
final Map<String, String> _uiID2Oid)
throws EFapsException
{
if (this.executionStatus == null) {
this.executionStatus = ExecutionStatus.EXECUTE;
}
final List<Return> ret = execut... | java | public List<Return> executeEvents(final Object _others,
final Map<String, String> _uiID2Oid)
throws EFapsException
{
if (this.executionStatus == null) {
this.executionStatus = ExecutionStatus.EXECUTE;
}
final List<Return> ret = execut... | [
"public",
"List",
"<",
"Return",
">",
"executeEvents",
"(",
"final",
"Object",
"_others",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"_uiID2Oid",
")",
"throws",
"EFapsException",
"{",
"if",
"(",
"this",
".",
"executionStatus",
"==",
"null",
")... | Execute the underlying events.
@param _others others
@param _uiID2Oid the ui i d2 oid
@return list of returns
@throws EFapsException on error | [
"Execute",
"the",
"underlying",
"events",
"."
] | 785c1aba0860dd65c673f123214fbe8c24ebdb17 | https://github.com/eFaps/eFaps-WebApp/blob/785c1aba0860dd65c673f123214fbe8c24ebdb17/src/main/java/org/efaps/ui/wicket/models/field/UICmdField.java#L112-L125 | valid | Method to execute the events of the UI_FIELD_CMD. | Create a Java method that does the following: "Method to execute the events of the UI_FIELD_CMD.". | Of course, here is the Java code you requested:
```java
public List<Return> executeEvents(final Object _others,
final Map<String, String> _uiID2Oid)
throws EFapsException
{
if (this.executionStatus == null) {
this.executionStatus = ExecutionStatus.E... | |
lastaflute/lastaflute | src/main/java/org/lastaflute/db/replication/slavedb/SlaveDBAccessorImpl.java | SlaveDBAccessorImpl.accessFixedly | @Override
public <RESULT> RESULT accessFixedly(SlaveDBCallback<RESULT> noArgLambda) {
assertCallbackNotNull(noArgLambda);
return doAccessFixedly(noArgLambda);
} | java | @Override
public <RESULT> RESULT accessFixedly(SlaveDBCallback<RESULT> noArgLambda) {
assertCallbackNotNull(noArgLambda);
return doAccessFixedly(noArgLambda);
} | [
"@",
"Override",
"public",
"<",
"RESULT",
">",
"RESULT",
"accessFixedly",
"(",
"SlaveDBCallback",
"<",
"RESULT",
">",
"noArgLambda",
")",
"{",
"assertCallbackNotNull",
"(",
"noArgLambda",
")",
";",
"return",
"doAccessFixedly",
"(",
"noArgLambda",
")",
";",
"}"
] | ------- | [
"-------"
] | 17b56dda8322e4c6d79043532c1dda917d6b60a8 | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/db/replication/slavedb/SlaveDBAccessorImpl.java#L49-L53 | train | Access the SECRET_CODE page fixed by the user. | Create a Java method that does the following: "Access the SECRET_CODE page fixed by the user.". | Of course, here is the Java code you requested:
```java
@Override
public <RESULT> RESULT accessFixedly(SlaveDBCallback<RESULT> noArgLambda) {
assertCallbackNotNull(noArgLambda);
return doAccessFixedly(noArgLambda);
}
```
Hope this helps! | |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.startJanus | public static Kernel startJanus(Class<? extends Agent> agentCls, Object... params)
throws Exception {
return startJanusWithModuleType(null, agentCls, params);
} | java | public static Kernel startJanus(Class<? extends Agent> agentCls, Object... params)
throws Exception {
return startJanusWithModuleType(null, agentCls, params);
} | [
"public",
"static",
"Kernel",
"startJanus",
"(",
"Class",
"<",
"?",
"extends",
"Agent",
">",
"agentCls",
",",
"Object",
"...",
"params",
")",
"throws",
"Exception",
"{",
"return",
"startJanusWithModuleType",
"(",
"null",
",",
"agentCls",
",",
"params",
")",
... | Launch the Janus kernel and the first agent in the kernel.
<p>Thus function does not parse the command line. See {@link #main(String[])} for the command line management. When this
function is called, it is assumed that all the system's properties are correctly set.
<p>The platformModule parameter permits to specify t... | [
"Launch",
"the",
"Janus",
"kernel",
"and",
"the",
"first",
"agent",
"in",
"the",
"kernel",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L922-L925 | train | Start a Janus kernel with a module type. | Create a Java method that does the following: "Start a Janus kernel with a module type.". | Of course, here is the Java code you requested:
```java
public static Kernel startJanus(Class<? extends Agent> agentCls, Object... params)
throws Exception {
return startJanusWithModuleType(null, agentCls, params);
}
```
Hope this helps! | |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.clearSprites | public void clearSprites ()
{
_metamgr.clearSprites();
if (_actionHandler != null) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
_actionSpriteCount = 0;
}
} | java | public void clearSprites ()
{
_metamgr.clearSprites();
if (_actionHandler != null) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
_actionSpriteCount = 0;
}
} | [
"public",
"void",
"clearSprites",
"(",
")",
"{",
"_metamgr",
".",
"clearSprites",
"(",
")",
";",
"if",
"(",
"_actionHandler",
"!=",
"null",
")",
"{",
"removeMouseListener",
"(",
"_actionHandler",
")",
";",
"removeMouseMotionListener",
"(",
"_actionHandler",
")",... | Removes all sprites from this panel. | [
"Removes",
"all",
"sprites",
"from",
"this",
"panel",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L205-L214 | train | Clear the sprites of the current page. | Create a Java method that does the following: "Clear the sprites of the current page.". | Of course, here is the Java code you requested:
```java
public void clearSprites ()
{
_metamgr.clearSprites();
if (_actionHandler != null) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
_actionSpriteCount = 0;
}
}
`... | |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authorization/authorizationpolicy_lbvserver_binding.java | authorizationpolicy_lbvserver_binding.get | public static authorizationpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
authorizationpolicy_lbvserver_binding obj = new authorizationpolicy_lbvserver_binding();
obj.set_name(name);
authorizationpolicy_lbvserver_binding response[] = (authorizationpolicy_lbvserver_binding[]) ... | java | public static authorizationpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
authorizationpolicy_lbvserver_binding obj = new authorizationpolicy_lbvserver_binding();
obj.set_name(name);
authorizationpolicy_lbvserver_binding response[] = (authorizationpolicy_lbvserver_binding[]) ... | [
"public",
"static",
"authorizationpolicy_lbvserver_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authorizationpolicy_lbvserver_binding",
"obj",
"=",
"new",
"authorizationpolicy_lbvserver_binding",
"(",
... | Use this API to fetch authorizationpolicy_lbvserver_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authorizationpolicy_lbvserver_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authorization/authorizationpolicy_lbvserver_binding.java#L122-L127 | train | Use this API to fetch authorizationpolicy_lbvserver_binding resources of given name. | Create a Java method that does the following: "Use this API to fetch authorizationpolicy_lbvserver_binding resources of given name.". | Of course, here is the Java code you requested:
```java
public static authorizationpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
authorizationpolicy_lbvserver_binding obj = new authorizationpolicy_lbvserver_binding();
obj.set_name(name);
authorizationpolicy_lbvserver_bindin... | |
Javen205/IJPay | src/main/java/com/jpay/secure/RSAUtils.java | RSAUtils.decryptByPrivateKey | public static String decryptByPrivateKey(String data, String privateKey, String fillMode) throws Exception {
byte[] encryptedData = base64.decode(data);
byte[] keyBytes = base64.decode(privateKey);
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory keyFactory = KeyFactory.getInstan... | java | public static String decryptByPrivateKey(String data, String privateKey, String fillMode) throws Exception {
byte[] encryptedData = base64.decode(data);
byte[] keyBytes = base64.decode(privateKey);
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory keyFactory = KeyFactory.getInstan... | [
"public",
"static",
"String",
"decryptByPrivateKey",
"(",
"String",
"data",
",",
"String",
"privateKey",
",",
"String",
"fillMode",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"encryptedData",
"=",
"base64",
".",
"decode",
"(",
"data",
")",
";",
"byte... | 私钥解密
@param data
@param privateKey
@param fillMode
填充模式
@return
@throws Exception | [
"私钥解密"
] | 78da6be4b70675abc6a41df74817532fa257ef29 | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/secure/RSAUtils.java#L238-L267 | train | Decrypts data using the private key. | Create a Java method that does the following: "Decrypts data using the private key.". | Of course, here is the Java code you requested:
```java
public static String decryptByPrivateKey(String data, String privateKey, String fillMode) throws Exception {
byte[] encryptedData = base64.decode(data);
byte[] keyBytes = base64.decode(privateKey);
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(... | |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/service/nitro_service.java | nitro_service.login | public base_response login() throws Exception
{
login login = new login(this.user_name, this.password, this.timeout);
base_response result = login.perform_operation(this);
if (result.errorcode == 0 || result.errorcode == 1034)
this.sessionid = result.sessionid;
return result;
} | java | public base_response login() throws Exception
{
login login = new login(this.user_name, this.password, this.timeout);
base_response result = login.perform_operation(this);
if (result.errorcode == 0 || result.errorcode == 1034)
this.sessionid = result.sessionid;
return result;
} | [
"public",
"base_response",
"login",
"(",
")",
"throws",
"Exception",
"{",
"login",
"login",
"=",
"new",
"login",
"(",
"this",
".",
"user_name",
",",
"this",
".",
"password",
",",
"this",
".",
"timeout",
")",
";",
"base_response",
"result",
"=",
"login",
... | <pre>
Use this API to login into Netscaler.
@return status of the operation performed.
@throws nitro_exception nitro exception is thrown.
</pre> | [
"<pre",
">",
"Use",
"this",
"API",
"to",
"login",
"into",
"Netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/service/nitro_service.java#L262-L270 | train | Use this method to perform a login operation on netscaler resource. | Create a Java method that does the following: "Use this method to perform a login operation on netscaler resource.". | Of course, here is the Java code you requested:
```java
public base_response login() throws Exception
{
login login = new login(this.user_name, this.password, this.timeout);
base_response result = login.perform_operation(this);
if (result.errorcode == 0 || result.errorcode == 1034)
this.sessionid = result.se... | |
moleculer-java/moleculer-java | src/main/java/services/moleculer/transporter/Transporter.java | Transporter.broadcastInfoPacket | public void broadcastInfoPacket() {
if (infoScheduled.compareAndSet(false, true)) {
scheduler.schedule(() -> {
infoScheduled.set(false);
sendInfoPacket(infoBroadcastChannel);
}, 1, TimeUnit.SECONDS);
}
} | java | public void broadcastInfoPacket() {
if (infoScheduled.compareAndSet(false, true)) {
scheduler.schedule(() -> {
infoScheduled.set(false);
sendInfoPacket(infoBroadcastChannel);
}, 1, TimeUnit.SECONDS);
}
} | [
"public",
"void",
"broadcastInfoPacket",
"(",
")",
"{",
"if",
"(",
"infoScheduled",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"scheduler",
".",
"schedule",
"(",
"(",
")",
"->",
"{",
"infoScheduled",
".",
"set",
"(",
"false",
")",
... | --- SEND BROADCAST INFO PACKET --- | [
"---",
"SEND",
"BROADCAST",
"INFO",
"PACKET",
"---"
] | 27575c44b9ecacc17c4456ceacf5d1851abf1cc4 | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/transporter/Transporter.java#L798-L805 | train | Broadcasts a message to the remote node. | Create a Java method that does the following: "Broadcasts a message to the remote node.". | Of course, here is the Java code you requested:
```java
public void broadcastInfoPacket() {
if (infoScheduled.compareAndSet(false, true)) {
scheduler.schedule(() -> {
infoScheduled.set(false);
sendInfoPacket(infoBroadcastChannel);
}, 1, TimeUnit.SECONDS);
}
}
```
Hope this helps! | |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.tail | public static <T> Iterator<T> tail(Iterator<T> self) {
if (!self.hasNext()) {
throw new NoSuchElementException("Cannot access tail() for an empty Iterator");
}
self.next();
return self;
} | java | public static <T> Iterator<T> tail(Iterator<T> self) {
if (!self.hasNext()) {
throw new NoSuchElementException("Cannot access tail() for an empty Iterator");
}
self.next();
return self;
} | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"tail",
"(",
"Iterator",
"<",
"T",
">",
"self",
")",
"{",
"if",
"(",
"!",
"self",
".",
"hasNext",
"(",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"\"Cannot access tail() f... | Returns the original iterator after throwing away the first element.
@param self the original iterator
@return the iterator without its first element
@throws NoSuchElementException if the array is empty and you try to access the tail()
@since 1.8.1 | [
"Returns",
"the",
"original",
"iterator",
"after",
"throwing",
"away",
"the",
"first",
"element",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L10045-L10051 | train | Returns the iterator with the most elements of the iterator. | Create a Java method that does the following: "Returns the iterator with the most elements of the iterator.". | Of course, here is the Java code you requested:
```java
public static <T> Iterator<T> tail(Iterator<T> self) {
if (!self.hasNext()) {
throw new NoSuchElementException("Cannot access tail() for an empty Iterator");
}
self.next();
return self;
}
```
Hope this helps! | |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/converters/ConvertUtils.java | ConvertUtils.convert | public static <T, P extends Convertable<T>> T convert(P value) throws ParseException {
return value == null ? null : value.convert();
} | java | public static <T, P extends Convertable<T>> T convert(P value) throws ParseException {
return value == null ? null : value.convert();
} | [
"public",
"static",
"<",
"T",
",",
"P",
"extends",
"Convertable",
"<",
"T",
">",
">",
"T",
"convert",
"(",
"P",
"value",
")",
"throws",
"ParseException",
"{",
"return",
"value",
"==",
"null",
"?",
"null",
":",
"value",
".",
"convert",
"(",
")",
";",
... | Converting single item if it is not null. | [
"Converting",
"single",
"item",
"if",
"it",
"is",
"not",
"null",
"."
] | aca9f6d5acfc6bd3694984b7f89956e1a0146ddb | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/converters/ConvertUtils.java#L21-L23 | train | Convert a value to a type. | Create a Java method that does the following: "Convert a value to a type.". | Of course, here is the Java code you requested:
```java
public static <T, P extends Convertable<T>> T convert(P value) throws ParseException {
return value == null ? null : value.convert();
}
```
Hope this helps! | |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java | PvmExecutionImpl.setParent | @SuppressWarnings("unchecked")
public void setParent(PvmExecutionImpl parent) {
PvmExecutionImpl currentParent = getParent();
setParentExecution(parent);
if (currentParent != null) {
currentParent.getExecutions().remove(this);
}
if (parent != null) {
((List<PvmExecutionImpl>) parent... | java | @SuppressWarnings("unchecked")
public void setParent(PvmExecutionImpl parent) {
PvmExecutionImpl currentParent = getParent();
setParentExecution(parent);
if (currentParent != null) {
currentParent.getExecutions().remove(this);
}
if (parent != null) {
((List<PvmExecutionImpl>) parent... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"setParent",
"(",
"PvmExecutionImpl",
"parent",
")",
"{",
"PvmExecutionImpl",
"currentParent",
"=",
"getParent",
"(",
")",
";",
"setParentExecution",
"(",
"parent",
")",
";",
"if",
"(",
"curre... | Sets the execution's parent and updates the old and new parents' set of
child executions | [
"Sets",
"the",
"execution",
"s",
"parent",
"and",
"updates",
"the",
"old",
"and",
"new",
"parents",
"set",
"of",
"child",
"executions"
] | 1a464fc887ef3760e53d6f91b9e5b871a0d77cc0 | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L1309-L1322 | train | Sets the parent of this node. | Create a Java method that does the following: "Sets the parent of this node.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public void setParent(PvmExecutionImpl parent) {
PvmExecutionImpl currentParent = getParent();
setParentExecution(parent);
if (currentParent != null) {
currentParent.getExecutions().remove(this);
}
if ... | |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/interceptor/RateLimitInterceptor.java | RateLimitInterceptor.intercept | @Override public Response intercept(Chain chain) throws IOException {
final Response response = chain.proceed(chain.request());
final Headers headers = response.headers();
final Map<String, List<String>> mappedHeaders = headers.toMultimap();
final RateLimits limits = new RateLimits.DefaultParser().pars... | java | @Override public Response intercept(Chain chain) throws IOException {
final Response response = chain.proceed(chain.request());
final Headers headers = response.headers();
final Map<String, List<String>> mappedHeaders = headers.toMultimap();
final RateLimits limits = new RateLimits.DefaultParser().pars... | [
"@",
"Override",
"public",
"Response",
"intercept",
"(",
"Chain",
"chain",
")",
"throws",
"IOException",
"{",
"final",
"Response",
"response",
"=",
"chain",
".",
"proceed",
"(",
"chain",
".",
"request",
"(",
")",
")",
";",
"final",
"Headers",
"headers",
"=... | Intercept a http call.
@param chain the current chain of calls.
@return a response from this call.
@throws IOException if something goes wrong. | [
"Intercept",
"a",
"http",
"call",
"."
] | ca310fb9ea9577fcff0ca57949ab7c2315fa2534 | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/interceptor/RateLimitInterceptor.java#L40-L50 | train | Intercept the chain. | Create a Java method that does the following: "Intercept the chain.". | Of course, here is the Java code you requested:
```java
@Override public Response intercept(Chain chain) throws IOException {
final Response response = chain.proceed(chain.request());
final Headers headers = response.headers();
final Map<String, List<String>> mappedHeaders = headers.toMultimap();
fina... | |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterComparator.java | FilterComparator.registerAt | public void registerAt(Class<? extends Filter> filter,
Class<? extends Filter> atFilter) {
Integer position = getOrder(atFilter);
if (position == null) {
throw new IllegalArgumentException(
"Cannot register after unregistered Filter " + atFilter);
}
put(filter, position);
} | java | public void registerAt(Class<? extends Filter> filter,
Class<? extends Filter> atFilter) {
Integer position = getOrder(atFilter);
if (position == null) {
throw new IllegalArgumentException(
"Cannot register after unregistered Filter " + atFilter);
}
put(filter, position);
} | [
"public",
"void",
"registerAt",
"(",
"Class",
"<",
"?",
"extends",
"Filter",
">",
"filter",
",",
"Class",
"<",
"?",
"extends",
"Filter",
">",
"atFilter",
")",
"{",
"Integer",
"position",
"=",
"getOrder",
"(",
"atFilter",
")",
";",
"if",
"(",
"position",
... | Registers a {@link Filter} to exist at a particular {@link Filter} position
@param filter the {@link Filter} to register
@param atFilter the {@link Filter} that is already registered and that
{@code filter} should be placed at. | [
"Registers",
"a",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterComparator.java#L148-L157 | test | Registers a Filter at a specific position. | Create a Java method that does the following: "Registers a Filter at a specific position.". | Of course, here is the Java code you requested:
```java
public void registerAt(Class<? extends Filter> filter,
Class<? extends Filter> atFilter) {
Integer position = getOrder(atFilter);
if (position == null) {
throw new IllegalArgumentException(
"Cannot register after unregistered Filter " + atFilter);
... | |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/AbstractConfiguration.java | AbstractConfiguration.key | protected <T> KeyTypeConfiguration<T> key( Class<T> type ) {
if ( type.isPrimitive() ) {
throw new IllegalArgumentException( "Primitive types cannot be used as a map's key" );
}
return new KeyTypeConfiguration<T>( type );
} | java | protected <T> KeyTypeConfiguration<T> key( Class<T> type ) {
if ( type.isPrimitive() ) {
throw new IllegalArgumentException( "Primitive types cannot be used as a map's key" );
}
return new KeyTypeConfiguration<T>( type );
} | [
"protected",
"<",
"T",
">",
"KeyTypeConfiguration",
"<",
"T",
">",
"key",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isPrimitive",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Primitive types cannot b... | Return a {@link KeyTypeConfiguration} to configure key serializer and/or deserializer for the given type.
@param type a {@link java.lang.Class} object.
@param <T> Type
@return a {@link com.github.nmorel.gwtjackson.client.AbstractConfiguration.KeyTypeConfiguration} object. | [
"Return",
"a",
"{",
"@link",
"KeyTypeConfiguration",
"}",
"to",
"configure",
"key",
"serializer",
"and",
"/",
"or",
"deserializer",
"for",
"the",
"given",
"type",
"."
] | 3fdc4350a27a9b64fc437d5fe516bf9191b74824 | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/AbstractConfiguration.java#L158-L163 | train | Create a KeyTypeConfiguration for the given type. | Create a Java method that does the following: "Create a KeyTypeConfiguration for the given type.". | Of course, here is the Java code you requested:
```java
protected <T> KeyTypeConfiguration<T> key( Class<T> type ) {
if ( type.isPrimitive() ) {
throw new IllegalArgumentException( "Primitive types cannot be used as a map's key" );
}
return new KeyTypeConfiguration<T>( type );
}... | |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/TypeResolver.java | TypeResolver.resolveType | public Type resolveType(ParameterizedType type) {
Type[] unresolvedTypeArguments = type.getActualTypeArguments();
/*
* Indicates whether we managed to resolve any of type arguments. If we did not then there is no need to create a new
* ParameterizedType with the old parameters. Instea... | java | public Type resolveType(ParameterizedType type) {
Type[] unresolvedTypeArguments = type.getActualTypeArguments();
/*
* Indicates whether we managed to resolve any of type arguments. If we did not then there is no need to create a new
* ParameterizedType with the old parameters. Instea... | [
"public",
"Type",
"resolveType",
"(",
"ParameterizedType",
"type",
")",
"{",
"Type",
"[",
"]",
"unresolvedTypeArguments",
"=",
"type",
".",
"getActualTypeArguments",
"(",
")",
";",
"/*\n * Indicates whether we managed to resolve any of type arguments. If we did not then... | Resolves a given parameterized type. If the parameterized type contains no type variables it is returned untouched.
Otherwise, a new {@link ParameterizedType} instance is returned in which each type variable is resolved using
{@link #resolveType(TypeVariable)}. | [
"Resolves",
"a",
"given",
"parameterized",
"type",
".",
"If",
"the",
"parameterized",
"type",
"contains",
"no",
"type",
"variables",
"it",
"is",
"returned",
"untouched",
".",
"Otherwise",
"a",
"new",
"{"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/TypeResolver.java#L50-L80 | train | Resolves a type parameter. | Create a Java method that does the following: "Resolves a type parameter.". | Of course, here is the Java code you requested:
```java
public Type resolveType(ParameterizedType type) {
Type[] unresolvedTypeArguments = type.getActualTypeArguments();
/*
* Indicates whether we managed to resolve any of type arguments. If we did not then there is no need to create a new
... | |
esigate/esigate | esigate-core/src/main/java/org/esigate/vars/VariablesResolver.java | VariablesResolver.replaceAllVariables | public static String replaceAllVariables(String strVars, DriverRequest request) {
String result = strVars;
if (VariablesResolver.containsVariable(strVars)) {
Matcher matcher = VAR_PATTERN.matcher(strVars);
while (matcher.find()) {
String group = matcher.group();
... | java | public static String replaceAllVariables(String strVars, DriverRequest request) {
String result = strVars;
if (VariablesResolver.containsVariable(strVars)) {
Matcher matcher = VAR_PATTERN.matcher(strVars);
while (matcher.find()) {
String group = matcher.group();
... | [
"public",
"static",
"String",
"replaceAllVariables",
"(",
"String",
"strVars",
",",
"DriverRequest",
"request",
")",
"{",
"String",
"result",
"=",
"strVars",
";",
"if",
"(",
"VariablesResolver",
".",
"containsVariable",
"(",
"strVars",
")",
")",
"{",
"Matcher",
... | Replace all ESI variables found in strVars by their matching value in vars.properties.
@param strVars
a String containing variables.
@param request
@return The resulting String | [
"Replace",
"all",
"ESI",
"variables",
"found",
"in",
"strVars",
"by",
"their",
"matching",
"value",
"in",
"vars",
".",
"properties",
"."
] | 50421fb224f16e1ec42715425109a72b3b55527b | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/vars/VariablesResolver.java#L143-L183 | train | Replaces all variables in the input string with the values of the variables in the input string. | Create a Java method that does the following: "Replaces all variables in the input string with the values of the variables in the input string.". | Of course, here is the Java code you requested:
```java
public static String replaceAllVariables(String strVars, DriverRequest request) {
String result = strVars;
if (VariablesResolver.containsVariable(strVars)) {
Matcher matcher = VAR_PATTERN.matcher(strVars);
while (matcher.f... | |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.invoke | public void invoke(String methodName, Object argument, OutputStream output) throws IOException {
invoke(methodName, argument, output, this.requestIDGenerator.generateID());
} | java | public void invoke(String methodName, Object argument, OutputStream output) throws IOException {
invoke(methodName, argument, output, this.requestIDGenerator.generateID());
} | [
"public",
"void",
"invoke",
"(",
"String",
"methodName",
",",
"Object",
"argument",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"invoke",
"(",
"methodName",
",",
"argument",
",",
"output",
",",
"this",
".",
"requestIDGenerator",
".",
"gen... | Invokes the given method on the remote service passing
the given argument. An id is generated automatically. To read
the response {@link #readResponse(Type, InputStream)} must be
subsequently called.
@param methodName the method to invoke
@param argument the arguments to pass to the method
@param output the {... | [
"Invokes",
"the",
"given",
"method",
"on",
"the",
"remote",
"service",
"passing",
"the",
"given",
"argument",
".",
"An",
"id",
"is",
"generated",
"automatically",
".",
"To",
"read",
"the",
"response",
"{",
"@link",
"#readResponse",
"(",
"Type",
"InputStream",
... | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L486-L488 | train | Invoke a method on the target object. | Create a Java method that does the following: "Invoke a method on the target object.". | Of course, here is the Java code you requested:
```java
public void invoke(String methodName, Object argument, OutputStream output) throws IOException {
invoke(methodName, argument, output, this.requestIDGenerator.generateID());
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java | TraceSummary.setAnnotations | public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
this.annotations = annotations;
} | java | public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
this.annotations = annotations;
} | [
"public",
"void",
"setAnnotations",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"ValueWithServiceIds",
">",
">",
"annotations",
")",
"{",
"this",
".",
"annotations",
"=",
"annotations",
";",
"}"
] | <p>
Annotations from the trace's segment documents.
</p>
@param annotations
Annotations from the trace's segment documents. | [
"<p",
">",
"Annotations",
"from",
"the",
"trace",
"s",
"segment",
"documents",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java#L556-L558 | train | Sets the annotations for this class. | Create a Java method that does the following: "Sets the annotations for this class.". | Of course, here is the Java code you requested:
```java
public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
this.annotations = annotations;
}
```
Hope this helps! | |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/state/StateHandler.java | StateHandler.changeState | public void changeState(Class<? extends State> next)
{
Check.notNull(next);
final State from = current;
if (current != null)
{
last = current.getClass();
current.exit();
}
if (!states.containsKey(next))
{
final ... | java | public void changeState(Class<? extends State> next)
{
Check.notNull(next);
final State from = current;
if (current != null)
{
last = current.getClass();
current.exit();
}
if (!states.containsKey(next))
{
final ... | [
"public",
"void",
"changeState",
"(",
"Class",
"<",
"?",
"extends",
"State",
">",
"next",
")",
"{",
"Check",
".",
"notNull",
"(",
"next",
")",
";",
"final",
"State",
"from",
"=",
"current",
";",
"if",
"(",
"current",
"!=",
"null",
")",
"{",
"last",
... | Change the current state.
@param next The next state.
@throws LionEngineException If <code>null</code> argument or unable to change state. | [
"Change",
"the",
"current",
"state",
"."
] | cac3d5578532cf11724a737b9f09e71bf9995ab2 | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/state/StateHandler.java#L134-L153 | train | Change the state of the calendar. | Create a Java method that does the following: "Change the state of the calendar.". | Of course, here is the Java code you requested:
```java
public void changeState(Class<? extends State> next)
{
Check.notNull(next);
final State from = current;
if (current != null)
{
last = current.getClass();
current.exit();
}
if (... | |
pravega/pravega | common/src/main/java/io/pravega/common/tracing/RequestTracker.java | RequestTracker.getRequestTagFor | public RequestTag getRequestTagFor(String requestDescriptor) {
Preconditions.checkNotNull(requestDescriptor, "Attempting to get a null request descriptor.");
if (!tracingEnabled) {
return new RequestTag(requestDescriptor, RequestTag.NON_EXISTENT_ID);
}
long requestId;
... | java | public RequestTag getRequestTagFor(String requestDescriptor) {
Preconditions.checkNotNull(requestDescriptor, "Attempting to get a null request descriptor.");
if (!tracingEnabled) {
return new RequestTag(requestDescriptor, RequestTag.NON_EXISTENT_ID);
}
long requestId;
... | [
"public",
"RequestTag",
"getRequestTagFor",
"(",
"String",
"requestDescriptor",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"requestDescriptor",
",",
"\"Attempting to get a null request descriptor.\"",
")",
";",
"if",
"(",
"!",
"tracingEnabled",
")",
"{",
"retu... | Retrieves a {@link RequestTag} object formed by a request descriptor and request id. If the request descriptor
does not exist or tracing is disabled, a new {@link RequestTag} object with a default request id is returned. In
the case of concurrent requests with the same descriptor, multiple request ids will be associate... | [
"Retrieves",
"a",
"{",
"@link",
"RequestTag",
"}",
"object",
"formed",
"by",
"a",
"request",
"descriptor",
"and",
"request",
"id",
".",
"If",
"the",
"request",
"descriptor",
"does",
"not",
"exist",
"or",
"tracing",
"is",
"disabled",
"a",
"new",
"{",
"@link... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/tracing/RequestTracker.java#L94-L114 | train | Gets the request tag for the specified request descriptor. | Create a Java method that does the following: "Gets the request tag for the specified request descriptor.". | Of course, here is the Java code you requested:
```java
public RequestTag getRequestTagFor(String requestDescriptor) {
Preconditions.checkNotNull(requestDescriptor, "Attempting to get a null request descriptor.");
if (!tracingEnabled) {
return new RequestTag(requestDescriptor, RequestTag.NO... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/AbstractRemoteSupport.java | AbstractRemoteSupport.removeAnycastInputHandlerAndRCD | public boolean removeAnycastInputHandlerAndRCD(String key) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAnycastInputHandlerAndRCD", key);
AnycastInputHandler aih = _anycastInputHandlers.get(key);
AIContainerItemStream aiCo... | java | public boolean removeAnycastInputHandlerAndRCD(String key) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAnycastInputHandlerAndRCD", key);
AnycastInputHandler aih = _anycastInputHandlers.get(key);
AIContainerItemStream aiCo... | [
"public",
"boolean",
"removeAnycastInputHandlerAndRCD",
"(",
"String",
"key",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"... | Method removeAnycastInputHandlerAndRCD
<p>Removes the AIH and the RCD instances for a given dme ID. Also removes the itemStreams
from the messageStore for the aiContainerItemStream and the rcdItemStream
@param dmeID the uuid of the dme which the instances of the aih and rcd
will be deleted.
@throws SIResourceException... | [
"Method",
"removeAnycastInputHandlerAndRCD",
"<p",
">",
"Removes",
"the",
"AIH",
"and",
"the",
"RCD",
"instances",
"for",
"a",
"given",
"dme",
"ID",
".",
"Also",
"removes",
"the",
"itemStreams",
"from",
"the",
"messageStore",
"for",
"the",
"aiContainerItemStream",... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/AbstractRemoteSupport.java#L850-L948 | train | Remove an AnycastInputHandler and the RCD. | Create a Java method that does the following: "Remove an AnycastInputHandler and the RCD.". | Of course, here is the Java code you requested:
```java
public boolean removeAnycastInputHandlerAndRCD(String key) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAnycastInputHandlerAndRCD", key);
AnycastInputHandler aih = _anyc... | |
karlnicholas/openstates-client | src/main/java/org/openstates/classes/EventClass.java | EventClass.search | public Events search(String state, String type) throws OpenStatesException {
return api.query(
new MethodMap("events"),
new ArgMap("state", state, "type", type),
Events.class
);
} | java | public Events search(String state, String type) throws OpenStatesException {
return api.query(
new MethodMap("events"),
new ArgMap("state", state, "type", type),
Events.class
);
} | [
"public",
"Events",
"search",
"(",
"String",
"state",
",",
"String",
"type",
")",
"throws",
"OpenStatesException",
"{",
"return",
"api",
".",
"query",
"(",
"new",
"MethodMap",
"(",
"\"events\"",
")",
",",
"new",
"ArgMap",
"(",
"\"state\"",
",",
"state",
",... | Event Search
This method allows searching by a number of fields:
@param state
@param type
@return {@link Events} | [
"Event",
"Search",
"This",
"method",
"allows",
"searching",
"by",
"a",
"number",
"of",
"fields",
":"
] | 423dd188a093bb7d80325f087a32ae34b323c267 | https://github.com/karlnicholas/openstates-client/blob/423dd188a093bb7d80325f087a32ae34b323c267/src/main/java/org/openstates/classes/EventClass.java#L64-L70 | valid | Search for events in a state. | Create a Java method that does the following: "Search for events in a state.". | Of course, here is the Java code you requested:
```java
public Events search(String state, String type) throws OpenStatesException {
return api.query(
new MethodMap("events"),
new ArgMap("state", state, "type", type),
Events.class
);
}
```
Hope this helps! | |
NLPchina/ansj_seg | plugin/ansj_lucene4_plugin/src/main/java/org/ansj/lucene/util/PorterStemmer.java | PorterStemmer.vowelinstem | private final boolean vowelinstem() {
int i;
for (i = k0; i <= j; i++)
if (!cons(i))
return true;
return false;
} | java | private final boolean vowelinstem() {
int i;
for (i = k0; i <= j; i++)
if (!cons(i))
return true;
return false;
} | [
"private",
"final",
"boolean",
"vowelinstem",
"(",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"k0",
";",
"i",
"<=",
"j",
";",
"i",
"++",
")",
"if",
"(",
"!",
"cons",
"(",
"i",
")",
")",
"return",
"true",
";",
"return",
"false",
";",
"}"... | /* vowelinstem() is true <=> k0,...j contains a vowel | [
"/",
"*",
"vowelinstem",
"()",
"is",
"true",
"<",
"=",
">",
"k0",
"...",
"j",
"contains",
"a",
"vowel"
] | 1addfa08c9dc86872fcdb06c7f0955dd5d197585 | https://github.com/NLPchina/ansj_seg/blob/1addfa08c9dc86872fcdb06c7f0955dd5d197585/plugin/ansj_lucene4_plugin/src/main/java/org/ansj/lucene/util/PorterStemmer.java#L139-L145 | train | Returns true if the vowel is a consonant. | Create a Java method that does the following: "Returns true if the vowel is a consonant.". | Of course, here is the Java code you requested:
```java
private final boolean vowelinstem() {
int i;
for (i = k0; i <= j; i++)
if (!cons(i))
return true;
return false;
}
```
Hope this helps! | |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/HandlerRequestUtils.java | HandlerRequestUtils.fromRequestBodyOrQueryParameter | public static <T> T fromRequestBodyOrQueryParameter(
T requestValue,
SupplierWithException<T, RestHandlerException> queryParameterExtractor,
T defaultValue,
Logger log) throws RestHandlerException {
if (requestValue != null) {
return requestValue;
} else {
T queryParameterValue = queryParameterExt... | java | public static <T> T fromRequestBodyOrQueryParameter(
T requestValue,
SupplierWithException<T, RestHandlerException> queryParameterExtractor,
T defaultValue,
Logger log) throws RestHandlerException {
if (requestValue != null) {
return requestValue;
} else {
T queryParameterValue = queryParameterExt... | [
"public",
"static",
"<",
"T",
">",
"T",
"fromRequestBodyOrQueryParameter",
"(",
"T",
"requestValue",
",",
"SupplierWithException",
"<",
"T",
",",
"RestHandlerException",
">",
"queryParameterExtractor",
",",
"T",
"defaultValue",
",",
"Logger",
"log",
")",
"throws",
... | Returns {@code requestValue} if it is not null, otherwise returns the query parameter value
if it is not null, otherwise returns the default value. | [
"Returns",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/HandlerRequestUtils.java#L73-L90 | train | Creates a new instance of the class based on the given value from the request body or query parameter. | Create a Java method that does the following: "Creates a new instance of the class based on the given value from the request body or query parameter.". | Of course, here is the Java code you requested:
```java
public static <T> T fromRequestBodyOrQueryParameter(
T requestValue,
SupplierWithException<T, RestHandlerException> queryParameterExtractor,
T defaultValue,
Logger log) throws RestHandlerException {
if (requestValue != null) {
return requestValue... | |
graknlabs/grakn | server/src/server/deduplicator/AttributeDeduplicator.java | AttributeDeduplicator.deduplicate | public static void deduplicate(SessionFactory sessionFactory, KeyspaceIndexPair keyspaceIndexPair) {
SessionImpl session = sessionFactory.session(keyspaceIndexPair.keyspace());
try (TransactionOLTP tx = session.transaction().write()) {
GraphTraversalSource tinker = tx.getTinkerTraversal();
... | java | public static void deduplicate(SessionFactory sessionFactory, KeyspaceIndexPair keyspaceIndexPair) {
SessionImpl session = sessionFactory.session(keyspaceIndexPair.keyspace());
try (TransactionOLTP tx = session.transaction().write()) {
GraphTraversalSource tinker = tx.getTinkerTraversal();
... | [
"public",
"static",
"void",
"deduplicate",
"(",
"SessionFactory",
"sessionFactory",
",",
"KeyspaceIndexPair",
"keyspaceIndexPair",
")",
"{",
"SessionImpl",
"session",
"=",
"sessionFactory",
".",
"session",
"(",
"keyspaceIndexPair",
".",
"keyspace",
"(",
")",
")",
";... | Deduplicate attributes that has the same value. A de-duplication process consists of picking a single attribute
in the duplicates as the "merge target", copying every edges from every "other duplicates" to the merge target, and
finally deleting that other duplicates.
@param sessionFactory the factory object for acc... | [
"Deduplicate",
"attributes",
"that",
"has",
"the",
"same",
"value",
".",
"A",
"de",
"-",
"duplication",
"process",
"consists",
"of",
"picking",
"a",
"single",
"attribute",
"in",
"the",
"duplicates",
"as",
"the",
"merge",
"target",
"copying",
"every",
"edges",
... | 6aaee75ea846202474d591f8809d62028262fac5 | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/deduplicator/AttributeDeduplicator.java#L52-L105 | train | Deduplicate the attribute and role - player edges in the given keyspace. | Create a Java method that does the following: "Deduplicate the attribute and role - player edges in the given keyspace.". | Of course, here is the Java code you requested:
```java
public static void deduplicate(SessionFactory sessionFactory, KeyspaceIndexPair keyspaceIndexPair) {
SessionImpl session = sessionFactory.session(keyspaceIndexPair.keyspace());
try (TransactionOLTP tx = session.transaction().write()) {
... | |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/info/ChainedProperty.java | ChainedProperty.appendTo | public void appendTo(Appendable app) throws IOException {
appendPropTo(app, mPrime.getName(), isOuterJoin(0));
StorableProperty<?>[] chain = mChain;
if (chain != null) {
for (int i=0; i<chain.length; i++) {
app.append('.');
appendPropTo(app, chai... | java | public void appendTo(Appendable app) throws IOException {
appendPropTo(app, mPrime.getName(), isOuterJoin(0));
StorableProperty<?>[] chain = mChain;
if (chain != null) {
for (int i=0; i<chain.length; i++) {
app.append('.');
appendPropTo(app, chai... | [
"public",
"void",
"appendTo",
"(",
"Appendable",
"app",
")",
"throws",
"IOException",
"{",
"appendPropTo",
"(",
"app",
",",
"mPrime",
".",
"getName",
"(",
")",
",",
"isOuterJoin",
"(",
"0",
")",
")",
";",
"StorableProperty",
"<",
"?",
">",
"[",
"]",
"c... | Appends the chained property formatted as "name.subname.subsubname".
This format is parseable only if the chain is composed of valid
many-to-one joins. | [
"Appends",
"the",
"chained",
"property",
"formatted",
"as",
"name",
".",
"subname",
".",
"subsubname",
".",
"This",
"format",
"is",
"parseable",
"only",
"if",
"the",
"chain",
"is",
"composed",
"of",
"valid",
"many",
"-",
"to",
"-",
"one",
"joins",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/info/ChainedProperty.java#L561-L570 | train | Append the contents of this instance to the given appendable. | Create a Java method that does the following: "Append the contents of this instance to the given appendable.". | Of course, here is the Java code you requested:
```java
public void appendTo(Appendable app) throws IOException {
appendPropTo(app, mPrime.getName(), isOuterJoin(0));
StorableProperty<?>[] chain = mChain;
if (chain != null) {
for (int i=0; i<chain.length; i++) {
... | |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java | BlockManagement.cut | private void cut(final char[] revA, final DiffBlock curA)
{
String text = copy(revA, curA.getRevAStart(), curA.getRevAEnd());
// Cut (C S E B)
DiffPart action = new DiffPart(DiffAction.CUT);
// S
action.setStart(version.length());
codecData.checkBlocksizeS(version.length());
// E
action.setLength(c... | java | private void cut(final char[] revA, final DiffBlock curA)
{
String text = copy(revA, curA.getRevAStart(), curA.getRevAEnd());
// Cut (C S E B)
DiffPart action = new DiffPart(DiffAction.CUT);
// S
action.setStart(version.length());
codecData.checkBlocksizeS(version.length());
// E
action.setLength(c... | [
"private",
"void",
"cut",
"(",
"final",
"char",
"[",
"]",
"revA",
",",
"final",
"DiffBlock",
"curA",
")",
"{",
"String",
"text",
"=",
"copy",
"(",
"revA",
",",
"curA",
".",
"getRevAStart",
"(",
")",
",",
"curA",
".",
"getRevAEnd",
"(",
")",
")",
";... | Creates a cut operation.
@param revA
Reference to revision A
@param curA
Reference to current block A | [
"Creates",
"a",
"cut",
"operation",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L309-L332 | train | Cut a diff block. | Create a Java method that does the following: "Cut a diff block.". | Of course, here is the Java code you requested:
```java
private void cut(final char[] revA, final DiffBlock curA)
{
String text = copy(revA, curA.getRevAStart(), curA.getRevAEnd());
// Cut (C S E B)
DiffPart action = new DiffPart(DiffAction.CUT);
// S
action.setStart(version.length());
codecData.checkB... | |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/durationpicker_underconstruction/DurationConverter.java | DurationConverter.convertStringFromDuration | static public String convertStringFromDuration(
Duration duration, DurationConverterSettings settings) {
if ((duration == null) || (duration.isNegative())) {
return "";
}
long seconds = duration.getSeconds();
HashSet<DurationUnit> usedUnits
= getU... | java | static public String convertStringFromDuration(
Duration duration, DurationConverterSettings settings) {
if ((duration == null) || (duration.isNegative())) {
return "";
}
long seconds = duration.getSeconds();
HashSet<DurationUnit> usedUnits
= getU... | [
"static",
"public",
"String",
"convertStringFromDuration",
"(",
"Duration",
"duration",
",",
"DurationConverterSettings",
"settings",
")",
"{",
"if",
"(",
"(",
"duration",
"==",
"null",
")",
"||",
"(",
"duration",
".",
"isNegative",
"(",
")",
")",
")",
"{",
... | This function will return an empty string if the duration is null or less than zero. This
function will never return null. | [
"This",
"function",
"will",
"return",
"an",
"empty",
"string",
"if",
"the",
"duration",
"is",
"null",
"or",
"less",
"than",
"zero",
".",
"This",
"function",
"will",
"never",
"return",
"null",
"."
] | c7df05a5fe382e1e08a6237e9391d8dc5fd48692 | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/durationpicker_underconstruction/DurationConverter.java#L107-L224 | train | Convert string from duration. | Create a Java method that does the following: "Convert string from duration.". | Of course, here is the Java code you requested:
```java
static public String convertStringFromDuration(
Duration duration, DurationConverterSettings settings) {
if ((duration == null) || (duration.isNegative())) {
return "";
}
long seconds = duration.getSeconds();
... | |
streamsets/datacollector | container/src/main/java/com/streamsets/datacollector/bundles/SupportBundleManager.java | SupportBundleManager.uploadNewBundleOnError | public void uploadNewBundleOnError() {
boolean enabled = configuration.get(Constants.UPLOAD_ON_ERROR, Constants.DEFAULT_UPLOAD_ON_ERROR);
LOG.info("Upload bundle on error: {}", enabled);
// We won't upload the bundle unless it's explicitly allowed
if(!enabled) {
return;
}
try {
upl... | java | public void uploadNewBundleOnError() {
boolean enabled = configuration.get(Constants.UPLOAD_ON_ERROR, Constants.DEFAULT_UPLOAD_ON_ERROR);
LOG.info("Upload bundle on error: {}", enabled);
// We won't upload the bundle unless it's explicitly allowed
if(!enabled) {
return;
}
try {
upl... | [
"public",
"void",
"uploadNewBundleOnError",
"(",
")",
"{",
"boolean",
"enabled",
"=",
"configuration",
".",
"get",
"(",
"Constants",
".",
"UPLOAD_ON_ERROR",
",",
"Constants",
".",
"DEFAULT_UPLOAD_ON_ERROR",
")",
";",
"LOG",
".",
"info",
"(",
"\"Upload bundle on er... | Try to upload bundle as part of internal SDC error (for example failing pipeline). | [
"Try",
"to",
"upload",
"bundle",
"as",
"part",
"of",
"internal",
"SDC",
"error",
"(",
"for",
"example",
"failing",
"pipeline",
")",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/bundles/SupportBundleManager.java#L340-L354 | test | Upload a new bundle on error. | Create a Java method that does the following: "Upload a new bundle on error.". | Of course, here is the Java code you requested:
```java
public void uploadNewBundleOnError() {
boolean enabled = configuration.get(Constants.UPLOAD_ON_ERROR, Constants.DEFAULT_UPLOAD_ON_ERROR);
LOG.info("Upload bundle on error: {}", enabled);
// We won't upload the bundle unless it's explicitly allowed
... | |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateSubList | public OperationStatus updateSubList(UUID appId, String versionId, UUID clEntityId, int subListId, WordListBaseUpdateObject wordListBaseUpdateObject) {
return updateSubListWithServiceResponseAsync(appId, versionId, clEntityId, subListId, wordListBaseUpdateObject).toBlocking().single().body();
} | java | public OperationStatus updateSubList(UUID appId, String versionId, UUID clEntityId, int subListId, WordListBaseUpdateObject wordListBaseUpdateObject) {
return updateSubListWithServiceResponseAsync(appId, versionId, clEntityId, subListId, wordListBaseUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateSubList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
",",
"int",
"subListId",
",",
"WordListBaseUpdateObject",
"wordListBaseUpdateObject",
")",
"{",
"return",
"updateSubListWithServiceResponseAsync",
"(... | Updates one of the closed list's sublists.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param subListId The sublist ID.
@param wordListBaseUpdateObject A sublist update object containing the new canonical form and the list of words.
@throws I... | [
"Updates",
"one",
"of",
"the",
"closed",
"list",
"s",
"sublists",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4968-L4970 | train | Update a list of words. | Create a Java method that does the following: "Update a list of words.". | Of course, here is the Java code you requested:
```java
public OperationStatus updateSubList(UUID appId, String versionId, UUID clEntityId, int subListId, WordListBaseUpdateObject wordListBaseUpdateObject) {
return updateSubListWithServiceResponseAsync(appId, versionId, clEntityId, subListId, wordListBaseUpdat... | |
petergeneric/stdlib | guice/common/src/main/java/com/peterphi/std/guice/restclient/jaxb/webquery/WQGroup.java | WQGroup.eq | public WQGroup eq(final String field, final Object... values)
{
if (values == null)
{
add(WQConstraint.eq(field, null));
}
else if (values.length == 1)
{
add(WQConstraint.eq(field, values[0]));
}
else if (values.length > 1)
{
final WQGroup or = or();
for (Object value : values)
or.eq(f... | java | public WQGroup eq(final String field, final Object... values)
{
if (values == null)
{
add(WQConstraint.eq(field, null));
}
else if (values.length == 1)
{
add(WQConstraint.eq(field, values[0]));
}
else if (values.length > 1)
{
final WQGroup or = or();
for (Object value : values)
or.eq(f... | [
"public",
"WQGroup",
"eq",
"(",
"final",
"String",
"field",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"add",
"(",
"WQConstraint",
".",
"eq",
"(",
"field",
",",
"null",
")",
")",
";",
"}",
"else"... | Assert that a field equals one of the provided values. Implicitly creates a new OR group if multiple values are supplied
@param field
@param values
@return | [
"Assert",
"that",
"a",
"field",
"equals",
"one",
"of",
"the",
"provided",
"values",
".",
"Implicitly",
"creates",
"a",
"new",
"OR",
"group",
"if",
"multiple",
"values",
"are",
"supplied"
] | d4025d2f881bc0542b1e004c5f65a1ccaf895836 | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/restclient/jaxb/webquery/WQGroup.java#L76-L303 | train | Assert that a field equals one of the provided values. | Create a Java method that does the following: "Assert that a field equals one of the provided values.". | Of course, here is the Java code you requested:
```java
public WQGroup eq(final String field, final Object... values)
{
if (values == null)
{
add(WQConstraint.eq(field, null));
}
else if (values.length == 1)
{
add(WQConstraint.eq(field, values[0]));
}
else if (values.length > 1)
{
final WQGro... | |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getCanonicalName | public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
if (cls == null) {
return valueIfNull;
}
final String canonicalName = cls.getCanonicalName();
return canonicalName == null ? valueIfNull : canonicalName;
} | java | public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
if (cls == null) {
return valueIfNull;
}
final String canonicalName = cls.getCanonicalName();
return canonicalName == null ? valueIfNull : canonicalName;
} | [
"public",
"static",
"String",
"getCanonicalName",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"valueIfNull",
")",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"valueIfNull",
";",
"}",
"final",
"String",
"canonicalName",... | <p>Gets the canonical name for a {@code Class}.</p>
@param cls the class for which to get the canonical class name; may be null
@param valueIfNull the return value if null
@return the canonical name of the class, or {@code valueIfNull}
@since 3.7
@see Class#getCanonicalName() | [
"<p",
">",
"Gets",
"the",
"canonical",
"name",
"for",
"a",
"{",
"@code",
"Class",
"}",
".",
"<",
"/",
"p",
">"
] | 9e2dfbbda3668cfa5d935fe76479d1426c294504 | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L1220-L1226 | train | Gets the canonical name of a class. | Create a Java method that does the following: "Gets the canonical name of a class.". | Of course, here is the Java code you requested:
```java
public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
if (cls == null) {
return valueIfNull;
}
final String canonicalName = cls.getCanonicalName();
return canonicalName == null ? valueIfN... | |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java | BinarySearch.search | public static int search(byte[] byteArray, byte value) {
int start = 0;
int end = byteArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == byteArray[middle]) {
return middle;
... | java | public static int search(byte[] byteArray, byte value) {
int start = 0;
int end = byteArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == byteArray[middle]) {
return middle;
... | [
"public",
"static",
"int",
"search",
"(",
"byte",
"[",
"]",
"byteArray",
",",
"byte",
"value",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"byteArray",
".",
"length",
"-",
"1",
";",
"int",
"middle",
"=",
"0",
";",
"while",
"(",
"s... | Search for the value in the sorted byte array and return the index.
@param byteArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array, else -1. | [
"Search",
"for",
"the",
"value",
"in",
"the",
"sorted",
"byte",
"array",
"and",
"return",
"the",
"index",
"."
] | a22971b746833e78a3939ae4de65e8f6bf2e3fd4 | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L179-L201 | train | Search for the value in the array of bytes. | Create a Java method that does the following: "Search for the value in the array of bytes.". | Of course, here is the Java code you requested:
```java
public static int search(byte[] byteArray, byte value) {
int start = 0;
int end = byteArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == byteA... | |
foundation-runtime/service-directory | 1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/registration/RegistrationManagerImpl.java | RegistrationManagerImpl.unregisterService | @Override
public void unregisterService(String serviceName, String providerAddress)
throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
ServiceInstanceUtils.validateAddress(provid... | java | @Override
public void unregisterService(String serviceName, String providerAddress)
throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
ServiceInstanceUtils.validateAddress(provid... | [
"@",
"Override",
"public",
"void",
"unregisterService",
"(",
"String",
"serviceName",
",",
"String",
"providerAddress",
")",
"throws",
"ServiceException",
"{",
"ServiceInstanceUtils",
".",
"validateManagerIsStarted",
"(",
"isStarted",
".",
"get",
"(",
")",
")",
";",... | {@inheritDoc} | [
"{"
] | a7bdefe173dc99e75eff4a24e07e6407e62f2ed4 | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/registration/RegistrationManagerImpl.java#L168-L177 | train | Unregister a service from the service registry. | Create a Java method that does the following: "Unregister a service from the service registry.". | Of course, here is the Java code you requested:
```java
@Override
public void unregisterService(String serviceName, String providerAddress)
throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceN... | |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java | SqlSelectStatement.appendListOfColumnsForSelect | protected List appendListOfColumnsForSelect(StringBuffer buf)
{
FieldDescriptor[] fieldDescriptors = getFieldsForSelect();
ArrayList columnList = new ArrayList();
TableAlias searchAlias = getSearchTable();
for (int i = 0; i < fieldDescriptors.length; i++)
{
... | java | protected List appendListOfColumnsForSelect(StringBuffer buf)
{
FieldDescriptor[] fieldDescriptors = getFieldsForSelect();
ArrayList columnList = new ArrayList();
TableAlias searchAlias = getSearchTable();
for (int i = 0; i < fieldDescriptors.length; i++)
{
... | [
"protected",
"List",
"appendListOfColumnsForSelect",
"(",
"StringBuffer",
"buf",
")",
"{",
"FieldDescriptor",
"[",
"]",
"fieldDescriptors",
"=",
"getFieldsForSelect",
"(",
")",
";",
"ArrayList",
"columnList",
"=",
"new",
"ArrayList",
"(",
")",
";",
"TableAlias",
"... | Appends to the statement a comma separated list of column names.
DO NOT use this if order of columns is important. The row readers build reflectively and look up
column names to find values, so this is safe. In the case of update, you CANNOT use this as the
order of columns is important.
@return list of column names ... | [
"Appends",
"to",
"the",
"statement",
"a",
"comma",
"separated",
"list",
"of",
"column",
"names",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java#L98-L122 | train | Append list of columns for select. | Create a Java method that does the following: "Append list of columns for select.". | Of course, here is the Java code you requested:
```java
protected List appendListOfColumnsForSelect(StringBuffer buf)
{
FieldDescriptor[] fieldDescriptors = getFieldsForSelect();
ArrayList columnList = new ArrayList();
TableAlias searchAlias = getSearchTable();
for (i... | |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/parser/AsciidoctorEngine.java | AsciidoctorEngine.processBody | @Override
public void processBody(ParserContext context) {
StringBuilder body = new StringBuilder(context.getBody().length());
if (!context.hasHeader()) {
for (String line : context.getFileLines()) {
body.append(line).append("\n");
}
context.setBod... | java | @Override
public void processBody(ParserContext context) {
StringBuilder body = new StringBuilder(context.getBody().length());
if (!context.hasHeader()) {
for (String line : context.getFileLines()) {
body.append(line).append("\n");
}
context.setBod... | [
"@",
"Override",
"public",
"void",
"processBody",
"(",
"ParserContext",
"context",
")",
"{",
"StringBuilder",
"body",
"=",
"new",
"StringBuilder",
"(",
"context",
".",
"getBody",
"(",
")",
".",
"length",
"(",
")",
")",
";",
"if",
"(",
"!",
"context",
"."... | TODO: write tests with options and attributes | [
"TODO",
":",
"write",
"tests",
"with",
"options",
"and",
"attributes"
] | beb9042a54bf0eb168821d524c88b9ea0bee88dc | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/parser/AsciidoctorEngine.java#L147-L157 | train | Process the body of a CRA XML document. | Create a Java method that does the following: "Process the body of a CRA XML document.". | Of course, here is the Java code you requested:
```java
@Override
public void processBody(ParserContext context) {
StringBuilder body = new StringBuilder(context.getBody().length());
if (!context.hasHeader()) {
for (String line : context.getFileLines()) {
body.append(lin... | |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.isPacketLongEnough | private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expectedLength + " bytes and got " +
lengt... | java | private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expectedLength + " bytes and got " +
lengt... | [
"private",
"boolean",
"isPacketLongEnough",
"(",
"DatagramPacket",
"packet",
",",
"int",
"expectedLength",
",",
"String",
"name",
")",
"{",
"final",
"int",
"length",
"=",
"packet",
".",
"getLength",
"(",
")",
";",
"if",
"(",
"length",
"<",
"expectedLength",
... | Helper method to check that we got the right size packet.
@param packet a packet that has been received
@param expectedLength the number of bytes we expect it to contain
@param name the description of the packet in case we need to report issues with the length
@return {@code true} if enough bytes were received to pro... | [
"Helper",
"method",
"to",
"check",
"that",
"we",
"got",
"the",
"right",
"size",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L72-L86 | train | Check if the packet is long enough. | Create a Java method that does the following: "Check if the packet is long enough.". | Of course, here is the Java code you requested:
```java
private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expec... | |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemChoose.java | ElemChoose.appendChild | public ElemTemplateElement appendChild(ElemTemplateElement newChild)
{
int type = ((ElemTemplateElement) newChild).getXSLToken();
switch (type)
{
case Constants.ELEMNAME_WHEN :
case Constants.ELEMNAME_OTHERWISE :
// TODO: Positional checking
break;
default :
error(XSLTErro... | java | public ElemTemplateElement appendChild(ElemTemplateElement newChild)
{
int type = ((ElemTemplateElement) newChild).getXSLToken();
switch (type)
{
case Constants.ELEMNAME_WHEN :
case Constants.ELEMNAME_OTHERWISE :
// TODO: Positional checking
break;
default :
error(XSLTErro... | [
"public",
"ElemTemplateElement",
"appendChild",
"(",
"ElemTemplateElement",
"newChild",
")",
"{",
"int",
"type",
"=",
"(",
"(",
"ElemTemplateElement",
")",
"newChild",
")",
".",
"getXSLToken",
"(",
")",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"Constants"... | Add a child to the child list.
@param newChild Child to add to this node's child list
@return The child that was just added to the child list
@throws DOMException | [
"Add",
"a",
"child",
"to",
"the",
"child",
"list",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemChoose.java#L134-L155 | train | Add a child to this element. | Create a Java method that does the following: "Add a child to this element.". | Of course, here is the Java code you requested:
```java
public ElemTemplateElement appendChild(ElemTemplateElement newChild)
{
int type = ((ElemTemplateElement) newChild).getXSLToken();
switch (type)
{
case Constants.ELEMNAME_WHEN :
case Constants.ELEMNAME_OTHERWISE :
// TODO: Positional... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.