repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.illegalCode | public static void illegalCode(Class<?> destination, Class<?> source, String path, Throwable e){
String additionalInformation = e.getMessage().split(",")[1];
throw new IllegalCodeException(MSG.INSTANCE.message(illegalCodePath,destination.getSimpleName(),source.getSimpleName(),path,additionalInformation));
} | java | public static void illegalCode(Class<?> destination, Class<?> source, String path, Throwable e){
String additionalInformation = e.getMessage().split(",")[1];
throw new IllegalCodeException(MSG.INSTANCE.message(illegalCodePath,destination.getSimpleName(),source.getSimpleName(),path,additionalInformation));
} | [
"public",
"static",
"void",
"illegalCode",
"(",
"Class",
"<",
"?",
">",
"destination",
",",
"Class",
"<",
"?",
">",
"source",
",",
"String",
"path",
",",
"Throwable",
"e",
")",
"{",
"String",
"additionalInformation",
"=",
"e",
".",
"getMessage",
"(",
")"... | Thrown when there is an error in mapper generated class.
@param destination destination class
@param source source class
@param path xml path configuration
@param e exception captured | [
"Thrown",
"when",
"there",
"is",
"an",
"error",
"in",
"mapper",
"generated",
"class",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L590-L593 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/INFLO.java | INFLO.computeNeighborhoods | private void computeNeighborhoods(Relation<O> relation, DataStore<SetDBIDs> knns, ModifiableDBIDs pruned, WritableDataStore<ModifiableDBIDs> rNNminuskNNs) {
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Finding RkNN", relation.size(), LOG) : null;
for(DBIDIter iter = relation.iterDBIDs(); iter.val... | java | private void computeNeighborhoods(Relation<O> relation, DataStore<SetDBIDs> knns, ModifiableDBIDs pruned, WritableDataStore<ModifiableDBIDs> rNNminuskNNs) {
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Finding RkNN", relation.size(), LOG) : null;
for(DBIDIter iter = relation.iterDBIDs(); iter.val... | [
"private",
"void",
"computeNeighborhoods",
"(",
"Relation",
"<",
"O",
">",
"relation",
",",
"DataStore",
"<",
"SetDBIDs",
">",
"knns",
",",
"ModifiableDBIDs",
"pruned",
",",
"WritableDataStore",
"<",
"ModifiableDBIDs",
">",
"rNNminuskNNs",
")",
"{",
"FiniteProgres... | Compute the reverse kNN minus the kNN.
<p>
This is based on algorithm 2 (two-way search) from the INFLO paper, but
unfortunately this algorithm does not compute the RkNN correctly, but
rather \( RkNN \cap kNN \), which is quite useless given that we will use
the union of that with kNN later on. Therefore, we decided to... | [
"Compute",
"the",
"reverse",
"kNN",
"minus",
"the",
"kNN",
".",
"<p",
">",
"This",
"is",
"based",
"on",
"algorithm",
"2",
"(",
"two",
"-",
"way",
"search",
")",
"from",
"the",
"INFLO",
"paper",
"but",
"unfortunately",
"this",
"algorithm",
"does",
"not",
... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/INFLO.java#L185-L213 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java | IPv6AddressSection.bitwiseOr | public IPv6AddressSection bitwiseOr(IPv6AddressSection mask, boolean retainPrefix) throws IncompatibleAddressException, SizeMismatchException {
checkMaskSectionCount(mask);
return getOredSegments(
this,
retainPrefix ? getPrefixLength() : null,
getAddressCreator(),
true,
this::getSegment,
i -... | java | public IPv6AddressSection bitwiseOr(IPv6AddressSection mask, boolean retainPrefix) throws IncompatibleAddressException, SizeMismatchException {
checkMaskSectionCount(mask);
return getOredSegments(
this,
retainPrefix ? getPrefixLength() : null,
getAddressCreator(),
true,
this::getSegment,
i -... | [
"public",
"IPv6AddressSection",
"bitwiseOr",
"(",
"IPv6AddressSection",
"mask",
",",
"boolean",
"retainPrefix",
")",
"throws",
"IncompatibleAddressException",
",",
"SizeMismatchException",
"{",
"checkMaskSectionCount",
"(",
"mask",
")",
";",
"return",
"getOredSegments",
"... | Does the bitwise disjunction with this address. Useful when subnetting. Similar to {@link #mask(IPv6AddressSection)} which does the bitwise conjunction.
@param mask
@param retainPrefix whether to drop the prefix
@return
@throws IncompatibleAddressException | [
"Does",
"the",
"bitwise",
"disjunction",
"with",
"this",
"address",
".",
"Useful",
"when",
"subnetting",
".",
"Similar",
"to",
"{",
"@link",
"#mask",
"(",
"IPv6AddressSection",
")",
"}",
"which",
"does",
"the",
"bitwise",
"conjunction",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java#L1759-L1768 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installAssets | public void installAssets(Collection<String> assetIds, RepositoryConnectionList loginInfo) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING_ASSETS"));
if (assetIds == null || assetIds.isEmpty()) {
throw... | java | public void installAssets(Collection<String> assetIds, RepositoryConnectionList loginInfo) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING_ASSETS"));
if (assetIds == null || assetIds.isEmpty()) {
throw... | [
"public",
"void",
"installAssets",
"(",
"Collection",
"<",
"String",
">",
"assetIds",
",",
"RepositoryConnectionList",
"loginInfo",
")",
"throws",
"InstallException",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"1",
",",
"Messages",
"."... | Installs the specified assets
@param assetIds Collection of asset Ids
@param loginInfo RepositoryConnectionList to access repository with assets
@throws InstallException | [
"Installs",
"the",
"specified",
"assets"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1399-L1414 |
resilience4j/resilience4j | resilience4j-spring/src/main/java/io/github/resilience4j/retry/configure/RetryConfigurationProperties.java | RetryConfigurationProperties.configureRetryIntervalFunction | private void configureRetryIntervalFunction(BackendProperties properties, RetryConfig.Builder<Object> builder) {
if (properties.getWaitDuration() != 0) {
long waitDuration = properties.getWaitDuration();
if (properties.getEnableExponentialBackoff()) {
if (properties.getExponentialBackoffMultiplier() != 0) {... | java | private void configureRetryIntervalFunction(BackendProperties properties, RetryConfig.Builder<Object> builder) {
if (properties.getWaitDuration() != 0) {
long waitDuration = properties.getWaitDuration();
if (properties.getEnableExponentialBackoff()) {
if (properties.getExponentialBackoffMultiplier() != 0) {... | [
"private",
"void",
"configureRetryIntervalFunction",
"(",
"BackendProperties",
"properties",
",",
"RetryConfig",
".",
"Builder",
"<",
"Object",
">",
"builder",
")",
"{",
"if",
"(",
"properties",
".",
"getWaitDuration",
"(",
")",
"!=",
"0",
")",
"{",
"long",
"w... | decide which retry delay polciy will be configured based into the configured properties
@param properties the backend retry properties
@param builder the retry config builder | [
"decide",
"which",
"retry",
"delay",
"polciy",
"will",
"be",
"configured",
"based",
"into",
"the",
"configured",
"properties"
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-spring/src/main/java/io/github/resilience4j/retry/configure/RetryConfigurationProperties.java#L136-L155 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java | WebAppSecurityCollaboratorImpl.isUserInRole | @Override
public boolean isUserInRole(String role, IExtendedRequest req) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "isUserInRole role = " + role);
}
if (role == null)
return false;
Subject subject = subjectManager.getCa... | java | @Override
public boolean isUserInRole(String role, IExtendedRequest req) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "isUserInRole role = " + role);
}
if (role == null)
return false;
Subject subject = subjectManager.getCa... | [
"@",
"Override",
"public",
"boolean",
"isUserInRole",
"(",
"String",
"role",
",",
"IExtendedRequest",
"req",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"deb... | {@inheritDoc} If the role is null or the call is unauthenticated,
return false. Otherwise, check if the authenticated subject is in
the requested role. | [
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java#L472-L487 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/impl/flexi/FlexiBean.java | FlexiBean.put | public Object put(String propertyName, Object newValue) {
if (VALID_KEY.matcher(propertyName).matches() == false) {
throw new IllegalArgumentException("Invalid key for FlexiBean: " + propertyName);
}
return dataWritable().put(propertyName, newValue);
} | java | public Object put(String propertyName, Object newValue) {
if (VALID_KEY.matcher(propertyName).matches() == false) {
throw new IllegalArgumentException("Invalid key for FlexiBean: " + propertyName);
}
return dataWritable().put(propertyName, newValue);
} | [
"public",
"Object",
"put",
"(",
"String",
"propertyName",
",",
"Object",
"newValue",
")",
"{",
"if",
"(",
"VALID_KEY",
".",
"matcher",
"(",
"propertyName",
")",
".",
"matches",
"(",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Sets a property in this bean to the specified value.
<p>
This creates a property if one does not exist.
@param propertyName the property name, not empty
@param newValue the new value, may be null
@return the old value of the property, may be null | [
"Sets",
"a",
"property",
"in",
"this",
"bean",
"to",
"the",
"specified",
"value",
".",
"<p",
">",
"This",
"creates",
"a",
"property",
"if",
"one",
"does",
"not",
"exist",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/flexi/FlexiBean.java#L288-L293 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/VerificationContextBuilder.java | VerificationContextBuilder.setDocumentHash | public VerificationContextBuilder setDocumentHash(DataHash documentHash, Long level) {
this.documentHash = documentHash;
this.inputHashLevel = level;
return this;
} | java | public VerificationContextBuilder setDocumentHash(DataHash documentHash, Long level) {
this.documentHash = documentHash;
this.inputHashLevel = level;
return this;
} | [
"public",
"VerificationContextBuilder",
"setDocumentHash",
"(",
"DataHash",
"documentHash",
",",
"Long",
"level",
")",
"{",
"this",
".",
"documentHash",
"=",
"documentHash",
";",
"this",
".",
"inputHashLevel",
"=",
"level",
";",
"return",
"this",
";",
"}"
] | Used to set the hash and local aggregation tree height.
If present then this hash must equal to signature input hash.
@param documentHash document hash
@return instance of {@link VerificationContextBuilder} | [
"Used",
"to",
"set",
"the",
"hash",
"and",
"local",
"aggregation",
"tree",
"height",
".",
"If",
"present",
"then",
"this",
"hash",
"must",
"equal",
"to",
"signature",
"input",
"hash",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/VerificationContextBuilder.java#L121-L125 |
apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.checkValueIsType | public static boolean checkValueIsType(Object value, Object name, Class type) {
if (value != null) {
if (type.isAssignableFrom(value.getClass())) {
return true;
} else {
throw new RuntimeException("The value argument of '" + name + "' must be of type "
... | java | public static boolean checkValueIsType(Object value, Object name, Class type) {
if (value != null) {
if (type.isAssignableFrom(value.getClass())) {
return true;
} else {
throw new RuntimeException("The value argument of '" + name + "' must be of type "
... | [
"public",
"static",
"boolean",
"checkValueIsType",
"(",
"Object",
"value",
",",
"Object",
"name",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"type",
".",
"isAssignableFrom",
"(",
"value",
".",
"getClass",
"(",
... | Checks type of value against builder type
@param value the node's value
@param name the node's name
@param type a Class that may be assignable to the value's class
@return true if type is assignable to the value's class, false if value
is null. | [
"Checks",
"type",
"of",
"value",
"against",
"builder",
"type"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L104-L115 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java | ST_SideBuffer.singleSideBuffer | public static Geometry singleSideBuffer(Geometry geometry, double distance){
if(geometry==null){
return null;
}
return computeSingleSideBuffer(geometry, distance, new BufferParameters());
} | java | public static Geometry singleSideBuffer(Geometry geometry, double distance){
if(geometry==null){
return null;
}
return computeSingleSideBuffer(geometry, distance, new BufferParameters());
} | [
"public",
"static",
"Geometry",
"singleSideBuffer",
"(",
"Geometry",
"geometry",
",",
"double",
"distance",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"computeSingleSideBuffer",
"(",
"geometry",
",",
"distanc... | Compute a single side buffer with default parameters
@param geometry
@param distance
@return | [
"Compute",
"a",
"single",
"side",
"buffer",
"with",
"default",
"parameters"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java#L58-L63 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/context/GenericsContext.java | GenericsContext.couldRequireKnownOuterGenerics | private boolean couldRequireKnownOuterGenerics(final GenericsContext root, final Type type) {
final Type outer = TypeUtils.getOuter(type);
// inner class may use generics of the root class
return outer != null && genericsInfo.getComposingTypes().contains(root.resolveClass(outer));
} | java | private boolean couldRequireKnownOuterGenerics(final GenericsContext root, final Type type) {
final Type outer = TypeUtils.getOuter(type);
// inner class may use generics of the root class
return outer != null && genericsInfo.getComposingTypes().contains(root.resolveClass(outer));
} | [
"private",
"boolean",
"couldRequireKnownOuterGenerics",
"(",
"final",
"GenericsContext",
"root",
",",
"final",
"Type",
"type",
")",
"{",
"final",
"Type",
"outer",
"=",
"TypeUtils",
".",
"getOuter",
"(",
"type",
")",
";",
"// inner class may use generics of the root cl... | Inner class could use outer class generics, and if outer class is known (in current hierarchy),
we can assume to use it's generics (correct for most cases, but may be corner cases).
@param root correct context for type resolution
@param type type to check
@return true if type is inner and outer class is present in cur... | [
"Inner",
"class",
"could",
"use",
"outer",
"class",
"generics",
"and",
"if",
"outer",
"class",
"is",
"known",
"(",
"in",
"current",
"hierarchy",
")",
"we",
"can",
"assume",
"to",
"use",
"it",
"s",
"generics",
"(",
"correct",
"for",
"most",
"cases",
"but"... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/context/GenericsContext.java#L288-L292 |
j256/simplejmx | src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java | ObjectNameUtil.makeObjectName | public static ObjectName makeObjectName(JmxResource jmxResource, Object obj) {
String domainName = jmxResource.domainName();
if (isEmpty(domainName)) {
throw new IllegalArgumentException(
"Could not create ObjectName because domain name not specified in @JmxResource");
}
String beanName = getBeanName(jm... | java | public static ObjectName makeObjectName(JmxResource jmxResource, Object obj) {
String domainName = jmxResource.domainName();
if (isEmpty(domainName)) {
throw new IllegalArgumentException(
"Could not create ObjectName because domain name not specified in @JmxResource");
}
String beanName = getBeanName(jm... | [
"public",
"static",
"ObjectName",
"makeObjectName",
"(",
"JmxResource",
"jmxResource",
",",
"Object",
"obj",
")",
"{",
"String",
"domainName",
"=",
"jmxResource",
".",
"domainName",
"(",
")",
";",
"if",
"(",
"isEmpty",
"(",
"domainName",
")",
")",
"{",
"thro... | Constructs an object-name from a jmx-resource and a object which is not self-naming.
@param jmxResource
Annotation from the class for which we are creating our ObjectName.
@param obj
Object for which we are creating our ObjectName
@throws IllegalArgumentException
If we had problems building the name | [
"Constructs",
"an",
"object",
"-",
"name",
"from",
"a",
"jmx",
"-",
"resource",
"and",
"a",
"object",
"which",
"is",
"not",
"self",
"-",
"naming",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java#L76-L87 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java | TwoBitFacade.getSequence | public String getSequence(String chromosomeName, int start, int end) throws Exception {
twoBitParser.close();
twoBitParser.setCurrentSequence(chromosomeName);
return twoBitParser.loadFragment(start,end-start);
} | java | public String getSequence(String chromosomeName, int start, int end) throws Exception {
twoBitParser.close();
twoBitParser.setCurrentSequence(chromosomeName);
return twoBitParser.loadFragment(start,end-start);
} | [
"public",
"String",
"getSequence",
"(",
"String",
"chromosomeName",
",",
"int",
"start",
",",
"int",
"end",
")",
"throws",
"Exception",
"{",
"twoBitParser",
".",
"close",
"(",
")",
";",
"twoBitParser",
".",
"setCurrentSequence",
"(",
"chromosomeName",
")",
";"... | Extract a sequence from a chromosome, using chromosomal coordinates
@param chromosomeName
@param start
@param end
@return the DNASequence from the requested coordinates.
@throws Exception | [
"Extract",
"a",
"sequence",
"from",
"a",
"chromosome",
"using",
"chromosomal",
"coordinates"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java#L78-L82 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/http2/Http2Connection.java | Http2Connection.writeData | public void writeData(int streamId, boolean outFinished, Buffer buffer, long byteCount)
throws IOException {
if (byteCount == 0) { // Empty data frames are not flow-controlled.
writer.data(outFinished, streamId, buffer, 0);
return;
}
while (byteCount > 0) {
int toWrite;
synchr... | java | public void writeData(int streamId, boolean outFinished, Buffer buffer, long byteCount)
throws IOException {
if (byteCount == 0) { // Empty data frames are not flow-controlled.
writer.data(outFinished, streamId, buffer, 0);
return;
}
while (byteCount > 0) {
int toWrite;
synchr... | [
"public",
"void",
"writeData",
"(",
"int",
"streamId",
",",
"boolean",
"outFinished",
",",
"Buffer",
"buffer",
",",
"long",
"byteCount",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteCount",
"==",
"0",
")",
"{",
"// Empty data frames are not flow-controlled."... | Callers of this method are not thread safe, and sometimes on application threads. Most often,
this method will be called to send a buffer worth of data to the peer.
<p>Writes are subject to the write window of the stream and the connection. Until there is a
window sufficient to send {@code byteCount}, the caller will ... | [
"Callers",
"of",
"this",
"method",
"are",
"not",
"thread",
"safe",
"and",
"sometimes",
"on",
"application",
"threads",
".",
"Most",
"often",
"this",
"method",
"will",
"be",
"called",
"to",
"send",
"a",
"buffer",
"worth",
"of",
"data",
"to",
"the",
"peer",
... | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/http2/Http2Connection.java#L286-L318 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.executeTasks | static PatchingResult executeTasks(final IdentityPatchContext context, final IdentityPatchContext.FinalizeCallback callback) throws Exception {
final List<PreparedTask> tasks = new ArrayList<PreparedTask>();
final List<ContentItem> conflicts = new ArrayList<ContentItem>();
// Identity
pr... | java | static PatchingResult executeTasks(final IdentityPatchContext context, final IdentityPatchContext.FinalizeCallback callback) throws Exception {
final List<PreparedTask> tasks = new ArrayList<PreparedTask>();
final List<ContentItem> conflicts = new ArrayList<ContentItem>();
// Identity
pr... | [
"static",
"PatchingResult",
"executeTasks",
"(",
"final",
"IdentityPatchContext",
"context",
",",
"final",
"IdentityPatchContext",
".",
"FinalizeCallback",
"callback",
")",
"throws",
"Exception",
"{",
"final",
"List",
"<",
"PreparedTask",
">",
"tasks",
"=",
"new",
"... | Execute all recorded tasks.
@param context the patch context
@param callback the finalization callback
@throws Exception | [
"Execute",
"all",
"recorded",
"tasks",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L630-L658 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.contains | public <A> boolean contains(boolean recursive, String name, Class<? extends A> clazz) {
Map<String, ResourceEntry> map = this.store.get(clazz);
return map == null ? ((recursive && parent != null) ? parent.contains(recursive, name, clazz) : false) : map.containsKey(name);
} | java | public <A> boolean contains(boolean recursive, String name, Class<? extends A> clazz) {
Map<String, ResourceEntry> map = this.store.get(clazz);
return map == null ? ((recursive && parent != null) ? parent.contains(recursive, name, clazz) : false) : map.containsKey(name);
} | [
"public",
"<",
"A",
">",
"boolean",
"contains",
"(",
"boolean",
"recursive",
",",
"String",
"name",
",",
"Class",
"<",
"?",
"extends",
"A",
">",
"clazz",
")",
"{",
"Map",
"<",
"String",
",",
"ResourceEntry",
">",
"map",
"=",
"this",
".",
"store",
"."... | 判断是否包含指定资源名和资源类型的资源对象
@param <A> 泛型
@param recursive 是否遍历父节点
@param name 资源名
@param clazz 资源类型
@return 是否存在 | [
"判断是否包含指定资源名和资源类型的资源对象"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L432-L435 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertBlob | public static Object convertBlob(Object blob, String value) throws SQLException {
return convertBlob(blob, value.getBytes());
} | java | public static Object convertBlob(Object blob, String value) throws SQLException {
return convertBlob(blob, value.getBytes());
} | [
"public",
"static",
"Object",
"convertBlob",
"(",
"Object",
"blob",
",",
"String",
"value",
")",
"throws",
"SQLException",
"{",
"return",
"convertBlob",
"(",
"blob",
",",
"value",
".",
"getBytes",
"(",
")",
")",
";",
"}"
] | Transfers data from String into sql.Blob
@param blob sql.Blob which would be filled
@param value String
@return sql.Blob from String
@throws SQLException | [
"Transfers",
"data",
"from",
"String",
"into",
"sql",
".",
"Blob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L161-L163 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ExternalizedBeanId.java | ExternalizedBeanId.readExternalPKey | private Serializable readExternalPKey(ObjectInput in, byte[] j2eeNameBytes)
throws java.io.IOException, ClassNotFoundException {
int pkeyLength = in.readInt();
byte[] pkeyBytes = new byte[pkeyLength];
//d164415 start
int bytesRead = 0;
for (int offset = 0; o... | java | private Serializable readExternalPKey(ObjectInput in, byte[] j2eeNameBytes)
throws java.io.IOException, ClassNotFoundException {
int pkeyLength = in.readInt();
byte[] pkeyBytes = new byte[pkeyLength];
//d164415 start
int bytesRead = 0;
for (int offset = 0; o... | [
"private",
"Serializable",
"readExternalPKey",
"(",
"ObjectInput",
"in",
",",
"byte",
"[",
"]",
"j2eeNameBytes",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"ClassNotFoundException",
"{",
"int",
"pkeyLength",
"=",
"in",
".",
"readInt",
"(",
")",... | Private helper method for readExternal - reads the Serialized
primary key.
@author Adrian Colyer
@return java.io.Serializable
@param in java.io.ObjectInput
@exception java.io.IOException The exception description. | [
"Private",
"helper",
"method",
"for",
"readExternal",
"-",
"reads",
"the",
"Serialized",
"primary",
"key",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ExternalizedBeanId.java#L208-L252 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/DisksInner.java | DisksInner.revokeAccess | public OperationStatusResponseInner revokeAccess(String resourceGroupName, String diskName) {
return revokeAccessWithServiceResponseAsync(resourceGroupName, diskName).toBlocking().last().body();
} | java | public OperationStatusResponseInner revokeAccess(String resourceGroupName, String diskName) {
return revokeAccessWithServiceResponseAsync(resourceGroupName, diskName).toBlocking().last().body();
} | [
"public",
"OperationStatusResponseInner",
"revokeAccess",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
")",
"{",
"return",
"revokeAccessWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"diskName",
")",
".",
"toBlocking",
"(",
")",
".",
"last",... | Revokes access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@throws Illega... | [
"Revokes",
"access",
"to",
"a",
"disk",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/DisksInner.java#L1124-L1126 |
houbb/log-integration | src/main/java/com/github/houbb/log/integration/support/placeholder/impl/DefaultPlaceholderConnector.java | DefaultPlaceholderConnector.buildString | private String buildString(String format, Object[] params) {
String stringFormat = format;
for(int i = 0; i < params.length; i++) {
stringFormat = stringFormat.replaceFirst("\\{}", "%s");
}
return String.format(stringFormat, params);
} | java | private String buildString(String format, Object[] params) {
String stringFormat = format;
for(int i = 0; i < params.length; i++) {
stringFormat = stringFormat.replaceFirst("\\{}", "%s");
}
return String.format(stringFormat, params);
} | [
"private",
"String",
"buildString",
"(",
"String",
"format",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"String",
"stringFormat",
"=",
"format",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".",
"length",
";",
"i",
"++",
")",
"... | 构建字符串
"1 {} 2 {} " TO "1 %s 2 %s"
@param format 格式化
@param params 参数列表
@return 构建的结果 | [
"构建字符串",
"1",
"{}",
"2",
"{}",
"TO",
"1",
"%s",
"2",
"%s"
] | train | https://github.com/houbb/log-integration/blob/c5e979719aec12a02f7d22b24b04b6fbb1789ca5/src/main/java/com/github/houbb/log/integration/support/placeholder/impl/DefaultPlaceholderConnector.java#L65-L71 |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/net/SslCodec.java | SslCodec.onIOError | @Handler(channels = EncryptedChannel.class)
public void onIOError(IOError event, IOSubchannel encryptedChannel)
throws SSLException, InterruptedException {
@SuppressWarnings("unchecked")
final Optional<PlainChannel> plainChannel
= (Optional<PlainChannel>) LinkedIOSubchannel
... | java | @Handler(channels = EncryptedChannel.class)
public void onIOError(IOError event, IOSubchannel encryptedChannel)
throws SSLException, InterruptedException {
@SuppressWarnings("unchecked")
final Optional<PlainChannel> plainChannel
= (Optional<PlainChannel>) LinkedIOSubchannel
... | [
"@",
"Handler",
"(",
"channels",
"=",
"EncryptedChannel",
".",
"class",
")",
"public",
"void",
"onIOError",
"(",
"IOError",
"event",
",",
"IOSubchannel",
"encryptedChannel",
")",
"throws",
"SSLException",
",",
"InterruptedException",
"{",
"@",
"SuppressWarnings",
... | Handles an {@link IOError} event from the encrypted channel (client)
by sending it downstream.
@param event the event
@param encryptedChannel the channel for exchanging the encrypted data
@throws InterruptedException
@throws SSLException | [
"Handles",
"an",
"{",
"@link",
"IOError",
"}",
"event",
"from",
"the",
"encrypted",
"channel",
"(",
"client",
")",
"by",
"sending",
"it",
"downstream",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/net/SslCodec.java#L253-L261 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java | CommonOps_DDF6.extractRow | public static DMatrix6 extractRow( DMatrix6x6 a , int row , DMatrix6 out ) {
if( out == null) out = new DMatrix6();
switch( row ) {
case 0:
out.a1 = a.a11;
out.a2 = a.a12;
out.a3 = a.a13;
out.a4 = a.a14;
out.a5 =... | java | public static DMatrix6 extractRow( DMatrix6x6 a , int row , DMatrix6 out ) {
if( out == null) out = new DMatrix6();
switch( row ) {
case 0:
out.a1 = a.a11;
out.a2 = a.a12;
out.a3 = a.a13;
out.a4 = a.a14;
out.a5 =... | [
"public",
"static",
"DMatrix6",
"extractRow",
"(",
"DMatrix6x6",
"a",
",",
"int",
"row",
",",
"DMatrix6",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"out",
"=",
"new",
"DMatrix6",
"(",
")",
";",
"switch",
"(",
"row",
")",
"{",
"case",
"0... | Extracts the row from the matrix a.
@param a Input matrix
@param row Which row is to be extracted
@param out output. Storage for the extracted row. If null then a new vector will be returned.
@return The extracted row. | [
"Extracts",
"the",
"row",
"from",
"the",
"matrix",
"a",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java#L2149-L2204 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRadioButtonSelectExample.java | WRadioButtonSelectExample.addSingleColumnSelectExample | private void addSingleColumnSelectExample() {
add(new WHeading(HeadingLevel.H3, "WRadioButtonSelect laid out in a single column"));
add(new ExplanatoryText("When layout is COLUMN, setting the layoutColumnCount property to one, or forgetting to set it at all (default is "
+ "one) is a little bit pointless."));
... | java | private void addSingleColumnSelectExample() {
add(new WHeading(HeadingLevel.H3, "WRadioButtonSelect laid out in a single column"));
add(new ExplanatoryText("When layout is COLUMN, setting the layoutColumnCount property to one, or forgetting to set it at all (default is "
+ "one) is a little bit pointless."));
... | [
"private",
"void",
"addSingleColumnSelectExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"WRadioButtonSelect laid out in a single column\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"When layout is COLU... | adds a WRadioButtonSelect with LAYOUT_COLUMN in 1 column simply by not setting the number of columns. This is
superfluous as you should use LAYOUT_STACKED (the default) instead. | [
"adds",
"a",
"WRadioButtonSelect",
"with",
"LAYOUT_COLUMN",
"in",
"1",
"column",
"simply",
"by",
"not",
"setting",
"the",
"number",
"of",
"columns",
".",
"This",
"is",
"superfluous",
"as",
"you",
"should",
"use",
"LAYOUT_STACKED",
"(",
"the",
"default",
")",
... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRadioButtonSelectExample.java#L236-L244 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/time/JMTimeUtil.java | JMTimeUtil.changeFormatAndTimeZoneToOffsetDateTime | public static String changeFormatAndTimeZoneToOffsetDateTime(
String dateFormat, String dateString) {
return getOffsetDateTime(changeTimestampToLong(dateFormat, dateString))
.toString();
} | java | public static String changeFormatAndTimeZoneToOffsetDateTime(
String dateFormat, String dateString) {
return getOffsetDateTime(changeTimestampToLong(dateFormat, dateString))
.toString();
} | [
"public",
"static",
"String",
"changeFormatAndTimeZoneToOffsetDateTime",
"(",
"String",
"dateFormat",
",",
"String",
"dateString",
")",
"{",
"return",
"getOffsetDateTime",
"(",
"changeTimestampToLong",
"(",
"dateFormat",
",",
"dateString",
")",
")",
".",
"toString",
"... | Change format and time zone to offset date time string.
@param dateFormat the date format
@param dateString the date string
@return the string | [
"Change",
"format",
"and",
"time",
"zone",
"to",
"offset",
"date",
"time",
"string",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/time/JMTimeUtil.java#L417-L421 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/DirectoryLucene.java | DirectoryLucene.forceUnlock | @Override
public void forceUnlock(String lockName) {
Cache<Object, Integer> lockCache = getDistLockCache().getAdvancedCache().withFlags(Flag.SKIP_CACHE_STORE, Flag.SKIP_CACHE_LOAD);
FileCacheKey fileCacheKey = new FileCacheKey(indexName, lockName, affinitySegmentId);
Object previousValue = lockCach... | java | @Override
public void forceUnlock(String lockName) {
Cache<Object, Integer> lockCache = getDistLockCache().getAdvancedCache().withFlags(Flag.SKIP_CACHE_STORE, Flag.SKIP_CACHE_LOAD);
FileCacheKey fileCacheKey = new FileCacheKey(indexName, lockName, affinitySegmentId);
Object previousValue = lockCach... | [
"@",
"Override",
"public",
"void",
"forceUnlock",
"(",
"String",
"lockName",
")",
"{",
"Cache",
"<",
"Object",
",",
"Integer",
">",
"lockCache",
"=",
"getDistLockCache",
"(",
")",
".",
"getAdvancedCache",
"(",
")",
".",
"withFlags",
"(",
"Flag",
".",
"SKIP... | Force release of the lock in this directory. Make sure to understand the
consequences | [
"Force",
"release",
"of",
"the",
"lock",
"in",
"this",
"directory",
".",
"Make",
"sure",
"to",
"understand",
"the",
"consequences"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/DirectoryLucene.java#L174-L182 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTree.java | MkTabTree.createNewDirectoryEntry | @Override
protected MkTabEntry createNewDirectoryEntry(MkTabTreeNode<O> node, DBID routingObjectID, double parentDistance) {
return new MkTabDirectoryEntry(routingObjectID, parentDistance, node.getPageID(), node.coveringRadiusFromEntries(routingObjectID, this), node.kNNDistances());
} | java | @Override
protected MkTabEntry createNewDirectoryEntry(MkTabTreeNode<O> node, DBID routingObjectID, double parentDistance) {
return new MkTabDirectoryEntry(routingObjectID, parentDistance, node.getPageID(), node.coveringRadiusFromEntries(routingObjectID, this), node.kNNDistances());
} | [
"@",
"Override",
"protected",
"MkTabEntry",
"createNewDirectoryEntry",
"(",
"MkTabTreeNode",
"<",
"O",
">",
"node",
",",
"DBID",
"routingObjectID",
",",
"double",
"parentDistance",
")",
"{",
"return",
"new",
"MkTabDirectoryEntry",
"(",
"routingObjectID",
",",
"paren... | Creates a new directory entry representing the specified node.
@param node the node to be represented by the new entry
@param routingObjectID the id of the routing object of the node
@param parentDistance the distance from the routing object of the node to
the routing object of the parent node | [
"Creates",
"a",
"new",
"directory",
"entry",
"representing",
"the",
"specified",
"node",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTree.java#L187-L190 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java | NameHelper.getGetterName | public String getGetterName(String propertyName, JType type, JsonNode node) {
propertyName = getPropertyNameForAccessor(propertyName, node);
String prefix = type.equals(type.owner()._ref(boolean.class)) ? "is" : "get";
String getterName;
if (propertyName.length() > 1 && Character.isUpp... | java | public String getGetterName(String propertyName, JType type, JsonNode node) {
propertyName = getPropertyNameForAccessor(propertyName, node);
String prefix = type.equals(type.owner()._ref(boolean.class)) ? "is" : "get";
String getterName;
if (propertyName.length() > 1 && Character.isUpp... | [
"public",
"String",
"getGetterName",
"(",
"String",
"propertyName",
",",
"JType",
"type",
",",
"JsonNode",
"node",
")",
"{",
"propertyName",
"=",
"getPropertyNameForAccessor",
"(",
"propertyName",
",",
"node",
")",
";",
"String",
"prefix",
"=",
"type",
".",
"e... | Generate getter method name for property.
@param propertyName
@param type
@param node
@return | [
"Generate",
"getter",
"method",
"name",
"for",
"property",
"."
] | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java#L197-L214 |
MaxLeap/SDK-CloudCode-Java | cloud-code-sdk/src/main/java/com/maxleap/code/impl/WebUtils.java | WebUtils.doGet | public static String doGet(String url, Map<String, String> header, Map<String, String> params) throws IOException {
return doRequestWithUrl(url, METHOD_GET, header, params, DEFAULT_CHARSET);
} | java | public static String doGet(String url, Map<String, String> header, Map<String, String> params) throws IOException {
return doRequestWithUrl(url, METHOD_GET, header, params, DEFAULT_CHARSET);
} | [
"public",
"static",
"String",
"doGet",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"header",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
"{",
"return",
"doRequestWithUrl",
"(",
"url",
",... | 执行HTTP GET请求。
@param url 请求地址
@param params 请求参数
@return 响应字符串
@throws IOException | [
"执行HTTP",
"GET请求。"
] | train | https://github.com/MaxLeap/SDK-CloudCode-Java/blob/756064c65dd613919c377bf136cf8710c7507968/cloud-code-sdk/src/main/java/com/maxleap/code/impl/WebUtils.java#L139-L141 |
SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setSelectedDate | public void setSelectedDate(@NonNull Calendar date) {
final int count = getAdapter().getCount() - 1;
int itemPosition = -1;
for(int i=0; i<count; i++) {
if(getAdapter().getItem(i).equals(date)) { // because DateItem deeply compares to calendar
itemPosition = i;
... | java | public void setSelectedDate(@NonNull Calendar date) {
final int count = getAdapter().getCount() - 1;
int itemPosition = -1;
for(int i=0; i<count; i++) {
if(getAdapter().getItem(i).equals(date)) { // because DateItem deeply compares to calendar
itemPosition = i;
... | [
"public",
"void",
"setSelectedDate",
"(",
"@",
"NonNull",
"Calendar",
"date",
")",
"{",
"final",
"int",
"count",
"=",
"getAdapter",
"(",
")",
".",
"getCount",
"(",
")",
"-",
"1",
";",
"int",
"itemPosition",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",... | Sets the Spinner's selection as date. If the date was not in the possible selections, a temporary
item is created and passed to selectTemporary().
@param date The date to be selected. | [
"Sets",
"the",
"Spinner",
"s",
"selection",
"as",
"date",
".",
"If",
"the",
"date",
"was",
"not",
"in",
"the",
"possible",
"selections",
"a",
"temporary",
"item",
"is",
"created",
"and",
"passed",
"to",
"selectTemporary",
"()",
"."
] | train | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L260-L292 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/ColumnLayoutExample.java | ColumnLayoutExample.addAutoWidthExample | private void addAutoWidthExample() {
add(new WHeading(HeadingLevel.H2, "Automatic (app defined) widths"));
add(new ExplanatoryText("This example shows what happens if you use undefined (0) column width and do not then define them in CSS."));
WPanel panel = new WPanel();
panel.setLayout(new ColumnLayout(new int[... | java | private void addAutoWidthExample() {
add(new WHeading(HeadingLevel.H2, "Automatic (app defined) widths"));
add(new ExplanatoryText("This example shows what happens if you use undefined (0) column width and do not then define them in CSS."));
WPanel panel = new WPanel();
panel.setLayout(new ColumnLayout(new int[... | [
"private",
"void",
"addAutoWidthExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"Automatic (app defined) widths\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"This example shows what happens if you use u... | This example shows a column which does not have widths set in Java. This is a "good thing": widths should be set in CSS. | [
"This",
"example",
"shows",
"a",
"column",
"which",
"does",
"not",
"have",
"widths",
"set",
"in",
"Java",
".",
"This",
"is",
"a",
"good",
"thing",
":",
"widths",
"should",
"be",
"set",
"in",
"CSS",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/ColumnLayoutExample.java#L149-L165 |
google/error-prone | check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java | SuggestedFixes.addModifiers | public static Optional<SuggestedFix> addModifiers(
Tree tree, VisitorState state, Modifier... modifiers) {
ModifiersTree originalModifiers = getModifiers(tree);
if (originalModifiers == null) {
return Optional.empty();
}
return addModifiers(tree, originalModifiers, state, new TreeSet<>(Array... | java | public static Optional<SuggestedFix> addModifiers(
Tree tree, VisitorState state, Modifier... modifiers) {
ModifiersTree originalModifiers = getModifiers(tree);
if (originalModifiers == null) {
return Optional.empty();
}
return addModifiers(tree, originalModifiers, state, new TreeSet<>(Array... | [
"public",
"static",
"Optional",
"<",
"SuggestedFix",
">",
"addModifiers",
"(",
"Tree",
"tree",
",",
"VisitorState",
"state",
",",
"Modifier",
"...",
"modifiers",
")",
"{",
"ModifiersTree",
"originalModifiers",
"=",
"getModifiers",
"(",
"tree",
")",
";",
"if",
... | Adds modifiers to the given class, method, or field declaration. | [
"Adds",
"modifiers",
"to",
"the",
"given",
"class",
"method",
"or",
"field",
"declaration",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java#L157-L164 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java | DeprecatedListWriter.addAnchor | private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) {
if (builder.hasDocumentation(type)) {
htmlTree.addContent(getMarkerAnchor(ANCHORS[type]));
}
} | java | private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) {
if (builder.hasDocumentation(type)) {
htmlTree.addContent(getMarkerAnchor(ANCHORS[type]));
}
} | [
"private",
"void",
"addAnchor",
"(",
"DeprecatedAPIListBuilder",
"builder",
",",
"int",
"type",
",",
"Content",
"htmlTree",
")",
"{",
"if",
"(",
"builder",
".",
"hasDocumentation",
"(",
"type",
")",
")",
"{",
"htmlTree",
".",
"addContent",
"(",
"getMarkerAncho... | Add the anchor.
@param builder the deprecated list builder
@param type the type of list being documented
@param htmlTree the content tree to which the anchor will be added | [
"Add",
"the",
"anchor",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java#L233-L237 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java | SecurityContextImpl.getWSPrincipal | protected WSPrincipal getWSPrincipal(Subject subject) throws IOException {
WSPrincipal wsPrincipal = null;
Set<WSPrincipal> principals = (subject != null) ? subject.getPrincipals(WSPrincipal.class) : null;
if (principals != null && !principals.isEmpty()) {
if (principals.size() > 1) ... | java | protected WSPrincipal getWSPrincipal(Subject subject) throws IOException {
WSPrincipal wsPrincipal = null;
Set<WSPrincipal> principals = (subject != null) ? subject.getPrincipals(WSPrincipal.class) : null;
if (principals != null && !principals.isEmpty()) {
if (principals.size() > 1) ... | [
"protected",
"WSPrincipal",
"getWSPrincipal",
"(",
"Subject",
"subject",
")",
"throws",
"IOException",
"{",
"WSPrincipal",
"wsPrincipal",
"=",
"null",
";",
"Set",
"<",
"WSPrincipal",
">",
"principals",
"=",
"(",
"subject",
"!=",
"null",
")",
"?",
"subject",
".... | Get the WSPrincipal from the subject
@param subject
@return the WSPrincipal of the subject
@throws IOException if there is more than one WSPrincipal in the subject | [
"Get",
"the",
"WSPrincipal",
"from",
"the",
"subject"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java#L391-L410 |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/suffixarray/DivSufSort.java | DivSufSort.trCopy | private void trCopy(int ISA, int first, int a, int b, int last, int depth) {
int c, d, e;// ptr
int s, v;
v = b - 1;
for (c = first, d = a - 1; c <= d; ++c) {
s = SA[c] - depth;
if ((0 <= s) && (SA[ISA + s] == v)) {
SA[++d] = s;
SA... | java | private void trCopy(int ISA, int first, int a, int b, int last, int depth) {
int c, d, e;// ptr
int s, v;
v = b - 1;
for (c = first, d = a - 1; c <= d; ++c) {
s = SA[c] - depth;
if ((0 <= s) && (SA[ISA + s] == v)) {
SA[++d] = s;
SA... | [
"private",
"void",
"trCopy",
"(",
"int",
"ISA",
",",
"int",
"first",
",",
"int",
"a",
",",
"int",
"b",
",",
"int",
"last",
",",
"int",
"depth",
")",
"{",
"int",
"c",
",",
"d",
",",
"e",
";",
"// ptr",
"int",
"s",
",",
"v",
";",
"v",
"=",
"b... | sort suffixes of middle partition by using sorted order of suffixes of left and
right partition. | [
"sort",
"suffixes",
"of",
"middle",
"partition",
"by",
"using",
"sorted",
"order",
"of",
"suffixes",
"of",
"left",
"and",
"right",
"partition",
"."
] | train | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/DivSufSort.java#L2080-L2099 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.getInheritedPropertyObject | public CmsClientProperty getInheritedPropertyObject(CmsClientSitemapEntry entry, String name) {
CmsClientSitemapEntry currentEntry = entry;
while (currentEntry != null) {
currentEntry = getParentEntry(currentEntry);
if (currentEntry != null) {
CmsClientProperty f... | java | public CmsClientProperty getInheritedPropertyObject(CmsClientSitemapEntry entry, String name) {
CmsClientSitemapEntry currentEntry = entry;
while (currentEntry != null) {
currentEntry = getParentEntry(currentEntry);
if (currentEntry != null) {
CmsClientProperty f... | [
"public",
"CmsClientProperty",
"getInheritedPropertyObject",
"(",
"CmsClientSitemapEntry",
"entry",
",",
"String",
"name",
")",
"{",
"CmsClientSitemapEntry",
"currentEntry",
"=",
"entry",
";",
"while",
"(",
"currentEntry",
"!=",
"null",
")",
"{",
"currentEntry",
"=",
... | Gets the property object which would be inherited by a sitemap entry.<p>
@param entry the sitemap entry
@param name the name of the property
@return the property object which would be inherited | [
"Gets",
"the",
"property",
"object",
"which",
"would",
"be",
"inherited",
"by",
"a",
"sitemap",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L1192-L1215 |
haifengl/smile | math/src/main/java/smile/math/matrix/JMatrix.java | JMatrix.eltran | private static void eltran(DenseMatrix A, DenseMatrix V, int[] perm) {
int n = A.nrows();
for (int mp = n - 2; mp > 0; mp--) {
for (int k = mp + 1; k < n; k++) {
V.set(k, mp, A.get(k, mp - 1));
}
int i = perm[mp];
if (i != mp) {
... | java | private static void eltran(DenseMatrix A, DenseMatrix V, int[] perm) {
int n = A.nrows();
for (int mp = n - 2; mp > 0; mp--) {
for (int k = mp + 1; k < n; k++) {
V.set(k, mp, A.get(k, mp - 1));
}
int i = perm[mp];
if (i != mp) {
... | [
"private",
"static",
"void",
"eltran",
"(",
"DenseMatrix",
"A",
",",
"DenseMatrix",
"V",
",",
"int",
"[",
"]",
"perm",
")",
"{",
"int",
"n",
"=",
"A",
".",
"nrows",
"(",
")",
";",
"for",
"(",
"int",
"mp",
"=",
"n",
"-",
"2",
";",
"mp",
">",
"... | Accumulate the stabilized elementary similarity transformations used
in the reduction of a real nonsymmetric matrix to upper Hessenberg form by elmhes. | [
"Accumulate",
"the",
"stabilized",
"elementary",
"similarity",
"transformations",
"used",
"in",
"the",
"reduction",
"of",
"a",
"real",
"nonsymmetric",
"matrix",
"to",
"upper",
"Hessenberg",
"form",
"by",
"elmhes",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/matrix/JMatrix.java#L1933-L1948 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.validateNamespace | public T validateNamespace(String prefix, String namespaceUri) {
xmlMessageValidationContext.getControlNamespaces().put(prefix, namespaceUri);
return self;
} | java | public T validateNamespace(String prefix, String namespaceUri) {
xmlMessageValidationContext.getControlNamespaces().put(prefix, namespaceUri);
return self;
} | [
"public",
"T",
"validateNamespace",
"(",
"String",
"prefix",
",",
"String",
"namespaceUri",
")",
"{",
"xmlMessageValidationContext",
".",
"getControlNamespaces",
"(",
")",
".",
"put",
"(",
"prefix",
",",
"namespaceUri",
")",
";",
"return",
"self",
";",
"}"
] | Validates XML namespace with prefix and uri.
@param prefix
@param namespaceUri
@return | [
"Validates",
"XML",
"namespace",
"with",
"prefix",
"and",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L553-L556 |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java | AbstractSingleton.isSingletonInstantiated | public static final boolean isSingletonInstantiated (@Nullable final IScope aScope,
@Nonnull final Class <? extends AbstractSingleton> aClass)
{
return getSingletonIfInstantiated (aScope, aClass) != null;
} | java | public static final boolean isSingletonInstantiated (@Nullable final IScope aScope,
@Nonnull final Class <? extends AbstractSingleton> aClass)
{
return getSingletonIfInstantiated (aScope, aClass) != null;
} | [
"public",
"static",
"final",
"boolean",
"isSingletonInstantiated",
"(",
"@",
"Nullable",
"final",
"IScope",
"aScope",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
"extends",
"AbstractSingleton",
">",
"aClass",
")",
"{",
"return",
"getSingletonIfInstantiated",
... | Check if a singleton is already instantiated inside a scope
@param aScope
The scope to check. May be <code>null</code> to avoid constructing a
scope.
@param aClass
The class to be checked. May not be <code>null</code>.
@return <code>true</code> if the singleton for the specified class is
already instantiated, <code>fa... | [
"Check",
"if",
"a",
"singleton",
"is",
"already",
"instantiated",
"inside",
"a",
"scope"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java#L447-L451 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java | JobsInner.beginCreate | public JobInner beginCreate(String resourceGroupName, String workspaceName, String experimentName, String jobName, JobCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName, parameters).toBlocking().single().body();
} | java | public JobInner beginCreate(String resourceGroupName, String workspaceName, String experimentName, String jobName, JobCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName, parameters).toBlocking().single().body();
} | [
"public",
"JobInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
",",
"String",
"jobName",
",",
"JobCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
... | Creates a Job in the given Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 ... | [
"Creates",
"a",
"Job",
"in",
"the",
"given",
"Experiment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L493-L495 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/AttachmentManager.java | AttachmentManager.uploadAttachment | public Attachment uploadAttachment(String fileName, String contentType,
InputStream content) throws RedmineException, IOException {
return uploadAttachment(fileName, contentType, content, -1);
} | java | public Attachment uploadAttachment(String fileName, String contentType,
InputStream content) throws RedmineException, IOException {
return uploadAttachment(fileName, contentType, content, -1);
} | [
"public",
"Attachment",
"uploadAttachment",
"(",
"String",
"fileName",
",",
"String",
"contentType",
",",
"InputStream",
"content",
")",
"throws",
"RedmineException",
",",
"IOException",
"{",
"return",
"uploadAttachment",
"(",
"fileName",
",",
"contentType",
",",
"c... | Uploads an attachment.
@param fileName
file name of the attachment.
@param contentType
content type of the attachment.
@param content
attachment content stream.
@return attachment content.
@throws RedmineException if something goes wrong.
@throws IOException
if input cannot be read. This exception cannot be thrown yet... | [
"Uploads",
"an",
"attachment",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/AttachmentManager.java#L126-L129 |
iobeam/iobeam-client-java | src/main/java/com/iobeam/api/client/Iobeam.java | Iobeam.sendAsync | public void sendAsync(SendCallback callback) {
List<ImportService.Submit> reqs;
try {
reqs = prepareDataRequests();
} catch (ApiException e) {
IobeamException ie = new IobeamException(e);
if (callback == null) {
throw ie;
} else {
... | java | public void sendAsync(SendCallback callback) {
List<ImportService.Submit> reqs;
try {
reqs = prepareDataRequests();
} catch (ApiException e) {
IobeamException ie = new IobeamException(e);
if (callback == null) {
throw ie;
} else {
... | [
"public",
"void",
"sendAsync",
"(",
"SendCallback",
"callback",
")",
"{",
"List",
"<",
"ImportService",
".",
"Submit",
">",
"reqs",
";",
"try",
"{",
"reqs",
"=",
"prepareDataRequests",
"(",
")",
";",
"}",
"catch",
"(",
"ApiException",
"e",
")",
"{",
"Iob... | Asynchronous version of send() that will not block the calling thread. Any provided callback
will be run on the background thread when the operation completes.
If `autoRetry` is set, failed requests will add the previous data to the new data store.
@param callback Callback for when the operation completes.
@throws Io... | [
"Asynchronous",
"version",
"of",
"send",
"()",
"that",
"will",
"not",
"block",
"the",
"calling",
"thread",
".",
"Any",
"provided",
"callback",
"will",
"be",
"run",
"on",
"the",
"background",
"thread",
"when",
"the",
"operation",
"completes",
"."
] | train | https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/client/Iobeam.java#L1004-L1027 |
requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.dropColumn | public <T> void dropColumn(Attribute<T, ?> attribute) {
Type<T> type = attribute.getDeclaringType();
if (attribute.isForeignKey()) {
// TODO MySQL need to drop FK constraint first
}
QueryBuilder qb = createQueryBuilder();
qb.keyword(ALTER, TABLE)
.tableNam... | java | public <T> void dropColumn(Attribute<T, ?> attribute) {
Type<T> type = attribute.getDeclaringType();
if (attribute.isForeignKey()) {
// TODO MySQL need to drop FK constraint first
}
QueryBuilder qb = createQueryBuilder();
qb.keyword(ALTER, TABLE)
.tableNam... | [
"public",
"<",
"T",
">",
"void",
"dropColumn",
"(",
"Attribute",
"<",
"T",
",",
"?",
">",
"attribute",
")",
"{",
"Type",
"<",
"T",
">",
"type",
"=",
"attribute",
".",
"getDeclaringType",
"(",
")",
";",
"if",
"(",
"attribute",
".",
"isForeignKey",
"("... | Alters the attribute's table and removes the column representing the given {@link Attribute}.
@param attribute being added
@param <T> parent type of the attribute
@throws TableModificationException if the removal fails. | [
"Alters",
"the",
"attribute",
"s",
"table",
"and",
"removes",
"the",
"column",
"representing",
"the",
"given",
"{",
"@link",
"Attribute",
"}",
"."
] | train | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L306-L321 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.updateJiraService | public JiraService updateJiraService(Object projectIdOrPath, JiraService jira) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("merge_requests_events", jira.getMergeRequestsEvents())
.withParam("commit_events", jira.getCommitEvents())
... | java | public JiraService updateJiraService(Object projectIdOrPath, JiraService jira) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("merge_requests_events", jira.getMergeRequestsEvents())
.withParam("commit_events", jira.getCommitEvents())
... | [
"public",
"JiraService",
"updateJiraService",
"(",
"Object",
"projectIdOrPath",
",",
"JiraService",
"jira",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"merge_requests_events\"",
... | Updates the JIRA service settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/jira</code></pre>
The following properties on the JiraService instance are utilized in the update of the settings:
<p>
mergeRequestsEvents (optional) - Enable notifications for merge request events
commitEvents (op... | [
"Updates",
"the",
"JIRA",
"service",
"settings",
"for",
"a",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L290-L302 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.createOrUpdate | public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().last().body();
} | java | public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().last().body();
} | [
"public",
"ExpressRouteCrossConnectionInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"ExpressRouteCrossConnectionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Update the specified ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param parameters Parameters supplied to the update express route crossConnection operation.
@throws IllegalArgumentException thrown if para... | [
"Update",
"the",
"specified",
"ExpressRouteCrossConnection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L444-L446 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/IslamicCalendar.java | IslamicCalendar.monthStart | private long monthStart(int year, int month) {
// Normalize year/month in case month is outside the normal bounds, which may occur
// in the case of an add operation
int realYear = year + month / 12;
int realMonth = month % 12;
long ms = 0;
if (cType == CalculationType.IS... | java | private long monthStart(int year, int month) {
// Normalize year/month in case month is outside the normal bounds, which may occur
// in the case of an add operation
int realYear = year + month / 12;
int realMonth = month % 12;
long ms = 0;
if (cType == CalculationType.IS... | [
"private",
"long",
"monthStart",
"(",
"int",
"year",
",",
"int",
"month",
")",
"{",
"// Normalize year/month in case month is outside the normal bounds, which may occur",
"// in the case of an add operation",
"int",
"realYear",
"=",
"year",
"+",
"month",
"/",
"12",
";",
"... | Return the day # on which the given month starts. Days are counted
from the Hijri epoch, origin 0.
@param year The hijri year
@param month The hijri month, 0-based | [
"Return",
"the",
"day",
"#",
"on",
"which",
"the",
"given",
"month",
"starts",
".",
"Days",
"are",
"counted",
"from",
"the",
"Hijri",
"epoch",
"origin",
"0",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/IslamicCalendar.java#L585-L606 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.findOneById | public T findOneById(K id, DBObject fields) throws MongoException {
return findOne(createIdQuery(id), fields);
} | java | public T findOneById(K id, DBObject fields) throws MongoException {
return findOne(createIdQuery(id), fields);
} | [
"public",
"T",
"findOneById",
"(",
"K",
"id",
",",
"DBObject",
"fields",
")",
"throws",
"MongoException",
"{",
"return",
"findOne",
"(",
"createIdQuery",
"(",
"id",
")",
",",
"fields",
")",
";",
"}"
] | Find an object by the given id
@param id The id
@return The object
@throws MongoException If an error occurred | [
"Find",
"an",
"object",
"by",
"the",
"given",
"id"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L858-L860 |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/util/BcdHelper.java | BcdHelper.bcdDecodeToHexString | public static String bcdDecodeToHexString(int encodingScheme, byte[] bcdBytes) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
for (byte b : bcdBytes) {
sb.append(bcdToHexString(encodingScheme, b));
}
if (GenericDigits._ENCODING_SCHEME_BCD_ODD =... | java | public static String bcdDecodeToHexString(int encodingScheme, byte[] bcdBytes) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
for (byte b : bcdBytes) {
sb.append(bcdToHexString(encodingScheme, b));
}
if (GenericDigits._ENCODING_SCHEME_BCD_ODD =... | [
"public",
"static",
"String",
"bcdDecodeToHexString",
"(",
"int",
"encodingScheme",
",",
"byte",
"[",
"]",
"bcdBytes",
")",
"throws",
"UnsupportedEncodingException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"byte",
"b",... | Decoded BCD encoded string into Hex digits string.
@param encodingScheme BCD endcoding scheme to be used
@param bcdBytes bytes table to decode.
@return hex string representation of BCD encoded digits | [
"Decoded",
"BCD",
"encoded",
"string",
"into",
"Hex",
"digits",
"string",
"."
] | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/util/BcdHelper.java#L160-L171 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java | ClusterManagerClient.completeIPRotation | public final Operation completeIPRotation(String projectId, String zone, String clusterId) {
CompleteIPRotationRequest request =
CompleteIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
return compl... | java | public final Operation completeIPRotation(String projectId, String zone, String clusterId) {
CompleteIPRotationRequest request =
CompleteIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
return compl... | [
"public",
"final",
"Operation",
"completeIPRotation",
"(",
"String",
"projectId",
",",
"String",
"zone",
",",
"String",
"clusterId",
")",
"{",
"CompleteIPRotationRequest",
"request",
"=",
"CompleteIPRotationRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
... | Completes master IP rotation.
<p>Sample code:
<pre><code>
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Operation response = clusterManagerClient.completeIPRotation(projectId, zone, clusterId);
}
</code></pre>
@param ... | [
"Completes",
"master",
"IP",
"rotation",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java#L2528-L2537 |
andrehertwig/admintool | admin-tools-core/src/main/java/de/chandre/admintool/core/utils/ReflectUtils.java | ReflectUtils.invokeGetter | @SuppressWarnings("unchecked")
public static <S extends Serializable> S invokeGetter(Object object, Field field)
{
Method m = ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toGetter(field.getName()));
if (null == m) {
for (String prefix : PREFIXES) {
m = ReflectionUtils.findMethod(object.getCl... | java | @SuppressWarnings("unchecked")
public static <S extends Serializable> S invokeGetter(Object object, Field field)
{
Method m = ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toGetter(field.getName()));
if (null == m) {
for (String prefix : PREFIXES) {
m = ReflectionUtils.findMethod(object.getCl... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"S",
"extends",
"Serializable",
">",
"S",
"invokeGetter",
"(",
"Object",
"object",
",",
"Field",
"field",
")",
"{",
"Method",
"m",
"=",
"ReflectionUtils",
".",
"findMethod",
"(",
"o... | invokes the getter on the filed
@param object
@param field
@return | [
"invokes",
"the",
"getter",
"on",
"the",
"filed"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/utils/ReflectUtils.java#L130-L143 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java | CoverageDataPng.getPixelValue | public short getPixelValue(BufferedImage image, int x, int y) {
validateImageType(image);
WritableRaster raster = image.getRaster();
short pixelValue = getPixelValue(raster, x, y);
return pixelValue;
} | java | public short getPixelValue(BufferedImage image, int x, int y) {
validateImageType(image);
WritableRaster raster = image.getRaster();
short pixelValue = getPixelValue(raster, x, y);
return pixelValue;
} | [
"public",
"short",
"getPixelValue",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"validateImageType",
"(",
"image",
")",
";",
"WritableRaster",
"raster",
"=",
"image",
".",
"getRaster",
"(",
")",
";",
"short",
"pixelValue",
"=... | Get the pixel value as an "unsigned short"
@param image
tile image
@param x
x coordinate
@param y
y coordinate
@return "unsigned short" pixel value | [
"Get",
"the",
"pixel",
"value",
"as",
"an",
"unsigned",
"short"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L118-L123 |
mesosphere/mesos-http-adapter | src/main/java/com/mesosphere/mesos/http-adapter/MesosToSchedulerDriverAdapter.java | MesosToSchedulerDriverAdapter.startInternal | @VisibleForTesting
protected Mesos startInternal() {
String version = System.getenv("MESOS_API_VERSION");
if (version == null) {
version = "V0";
}
LOGGER.info("Using Mesos API version: {}", version);
if (version.equals("V0")) {
if (credential == null... | java | @VisibleForTesting
protected Mesos startInternal() {
String version = System.getenv("MESOS_API_VERSION");
if (version == null) {
version = "V0";
}
LOGGER.info("Using Mesos API version: {}", version);
if (version.equals("V0")) {
if (credential == null... | [
"@",
"VisibleForTesting",
"protected",
"Mesos",
"startInternal",
"(",
")",
"{",
"String",
"version",
"=",
"System",
".",
"getenv",
"(",
"\"MESOS_API_VERSION\"",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"version",
"=",
"\"V0\"",
";",
"}",
"LO... | Broken out into a separate function to allow testing with custom `Mesos` implementations. | [
"Broken",
"out",
"into",
"a",
"separate",
"function",
"to",
"allow",
"testing",
"with",
"custom",
"Mesos",
"implementations",
"."
] | train | https://github.com/mesosphere/mesos-http-adapter/blob/5965d467c86ce7a1092bda5624dd2da9b0776334/src/main/java/com/mesosphere/mesos/http-adapter/MesosToSchedulerDriverAdapter.java#L314-L338 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java | MapTileCollisionRendererModel.createFunctionDraw | public static ImageBuffer createFunctionDraw(CollisionFormula collision, int tw, int th)
{
final ImageBuffer buffer = Graphics.createImageBuffer(tw, th, ColorRgba.TRANSPARENT);
final Graphic g = buffer.createGraphic();
g.setColor(ColorRgba.PURPLE);
createFunctionDraw(g, collis... | java | public static ImageBuffer createFunctionDraw(CollisionFormula collision, int tw, int th)
{
final ImageBuffer buffer = Graphics.createImageBuffer(tw, th, ColorRgba.TRANSPARENT);
final Graphic g = buffer.createGraphic();
g.setColor(ColorRgba.PURPLE);
createFunctionDraw(g, collis... | [
"public",
"static",
"ImageBuffer",
"createFunctionDraw",
"(",
"CollisionFormula",
"collision",
",",
"int",
"tw",
",",
"int",
"th",
")",
"{",
"final",
"ImageBuffer",
"buffer",
"=",
"Graphics",
".",
"createImageBuffer",
"(",
"tw",
",",
"th",
",",
"ColorRgba",
".... | Create the function draw to buffer.
@param collision The collision reference.
@param tw The tile width.
@param th The tile height.
@return The created collision representation buffer. | [
"Create",
"the",
"function",
"draw",
"to",
"buffer",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java#L48-L58 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/TextUtil.java | TextUtil.relativizePath | public static String relativizePath(String path, boolean withIndex)
{
if (path.startsWith("/"))
path = path.substring(1);
if (!withIndex && path.endsWith("]"))
{
int index = path.lastIndexOf('[');
return index == -1 ? path : path.substring(0, index);
}
... | java | public static String relativizePath(String path, boolean withIndex)
{
if (path.startsWith("/"))
path = path.substring(1);
if (!withIndex && path.endsWith("]"))
{
int index = path.lastIndexOf('[');
return index == -1 ? path : path.substring(0, index);
}
... | [
"public",
"static",
"String",
"relativizePath",
"(",
"String",
"path",
",",
"boolean",
"withIndex",
")",
"{",
"if",
"(",
"path",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"path",
"=",
"path",
".",
"substring",
"(",
"1",
")",
";",
"if",
"(",
"!",
"wi... | Creates relative path from string.
@param path path
@param withIndex indicates whether we should keep the index or not
@return relative path | [
"Creates",
"relative",
"path",
"from",
"string",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/TextUtil.java#L166-L177 |
m-m-m/util | xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java | XmlBeanMapper.saveXml | public void saveXml(T jaxbBean, OutputStream outputStream) {
try {
validate(jaxbBean);
getOrCreateMarshaller().marshal(jaxbBean, outputStream);
} catch (MarshalException e) {
throw new XmlInvalidException(e, jaxbBean);
} catch (JAXBException e) {
throw new IllegalStateException(e);
... | java | public void saveXml(T jaxbBean, OutputStream outputStream) {
try {
validate(jaxbBean);
getOrCreateMarshaller().marshal(jaxbBean, outputStream);
} catch (MarshalException e) {
throw new XmlInvalidException(e, jaxbBean);
} catch (JAXBException e) {
throw new IllegalStateException(e);
... | [
"public",
"void",
"saveXml",
"(",
"T",
"jaxbBean",
",",
"OutputStream",
"outputStream",
")",
"{",
"try",
"{",
"validate",
"(",
"jaxbBean",
")",
";",
"getOrCreateMarshaller",
"(",
")",
".",
"marshal",
"(",
"jaxbBean",
",",
"outputStream",
")",
";",
"}",
"ca... | This method saves the given {@code jaxbBean} as XML to the given {@code outputStream}. <br>
<b>ATTENTION:</b><br>
The caller of this method has to {@link OutputStream#close() close} the {@code outputStream}.
@param jaxbBean is the JAXB-bean to save as XML.
@param outputStream is the {@link OutputStream} where to write... | [
"This",
"method",
"saves",
"the",
"given",
"{",
"@code",
"jaxbBean",
"}",
"as",
"XML",
"to",
"the",
"given",
"{",
"@code",
"outputStream",
"}",
".",
"<br",
">",
"<b",
">",
"ATTENTION",
":",
"<",
"/",
"b",
">",
"<br",
">",
"The",
"caller",
"of",
"th... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java#L330-L340 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java | EmulatedFields.get | public double get(String name, double defaultValue) throws IllegalArgumentException {
ObjectSlot slot = findMandatorySlot(name, double.class);
return slot.defaulted ? defaultValue : ((Double) slot.fieldValue).doubleValue();
} | java | public double get(String name, double defaultValue) throws IllegalArgumentException {
ObjectSlot slot = findMandatorySlot(name, double.class);
return slot.defaulted ? defaultValue : ((Double) slot.fieldValue).doubleValue();
} | [
"public",
"double",
"get",
"(",
"String",
"name",
",",
"double",
"defaultValue",
")",
"throws",
"IllegalArgumentException",
"{",
"ObjectSlot",
"slot",
"=",
"findMandatorySlot",
"(",
"name",
",",
"double",
".",
"class",
")",
";",
"return",
"slot",
".",
"default... | Finds and returns the double value of a given field named {@code name}
in the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name of the field to find.
@param defaultValue
return value in case the field has not been assigned to ye... | [
"Finds",
"and",
"returns",
"the",
"double",
"value",
"of",
"a",
"given",
"field",
"named",
"{",
"@code",
"name",
"}",
"in",
"the",
"receiver",
".",
"If",
"the",
"field",
"has",
"not",
"been",
"assigned",
"any",
"value",
"yet",
"the",
"default",
"value",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java#L248-L251 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java | BitmapUtils.applyColor | public static Bitmap applyColor(Bitmap bitmap, int accentColor) {
int r = Color.red(accentColor);
int g = Color.green(accentColor);
int b = Color.blue(accentColor);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
bitmap.getPixels(pixels, 0, width,... | java | public static Bitmap applyColor(Bitmap bitmap, int accentColor) {
int r = Color.red(accentColor);
int g = Color.green(accentColor);
int b = Color.blue(accentColor);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
bitmap.getPixels(pixels, 0, width,... | [
"public",
"static",
"Bitmap",
"applyColor",
"(",
"Bitmap",
"bitmap",
",",
"int",
"accentColor",
")",
"{",
"int",
"r",
"=",
"Color",
".",
"red",
"(",
"accentColor",
")",
";",
"int",
"g",
"=",
"Color",
".",
"green",
"(",
"accentColor",
")",
";",
"int",
... | Creates a copy of the bitmap by replacing the color of every pixel
by accentColor while keeping the alpha value.
@param bitmap The original bitmap.
@param accentColor The color to apply to every pixel.
@return A copy of the given bitmap with the accent color applied. | [
"Creates",
"a",
"copy",
"of",
"the",
"bitmap",
"by",
"replacing",
"the",
"color",
"of",
"every",
"pixel",
"by",
"accentColor",
"while",
"keeping",
"the",
"alpha",
"value",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java#L53-L69 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/DividedDateTimeField.java | DividedDateTimeField.addWrapField | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
} | java | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"instant",
",",
"FieldUtils",
".",
"getWrappedValue",
"(",
"get",
"(",
"instant",
")",
",",
"amount",
",",
"iMin",
",",
"iMax",
")",
")",
";... | Add to the scaled component of the specified time instant,
wrapping around within that component if necessary.
@param instant the time instant in millis to update.
@param amount the amount of scaled units to add (can be negative).
@return the updated time instant. | [
"Add",
"to",
"the",
"scaled",
"component",
"of",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"that",
"component",
"if",
"necessary",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/DividedDateTimeField.java#L181-L183 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadPGM | public static BufferedImage loadPGM( String fileName , BufferedImage storage ) throws IOException {
return loadPGM(new FileInputStream(fileName), storage);
} | java | public static BufferedImage loadPGM( String fileName , BufferedImage storage ) throws IOException {
return loadPGM(new FileInputStream(fileName), storage);
} | [
"public",
"static",
"BufferedImage",
"loadPGM",
"(",
"String",
"fileName",
",",
"BufferedImage",
"storage",
")",
"throws",
"IOException",
"{",
"return",
"loadPGM",
"(",
"new",
"FileInputStream",
"(",
"fileName",
")",
",",
"storage",
")",
";",
"}"
] | Loads a PGM image from a file.
@param fileName Location of PGM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_BYTE_GRAY. If null or width/height incorrect a new image
will be declared.
@return The image
@th... | [
"Loads",
"a",
"PGM",
"image",
"from",
"a",
"file",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L217-L219 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.checkNotAncestor | private void checkNotAncestor(File source, Directory destParent, FileSystemView destView)
throws IOException {
// if dest is not in the same file system, it couldn't be in source's subdirectories
if (!isSameFileSystem(destView)) {
return;
}
Directory current = destParent;
while (true) {... | java | private void checkNotAncestor(File source, Directory destParent, FileSystemView destView)
throws IOException {
// if dest is not in the same file system, it couldn't be in source's subdirectories
if (!isSameFileSystem(destView)) {
return;
}
Directory current = destParent;
while (true) {... | [
"private",
"void",
"checkNotAncestor",
"(",
"File",
"source",
",",
"Directory",
"destParent",
",",
"FileSystemView",
"destView",
")",
"throws",
"IOException",
"{",
"// if dest is not in the same file system, it couldn't be in source's subdirectories",
"if",
"(",
"!",
"isSameF... | Checks that source is not an ancestor of dest, throwing an exception if it is. | [
"Checks",
"that",
"source",
"is",
"not",
"an",
"ancestor",
"of",
"dest",
"throwing",
"an",
"exception",
"if",
"it",
"is",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L640-L660 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.resetSharedKeyAsync | public Observable<ConnectionResetSharedKeyInner> resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) {
return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1<ServiceResponse<ConnectionRes... | java | public Observable<ConnectionResetSharedKeyInner> resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) {
return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1<ServiceResponse<ConnectionRes... | [
"public",
"Observable",
"<",
"ConnectionResetSharedKeyInner",
">",
"resetSharedKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"int",
"keyLength",
")",
"{",
"return",
"resetSharedKeyWithServiceResponseAsync",
"(",
"res... | The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConn... | [
"The",
"VirtualNetworkGatewayConnectionResetSharedKey",
"operation",
"resets",
"the",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"for",
"passed",
"virtual",
"network",
"gateway",
"connection",
"in",
"the",
"specified",
"resource",
"group",
"through",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L1250-L1257 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/JCellButton.java | JCellButton.init | public void init(Icon icon, String text)
{
this.setText(text);
this.setIcon(icon);
this.setMargin(JScreenConstants.NO_INSETS);
} | java | public void init(Icon icon, String text)
{
this.setText(text);
this.setIcon(icon);
this.setMargin(JScreenConstants.NO_INSETS);
} | [
"public",
"void",
"init",
"(",
"Icon",
"icon",
",",
"String",
"text",
")",
"{",
"this",
".",
"setText",
"(",
"text",
")",
";",
"this",
".",
"setIcon",
"(",
"icon",
")",
";",
"this",
".",
"setMargin",
"(",
"JScreenConstants",
".",
"NO_INSETS",
")",
";... | Creates new JCellButton. The icon and text are reversed, because of a conflicting method in JButton.
@param text the button text.
@param icon The button icon. | [
"Creates",
"new",
"JCellButton",
".",
"The",
"icon",
"and",
"text",
"are",
"reversed",
"because",
"of",
"a",
"conflicting",
"method",
"in",
"JButton",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/JCellButton.java#L82-L87 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public short getRequstURIPath(String prefix, short defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Short.parseShort(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | java | public short getRequstURIPath(String prefix, short defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Short.parseShort(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | [
"public",
"short",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"short",
"defvalue",
")",
"{",
"String",
"val",
"=",
"getRequstURIPath",
"(",
"prefix",
",",
"null",
")",
";",
"try",
"{",
"return",
"val",
"==",
"null",
"?",
"defvalue",
":",
"Short",
... | 获取请求URL分段中含prefix段的short值 <br>
例如请求URL /pipes/record/query/type:10 <br>
获取type参数: short type = request.getRequstURIPath("type:", (short)0);
@param prefix prefix段前缀
@param defvalue 默认short值
@return short值 | [
"获取请求URL分段中含prefix段的short值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"type",
":",
"10",
"<br",
">",
"获取type参数",
":",
"short",
"type",
"=",
"request",
".",
"getRequstURIPath",
"(",
"type",
":",
"(",
"short",
")",
"0",
")",
... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L817-L824 |
urish/gwt-titanium | src/main/java/org/urish/gwtit/client/util/Timers.java | Timers.setInterval | public static Timer setInterval(int milliseconds, TimerCallback callback) {
IntervalTimer interval = new IntervalTimer();
interval.setId(nativeSetInterval(milliseconds, callback, interval));
return interval;
} | java | public static Timer setInterval(int milliseconds, TimerCallback callback) {
IntervalTimer interval = new IntervalTimer();
interval.setId(nativeSetInterval(milliseconds, callback, interval));
return interval;
} | [
"public",
"static",
"Timer",
"setInterval",
"(",
"int",
"milliseconds",
",",
"TimerCallback",
"callback",
")",
"{",
"IntervalTimer",
"interval",
"=",
"new",
"IntervalTimer",
"(",
")",
";",
"interval",
".",
"setId",
"(",
"nativeSetInterval",
"(",
"milliseconds",
... | Defines a repeating timer with a specified interval.
@param milliseconds Interval between timer shots.
@param callback Callback to fire on each timer shot.
@return The new interval object | [
"Defines",
"a",
"repeating",
"timer",
"with",
"a",
"specified",
"interval",
"."
] | train | https://github.com/urish/gwt-titanium/blob/5b53a312093a84f235366932430f02006a570612/src/main/java/org/urish/gwtit/client/util/Timers.java#L127-L131 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract1.java | Tesseract1.doOCR | @Override
public String doOCR(BufferedImage bi, Rectangle rect) throws TesseractException {
try {
return doOCR(ImageIOHelper.getIIOImageList(bi), rect);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new TesseractException(e);
}
} | java | @Override
public String doOCR(BufferedImage bi, Rectangle rect) throws TesseractException {
try {
return doOCR(ImageIOHelper.getIIOImageList(bi), rect);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new TesseractException(e);
}
} | [
"@",
"Override",
"public",
"String",
"doOCR",
"(",
"BufferedImage",
"bi",
",",
"Rectangle",
"rect",
")",
"throws",
"TesseractException",
"{",
"try",
"{",
"return",
"doOCR",
"(",
"ImageIOHelper",
".",
"getIIOImageList",
"(",
"bi",
")",
",",
"rect",
")",
";",
... | Performs OCR operation.
@param bi a buffered image
@param rect the bounding rectangle defines the region of the image to be
recognized. A rectangle of zero dimension or <code>null</code> indicates
the whole image.
@return the recognized text
@throws TesseractException | [
"Performs",
"OCR",
"operation",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L253-L261 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ADMMessage.java | ADMMessage.withData | public ADMMessage withData(java.util.Map<String, String> data) {
setData(data);
return this;
} | java | public ADMMessage withData(java.util.Map<String, String> data) {
setData(data);
return this;
} | [
"public",
"ADMMessage",
"withData",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"data",
")",
"{",
"setData",
"(",
"data",
")",
";",
"return",
"this",
";",
"}"
] | The data payload used for a silent push. This payload is added to the notifications' data.pinpoint.jsonBody'
object
@param data
The data payload used for a silent push. This payload is added to the notifications'
data.pinpoint.jsonBody' object
@return Returns a reference to this object so that method calls can be chai... | [
"The",
"data",
"payload",
"used",
"for",
"a",
"silent",
"push",
".",
"This",
"payload",
"is",
"added",
"to",
"the",
"notifications",
"data",
".",
"pinpoint",
".",
"jsonBody",
"object"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ADMMessage.java#L275-L278 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/DirectQuickSelectSketchR.java | DirectQuickSelectSketchR.setHashTableThreshold | static final int setHashTableThreshold(final int lgNomLongs, final int lgArrLongs) {
//FindBugs may complain if DQS_RESIZE_THRESHOLD == REBUILD_THRESHOLD, but this allows us
// to tune these constants for different sketches.
final double fraction = (lgArrLongs <= lgNomLongs) ? DQS_RESIZE_THRESHOLD : REBUILD... | java | static final int setHashTableThreshold(final int lgNomLongs, final int lgArrLongs) {
//FindBugs may complain if DQS_RESIZE_THRESHOLD == REBUILD_THRESHOLD, but this allows us
// to tune these constants for different sketches.
final double fraction = (lgArrLongs <= lgNomLongs) ? DQS_RESIZE_THRESHOLD : REBUILD... | [
"static",
"final",
"int",
"setHashTableThreshold",
"(",
"final",
"int",
"lgNomLongs",
",",
"final",
"int",
"lgArrLongs",
")",
"{",
"//FindBugs may complain if DQS_RESIZE_THRESHOLD == REBUILD_THRESHOLD, but this allows us",
"// to tune these constants for different sketches.",
"final"... | Returns the cardinality limit given the current size of the hash table array.
@param lgNomLongs <a href="{@docRoot}/resources/dictionary.html#lgNomLongs">See lgNomLongs</a>.
@param lgArrLongs <a href="{@docRoot}/resources/dictionary.html#lgArrLongs">See lgArrLongs</a>.
@return the hash table threshold | [
"Returns",
"the",
"cardinality",
"limit",
"given",
"the",
"current",
"size",
"of",
"the",
"hash",
"table",
"array",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/DirectQuickSelectSketchR.java#L252-L257 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/util/automount/Automounter.java | Automounter.addHandle | public static boolean addHandle(VirtualFile owner, Closeable handle) {
RegistryEntry entry = getEntry(owner);
return entry.handles.add(handle);
} | java | public static boolean addHandle(VirtualFile owner, Closeable handle) {
RegistryEntry entry = getEntry(owner);
return entry.handles.add(handle);
} | [
"public",
"static",
"boolean",
"addHandle",
"(",
"VirtualFile",
"owner",
",",
"Closeable",
"handle",
")",
"{",
"RegistryEntry",
"entry",
"=",
"getEntry",
"(",
"owner",
")",
";",
"return",
"entry",
".",
"handles",
".",
"add",
"(",
"handle",
")",
";",
"}"
] | Add handle to owner, to be auto closed.
@param owner the handle owner
@param handle the handle
@return add result | [
"Add",
"handle",
"to",
"owner",
"to",
"be",
"auto",
"closed",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/automount/Automounter.java#L134-L137 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java | JsonServiceDocumentWriter.writeObject | private void writeObject(JsonGenerator jsonGenerator, Object entity) throws IOException {
jsonGenerator.writeStartObject();
writeName(jsonGenerator, entity);
writeKind(jsonGenerator, entity);
writeURL(jsonGenerator, entity);
jsonGenerator.writeEndObject();
} | java | private void writeObject(JsonGenerator jsonGenerator, Object entity) throws IOException {
jsonGenerator.writeStartObject();
writeName(jsonGenerator, entity);
writeKind(jsonGenerator, entity);
writeURL(jsonGenerator, entity);
jsonGenerator.writeEndObject();
} | [
"private",
"void",
"writeObject",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"Object",
"entity",
")",
"throws",
"IOException",
"{",
"jsonGenerator",
".",
"writeStartObject",
"(",
")",
";",
"writeName",
"(",
"jsonGenerator",
",",
"entity",
")",
";",
"writeKind",
... | Build an embedded json object that will have key-value attributes like
'name' and 'url' (they are MUST), 'title' and 'kind'.
@param jsonGenerator jsonGenerator
@param entity entitySet or singleton
@throws IOException | [
"Build",
"an",
"embedded",
"json",
"object",
"that",
"will",
"have",
"key",
"-",
"value",
"attributes",
"like",
"name",
"and",
"url",
"(",
"they",
"are",
"MUST",
")",
"title",
"and",
"kind",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java#L106-L114 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/trustregion/TrustRegionUpdateDogleg_F64.java | TrustRegionUpdateDogleg_F64.fractionCauchyToGN | static double fractionCauchyToGN(double lengthCauchy , double lengthGN , double lengthPtoGN, double region ) {
// First triangle has 3 known sides
double a=lengthGN,b=lengthCauchy,c=lengthPtoGN;
// Law of cosine to find angle for side GN (a.k.a 'a')
double cosineA = (a*a - b*b - c*c)/(-2.0*b*c);
double angl... | java | static double fractionCauchyToGN(double lengthCauchy , double lengthGN , double lengthPtoGN, double region ) {
// First triangle has 3 known sides
double a=lengthGN,b=lengthCauchy,c=lengthPtoGN;
// Law of cosine to find angle for side GN (a.k.a 'a')
double cosineA = (a*a - b*b - c*c)/(-2.0*b*c);
double angl... | [
"static",
"double",
"fractionCauchyToGN",
"(",
"double",
"lengthCauchy",
",",
"double",
"lengthGN",
",",
"double",
"lengthPtoGN",
",",
"double",
"region",
")",
"{",
"// First triangle has 3 known sides",
"double",
"a",
"=",
"lengthGN",
",",
"b",
"=",
"lengthCauchy",... | Compute the fractional distance from P to GN where the point intersects the region's boundary | [
"Compute",
"the",
"fractional",
"distance",
"from",
"P",
"to",
"GN",
"where",
"the",
"point",
"intersects",
"the",
"region",
"s",
"boundary"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/trustregion/TrustRegionUpdateDogleg_F64.java#L207-L225 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/calls/peers/PeerConnectionInt.java | PeerConnectionInt.onCandidate | public void onCandidate(long sessionId, int index, String id, String sdp) {
send(new PeerConnectionActor.OnCandidate(sessionId, index, id, sdp));
} | java | public void onCandidate(long sessionId, int index, String id, String sdp) {
send(new PeerConnectionActor.OnCandidate(sessionId, index, id, sdp));
} | [
"public",
"void",
"onCandidate",
"(",
"long",
"sessionId",
",",
"int",
"index",
",",
"String",
"id",
",",
"String",
"sdp",
")",
"{",
"send",
"(",
"new",
"PeerConnectionActor",
".",
"OnCandidate",
"(",
"sessionId",
",",
"index",
",",
"id",
",",
"sdp",
")"... | Call this method when new candidate arrived from other peer
@param index index of media in sdp
@param id id of candidate
@param sdp sdp of candidate | [
"Call",
"this",
"method",
"when",
"new",
"candidate",
"arrived",
"from",
"other",
"peer"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/calls/peers/PeerConnectionInt.java#L104-L106 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorXyz.java | ColorXyz.xyzToSrgb | public static void xyzToSrgb( float x , float y , float z , float srgb[] ) {
srgb[0] = 3.240479f*x - 1.53715f*y - 0.498535f*z;
srgb[1] = -0.969256f*x + 1.875991f*y + 0.041556f*z;
srgb[2] = 0.055648f*x - 0.204043f*y + 1.057311f*z;
} | java | public static void xyzToSrgb( float x , float y , float z , float srgb[] ) {
srgb[0] = 3.240479f*x - 1.53715f*y - 0.498535f*z;
srgb[1] = -0.969256f*x + 1.875991f*y + 0.041556f*z;
srgb[2] = 0.055648f*x - 0.204043f*y + 1.057311f*z;
} | [
"public",
"static",
"void",
"xyzToSrgb",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
",",
"float",
"srgb",
"[",
"]",
")",
"{",
"srgb",
"[",
"0",
"]",
"=",
"3.240479f",
"*",
"x",
"-",
"1.53715f",
"*",
"y",
"-",
"0.498535f",
"*",
"z",
... | Conversion from normalized RGB into XYZ. Normalized RGB values have a range of 0:1 | [
"Conversion",
"from",
"normalized",
"RGB",
"into",
"XYZ",
".",
"Normalized",
"RGB",
"values",
"have",
"a",
"range",
"of",
"0",
":",
"1"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorXyz.java#L88-L92 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/xml/NodeProcessor.java | NodeProcessor.applyNamespace | public static void applyNamespace(Namespace nsp, Element e) {
// Assertions...
if (nsp == null) {
String msg = "Argument 'nsp' cannot be null.";
throw new IllegalArgumentException(msg);
}
if (e == null) {
String msg = "Argument 'e [Element]' cannot be null.";
throw new IllegalArgumentException(msg)... | java | public static void applyNamespace(Namespace nsp, Element e) {
// Assertions...
if (nsp == null) {
String msg = "Argument 'nsp' cannot be null.";
throw new IllegalArgumentException(msg);
}
if (e == null) {
String msg = "Argument 'e [Element]' cannot be null.";
throw new IllegalArgumentException(msg)... | [
"public",
"static",
"void",
"applyNamespace",
"(",
"Namespace",
"nsp",
",",
"Element",
"e",
")",
"{",
"// Assertions...",
"if",
"(",
"nsp",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"Argument 'nsp' cannot be null.\"",
";",
"throw",
"new",
"IllegalArgumentE... | Recursively applies the specified <code>Namespace</code> to the specified
<code>Element</code>, unless the <code>Element</code> (or any child
<code>Element</code>) already specifies a <code>Namespace</code>.
@param nsp Namespace to apply.
@param e XML structure upon which to apply the Namespace. | [
"Recursively",
"applies",
"the",
"specified",
"<code",
">",
"Namespace<",
"/",
"code",
">",
"to",
"the",
"specified",
"<code",
">",
"Element<",
"/",
"code",
">",
"unless",
"the",
"<code",
">",
"Element<",
"/",
"code",
">",
"(",
"or",
"any",
"child",
"<co... | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/xml/NodeProcessor.java#L86-L105 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java | ServiceEndpointPolicyDefinitionsInner.createOrUpdateAsync | public Observable<ServiceEndpointPolicyDefinitionInner> createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) {
return createOrUpdateWithServiceResponseAsync(resourceGroup... | java | public Observable<ServiceEndpointPolicyDefinitionInner> createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) {
return createOrUpdateWithServiceResponseAsync(resourceGroup... | [
"public",
"Observable",
"<",
"ServiceEndpointPolicyDefinitionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serviceEndpointPolicyName",
",",
"String",
"serviceEndpointPolicyDefinitionName",
",",
"ServiceEndpointPolicyDefinitionInner",
"servi... | Creates or updates a service endpoint policy definition in the specified service endpoint policy.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definit... | [
"Creates",
"or",
"updates",
"a",
"service",
"endpoint",
"policy",
"definition",
"in",
"the",
"specified",
"service",
"endpoint",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java#L391-L398 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/lang/MessageResolver.java | MessageResolver.getMessage | public String getMessage(final MSLocale formatLocale, Locale runtimeLocale, final String key) {
if(formatLocale != null) {
return getMessage(formatLocale, key);
} else {
return getMessage(runtimeLocale, key);
}
} | java | public String getMessage(final MSLocale formatLocale, Locale runtimeLocale, final String key) {
if(formatLocale != null) {
return getMessage(formatLocale, key);
} else {
return getMessage(runtimeLocale, key);
}
} | [
"public",
"String",
"getMessage",
"(",
"final",
"MSLocale",
"formatLocale",
",",
"Locale",
"runtimeLocale",
",",
"final",
"String",
"key",
")",
"{",
"if",
"(",
"formatLocale",
"!=",
"null",
")",
"{",
"return",
"getMessage",
"(",
"formatLocale",
",",
"key",
"... | 書式のロケールを優先して、キーに対するメッセージを取得する。
formatLocaleがnullのとき、runtimeLocaleから値を取得する。
@since 0.10
@param formatLocale 書式に指定されているロケール。nullの場合がある。
@param runtimeLocale 実行時のロケール。
@param key メッセージキー
@return 該当するロケールのメッセージが見つからない場合は、デフォルトのリソースから取得する。 | [
"書式のロケールを優先して、キーに対するメッセージを取得する。",
"formatLocaleがnullのとき、runtimeLocaleから値を取得する。"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/MessageResolver.java#L338-L346 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.importCertificateAsync | public Observable<CertificateBundle> importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) {
return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate).map(new Func1<ServiceResponse<CertificateBundle>, CertificateBundl... | java | public Observable<CertificateBundle> importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate) {
return importCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, base64EncodedCertificate).map(new Func1<ServiceResponse<CertificateBundle>, CertificateBundl... | [
"public",
"Observable",
"<",
"CertificateBundle",
">",
"importCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"base64EncodedCertificate",
")",
"{",
"return",
"importCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
... | Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation r... | [
"Imports",
"a",
"certificate",
"into",
"a",
"specified",
"key",
"vault",
".",
"Imports",
"an",
"existing",
"valid",
"certificate",
"containing",
"a",
"private",
"key",
"into",
"Azure",
"Key",
"Vault",
".",
"The",
"certificate",
"to",
"be",
"imported",
"can",
... | train | 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#L6713-L6720 |
joinfaces/joinfaces | joinfaces-tools/joinfaces-scan-tools/src/main/java/org/joinfaces/tools/ScanResultHandler.java | ScanResultHandler.writeClassList | protected void writeClassList(File file, Collection<String> classNames) throws IOException {
File baseDir = file.getParentFile();
if (baseDir.isDirectory() || baseDir.mkdirs()) {
Files.write(file.toPath(), classNames, StandardCharsets.UTF_8);
}
else {
throw new IOException(baseDir + " does not exist and ... | java | protected void writeClassList(File file, Collection<String> classNames) throws IOException {
File baseDir = file.getParentFile();
if (baseDir.isDirectory() || baseDir.mkdirs()) {
Files.write(file.toPath(), classNames, StandardCharsets.UTF_8);
}
else {
throw new IOException(baseDir + " does not exist and ... | [
"protected",
"void",
"writeClassList",
"(",
"File",
"file",
",",
"Collection",
"<",
"String",
">",
"classNames",
")",
"throws",
"IOException",
"{",
"File",
"baseDir",
"=",
"file",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"baseDir",
".",
"isDirectory",... | Helper method which writes a list of class names to the given file.
@param file The target file in which the class names should be written.
@param classNames The class names which should be written in the target file.
@throws IOException when the class names could not be written to the target file. | [
"Helper",
"method",
"which",
"writes",
"a",
"list",
"of",
"class",
"names",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/joinfaces/joinfaces/blob/c9fc811a9eaf695820951f2c04715297dd1e6d66/joinfaces-tools/joinfaces-scan-tools/src/main/java/org/joinfaces/tools/ScanResultHandler.java#L58-L67 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/FleetsApi.java | FleetsApi.postFleetsFleetIdWings | public FleetWingCreatedResponse postFleetsFleetIdWings(Long fleetId, String datasource, String token)
throws ApiException {
ApiResponse<FleetWingCreatedResponse> resp = postFleetsFleetIdWingsWithHttpInfo(fleetId, datasource, token);
return resp.getData();
} | java | public FleetWingCreatedResponse postFleetsFleetIdWings(Long fleetId, String datasource, String token)
throws ApiException {
ApiResponse<FleetWingCreatedResponse> resp = postFleetsFleetIdWingsWithHttpInfo(fleetId, datasource, token);
return resp.getData();
} | [
"public",
"FleetWingCreatedResponse",
"postFleetsFleetIdWings",
"(",
"Long",
"fleetId",
",",
"String",
"datasource",
",",
"String",
"token",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"FleetWingCreatedResponse",
">",
"resp",
"=",
"postFleetsFleetIdWingsWithHt... | Create fleet wing Create a new wing in a fleet --- SSO Scope:
esi-fleets.write_fleet.v1
@param fleetId
ID for a fleet (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param token
Access token to use if unable to set a header (optional)
@return FleetWingCreatedRe... | [
"Create",
"fleet",
"wing",
"Create",
"a",
"new",
"wing",
"in",
"a",
"fleet",
"---",
"SSO",
"Scope",
":",
"esi",
"-",
"fleets",
".",
"write_fleet",
".",
"v1"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/FleetsApi.java#L1479-L1483 |
katharsis-project/katharsis-framework | katharsis-core/src/main/java/io/katharsis/repository/ResourceRepositoryBase.java | ResourceRepositoryBase.findOne | @Override
public T findOne(I id, QuerySpec querySpec) {
RegistryEntry entry = resourceRegistry.findEntry(resourceClass);
String idName = entry.getResourceInformation().getIdField().getUnderlyingName();
QuerySpec idQuerySpec = querySpec.duplicate();
idQuerySpec.addFilter(new FilterSpec(Arrays.asList(idName), F... | java | @Override
public T findOne(I id, QuerySpec querySpec) {
RegistryEntry entry = resourceRegistry.findEntry(resourceClass);
String idName = entry.getResourceInformation().getIdField().getUnderlyingName();
QuerySpec idQuerySpec = querySpec.duplicate();
idQuerySpec.addFilter(new FilterSpec(Arrays.asList(idName), F... | [
"@",
"Override",
"public",
"T",
"findOne",
"(",
"I",
"id",
",",
"QuerySpec",
"querySpec",
")",
"{",
"RegistryEntry",
"entry",
"=",
"resourceRegistry",
".",
"findEntry",
"(",
"resourceClass",
")",
";",
"String",
"idName",
"=",
"entry",
".",
"getResourceInformat... | Forwards to {@link #findAll(QuerySpec)}
@param id
of the resource
@param querySpec
for field and relation inclusion
@return resource | [
"Forwards",
"to",
"{",
"@link",
"#findAll",
"(",
"QuerySpec",
")",
"}"
] | train | https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-core/src/main/java/io/katharsis/repository/ResourceRepositoryBase.java#L56-L72 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionComputer.java | MapTileCollisionComputer.getCollisionY | private static Double getCollisionY(CollisionCategory category, TileCollision tileCollision, double x, double y)
{
if (Axis.Y == category.getAxis())
{
return tileCollision.getCollisionY(category, x, y);
}
return null;
} | java | private static Double getCollisionY(CollisionCategory category, TileCollision tileCollision, double x, double y)
{
if (Axis.Y == category.getAxis())
{
return tileCollision.getCollisionY(category, x, y);
}
return null;
} | [
"private",
"static",
"Double",
"getCollisionY",
"(",
"CollisionCategory",
"category",
",",
"TileCollision",
"tileCollision",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"Axis",
".",
"Y",
"==",
"category",
".",
"getAxis",
"(",
")",
")",
"{"... | Get the vertical collision from current location.
@param category The collision category.
@param tileCollision The current tile collision.
@param x The current horizontal location.
@param y The current vertical location.
@return The computed vertical collision. | [
"Get",
"the",
"vertical",
"collision",
"from",
"current",
"location",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionComputer.java#L78-L85 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/WebSiteRequest.java | WebSiteRequest.getURL | public String getURL(String classAndParams) throws IOException, SQLException {
String className, params;
int pos=classAndParams.indexOf('?');
if(pos==-1) {
className=classAndParams;
params=null;
} else {
className=classAndParams.substring(0, pos);
params=classAndParams.substring(pos+1);
}
return... | java | public String getURL(String classAndParams) throws IOException, SQLException {
String className, params;
int pos=classAndParams.indexOf('?');
if(pos==-1) {
className=classAndParams;
params=null;
} else {
className=classAndParams.substring(0, pos);
params=classAndParams.substring(pos+1);
}
return... | [
"public",
"String",
"getURL",
"(",
"String",
"classAndParams",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"String",
"className",
",",
"params",
";",
"int",
"pos",
"=",
"classAndParams",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"pos"... | Gets a relative URL from a String containing a classname and optional parameters.
Parameters should already be URL encoded but not XML encoded. | [
"Gets",
"a",
"relative",
"URL",
"from",
"a",
"String",
"containing",
"a",
"classname",
"and",
"optional",
"parameters",
".",
"Parameters",
"should",
"already",
"be",
"URL",
"encoded",
"but",
"not",
"XML",
"encoded",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L351-L362 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java | ExampleFeatureSurf.easy | public static void easy( GrayF32 image ) {
// create the detector and descriptors
DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe.
surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class);
// specify the image to process
surf.detect(image);
System.out.p... | java | public static void easy( GrayF32 image ) {
// create the detector and descriptors
DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe.
surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class);
// specify the image to process
surf.detect(image);
System.out.p... | [
"public",
"static",
"void",
"easy",
"(",
"GrayF32",
"image",
")",
"{",
"// create the detector and descriptors",
"DetectDescribePoint",
"<",
"GrayF32",
",",
"BrightFeature",
">",
"surf",
"=",
"FactoryDetectDescribe",
".",
"surfStable",
"(",
"new",
"ConfigFastHessian",
... | Use generalized interfaces for working with SURF. This removes much of the drudgery, but also reduces flexibility
and slightly increases memory and computational requirements.
@param image Input image type. DOES NOT NEED TO BE GrayF32, GrayU8 works too | [
"Use",
"generalized",
"interfaces",
"for",
"working",
"with",
"SURF",
".",
"This",
"removes",
"much",
"of",
"the",
"drudgery",
"but",
"also",
"reduces",
"flexibility",
"and",
"slightly",
"increases",
"memory",
"and",
"computational",
"requirements",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L59-L69 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryServers.java | DirectoryServers.validateServer | private boolean validateServer(String host, int port){
if(host==null || host.isEmpty()){
return false;
}
if(port <=0 || port > 65535){
return false;
}
return true;
} | java | private boolean validateServer(String host, int port){
if(host==null || host.isEmpty()){
return false;
}
if(port <=0 || port > 65535){
return false;
}
return true;
} | [
"private",
"boolean",
"validateServer",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"if",
"(",
"host",
"==",
"null",
"||",
"host",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"port",
"<=",
"0",
"||",
"port",... | Validate the host and port.
@param host
the host string.
@param port
the port number.
@return
true for success. | [
"Validate",
"the",
"host",
"and",
"port",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryServers.java#L147-L155 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.startNewPipeline | public static String startNewPipeline(
JobSetting[] settings, Job<?> jobInstance, Object... params) {
UpdateSpec updateSpec = new UpdateSpec(null);
Job<?> rootJobInstance = jobInstance;
// If rootJobInstance has exceptionHandler it has to be wrapped to ensure that root job
// ends up in finalized ... | java | public static String startNewPipeline(
JobSetting[] settings, Job<?> jobInstance, Object... params) {
UpdateSpec updateSpec = new UpdateSpec(null);
Job<?> rootJobInstance = jobInstance;
// If rootJobInstance has exceptionHandler it has to be wrapped to ensure that root job
// ends up in finalized ... | [
"public",
"static",
"String",
"startNewPipeline",
"(",
"JobSetting",
"[",
"]",
"settings",
",",
"Job",
"<",
"?",
">",
"jobInstance",
",",
"Object",
"...",
"params",
")",
"{",
"UpdateSpec",
"updateSpec",
"=",
"new",
"UpdateSpec",
"(",
"null",
")",
";",
"Job... | Creates and launches a new Pipeline
<p>
Creates the root Job with its associated Barriers and Slots and saves them
to the data store. All slots in the root job are immediately filled with
the values of the parameters to this method, and
{@link HandleSlotFilledTask HandleSlotFilledTasks} are enqueued for each of
the fil... | [
"Creates",
"and",
"launches",
"a",
"new",
"Pipeline",
"<p",
">",
"Creates",
"the",
"root",
"Job",
"with",
"its",
"associated",
"Barriers",
"and",
"Slots",
"and",
"saves",
"them",
"to",
"the",
"data",
"store",
".",
"All",
"slots",
"in",
"the",
"root",
"jo... | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L93-L113 |
infinispan/infinispan | counter/src/main/java/org/infinispan/counter/configuration/CounterConfigurationSerializer.java | CounterConfigurationSerializer.serializeConfigurations | public void serializeConfigurations(OutputStream os, List<AbstractCounterConfiguration> configs)
throws XMLStreamException {
BufferedOutputStream output = new BufferedOutputStream(os);
XMLStreamWriter subWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(output);
XMLExtendedStreamW... | java | public void serializeConfigurations(OutputStream os, List<AbstractCounterConfiguration> configs)
throws XMLStreamException {
BufferedOutputStream output = new BufferedOutputStream(os);
XMLStreamWriter subWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(output);
XMLExtendedStreamW... | [
"public",
"void",
"serializeConfigurations",
"(",
"OutputStream",
"os",
",",
"List",
"<",
"AbstractCounterConfiguration",
">",
"configs",
")",
"throws",
"XMLStreamException",
"{",
"BufferedOutputStream",
"output",
"=",
"new",
"BufferedOutputStream",
"(",
"os",
")",
";... | It serializes a {@link List} of {@link AbstractCounterConfiguration} to an {@link OutputStream}.
@param os the {@link OutputStream} to write to.
@param configs the {@link List} if {@link AbstractCounterConfiguration}.
@throws XMLStreamException if xml is malformed | [
"It",
"serializes",
"a",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/configuration/CounterConfigurationSerializer.java#L38-L49 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java | PGPMessageSigner.verifyMessage | @Override
public boolean verifyMessage(InputStream publicKeyOfSender, InputStream message, InputStream signatureStream) {
LOGGER.trace("verifyMessage(InputStream, InputStream, InputStream)");
LOGGER.trace("Public Key: {}, Data: {}, Signature: {}",
publicKeyOfSender == null ? "not set" : "set", message... | java | @Override
public boolean verifyMessage(InputStream publicKeyOfSender, InputStream message, InputStream signatureStream) {
LOGGER.trace("verifyMessage(InputStream, InputStream, InputStream)");
LOGGER.trace("Public Key: {}, Data: {}, Signature: {}",
publicKeyOfSender == null ? "not set" : "set", message... | [
"@",
"Override",
"public",
"boolean",
"verifyMessage",
"(",
"InputStream",
"publicKeyOfSender",
",",
"InputStream",
"message",
",",
"InputStream",
"signatureStream",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"verifyMessage(InputStream, InputStream, InputStream)\"",
")",
";... | @see MessageSigner#verifyMessage(InputStream, InputStream, InputStream)
@param publicKeyOfSender
the public key of the sender of the message
@param message
the message / data to verify
@param signatureStream
the (detached) signature
@return | [
"@see",
"MessageSigner#verifyMessage",
"(",
"InputStream",
"InputStream",
"InputStream",
")"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java#L41-L89 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/TextModerationsImpl.java | TextModerationsImpl.screenTextWithServiceResponseAsync | public Observable<ServiceResponse<Screen>> screenTextWithServiceResponseAsync(String textContentType, byte[] textContent, ScreenTextOptionalParameter screenTextOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required an... | java | public Observable<ServiceResponse<Screen>> screenTextWithServiceResponseAsync(String textContentType, byte[] textContent, ScreenTextOptionalParameter screenTextOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required an... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Screen",
">",
">",
"screenTextWithServiceResponseAsync",
"(",
"String",
"textContentType",
",",
"byte",
"[",
"]",
"textContent",
",",
"ScreenTextOptionalParameter",
"screenTextOptionalParameter",
")",
"{",
"if",
"(",... | Detect profanity and match against custom and shared blacklists.
Detects profanity in more than 100 languages and match against custom and shared blacklists.
@param textContentType The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'
@param textContent Content to screen.
@p... | [
"Detect",
"profanity",
"and",
"match",
"against",
"custom",
"and",
"shared",
"blacklists",
".",
"Detects",
"profanity",
"in",
"more",
"than",
"100",
"languages",
"and",
"match",
"against",
"custom",
"and",
"shared",
"blacklists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/TextModerationsImpl.java#L132-L149 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java | SkbShellFactory.newShell | public static SkbShell newShell(String id, MessageRenderer renderer, boolean useConsole){
return new AbstractShell(id, renderer, useConsole);
} | java | public static SkbShell newShell(String id, MessageRenderer renderer, boolean useConsole){
return new AbstractShell(id, renderer, useConsole);
} | [
"public",
"static",
"SkbShell",
"newShell",
"(",
"String",
"id",
",",
"MessageRenderer",
"renderer",
",",
"boolean",
"useConsole",
")",
"{",
"return",
"new",
"AbstractShell",
"(",
"id",
",",
"renderer",
",",
"useConsole",
")",
";",
"}"
] | Returns a new shell with given identifier and console flag.
@param id new shell with identifier
@param renderer a renderer for help messages
@param useConsole flag to use (true) or not to use (false) console, of false then no output will happen
@return new shell | [
"Returns",
"a",
"new",
"shell",
"with",
"given",
"identifier",
"and",
"console",
"flag",
"."
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L96-L98 |
epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.processSubheaderPointers | private SubheaderPointer processSubheaderPointers(long subheaderPointerOffset, int subheaderPointerIndex)
throws IOException {
int intOrLongLength = sasFileProperties.isU64() ? BYTES_IN_LONG : BYTES_IN_INT;
int subheaderPointerLength = sasFileProperties.isU64() ? SUBHEADER_POINTER_LENGTH_X64... | java | private SubheaderPointer processSubheaderPointers(long subheaderPointerOffset, int subheaderPointerIndex)
throws IOException {
int intOrLongLength = sasFileProperties.isU64() ? BYTES_IN_LONG : BYTES_IN_INT;
int subheaderPointerLength = sasFileProperties.isU64() ? SUBHEADER_POINTER_LENGTH_X64... | [
"private",
"SubheaderPointer",
"processSubheaderPointers",
"(",
"long",
"subheaderPointerOffset",
",",
"int",
"subheaderPointerIndex",
")",
"throws",
"IOException",
"{",
"int",
"intOrLongLength",
"=",
"sasFileProperties",
".",
"isU64",
"(",
")",
"?",
"BYTES_IN_LONG",
":... | The function to read the pointer with the subheaderPointerIndex index from the list of {@link SubheaderPointer}
located at the subheaderPointerOffset offset.
@param subheaderPointerOffset the offset before the list of {@link SubheaderPointer}.
@param subheaderPointerIndex the index of the subheader pointer being read... | [
"The",
"function",
"to",
"read",
"the",
"pointer",
"with",
"the",
"subheaderPointerIndex",
"index",
"from",
"the",
"list",
"of",
"{",
"@link",
"SubheaderPointer",
"}",
"located",
"at",
"the",
"subheaderPointerOffset",
"offset",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L457-L474 |
jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java | HOTSAXImplementation.hashToFreqEntries | @Deprecated
private static ArrayList<FrequencyTableEntry> hashToFreqEntries(
HashMap<String, ArrayList<Integer>> hash) {
ArrayList<FrequencyTableEntry> res = new ArrayList<FrequencyTableEntry>();
for (Entry<String, ArrayList<Integer>> e : hash.entrySet()) {
char[] payload = e.getKey().toCharArray(... | java | @Deprecated
private static ArrayList<FrequencyTableEntry> hashToFreqEntries(
HashMap<String, ArrayList<Integer>> hash) {
ArrayList<FrequencyTableEntry> res = new ArrayList<FrequencyTableEntry>();
for (Entry<String, ArrayList<Integer>> e : hash.entrySet()) {
char[] payload = e.getKey().toCharArray(... | [
"@",
"Deprecated",
"private",
"static",
"ArrayList",
"<",
"FrequencyTableEntry",
">",
"hashToFreqEntries",
"(",
"HashMap",
"<",
"String",
",",
"ArrayList",
"<",
"Integer",
">",
">",
"hash",
")",
"{",
"ArrayList",
"<",
"FrequencyTableEntry",
">",
"res",
"=",
"n... | Translates the hash table into sortable array of substrings.
@param hash
@return | [
"Translates",
"the",
"hash",
"table",
"into",
"sortable",
"array",
"of",
"substrings",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java#L651-L663 |
streamsets/datacollector-api | src/main/java/com/streamsets/pipeline/api/impl/Utils.java | Utils.checkNotNull | public static <T> T checkNotNull(@Nullable T value, Object varName) {
if (value == null) {
throw new NullPointerException(format("{} cannot be null", varName));
}
return value;
} | java | public static <T> T checkNotNull(@Nullable T value, Object varName) {
if (value == null) {
throw new NullPointerException(format("{} cannot be null", varName));
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkNotNull",
"(",
"@",
"Nullable",
"T",
"value",
",",
"Object",
"varName",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"format",
"(",
"\"{} cannot be null\"",... | Ensures that an object reference passed as a parameter to the calling method is not null.
@param value an object reference
@param varName the variable name to use in an exception message if the check fails
@return the non-null reference that was validated
@throws NullPointerException if {@code value} is null | [
"Ensures",
"that",
"an",
"object",
"reference",
"passed",
"as",
"a",
"parameter",
"to",
"the",
"calling",
"method",
"is",
"not",
"null",
"."
] | train | https://github.com/streamsets/datacollector-api/blob/ac832a97bea2fcef11f50fac6746e85019adad58/src/main/java/com/streamsets/pipeline/api/impl/Utils.java#L55-L60 |
jkyamog/DeDS | sample_clients/java/src/main/java/nz/net/catalyst/mobile/dds/sample/DDSClient.java | DDSClient.jsonDecode | private static <T> T jsonDecode(String responseContent, TypeReference<T> valueTypeRef) throws IOException {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.<T>readValue(responseContent, valueTypeRef);
} catch (JsonGenerationException e) {
logger.severe("unable d... | java | private static <T> T jsonDecode(String responseContent, TypeReference<T> valueTypeRef) throws IOException {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.<T>readValue(responseContent, valueTypeRef);
} catch (JsonGenerationException e) {
logger.severe("unable d... | [
"private",
"static",
"<",
"T",
">",
"T",
"jsonDecode",
"(",
"String",
"responseContent",
",",
"TypeReference",
"<",
"T",
">",
"valueTypeRef",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"try",
"{",
... | Given a string and a type ref. Decode the string and return the values.
@param <T>
@param responseContent
@param valueTypeRef
@return
@throws IOException | [
"Given",
"a",
"string",
"and",
"a",
"type",
"ref",
".",
"Decode",
"the",
"string",
"and",
"return",
"the",
"values",
"."
] | train | https://github.com/jkyamog/DeDS/blob/d8cf6a294a23daa8e8a92073827c73b1befe3fa1/sample_clients/java/src/main/java/nz/net/catalyst/mobile/dds/sample/DDSClient.java#L103-L116 |
yuvipanda/java-http-fluent | src/main/java/in/yuvi/http/fluent/Http.java | Http.asString | public static String asString(final HttpResponse response, final String encoding) {
if (response == null) {
throw new NullPointerException();
}
final HttpEntity entity = response.getEntity();
if (entity == null) {
return null;
}
try {
... | java | public static String asString(final HttpResponse response, final String encoding) {
if (response == null) {
throw new NullPointerException();
}
final HttpEntity entity = response.getEntity();
if (entity == null) {
return null;
}
try {
... | [
"public",
"static",
"String",
"asString",
"(",
"final",
"HttpResponse",
"response",
",",
"final",
"String",
"encoding",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"final",
"HttpEntity"... | Converts a {@linkplain HttpResponse} to a String by calling {@link EntityUtils#toString(HttpEntity)} on its {@linkplain HttpEntity
entity}.
@param response
the {@linkplain HttpResponse response} to convert.
@param encoding
the encoding to use for the conversion.
@throws NullPointerException
if the given response was n... | [
"Converts",
"a",
"{",
"@linkplain",
"HttpResponse",
"}",
"to",
"a",
"String",
"by",
"calling",
"{",
"@link",
"EntityUtils#toString",
"(",
"HttpEntity",
")",
"}",
"on",
"its",
"{",
"@linkplain",
"HttpEntity",
"entity",
"}",
"."
] | train | https://github.com/yuvipanda/java-http-fluent/blob/e1da03aa23671cc099f30b9d7afbe2fad829f250/src/main/java/in/yuvi/http/fluent/Http.java#L187-L202 |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java | Credential.executeRefreshToken | protected TokenResponse executeRefreshToken() throws IOException {
if (refreshToken == null) {
return null;
}
return new RefreshTokenRequest(transport, jsonFactory, new GenericUrl(tokenServerEncodedUrl),
refreshToken).setClientAuthentication(clientAuthentication)
.setRequestInitializer... | java | protected TokenResponse executeRefreshToken() throws IOException {
if (refreshToken == null) {
return null;
}
return new RefreshTokenRequest(transport, jsonFactory, new GenericUrl(tokenServerEncodedUrl),
refreshToken).setClientAuthentication(clientAuthentication)
.setRequestInitializer... | [
"protected",
"TokenResponse",
"executeRefreshToken",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"refreshToken",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"RefreshTokenRequest",
"(",
"transport",
",",
"jsonFactory",
",",
"new",
... | Executes a request for new credentials from the token server.
<p>
The default implementation calls {@link RefreshTokenRequest#execute()} using the
{@link #getTransport()}, {@link #getJsonFactory()}, {@link #getRequestInitializer()},
{@link #getTokenServerEncodedUrl()}, {@link #getRefreshToken()}, and the
{@link #getCl... | [
"Executes",
"a",
"request",
"for",
"new",
"credentials",
"from",
"the",
"token",
"server",
"."
] | train | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java#L571-L578 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java | Utils.findMethod | public ExecutableElement findMethod(TypeElement te, ExecutableElement method) {
for (Element m : getMethods(te)) {
if (executableMembersEqual(method, (ExecutableElement)m)) {
return (ExecutableElement)m;
}
}
return null;
} | java | public ExecutableElement findMethod(TypeElement te, ExecutableElement method) {
for (Element m : getMethods(te)) {
if (executableMembersEqual(method, (ExecutableElement)m)) {
return (ExecutableElement)m;
}
}
return null;
} | [
"public",
"ExecutableElement",
"findMethod",
"(",
"TypeElement",
"te",
",",
"ExecutableElement",
"method",
")",
"{",
"for",
"(",
"Element",
"m",
":",
"getMethods",
"(",
"te",
")",
")",
"{",
"if",
"(",
"executableMembersEqual",
"(",
"method",
",",
"(",
"Execu... | Search for the given method in the given class.
@param te Class to search into.
@param method Method to be searched.
@return ExecutableElement Method found, null otherwise. | [
"Search",
"for",
"the",
"given",
"method",
"in",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java#L200-L207 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileLexer.java | WhileyFileLexer.scanCharacterLiteral | public Token scanCharacterLiteral() {
int start = pos;
pos++;
char c = input.charAt(pos++);
if (c == '\\') {
// escape code
switch (input.charAt(pos++)) {
case 'b':
c = '\b';
break;
case 't':
c = '\t';
break;
case 'n':
c = '\n';
break;
case 'f':
c = '\f';
break;... | java | public Token scanCharacterLiteral() {
int start = pos;
pos++;
char c = input.charAt(pos++);
if (c == '\\') {
// escape code
switch (input.charAt(pos++)) {
case 'b':
c = '\b';
break;
case 't':
c = '\t';
break;
case 'n':
c = '\n';
break;
case 'f':
c = '\f';
break;... | [
"public",
"Token",
"scanCharacterLiteral",
"(",
")",
"{",
"int",
"start",
"=",
"pos",
";",
"pos",
"++",
";",
"char",
"c",
"=",
"input",
".",
"charAt",
"(",
"pos",
"++",
")",
";",
"if",
"(",
"c",
"==",
"'",
"'",
")",
"{",
"// escape code",
"switch",... | Scan a character literal, such as e.g. 'c'. Observe that care must be
taken to properly handle escape codes. For example, '\n' is a single
character constant which is made up from two characters in the input
string.
@return | [
"Scan",
"a",
"character",
"literal",
"such",
"as",
"e",
".",
"g",
".",
"c",
".",
"Observe",
"that",
"care",
"must",
"be",
"taken",
"to",
"properly",
"handle",
"escape",
"codes",
".",
"For",
"example",
"\\",
"n",
"is",
"a",
"single",
"character",
"const... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileLexer.java#L160-L201 |
motown-io/motown | chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java | DomainService.getConnector | public Connector getConnector(Long chargingStationTypeId, Long evseId, Long id) {
ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId);
Evse evse = getEvseById(chargingStationType, evseId);
return getConnectorById(evse, id);
} | java | public Connector getConnector(Long chargingStationTypeId, Long evseId, Long id) {
ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId);
Evse evse = getEvseById(chargingStationType, evseId);
return getConnectorById(evse, id);
} | [
"public",
"Connector",
"getConnector",
"(",
"Long",
"chargingStationTypeId",
",",
"Long",
"evseId",
",",
"Long",
"id",
")",
"{",
"ChargingStationType",
"chargingStationType",
"=",
"chargingStationTypeRepository",
".",
"findOne",
"(",
"chargingStationTypeId",
")",
";",
... | Find a connector based on its id.
@param id the id of the entity to find.
@return the connector. | [
"Find",
"a",
"connector",
"based",
"on",
"its",
"id",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java#L244-L249 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/application5/ApplicationDescriptorImpl.java | ApplicationDescriptorImpl.addNamespace | public ApplicationDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | java | public ApplicationDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"ApplicationDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>ApplicationDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/application5/ApplicationDescriptorImpl.java#L87-L91 |
apache/groovy | src/main/groovy/groovy/lang/ProxyMetaClass.java | ProxyMetaClass.invokeMethod | public Object invokeMethod(final Object object, final String methodName, final Object[] arguments) {
return doCall(object, methodName, arguments, interceptor, new Callable() {
public Object call() {
return adaptee.invokeMethod(object, methodName, arguments);
}
});... | java | public Object invokeMethod(final Object object, final String methodName, final Object[] arguments) {
return doCall(object, methodName, arguments, interceptor, new Callable() {
public Object call() {
return adaptee.invokeMethod(object, methodName, arguments);
}
});... | [
"public",
"Object",
"invokeMethod",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"methodName",
",",
"final",
"Object",
"[",
"]",
"arguments",
")",
"{",
"return",
"doCall",
"(",
"object",
",",
"methodName",
",",
"arguments",
",",
"interceptor",
"... | Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
With Interceptor the call is nested in its beforeInvoke and afterInvoke methods.
The method call is suppressed if Interceptor.doInvoke() returns false.
See Interceptor for details. | [
"Call",
"invokeMethod",
"on",
"adaptee",
"with",
"logic",
"like",
"in",
"MetaClass",
"unless",
"we",
"have",
"an",
"Interceptor",
".",
"With",
"Interceptor",
"the",
"call",
"is",
"nested",
"in",
"its",
"beforeInvoke",
"and",
"afterInvoke",
"methods",
".",
"The... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ProxyMetaClass.java#L117-L123 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/EntityMetadata.java | EntityMetadata.addRelation | public void addRelation(String property, Relation relation)
{
relationsMap.put(property, relation);
addRelationName(relation);
} | java | public void addRelation(String property, Relation relation)
{
relationsMap.put(property, relation);
addRelationName(relation);
} | [
"public",
"void",
"addRelation",
"(",
"String",
"property",
",",
"Relation",
"relation",
")",
"{",
"relationsMap",
".",
"put",
"(",
"property",
",",
"relation",
")",
";",
"addRelationName",
"(",
"relation",
")",
";",
"}"
] | Adds the relation.
@param property
the property
@param relation
the relation | [
"Adds",
"the",
"relation",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/EntityMetadata.java#L361-L365 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.handleErrorResponse | public static void handleErrorResponse(String msg, String responseText) {
String responseHtml;
Environment instance = getInstance();
try {
responseHtml = instance.getHtmlForXml(responseText);
} catch (Exception e) {
responseHtml = instance.getHtml(value -> value, ... | java | public static void handleErrorResponse(String msg, String responseText) {
String responseHtml;
Environment instance = getInstance();
try {
responseHtml = instance.getHtmlForXml(responseText);
} catch (Exception e) {
responseHtml = instance.getHtml(value -> value, ... | [
"public",
"static",
"void",
"handleErrorResponse",
"(",
"String",
"msg",
",",
"String",
"responseText",
")",
"{",
"String",
"responseHtml",
";",
"Environment",
"instance",
"=",
"getInstance",
"(",
")",
";",
"try",
"{",
"responseHtml",
"=",
"instance",
".",
"ge... | Creates exception that will display nicely in a columnFixture.
@param msg message for exception
@param responseText XML received, which will be shown in wiki table.
@throws FitFailureException always | [
"Creates",
"exception",
"that",
"will",
"display",
"nicely",
"in",
"a",
"columnFixture",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L545-L555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.