repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/config/AbstractConfigurablePlugin.java | AbstractConfigurablePlugin.parseArgument | @Override
public int parseArgument(Options opts, String[] args, int i) throws BadCommandLineException {
"""
Parse and apply plugin configuration options.
@return number of consumed argument options
"""
initLoggerIfNecessary(opts);
int recognized = 0;
String arg = args[i];
logger.trace("Arg... | java | @Override
public int parseArgument(Options opts, String[] args, int i) throws BadCommandLineException {
initLoggerIfNecessary(opts);
int recognized = 0;
String arg = args[i];
logger.trace("Argument[" + i + "] = " + arg);
if (arg.equals(getArgumentName(ConfigurationOption.APPLY_PLURAL_FORM.optionN... | [
"@",
"Override",
"public",
"int",
"parseArgument",
"(",
"Options",
"opts",
",",
"String",
"[",
"]",
"args",
",",
"int",
"i",
")",
"throws",
"BadCommandLineException",
"{",
"initLoggerIfNecessary",
"(",
"opts",
")",
";",
"int",
"recognized",
"=",
"0",
";",
... | Parse and apply plugin configuration options.
@return number of consumed argument options | [
"Parse",
"and",
"apply",
"plugin",
"configuration",
"options",
"."
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/config/AbstractConfigurablePlugin.java#L150-L174 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/util/ManagementUtil.java | ManagementUtil.awaitGraphIndexUpdate | public static void awaitGraphIndexUpdate(TitanGraph g, String indexName, long time, TemporalUnit unit) {
"""
This method blocks and waits until the provided index has been updated across the entire Titan cluster
and reached a stable state.
This method will wait for the given period of time and throw an exception... | java | public static void awaitGraphIndexUpdate(TitanGraph g, String indexName, long time, TemporalUnit unit) {
awaitIndexUpdate(g,indexName,null,time,unit);
} | [
"public",
"static",
"void",
"awaitGraphIndexUpdate",
"(",
"TitanGraph",
"g",
",",
"String",
"indexName",
",",
"long",
"time",
",",
"TemporalUnit",
"unit",
")",
"{",
"awaitIndexUpdate",
"(",
"g",
",",
"indexName",
",",
"null",
",",
"time",
",",
"unit",
")",
... | This method blocks and waits until the provided index has been updated across the entire Titan cluster
and reached a stable state.
This method will wait for the given period of time and throw an exception if the index did not reach a
final state within that time. The method simply returns when the index has reached the... | [
"This",
"method",
"blocks",
"and",
"waits",
"until",
"the",
"provided",
"index",
"has",
"been",
"updated",
"across",
"the",
"entire",
"Titan",
"cluster",
"and",
"reached",
"a",
"stable",
"state",
".",
"This",
"method",
"will",
"wait",
"for",
"the",
"given",
... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/util/ManagementUtil.java#L42-L44 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsUserTable.java | CmsUserTable.getStatusHelp | String getStatusHelp(CmsUser user, boolean disabled, boolean newUser) {
"""
Returns status help message.
@param user CmsUser
@param disabled boolean
@param newUser boolean
@return String
"""
if (disabled) {
return CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_DISABLE... | java | String getStatusHelp(CmsUser user, boolean disabled, boolean newUser) {
if (disabled) {
return CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_DISABLED_HELP_0);
}
if (newUser) {
return CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_INACTIVE... | [
"String",
"getStatusHelp",
"(",
"CmsUser",
"user",
",",
"boolean",
"disabled",
",",
"boolean",
"newUser",
")",
"{",
"if",
"(",
"disabled",
")",
"{",
"return",
"CmsVaadinUtils",
".",
"getMessageText",
"(",
"Messages",
".",
"GUI_USERMANAGEMENT_USER_DISABLED_HELP_0",
... | Returns status help message.
@param user CmsUser
@param disabled boolean
@param newUser boolean
@return String | [
"Returns",
"status",
"help",
"message",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsUserTable.java#L1376-L1391 |
lucee/Lucee | core/src/main/java/lucee/runtime/functions/decision/IsValid.java | IsValid.call | public static boolean call(PageContext pc, String type, Object value, Object objPattern) throws PageException {
"""
regex check
@param pc
@param type
@param value
@param objPattern
@return
@throws PageException
"""
type = type.trim();
if (!"regex".equalsIgnoreCase(type) && !"regular_expression".equa... | java | public static boolean call(PageContext pc, String type, Object value, Object objPattern) throws PageException {
type = type.trim();
if (!"regex".equalsIgnoreCase(type) && !"regular_expression".equalsIgnoreCase(type))
throw new FunctionException(pc, "isValid", 1, "type", "wrong attribute count for type [" + type... | [
"public",
"static",
"boolean",
"call",
"(",
"PageContext",
"pc",
",",
"String",
"type",
",",
"Object",
"value",
",",
"Object",
"objPattern",
")",
"throws",
"PageException",
"{",
"type",
"=",
"type",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"\"regex\""... | regex check
@param pc
@param type
@param value
@param objPattern
@return
@throws PageException | [
"regex",
"check"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/decision/IsValid.java#L67-L74 |
gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.validateDeclaredReturns | protected void validateDeclaredReturns() {
"""
Validates the declared Returns of the controller method. If the controller method returns an object then
it must also declare a successful @Return with a status code in the 200 range.
"""
boolean returnsObject = void.class != method.getReturnType();
... | java | protected void validateDeclaredReturns() {
boolean returnsObject = void.class != method.getReturnType();
if (returnsObject) {
for (Return declaredReturn : declaredReturns) {
if (declaredReturn.code() >= 200 && declaredReturn.code() < 300) {
return;
... | [
"protected",
"void",
"validateDeclaredReturns",
"(",
")",
"{",
"boolean",
"returnsObject",
"=",
"void",
".",
"class",
"!=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"returnsObject",
")",
"{",
"for",
"(",
"Return",
"declaredReturn",
":",
"dec... | Validates the declared Returns of the controller method. If the controller method returns an object then
it must also declare a successful @Return with a status code in the 200 range. | [
"Validates",
"the",
"declared",
"Returns",
"of",
"the",
"controller",
"method",
".",
"If",
"the",
"controller",
"method",
"returns",
"an",
"object",
"then",
"it",
"must",
"also",
"declare",
"a",
"successful"
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L512-L523 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/animation/NavigationAnimationFactory.java | NavigationAnimationFactory.createZoomIn | public static NavigationAnimation createZoomIn(MapPresenter mapPresenter, View endView) {
"""
Create a new zoom in {@link NavigationAnimation} that zooms in to the provided end view.
@param mapPresenter The map onto which you want the zoom in animation to run.
@param endView The final view to arrive at wh... | java | public static NavigationAnimation createZoomIn(MapPresenter mapPresenter, View endView) {
return new NavigationAnimationImpl(mapPresenter.getViewPort(), mapPresenter.getEventBus(),
new LinearTrajectory(mapPresenter.getViewPort().getView(), endView), getMillis(mapPresenter));
} | [
"public",
"static",
"NavigationAnimation",
"createZoomIn",
"(",
"MapPresenter",
"mapPresenter",
",",
"View",
"endView",
")",
"{",
"return",
"new",
"NavigationAnimationImpl",
"(",
"mapPresenter",
".",
"getViewPort",
"(",
")",
",",
"mapPresenter",
".",
"getEventBus",
... | Create a new zoom in {@link NavigationAnimation} that zooms in to the provided end view.
@param mapPresenter The map onto which you want the zoom in animation to run.
@param endView The final view to arrive at when the animation finishes.
@return The animation. Just call "run" to have it animate the map. | [
"Create",
"a",
"new",
"zoom",
"in",
"{",
"@link",
"NavigationAnimation",
"}",
"that",
"zooms",
"in",
"to",
"the",
"provided",
"end",
"view",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/animation/NavigationAnimationFactory.java#L69-L72 |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractSignalEventDefinitionBuilder.java | AbstractSignalEventDefinitionBuilder.camundaInAllVariables | public B camundaInAllVariables(String variables, boolean local) {
"""
Sets a "camunda:in" parameter to pass all the process variables of the
signal-throwing process instance to the signal-catching process instance
@param variables a String flag to declare that all of the signal-throwing process-instance variab... | java | public B camundaInAllVariables(String variables, boolean local) {
CamundaIn param = modelInstance.newInstance(CamundaIn.class);
param.setCamundaVariables(variables);
if (local) {
param.setCamundaLocal(local);
}
addExtensionElement(param);
return myself;
} | [
"public",
"B",
"camundaInAllVariables",
"(",
"String",
"variables",
",",
"boolean",
"local",
")",
"{",
"CamundaIn",
"param",
"=",
"modelInstance",
".",
"newInstance",
"(",
"CamundaIn",
".",
"class",
")",
";",
"param",
".",
"setCamundaVariables",
"(",
"variables"... | Sets a "camunda:in" parameter to pass all the process variables of the
signal-throwing process instance to the signal-catching process instance
@param variables a String flag to declare that all of the signal-throwing process-instance variables should be passed
@param local a Boolean flag to declare that only the loca... | [
"Sets",
"a",
"camunda",
":",
"in",
"parameter",
"to",
"pass",
"all",
"the",
"process",
"variables",
"of",
"the",
"signal",
"-",
"throwing",
"process",
"instance",
"to",
"the",
"signal",
"-",
"catching",
"process",
"instance"
] | train | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractSignalEventDefinitionBuilder.java#L95-L107 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/ifx/AbstractRectangularShape2ifx.java | AbstractRectangularShape2ifx.minXProperty | @Pure
public IntegerProperty minXProperty() {
"""
Replies the property that is the minimum x coordinate of the box.
@return the minX property.
"""
if (this.minX == null) {
this.minX = new SimpleIntegerProperty(this, MathFXAttributeNames.MINIMUM_X) {
@Override
protected void invalidated() {
... | java | @Pure
public IntegerProperty minXProperty() {
if (this.minX == null) {
this.minX = new SimpleIntegerProperty(this, MathFXAttributeNames.MINIMUM_X) {
@Override
protected void invalidated() {
final int currentMin = get();
final int currentMax = getMaxX();
if (currentMax < currentMin) {
... | [
"@",
"Pure",
"public",
"IntegerProperty",
"minXProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"minX",
"==",
"null",
")",
"{",
"this",
".",
"minX",
"=",
"new",
"SimpleIntegerProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"MINIMUM_X",
")",
"{",... | Replies the property that is the minimum x coordinate of the box.
@return the minX property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"minimum",
"x",
"coordinate",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/ifx/AbstractRectangularShape2ifx.java#L141-L157 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/primitives/DoubleUtils.java | DoubleUtils.argMax | public static int argMax(final double[] x, final int startInclusive, final int endExclusive) {
"""
Returns the index of the first maximal element of the array within the specified bounds. That
is, if there is a unique maximum, its index is returned. If there are multiple values tied for
largest, the index of the... | java | public static int argMax(final double[] x, final int startInclusive, final int endExclusive) {
checkArgument(endExclusive > startInclusive);
checkArgument(startInclusive >= 0);
checkArgument(endExclusive <= x.length);
double maxValue = Double.MIN_VALUE;
int maxIndex = 0;
for (int i = startIncl... | [
"public",
"static",
"int",
"argMax",
"(",
"final",
"double",
"[",
"]",
"x",
",",
"final",
"int",
"startInclusive",
",",
"final",
"int",
"endExclusive",
")",
"{",
"checkArgument",
"(",
"endExclusive",
">",
"startInclusive",
")",
";",
"checkArgument",
"(",
"st... | Returns the index of the first maximal element of the array within the specified bounds. That
is, if there is a unique maximum, its index is returned. If there are multiple values tied for
largest, the index of the first is returned. If the supplied array is empty, an {@link
IllegalArgumentException} is thrown. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"maximal",
"element",
"of",
"the",
"array",
"within",
"the",
"specified",
"bounds",
".",
"That",
"is",
"if",
"there",
"is",
"a",
"unique",
"maximum",
"its",
"index",
"is",
"returned",
".",
"If",
"there",
"... | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/primitives/DoubleUtils.java#L139-L155 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java | Calendar.getPatternData | private static PatternData getPatternData(ULocale locale, String calType) {
"""
Retrieves the DateTime patterns and overrides from the resource bundle and generates a
new PatternData object.
@param locale Locale to retrieve.
@param calType Calendar type to retrieve. If not found will fallback to gregorian.
@re... | java | private static PatternData getPatternData(ULocale locale, String calType) {
ICUResourceBundle rb =
(ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale);
ICUResourceBundle dtPatternsRb = rb.findWithFallback("calendar/" + calType + "/DateTimePatterns");
... | [
"private",
"static",
"PatternData",
"getPatternData",
"(",
"ULocale",
"locale",
",",
"String",
"calType",
")",
"{",
"ICUResourceBundle",
"rb",
"=",
"(",
"ICUResourceBundle",
")",
"UResourceBundle",
".",
"getBundleInstance",
"(",
"ICUData",
".",
"ICU_BASE_NAME",
",",... | Retrieves the DateTime patterns and overrides from the resource bundle and generates a
new PatternData object.
@param locale Locale to retrieve.
@param calType Calendar type to retrieve. If not found will fallback to gregorian.
@return PatternData object for this locale and calendarType. | [
"Retrieves",
"the",
"DateTime",
"patterns",
"and",
"overrides",
"from",
"the",
"resource",
"bundle",
"and",
"generates",
"a",
"new",
"PatternData",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L3574-L3598 |
Stratio/deep-spark | deep-aerospike/src/main/java/com/stratio/deep/aerospike/utils/UtilAerospike.java | UtilAerospike.getAerospikeRecordFromCell | public static Pair<Object, AerospikeRecord> getAerospikeRecordFromCell(Cells cells) throws IllegalAccessException, InstantiationException,
InvocationTargetException {
"""
Converts from and entity class with deep's anotations to AerospikeRecord.
@param cells
@return
@throws IllegalAccessException
... | java | public static Pair<Object, AerospikeRecord> getAerospikeRecordFromCell(Cells cells) throws IllegalAccessException, InstantiationException,
InvocationTargetException {
Map<String, Object> bins = new HashMap<>();
Object key = null;
for (Cell cell : cells.getCells()) {
if(ke... | [
"public",
"static",
"Pair",
"<",
"Object",
",",
"AerospikeRecord",
">",
"getAerospikeRecordFromCell",
"(",
"Cells",
"cells",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"InvocationTargetException",
"{",
"Map",
"<",
"String",
",",
"Obje... | Converts from and entity class with deep's anotations to AerospikeRecord.
@param cells
@return
@throws IllegalAccessException
@throws InstantiationException
@throws InvocationTargetException | [
"Converts",
"from",
"and",
"entity",
"class",
"with",
"deep",
"s",
"anotations",
"to",
"AerospikeRecord",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-aerospike/src/main/java/com/stratio/deep/aerospike/utils/UtilAerospike.java#L242-L264 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.getTransitionableState | public TransitionableState getTransitionableState(final Flow flow, final String stateId) {
"""
Gets transitionable state.
@param flow the flow
@param stateId the state id
@return the transitionable state
"""
if (containsFlowState(flow, stateId)) {
return (TransitionableState) flow.g... | java | public TransitionableState getTransitionableState(final Flow flow, final String stateId) {
if (containsFlowState(flow, stateId)) {
return (TransitionableState) flow.getTransitionableState(stateId);
}
return null;
} | [
"public",
"TransitionableState",
"getTransitionableState",
"(",
"final",
"Flow",
"flow",
",",
"final",
"String",
"stateId",
")",
"{",
"if",
"(",
"containsFlowState",
"(",
"flow",
",",
"stateId",
")",
")",
"{",
"return",
"(",
"TransitionableState",
")",
"flow",
... | Gets transitionable state.
@param flow the flow
@param stateId the state id
@return the transitionable state | [
"Gets",
"transitionable",
"state",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L769-L774 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/crypto/KeyCrypterScrypt.java | KeyCrypterScrypt.deriveKey | @Override
public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException {
"""
Generate AES key.
This is a very slow operation compared to encrypt/ decrypt so it is normally worth caching the result.
@param password The password to use in key generation
@return The KeyPara... | java | @Override
public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException {
byte[] passwordBytes = null;
try {
passwordBytes = convertToByteArray(password);
byte[] salt = new byte[0];
if ( scryptParameters.getSalt() != null) {
salt ... | [
"@",
"Override",
"public",
"KeyParameter",
"deriveKey",
"(",
"CharSequence",
"password",
")",
"throws",
"KeyCrypterException",
"{",
"byte",
"[",
"]",
"passwordBytes",
"=",
"null",
";",
"try",
"{",
"passwordBytes",
"=",
"convertToByteArray",
"(",
"password",
")",
... | Generate AES key.
This is a very slow operation compared to encrypt/ decrypt so it is normally worth caching the result.
@param password The password to use in key generation
@return The KeyParameter containing the created AES key
@throws KeyCrypterException | [
"Generate",
"AES",
"key",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/crypto/KeyCrypterScrypt.java#L145-L172 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_service_serviceName_voiceConsumption_consumptionId_callDiagnostics_GET | public OvhCallDiagnostics billingAccount_service_serviceName_voiceConsumption_consumptionId_callDiagnostics_GET(String billingAccount, String serviceName, Long consumptionId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/service/{serviceName}/voiceConsumption/{consump... | java | public OvhCallDiagnostics billingAccount_service_serviceName_voiceConsumption_consumptionId_callDiagnostics_GET(String billingAccount, String serviceName, Long consumptionId) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/voiceConsumption/{consumptionId}/callDiagnostics";
Str... | [
"public",
"OvhCallDiagnostics",
"billingAccount_service_serviceName_voiceConsumption_consumptionId_callDiagnostics_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"consumptionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/t... | Get this object properties
REST: GET /telephony/{billingAccount}/service/{serviceName}/voiceConsumption/{consumptionId}/callDiagnostics
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param consumptionId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3760-L3765 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java | AbstractServerDetector.getSingleStringAttribute | protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) {
"""
Get a single attribute for a given MBeanName pattern.
@param pMBeanServerExecutor MBeanServer manager to query
@param pMBeanName a MBean name or pattern. If multiple MBeans are found,... | java | protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) {
Set<ObjectName> serverMBeanNames = searchMBeans(pMBeanServerExecutor, pMBeanName);
if (serverMBeanNames.size() == 0) {
return null;
}
Set<String> attrib... | [
"protected",
"String",
"getSingleStringAttribute",
"(",
"MBeanServerExecutor",
"pMBeanServerExecutor",
",",
"String",
"pMBeanName",
",",
"String",
"pAttribute",
")",
"{",
"Set",
"<",
"ObjectName",
">",
"serverMBeanNames",
"=",
"searchMBeans",
"(",
"pMBeanServerExecutor",
... | Get a single attribute for a given MBeanName pattern.
@param pMBeanServerExecutor MBeanServer manager to query
@param pMBeanName a MBean name or pattern. If multiple MBeans are found, each is queried for the attribute
@param pAttribute the attribute to lookup
@return the string value of the attribute or null if either... | [
"Get",
"a",
"single",
"attribute",
"for",
"a",
"given",
"MBeanName",
"pattern",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L123-L139 |
apache/groovy | src/main/groovy/groovy/lang/MetaClassImpl.java | MetaClassImpl.setProperties | public void setProperties(Object bean, Map map) {
"""
Sets a number of bean properties from the given Map where the keys are
the String names of properties and the values are the values of the
properties to set
"""
checkInitalised();
for (Iterator iter = map.entrySet().iterator(); iter.hasNex... | java | public void setProperties(Object bean, Map map) {
checkInitalised();
for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = (Map.Entry) iter.next();
String key = entry.getKey().toString();
Object value = entry.getValue();
set... | [
"public",
"void",
"setProperties",
"(",
"Object",
"bean",
",",
"Map",
"map",
")",
"{",
"checkInitalised",
"(",
")",
";",
"for",
"(",
"Iterator",
"iter",
"=",
"map",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"iter",
".",
"hasNext",
"(... | Sets a number of bean properties from the given Map where the keys are
the String names of properties and the values are the values of the
properties to set | [
"Sets",
"a",
"number",
"of",
"bean",
"properties",
"from",
"the",
"given",
"Map",
"where",
"the",
"keys",
"are",
"the",
"String",
"names",
"of",
"properties",
"and",
"the",
"values",
"are",
"the",
"values",
"of",
"the",
"properties",
"to",
"set"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaClassImpl.java#L1818-L1827 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java | TransportClient.sendRpcSync | public ByteBuffer sendRpcSync(ByteBuffer message, long timeoutMs) {
"""
Synchronously sends an opaque message to the RpcHandler on the server-side, waiting for up to
a specified timeout for a response.
"""
final SettableFuture<ByteBuffer> result = SettableFuture.create();
sendRpc(message, new RpcResp... | java | public ByteBuffer sendRpcSync(ByteBuffer message, long timeoutMs) {
final SettableFuture<ByteBuffer> result = SettableFuture.create();
sendRpc(message, new RpcResponseCallback() {
@Override
public void onSuccess(ByteBuffer response) {
ByteBuffer copy = ByteBuffer.allocate(response.remaining... | [
"public",
"ByteBuffer",
"sendRpcSync",
"(",
"ByteBuffer",
"message",
",",
"long",
"timeoutMs",
")",
"{",
"final",
"SettableFuture",
"<",
"ByteBuffer",
">",
"result",
"=",
"SettableFuture",
".",
"create",
"(",
")",
";",
"sendRpc",
"(",
"message",
",",
"new",
... | Synchronously sends an opaque message to the RpcHandler on the server-side, waiting for up to
a specified timeout for a response. | [
"Synchronously",
"sends",
"an",
"opaque",
"message",
"to",
"the",
"RpcHandler",
"on",
"the",
"server",
"-",
"side",
"waiting",
"for",
"up",
"to",
"a",
"specified",
"timeout",
"for",
"a",
"response",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java#L234-L260 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/ExpFamFactor.java | ExpFamFactor.getDotProd | protected double getDotProd(int config, FgModel model) {
"""
Provide the dot product of the features and model weights for this configuration
(make sure to exp that value if !logDomain).
Note that this method can be overridden for an efficient product of an ExpFamFactor
and a hard factor (that rules out some ... | java | protected double getDotProd(int config, FgModel model) {
FeatureVector fv = getFeatures(config);
return model.dot(fv);
} | [
"protected",
"double",
"getDotProd",
"(",
"int",
"config",
",",
"FgModel",
"model",
")",
"{",
"FeatureVector",
"fv",
"=",
"getFeatures",
"(",
"config",
")",
";",
"return",
"model",
".",
"dot",
"(",
"fv",
")",
";",
"}"
] | Provide the dot product of the features and model weights for this configuration
(make sure to exp that value if !logDomain).
Note that this method can be overridden for an efficient product of an ExpFamFactor
and a hard factor (that rules out some configurations). Just return -infinity
here before extracting features... | [
"Provide",
"the",
"dot",
"product",
"of",
"the",
"features",
"and",
"model",
"weights",
"for",
"this",
"configuration",
"(",
"make",
"sure",
"to",
"exp",
"that",
"value",
"if",
"!logDomain",
")",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/ExpFamFactor.java#L81-L84 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getAllEventDetailedInfo | public EventDetail getAllEventDetailedInfo() throws GuildWars2Exception {
"""
For more info on event detail API go <a href="https://wiki.guildwars2.com/wiki/API:1/event_details">here</a><br/>
@return event details
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see EventDetail event detail
"... | java | public EventDetail getAllEventDetailedInfo() throws GuildWars2Exception {
try {
Response<EventDetail> response = gw2API.getAllEventDetailedInfo(GuildWars2.lang.getValue()).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
} catch (IOExceptio... | [
"public",
"EventDetail",
"getAllEventDetailedInfo",
"(",
")",
"throws",
"GuildWars2Exception",
"{",
"try",
"{",
"Response",
"<",
"EventDetail",
">",
"response",
"=",
"gw2API",
".",
"getAllEventDetailedInfo",
"(",
"GuildWars2",
".",
"lang",
".",
"getValue",
"(",
")... | For more info on event detail API go <a href="https://wiki.guildwars2.com/wiki/API:1/event_details">here</a><br/>
@return event details
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see EventDetail event detail | [
"For",
"more",
"info",
"on",
"event",
"detail",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"1",
"/",
"event_details",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">"
] | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L61-L69 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java | HawkbitCommonUtil.createLazyQueryContainer | public static LazyQueryContainer createLazyQueryContainer(
final BeanQueryFactory<? extends AbstractBeanQuery<?>> queryFactory) {
"""
Create a lazy query container for the given query bean factory with empty
configurations.
@param queryFactory
is reference of {@link BeanQueryFactory<? extends
Abs... | java | public static LazyQueryContainer createLazyQueryContainer(
final BeanQueryFactory<? extends AbstractBeanQuery<?>> queryFactory) {
queryFactory.setQueryConfiguration(Collections.emptyMap());
return new LazyQueryContainer(new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), queryF... | [
"public",
"static",
"LazyQueryContainer",
"createLazyQueryContainer",
"(",
"final",
"BeanQueryFactory",
"<",
"?",
"extends",
"AbstractBeanQuery",
"<",
"?",
">",
">",
"queryFactory",
")",
"{",
"queryFactory",
".",
"setQueryConfiguration",
"(",
"Collections",
".",
"empt... | Create a lazy query container for the given query bean factory with empty
configurations.
@param queryFactory
is reference of {@link BeanQueryFactory<? extends
AbstractBeanQuery>} on which lazy container should create.
@return instance of {@link LazyQueryContainer}. | [
"Create",
"a",
"lazy",
"query",
"container",
"for",
"the",
"given",
"query",
"bean",
"factory",
"with",
"empty",
"configurations",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L331-L335 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/task/TaskBaseMetric.java | TaskBaseMetric.updateTime | public void updateTime(String streamId, String name, long start, long end, int count, boolean mergeTopology) {
"""
almost the same implementation of above update, but improves performance for histograms
"""
if (start > 0 && count > 0) {
AsmMetric existingMetric = findMetric(streamId, name... | java | public void updateTime(String streamId, String name, long start, long end, int count, boolean mergeTopology) {
if (start > 0 && count > 0) {
AsmMetric existingMetric = findMetric(streamId, name, MetricType.HISTOGRAM, mergeTopology);
if (existingMetric instanceof AsmHistogram) {
... | [
"public",
"void",
"updateTime",
"(",
"String",
"streamId",
",",
"String",
"name",
",",
"long",
"start",
",",
"long",
"end",
",",
"int",
"count",
",",
"boolean",
"mergeTopology",
")",
"{",
"if",
"(",
"start",
">",
"0",
"&&",
"count",
">",
"0",
")",
"{... | almost the same implementation of above update, but improves performance for histograms | [
"almost",
"the",
"same",
"implementation",
"of",
"above",
"update",
"but",
"improves",
"performance",
"for",
"histograms"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/task/TaskBaseMetric.java#L87-L102 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java | TmdbMovies.getMovieChanges | public ResultList<ChangeKeyItem> getMovieChanges(int movieId, String startDate, String endDate) throws MovieDbException {
"""
Get the changes for a specific movie ID.
Changes are grouped by key, and ordered by date in descending order.
By default, only the last 24 hours of changes are returned.
The maximu... | java | public ResultList<ChangeKeyItem> getMovieChanges(int movieId, String startDate, String endDate) throws MovieDbException {
return getMediaChanges(movieId, startDate, endDate);
} | [
"public",
"ResultList",
"<",
"ChangeKeyItem",
">",
"getMovieChanges",
"(",
"int",
"movieId",
",",
"String",
"startDate",
",",
"String",
"endDate",
")",
"throws",
"MovieDbException",
"{",
"return",
"getMediaChanges",
"(",
"movieId",
",",
"startDate",
",",
"endDate"... | Get the changes for a specific movie ID.
Changes are grouped by key, and ordered by date in descending order.
By default, only the last 24 hours of changes are returned.
The maximum number of days that can be returned in a single request is 14.
The language is present on fields that are translatable.
@param movieI... | [
"Get",
"the",
"changes",
"for",
"a",
"specific",
"movie",
"ID",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java#L460-L462 |
wcm-io/wcm-io-tooling | maven/skins/reflow-velocity-tools/src/main/java/io/wcm/maven/skins/reflow/velocity/HtmlTool.java | HtmlTool.headingIndex | private static int headingIndex(Element element) {
"""
Retrieves numeric index of a heading.
@param element
@return Index
"""
String tagName = element.tagName();
if (tagName.startsWith("h")) {
try {
return Integer.parseInt(tagName.substring(1));
}
catch (Throwable ex) {
... | java | private static int headingIndex(Element element) {
String tagName = element.tagName();
if (tagName.startsWith("h")) {
try {
return Integer.parseInt(tagName.substring(1));
}
catch (Throwable ex) {
throw new IllegalArgumentException("Must be a header tag: " + tagName, ex);
... | [
"private",
"static",
"int",
"headingIndex",
"(",
"Element",
"element",
")",
"{",
"String",
"tagName",
"=",
"element",
".",
"tagName",
"(",
")",
";",
"if",
"(",
"tagName",
".",
"startsWith",
"(",
"\"h\"",
")",
")",
"{",
"try",
"{",
"return",
"Integer",
... | Retrieves numeric index of a heading.
@param element
@return Index | [
"Retrieves",
"numeric",
"index",
"of",
"a",
"heading",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/maven/skins/reflow-velocity-tools/src/main/java/io/wcm/maven/skins/reflow/velocity/HtmlTool.java#L1225-L1238 |
springfox/springfox | springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRule.java | AlternateTypeRule.alternateFor | public ResolvedType alternateFor(ResolvedType type) {
"""
Provides alternate for supplier type.
@param type the type
@return the alternate for the type
"""
if (appliesTo(type)) {
if (hasWildcards(original)) {
return replaceWildcardsFrom(WildcardType.collectReplaceables(type, original), al... | java | public ResolvedType alternateFor(ResolvedType type) {
if (appliesTo(type)) {
if (hasWildcards(original)) {
return replaceWildcardsFrom(WildcardType.collectReplaceables(type, original), alternate);
} else {
return alternate;
}
}
return type;
} | [
"public",
"ResolvedType",
"alternateFor",
"(",
"ResolvedType",
"type",
")",
"{",
"if",
"(",
"appliesTo",
"(",
"type",
")",
")",
"{",
"if",
"(",
"hasWildcards",
"(",
"original",
")",
")",
"{",
"return",
"replaceWildcardsFrom",
"(",
"WildcardType",
".",
"colle... | Provides alternate for supplier type.
@param type the type
@return the alternate for the type | [
"Provides",
"alternate",
"for",
"supplier",
"type",
"."
] | train | https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRule.java#L61-L70 |
jbundle/jbundle | thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/CachedInfo.java | CachedInfo.setCacheData | public synchronized void setCacheData(Date startTime, Date endTime, String description, String [] rgstrMeals) {
"""
Change the cache data without calling the methods to change the underlying model.
This method is used by the lineItem to change the screen model without calling a change to the model.
"""
... | java | public synchronized void setCacheData(Date startTime, Date endTime, String description, String [] rgstrMeals)
{
if (startTime != null)
m_startTime = startTime;
if (endTime != null)
m_endTime = endTime;
if (description != null)
m_description = description;
... | [
"public",
"synchronized",
"void",
"setCacheData",
"(",
"Date",
"startTime",
",",
"Date",
"endTime",
",",
"String",
"description",
",",
"String",
"[",
"]",
"rgstrMeals",
")",
"{",
"if",
"(",
"startTime",
"!=",
"null",
")",
"m_startTime",
"=",
"startTime",
";"... | Change the cache data without calling the methods to change the underlying model.
This method is used by the lineItem to change the screen model without calling a change to the model. | [
"Change",
"the",
"cache",
"data",
"without",
"calling",
"the",
"methods",
"to",
"change",
"the",
"underlying",
"model",
".",
"This",
"method",
"is",
"used",
"by",
"the",
"lineItem",
"to",
"change",
"the",
"screen",
"model",
"without",
"calling",
"a",
"change... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/CachedInfo.java#L229-L239 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/FutureOperation.java | FutureOperation.waitForCompletion | public void waitForCompletion(final long timeout, final TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
"""
Wait for the completion of the operation (timed version)
@param timeout
@param unit
@throws InterruptedException
@throws ExecutionException
@throws TimeoutExceptio... | java | public void waitForCompletion(final long timeout, final TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
doneLatch.await(timeout, unit);
} | [
"public",
"void",
"waitForCompletion",
"(",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"doneLatch",
".",
"await",
"(",
"timeout",
",",
"unit",
")",
... | Wait for the completion of the operation (timed version)
@param timeout
@param unit
@throws InterruptedException
@throws ExecutionException
@throws TimeoutException | [
"Wait",
"for",
"the",
"completion",
"of",
"the",
"operation",
"(",
"timed",
"version",
")"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/FutureOperation.java#L85-L88 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_menu_POST | public OvhOvhPabxMenu billingAccount_ovhPabx_serviceName_menu_POST(String billingAccount, String serviceName, Long greetSound, Long greetSoundTts, Long invalidSound, Long invalidSoundTts, String name) throws IOException {
"""
Create a new menu
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/menu
@... | java | public OvhOvhPabxMenu billingAccount_ovhPabx_serviceName_menu_POST(String billingAccount, String serviceName, Long greetSound, Long greetSoundTts, Long invalidSound, Long invalidSoundTts, String name) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu";
StringBuilder sb = pa... | [
"public",
"OvhOvhPabxMenu",
"billingAccount_ovhPabx_serviceName_menu_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"greetSound",
",",
"Long",
"greetSoundTts",
",",
"Long",
"invalidSound",
",",
"Long",
"invalidSoundTts",
",",
"String",
... | Create a new menu
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/menu
@param greetSound [required] The id of the OvhPabxSound played to greet
@param invalidSound [required] The id of the OvhPabxSound played when the caller uses an invalid DTMF
@param invalidSoundTts [required] The text to speech sound pl... | [
"Create",
"a",
"new",
"menu"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7600-L7611 |
centic9/commons-dost | src/main/java/org/dstadler/commons/zip/ZipUtils.java | ZipUtils.extractZip | public static void extractZip(InputStream zip, final File toDir) throws IOException {
"""
Extracts all files in the ZIP file passed as InputStream and stores them in the
denoted directory. The directory needs to exist before running this method.
Note: nested ZIP files are not extracted here.
@param zip An {... | java | public static void extractZip(InputStream zip, final File toDir) throws IOException{
if(!toDir.exists()) {
throw new IOException("Directory '" + toDir + "' does not exist.");
}
// Use the ZipFileVisitor to walk all the entries in the Zip-Stream and create
// directories and files accordingly
new ZipFileVi... | [
"public",
"static",
"void",
"extractZip",
"(",
"InputStream",
"zip",
",",
"final",
"File",
"toDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"toDir",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Directory '\"",
"+",
... | Extracts all files in the ZIP file passed as InputStream and stores them in the
denoted directory. The directory needs to exist before running this method.
Note: nested ZIP files are not extracted here.
@param zip An {@link InputStream} to read zipped files from
@param toDir Target directory, should already exist.
@... | [
"Extracts",
"all",
"files",
"in",
"the",
"ZIP",
"file",
"passed",
"as",
"InputStream",
"and",
"stores",
"them",
"in",
"the",
"denoted",
"directory",
".",
"The",
"directory",
"needs",
"to",
"exist",
"before",
"running",
"this",
"method",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/zip/ZipUtils.java#L390-L426 |
knightliao/disconf | disconf-client/src/main/java/com/baidu/disconf/client/usertools/DisconfDataGetter.java | DisconfDataGetter.getByFileItem | public static Object getByFileItem(String fileName, String fileItem) {
"""
获取 分布式配置文件 获取该配置文件 中 某个配置项 的值
@param fileName
@param fileItem
@return
"""
return iDisconfDataGetter.getByFileItem(fileName, fileItem);
} | java | public static Object getByFileItem(String fileName, String fileItem) {
return iDisconfDataGetter.getByFileItem(fileName, fileItem);
} | [
"public",
"static",
"Object",
"getByFileItem",
"(",
"String",
"fileName",
",",
"String",
"fileItem",
")",
"{",
"return",
"iDisconfDataGetter",
".",
"getByFileItem",
"(",
"fileName",
",",
"fileItem",
")",
";",
"}"
] | 获取 分布式配置文件 获取该配置文件 中 某个配置项 的值
@param fileName
@param fileItem
@return | [
"获取",
"分布式配置文件",
"获取该配置文件",
"中",
"某个配置项",
"的值"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/usertools/DisconfDataGetter.java#L33-L35 |
wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/security/AuthenticationInterceptor.java | AuthenticationInterceptor.call | @Override
public Result call(Authenticated configuration, RequestContext context) throws Exception {
"""
Intercepts the action, and checks if the current request is authenticated.
the results depends on two factors: if the request is authenticated and the availability of authenticator.
<p>
If there are no a... | java | @Override
public Result call(Authenticated configuration, RequestContext context) throws Exception {
Authenticator authenticator = getAuthenticator(context, configuration.value());
if (authenticator != null) {
String username = authenticator.getUserName(context.context());
if... | [
"@",
"Override",
"public",
"Result",
"call",
"(",
"Authenticated",
"configuration",
",",
"RequestContext",
"context",
")",
"throws",
"Exception",
"{",
"Authenticator",
"authenticator",
"=",
"getAuthenticator",
"(",
"context",
",",
"configuration",
".",
"value",
"(",... | Intercepts the action, and checks if the current request is authenticated.
the results depends on two factors: if the request is authenticated and the availability of authenticator.
<p>
If there are no authenticator, it returns a unauthorized response.
If there are an authenticator matching the set ones (in the annotat... | [
"Intercepts",
"the",
"action",
"and",
"checks",
"if",
"the",
"current",
"request",
"is",
"authenticated",
".",
"the",
"results",
"depends",
"on",
"two",
"factors",
":",
"if",
"the",
"request",
"is",
"authenticated",
"and",
"the",
"availability",
"of",
"authent... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/security/AuthenticationInterceptor.java#L67-L86 |
groupon/monsoon | collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MetricListener.java | MetricListener.onNewMbean | private synchronized void onNewMbean(ObjectName obj) {
"""
Respond to MBeans being added.
@param obj The name of the MBean being added.
"""
if (detected_groups_.keySet().contains(obj)) {
LOG.log(Level.WARNING, "skipping registration of {0}: already present", obj);
return;
... | java | private synchronized void onNewMbean(ObjectName obj) {
if (detected_groups_.keySet().contains(obj)) {
LOG.log(Level.WARNING, "skipping registration of {0}: already present", obj);
return;
}
MBeanGroup instance = new MBeanGroup(obj, resolvedMap);
detected_groups_.... | [
"private",
"synchronized",
"void",
"onNewMbean",
"(",
"ObjectName",
"obj",
")",
"{",
"if",
"(",
"detected_groups_",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"obj",
")",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"skipping reg... | Respond to MBeans being added.
@param obj The name of the MBean being added. | [
"Respond",
"to",
"MBeans",
"being",
"added",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MetricListener.java#L141-L150 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateIpv6 | public static <T extends CharSequence> T validateIpv6(T value, String errorMsg) throws ValidateException {
"""
验证是否为IPV6地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isIpv6(value)) {
throw new ValidateException(errorMsg);
... | java | public static <T extends CharSequence> T validateIpv6(T value, String errorMsg) throws ValidateException {
if (false == isIpv6(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateIpv6",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isIpv6",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Va... | 验证是否为IPV6地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为IPV6地址"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L835-L840 |
seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java | AbstractI18nRestIT.httpDelete | protected Response httpDelete(String path, int status) {
"""
Deletes the resource at the given path.
@param path the resource URI
@return the http response
"""
return httpRequest(status, null).delete(baseURL + PATH_PREFIX + path);
} | java | protected Response httpDelete(String path, int status) {
return httpRequest(status, null).delete(baseURL + PATH_PREFIX + path);
} | [
"protected",
"Response",
"httpDelete",
"(",
"String",
"path",
",",
"int",
"status",
")",
"{",
"return",
"httpRequest",
"(",
"status",
",",
"null",
")",
".",
"delete",
"(",
"baseURL",
"+",
"PATH_PREFIX",
"+",
"path",
")",
";",
"}"
] | Deletes the resource at the given path.
@param path the resource URI
@return the http response | [
"Deletes",
"the",
"resource",
"at",
"the",
"given",
"path",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java#L119-L121 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/App.java | App.withAttributes | public App withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
The stack attributes.
</p>
@param attributes
The stack attributes.
@return Returns a reference to this object so that method calls can be chained together.
"""
setAttributes(attributes);
return this;
} | java | public App withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"App",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The stack attributes.
</p>
@param attributes
The stack attributes.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"stack",
"attributes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/App.java#L725-L728 |
emfjson/emfjson-jackson | src/main/java/org/emfjson/jackson/utils/EObjects.java | EObjects.setOrAdd | public static void setOrAdd(EObject owner, EReference reference, Object value) {
"""
Set or add a value to an object reference. The value must be
an EObject.
@param owner
@param reference
@param value
"""
if (value != null) {
if (reference.isMany()) {
@SuppressWarnings("unchecked")
Collectio... | java | public static void setOrAdd(EObject owner, EReference reference, Object value) {
if (value != null) {
if (reference.isMany()) {
@SuppressWarnings("unchecked")
Collection<EObject> values = (Collection<EObject>) owner.eGet(reference, false);
if (values != null && value instanceof EObject) {
values.a... | [
"public",
"static",
"void",
"setOrAdd",
"(",
"EObject",
"owner",
",",
"EReference",
"reference",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"reference",
".",
"isMany",
"(",
")",
")",
"{",
"@",
"SuppressWarn... | Set or add a value to an object reference. The value must be
an EObject.
@param owner
@param reference
@param value | [
"Set",
"or",
"add",
"a",
"value",
"to",
"an",
"object",
"reference",
".",
"The",
"value",
"must",
"be",
"an",
"EObject",
"."
] | train | https://github.com/emfjson/emfjson-jackson/blob/5f4488d1b07d499003351606cf76ee0c4ac39964/src/main/java/org/emfjson/jackson/utils/EObjects.java#L36-L48 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getString | public String getString(@NotNull final String key, @Nullable final String defaultValue) {
"""
Returns a value from the properties file. If the value was specified as a
system property or passed in via the -Dprop=value argument - this method
will return the value from the system properties before the values in th... | java | public String getString(@NotNull final String key, @Nullable final String defaultValue) {
return System.getProperty(key, props.getProperty(key, defaultValue));
} | [
"public",
"String",
"getString",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"Nullable",
"final",
"String",
"defaultValue",
")",
"{",
"return",
"System",
".",
"getProperty",
"(",
"key",
",",
"props",
".",
"getProperty",
"(",
"key",
",",
"defau... | Returns a value from the properties file. If the value was specified as a
system property or passed in via the -Dprop=value argument - this method
will return the value from the system properties before the values in the
contained configuration file.
@param key the key to lookup within the properties file
@param defau... | [
"Returns",
"a",
"value",
"from",
"the",
"properties",
"file",
".",
"If",
"the",
"value",
"was",
"specified",
"as",
"a",
"system",
"property",
"or",
"passed",
"in",
"via",
"the",
"-",
"Dprop",
"=",
"value",
"argument",
"-",
"this",
"method",
"will",
"retu... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L902-L904 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | MethodUtils.distance | private static int distance(final Class<?>[] classArray, final Class<?>[] toClassArray) {
"""
<p>Returns the aggregate number of inheritance hops between assignable argument class types. Returns -1
if the arguments aren't assignable. Fills a specific purpose for getMatchingMethod and is not generalized.</p>
@p... | java | private static int distance(final Class<?>[] classArray, final Class<?>[] toClassArray) {
int answer = 0;
if (!ClassUtils.isAssignable(classArray, toClassArray, true)) {
return -1;
}
for (int offset = 0; offset < classArray.length; offset++) {
// Note Inheritance... | [
"private",
"static",
"int",
"distance",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"classArray",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"toClassArray",
")",
"{",
"int",
"answer",
"=",
"0",
";",
"if",
"(",
"!",
"ClassUtils",
".",
"isAs... | <p>Returns the aggregate number of inheritance hops between assignable argument class types. Returns -1
if the arguments aren't assignable. Fills a specific purpose for getMatchingMethod and is not generalized.</p>
@param classArray
@param toClassArray
@return the aggregate number of inheritance hops between assignab... | [
"<p",
">",
"Returns",
"the",
"aggregate",
"number",
"of",
"inheritance",
"hops",
"between",
"assignable",
"argument",
"class",
"types",
".",
"Returns",
"-",
"1",
"if",
"the",
"arguments",
"aren",
"t",
"assignable",
".",
"Fills",
"a",
"specific",
"purpose",
"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java#L769-L788 |
EdwardRaff/JSAT | JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java | OnlineLDAsvi.setTau0 | public void setTau0(double tau0) {
"""
A learning rate constant to control the influence of early iterations on
the solution. Larger values reduce the influence of earlier iterations,
smaller values increase the weight of earlier iterations.
@param tau0 a learning rate parameter that must be greater than 0 (usu... | java | public void setTau0(double tau0)
{
if(tau0 <= 0 || Double.isInfinite(tau0) || Double.isNaN(tau0))
throw new IllegalArgumentException("Eta must be a positive constant, not " + tau0);
this.tau0 = tau0;
} | [
"public",
"void",
"setTau0",
"(",
"double",
"tau0",
")",
"{",
"if",
"(",
"tau0",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"tau0",
")",
"||",
"Double",
".",
"isNaN",
"(",
"tau0",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Et... | A learning rate constant to control the influence of early iterations on
the solution. Larger values reduce the influence of earlier iterations,
smaller values increase the weight of earlier iterations.
@param tau0 a learning rate parameter that must be greater than 0 (usually at least 1) | [
"A",
"learning",
"rate",
"constant",
"to",
"control",
"the",
"influence",
"of",
"early",
"iterations",
"on",
"the",
"solution",
".",
"Larger",
"values",
"reduce",
"the",
"influence",
"of",
"earlier",
"iterations",
"smaller",
"values",
"increase",
"the",
"weight"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java#L299-L304 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_namespaces_POST | public OvhNamespace serviceName_namespaces_POST(String serviceName, OvhInputNamespace body) throws IOException {
"""
Create namespace
REST: POST /caas/registry/{serviceName}/namespaces
@param body [required] A namespace in which a user can either read, write or delete images
@param serviceName [required] Serv... | java | public OvhNamespace serviceName_namespaces_POST(String serviceName, OvhInputNamespace body) throws IOException {
String qPath = "/caas/registry/{serviceName}/namespaces";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "POST", sb.toString(), body);
return convertTo(resp, OvhNamespace.clas... | [
"public",
"OvhNamespace",
"serviceName_namespaces_POST",
"(",
"String",
"serviceName",
",",
"OvhInputNamespace",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/registry/{serviceName}/namespaces\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Create namespace
REST: POST /caas/registry/{serviceName}/namespaces
@param body [required] A namespace in which a user can either read, write or delete images
@param serviceName [required] Service name
API beta | [
"Create",
"namespace"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L469-L474 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java | HeaderAndFooterGridView.addHeaderView | public final void addHeaderView(@NonNull final View view, @Nullable final Object data,
final boolean selectable) {
"""
Adds a fixed view to appear at the top of the adapter view. If this method is called more
than once, the views will appear in the order they were added.
@pa... | java | public final void addHeaderView(@NonNull final View view, @Nullable final Object data,
final boolean selectable) {
Condition.INSTANCE.ensureNotNull(view, "The view may not be null");
headers.add(new FullWidthItem(view, data, selectable));
notifyDataSetChanged(... | [
"public",
"final",
"void",
"addHeaderView",
"(",
"@",
"NonNull",
"final",
"View",
"view",
",",
"@",
"Nullable",
"final",
"Object",
"data",
",",
"final",
"boolean",
"selectable",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"view",
",",
... | Adds a fixed view to appear at the top of the adapter view. If this method is called more
than once, the views will appear in the order they were added.
@param view
The header view, which should be added, as an instance of the class {@link View}. The
view may not be null
@param data
The data, which should be associate... | [
"Adds",
"a",
"fixed",
"view",
"to",
"appear",
"at",
"the",
"top",
"of",
"the",
"adapter",
"view",
".",
"If",
"this",
"method",
"is",
"called",
"more",
"than",
"once",
"the",
"views",
"will",
"appear",
"in",
"the",
"order",
"they",
"were",
"added",
"."
... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java#L626-L631 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java | OAuth1.responseToToken | protected Token responseToToken(Map<String, String> response) {
"""
Parses a service response and creates a token
@param response the response
@return the token
"""
return new Token(response.get(OAUTH_TOKEN), response.get(OAUTH_TOKEN_SECRET));
} | java | protected Token responseToToken(Map<String, String> response) {
return new Token(response.get(OAUTH_TOKEN), response.get(OAUTH_TOKEN_SECRET));
} | [
"protected",
"Token",
"responseToToken",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"response",
")",
"{",
"return",
"new",
"Token",
"(",
"response",
".",
"get",
"(",
"OAUTH_TOKEN",
")",
",",
"response",
".",
"get",
"(",
"OAUTH_TOKEN_SECRET",
")",
")",
... | Parses a service response and creates a token
@param response the response
@return the token | [
"Parses",
"a",
"service",
"response",
"and",
"creates",
"a",
"token"
] | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/OAuth1.java#L147-L149 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineFinish | public void setBaselineFinish(int baselineNumber, Date value) {
"""
Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value
"""
set(selectField(TaskFieldLists.BASELINE_FINISHES, baselineNumber), value);
} | java | public void setBaselineFinish(int baselineNumber, Date value)
{
set(selectField(TaskFieldLists.BASELINE_FINISHES, baselineNumber), value);
} | [
"public",
"void",
"setBaselineFinish",
"(",
"int",
"baselineNumber",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_FINISHES",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4002-L4005 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/HexUtil.java | HexUtil.appendHexString | static public void appendHexString(StringBuilder buffer, long value) {
"""
Appends 16 characters to a StringBuilder with the long in a "Big Endian"
hexidecimal format. For example, a long 0xAABBCCDDEE123456 will be appended as a
String in format "AABBCCDDEE123456". A long of value 0 will be appended as "00000000... | java | static public void appendHexString(StringBuilder buffer, long value) {
appendHexString(buffer, (int)((value & 0xFFFFFFFF00000000L) >>> 32));
appendHexString(buffer, (int)(value & 0x00000000FFFFFFFFL));
} | [
"static",
"public",
"void",
"appendHexString",
"(",
"StringBuilder",
"buffer",
",",
"long",
"value",
")",
"{",
"appendHexString",
"(",
"buffer",
",",
"(",
"int",
")",
"(",
"(",
"value",
"&",
"0xFFFFFFFF00000000",
"L",
")",
">>>",
"32",
")",
")",
";",
"ap... | Appends 16 characters to a StringBuilder with the long in a "Big Endian"
hexidecimal format. For example, a long 0xAABBCCDDEE123456 will be appended as a
String in format "AABBCCDDEE123456". A long of value 0 will be appended as "0000000000000000".
@param buffer The StringBuilder the long value in hexidecimal format
wi... | [
"Appends",
"16",
"characters",
"to",
"a",
"StringBuilder",
"with",
"the",
"long",
"in",
"a",
"Big",
"Endian",
"hexidecimal",
"format",
".",
"For",
"example",
"a",
"long",
"0xAABBCCDDEE123456",
"will",
"be",
"appended",
"as",
"a",
"String",
"in",
"format",
"A... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/HexUtil.java#L247-L250 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java | TypeQualifierDatabase.setParameter | public void setParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) {
"""
Set a TypeQualifierAnnotation on a method parameter.
@param methodDesc
the method
@param param
the parameter (0 == first parameter)
@param tqv
the type qualifier
@param tqa
the t... | java | public void setParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) {
Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = parameterMap.get(methodDesc, param);
if (map == null) {
map = new HashMap<>();
parameterMap.put(met... | [
"public",
"void",
"setParameter",
"(",
"MethodDescriptor",
"methodDesc",
",",
"int",
"param",
",",
"TypeQualifierValue",
"<",
"?",
">",
"tqv",
",",
"TypeQualifierAnnotation",
"tqa",
")",
"{",
"Map",
"<",
"TypeQualifierValue",
"<",
"?",
">",
",",
"TypeQualifierAn... | Set a TypeQualifierAnnotation on a method parameter.
@param methodDesc
the method
@param param
the parameter (0 == first parameter)
@param tqv
the type qualifier
@param tqa
the type qualifier annotation | [
"Set",
"a",
"TypeQualifierAnnotation",
"on",
"a",
"method",
"parameter",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L112-L123 |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java | GlobalSuffixFinders.findRivestSchapire | public static <I, O> List<Word<I>> findRivestSchapire(Query<I, O> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, O> hypOutput,
... | java | public static <I, O> List<Word<I>> findRivestSchapire(Query<I, O> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, O> hypOutput,
... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"List",
"<",
"Word",
"<",
"I",
">",
">",
"findRivestSchapire",
"(",
"Query",
"<",
"I",
",",
"O",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
",",
"SuffixOutput",
"<",
"I... | Returns the suffix (plus all of its suffixes, if {@code allSuffixes} is true) found by the binary search access
sequence transformation.
@param ceQuery
the counterexample query
@param asTransformer
the access sequence transformer
@param hypOutput
interface to the hypothesis output
@param oracle
interface to the SUL ou... | [
"Returns",
"the",
"suffix",
"(",
"plus",
"all",
"of",
"its",
"suffixes",
"if",
"{",
"@code",
"allSuffixes",
"}",
"is",
"true",
")",
"found",
"by",
"the",
"binary",
"search",
"access",
"sequence",
"transformation",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java#L332-L339 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/Img.java | Img.scale | public Img scale(int width, int height, Color fixedColor) {
"""
缩放图像(按高度和宽度缩放)<br>
缩放后默认为jpeg格式
@param width 缩放后的宽度
@param height 缩放后的高度
@param fixedColor 比例不对时补充的颜色,不补充为<code>null</code>
@return this
"""
final BufferedImage srcImage = getValidSrcImg();
int srcHeight = srcImage.getHeight(null);
... | java | public Img scale(int width, int height, Color fixedColor) {
final BufferedImage srcImage = getValidSrcImg();
int srcHeight = srcImage.getHeight(null);
int srcWidth = srcImage.getWidth(null);
double heightRatio = NumberUtil.div(height, srcHeight);
double widthRatio = NumberUtil.div(width, srcWidth);
if... | [
"public",
"Img",
"scale",
"(",
"int",
"width",
",",
"int",
"height",
",",
"Color",
"fixedColor",
")",
"{",
"final",
"BufferedImage",
"srcImage",
"=",
"getValidSrcImg",
"(",
")",
";",
"int",
"srcHeight",
"=",
"srcImage",
".",
"getHeight",
"(",
"null",
")",
... | 缩放图像(按高度和宽度缩放)<br>
缩放后默认为jpeg格式
@param width 缩放后的宽度
@param height 缩放后的高度
@param fixedColor 比例不对时补充的颜色,不补充为<code>null</code>
@return this | [
"缩放图像(按高度和宽度缩放)<br",
">",
"缩放后默认为jpeg格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/Img.java#L240-L277 |
javaruntype/javaruntype | src/main/java/org/javaruntype/cache/ConcurrentCache.java | ConcurrentCache.computeAndGet | public V computeAndGet(final K key, final V value) {
"""
<p>
Puts a value into the cache and returns it. If a value already
existed for the same key, the existing value is not modified and is
returned instead of the one passed as parameter. This ensures only one
object for each key exists at a time.
</p>
@... | java | public V computeAndGet(final K key, final V value) {
V result = this.cache.get(key);
if (result == null) {
result = this.cache.putIfAbsent(key, value);
if (result == null) {
result = value;
final int excessElements = this.cache.size() - this.maxEle... | [
"public",
"V",
"computeAndGet",
"(",
"final",
"K",
"key",
",",
"final",
"V",
"value",
")",
"{",
"V",
"result",
"=",
"this",
".",
"cache",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"this",
".",
... | <p>
Puts a value into the cache and returns it. If a value already
existed for the same key, the existing value is not modified and is
returned instead of the one passed as parameter. This ensures only one
object for each key exists at a time.
</p>
@param key the key to which the value will be assigned
@param value th... | [
"<p",
">",
"Puts",
"a",
"value",
"into",
"the",
"cache",
"and",
"returns",
"it",
".",
"If",
"a",
"value",
"already",
"existed",
"for",
"the",
"same",
"key",
"the",
"existing",
"value",
"is",
"not",
"modified",
"and",
"is",
"returned",
"instead",
"of",
... | train | https://github.com/javaruntype/javaruntype/blob/d3c522d16fd2295d09a11570d8c951c4821eff0a/src/main/java/org/javaruntype/cache/ConcurrentCache.java#L116-L131 |
paymill/paymill-java | src/main/java/com/paymill/services/ChecksumService.java | ChecksumService.createChecksumForPaypal | public Checksum createChecksumForPaypal(Integer amount, String currency, String returnUrl, String cancelUrl) {
"""
Created a {@link Checksum} of {@link Checksum#type Checksum.type} with amount in the given currency.
@param amount
Amount (in cents) which will be charged.
@param currency
ISO 4217 formatted cur... | java | public Checksum createChecksumForPaypal(Integer amount, String currency, String returnUrl, String cancelUrl) {
return this.createChecksumForPaypalWithDescription(amount, currency, returnUrl, cancelUrl, null);
} | [
"public",
"Checksum",
"createChecksumForPaypal",
"(",
"Integer",
"amount",
",",
"String",
"currency",
",",
"String",
"returnUrl",
",",
"String",
"cancelUrl",
")",
"{",
"return",
"this",
".",
"createChecksumForPaypalWithDescription",
"(",
"amount",
",",
"currency",
"... | Created a {@link Checksum} of {@link Checksum#type Checksum.type} with amount in the given currency.
@param amount
Amount (in cents) which will be charged.
@param currency
ISO 4217 formatted currency code.
@param returnUrl
URL to redirect customers to after checkout has completed.
@param cancelUrl
URL to redirect cust... | [
"Created",
"a",
"{",
"@link",
"Checksum",
"}",
"of",
"{",
"@link",
"Checksum#type",
"Checksum",
".",
"type",
"}",
"with",
"amount",
"in",
"the",
"given",
"currency",
"."
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/ChecksumService.java#L42-L44 |
walkmod/walkmod-core | src/main/java/org/walkmod/util/ClassLoaderUtil.java | ClassLoaderUtil.getResources | public static Iterator<URL> getResources(String resourceName, Class<?> callingClass, boolean aggregate)
throws IOException {
"""
Load all resources with a given name, potentially aggregating all results
from the searched classloaders. If no results are found, the resource
name is prepended by '/' and tried a... | java | public static Iterator<URL> getResources(String resourceName, Class<?> callingClass, boolean aggregate)
throws IOException {
AggregateIterator<URL> iterator = new AggregateIterator<URL>();
iterator.addEnumeration(Thread.currentThread().getContextClassLoader().getResources(resourceName));
if (!iterator.hasN... | [
"public",
"static",
"Iterator",
"<",
"URL",
">",
"getResources",
"(",
"String",
"resourceName",
",",
"Class",
"<",
"?",
">",
"callingClass",
",",
"boolean",
"aggregate",
")",
"throws",
"IOException",
"{",
"AggregateIterator",
"<",
"URL",
">",
"iterator",
"=",
... | Load all resources with a given name, potentially aggregating all results
from the searched classloaders. If no results are found, the resource
name is prepended by '/' and tried again.
This method will try to load the resources using the following methods
(in order):
<ul>
<li>From Thread.currentThread().getContextCla... | [
"Load",
"all",
"resources",
"with",
"a",
"given",
"name",
"potentially",
"aggregating",
"all",
"results",
"from",
"the",
"searched",
"classloaders",
".",
"If",
"no",
"results",
"are",
"found",
"the",
"resource",
"name",
"is",
"prepended",
"by",
"/",
"and",
"... | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/util/ClassLoaderUtil.java#L312-L330 |
baratine/baratine | framework/src/main/java/com/caucho/v5/config/reflect/ParamType.java | ParamType.extendGenericType | @Override
public BaseType extendGenericType() {
"""
Convert Foo<Bar> to Foo<? extends Bar> for CDI extension matching.
"""
BaseType []oldParams = getParameters();
BaseType []newParams = new BaseType[oldParams.length];
boolean isExtend = false;
for (int i = 0; i < newParams.length; i+... | java | @Override
public BaseType extendGenericType()
{
BaseType []oldParams = getParameters();
BaseType []newParams = new BaseType[oldParams.length];
boolean isExtend = false;
for (int i = 0; i < newParams.length; i++) {
BaseType param = oldParams[i];
if (param instanceof ClassT... | [
"@",
"Override",
"public",
"BaseType",
"extendGenericType",
"(",
")",
"{",
"BaseType",
"[",
"]",
"oldParams",
"=",
"getParameters",
"(",
")",
";",
"BaseType",
"[",
"]",
"newParams",
"=",
"new",
"BaseType",
"[",
"oldParams",
".",
"length",
"]",
";",
"boolea... | Convert Foo<Bar> to Foo<? extends Bar> for CDI extension matching. | [
"Convert",
"Foo<Bar",
">",
"to",
"Foo<?",
"extends",
"Bar",
">",
"for",
"CDI",
"extension",
"matching",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/config/reflect/ParamType.java#L244-L277 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putServiceIntoFlowScope | public static void putServiceIntoFlowScope(final RequestContext context, final Service service) {
"""
Put service into flowscope.
@param context the context
@param service the service
"""
context.getFlowScope().put(PARAMETER_SERVICE, service);
} | java | public static void putServiceIntoFlowScope(final RequestContext context, final Service service) {
context.getFlowScope().put(PARAMETER_SERVICE, service);
} | [
"public",
"static",
"void",
"putServiceIntoFlowScope",
"(",
"final",
"RequestContext",
"context",
",",
"final",
"Service",
"service",
")",
"{",
"context",
".",
"getFlowScope",
"(",
")",
".",
"put",
"(",
"PARAMETER_SERVICE",
",",
"service",
")",
";",
"}"
] | Put service into flowscope.
@param context the context
@param service the service | [
"Put",
"service",
"into",
"flowscope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L299-L301 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.notEmpty | @ArgumentsChecked
@Throws( {
"""
Ensures that a passed parameter of the calling method is not empty, using the passed expression to evaluate the
emptiness.
@param condition
condition must be {@code true}^ so that the check will be performed
@param expression
the result of the expression to verify the empti... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class })
public static void notEmpty(final boolean condition, final boolean expression, @Nullable final String name) {
if (condition) {
Check.notEmpty(expression, name);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalEmptyArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"void",
"notEmpty",
"(",
"final",
"boolean",
"condition",
",",
"final",
"boolean",
"ex... | Ensures that a passed parameter of the calling method is not empty, using the passed expression to evaluate the
emptiness.
@param condition
condition must be {@code true}^ so that the check will be performed
@param expression
the result of the expression to verify the emptiness of a reference ({@code true} means empty... | [
"Ensures",
"that",
"a",
"passed",
"parameter",
"of",
"the",
"calling",
"method",
"is",
"not",
"empty",
"using",
"the",
"passed",
"expression",
"to",
"evaluate",
"the",
"emptiness",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1183-L1189 |
lucee/Lucee | core/src/main/java/lucee/runtime/functions/cache/CacheClear.java | CacheClear.call | public static double call(PageContext pc, String filter, String cacheName) throws PageException {
"""
FUTURE remove, only exist for code in Lucee archives using that function
"""
return _call(pc, filter, cacheName);
} | java | public static double call(PageContext pc, String filter, String cacheName) throws PageException {
return _call(pc, filter, cacheName);
} | [
"public",
"static",
"double",
"call",
"(",
"PageContext",
"pc",
",",
"String",
"filter",
",",
"String",
"cacheName",
")",
"throws",
"PageException",
"{",
"return",
"_call",
"(",
"pc",
",",
"filter",
",",
"cacheName",
")",
";",
"}"
] | FUTURE remove, only exist for code in Lucee archives using that function | [
"FUTURE",
"remove",
"only",
"exist",
"for",
"code",
"in",
"Lucee",
"archives",
"using",
"that",
"function"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/cache/CacheClear.java#L64-L66 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XImageView.java | XImageView.printData | public boolean printData(PrintWriter out, int iPrintOptions) {
"""
Print this field's data in XML format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
boolean bFieldsFound = false;
String strFieldName =... | java | public boolean printData(PrintWriter out, int iPrintOptions)
{
boolean bFieldsFound = false;
String strFieldName = this.getScreenField().getSFieldParam();
String strFieldData = this.getZmlImagePath();
if (strFieldData == null)
strFieldData = HtmlConstants.ICON_DIR + "Noim... | [
"public",
"boolean",
"printData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"boolean",
"bFieldsFound",
"=",
"false",
";",
"String",
"strFieldName",
"=",
"this",
".",
"getScreenField",
"(",
")",
".",
"getSFieldParam",
"(",
")",
";",
"S... | Print this field's data in XML format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Print",
"this",
"field",
"s",
"data",
"in",
"XML",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XImageView.java#L74-L84 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getBondOrderSum | public static double getBondOrderSum(IAtomContainer container, IAtom atom) {
"""
Returns the sum of the bond order equivalents for a given IAtom. It
considers single bonds as 1.0, double bonds as 2.0, triple bonds as 3.0,
and quadruple bonds as 4.0.
@param atom The atom for which to calculate the bond order... | java | public static double getBondOrderSum(IAtomContainer container, IAtom atom) {
double count = 0;
for (IBond bond : container.getConnectedBondsList(atom)) {
IBond.Order order = bond.getOrder();
if (order != null) {
count += order.numeric();
}
}
... | [
"public",
"static",
"double",
"getBondOrderSum",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"atom",
")",
"{",
"double",
"count",
"=",
"0",
";",
"for",
"(",
"IBond",
"bond",
":",
"container",
".",
"getConnectedBondsList",
"(",
"atom",
")",
")",
"{",
... | Returns the sum of the bond order equivalents for a given IAtom. It
considers single bonds as 1.0, double bonds as 2.0, triple bonds as 3.0,
and quadruple bonds as 4.0.
@param atom The atom for which to calculate the bond order sum
@return The number of bond order equivalents for this atom | [
"Returns",
"the",
"sum",
"of",
"the",
"bond",
"order",
"equivalents",
"for",
"a",
"given",
"IAtom",
".",
"It",
"considers",
"single",
"bonds",
"as",
"1",
".",
"0",
"double",
"bonds",
"as",
"2",
".",
"0",
"triple",
"bonds",
"as",
"3",
".",
"0",
"and",... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1708-L1717 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java | DistributionBarHelper.getTooltip | public static String getTooltip(final Map<Status, Long> statusCountMap) {
"""
Returns tool tip for progress bar.
@param statusCountMap
map with status and count details
@return tool tip
"""
final Map<Status, Long> nonZeroStatusCountMap = DistributionBarHelper
.getStatusMapWithNonZe... | java | public static String getTooltip(final Map<Status, Long> statusCountMap) {
final Map<Status, Long> nonZeroStatusCountMap = DistributionBarHelper
.getStatusMapWithNonZeroValues(statusCountMap);
final StringBuilder tooltip = new StringBuilder();
for (final Entry<Status, Long> entry ... | [
"public",
"static",
"String",
"getTooltip",
"(",
"final",
"Map",
"<",
"Status",
",",
"Long",
">",
"statusCountMap",
")",
"{",
"final",
"Map",
"<",
"Status",
",",
"Long",
">",
"nonZeroStatusCountMap",
"=",
"DistributionBarHelper",
".",
"getStatusMapWithNonZeroValue... | Returns tool tip for progress bar.
@param statusCountMap
map with status and count details
@return tool tip | [
"Returns",
"tool",
"tip",
"for",
"progress",
"bar",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java#L82-L91 |
ziccardi/jnrpe | jnrpe-server/src/main/java/it/jnrpe/server/CommandsSection.java | CommandsSection.addCommand | public void addCommand(final String commandName, final String pluginName, final String commandLine) {
"""
Adds a command to the section.
@param commandName
The command name
@param pluginName
The plugin name
@param commandLine
The command line
"""
commandsList.add(new Command(commandName, plugin... | java | public void addCommand(final String commandName, final String pluginName, final String commandLine) {
commandsList.add(new Command(commandName, pluginName, commandLine));
} | [
"public",
"void",
"addCommand",
"(",
"final",
"String",
"commandName",
",",
"final",
"String",
"pluginName",
",",
"final",
"String",
"commandLine",
")",
"{",
"commandsList",
".",
"add",
"(",
"new",
"Command",
"(",
"commandName",
",",
"pluginName",
",",
"comman... | Adds a command to the section.
@param commandName
The command name
@param pluginName
The plugin name
@param commandLine
The command line | [
"Adds",
"a",
"command",
"to",
"the",
"section",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-server/src/main/java/it/jnrpe/server/CommandsSection.java#L102-L104 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsResourceTypeConfig.java | CmsResourceTypeConfig.configureCreateNewElement | public void configureCreateNewElement(CmsObject cms, String pageFolderRootPath, CmsNewResourceBuilder builder)
throws CmsException {
"""
Similar to createNewElement, but just sets parameters on a resource builder instead of actually creating the resource.<p>
@param cms the CMS context
@param pageFolderRoot... | java | public void configureCreateNewElement(CmsObject cms, String pageFolderRootPath, CmsNewResourceBuilder builder)
throws CmsException {
checkOffline(cms);
checkInitialized();
String folderPath = getFolderPath(cms, pageFolderRootPath);
CmsVfsUtil.createFolder(cms, folderPath);
S... | [
"public",
"void",
"configureCreateNewElement",
"(",
"CmsObject",
"cms",
",",
"String",
"pageFolderRootPath",
",",
"CmsNewResourceBuilder",
"builder",
")",
"throws",
"CmsException",
"{",
"checkOffline",
"(",
"cms",
")",
";",
"checkInitialized",
"(",
")",
";",
"String... | Similar to createNewElement, but just sets parameters on a resource builder instead of actually creating the resource.<p>
@param cms the CMS context
@param pageFolderRootPath the page folder root path
@param builder the resource builder
@throws CmsException if something goes wrong | [
"Similar",
"to",
"createNewElement",
"but",
"just",
"sets",
"parameters",
"on",
"a",
"resource",
"builder",
"instead",
"of",
"actually",
"creating",
"the",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java#L333-L345 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/db/mongo/JongoUtils.java | JongoUtils.generateQuery | public static String generateQuery(final Map<String,Object> params) {
"""
Generate a Jongo query regarding a set of parameters.
@param params Map<queryKey, queryValue> of query parameters
@return String
"""
final StringBuilder sb = new StringBuilder();
boolean newEntry = false;
sb.append("{");
f... | java | public static String generateQuery(final Map<String,Object> params){
final StringBuilder sb = new StringBuilder();
boolean newEntry = false;
sb.append("{");
for(final Entry<String,Object> param: params.entrySet()){
if(newEntry){
sb.append(", ");
}
sb.append(param.getKey());
sb.append(": ");
... | [
"public",
"static",
"String",
"generateQuery",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"newEntry",
"=",
"false",
";",
"sb",
".",
"a... | Generate a Jongo query regarding a set of parameters.
@param params Map<queryKey, queryValue> of query parameters
@return String | [
"Generate",
"a",
"Jongo",
"query",
"regarding",
"a",
"set",
"of",
"parameters",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/db/mongo/JongoUtils.java#L28-L46 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java | StringUtil.isLatin | public static boolean isLatin(String str, int beginIndex, int endIndex) {
"""
check if the specified string is all Latin chars
@param str
@param beginIndex
@param endIndex
@return boolean
"""
for ( int j = beginIndex; j < endIndex; j++ ) {
if ( ! isEnChar(str.charAt(j)) ) {
... | java | public static boolean isLatin(String str, int beginIndex, int endIndex)
{
for ( int j = beginIndex; j < endIndex; j++ ) {
if ( ! isEnChar(str.charAt(j)) ) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isLatin",
"(",
"String",
"str",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"beginIndex",
";",
"j",
"<",
"endIndex",
";",
"j",
"++",
")",
"{",
"if",
"(",
"!",
"isEnChar",
... | check if the specified string is all Latin chars
@param str
@param beginIndex
@param endIndex
@return boolean | [
"check",
"if",
"the",
"specified",
"string",
"is",
"all",
"Latin",
"chars"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L332-L341 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/EventHelper.java | EventHelper.onOpenDocument | @Override
public final void onOpenDocument(PdfWriter writer, Document document) {
"""
prepares template for printing header and footer
@param writer
@param document
"""
super.onOpenDocument(writer, document);
template = writer.getDirectContent().createTemplate(document.getPageSize().getWidth... | java | @Override
public final void onOpenDocument(PdfWriter writer, Document document) {
super.onOpenDocument(writer, document);
template = writer.getDirectContent().createTemplate(document.getPageSize().getWidth(), document.getPageSize().getHeight());
if (!getSettings().containsKey(PAGEFOOTERSTYLEKEY)) {... | [
"@",
"Override",
"public",
"final",
"void",
"onOpenDocument",
"(",
"PdfWriter",
"writer",
",",
"Document",
"document",
")",
"{",
"super",
".",
"onOpenDocument",
"(",
"writer",
",",
"document",
")",
";",
"template",
"=",
"writer",
".",
"getDirectContent",
"(",
... | prepares template for printing header and footer
@param writer
@param document | [
"prepares",
"template",
"for",
"printing",
"header",
"and",
"footer"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/EventHelper.java#L130-L145 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCircuitPeeringsInner.java | ExpressRouteCircuitPeeringsInner.beginCreateOrUpdate | public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) {
"""
Creates or updates a peering in the specified express route circuits.
@param resourceGroupName The name of the resource group.
@p... | java | public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single... | [
"public",
"ExpressRouteCircuitPeeringInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
",",
"ExpressRouteCircuitPeeringInner",
"peeringParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResp... | Creates or updates a peering in the specified express route circuits.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@param peeringParameters Parameters supplied to the create or update express route circuit... | [
"Creates",
"or",
"updates",
"a",
"peering",
"in",
"the",
"specified",
"express",
"route",
"circuits",
"."
] | 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/ExpressRouteCircuitPeeringsInner.java#L444-L446 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readLines | public static void readLines(File file, Charset charset, LineHandler lineHandler) throws IORuntimeException {
"""
按行处理文件内容
@param file 文件
@param charset 编码
@param lineHandler {@link LineHandler}行处理器
@throws IORuntimeException IO异常
"""
FileReader.create(file, charset).readLines(lineHandler);
} | java | public static void readLines(File file, Charset charset, LineHandler lineHandler) throws IORuntimeException {
FileReader.create(file, charset).readLines(lineHandler);
} | [
"public",
"static",
"void",
"readLines",
"(",
"File",
"file",
",",
"Charset",
"charset",
",",
"LineHandler",
"lineHandler",
")",
"throws",
"IORuntimeException",
"{",
"FileReader",
".",
"create",
"(",
"file",
",",
"charset",
")",
".",
"readLines",
"(",
"lineHan... | 按行处理文件内容
@param file 文件
@param charset 编码
@param lineHandler {@link LineHandler}行处理器
@throws IORuntimeException IO异常 | [
"按行处理文件内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2415-L2417 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java | DefaultGroovyStaticMethods.getBundle | public static ResourceBundle getBundle(ResourceBundle self, String bundleName, Locale locale) {
"""
Works exactly like ResourceBundle.getBundle(String, Locale). This is needed
because the java method depends on a particular stack configuration that
is not guaranteed in Groovy when calling the Java method.
@p... | java | public static ResourceBundle getBundle(ResourceBundle self, String bundleName, Locale locale) {
Class c = ReflectionUtils.getCallingClass();
ClassLoader targetCL = c != null ? c.getClassLoader() : null;
if (targetCL == null) targetCL = ClassLoader.getSystemClassLoader();
return ResourceB... | [
"public",
"static",
"ResourceBundle",
"getBundle",
"(",
"ResourceBundle",
"self",
",",
"String",
"bundleName",
",",
"Locale",
"locale",
")",
"{",
"Class",
"c",
"=",
"ReflectionUtils",
".",
"getCallingClass",
"(",
")",
";",
"ClassLoader",
"targetCL",
"=",
"c",
... | Works exactly like ResourceBundle.getBundle(String, Locale). This is needed
because the java method depends on a particular stack configuration that
is not guaranteed in Groovy when calling the Java method.
@param self placeholder variable used by Groovy categories; ignored for default static methods
@param bun... | [
"Works",
"exactly",
"like",
"ResourceBundle",
".",
"getBundle",
"(",
"String",
"Locale",
")",
".",
"This",
"is",
"needed",
"because",
"the",
"java",
"method",
"depends",
"on",
"a",
"particular",
"stack",
"configuration",
"that",
"is",
"not",
"guaranteed",
"in"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java#L208-L213 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.withFields | public Period withFields(ReadablePeriod period) {
"""
Creates a new Period instance with the fields from the specified period
copied on top of those from this period.
<p>
This period instance is immutable and unaffected by this method call.
@param period the period to copy from, null ignored
@return the ne... | java | public Period withFields(ReadablePeriod period) {
if (period == null) {
return this;
}
int[] newValues = getValues(); // cloned
newValues = super.mergePeriodInto(newValues, period);
return new Period(newValues, getPeriodType());
} | [
"public",
"Period",
"withFields",
"(",
"ReadablePeriod",
"period",
")",
"{",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"newValues",
"=",
"super",
... | Creates a new Period instance with the fields from the specified period
copied on top of those from this period.
<p>
This period instance is immutable and unaffected by this method call.
@param period the period to copy from, null ignored
@return the new period instance
@throws IllegalArgumentException if a field typ... | [
"Creates",
"a",
"new",
"Period",
"instance",
"with",
"the",
"fields",
"from",
"the",
"specified",
"period",
"copied",
"on",
"top",
"of",
"those",
"from",
"this",
"period",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L853-L860 |
alkacon/opencms-core | src/org/opencms/ade/publish/CmsPublishService.java | CmsPublishService.wrapProjectName | public static String wrapProjectName(CmsObject cms, String name) {
"""
Wraps the project name in a message string.<p>
@param cms the CMS context
@param name the project name
@return the message for the given project name
"""
return Messages.get().getBundle(OpenCms.getWorkplaceManager().getWorkp... | java | public static String wrapProjectName(CmsObject cms, String name) {
return Messages.get().getBundle(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms)).key(
Messages.GUI_NORMAL_PROJECT_1,
name);
} | [
"public",
"static",
"String",
"wrapProjectName",
"(",
"CmsObject",
"cms",
",",
"String",
"name",
")",
"{",
"return",
"Messages",
".",
"get",
"(",
")",
".",
"getBundle",
"(",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplaceLocale",
"(",
"cm... | Wraps the project name in a message string.<p>
@param cms the CMS context
@param name the project name
@return the message for the given project name | [
"Wraps",
"the",
"project",
"name",
"in",
"a",
"message",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/publish/CmsPublishService.java#L138-L143 |
authlete/authlete-java-common | src/main/java/com/authlete/common/api/AuthleteApiImpl.java | AuthleteApiImpl.callServiceOwnerPostApi | private <TResponse> TResponse callServiceOwnerPostApi(
String path, Object requestBody, Class<TResponse> responseClass) throws AuthleteApiException {
"""
Call an API with HTTP POST method and Service Owner credentials (without query parameters).
"""
return callServiceOwnerPostApi(path, (Map... | java | private <TResponse> TResponse callServiceOwnerPostApi(
String path, Object requestBody, Class<TResponse> responseClass) throws AuthleteApiException
{
return callServiceOwnerPostApi(path, (Map<String, String>)null, requestBody, responseClass);
} | [
"private",
"<",
"TResponse",
">",
"TResponse",
"callServiceOwnerPostApi",
"(",
"String",
"path",
",",
"Object",
"requestBody",
",",
"Class",
"<",
"TResponse",
">",
"responseClass",
")",
"throws",
"AuthleteApiException",
"{",
"return",
"callServiceOwnerPostApi",
"(",
... | Call an API with HTTP POST method and Service Owner credentials (without query parameters). | [
"Call",
"an",
"API",
"with",
"HTTP",
"POST",
"method",
"and",
"Service",
"Owner",
"credentials",
"(",
"without",
"query",
"parameters",
")",
"."
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/api/AuthleteApiImpl.java#L305-L309 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.addDateDocumentsWithIdKey | public String addDateDocumentsWithIdKey(String indexName, String indexType, List<Map> beans,String docIdKey) throws ElasticSearchException {
"""
批量创建索引,根据时间格式建立新的索引表
@param indexName
@param indexType
@param beans
@param docIdKey map中作为文档id的Key
@return
@throws ElasticSearchException
"""
return addDocume... | java | public String addDateDocumentsWithIdKey(String indexName, String indexType, List<Map> beans,String docIdKey) throws ElasticSearchException{
return addDocumentsWithIdKey(this.indexNameBuilder.getIndexName(indexName), indexType, beans,docIdKey);
} | [
"public",
"String",
"addDateDocumentsWithIdKey",
"(",
"String",
"indexName",
",",
"String",
"indexType",
",",
"List",
"<",
"Map",
">",
"beans",
",",
"String",
"docIdKey",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"addDocumentsWithIdKey",
"(",
"this",
... | 批量创建索引,根据时间格式建立新的索引表
@param indexName
@param indexType
@param beans
@param docIdKey map中作为文档id的Key
@return
@throws ElasticSearchException | [
"批量创建索引",
"根据时间格式建立新的索引表"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L324-L326 |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java | ParsedOptions.getValue | public String getValue(Option option, String defaultValue) {
"""
Retrieve the first argument, if any, of an option.
@param option the name of the option
@param defaultValue the default value to be returned if the option
is not specified
@return the value of the argument if option is set, and has an argument,... | java | public String getValue(Option option, String defaultValue) {
String answer = getValue(option);
return (answer != null ? answer : defaultValue);
} | [
"public",
"String",
"getValue",
"(",
"Option",
"option",
",",
"String",
"defaultValue",
")",
"{",
"String",
"answer",
"=",
"getValue",
"(",
"option",
")",
";",
"return",
"(",
"answer",
"!=",
"null",
"?",
"answer",
":",
"defaultValue",
")",
";",
"}"
] | Retrieve the first argument, if any, of an option.
@param option the name of the option
@param defaultValue the default value to be returned if the option
is not specified
@return the value of the argument if option is set, and has an argument,
otherwise {@code defaultValue} | [
"Retrieve",
"the",
"first",
"argument",
"if",
"any",
"of",
"an",
"option",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java#L258-L261 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java | CommonOps_DDF5.elementMult | public static void elementMult( DMatrix5x5 a , DMatrix5x5 b , DMatrix5x5 c ) {
"""
<p>Performs an element by element multiplication operation:<br>
<br>
c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix i... | java | public static void elementMult( DMatrix5x5 a , DMatrix5x5 b , DMatrix5x5 c ) {
c.a11 = a.a11*b.a11; c.a12 = a.a12*b.a12; c.a13 = a.a13*b.a13; c.a14 = a.a14*b.a14; c.a15 = a.a15*b.a15;
c.a21 = a.a21*b.a21; c.a22 = a.a22*b.a22; c.a23 = a.a23*b.a23; c.a24 = a.a24*b.a24; c.a25 = a.a25*b.a25;
c.a31 =... | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrix5x5",
"a",
",",
"DMatrix5x5",
"b",
",",
"DMatrix5x5",
"c",
")",
"{",
"c",
".",
"a11",
"=",
"a",
".",
"a11",
"*",
"b",
".",
"a11",
";",
"c",
".",
"a12",
"=",
"a",
".",
"a12",
"*",
"b",
".",... | <p>Performs an element by element multiplication operation:<br>
<br>
c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c Where the results of the operation are... | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"multiplication",
"operation",
":",
"<br",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"*",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
"<br",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java#L1635-L1641 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheEventListenerConfigurationBuilder.java | CacheEventListenerConfigurationBuilder.newEventListenerConfiguration | public static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(
Class<? extends CacheEventListener<?, ?>> listenerClass, EventType eventType, EventType... eventTypes) {
"""
Creates a new builder instance using the given {@link CacheEventListener} subclass and the {@link EventType}s it
wi... | java | public static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(
Class<? extends CacheEventListener<?, ?>> listenerClass, EventType eventType, EventType... eventTypes){
return new CacheEventListenerConfigurationBuilder(EnumSet.of(eventType, eventTypes), listenerClass);
} | [
"public",
"static",
"CacheEventListenerConfigurationBuilder",
"newEventListenerConfiguration",
"(",
"Class",
"<",
"?",
"extends",
"CacheEventListener",
"<",
"?",
",",
"?",
">",
">",
"listenerClass",
",",
"EventType",
"eventType",
",",
"EventType",
"...",
"eventTypes",
... | Creates a new builder instance using the given {@link CacheEventListener} subclass and the {@link EventType}s it
will listen to.
<p>
<ul>
<li>{@link EventOrdering} defaults to {@link EventOrdering#UNORDERED}</li>
<li>{@link EventFiring} defaults to {@link EventFiring#ASYNCHRONOUS}</li>
</ul>
@param listenerClass the {... | [
"Creates",
"a",
"new",
"builder",
"instance",
"using",
"the",
"given",
"{",
"@link",
"CacheEventListener",
"}",
"subclass",
"and",
"the",
"{",
"@link",
"EventType",
"}",
"s",
"it",
"will",
"listen",
"to",
".",
"<p",
">",
"<ul",
">",
"<li",
">",
"{",
"@... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheEventListenerConfigurationBuilder.java#L81-L84 |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalBoolean | private Boolean readOptionalBoolean(JSONObject json, String key) {
"""
Read an optional boolean value form a JSON Object.
@param json the JSON object to read from.
@param key the key for the boolean value in the provided JSON object.
@return the boolean or null if reading the boolean fails.
"""
try... | java | private Boolean readOptionalBoolean(JSONObject json, String key) {
try {
return Boolean.valueOf(json.getBoolean(key));
} catch (JSONException e) {
LOG.debug("Reading optional JSON boolean failed. Default to provided default value.", e);
}
return null;
} | [
"private",
"Boolean",
"readOptionalBoolean",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"Boolean",
".",
"valueOf",
"(",
"json",
".",
"getBoolean",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",
"JSONException",
"e",
"... | Read an optional boolean value form a JSON Object.
@param json the JSON object to read from.
@param key the key for the boolean value in the provided JSON object.
@return the boolean or null if reading the boolean fails. | [
"Read",
"an",
"optional",
"boolean",
"value",
"form",
"a",
"JSON",
"Object",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L317-L325 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildContents | public void buildContents(XMLNode node, Content contentTree) {
"""
Build the list of packages.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the content list will be added
"""
Content contentListTree = writer.getContentsHeader()... | java | public void buildContents(XMLNode node, Content contentTree) {
Content contentListTree = writer.getContentsHeader();
printedPackageHeaders.clear();
for (PackageElement pkg : configuration.packages) {
if (hasConstantField(pkg) && !hasPrintedPackageIndex(pkg)) {
writer.... | [
"public",
"void",
"buildContents",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"Content",
"contentListTree",
"=",
"writer",
".",
"getContentsHeader",
"(",
")",
";",
"printedPackageHeaders",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Package... | Build the list of packages.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the content list will be added | [
"Build",
"the",
"list",
"of",
"packages",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java#L167-L176 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSgpsvInterleavedBatch_bufferSizeExt | public static int cusparseSgpsvInterleavedBatch_bufferSizeExt(
cusparseHandle handle,
int algo,
int m,
Pointer ds,
Pointer dl,
Pointer d,
Pointer du,
Pointer dw,
Pointer x,
int batchCount,
long[] pBufferSizeInBy... | java | public static int cusparseSgpsvInterleavedBatch_bufferSizeExt(
cusparseHandle handle,
int algo,
int m,
Pointer ds,
Pointer dl,
Pointer d,
Pointer du,
Pointer dw,
Pointer x,
int batchCount,
long[] pBufferSizeInBy... | [
"public",
"static",
"int",
"cusparseSgpsvInterleavedBatch_bufferSizeExt",
"(",
"cusparseHandle",
"handle",
",",
"int",
"algo",
",",
"int",
"m",
",",
"Pointer",
"ds",
",",
"Pointer",
"dl",
",",
"Pointer",
"d",
",",
"Pointer",
"du",
",",
"Pointer",
"dw",
",",
... | <pre>
Description: Solution of pentadiagonal linear system A * X = B,
with multiple right-hand-sides. The coefficient matrix A is
composed of lower (ds, dl), main (d) and upper (du, dw) diagonals, and
the right-hand-sides B are overwritten with the solution X.
</pre> | [
"<pre",
">",
"Description",
":",
"Solution",
"of",
"pentadiagonal",
"linear",
"system",
"A",
"*",
"X",
"=",
"B",
"with",
"multiple",
"right",
"-",
"hand",
"-",
"sides",
".",
"The",
"coefficient",
"matrix",
"A",
"is",
"composed",
"of",
"lower",
"(",
"ds",... | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L9119-L9133 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/TransactionImpl.java | TransactionImpl.tryLock | public boolean tryLock(Object obj, int lockMode) {
"""
Upgrade the lock on the given object to the given lock mode. Method <code>
tryLock</code> is the same as <code>lock</code> except it returns a boolean
indicating whether the lock was granted instead of generating an exception.
@param obj Descripti... | java | public boolean tryLock(Object obj, int lockMode)
{
if (log.isDebugEnabled()) log.debug("Try to lock object was called on tx " + this);
checkOpen();
try
{
lock(obj, lockMode);
return true;
}
catch (LockNotGrantedException ex)
{... | [
"public",
"boolean",
"tryLock",
"(",
"Object",
"obj",
",",
"int",
"lockMode",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"Try to lock object was called on tx \"",
"+",
"this",
")",
";",
"checkOpen",
"(",
"... | Upgrade the lock on the given object to the given lock mode. Method <code>
tryLock</code> is the same as <code>lock</code> except it returns a boolean
indicating whether the lock was granted instead of generating an exception.
@param obj Description of Parameter
@param lockMode Description of Parameter
@... | [
"Upgrade",
"the",
"lock",
"on",
"the",
"given",
"object",
"to",
"the",
"given",
"lock",
"mode",
".",
"Method",
"<code",
">",
"tryLock<",
"/",
"code",
">",
"is",
"the",
"same",
"as",
"<code",
">",
"lock<",
"/",
"code",
">",
"except",
"it",
"returns",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L659-L672 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/Client.java | Client.recoverOrInitializeState | public Completable recoverOrInitializeState(final StateFormat format, final byte[] persistedState,
final StreamFrom from, final StreamTo to) {
"""
Recovers or initializes the {@link SessionState}.
<p>
This method is a convience wrapper around initialization and recov... | java | public Completable recoverOrInitializeState(final StateFormat format, final byte[] persistedState,
final StreamFrom from, final StreamTo to) {
if (persistedState == null || persistedState.length == 0) {
return initializeState(from, to);
} else {
return r... | [
"public",
"Completable",
"recoverOrInitializeState",
"(",
"final",
"StateFormat",
"format",
",",
"final",
"byte",
"[",
"]",
"persistedState",
",",
"final",
"StreamFrom",
"from",
",",
"final",
"StreamTo",
"to",
")",
"{",
"if",
"(",
"persistedState",
"==",
"null",... | Recovers or initializes the {@link SessionState}.
<p>
This method is a convience wrapper around initialization and recovery. It combines both methods and
checks if the persisted state byte array is null or empty and if so it starts with the params given. If
it is not empty it recovers from there. This acknowledges the ... | [
"Recovers",
"or",
"initializes",
"the",
"{",
"@link",
"SessionState",
"}",
".",
"<p",
">",
"This",
"method",
"is",
"a",
"convience",
"wrapper",
"around",
"initialization",
"and",
"recovery",
".",
"It",
"combines",
"both",
"methods",
"and",
"checks",
"if",
"t... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/Client.java#L636-L643 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/util/ContentMetadata.java | ContentMetadata.addCustomMetadata | public ContentMetadata addCustomMetadata(String key, String value) {
"""
Adds any custom metadata associated with the qualifying content item
@param key Name of the custom data
@param value Value for the custom data
@return {@link ContentMetadata} object for method chaining
"""
customMetadata.pu... | java | public ContentMetadata addCustomMetadata(String key, String value) {
customMetadata.put(key, value);
return this;
} | [
"public",
"ContentMetadata",
"addCustomMetadata",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"customMetadata",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds any custom metadata associated with the qualifying content item
@param key Name of the custom data
@param value Value for the custom data
@return {@link ContentMetadata} object for method chaining | [
"Adds",
"any",
"custom",
"metadata",
"associated",
"with",
"the",
"qualifying",
"content",
"item"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/ContentMetadata.java#L156-L159 |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/TagLink.java | TagLink.getMinStringSize | private double getMinStringSize(String[] tTokens, String[] uTokens) {
"""
getMinStringSize count the number of characters in String array tTokens and
String array uTokens and return the minimun size.
@param tTokens String[]
@param uTokens String[]
@return double
"""
double tSize = 0, uSize = 0;
... | java | private double getMinStringSize(String[] tTokens, String[] uTokens) {
double tSize = 0, uSize = 0;
for (int i = 0; i < tTokens.length; i++) {
tSize += tTokens[i].length();
}
for (int i = 0; i < uTokens.length; i++) {
uSize += uTokens[i].length();
}
return Math.min(tSize, uSiz... | [
"private",
"double",
"getMinStringSize",
"(",
"String",
"[",
"]",
"tTokens",
",",
"String",
"[",
"]",
"uTokens",
")",
"{",
"double",
"tSize",
"=",
"0",
",",
"uSize",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tTokens",
".",
... | getMinStringSize count the number of characters in String array tTokens and
String array uTokens and return the minimun size.
@param tTokens String[]
@param uTokens String[]
@return double | [
"getMinStringSize",
"count",
"the",
"number",
"of",
"characters",
"in",
"String",
"array",
"tTokens",
"and",
"String",
"array",
"uTokens",
"and",
"return",
"the",
"minimun",
"size",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/TagLink.java#L102-L111 |
gresrun/jesque | src/main/java/net/greghaines/jesque/Job.java | Job.setUnknownFields | @JsonIgnore
public void setUnknownFields(final Map<String,Object> unknownFields) {
"""
Set all unknown fields
@param unknownFields the new unknown fields
"""
this.unknownFields.clear();
this.unknownFields.putAll(unknownFields);
} | java | @JsonIgnore
public void setUnknownFields(final Map<String,Object> unknownFields) {
this.unknownFields.clear();
this.unknownFields.putAll(unknownFields);
} | [
"@",
"JsonIgnore",
"public",
"void",
"setUnknownFields",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"unknownFields",
")",
"{",
"this",
".",
"unknownFields",
".",
"clear",
"(",
")",
";",
"this",
".",
"unknownFields",
".",
"putAll",
"(",
"unknow... | Set all unknown fields
@param unknownFields the new unknown fields | [
"Set",
"all",
"unknown",
"fields"
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/Job.java#L249-L253 |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java | ServerModelStore.changeValueCommand | @Deprecated
public static void changeValueCommand(final List<Command> response, final ServerAttribute attribute, final Object value) {
"""
Convenience method to change an attribute value on the server side.
@param response must not be null or the method silently ignores the call
@param attribute must not ... | java | @Deprecated
public static void changeValueCommand(final List<Command> response, final ServerAttribute attribute, final Object value) {
if (response == null) {
return;
}
if (attribute == null) {
LOG.error("Cannot change value on a null attribute to '{}'", value);
... | [
"@",
"Deprecated",
"public",
"static",
"void",
"changeValueCommand",
"(",
"final",
"List",
"<",
"Command",
">",
"response",
",",
"final",
"ServerAttribute",
"attribute",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{"... | Convenience method to change an attribute value on the server side.
@param response must not be null or the method silently ignores the call
@param attribute must not be null | [
"Convenience",
"method",
"to",
"change",
"an",
"attribute",
"value",
"on",
"the",
"server",
"side",
"."
] | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java#L158-L168 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/parsers/JSONPathParser.java | JSONPathParser.parseToMap | @Override
public Map<String, Object> parseToMap(String input) {
"""
@param input JSON string. The root must be a JSON object, not an array.
e.g., {"valid": "true"} and {"valid":[1,2,3]} are supported
but [{"invalid": "true"}] and [1,2,3] are not.
@return A map of field names and values
"""
try {
... | java | @Override
public Map<String, Object> parseToMap(String input)
{
try {
JsonNode document = mapper.readValue(input, JsonNode.class);
return flattener.flatten(document);
}
catch (Exception e) {
throw new ParseException(e, "Unable to parse row [%s]", input);
}
} | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"parseToMap",
"(",
"String",
"input",
")",
"{",
"try",
"{",
"JsonNode",
"document",
"=",
"mapper",
".",
"readValue",
"(",
"input",
",",
"JsonNode",
".",
"class",
")",
";",
"return",
"... | @param input JSON string. The root must be a JSON object, not an array.
e.g., {"valid": "true"} and {"valid":[1,2,3]} are supported
but [{"invalid": "true"}] and [1,2,3] are not.
@return A map of field names and values | [
"@param",
"input",
"JSON",
"string",
".",
"The",
"root",
"must",
"be",
"a",
"JSON",
"object",
"not",
"an",
"array",
".",
"e",
".",
"g",
".",
"{",
"valid",
":",
"true",
"}",
"and",
"{",
"valid",
":",
"[",
"1",
"2",
"3",
"]",
"}",
"are",
"support... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/parsers/JSONPathParser.java#L66-L76 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDictionary.java | MutableDictionary.setBoolean | @NonNull
@Override
public MutableDictionary setBoolean(@NonNull String key, boolean value) {
"""
Set a boolean value for the given key.
@param key The key
@param value The boolean value.
@return The self object.
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDictionary setBoolean(@NonNull String key, boolean value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDictionary",
"setBoolean",
"(",
"@",
"NonNull",
"String",
"key",
",",
"boolean",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a boolean value for the given key.
@param key The key
@param value The boolean value.
@return The self object. | [
"Set",
"a",
"boolean",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDictionary.java#L195-L199 |
meertensinstituut/mtas | src/main/java/mtas/analysis/parser/MtasBasicParser.java | MtasBasicParser.checkForVariables | private boolean checkForVariables(List<Map<String, String>> values) {
"""
Check for variables.
@param values the values
@return true, if successful
"""
if (values == null || values.isEmpty()) {
return false;
} else {
for (Map<String, String> list : values) {
if (list.containsKey... | java | private boolean checkForVariables(List<Map<String, String>> values) {
if (values == null || values.isEmpty()) {
return false;
} else {
for (Map<String, String> list : values) {
if (list.containsKey("type") && list.get("type")
.equals(MtasParserMapping.PARSER_TYPE_VARIABLE)) {
... | [
"private",
"boolean",
"checkForVariables",
"(",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"else"... | Check for variables.
@param values the values
@return true, if successful | [
"Check",
"for",
"variables",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L655-L667 |
PuyallupFoursquare/ccb-api-client-java | src/main/java/com/p4square/ccbapi/model/GetIndividualProfilesRequest.java | GetIndividualProfilesRequest.withMICR | public GetIndividualProfilesRequest withMICR(final String routingNumber, final String accountNumber) {
"""
Request the IndividualProfile for the given bank account information.
This option is mutually exclusive with {@link #withIndividualId(int)}
and {@link #withLoginPassword(String, char[])}.
@param routin... | java | public GetIndividualProfilesRequest withMICR(final String routingNumber, final String accountNumber) {
this.routingNumber = routingNumber;
this.accountNumber = accountNumber;
return this;
} | [
"public",
"GetIndividualProfilesRequest",
"withMICR",
"(",
"final",
"String",
"routingNumber",
",",
"final",
"String",
"accountNumber",
")",
"{",
"this",
".",
"routingNumber",
"=",
"routingNumber",
";",
"this",
".",
"accountNumber",
"=",
"accountNumber",
";",
"retur... | Request the IndividualProfile for the given bank account information.
This option is mutually exclusive with {@link #withIndividualId(int)}
and {@link #withLoginPassword(String, char[])}.
@param routingNumber The individual's bank routing number.
@param accountNumber The individual's bank account number.
@return this... | [
"Request",
"the",
"IndividualProfile",
"for",
"the",
"given",
"bank",
"account",
"information",
"."
] | train | https://github.com/PuyallupFoursquare/ccb-api-client-java/blob/54a7a3184dc565fe513aa520e1344b2303ea6834/src/main/java/com/p4square/ccbapi/model/GetIndividualProfilesRequest.java#L92-L96 |
fabiomaffioletti/jsondoc | jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/AbstractSpringJSONDocScanner.java | AbstractSpringJSONDocScanner.mergeApiDoc | @Override
public ApiDoc mergeApiDoc(Class<?> controller, ApiDoc apiDoc) {
"""
Once the ApiDoc has been initialized and filled with other data (version,
auth, etc) it's time to merge the documentation with JSONDoc annotation,
if existing.
"""
ApiDoc jsondocApiDoc = JSONDocApiDocBuilder.build(controller);
... | java | @Override
public ApiDoc mergeApiDoc(Class<?> controller, ApiDoc apiDoc) {
ApiDoc jsondocApiDoc = JSONDocApiDocBuilder.build(controller);
BeanUtils.copyProperties(jsondocApiDoc, apiDoc, new String[] { "methods", "supportedversions", "auth" });
return apiDoc;
} | [
"@",
"Override",
"public",
"ApiDoc",
"mergeApiDoc",
"(",
"Class",
"<",
"?",
">",
"controller",
",",
"ApiDoc",
"apiDoc",
")",
"{",
"ApiDoc",
"jsondocApiDoc",
"=",
"JSONDocApiDocBuilder",
".",
"build",
"(",
"controller",
")",
";",
"BeanUtils",
".",
"copyProperti... | Once the ApiDoc has been initialized and filled with other data (version,
auth, etc) it's time to merge the documentation with JSONDoc annotation,
if existing. | [
"Once",
"the",
"ApiDoc",
"has",
"been",
"initialized",
"and",
"filled",
"with",
"other",
"data",
"(",
"version",
"auth",
"etc",
")",
"it",
"s",
"time",
"to",
"merge",
"the",
"documentation",
"with",
"JSONDoc",
"annotation",
"if",
"existing",
"."
] | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/AbstractSpringJSONDocScanner.java#L219-L224 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Base64Encoder.java | Base64Encoder.encodeUrlSafe | public static String encodeUrlSafe(byte[] source, String charset) {
"""
base64编码,URL安全的
@param source 被编码的base64字符串
@param charset 字符集
@return 被加密后的字符串
@since 3.0.6
"""
return StrUtil.str(encodeUrlSafe(source, false), charset);
} | java | public static String encodeUrlSafe(byte[] source, String charset) {
return StrUtil.str(encodeUrlSafe(source, false), charset);
} | [
"public",
"static",
"String",
"encodeUrlSafe",
"(",
"byte",
"[",
"]",
"source",
",",
"String",
"charset",
")",
"{",
"return",
"StrUtil",
".",
"str",
"(",
"encodeUrlSafe",
"(",
"source",
",",
"false",
")",
",",
"charset",
")",
";",
"}"
] | base64编码,URL安全的
@param source 被编码的base64字符串
@param charset 字符集
@return 被加密后的字符串
@since 3.0.6 | [
"base64编码,URL安全的"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base64Encoder.java#L154-L156 |
apache/incubator-shardingsphere | sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLBuilder.java | SQLBuilder.toSQL | public String toSQL(final MasterSlaveRule masterSlaveRule, final ShardingDataSourceMetaData shardingDataSourceMetaData) {
"""
Convert to SQL unit.
@param masterSlaveRule master slave rule
@param shardingDataSourceMetaData sharding data source meta data
@return SQL
"""
StringBuilder result = new St... | java | public String toSQL(final MasterSlaveRule masterSlaveRule, final ShardingDataSourceMetaData shardingDataSourceMetaData) {
StringBuilder result = new StringBuilder();
for (Object each : segments) {
if (each instanceof SchemaPlaceholder) {
result.append(shardingDataSourceMetaDa... | [
"public",
"String",
"toSQL",
"(",
"final",
"MasterSlaveRule",
"masterSlaveRule",
",",
"final",
"ShardingDataSourceMetaData",
"shardingDataSourceMetaData",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Object",
"each",
... | Convert to SQL unit.
@param masterSlaveRule master slave rule
@param shardingDataSourceMetaData sharding data source meta data
@return SQL | [
"Convert",
"to",
"SQL",
"unit",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLBuilder.java#L131-L141 |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java | ImmutableMatrixFactory.createVector | public static ImmutableVector3 createVector(final double x, final double y, final double z) {
"""
Creates a new immutable 3D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@param z the z coordinate of the new vector
@return the new vector
"""
retu... | java | public static ImmutableVector3 createVector(final double x, final double y, final double z) {
return new ImmutableVector3(new ImmutableData(3, 1) {
@Override
public double getQuick(int row, int col) {
switch (row) {
case 0:
return x;
case 1:
return y;
default:
return z;
... | [
"public",
"static",
"ImmutableVector3",
"createVector",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
",",
"final",
"double",
"z",
")",
"{",
"return",
"new",
"ImmutableVector3",
"(",
"new",
"ImmutableData",
"(",
"3",
",",
"1",
")",
"{",
"@",
... | Creates a new immutable 3D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@param z the z coordinate of the new vector
@return the new vector | [
"Creates",
"a",
"new",
"immutable",
"3D",
"column",
"vector",
"."
] | train | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java#L44-L58 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallPolicyDefinitionSummary | public static PolicyDefinitionSummaryBean unmarshallPolicyDefinitionSummary(Map<String, Object> map) {
"""
Unmarshals the given map source into a bean.
@param map the search map
@return the policy definition summary
"""
PolicyDefinitionSummaryBean bean = new PolicyDefinitionSummaryBean();
bea... | java | public static PolicyDefinitionSummaryBean unmarshallPolicyDefinitionSummary(Map<String, Object> map) {
PolicyDefinitionSummaryBean bean = new PolicyDefinitionSummaryBean();
bean.setId(asString(map.get("id")));
bean.setName(asString(map.get("name")));
if (map.containsKey("description")) {... | [
"public",
"static",
"PolicyDefinitionSummaryBean",
"unmarshallPolicyDefinitionSummary",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"PolicyDefinitionSummaryBean",
"bean",
"=",
"new",
"PolicyDefinitionSummaryBean",
"(",
")",
";",
"bean",
".",
"setId... | Unmarshals the given map source into a bean.
@param map the search map
@return the policy definition summary | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1283-L1303 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.pullFromRepository | public PullResult pullFromRepository(final Git git, final String remote, String remoteBranch, final String passphrase,
final Path privateKey) {
"""
Pull repository from current branch and remote branch with same name as current
@param git
instance.
@param remote
to be used.
@param remoteBranch
to u... | java | public PullResult pullFromRepository(final Git git, final String remote, String remoteBranch, final String passphrase,
final Path privateKey) {
SshSessionFactory sshSessionFactory = new JschConfigSessionFactory() {
@Override
protected void configure(OpenSshConfig.Host host, Sessi... | [
"public",
"PullResult",
"pullFromRepository",
"(",
"final",
"Git",
"git",
",",
"final",
"String",
"remote",
",",
"String",
"remoteBranch",
",",
"final",
"String",
"passphrase",
",",
"final",
"Path",
"privateKey",
")",
"{",
"SshSessionFactory",
"sshSessionFactory",
... | Pull repository from current branch and remote branch with same name as current
@param git
instance.
@param remote
to be used.
@param remoteBranch
to use.
@param passphrase
to access private key.
@param privateKey
file location. | [
"Pull",
"repository",
"from",
"current",
"branch",
"and",
"remote",
"branch",
"with",
"same",
"name",
"as",
"current"
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L427-L459 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java | ELHelper.processLdapSearchScope | protected LdapSearchScope processLdapSearchScope(String name, String expression, LdapSearchScope value, boolean immediateOnly) {
"""
This method will process a configuration value for LdapSearchScope setting in
{@link LdapIdentityStoreDefinition}. It will first check to see if there is an
EL expression. It there... | java | protected LdapSearchScope processLdapSearchScope(String name, String expression, LdapSearchScope value, boolean immediateOnly) {
LdapSearchScope result;
boolean immediate = false;
/*
* The expression language value takes precedence over the direct setting.
*/
if (expre... | [
"protected",
"LdapSearchScope",
"processLdapSearchScope",
"(",
"String",
"name",
",",
"String",
"expression",
",",
"LdapSearchScope",
"value",
",",
"boolean",
"immediateOnly",
")",
"{",
"LdapSearchScope",
"result",
";",
"boolean",
"immediate",
"=",
"false",
";",
"/*... | This method will process a configuration value for LdapSearchScope setting in
{@link LdapIdentityStoreDefinition}. It will first check to see if there is an
EL expression. It there is, it will return the evaluated expression; otherwise, it
will return the non-EL value.
@param name The name of the property. Used for er... | [
"This",
"method",
"will",
"process",
"a",
"configuration",
"value",
"for",
"LdapSearchScope",
"setting",
"in",
"{",
"@link",
"LdapIdentityStoreDefinition",
"}",
".",
"It",
"will",
"first",
"check",
"to",
"see",
"if",
"there",
"is",
"an",
"EL",
"expression",
".... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java#L188-L217 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlTimer.java | HsqlTimer.setPeriod | public static Object setPeriod(final Object task, final long period) {
"""
Sets the periodicity of the designated task to a new value. <p>
If the designated task is cancelled or the new period is identical to the
task's current period, then this invocation has essentially no effect
and the submitted object is... | java | public static Object setPeriod(final Object task, final long period) {
return (task instanceof Task) ? ((Task) task).setPeriod(period)
: task;
} | [
"public",
"static",
"Object",
"setPeriod",
"(",
"final",
"Object",
"task",
",",
"final",
"long",
"period",
")",
"{",
"return",
"(",
"task",
"instanceof",
"Task",
")",
"?",
"(",
"(",
"Task",
")",
"task",
")",
".",
"setPeriod",
"(",
"period",
")",
":",
... | Sets the periodicity of the designated task to a new value. <p>
If the designated task is cancelled or the new period is identical to the
task's current period, then this invocation has essentially no effect
and the submitted object is returned. <p>
Otherwise, if the new period is greater than the designated task's
c... | [
"Sets",
"the",
"periodicity",
"of",
"the",
"designated",
"task",
"to",
"a",
"new",
"value",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlTimer.java#L427-L430 |
spotify/ssh-agent-proxy | src/main/java/com/spotify/sshagentproxy/AgentOutput.java | AgentOutput.writeField | private static void writeField(final OutputStream out, final int num) throws IOException {
"""
Convert int to a big-endian byte array containing the minimum number of bytes required to
represent it. Write those bytes to an {@link OutputStream}.
@param out {@link OutputStream}
@param num int
"""
final by... | java | private static void writeField(final OutputStream out, final int num) throws IOException {
final byte[] bytes = BigInteger.valueOf(num).toByteArray();
writeField(out, bytes);
} | [
"private",
"static",
"void",
"writeField",
"(",
"final",
"OutputStream",
"out",
",",
"final",
"int",
"num",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"BigInteger",
".",
"valueOf",
"(",
"num",
")",
".",
"toByteArray",
"(",
... | Convert int to a big-endian byte array containing the minimum number of bytes required to
represent it. Write those bytes to an {@link OutputStream}.
@param out {@link OutputStream}
@param num int | [
"Convert",
"int",
"to",
"a",
"big",
"-",
"endian",
"byte",
"array",
"containing",
"the",
"minimum",
"number",
"of",
"bytes",
"required",
"to",
"represent",
"it",
".",
"Write",
"those",
"bytes",
"to",
"an",
"{"
] | train | https://github.com/spotify/ssh-agent-proxy/blob/b678792750c0157bd5ed3fb6a18895ff95effbc4/src/main/java/com/spotify/sshagentproxy/AgentOutput.java#L86-L89 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java | GasteigerPEPEPartialCharges.getElectrostaticPotentialN | private double getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds) {
"""
get the electrostatic potential of the neighbours of a atom.
@param ac The IAtomContainer to study
@param ds
@param atom1 The position of the IAtom to study
@return The sum of electrostatic potential of the neigh... | java | private double getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds) {
// double CoulombForceConstant = 1/(4*Math.PI*8.81/*Math.pow(10, -12)*/);
double CoulombForceConstant = 0.048;
double sum = 0.0;
try {
if (factory == null)
factory = AtomT... | [
"private",
"double",
"getElectrostaticPotentialN",
"(",
"IAtomContainer",
"ac",
",",
"int",
"atom1",
",",
"double",
"[",
"]",
"ds",
")",
"{",
"//\t\tdouble CoulombForceConstant = 1/(4*Math.PI*8.81/*Math.pow(10, -12)*/);",
"double",
"CoulombForceConstant",
"=",
"0.048",
";",... | get the electrostatic potential of the neighbours of a atom.
@param ac The IAtomContainer to study
@param ds
@param atom1 The position of the IAtom to study
@return The sum of electrostatic potential of the neighbours | [
"get",
"the",
"electrostatic",
"potential",
"of",
"the",
"neighbours",
"of",
"a",
"atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L594-L621 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/output/PangoolMultipleOutputs.java | PangoolMultipleOutputs.setSpecificNamedOutputContext | public static void setSpecificNamedOutputContext(Configuration conf, Job job, String namedOutput) {
"""
Iterates over the Configuration and sets the specific context found for the namedOutput in the Job instance.
Package-access so it can be unit tested. The specific context is configured in method this.
{@link #... | java | public static void setSpecificNamedOutputContext(Configuration conf, Job job, String namedOutput) {
for(Map.Entry<String, String> entries : conf) {
String confKey = entries.getKey();
String confValue = entries.getValue();
if(confKey.startsWith(MO_PREFIX + namedOutput + CONF)) {
// Specific context key, v... | [
"public",
"static",
"void",
"setSpecificNamedOutputContext",
"(",
"Configuration",
"conf",
",",
"Job",
"job",
",",
"String",
"namedOutput",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entries",
":",
"conf",
")",
"{",
"Str... | Iterates over the Configuration and sets the specific context found for the namedOutput in the Job instance.
Package-access so it can be unit tested. The specific context is configured in method this.
{@link #addNamedOutputContext(Job, String, String, String)}.
@param conf
The configuration that may contain specific c... | [
"Iterates",
"over",
"the",
"Configuration",
"and",
"sets",
"the",
"specific",
"context",
"found",
"for",
"the",
"namedOutput",
"in",
"the",
"Job",
"instance",
".",
"Package",
"-",
"access",
"so",
"it",
"can",
"be",
"unit",
"tested",
".",
"The",
"specific",
... | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/output/PangoolMultipleOutputs.java#L255-L273 |
haifengl/smile | core/src/main/java/smile/association/TotalSupportTree.java | TotalSupportTree.getSupport | public int getSupport(int[] itemset) {
"""
Returns the support value for the given item set.
@param itemset the given item set. The items in the set has to be in the
descending order according to their frequency.
@return the support value (0 if not found)
"""
if (root.children != null) {
... | java | public int getSupport(int[] itemset) {
if (root.children != null) {
return getSupport(itemset, itemset.length - 1, root);
} else {
return 0;
}
} | [
"public",
"int",
"getSupport",
"(",
"int",
"[",
"]",
"itemset",
")",
"{",
"if",
"(",
"root",
".",
"children",
"!=",
"null",
")",
"{",
"return",
"getSupport",
"(",
"itemset",
",",
"itemset",
".",
"length",
"-",
"1",
",",
"root",
")",
";",
"}",
"else... | Returns the support value for the given item set.
@param itemset the given item set. The items in the set has to be in the
descending order according to their frequency.
@return the support value (0 if not found) | [
"Returns",
"the",
"support",
"value",
"for",
"the",
"given",
"item",
"set",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/TotalSupportTree.java#L131-L137 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/WebSiteRequest.java | WebSiteRequest.getURL | public String getURL(String url, Object optParam) throws IOException {
"""
Gets the URL String with the given parameters embedded, keeping the current settings.
@param url the context-relative URL, with a beginning slash
@param optParam any number of additional parameters. This parameter ca... | java | public String getURL(String url, Object optParam) throws IOException {
return getURL(url, optParam, true);
} | [
"public",
"String",
"getURL",
"(",
"String",
"url",
",",
"Object",
"optParam",
")",
"throws",
"IOException",
"{",
"return",
"getURL",
"(",
"url",
",",
"optParam",
",",
"true",
")",
";",
"}"
] | Gets the URL String with the given parameters embedded, keeping the current settings.
@param url the context-relative URL, with a beginning slash
@param optParam any number of additional parameters. This parameter can accept several types of
objects. The following is a list of supported objects an... | [
"Gets",
"the",
"URL",
"String",
"with",
"the",
"given",
"parameters",
"embedded",
"keeping",
"the",
"current",
"settings",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L477-L479 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.getDHOffset | public int getDHOffset(int algorithm, byte[] handshake, int bufferOffset) {
"""
Returns the DH offset from an array of bytes.
@param algorithm validation algorithm
@param handshake handshake sequence
@param bufferOffset buffer offset
@return DH offset
"""
switch (algorithm) {
case 1... | java | public int getDHOffset(int algorithm, byte[] handshake, int bufferOffset) {
switch (algorithm) {
case 1:
return getDHOffset2(handshake, bufferOffset);
default:
case 0:
return getDHOffset1(handshake, bufferOffset);
}
} | [
"public",
"int",
"getDHOffset",
"(",
"int",
"algorithm",
",",
"byte",
"[",
"]",
"handshake",
",",
"int",
"bufferOffset",
")",
"{",
"switch",
"(",
"algorithm",
")",
"{",
"case",
"1",
":",
"return",
"getDHOffset2",
"(",
"handshake",
",",
"bufferOffset",
")",... | Returns the DH offset from an array of bytes.
@param algorithm validation algorithm
@param handshake handshake sequence
@param bufferOffset buffer offset
@return DH offset | [
"Returns",
"the",
"DH",
"offset",
"from",
"an",
"array",
"of",
"bytes",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L427-L435 |
BroadleafCommerce/blc-paypal | src/main/java/org/broadleafcommerce/vendor/paypal/service/PayPalAgreementTokenServiceImpl.java | PayPalAgreementTokenServiceImpl.createPayPalAgreementTokenForCurrentOrder | @Override
public AgreementToken createPayPalAgreementTokenForCurrentOrder(boolean performCheckoutOnReturn) throws PaymentException {
"""
To support PayPal Reference Transactions and Billing Agreement Tokens
{@see https://developer.paypal.com/docs/limited-release/reference-transactions}
@param performChecko... | java | @Override
public AgreementToken createPayPalAgreementTokenForCurrentOrder(boolean performCheckoutOnReturn) throws PaymentException {
PaymentRequestDTO paymentRequestDTO = getPaymentRequestForCurrentOrder();
// Create Agreement Token
String agreementDescription = constructAgreementDescriptio... | [
"@",
"Override",
"public",
"AgreementToken",
"createPayPalAgreementTokenForCurrentOrder",
"(",
"boolean",
"performCheckoutOnReturn",
")",
"throws",
"PaymentException",
"{",
"PaymentRequestDTO",
"paymentRequestDTO",
"=",
"getPaymentRequestForCurrentOrder",
"(",
")",
";",
"// Cre... | To support PayPal Reference Transactions and Billing Agreement Tokens
{@see https://developer.paypal.com/docs/limited-release/reference-transactions}
@param performCheckoutOnReturn
@return
@throws PaymentException | [
"To",
"support",
"PayPal",
"Reference",
"Transactions",
"and",
"Billing",
"Agreement",
"Tokens",
"{",
"@see",
"https",
":",
"//",
"developer",
".",
"paypal",
".",
"com",
"/",
"docs",
"/",
"limited",
"-",
"release",
"/",
"reference",
"-",
"transactions",
"}"
... | train | https://github.com/BroadleafCommerce/blc-paypal/blob/2b38e25722411f136f9012c030519013f6cb010a/src/main/java/org/broadleafcommerce/vendor/paypal/service/PayPalAgreementTokenServiceImpl.java#L55-L65 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CronScheduleBuilder.java | CronScheduleBuilder.dailyAtHourAndMinute | @Nonnull
public static CronScheduleBuilder dailyAtHourAndMinute (final int hour, final int minute) {
"""
Create a CronScheduleBuilder with a cron-expression that sets the schedule
to fire every day at the given time (hour and minute).
@param hour
the hour of day to fire
@param minute
the minute of the giv... | java | @Nonnull
public static CronScheduleBuilder dailyAtHourAndMinute (final int hour, final int minute)
{
DateBuilder.validateHour (hour);
DateBuilder.validateMinute (minute);
final String cronExpression = "0 " + minute + " " + hour + " ? * *";
return _cronScheduleNoParseException (cronExpression);
} | [
"@",
"Nonnull",
"public",
"static",
"CronScheduleBuilder",
"dailyAtHourAndMinute",
"(",
"final",
"int",
"hour",
",",
"final",
"int",
"minute",
")",
"{",
"DateBuilder",
".",
"validateHour",
"(",
"hour",
")",
";",
"DateBuilder",
".",
"validateMinute",
"(",
"minute... | Create a CronScheduleBuilder with a cron-expression that sets the schedule
to fire every day at the given time (hour and minute).
@param hour
the hour of day to fire
@param minute
the minute of the given hour to fire
@return the new CronScheduleBuilder
@see CronExpression | [
"Create",
"a",
"CronScheduleBuilder",
"with",
"a",
"cron",
"-",
"expression",
"that",
"sets",
"the",
"schedule",
"to",
"fire",
"every",
"day",
"at",
"the",
"given",
"time",
"(",
"hour",
"and",
"minute",
")",
"."
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CronScheduleBuilder.java#L178-L187 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.