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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/snapping/SnappingMode.java | SnappingMode.setCoordinate | public void setCoordinate(Coordinate coordinate) {
if (coordinate == null) {
throw new IllegalArgumentException("Can't snap to a null coordinate.");
}
this.coordinate = coordinate;
bounds = new Bbox(coordinate.getX() - rule.getDistance(), coordinate.getY() - rule.getDistance(), rule
.getDistance() * 2, r... | java | public void setCoordinate(Coordinate coordinate) {
if (coordinate == null) {
throw new IllegalArgumentException("Can't snap to a null coordinate.");
}
this.coordinate = coordinate;
bounds = new Bbox(coordinate.getX() - rule.getDistance(), coordinate.getY() - rule.getDistance(), rule
.getDistance() * 2, r... | [
"public",
"void",
"setCoordinate",
"(",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"coordinate",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't snap to a null coordinate.\"",
")",
";",
"}",
"this",
".",
"coordinate",
"=",
... | Set a new coordinate ready to be snapped. | [
"Set",
"a",
"new",
"coordinate",
"ready",
"to",
"be",
"snapped",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/snapping/SnappingMode.java#L79-L88 | train | Sets the coordinate of the rule. | Of course, here is the Java code you requested:
```java
public void setCoordinate(Coordinate coordinate) {
if (coordinate == null) {
throw new IllegalArgumentException("Can't snap to a null coordinate.");
}
this.coordinate = coordinate;
bounds = new Bbox(coordinate.getX() - rule.getDistance(), coordinate.ge... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsip.java | nsip.get | public static nsip[] get(nitro_service service) throws Exception{
nsip obj = new nsip();
nsip[] response = (nsip[])obj.get_resources(service);
return response;
} | java | public static nsip[] get(nitro_service service) throws Exception{
nsip obj = new nsip();
nsip[] response = (nsip[])obj.get_resources(service);
return response;
} | [
"public",
"static",
"nsip",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"nsip",
"obj",
"=",
"new",
"nsip",
"(",
")",
";",
"nsip",
"[",
"]",
"response",
"=",
"(",
"nsip",
"[",
"]",
")",
"obj",
".",
"get_resources... | Use this API to fetch all the nsip resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"nsip",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsip.java#L1143-L1147 | train | Use this API to fetch all the nsip resources that are configured on netscaler. | Of course, here is the Java code you requested:
```java
public static nsip[] get(nitro_service service) throws Exception{
nsip obj = new nsip();
nsip[] response = (nsip[])obj.get_resources(service);
return response;
}
```
Hope this helps! |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java | NeedlessMemberCollectionSynchronization.sawInitOpcode | private void sawInitOpcode(int seen) {
boolean isSyncCollection = false;
try {
stack.mergeJumps(this);
isSyncCollection = isSyncCollectionCreation(seen);
if (seen == Const.PUTFIELD) {
processCollectionStore();
}
} finally {
... | java | private void sawInitOpcode(int seen) {
boolean isSyncCollection = false;
try {
stack.mergeJumps(this);
isSyncCollection = isSyncCollectionCreation(seen);
if (seen == Const.PUTFIELD) {
processCollectionStore();
}
} finally {
... | [
"private",
"void",
"sawInitOpcode",
"(",
"int",
"seen",
")",
"{",
"boolean",
"isSyncCollection",
"=",
"false",
";",
"try",
"{",
"stack",
".",
"mergeJumps",
"(",
"this",
")",
";",
"isSyncCollection",
"=",
"isSyncCollectionCreation",
"(",
"seen",
")",
";",
"if... | handle {@code <init>} blocks by looking for putfield calls referencing synchronized collections
@param seen
the opcode of the currently parsed instruction | [
"handle",
"{",
"@code",
"<init",
">",
"}",
"blocks",
"by",
"looking",
"for",
"putfield",
"calls",
"referencing",
"synchronized",
"collections"
] | 3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8 | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java#L232-L247 | train | overrides the visitor to look for initializers that are not sync collections | Of course, here is the Java code you requested:
```java
private void sawInitOpcode(int seen) {
boolean isSyncCollection = false;
try {
stack.mergeJumps(this);
isSyncCollection = isSyncCollectionCreation(seen);
if (seen == Const.PUTFIELD) {
processColl... |
OpenLiberty/open-liberty | dev/com.ibm.rls.jdbc/src/com/ibm/ws/recoverylog/custom/jdbc/impl/SQLNonTransactionalDataSource.java | SQLNonTransactionalDataSource.getDataSource | @FFDCIgnore(Exception.class)
public DataSource getDataSource() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "getDataSource");
// Retrieve the data source factory from the CustomLogProperties. This Factory should be set in the JTMConfigurationProvider
// by the jdbc c... | java | @FFDCIgnore(Exception.class)
public DataSource getDataSource() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "getDataSource");
// Retrieve the data source factory from the CustomLogProperties. This Factory should be set in the JTMConfigurationProvider
// by the jdbc c... | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"public",
"DataSource",
"getDataSource",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getDataSource\"",
")",
";... | Locates a DataSource in config
@return The DataSource.
@exception | [
"Locates",
"a",
"DataSource",
"in",
"config"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.rls.jdbc/src/com/ibm/ws/recoverylog/custom/jdbc/impl/SQLNonTransactionalDataSource.java#L78-L148 | train | This method is called by the application to get the DataSource object. | Of course, here is the Java code you requested:
```java
@FFDCIgnore(Exception.class)
public DataSource getDataSource() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "getDataSource");
// Retrieve the data source factory from the CustomLogProperties. This Factory should be set... |
bazaarvoice/ostrich | core/src/main/java/com/bazaarvoice/ostrich/pool/ServicePoolBuilder.java | ServicePoolBuilder.withPartitionContextAnnotationsFrom | public ServicePoolBuilder<S> withPartitionContextAnnotationsFrom(Class<? extends S> annotatedServiceClass) {
checkNotNull(annotatedServiceClass);
_partitionContextSupplier = new AnnotationPartitionContextSupplier(_serviceType, annotatedServiceClass);
return this;
} | java | public ServicePoolBuilder<S> withPartitionContextAnnotationsFrom(Class<? extends S> annotatedServiceClass) {
checkNotNull(annotatedServiceClass);
_partitionContextSupplier = new AnnotationPartitionContextSupplier(_serviceType, annotatedServiceClass);
return this;
} | [
"public",
"ServicePoolBuilder",
"<",
"S",
">",
"withPartitionContextAnnotationsFrom",
"(",
"Class",
"<",
"?",
"extends",
"S",
">",
"annotatedServiceClass",
")",
"{",
"checkNotNull",
"(",
"annotatedServiceClass",
")",
";",
"_partitionContextSupplier",
"=",
"new",
"Anno... | Uses {@link PartitionKey} annotations from the specified class to generate partition context in the built proxy.
<p>
NOTE: This is only useful if building a proxy with {@link #buildProxy(com.bazaarvoice.ostrich.RetryPolicy)}. If
partition context is necessary with a normal service pool, then can be provided directly b... | [
"Uses",
"{",
"@link",
"PartitionKey",
"}",
"annotations",
"from",
"the",
"specified",
"class",
"to",
"generate",
"partition",
"context",
"in",
"the",
"built",
"proxy",
".",
"<p",
">",
"NOTE",
":",
"This",
"is",
"only",
"useful",
"if",
"building",
"a",
"pro... | 13591867870ab23445253f11fc872662a8028191 | https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/ServicePoolBuilder.java#L211-L215 | train | Sets the partition context annotations from the given annotated service class. | Of course, here is the Java code you requested:
```java
public ServicePoolBuilder<S> withPartitionContextAnnotationsFrom(Class<? extends S> annotatedServiceClass) {
checkNotNull(annotatedServiceClass);
_partitionContextSupplier = new AnnotationPartitionContextSupplier(_serviceType, annotatedServiceClas... |
OpenLiberty/open-liberty | dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/ObjectFactory.java | ObjectFactory.createPreferredLanguage | @XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "preferredLanguage")
public JAXBElement<String> createPreferredLanguage(String value) {
return new JAXBElement<String>(_PreferredLanguage_QNAME, String.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "preferredLanguage")
public JAXBElement<String> createPreferredLanguage(String value) {
return new JAXBElement<String>(_PreferredLanguage_QNAME, String.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.ibm.com/websphere/wim\"",
",",
"name",
"=",
"\"preferredLanguage\"",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createPreferredLanguage",
"(",
"String",
"value",
")",
"{",
"return",
"new",
"JAXBElemen... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/ObjectFactory.java#L843-L846 | train | Create an instance of the preferredLanguage property. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "preferredLanguage")
public JAXBElement<String> createPreferredLanguage(String value) {
return new JAXBElement<String>(_PreferredLanguage_QNAME, String.class, null, value);
}
`... |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/crdt/CRDTReplicationTask.java | CRDTReplicationTask.pickTargets | private Member[] pickTargets(Collection<Member> members, int startingIndex, int maxTargets) {
final Member[] viableTargetArray = members.toArray(new Member[0]);
final Member[] pickedTargets = new Member[Math.min(maxTargets, viableTargetArray.length)];
for (int i = 0; i < pickedTargets.length; i... | java | private Member[] pickTargets(Collection<Member> members, int startingIndex, int maxTargets) {
final Member[] viableTargetArray = members.toArray(new Member[0]);
final Member[] pickedTargets = new Member[Math.min(maxTargets, viableTargetArray.length)];
for (int i = 0; i < pickedTargets.length; i... | [
"private",
"Member",
"[",
"]",
"pickTargets",
"(",
"Collection",
"<",
"Member",
">",
"members",
",",
"int",
"startingIndex",
",",
"int",
"maxTargets",
")",
"{",
"final",
"Member",
"[",
"]",
"viableTargetArray",
"=",
"members",
".",
"toArray",
"(",
"new",
"... | Picks up to {@code maxTargets} from the provided {@code members}
collection. The {@code startingIndex} parameter determines which
subset of members can be returned. By increasing the parameter by the
size of the returned array you can imitate a "sliding window", meaning
that each time it is invoked it will rotate throu... | [
"Picks",
"up",
"to",
"{",
"@code",
"maxTargets",
"}",
"from",
"the",
"provided",
"{",
"@code",
"members",
"}",
"collection",
".",
"The",
"{",
"@code",
"startingIndex",
"}",
"parameter",
"determines",
"which",
"subset",
"of",
"members",
"can",
"be",
"returned... | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/crdt/CRDTReplicationTask.java#L160-L169 | train | Pick targets from a collection of members. | Of course, here is the Java code you requested:
```java
private Member[] pickTargets(Collection<Member> members, int startingIndex, int maxTargets) {
final Member[] viableTargetArray = members.toArray(new Member[0]);
final Member[] pickedTargets = new Member[Math.min(maxTargets, viableTargetArray.lengt... |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/Gold.java | Gold.setTypeS | public void setTypeS(String v) {
if (Gold_Type.featOkTst && ((Gold_Type)jcasType).casFeat_typeS == null)
jcasType.jcas.throwFeatMissing("typeS", "ch.epfl.bbp.uima.types.Gold");
jcasType.ll_cas.ll_setStringValue(addr, ((Gold_Type)jcasType).casFeatCode_typeS, v);} | java | public void setTypeS(String v) {
if (Gold_Type.featOkTst && ((Gold_Type)jcasType).casFeat_typeS == null)
jcasType.jcas.throwFeatMissing("typeS", "ch.epfl.bbp.uima.types.Gold");
jcasType.ll_cas.ll_setStringValue(addr, ((Gold_Type)jcasType).casFeatCode_typeS, v);} | [
"public",
"void",
"setTypeS",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"Gold_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Gold_Type",
")",
"jcasType",
")",
".",
"casFeat_typeS",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"ty... | setter for typeS - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"typeS",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/Gold.java#L95-L98 | train | setter for typeS - sets | Of course, here is the Java code you requested:
```java
public void setTypeS(String v) {
if (Gold_Type.featOkTst && ((Gold_Type)jcasType).casFeat_typeS == null)
jcasType.jcas.throwFeatMissing("typeS", "ch.epfl.bbp.uima.types.Gold");
jcasType.ll_cas.ll_setStringValue(addr, ((Gold_Type)jcasType).casFeatCod... |
samskivert/samskivert | src/main/java/com/samskivert/servlet/SiteIdentifiers.java | SiteIdentifiers.single | public static SiteIdentifier single (final int siteId, final String siteString) {
return new SiteIdentifier() {
public int identifySite (HttpServletRequest req) {
return siteId;
}
public String getSiteString (int siteId) {
return siteString;
... | java | public static SiteIdentifier single (final int siteId, final String siteString) {
return new SiteIdentifier() {
public int identifySite (HttpServletRequest req) {
return siteId;
}
public String getSiteString (int siteId) {
return siteString;
... | [
"public",
"static",
"SiteIdentifier",
"single",
"(",
"final",
"int",
"siteId",
",",
"final",
"String",
"siteString",
")",
"{",
"return",
"new",
"SiteIdentifier",
"(",
")",
"{",
"public",
"int",
"identifySite",
"(",
"HttpServletRequest",
"req",
")",
"{",
"retur... | Returns a site identifier that returns the specified site always. | [
"Returns",
"a",
"site",
"identifier",
"that",
"returns",
"the",
"specified",
"site",
"always",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/SiteIdentifiers.java#L23-L38 | train | Creates a single SiteIdentifier object. | Of course, here is the Java code you requested:
```java
public static SiteIdentifier single (final int siteId, final String siteString) {
return new SiteIdentifier() {
public int identifySite (HttpServletRequest req) {
return siteId;
}
public String getSiteSt... |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/ConvertRotation3D_F64.java | ConvertRotation3D_F64.rotationAboutAxis | private static DMatrixRMaj rotationAboutAxis(int axis, double angle, DMatrixRMaj R ) {
switch( axis ) {
case 0:
return ConvertRotation3D_F64.rotX( angle, R );
case 1:
return ConvertRotation3D_F64.rotY( angle, R );
case 2:
return ConvertRotation3D_F64.rotZ( angle, R );
default:
throw new... | java | private static DMatrixRMaj rotationAboutAxis(int axis, double angle, DMatrixRMaj R ) {
switch( axis ) {
case 0:
return ConvertRotation3D_F64.rotX( angle, R );
case 1:
return ConvertRotation3D_F64.rotY( angle, R );
case 2:
return ConvertRotation3D_F64.rotZ( angle, R );
default:
throw new... | [
"private",
"static",
"DMatrixRMaj",
"rotationAboutAxis",
"(",
"int",
"axis",
",",
"double",
"angle",
",",
"DMatrixRMaj",
"R",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"0",
":",
"return",
"ConvertRotation3D_F64",
".",
"rotX",
"(",
"angle",
",",
"R... | Creates a rotation matrix about the specified axis.
@param axis 0 = x, 1 = y, 2 = z
@param angle The angle it is rotated by in radians.
@return The 3 by 3 rotation matrix. | [
"Creates",
"a",
"rotation",
"matrix",
"about",
"the",
"specified",
"axis",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/ConvertRotation3D_F64.java#L656-L670 | test | Convert rotation about axis | Of course, here is the Java code you requested:
```java
private static DMatrixRMaj rotationAboutAxis(int axis, double angle, DMatrixRMaj R ) {
switch( axis ) {
case 0:
return ConvertRotation3D_F64.rotX( angle, R );
case 1:
return ConvertRotation3D_F64.rotY( angle, R );
case 2:
return ConvertRo... |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java | BindingFactory.contributeToModule | public void contributeToModule() {
final GuiceModuleAccess module = this.module.get();
if (!this.removableBindings.isEmpty()) {
// Ok, we are broking the Java secutiry manager.
// But it's for having something working!
try {
final Field field = module.getClass().getDeclaredField("bindings"); //$NON-NLS... | java | public void contributeToModule() {
final GuiceModuleAccess module = this.module.get();
if (!this.removableBindings.isEmpty()) {
// Ok, we are broking the Java secutiry manager.
// But it's for having something working!
try {
final Field field = module.getClass().getDeclaredField("bindings"); //$NON-NLS... | [
"public",
"void",
"contributeToModule",
"(",
")",
"{",
"final",
"GuiceModuleAccess",
"module",
"=",
"this",
".",
"module",
".",
"get",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"removableBindings",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Ok, we are broki... | Put the bindings to the associated module. | [
"Put",
"the",
"bindings",
"to",
"the",
"associated",
"module",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java#L363-L383 | train | Contributes the bindings to the Guice module. | Of course, here is the Java code you requested:
```java
public void contributeToModule() {
final GuiceModuleAccess module = this.module.get();
if (!this.removableBindings.isEmpty()) {
// Ok, we are broking the Java secutiry manager.
// But it's for having something working!
try {
final Field field = m... |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/utils/social/ConnectionUtils.java | ConnectionUtils.createProfile | public static Profile createProfile(Connection<?> connection) {
Profile profile = new Profile();
UserProfile providerProfile = connection.fetchUserProfile();
String email = providerProfile.getEmail();
if (StringUtils.isEmpty(email)) {
throw new IllegalStateException("No emai... | java | public static Profile createProfile(Connection<?> connection) {
Profile profile = new Profile();
UserProfile providerProfile = connection.fetchUserProfile();
String email = providerProfile.getEmail();
if (StringUtils.isEmpty(email)) {
throw new IllegalStateException("No emai... | [
"public",
"static",
"Profile",
"createProfile",
"(",
"Connection",
"<",
"?",
">",
"connection",
")",
"{",
"Profile",
"profile",
"=",
"new",
"Profile",
"(",
")",
";",
"UserProfile",
"providerProfile",
"=",
"connection",
".",
"fetchUserProfile",
"(",
")",
";",
... | Creates a profile from the specified connection.
@param connection the connection where to retrieve the profile info from
@return the created profile | [
"Creates",
"a",
"profile",
"from",
"the",
"specified",
"connection",
"."
] | d829c1136b0fd21d87dc925cb7046cbd38a300a4 | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/utils/social/ConnectionUtils.java#L244-L279 | train | Creates a profile object from the connection object. | Of course, here is the Java code you requested:
```java
public static Profile createProfile(Connection<?> connection) {
Profile profile = new Profile();
UserProfile providerProfile = connection.fetchUserProfile();
String email = providerProfile.getEmail();
if (StringUtils.isEmpty(email... |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java | LibraryCacheManager.writeLibraryToStreamInternal | private void writeLibraryToStreamInternal(final String libraryFileName, final DataOutput out) throws IOException {
if (libraryFileName == null) {
throw new IOException("libraryName is null!");
}
final Path storePath = new Path(this.libraryCachePath + "/" + libraryFileName);
synchronized (this.fs) {
if... | java | private void writeLibraryToStreamInternal(final String libraryFileName, final DataOutput out) throws IOException {
if (libraryFileName == null) {
throw new IOException("libraryName is null!");
}
final Path storePath = new Path(this.libraryCachePath + "/" + libraryFileName);
synchronized (this.fs) {
if... | [
"private",
"void",
"writeLibraryToStreamInternal",
"(",
"final",
"String",
"libraryFileName",
",",
"final",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"libraryFileName",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"library... | Writes data from the library with the given file name to the specified stream.
@param libraryFileName
the name of the library
@param out
the stream to write the data to
@throws IOException
thrown if an error occurs while writing the data | [
"Writes",
"data",
"from",
"the",
"library",
"with",
"the",
"given",
"file",
"name",
"to",
"the",
"specified",
"stream",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L514-L543 | train | Write the library file to the output stream. | Of course, here is the Java code you requested:
```java
private void writeLibraryToStreamInternal(final String libraryFileName, final DataOutput out) throws IOException {
if (libraryFileName == null) {
throw new IOException("libraryName is null!");
}
final Path storePath = new Path(this.libraryCachePath + "... |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java | ServerHandshaker.clientFinished | private void clientFinished(Finished mesg) throws IOException {
if (debug != null && Debug.isOn("handshake")) {
mesg.print(System.out);
}
/*
* Verify if client did send the certificate when client
* authentication was required, otherwise server should not proceed
... | java | private void clientFinished(Finished mesg) throws IOException {
if (debug != null && Debug.isOn("handshake")) {
mesg.print(System.out);
}
/*
* Verify if client did send the certificate when client
* authentication was required, otherwise server should not proceed
... | [
"private",
"void",
"clientFinished",
"(",
"Finished",
"mesg",
")",
"throws",
"IOException",
"{",
"if",
"(",
"debug",
"!=",
"null",
"&&",
"Debug",
".",
"isOn",
"(",
"\"handshake\"",
")",
")",
"{",
"mesg",
".",
"print",
"(",
"System",
".",
"out",
")",
";... | /*
Client writes "finished" at the end of its handshake, after cipher
spec is changed. We verify it and then send ours.
When we're resuming a session, we'll have already sent our own
Finished message so just the verification is needed. | [
"/",
"*",
"Client",
"writes",
"finished",
"at",
"the",
"end",
"of",
"its",
"handshake",
"after",
"cipher",
"spec",
"is",
"changed",
".",
"We",
"verify",
"it",
"and",
"then",
"send",
"ours",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java#L1502-L1574 | train | clientFinished method. | Of course, here is the Java code you requested:
```java
private void clientFinished(Finished mesg) throws IOException {
if (debug != null && Debug.isOn("handshake")) {
mesg.print(System.out);
}
/*
* Verify if client did send the certificate when client
* authentic... |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java | ExcelDataProviderImpl.prepareHeaderRowDataMap | private Map<String, String> prepareHeaderRowDataMap(List<String> header, List<String> rowData) {
Map<String, String> headerRowDataMap = new HashMap<>();
if (header.size() == rowData.size()) {
for (int i = 0; i < header.size(); i++) {
if (null != header.get(i)) {
... | java | private Map<String, String> prepareHeaderRowDataMap(List<String> header, List<String> rowData) {
Map<String, String> headerRowDataMap = new HashMap<>();
if (header.size() == rowData.size()) {
for (int i = 0; i < header.size(); i++) {
if (null != header.get(i)) {
... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"prepareHeaderRowDataMap",
"(",
"List",
"<",
"String",
">",
"header",
",",
"List",
"<",
"String",
">",
"rowData",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"headerRowDataMap",
"=",
"new",
"Ha... | /*
prepares map of excel header row and the the excel data row
@param header the excel header row
@param rowData row data to be used for preparing the return value
@return map of the header row and data row | [
"/",
"*",
"prepares",
"map",
"of",
"excel",
"header",
"row",
"and",
"the",
"the",
"excel",
"data",
"row"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java#L547-L559 | train | Prepare header row data map. | Of course, here is the Java code you requested:
```java
private Map<String, String> prepareHeaderRowDataMap(List<String> header, List<String> rowData) {
Map<String, String> headerRowDataMap = new HashMap<>();
if (header.size() == rowData.size()) {
for (int i = 0; i < header.size(); i++) {
... |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.rewriteQuantifiers | private Type rewriteQuantifiers(Type t, boolean high, boolean rewriteTypeVars) {
return new Rewriter(high, rewriteTypeVars).visit(t);
} | java | private Type rewriteQuantifiers(Type t, boolean high, boolean rewriteTypeVars) {
return new Rewriter(high, rewriteTypeVars).visit(t);
} | [
"private",
"Type",
"rewriteQuantifiers",
"(",
"Type",
"t",
",",
"boolean",
"high",
",",
"boolean",
"rewriteTypeVars",
")",
"{",
"return",
"new",
"Rewriter",
"(",
"high",
",",
"rewriteTypeVars",
")",
".",
"visit",
"(",
"t",
")",
";",
"}"
] | Rewrite all type variables (universal quantifiers) in the given
type to wildcards (existential quantifiers). This is used to
determine if a cast is allowed. For example, if high is true
and {@code T <: Number}, then {@code List<T>} is rewritten to
{@code List<? extends Number>}. Since {@code List<Integer> <:
List<?... | [
"Rewrite",
"all",
"type",
"variables",
"(",
"universal",
"quantifiers",
")",
"in",
"the",
"given",
"type",
"to",
"wildcards",
"(",
"existential",
"quantifiers",
")",
".",
"This",
"is",
"used",
"to",
"determine",
"if",
"a",
"cast",
"is",
"allowed",
".",
"Fo... | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L4434-L4436 | train | Rewrite the quantifiers of a type. | Of course, here is the Java code you requested:
```java
private Type rewriteQuantifiers(Type t, boolean high, boolean rewriteTypeVars) {
return new Rewriter(high, rewriteTypeVars).visit(t);
}
```
Hope this helps! |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.safelyRemoveHandlers | public static void safelyRemoveHandlers(ChannelPipeline pipeline, String... handlerNames) {
for (String name : handlerNames) {
if (pipeline.get(name) != null) {
pipeline.remove(name);
} else {
LOG.debug("Trying to remove not engaged {} handler from the pip... | java | public static void safelyRemoveHandlers(ChannelPipeline pipeline, String... handlerNames) {
for (String name : handlerNames) {
if (pipeline.get(name) != null) {
pipeline.remove(name);
} else {
LOG.debug("Trying to remove not engaged {} handler from the pip... | [
"public",
"static",
"void",
"safelyRemoveHandlers",
"(",
"ChannelPipeline",
"pipeline",
",",
"String",
"...",
"handlerNames",
")",
"{",
"for",
"(",
"String",
"name",
":",
"handlerNames",
")",
"{",
"if",
"(",
"pipeline",
".",
"get",
"(",
"name",
")",
"!=",
... | Removes handlers from the pipeline if they are present.
@param pipeline the channel pipeline
@param handlerNames names of the handlers to be removed | [
"Removes",
"handlers",
"from",
"the",
"pipeline",
"if",
"they",
"are",
"present",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L683-L691 | train | Removes the handlers from the pipeline. | Of course, here is the Java code you requested:
```java
public static void safelyRemoveHandlers(ChannelPipeline pipeline, String... handlerNames) {
for (String name : handlerNames) {
if (pipeline.get(name) != null) {
pipeline.remove(name);
} else {
LOG.de... |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBClient.java | CouchDBClient.setEntitiesInResult | private void setEntitiesInResult(EntityMetadata m, List results, JsonArray array)
{
for (JsonElement element : array)
{
String id = element.getAsJsonObject().get("value").getAsJsonObject()
.get(((AbstractAttribute) m.getIdAttribute()).getJPAColumnName()).getAsString(... | java | private void setEntitiesInResult(EntityMetadata m, List results, JsonArray array)
{
for (JsonElement element : array)
{
String id = element.getAsJsonObject().get("value").getAsJsonObject()
.get(((AbstractAttribute) m.getIdAttribute()).getJPAColumnName()).getAsString(... | [
"private",
"void",
"setEntitiesInResult",
"(",
"EntityMetadata",
"m",
",",
"List",
"results",
",",
"JsonArray",
"array",
")",
"{",
"for",
"(",
"JsonElement",
"element",
":",
"array",
")",
"{",
"String",
"id",
"=",
"element",
".",
"getAsJsonObject",
"(",
")",... | Sets the entities in result.
@param m
the m
@param results
the results
@param array
the array | [
"Sets",
"the",
"entities",
"in",
"result",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBClient.java#L1045-L1061 | train | Sets entities in result. | Of course, here is the Java code you requested:
```java
private void setEntitiesInResult(EntityMetadata m, List results, JsonArray array)
{
for (JsonElement element : array)
{
String id = element.getAsJsonObject().get("value").getAsJsonObject()
.get(((AbstractAttrib... |
GerdHolz/TOVAL | src/de/invation/code/toval/reflect/ReflectionUtils.java | ReflectionUtils.getSubclassesInPackage | public static LinkedHashSet<Class<?>> getSubclassesInPackage(Class<?> clazz, String packageName, boolean recursive) throws ReflectionException {
Validate.notNull(clazz);
if (clazz.isInterface() || clazz.isEnum()) {
throw new ParameterException("Parameter is not a class");
}
... | java | public static LinkedHashSet<Class<?>> getSubclassesInPackage(Class<?> clazz, String packageName, boolean recursive) throws ReflectionException {
Validate.notNull(clazz);
if (clazz.isInterface() || clazz.isEnum()) {
throw new ParameterException("Parameter is not a class");
}
... | [
"public",
"static",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
">",
"getSubclassesInPackage",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"packageName",
",",
"boolean",
"recursive",
")",
"throws",
"ReflectionException",
"{",
"Validate",
".",
"notNu... | <p>
Returns a {@link LinkedHashSet} of {@link Class} objects containing all
classes of a specified package (including subpackages) which extend the
given class.
</p>
<p>
Example:
</p>
<pre>
String pack = "de.uni.freiburg.iig.telematik.sepia";
Class<?> superclass = AbstractPlace.class;
LinkedHashSet<... | [
"<p",
">",
"Returns",
"a",
"{",
"@link",
"LinkedHashSet",
"}",
"of",
"{",
"@link",
"Class",
"}",
"objects",
"containing",
"all",
"classes",
"of",
"a",
"specified",
"package",
"(",
"including",
"subpackages",
")",
"which",
"extend",
"the",
"given",
"class",
... | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/reflect/ReflectionUtils.java#L317-L336 | train | Get all subclasses of a class in a package. | Of course, here is the Java code you requested:
```java
public static LinkedHashSet<Class<?>> getSubclassesInPackage(Class<?> clazz, String packageName, boolean recursive) throws ReflectionException {
Validate.notNull(clazz);
if (clazz.isInterface() || clazz.isEnum()) {
throw new ParameterE... |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.registerScriptType | public void registerScriptType(ScriptType type) {
if (typeMap.containsKey(type.getName())) {
throw new InvalidParameterException("ScriptType already registered: " + type.getName());
}
this.typeMap.put(type.getName(), type);
this.getTreeModel().addType(type);
if (shouldLoadTemplatesOnScriptTypeRegis... | java | public void registerScriptType(ScriptType type) {
if (typeMap.containsKey(type.getName())) {
throw new InvalidParameterException("ScriptType already registered: " + type.getName());
}
this.typeMap.put(type.getName(), type);
this.getTreeModel().addType(type);
if (shouldLoadTemplatesOnScriptTypeRegis... | [
"public",
"void",
"registerScriptType",
"(",
"ScriptType",
"type",
")",
"{",
"if",
"(",
"typeMap",
".",
"containsKey",
"(",
"type",
".",
"getName",
"(",
")",
")",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"(",
"\"ScriptType already registered: \"",
... | Registers a new type of script.
<p>
The script is added to the tree of scripts and its templates loaded, if any.
@param type the new type of script
@throws InvalidParameterException if a script type with same name is already registered
@see #removeScripType(ScriptType) | [
"Registers",
"a",
"new",
"type",
"of",
"script",
".",
"<p",
">",
"The",
"script",
"is",
"added",
"to",
"the",
"tree",
"of",
"scripts",
"and",
"its",
"templates",
"loaded",
"if",
"any",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L493-L509 | train | Registers a new ScriptType. | Of course, here is the Java code you requested:
```java
public void registerScriptType(ScriptType type) {
if (typeMap.containsKey(type.getName())) {
throw new InvalidParameterException("ScriptType already registered: " + type.getName());
}
this.typeMap.put(type.getName(), type);
this.getTreeModel().add... |
nutzam/nutz | src/org/nutz/lang/Strings.java | Strings.isQuoteBy | public static boolean isQuoteBy(String str, String l, String r) {
if (null == str || null == l || null == r)
return false;
return str.startsWith(l) && str.endsWith(r);
} | java | public static boolean isQuoteBy(String str, String l, String r) {
if (null == str || null == l || null == r)
return false;
return str.startsWith(l) && str.endsWith(r);
} | [
"public",
"static",
"boolean",
"isQuoteBy",
"(",
"String",
"str",
",",
"String",
"l",
",",
"String",
"r",
")",
"{",
"if",
"(",
"null",
"==",
"str",
"||",
"null",
"==",
"l",
"||",
"null",
"==",
"r",
")",
"return",
"false",
";",
"return",
"str",
".",... | 测试此字符串是否被指定的左字符串和右字符串所包裹
@param str
字符串
@param l
左字符串
@param r
右字符串
@return 字符串是被左字符串和右字符串包裹 | [
"测试此字符串是否被指定的左字符串和右字符串所包裹"
] | a38694d5cbda2692e7931ab093c168487a6a4bfe | https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/lang/Strings.java#L705-L709 | valid | Checks if the string is a quote by the l and r characters. | Of course, here is the Java code you requested:
```java
public static boolean isQuoteBy(String str, String l, String r) {
if (null == str || null == l || null == r)
return false;
return str.startsWith(l) && str.endsWith(r);
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsVfsSitemapService.java | CmsVfsSitemapService.collectGalleryTypes | @SuppressWarnings("deprecation")
private List<CmsGalleryType> collectGalleryTypes() {
Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
Map<String, List<String>> galleryContentTypes = new HashMap<String, List<String>>();
List<CmsGalleryType> result = new Ar... | java | @SuppressWarnings("deprecation")
private List<CmsGalleryType> collectGalleryTypes() {
Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
Map<String, List<String>> galleryContentTypes = new HashMap<String, List<String>>();
List<CmsGalleryType> result = new Ar... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"List",
"<",
"CmsGalleryType",
">",
"collectGalleryTypes",
"(",
")",
"{",
"Locale",
"wpLocale",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplaceLocale",
"(",
"getCmsObject",
"... | Returns all available gallery folder resource types.<p>
@return the gallery folder resource types | [
"Returns",
"all",
"available",
"gallery",
"folder",
"resource",
"types",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsVfsSitemapService.java#L1491-L1540 | train | Collect the gallery types. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
private List<CmsGalleryType> collectGalleryTypes() {
Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
Map<String, List<String>> galleryContentTypes = new HashMap<String, List... |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/libcore/reflect/Types.java | Types.appendTypeName | @ObjectiveCName("appendTypeName:class:")
public static void appendTypeName(StringBuilder out, Class<?> c) {
int dimensions = 0;
while (c.isArray()) {
c = c.getComponentType();
dimensions++;
}
out.append(c.getName());
for (int d = 0; d < dimensions; d++... | java | @ObjectiveCName("appendTypeName:class:")
public static void appendTypeName(StringBuilder out, Class<?> c) {
int dimensions = 0;
while (c.isArray()) {
c = c.getComponentType();
dimensions++;
}
out.append(c.getName());
for (int d = 0; d < dimensions; d++... | [
"@",
"ObjectiveCName",
"(",
"\"appendTypeName:class:\"",
")",
"public",
"static",
"void",
"appendTypeName",
"(",
"StringBuilder",
"out",
",",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"int",
"dimensions",
"=",
"0",
";",
"while",
"(",
"c",
".",
"isArray",
"(",... | Appends the best {@link #toString} name for {@code c} to {@code out}.
This works around the fact that {@link Class#getName} is lousy for
primitive arrays (it writes "[C" instead of "char[]") and {@link
Class#getCanonicalName()} is lousy for nested classes (it uses a "."
separator rather than a "$" separator). | [
"Appends",
"the",
"best",
"{"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/reflect/Types.java#L104-L115 | train | Append type name. | Of course, here is the Java code you requested:
```java
@ObjectiveCName("appendTypeName:class:")
public static void appendTypeName(StringBuilder out, Class<?> c) {
int dimensions = 0;
while (c.isArray()) {
c = c.getComponentType();
dimensions++;
}
out.append(... |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/AbstractFileStorageEngine.java | AbstractFileStorageEngine.deleteIfExistsRecursively | protected boolean deleteIfExistsRecursively(Path path) throws IOException {
try {
return Files.deleteIfExists(path);
}
catch (DirectoryNotEmptyException ex) {
//do recursive delete
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Overr... | java | protected boolean deleteIfExistsRecursively(Path path) throws IOException {
try {
return Files.deleteIfExists(path);
}
catch (DirectoryNotEmptyException ex) {
//do recursive delete
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Overr... | [
"protected",
"boolean",
"deleteIfExistsRecursively",
"(",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"Files",
".",
"deleteIfExists",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"DirectoryNotEmptyException",
"ex",
")",
"{",
"//do recur... | Deletes the file or directory recursively if it exists.
@param path
@return
@throws IOException | [
"Deletes",
"the",
"file",
"or",
"directory",
"recursively",
"if",
"it",
"exists",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/AbstractFileStorageEngine.java#L75-L96 | train | Delete the file or directory if it exists recursively. | Of course, here is the Java code you requested:
```java
protected boolean deleteIfExistsRecursively(Path path) throws IOException {
try {
return Files.deleteIfExists(path);
}
catch (DirectoryNotEmptyException ex) {
//do recursive delete
Files.walkFileTree(pat... |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificateVersionsNextWithServiceResponseAsync | public Observable<ServiceResponse<Page<CertificateItem>>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) {
return getCertificateVersionsNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<Certif... | java | public Observable<ServiceResponse<Page<CertificateItem>>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) {
return getCertificateVersionsNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<Certif... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"CertificateItem",
">",
">",
">",
"getCertificateVersionsNextWithServiceResponseAsync",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"return",
"getCertificateVersionsNextSinglePageAsync",
"(",
"nextPageL... | List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thr... | [
"List",
"the",
"versions",
"of",
"a",
"certificate",
".",
"The",
"GetCertificateVersions",
"operation",
"returns",
"the",
"versions",
"of",
"a",
"certificate",
"in",
"the",
"specified",
"key",
"vault",
".",
"This",
"operation",
"requires",
"the",
"certificates",
... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L12691-L12703 | train | Gets the certificate versions of a single certificate. | Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<Page<CertificateItem>>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) {
return getCertificateVersionsNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<... |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/collections/JMTimeSeries.java | JMTimeSeries.put | @Override
public V put(Long timestamp, V object) {
return this.timeSeriesMap.put(buildKeyTimestamp(timestamp), object);
} | java | @Override
public V put(Long timestamp, V object) {
return this.timeSeriesMap.put(buildKeyTimestamp(timestamp), object);
} | [
"@",
"Override",
"public",
"V",
"put",
"(",
"Long",
"timestamp",
",",
"V",
"object",
")",
"{",
"return",
"this",
".",
"timeSeriesMap",
".",
"put",
"(",
"buildKeyTimestamp",
"(",
"timestamp",
")",
",",
"object",
")",
";",
"}"
] | /*
(non-Javadoc)
@see java.util.Map#put(java.lang.Object, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 9e407b3f28a7990418a1e877229fa8344f4d78a5 | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/collections/JMTimeSeries.java#L56-L59 | train | Add a record to the cache. | Of course, here is the Java code you requested:
```java
@Override
public V put(Long timestamp, V object) {
return this.timeSeriesMap.put(buildKeyTimestamp(timestamp), object);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ConcurrentHashSet.java | ConcurrentHashSet.getSubSet | private final java.util.Set getSubSet(final Object key)
{
// Make sure the hashcode is positive.
return subSets[(int) ((key.hashCode() & 0x7FFFFFFF) % subSets.length)];
} | java | private final java.util.Set getSubSet(final Object key)
{
// Make sure the hashcode is positive.
return subSets[(int) ((key.hashCode() & 0x7FFFFFFF) % subSets.length)];
} | [
"private",
"final",
"java",
".",
"util",
".",
"Set",
"getSubSet",
"(",
"final",
"Object",
"key",
")",
"{",
"// Make sure the hashcode is positive.",
"return",
"subSets",
"[",
"(",
"int",
")",
"(",
"(",
"key",
".",
"hashCode",
"(",
")",
"&",
"0x7FFFFFFF",
"... | /*
Compute the subSet containing a key.
@param Object the key to be found.
@return java.util.Set which could contain the key. | [
"/",
"*",
"Compute",
"the",
"subSet",
"containing",
"a",
"key",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ConcurrentHashSet.java#L57-L61 | train | Get the subset of the specified key. | Of course, here is the Java code you requested:
```java
private final java.util.Set getSubSet(final Object key)
{
// Make sure the hashcode is positive.
return subSets[(int) ((key.hashCode() & 0x7FFFFFFF) % subSets.length)];
}
```
Hope this helps! |
op4j/op4j | src/main/java/org/op4j/functions/FnLong.java | FnLong.eqValue | public static final Function<Long,Boolean> eqValue(final Number object) {
return (Function<Long,Boolean>)((Function)FnObject.eqValue(object));
} | java | public static final Function<Long,Boolean> eqValue(final Number object) {
return (Function<Long,Boolean>)((Function)FnObject.eqValue(object));
} | [
"public",
"static",
"final",
"Function",
"<",
"Long",
",",
"Boolean",
">",
"eqValue",
"(",
"final",
"Number",
"object",
")",
"{",
"return",
"(",
"Function",
"<",
"Long",
",",
"Boolean",
">",
")",
"(",
"(",
"Function",
")",
"FnObject",
".",
"eqValue",
"... | <p>
Determines whether the target object and the specified object are equal
in value, this is, whether <tt>target.compareTo(object) == 0</tt>. Both
the target and the specified object have to implement {@link Comparable}.
</p>
@param object the object to compare to the target
@return true if both objects are equal acc... | [
"<p",
">",
"Determines",
"whether",
"the",
"target",
"object",
"and",
"the",
"specified",
"object",
"are",
"equal",
"in",
"value",
"this",
"is",
"whether",
"<tt",
">",
"target",
".",
"compareTo",
"(",
"object",
")",
"==",
"0<",
"/",
"tt",
">",
".",
"Bo... | b577596dfe462089d3dd169666defc6de7ad289a | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnLong.java#L337-L339 | train | Returns a function that returns true if the first argument is equal to the second argument. | Of course, here is the Java code you requested:
```java
public static final Function<Long,Boolean> eqValue(final Number object) {
return (Function<Long,Boolean>)((Function)FnObject.eqValue(object));
}
```
Hope this helps! |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.saveAlbumsForCurrentUser | public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(String... ids) {
return new SaveAlbumsForCurrentUserRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(concat(ids, ','));
} | java | public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(String... ids) {
return new SaveAlbumsForCurrentUserRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(concat(ids, ','));
} | [
"public",
"SaveAlbumsForCurrentUserRequest",
".",
"Builder",
"saveAlbumsForCurrentUser",
"(",
"String",
"...",
"ids",
")",
"{",
"return",
"new",
"SaveAlbumsForCurrentUserRequest",
".",
"Builder",
"(",
"accessToken",
")",
".",
"setDefaults",
"(",
"httpManager",
",",
"s... | Save albums in the users "Your Music" library.
@param ids The album IDs to add to the users library. Maximum: 50 IDs.
@return A {@link SaveAlbumsForCurrentUserRequest.Builder}.
@see <a href="https://developer.spotify.com/web-api/user-guide/#spotify-uris-and-ids">Spotify: URLs & IDs</a> | [
"Save",
"albums",
"in",
"the",
"users",
"Your",
"Music",
"library",
"."
] | c06b8512344c0310d0c1df362fa267879021da2e | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L810-L814 | train | Save albums for current user. | Of course, here is the Java code you requested:
```java
public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(String... ids) {
return new SaveAlbumsForCurrentUserRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(concat(ids, ','));
}
```
Hop... |
sirensolutions/siren-join | src/main/java/solutions/siren/join/action/terms/collector/LongBloomFilter.java | LongBloomFilter.getblock | protected static long getblock(byte[] key, int offset, int index) {
int i_8 = index << 3;
int blockOffset = offset + i_8;
return ((long) key[blockOffset + 0] & 0xff) + (((long) key[blockOffset + 1] & 0xff) << 8) +
(((long) key[blockOffset + 2] & 0xff) << 16) + (((long) key[blockOffset + 3] & 0xf... | java | protected static long getblock(byte[] key, int offset, int index) {
int i_8 = index << 3;
int blockOffset = offset + i_8;
return ((long) key[blockOffset + 0] & 0xff) + (((long) key[blockOffset + 1] & 0xff) << 8) +
(((long) key[blockOffset + 2] & 0xff) << 16) + (((long) key[blockOffset + 3] & 0xf... | [
"protected",
"static",
"long",
"getblock",
"(",
"byte",
"[",
"]",
"key",
",",
"int",
"offset",
",",
"int",
"index",
")",
"{",
"int",
"i_8",
"=",
"index",
"<<",
"3",
";",
"int",
"blockOffset",
"=",
"offset",
"+",
"i_8",
";",
"return",
"(",
"(",
"lon... | NOTE: don't replace this code with the o.e.common.hashing.MurmurHash3 method which returns a different hash | [
"NOTE",
":",
"don",
"t",
"replace",
"this",
"code",
"with",
"the",
"o",
".",
"e",
".",
"common",
".",
"hashing",
".",
"MurmurHash3",
"method",
"which",
"returns",
"a",
"different",
"hash"
] | cba1111b209ce6f72ab7750d5488a573a6c77fe5 | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/collector/LongBloomFilter.java#L355-L362 | train | Get block from byte array. | Of course, here is the Java code you requested:
```java
protected static long getblock(byte[] key, int offset, int index) {
int i_8 = index << 3;
int blockOffset = offset + i_8;
return ((long) key[blockOffset + 0] & 0xff) + (((long) key[blockOffset + 1] & 0xff) << 8) +
(((long) key[blockOffset ... |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/GetMaintenanceWindowExecutionResult.java | GetMaintenanceWindowExecutionResult.setTaskIds | public void setTaskIds(java.util.Collection<String> taskIds) {
if (taskIds == null) {
this.taskIds = null;
return;
}
this.taskIds = new com.amazonaws.internal.SdkInternalList<String>(taskIds);
} | java | public void setTaskIds(java.util.Collection<String> taskIds) {
if (taskIds == null) {
this.taskIds = null;
return;
}
this.taskIds = new com.amazonaws.internal.SdkInternalList<String>(taskIds);
} | [
"public",
"void",
"setTaskIds",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"taskIds",
")",
"{",
"if",
"(",
"taskIds",
"==",
"null",
")",
"{",
"this",
".",
"taskIds",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"taskIds",
... | <p>
The ID of the task executions from the Maintenance Window execution.
</p>
@param taskIds
The ID of the task executions from the Maintenance Window execution. | [
"<p",
">",
"The",
"ID",
"of",
"the",
"task",
"executions",
"from",
"the",
"Maintenance",
"Window",
"execution",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/GetMaintenanceWindowExecutionResult.java#L128-L135 | train | Sets the value taskIds property. | Of course, here is the Java code you requested:
```java
public void setTaskIds(java.util.Collection<String> taskIds) {
if (taskIds == null) {
this.taskIds = null;
return;
}
this.taskIds = new com.amazonaws.internal.SdkInternalList<String>(taskIds);
}
```
Hope this ... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/ResourceObjectIncludeImpl.java | ResourceObjectIncludeImpl.eGet | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__OBJ_TYPE:
return getObjType();
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__OBJ_NAME:
return getObjName();
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__XOBJ... | java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__OBJ_TYPE:
return getObjType();
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__OBJ_NAME:
return getObjName();
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__XOBJ... | [
"@",
"Override",
"public",
"Object",
"eGet",
"(",
"int",
"featureID",
",",
"boolean",
"resolve",
",",
"boolean",
"coreType",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"RESOURCE_OBJECT_INCLUDE__OBJ_TYPE",
":",
"return",
"getObj... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/ResourceObjectIncludeImpl.java#L263-L278 | train | Override eGet to return the object associated with the featureID | Of course, here is the Java code you requested:
```java
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__OBJ_TYPE:
return getObjType();
case AfplibPackage.RESOURCE_OBJECT_INCLUDE__OBJ_NAME:
return getObjNa... |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java | GlobalSuffixFinders.findLinear | public static <I, D> List<Word<I>> findLinear(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle... | java | public static <I, D> List<Word<I>> findLinear(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle... | [
"public",
"static",
"<",
"I",
",",
"D",
">",
"List",
"<",
"Word",
"<",
"I",
">",
">",
"findLinear",
"(",
"Query",
"<",
"I",
",",
"D",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
",",
"SuffixOutput",
"<",
"I",
","... | Returns the suffix (plus all of its suffixes, if {@code allSuffixes} is true) found by the access sequence
transformation in ascending linear order.
@param ceQuery
the counterexample query
@param asTransformer
the access sequence transformer
@param hypOutput
interface to the hypothesis output
@param oracle
interface t... | [
"Returns",
"the",
"suffix",
"(",
"plus",
"all",
"of",
"its",
"suffixes",
"if",
"{",
"@code",
"allSuffixes",
"}",
"is",
"true",
")",
"found",
"by",
"the",
"access",
"sequence",
"transformation",
"in",
"ascending",
"linear",
"order",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java#L276-L283 | train | Find linear suffixes. | Of course, here is the Java code you requested:
```java
public static <I, D> List<Word<I>> findLinear(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
... |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/OOServer.java | OOServer.getDefaultOOoOptions | public static List<String> getDefaultOOoOptions() {
ArrayList<String> options = new ArrayList<String>();
options.add("-nologo");
options.add("-nodefault");
options.add("-norestore");
options.add("-nocrashreport");
options.add("-nolockcheck");
options.add("-nofir... | java | public static List<String> getDefaultOOoOptions() {
ArrayList<String> options = new ArrayList<String>();
options.add("-nologo");
options.add("-nodefault");
options.add("-norestore");
options.add("-nocrashreport");
options.add("-nolockcheck");
options.add("-nofir... | [
"public",
"static",
"List",
"<",
"String",
">",
"getDefaultOOoOptions",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"options",
".",
"add",
"(",
"\"-nologo\"",
")",
";",
"options",... | Returns the list of default options.
!Note! we are using old version notation (- instead of --) to support old version of office
@return The list of default options | [
"Returns",
"the",
"list",
"of",
"default",
"options",
".",
"!Note!",
"we",
"are",
"using",
"old",
"version",
"notation",
"(",
"-",
"instead",
"of",
"--",
")",
"to",
"support",
"old",
"version",
"of",
"office"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/OOServer.java#L165-L178 | train | Get the default options for the ooo. | Of course, here is the Java code you requested:
```java
public static List<String> getDefaultOOoOptions() {
ArrayList<String> options = new ArrayList<String>();
options.add("-nologo");
options.add("-nodefault");
options.add("-norestore");
options.add("-nocrashreport");
... |
riversun/string-grabber | src/main/java/org/riversun/string_grabber/StringGrabber.java | StringGrabber.split | public StringGrabberList split(String regexp) {
final StringGrabberList retList = new StringGrabberList();
final String string = sb.toString();
String[] splitedStrings = string.split(regexp);
for (String str : splitedStrings) {
retList.add(new StringGrabber(str));
}
return retList;
} | java | public StringGrabberList split(String regexp) {
final StringGrabberList retList = new StringGrabberList();
final String string = sb.toString();
String[] splitedStrings = string.split(regexp);
for (String str : splitedStrings) {
retList.add(new StringGrabber(str));
}
return retList;
} | [
"public",
"StringGrabberList",
"split",
"(",
"String",
"regexp",
")",
"{",
"final",
"StringGrabberList",
"retList",
"=",
"new",
"StringGrabberList",
"(",
")",
";",
"final",
"String",
"string",
"=",
"sb",
".",
"toString",
"(",
")",
";",
"String",
"[",
"]",
... | Splits this string around matches of the given regular expression.
@param regexp
@return | [
"Splits",
"this",
"string",
"around",
"matches",
"of",
"the",
"given",
"regular",
"expression",
"."
] | b5aadc21fe15f50d35392188dec6ab81dcf8d464 | https://github.com/riversun/string-grabber/blob/b5aadc21fe15f50d35392188dec6ab81dcf8d464/src/main/java/org/riversun/string_grabber/StringGrabber.java#L669-L683 | train | Split this string into a list of strings. | Of course, here is the Java code you requested:
```java
public StringGrabberList split(String regexp) {
final StringGrabberList retList = new StringGrabberList();
final String string = sb.toString();
String[] splitedStrings = string.split(regexp);
for (String str : splitedStrings) {
retList.add(new Stri... |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/EnaValidator.java | EnaValidator.writeResultsToFile | private void writeResultsToFile(ValidationPlanResult planResult) throws IOException
{
/**
* first set any report messages (probably exceptional that the
* translation report needs to get set outside the embl-api-core package
* due to the need for embl-ff writers
**/
for (ValidationResult result : plan... | java | private void writeResultsToFile(ValidationPlanResult planResult) throws IOException
{
/**
* first set any report messages (probably exceptional that the
* translation report needs to get set outside the embl-api-core package
* due to the need for embl-ff writers
**/
for (ValidationResult result : plan... | [
"private",
"void",
"writeResultsToFile",
"(",
"ValidationPlanResult",
"planResult",
")",
"throws",
"IOException",
"{",
"/**\n\t\t * first set any report messages (probably exceptional that the\n\t\t * translation report needs to get set outside the embl-api-core package\n\t\t * due to the need f... | Write results to file.
@param planResult the plan result
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"results",
"to",
"file",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/EnaValidator.java#L913-L955 | train | Write the results to the file. | Of course, here is the Java code you requested:
```java
private void writeResultsToFile(ValidationPlanResult planResult) throws IOException
{
/**
* first set any report messages (probably exceptional that the
* translation report needs to get set outside the embl-api-core package
* due to the need for emb... |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Completable.java | Completable.merge0 | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
private static Completable merge0(Publisher<? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
ObjectHelper.requireNonNull(sources, "sources is null");
ObjectH... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
private static Completable merge0(Publisher<? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
ObjectHelper.requireNonNull(sources, "sources is null");
ObjectH... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"private",
"static",
"Completable",
"merge0",
"(",
"Publisher",
"<",
"?",
"extends",
"CompletableSourc... | Returns a Completable instance that keeps subscriptions to a limited number of sources at once and
completes only when all source Completables terminate in one way or another, combining any exceptions
thrown by either the sources Observable or the inner Completable instances.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The ... | [
"Returns",
"a",
"Completable",
"instance",
"that",
"keeps",
"subscriptions",
"to",
"a",
"limited",
"number",
"of",
"sources",
"at",
"once",
"and",
"completes",
"only",
"when",
"all",
"source",
"Completables",
"terminate",
"in",
"one",
"way",
"or",
"another",
"... | 8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Completable.java#L755-L762 | train | Merge a sequence of CompletableSource with a single Sequence of Sequence of CompletableSource. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
private static Completable merge0(Publisher<? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
ObjectHelper.re... |
googlegenomics/dataflow-java | src/main/java/com/google/cloud/genomics/dataflow/functions/verifybamid/Solver.java | Solver.maximize | public static double maximize(UnivariateFunction fn, double gridStart, double gridEnd,
double gridStep, double relErr, double absErr, int maxIter, int maxEval) {
Interval interval = gridSearch(fn, gridStart, gridEnd, gridStep);
BrentOptimizer bo = new BrentOptimizer(relErr, absErr);
UnivariatePointVal... | java | public static double maximize(UnivariateFunction fn, double gridStart, double gridEnd,
double gridStep, double relErr, double absErr, int maxIter, int maxEval) {
Interval interval = gridSearch(fn, gridStart, gridEnd, gridStep);
BrentOptimizer bo = new BrentOptimizer(relErr, absErr);
UnivariatePointVal... | [
"public",
"static",
"double",
"maximize",
"(",
"UnivariateFunction",
"fn",
",",
"double",
"gridStart",
",",
"double",
"gridEnd",
",",
"double",
"gridStep",
",",
"double",
"relErr",
",",
"double",
"absErr",
",",
"int",
"maxIter",
",",
"int",
"maxEval",
")",
"... | Maximizes a univariate function using a grid search followed by Brent's algorithm.
@param fn the likelihood function to minimize
@param gridStart the lower bound for the grid search
@param gridEnd the upper bound for the grid search
@param gridStep step size for the grid search
@param relErr relative error tolerance f... | [
"Maximizes",
"a",
"univariate",
"function",
"using",
"a",
"grid",
"search",
"followed",
"by",
"Brent",
"s",
"algorithm",
"."
] | ef2c56ed1a6397843c55102748b8c2b12aaa4772 | https://github.com/googlegenomics/dataflow-java/blob/ef2c56ed1a6397843c55102748b8c2b12aaa4772/src/main/java/com/google/cloud/genomics/dataflow/functions/verifybamid/Solver.java#L86-L97 | train | Maximize a UnivariateFunction. | Of course, here is the Java code you requested:
```java
public static double maximize(UnivariateFunction fn, double gridStart, double gridEnd,
double gridStep, double relErr, double absErr, int maxIter, int maxEval) {
Interval interval = gridSearch(fn, gridStart, gridEnd, gridStep);
BrentOptimizer bo = n... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.toWriter | public static void toWriter(String templateFileName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) {
final VelocityContext context = new VelocityContext();
parseRequest(context, request);
parseSession(context, request.getSession(false));
Writer writer = nu... | java | public static void toWriter(String templateFileName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) {
final VelocityContext context = new VelocityContext();
parseRequest(context, request);
parseSession(context, request.getSession(false));
Writer writer = nu... | [
"public",
"static",
"void",
"toWriter",
"(",
"String",
"templateFileName",
",",
"javax",
".",
"servlet",
".",
"http",
".",
"HttpServletRequest",
"request",
",",
"javax",
".",
"servlet",
".",
"http",
".",
"HttpServletResponse",
"response",
")",
"{",
"final",
"V... | 生成内容写到响应内容中<br>
模板的变量来自于Request的Attribute对象
@param templateFileName 模板文件
@param request 请求对象,用于获取模板中的变量值
@param response 响应对象 | [
"生成内容写到响应内容中<br",
">",
"模板的变量来自于Request的Attribute对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L214-L228 | train | Write the Velocity content template to the response writer. | Of course, here is the Java code you requested:
```java
public static void toWriter(String templateFileName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) {
final VelocityContext context = new VelocityContext();
parseRequest(context, request);
parseSession(con... |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.deleteHook | public void deleteHook(Object projectIdOrPath, Integer hookId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "hooks", hookId);
... | java | public void deleteHook(Object projectIdOrPath, Integer hookId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "hooks", hookId);
... | [
"public",
"void",
"deleteHook",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"hookId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
".",
... | Deletes a hook from the project.
<pre><code>DELETE /projects/:id/hooks/:hook_id</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param hookId the project hook ID to delete
@throws GitLabApiException if any exception occurs | [
"Deletes",
"a",
"hook",
"from",
"the",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L1738-L1741 | train | Delete a specific hook from a project. | Of course, here is the Java code you requested:
```java
public void deleteHook(Object projectIdOrPath, Integer hookId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", g... |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/NumberFormatContext.java | NumberFormatContext.shortOrdinal | public String shortOrdinal(Long n) {
return (n == null) ? null : shortOrdinal(n.longValue());
} | java | public String shortOrdinal(Long n) {
return (n == null) ? null : shortOrdinal(n.longValue());
} | [
"public",
"String",
"shortOrdinal",
"(",
"Long",
"n",
")",
"{",
"return",
"(",
"n",
"==",
"null",
")",
"?",
"null",
":",
"shortOrdinal",
"(",
"n",
".",
"longValue",
"(",
")",
")",
";",
"}"
] | A function that converts an integer to a short ordinal value.
i.e. 1st, 2nd, 3rd etc.
@param n the number to convert
@return a String containing the short ordinal value of the specified
number | [
"A",
"function",
"that",
"converts",
"an",
"integer",
"to",
"a",
"short",
"ordinal",
"value",
".",
"i",
".",
"e",
".",
"1st",
"2nd",
"3rd",
"etc",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/NumberFormatContext.java#L189-L191 | train | Returns the short ordinal of the given long. | Of course, here is the Java code you requested:
```java
public String shortOrdinal(Long n) {
return (n == null) ? null : shortOrdinal(n.longValue());
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/AWSDatabaseMigrationServiceClient.java | AWSDatabaseMigrationServiceClient.deleteReplicationSubnetGroup | @Override
public DeleteReplicationSubnetGroupResult deleteReplicationSubnetGroup(DeleteReplicationSubnetGroupRequest request) {
request = beforeClientExecution(request);
return executeDeleteReplicationSubnetGroup(request);
} | java | @Override
public DeleteReplicationSubnetGroupResult deleteReplicationSubnetGroup(DeleteReplicationSubnetGroupRequest request) {
request = beforeClientExecution(request);
return executeDeleteReplicationSubnetGroup(request);
} | [
"@",
"Override",
"public",
"DeleteReplicationSubnetGroupResult",
"deleteReplicationSubnetGroup",
"(",
"DeleteReplicationSubnetGroupRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteReplicationSubnetGroup",
... | <p>
Deletes a subnet group.
</p>
@param deleteReplicationSubnetGroupRequest
@return Result of the DeleteReplicationSubnetGroup operation returned by the service.
@throws InvalidResourceStateException
The resource is in a state that prevents it from being used for database migration.
@throws ResourceNotFoundException
T... | [
"<p",
">",
"Deletes",
"a",
"subnet",
"group",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/AWSDatabaseMigrationServiceClient.java#L1084-L1088 | train | Deletes a replication subnet group. | Of course, here is the Java code you requested:
```java
@Override
public DeleteReplicationSubnetGroupResult deleteReplicationSubnetGroup(DeleteReplicationSubnetGroupRequest request) {
request = beforeClientExecution(request);
return executeDeleteReplicationSubnetGroup(request);
}
```
Hope this... |
bushidowallet/bushido-java-service | bushido-wallet-service/src/main/java/com/authy/api/Users.java | Users.createUser | public com.authy.api.User createUser(String email, String phone, String countryCode) {
User user = new User(email, phone, countryCode);
String content = this.post(NEW_USER_PATH, user);
return userFromXml(this.getStatus(), content);
} | java | public com.authy.api.User createUser(String email, String phone, String countryCode) {
User user = new User(email, phone, countryCode);
String content = this.post(NEW_USER_PATH, user);
return userFromXml(this.getStatus(), content);
} | [
"public",
"com",
".",
"authy",
".",
"api",
".",
"User",
"createUser",
"(",
"String",
"email",
",",
"String",
"phone",
",",
"String",
"countryCode",
")",
"{",
"User",
"user",
"=",
"new",
"User",
"(",
"email",
",",
"phone",
",",
"countryCode",
")",
";",
... | Create a new user using his e-mail, phone and country code.
@param email
@param phone
@param countryCode
@return a User instance | [
"Create",
"a",
"new",
"user",
"using",
"his",
"e",
"-",
"mail",
"phone",
"and",
"country",
"code",
"."
] | e1a0157527e57459b509718044d2df44084876a2 | https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-wallet-service/src/main/java/com/authy/api/Users.java#L43-L49 | train | Create a new user. | Of course, here is the Java code you requested:
```java
public com.authy.api.User createUser(String email, String phone, String countryCode) {
User user = new User(email, phone, countryCode);
String content = this.post(NEW_USER_PATH, user);
return userFromXml(this.getStatus(), content);
}
```
Hope this hel... |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsWidgetDialog.java | CmsWidgetDialog.writeDialog | public void writeDialog() throws IOException, JspException {
if (isForwarded()) {
return;
}
switch (getAction()) {
case ACTION_CANCEL:
case ACTION_ERROR:
case ACTION_SAVE:
break;
case ACTION_DEFAULT:
defaul... | java | public void writeDialog() throws IOException, JspException {
if (isForwarded()) {
return;
}
switch (getAction()) {
case ACTION_CANCEL:
case ACTION_ERROR:
case ACTION_SAVE:
break;
case ACTION_DEFAULT:
defaul... | [
"public",
"void",
"writeDialog",
"(",
")",
"throws",
"IOException",
",",
"JspException",
"{",
"if",
"(",
"isForwarded",
"(",
")",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"getAction",
"(",
")",
")",
"{",
"case",
"ACTION_CANCEL",
":",
"case",
"ACTION_... | Writes the dialog html code, only if the <code>{@link #ACTION_DEFAULT}</code> is set.<p>
@throws JspException if dialog actions fail
@throws IOException if writing to the JSP out fails, or in case of errors forwarding to the required result page | [
"Writes",
"the",
"dialog",
"html",
"code",
"only",
"if",
"the",
"<code",
">",
"{",
"@link",
"#ACTION_DEFAULT",
"}",
"<",
"/",
"code",
">",
"is",
"set",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsWidgetDialog.java#L754-L772 | train | Write the dialog. | Of course, here is the Java code you requested:
```java
public void writeDialog() throws IOException, JspException {
if (isForwarded()) {
return;
}
switch (getAction()) {
case ACTION_CANCEL:
case ACTION_ERROR:
case ACTION_SAVE:
br... |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java | RevisionApi.checkMapping | protected int checkMapping(final int articleID, final int revisionCounter)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
// Check for the correct revisionCounter mapping
try {
statement = this.connection.prepareStatement("SEL... | java | protected int checkMapping(final int articleID, final int revisionCounter)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
// Check for the correct revisionCounter mapping
try {
statement = this.connection.prepareStatement("SEL... | [
"protected",
"int",
"checkMapping",
"(",
"final",
"int",
"articleID",
",",
"final",
"int",
"revisionCounter",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"ResultSet",
"result",
"=",
"null",
";",
"// Check for the correct r... | This method maps the chronological order to the revisionCounter.
@param articleID
ID of the article
@param revisionCounter
chronological position
@return position in the chronological order
@throws SQLException
if an error occurs while accesing the database. | [
"This",
"method",
"maps",
"the",
"chronological",
"order",
"to",
"the",
"revisionCounter",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1575-L1606 | train | Check if the mapping for the articleID is correct. | Of course, here is the Java code you requested:
```java
protected int checkMapping(final int articleID, final int revisionCounter)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
// Check for the correct revisionCounter mapping
try {
... |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSUtil.java | DFSUtil.string2Bytes | public static byte[] string2Bytes(String str) {
try {
final int len = str.length();
// if we can, we will use it to return the bytes
byte[] rawBytes = new byte[len];
// get all chars of the given string
char[] charArray = UTF8.getCharArray(len);
str.getChars(0, len, charAr... | java | public static byte[] string2Bytes(String str) {
try {
final int len = str.length();
// if we can, we will use it to return the bytes
byte[] rawBytes = new byte[len];
// get all chars of the given string
char[] charArray = UTF8.getCharArray(len);
str.getChars(0, len, charAr... | [
"public",
"static",
"byte",
"[",
"]",
"string2Bytes",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"final",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"// if we can, we will use it to return the bytes",
"byte",
"[",
"]",
"rawBytes",
"=",
"new",
... | Converts a string to a byte array using UTF8 encoding. | [
"Converts",
"a",
"string",
"to",
"a",
"byte",
"array",
"using",
"UTF8",
"encoding",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSUtil.java#L160-L185 | train | Convert a String to a byte array. | Of course, here is the Java code you requested:
```java
public static byte[] string2Bytes(String str) {
try {
final int len = str.length();
// if we can, we will use it to return the bytes
byte[] rawBytes = new byte[len];
// get all chars of the given string
char[] charArray = ... |
Prototik/HoloEverywhere | library/src/org/holoeverywhere/widget/datetimepicker/time/TimePickerDialog.java | TimePickerDialog.getEnteredTime | private int[] getEnteredTime(Boolean[] enteredZeros) {
int amOrPm = -1;
int startIndex = 1;
if (!mIs24HourMode && isTypedTimeFullyLegal()) {
int keyCode = mTypedTimes.get(mTypedTimes.size() - 1);
if (keyCode == getAmOrPmKeyCode(AM)) {
amOrPm = AM;
... | java | private int[] getEnteredTime(Boolean[] enteredZeros) {
int amOrPm = -1;
int startIndex = 1;
if (!mIs24HourMode && isTypedTimeFullyLegal()) {
int keyCode = mTypedTimes.get(mTypedTimes.size() - 1);
if (keyCode == getAmOrPmKeyCode(AM)) {
amOrPm = AM;
... | [
"private",
"int",
"[",
"]",
"getEnteredTime",
"(",
"Boolean",
"[",
"]",
"enteredZeros",
")",
"{",
"int",
"amOrPm",
"=",
"-",
"1",
";",
"int",
"startIndex",
"=",
"1",
";",
"if",
"(",
"!",
"mIs24HourMode",
"&&",
"isTypedTimeFullyLegal",
"(",
")",
")",
"{... | Get the currently-entered time, as integer values of the hours and minutes typed.
@param enteredZeros A size-2 boolean array, which the caller should initialize, and which
may then be used for the caller to know whether zeros had been explicitly entered as either
hours of minutes. This is helpful for deciding whether ... | [
"Get",
"the",
"currently",
"-",
"entered",
"time",
"as",
"integer",
"values",
"of",
"the",
"hours",
"and",
"minutes",
"typed",
"."
] | b870abb5ab009a5a6dbab3fb855ec2854e35e125 | https://github.com/Prototik/HoloEverywhere/blob/b870abb5ab009a5a6dbab3fb855ec2854e35e125/library/src/org/holoeverywhere/widget/datetimepicker/time/TimePickerDialog.java#L641-L676 | train | getEnteredTime Method. | Of course, here is the Java code you requested:
```java
private int[] getEnteredTime(Boolean[] enteredZeros) {
int amOrPm = -1;
int startIndex = 1;
if (!mIs24HourMode && isTypedTimeFullyLegal()) {
int keyCode = mTypedTimes.get(mTypedTimes.size() - 1);
if (keyCode == getA... |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | public static <T> List<T> getAt(ListWithDefault<T> self, Range range) {
RangeInfo info = subListBorders(self.size(), range);
// if a positive index is accessed not initialized so far
// initialization up to that index takes place
if (self.size() < info.to) {
self.get(info.to... | java | public static <T> List<T> getAt(ListWithDefault<T> self, Range range) {
RangeInfo info = subListBorders(self.size(), range);
// if a positive index is accessed not initialized so far
// initialization up to that index takes place
if (self.size() < info.to) {
self.get(info.to... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getAt",
"(",
"ListWithDefault",
"<",
"T",
">",
"self",
",",
"Range",
"range",
")",
"{",
"RangeInfo",
"info",
"=",
"subListBorders",
"(",
"self",
".",
"size",
"(",
")",
",",
"range",
")",
";... | Support the range subscript operator for an eager or lazy List.
<pre class="groovyTestCase">def list = [].withDefault { 42 }
assert list[1..2] == [null, 42]</pre>
@param self a ListWithDefault
@param range a Range indicating the items to get
@return a new eager or lazy list instance based on range borders | [
"Support",
"the",
"range",
"subscript",
"operator",
"for",
"an",
"eager",
"or",
"lazy",
"List",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"list",
"=",
"[]",
".",
"withDefault",
"{",
"42",
"}",
"assert",
"list",
"[",
"1",
"..",
"2",
"]",
... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L7604-L7622 | train | Gets the value at the specified index in the list. | Of course, here is the Java code you requested:
```java
public static <T> List<T> getAt(ListWithDefault<T> self, Range range) {
RangeInfo info = subListBorders(self.size(), range);
// if a positive index is accessed not initialized so far
// initialization up to that index takes place
... |
aws/aws-sdk-java | aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PersonMatch.java | PersonMatch.withFaceMatches | public PersonMatch withFaceMatches(FaceMatch... faceMatches) {
if (this.faceMatches == null) {
setFaceMatches(new java.util.ArrayList<FaceMatch>(faceMatches.length));
}
for (FaceMatch ele : faceMatches) {
this.faceMatches.add(ele);
}
return this;
} | java | public PersonMatch withFaceMatches(FaceMatch... faceMatches) {
if (this.faceMatches == null) {
setFaceMatches(new java.util.ArrayList<FaceMatch>(faceMatches.length));
}
for (FaceMatch ele : faceMatches) {
this.faceMatches.add(ele);
}
return this;
} | [
"public",
"PersonMatch",
"withFaceMatches",
"(",
"FaceMatch",
"...",
"faceMatches",
")",
"{",
"if",
"(",
"this",
".",
"faceMatches",
"==",
"null",
")",
"{",
"setFaceMatches",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"FaceMatch",
">",
"(",
"f... | <p>
Information about the faces in the input collection that match the face of a person in the video.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setFaceMatches(java.util.Collection)} or {@link #withFaceMatches(java.util.Collection)} if you want to
override the existi... | [
"<p",
">",
"Information",
"about",
"the",
"faces",
"in",
"the",
"input",
"collection",
"that",
"match",
"the",
"face",
"of",
"a",
"person",
"in",
"the",
"video",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"Thi... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PersonMatch.java#L175-L183 | train | A collection of face matches. | Of course, here is the Java code you requested:
```java
public PersonMatch withFaceMatches(FaceMatch... faceMatches) {
if (this.faceMatches == null) {
setFaceMatches(new java.util.ArrayList<FaceMatch>(faceMatches.length));
}
for (FaceMatch ele : faceMatches) {
this.faceM... |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java | AbstrCFMLExprTransformer.notOp | private Expression notOp(Data data) throws TemplateException {
// And Operation
Position line = data.srcCode.getPosition();
if (data.srcCode.isCurrent('!') && !data.srcCode.isCurrent("!=")) {
data.srcCode.next();
comments(data);
return data.factory.opNegate(notOp(data), line, data.srcCode.getPosition(... | java | private Expression notOp(Data data) throws TemplateException {
// And Operation
Position line = data.srcCode.getPosition();
if (data.srcCode.isCurrent('!') && !data.srcCode.isCurrent("!=")) {
data.srcCode.next();
comments(data);
return data.factory.opNegate(notOp(data), line, data.srcCode.getPosition(... | [
"private",
"Expression",
"notOp",
"(",
"Data",
"data",
")",
"throws",
"TemplateException",
"{",
"// And Operation",
"Position",
"line",
"=",
"data",
".",
"srcCode",
".",
"getPosition",
"(",
")",
";",
"if",
"(",
"data",
".",
"srcCode",
".",
"isCurrent",
"(",
... | Transfomiert eine Not (not) Operation. Im Gegensatz zu CFMX , wird das "!" Zeichen auch als Not
Operator anerkannt. <br />
EBNF:<br />
<code>[("not"|"!") spaces] decsionOp; (* "!" Existiert in CFMX nicht *)</code>
@return CFXD Element
@throws TemplateException | [
"Transfomiert",
"eine",
"Not",
"(",
"not",
")",
"Operation",
".",
"Im",
"Gegensatz",
"zu",
"CFMX",
"wird",
"das",
"!",
"Zeichen",
"auch",
"als",
"Not",
"Operator",
"anerkannt",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"[",
"(... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java#L489-L502 | train | Not Operation | Of course, here is the Java code you requested:
```java
private Expression notOp(Data data) throws TemplateException {
// And Operation
Position line = data.srcCode.getPosition();
if (data.srcCode.isCurrent('!') && !data.srcCode.isCurrent("!=")) {
data.srcCode.next();
comments(data);
return data.fact... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.addDefaultKryoSerializer | public <T extends Serializer<?> & Serializable>void addDefaultKryoSerializer(Class<?> type, T serializer) {
config.addDefaultKryoSerializer(type, serializer);
} | java | public <T extends Serializer<?> & Serializable>void addDefaultKryoSerializer(Class<?> type, T serializer) {
config.addDefaultKryoSerializer(type, serializer);
} | [
"public",
"<",
"T",
"extends",
"Serializer",
"<",
"?",
">",
"&",
"Serializable",
">",
"void",
"addDefaultKryoSerializer",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"T",
"serializer",
")",
"{",
"config",
".",
"addDefaultKryoSerializer",
"(",
"type",
",",
"s... | Adds a new Kryo default serializer to the Runtime.
<p>Note that the serializer instance must be serializable (as defined by
java.io.Serializable), because it may be distributed to the worker nodes
by java serialization.
@param type
The class of the types serialized with the given serializer.
@param serializer
The ser... | [
"Adds",
"a",
"new",
"Kryo",
"default",
"serializer",
"to",
"the",
"Runtime",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L554-L556 | train | Add a default serializer for the given type. | Of course, here is the Java code you requested:
```java
public <T extends Serializer<?> & Serializable>void addDefaultKryoSerializer(Class<?> type, T serializer) {
config.addDefaultKryoSerializer(type, serializer);
}
```
Hope this helps! |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java | BFS.processNode | protected void processNode(Node current)
{
// Do not process the node if it is ubique
if (current.isUbique())
{
setColor(current, BLACK);
return;
}
// System.out.println("processing = " + current);
// Process edges towards the direction
for (Edge edge : direction == Direction.DOWNS... | java | protected void processNode(Node current)
{
// Do not process the node if it is ubique
if (current.isUbique())
{
setColor(current, BLACK);
return;
}
// System.out.println("processing = " + current);
// Process edges towards the direction
for (Edge edge : direction == Direction.DOWNS... | [
"protected",
"void",
"processNode",
"(",
"Node",
"current",
")",
"{",
"// Do not process the node if it is ubique\r",
"if",
"(",
"current",
".",
"isUbique",
"(",
")",
")",
"{",
"setColor",
"(",
"current",
",",
"BLACK",
")",
";",
"return",
";",
"}",
"//\t\tSyst... | Processes a node.
@param current The current node | [
"Processes",
"a",
"node",
"."
] | 2f93afa94426bf8b5afc2e0e61cd4b269a83288d | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L142-L220 | train | This method is called from the OSGi framework to process a node. | Of course, here is the Java code you requested:
```java
protected void processNode(Node current)
{
// Do not process the node if it is ubique
if (current.isUbique())
{
setColor(current, BLACK);
return;
}
// System.out.println("processing = " + current);
// Process edges towards the dir... |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/knxnetip/KNXnetIPDevMgmt.java | KNXnetIPDevMgmt.handleService | void handleService(KNXnetIPHeader h, byte[] data, int offset)
throws KNXFormatException, IOException
{
final int svc = h.getServiceType();
if (svc == KNXnetIPHeader.DEVICE_CONFIGURATION_REQ) {
ServiceRequest req;
try {
req = PacketHelper.getServiceRequest(h, data, offset);
}
catch (final... | java | void handleService(KNXnetIPHeader h, byte[] data, int offset)
throws KNXFormatException, IOException
{
final int svc = h.getServiceType();
if (svc == KNXnetIPHeader.DEVICE_CONFIGURATION_REQ) {
ServiceRequest req;
try {
req = PacketHelper.getServiceRequest(h, data, offset);
}
catch (final... | [
"void",
"handleService",
"(",
"KNXnetIPHeader",
"h",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"KNXFormatException",
",",
"IOException",
"{",
"final",
"int",
"svc",
"=",
"h",
".",
"getServiceType",
"(",
")",
";",
"if",
"(",
"svc... | /* (non-Javadoc)
@see tuwien.auto.calimero.knxnetip.ConnectionImpl#handleService
(tuwien.auto.calimero.knxnetip.servicetype.KNXnetIPHeader, byte[], int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 4e9318eadbdeb945e529789f573b45386e619bed | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/knxnetip/KNXnetIPDevMgmt.java#L152-L207 | train | Handle a service message. | Of course, here is the Java code you requested:
```java
void handleService(KNXnetIPHeader h, byte[] data, int offset)
throws KNXFormatException, IOException
{
final int svc = h.getServiceType();
if (svc == KNXnetIPHeader.DEVICE_CONFIGURATION_REQ) {
ServiceRequest req;
try {
req = PacketHelper.g... |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Clock.java | Clock.setMinute | public void setMinute(final int MINUTE) {
minute = MINUTE % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | java | public void setMinute(final int MINUTE) {
minute = MINUTE % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | [
"public",
"void",
"setMinute",
"(",
"final",
"int",
"MINUTE",
")",
"{",
"minute",
"=",
"MINUTE",
"%",
"60",
";",
"calculateAngles",
"(",
"hour",
",",
"minute",
",",
"second",
")",
";",
"repaint",
"(",
"getInnerBounds",
"(",
")",
")",
";",
"}"
] | Sets the current minute of the clock
@param MINUTE | [
"Sets",
"the",
"current",
"minute",
"of",
"the",
"clock"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Clock.java#L340-L344 | train | Sets the minute value. | Of course, here is the Java code you requested:
```java
public void setMinute(final int MINUTE) {
minute = MINUTE % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
}
```
Hope this helps! |
icode/ameba | src/main/java/ameba/lib/Strands.java | Strands.sleep | public static void sleep(long millis) throws InterruptedException {
try {
Strand.sleep(millis);
} catch (SuspendExecution e) {
throw RuntimeSuspendExecution.of(e);
}
} | java | public static void sleep(long millis) throws InterruptedException {
try {
Strand.sleep(millis);
} catch (SuspendExecution e) {
throw RuntimeSuspendExecution.of(e);
}
} | [
"public",
"static",
"void",
"sleep",
"(",
"long",
"millis",
")",
"throws",
"InterruptedException",
"{",
"try",
"{",
"Strand",
".",
"sleep",
"(",
"millis",
")",
";",
"}",
"catch",
"(",
"SuspendExecution",
"e",
")",
"{",
"throw",
"RuntimeSuspendExecution",
"."... | Causes the currently executing strand to sleep (temporarily cease
execution) for the specified number of milliseconds, subject to
the precision and accuracy of system timers and schedulers.
@param millis the length of time to sleep in milliseconds
@throws IllegalArgumentException if the value of {@code millis} is nega... | [
"Causes",
"the",
"currently",
"executing",
"strand",
"to",
"sleep",
"(",
"temporarily",
"cease",
"execution",
")",
"for",
"the",
"specified",
"number",
"of",
"milliseconds",
"subject",
"to",
"the",
"precision",
"and",
"accuracy",
"of",
"system",
"timers",
"and",... | 9d4956e935898e41331b2745e400ef869cd265e0 | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Strands.java#L146-L152 | train | Sleep for the specified amount of time. | Of course, here is the Java code you requested:
```java
public static void sleep(long millis) throws InterruptedException {
try {
Strand.sleep(millis);
} catch (SuspendExecution e) {
throw RuntimeSuspendExecution.of(e);
}
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbSpiLocalTransactionImpl.java | WSRdbSpiLocalTransactionImpl.rollback | public void rollback() throws ResourceException {
if (tc.isEntryEnabled())
Tr.entry(this, tc, "rollback", ivMC);
// if the MC marked Stale, it means the user requested a purge pool with an immediate option
// so don't allow any work on the mc
if (ivMC._mcStale) {
... | java | public void rollback() throws ResourceException {
if (tc.isEntryEnabled())
Tr.entry(this, tc, "rollback", ivMC);
// if the MC marked Stale, it means the user requested a purge pool with an immediate option
// so don't allow any work on the mc
if (ivMC._mcStale) {
... | [
"public",
"void",
"rollback",
"(",
")",
"throws",
"ResourceException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"rollback\"",
",",
"ivMC",
")",
";",
"// if the MC marked Stale, it means th... | Rollback a local transaction
@exception ResourceException - Possible causes for this exception are:
1) if there is no transaction active that can be rolledback
2) rollback was called from an invalid transaction state | [
"Rollback",
"a",
"local",
"transaction"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbSpiLocalTransactionImpl.java#L338-L448 | train | Rollback the transaction. | Of course, here is the Java code you requested:
```java
public void rollback() throws ResourceException {
if (tc.isEntryEnabled())
Tr.entry(this, tc, "rollback", ivMC);
// if the MC marked Stale, it means the user requested a purge pool with an immediate option
// so don't allow an... |
overturetool/overture | ide/vdmpp/debug/src/main/java/org/overture/ide/vdmpp/debug/ui/launchconfigurations/VdmPpApplicationLaunchShortcut.java | VdmPpApplicationLaunchShortcut.createConfiguration | protected ILaunchConfiguration createConfiguration(INode type,
String projectName)
{
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
try
{
ILaunchConfigurationType configType = getConfigurationType();
wc = configType.newInstance(null, getLaunchManager().generateLaunc... | java | protected ILaunchConfiguration createConfiguration(INode type,
String projectName)
{
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
try
{
ILaunchConfigurationType configType = getConfigurationType();
wc = configType.newInstance(null, getLaunchManager().generateLaunc... | [
"protected",
"ILaunchConfiguration",
"createConfiguration",
"(",
"INode",
"type",
",",
"String",
"projectName",
")",
"{",
"ILaunchConfiguration",
"config",
"=",
"null",
";",
"ILaunchConfigurationWorkingCopy",
"wc",
"=",
"null",
";",
"try",
"{",
"ILaunchConfigurationType... | /*
(non-Javadoc)
@see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#createConfiguration(org.eclipse.jdt
.core.IType) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/vdmpp/debug/src/main/java/org/overture/ide/vdmpp/debug/ui/launchconfigurations/VdmPpApplicationLaunchShortcut.java#L81-L121 | train | Create the configuration for the given type. | Of course, here is the Java code you requested:
```java
protected ILaunchConfiguration createConfiguration(INode type,
String projectName)
{
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
try
{
ILaunchConfigurationType configType = getConfigurationType();
wc = conf... |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/collection/MapUtil.java | MapUtil.newHashMapWithCapacity | public static <K, V> HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor) {
int finalSize = (int) (expectedSize / loadFactor + 1.0F);
return new HashMap<K, V>(finalSize, loadFactor);
} | java | public static <K, V> HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor) {
int finalSize = (int) (expectedSize / loadFactor + 1.0F);
return new HashMap<K, V>(finalSize, loadFactor);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HashMap",
"<",
"K",
",",
"V",
">",
"newHashMapWithCapacity",
"(",
"int",
"expectedSize",
",",
"float",
"loadFactor",
")",
"{",
"int",
"finalSize",
"=",
"(",
"int",
")",
"(",
"expectedSize",
"/",
"loadFactor",... | 根据等号左边的类型, 构造类型正确的HashMap.
注意HashMap中有0.75的加载因子的影响, 需要进行运算后才能正确初始化HashMap的大小.
加载因子也是HashMap中减少Hash冲突的重要一环,如果读写频繁,总记录数不多的Map,可以比默认值0.75进一步降低,建议0.5
@see com.google.common.collect.Maps#newHashMap(int) | [
"根据等号左边的类型",
"构造类型正确的HashMap",
"."
] | 60c743da35913d72f37f2d79afa90ad2bf73cb89 | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/collection/MapUtil.java#L121-L124 | train | Creates a new HashMap with the specified capacity. | Of course, here is the Java code you requested:
```java
public static <K, V> HashMap<K, V> newHashMapWithCapacity(int expectedSize, float loadFactor) {
int finalSize = (int) (expectedSize / loadFactor + 1.0F);
return new HashMap<K, V>(finalSize, loadFactor);
}
```
Hope this helps! |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.tan | public static DoubleBinding tan(final ObservableDoubleValue a) {
return createDoubleBinding(() -> Math.tan(a.get()), a);
} | java | public static DoubleBinding tan(final ObservableDoubleValue a) {
return createDoubleBinding(() -> Math.tan(a.get()), a);
} | [
"public",
"static",
"DoubleBinding",
"tan",
"(",
"final",
"ObservableDoubleValue",
"a",
")",
"{",
"return",
"createDoubleBinding",
"(",
"(",
")",
"->",
"Math",
".",
"tan",
"(",
"a",
".",
"get",
"(",
")",
")",
",",
"a",
")",
";",
"}"
] | Binding for {@link java.lang.Math#tan(double)}
@param a an angle, in radians.
@return the tangent of the argument. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#tan",
"(",
"double",
")",
"}"
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L1475-L1477 | train | Create a double binding that is the tan of the specified double value. | Of course, here is the Java code you requested:
```java
public static DoubleBinding tan(final ObservableDoubleValue a) {
return createDoubleBinding(() -> Math.tan(a.get()), a);
}
```
Hope this helps! |
radkovo/SwingBox | src/main/java/org/fit/cssbox/swingbox/view/DelegateView.java | DelegateView.viewToModel | @Override
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
{
if (view != null)
{
int retValue = view.viewToModel(x, y, a, bias);
return retValue;
}
return -1;
} | java | @Override
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
{
if (view != null)
{
int retValue = view.viewToModel(x, y, a, bias);
return retValue;
}
return -1;
} | [
"@",
"Override",
"public",
"int",
"viewToModel",
"(",
"float",
"x",
",",
"float",
"y",
",",
"Shape",
"a",
",",
"Position",
".",
"Bias",
"[",
"]",
"bias",
")",
"{",
"if",
"(",
"view",
"!=",
"null",
")",
"{",
"int",
"retValue",
"=",
"view",
".",
"v... | Provides a mapping from the view coordinate space to the logical
coordinate space of the model.
@param x
x coordinate of the view location to convert
@param y
y coordinate of the view location to convert
@param a
the allocated region to render into
@return the location within the model that best represents the given
p... | [
"Provides",
"a",
"mapping",
"from",
"the",
"view",
"coordinate",
"space",
"to",
"the",
"logical",
"coordinate",
"space",
"of",
"the",
"model",
"."
] | ff370f3dc54d248e4c8852c17513618c83c25984 | https://github.com/radkovo/SwingBox/blob/ff370f3dc54d248e4c8852c17513618c83c25984/src/main/java/org/fit/cssbox/swingbox/view/DelegateView.java#L413-L422 | train | Override the viewToModel method to return the value of the CRAS SECTYPE attribute. | Of course, here is the Java code you requested:
```java
@Override
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
{
if (view != null)
{
int retValue = view.viewToModel(x, y, a, bias);
return retValue;
}
return -1;
}
```
Hope t... |
trellis-ldp/trellis | components/triplestore/src/main/java/org/trellisldp/triplestore/TriplestoreResource.java | TriplestoreResource.fetchContainmentQuads | private Stream<Quad> fetchContainmentQuads() {
if (getInteractionModel().getIRIString().endsWith("Container")) {
final Query q = new Query();
q.setQuerySelectType();
q.addResultVar(OBJECT);
final ElementPathBlock epb = new ElementPathBlock();
epb.addT... | java | private Stream<Quad> fetchContainmentQuads() {
if (getInteractionModel().getIRIString().endsWith("Container")) {
final Query q = new Query();
q.setQuerySelectType();
q.addResultVar(OBJECT);
final ElementPathBlock epb = new ElementPathBlock();
epb.addT... | [
"private",
"Stream",
"<",
"Quad",
">",
"fetchContainmentQuads",
"(",
")",
"{",
"if",
"(",
"getInteractionModel",
"(",
")",
".",
"getIRIString",
"(",
")",
".",
"endsWith",
"(",
"\"Container\"",
")",
")",
"{",
"final",
"Query",
"q",
"=",
"new",
"Query",
"(... | This code is equivalent to the SPARQL query below.
<p><pre><code>
SELECT ?object
WHERE {
GRAPH trellis:PreferServerManaged { ?object dc:isPartOf IDENTIFIER }
}
</code></pre> | [
"This",
"code",
"is",
"equivalent",
"to",
"the",
"SPARQL",
"query",
"below",
"."
] | 789fd7a3df86cab7ebba63e72bf4e58397e5f42d | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/components/triplestore/src/main/java/org/trellisldp/triplestore/TriplestoreResource.java#L446-L467 | train | Fetch the containment quads. | Of course, here is the Java code you requested:
```java
private Stream<Quad> fetchContainmentQuads() {
if (getInteractionModel().getIRIString().endsWith("Container")) {
final Query q = new Query();
q.setQuerySelectType();
q.addResultVar(OBJECT);
final ElementPat... |
logic-ng/LogicNG | src/main/java/org/logicng/bdds/jbuddy/BDDKernel.java | BDDKernel.allSat | public List<byte[]> allSat(final int r) {
final byte[] allsatProfile = new byte[this.varnum];
for (int v = level(r) - 1; v >= 0; --v)
allsatProfile[this.level2var[v]] = -1;
initRef();
final List<byte[]> allSat = new LinkedList<>();
allSatRec(r, allSat, allsatProfile);
return allSat;
} | java | public List<byte[]> allSat(final int r) {
final byte[] allsatProfile = new byte[this.varnum];
for (int v = level(r) - 1; v >= 0; --v)
allsatProfile[this.level2var[v]] = -1;
initRef();
final List<byte[]> allSat = new LinkedList<>();
allSatRec(r, allSat, allsatProfile);
return allSat;
} | [
"public",
"List",
"<",
"byte",
"[",
"]",
">",
"allSat",
"(",
"final",
"int",
"r",
")",
"{",
"final",
"byte",
"[",
"]",
"allsatProfile",
"=",
"new",
"byte",
"[",
"this",
".",
"varnum",
"]",
";",
"for",
"(",
"int",
"v",
"=",
"level",
"(",
"r",
")... | Returns all models for a given BDD.
@param r the BDD root node
@return all models for the BDD | [
"Returns",
"all",
"models",
"for",
"a",
"given",
"BDD",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/jbuddy/BDDKernel.java#L892-L900 | train | Get all SAT of a given level. | Of course, here is the Java code you requested:
```java
public List<byte[]> allSat(final int r) {
final byte[] allsatProfile = new byte[this.varnum];
for (int v = level(r) - 1; v >= 0; --v)
allsatProfile[this.level2var[v]] = -1;
initRef();
final List<byte[]> allSat = new LinkedList<>();
allSa... |
aws/aws-sdk-java | aws-java-sdk-neptune/src/main/java/com/amazonaws/services/neptune/AmazonNeptuneClient.java | AmazonNeptuneClient.listTagsForResource | @Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
} | java | @Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
} | [
"@",
"Override",
"public",
"ListTagsForResourceResult",
"listTagsForResource",
"(",
"ListTagsForResourceRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListTagsForResource",
"(",
"request",
")",
";",
"}... | <p>
Lists all tags on an Amazon Neptune resource.
</p>
@param listTagsForResourceRequest
@return Result of the ListTagsForResource operation returned by the service.
@throws DBInstanceNotFoundException
<i>DBInstanceIdentifier</i> does not refer to an existing DB instance.
@throws DBSnapshotNotFoundException
<i>DBSnaps... | [
"<p",
">",
"Lists",
"all",
"tags",
"on",
"an",
"Amazon",
"Neptune",
"resource",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-neptune/src/main/java/com/amazonaws/services/neptune/AmazonNeptuneClient.java#L2748-L2752 | train | Returns a list of tags for a resource. | Of course, here is the Java code you requested:
```java
@Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
}
```
Hope this helps! |
sbt-compiler-maven-plugin/sbt-compiler-maven-plugin | sbt-compilers/sbt-compiler-sbt012/src/main/java/com/google/code/sbt/compiler/sbt012/SBT012Analysis.java | SBT012Analysis.getSourceFiles | @Override
public Set<File> getSourceFiles()
{
return JavaConversions.setAsJavaSet( analysis.apis().internal().keySet() );
} | java | @Override
public Set<File> getSourceFiles()
{
return JavaConversions.setAsJavaSet( analysis.apis().internal().keySet() );
} | [
"@",
"Override",
"public",
"Set",
"<",
"File",
">",
"getSourceFiles",
"(",
")",
"{",
"return",
"JavaConversions",
".",
"setAsJavaSet",
"(",
"analysis",
".",
"apis",
"(",
")",
".",
"internal",
"(",
")",
".",
"keySet",
"(",
")",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | cf8b8766956841c13f388eb311d214644dba9137 | https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/blob/cf8b8766956841c13f388eb311d214644dba9137/sbt-compilers/sbt-compiler-sbt012/src/main/java/com/google/code/sbt/compiler/sbt012/SBT012Analysis.java#L66-L70 | train | Get the source files. | Of course, here is the Java code you requested:
```java
@Override
public Set<File> getSourceFiles()
{
return JavaConversions.setAsJavaSet( analysis.apis().internal().keySet() );
}
```
Hope this helps! |
cologneintelligence/FitGoodies | fitgoodies-db-jdbc/src/main/java/de/cologneintelligence/fitgoodies/database/SetupFixture.java | SetupFixture.connectionString | public void connectionString(final String uri) {
SetupHelper helper = DependencyManager.getOrCreate(SetupHelper.class);
helper.setConnectionString(uri);
} | java | public void connectionString(final String uri) {
SetupHelper helper = DependencyManager.getOrCreate(SetupHelper.class);
helper.setConnectionString(uri);
} | [
"public",
"void",
"connectionString",
"(",
"final",
"String",
"uri",
")",
"{",
"SetupHelper",
"helper",
"=",
"DependencyManager",
".",
"getOrCreate",
"(",
"SetupHelper",
".",
"class",
")",
";",
"helper",
".",
"setConnectionString",
"(",
"uri",
")",
";",
"}"
] | Sets the database connection string to {@code uri}.
The connection string can be received using
{@link SetupHelper#getConnectionString()}.
@param uri the database connectoin string | [
"Sets",
"the",
"database",
"connection",
"string",
"to",
"{",
"@code",
"uri",
"}",
".",
"The",
"connection",
"string",
"can",
"be",
"received",
"using",
"{",
"@link",
"SetupHelper#getConnectionString",
"()",
"}",
"."
] | 834e42d1f41b4b9226060b1e83a80cc69ea88c7b | https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-db-jdbc/src/main/java/de/cologneintelligence/fitgoodies/database/SetupFixture.java#L96-L99 | test | Sets the connection string. | Of course, here is the Java code you requested:
```java
public void connectionString(final String uri) {
SetupHelper helper = DependencyManager.getOrCreate(SetupHelper.class);
helper.setConnectionString(uri);
}
```
Hope this helps! |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/route6.java | route6.get | public static route6[] get(nitro_service service, route6_args args) throws Exception{
route6 obj = new route6();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
route6[] response = (route6[])obj.get_resources(service, option);
return response;
} | java | public static route6[] get(nitro_service service, route6_args args) throws Exception{
route6 obj = new route6();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
route6[] response = (route6[])obj.get_resources(service, option);
return response;
} | [
"public",
"static",
"route6",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"route6_args",
"args",
")",
"throws",
"Exception",
"{",
"route6",
"obj",
"=",
"new",
"route6",
"(",
")",
";",
"options",
"option",
"=",
"new",
"options",
"(",
")",
";",
... | Use this API to fetch all the route6 resources that are configured on netscaler.
This uses route6_args which is a way to provide additional arguments while fetching the resources. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"route6",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
".",
"This",
"uses",
"route6_args",
"which",
"is",
"a",
"way",
"to",
"provide",
"additional",
"arguments",
"while",
"fetching",
"the",
"... | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/route6.java#L878-L884 | train | Use this API to fetch all the route6 resources that are configured on netscaler. This uses route6_args which is a way to provide additional arguments while fetching the resources. | Of course, here is the Java code you requested:
```java
public static route6[] get(nitro_service service, route6_args args) throws Exception{
route6 obj = new route6();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
route6[] response = (route6[])obj.get_resour... |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java | ReferenceIndividualGroupService.updateGroupMembers | @Override
public void updateGroupMembers(IEntityGroup group) throws GroupsException {
throwExceptionIfNotInternallyManaged();
getGroupStore().updateMembers(group);
if (cacheInUse()) {
cacheUpdate(group);
}
synchronizeGroupMembersOnUpdate(group);
} | java | @Override
public void updateGroupMembers(IEntityGroup group) throws GroupsException {
throwExceptionIfNotInternallyManaged();
getGroupStore().updateMembers(group);
if (cacheInUse()) {
cacheUpdate(group);
}
synchronizeGroupMembersOnUpdate(group);
} | [
"@",
"Override",
"public",
"void",
"updateGroupMembers",
"(",
"IEntityGroup",
"group",
")",
"throws",
"GroupsException",
"{",
"throwExceptionIfNotInternallyManaged",
"(",
")",
";",
"getGroupStore",
"(",
")",
".",
"updateMembers",
"(",
"group",
")",
";",
"if",
"(",... | Update the store and the updated members.
@param group IEntityGroup | [
"Update",
"the",
"store",
"and",
"the",
"updated",
"members",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java#L646-L654 | train | Update the members of the given entity group. | Of course, here is the Java code you requested:
```java
@Override
public void updateGroupMembers(IEntityGroup group) throws GroupsException {
throwExceptionIfNotInternallyManaged();
getGroupStore().updateMembers(group);
if (cacheInUse()) {
cacheUpdate(group);
}
s... |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/channel/ServerChannelUpdaterDelegateImpl.java | ServerChannelUpdaterDelegateImpl.populatePermissionOverwrites | private void populatePermissionOverwrites() {
if (overwrittenUserPermissions == null) {
overwrittenUserPermissions = new HashMap<>();
overwrittenUserPermissions.putAll(((ServerChannelImpl) channel).getInternalOverwrittenUserPermissions());
}
if (overwrittenRolePermissions... | java | private void populatePermissionOverwrites() {
if (overwrittenUserPermissions == null) {
overwrittenUserPermissions = new HashMap<>();
overwrittenUserPermissions.putAll(((ServerChannelImpl) channel).getInternalOverwrittenUserPermissions());
}
if (overwrittenRolePermissions... | [
"private",
"void",
"populatePermissionOverwrites",
"(",
")",
"{",
"if",
"(",
"overwrittenUserPermissions",
"==",
"null",
")",
"{",
"overwrittenUserPermissions",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"overwrittenUserPermissions",
".",
"putAll",
"(",
"(",
"(",... | Populates the maps which contain the permission overwrites. | [
"Populates",
"the",
"maps",
"which",
"contain",
"the",
"permission",
"overwrites",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/channel/ServerChannelUpdaterDelegateImpl.java#L154-L163 | train | Populates the permissions overwritten by the channel. | Of course, here is the Java code you requested:
```java
private void populatePermissionOverwrites() {
if (overwrittenUserPermissions == null) {
overwrittenUserPermissions = new HashMap<>();
overwrittenUserPermissions.putAll(((ServerChannelImpl) channel).getInternalOverwrittenUserPermiss... |
jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.getGlobalPropertyType | public PropertyType getGlobalPropertyType(String field) {
if(globalPropertyTypes==null)
globalPropertyTypes = buildPropertyTypes(getClass());
return globalPropertyTypes.get(field);
} | java | public PropertyType getGlobalPropertyType(String field) {
if(globalPropertyTypes==null)
globalPropertyTypes = buildPropertyTypes(getClass());
return globalPropertyTypes.get(field);
} | [
"public",
"PropertyType",
"getGlobalPropertyType",
"(",
"String",
"field",
")",
"{",
"if",
"(",
"globalPropertyTypes",
"==",
"null",
")",
"globalPropertyTypes",
"=",
"buildPropertyTypes",
"(",
"getClass",
"(",
")",
")",
";",
"return",
"globalPropertyTypes",
".",
"... | Obtains the property type of the given field of this descriptor. | [
"Obtains",
"the",
"property",
"type",
"of",
"the",
"given",
"field",
"of",
"this",
"descriptor",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L499-L503 | train | Gets the global property type for the given field. | Of course, here is the Java code you requested:
```java
public PropertyType getGlobalPropertyType(String field) {
if(globalPropertyTypes==null)
globalPropertyTypes = buildPropertyTypes(getClass());
return globalPropertyTypes.get(field);
}
```
Hope this helps! |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/MapListenerFlagOperator.java | MapListenerFlagOperator.setAndGetAllListenerFlags | private static int setAndGetAllListenerFlags() {
int listenerFlags = 0;
EntryEventType[] values = EntryEventType.values();
for (EntryEventType eventType : values) {
listenerFlags = listenerFlags | eventType.getType();
}
return listenerFlags;
} | java | private static int setAndGetAllListenerFlags() {
int listenerFlags = 0;
EntryEventType[] values = EntryEventType.values();
for (EntryEventType eventType : values) {
listenerFlags = listenerFlags | eventType.getType();
}
return listenerFlags;
} | [
"private",
"static",
"int",
"setAndGetAllListenerFlags",
"(",
")",
"{",
"int",
"listenerFlags",
"=",
"0",
";",
"EntryEventType",
"[",
"]",
"values",
"=",
"EntryEventType",
".",
"values",
"(",
")",
";",
"for",
"(",
"EntryEventType",
"eventType",
":",
"values",
... | Sets and gets all listener flags. | [
"Sets",
"and",
"gets",
"all",
"listener",
"flags",
"."
] | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/MapListenerFlagOperator.java#L57-L64 | train | Set the listener flags to 0. | Of course, here is the Java code you requested:
```java
private static int setAndGetAllListenerFlags() {
int listenerFlags = 0;
EntryEventType[] values = EntryEventType.values();
for (EntryEventType eventType : values) {
listenerFlags = listenerFlags | eventType.getType();
}... |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/finder/OperationEfficiencyComparator.java | OperationEfficiencyComparator.computeDifficulty | private int computeDifficulty(Operation left)
{
int difficulty = 0;
if (left instanceof MappedOperation)
{
difficulty = 10*getMappingDepth(left);
}
return difficulty;
} | java | private int computeDifficulty(Operation left)
{
int difficulty = 0;
if (left instanceof MappedOperation)
{
difficulty = 10*getMappingDepth(left);
}
return difficulty;
} | [
"private",
"int",
"computeDifficulty",
"(",
"Operation",
"left",
")",
"{",
"int",
"difficulty",
"=",
"0",
";",
"if",
"(",
"left",
"instanceof",
"MappedOperation",
")",
"{",
"difficulty",
"=",
"10",
"*",
"getMappingDepth",
"(",
"left",
")",
";",
"}",
"retur... | todo: add zGetDifficulty method to the operation itself. | [
"todo",
":",
"add",
"zGetDifficulty",
"method",
"to",
"the",
"operation",
"itself",
"."
] | e9a069452eece7a6ef9551caf81a69d3d9a3d990 | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/finder/OperationEfficiencyComparator.java#L74-L82 | train | Compute the difficulty of a single segment operation. | Of course, here is the Java code you requested:
```java
private int computeDifficulty(Operation left)
{
int difficulty = 0;
if (left instanceof MappedOperation)
{
difficulty = 10*getMappingDepth(left);
}
return difficulty;
}
```
Hope this helps! |
jdereg/java-util | src/main/java/com/cedarsoftware/util/IOUtilities.java | IOUtilities.transfer | public static void transfer(InputStream in, OutputStream out) throws IOException
{
byte[] bytes = new byte[TRANSFER_BUFFER];
int count;
while ((count = in.read(bytes)) != -1)
{
out.write(bytes, 0, count);
}
} | java | public static void transfer(InputStream in, OutputStream out) throws IOException
{
byte[] bytes = new byte[TRANSFER_BUFFER];
int count;
while ((count = in.read(bytes)) != -1)
{
out.write(bytes, 0, count);
}
} | [
"public",
"static",
"void",
"transfer",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"TRANSFER_BUFFER",
"]",
";",
"int",
"count",
";",
"while",
"(",
"(",
"cou... | Transfers bytes from an input stream to an output stream.
Callers of this method are responsible for closing the streams
since they are the ones that opened the streams. | [
"Transfers",
"bytes",
"from",
"an",
"input",
"stream",
"to",
"an",
"output",
"stream",
".",
"Callers",
"of",
"this",
"method",
"are",
"responsible",
"for",
"closing",
"the",
"streams",
"since",
"they",
"are",
"the",
"ones",
"that",
"opened",
"the",
"streams"... | a2dce61aed16d6454ee575174dda1ba6bff0015c | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/IOUtilities.java#L154-L162 | train | Transfers the contents of the input stream to the output stream. | Of course, here is the Java code you requested:
```java
public static void transfer(InputStream in, OutputStream out) throws IOException
{
byte[] bytes = new byte[TRANSFER_BUFFER];
int count;
while ((count = in.read(bytes)) != -1)
{
out.write(bytes, 0, count);
}
... |
tvesalainen/util | ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java | GeoDB.search | public List<GeoLocation> search(boolean strict, GeoSearch... searches)
{
List<GeoLocation> list = new ArrayList<>();
for (GeoFile gf : files)
{
gf.search(strict, list, searches);
}
return list;
} | java | public List<GeoLocation> search(boolean strict, GeoSearch... searches)
{
List<GeoLocation> list = new ArrayList<>();
for (GeoFile gf : files)
{
gf.search(strict, list, searches);
}
return list;
} | [
"public",
"List",
"<",
"GeoLocation",
">",
"search",
"(",
"boolean",
"strict",
",",
"GeoSearch",
"...",
"searches",
")",
"{",
"List",
"<",
"GeoLocation",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"GeoFile",
"gf",
":",
"file... | Returns a list of GeoLocations which match all the searches
@param searches
@return | [
"Returns",
"a",
"list",
"of",
"GeoLocations",
"which",
"match",
"all",
"the",
"searches"
] | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java#L85-L93 | train | Returns a list of GeoLocations contained in this file matching the searches. | Of course, here is the Java code you requested:
```java
public List<GeoLocation> search(boolean strict, GeoSearch... searches)
{
List<GeoLocation> list = new ArrayList<>();
for (GeoFile gf : files)
{
gf.search(strict, list, searches);
}
return list;
}... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java | RandomUtil.randomEles | public static <T> List<T> randomEles(List<T> list, int count) {
final List<T> result = new ArrayList<T>(count);
int limit = list.size();
while (result.size() < count) {
result.add(randomEle(list, limit));
}
return result;
} | java | public static <T> List<T> randomEles(List<T> list, int count) {
final List<T> result = new ArrayList<T>(count);
int limit = list.size();
while (result.size() < count) {
result.add(randomEle(list, limit));
}
return result;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"randomEles",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"count",
")",
"{",
"final",
"List",
"<",
"T",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"count",
")",
";",... | 随机获得列表中的一定量元素
@param <T> 元素类型
@param list 列表
@param count 随机取出的个数
@return 随机元素 | [
"随机获得列表中的一定量元素"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L311-L319 | train | Returns a random subset of the specified list of elements. | Of course, here is the Java code you requested:
```java
public static <T> List<T> randomEles(List<T> list, int count) {
final List<T> result = new ArrayList<T>(count);
int limit = list.size();
while (result.size() < count) {
result.add(randomEle(list, limit));
}
return result;
}
```
Hope this h... |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/o/PlatformCampaignEstimate.java | PlatformCampaignEstimate.getPlatform | public com.google.api.ads.adwords.axis.v201809.cm.Platform getPlatform() {
return platform;
} | java | public com.google.api.ads.adwords.axis.v201809.cm.Platform getPlatform() {
return platform;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"cm",
".",
"Platform",
"getPlatform",
"(",
")",
"{",
"return",
"platform",
";",
"}"
] | Gets the platform value for this PlatformCampaignEstimate.
@return platform * The {@link Platform} associated with this estimate.
<span class="constraint Required">This field is required
and should not be {@code null}.</span> | [
"Gets",
"the",
"platform",
"value",
"for",
"this",
"PlatformCampaignEstimate",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/o/PlatformCampaignEstimate.java#L69-L71 | train | Gets the platform value for this CdnAudienceSegment. | Of course, here is the Java code you requested:
```java
public com.google.api.ads.adwords.axis.v201809.cm.Platform getPlatform() {
return platform;
}
```
Hope this helps! |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/utils/ResourceLoader.java | ResourceLoader.loadAsString | public static String loadAsString(String resourceFileName) throws IOException, URISyntaxException {
try (InputStream is = ResourceLoader.class.getClassLoader().getResourceAsStream(resourceFileName)) {
StringWriter stringWriter = new StringWriter();
IOUtils.copy(is, stringWriter, Standard... | java | public static String loadAsString(String resourceFileName) throws IOException, URISyntaxException {
try (InputStream is = ResourceLoader.class.getClassLoader().getResourceAsStream(resourceFileName)) {
StringWriter stringWriter = new StringWriter();
IOUtils.copy(is, stringWriter, Standard... | [
"public",
"static",
"String",
"loadAsString",
"(",
"String",
"resourceFileName",
")",
"throws",
"IOException",
",",
"URISyntaxException",
"{",
"try",
"(",
"InputStream",
"is",
"=",
"ResourceLoader",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceA... | Loads the contents of a project resource file in a string.
@param resourceFileName The name of the resource file.
@return A string value representing the entire content of the resource.
@throws IOException
@throws URISyntaxException | [
"Loads",
"the",
"contents",
"of",
"a",
"project",
"resource",
"file",
"in",
"a",
"string",
"."
] | 9a1be1e99ad88286a6c153d5f2275df6ae1a57a1 | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/utils/ResourceLoader.java#L44-L50 | train | Load a string from a file name. | Of course, here is the Java code you requested:
```java
public static String loadAsString(String resourceFileName) throws IOException, URISyntaxException {
try (InputStream is = ResourceLoader.class.getClassLoader().getResourceAsStream(resourceFileName)) {
StringWriter stringWriter = new StringWrit... |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/JobScheduleExistsHeaders.java | JobScheduleExistsHeaders.withLastModified | public JobScheduleExistsHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} | java | public JobScheduleExistsHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} | [
"public",
"JobScheduleExistsHeaders",
"withLastModified",
"(",
"DateTime",
"lastModified",
")",
"{",
"if",
"(",
"lastModified",
"==",
"null",
")",
"{",
"this",
".",
"lastModified",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"lastModified",
"=",
"new",
... | Set the time at which the resource was last modified.
@param lastModified the lastModified value to set
@return the JobScheduleExistsHeaders 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/JobScheduleExistsHeaders.java#L129-L136 | train | Sets the lastModified value for the JobScheduleExistsHeaders object. | Of course, here is the Java code you requested:
```java
public JobScheduleExistsHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
... |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java | DialogFragmentUtils.supportFindDialogFragmentByTag | @SuppressWarnings("unchecked") // we know the dialog fragment is a child of fragment.
public static <F extends android.support.v4.app.DialogFragment> F supportFindDialogFragmentByTag(android.support.v4.app.FragmentManager manager, String tag) {
return (F) manager.findFragmentByTag(tag);
} | java | @SuppressWarnings("unchecked") // we know the dialog fragment is a child of fragment.
public static <F extends android.support.v4.app.DialogFragment> F supportFindDialogFragmentByTag(android.support.v4.app.FragmentManager manager, String tag) {
return (F) manager.findFragmentByTag(tag);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// we know the dialog fragment is a child of fragment.",
"public",
"static",
"<",
"F",
"extends",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"DialogFragment",
">",
"F",
"supportFindDialogFragmentByTag",
"(... | Find fragment registered on the manager.
@param manager the manager.
@param tag the tag string that is related to the {@link android.support.v4.app.DialogFragment}.
@param <F> the dialog fragment impl.
@return the {@link android.support.v4.app.DialogFragment}. {@code null} if the fragment not found. | [
"Find",
"fragment",
"registered",
"on",
"the",
"manager",
"."
] | 57809ddbfe7897e979cf507982ce0b3aa5e0ed8a | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L54-L57 | train | Support find dialog fragment by tag. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked") // we know the dialog fragment is a child of fragment.
public static <F extends android.support.v4.app.DialogFragment> F supportFindDialogFragmentByTag(android.support.v4.app.FragmentManager manager, String tag) {
return... |
Karumi/HeaderRecyclerView | library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java | HeaderRecyclerViewAdapter.onViewRecycled | @Override public final void onViewRecycled(VH holder) {
int position = holder.getAdapterPosition();
if (isHeaderPosition(position)) {
onHeaderViewRecycled(holder);
} else if (isFooterPosition(position)) {
onFooterViewRecycled(holder);
} else {
onItemViewRecycled(holder);
}
} | java | @Override public final void onViewRecycled(VH holder) {
int position = holder.getAdapterPosition();
if (isHeaderPosition(position)) {
onHeaderViewRecycled(holder);
} else if (isFooterPosition(position)) {
onFooterViewRecycled(holder);
} else {
onItemViewRecycled(holder);
}
} | [
"@",
"Override",
"public",
"final",
"void",
"onViewRecycled",
"(",
"VH",
"holder",
")",
"{",
"int",
"position",
"=",
"holder",
".",
"getAdapterPosition",
"(",
")",
";",
"if",
"(",
"isHeaderPosition",
"(",
"position",
")",
")",
"{",
"onHeaderViewRecycled",
"(... | Invokes onHeaderViewRecycled, onItemViewRecycled or onFooterViewRecycled methods based
on the holder.getAdapterPosition() | [
"Invokes",
"onHeaderViewRecycled",
"onItemViewRecycled",
"or",
"onFooterViewRecycled",
"methods",
"based",
"on",
"the",
"holder",
".",
"getAdapterPosition",
"()"
] | c018472a1b15de661d8aec153bd5f555ef1e9a37 | https://github.com/Karumi/HeaderRecyclerView/blob/c018472a1b15de661d8aec153bd5f555ef1e9a37/library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java#L109-L119 | train | On view recycled. | Of course, here is the Java code you requested:
```java
@Override public final void onViewRecycled(VH holder) {
int position = holder.getAdapterPosition();
if (isHeaderPosition(position)) {
onHeaderViewRecycled(holder);
} else if (isFooterPosition(position)) {
onFooterViewRecycled(holder);
... |
alkacon/opencms-core | src/org/opencms/ade/galleries/CmsGalleryActionElement.java | CmsGalleryActionElement.createGalleryConfigurationFromRequest | private CmsGalleryConfiguration createGalleryConfigurationFromRequest(GalleryMode galleryMode) {
CmsGalleryConfiguration conf = new CmsGalleryConfiguration();
conf.setGalleryMode(galleryMode);
conf.setReferencePath(getRequest().getParameter(I_CmsGalleryProviderConstants.CONFIG_REFERENCE_PATH));... | java | private CmsGalleryConfiguration createGalleryConfigurationFromRequest(GalleryMode galleryMode) {
CmsGalleryConfiguration conf = new CmsGalleryConfiguration();
conf.setGalleryMode(galleryMode);
conf.setReferencePath(getRequest().getParameter(I_CmsGalleryProviderConstants.CONFIG_REFERENCE_PATH));... | [
"private",
"CmsGalleryConfiguration",
"createGalleryConfigurationFromRequest",
"(",
"GalleryMode",
"galleryMode",
")",
"{",
"CmsGalleryConfiguration",
"conf",
"=",
"new",
"CmsGalleryConfiguration",
"(",
")",
";",
"conf",
".",
"setGalleryMode",
"(",
"galleryMode",
")",
";"... | Uses the request parameters of the current request to create a gallery configuration object.<p>
@param galleryMode the gallery mode
@return the gallery configuration | [
"Uses",
"the",
"request",
"parameters",
"of",
"the",
"current",
"request",
"to",
"create",
"a",
"gallery",
"configuration",
"object",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryActionElement.java#L192-L235 | train | Creates the gallery configuration from the request. | Of course, here is the Java code you requested:
```java
private CmsGalleryConfiguration createGalleryConfigurationFromRequest(GalleryMode galleryMode) {
CmsGalleryConfiguration conf = new CmsGalleryConfiguration();
conf.setGalleryMode(galleryMode);
conf.setReferencePath(getRequest().getParamet... |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/FXWrapper.java | FXWrapper.wrapBooleanProperty | public static BooleanProperty wrapBooleanProperty(final Property<Boolean> dolphinProperty) {
Assert.requireNonNull(dolphinProperty, "dolphinProperty");
final BooleanProperty property = new SimpleBooleanProperty();
FXBinder.bind(property).bidirectionalTo(dolphinProperty);
return property;... | java | public static BooleanProperty wrapBooleanProperty(final Property<Boolean> dolphinProperty) {
Assert.requireNonNull(dolphinProperty, "dolphinProperty");
final BooleanProperty property = new SimpleBooleanProperty();
FXBinder.bind(property).bidirectionalTo(dolphinProperty);
return property;... | [
"public",
"static",
"BooleanProperty",
"wrapBooleanProperty",
"(",
"final",
"Property",
"<",
"Boolean",
">",
"dolphinProperty",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"dolphinProperty",
",",
"\"dolphinProperty\"",
")",
";",
"final",
"BooleanProperty",
"proper... | Create a JavaFX {@link javafx.beans.property.BooleanProperty} as a wrapper for a dolphin platform property
@param dolphinProperty the dolphin platform property
@return the JavaFX property | [
"Create",
"a",
"JavaFX",
"{",
"@link",
"javafx",
".",
"beans",
".",
"property",
".",
"BooleanProperty",
"}",
"as",
"a",
"wrapper",
"for",
"a",
"dolphin",
"platform",
"property"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/FXWrapper.java#L113-L118 | train | Wrap a BooleanProperty in a SimpleBooleanProperty. | Of course, here is the Java code you requested:
```java
public static BooleanProperty wrapBooleanProperty(final Property<Boolean> dolphinProperty) {
Assert.requireNonNull(dolphinProperty, "dolphinProperty");
final BooleanProperty property = new SimpleBooleanProperty();
FXBinder.bind(property).b... |
alkacon/opencms-core | src/org/opencms/ui/login/CmsLoginHelper.java | CmsLoginHelper.initSiteAndProject | public static CmsWorkplaceSettings initSiteAndProject(CmsObject cms) {
CmsWorkplaceSettings workplaceSettings = CmsWorkplace.initWorkplaceSettings(cms, null, false);
String startSite = CmsWorkplace.getStartSiteRoot(cms, workplaceSettings);
// switch to the preferred site
workplaceSettin... | java | public static CmsWorkplaceSettings initSiteAndProject(CmsObject cms) {
CmsWorkplaceSettings workplaceSettings = CmsWorkplace.initWorkplaceSettings(cms, null, false);
String startSite = CmsWorkplace.getStartSiteRoot(cms, workplaceSettings);
// switch to the preferred site
workplaceSettin... | [
"public",
"static",
"CmsWorkplaceSettings",
"initSiteAndProject",
"(",
"CmsObject",
"cms",
")",
"{",
"CmsWorkplaceSettings",
"workplaceSettings",
"=",
"CmsWorkplace",
".",
"initWorkplaceSettings",
"(",
"cms",
",",
"null",
",",
"false",
")",
";",
"String",
"startSite",... | Initializes the site and project for a CMS context after login, and returns the workplace settings for the corresponding user.<p>
@param cms the CMS context which should be initialized
@return the workplace set | [
"Initializes",
"the",
"site",
"and",
"project",
"for",
"a",
"CMS",
"context",
"after",
"login",
"and",
"returns",
"the",
"workplace",
"settings",
"for",
"the",
"corresponding",
"user",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsLoginHelper.java#L491-L520 | train | Initializes the workplace settings for the site and project. | Of course, here is the Java code you requested:
```java
public static CmsWorkplaceSettings initSiteAndProject(CmsObject cms) {
CmsWorkplaceSettings workplaceSettings = CmsWorkplace.initWorkplaceSettings(cms, null, false);
String startSite = CmsWorkplace.getStartSiteRoot(cms, workplaceSettings);
... |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.addOutput | public TransactionOutput addOutput(Coin value, Address address) {
return addOutput(new TransactionOutput(params, this, value, address));
} | java | public TransactionOutput addOutput(Coin value, Address address) {
return addOutput(new TransactionOutput(params, this, value, address));
} | [
"public",
"TransactionOutput",
"addOutput",
"(",
"Coin",
"value",
",",
"Address",
"address",
")",
"{",
"return",
"addOutput",
"(",
"new",
"TransactionOutput",
"(",
"params",
",",
"this",
",",
"value",
",",
"address",
")",
")",
";",
"}"
] | Creates an output based on the given address and value, adds it to this transaction, and returns the new output. | [
"Creates",
"an",
"output",
"based",
"on",
"the",
"given",
"address",
"and",
"value",
"adds",
"it",
"to",
"this",
"transaction",
"and",
"returns",
"the",
"new",
"output",
"."
] | 9cf13d29315014ed59cf4fc5944e5f227e8df9a6 | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1041-L1043 | train | Add an output to the transaction. | Of course, here is the Java code you requested:
```java
public TransactionOutput addOutput(Coin value, Address address) {
return addOutput(new TransactionOutput(params, this, value, address));
}
```
Hope this helps! |
hudson3-plugins/tasks-plugin | src/main/java/hudson/plugins/tasks/MavenTasksResultAction.java | MavenTasksResultAction.initializeFields | @SuppressWarnings("hiding")
private void initializeFields(final String defaultEncoding, final String high, final String normal, final String low) {
this.high = high;
this.normal = normal;
this.low = low;
this.defaultEncoding = defaultEncoding;
} | java | @SuppressWarnings("hiding")
private void initializeFields(final String defaultEncoding, final String high, final String normal, final String low) {
this.high = high;
this.normal = normal;
this.low = low;
this.defaultEncoding = defaultEncoding;
} | [
"@",
"SuppressWarnings",
"(",
"\"hiding\"",
")",
"private",
"void",
"initializeFields",
"(",
"final",
"String",
"defaultEncoding",
",",
"final",
"String",
"high",
",",
"final",
"String",
"normal",
",",
"final",
"String",
"low",
")",
"{",
"this",
".",
"high",
... | CHECKSTYLE:OFF | [
"CHECKSTYLE",
":",
"OFF"
] | 4db519b2c9295cce622dd13f7e8ec64586daefcc | https://github.com/hudson3-plugins/tasks-plugin/blob/4db519b2c9295cce622dd13f7e8ec64586daefcc/src/main/java/hudson/plugins/tasks/MavenTasksResultAction.java#L76-L82 | train | Initializes the fields of the
. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("hiding")
private void initializeFields(final String defaultEncoding, final String high, final String normal, final String low) {
this.high = high;
this.normal = normal;
this.low = low;
this.defaultEncodi... |
google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.replaceExpression | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | java | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | [
"private",
"Node",
"replaceExpression",
"(",
"NodeTraversal",
"t",
",",
"Node",
"expr",
",",
"Node",
"parent",
")",
"{",
"Node",
"replacement",
";",
"String",
"key",
"=",
"null",
";",
"String",
"replacementString",
";",
"switch",
"(",
"expr",
".",
"getToken"... | Replaces a string expression with a short encoded string expression.
@param t The traversal
@param expr The expression node
@param parent The expression node's parent
@return The replacement node (or the original expression if no replacement is made) | [
"Replaces",
"a",
"string",
"expression",
"with",
"a",
"short",
"encoded",
"string",
"expression",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L316-L355 | train | Replaces the expression with the replacement. | Of course, here is the Java code you requested:
```java
private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getR... |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java | EasyPredictModelWrapper.sortByDescendingClassProbability | public SortedClassProbability[] sortByDescendingClassProbability(BinomialModelPrediction p) {
String[] domainValues = m.getDomainValues(m.getResponseIdx());
double[] classProbabilities = p.classProbabilities;
return sortByDescendingClassProbability(domainValues, classProbabilities);
} | java | public SortedClassProbability[] sortByDescendingClassProbability(BinomialModelPrediction p) {
String[] domainValues = m.getDomainValues(m.getResponseIdx());
double[] classProbabilities = p.classProbabilities;
return sortByDescendingClassProbability(domainValues, classProbabilities);
} | [
"public",
"SortedClassProbability",
"[",
"]",
"sortByDescendingClassProbability",
"(",
"BinomialModelPrediction",
"p",
")",
"{",
"String",
"[",
"]",
"domainValues",
"=",
"m",
".",
"getDomainValues",
"(",
"m",
".",
"getResponseIdx",
"(",
")",
")",
";",
"double",
... | A helper function to return an array of binomial class probabilities for a prediction in sorted order.
The returned array has the most probable class in position 0.
@param p The prediction.
@return An array with sorted class probabilities. | [
"A",
"helper",
"function",
"to",
"return",
"an",
"array",
"of",
"binomial",
"class",
"probabilities",
"for",
"a",
"prediction",
"in",
"sorted",
"order",
".",
"The",
"returned",
"array",
"has",
"the",
"most",
"probable",
"class",
"in",
"position",
"0",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java#L679-L683 | train | Sort by descending class probability. | Of course, here is the Java code you requested:
```java
public SortedClassProbability[] sortByDescendingClassProbability(BinomialModelPrediction p) {
String[] domainValues = m.getDomainValues(m.getResponseIdx());
double[] classProbabilities = p.classProbabilities;
return sortByDescendingClassProbability(do... |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbStatement.java | MariaDbStatement.getUpdateCount | public int getUpdateCount() {
if (results != null && results.getCmdInformation() != null && !results.isBatch()) {
return results.getCmdInformation().getUpdateCount();
}
return -1;
} | java | public int getUpdateCount() {
if (results != null && results.getCmdInformation() != null && !results.isBatch()) {
return results.getCmdInformation().getUpdateCount();
}
return -1;
} | [
"public",
"int",
"getUpdateCount",
"(",
")",
"{",
"if",
"(",
"results",
"!=",
"null",
"&&",
"results",
".",
"getCmdInformation",
"(",
")",
"!=",
"null",
"&&",
"!",
"results",
".",
"isBatch",
"(",
")",
")",
"{",
"return",
"results",
".",
"getCmdInformatio... | Retrieves the current result as an update count; if the result is a ResultSet object or there
are no more results, -1 is returned. This method should be called only once per result.
@return the current result as an update count; -1 if the current result is a ResultSet object
or there are no more results | [
"Retrieves",
"the",
"current",
"result",
"as",
"an",
"update",
"count",
";",
"if",
"the",
"result",
"is",
"a",
"ResultSet",
"object",
"or",
"there",
"are",
"no",
"more",
"results",
"-",
"1",
"is",
"returned",
".",
"This",
"method",
"should",
"be",
"calle... | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbStatement.java#L1057-L1062 | train | Get the update count of the result set. | Of course, here is the Java code you requested:
```java
public int getUpdateCount() {
if (results != null && results.getCmdInformation() != null && !results.isBatch()) {
return results.getCmdInformation().getUpdateCount();
}
return -1;
}
```
Hope this helps! |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.getAllMatches | private List<Match> getAllMatches(final Configuration configuration, final String password)
{
List<Match> matches = new ArrayList<>();
for (PasswordMatcher passwordMatcher : configuration.getPasswordMatchers())
{
matches.addAll(passwordMatcher.match(configuration, password));
... | java | private List<Match> getAllMatches(final Configuration configuration, final String password)
{
List<Match> matches = new ArrayList<>();
for (PasswordMatcher passwordMatcher : configuration.getPasswordMatchers())
{
matches.addAll(passwordMatcher.match(configuration, password));
... | [
"private",
"List",
"<",
"Match",
">",
"getAllMatches",
"(",
"final",
"Configuration",
"configuration",
",",
"final",
"String",
"password",
")",
"{",
"List",
"<",
"Match",
">",
"matches",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"PasswordMa... | Gets all matches for a given password.
@param configuration the configuration file used to estimate entropy.
@param password the password to get matches for.
@return a {@code List} of {@code Match} objects for the supplied password. | [
"Gets",
"all",
"matches",
"for",
"a",
"given",
"password",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L582-L592 | train | Gets all matches. | Of course, here is the Java code you requested:
```java
private List<Match> getAllMatches(final Configuration configuration, final String password)
{
List<Match> matches = new ArrayList<>();
for (PasswordMatcher passwordMatcher : configuration.getPasswordMatchers())
{
matches.a... |
voldemort/voldemort | src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java | QueuedKeyedResourcePool.create | public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory,
ResourcePoolConfig config) {
return new QueuedKeyedResourcePool<K, V>(factory, config);
} | java | public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory,
ResourcePoolConfig config) {
return new QueuedKeyedResourcePool<K, V>(factory, config);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"QueuedKeyedResourcePool",
"<",
"K",
",",
"V",
">",
"create",
"(",
"ResourceFactory",
"<",
"K",
",",
"V",
">",
"factory",
",",
"ResourcePoolConfig",
"config",
")",
"{",
"return",
"new",
"QueuedKeyedResourcePool",
... | Create a new queued pool with key type K, request type R, and value type
V.
@param factory The factory that creates objects
@param config The pool config
@return The created pool | [
"Create",
"a",
"new",
"queued",
"pool",
"with",
"key",
"type",
"K",
"request",
"type",
"R",
"and",
"value",
"type",
"V",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java#L67-L70 | train | Create a new QueuedKeyedResourcePool. | Of course, here is the Java code you requested:
```java
public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory,
ResourcePoolConfig config) {
return new QueuedKeyedResourcePool<K, V>(factory, config);
}
```
Hope ... |
meertensinstituut/mtas | src/main/java/mtas/codec/tree/MtasRBTree.java | MtasRBTree.setMax | private void setMax(MtasRBTreeNode n) {
n.max = n.right;
if (n.leftChild != null) {
n.max = Math.max(n.max, n.leftChild.max);
}
if (n.rightChild != null) {
n.max = Math.max(n.max, n.rightChild.max);
}
} | java | private void setMax(MtasRBTreeNode n) {
n.max = n.right;
if (n.leftChild != null) {
n.max = Math.max(n.max, n.leftChild.max);
}
if (n.rightChild != null) {
n.max = Math.max(n.max, n.rightChild.max);
}
} | [
"private",
"void",
"setMax",
"(",
"MtasRBTreeNode",
"n",
")",
"{",
"n",
".",
"max",
"=",
"n",
".",
"right",
";",
"if",
"(",
"n",
".",
"leftChild",
"!=",
"null",
")",
"{",
"n",
".",
"max",
"=",
"Math",
".",
"max",
"(",
"n",
".",
"max",
",",
"n... | Sets the max.
@param n the new max | [
"Sets",
"the",
"max",
"."
] | f02ae730848616bd88b553efa7f9eddc32818e64 | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/tree/MtasRBTree.java#L220-L228 | train | Set max value of node. | Of course, here is the Java code you requested:
```java
private void setMax(MtasRBTreeNode n) {
n.max = n.right;
if (n.leftChild != null) {
n.max = Math.max(n.max, n.leftChild.max);
}
if (n.rightChild != null) {
n.max = Math.max(n.max, n.rightChild.max);
}
}
```
Hope this helps! |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/model/metrics/MetricTimeslice.java | MetricTimeslice.setValues | public void setValues(Map<String,Object> values)
{
this.values.clear();
this.values.putAll(values);
} | java | public void setValues(Map<String,Object> values)
{
this.values.clear();
this.values.putAll(values);
} | [
"public",
"void",
"setValues",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"this",
".",
"values",
".",
"clear",
"(",
")",
";",
"this",
".",
"values",
".",
"putAll",
"(",
"values",
")",
";",
"}"
] | Sets the list of values.
@param values The list of values | [
"Sets",
"the",
"list",
"of",
"values",
"."
] | 5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/model/metrics/MetricTimeslice.java#L83-L87 | train | Sets the values of this object. | Of course, here is the Java code you requested:
```java
public void setValues(Map<String,Object> values)
{
this.values.clear();
this.values.putAll(values);
}
```
Hope this helps! |
apache/flink | flink-metrics/flink-metrics-jmx/src/main/java/org/apache/flink/metrics/jmx/JMXReporter.java | JMXReporter.open | @Override
public void open(MetricConfig config) {
String portsConfig = config.getString(ARG_PORT, null);
if (portsConfig != null) {
Iterator<Integer> ports = NetUtils.getPortRangeFromString(portsConfig);
JMXServer server = new JMXServer();
while (ports.hasNext()) {
int port = ports.next();
try {... | java | @Override
public void open(MetricConfig config) {
String portsConfig = config.getString(ARG_PORT, null);
if (portsConfig != null) {
Iterator<Integer> ports = NetUtils.getPortRangeFromString(portsConfig);
JMXServer server = new JMXServer();
while (ports.hasNext()) {
int port = ports.next();
try {... | [
"@",
"Override",
"public",
"void",
"open",
"(",
"MetricConfig",
"config",
")",
"{",
"String",
"portsConfig",
"=",
"config",
".",
"getString",
"(",
"ARG_PORT",
",",
"null",
")",
";",
"if",
"(",
"portsConfig",
"!=",
"null",
")",
"{",
"Iterator",
"<",
"Inte... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-jmx/src/main/java/org/apache/flink/metrics/jmx/JMXReporter.java#L100-L130 | train | Open the JMXReporter. | Of course, here is the Java code you requested:
```java
@Override
public void open(MetricConfig config) {
String portsConfig = config.getString(ARG_PORT, null);
if (portsConfig != null) {
Iterator<Integer> ports = NetUtils.getPortRangeFromString(portsConfig);
JMXServer server = new JMXServer();
while (... |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java | AbstractConnection.sendBuf | protected void sendBuf(final OtpErlangPid from, final String dest,
final OtpOutputStream payload) throws IOException {
if (!connected) {
throw new IOException("Not connected");
}
@SuppressWarnings("resource")
final OtpOutputStream header = new OtpOutputStream(head... | java | protected void sendBuf(final OtpErlangPid from, final String dest,
final OtpOutputStream payload) throws IOException {
if (!connected) {
throw new IOException("Not connected");
}
@SuppressWarnings("resource")
final OtpOutputStream header = new OtpOutputStream(head... | [
"protected",
"void",
"sendBuf",
"(",
"final",
"OtpErlangPid",
"from",
",",
"final",
"String",
"dest",
",",
"final",
"OtpOutputStream",
"payload",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"connected",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\... | Send a pre-encoded message to a named process on a remote node.
@param dest
the name of the remote process.
@param payload
the encoded message to send.
@exception java.io.IOException
if the connection is not active or a communication error
occurs. | [
"Send",
"a",
"pre",
"-",
"encoded",
"message",
"to",
"a",
"named",
"process",
"on",
"a",
"remote",
"node",
"."
] | ac6084fd83240355f72e94adbf303e57832d1fab | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java#L231-L262 | train | Send a message to the local node. | Of course, here is the Java code you requested:
```java
protected void sendBuf(final OtpErlangPid from, final String dest,
final OtpOutputStream payload) throws IOException {
if (!connected) {
throw new IOException("Not connected");
}
@SuppressWarnings("resource")
... |
xwiki/xwiki-rendering | xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.java | HTMLMacro.cleanHTML | private String cleanHTML(String content, MacroTransformationContext context) throws MacroExecutionException
{
String cleanedContent = content;
HTMLCleanerConfiguration cleanerConfiguration = getCleanerConfiguration(context);
// Note that we trim the content since we want to be lenient with... | java | private String cleanHTML(String content, MacroTransformationContext context) throws MacroExecutionException
{
String cleanedContent = content;
HTMLCleanerConfiguration cleanerConfiguration = getCleanerConfiguration(context);
// Note that we trim the content since we want to be lenient with... | [
"private",
"String",
"cleanHTML",
"(",
"String",
"content",
",",
"MacroTransformationContext",
"context",
")",
"throws",
"MacroExecutionException",
"{",
"String",
"cleanedContent",
"=",
"content",
";",
"HTMLCleanerConfiguration",
"cleanerConfiguration",
"=",
"getCleanerConf... | Clean the HTML entered by the user, transforming it into valid XHTML.
@param content the content to clean
@param context the macro transformation context
@return the cleaned HTML as a string representing valid XHTML
@throws MacroExecutionException if the macro is inline and the content is not inline HTML | [
"Clean",
"the",
"HTML",
"entered",
"by",
"the",
"user",
"transforming",
"it",
"into",
"valid",
"XHTML",
"."
] | a21cdfcb64ef5b76872e3eedf78c530f26d7beb0 | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.java#L181-L231 | train | Clean HTML content. | Of course, here is the Java code you requested:
```java
private String cleanHTML(String content, MacroTransformationContext context) throws MacroExecutionException
{
String cleanedContent = content;
HTMLCleanerConfiguration cleanerConfiguration = getCleanerConfiguration(context);
// Note ... |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java | BigDecimalMath.root | static public BigDecimal root(final int n, final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("negative argument " + x.toString() + " of root");
}
if (n <= 0) {
throw new ArithmeticException("negative power " + n + " of root");
... | java | static public BigDecimal root(final int n, final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("negative argument " + x.toString() + " of root");
}
if (n <= 0) {
throw new ArithmeticException("negative power " + n + " of root");
... | [
"static",
"public",
"BigDecimal",
"root",
"(",
"final",
"int",
"n",
",",
"final",
"BigDecimal",
"x",
")",
"{",
"if",
"(",
"x",
".",
"compareTo",
"(",
"BigDecimal",
".",
"ZERO",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"neg... | The integer root.
@param n the positive argument.
@param x the non-negative argument.
@return The n-th root of the BigDecimal rounded to the precision implied by x, x^(1/n). | [
"The",
"integer",
"root",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L238-L275 | test | Root of a BigDecimal. | Of course, here is the Java code you requested:
```java
static public BigDecimal root(final int n, final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("negative argument " + x.toString() + " of root");
}
if (n <= 0) {
throw new Ari... |
GojaFramework/goja | goja-web/src/main/java/goja/mvc/render/ftl/kit/DirectiveKit.java | DirectiveKit.setTopBodyForParentBody | public static void setTopBodyForParentBody(TemplateDirectiveBodyOverrideWraper topBody,
TemplateDirectiveBodyOverrideWraper overrideBody) {
TemplateDirectiveBodyOverrideWraper parent = overrideBody;
while (parent.parentBody != null) {
parent = p... | java | public static void setTopBodyForParentBody(TemplateDirectiveBodyOverrideWraper topBody,
TemplateDirectiveBodyOverrideWraper overrideBody) {
TemplateDirectiveBodyOverrideWraper parent = overrideBody;
while (parent.parentBody != null) {
parent = p... | [
"public",
"static",
"void",
"setTopBodyForParentBody",
"(",
"TemplateDirectiveBodyOverrideWraper",
"topBody",
",",
"TemplateDirectiveBodyOverrideWraper",
"overrideBody",
")",
"{",
"TemplateDirectiveBodyOverrideWraper",
"parent",
"=",
"overrideBody",
";",
"while",
"(",
"parent",... | 对指定的Body的渲染器,指定其父亲的内容区域
@param topBody 内容渲染器
@param overrideBody 需要覆盖的内容渲染器 | [
"对指定的Body的渲染器,指定其父亲的内容区域"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/render/ftl/kit/DirectiveKit.java#L106-L113 | test | Sets the top body of the override body. | Of course, here is the Java code you requested:
```java
public static void setTopBodyForParentBody(TemplateDirectiveBodyOverrideWraper topBody,
TemplateDirectiveBodyOverrideWraper overrideBody) {
TemplateDirectiveBodyOverrideWraper parent = overrideBody;
w... |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/util/TracingUtilities.java | TracingUtilities.addDescriptor | private static void addDescriptor(List<String> descriptors, ServiceDescriptor serviceDescriptor) {
for (MethodDescriptor<?, ?> method : serviceDescriptor.getMethods()) {
// This is added by Cloud Bigtable's AbstractRetryingOperation
descriptors.add("Operation." + method.getFullMethodName().replace('/', ... | java | private static void addDescriptor(List<String> descriptors, ServiceDescriptor serviceDescriptor) {
for (MethodDescriptor<?, ?> method : serviceDescriptor.getMethods()) {
// This is added by Cloud Bigtable's AbstractRetryingOperation
descriptors.add("Operation." + method.getFullMethodName().replace('/', ... | [
"private",
"static",
"void",
"addDescriptor",
"(",
"List",
"<",
"String",
">",
"descriptors",
",",
"ServiceDescriptor",
"serviceDescriptor",
")",
"{",
"for",
"(",
"MethodDescriptor",
"<",
"?",
",",
"?",
">",
"method",
":",
"serviceDescriptor",
".",
"getMethods",... | Reads a list of {@link MethodDescriptor}s from a {@link ServiceDescriptor} and creates a list
of Open Census tags.
@param descriptors a {@link} of Strings to add Open Census tags to
@param serviceDescriptor A {@link ServiceDescriptor} that contains a list of RPCs that are
provided by that service | [
"Reads",
"a",
"list",
"of",
"{",
"@link",
"MethodDescriptor",
"}",
"s",
"from",
"a",
"{",
"@link",
"ServiceDescriptor",
"}",
"and",
"creates",
"a",
"list",
"of",
"Open",
"Census",
"tags",
"."
] | 53543f36e4d6f9ed1963640d91a35be2a2047656 | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/util/TracingUtilities.java#L81-L86 | train | Add the operation descriptor to the list of descriptors. | Of course, here is the Java code you requested:
```java
private static void addDescriptor(List<String> descriptors, ServiceDescriptor serviceDescriptor) {
for (MethodDescriptor<?, ?> method : serviceDescriptor.getMethods()) {
// This is added by Cloud Bigtable's AbstractRetryingOperation
descriptors.ad... |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/TypesafeConfigUtils.java | TypesafeConfigUtils.getDurationOptional | public static Optional<Long> getDurationOptional(Config config, String path,
TimeUnit timeUnit) {
return Optional.ofNullable(getDuration(config, path, timeUnit));
} | java | public static Optional<Long> getDurationOptional(Config config, String path,
TimeUnit timeUnit) {
return Optional.ofNullable(getDuration(config, path, timeUnit));
} | [
"public",
"static",
"Optional",
"<",
"Long",
">",
"getDurationOptional",
"(",
"Config",
"config",
",",
"String",
"path",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"getDuration",
"(",
"config",
",",
"path",
",",
"tim... | Get a configuration as duration (parses special strings like "10s"). Return {@code null}
if missing, wrong type or bad value.
@param config
@param path
@param timeUnit
@return | [
"Get",
"a",
"configuration",
"as",
"duration",
"(",
"parses",
"special",
"strings",
"like",
"10s",
")",
".",
"Return",
"{",
"@code",
"null",
"}",
"if",
"missing",
"wrong",
"type",
"or",
"bad",
"value",
"."
] | 734f0e77321d41eeca78a557be9884df9874e46e | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/TypesafeConfigUtils.java#L718-L721 | train | Get the duration optional. | Of course, here is the Java code you requested:
```java
public static Optional<Long> getDurationOptional(Config config, String path,
TimeUnit timeUnit) {
return Optional.ofNullable(getDuration(config, path, timeUnit));
}
```
Hope this helps! |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/Password.java | Password.check | public boolean check(Object credentials)
{
if (this == credentials)
return true;
if (credentials instanceof Password)
return credentials.equals(_pw);
if (credentials instanceof String)
return credentials.equals(_pw);
if (credentials instanceo... | java | public boolean check(Object credentials)
{
if (this == credentials)
return true;
if (credentials instanceof Password)
return credentials.equals(_pw);
if (credentials instanceof String)
return credentials.equals(_pw);
if (credentials instanceo... | [
"public",
"boolean",
"check",
"(",
"Object",
"credentials",
")",
"{",
"if",
"(",
"this",
"==",
"credentials",
")",
"return",
"true",
";",
"if",
"(",
"credentials",
"instanceof",
"Password",
")",
"return",
"credentials",
".",
"equals",
"(",
"_pw",
")",
";",... | /* ------------------------------------------------------------ | [
"/",
"*",
"------------------------------------------------------------"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Password.java#L82-L97 | train | Check if the credentials object is a CAS page. | Of course, here is the Java code you requested:
```java
public boolean check(Object credentials)
{
if (this == credentials)
return true;
if (credentials instanceof Password)
return credentials.equals(_pw);
if (credentials instanceof String)
return credential... |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/utils/thresholds/LegacyRange.java | LegacyRange.parseRange | private void parseRange() throws BadThresholdException {
PushbackReader reader = new PushbackReader(new StringReader(thresholdString));
StringBuilder currentParsedBuffer = new StringBuilder();
byte b;
try {
while ((b = (byte) reader.read()) != -1) {
curren... | java | private void parseRange() throws BadThresholdException {
PushbackReader reader = new PushbackReader(new StringReader(thresholdString));
StringBuilder currentParsedBuffer = new StringBuilder();
byte b;
try {
while ((b = (byte) reader.read()) != -1) {
curren... | [
"private",
"void",
"parseRange",
"(",
")",
"throws",
"BadThresholdException",
"{",
"PushbackReader",
"reader",
"=",
"new",
"PushbackReader",
"(",
"new",
"StringReader",
"(",
"thresholdString",
")",
")",
";",
"StringBuilder",
"currentParsedBuffer",
"=",
"new",
"Strin... | Parses the range definition to evaluate the minimum and maximum
thresholds.
@throws BadThresholdException
- | [
"Parses",
"the",
"range",
"definition",
"to",
"evaluate",
"the",
"minimum",
"and",
"maximum",
"thresholds",
"."
] | ac9046355851136994388442b01ba4063305f9c4 | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/utils/thresholds/LegacyRange.java#L124-L235 | train | Parse the range of the threshold string. | Of course, here is the Java code you requested:
```java
private void parseRange() throws BadThresholdException {
PushbackReader reader = new PushbackReader(new StringReader(thresholdString));
StringBuilder currentParsedBuffer = new StringBuilder();
byte b;
try {
while ((... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.