repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/OpenPgpPubSubUtil.java | OpenPgpPubSubUtil.fetchPubkeysList | public static PublicKeysListElement fetchPubkeysList(XMPPConnection connection)
throws InterruptedException, XMPPException.XMPPErrorException, PubSubException.NotAPubSubNodeException,
PubSubException.NotALeafNodeException, SmackException.NotConnectedException, SmackException.NoResponseException ... | java | public static PublicKeysListElement fetchPubkeysList(XMPPConnection connection)
throws InterruptedException, XMPPException.XMPPErrorException, PubSubException.NotAPubSubNodeException,
PubSubException.NotALeafNodeException, SmackException.NotConnectedException, SmackException.NoResponseException ... | [
"public",
"static",
"PublicKeysListElement",
"fetchPubkeysList",
"(",
"XMPPConnection",
"connection",
")",
"throws",
"InterruptedException",
",",
"XMPPException",
".",
"XMPPErrorException",
",",
"PubSubException",
".",
"NotAPubSubNodeException",
",",
"PubSubException",
".",
... | Consult the public key metadata node and fetch a list of all of our published OpenPGP public keys.
@see <a href="https://xmpp.org/extensions/xep-0373.html#discover-pubkey-list">
XEP-0373 §4.3: Discovering Public Keys of a User</a>
@param connection XMPP connection
@return content of our metadata node.
@throws Interr... | [
"Consult",
"the",
"public",
"key",
"metadata",
"node",
"and",
"fetch",
"a",
"list",
"of",
"all",
"of",
"our",
"published",
"OpenPGP",
"public",
"keys",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/OpenPgpPubSubUtil.java#L180-L184 | train | Fetch a list of public keys from the server. | Of course, here is the Java code you requested:
```java
public static PublicKeysListElement fetchPubkeysList(XMPPConnection connection)
throws InterruptedException, XMPPException.XMPPErrorException, PubSubException.NotAPubSubNodeException,
PubSubException.NotALeafNodeException, SmackException.N... |
geomajas/geomajas-project-client-gwt2 | plugin/corewidget/corewidget/src/main/java/org/geomajas/gwt2/plugin/corewidget/client/map/layercontrolpanel/LayerControlPanelViewImpl.java | LayerControlPanelViewImpl.bindEvents | private void bindEvents() {
visibilityToggle.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (visibilityToggle.isEnabled()) {
presenter.toggleLayerVisibility();
visibilityToggle.setEnabled(true); // Works because JavaScript is single threaded...
}
}
});
} | java | private void bindEvents() {
visibilityToggle.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (visibilityToggle.isEnabled()) {
presenter.toggleLayerVisibility();
visibilityToggle.setEnabled(true); // Works because JavaScript is single threaded...
}
}
});
} | [
"private",
"void",
"bindEvents",
"(",
")",
"{",
"visibilityToggle",
".",
"addClickHandler",
"(",
"new",
"ClickHandler",
"(",
")",
"{",
"public",
"void",
"onClick",
"(",
"ClickEvent",
"event",
")",
"{",
"if",
"(",
"visibilityToggle",
".",
"isEnabled",
"(",
")... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | bd8d7904e861fa80522eed7b83c4ea99844180c7 | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/corewidget/corewidget/src/main/java/org/geomajas/gwt2/plugin/corewidget/client/map/layercontrolpanel/LayerControlPanelViewImpl.java#L114-L124 | train | Bind events to the visibilityToggle. | Of course, here is the Java code you requested:
```java
private void bindEvents() {
visibilityToggle.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (visibilityToggle.isEnabled()) {
presenter.toggleLayerVisibility();
visibilityToggle.setEnabled(true); // Works becaus... |
pressgang-ccms/PressGangCCMSDatasourceProviders | rest-provider/src/main/java/org/jboss/pressgang/ccms/provider/RESTPropertyTagProvider.java | RESTPropertyTagProvider.getRESTPropertyTagRevisions | public RESTPropertyTagCollectionV1 getRESTPropertyTagRevisions(int id, Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
if (getRESTEntityCache().containsKeyValue(RESTPropertyTagV1.class, id, revision)) {
propertyTag = getRESTEntityCache().get(RESTPropertyTa... | java | public RESTPropertyTagCollectionV1 getRESTPropertyTagRevisions(int id, Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
if (getRESTEntityCache().containsKeyValue(RESTPropertyTagV1.class, id, revision)) {
propertyTag = getRESTEntityCache().get(RESTPropertyTa... | [
"public",
"RESTPropertyTagCollectionV1",
"getRESTPropertyTagRevisions",
"(",
"int",
"id",
",",
"Integer",
"revision",
")",
"{",
"try",
"{",
"RESTPropertyTagV1",
"propertyTag",
"=",
"null",
";",
"if",
"(",
"getRESTEntityCache",
"(",
")",
".",
"containsKeyValue",
"(",... | /*@Override
public UpdateableCollectionWrapper<PropertyCategoryWrapper> getPropertyTagCategories(int id, final Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
Check the cache first
if (getRESTEntityCache().containsKeyValue(RESTPropertyTagV1.class, id, revision)) {
propertyTag = getRESTEntityCache().get(... | [
"/",
"*",
"@Override",
"public",
"UpdateableCollectionWrapper<PropertyCategoryWrapper",
">",
"getPropertyTagCategories",
"(",
"int",
"id",
"final",
"Integer",
"revision",
")",
"{",
"try",
"{",
"RESTPropertyTagV1",
"propertyTag",
"=",
"null",
";",
"Check",
"the",
"cach... | e47588adad0dcd55608b197b37825a512bc8fd25 | https://github.com/pressgang-ccms/PressGangCCMSDatasourceProviders/blob/e47588adad0dcd55608b197b37825a512bc8fd25/rest-provider/src/main/java/org/jboss/pressgang/ccms/provider/RESTPropertyTagProvider.java#L135-L164 | train | Get the Revisions for a Property Tag. | Of course, here is the Java code you requested:
```java
public RESTPropertyTagCollectionV1 getRESTPropertyTagRevisions(int id, Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
if (getRESTEntityCache().containsKeyValue(RESTPropertyTagV1.class, id, revision)) {
... |
google/closure-compiler | src/com/google/javascript/jscomp/RenameVars.java | RenameVars.finalizeNameAssignment | private void finalizeNameAssignment(Assignment a, String newName) {
a.setNewName(newName);
// Keep track of the mapping
renameMap.put(a.oldName, newName);
} | java | private void finalizeNameAssignment(Assignment a, String newName) {
a.setNewName(newName);
// Keep track of the mapping
renameMap.put(a.oldName, newName);
} | [
"private",
"void",
"finalizeNameAssignment",
"(",
"Assignment",
"a",
",",
"String",
"newName",
")",
"{",
"a",
".",
"setNewName",
"(",
"newName",
")",
";",
"// Keep track of the mapping",
"renameMap",
".",
"put",
"(",
"a",
".",
"oldName",
",",
"newName",
")",
... | Makes a final name assignment. | [
"Makes",
"a",
"final",
"name",
"assignment",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RenameVars.java#L547-L552 | train | Finalize name assignment. | Of course, here is the Java code you requested:
```java
private void finalizeNameAssignment(Assignment a, String newName) {
a.setNewName(newName);
// Keep track of the mapping
renameMap.put(a.oldName, newName);
}
```
Hope this helps! |
nmdp-bioinformatics/ngs | fca/src/main/java/org/nmdp/ngs/fca/Interval.java | Interval.after | public boolean after(final Interval<C> that) {
if(this.hasNone() || that.hasNone()) {
return false;
}
return that.before(this);
} | java | public boolean after(final Interval<C> that) {
if(this.hasNone() || that.hasNone()) {
return false;
}
return that.before(this);
} | [
"public",
"boolean",
"after",
"(",
"final",
"Interval",
"<",
"C",
">",
"that",
")",
"{",
"if",
"(",
"this",
".",
"hasNone",
"(",
")",
"||",
"that",
".",
"hasNone",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"that",
".",
"before",
... | Test if an interval is after another.
@param that interval
@return true if that interval (upper endpoint) is before this (lower
endpoint)
@see #before(org.nmdp.ngs.fca.Interval) | [
"Test",
"if",
"an",
"interval",
"is",
"after",
"another",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/fca/src/main/java/org/nmdp/ngs/fca/Interval.java#L425-L430 | train | Check if this interval is after the given one. | Of course, here is the Java code you requested:
```java
public boolean after(final Interval<C> that) {
if(this.hasNone() || that.hasNone()) {
return false;
}
return that.before(this);
}
```
Hope this helps! |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.distinct | @SuppressWarnings("rawtypes")
public org.grails.datastore.mapping.query.api.ProjectionList distinct(Collection propertyNames, String alias) {
ProjectionList list = Projections.projectionList();
for (Object o : propertyNames) {
list.add(Projections.property(calculatePropertyName(o.toStrin... | java | @SuppressWarnings("rawtypes")
public org.grails.datastore.mapping.query.api.ProjectionList distinct(Collection propertyNames, String alias) {
ProjectionList list = Projections.projectionList();
for (Object o : propertyNames) {
list.add(Projections.property(calculatePropertyName(o.toStrin... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"org",
".",
"grails",
".",
"datastore",
".",
"mapping",
".",
"query",
".",
"api",
".",
"ProjectionList",
"distinct",
"(",
"Collection",
"propertyNames",
",",
"String",
"alias",
")",
"{",
"ProjectionL... | A distinct projection that takes a list
@param propertyNames The list of distince property names
@param alias The alias to use | [
"A",
"distinct",
"projection",
"that",
"takes",
"a",
"list"
] | 0ebb80cd769ef2bea955723d4543828a3e9542ef | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L226-L235 | train | Create a projection list that contains the distinct values of the given property names. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("rawtypes")
public org.grails.datastore.mapping.query.api.ProjectionList distinct(Collection propertyNames, String alias) {
ProjectionList list = Projections.projectionList();
for (Object o : propertyNames) {
list... |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DeleteFleetsResult.java | DeleteFleetsResult.setSuccessfulFleetDeletions | public void setSuccessfulFleetDeletions(java.util.Collection<DeleteFleetSuccessItem> successfulFleetDeletions) {
if (successfulFleetDeletions == null) {
this.successfulFleetDeletions = null;
return;
}
this.successfulFleetDeletions = new com.amazonaws.internal.SdkInternal... | java | public void setSuccessfulFleetDeletions(java.util.Collection<DeleteFleetSuccessItem> successfulFleetDeletions) {
if (successfulFleetDeletions == null) {
this.successfulFleetDeletions = null;
return;
}
this.successfulFleetDeletions = new com.amazonaws.internal.SdkInternal... | [
"public",
"void",
"setSuccessfulFleetDeletions",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"DeleteFleetSuccessItem",
">",
"successfulFleetDeletions",
")",
"{",
"if",
"(",
"successfulFleetDeletions",
"==",
"null",
")",
"{",
"this",
".",
"successfulFleetDeletion... | <p>
Information about the EC2 Fleets that are successfully deleted.
</p>
@param successfulFleetDeletions
Information about the EC2 Fleets that are successfully deleted. | [
"<p",
">",
"Information",
"about",
"the",
"EC2",
"Fleets",
"that",
"are",
"successfully",
"deleted",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DeleteFleetsResult.java#L63-L70 | train | Sets the value of the successfulFleetDeletions property. | Of course, here is the Java code you requested:
```java
public void setSuccessfulFleetDeletions(java.util.Collection<DeleteFleetSuccessItem> successfulFleetDeletions) {
if (successfulFleetDeletions == null) {
this.successfulFleetDeletions = null;
return;
}
this.successf... |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/util/files/QFiles.java | QFiles.deleteRecursively | public static void deleteRecursively(File file) {
if (file.isDirectory()) {
for (File c : file.listFiles()) {
deleteRecursively(c);
}
}
if (!file.delete()) {
System.err.println("WARN: unable to delete file: " + file.getPath());
}
} | java | public static void deleteRecursively(File file) {
if (file.isDirectory()) {
for (File c : file.listFiles()) {
deleteRecursively(c);
}
}
if (!file.delete()) {
System.err.println("WARN: unable to delete file: " + file.getPath());
}
} | [
"public",
"static",
"void",
"deleteRecursively",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"for",
"(",
"File",
"c",
":",
"file",
".",
"listFiles",
"(",
")",
")",
"{",
"deleteRecursively",
"(",
"c",
")",... | CAUTION: This is equivalent to calling rm -r on file. | [
"CAUTION",
":",
"This",
"is",
"equivalent",
"to",
"calling",
"rm",
"-",
"r",
"on",
"file",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/util/files/QFiles.java#L279-L288 | train | Delete a file or directory recursively. | Of course, here is the Java code you requested:
```java
public static void deleteRecursively(File file) {
if (file.isDirectory()) {
for (File c : file.listFiles()) {
deleteRecursively(c);
}
}
if (!file.delete()) {
System.err.println("WARN: una... |
alexruiz/fest-assert-1.x | src/main/java/org/fest/assertions/StringAssert.java | StringAssert.contains | public @NotNull StringAssert contains(String expected) {
isNotNull();
if (actual.indexOf(expected) != -1) {
return this;
}
failIfCustomMessageIsSet();
throw failure(format("<%s> should contain the String:<%s>", actual, expected));
} | java | public @NotNull StringAssert contains(String expected) {
isNotNull();
if (actual.indexOf(expected) != -1) {
return this;
}
failIfCustomMessageIsSet();
throw failure(format("<%s> should contain the String:<%s>", actual, expected));
} | [
"public",
"@",
"NotNull",
"StringAssert",
"contains",
"(",
"String",
"expected",
")",
"{",
"isNotNull",
"(",
")",
";",
"if",
"(",
"actual",
".",
"indexOf",
"(",
"expected",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"this",
";",
"}",
"failIfCustomMessageIs... | Verifies that the actual {@code String} contains the given one.
@param expected the given {@code String} expected to be contained in the actual one.
@return this assertion object.
@throws AssertionError if the actual {@code String} is {@code null}.
@throws AssertionError if the actual {@code String} does not contain t... | [
"Verifies",
"that",
"the",
"actual",
"{",
"@code",
"String",
"}",
"contains",
"the",
"given",
"one",
"."
] | f026c3059c8b2e40052f0388309cace819ac93a4 | https://github.com/alexruiz/fest-assert-1.x/blob/f026c3059c8b2e40052f0388309cace819ac93a4/src/main/java/org/fest/assertions/StringAssert.java#L80-L87 | valid | Assert that the String is contained in the String | Of course, here is the Java code you requested:
```java
public @NotNull StringAssert contains(String expected) {
isNotNull();
if (actual.indexOf(expected) != -1) {
return this;
}
failIfCustomMessageIsSet();
throw failure(format("<%s> should contain the String:<%s>", actual, expected));
}
``... |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/PiElectronegativity.java | PiElectronegativity.calculatePiElectronegativity | public double calculatePiElectronegativity(IAtomContainer ac, IAtom atom) {
return calculatePiElectronegativity(ac, atom, maxI, maxRS);
} | java | public double calculatePiElectronegativity(IAtomContainer ac, IAtom atom) {
return calculatePiElectronegativity(ac, atom, maxI, maxRS);
} | [
"public",
"double",
"calculatePiElectronegativity",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"return",
"calculatePiElectronegativity",
"(",
"ac",
",",
"atom",
",",
"maxI",
",",
"maxRS",
")",
";",
"}"
] | calculate the electronegativity of orbitals pi.
@param ac IAtomContainer
@param atom atom for which effective atom electronegativity should be calculated
@return piElectronegativity | [
"calculate",
"the",
"electronegativity",
"of",
"orbitals",
"pi",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/PiElectronegativity.java#L82-L85 | train | Calculates the piElectronegativity of a given atom. | Of course, here is the Java code you requested:
```java
public double calculatePiElectronegativity(IAtomContainer ac, IAtom atom) {
return calculatePiElectronegativity(ac, atom, maxI, maxRS);
}
```
Hope this helps! |
strator-dev/greenpepper | greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/domain/dao/hibernate/HibernateLazyInitializer.java | HibernateLazyInitializer.init | public static void init(Object object)
{
if (object instanceof Collection)
{
initCollection((Collection<?>)object);
}
else if (object instanceof Marshalizable)
{
Marshalizable m = (Marshalizable)object;
m.marshallize();
}
} | java | public static void init(Object object)
{
if (object instanceof Collection)
{
initCollection((Collection<?>)object);
}
else if (object instanceof Marshalizable)
{
Marshalizable m = (Marshalizable)object;
m.marshallize();
}
} | [
"public",
"static",
"void",
"init",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"Collection",
")",
"{",
"initCollection",
"(",
"(",
"Collection",
"<",
"?",
">",
")",
"object",
")",
";",
"}",
"else",
"if",
"(",
"object",
"insta... | <p>init.</p>
@param object a {@link java.lang.Object} object. | [
"<p",
">",
"init",
".",
"<",
"/",
"p",
">"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/domain/dao/hibernate/HibernateLazyInitializer.java#L41-L52 | train | Initializes the object. | Of course, here is the Java code you requested:
```java
public static void init(Object object)
{
if (object instanceof Collection)
{
initCollection((Collection<?>)object);
}
else if (object instanceof Marshalizable)
{
Marshalizable m = (Marshalizable)object;
m.marshallize();
}
}
```
Hope this h... |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java | Ifc2x3tc1FactoryImpl.createIfcWorkControlTypeEnumFromString | public IfcWorkControlTypeEnum createIfcWorkControlTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcWorkControlTypeEnum result = IfcWorkControlTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator o... | java | public IfcWorkControlTypeEnum createIfcWorkControlTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcWorkControlTypeEnum result = IfcWorkControlTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator o... | [
"public",
"IfcWorkControlTypeEnum",
"createIfcWorkControlTypeEnumFromString",
"(",
"EDataType",
"eDataType",
",",
"String",
"initialValue",
")",
"{",
"IfcWorkControlTypeEnum",
"result",
"=",
"IfcWorkControlTypeEnum",
".",
"get",
"(",
"initialValue",
")",
";",
"if",
"(",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java#L13694-L13700 | train | Converts a String to a IfcWorkControlTypeEnum. | Of course, here is the Java code you requested:
```java
public IfcWorkControlTypeEnum createIfcWorkControlTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcWorkControlTypeEnum result = IfcWorkControlTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The... |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OrientResourceAuthorizationStrategy.java | OrientResourceAuthorizationStrategy.getRequiredOrientResources | public RequiredOrientResource[] getRequiredOrientResources(Class<?> clazz)
{
RequiredOrientResources resources = clazz.getAnnotation(RequiredOrientResources.class);
RequiredOrientResource singleResource = clazz.getAnnotation(RequiredOrientResource.class);
if(resources==null && singleResource==null) return null;
... | java | public RequiredOrientResource[] getRequiredOrientResources(Class<?> clazz)
{
RequiredOrientResources resources = clazz.getAnnotation(RequiredOrientResources.class);
RequiredOrientResource singleResource = clazz.getAnnotation(RequiredOrientResource.class);
if(resources==null && singleResource==null) return null;
... | [
"public",
"RequiredOrientResource",
"[",
"]",
"getRequiredOrientResources",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"RequiredOrientResources",
"resources",
"=",
"clazz",
".",
"getAnnotation",
"(",
"RequiredOrientResources",
".",
"class",
")",
";",
"RequiredO... | Extract {@link RequiredOrientResource}s from a Class
@param clazz Class to extract {@link RequiredOrientResource}s from
@return statically defined {@link RequiredOrientResource}s on specified class | [
"Extract",
"{"
] | eb1d94f00a6bff9e266c5c032baa6043afc1db92 | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OrientResourceAuthorizationStrategy.java#L149-L164 | train | Gets the required orient resources. | Of course, here is the Java code you requested:
```java
public RequiredOrientResource[] getRequiredOrientResources(Class<?> clazz)
{
RequiredOrientResources resources = clazz.getAnnotation(RequiredOrientResources.class);
RequiredOrientResource singleResource = clazz.getAnnotation(RequiredOrientResource.class);
... |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG1.java | WFG1.t2 | public float[] t2(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
for (int i = k; i < z.length; i++) {
result[i] = (new Transformations()).bFlat(z[i], (float) 0.8, (float) 0.75, (float) 0.85);
}
return result;
} | java | public float[] t2(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
for (int i = k; i < z.length; i++) {
result[i] = (new Transformations()).bFlat(z[i], (float) 0.8, (float) 0.75, (float) 0.85);
}
return result;
} | [
"public",
"float",
"[",
"]",
"t2",
"(",
"float",
"[",
"]",
"z",
",",
"int",
"k",
")",
"{",
"float",
"[",
"]",
"result",
"=",
"new",
"float",
"[",
"z",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"z",
",",
"0",
",",
"result",
","... | WFG1 t2 transformation | [
"WFG1",
"t2",
"transformation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG1.java#L96-L106 | train | T2 transformation. | Of course, here is the Java code you requested:
```java
public float[] t2(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
for (int i = k; i < z.length; i++) {
result[i] = (new Transformations()).bFlat(z[i], (float) 0.8, (float) 0.75, (float) 0.8... |
oblac/jodd | jodd-bean/src/main/java/jodd/bean/BeanUtilBean.java | BeanUtilBean.getIndexProperty | protected Object getIndexProperty(final BeanProperty bp) {
bp.indexString = extractIndex(bp);
Object value = _getIndexProperty(bp);
bp.indexString = null;
return value;
} | java | protected Object getIndexProperty(final BeanProperty bp) {
bp.indexString = extractIndex(bp);
Object value = _getIndexProperty(bp);
bp.indexString = null;
return value;
} | [
"protected",
"Object",
"getIndexProperty",
"(",
"final",
"BeanProperty",
"bp",
")",
"{",
"bp",
".",
"indexString",
"=",
"extractIndex",
"(",
"bp",
")",
";",
"Object",
"value",
"=",
"_getIndexProperty",
"(",
"bp",
")",
";",
"bp",
".",
"indexString",
"=",
"n... | Get non-nested property value: either simple or indexed property.
If forced, missing bean will be created if possible. | [
"Get",
"non",
"-",
"nested",
"property",
"value",
":",
"either",
"simple",
"or",
"indexed",
"property",
".",
"If",
"forced",
"missing",
"bean",
"will",
"be",
"created",
"if",
"possible",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanUtilBean.java#L280-L288 | test | Gets the index property. | Of course, here is the Java code you requested:
```java
protected Object getIndexProperty(final BeanProperty bp) {
bp.indexString = extractIndex(bp);
Object value = _getIndexProperty(bp);
bp.indexString = null;
return value;
}
```
Hope this helps! |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsWidgetDialog.java | CmsWidgetDialog.getWidgetIncludes | public String getWidgetIncludes() throws JspException {
StringBuffer result = new StringBuffer(32);
try {
// iterate over unique widgets from collector
Iterator<CmsWidgetDialogParameter> i = getWidgets().iterator();
Set<I_CmsWidget> set = new HashSet<I_CmsWidget>();
... | java | public String getWidgetIncludes() throws JspException {
StringBuffer result = new StringBuffer(32);
try {
// iterate over unique widgets from collector
Iterator<CmsWidgetDialogParameter> i = getWidgets().iterator();
Set<I_CmsWidget> set = new HashSet<I_CmsWidget>();
... | [
"public",
"String",
"getWidgetIncludes",
"(",
")",
"throws",
"JspException",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"32",
")",
";",
"try",
"{",
"// iterate over unique widgets from collector",
"Iterator",
"<",
"CmsWidgetDialogParameter",
">",
... | Generates the HTML include tags for external JavaScripts files of the used widgets.<p>
@return the HTML include tags for external JavaScripts files of the used widgets
@throws JspException if an error occurs during JavaScript generation | [
"Generates",
"the",
"HTML",
"include",
"tags",
"for",
"external",
"JavaScripts",
"files",
"of",
"the",
"used",
"widgets",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsWidgetDialog.java#L555-L575 | train | Returns the widget includes. | Of course, here is the Java code you requested:
```java
public String getWidgetIncludes() throws JspException {
StringBuffer result = new StringBuffer(32);
try {
// iterate over unique widgets from collector
Iterator<CmsWidgetDialogParameter> i = getWidgets().iterator();
... |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.createOrUpdateElement | public Element createOrUpdateElement(Object parent, String name, String type, Style style, boolean generateId) {
Element element;
// check existence
if (name != null) {
if (!generateId) {
element = Dom.getElementById(name);
} else {
element = getElement(parent, name);
}
} else {
return null;... | java | public Element createOrUpdateElement(Object parent, String name, String type, Style style, boolean generateId) {
Element element;
// check existence
if (name != null) {
if (!generateId) {
element = Dom.getElementById(name);
} else {
element = getElement(parent, name);
}
} else {
return null;... | [
"public",
"Element",
"createOrUpdateElement",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"String",
"type",
",",
"Style",
"style",
",",
"boolean",
"generateId",
")",
"{",
"Element",
"element",
";",
"// check existence",
"if",
"(",
"name",
"!=",
"null"... | Create or update an element in the DOM. The id will be generated.
@param parent
the parent group
@param name
the local group name of the element (should be unique within the group)
@param type
the type of the element (tag name, e.g. 'image')
@param style
The style to apply on the element.
@param generateId
true if a u... | [
"Create",
"or",
"update",
"an",
"element",
"in",
"the",
"DOM",
".",
"The",
"id",
"will",
"be",
"generated",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L162-L186 | train | Creates or updates an existing element. | Of course, here is the Java code you requested:
```java
public Element createOrUpdateElement(Object parent, String name, String type, Style style, boolean generateId) {
Element element;
// check existence
if (name != null) {
if (!generateId) {
element = Dom.getElementById(name);
} else {
element = ... |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/CorporationApi.java | CorporationApi.getCorporationsCorporationIdShareholders | public List<CorporationShareholdersResponse> getCorporationsCorporationIdShareholders(Integer corporationId,
String datasource, String ifNoneMatch, Integer page, String token) throws ApiException {
ApiResponse<List<CorporationShareholdersResponse>> resp = getCorporationsCorporationIdShareholdersWith... | java | public List<CorporationShareholdersResponse> getCorporationsCorporationIdShareholders(Integer corporationId,
String datasource, String ifNoneMatch, Integer page, String token) throws ApiException {
ApiResponse<List<CorporationShareholdersResponse>> resp = getCorporationsCorporationIdShareholdersWith... | [
"public",
"List",
"<",
"CorporationShareholdersResponse",
">",
"getCorporationsCorporationIdShareholders",
"(",
"Integer",
"corporationId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
",",
"Integer",
"page",
",",
"String",
"token",
")",
"throws",
"ApiExce... | Get corporation shareholders Return the current shareholders of a
corporation. --- This route is cached for up to 3600 seconds --- Requires
one of the following EVE corporation role(s): Director SSO Scope:
esi-wallet.read_corporation_wallets.v1
@param corporationId
An EVE corporation ID (required)
@param datasource
Th... | [
"Get",
"corporation",
"shareholders",
"Return",
"the",
"current",
"shareholders",
"of",
"a",
"corporation",
".",
"---",
"This",
"route",
"is",
"cached",
"for",
"up",
"to",
"3600",
"seconds",
"---",
"Requires",
"one",
"of",
"the",
"following",
"EVE",
"corporati... | 24a941c592cfc15f23471ef849b282fbc582ca13 | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/CorporationApi.java#L2744-L2749 | train | Get corporationId Get corporations shareholders | Of course, here is the Java code you requested:
```java
public List<CorporationShareholdersResponse> getCorporationsCorporationIdShareholders(Integer corporationId,
String datasource, String ifNoneMatch, Integer page, String token) throws ApiException {
ApiResponse<List<CorporationShareholdersRespo... |
Waikato/jclasslocator | src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java | ClassLocator.getClassCache | protected List<Class> getClassCache(Class cls, String pkgname) {
return m_CacheClasses.get(cls.getName() + "-" + pkgname);
} | java | protected List<Class> getClassCache(Class cls, String pkgname) {
return m_CacheClasses.get(cls.getName() + "-" + pkgname);
} | [
"protected",
"List",
"<",
"Class",
">",
"getClassCache",
"(",
"Class",
"cls",
",",
"String",
"pkgname",
")",
"{",
"return",
"m_CacheClasses",
".",
"get",
"(",
"cls",
".",
"getName",
"(",
")",
"+",
"\"-\"",
"+",
"pkgname",
")",
";",
"}"
] | returns the list of classes associated with this class and package, if
available, otherwise null.
@param cls the class to get the classes for
@param pkgname the package name for the classes
@return the classes if found, otherwise null | [
"returns",
"the",
"list",
"of",
"classes",
"associated",
"with",
"this",
"class",
"and",
"package",
"if",
"available",
"otherwise",
"null",
"."
] | c899072fff607a56ee7f8c2d01fbeb15157ad144 | https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java#L521-L523 | train | Get the class cache. | Of course, here is the Java code you requested:
```java
protected List<Class> getClassCache(Class cls, String pkgname) {
return m_CacheClasses.get(cls.getName() + "-" + pkgname);
}
```
Hope this helps! |
ebean-orm/ebean-mocker | src/main/java/io/ebean/DelegateEbeanServer.java | DelegateEbeanServer.nextId | @Override
public Object nextId(Class<?> beanType) {
methodCalls.add(MethodCall.of("nextId").with("beanType", beanType));
return !persistSaves ? 0 : save.nextId(beanType);
} | java | @Override
public Object nextId(Class<?> beanType) {
methodCalls.add(MethodCall.of("nextId").with("beanType", beanType));
return !persistSaves ? 0 : save.nextId(beanType);
} | [
"@",
"Override",
"public",
"Object",
"nextId",
"(",
"Class",
"<",
"?",
">",
"beanType",
")",
"{",
"methodCalls",
".",
"add",
"(",
"MethodCall",
".",
"of",
"(",
"\"nextId\"",
")",
".",
"with",
"(",
"\"beanType\"",
",",
"beanType",
")",
")",
";",
"return... | -- save ------------------------ | [
"--",
"save",
"------------------------"
] | 98c14a58253e8cd40b2a0c9b49526a307079389a | https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/DelegateEbeanServer.java#L725-L729 | train | Returns the next id for the given bean type. | Of course, here is the Java code you requested:
```java
@Override
public Object nextId(Class<?> beanType) {
methodCalls.add(MethodCall.of("nextId").with("beanType", beanType));
return !persistSaves ? 0 : save.nextId(beanType);
}
```
Hope this helps! |
Dempsy/dempsy | dempsy-framework.api/src/main/java/net/dempsy/lifecycle/annotation/internal/AnnotatedMethodInvoker.java | AnnotatedMethodInvoker.introspectAnnotationMultiple | public static <T extends Annotation> List<Method> introspectAnnotationMultiple(
final Class<?> klass, final Class<T> annotationType) {
final List<Method> result = new ArrayList<Method>();
for (final Method method : klass.getMethods()) {
if (method.getAnnotation(annotationType) !=... | java | public static <T extends Annotation> List<Method> introspectAnnotationMultiple(
final Class<?> klass, final Class<T> annotationType) {
final List<Method> result = new ArrayList<Method>();
for (final Method method : klass.getMethods()) {
if (method.getAnnotation(annotationType) !=... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"List",
"<",
"Method",
">",
"introspectAnnotationMultiple",
"(",
"final",
"Class",
"<",
"?",
">",
"klass",
",",
"final",
"Class",
"<",
"T",
">",
"annotationType",
")",
"{",
"final",
"List",
"<",
... | Examines the passed class and extracts all methods that are annotated with the specified annotation type (may be none). | [
"Examines",
"the",
"passed",
"class",
"and",
"extracts",
"all",
"methods",
"that",
"are",
"annotated",
"with",
"the",
"specified",
"annotation",
"type",
"(",
"may",
"be",
"none",
")",
"."
] | cd3415b51b6787a6a9d9589b15f00ce674b6f113 | https://github.com/Dempsy/dempsy/blob/cd3415b51b6787a6a9d9589b15f00ce674b6f113/dempsy-framework.api/src/main/java/net/dempsy/lifecycle/annotation/internal/AnnotatedMethodInvoker.java#L174-L182 | train | Introspect multiple annotations. | Of course, here is the Java code you requested:
```java
public static <T extends Annotation> List<Method> introspectAnnotationMultiple(
final Class<?> klass, final Class<T> annotationType) {
final List<Method> result = new ArrayList<Method>();
for (final Method method : klass.getMethods()) ... |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/process/ProcessListenerEx.java | ProcessListenerEx.asString | public String asString(ProcessEvent e) throws KNXFormatException
{
final DPTXlatorString t = new DPTXlatorString(DPTXlatorString.DPT_STRING_8859_1);
t.setData(e.getASDU());
return t.getValue();
} | java | public String asString(ProcessEvent e) throws KNXFormatException
{
final DPTXlatorString t = new DPTXlatorString(DPTXlatorString.DPT_STRING_8859_1);
t.setData(e.getASDU());
return t.getValue();
} | [
"public",
"String",
"asString",
"(",
"ProcessEvent",
"e",
")",
"throws",
"KNXFormatException",
"{",
"final",
"DPTXlatorString",
"t",
"=",
"new",
"DPTXlatorString",
"(",
"DPTXlatorString",
".",
"DPT_STRING_8859_1",
")",
";",
"t",
".",
"setData",
"(",
"e",
".",
... | Returns the ASDU of the received process event as string datapoint value.
<p>
The used character set is ISO-8859-1 (Latin 1), with an allowed string length of 14
characters.
<p>
This method has to be invoked manually by the user (either in
{@link #groupReadResponse(ProcessEvent)} or
{@link ProcessListener#groupWrite(Pr... | [
"Returns",
"the",
"ASDU",
"of",
"the",
"received",
"process",
"event",
"as",
"string",
"datapoint",
"value",
".",
"<p",
">",
"The",
"used",
"character",
"set",
"is",
"ISO",
"-",
"8859",
"-",
"1",
"(",
"Latin",
"1",
")",
"with",
"an",
"allowed",
"string... | 4e9318eadbdeb945e529789f573b45386e619bed | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/process/ProcessListenerEx.java#L211-L216 | train | Converts a ProcessEvent to a String. | Of course, here is the Java code you requested:
```java
public String asString(ProcessEvent e) throws KNXFormatException
{
final DPTXlatorString t = new DPTXlatorString(DPTXlatorString.DPT_STRING_8859_1);
t.setData(e.getASDU());
return t.getValue();
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java | StatefulBeanO.uninstall | public final synchronized void uninstall() {
// To transition a Stateful bean to the "does not exist" state,
// either ejbRemove or ejbPassivate must be called.
// ejbPassivate has been chosen, as it will generally perform
// better (it normally does less) assuming that the bean is not
... | java | public final synchronized void uninstall() {
// To transition a Stateful bean to the "does not exist" state,
// either ejbRemove or ejbPassivate must be called.
// ejbPassivate has been chosen, as it will generally perform
// better (it normally does less) assuming that the bean is not
... | [
"public",
"final",
"synchronized",
"void",
"uninstall",
"(",
")",
"{",
"// To transition a Stateful bean to the \"does not exist\" state,",
"// either ejbRemove or ejbPassivate must be called.",
"// ejbPassivate has been chosen, as it will generally perform",
"// better (it normally does less)... | d112866 | [
"d112866"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java#L1321-L1344 | train | Uninstall the state of the stateful bean. | Of course, here is the Java code you requested:
```java
public final synchronized void uninstall() {
// To transition a Stateful bean to the "does not exist" state,
// either ejbRemove or ejbPassivate must be called.
// ejbPassivate has been chosen, as it will generally perform
// bette... |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.callGetter | public static SourceSnippet callGetter(final Key<?> key) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callGetter(key);
}
};
} | java | public static SourceSnippet callGetter(final Key<?> key) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callGetter(key);
}
};
} | [
"public",
"static",
"SourceSnippet",
"callGetter",
"(",
"final",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"return",
"new",
"SourceSnippet",
"(",
")",
"{",
"public",
"String",
"getSource",
"(",
"InjectorWriteContext",
"writeContext",
")",
"{",
"return",
"writeCon... | Creates a snippet that evaluates to an injected instance of the given key
in the current {@link GinjectorBindings}. | [
"Creates",
"a",
"snippet",
"that",
"evaluates",
"to",
"an",
"injected",
"instance",
"of",
"the",
"given",
"key",
"in",
"the",
"current",
"{"
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L47-L53 | train | Returns a snippet that gets the value of the given key. | Of course, here is the Java code you requested:
```java
public static SourceSnippet callGetter(final Key<?> key) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callGetter(key);
}
};
}
```
Hope this helps! |
codelibs/minhash | src/main/java/org/codelibs/minhash/MinHash.java | MinHash.newData | public static Data newData(final Analyzer analyzer, final String text,
final int numOfBits) {
return new Data(analyzer, text, numOfBits);
} | java | public static Data newData(final Analyzer analyzer, final String text,
final int numOfBits) {
return new Data(analyzer, text, numOfBits);
} | [
"public",
"static",
"Data",
"newData",
"(",
"final",
"Analyzer",
"analyzer",
",",
"final",
"String",
"text",
",",
"final",
"int",
"numOfBits",
")",
"{",
"return",
"new",
"Data",
"(",
"analyzer",
",",
"text",
",",
"numOfBits",
")",
";",
"}"
] | Create a target data which has analyzer, text and the number of bits.
@param analyzer
@param text
@param numOfBits
@return | [
"Create",
"a",
"target",
"data",
"which",
"has",
"analyzer",
"text",
"and",
"the",
"number",
"of",
"bits",
"."
] | 2aaa16e3096461c0f550d0eb462ae9e69d1b7749 | https://github.com/codelibs/minhash/blob/2aaa16e3096461c0f550d0eb462ae9e69d1b7749/src/main/java/org/codelibs/minhash/MinHash.java#L273-L276 | train | Create a new data object from an analyzer and a text. | Of course, here is the Java code you requested:
```java
public static Data newData(final Analyzer analyzer, final String text,
final int numOfBits) {
return new Data(analyzer, text, numOfBits);
}
```
Hope this helps! |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.getFromCache | public <T> void getFromCache(final Class<T> clazz, final Object requestCacheKey, final long cacheExpiryDuration, final RequestListener<T> requestListener) {
final SpiceRequest<T> request = new SpiceRequest<T>(clazz) {
@Override
public T loadDataFromNetwork() throws Exception {
... | java | public <T> void getFromCache(final Class<T> clazz, final Object requestCacheKey, final long cacheExpiryDuration, final RequestListener<T> requestListener) {
final SpiceRequest<T> request = new SpiceRequest<T>(clazz) {
@Override
public T loadDataFromNetwork() throws Exception {
... | [
"public",
"<",
"T",
">",
"void",
"getFromCache",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"requestCacheKey",
",",
"final",
"long",
"cacheExpiryDuration",
",",
"final",
"RequestListener",
"<",
"T",
">",
"requestListener",
")",
"{... | Get some data previously saved in cache with key <i>requestCacheKey</i>
with maximum time in cache : <i>cacheDuration</i> millisecond and
register listeners to notify when request is finished. This method
executes a SpiceRequest with no network processing. It just checks
whatever is in the cache and return it, includin... | [
"Get",
"some",
"data",
"previously",
"saved",
"in",
"cache",
"with",
"key",
"<i",
">",
"requestCacheKey<",
"/",
"i",
">",
"with",
"maximum",
"time",
"in",
"cache",
":",
"<i",
">",
"cacheDuration<",
"/",
"i",
">",
"millisecond",
"and",
"register",
"listener... | 8bffde88b3534a961a13cab72a8f07a755f0a0fe | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L381-L397 | train | Gets the object from cache. | Of course, here is the Java code you requested:
```java
public <T> void getFromCache(final Class<T> clazz, final Object requestCacheKey, final long cacheExpiryDuration, final RequestListener<T> requestListener) {
final SpiceRequest<T> request = new SpiceRequest<T>(clazz) {
@Override
pu... |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/Similarity.java | Similarity.spearmanRankCorrelationCoefficient | public static double spearmanRankCorrelationCoefficient(DoubleVector a,
DoubleVector b) {
// NOTE: should this code ever be on the critical path, we should
// re-implement it to operate on the Vector instances themselves
return spearma... | java | public static double spearmanRankCorrelationCoefficient(DoubleVector a,
DoubleVector b) {
// NOTE: should this code ever be on the critical path, we should
// re-implement it to operate on the Vector instances themselves
return spearma... | [
"public",
"static",
"double",
"spearmanRankCorrelationCoefficient",
"(",
"DoubleVector",
"a",
",",
"DoubleVector",
"b",
")",
"{",
"// NOTE: should this code ever be on the critical path, we should",
"// re-implement it to operate on the Vector instances themselves",
"return",
"spearman... | Computes the Spearman rank correlation coefficient for the two {@code
DoubleVector} instances.
<p> This implementation properly accounts for ties according to the
procedure specified in <i>Nonparametric Statistics for The Behavioral
Sciences</i> by Sidney Siegel and N. John Castellan Jr. Second
Ed. (1988).
@throws Il... | [
"Computes",
"the",
"Spearman",
"rank",
"correlation",
"coefficient",
"for",
"the",
"two",
"{",
"@code",
"DoubleVector",
"}",
"instances",
"."
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L1250-L1255 | train | Spearman rank correlation coefficient for two vectors. | Of course, here is the Java code you requested:
```java
public static double spearmanRankCorrelationCoefficient(DoubleVector a,
DoubleVector b) {
// NOTE: should this code ever be on the critical path, we should
// re-implement it to operate ... |
alkacon/opencms-core | src/org/opencms/search/CmsSearchParameters.java | CmsSearchParameters.setSearchIndex | public void setSearchIndex(CmsSearchIndex index) throws CmsIllegalArgumentException {
if (index == null) {
throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INDEX_NULL_0));
}
m_index = index;
} | java | public void setSearchIndex(CmsSearchIndex index) throws CmsIllegalArgumentException {
if (index == null) {
throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INDEX_NULL_0));
}
m_index = index;
} | [
"public",
"void",
"setSearchIndex",
"(",
"CmsSearchIndex",
"index",
")",
"throws",
"CmsIllegalArgumentException",
"{",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"throw",
"new",
"CmsIllegalArgumentException",
"(",
"Messages",
".",
"get",
"(",
")",
".",
"contain... | Sets the search index to use for the search. <p>
@param index the search index to use for the search to set.
@throws CmsIllegalArgumentException if null is given as argument | [
"Sets",
"the",
"search",
"index",
"to",
"use",
"for",
"the",
"search",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchParameters.java#L1040-L1046 | train | Sets the search index. | Of course, here is the Java code you requested:
```java
public void setSearchIndex(CmsSearchIndex index) throws CmsIllegalArgumentException {
if (index == null) {
throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INDEX_NULL_0));
}
m_index = index;
}
``... |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/S3OutputLocationMarshaller.java | S3OutputLocationMarshaller.marshall | public void marshall(S3OutputLocation s3OutputLocation, ProtocolMarshaller protocolMarshaller) {
if (s3OutputLocation == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3OutputLocation.getOutputS3Reg... | java | public void marshall(S3OutputLocation s3OutputLocation, ProtocolMarshaller protocolMarshaller) {
if (s3OutputLocation == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3OutputLocation.getOutputS3Reg... | [
"public",
"void",
"marshall",
"(",
"S3OutputLocation",
"s3OutputLocation",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"s3OutputLocation",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(.... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/S3OutputLocationMarshaller.java#L46-L59 | train | marshalls the given S3OutputLocation to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(S3OutputLocation s3OutputLocation, ProtocolMarshaller protocolMarshaller) {
if (s3OutputLocation == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... |
hypercube1024/firefly | firefly/src/main/java/com/firefly/client/http2/SimpleHTTPClient.java | SimpleHTTPClient.request | public RequestBuilder request(HttpMethod method, String url) {
return request(method.asString(), url);
} | java | public RequestBuilder request(HttpMethod method, String url) {
return request(method.asString(), url);
} | [
"public",
"RequestBuilder",
"request",
"(",
"HttpMethod",
"method",
",",
"String",
"url",
")",
"{",
"return",
"request",
"(",
"method",
".",
"asString",
"(",
")",
",",
"url",
")",
";",
"}"
] | Create a RequestBuilder with HTTP method and URL.
@param method HTTP method.
@param url The request URL.
@return A new RequestBuilder that helps you to build an HTTP request. | [
"Create",
"a",
"RequestBuilder",
"with",
"HTTP",
"method",
"and",
"URL",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/client/http2/SimpleHTTPClient.java#L845-L847 | train | Create a RequestBuilder for the given HTTP method and URL. | Of course, here is the Java code you requested:
```java
public RequestBuilder request(HttpMethod method, String url) {
return request(method.asString(), url);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java | WebAppSecurityCollaboratorImpl.toStringFormChangedPropertiesMap | private String toStringFormChangedPropertiesMap(Map<String, String> delta) {
if (delta == null || delta.isEmpty()) {
return "";
}
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, String> entry : delta.entrySet()) {
if (sb.length() > 0) {
... | java | private String toStringFormChangedPropertiesMap(Map<String, String> delta) {
if (delta == null || delta.isEmpty()) {
return "";
}
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, String> entry : delta.entrySet()) {
if (sb.length() > 0) {
... | [
"private",
"String",
"toStringFormChangedPropertiesMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"delta",
")",
"{",
"if",
"(",
"delta",
"==",
"null",
"||",
"delta",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuffer",
"s... | Format the map of config change attributes for the audit function. The output format would be the
same as original WebAppSecurityConfig.getChangedProperties method.
@return String in the format of "name=value, name=value, ..." encapsulating the
properties that are different between this WebAppSecurityConfig and the sp... | [
"Format",
"the",
"map",
"of",
"config",
"change",
"attributes",
"for",
"the",
"audit",
"function",
".",
"The",
"output",
"format",
"would",
"be",
"the",
"same",
"as",
"original",
"WebAppSecurityConfig",
".",
"getChangedProperties",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java#L1673-L1685 | train | toStringFormChangedPropertiesMap This method is used to get String form changed properties map. | Of course, here is the Java code you requested:
```java
private String toStringFormChangedPropertiesMap(Map<String, String> delta) {
if (delta == null || delta.isEmpty()) {
return "";
}
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, String> entry : delta.entryS... |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.onEachNode | public void onEachNode( Session session,
boolean includeSystemNodes,
NodeOperation operation ) throws Exception {
Node node = session.getRootNode();
operation.run(node);
NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
... | java | public void onEachNode( Session session,
boolean includeSystemNodes,
NodeOperation operation ) throws Exception {
Node node = session.getRootNode();
operation.run(node);
NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
... | [
"public",
"void",
"onEachNode",
"(",
"Session",
"session",
",",
"boolean",
"includeSystemNodes",
",",
"NodeOperation",
"operation",
")",
"throws",
"Exception",
"{",
"Node",
"node",
"=",
"session",
".",
"getRootNode",
"(",
")",
";",
"operation",
".",
"run",
"("... | Execute the supplied operation on each node in the workspace accessible by the supplied session.
@param session the session
@param includeSystemNodes true if all nodes under "/jcr:system" should be included, or false if the system nodes should be
excluded
@param operation the operation
@throws Exception the exception ... | [
"Execute",
"the",
"supplied",
"operation",
"on",
"each",
"node",
"in",
"the",
"workspace",
"accessible",
"by",
"the",
"supplied",
"session",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L865-L877 | train | OnEachNode Method. | Of course, here is the Java code you requested:
```java
public void onEachNode( Session session,
boolean includeSystemNodes,
NodeOperation operation ) throws Exception {
Node node = session.getRootNode();
operation.run(node);
NodeIterator ... |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_norm.java | Dcs_norm.cs_norm | public static double cs_norm(Dcs A) {
int p, j, n, Ap[];
double Ax[], norm = 0, s;
if (!Dcs_util.CS_CSC(A) || A.x == null)
return (-1); /* check inputs */
n = A.n;
Ap = A.p;
Ax = A.x;
for (j = 0; j < n; j++) {
for (s = 0, p = Ap[j]... | java | public static double cs_norm(Dcs A) {
int p, j, n, Ap[];
double Ax[], norm = 0, s;
if (!Dcs_util.CS_CSC(A) || A.x == null)
return (-1); /* check inputs */
n = A.n;
Ap = A.p;
Ax = A.x;
for (j = 0; j < n; j++) {
for (s = 0, p = Ap[j]... | [
"public",
"static",
"double",
"cs_norm",
"(",
"Dcs",
"A",
")",
"{",
"int",
"p",
",",
"j",
",",
"n",
",",
"Ap",
"[",
"]",
";",
"double",
"Ax",
"[",
"]",
",",
"norm",
"=",
"0",
",",
"s",
";",
"if",
"(",
"!",
"Dcs_util",
".",
"CS_CSC",
"(",
"A... | Computes the 1-norm of a sparse matrix = max (sum (abs (A))), largest
column sum.
@param A
column-compressed matrix
@return the 1-norm if successful, -1 on error | [
"Computes",
"the",
"1",
"-",
"norm",
"of",
"a",
"sparse",
"matrix",
"=",
"max",
"(",
"sum",
"(",
"abs",
"(",
"A",
")))",
"largest",
"column",
"sum",
"."
] | 6a6f66bccce1558156a961494358952603b0ac84 | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_norm.java#L45-L59 | train | Returns the norm of the C - S term. | Of course, here is the Java code you requested:
```java
public static double cs_norm(Dcs A) {
int p, j, n, Ap[];
double Ax[], norm = 0, s;
if (!Dcs_util.CS_CSC(A) || A.x == null)
return (-1); /* check inputs */
n = A.n;
Ap = A.p;
Ax = A.x;
for... |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javah/Gen.java | Gen.run | public void run() throws IOException, ClassNotFoundException, Util.Exit {
int i = 0;
if (outFile != null) {
/* Everything goes to one big file... */
ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
writeFileTop(bout); /* only once */
for (Typ... | java | public void run() throws IOException, ClassNotFoundException, Util.Exit {
int i = 0;
if (outFile != null) {
/* Everything goes to one big file... */
ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
writeFileTop(bout); /* only once */
for (Typ... | [
"public",
"void",
"run",
"(",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
",",
"Util",
".",
"Exit",
"{",
"int",
"i",
"=",
"0",
";",
"if",
"(",
"outFile",
"!=",
"null",
")",
"{",
"/* Everything goes to one big file... */",
"ByteArrayOutputStream"... | After initializing state of an instance, use this method to start
processing.
Buffer size chosen as an approximation from a single sampling of:
expr `du -sk` / `ls *.h | wc -l` | [
"After",
"initializing",
"state",
"of",
"an",
"instance",
"use",
"this",
"method",
"to",
"start",
"processing",
"."
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javah/Gen.java#L157-L178 | train | This method is called by the test class to run the test class. | Of course, here is the Java code you requested:
```java
public void run() throws IOException, ClassNotFoundException, Util.Exit {
int i = 0;
if (outFile != null) {
/* Everything goes to one big file... */
ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
... |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509TrustManager.java | MariaDbX509TrustManager.checkClientTrusted | @Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String string)
throws CertificateException {
if (trustManager == null) {
return;
}
trustManager.checkClientTrusted(x509Certificates, string);
} | java | @Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String string)
throws CertificateException {
if (trustManager == null) {
return;
}
trustManager.checkClientTrusted(x509Certificates, string);
} | [
"@",
"Override",
"public",
"void",
"checkClientTrusted",
"(",
"X509Certificate",
"[",
"]",
"x509Certificates",
",",
"String",
"string",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"trustManager",
"==",
"null",
")",
"{",
"return",
";",
"}",
"trustManag... | Check client trusted.
@param x509Certificates certificate
@param string string
@throws CertificateException exception | [
"Check",
"client",
"trusted",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509TrustManager.java#L203-L210 | train | Override checkClientTrusted to check client trusted certificate. | Of course, here is the Java code you requested:
```java
@Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String string)
throws CertificateException {
if (trustManager == null) {
return;
}
trustManager.checkClientTrusted(x509Certificates, string);
}
```
Hope this... |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Database.java | Database.invokeUpdateHandler | public String invokeUpdateHandler(String updateHandlerUri, String docId,
Params params) {
assertNotEmpty(params, "params");
return db.invokeUpdateHandler(updateHandlerUri, docId, params.getInternalParams());
} | java | public String invokeUpdateHandler(String updateHandlerUri, String docId,
Params params) {
assertNotEmpty(params, "params");
return db.invokeUpdateHandler(updateHandlerUri, docId, params.getInternalParams());
} | [
"public",
"String",
"invokeUpdateHandler",
"(",
"String",
"updateHandlerUri",
",",
"String",
"docId",
",",
"Params",
"params",
")",
"{",
"assertNotEmpty",
"(",
"params",
",",
"\"params\"",
")",
";",
"return",
"db",
".",
"invokeUpdateHandler",
"(",
"updateHandlerUr... | Invokes an Update Handler.
<P>Example usage:</P>
<pre>
{@code
final String newValue = "foo bar";
Params params = new Params()
.addParam("field", "title")
.addParam("value", newValue);
String output = db.invokeUpdateHandler("example/example_update", "exampleId", params);
}
</pre>
<pre>
Params params = new Params()
.add... | [
"Invokes",
"an",
"Update",
"Handler",
".",
"<P",
">",
"Example",
"usage",
":",
"<",
"/",
"P",
">",
"<pre",
">",
"{",
"@code",
"final",
"String",
"newValue",
"=",
"foo",
"bar",
";",
"Params",
"params",
"=",
"new",
"Params",
"()",
".",
"addParam",
"(",... | 42c438654945361bded2cc0827afc046d535b31b | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L1378-L1382 | train | Invoke an update handler. | Of course, here is the Java code you requested:
```java
public String invokeUpdateHandler(String updateHandlerUri, String docId,
Params params) {
assertNotEmpty(params, "params");
return db.invokeUpdateHandler(updateHandlerUri, docId, params.getInternalParams());
... |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/TaskGetHeaders.java | TaskGetHeaders.withLastModified | public TaskGetHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} | java | public TaskGetHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} | [
"public",
"TaskGetHeaders",
"withLastModified",
"(",
"DateTime",
"lastModified",
")",
"{",
"if",
"(",
"lastModified",
"==",
"null",
")",
"{",
"this",
".",
"lastModified",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"lastModified",
"=",
"new",
"DateTimeR... | Set the time at which the resource was last modified.
@param lastModified the lastModified value to set
@return the TaskGetHeaders object itself. | [
"Set",
"the",
"time",
"at",
"which",
"the",
"resource",
"was",
"last",
"modified",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/TaskGetHeaders.java#L135-L142 | train | Sets the value lastModified. | Of course, here is the Java code you requested:
```java
public TaskGetHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
}
```
... |
mongodb/mongo-java-driver | bson/src/main/org/bson/AbstractBsonReader.java | AbstractBsonReader.getNextState | protected State getNextState() {
switch (context.getContextType()) {
case ARRAY:
case DOCUMENT:
case SCOPE_DOCUMENT:
return State.TYPE;
case TOP_LEVEL:
return State.DONE;
default:
throw new BSONException(... | java | protected State getNextState() {
switch (context.getContextType()) {
case ARRAY:
case DOCUMENT:
case SCOPE_DOCUMENT:
return State.TYPE;
case TOP_LEVEL:
return State.DONE;
default:
throw new BSONException(... | [
"protected",
"State",
"getNextState",
"(",
")",
"{",
"switch",
"(",
"context",
".",
"getContextType",
"(",
")",
")",
"{",
"case",
"ARRAY",
":",
"case",
"DOCUMENT",
":",
"case",
"SCOPE_DOCUMENT",
":",
"return",
"State",
".",
"TYPE",
";",
"case",
"TOP_LEVEL"... | Returns the next {@code State} to transition to, based on the {@link org.bson.AbstractBsonReader.Context} of this reader.
@return the next state | [
"Returns",
"the",
"next",
"{",
"@code",
"State",
"}",
"to",
"transition",
"to",
"based",
"on",
"the",
"{",
"@link",
"org",
".",
"bson",
".",
"AbstractBsonReader",
".",
"Context",
"}",
"of",
"this",
"reader",
"."
] | a92d47e2e9f2fca55d09229a0a2e2cdc714db085 | https://github.com/mongodb/mongo-java-driver/blob/a92d47e2e9f2fca55d09229a0a2e2cdc714db085/bson/src/main/org/bson/AbstractBsonReader.java#L748-L759 | valid | Returns the next state for the context. | Of course, here is the Java code you requested:
```java
protected State getNextState() {
switch (context.getContextType()) {
case ARRAY:
case DOCUMENT:
case SCOPE_DOCUMENT:
return State.TYPE;
case TOP_LEVEL:
return State.DONE;
... |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/dbproperty/DBProperties.java | DBProperties.getValueFromDB | private static String getValueFromDB(final String _key,
final String _language)
{
String ret = null;
try {
boolean closeContext = false;
if (!Context.isThreadActive()) {
Context.begin();
closeContext = t... | java | private static String getValueFromDB(final String _key,
final String _language)
{
String ret = null;
try {
boolean closeContext = false;
if (!Context.isThreadActive()) {
Context.begin();
closeContext = t... | [
"private",
"static",
"String",
"getValueFromDB",
"(",
"final",
"String",
"_key",
",",
"final",
"String",
"_language",
")",
"{",
"String",
"ret",
"=",
"null",
";",
"try",
"{",
"boolean",
"closeContext",
"=",
"false",
";",
"if",
"(",
"!",
"Context",
".",
"... | This method is initializing the cache.
@param _key key to be read.
@param _language language to search for
@return value from the database, null if not found | [
"This",
"method",
"is",
"initializing",
"the",
"cache",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/dbproperty/DBProperties.java#L312-L361 | train | Method to get the value from the database. | Of course, here is the Java code you requested:
```java
private static String getValueFromDB(final String _key,
final String _language)
{
String ret = null;
try {
boolean closeContext = false;
if (!Context.isThreadActive()) {
... |
netty/netty | common/src/main/java/io/netty/util/ConstantPool.java | ConstantPool.valueOf | public T valueOf(Class<?> firstNameComponent, String secondNameComponent) {
if (firstNameComponent == null) {
throw new NullPointerException("firstNameComponent");
}
if (secondNameComponent == null) {
throw new NullPointerException("secondNameComponent");
}
... | java | public T valueOf(Class<?> firstNameComponent, String secondNameComponent) {
if (firstNameComponent == null) {
throw new NullPointerException("firstNameComponent");
}
if (secondNameComponent == null) {
throw new NullPointerException("secondNameComponent");
}
... | [
"public",
"T",
"valueOf",
"(",
"Class",
"<",
"?",
">",
"firstNameComponent",
",",
"String",
"secondNameComponent",
")",
"{",
"if",
"(",
"firstNameComponent",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"firstNameComponent\"",
")",
";",... | Shortcut of {@link #valueOf(String) valueOf(firstNameComponent.getName() + "#" + secondNameComponent)}. | [
"Shortcut",
"of",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ConstantPool.java#L39-L48 | train | Gets the value of the class with the given name. | Of course, here is the Java code you requested:
```java
public T valueOf(Class<?> firstNameComponent, String secondNameComponent) {
if (firstNameComponent == null) {
throw new NullPointerException("firstNameComponent");
}
if (secondNameComponent == null) {
throw new Null... |
OpenBEL/openbel-framework | org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/service/ResolverServiceImpl.java | ResolverServiceImpl.namespaces | private Map<String, String> namespaces(Kam kam) {
Map<String, String> nsmap = new HashMap<String, String>();
// find namespaces in resource index
List<NamespaceDescriptor> ns = nsrsvc.getAllNamespaceDescriptors();
for (NamespaceDescriptor n : ns) {
Namespace the_ns = n.getNa... | java | private Map<String, String> namespaces(Kam kam) {
Map<String, String> nsmap = new HashMap<String, String>();
// find namespaces in resource index
List<NamespaceDescriptor> ns = nsrsvc.getAllNamespaceDescriptors();
for (NamespaceDescriptor n : ns) {
Namespace the_ns = n.getNa... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"namespaces",
"(",
"Kam",
"kam",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"nsmap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"// find namespaces in resource in... | Assemble all known namespaces from the resource index and {@link Kam}.
@param kam
{@link Kam}
@return {@link Map} of namespace {@link String prefix} to {@link String
resource location} | [
"Assemble",
"all",
"known",
"namespaces",
"from",
"the",
"resource",
"index",
"and",
"{",
"@link",
"Kam",
"}",
"."
] | 149f80b1d6eabb15ab15815b6f745b0afa9fd2d3 | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/service/ResolverServiceImpl.java#L175-L192 | train | Get the namespaces map from KAM | Of course, here is the Java code you requested:
```java
private Map<String, String> namespaces(Kam kam) {
Map<String, String> nsmap = new HashMap<String, String>();
// find namespaces in resource index
List<NamespaceDescriptor> ns = nsrsvc.getAllNamespaceDescriptors();
for (NamespaceDe... |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java | DateTimesHelper.toDateTime | public DateTime toDateTime(T dateTime) {
try {
@SuppressWarnings("unchecked") // Expected class.
D dateObj = (D) PropertyUtils.getProperty(dateTime, "date");
String timeZoneId =
PropertyUtils.isReadable(dateTime, "timeZoneId")
? (String) PropertyUtils.getProperty(dateTime, ... | java | public DateTime toDateTime(T dateTime) {
try {
@SuppressWarnings("unchecked") // Expected class.
D dateObj = (D) PropertyUtils.getProperty(dateTime, "date");
String timeZoneId =
PropertyUtils.isReadable(dateTime, "timeZoneId")
? (String) PropertyUtils.getProperty(dateTime, ... | [
"public",
"DateTime",
"toDateTime",
"(",
"T",
"dateTime",
")",
"{",
"try",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// Expected class.",
"D",
"dateObj",
"=",
"(",
"D",
")",
"PropertyUtils",
".",
"getProperty",
"(",
"dateTime",
",",
"\"date\"",... | Converts an API date time to a {@code DateTime} preserving the time zone. | [
"Converts",
"an",
"API",
"date",
"time",
"to",
"a",
"{"
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java#L147-L171 | train | Converts a java. util. Date to a DateTime object. | Of course, here is the Java code you requested:
```java
public DateTime toDateTime(T dateTime) {
try {
@SuppressWarnings("unchecked") // Expected class.
D dateObj = (D) PropertyUtils.getProperty(dateTime, "date");
String timeZoneId =
PropertyUtils.isReadable(dateTime, "timeZoneId")
... |
opsbears/owc-dic | src/main/java/com/opsbears/webcomponents/dic/InjectorConfiguration.java | InjectorConfiguration.getScopedFactoryClass | @Nullable
public <T> Class<Provider<T>> getScopedFactoryClass(Class scope, Class<T> classDefinition) {
//noinspection unchecked
return (Class)factoryClasses.getScope(scope).get(classDefinition);
} | java | @Nullable
public <T> Class<Provider<T>> getScopedFactoryClass(Class scope, Class<T> classDefinition) {
//noinspection unchecked
return (Class)factoryClasses.getScope(scope).get(classDefinition);
} | [
"@",
"Nullable",
"public",
"<",
"T",
">",
"Class",
"<",
"Provider",
"<",
"T",
">",
">",
"getScopedFactoryClass",
"(",
"Class",
"scope",
",",
"Class",
"<",
"T",
">",
"classDefinition",
")",
"{",
"//noinspection unchecked",
"return",
"(",
"Class",
")",
"fact... | Returns a factory class to instantiate a certain class.
@param classDefinition the class that is to be instantiated.
@param <T> the type of the class to be instantiated.
@return a factory method for the specified class. | [
"Returns",
"a",
"factory",
"class",
"to",
"instantiate",
"a",
"certain",
"class",
"."
] | eb254ca993b26c299292a01598b358a31f323566 | https://github.com/opsbears/owc-dic/blob/eb254ca993b26c299292a01598b358a31f323566/src/main/java/com/opsbears/webcomponents/dic/InjectorConfiguration.java#L710-L714 | train | Gets the scoped factory class. | Of course, here is the Java code you requested:
```java
@Nullable
public <T> Class<Provider<T>> getScopedFactoryClass(Class scope, Class<T> classDefinition) {
//noinspection unchecked
return (Class)factoryClasses.getScope(scope).get(classDefinition);
}
```
Hope this helps! |
lawloretienne/ImageGallery | library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java | TouchImageView.fixTrans | private void fixTrans() {
matrix.getValues(m);
float transX = m[Matrix.MTRANS_X];
float transY = m[Matrix.MTRANS_Y];
float fixTransX = getFixTrans(transX, viewWidth, getImageWidth());
float fixTransY = getFixTrans(transY, viewHeight, getImageHeight());
if (fixTransX != ... | java | private void fixTrans() {
matrix.getValues(m);
float transX = m[Matrix.MTRANS_X];
float transY = m[Matrix.MTRANS_Y];
float fixTransX = getFixTrans(transX, viewWidth, getImageWidth());
float fixTransY = getFixTrans(transY, viewHeight, getImageHeight());
if (fixTransX != ... | [
"private",
"void",
"fixTrans",
"(",
")",
"{",
"matrix",
".",
"getValues",
"(",
"m",
")",
";",
"float",
"transX",
"=",
"m",
"[",
"Matrix",
".",
"MTRANS_X",
"]",
";",
"float",
"transY",
"=",
"m",
"[",
"Matrix",
".",
"MTRANS_Y",
"]",
";",
"float",
"fi... | Performs boundary checking and fixes the image matrix if it
is out of bounds. | [
"Performs",
"boundary",
"checking",
"and",
"fixes",
"the",
"image",
"matrix",
"if",
"it",
"is",
"out",
"of",
"bounds",
"."
] | 960d68dfb2b81d05322a576723ac4f090e10eda7 | https://github.com/lawloretienne/ImageGallery/blob/960d68dfb2b81d05322a576723ac4f090e10eda7/library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java#L461-L472 | train | Fix the translation of the image. | Of course, here is the Java code you requested:
```java
private void fixTrans() {
matrix.getValues(m);
float transX = m[Matrix.MTRANS_X];
float transY = m[Matrix.MTRANS_Y];
float fixTransX = getFixTrans(transX, viewWidth, getImageWidth());
float fixTransY = getFixTrans(transY, ... |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java | ErrorUnmarshallingHandler.exceptionCaught | @Override
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
if (!notifiedOnFailure) {
notifiedOnFailure = true;
try {
responseHandler.onFailure(new SdkClientException("Unable to execute HTTP request.", cause));
... | java | @Override
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
if (!notifiedOnFailure) {
notifiedOnFailure = true;
try {
responseHandler.onFailure(new SdkClientException("Unable to execute HTTP request.", cause));
... | [
"@",
"Override",
"public",
"void",
"exceptionCaught",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"notifiedOnFailure",
")",
"{",
"notifiedOnFailure",
"=",
"true",
";",
"try",
... | An exception was propagated from further up the pipeline (probably an IO exception of some sort). Notify the handler and
kill the connection. | [
"An",
"exception",
"was",
"propagated",
"from",
"further",
"up",
"the",
"pipeline",
"(",
"probably",
"an",
"IO",
"exception",
"of",
"some",
"sort",
")",
".",
"Notify",
"the",
"handler",
"and",
"kill",
"the",
"connection",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java#L142-L152 | train | Called when an exception occurs. | Of course, here is the Java code you requested:
```java
@Override
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
if (!notifiedOnFailure) {
notifiedOnFailure = true;
try {
responseHandler.onFailure(new SdkClientE... |
apache/incubator-druid | core/src/main/java/org/apache/druid/collections/ReferenceCountingResourceHolder.java | ReferenceCountingResourceHolder.close | @Override
public void close()
{
if (closed.compareAndSet(false, true)) {
decrement();
} else {
log.warn(new ISE("Already closed"), "Already closed");
}
} | java | @Override
public void close()
{
if (closed.compareAndSet(false, true)) {
decrement();
} else {
log.warn(new ISE("Already closed"), "Already closed");
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"closed",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"decrement",
"(",
")",
";",
"}",
"else",
"{",
"log",
".",
"warn",
"(",
"new",
"ISE",
"(",
"\"Already clo... | Decrements the reference count by 1. If it reaches to 0, then closes {@link #closer}. | [
"Decrements",
"the",
"reference",
"count",
"by",
"1",
".",
"If",
"it",
"reaches",
"to",
"0",
"then",
"closes",
"{"
] | f776b9408962b9006cfcfe4d6c1794751972cc8e | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/collections/ReferenceCountingResourceHolder.java#L119-L127 | train | Close the sequence. | Of course, here is the Java code you requested:
```java
@Override
public void close()
{
if (closed.compareAndSet(false, true)) {
decrement();
} else {
log.warn(new ISE("Already closed"), "Already closed");
}
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readLocks | public void readLocks() throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext();
try {
m_driverManager.readLocks(dbc);
} finally {
dbc.clear();
}
} | java | public void readLocks() throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext();
try {
m_driverManager.readLocks(dbc);
} finally {
dbc.clear();
}
} | [
"public",
"void",
"readLocks",
"(",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
")",
";",
"try",
"{",
"m_driverManager",
".",
"readLocks",
"(",
"dbc",
")",
";",
"}",
"finally",
"{",
"dbc",
... | Reads the locks that were saved to the database in the previous run of OpenCms.<p>
@throws CmsException if something goes wrong | [
"Reads",
"the",
"locks",
"that",
"were",
"saved",
"to",
"the",
"database",
"in",
"the",
"previous",
"run",
"of",
"OpenCms",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4538-L4546 | train | Reads all locks. | Of course, here is the Java code you requested:
```java
public void readLocks() throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext();
try {
m_driverManager.readLocks(dbc);
} finally {
dbc.clear();
}
}
```
Hope this helps! |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/message/SendQueueSession.java | SendQueueSession.sendMessage | public void sendMessage(Message message) throws RemoteException
{
Utility.getLogger().info("EJB sendMessage: " + message);
if (((BaseMessage)message).isProcessedByClient())
((BaseMessage)message).setProcessedByClientSession(this.getParentSession());
m_messageSender.sendMessage(me... | java | public void sendMessage(Message message) throws RemoteException
{
Utility.getLogger().info("EJB sendMessage: " + message);
if (((BaseMessage)message).isProcessedByClient())
((BaseMessage)message).setProcessedByClientSession(this.getParentSession());
m_messageSender.sendMessage(me... | [
"public",
"void",
"sendMessage",
"(",
"Message",
"message",
")",
"throws",
"RemoteException",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"EJB sendMessage: \"",
"+",
"message",
")",
";",
"if",
"(",
"(",
"(",
"BaseMessage",
")",
"message",... | Send this message to the message queue.
@param strCommand Command to perform remotely.
@return boolean success. | [
"Send",
"this",
"message",
"to",
"the",
"message",
"queue",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/message/SendQueueSession.java#L97-L103 | train | This method is called by the message sender to send the message to the EJB. | Of course, here is the Java code you requested:
```java
public void sendMessage(Message message) throws RemoteException
{
Utility.getLogger().info("EJB sendMessage: " + message);
if (((BaseMessage)message).isProcessedByClient())
((BaseMessage)message).setProcessedByClientSession(this.ge... |
cache2k/cache2k | cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java | Cache2kBuilder.expiryPolicy | public final Cache2kBuilder<K, V> expiryPolicy(ExpiryPolicy<K, V> c) {
config().setExpiryPolicy(wrapCustomizationInstance(c));
return this;
} | java | public final Cache2kBuilder<K, V> expiryPolicy(ExpiryPolicy<K, V> c) {
config().setExpiryPolicy(wrapCustomizationInstance(c));
return this;
} | [
"public",
"final",
"Cache2kBuilder",
"<",
"K",
",",
"V",
">",
"expiryPolicy",
"(",
"ExpiryPolicy",
"<",
"K",
",",
"V",
">",
"c",
")",
"{",
"config",
"(",
")",
".",
"setExpiryPolicy",
"(",
"wrapCustomizationInstance",
"(",
"c",
")",
")",
";",
"return",
... | Set expiry policy to use.
<p>If this is specified the maximum expiry time is still limited to the value in
{@link #expireAfterWrite}. If {@link #expireAfterWrite(long, java.util.concurrent.TimeUnit)}
is set to 0 then expiry calculation is not used, all entries expire immediately.
<p>If no maximum expiry is specified ... | [
"Set",
"expiry",
"policy",
"to",
"use",
"."
] | 3c9ccff12608c598c387ec50957089784cc4b618 | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L565-L568 | train | Sets the expiry policy. | Of course, here is the Java code you requested:
```java
public final Cache2kBuilder<K, V> expiryPolicy(ExpiryPolicy<K, V> c) {
config().setExpiryPolicy(wrapCustomizationInstance(c));
return this;
}
```
Hope this helps! |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonMatchers.java | JsonMatchers.jsonPartMatches | public static <T> Matcher<T> jsonPartMatches(String path, Matcher<?> matcher) {
return new MatcherApplyingMatcher<>(path, matcher);
} | java | public static <T> Matcher<T> jsonPartMatches(String path, Matcher<?> matcher) {
return new MatcherApplyingMatcher<>(path, matcher);
} | [
"public",
"static",
"<",
"T",
">",
"Matcher",
"<",
"T",
">",
"jsonPartMatches",
"(",
"String",
"path",
",",
"Matcher",
"<",
"?",
">",
"matcher",
")",
"{",
"return",
"new",
"MatcherApplyingMatcher",
"<>",
"(",
"path",
",",
"matcher",
")",
";",
"}"
] | Applies matcher to the part of the JSON. | [
"Applies",
"matcher",
"to",
"the",
"part",
"of",
"the",
"JSON",
"."
] | 2b12ed792e8dd787bddd6f3b8eb2325737435791 | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonMatchers.java#L70-L72 | train | Returns a matcher that matches the JSON part of the path. | Of course, here is the Java code you requested:
```java
public static <T> Matcher<T> jsonPartMatches(String path, Matcher<?> matcher) {
return new MatcherApplyingMatcher<>(path, matcher);
}
```
Hope this helps! |
overturetool/overture | core/ast/src/main/java/org/overture/ast/preview/GraphViz.java | GraphViz.get_img_stream | private byte[] get_img_stream(File dot, String type)
throws GraphVizException
{
File img;
byte[] img_stream = null;
try
{
img = File.createTempFile("graph_", "." + type);
Runtime rt = Runtime.getRuntime();
// patch by Mike Chenault
String[] args = { dotPath, "-T" + type, dot.getAbsolutePath(),
... | java | private byte[] get_img_stream(File dot, String type)
throws GraphVizException
{
File img;
byte[] img_stream = null;
try
{
img = File.createTempFile("graph_", "." + type);
Runtime rt = Runtime.getRuntime();
// patch by Mike Chenault
String[] args = { dotPath, "-T" + type, dot.getAbsolutePath(),
... | [
"private",
"byte",
"[",
"]",
"get_img_stream",
"(",
"File",
"dot",
",",
"String",
"type",
")",
"throws",
"GraphVizException",
"{",
"File",
"img",
";",
"byte",
"[",
"]",
"img_stream",
"=",
"null",
";",
"try",
"{",
"img",
"=",
"File",
".",
"createTempFile"... | It will call the external dot program, and return the image in binary format.
@param dot
Source of the graph (in dot language).
@param type
Type of the output image to be produced, e.g.: gif, dot, fig, pdf, ps, svg, png.
@return The image of the graph in .gif format.
@throws GraphVizException | [
"It",
"will",
"call",
"the",
"external",
"dot",
"program",
"and",
"return",
"the",
"image",
"in",
"binary",
"format",
"."
] | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/ast/src/main/java/org/overture/ast/preview/GraphViz.java#L212-L248 | train | Get the image stream from the dot file. | Of course, here is the Java code you requested:
```java
private byte[] get_img_stream(File dot, String type)
throws GraphVizException
{
File img;
byte[] img_stream = null;
try
{
img = File.createTempFile("graph_", "." + type);
Runtime rt = Runtime.getRuntime();
// patch by Mike Chenault
String... |
TakahikoKawasaki/nv-bluetooth | src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java | Bytes.toHexString | public static String toHexString(byte[] data, boolean upper)
{
if (data == null)
{
return null;
}
char[] table = (upper ? UPPER_HEX_CHARS : LOWER_HEX_CHARS);
char[] chars = new char[data.length * 2];
for (int i = 0; i < data.length; ++i)
{
... | java | public static String toHexString(byte[] data, boolean upper)
{
if (data == null)
{
return null;
}
char[] table = (upper ? UPPER_HEX_CHARS : LOWER_HEX_CHARS);
char[] chars = new char[data.length * 2];
for (int i = 0; i < data.length; ++i)
{
... | [
"public",
"static",
"String",
"toHexString",
"(",
"byte",
"[",
"]",
"data",
",",
"boolean",
"upper",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"char",
"[",
"]",
"table",
"=",
"(",
"upper",
"?",
"UPPER_HEX_CHARS"... | Convert a byte array to a hex string.
@param data
An input byte array.
@param upper
{@code true} to generate a upper-case hex string.
{@code false} to generate a lower-case hex string.
@return
A hex string. if {@code data} is {@code null},
{@code null} is returned. | [
"Convert",
"a",
"byte",
"array",
"to",
"a",
"hex",
"string",
"."
] | ef0099e941cd377571398615ea5e18cfc84cadd3 | https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java#L102-L119 | train | Get the hex string from a byte array. | Of course, here is the Java code you requested:
```java
public static String toHexString(byte[] data, boolean upper)
{
if (data == null)
{
return null;
}
char[] table = (upper ? UPPER_HEX_CHARS : LOWER_HEX_CHARS);
char[] chars = new char[data.length * 2];
... |
Waikato/moa | moa/src/main/java/weka/gui/MOAClassOptionEditor.java | MOAClassOptionEditor.closeDialog | protected void closeDialog() {
if (m_CustomEditor instanceof Container) {
Dialog dlg = PropertyDialog.getParentDialog((Container) m_CustomEditor);
if (dlg != null)
dlg.setVisible(false);
}
} | java | protected void closeDialog() {
if (m_CustomEditor instanceof Container) {
Dialog dlg = PropertyDialog.getParentDialog((Container) m_CustomEditor);
if (dlg != null)
dlg.setVisible(false);
}
} | [
"protected",
"void",
"closeDialog",
"(",
")",
"{",
"if",
"(",
"m_CustomEditor",
"instanceof",
"Container",
")",
"{",
"Dialog",
"dlg",
"=",
"PropertyDialog",
".",
"getParentDialog",
"(",
"(",
"Container",
")",
"m_CustomEditor",
")",
";",
"if",
"(",
"dlg",
"!=... | Closes the dialog. | [
"Closes",
"the",
"dialog",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/weka/gui/MOAClassOptionEditor.java#L65-L71 | train | Close the dialog. | Of course, here is the Java code you requested:
```java
protected void closeDialog() {
if (m_CustomEditor instanceof Container) {
Dialog dlg = PropertyDialog.getParentDialog((Container) m_CustomEditor);
if (dlg != null)
dlg.setVisible(false);
}
}
```
Hope this helps! |
Unidata/thredds | tds/src/main/java/thredds/server/config/HtmlConfigBean.java | HtmlConfigBean.prepareUrlStringForHtml | public String prepareUrlStringForHtml(String url) {
if (url == null)
return null;
URI uri;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Given a bad URL [" + url + "].", e);
}
if (uri.isAbsolute())
return uri.toString();
... | java | public String prepareUrlStringForHtml(String url) {
if (url == null)
return null;
URI uri;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Given a bad URL [" + url + "].", e);
}
if (uri.isAbsolute())
return uri.toString();
... | [
"public",
"String",
"prepareUrlStringForHtml",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"null",
";",
"URI",
"uri",
";",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"URISyntaxExc... | Return a URL ready to use in a generated HTML page from a URL that
is either absolute or relative to the webapp context path. That is,
if relative, it is relative to "http://server:port/thredds/".
<p/>
<p>For simplicity, all relative URLs are converted to URLs that are
absolute paths. For instance, "catalog.xml" become... | [
"Return",
"a",
"URL",
"ready",
"to",
"use",
"in",
"a",
"generated",
"HTML",
"page",
"from",
"a",
"URL",
"that",
"is",
"either",
"absolute",
"or",
"relative",
"to",
"the",
"webapp",
"context",
"path",
".",
"That",
"is",
"if",
"relative",
"it",
"is",
"re... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/config/HtmlConfigBean.java#L421-L435 | test | Prepare a URL string for HTML. | Of course, here is the Java code you requested:
```java
public String prepareUrlStringForHtml(String url) {
if (url == null)
return null;
URI uri;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Given a bad URL [" + url + "].", e);
}
... |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.trStyle | public static String trStyle(String style, String... content) {
return tagStyle(Html.Tag.TR, style, content);
} | java | public static String trStyle(String style, String... content) {
return tagStyle(Html.Tag.TR, style, content);
} | [
"public",
"static",
"String",
"trStyle",
"(",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagStyle",
"(",
"Html",
".",
"Tag",
".",
"TR",
",",
"style",
",",
"content",
")",
";",
"}"
] | Build a HTML TableRow with given CSS style attributes for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for tr element
@param content content string
@return HTML tr element as string | [
"Build",
"a",
"HTML",
"TableRow",
"with",
"given",
"CSS",
"style",
"attributes",
"for",
"a",
"string",
".",
"Given",
"content",
"does",
"<b",
">",
"not<",
"/",
"b",
">",
"consists",
"of",
"HTML",
"snippets",
"and",
"as",
"such",
"is",
"being",
"prepared"... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L153-L155 | train | Create a tr tag with the specified style and content. | Of course, here is the Java code you requested:
```java
public static String trStyle(String style, String... content) {
return tagStyle(Html.Tag.TR, style, content);
}
```
Hope this helps! |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/PathAndQuery.java | PathAndQuery.storeInCache | public void storeInCache(@Nullable String rawPath) {
if (CACHE != null && rawPath != null) {
CACHE.put(rawPath, this);
}
} | java | public void storeInCache(@Nullable String rawPath) {
if (CACHE != null && rawPath != null) {
CACHE.put(rawPath, this);
}
} | [
"public",
"void",
"storeInCache",
"(",
"@",
"Nullable",
"String",
"rawPath",
")",
"{",
"if",
"(",
"CACHE",
"!=",
"null",
"&&",
"rawPath",
"!=",
"null",
")",
"{",
"CACHE",
".",
"put",
"(",
"rawPath",
",",
"this",
")",
";",
"}",
"}"
] | Stores this {@link PathAndQuery} into cache for the given raw path. This should be used by callers when
the parsed result was valid (e.g., when a server is able to successfully handle the parsed path). | [
"Stores",
"this",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/PathAndQuery.java#L141-L145 | train | Stores the instance in cache. | Of course, here is the Java code you requested:
```java
public void storeInCache(@Nullable String rawPath) {
if (CACHE != null && rawPath != null) {
CACHE.put(rawPath, this);
}
}
```
Hope this helps! |
citrusframework/citrus | modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/FtpClient.java | FtpClient.deleteFile | protected FtpMessage deleteFile(DeleteCommand delete, TestContext context) {
String remoteFilePath = context.replaceDynamicContentInString(delete.getTarget().getPath());
try {
if (!StringUtils.hasText(remoteFilePath)) {
return null;
}
boolean success... | java | protected FtpMessage deleteFile(DeleteCommand delete, TestContext context) {
String remoteFilePath = context.replaceDynamicContentInString(delete.getTarget().getPath());
try {
if (!StringUtils.hasText(remoteFilePath)) {
return null;
}
boolean success... | [
"protected",
"FtpMessage",
"deleteFile",
"(",
"DeleteCommand",
"delete",
",",
"TestContext",
"context",
")",
"{",
"String",
"remoteFilePath",
"=",
"context",
".",
"replaceDynamicContentInString",
"(",
"delete",
".",
"getTarget",
"(",
")",
".",
"getPath",
"(",
")",... | Performs delete file operation.
@param delete
@param context | [
"Performs",
"delete",
"file",
"operation",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/FtpClient.java#L186-L235 | train | Delete file from FTP server. | Of course, here is the Java code you requested:
```java
protected FtpMessage deleteFile(DeleteCommand delete, TestContext context) {
String remoteFilePath = context.replaceDynamicContentInString(delete.getTarget().getPath());
try {
if (!StringUtils.hasText(remoteFilePath)) {
... |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/framework/Variable.java | Variable.getRecursivelyDependentVariables | public Variable[] getRecursivelyDependentVariables() {
ArrayList<Variable> depVars = new ArrayList<Variable>();
for (Variable depVar : this.getDependentVariables()) {
for (Variable depVar1 : depVar.getRecursivelyDependentVariables()) {
depVars.add(depVar1);
}
}
depVars.add(this);
return depV... | java | public Variable[] getRecursivelyDependentVariables() {
ArrayList<Variable> depVars = new ArrayList<Variable>();
for (Variable depVar : this.getDependentVariables()) {
for (Variable depVar1 : depVar.getRecursivelyDependentVariables()) {
depVars.add(depVar1);
}
}
depVars.add(this);
return depV... | [
"public",
"Variable",
"[",
"]",
"getRecursivelyDependentVariables",
"(",
")",
"{",
"ArrayList",
"<",
"Variable",
">",
"depVars",
"=",
"new",
"ArrayList",
"<",
"Variable",
">",
"(",
")",
";",
"for",
"(",
"Variable",
"depVar",
":",
"this",
".",
"getDependentVa... | Recursively get all variables that depend on this {@link Variable} or its dependents, plus this {@link Variable}.
@return All variables that depend on this {@link Variable} or its dependents, plus this {@link Variable}. | [
"Recursively",
"get",
"all",
"variables",
"that",
"depend",
"on",
"this",
"{"
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/framework/Variable.java#L135-L144 | train | Gets the list of all the dependent variables of this variable and all of its sub - variables. | Of course, here is the Java code you requested:
```java
public Variable[] getRecursivelyDependentVariables() {
ArrayList<Variable> depVars = new ArrayList<Variable>();
for (Variable depVar : this.getDependentVariables()) {
for (Variable depVar1 : depVar.getRecursivelyDependentVariables()) {
depVars.add(... |
ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/injection/impl/OntopMappingSQLConfigurationImpl.java | OntopMappingSQLConfigurationImpl.loadPPMapping | Optional<SQLPPMapping> loadPPMapping(Supplier<Optional<File>> mappingFileSupplier,
Supplier<Optional<Reader>> mappingReaderSupplier,
Supplier<Optional<Graph>> mappingGraphSupplier)
throws MappingIOException, InvalidMappingExce... | java | Optional<SQLPPMapping> loadPPMapping(Supplier<Optional<File>> mappingFileSupplier,
Supplier<Optional<Reader>> mappingReaderSupplier,
Supplier<Optional<Graph>> mappingGraphSupplier)
throws MappingIOException, InvalidMappingExce... | [
"Optional",
"<",
"SQLPPMapping",
">",
"loadPPMapping",
"(",
"Supplier",
"<",
"Optional",
"<",
"File",
">",
">",
"mappingFileSupplier",
",",
"Supplier",
"<",
"Optional",
"<",
"Reader",
">",
">",
"mappingReaderSupplier",
",",
"Supplier",
"<",
"Optional",
"<",
"G... | TODO: also consider the other steps | [
"TODO",
":",
"also",
"consider",
"the",
"other",
"steps"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/injection/impl/OntopMappingSQLConfigurationImpl.java#L104-L130 | train | Load the PDB mapping. | Of course, here is the Java code you requested:
```java
Optional<SQLPPMapping> loadPPMapping(Supplier<Optional<File>> mappingFileSupplier,
Supplier<Optional<Reader>> mappingReaderSupplier,
Supplier<Optional<Graph>> mappingGraphSupplier)
... |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotation | public Matrix4x3d rotation(Quaterniondc quat) {
double w2 = quat.w() * quat.w();
double x2 = quat.x() * quat.x();
double y2 = quat.y() * quat.y();
double z2 = quat.z() * quat.z();
double zw = quat.z() * quat.w(), dzw = zw + zw;
double xy = quat.x() * quat.y(), dxy = xy + ... | java | public Matrix4x3d rotation(Quaterniondc quat) {
double w2 = quat.w() * quat.w();
double x2 = quat.x() * quat.x();
double y2 = quat.y() * quat.y();
double z2 = quat.z() * quat.z();
double zw = quat.z() * quat.w(), dzw = zw + zw;
double xy = quat.x() * quat.y(), dxy = xy + ... | [
"public",
"Matrix4x3d",
"rotation",
"(",
"Quaterniondc",
"quat",
")",
"{",
"double",
"w2",
"=",
"quat",
".",
"w",
"(",
")",
"*",
"quat",
".",
"w",
"(",
")",
";",
"double",
"x2",
"=",
"quat",
".",
"x",
"(",
")",
"*",
"quat",
".",
"x",
"(",
")",
... | Set this matrix to the rotation - and possibly scaling - transformation of the given {@link Quaterniondc}.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin.
When u... | [
"Set",
"this",
"matrix",
"to",
"the",
"rotation",
"-",
"and",
"possibly",
"scaling",
"-",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaterniondc",
"}",
".",
"<p",
">",
"When",
"used",
"with",
"a",
"right",
"-",
"handed",
"coordinate",
"system"... | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L4728-L4753 | train | Sets the rotation of this matrix to the rotation of the quaternion. | Of course, here is the Java code you requested:
```java
public Matrix4x3d rotation(Quaterniondc quat) {
double w2 = quat.w() * quat.w();
double x2 = quat.x() * quat.x();
double y2 = quat.y() * quat.y();
double z2 = quat.z() * quat.z();
double zw = quat.z() * quat.w(), dzw = zw +... |
esmasui/AndroidJUnit4 | android-junit4/src/main/java/android/os/PerformanceCollector.java | PerformanceCollector.addIteration | public Bundle addIteration(String label) {
mCpuTime = Process.getElapsedCpuTime() - mCpuTime;
mExecTime = SystemClock.uptimeMillis() - mExecTime;
Bundle iteration = new Bundle();
iteration.putString(METRIC_KEY_LABEL, label);
iteration.putLong(METRIC_KEY_EXECUTION_TIME, mExecTime... | java | public Bundle addIteration(String label) {
mCpuTime = Process.getElapsedCpuTime() - mCpuTime;
mExecTime = SystemClock.uptimeMillis() - mExecTime;
Bundle iteration = new Bundle();
iteration.putString(METRIC_KEY_LABEL, label);
iteration.putLong(METRIC_KEY_EXECUTION_TIME, mExecTime... | [
"public",
"Bundle",
"addIteration",
"(",
"String",
"label",
")",
"{",
"mCpuTime",
"=",
"Process",
".",
"getElapsedCpuTime",
"(",
")",
"-",
"mCpuTime",
";",
"mExecTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"-",
"mExecTime",
";",
"Bundle",
"iter... | Add a measured segment, and start measuring the next segment. Returns
collected data in a Bundle object.
@param label description of code block between startTiming and
addIteration, and between two calls to addIteration, used
to label output
@return Runtime metrics stored as key/value pairs. Values are of type
long, a... | [
"Add",
"a",
"measured",
"segment",
"and",
"start",
"measuring",
"the",
"next",
"segment",
".",
"Returns",
"collected",
"data",
"in",
"a",
"Bundle",
"object",
"."
] | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/android/os/PerformanceCollector.java#L387-L400 | train | Add an iteration to the bundle. | Of course, here is the Java code you requested:
```java
public Bundle addIteration(String label) {
mCpuTime = Process.getElapsedCpuTime() - mCpuTime;
mExecTime = SystemClock.uptimeMillis() - mExecTime;
Bundle iteration = new Bundle();
iteration.putString(METRIC_KEY_LABEL, label);
... |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIData.java | UIData.encodeBegin | @Override
public void encodeBegin(FacesContext context) throws IOException
{
_initialDescendantComponentState = null;
if (_isValidChilds && !hasErrorMessages(context))
{
// Clear the data model so that when rendering code calls
// getDataModel a fresh model is fet... | java | @Override
public void encodeBegin(FacesContext context) throws IOException
{
_initialDescendantComponentState = null;
if (_isValidChilds && !hasErrorMessages(context))
{
// Clear the data model so that when rendering code calls
// getDataModel a fresh model is fet... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
")",
"throws",
"IOException",
"{",
"_initialDescendantComponentState",
"=",
"null",
";",
"if",
"(",
"_isValidChilds",
"&&",
"!",
"hasErrorMessages",
"(",
"context",
")",
")",
"{",
... | Perform necessary actions when rendering of this component starts, before delegating to the inherited
implementation which calls the associated renderer's encodeBegin method. | [
"Perform",
"necessary",
"actions",
"when",
"rendering",
"of",
"this",
"component",
"starts",
"before",
"delegating",
"to",
"the",
"inherited",
"implementation",
"which",
"calls",
"the",
"associated",
"renderer",
"s",
"encodeBegin",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIData.java#L1741-L1762 | train | Override encodeBegin to clear the data model and row state. | Of course, here is the Java code you requested:
```java
@Override
public void encodeBegin(FacesContext context) throws IOException
{
_initialDescendantComponentState = null;
if (_isValidChilds && !hasErrorMessages(context))
{
// Clear the data model so that when rendering co... |
kejunxia/AndroidMvc | library/android-mvc-core/src/main/java/com/shipdream/lib/android/mvc/Navigator.java | Navigator.back | public void back() {
NavLocation currentLoc = navigationManager.getModel().getCurrentLocation();
if (currentLoc == null) {
navigationManager.logger.warn("Current location should never be null before navigating backwards.");
return;
}
NavLocation previousLoc = cur... | java | public void back() {
NavLocation currentLoc = navigationManager.getModel().getCurrentLocation();
if (currentLoc == null) {
navigationManager.logger.warn("Current location should never be null before navigating backwards.");
return;
}
NavLocation previousLoc = cur... | [
"public",
"void",
"back",
"(",
")",
"{",
"NavLocation",
"currentLoc",
"=",
"navigationManager",
".",
"getModel",
"(",
")",
".",
"getCurrentLocation",
"(",
")",
";",
"if",
"(",
"currentLoc",
"==",
"null",
")",
"{",
"navigationManager",
".",
"logger",
".",
"... | <p>
Navigates one step back. However, if the previous location is an interim location, it keeps
seeking backward to the first non-interim navigation location. Interim locations are set when
forward navigate to them by
<pre>
navigationManager.navigate(this).to(SomeController.class, new Forwarder().setInterim(true));
</... | [
"<p",
">",
"Navigates",
"one",
"step",
"back",
".",
"However",
"if",
"the",
"previous",
"location",
"is",
"an",
"interim",
"location",
"it",
"keeps",
"seeking",
"backward",
"to",
"the",
"first",
"non",
"-",
"interim",
"navigation",
"location",
".",
"Interim"... | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/android-mvc-core/src/main/java/com/shipdream/lib/android/mvc/Navigator.java#L316-L338 | train | Navigates back to the current location. | Of course, here is the Java code you requested:
```java
public void back() {
NavLocation currentLoc = navigationManager.getModel().getCurrentLocation();
if (currentLoc == null) {
navigationManager.logger.warn("Current location should never be null before navigating backwards.");
... |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java | UserIndexer.postCommit | private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
index(dbSession, items);
} | java | private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
index(dbSession, items);
} | [
"private",
"void",
"postCommit",
"(",
"DbSession",
"dbSession",
",",
"Collection",
"<",
"String",
">",
"logins",
",",
"Collection",
"<",
"EsQueueDto",
">",
"items",
")",
"{",
"index",
"(",
"dbSession",
",",
"items",
")",
";",
"}"
] | Entry point for Byteman tests. See directory tests/resilience.
The parameter "logins" is used only by the Byteman script. | [
"Entry",
"point",
"for",
"Byteman",
"tests",
".",
"See",
"directory",
"tests",
"/",
"resilience",
".",
"The",
"parameter",
"logins",
"is",
"used",
"only",
"by",
"the",
"Byteman",
"script",
"."
] | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java#L99-L101 | train | Index the items in the database after commit. | Of course, here is the Java code you requested:
```java
private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
index(dbSession, items);
}
```
Hope this helps! |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/sax/ExcelSaxUtil.java | ExcelSaxUtil.getDateValue | private static DateTime getDateValue(String value) {
return DateUtil.date(org.apache.poi.ss.usermodel.DateUtil.getJavaDate(Double.parseDouble(value), false));
} | java | private static DateTime getDateValue(String value) {
return DateUtil.date(org.apache.poi.ss.usermodel.DateUtil.getJavaDate(Double.parseDouble(value), false));
} | [
"private",
"static",
"DateTime",
"getDateValue",
"(",
"String",
"value",
")",
"{",
"return",
"DateUtil",
".",
"date",
"(",
"org",
".",
"apache",
".",
"poi",
".",
"ss",
".",
"usermodel",
".",
"DateUtil",
".",
"getJavaDate",
"(",
"Double",
".",
"parseDouble"... | 获取日期
@param value 单元格值
@return 日期
@since 4.1.0 | [
"获取日期"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/ExcelSaxUtil.java#L128-L130 | train | Get the date value from a string. | Of course, here is the Java code you requested:
```java
private static DateTime getDateValue(String value) {
return DateUtil.date(org.apache.poi.ss.usermodel.DateUtil.getJavaDate(Double.parseDouble(value), false));
}
```
Hope this helps! |
robeio/robe | robe-hibernate/src/main/java/io/robe/hibernate/dao/BaseDao.java | BaseDao.queryAll | public Criteria<Map<String, Object>> queryAll(SearchModel search) {
Transformer<Map<String, Object>> transformer = new TransformerImpl<>(this.currentSession(), Criteria.MAP_CLASS);
Query<Map<String, Object>> query = new Query<>(transformer);
return query.createCriteria(this.getEntityClass(), sea... | java | public Criteria<Map<String, Object>> queryAll(SearchModel search) {
Transformer<Map<String, Object>> transformer = new TransformerImpl<>(this.currentSession(), Criteria.MAP_CLASS);
Query<Map<String, Object>> query = new Query<>(transformer);
return query.createCriteria(this.getEntityClass(), sea... | [
"public",
"Criteria",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"queryAll",
"(",
"SearchModel",
"search",
")",
"{",
"Transformer",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"transformer",
"=",
"new",
"TransformerImpl",
"<>",
"(",
"thi... | Returns modified list of the entities regarding to the search model.
{@inheritDoc}
@return List of entities. | [
"Returns",
"modified",
"list",
"of",
"the",
"entities",
"regarding",
"to",
"the",
"search",
"model",
".",
"{",
"@inheritDoc",
"}"
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-hibernate/src/main/java/io/robe/hibernate/dao/BaseDao.java#L60-L64 | test | Query all the entities in the database. | Of course, here is the Java code you requested:
```java
public Criteria<Map<String, Object>> queryAll(SearchModel search) {
Transformer<Map<String, Object>> transformer = new TransformerImpl<>(this.currentSession(), Criteria.MAP_CLASS);
Query<Map<String, Object>> query = new Query<>(transformer);
... |
aws/aws-sdk-java | aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java | AmazonRDSClient.describeDBInstanceAutomatedBackups | @Override
public DescribeDBInstanceAutomatedBackupsResult describeDBInstanceAutomatedBackups(DescribeDBInstanceAutomatedBackupsRequest request) {
request = beforeClientExecution(request);
return executeDescribeDBInstanceAutomatedBackups(request);
} | java | @Override
public DescribeDBInstanceAutomatedBackupsResult describeDBInstanceAutomatedBackups(DescribeDBInstanceAutomatedBackupsRequest request) {
request = beforeClientExecution(request);
return executeDescribeDBInstanceAutomatedBackups(request);
} | [
"@",
"Override",
"public",
"DescribeDBInstanceAutomatedBackupsResult",
"describeDBInstanceAutomatedBackups",
"(",
"DescribeDBInstanceAutomatedBackupsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeDBInsta... | <p>
Displays backups for both current and deleted instances. For example, use this operation to find details about
automated backups for previously deleted instances. Current instances with retention periods greater than zero
(0) are returned for both the <code>DescribeDBInstanceAutomatedBackups</code> and
<code>Descri... | [
"<p",
">",
"Displays",
"backups",
"for",
"both",
"current",
"and",
"deleted",
"instances",
".",
"For",
"example",
"use",
"this",
"operation",
"to",
"find",
"details",
"about",
"automated",
"backups",
"for",
"previously",
"deleted",
"instances",
".",
"Current",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java#L3803-L3807 | train | Retrieves the details of automated backups for an instance. | Of course, here is the Java code you requested:
```java
@Override
public DescribeDBInstanceAutomatedBackupsResult describeDBInstanceAutomatedBackups(DescribeDBInstanceAutomatedBackupsRequest request) {
request = beforeClientExecution(request);
return executeDescribeDBInstanceAutomatedBackups(reques... |
boonproject/boon | boon/src/main/java/org/boon/Maps.java | Maps.before | @Universal
public static <K, V> V before( NavigableMap<K, V> map, final K index ) {
return map.get( map.lowerKey( index ) );
} | java | @Universal
public static <K, V> V before( NavigableMap<K, V> map, final K index ) {
return map.get( map.lowerKey( index ) );
} | [
"@",
"Universal",
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"before",
"(",
"NavigableMap",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"index",
")",
"{",
"return",
"map",
".",
"get",
"(",
"map",
".",
"lowerKey",
"(",
"index",
")",
... | Grabs the value before this key from a tree map (Navigable map). | [
"Grabs",
"the",
"value",
"before",
"this",
"key",
"from",
"a",
"tree",
"map",
"(",
"Navigable",
"map",
")",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Maps.java#L255-L258 | test | Gets the value before the given key. | Of course, here is the Java code you requested:
```java
@Universal
public static <K, V> V before( NavigableMap<K, V> map, final K index ) {
return map.get( map.lowerKey( index ) );
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/file/types/CmsResourceTypeXmlContainerPage.java | CmsResourceTypeXmlContainerPage.getContainerPageTypeId | @SuppressWarnings("deprecation")
public static int getContainerPageTypeId() throws CmsLoaderException {
if (containerPageTypeId == 0) {
I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(getStaticTypeName());
if (resType != null) {
containerPage... | java | @SuppressWarnings("deprecation")
public static int getContainerPageTypeId() throws CmsLoaderException {
if (containerPageTypeId == 0) {
I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(getStaticTypeName());
if (resType != null) {
containerPage... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"int",
"getContainerPageTypeId",
"(",
")",
"throws",
"CmsLoaderException",
"{",
"if",
"(",
"containerPageTypeId",
"==",
"0",
")",
"{",
"I_CmsResourceType",
"resType",
"=",
"OpenCms",
".",
"g... | Returns the container-page type id.<p>
@return the container-page type id
@throws CmsLoaderException if the type is not configured | [
"Returns",
"the",
"container",
"-",
"page",
"type",
"id",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/types/CmsResourceTypeXmlContainerPage.java#L120-L130 | train | Gets the container page type id. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
public static int getContainerPageTypeId() throws CmsLoaderException {
if (containerPageTypeId == 0) {
I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(getStaticTypeName());
... |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java | KafkaMsgConsumer.consume | public KafkaMessage consume(String topic, long waitTime, TimeUnit waitTimeUnit) {
BlockingQueue<ConsumerRecord<String, byte[]>> buffer = _getBuffer(topic);
ConsumerRecord<String, byte[]> cr = buffer.poll();
if (cr == null) {
_fetch(buffer, topic, waitTime, waitTimeUnit);
... | java | public KafkaMessage consume(String topic, long waitTime, TimeUnit waitTimeUnit) {
BlockingQueue<ConsumerRecord<String, byte[]>> buffer = _getBuffer(topic);
ConsumerRecord<String, byte[]> cr = buffer.poll();
if (cr == null) {
_fetch(buffer, topic, waitTime, waitTimeUnit);
... | [
"public",
"KafkaMessage",
"consume",
"(",
"String",
"topic",
",",
"long",
"waitTime",
",",
"TimeUnit",
"waitTimeUnit",
")",
"{",
"BlockingQueue",
"<",
"ConsumerRecord",
"<",
"String",
",",
"byte",
"[",
"]",
">",
">",
"buffer",
"=",
"_getBuffer",
"(",
"topic"... | Consumes one message from a topic, wait up to specified wait-time.
@param topic
@param waitTime
@param waitTimeUnit
@return the consumed message or {@code null} if no message available | [
"Consumes",
"one",
"message",
"from",
"a",
"topic",
"wait",
"up",
"to",
"specified",
"wait",
"-",
"time",
"."
] | aaeb8536e28a109ac0b69022f0ea4bbf5696b76f | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L596-L604 | train | Consume a Kafka message from Kafka. | Of course, here is the Java code you requested:
```java
public KafkaMessage consume(String topic, long waitTime, TimeUnit waitTimeUnit) {
BlockingQueue<ConsumerRecord<String, byte[]>> buffer = _getBuffer(topic);
ConsumerRecord<String, byte[]> cr = buffer.poll();
if (cr == null) {
_f... |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/transform/DescribeAssessmentTemplatesRequestMarshaller.java | DescribeAssessmentTemplatesRequestMarshaller.marshall | public void marshall(DescribeAssessmentTemplatesRequest describeAssessmentTemplatesRequest, ProtocolMarshaller protocolMarshaller) {
if (describeAssessmentTemplatesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | java | public void marshall(DescribeAssessmentTemplatesRequest describeAssessmentTemplatesRequest, ProtocolMarshaller protocolMarshaller) {
if (describeAssessmentTemplatesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | [
"public",
"void",
"marshall",
"(",
"DescribeAssessmentTemplatesRequest",
"describeAssessmentTemplatesRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"describeAssessmentTemplatesRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientExcepti... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/transform/DescribeAssessmentTemplatesRequestMarshaller.java#L43-L54 | train | marshalls the given DescribeAssessmentTemplatesRequest to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(DescribeAssessmentTemplatesRequest describeAssessmentTemplatesRequest, ProtocolMarshaller protocolMarshaller) {
if (describeAssessmentTemplatesRequest == null) {
throw new SdkClientException("Invalid argument passed to ma... |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingRepositorySameConfigRestore.java | JobExistingRepositorySameConfigRestore.restoreRepository | @Override
protected void restoreRepository() throws RepositoryRestoreExeption
{
// list of data restorers
List<DataRestore> dataRestorer = new ArrayList<DataRestore>();
List<WorkspaceContainerFacade> workspacesWaits4Resume = new ArrayList<WorkspaceContainerFacade>();
try
{
... | java | @Override
protected void restoreRepository() throws RepositoryRestoreExeption
{
// list of data restorers
List<DataRestore> dataRestorer = new ArrayList<DataRestore>();
List<WorkspaceContainerFacade> workspacesWaits4Resume = new ArrayList<WorkspaceContainerFacade>();
try
{
... | [
"@",
"Override",
"protected",
"void",
"restoreRepository",
"(",
")",
"throws",
"RepositoryRestoreExeption",
"{",
"// list of data restorers\r",
"List",
"<",
"DataRestore",
">",
"dataRestorer",
"=",
"new",
"ArrayList",
"<",
"DataRestore",
">",
"(",
")",
";",
"List",
... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingRepositorySameConfigRestore.java#L88-L290 | train | Override the restoreRepository method to perform the actual restoration of the repository. | Of course, here is the Java code you requested:
```java
@Override
protected void restoreRepository() throws RepositoryRestoreExeption
{
// list of data restorers
List<DataRestore> dataRestorer = new ArrayList<DataRestore>();
List<WorkspaceContainerFacade> workspacesWaits4Resume = new Arr... |
lonnyj/liquibase-spatial | src/main/java/liquibase/ext/spatial/sqlgenerator/OracleSpatialUtils.java | OracleSpatialUtils.getOracleWkt | public static String getOracleWkt(final String wkt) {
final String oracleWkt;
// Strings longer than 4000 characters need to be converted to CLOBs.
if (wkt.length() > 4000) {
oracleWkt = "' || " + convertToClob(wkt) + " || '";
} else {
oracleWkt = wkt;
}
ret... | java | public static String getOracleWkt(final String wkt) {
final String oracleWkt;
// Strings longer than 4000 characters need to be converted to CLOBs.
if (wkt.length() > 4000) {
oracleWkt = "' || " + convertToClob(wkt) + " || '";
} else {
oracleWkt = wkt;
}
ret... | [
"public",
"static",
"String",
"getOracleWkt",
"(",
"final",
"String",
"wkt",
")",
"{",
"final",
"String",
"oracleWkt",
";",
"// Strings longer than 4000 characters need to be converted to CLOBs.\r",
"if",
"(",
"wkt",
".",
"length",
"(",
")",
">",
"4000",
")",
"{",
... | Converts the given Well-Known Text string to one that will work in Oracle. If the string is
greater than 4000 characters, the string is broken into pieces where each piece is converted
to a CLOB. The CLOB handling assumes that the result will be wrapped in single quotes so it
wraps the result in "<code>' || TO_CLOB(...... | [
"Converts",
"the",
"given",
"Well",
"-",
"Known",
"Text",
"string",
"to",
"one",
"that",
"will",
"work",
"in",
"Oracle",
".",
"If",
"the",
"string",
"is",
"greater",
"than",
"4000",
"characters",
"the",
"string",
"is",
"broken",
"into",
"pieces",
"where",
... | 36ae41b0d3d08bb00a22c856e51ffeed08891c0e | https://github.com/lonnyj/liquibase-spatial/blob/36ae41b0d3d08bb00a22c856e51ffeed08891c0e/src/main/java/liquibase/ext/spatial/sqlgenerator/OracleSpatialUtils.java#L42-L51 | train | Get the Oracle WKT string from a WKT string. | Of course, here is the Java code you requested:
```java
public static String getOracleWkt(final String wkt) {
final String oracleWkt;
// Strings longer than 4000 characters need to be converted to CLOBs.
if (wkt.length() > 4000) {
oracleWkt = "' || " + convertToClob(wkt) + " || '";
... |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeDefinitionImpl.java | NodeDefinitionImpl.getDefaultPrimaryType | public NodeType getDefaultPrimaryType()
{
if (nodeDefinitionData.getDefaultPrimaryType() == null)
return null;
return new NodeTypeImpl(nodeTypeDataManager.getNodeType(nodeDefinitionData.getDefaultPrimaryType()),
nodeTypeDataManager, nodeTypeManager, locationFactory, valueFactory, dataMa... | java | public NodeType getDefaultPrimaryType()
{
if (nodeDefinitionData.getDefaultPrimaryType() == null)
return null;
return new NodeTypeImpl(nodeTypeDataManager.getNodeType(nodeDefinitionData.getDefaultPrimaryType()),
nodeTypeDataManager, nodeTypeManager, locationFactory, valueFactory, dataMa... | [
"public",
"NodeType",
"getDefaultPrimaryType",
"(",
")",
"{",
"if",
"(",
"nodeDefinitionData",
".",
"getDefaultPrimaryType",
"(",
")",
"==",
"null",
")",
"return",
"null",
";",
"return",
"new",
"NodeTypeImpl",
"(",
"nodeTypeDataManager",
".",
"getNodeType",
"(",
... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeDefinitionImpl.java#L84-L90 | train | Get the default primary type. | Of course, here is the Java code you requested:
```java
public NodeType getDefaultPrimaryType()
{
if (nodeDefinitionData.getDefaultPrimaryType() == null)
return null;
return new NodeTypeImpl(nodeTypeDataManager.getNodeType(nodeDefinitionData.getDefaultPrimaryType()),
nodeTypeDataManage... |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoApi/DatabaseDAODefaultImpl.java | DatabaseDAODefaultImpl.getAliasFromDevice | public String getAliasFromDevice(Database database, String deviceName) throws DevFailed {
DeviceData argIn = new DeviceData();
argIn.insert(deviceName);
DeviceData argOut = command_inout(database, "DbGetDeviceAlias", argIn);
return argOut.extractString();
} | java | public String getAliasFromDevice(Database database, String deviceName) throws DevFailed {
DeviceData argIn = new DeviceData();
argIn.insert(deviceName);
DeviceData argOut = command_inout(database, "DbGetDeviceAlias", argIn);
return argOut.extractString();
} | [
"public",
"String",
"getAliasFromDevice",
"(",
"Database",
"database",
",",
"String",
"deviceName",
")",
"throws",
"DevFailed",
"{",
"DeviceData",
"argIn",
"=",
"new",
"DeviceData",
"(",
")",
";",
"argIn",
".",
"insert",
"(",
"deviceName",
")",
";",
"DeviceDat... | ========================================================================== | [
"=========================================================================="
] | 1ccc9dcb83e6de2359a9f1906d170571cacf1345 | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/DatabaseDAODefaultImpl.java#L1702-L1707 | train | Get alias from device | Of course, here is the Java code you requested:
```java
public String getAliasFromDevice(Database database, String deviceName) throws DevFailed {
DeviceData argIn = new DeviceData();
argIn.insert(deviceName);
DeviceData argOut = command_inout(database, "DbGetDeviceAlias", argIn);
return... |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/BehaviorTagHandlerDelegate.java | BehaviorTagHandlerDelegate.applyAttachedObject | public void applyAttachedObject(FacesContext context, UIComponent parent)
{
// Retrieve the current FaceletContext from FacesContext object
FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
FaceletContext.FACELET_CONTEXT_KEY);
ValueExpress... | java | public void applyAttachedObject(FacesContext context, UIComponent parent)
{
// Retrieve the current FaceletContext from FacesContext object
FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
FaceletContext.FACELET_CONTEXT_KEY);
ValueExpress... | [
"public",
"void",
"applyAttachedObject",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"parent",
")",
"{",
"// Retrieve the current FaceletContext from FacesContext object",
"FaceletContext",
"faceletContext",
"=",
"(",
"FaceletContext",
")",
"context",
".",
"getAttribu... | Create a ClientBehavior and attach it to the component | [
"Create",
"a",
"ClientBehavior",
"and",
"attach",
"it",
"to",
"the",
"component"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/BehaviorTagHandlerDelegate.java#L122-L182 | train | This method is called by the UIComponent when an attached component is attached to a UIComponent. | Of course, here is the Java code you requested:
```java
public void applyAttachedObject(FacesContext context, UIComponent parent)
{
// Retrieve the current FaceletContext from FacesContext object
FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
FaceletCo... |
gresrun/jesque | src/main/java/net/greghaines/jesque/meta/dao/impl/WorkerInfoDAORedisImpl.java | WorkerInfoDAORedisImpl.getWorker | @Override
public WorkerInfo getWorker(final String workerName) {
return PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, WorkerInfo>() {
/**
* {@inheritDoc}
*/
@Override
public WorkerInfo doWork(final Jedis jedis) throws Exception... | java | @Override
public WorkerInfo getWorker(final String workerName) {
return PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, WorkerInfo>() {
/**
* {@inheritDoc}
*/
@Override
public WorkerInfo doWork(final Jedis jedis) throws Exception... | [
"@",
"Override",
"public",
"WorkerInfo",
"getWorker",
"(",
"final",
"String",
"workerName",
")",
"{",
"return",
"PoolUtils",
".",
"doWorkInPoolNicely",
"(",
"this",
".",
"jedisPool",
",",
"new",
"PoolWork",
"<",
"Jedis",
",",
"WorkerInfo",
">",
"(",
")",
"{"... | {@inheritDoc} | [
"{"
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/meta/dao/impl/WorkerInfoDAORedisImpl.java#L186-L201 | train | Get a worker by name. | Of course, here is the Java code you requested:
```java
@Override
public WorkerInfo getWorker(final String workerName) {
return PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, WorkerInfo>() {
/**
* {@inheritDoc}
*/
@Override
pub... |
jboss/jboss-common-core | src/main/java/org/jboss/util/property/PropertyMap.java | PropertyMap.put | public Object put(Object name, Object value)
{
if (name == null)
throw new NullArgumentException("name");
// value can be null
// check if this is a new addition or not prior to updating the hash
boolean add = !containsKey(name);
Object prev = super.put(name, value);
Pr... | java | public Object put(Object name, Object value)
{
if (name == null)
throw new NullArgumentException("name");
// value can be null
// check if this is a new addition or not prior to updating the hash
boolean add = !containsKey(name);
Object prev = super.put(name, value);
Pr... | [
"public",
"Object",
"put",
"(",
"Object",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"throw",
"new",
"NullArgumentException",
"(",
"\"name\"",
")",
";",
"// value can be null",
"// check if this is a new addition or not prior to ... | Set a property.
@param name Property name.
@param value Property value.
@return Previous property value or null. | [
"Set",
"a",
"property",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/PropertyMap.java#L171-L195 | test | Override put to add or remove a value to the hash table. | Of course, here is the Java code you requested:
```java
public Object put(Object name, Object value)
{
if (name == null)
throw new NullArgumentException("name");
// value can be null
// check if this is a new addition or not prior to updating the hash
boolean add = !containsKey(nam... |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNegativeObjectPropertyAssertionAxiomImpl_CustomFieldSerializer.java | OWLNegativeObjectPropertyAssertionAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLNegativeObjectPropertyAssertionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLNegativeObjectPropertyAssertionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLNegativeObjectPropertyAssertionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | 7ab975fb6cef3c8947099983551672a3b5d4e2fd | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNegativeObjectPropertyAssertionAxiomImpl_CustomFieldSerializer.java#L100-L103 | train | Deserialize an instance of the OWLNegativeObjectPropertyAssertionAxiomImpl. | Of course, here is the Java code you requested:
```java
@Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLNegativeObjectPropertyAssertionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
}
```
Hope this helps! |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorDeviceConfiguration.java | TerminalEmulatorDeviceConfiguration.withBlinkLengthInMilliSeconds | public TerminalEmulatorDeviceConfiguration withBlinkLengthInMilliSeconds(int blinkLengthInMilliSeconds) {
if (this.blinkLengthInMilliSeconds == blinkLengthInMilliSeconds) {
return this;
} else {
return new TerminalEmulatorDeviceConfiguration(
this.lineBufferSc... | java | public TerminalEmulatorDeviceConfiguration withBlinkLengthInMilliSeconds(int blinkLengthInMilliSeconds) {
if (this.blinkLengthInMilliSeconds == blinkLengthInMilliSeconds) {
return this;
} else {
return new TerminalEmulatorDeviceConfiguration(
this.lineBufferSc... | [
"public",
"TerminalEmulatorDeviceConfiguration",
"withBlinkLengthInMilliSeconds",
"(",
"int",
"blinkLengthInMilliSeconds",
")",
"{",
"if",
"(",
"this",
".",
"blinkLengthInMilliSeconds",
"==",
"blinkLengthInMilliSeconds",
")",
"{",
"return",
"this",
";",
"}",
"else",
"{",
... | Copies the current configuration. The new object has the given value.
@param blinkLengthInMilliSeconds How many milliseconds does a 'blink' last
@return A copy of the current configuration with the changed value. | [
"Copies",
"the",
"current",
"configuration",
".",
"The",
"new",
"object",
"has",
"the",
"given",
"value",
"."
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorDeviceConfiguration.java#L151-L163 | train | Sets the blinkLengthInMilliSeconds property. | Of course, here is the Java code you requested:
```java
public TerminalEmulatorDeviceConfiguration withBlinkLengthInMilliSeconds(int blinkLengthInMilliSeconds) {
if (this.blinkLengthInMilliSeconds == blinkLengthInMilliSeconds) {
return this;
} else {
return new TerminalEmulatorD... |
andriusvelykis/reflow-maven-skin | reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java | HtmlTool.slug | public static String slug(String input, String separator) {
String slug = adaptSlug(input, separator);
return slug.toLowerCase(Locale.ENGLISH);
} | java | public static String slug(String input, String separator) {
String slug = adaptSlug(input, separator);
return slug.toLowerCase(Locale.ENGLISH);
} | [
"public",
"static",
"String",
"slug",
"(",
"String",
"input",
",",
"String",
"separator",
")",
"{",
"String",
"slug",
"=",
"adaptSlug",
"(",
"input",
",",
"separator",
")",
";",
"return",
"slug",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
")",
";... | Creates a slug (latin text with no whitespace or other symbols) for a longer text (i.e. to
use in URLs).
@param input
text to generate the slug from
@param separator
separator for whitespace replacement
@return the slug of the given text that contains alphanumeric symbols and separator only
@since 1.0
@see <a href="ht... | [
"Creates",
"a",
"slug",
"(",
"latin",
"text",
"with",
"no",
"whitespace",
"or",
"other",
"symbols",
")",
"for",
"a",
"longer",
"text",
"(",
"i",
".",
"e",
".",
"to",
"use",
"in",
"URLs",
")",
"."
] | 01170ae1426a1adfe7cc9c199e77aaa2ecb37ef2 | https://github.com/andriusvelykis/reflow-maven-skin/blob/01170ae1426a1adfe7cc9c199e77aaa2ecb37ef2/reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java#L1132-L1135 | train | Converts a String to a slug. | Of course, here is the Java code you requested:
```java
public static String slug(String input, String separator) {
String slug = adaptSlug(input, separator);
return slug.toLowerCase(Locale.ENGLISH);
}
```
Hope this helps! |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.logException | public static void logException( Logger logger, Level logLevel, Throwable t ) {
logException( logger, logLevel, t, null );
} | java | public static void logException( Logger logger, Level logLevel, Throwable t ) {
logException( logger, logLevel, t, null );
} | [
"public",
"static",
"void",
"logException",
"(",
"Logger",
"logger",
",",
"Level",
"logLevel",
",",
"Throwable",
"t",
")",
"{",
"logException",
"(",
"logger",
",",
"logLevel",
",",
"t",
",",
"null",
")",
";",
"}"
] | Logs an exception with the given logger and the given level.
<p>
Writing a stack trace may be time-consuming in some environments.
To prevent useless computing, this method checks the current log level
before trying to log anything.
</p>
@param logger the logger
@param t an exception or a throwable
@param logLevel the... | [
"Logs",
"an",
"exception",
"with",
"the",
"given",
"logger",
"and",
"the",
"given",
"level",
".",
"<p",
">",
"Writing",
"a",
"stack",
"trace",
"may",
"be",
"time",
"-",
"consuming",
"in",
"some",
"environments",
".",
"To",
"prevent",
"useless",
"computing"... | add54eead479effb138d0ff53a2d637902b82702 | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L1126-L1128 | train | Log an exception with the specified log level. | Of course, here is the Java code you requested:
```java
public static void logException( Logger logger, Level logLevel, Throwable t ) {
logException( logger, logLevel, t, null );
}
```
Hope this helps! |
stevespringett/Alpine | alpine/src/main/java/alpine/event/framework/BaseEventService.java | BaseEventService.unsubscribe | public void unsubscribe(Class<? extends Subscriber> subscriberType) {
for (ArrayList<Class<? extends Subscriber>> list : subscriptionMap.values()) {
list.remove(subscriberType);
}
} | java | public void unsubscribe(Class<? extends Subscriber> subscriberType) {
for (ArrayList<Class<? extends Subscriber>> list : subscriptionMap.values()) {
list.remove(subscriberType);
}
} | [
"public",
"void",
"unsubscribe",
"(",
"Class",
"<",
"?",
"extends",
"Subscriber",
">",
"subscriberType",
")",
"{",
"for",
"(",
"ArrayList",
"<",
"Class",
"<",
"?",
"extends",
"Subscriber",
">",
">",
"list",
":",
"subscriptionMap",
".",
"values",
"(",
")",
... | {@inheritDoc}
@since 1.0.0 | [
"{"
] | 6c5ef5e1ba4f38922096f1307d3950c09edb3093 | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/event/framework/BaseEventService.java#L193-L197 | train | Unsubscribe a subscriber type | Of course, here is the Java code you requested:
```java
public void unsubscribe(Class<? extends Subscriber> subscriberType) {
for (ArrayList<Class<? extends Subscriber>> list : subscriptionMap.values()) {
list.remove(subscriberType);
}
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/CreatePlatformEndpointRequest.java | CreatePlatformEndpointRequest.withAttributes | public CreatePlatformEndpointRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | java | public CreatePlatformEndpointRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"CreatePlatformEndpointRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html">SetEndpointAttributes</a>.
</p>
@param attributes
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html"
>SetEndpointAttributes</a>.
@return R... | [
"<p",
">",
"For",
"a",
"list",
"of",
"attributes",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"sns",
"/",
"latest",
"/",
"api",
"/",
"API_SetEndpointAttributes",
".",
"html",
">",
"SetEndpointAttri... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/CreatePlatformEndpointRequest.java#L252-L255 | train | Sets the attributes for the application. | Of course, here is the Java code you requested:
```java
public CreatePlatformEndpointRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
}
```
Hope this helps! |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/TemplateBuilder.java | TemplateBuilder.parameter | public TemplateBuilder parameter(String name, String value) {
action.getParameter().put(name, value);
return this;
} | java | public TemplateBuilder parameter(String name, String value) {
action.getParameter().put(name, value);
return this;
} | [
"public",
"TemplateBuilder",
"parameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"action",
".",
"getParameter",
"(",
")",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Set parameter before execution.
@param name
@param value | [
"Set",
"parameter",
"before",
"execution",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/TemplateBuilder.java#L97-L100 | train | Add a parameter to the template. | Of course, here is the Java code you requested:
```java
public TemplateBuilder parameter(String name, String value) {
action.getParameter().put(name, value);
return this;
}
```
Hope this helps! |
apache/incubator-heron | heron/schedulers/src/java/org/apache/heron/scheduler/yarn/HeronMasterDriver.java | HeronMasterDriver.findLargestFittingWorker | @VisibleForTesting
Optional<HeronWorker> findLargestFittingWorker(AllocatedEvaluator evaluator,
Collection<HeronWorker> pendingWorkers,
boolean ignoreCpu) {
ByteAmount allocatedRam
= ByteAmount.fromMegabytes(... | java | @VisibleForTesting
Optional<HeronWorker> findLargestFittingWorker(AllocatedEvaluator evaluator,
Collection<HeronWorker> pendingWorkers,
boolean ignoreCpu) {
ByteAmount allocatedRam
= ByteAmount.fromMegabytes(... | [
"@",
"VisibleForTesting",
"Optional",
"<",
"HeronWorker",
">",
"findLargestFittingWorker",
"(",
"AllocatedEvaluator",
"evaluator",
",",
"Collection",
"<",
"HeronWorker",
">",
"pendingWorkers",
",",
"boolean",
"ignoreCpu",
")",
"{",
"ByteAmount",
"allocatedRam",
"=",
"... | YARN allocates resources in fixed increments of memory and CPU. As a result, the actual
resource allocation may be little more than what was requested. This method finds the biggest
heron containerPlan that will fit the allocated YARN container. In some cases the YARN CPU
scheduling may be disabled, resulting in defaul... | [
"YARN",
"allocates",
"resources",
"in",
"fixed",
"increments",
"of",
"memory",
"and",
"CPU",
".",
"As",
"a",
"result",
"the",
"actual",
"resource",
"allocation",
"may",
"be",
"little",
"more",
"than",
"what",
"was",
"requested",
".",
"This",
"method",
"finds... | 776abe2b5a45b93a0eb957fd65cbc149d901a92a | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/schedulers/src/java/org/apache/heron/scheduler/yarn/HeronMasterDriver.java#L218-L248 | train | Find the largest fitting worker in the given collection of workers. | Of course, here is the Java code you requested:
```java
@VisibleForTesting
Optional<HeronWorker> findLargestFittingWorker(AllocatedEvaluator evaluator,
Collection<HeronWorker> pendingWorkers,
boolean ignoreCpu) {
By... |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java | DataWriterBuilder.writeTo | public DataWriterBuilder<S, D> writeTo(Destination destination) {
this.destination = destination;
log.debug("For destination: {}", destination);
return this;
} | java | public DataWriterBuilder<S, D> writeTo(Destination destination) {
this.destination = destination;
log.debug("For destination: {}", destination);
return this;
} | [
"public",
"DataWriterBuilder",
"<",
"S",
",",
"D",
">",
"writeTo",
"(",
"Destination",
"destination",
")",
"{",
"this",
".",
"destination",
"=",
"destination",
";",
"log",
".",
"debug",
"(",
"\"For destination: {}\"",
",",
"destination",
")",
";",
"return",
... | Tell the writer the destination to write to.
@param destination destination to write to
@return this {@link DataWriterBuilder} instance | [
"Tell",
"the",
"writer",
"the",
"destination",
"to",
"write",
"to",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java#L57-L61 | train | Write to the destination. | Of course, here is the Java code you requested:
```java
public DataWriterBuilder<S, D> writeTo(Destination destination) {
this.destination = destination;
log.debug("For destination: {}", destination);
return this;
}
```
Hope this helps! |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/FileListUtils.java | FileListUtils.listFilesToCopyAtPath | public static List<FileStatus> listFilesToCopyAtPath(FileSystem fs, Path path, PathFilter fileFilter,
boolean includeEmptyDirectories) throws IOException {
return listFilesToCopyAtPath(fs, path, fileFilter, false, includeEmptyDirectories);
} | java | public static List<FileStatus> listFilesToCopyAtPath(FileSystem fs, Path path, PathFilter fileFilter,
boolean includeEmptyDirectories) throws IOException {
return listFilesToCopyAtPath(fs, path, fileFilter, false, includeEmptyDirectories);
} | [
"public",
"static",
"List",
"<",
"FileStatus",
">",
"listFilesToCopyAtPath",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"PathFilter",
"fileFilter",
",",
"boolean",
"includeEmptyDirectories",
")",
"throws",
"IOException",
"{",
"return",
"listFilesToCopyAtPath",... | Given a path to copy, list all files rooted at the given path to copy
@param fs the file system of the path
@param path root path to copy
@param fileFilter a filter only applied to root
@param includeEmptyDirectories a control to include empty directories for copy | [
"Given",
"a",
"path",
"to",
"copy",
"list",
"all",
"files",
"rooted",
"at",
"the",
"given",
"path",
"to",
"copy"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/FileListUtils.java#L84-L87 | train | List all files to copy at the given path. | Of course, here is the Java code you requested:
```java
public static List<FileStatus> listFilesToCopyAtPath(FileSystem fs, Path path, PathFilter fileFilter,
boolean includeEmptyDirectories) throws IOException {
return listFilesToCopyAtPath(fs, path, fileFilter, false, includeEmptyDirectories);
}
```
Hope... |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java | ConcurrencyTools.shutdownAndAwaitTermination | public static void shutdownAndAwaitTermination() {
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
pool.shutdownNow(); // cancel currently executing tasks
// wait a while for tasks to respond to being can... | java | public static void shutdownAndAwaitTermination() {
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
pool.shutdownNow(); // cancel currently executing tasks
// wait a while for tasks to respond to being can... | [
"public",
"static",
"void",
"shutdownAndAwaitTermination",
"(",
")",
"{",
"shutdown",
"(",
")",
";",
"if",
"(",
"pool",
"!=",
"null",
")",
"{",
"try",
"{",
"// wait a while for existing tasks to terminate",
"if",
"(",
"!",
"pool",
".",
"awaitTermination",
"(",
... | Closes the thread pool. Waits 1 minute for a clean exit; if necessary, waits another minute for cancellation. | [
"Closes",
"the",
"thread",
"pool",
".",
"Waits",
"1",
"minute",
"for",
"a",
"clean",
"exit",
";",
"if",
"necessary",
"waits",
"another",
"minute",
"for",
"cancellation",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java#L126-L143 | train | shutdown and wait termination of the ConcurrencyTools thread pool | Of course, here is the Java code you requested:
```java
public static void shutdownAndAwaitTermination() {
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
pool.shutdownNow(); // cancel currently executing tas... |
geomajas/geomajas-project-geometry | jts/src/main/java/org/geomajas/geometry/conversion/jts/GeometryConverterService.java | GeometryConverterService.toJts | public static com.vividsolutions.jts.geom.Geometry toJts(Geometry geometry) throws JtsConversionException {
if (geometry == null) {
throw new JtsConversionException("Cannot convert null argument");
}
int srid = geometry.getSrid();
int precision = geometry.getPrecision();
PrecisionModel model;
if (precis... | java | public static com.vividsolutions.jts.geom.Geometry toJts(Geometry geometry) throws JtsConversionException {
if (geometry == null) {
throw new JtsConversionException("Cannot convert null argument");
}
int srid = geometry.getSrid();
int precision = geometry.getPrecision();
PrecisionModel model;
if (precis... | [
"public",
"static",
"com",
".",
"vividsolutions",
".",
"jts",
".",
"geom",
".",
"Geometry",
"toJts",
"(",
"Geometry",
"geometry",
")",
"throws",
"JtsConversionException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"throw",
"new",
"JtsConversionExcepti... | Convert a Geomajas geometry to a JTS geometry.
@param geometry Geomajas geometry
@return JTS geometry
@throws JtsConversionException conversion failed | [
"Convert",
"a",
"Geomajas",
"geometry",
"to",
"a",
"JTS",
"geometry",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/jts/src/main/java/org/geomajas/geometry/conversion/jts/GeometryConverterService.java#L57-L107 | train | Converts a geometry to a JTS geometry. | Of course, here is the Java code you requested:
```java
public static com.vividsolutions.jts.geom.Geometry toJts(Geometry geometry) throws JtsConversionException {
if (geometry == null) {
throw new JtsConversionException("Cannot convert null argument");
}
int srid = geometry.getSrid();
int precision = geom... |
eclipse/xtext-extras | org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/annotations/xAnnotations/impl/XAnnotationsFactoryImpl.java | XAnnotationsFactoryImpl.init | public static XAnnotationsFactory init()
{
try
{
XAnnotationsFactory theXAnnotationsFactory = (XAnnotationsFactory)EPackage.Registry.INSTANCE.getEFactory(XAnnotationsPackage.eNS_URI);
if (theXAnnotationsFactory != null)
{
return theXAnnotationsFactory;
}
}
catch (Exception exception)
{
Eco... | java | public static XAnnotationsFactory init()
{
try
{
XAnnotationsFactory theXAnnotationsFactory = (XAnnotationsFactory)EPackage.Registry.INSTANCE.getEFactory(XAnnotationsPackage.eNS_URI);
if (theXAnnotationsFactory != null)
{
return theXAnnotationsFactory;
}
}
catch (Exception exception)
{
Eco... | [
"public",
"static",
"XAnnotationsFactory",
"init",
"(",
")",
"{",
"try",
"{",
"XAnnotationsFactory",
"theXAnnotationsFactory",
"=",
"(",
"XAnnotationsFactory",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEFactory",
"(",
"XAnnotationsPackage",
".",
"e... | Creates the default factory implementation.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"Creates",
"the",
"default",
"factory",
"implementation",
".",
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/annotations/xAnnotations/impl/XAnnotationsFactoryImpl.java#L34-L49 | train | This method is called by the XAnnotationsFactory. It will try to get an instance of the XAnnotationsFactory class. | Of course, here is the Java code you requested:
```java
public static XAnnotationsFactory init()
{
try
{
XAnnotationsFactory theXAnnotationsFactory = (XAnnotationsFactory)EPackage.Registry.INSTANCE.getEFactory(XAnnotationsPackage.eNS_URI);
if (theXAnnotationsFactory != null)
{
return theXAnnotationsF... |
playn/playn | java-base/src/playn/java/JavaPlatform.java | JavaPlatform.start | public void start () {
if (config.activationKey != null) {
input().keyboardEvents.connect(new Slot<Keyboard.Event>() {
public void onEmit (Keyboard.Event event) {
if (event instanceof Keyboard.KeyEvent) {
Keyboard.KeyEvent kevent = (Keyboard.KeyEvent)event;
if (kevent... | java | public void start () {
if (config.activationKey != null) {
input().keyboardEvents.connect(new Slot<Keyboard.Event>() {
public void onEmit (Keyboard.Event event) {
if (event instanceof Keyboard.KeyEvent) {
Keyboard.KeyEvent kevent = (Keyboard.KeyEvent)event;
if (kevent... | [
"public",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"config",
".",
"activationKey",
"!=",
"null",
")",
"{",
"input",
"(",
")",
".",
"keyboardEvents",
".",
"connect",
"(",
"new",
"Slot",
"<",
"Keyboard",
".",
"Event",
">",
"(",
")",
"{",
"public",
... | Starts the game loop. This method will not return until the game exits. | [
"Starts",
"the",
"game",
"loop",
".",
"This",
"method",
"will",
"not",
"return",
"until",
"the",
"game",
"exits",
"."
] | 7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66 | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/java-base/src/playn/java/JavaPlatform.java#L128-L163 | train | Start the game. | Of course, here is the Java code you requested:
```java
public void start () {
if (config.activationKey != null) {
input().keyboardEvents.connect(new Slot<Keyboard.Event>() {
public void onEmit (Keyboard.Event event) {
if (event instanceof Keyboard.KeyEvent) {
Keyboard.KeyEvent ... |
demidenko05/beigesoft-accounting | src/main/java/org/beigesoft/accounting/factory/FctBnAccEntitiesProcessors.java | FctBnAccEntitiesProcessors.lazyGetPrcInpAccEntriesRetrieve | protected final PrcInpAccEntriesRetrieve lazyGetPrcInpAccEntriesRetrieve(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcInpAccEntriesRetrieve<RS> proc =
(PrcInpAccEntriesRetrieve<RS>) this.processorsMap
.get(PrcInpAccEntriesRetrieve.class.getSimpleNa... | java | protected final PrcInpAccEntriesRetrieve lazyGetPrcInpAccEntriesRetrieve(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcInpAccEntriesRetrieve<RS> proc =
(PrcInpAccEntriesRetrieve<RS>) this.processorsMap
.get(PrcInpAccEntriesRetrieve.class.getSimpleNa... | [
"protected",
"final",
"PrcInpAccEntriesRetrieve",
"lazyGetPrcInpAccEntriesRetrieve",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
")",
"throws",
"Exception",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"PrcInpAccEntriesRetrieve",
"<"... | <p>Get PrcInpAccEntriesRetrieve (create and put into map).</p>
@param pAddParam additional param
@return requested PrcInpAccEntriesRetrieve
@throws Exception - an exception | [
"<p",
">",
"Get",
"PrcInpAccEntriesRetrieve",
"(",
"create",
"and",
"put",
"into",
"map",
")",
".",
"<",
"/",
"p",
">"
] | e6f423949008218ddd05953b078f1ea8805095c1 | https://github.com/demidenko05/beigesoft-accounting/blob/e6f423949008218ddd05953b078f1ea8805095c1/src/main/java/org/beigesoft/accounting/factory/FctBnAccEntitiesProcessors.java#L3379-L3397 | train | Get a PrcInpAccEntriesRetrieve object from the database. | Of course, here is the Java code you requested:
```java
protected final PrcInpAccEntriesRetrieve lazyGetPrcInpAccEntriesRetrieve(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcInpAccEntriesRetrieve<RS> proc =
(PrcInpAccEntriesRetrieve<RS>) this.processorsMa... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java | MimeMappings.remove | public String remove(String extension) {
Mapping previous = this.map.remove(extension);
return (previous != null) ? previous.getMimeType() : null;
} | java | public String remove(String extension) {
Mapping previous = this.map.remove(extension);
return (previous != null) ? previous.getMimeType() : null;
} | [
"public",
"String",
"remove",
"(",
"String",
"extension",
")",
"{",
"Mapping",
"previous",
"=",
"this",
".",
"map",
".",
"remove",
"(",
"extension",
")",
";",
"return",
"(",
"previous",
"!=",
"null",
")",
"?",
"previous",
".",
"getMimeType",
"(",
")",
... | Remove an existing mapping.
@param extension the file extension (excluding '.')
@return the removed mime mapping or {@code null} if no item was removed | [
"Remove",
"an",
"existing",
"mapping",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java#L300-L303 | train | Removes the mapping for the given extension. | Of course, here is the Java code you requested:
```java
public String remove(String extension) {
Mapping previous = this.map.remove(extension);
return (previous != null) ? previous.getMimeType() : null;
}
```
Hope this helps! |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/GroovyRowResult.java | GroovyRowResult.getAt | public Object getAt(int index) {
try {
// a negative index will count backwards from the last column.
if (index < 0)
index += result.size();
Iterator it = result.values().iterator();
int i = 0;
Object obj = null;
while ((obj... | java | public Object getAt(int index) {
try {
// a negative index will count backwards from the last column.
if (index < 0)
index += result.size();
Iterator it = result.values().iterator();
int i = 0;
Object obj = null;
while ((obj... | [
"public",
"Object",
"getAt",
"(",
"int",
"index",
")",
"{",
"try",
"{",
"// a negative index will count backwards from the last column.",
"if",
"(",
"index",
"<",
"0",
")",
"index",
"+=",
"result",
".",
"size",
"(",
")",
";",
"Iterator",
"it",
"=",
"result",
... | Retrieve the value of the property by its index.
A negative index will count backwards from the last column.
@param index is the number of the column to look at
@return the value of the property | [
"Retrieve",
"the",
"value",
"of",
"the",
"property",
"by",
"its",
"index",
".",
"A",
"negative",
"index",
"will",
"count",
"backwards",
"from",
"the",
"last",
"column",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/GroovyRowResult.java#L84-L104 | train | Gets the value at the specified index. | Of course, here is the Java code you requested:
```java
public Object getAt(int index) {
try {
// a negative index will count backwards from the last column.
if (index < 0)
index += result.size();
Iterator it = result.values().iterator();
int i = ... |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Category.java | Category.getSiblings | public Set<Category> getSiblings() {
Set<Category> siblings = new HashSet<Category>();
// add siblings
for (Category parent : this.getParents()) {
siblings.addAll(parent.getChildren());
}
// remove this category from list
siblings.remove(this);
retu... | java | public Set<Category> getSiblings() {
Set<Category> siblings = new HashSet<Category>();
// add siblings
for (Category parent : this.getParents()) {
siblings.addAll(parent.getChildren());
}
// remove this category from list
siblings.remove(this);
retu... | [
"public",
"Set",
"<",
"Category",
">",
"getSiblings",
"(",
")",
"{",
"Set",
"<",
"Category",
">",
"siblings",
"=",
"new",
"HashSet",
"<",
"Category",
">",
"(",
")",
";",
"// add siblings",
"for",
"(",
"Category",
"parent",
":",
"this",
".",
"getParents",... | Returns the siblings of this category.
@return Returns the siblings of this category or null, if there are none. | [
"Returns",
"the",
"siblings",
"of",
"this",
"category",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Category.java#L356-L368 | train | Gets the siblings of this category. | Of course, here is the Java code you requested:
```java
public Set<Category> getSiblings() {
Set<Category> siblings = new HashSet<Category>();
// add siblings
for (Category parent : this.getParents()) {
siblings.addAll(parent.getChildren());
}
// remove this catego... |
io7m/jcanephora | com.io7m.jcanephora.lwjgl3/src/main/java/com/io7m/jcanephora/lwjgl3/LWJGL3TypeConversions.java | LWJGL3TypeConversions.faceSelectionToGL | public static int faceSelectionToGL(
final JCGLFaceSelection faces)
{
switch (faces) {
case FACE_BACK:
return GL11.GL_BACK;
case FACE_FRONT:
return GL11.GL_FRONT;
case FACE_FRONT_AND_BACK:
return GL11.GL_FRONT_AND_BACK;
}
throw new UnreachableCodeException();... | java | public static int faceSelectionToGL(
final JCGLFaceSelection faces)
{
switch (faces) {
case FACE_BACK:
return GL11.GL_BACK;
case FACE_FRONT:
return GL11.GL_FRONT;
case FACE_FRONT_AND_BACK:
return GL11.GL_FRONT_AND_BACK;
}
throw new UnreachableCodeException();... | [
"public",
"static",
"int",
"faceSelectionToGL",
"(",
"final",
"JCGLFaceSelection",
"faces",
")",
"{",
"switch",
"(",
"faces",
")",
"{",
"case",
"FACE_BACK",
":",
"return",
"GL11",
".",
"GL_BACK",
";",
"case",
"FACE_FRONT",
":",
"return",
"GL11",
".",
"GL_FRO... | Convert faces to GL constants.
@param faces The faces.
@return The resulting GL constant. | [
"Convert",
"faces",
"to",
"GL",
"constants",
"."
] | 0004c1744b7f0969841d04cd4fa693f402b10980 | https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.lwjgl3/src/main/java/com/io7m/jcanephora/lwjgl3/LWJGL3TypeConversions.java#L1324-L1337 | train | Convert a JCGLFaceSelection to GL constants. | Of course, here is the Java code you requested:
```java
public static int faceSelectionToGL(
final JCGLFaceSelection faces)
{
switch (faces) {
case FACE_BACK:
return GL11.GL_BACK;
case FACE_FRONT:
return GL11.GL_FRONT;
case FACE_FRONT_AND_BACK:
return GL11.GL_FRONT_A... |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/CopyOnWriteMap.java | CopyOnWriteMap.putAll | public void putAll(Map<? extends K, ? extends V> newData) {
synchronized (this) {
Map<K, V> newMap = new HashMap<>(internalMap);
newMap.putAll(newData);
internalMap = newMap;
}
} | java | public void putAll(Map<? extends K, ? extends V> newData) {
synchronized (this) {
Map<K, V> newMap = new HashMap<>(internalMap);
newMap.putAll(newData);
internalMap = newMap;
}
} | [
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"newData",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"newMap",
"=",
"new",
"HashMap",
"<>",
"(",
"internalMap",
... | Inserts all the keys and values contained in the
provided map to this map.
@see java.util.Map#putAll(java.util.Map) | [
"Inserts",
"all",
"the",
"keys",
"and",
"values",
"contained",
"in",
"the",
"provided",
"map",
"to",
"this",
"map",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/CopyOnWriteMap.java#L103-L109 | train | Put all the elements in the specified map into this map. | Of course, here is the Java code you requested:
```java
public void putAll(Map<? extends K, ? extends V> newData) {
synchronized (this) {
Map<K, V> newMap = new HashMap<>(internalMap);
newMap.putAll(newData);
internalMap = newMap;
}
}
```
Hope this helps! |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcrl.java | sslcrl.update | public static base_response update(nitro_service client, sslcrl resource) throws Exception {
sslcrl updateresource = new sslcrl();
updateresource.crlname = resource.crlname;
updateresource.refresh = resource.refresh;
updateresource.cacert = resource.cacert;
updateresource.server = resource.server;
updateres... | java | public static base_response update(nitro_service client, sslcrl resource) throws Exception {
sslcrl updateresource = new sslcrl();
updateresource.crlname = resource.crlname;
updateresource.refresh = resource.refresh;
updateresource.cacert = resource.cacert;
updateresource.server = resource.server;
updateres... | [
"public",
"static",
"base_response",
"update",
"(",
"nitro_service",
"client",
",",
"sslcrl",
"resource",
")",
"throws",
"Exception",
"{",
"sslcrl",
"updateresource",
"=",
"new",
"sslcrl",
"(",
")",
";",
"updateresource",
".",
"crlname",
"=",
"resource",
".",
... | Use this API to update sslcrl. | [
"Use",
"this",
"API",
"to",
"update",
"sslcrl",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcrl.java#L751-L769 | train | Use this API to update sslcrl. | Of course, here is the Java code you requested:
```java
public static base_response update(nitro_service client, sslcrl resource) throws Exception {
sslcrl updateresource = new sslcrl();
updateresource.crlname = resource.crlname;
updateresource.refresh = resource.refresh;
updateresource.cacert = resource.cacer... |
digitalfondue/stampo | src/main/java/ch/digitalfondue/stampo/StampoGlobalConfiguration.java | StampoGlobalConfiguration.extractIgnorePatterns | @SuppressWarnings("unchecked")
private Set<String> extractIgnorePatterns(Map<String, Object> configuration) {
List<String> patterns = asList("glob:.*",// hidden files
"glob:*~", "glob:#*#", "glob:.#*", // emacs
"glob:*~", "glob:[._]*.s[a-w][a-z]", "glob:[._]s[a-w][a-z]", "glob:*.un~" // vim
);... | java | @SuppressWarnings("unchecked")
private Set<String> extractIgnorePatterns(Map<String, Object> configuration) {
List<String> patterns = asList("glob:.*",// hidden files
"glob:*~", "glob:#*#", "glob:.#*", // emacs
"glob:*~", "glob:[._]*.s[a-w][a-z]", "glob:[._]s[a-w][a-z]", "glob:*.un~" // vim
);... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Set",
"<",
"String",
">",
"extractIgnorePatterns",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"configuration",
")",
"{",
"List",
"<",
"String",
">",
"patterns",
"=",
"asList",
"(",
"\"glob:.... | http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher%28java.lang.String%29 | [
"http",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"api",
"/",
"java",
"/",
"nio",
"/",
"file",
"/",
"FileSystem",
".",
"html#getPathMatcher%28java",
".",
"lang",
".",
"String%29"
] | 5a41f20acd9211cf3951c30d0e0825994ae95573 | https://github.com/digitalfondue/stampo/blob/5a41f20acd9211cf3951c30d0e0825994ae95573/src/main/java/ch/digitalfondue/stampo/StampoGlobalConfiguration.java#L121-L130 | train | Extract ignore patterns from configuration. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
private Set<String> extractIgnorePatterns(Map<String, Object> configuration) {
List<String> patterns = asList("glob:.*",// hidden files
"glob:*~", "glob:#*#", "glob:.#*", // emacs
"glob:*~", "glob:[._]*.s[a-w][... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.