repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
lipangit/JiaoZiVideoPlayer | jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java | JZUtils.clearSavedProgress | public static void clearSavedProgress(Context context, Object url) {
if (url == null) {
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
Context.MODE_PRIVATE);
spn.edit().clear().apply();
} else {
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
Context.MODE_PRIVATE);
spn.edit().putLong("newVersion:" + url.toString(), 0).apply();
}
} | java | public static void clearSavedProgress(Context context, Object url) {
if (url == null) {
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
Context.MODE_PRIVATE);
spn.edit().clear().apply();
} else {
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
Context.MODE_PRIVATE);
spn.edit().putLong("newVersion:" + url.toString(), 0).apply();
}
} | [
"public",
"static",
"void",
"clearSavedProgress",
"(",
"Context",
"context",
",",
"Object",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"SharedPreferences",
"spn",
"=",
"context",
".",
"getSharedPreferences",
"(",
"\"JZVD_PROGRESS\"",
",",
"Cont... | if url == null, clear all progress
@param context context
@param url if url!=null clear this url progress | [
"if",
"url",
"==",
"null",
"clear",
"all",
"progress"
] | train | https://github.com/lipangit/JiaoZiVideoPlayer/blob/52c7370c131173b5ac77051029f0bd62fcf883f9/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java#L141-L151 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java | GravityUtils.getImagePosition | public static void getImagePosition(State state, Settings settings, Rect out) {
state.get(tmpMatrix);
getImagePosition(tmpMatrix, settings, out);
} | java | public static void getImagePosition(State state, Settings settings, Rect out) {
state.get(tmpMatrix);
getImagePosition(tmpMatrix, settings, out);
} | [
"public",
"static",
"void",
"getImagePosition",
"(",
"State",
"state",
",",
"Settings",
"settings",
",",
"Rect",
"out",
")",
"{",
"state",
".",
"get",
"(",
"tmpMatrix",
")",
";",
"getImagePosition",
"(",
"tmpMatrix",
",",
"settings",
",",
"out",
")",
";",
... | Calculates image position (scaled and rotated) within viewport area with gravity applied.
@param state Image state
@param settings Image settings
@param out Output rectangle | [
"Calculates",
"image",
"position",
"(",
"scaled",
"and",
"rotated",
")",
"within",
"viewport",
"area",
"with",
"gravity",
"applied",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java#L30-L33 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java | MassToFormulaTool.returnOrdered | private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) {
IMolecularFormulaSet solutions_new = null;
if (formulaSet.size() != 0) {
double valueMin = 100;
int i_final = 0;
solutions_new = formulaSet.getBuilder().newInstance(IMolecularFormulaSet.class);
List<Integer> listI = new ArrayList<Integer>();
for (int j = 0; j < formulaSet.size(); j++) {
for (int i = 0; i < formulaSet.size(); i++) {
if (listI.contains(i)) continue;
double value = MolecularFormulaManipulator.getTotalExactMass(formulaSet.getMolecularFormula(i));
double diff = Math.abs(mass - Math.abs(value));
if (valueMin > diff) {
valueMin = diff;
i_final = i;
}
}
valueMin = 100;
solutions_new.addMolecularFormula(formulaSet.getMolecularFormula(i_final));
listI.add(i_final);
}
}
return solutions_new;
} | java | private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) {
IMolecularFormulaSet solutions_new = null;
if (formulaSet.size() != 0) {
double valueMin = 100;
int i_final = 0;
solutions_new = formulaSet.getBuilder().newInstance(IMolecularFormulaSet.class);
List<Integer> listI = new ArrayList<Integer>();
for (int j = 0; j < formulaSet.size(); j++) {
for (int i = 0; i < formulaSet.size(); i++) {
if (listI.contains(i)) continue;
double value = MolecularFormulaManipulator.getTotalExactMass(formulaSet.getMolecularFormula(i));
double diff = Math.abs(mass - Math.abs(value));
if (valueMin > diff) {
valueMin = diff;
i_final = i;
}
}
valueMin = 100;
solutions_new.addMolecularFormula(formulaSet.getMolecularFormula(i_final));
listI.add(i_final);
}
}
return solutions_new;
} | [
"private",
"IMolecularFormulaSet",
"returnOrdered",
"(",
"double",
"mass",
",",
"IMolecularFormulaSet",
"formulaSet",
")",
"{",
"IMolecularFormulaSet",
"solutions_new",
"=",
"null",
";",
"if",
"(",
"formulaSet",
".",
"size",
"(",
")",
"!=",
"0",
")",
"{",
"doubl... | Return all molecular formulas but ordered according the tolerance difference between masses.
@param mass The mass to analyze
@param formulaSet The IMolecularFormulaSet to order
@return The IMolecularFormulaSet ordered | [
"Return",
"all",
"molecular",
"formulas",
"but",
"ordered",
"according",
"the",
"tolerance",
"difference",
"between",
"masses",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L545-L573 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/WebServiceRefInfo.java | WebServiceRefInfo.addWebServiceFeatureInfo | public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) {
PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap.get(seiName);
if (portComponentRefInfo == null) {
portComponentRefInfo = new PortComponentRefInfo(seiName);
seiNamePortComponentRefInfoMap.put(seiName, portComponentRefInfo);
}
portComponentRefInfo.addWebServiceFeatureInfo(featureInfo);
} | java | public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) {
PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap.get(seiName);
if (portComponentRefInfo == null) {
portComponentRefInfo = new PortComponentRefInfo(seiName);
seiNamePortComponentRefInfoMap.put(seiName, portComponentRefInfo);
}
portComponentRefInfo.addWebServiceFeatureInfo(featureInfo);
} | [
"public",
"void",
"addWebServiceFeatureInfo",
"(",
"String",
"seiName",
",",
"WebServiceFeatureInfo",
"featureInfo",
")",
"{",
"PortComponentRefInfo",
"portComponentRefInfo",
"=",
"seiNamePortComponentRefInfoMap",
".",
"get",
"(",
"seiName",
")",
";",
"if",
"(",
"portCo... | Add a feature info to the PortComponentRefInfo, if the target one does not exist, a new one with
that port component interface will be created
@param seiName port component interface name
@param featureInfo feature info of the target port | [
"Add",
"a",
"feature",
"info",
"to",
"the",
"PortComponentRefInfo",
"if",
"the",
"target",
"one",
"does",
"not",
"exist",
"a",
"new",
"one",
"with",
"that",
"port",
"component",
"interface",
"will",
"be",
"created"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/WebServiceRefInfo.java#L197-L204 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.sendEmail | @SuppressWarnings("unchecked")
public <T extends IEntity> T sendEmail(T entity, String email) throws FMSException {
if(!isAvailableToEmail(entity)) {
throw new FMSException("Following entity: " + entity.getClass().getSimpleName() + " cannot be send as email" );
}
IntuitMessage intuitMessage = prepareEmail(entity, email);
//execute interceptors
executeInterceptors(intuitMessage);
return (T) retrieveEntity(intuitMessage);
} | java | @SuppressWarnings("unchecked")
public <T extends IEntity> T sendEmail(T entity, String email) throws FMSException {
if(!isAvailableToEmail(entity)) {
throw new FMSException("Following entity: " + entity.getClass().getSimpleName() + " cannot be send as email" );
}
IntuitMessage intuitMessage = prepareEmail(entity, email);
//execute interceptors
executeInterceptors(intuitMessage);
return (T) retrieveEntity(intuitMessage);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"IEntity",
">",
"T",
"sendEmail",
"(",
"T",
"entity",
",",
"String",
"email",
")",
"throws",
"FMSException",
"{",
"if",
"(",
"!",
"isAvailableToEmail",
"(",
"entity",
")",
"... | Send entity via email using specified address
@param entity
@param email
@param <T>
@return
@throws FMSException | [
"Send",
"entity",
"via",
"email",
"using",
"specified",
"address"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L560-L571 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.removeAll | public static <T> boolean removeAll(Collection<T> collection, Iterable<? extends T> elements) {
return Iterables.removeAll(collection, newHashSet(elements));
} | java | public static <T> boolean removeAll(Collection<T> collection, Iterable<? extends T> elements) {
return Iterables.removeAll(collection, newHashSet(elements));
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"removeAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"elements",
")",
"{",
"return",
"Iterables",
".",
"removeAll",
"(",
"collection",
",",
"newHashSet",
... | Removes all of the specified elements from the specified collection.
@param collection
the collection from which the {@code elements} are to be removed. May not be <code>null</code>.
@param elements
the elements to remove from the {@code collection}. May not be <code>null</code> but may contain
<code>null</code> entries if the {@code collection} allows that.
@return <code>true</code> if the collection changed as a result of the call
@since 2.4 | [
"Removes",
"all",
"of",
"the",
"specified",
"elements",
"from",
"the",
"specified",
"collection",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L316-L318 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/time/SchedulingSupport.java | SchedulingSupport.getNextIntervalStart | public static long getNextIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
long interval = MINUTE_IN_MS * intervalInMinutes;
return getPreviousIntervalStart(time, intervalInMinutes, offsetInMinutes) + interval;
} | java | public static long getNextIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
long interval = MINUTE_IN_MS * intervalInMinutes;
return getPreviousIntervalStart(time, intervalInMinutes, offsetInMinutes) + interval;
} | [
"public",
"static",
"long",
"getNextIntervalStart",
"(",
"long",
"time",
",",
"int",
"intervalInMinutes",
",",
"int",
"offsetInMinutes",
")",
"{",
"long",
"interval",
"=",
"MINUTE_IN_MS",
"*",
"intervalInMinutes",
";",
"return",
"getPreviousIntervalStart",
"(",
"tim... | Determines the exact time the next interval starts based on a time within the current interval.
@param time time in millis
@param intervalInMinutes
@param offsetInMinutes
@return the exact time in milliseconds the interval begins local time | [
"Determines",
"the",
"exact",
"time",
"the",
"next",
"interval",
"starts",
"based",
"on",
"a",
"time",
"within",
"the",
"current",
"interval",
".",
"@param",
"time",
"time",
"in",
"millis",
"@param",
"intervalInMinutes",
"@param",
"offsetInMinutes"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/time/SchedulingSupport.java#L112-L115 |
epam/parso | src/main/java/com/epam/parso/DataWriterUtil.java | DataWriterUtil.convertPercentElementToString | private static String convertPercentElementToString(Object value, DecimalFormat decimalFormat) {
Double doubleValue = value instanceof Long ? ((Long) value).doubleValue() : (Double) value;
return decimalFormat.format(doubleValue);
} | java | private static String convertPercentElementToString(Object value, DecimalFormat decimalFormat) {
Double doubleValue = value instanceof Long ? ((Long) value).doubleValue() : (Double) value;
return decimalFormat.format(doubleValue);
} | [
"private",
"static",
"String",
"convertPercentElementToString",
"(",
"Object",
"value",
",",
"DecimalFormat",
"decimalFormat",
")",
"{",
"Double",
"doubleValue",
"=",
"value",
"instanceof",
"Long",
"?",
"(",
"(",
"Long",
")",
"value",
")",
".",
"doubleValue",
"(... | The function to convert a percent element into a string.
@param value the input numeric value to convert.
@param decimalFormat the formatter to convert percentage element into string.
@return the string with the text presentation of the input numeric value. | [
"The",
"function",
"to",
"convert",
"a",
"percent",
"element",
"into",
"a",
"string",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/DataWriterUtil.java#L308-L311 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemGroupRenderer.java | WMenuItemGroupRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WMenuItemGroup group = (WMenuItemGroup) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:menugroup");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendClose();
paintChildren(group, renderContext);
xml.appendEndTag("ui:menugroup");
} | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WMenuItemGroup group = (WMenuItemGroup) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:menugroup");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendClose();
paintChildren(group, renderContext);
xml.appendEndTag("ui:menugroup");
} | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WMenuItemGroup",
"group",
"=",
"(",
"WMenuItemGroup",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"r... | Paints the given WMenuItemGroup.
@param component the WMenuItemGroup to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WMenuItemGroup",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemGroupRenderer.java#L22-L36 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/ModalDialogFragmentPanel.java | ModalDialogFragmentPanel.newOpenModalLink | protected MarkupContainer newOpenModalLink(final String id, final IModel<T> model)
{
return new AjaxLink<Void>(id)
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onClick(final AjaxRequestTarget target)
{
ModalDialogFragmentPanel.this.onShow(target);
}
};
} | java | protected MarkupContainer newOpenModalLink(final String id, final IModel<T> model)
{
return new AjaxLink<Void>(id)
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onClick(final AjaxRequestTarget target)
{
ModalDialogFragmentPanel.this.onShow(target);
}
};
} | [
"protected",
"MarkupContainer",
"newOpenModalLink",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"return",
"new",
"AjaxLink",
"<",
"Void",
">",
"(",
"id",
")",
"{",
"/** The Constant serialVersionUID. */",
"private",
... | Factory method for creating a new {@link Component} to open the {@link ModalWindow}. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provide their own version of a new {@link Component} to open the {@link ModalWindow}.
@param id
the wicket id
@param model
the model
@return the new {@link Component} to open the {@link ModalWindow}. | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Component",
"}",
"to",
"open",
"the",
"{",
"@link",
"ModalWindow",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can"... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/ModalDialogFragmentPanel.java#L141-L158 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.getJobs | public Map<String, Job> getJobs(String view) throws IOException {
return getJobs(null, view);
} | java | public Map<String, Job> getJobs(String view) throws IOException {
return getJobs(null, view);
} | [
"public",
"Map",
"<",
"String",
",",
"Job",
">",
"getJobs",
"(",
"String",
"view",
")",
"throws",
"IOException",
"{",
"return",
"getJobs",
"(",
"null",
",",
"view",
")",
";",
"}"
] | Get a list of all the defined jobs on the server (at the specified view
level)
@param view The view to get jobs from.
@return list of defined jobs (view level, for details @see Job#details
@throws IOException in case of an error. | [
"Get",
"a",
"list",
"of",
"all",
"the",
"defined",
"jobs",
"on",
"the",
"server",
"(",
"at",
"the",
"specified",
"view",
"level",
")"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L152-L154 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsMacroResolverDialog.java | CmsMacroResolverDialog.getLocalizedBundle | private Properties getLocalizedBundle(CmsObject cms, String path) throws CmsException, IOException {
CmsResource bundleResource = cms.readResource(path
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ getAvailableLocalVariant(cms, path + CmsSiteManager.MACRO_FOLDER + "/", CmsSiteManager.BUNDLE_NAME));
Properties ret = new Properties();
InputStreamReader reader = new InputStreamReader(
new ByteArrayInputStream(cms.readFile(bundleResource).getContents()),
StandardCharsets.UTF_8);
ret.load(reader);
return ret;
} | java | private Properties getLocalizedBundle(CmsObject cms, String path) throws CmsException, IOException {
CmsResource bundleResource = cms.readResource(path
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ getAvailableLocalVariant(cms, path + CmsSiteManager.MACRO_FOLDER + "/", CmsSiteManager.BUNDLE_NAME));
Properties ret = new Properties();
InputStreamReader reader = new InputStreamReader(
new ByteArrayInputStream(cms.readFile(bundleResource).getContents()),
StandardCharsets.UTF_8);
ret.load(reader);
return ret;
} | [
"private",
"Properties",
"getLocalizedBundle",
"(",
"CmsObject",
"cms",
",",
"String",
"path",
")",
"throws",
"CmsException",
",",
"IOException",
"{",
"CmsResource",
"bundleResource",
"=",
"cms",
".",
"readResource",
"(",
"path",
"+",
"CmsSiteManager",
".",
"MACRO... | Gets localized property object.<p>
@param cms CmsObject
@param path of resource
@return Properties object
@throws CmsException exception
@throws IOException exception | [
"Gets",
"localized",
"property",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsMacroResolverDialog.java#L206-L220 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/AppendRule.java | AppendRule.newInstance | public static AppendRule newInstance(String file, String resource, String url, String format, String profile)
throws IllegalRuleException {
AppendRule appendRule = new AppendRule();
if (StringUtils.hasText(file)) {
appendRule.setFile(file);
} else if (StringUtils.hasText(resource)) {
appendRule.setResource(resource);
} else if (StringUtils.hasText(url)) {
appendRule.setUrl(url);
} else {
throw new IllegalRuleException("The 'append' element requires either a 'file' or a 'resource' or a 'url' attribute");
}
AppendedFileFormatType appendedFileFormatType = AppendedFileFormatType.resolve(format);
if (format != null && appendedFileFormatType == null) {
throw new IllegalRuleException("No appended file format type for '" + format + "'");
}
appendRule.setFormat(appendedFileFormatType);
if (profile != null && !profile.isEmpty()) {
appendRule.setProfile(profile);
}
return appendRule;
} | java | public static AppendRule newInstance(String file, String resource, String url, String format, String profile)
throws IllegalRuleException {
AppendRule appendRule = new AppendRule();
if (StringUtils.hasText(file)) {
appendRule.setFile(file);
} else if (StringUtils.hasText(resource)) {
appendRule.setResource(resource);
} else if (StringUtils.hasText(url)) {
appendRule.setUrl(url);
} else {
throw new IllegalRuleException("The 'append' element requires either a 'file' or a 'resource' or a 'url' attribute");
}
AppendedFileFormatType appendedFileFormatType = AppendedFileFormatType.resolve(format);
if (format != null && appendedFileFormatType == null) {
throw new IllegalRuleException("No appended file format type for '" + format + "'");
}
appendRule.setFormat(appendedFileFormatType);
if (profile != null && !profile.isEmpty()) {
appendRule.setProfile(profile);
}
return appendRule;
} | [
"public",
"static",
"AppendRule",
"newInstance",
"(",
"String",
"file",
",",
"String",
"resource",
",",
"String",
"url",
",",
"String",
"format",
",",
"String",
"profile",
")",
"throws",
"IllegalRuleException",
"{",
"AppendRule",
"appendRule",
"=",
"new",
"Appen... | Create a new AppendRule.
@param file the rule file to append
@param resource the rule resource to append
@param url the rule url to append
@param format the rule file type ('xml' or 'apon')
@param profile the environment profile name
@return an {@code AppendRule} object
@throws IllegalRuleException if an illegal rule is found | [
"Create",
"a",
"new",
"AppendRule",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/AppendRule.java#L113-L138 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java | UserResource.changeEmail | @POST
@Path("me/email")
@RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
public Response changeEmail(@Context HttpServletRequest request, EmailRequest emailRequest) {
Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
return changeEmail(userId, emailRequest);
} | java | @POST
@Path("me/email")
@RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
public Response changeEmail(@Context HttpServletRequest request, EmailRequest emailRequest) {
Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
return changeEmail(userId, emailRequest);
} | [
"@",
"POST",
"@",
"Path",
"(",
"\"me/email\"",
")",
"@",
"RolesAllowed",
"(",
"{",
"\"ROLE_ADMIN\"",
",",
"\"ROLE_USER\"",
"}",
")",
"public",
"Response",
"changeEmail",
"(",
"@",
"Context",
"HttpServletRequest",
"request",
",",
"EmailRequest",
"emailRequest",
"... | User request changing their email address.
The new email is temporarily stored and an email is sent to the new email address for confirmation.
@param emailRequest new email address
@return 204 if success | [
"User",
"request",
"changing",
"their",
"email",
"address",
".",
"The",
"new",
"email",
"is",
"temporarily",
"stored",
"and",
"an",
"email",
"is",
"sent",
"to",
"the",
"new",
"email",
"address",
"for",
"confirmation",
"."
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java#L450-L456 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getValue | public Double getValue(GriddedTile griddedTile, short pixelValue) {
int unsignedPixelValue = getUnsignedPixelValue(pixelValue);
Double value = getValue(griddedTile, unsignedPixelValue);
return value;
} | java | public Double getValue(GriddedTile griddedTile, short pixelValue) {
int unsignedPixelValue = getUnsignedPixelValue(pixelValue);
Double value = getValue(griddedTile, unsignedPixelValue);
return value;
} | [
"public",
"Double",
"getValue",
"(",
"GriddedTile",
"griddedTile",
",",
"short",
"pixelValue",
")",
"{",
"int",
"unsignedPixelValue",
"=",
"getUnsignedPixelValue",
"(",
"pixelValue",
")",
";",
"Double",
"value",
"=",
"getValue",
"(",
"griddedTile",
",",
"unsignedP... | Get the coverage data value for the "unsigned short" pixel value
@param griddedTile
gridded tile
@param pixelValue
pixel value as an unsigned short
@return coverage data value | [
"Get",
"the",
"coverage",
"data",
"value",
"for",
"the",
"unsigned",
"short",
"pixel",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1417-L1421 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LauncherModel.java | LauncherModel.computeVector | private Force computeVector(Force vector, Localizable target)
{
final double sx = localizable.getX();
final double sy = localizable.getY();
double dx = target.getX();
double dy = target.getY();
if (target instanceof Transformable)
{
final Transformable transformable = (Transformable) target;
final double ray = UtilMath.getDistance(localizable.getX(),
localizable.getY(),
target.getX(),
target.getY());
dx += (int) ((target.getX() - transformable.getOldX()) / vector.getDirectionHorizontal() * ray);
dy += (int) ((target.getY() - transformable.getOldY()) / vector.getDirectionVertical() * ray);
}
final double dist = Math.max(Math.abs(sx - dx), Math.abs(sy - dy));
final double vecX = (dx - sx) / dist * vector.getDirectionHorizontal();
final double vecY = (dy - sy) / dist * vector.getDirectionVertical();
final Force force = new Force(vector);
force.setDestination(vecX, vecY);
return force;
} | java | private Force computeVector(Force vector, Localizable target)
{
final double sx = localizable.getX();
final double sy = localizable.getY();
double dx = target.getX();
double dy = target.getY();
if (target instanceof Transformable)
{
final Transformable transformable = (Transformable) target;
final double ray = UtilMath.getDistance(localizable.getX(),
localizable.getY(),
target.getX(),
target.getY());
dx += (int) ((target.getX() - transformable.getOldX()) / vector.getDirectionHorizontal() * ray);
dy += (int) ((target.getY() - transformable.getOldY()) / vector.getDirectionVertical() * ray);
}
final double dist = Math.max(Math.abs(sx - dx), Math.abs(sy - dy));
final double vecX = (dx - sx) / dist * vector.getDirectionHorizontal();
final double vecY = (dy - sy) / dist * vector.getDirectionVertical();
final Force force = new Force(vector);
force.setDestination(vecX, vecY);
return force;
} | [
"private",
"Force",
"computeVector",
"(",
"Force",
"vector",
",",
"Localizable",
"target",
")",
"{",
"final",
"double",
"sx",
"=",
"localizable",
".",
"getX",
"(",
")",
";",
"final",
"double",
"sy",
"=",
"localizable",
".",
"getY",
"(",
")",
";",
"double... | Compute the force vector depending of the target.
@param vector The initial vector used for launch.
@param target The target reference.
@return The computed force to reach target. | [
"Compute",
"the",
"force",
"vector",
"depending",
"of",
"the",
"target",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LauncherModel.java#L205-L233 |
VoltDB/voltdb | src/frontend/org/voltdb/export/ExportGeneration.java | ExportGeneration.sendDummyTakeMastershipResponse | private void sendDummyTakeMastershipResponse(long sourceHsid, long requestId, int partitionId, byte[] signatureBytes) {
// msg type(1) + partition:int(4) + length:int(4) + signaturesBytes.length
// requestId(8)
int msgLen = 1 + 4 + 4 + signatureBytes.length + 8;
ByteBuffer buf = ByteBuffer.allocate(msgLen);
buf.put(ExportManager.TAKE_MASTERSHIP_RESPONSE);
buf.putInt(partitionId);
buf.putInt(signatureBytes.length);
buf.put(signatureBytes);
buf.putLong(requestId);
BinaryPayloadMessage bpm = new BinaryPayloadMessage(new byte[0], buf.array());
m_mbox.send(sourceHsid, bpm);
if (exportLog.isDebugEnabled()) {
exportLog.debug("Partition " + partitionId + " mailbox hsid (" +
CoreUtils.hsIdToString(m_mbox.getHSId()) +
") send dummy TAKE_MASTERSHIP_RESPONSE message(" +
requestId + ") to " + CoreUtils.hsIdToString(sourceHsid));
}
} | java | private void sendDummyTakeMastershipResponse(long sourceHsid, long requestId, int partitionId, byte[] signatureBytes) {
// msg type(1) + partition:int(4) + length:int(4) + signaturesBytes.length
// requestId(8)
int msgLen = 1 + 4 + 4 + signatureBytes.length + 8;
ByteBuffer buf = ByteBuffer.allocate(msgLen);
buf.put(ExportManager.TAKE_MASTERSHIP_RESPONSE);
buf.putInt(partitionId);
buf.putInt(signatureBytes.length);
buf.put(signatureBytes);
buf.putLong(requestId);
BinaryPayloadMessage bpm = new BinaryPayloadMessage(new byte[0], buf.array());
m_mbox.send(sourceHsid, bpm);
if (exportLog.isDebugEnabled()) {
exportLog.debug("Partition " + partitionId + " mailbox hsid (" +
CoreUtils.hsIdToString(m_mbox.getHSId()) +
") send dummy TAKE_MASTERSHIP_RESPONSE message(" +
requestId + ") to " + CoreUtils.hsIdToString(sourceHsid));
}
} | [
"private",
"void",
"sendDummyTakeMastershipResponse",
"(",
"long",
"sourceHsid",
",",
"long",
"requestId",
",",
"int",
"partitionId",
",",
"byte",
"[",
"]",
"signatureBytes",
")",
"{",
"// msg type(1) + partition:int(4) + length:int(4) + signaturesBytes.length",
"// requestId... | Auto reply a response when the requested stream is no longer exists | [
"Auto",
"reply",
"a",
"response",
"when",
"the",
"requested",
"stream",
"is",
"no",
"longer",
"exists"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/export/ExportGeneration.java#L447-L465 |
guardtime/ksi-java-sdk | ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java | AbstractApacheHttpClient.createClient | private CloseableHttpAsyncClient createClient(HttpSettings settings, ApacheHttpClientConfiguration conf) {
IOReactorConfig ioReactor = IOReactorConfig.custom().setIoThreadCount(conf.getMaxThreadCount()).build();
HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClients.custom()
.useSystemProperties()
// allow POST redirects
.setRedirectStrategy(new LaxRedirectStrategy()).setMaxConnTotal(conf.getMaxTotalConnectionCount()).setMaxConnPerRoute(conf.getMaxRouteConnectionCount()).setDefaultIOReactorConfig(ioReactor)
.setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy()).setDefaultRequestConfig(createDefaultRequestConfig(settings));
if (settings.getProxyUrl() != null) {
DefaultProxyRoutePlanner routePlanner = createProxyRoutePlanner(settings, httpClientBuilder);
httpClientBuilder.setRoutePlanner(routePlanner);
}
CloseableHttpAsyncClient httpClient = httpClientBuilder.build();
httpClient.start();
return httpClient;
} | java | private CloseableHttpAsyncClient createClient(HttpSettings settings, ApacheHttpClientConfiguration conf) {
IOReactorConfig ioReactor = IOReactorConfig.custom().setIoThreadCount(conf.getMaxThreadCount()).build();
HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClients.custom()
.useSystemProperties()
// allow POST redirects
.setRedirectStrategy(new LaxRedirectStrategy()).setMaxConnTotal(conf.getMaxTotalConnectionCount()).setMaxConnPerRoute(conf.getMaxRouteConnectionCount()).setDefaultIOReactorConfig(ioReactor)
.setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy()).setDefaultRequestConfig(createDefaultRequestConfig(settings));
if (settings.getProxyUrl() != null) {
DefaultProxyRoutePlanner routePlanner = createProxyRoutePlanner(settings, httpClientBuilder);
httpClientBuilder.setRoutePlanner(routePlanner);
}
CloseableHttpAsyncClient httpClient = httpClientBuilder.build();
httpClient.start();
return httpClient;
} | [
"private",
"CloseableHttpAsyncClient",
"createClient",
"(",
"HttpSettings",
"settings",
",",
"ApacheHttpClientConfiguration",
"conf",
")",
"{",
"IOReactorConfig",
"ioReactor",
"=",
"IOReactorConfig",
".",
"custom",
"(",
")",
".",
"setIoThreadCount",
"(",
"conf",
".",
... | Creates asynchronous Apache HTTP client.
@param settings
settings to use to create client.
@param conf
configuration related to async connection.
@return Instance of {@link CloseableHttpAsyncClient}. | [
"Creates",
"asynchronous",
"Apache",
"HTTP",
"client",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java#L128-L142 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.projectiveToMetric | public static void projectiveToMetric( DMatrixRMaj cameraMatrix , DMatrixRMaj H ,
Se3_F64 worldToView , DMatrixRMaj K )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
MultiViewOps.decomposeMetricCamera(tmp,K,worldToView);
} | java | public static void projectiveToMetric( DMatrixRMaj cameraMatrix , DMatrixRMaj H ,
Se3_F64 worldToView , DMatrixRMaj K )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
MultiViewOps.decomposeMetricCamera(tmp,K,worldToView);
} | [
"public",
"static",
"void",
"projectiveToMetric",
"(",
"DMatrixRMaj",
"cameraMatrix",
",",
"DMatrixRMaj",
"H",
",",
"Se3_F64",
"worldToView",
",",
"DMatrixRMaj",
"K",
")",
"{",
"DMatrixRMaj",
"tmp",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"4",
")",
";",
"C... | Elevates a projective camera matrix into a metric one using the rectifying homography.
Extracts calibration and Se3 pose.
<pre>
P'=P*H
K,R,t = decompose(P')
</pre>
where P is the camera matrix, H is the homography, (K,R,t) are the intrinsic calibration matrix, rotation,
and translation
@see MultiViewOps#absoluteQuadraticToH
@see #decomposeMetricCamera(DMatrixRMaj, DMatrixRMaj, Se3_F64)
@param cameraMatrix (Input) camera matrix. 3x4
@param H (Input) Rectifying homography. 4x4
@param worldToView (Output) Transform from world to camera view
@param K (Output) Camera calibration matrix | [
"Elevates",
"a",
"projective",
"camera",
"matrix",
"into",
"a",
"metric",
"one",
"using",
"the",
"rectifying",
"homography",
".",
"Extracts",
"calibration",
"and",
"Se3",
"pose",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1358-L1365 |
grpc/grpc-java | stub/src/main/java/io/grpc/stub/AbstractStub.java | AbstractStub.withCompression | @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704")
public final S withCompression(String compressorName) {
return build(channel, callOptions.withCompression(compressorName));
} | java | @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704")
public final S withCompression(String compressorName) {
return build(channel, callOptions.withCompression(compressorName));
} | [
"@",
"ExperimentalApi",
"(",
"\"https://github.com/grpc/grpc-java/issues/1704\"",
")",
"public",
"final",
"S",
"withCompression",
"(",
"String",
"compressorName",
")",
"{",
"return",
"build",
"(",
"channel",
",",
"callOptions",
".",
"withCompression",
"(",
"compressorNa... | Set's the compressor name to use for the call. It is the responsibility of the application
to make sure the server supports decoding the compressor picked by the client. To be clear,
this is the compressor used by the stub to compress messages to the server. To get
compressed responses from the server, set the appropriate {@link io.grpc.DecompressorRegistry}
on the {@link io.grpc.ManagedChannelBuilder}.
@since 1.0.0
@param compressorName the name (e.g. "gzip") of the compressor to use. | [
"Set",
"s",
"the",
"compressor",
"name",
"to",
"use",
"for",
"the",
"call",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"application",
"to",
"make",
"sure",
"the",
"server",
"supports",
"decoding",
"the",
"compressor",
"picked",
"by",
"the",
"cl... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/AbstractStub.java#L148-L151 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.withDayOfMonth | public YearMonthDay withDayOfMonth(int dayOfMonth) {
int[] newValues = getValues();
newValues = getChronology().dayOfMonth().set(this, DAY_OF_MONTH, newValues, dayOfMonth);
return new YearMonthDay(this, newValues);
} | java | public YearMonthDay withDayOfMonth(int dayOfMonth) {
int[] newValues = getValues();
newValues = getChronology().dayOfMonth().set(this, DAY_OF_MONTH, newValues, dayOfMonth);
return new YearMonthDay(this, newValues);
} | [
"public",
"YearMonthDay",
"withDayOfMonth",
"(",
"int",
"dayOfMonth",
")",
"{",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"newValues",
"=",
"getChronology",
"(",
")",
".",
"dayOfMonth",
"(",
")",
".",
"set",
"(",
"this",
",",
"DAY_OF... | Returns a copy of this date with the day of month field updated.
<p>
YearMonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
day of month changed.
@param dayOfMonth the day of month to set
@return a copy of this object with the field set
@throws IllegalArgumentException if the value is invalid
@since 1.3 | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"day",
"of",
"month",
"field",
"updated",
".",
"<p",
">",
"YearMonthDay",
"is",
"immutable",
"so",
"there",
"are",
"no",
"set",
"methods",
".",
"Instead",
"this",
"method",
"returns",
"a",
"new... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L878-L882 |
strator-dev/greenpepper | greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/AbstractJarMojo.java | AbstractJarMojo.createArchive | public File createArchive()
throws MojoExecutionException
{
File jarFile = getJarFile( outputDirectory, finalName, getClassifier() );
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver( jarArchiver );
archiver.setOutputFile( jarFile );
archive.setForced( forceCreation );
try
{
File contentDirectory = getClassesDirectory();
if ( !contentDirectory.exists() )
{
getLog().warn( "JAR will be empty - no content was marked for inclusion!" );
}
else
{
archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );
}
archiver.createArchive(mavenSession, project, archive);
return jarFile;
}
catch ( Exception e )
{
throw new MojoExecutionException( "Error assembling JAR", e );
}
} | java | public File createArchive()
throws MojoExecutionException
{
File jarFile = getJarFile( outputDirectory, finalName, getClassifier() );
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver( jarArchiver );
archiver.setOutputFile( jarFile );
archive.setForced( forceCreation );
try
{
File contentDirectory = getClassesDirectory();
if ( !contentDirectory.exists() )
{
getLog().warn( "JAR will be empty - no content was marked for inclusion!" );
}
else
{
archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );
}
archiver.createArchive(mavenSession, project, archive);
return jarFile;
}
catch ( Exception e )
{
throw new MojoExecutionException( "Error assembling JAR", e );
}
} | [
"public",
"File",
"createArchive",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"jarFile",
"=",
"getJarFile",
"(",
"outputDirectory",
",",
"finalName",
",",
"getClassifier",
"(",
")",
")",
";",
"MavenArchiver",
"archiver",
"=",
"new",
"MavenArchiver"... | Generates the JAR.
@return a {@link java.io.File} object.
@throws org.apache.maven.plugin.MojoExecutionException if any. | [
"Generates",
"the",
"JAR",
"."
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/AbstractJarMojo.java#L158-L191 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.removePoint | private void removePoint(Point point, Collidable collidable)
{
final Integer group = collidable.getGroup();
if (collidables.containsKey(group))
{
final Map<Point, Set<Collidable>> elements = collidables.get(group);
if (elements.containsKey(point))
{
removePoint(point, collidable, elements, group);
}
}
} | java | private void removePoint(Point point, Collidable collidable)
{
final Integer group = collidable.getGroup();
if (collidables.containsKey(group))
{
final Map<Point, Set<Collidable>> elements = collidables.get(group);
if (elements.containsKey(point))
{
removePoint(point, collidable, elements, group);
}
}
} | [
"private",
"void",
"removePoint",
"(",
"Point",
"point",
",",
"Collidable",
"collidable",
")",
"{",
"final",
"Integer",
"group",
"=",
"collidable",
".",
"getGroup",
"(",
")",
";",
"if",
"(",
"collidables",
".",
"containsKey",
"(",
"group",
")",
")",
"{",
... | Remove point. Remove list of no more collidable.
@param point The point to remove.
@param collidable The associated collidable. | [
"Remove",
"point",
".",
"Remove",
"list",
"of",
"no",
"more",
"collidable",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L67-L78 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/PersianCalendar.java | PersianCalendar.handleComputeMonthStart | @Deprecated
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
// If the month is out of range, adjust it into range, and
// modify the extended year value accordingly.
if (month < 0 || month > 11) {
int[] rem = new int[1];
eyear += floorDivide(month, 12, rem);
month = rem[0];
}
int julianDay = PERSIAN_EPOCH - 1 + 365 * (eyear - 1) + floorDivide(8 * eyear + 21, 33);
if (month != 0) {
julianDay += MONTH_COUNT[month][2];
}
return julianDay;
} | java | @Deprecated
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
// If the month is out of range, adjust it into range, and
// modify the extended year value accordingly.
if (month < 0 || month > 11) {
int[] rem = new int[1];
eyear += floorDivide(month, 12, rem);
month = rem[0];
}
int julianDay = PERSIAN_EPOCH - 1 + 365 * (eyear - 1) + floorDivide(8 * eyear + 21, 33);
if (month != 0) {
julianDay += MONTH_COUNT[month][2];
}
return julianDay;
} | [
"@",
"Deprecated",
"protected",
"int",
"handleComputeMonthStart",
"(",
"int",
"eyear",
",",
"int",
"month",
",",
"boolean",
"useMonth",
")",
"{",
"// If the month is out of range, adjust it into range, and",
"// modify the extended year value accordingly.",
"if",
"(",
"month"... | Return JD of start of given month/year
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Return",
"JD",
"of",
"start",
"of",
"given",
"month",
"/",
"year"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/PersianCalendar.java#L367-L382 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/Link.java | Link.andAffordance | public Link andAffordance(HttpMethod httpMethod, Class<?> inputType, List<QueryParameter> queryMethodParameters,
Class<?> outputType) {
return andAffordance(httpMethod, ResolvableType.forClass(inputType), queryMethodParameters,
ResolvableType.forClass(outputType));
} | java | public Link andAffordance(HttpMethod httpMethod, Class<?> inputType, List<QueryParameter> queryMethodParameters,
Class<?> outputType) {
return andAffordance(httpMethod, ResolvableType.forClass(inputType), queryMethodParameters,
ResolvableType.forClass(outputType));
} | [
"public",
"Link",
"andAffordance",
"(",
"HttpMethod",
"httpMethod",
",",
"Class",
"<",
"?",
">",
"inputType",
",",
"List",
"<",
"QueryParameter",
">",
"queryMethodParameters",
",",
"Class",
"<",
"?",
">",
"outputType",
")",
"{",
"return",
"andAffordance",
"(",... | Convenience method when chaining an existing {@link Link}. Defaults the name of the affordance to verb + classname,
e.g. {@literal <httpMethod=HttpMethod.PUT, inputType=Employee>} produces {@literal <name=putEmployee>}.
@param httpMethod
@param inputType
@param queryMethodParameters
@param outputType
@return | [
"Convenience",
"method",
"when",
"chaining",
"an",
"existing",
"{",
"@link",
"Link",
"}",
".",
"Defaults",
"the",
"name",
"of",
"the",
"affordance",
"to",
"verb",
"+",
"classname",
"e",
".",
"g",
".",
"{",
"@literal",
"<httpMethod",
"=",
"HttpMethod",
".",... | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/Link.java#L262-L266 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java | TableSession.doMove | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException
{
try {
Utility.getLogger().info("EJB Move");
if (iRecordCount == 1)
{
return this.doMoveOne(iRelPosition);
}
else
{
Vector<Object> objVector = new Vector<Object>();
for (; iRecordCount > 0;iRecordCount--)
{
Object objData = this.doMoveOne(iRelPosition);
objVector.add(objData);
if (!(objData instanceof Vector))
break;
iRelPosition = +1;
}
return objVector; // Vector of multiple rows
}
} catch (DBException ex) {
throw ex;
} catch (Exception ex) {
ex.printStackTrace();
throw new DBException(ex.getMessage());
}
} | java | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException
{
try {
Utility.getLogger().info("EJB Move");
if (iRecordCount == 1)
{
return this.doMoveOne(iRelPosition);
}
else
{
Vector<Object> objVector = new Vector<Object>();
for (; iRecordCount > 0;iRecordCount--)
{
Object objData = this.doMoveOne(iRelPosition);
objVector.add(objData);
if (!(objData instanceof Vector))
break;
iRelPosition = +1;
}
return objVector; // Vector of multiple rows
}
} catch (DBException ex) {
throw ex;
} catch (Exception ex) {
ex.printStackTrace();
throw new DBException(ex.getMessage());
}
} | [
"public",
"Object",
"doMove",
"(",
"int",
"iRelPosition",
",",
"int",
"iRecordCount",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"try",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"EJB Move\"",
")",
";",
"if",
"(",
"iRec... | Move the current position and read the record (optionally read several records).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Records to read.
@return If I read 1 record, this is the record's data.
@return If I read several records, this is a vector of the returned records.
@return If at EOF, or error, returns the error code as a Integer.
@exception DBException File exception. | [
"Move",
"the",
"current",
"position",
"and",
"read",
"the",
"record",
"(",
"optionally",
"read",
"several",
"records",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java#L423-L450 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/HeartbeatDirectoryRegistrationService.java | HeartbeatDirectoryRegistrationService.registerCachedServiceInstance | private void registerCachedServiceInstance(ProvidedServiceInstance instance, ServiceInstanceHealth registryHealth) {
try {
write.lock();
ServiceInstanceId id = new ServiceInstanceId(instance.getServiceName(),
instance.getProviderId());
CachedProviderServiceInstance cachedInstance = getCacheServiceInstances().get(id);
if(cachedInstance == null){
cachedInstance = new CachedProviderServiceInstance(
instance);
getCacheServiceInstances().put(id, cachedInstance);
}
if(LOGGER.isDebugEnabled()){
LOGGER.debug("add cached ProvidedServiceInstance: {}.", cachedInstance.toString());
}
cachedInstance.setServiceInstanceHealth(registryHealth);
} finally {
write.unlock();
}
} | java | private void registerCachedServiceInstance(ProvidedServiceInstance instance, ServiceInstanceHealth registryHealth) {
try {
write.lock();
ServiceInstanceId id = new ServiceInstanceId(instance.getServiceName(),
instance.getProviderId());
CachedProviderServiceInstance cachedInstance = getCacheServiceInstances().get(id);
if(cachedInstance == null){
cachedInstance = new CachedProviderServiceInstance(
instance);
getCacheServiceInstances().put(id, cachedInstance);
}
if(LOGGER.isDebugEnabled()){
LOGGER.debug("add cached ProvidedServiceInstance: {}.", cachedInstance.toString());
}
cachedInstance.setServiceInstanceHealth(registryHealth);
} finally {
write.unlock();
}
} | [
"private",
"void",
"registerCachedServiceInstance",
"(",
"ProvidedServiceInstance",
"instance",
",",
"ServiceInstanceHealth",
"registryHealth",
")",
"{",
"try",
"{",
"write",
".",
"lock",
"(",
")",
";",
"ServiceInstanceId",
"id",
"=",
"new",
"ServiceInstanceId",
"(",
... | Register a ProvidedServiceInstance to the Cache.
Add/update the ProvidedServiceInstance in the cache.
It is thread safe.
@param instance
the ProvidedServiceInstance.
@param registryHealth
the ServiceInstanceHealth callback. | [
"Register",
"a",
"ProvidedServiceInstance",
"to",
"the",
"Cache",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/HeartbeatDirectoryRegistrationService.java#L290-L310 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java | LogFilePatternReceiver.convertTimestamp | private String convertTimestamp() {
//some locales (for example, French) generate timestamp text with characters not included in \w -
// now using \S (all non-whitespace characters) instead of /w
String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+");
//make sure dots in timestamp are escaped
result = result.replaceAll(Pattern.quote("."), "\\\\.");
return result;
} | java | private String convertTimestamp() {
//some locales (for example, French) generate timestamp text with characters not included in \w -
// now using \S (all non-whitespace characters) instead of /w
String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+");
//make sure dots in timestamp are escaped
result = result.replaceAll(Pattern.quote("."), "\\\\.");
return result;
} | [
"private",
"String",
"convertTimestamp",
"(",
")",
"{",
"//some locales (for example, French) generate timestamp text with characters not included in \\w -",
"// now using \\S (all non-whitespace characters) instead of /w ",
"String",
"result",
"=",
"timestampFormat",
".",
"replaceAll",
... | Helper method that will convert timestamp format to a pattern
@return string | [
"Helper",
"method",
"that",
"will",
"convert",
"timestamp",
"format",
"to",
"a",
"pattern"
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L582-L589 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.registerActiveOperation | protected <T, A> ActiveOperation<T, A> registerActiveOperation(A attachment, ActiveOperation.CompletedCallback<T> callback) {
return registerActiveOperation(null, attachment, callback);
} | java | protected <T, A> ActiveOperation<T, A> registerActiveOperation(A attachment, ActiveOperation.CompletedCallback<T> callback) {
return registerActiveOperation(null, attachment, callback);
} | [
"protected",
"<",
"T",
",",
"A",
">",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
"registerActiveOperation",
"(",
"A",
"attachment",
",",
"ActiveOperation",
".",
"CompletedCallback",
"<",
"T",
">",
"callback",
")",
"{",
"return",
"registerActiveOperation",
"("... | Register an active operation. The operation-id will be generated.
@param attachment the shared attachment
@param callback the completed callback
@return the active operation | [
"Register",
"an",
"active",
"operation",
".",
"The",
"operation",
"-",
"id",
"will",
"be",
"generated",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L352-L354 |
apache/groovy | src/main/groovy/groovy/lang/BenchmarkInterceptor.java | BenchmarkInterceptor.afterInvoke | public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {
((List) calls.get(methodName)).add(System.currentTimeMillis());
return result;
} | java | public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {
((List) calls.get(methodName)).add(System.currentTimeMillis());
return result;
} | [
"public",
"Object",
"afterInvoke",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"result",
")",
"{",
"(",
"(",
"List",
")",
"calls",
".",
"get",
"(",
"methodName",
")",
")",
".",
"add",
"(",
... | This code is executed after the method is called.
@param object receiver object for the called method
@param methodName name of the called method
@param arguments arguments to the called method
@param result result of the executed method call or result of beforeInvoke if method was not called
@return result | [
"This",
"code",
"is",
"executed",
"after",
"the",
"method",
"is",
"called",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/BenchmarkInterceptor.java#L89-L92 |
infinispan/infinispan | extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java | StreamSummaryContainer.addGet | public void addGet(Object key, boolean remote) {
if (!isEnabled()) {
return;
}
syncOffer(remote ? Stat.REMOTE_GET : Stat.LOCAL_GET, key);
} | java | public void addGet(Object key, boolean remote) {
if (!isEnabled()) {
return;
}
syncOffer(remote ? Stat.REMOTE_GET : Stat.LOCAL_GET, key);
} | [
"public",
"void",
"addGet",
"(",
"Object",
"key",
",",
"boolean",
"remote",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"syncOffer",
"(",
"remote",
"?",
"Stat",
".",
"REMOTE_GET",
":",
"Stat",
".",
"LOCAL_GET",
",",... | Adds the key to the read top-key.
@param remote {@code true} if the key is remote, {@code false} otherwise. | [
"Adds",
"the",
"key",
"to",
"the",
"read",
"top",
"-",
"key",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java#L102-L107 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.createRequest | private InternalRequest createRequest(
HttpMethodName httpMethod, AbstractBceRequest request, String...pathVariables) {
// build URL paths
List<String> pathComponents = new ArrayList<String>();
pathComponents.add(VERSION);
// append resourceKeys,pathVariables,
// For example:/resourcekey1/resourcekey2/../pathVariable1/pathVariable2
if (pathVariables != null) {
for (String pathVariable : pathVariables) {
pathComponents.add(pathVariable);
}
}
URI uri = HttpUtils.appendUri(getEndpoint(), pathComponents.toArray(new String[pathComponents.size()]));
// get a InternalRequest instance and set headers
InternalRequest internalRequest = new InternalRequest(httpMethod, uri);
internalRequest.setCredentials(request.getRequestCredentials());
if (httpMethod == HttpMethodName.POST
|| httpMethod == HttpMethodName.PUT) {
fillRequestPayload(internalRequest, request);
}
return internalRequest;
} | java | private InternalRequest createRequest(
HttpMethodName httpMethod, AbstractBceRequest request, String...pathVariables) {
// build URL paths
List<String> pathComponents = new ArrayList<String>();
pathComponents.add(VERSION);
// append resourceKeys,pathVariables,
// For example:/resourcekey1/resourcekey2/../pathVariable1/pathVariable2
if (pathVariables != null) {
for (String pathVariable : pathVariables) {
pathComponents.add(pathVariable);
}
}
URI uri = HttpUtils.appendUri(getEndpoint(), pathComponents.toArray(new String[pathComponents.size()]));
// get a InternalRequest instance and set headers
InternalRequest internalRequest = new InternalRequest(httpMethod, uri);
internalRequest.setCredentials(request.getRequestCredentials());
if (httpMethod == HttpMethodName.POST
|| httpMethod == HttpMethodName.PUT) {
fillRequestPayload(internalRequest, request);
}
return internalRequest;
} | [
"private",
"InternalRequest",
"createRequest",
"(",
"HttpMethodName",
"httpMethod",
",",
"AbstractBceRequest",
"request",
",",
"String",
"...",
"pathVariables",
")",
"{",
"// build URL paths",
"List",
"<",
"String",
">",
"pathComponents",
"=",
"new",
"ArrayList",
"<",... | Creates and initializes a new request object for the specified resource. This method is responsible for
determining HTTP method, URI path, credentials and request body for POST method.
<p>
<b>Note: </b> The Query parameters in URL should be specified by caller method.
</p>
@param httpMethod The HTTP method to use when sending the request.
@param request The original request, as created by the user.
@param pathVariables The optional variables in URI path.
@return A new request object, populated with endpoint, resource path, ready for callers to populate any
additional headers or parameters, and execute. | [
"Creates",
"and",
"initializes",
"a",
"new",
"request",
"object",
"for",
"the",
"specified",
"resource",
".",
"This",
"method",
"is",
"responsible",
"for",
"determining",
"HTTP",
"method",
"URI",
"path",
"credentials",
"and",
"request",
"body",
"for",
"POST",
... | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L1046-L1072 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractProcessor.java | AbstractProcessor.getIdentifier | protected static String getIdentifier(final String[] command, final String fallback) {
String identifier = fallback;
try {
final String[] cmdout = CaptureStreamHandler.run(command);
if (cmdout.length > 0) {
identifier = cmdout[0];
}
} catch (final Throwable ex) {
identifier = fallback + ":" + ex.toString();
}
return identifier;
} | java | protected static String getIdentifier(final String[] command, final String fallback) {
String identifier = fallback;
try {
final String[] cmdout = CaptureStreamHandler.run(command);
if (cmdout.length > 0) {
identifier = cmdout[0];
}
} catch (final Throwable ex) {
identifier = fallback + ":" + ex.toString();
}
return identifier;
} | [
"protected",
"static",
"String",
"getIdentifier",
"(",
"final",
"String",
"[",
"]",
"command",
",",
"final",
"String",
"fallback",
")",
"{",
"String",
"identifier",
"=",
"fallback",
";",
"try",
"{",
"final",
"String",
"[",
"]",
"cmdout",
"=",
"CaptureStreamH... | Determines the identification of a command line processor by capture the
first line of its output for a specific command.
@param command
array of command line arguments starting with executable
name. For example, { "cl" }
@param fallback
start of identifier if there is an error in executing the
command
@return identifier for the processor | [
"Determines",
"the",
"identification",
"of",
"a",
"command",
"line",
"processor",
"by",
"capture",
"the",
"first",
"line",
"of",
"its",
"output",
"for",
"a",
"specific",
"command",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractProcessor.java#L52-L63 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java | CoderResult.malformedForLength | public static synchronized CoderResult malformedForLength(int length)
throws IllegalArgumentException {
if (length > 0) {
Integer key = Integer.valueOf(length);
synchronized (_malformedErrors) {
CoderResult r = _malformedErrors.get(key);
if (r == null) {
r = new CoderResult(TYPE_MALFORMED_INPUT, length);
_malformedErrors.put(key, r);
}
return r;
}
}
throw new IllegalArgumentException("length <= 0: " + length);
} | java | public static synchronized CoderResult malformedForLength(int length)
throws IllegalArgumentException {
if (length > 0) {
Integer key = Integer.valueOf(length);
synchronized (_malformedErrors) {
CoderResult r = _malformedErrors.get(key);
if (r == null) {
r = new CoderResult(TYPE_MALFORMED_INPUT, length);
_malformedErrors.put(key, r);
}
return r;
}
}
throw new IllegalArgumentException("length <= 0: " + length);
} | [
"public",
"static",
"synchronized",
"CoderResult",
"malformedForLength",
"(",
"int",
"length",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"length",
">",
"0",
")",
"{",
"Integer",
"key",
"=",
"Integer",
".",
"valueOf",
"(",
"length",
")",
";",
... | Gets a <code>CoderResult</code> object indicating a malformed-input
error.
@param length
the length of the malformed-input.
@return a <code>CoderResult</code> object indicating a malformed-input
error.
@throws IllegalArgumentException
if <code>length</code> is non-positive. | [
"Gets",
"a",
"<code",
">",
"CoderResult<",
"/",
"code",
">",
"object",
"indicating",
"a",
"malformed",
"-",
"input",
"error",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java#L112-L126 |
leadware/jpersistence-tools | jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorHelper.java | DAOValidatorHelper.arraryContains | public static <T extends Object> boolean arraryContains(T[] array, T value) {
// Si le tableau est vide
if(array == null || array.length == 0) {
// On retourne false
return false;
}
// Si le mode est vide
if(value == null) {
// On retourne false
return false;
}
// Mode dedans
boolean modeIn = false;
// Index du Tableau
int index = 0;
// Parcours
while(index < array.length && !modeIn) {
// Valeur du Tableau
T tValue = array[index++];
modeIn = tValue.equals(value);
}
// On retourne false
return modeIn;
} | java | public static <T extends Object> boolean arraryContains(T[] array, T value) {
// Si le tableau est vide
if(array == null || array.length == 0) {
// On retourne false
return false;
}
// Si le mode est vide
if(value == null) {
// On retourne false
return false;
}
// Mode dedans
boolean modeIn = false;
// Index du Tableau
int index = 0;
// Parcours
while(index < array.length && !modeIn) {
// Valeur du Tableau
T tValue = array[index++];
modeIn = tValue.equals(value);
}
// On retourne false
return modeIn;
} | [
"public",
"static",
"<",
"T",
"extends",
"Object",
">",
"boolean",
"arraryContains",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"value",
")",
"{",
"// Si le tableau est vide\r",
"if",
"(",
"array",
"==",
"null",
"||",
"array",
".",
"length",
"==",
"0",
")",
... | Methode permettant de savoir si un Objet de type T est contenu dans un Tableau d'objet de type T
@param array Tableau d'objet d'un type T
@param value Objet d'un Type T
@param <T> Type de valeurs du tableau
@return Etat de presence | [
"Methode",
"permettant",
"de",
"savoir",
"si",
"un",
"Objet",
"de",
"type",
"T",
"est",
"contenu",
"dans",
"un",
"Tableau",
"d",
"objet",
"de",
"type",
"T"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorHelper.java#L373-L406 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/spi/MoneyUtils.java | MoneyUtils.getBigDecimal | public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) {
BigDecimal bd = getBigDecimal(num);
if (Objects.nonNull(moneyContext)) {
MathContext mc = getMathContext(moneyContext, HALF_EVEN);
bd = new BigDecimal(bd.toString(), mc);
int maxScale = moneyContext.getMaxScale();
if (maxScale > 0) {
if (bd.scale() > maxScale) {
if (LOG.isLoggable(FINEST)) {
LOG.log(FINEST, "The number scale is " + bd.scale() + " but Max Scale is " + maxScale);
}
bd = bd.setScale(maxScale, mc.getRoundingMode());
}
}
}
return bd;
} | java | public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) {
BigDecimal bd = getBigDecimal(num);
if (Objects.nonNull(moneyContext)) {
MathContext mc = getMathContext(moneyContext, HALF_EVEN);
bd = new BigDecimal(bd.toString(), mc);
int maxScale = moneyContext.getMaxScale();
if (maxScale > 0) {
if (bd.scale() > maxScale) {
if (LOG.isLoggable(FINEST)) {
LOG.log(FINEST, "The number scale is " + bd.scale() + " but Max Scale is " + maxScale);
}
bd = bd.setScale(maxScale, mc.getRoundingMode());
}
}
}
return bd;
} | [
"public",
"static",
"BigDecimal",
"getBigDecimal",
"(",
"Number",
"num",
",",
"MonetaryContext",
"moneyContext",
")",
"{",
"BigDecimal",
"bd",
"=",
"getBigDecimal",
"(",
"num",
")",
";",
"if",
"(",
"Objects",
".",
"nonNull",
"(",
"moneyContext",
")",
")",
"{... | Creates a {@link BigDecimal} from the given {@link Number} doing the
valid conversion depending the type given, if a {@link MonetaryContext}
is given, it is applied to the number returned.
@param num the number type
@return the corresponding {@link BigDecimal} | [
"Creates",
"a",
"{",
"@link",
"BigDecimal",
"}",
"from",
"the",
"given",
"{",
"@link",
"Number",
"}",
"doing",
"the",
"valid",
"conversion",
"depending",
"the",
"type",
"given",
"if",
"a",
"{",
"@link",
"MonetaryContext",
"}",
"is",
"given",
"it",
"is",
... | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/spi/MoneyUtils.java#L101-L117 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET | public ArrayList<Long> billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET(String billingAccount, String serviceName, OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum screenListType) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/screenListConditions/conditions";
StringBuilder sb = path(qPath, billingAccount, serviceName);
query(sb, "screenListType", screenListType);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t2);
} | java | public ArrayList<Long> billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET(String billingAccount, String serviceName, OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum screenListType) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/screenListConditions/conditions";
StringBuilder sb = path(qPath, billingAccount, serviceName);
query(sb, "screenListType", screenListType);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t2);
} | [
"public",
"ArrayList",
"<",
"Long",
">",
"billingAccount_easyHunting_serviceName_screenListConditions_conditions_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum",
"screenListType",
")",
"throws",
"IOE... | Screen lists conditions checked when a call is received
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/screenListConditions/conditions
@param screenListType [required] Filter the value of screenListType property (=)
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Screen",
"lists",
"conditions",
"checked",
"when",
"a",
"call",
"is",
"received"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3216-L3222 |
resourcepool/ssdp-client | src/main/java/io/resourcepool/ssdp/client/request/SsdpDiscovery.java | SsdpDiscovery.getDatagram | public static DatagramPacket getDatagram(String serviceType) {
StringBuilder sb = new StringBuilder("M-SEARCH * HTTP/1.1\r\n");
sb.append("HOST: " + SsdpParams.getSsdpMulticastAddress().getHostAddress() + ":" + SsdpParams.getSsdpMulticastPort() + "\r\n");
sb.append("MAN: \"ssdp:discover\"\r\n");
sb.append("MX: 3\r\n");
sb.append("USER-AGENT: Resourcepool SSDP Client\r\n");
sb.append(serviceType == null ? "ST: ssdp:all\r\n" : "ST: " + serviceType + "\r\n\r\n");
byte[] content = sb.toString().getBytes(UTF_8);
return new DatagramPacket(content, content.length, SsdpParams.getSsdpMulticastAddress(), SsdpParams.getSsdpMulticastPort());
} | java | public static DatagramPacket getDatagram(String serviceType) {
StringBuilder sb = new StringBuilder("M-SEARCH * HTTP/1.1\r\n");
sb.append("HOST: " + SsdpParams.getSsdpMulticastAddress().getHostAddress() + ":" + SsdpParams.getSsdpMulticastPort() + "\r\n");
sb.append("MAN: \"ssdp:discover\"\r\n");
sb.append("MX: 3\r\n");
sb.append("USER-AGENT: Resourcepool SSDP Client\r\n");
sb.append(serviceType == null ? "ST: ssdp:all\r\n" : "ST: " + serviceType + "\r\n\r\n");
byte[] content = sb.toString().getBytes(UTF_8);
return new DatagramPacket(content, content.length, SsdpParams.getSsdpMulticastAddress(), SsdpParams.getSsdpMulticastPort());
} | [
"public",
"static",
"DatagramPacket",
"getDatagram",
"(",
"String",
"serviceType",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"M-SEARCH * HTTP/1.1\\r\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"HOST: \"",
"+",
"SsdpParams",
".",
"getSsd... | Get Datagram from serviceType.
@param serviceType the serviceType
@return the DatagramPacket matching the search request | [
"Get",
"Datagram",
"from",
"serviceType",
"."
] | train | https://github.com/resourcepool/ssdp-client/blob/5c44131c159189e53dfed712bc10b8b3444776b6/src/main/java/io/resourcepool/ssdp/client/request/SsdpDiscovery.java#L22-L31 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.sunionstore | @Override
public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sunionstore(dstkey, keys);
return client.getIntegerReply();
} | java | @Override
public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
checkIsInMultiOrPipeline();
client.sunionstore(dstkey, keys);
return client.getIntegerReply();
} | [
"@",
"Override",
"public",
"Long",
"sunionstore",
"(",
"final",
"byte",
"[",
"]",
"dstkey",
",",
"final",
"byte",
"[",
"]",
"...",
"keys",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"sunionstore",
"(",
"dstkey",
",",
"keys",
")",... | This command works exactly like {@link #sunion(byte[]...) SUNION} but instead of being returned
the resulting set is stored as dstkey. Any existing value in dstkey will be over-written.
<p>
Time complexity O(N) where N is the total number of elements in all the provided sets
@param dstkey
@param keys
@return Status code reply | [
"This",
"command",
"works",
"exactly",
"like",
"{"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1570-L1575 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlCreateDurableImpl.java | ControlCreateDurableImpl.getDurableSelectorNamespaceMap | public Map<String,String> getDurableSelectorNamespaceMap() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDurableSelectorNamespaceMap");
Map<String,String> map = null;
if (jmo.getChoiceField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP) == ControlAccess.IS_BODY_CREATEDURABLE_NAMESPACEMAP_MAP) {
List<String> names = (List<String>)jmo.getField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP_MAP_NAME);
List<Object> values = (List<Object>)jmo.getField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP_MAP_VALUE);
map = (Map<String,String>)(Map<String,?>)new JsMsgMap(names, values);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDurableSelectorNamespaceMap", map);
return map;
} | java | public Map<String,String> getDurableSelectorNamespaceMap() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDurableSelectorNamespaceMap");
Map<String,String> map = null;
if (jmo.getChoiceField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP) == ControlAccess.IS_BODY_CREATEDURABLE_NAMESPACEMAP_MAP) {
List<String> names = (List<String>)jmo.getField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP_MAP_NAME);
List<Object> values = (List<Object>)jmo.getField(ControlAccess.BODY_CREATEDURABLE_NAMESPACEMAP_MAP_VALUE);
map = (Map<String,String>)(Map<String,?>)new JsMsgMap(names, values);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDurableSelectorNamespaceMap", map);
return map;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getDurableSelectorNamespaceMap",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",... | Get the map of prefixes to namespace URLs that are associated with the selector.
@return the map of namespace prefixes | [
"Get",
"the",
"map",
"of",
"prefixes",
"to",
"namespace",
"URLs",
"that",
"are",
"associated",
"with",
"the",
"selector",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlCreateDurableImpl.java#L158-L168 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.createParameterizedType | public static ParameterizedType createParameterizedType(Class<?> rawClass, Type... genericTypes) {
return new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return genericTypes;
}
@Override
public Type getRawType() {
return rawClass;
}
@Override
public Type getOwnerType() {
return null;
}
};
} | java | public static ParameterizedType createParameterizedType(Class<?> rawClass, Type... genericTypes) {
return new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return genericTypes;
}
@Override
public Type getRawType() {
return rawClass;
}
@Override
public Type getOwnerType() {
return null;
}
};
} | [
"public",
"static",
"ParameterizedType",
"createParameterizedType",
"(",
"Class",
"<",
"?",
">",
"rawClass",
",",
"Type",
"...",
"genericTypes",
")",
"{",
"return",
"new",
"ParameterizedType",
"(",
")",
"{",
"@",
"Override",
"public",
"Type",
"[",
"]",
"getAct... | Create a parameterized type from a raw class and its type arguments.
@param rawClass the raw class to construct the parameterized type
@param genericTypes the generic arguments
@return the parameterized type | [
"Create",
"a",
"parameterized",
"type",
"from",
"a",
"raw",
"class",
"and",
"its",
"type",
"arguments",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L154-L171 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.readDocument | public ReadDocumentResponse readDocument(String documentId, long expireInSeconds) {
ReadDocumentRequest request = new ReadDocumentRequest();
request.setDocumentId(documentId);
request.setExpireInSeconds(expireInSeconds);
return this.readDocument(request);
} | java | public ReadDocumentResponse readDocument(String documentId, long expireInSeconds) {
ReadDocumentRequest request = new ReadDocumentRequest();
request.setDocumentId(documentId);
request.setExpireInSeconds(expireInSeconds);
return this.readDocument(request);
} | [
"public",
"ReadDocumentResponse",
"readDocument",
"(",
"String",
"documentId",
",",
"long",
"expireInSeconds",
")",
"{",
"ReadDocumentRequest",
"request",
"=",
"new",
"ReadDocumentRequest",
"(",
")",
";",
"request",
".",
"setDocumentId",
"(",
"documentId",
")",
";",... | read a Document, get document reader infomation.
@param documentId The document id.
@param expireInSeconds The expire time
@return A ReadDocumentResponse object containing the information returned by Document. | [
"read",
"a",
"Document",
"get",
"document",
"reader",
"infomation",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L734-L739 |
andrehertwig/admintool | admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/service/validation/AbstractValidator.java | AbstractValidator.sortInterceptors | protected <I extends AdminToolValidationInterceptor<O>> void sortInterceptors(List<I> interceptors) {
if (!CollectionUtils.isEmpty(interceptors)) {
int amount = interceptors != null ? interceptors.size() : 0;
LOGGER.debug(amount + " interceptors configured for " + getMessageArea());
Collections.sort(interceptors, new Comparator<I>() {
@Override
public int compare(I o1, I o2) {
return Integer.compare(o1.getPrecedence(), o2.getPrecedence());
}
});
for (AdminToolValidationInterceptor<O> interceptor : interceptors) {
LOGGER.debug(" precedence: " + interceptor.getPrecedence() + ", class: " + interceptor.getClass().getSimpleName());
}
}
} | java | protected <I extends AdminToolValidationInterceptor<O>> void sortInterceptors(List<I> interceptors) {
if (!CollectionUtils.isEmpty(interceptors)) {
int amount = interceptors != null ? interceptors.size() : 0;
LOGGER.debug(amount + " interceptors configured for " + getMessageArea());
Collections.sort(interceptors, new Comparator<I>() {
@Override
public int compare(I o1, I o2) {
return Integer.compare(o1.getPrecedence(), o2.getPrecedence());
}
});
for (AdminToolValidationInterceptor<O> interceptor : interceptors) {
LOGGER.debug(" precedence: " + interceptor.getPrecedence() + ", class: " + interceptor.getClass().getSimpleName());
}
}
} | [
"protected",
"<",
"I",
"extends",
"AdminToolValidationInterceptor",
"<",
"O",
">",
">",
"void",
"sortInterceptors",
"(",
"List",
"<",
"I",
">",
"interceptors",
")",
"{",
"if",
"(",
"!",
"CollectionUtils",
".",
"isEmpty",
"(",
"interceptors",
")",
")",
"{",
... | sorts the interceptors against its precedence
@param interceptors | [
"sorts",
"the",
"interceptors",
"against",
"its",
"precedence"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/service/validation/AbstractValidator.java#L59-L74 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerBinding | public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) {
registerConverter(key.invert(), new FromUnmarshallerConverter<S,T>(converter));
registerConverter(key, new ToMarshallerConverter<S,T>(converter));
} | java | public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) {
registerConverter(key.invert(), new FromUnmarshallerConverter<S,T>(converter));
registerConverter(key, new ToMarshallerConverter<S,T>(converter));
} | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerBinding",
"(",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"key",
",",
"Binding",
"<",
"S",
",",
"T",
">",
"converter",
")",
"{",
"registerConverter",
"(",
"key",
".",
"invert",
"(",
")",
",... | Register a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the binding. The source can be marshalled
into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
@param key Converter Key to use
@param converter The binding to be registered | [
"Register",
"a",
"Binding",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"A",
"binding",
"unifies",
"a",
"marshaller",
"and",
"an",
"unmarshaller",
"and",
"both",
"must",
"be",
"available",
"to",
"resolve",
"a",
"binding",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L609-L612 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.logAndGetAmazonServiceException | private String logAndGetAmazonServiceException(AmazonServiceException ase, String action) {
String errorMessage = "AmazonServiceException: " + action + ". RequestId: " + ase.getRequestId() +
"\nHTTPStatusCode: " + ase.getStatusCode() + " AmazonErrorCode: " +
ase.getErrorCode();
LOG.error(errorMessage, ase);
return errorMessage;
} | java | private String logAndGetAmazonServiceException(AmazonServiceException ase, String action) {
String errorMessage = "AmazonServiceException: " + action + ". RequestId: " + ase.getRequestId() +
"\nHTTPStatusCode: " + ase.getStatusCode() + " AmazonErrorCode: " +
ase.getErrorCode();
LOG.error(errorMessage, ase);
return errorMessage;
} | [
"private",
"String",
"logAndGetAmazonServiceException",
"(",
"AmazonServiceException",
"ase",
",",
"String",
"action",
")",
"{",
"String",
"errorMessage",
"=",
"\"AmazonServiceException: \"",
"+",
"action",
"+",
"\". RequestId: \"",
"+",
"ase",
".",
"getRequestId",
"(",... | Create generic error message for <code>AmazonServiceException</code>. Message include
Action, RequestId, HTTPStatusCode, and AmazonErrorCode. | [
"Create",
"generic",
"error",
"message",
"for",
"<code",
">",
"AmazonServiceException<",
"/",
"code",
">",
".",
"Message",
"include",
"Action",
"RequestId",
"HTTPStatusCode",
"and",
"AmazonErrorCode",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L401-L407 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.pbc | public PBConstraint pbc(final CType comparator, final int rhs, final List<? extends Literal> literals, final List<Integer> coefficients) {
final int[] cfs = new int[coefficients.size()];
for (int i = 0; i < coefficients.size(); i++)
cfs[i] = coefficients.get(i);
return this.constructPBC(comparator, rhs, literals.toArray(new Literal[0]), cfs);
} | java | public PBConstraint pbc(final CType comparator, final int rhs, final List<? extends Literal> literals, final List<Integer> coefficients) {
final int[] cfs = new int[coefficients.size()];
for (int i = 0; i < coefficients.size(); i++)
cfs[i] = coefficients.get(i);
return this.constructPBC(comparator, rhs, literals.toArray(new Literal[0]), cfs);
} | [
"public",
"PBConstraint",
"pbc",
"(",
"final",
"CType",
"comparator",
",",
"final",
"int",
"rhs",
",",
"final",
"List",
"<",
"?",
"extends",
"Literal",
">",
"literals",
",",
"final",
"List",
"<",
"Integer",
">",
"coefficients",
")",
"{",
"final",
"int",
... | Creates a new pseudo-Boolean constraint.
@param comparator the comparator of the constraint
@param rhs the right-hand side of the constraint
@param literals the literals of the constraint
@param coefficients the coefficients of the constraint
@return the pseudo-Boolean constraint
@throws IllegalArgumentException if the number of literals and coefficients do not correspond | [
"Creates",
"a",
"new",
"pseudo",
"-",
"Boolean",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L721-L726 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsOuTree.java | CmsOuTree.getIconCaptionHTML | private String getIconCaptionHTML(Object item, I_CmsOuTreeType type) {
CmsCssIcon icon = type.getIcon();
String caption = type.getName();
if (item instanceof CmsOrganizationalUnit) {
CmsOrganizationalUnit ou = (CmsOrganizationalUnit)item;
if (ou.hasFlagWebuser()) {
icon = new CmsCssIcon(OpenCmsTheme.ICON_OU_WEB);
}
caption = (ou.equals(m_rootSystemOU) ? ou.getDisplayName(A_CmsUI.get().getLocale()) : ou.getName());
}
if (item instanceof CmsGroup) {
//Real group shown under groups
caption = ((CmsGroup)item).getName();
icon = m_app.getGroupIcon((CmsGroup)item);
}
if (item instanceof CmsRole) {
//Real group shown under groups
caption = ((CmsRole)item).getName(A_CmsUI.get().getLocale());
}
if (icon != null) {
return "<span class=\"o-resource-icon\">"
+ icon.getHtml()
+ "</span>"
+ "<span class=\"o-tree-caption\">"
+ caption
+ "</span>";
}
return "";
} | java | private String getIconCaptionHTML(Object item, I_CmsOuTreeType type) {
CmsCssIcon icon = type.getIcon();
String caption = type.getName();
if (item instanceof CmsOrganizationalUnit) {
CmsOrganizationalUnit ou = (CmsOrganizationalUnit)item;
if (ou.hasFlagWebuser()) {
icon = new CmsCssIcon(OpenCmsTheme.ICON_OU_WEB);
}
caption = (ou.equals(m_rootSystemOU) ? ou.getDisplayName(A_CmsUI.get().getLocale()) : ou.getName());
}
if (item instanceof CmsGroup) {
//Real group shown under groups
caption = ((CmsGroup)item).getName();
icon = m_app.getGroupIcon((CmsGroup)item);
}
if (item instanceof CmsRole) {
//Real group shown under groups
caption = ((CmsRole)item).getName(A_CmsUI.get().getLocale());
}
if (icon != null) {
return "<span class=\"o-resource-icon\">"
+ icon.getHtml()
+ "</span>"
+ "<span class=\"o-tree-caption\">"
+ caption
+ "</span>";
}
return "";
} | [
"private",
"String",
"getIconCaptionHTML",
"(",
"Object",
"item",
",",
"I_CmsOuTreeType",
"type",
")",
"{",
"CmsCssIcon",
"icon",
"=",
"type",
".",
"getIcon",
"(",
")",
";",
"String",
"caption",
"=",
"type",
".",
"getName",
"(",
")",
";",
"if",
"(",
"ite... | Get HTML for icon and item caption.<p>
@param item item to get icon and caption for
@param type type
@return html | [
"Get",
"HTML",
"for",
"icon",
"and",
"item",
"caption",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsOuTree.java#L395-L427 |
samskivert/samskivert | src/main/java/com/samskivert/swing/Controller.java | Controller.postAction | public static void postAction (
Component source, String command, Object argument)
{
// slip things onto the event queue for later
CommandEvent event = new CommandEvent(source, command, argument);
EventQueue.invokeLater(new ActionInvoker(event));
} | java | public static void postAction (
Component source, String command, Object argument)
{
// slip things onto the event queue for later
CommandEvent event = new CommandEvent(source, command, argument);
EventQueue.invokeLater(new ActionInvoker(event));
} | [
"public",
"static",
"void",
"postAction",
"(",
"Component",
"source",
",",
"String",
"command",
",",
"Object",
"argument",
")",
"{",
"// slip things onto the event queue for later",
"CommandEvent",
"event",
"=",
"new",
"CommandEvent",
"(",
"source",
",",
"command",
... | Like {@link #postAction(ActionEvent)} except that it constructs a
{@link CommandEvent} with the supplied source component, string
command and argument. | [
"Like",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Controller.java#L123-L129 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_service_serviceName_offerChange_POST | public void billingAccount_service_serviceName_offerChange_POST(String billingAccount, String serviceName, String offer) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/offerChange";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "offer", offer);
exec(qPath, "POST", sb.toString(), o);
} | java | public void billingAccount_service_serviceName_offerChange_POST(String billingAccount, String serviceName, String offer) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/offerChange";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "offer", offer);
exec(qPath, "POST", sb.toString(), o);
} | [
"public",
"void",
"billingAccount_service_serviceName_offerChange_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/service/{serviceName}/offerC... | Add a new offer change
REST: POST /telephony/{billingAccount}/service/{serviceName}/offerChange
@param offer [required] The future offer
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Add",
"a",
"new",
"offer",
"change"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4135-L4141 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/impl/InternalPartitionServiceImpl.java | InternalPartitionServiceImpl.createPartitionStateInternal | public PartitionRuntimeState createPartitionStateInternal() {
lock.lock();
try {
if (!partitionStateManager.isInitialized()) {
return null;
}
List<MigrationInfo> completedMigrations = migrationManager.getCompletedMigrationsCopy();
InternalPartition[] partitions = partitionStateManager.getPartitions();
PartitionRuntimeState state = new PartitionRuntimeState(partitions, completedMigrations, getPartitionStateVersion());
state.setActiveMigration(migrationManager.getActiveMigration());
return state;
} finally {
lock.unlock();
}
} | java | public PartitionRuntimeState createPartitionStateInternal() {
lock.lock();
try {
if (!partitionStateManager.isInitialized()) {
return null;
}
List<MigrationInfo> completedMigrations = migrationManager.getCompletedMigrationsCopy();
InternalPartition[] partitions = partitionStateManager.getPartitions();
PartitionRuntimeState state = new PartitionRuntimeState(partitions, completedMigrations, getPartitionStateVersion());
state.setActiveMigration(migrationManager.getActiveMigration());
return state;
} finally {
lock.unlock();
}
} | [
"public",
"PartitionRuntimeState",
"createPartitionStateInternal",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"partitionStateManager",
".",
"isInitialized",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"M... | Returns a copy of the partition table or {@code null} if not initialized. This method will acquire the partition service
lock. | [
"Returns",
"a",
"copy",
"of",
"the",
"partition",
"table",
"or",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/InternalPartitionServiceImpl.java#L421-L437 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.listNext | public PagedList<ComputeNode> listNext(final String nextPageLink, final ComputeNodeListNextOptions computeNodeListNextOptions) {
ServiceResponseWithHeaders<Page<ComputeNode>, ComputeNodeListHeaders> response = listNextSinglePageAsync(nextPageLink, computeNodeListNextOptions).toBlocking().single();
return new PagedList<ComputeNode>(response.body()) {
@Override
public Page<ComputeNode> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink, computeNodeListNextOptions).toBlocking().single().body();
}
};
} | java | public PagedList<ComputeNode> listNext(final String nextPageLink, final ComputeNodeListNextOptions computeNodeListNextOptions) {
ServiceResponseWithHeaders<Page<ComputeNode>, ComputeNodeListHeaders> response = listNextSinglePageAsync(nextPageLink, computeNodeListNextOptions).toBlocking().single();
return new PagedList<ComputeNode>(response.body()) {
@Override
public Page<ComputeNode> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink, computeNodeListNextOptions).toBlocking().single().body();
}
};
} | [
"public",
"PagedList",
"<",
"ComputeNode",
">",
"listNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"ComputeNodeListNextOptions",
"computeNodeListNextOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"ComputeNode",
">",
",",
"ComputeNodeL... | Lists the compute nodes in the specified pool.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param computeNodeListNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the PagedList<ComputeNode> object if successful. | [
"Lists",
"the",
"compute",
"nodes",
"in",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L3013-L3021 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/io/Closeables.java | Closeables.closeableFrom | public static Closeable closeableFrom(@WillNotClose @Nullable final Connection connection) {
return closeableFrom(connection, Connection::close);
} | java | public static Closeable closeableFrom(@WillNotClose @Nullable final Connection connection) {
return closeableFrom(connection, Connection::close);
} | [
"public",
"static",
"Closeable",
"closeableFrom",
"(",
"@",
"WillNotClose",
"@",
"Nullable",
"final",
"Connection",
"connection",
")",
"{",
"return",
"closeableFrom",
"(",
"connection",
",",
"Connection",
"::",
"close",
")",
";",
"}"
] | Provides {@link Closeable} interface for {@link Connection}
@param connection the connection to decorate
@return a closeable decorated connection | [
"Provides",
"{",
"@link",
"Closeable",
"}",
"interface",
"for",
"{",
"@link",
"Connection",
"}"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/io/Closeables.java#L38-L40 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java | HtmlWriter.getResource | public Content getResource(String key, Object o) {
return configuration.getResource(key, o);
} | java | public Content getResource(String key, Object o) {
return configuration.getResource(key, o);
} | [
"public",
"Content",
"getResource",
"(",
"String",
"key",
",",
"Object",
"o",
")",
"{",
"return",
"configuration",
".",
"getResource",
"(",
"key",
",",
"o",
")",
";",
"}"
] | Get the configuration string as a content.
@param key the key to look for in the configuration file
@param o string or content argument added to configuration text
@return a content tree for the text | [
"Get",
"the",
"configuration",
"string",
"as",
"a",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java#L265-L267 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.canSwapCols | public static boolean canSwapCols(Matrix matrix, int col1, int col2, int row1) {
boolean response = true;
for (int row = row1 + 1; row < matrix.getRowCount(); ++row) {
if (0 == matrix.getAsDouble(row, col1)) {
if (0 != matrix.getAsDouble(row, col2)) {
response = false;
break;
}
}
}
return response;
} | java | public static boolean canSwapCols(Matrix matrix, int col1, int col2, int row1) {
boolean response = true;
for (int row = row1 + 1; row < matrix.getRowCount(); ++row) {
if (0 == matrix.getAsDouble(row, col1)) {
if (0 != matrix.getAsDouble(row, col2)) {
response = false;
break;
}
}
}
return response;
} | [
"public",
"static",
"boolean",
"canSwapCols",
"(",
"Matrix",
"matrix",
",",
"int",
"col1",
",",
"int",
"col2",
",",
"int",
"row1",
")",
"{",
"boolean",
"response",
"=",
"true",
";",
"for",
"(",
"int",
"row",
"=",
"row1",
"+",
"1",
";",
"row",
"<",
... | Check to see if columns can be swapped - part of the bandwidth reduction
algorithm.
@param matrix
the matrix to check
@param col1
the first column
@param col2
the second column
@param row1
the row
@return true if the columns can be swapped | [
"Check",
"to",
"see",
"if",
"columns",
"can",
"be",
"swapped",
"-",
"part",
"of",
"the",
"bandwidth",
"reduction",
"algorithm",
"."
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L892-L903 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/PropertiesLightblueClientConfiguration.java | PropertiesLightblueClientConfiguration.loadInputStream | private static Reader loadInputStream(InputStream propertiesStream) throws IOException {
StringBuilder buff = new StringBuilder();
try (InputStreamReader isr = new InputStreamReader(propertiesStream, Charset.defaultCharset());
BufferedReader reader = new BufferedReader(isr)) {
String line;
while ((line = reader.readLine()) != null) {
buff.append(line).append("\n");
}
}
return new StringReader(StrSubstitutor.replaceSystemProperties(buff.toString()));
} | java | private static Reader loadInputStream(InputStream propertiesStream) throws IOException {
StringBuilder buff = new StringBuilder();
try (InputStreamReader isr = new InputStreamReader(propertiesStream, Charset.defaultCharset());
BufferedReader reader = new BufferedReader(isr)) {
String line;
while ((line = reader.readLine()) != null) {
buff.append(line).append("\n");
}
}
return new StringReader(StrSubstitutor.replaceSystemProperties(buff.toString()));
} | [
"private",
"static",
"Reader",
"loadInputStream",
"(",
"InputStream",
"propertiesStream",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"(",
"InputStreamReader",
"isr",
"=",
"new",
"InputStreamReader",... | Reads the {@link InputStream} and substitutes system properties.
@return {@link Reader} | [
"Reads",
"the",
"{",
"@link",
"InputStream",
"}",
"and",
"substitutes",
"system",
"properties",
"."
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/PropertiesLightblueClientConfiguration.java#L172-L184 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printDebug | public static void printDebug(final int[] pIntArray, final PrintStream pPrintStream) {
if (pPrintStream == null) {
System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
return;
}
if (pIntArray == null) {
pPrintStream.println(INTARRAY_IS_NULL_ERROR_MESSAGE);
return;
}
for (int i = 0; i < pIntArray.length; i++) {
pPrintStream.println(pIntArray[i]);
}
} | java | public static void printDebug(final int[] pIntArray, final PrintStream pPrintStream) {
if (pPrintStream == null) {
System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
return;
}
if (pIntArray == null) {
pPrintStream.println(INTARRAY_IS_NULL_ERROR_MESSAGE);
return;
}
for (int i = 0; i < pIntArray.length; i++) {
pPrintStream.println(pIntArray[i]);
}
} | [
"public",
"static",
"void",
"printDebug",
"(",
"final",
"int",
"[",
"]",
"pIntArray",
",",
"final",
"PrintStream",
"pPrintStream",
")",
"{",
"if",
"(",
"pPrintStream",
"==",
"null",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"PRINTSTREAM_IS_NULL_ER... | Prints the content of a {@code int[]} to a {@code java.io.PrintStream}.
<p>
@param pIntArray the {@code int[]} to be printed.
@param pPrintStream the {@code java.io.PrintStream} for flushing the results. | [
"Prints",
"the",
"content",
"of",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L317-L330 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/CanvasApiFactory.java | CanvasApiFactory.getReader | public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken) {
return getReader(type, oauthToken, null);
} | java | public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken) {
return getReader(type, oauthToken, null);
} | [
"public",
"<",
"T",
"extends",
"CanvasReader",
">",
"T",
"getReader",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"OauthToken",
"oauthToken",
")",
"{",
"return",
"getReader",
"(",
"type",
",",
"oauthToken",
",",
"null",
")",
";",
"}"
] | Get a reader implementation class to perform API calls with.
@param type Interface type you wish to get an implementation for
@param oauthToken An OAuth token to use for authentication when making API calls
@param <T> The reader type to request an instance of
@return A reader implementation class | [
"Get",
"a",
"reader",
"implementation",
"class",
"to",
"perform",
"API",
"calls",
"with",
"."
] | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java#L67-L69 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/PassThruTable.java | PassThruTable.copyKeys | public void copyKeys(Record recAlt, Record recMain, int iKeyArea)
{
BaseBuffer vector = new VectorBuffer(null);
KeyArea keyMain = recMain.getKeyArea(iKeyArea);
KeyArea keyAlt = recAlt.getKeyArea(iKeyArea);
keyMain.setupKeyBuffer(vector, DBConstants.FILE_KEY_AREA);
keyAlt.reverseKeyBuffer(vector, DBConstants.FILE_KEY_AREA); // Move these keys back to the record
vector.free();
} | java | public void copyKeys(Record recAlt, Record recMain, int iKeyArea)
{
BaseBuffer vector = new VectorBuffer(null);
KeyArea keyMain = recMain.getKeyArea(iKeyArea);
KeyArea keyAlt = recAlt.getKeyArea(iKeyArea);
keyMain.setupKeyBuffer(vector, DBConstants.FILE_KEY_AREA);
keyAlt.reverseKeyBuffer(vector, DBConstants.FILE_KEY_AREA); // Move these keys back to the record
vector.free();
} | [
"public",
"void",
"copyKeys",
"(",
"Record",
"recAlt",
",",
"Record",
"recMain",
",",
"int",
"iKeyArea",
")",
"{",
"BaseBuffer",
"vector",
"=",
"new",
"VectorBuffer",
"(",
"null",
")",
";",
"KeyArea",
"keyMain",
"=",
"recMain",
".",
"getKeyArea",
"(",
"iKe... | Copy the fields from the (main) source to the (mirrored) destination record.
This is done before any write or set.
@param recAlt Destination record
@param recMain Source record | [
"Copy",
"the",
"fields",
"from",
"the",
"(",
"main",
")",
"source",
"to",
"the",
"(",
"mirrored",
")",
"destination",
"record",
".",
"This",
"is",
"done",
"before",
"any",
"write",
"or",
"set",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/PassThruTable.java#L558-L566 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCopy.java | PdfCopy.getImportedPage | public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber) {
if (currentPdfReaderInstance != null) {
if (currentPdfReaderInstance.getReader() != reader) {
try {
currentPdfReaderInstance.getReader().close();
currentPdfReaderInstance.getReaderFile().close();
}
catch (IOException ioe) {
// empty on purpose
}
currentPdfReaderInstance = reader.getPdfReaderInstance(this);
}
}
else {
currentPdfReaderInstance = reader.getPdfReaderInstance(this);
}
return currentPdfReaderInstance.getImportedPage(pageNumber);
} | java | public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber) {
if (currentPdfReaderInstance != null) {
if (currentPdfReaderInstance.getReader() != reader) {
try {
currentPdfReaderInstance.getReader().close();
currentPdfReaderInstance.getReaderFile().close();
}
catch (IOException ioe) {
// empty on purpose
}
currentPdfReaderInstance = reader.getPdfReaderInstance(this);
}
}
else {
currentPdfReaderInstance = reader.getPdfReaderInstance(this);
}
return currentPdfReaderInstance.getImportedPage(pageNumber);
} | [
"public",
"PdfImportedPage",
"getImportedPage",
"(",
"PdfReader",
"reader",
",",
"int",
"pageNumber",
")",
"{",
"if",
"(",
"currentPdfReaderInstance",
"!=",
"null",
")",
"{",
"if",
"(",
"currentPdfReaderInstance",
".",
"getReader",
"(",
")",
"!=",
"reader",
")",... | Grabs a page from the input document
@param reader the reader of the document
@param pageNumber which page to get
@return the page | [
"Grabs",
"a",
"page",
"from",
"the",
"input",
"document"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCopy.java#L160-L177 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/sections/SectionLoader.java | SectionLoader.addressIsWithin | private static boolean addressIsWithin(Location location, long address) {
long endpoint = location.from() + location.size();
return address >= location.from() && address < endpoint;
} | java | private static boolean addressIsWithin(Location location, long address) {
long endpoint = location.from() + location.size();
return address >= location.from() && address < endpoint;
} | [
"private",
"static",
"boolean",
"addressIsWithin",
"(",
"Location",
"location",
",",
"long",
"address",
")",
"{",
"long",
"endpoint",
"=",
"location",
".",
"from",
"(",
")",
"+",
"location",
".",
"size",
"(",
")",
";",
"return",
"address",
">=",
"location"... | Returns true if the address is within the given location
@param location
@param address
a address that may point into the section
@return true iff address is within location | [
"Returns",
"true",
"if",
"the",
"address",
"is",
"within",
"the",
"given",
"location"
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/sections/SectionLoader.java#L421-L424 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java | AssetUtil.getClassLoaderResourceName | public static String getClassLoaderResourceName(Package resourcePackage, String resourceName) {
String resourcePackaeName = resourcePackage.getName().replaceAll(DELIMITER_CLASS_NAME_PATH,
DELIMITER_RESOURCE_PATH);
return resourcePackaeName + DELIMITER_RESOURCE_PATH + resourceName;
} | java | public static String getClassLoaderResourceName(Package resourcePackage, String resourceName) {
String resourcePackaeName = resourcePackage.getName().replaceAll(DELIMITER_CLASS_NAME_PATH,
DELIMITER_RESOURCE_PATH);
return resourcePackaeName + DELIMITER_RESOURCE_PATH + resourceName;
} | [
"public",
"static",
"String",
"getClassLoaderResourceName",
"(",
"Package",
"resourcePackage",
",",
"String",
"resourceName",
")",
"{",
"String",
"resourcePackaeName",
"=",
"resourcePackage",
".",
"getName",
"(",
")",
".",
"replaceAll",
"(",
"DELIMITER_CLASS_NAME_PATH",... | Helper to convert from java package name to class loader package name <br/>
<br/>
ie: javax.test + my.txt = javax/test/ + my.txt
@param resourcePackage
The base package
@param resourceName
The resource inside the package.
@return {@link ClassLoader} resource location | [
"Helper",
"to",
"convert",
"from",
"java",
"package",
"name",
"to",
"class",
"loader",
"package",
"name",
"<br",
"/",
">",
"<br",
"/",
">",
"ie",
":",
"javax",
".",
"test",
"+",
"my",
".",
"txt",
"=",
"javax",
"/",
"test",
"/",
"+",
"my",
".",
"t... | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java#L92-L97 |
mojohaus/webstart | webstart-jnlp-servlet/src/main/java/jnlp/sample/servlet/ResourceCatalog.java | ResourceCatalog.prefixMatchLists | public boolean prefixMatchLists( String[] prefixes, String[] keys )
{
// The prefixes are part of the server resources. If none is given,
// everything matches
if ( prefixes == null )
{
return true;
}
// If no os keyes was given, and the server resource is keyed of this,
// then return false.
if ( keys == null )
{
return false;
}
// Check for a match on a key
for ( String key : keys )
{
if ( prefixMatchStringList( prefixes, key ) )
{
return true;
}
}
return false;
} | java | public boolean prefixMatchLists( String[] prefixes, String[] keys )
{
// The prefixes are part of the server resources. If none is given,
// everything matches
if ( prefixes == null )
{
return true;
}
// If no os keyes was given, and the server resource is keyed of this,
// then return false.
if ( keys == null )
{
return false;
}
// Check for a match on a key
for ( String key : keys )
{
if ( prefixMatchStringList( prefixes, key ) )
{
return true;
}
}
return false;
} | [
"public",
"boolean",
"prefixMatchLists",
"(",
"String",
"[",
"]",
"prefixes",
",",
"String",
"[",
"]",
"keys",
")",
"{",
"// The prefixes are part of the server resources. If none is given,",
"// everything matches",
"if",
"(",
"prefixes",
"==",
"null",
")",
"{",
"ret... | /* Return true if at least one of the strings in 'prefixes' are a prefix
to at least one of the 'keys'. | [
"/",
"*",
"Return",
"true",
"if",
"at",
"least",
"one",
"of",
"the",
"strings",
"in",
"prefixes",
"are",
"a",
"prefix",
"to",
"at",
"least",
"one",
"of",
"the",
"keys",
"."
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-jnlp-servlet/src/main/java/jnlp/sample/servlet/ResourceCatalog.java#L296-L319 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.rnnSetPreviousState | public void rnnSetPreviousState(String layerName, Map<String, INDArray> state) {
Layer l = verticesMap.get(layerName).getLayer();
if(l instanceof org.deeplearning4j.nn.layers.wrapper.BaseWrapperLayer){
l = ((org.deeplearning4j.nn.layers.wrapper.BaseWrapperLayer)l).getUnderlying();
}
if (l == null || !(l instanceof RecurrentLayer)) {
throw new UnsupportedOperationException(
"Layer \"" + layerName + "\" is not a recurrent layer. Cannot set state");
}
((RecurrentLayer) l).rnnSetPreviousState(state);
} | java | public void rnnSetPreviousState(String layerName, Map<String, INDArray> state) {
Layer l = verticesMap.get(layerName).getLayer();
if(l instanceof org.deeplearning4j.nn.layers.wrapper.BaseWrapperLayer){
l = ((org.deeplearning4j.nn.layers.wrapper.BaseWrapperLayer)l).getUnderlying();
}
if (l == null || !(l instanceof RecurrentLayer)) {
throw new UnsupportedOperationException(
"Layer \"" + layerName + "\" is not a recurrent layer. Cannot set state");
}
((RecurrentLayer) l).rnnSetPreviousState(state);
} | [
"public",
"void",
"rnnSetPreviousState",
"(",
"String",
"layerName",
",",
"Map",
"<",
"String",
",",
"INDArray",
">",
"state",
")",
"{",
"Layer",
"l",
"=",
"verticesMap",
".",
"get",
"(",
"layerName",
")",
".",
"getLayer",
"(",
")",
";",
"if",
"(",
"l"... | Set the state of the RNN layer, for use in {@link #rnnTimeStep(INDArray...)}
@param layerName The name of the layer.
@param state The state to set the specified layer to | [
"Set",
"the",
"state",
"of",
"the",
"RNN",
"layer",
"for",
"use",
"in",
"{",
"@link",
"#rnnTimeStep",
"(",
"INDArray",
"...",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L3515-L3525 |
shrinkwrap/descriptors | metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/Metadata.java | Metadata.addEnumValue | public void addEnumValue(final String enumName, final String enumValue) {
for (MetadataEnum instance : enumList) {
if (instance.getName().equals(enumName) && instance.getNamespace().equals(getCurrentNamespace())) {
instance.addValue(enumValue);
return;
}
}
final MetadataEnum newEnum = new MetadataEnum(enumName);
newEnum.addValue(enumValue);
newEnum.setNamespace(getCurrentNamespace());
newEnum.setSchemaName(getCurrentSchmema());
newEnum.setPackageApi(getCurrentPackageApi());
enumList.add(newEnum);
} | java | public void addEnumValue(final String enumName, final String enumValue) {
for (MetadataEnum instance : enumList) {
if (instance.getName().equals(enumName) && instance.getNamespace().equals(getCurrentNamespace())) {
instance.addValue(enumValue);
return;
}
}
final MetadataEnum newEnum = new MetadataEnum(enumName);
newEnum.addValue(enumValue);
newEnum.setNamespace(getCurrentNamespace());
newEnum.setSchemaName(getCurrentSchmema());
newEnum.setPackageApi(getCurrentPackageApi());
enumList.add(newEnum);
} | [
"public",
"void",
"addEnumValue",
"(",
"final",
"String",
"enumName",
",",
"final",
"String",
"enumValue",
")",
"{",
"for",
"(",
"MetadataEnum",
"instance",
":",
"enumList",
")",
"{",
"if",
"(",
"instance",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"... | Adds a enumeration value to the specified enumeration name. If no enumeration class is found, then a new
enumeration class will be created.
@param enumName
the enumeration class name.
@param enumValue
the new enumeration value. | [
"Adds",
"a",
"enumeration",
"value",
"to",
"the",
"specified",
"enumeration",
"name",
".",
"If",
"no",
"enumeration",
"class",
"is",
"found",
"then",
"a",
"new",
"enumeration",
"class",
"will",
"be",
"created",
"."
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/Metadata.java#L118-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ConnectionDescriptorImpl.java | ConnectionDescriptorImpl.setAddrs | public void setAddrs(InetAddress _remote, InetAddress _local) {
this.addrRemote = _remote;
this.addrLocal = _local;
this.remoteHostName = null;
this.remoteHostAddress = null;
this.localHostName = null;
this.localHostAddress = null;
} | java | public void setAddrs(InetAddress _remote, InetAddress _local) {
this.addrRemote = _remote;
this.addrLocal = _local;
this.remoteHostName = null;
this.remoteHostAddress = null;
this.localHostName = null;
this.localHostAddress = null;
} | [
"public",
"void",
"setAddrs",
"(",
"InetAddress",
"_remote",
",",
"InetAddress",
"_local",
")",
"{",
"this",
".",
"addrRemote",
"=",
"_remote",
";",
"this",
".",
"addrLocal",
"=",
"_local",
";",
"this",
".",
"remoteHostName",
"=",
"null",
";",
"this",
".",... | Set the address information based on the input InetAddress objects.
@param _remote
@param _local | [
"Set",
"the",
"address",
"information",
"based",
"on",
"the",
"input",
"InetAddress",
"objects",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ConnectionDescriptorImpl.java#L155-L162 |
OpenLiberty/open-liberty | dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java | CustomUtils.findCustomEncryption | public static List<CustomManifest> findCustomEncryption(String extension) throws IOException {
List<File> dirs = listRootAndExtensionDirectories();
return findCustomEncryption(dirs, TOOL_EXTENSION_DIR + extension);
} | java | public static List<CustomManifest> findCustomEncryption(String extension) throws IOException {
List<File> dirs = listRootAndExtensionDirectories();
return findCustomEncryption(dirs, TOOL_EXTENSION_DIR + extension);
} | [
"public",
"static",
"List",
"<",
"CustomManifest",
">",
"findCustomEncryption",
"(",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"List",
"<",
"File",
">",
"dirs",
"=",
"listRootAndExtensionDirectories",
"(",
")",
";",
"return",
"findCustomEncryption",
... | Find the URL of the jar file which includes specified class.
If there is none, return empty array.
@throws IOException | [
"Find",
"the",
"URL",
"of",
"the",
"jar",
"file",
"which",
"includes",
"specified",
"class",
".",
"If",
"there",
"is",
"none",
"return",
"empty",
"array",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L176-L179 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java | DojoHttpTransport.beforeLayerModule | protected String beforeLayerModule(HttpServletRequest request, ModuleInfo info) {
String result;
String mid = info.getModuleId();
int idx = mid.indexOf("!"); //$NON-NLS-1$
if (info.isScript()) {
result = "\"" + (idx == -1 ? mid : mid.substring(idx+1)) + "\":function(){"; //$NON-NLS-1$ //$NON-NLS-2$
} else {
result = "\"url:" + (idx == -1 ? mid : mid.substring(idx+1)) + "\":"; //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
} | java | protected String beforeLayerModule(HttpServletRequest request, ModuleInfo info) {
String result;
String mid = info.getModuleId();
int idx = mid.indexOf("!"); //$NON-NLS-1$
if (info.isScript()) {
result = "\"" + (idx == -1 ? mid : mid.substring(idx+1)) + "\":function(){"; //$NON-NLS-1$ //$NON-NLS-2$
} else {
result = "\"url:" + (idx == -1 ? mid : mid.substring(idx+1)) + "\":"; //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
} | [
"protected",
"String",
"beforeLayerModule",
"(",
"HttpServletRequest",
"request",
",",
"ModuleInfo",
"info",
")",
"{",
"String",
"result",
";",
"String",
"mid",
"=",
"info",
".",
"getModuleId",
"(",
")",
";",
"int",
"idx",
"=",
"mid",
".",
"indexOf",
"(",
... | Handles
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#BEFORE_FIRST_LAYER_MODULE}
and
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#BEFORE_SUBSEQUENT_LAYER_MODULE}
layer listener events.
@param request
the http request object
@param info
the {@link com.ibm.jaggr.core.transport.IHttpTransport.ModuleInfo} object for the module
@return the layer contribution | [
"Handles",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
".",
"IHttpTransport",
".",
"LayerContributionType#BEFORE_FIRST_LAYER_MODULE",
"}",
"and",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java#L258-L268 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java | FormLayout.maximumLayoutSize | @Override
public Dimension maximumLayoutSize(Container target) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
} | java | @Override
public Dimension maximumLayoutSize(Container target) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
} | [
"@",
"Override",
"public",
"Dimension",
"maximumLayoutSize",
"(",
"Container",
"target",
")",
"{",
"return",
"new",
"Dimension",
"(",
"Integer",
".",
"MAX_VALUE",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}"
] | Returns the maximum dimensions for this layout given the components in the specified target
container.
@param target the container which needs to be laid out
@see Container
@see #minimumLayoutSize(Container)
@see #preferredLayoutSize(Container)
@return the maximum dimensions for this layout | [
"Returns",
"the",
"maximum",
"dimensions",
"for",
"this",
"layout",
"given",
"the",
"components",
"in",
"the",
"specified",
"target",
"container",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java#L1090-L1093 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.doOnRequest | public final HttpClient doOnRequest(BiConsumer<? super HttpClientRequest, ? super Connection> doOnRequest) {
Objects.requireNonNull(doOnRequest, "doOnRequest");
return new HttpClientDoOn(this, doOnRequest, null, null, null);
} | java | public final HttpClient doOnRequest(BiConsumer<? super HttpClientRequest, ? super Connection> doOnRequest) {
Objects.requireNonNull(doOnRequest, "doOnRequest");
return new HttpClientDoOn(this, doOnRequest, null, null, null);
} | [
"public",
"final",
"HttpClient",
"doOnRequest",
"(",
"BiConsumer",
"<",
"?",
"super",
"HttpClientRequest",
",",
"?",
"super",
"Connection",
">",
"doOnRequest",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"doOnRequest",
",",
"\"doOnRequest\"",
")",
";",
"ret... | Setup a callback called when {@link HttpClientRequest} is about to be sent.
@param doOnRequest a consumer observing connected events
@return a new {@link HttpClient} | [
"Setup",
"a",
"callback",
"called",
"when",
"{",
"@link",
"HttpClientRequest",
"}",
"is",
"about",
"to",
"be",
"sent",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L516-L519 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/SemanticHeadFinder.java | SemanticHeadFinder.postOperationFix | @Override
protected int postOperationFix(int headIdx, Tree[] daughterTrees) {
if (headIdx >= 2) {
String prevLab = tlp.basicCategory(daughterTrees[headIdx - 1].value());
if (prevLab.equals("CC") || prevLab.equals("CONJP")) {
int newHeadIdx = headIdx - 2;
Tree t = daughterTrees[newHeadIdx];
while (newHeadIdx >= 0 && t.isPreTerminal() && tlp.isPunctuationTag(t.value())) {
newHeadIdx--;
}
while (newHeadIdx >= 2 && tlp.isPunctuationTag(daughterTrees[newHeadIdx - 1].value())) {
newHeadIdx = newHeadIdx - 2;
}
if (newHeadIdx >= 0) {
headIdx = newHeadIdx;
}
}
}
return headIdx;
} | java | @Override
protected int postOperationFix(int headIdx, Tree[] daughterTrees) {
if (headIdx >= 2) {
String prevLab = tlp.basicCategory(daughterTrees[headIdx - 1].value());
if (prevLab.equals("CC") || prevLab.equals("CONJP")) {
int newHeadIdx = headIdx - 2;
Tree t = daughterTrees[newHeadIdx];
while (newHeadIdx >= 0 && t.isPreTerminal() && tlp.isPunctuationTag(t.value())) {
newHeadIdx--;
}
while (newHeadIdx >= 2 && tlp.isPunctuationTag(daughterTrees[newHeadIdx - 1].value())) {
newHeadIdx = newHeadIdx - 2;
}
if (newHeadIdx >= 0) {
headIdx = newHeadIdx;
}
}
}
return headIdx;
} | [
"@",
"Override",
"protected",
"int",
"postOperationFix",
"(",
"int",
"headIdx",
",",
"Tree",
"[",
"]",
"daughterTrees",
")",
"{",
"if",
"(",
"headIdx",
">=",
"2",
")",
"{",
"String",
"prevLab",
"=",
"tlp",
".",
"basicCategory",
"(",
"daughterTrees",
"[",
... | Overwrite the postOperationFix method: a, b and c -> we want a to be the head | [
"Overwrite",
"the",
"postOperationFix",
"method",
":",
"a",
"b",
"and",
"c",
"-",
">",
"we",
"want",
"a",
"to",
"be",
"the",
"head"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/SemanticHeadFinder.java#L157-L176 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.createIssue | public Issue createIssue(String name, Map<String, Object> attributes) {
return getInstance().create().issue(name, this, attributes);
} | java | public Issue createIssue(String name, Map<String, Object> attributes) {
return getInstance().create().issue(name, this, attributes);
} | [
"public",
"Issue",
"createIssue",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"issue",
"(",
"name",
",",
"this",
",",
"attributes",
")",
... | Create a new Issue in this Project.
@param name The initial name of the Issue.
@param attributes additional attributes for the Issue.
@return A new Issue. | [
"Create",
"a",
"new",
"Issue",
"in",
"this",
"Project",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L314-L316 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ConsumedCapacity.java | ConsumedCapacity.withGlobalSecondaryIndexes | public ConsumedCapacity withGlobalSecondaryIndexes(java.util.Map<String, Capacity> globalSecondaryIndexes) {
setGlobalSecondaryIndexes(globalSecondaryIndexes);
return this;
} | java | public ConsumedCapacity withGlobalSecondaryIndexes(java.util.Map<String, Capacity> globalSecondaryIndexes) {
setGlobalSecondaryIndexes(globalSecondaryIndexes);
return this;
} | [
"public",
"ConsumedCapacity",
"withGlobalSecondaryIndexes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Capacity",
">",
"globalSecondaryIndexes",
")",
"{",
"setGlobalSecondaryIndexes",
"(",
"globalSecondaryIndexes",
")",
";",
"return",
"this",
";",
"}... | <p>
The amount of throughput consumed on each global index affected by the operation.
</p>
@param globalSecondaryIndexes
The amount of throughput consumed on each global index affected by the operation.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"amount",
"of",
"throughput",
"consumed",
"on",
"each",
"global",
"index",
"affected",
"by",
"the",
"operation",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ConsumedCapacity.java#L374-L377 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java | PersistentContext.doWithUser | public <T> T doWithUser(final String user, final SpecificUserAction<T> action) {
return userManager.executeWithTxUser(user, action);
} | java | public <T> T doWithUser(final String user, final SpecificUserAction<T> action) {
return userManager.executeWithTxUser(user, action);
} | [
"public",
"<",
"T",
">",
"T",
"doWithUser",
"(",
"final",
"String",
"user",
",",
"final",
"SpecificUserAction",
"<",
"T",
">",
"action",
")",
"{",
"return",
"userManager",
".",
"executeWithTxUser",
"(",
"user",
",",
"action",
")",
";",
"}"
] | Execute logic with specific user. Changes user only inside transaction.
Used, for example, to force security checks.
<p>
See {@link ru.vyarus.guice.persist.orient.db.user.UserManager#executeWithTxUser(
String, ru.vyarus.guice.persist.orient.db.user.SpecificUserAction)}.
<p>
Use {@link ru.vyarus.guice.persist.orient.db.user.UserManager} directly to change user for
multiple transactions.
<p>
LIMITATION: current user must have read right on users table.
@param user user login
@param action action to execute under user
@param <T> type of returned result (may be Void)
@return action result (may be null) | [
"Execute",
"logic",
"with",
"specific",
"user",
".",
"Changes",
"user",
"only",
"inside",
"transaction",
".",
"Used",
"for",
"example",
"to",
"force",
"security",
"checks",
".",
"<p",
">",
"See",
"{",
"@link",
"ru",
".",
"vyarus",
".",
"guice",
".",
"per... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java#L183-L185 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java | DescribeDenseHogFastAlg.growCellArray | void growCellArray(int imageWidth, int imageHeight) {
cellCols = imageWidth/ pixelsPerCell;
cellRows = imageHeight/ pixelsPerCell;
if( cellRows*cellCols > cells.length ) {
Cell[] a = new Cell[cellCols*cellRows];
System.arraycopy(cells,0,a,0,cells.length);
for (int i = cells.length; i < a.length; i++) {
a[i] = new Cell();
a[i].histogram = new float[ orientationBins ];
}
cells = a;
}
} | java | void growCellArray(int imageWidth, int imageHeight) {
cellCols = imageWidth/ pixelsPerCell;
cellRows = imageHeight/ pixelsPerCell;
if( cellRows*cellCols > cells.length ) {
Cell[] a = new Cell[cellCols*cellRows];
System.arraycopy(cells,0,a,0,cells.length);
for (int i = cells.length; i < a.length; i++) {
a[i] = new Cell();
a[i].histogram = new float[ orientationBins ];
}
cells = a;
}
} | [
"void",
"growCellArray",
"(",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"{",
"cellCols",
"=",
"imageWidth",
"/",
"pixelsPerCell",
";",
"cellRows",
"=",
"imageHeight",
"/",
"pixelsPerCell",
";",
"if",
"(",
"cellRows",
"*",
"cellCols",
">",
"cells",
... | Determines if the cell array needs to grow. If it does a new array is declared. Old data is recycled when
possible | [
"Determines",
"if",
"the",
"cell",
"array",
"needs",
"to",
"grow",
".",
"If",
"it",
"does",
"a",
"new",
"array",
"is",
"declared",
".",
"Old",
"data",
"is",
"recycled",
"when",
"possible"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L104-L118 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.invoke | public static <T> T invoke(String classNameWithMethodName, boolean isSingleton, Object... args) {
if (StrUtil.isBlank(classNameWithMethodName)) {
throw new UtilException("Blank classNameDotMethodName!");
}
int splitIndex = classNameWithMethodName.lastIndexOf('#');
if (splitIndex <= 0) {
splitIndex = classNameWithMethodName.lastIndexOf('.');
}
if (splitIndex <= 0) {
throw new UtilException("Invalid classNameWithMethodName [{}]!", classNameWithMethodName);
}
final String className = classNameWithMethodName.substring(0, splitIndex);
final String methodName = classNameWithMethodName.substring(splitIndex + 1);
return invoke(className, methodName, isSingleton, args);
} | java | public static <T> T invoke(String classNameWithMethodName, boolean isSingleton, Object... args) {
if (StrUtil.isBlank(classNameWithMethodName)) {
throw new UtilException("Blank classNameDotMethodName!");
}
int splitIndex = classNameWithMethodName.lastIndexOf('#');
if (splitIndex <= 0) {
splitIndex = classNameWithMethodName.lastIndexOf('.');
}
if (splitIndex <= 0) {
throw new UtilException("Invalid classNameWithMethodName [{}]!", classNameWithMethodName);
}
final String className = classNameWithMethodName.substring(0, splitIndex);
final String methodName = classNameWithMethodName.substring(splitIndex + 1);
return invoke(className, methodName, isSingleton, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"invoke",
"(",
"String",
"classNameWithMethodName",
",",
"boolean",
"isSingleton",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"classNameWithMethodName",
")",
")",
"{",
"throw",
... | 执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
@param <T> 对象类型
@param classNameWithMethodName 类名和方法名表达式,例如:com.xiaoleilu.hutool.StrUtil#isEmpty或com.xiaoleilu.hutool.StrUtil.isEmpty
@param isSingleton 是否为单例对象,如果此参数为false,每次执行方法时创建一个新对象
@param args 参数,必须严格对应指定方法的参数类型和数量
@return 返回结果 | [
"执行方法<br",
">",
"可执行Private方法,也可执行static方法<br",
">",
"执行非static方法时,必须满足对象有默认构造方法<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L634-L651 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.resetPassword | public void resetPassword(String userName, ResetPasswordPayload resetPasswordPayload) {
resetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).toBlocking().last().body();
} | java | public void resetPassword(String userName, ResetPasswordPayload resetPasswordPayload) {
resetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).toBlocking().last().body();
} | [
"public",
"void",
"resetPassword",
"(",
"String",
"userName",
",",
"ResetPasswordPayload",
"resetPasswordPayload",
")",
"{",
"resetPasswordWithServiceResponseAsync",
"(",
"userName",
",",
"resetPasswordPayload",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",
")",... | Resets the user password on an environment This operation can take a while to complete.
@param userName The name of the user.
@param resetPasswordPayload Represents the payload for resetting passwords.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L932-L934 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.enterPackage | public PackageSymbol enterPackage(Name name, PackageSymbol owner) {
return enterPackage(TypeSymbol.formFullName(name, owner));
} | java | public PackageSymbol enterPackage(Name name, PackageSymbol owner) {
return enterPackage(TypeSymbol.formFullName(name, owner));
} | [
"public",
"PackageSymbol",
"enterPackage",
"(",
"Name",
"name",
",",
"PackageSymbol",
"owner",
")",
"{",
"return",
"enterPackage",
"(",
"TypeSymbol",
".",
"formFullName",
"(",
"name",
",",
"owner",
")",
")",
";",
"}"
] | Make a package, given its unqualified name and enclosing package. | [
"Make",
"a",
"package",
"given",
"its",
"unqualified",
"name",
"and",
"enclosing",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2672-L2674 |
mbenson/uelbox | src/main/java/uelbox/UEL.java | UEL.coerceToType | public static <T> T coerceToType(ELContext context, Class<T> toType, Object object) {
@SuppressWarnings("unchecked")
T result = (T) getExpressionFactory(context).coerceToType(object, toType);
return result;
} | java | public static <T> T coerceToType(ELContext context, Class<T> toType, Object object) {
@SuppressWarnings("unchecked")
T result = (T) getExpressionFactory(context).coerceToType(object, toType);
return result;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"coerceToType",
"(",
"ELContext",
"context",
",",
"Class",
"<",
"T",
">",
"toType",
",",
"Object",
"object",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"T",
"result",
"=",
"(",
"T",
")",
"getEx... | Use EL specification coercion facilities to coerce an object to the specified type.
@param context
@param toType
@param object
@return T
@throws ELException if the coercion fails. | [
"Use",
"EL",
"specification",
"coercion",
"facilities",
"to",
"coerce",
"an",
"object",
"to",
"the",
"specified",
"type",
"."
] | train | https://github.com/mbenson/uelbox/blob/b0c2df2c738295bddfd3c16a916e67c9c7c512ef/src/main/java/uelbox/UEL.java#L248-L252 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.reverseForEach | @Deprecated
public static void reverseForEach(String string, CharProcedure procedure)
{
StringIterate.reverseForEachChar(string, procedure);
} | java | @Deprecated
public static void reverseForEach(String string, CharProcedure procedure)
{
StringIterate.reverseForEachChar(string, procedure);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"reverseForEach",
"(",
"String",
"string",
",",
"CharProcedure",
"procedure",
")",
"{",
"StringIterate",
".",
"reverseForEachChar",
"(",
"string",
",",
"procedure",
")",
";",
"}"
] | For each char in the {@code string} in reverse order, execute the {@link CharProcedure}.
@deprecated since 7.0. Use {@link #reverseForEachChar(String, CharProcedure)} instead. | [
"For",
"each",
"char",
"in",
"the",
"{",
"@code",
"string",
"}",
"in",
"reverse",
"order",
"execute",
"the",
"{",
"@link",
"CharProcedure",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L401-L405 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java | BatchFraction.defaultThreadPool | public BatchFraction defaultThreadPool(final int maxThreads, final int keepAliveTime, final TimeUnit keepAliveUnits) {
return defaultThreadPool(DEFAULT_THREAD_POOL_NAME, maxThreads, keepAliveTime, keepAliveUnits);
} | java | public BatchFraction defaultThreadPool(final int maxThreads, final int keepAliveTime, final TimeUnit keepAliveUnits) {
return defaultThreadPool(DEFAULT_THREAD_POOL_NAME, maxThreads, keepAliveTime, keepAliveUnits);
} | [
"public",
"BatchFraction",
"defaultThreadPool",
"(",
"final",
"int",
"maxThreads",
",",
"final",
"int",
"keepAliveTime",
",",
"final",
"TimeUnit",
"keepAliveUnits",
")",
"{",
"return",
"defaultThreadPool",
"(",
"DEFAULT_THREAD_POOL_NAME",
",",
"maxThreads",
",",
"keep... | Creates a new thread-pool using the {@linkplain #DEFAULT_THREAD_POOL_NAME default name}. The thread-pool is then set as
the default thread-pool for bath jobs.
@param maxThreads the maximum number of threads to set the pool to
@param keepAliveTime the time to keep threads alive
@param keepAliveUnits the time unit for the keep alive time
@return this fraction | [
"Creates",
"a",
"new",
"thread",
"-",
"pool",
"using",
"the",
"{",
"@linkplain",
"#DEFAULT_THREAD_POOL_NAME",
"default",
"name",
"}",
".",
"The",
"thread",
"-",
"pool",
"is",
"then",
"set",
"as",
"the",
"default",
"thread",
"-",
"pool",
"for",
"bath",
"job... | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java#L143-L145 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.isInstaneOf | public static boolean isInstaneOf(Class src, Class trg) {
if (src.isArray() && trg.isArray()) {
return isInstaneOf(src.getComponentType(), trg.getComponentType());
}
if (src == trg) return true;
// Interface
if (trg.isInterface()) {
return _checkInterfaces(src, trg);
}
// Extends
while (src != null) {
if (src == trg) return true;
src = src.getSuperclass();
}
return trg == Object.class;
} | java | public static boolean isInstaneOf(Class src, Class trg) {
if (src.isArray() && trg.isArray()) {
return isInstaneOf(src.getComponentType(), trg.getComponentType());
}
if (src == trg) return true;
// Interface
if (trg.isInterface()) {
return _checkInterfaces(src, trg);
}
// Extends
while (src != null) {
if (src == trg) return true;
src = src.getSuperclass();
}
return trg == Object.class;
} | [
"public",
"static",
"boolean",
"isInstaneOf",
"(",
"Class",
"src",
",",
"Class",
"trg",
")",
"{",
"if",
"(",
"src",
".",
"isArray",
"(",
")",
"&&",
"trg",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"isInstaneOf",
"(",
"src",
".",
"getComponentType",... | check if Class is instanceof a a other Class
@param src Class to check
@param trg is Class of?
@return is Class Class of... | [
"check",
"if",
"Class",
"is",
"instanceof",
"a",
"a",
"other",
"Class"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L159-L177 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/ResolvableBuilder.java | ResolvableBuilder.createMetadataProvider | private Resolvable createMetadataProvider(Class<?> rawType) {
Set<Type> types = Collections.<Type>singleton(rawType);
return new ResolvableImpl(rawType, types, declaringBean, qualifierInstances, delegate);
} | java | private Resolvable createMetadataProvider(Class<?> rawType) {
Set<Type> types = Collections.<Type>singleton(rawType);
return new ResolvableImpl(rawType, types, declaringBean, qualifierInstances, delegate);
} | [
"private",
"Resolvable",
"createMetadataProvider",
"(",
"Class",
"<",
"?",
">",
"rawType",
")",
"{",
"Set",
"<",
"Type",
">",
"types",
"=",
"Collections",
".",
"<",
"Type",
">",
"singleton",
"(",
"rawType",
")",
";",
"return",
"new",
"ResolvableImpl",
"(",... | just as facade but we keep the qualifiers so that we can recognize Bean from @Intercepted Bean. | [
"just",
"as",
"facade",
"but",
"we",
"keep",
"the",
"qualifiers",
"so",
"that",
"we",
"can",
"recognize",
"Bean",
"from"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/ResolvableBuilder.java#L143-L146 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.setThresholdAttributes | private void setThresholdAttributes(List<String> thresholdIds, HttpServletRequest request) throws APIException {
if (thresholdIds == null || thresholdIds.isEmpty()) {
return;
}
request.setAttribute("thresholdsPresent", Boolean.TRUE);
List<ThresholdStatusBean> thresholdStatusBeans = getThresholdBeans(getThresholdAPI().getThresholdStatuses(thresholdIds.toArray(new String[0])));
request.setAttribute("thresholds", thresholdStatusBeans);
} | java | private void setThresholdAttributes(List<String> thresholdIds, HttpServletRequest request) throws APIException {
if (thresholdIds == null || thresholdIds.isEmpty()) {
return;
}
request.setAttribute("thresholdsPresent", Boolean.TRUE);
List<ThresholdStatusBean> thresholdStatusBeans = getThresholdBeans(getThresholdAPI().getThresholdStatuses(thresholdIds.toArray(new String[0])));
request.setAttribute("thresholds", thresholdStatusBeans);
} | [
"private",
"void",
"setThresholdAttributes",
"(",
"List",
"<",
"String",
">",
"thresholdIds",
",",
"HttpServletRequest",
"request",
")",
"throws",
"APIException",
"{",
"if",
"(",
"thresholdIds",
"==",
"null",
"||",
"thresholdIds",
".",
"isEmpty",
"(",
")",
")",
... | Sets threshold specific attributes, required to show thresholds on page.
@param thresholdIds Threshold IDs, tied to given producers
@param request {@link HttpServletRequest} | [
"Sets",
"threshold",
"specific",
"attributes",
"required",
"to",
"show",
"thresholds",
"on",
"page",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L169-L177 |
ops4j/org.ops4j.base | ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java | PropertyResolver.startProperty | private static void startProperty( String name, Properties props, Stack<String> stack )
{
String propValue = System.getProperty( name );
if( propValue == null )
{
propValue = props.getProperty( name );
}
if( propValue == null )
{
push( stack, "${" + name + "}" );
}
else
{
push( stack, propValue );
}
} | java | private static void startProperty( String name, Properties props, Stack<String> stack )
{
String propValue = System.getProperty( name );
if( propValue == null )
{
propValue = props.getProperty( name );
}
if( propValue == null )
{
push( stack, "${" + name + "}" );
}
else
{
push( stack, propValue );
}
} | [
"private",
"static",
"void",
"startProperty",
"(",
"String",
"name",
",",
"Properties",
"props",
",",
"Stack",
"<",
"String",
">",
"stack",
")",
"{",
"String",
"propValue",
"=",
"System",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"propValue",
... | Starts a new property.
@param name The name of the property.
@param props The Properties we are exchanging with.
@param stack The parsing stack. | [
"Starts",
"a",
"new",
"property",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java#L127-L142 |
kiswanij/jk-util | src/main/java/com/jk/util/xml/JKXmlHandler.java | JKXmlHandler.toXml | public String toXml(Object obj, Class<?>... clas) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
toXml(obj, out, clas);
return out.toString();
} | java | public String toXml(Object obj, Class<?>... clas) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
toXml(obj, out, clas);
return out.toString();
} | [
"public",
"String",
"toXml",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"...",
"clas",
")",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"toXml",
"(",
"obj",
",",
"out",
",",
"clas",
")",
";",
"return... | To xml.
@param obj the obj
@param clas the clas
@return the string | [
"To",
"xml",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/xml/JKXmlHandler.java#L108-L112 |
HolmesNL/kafka-spout | src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java | ConfigUtils.getStormZookeepers | public static String getStormZookeepers(final Map<String, Object> stormConfig) {
final Object stormZookeepers = stormConfig.get(Config.STORM_ZOOKEEPER_SERVERS);
final Object stormZookeepersPort = stormConfig.get(Config.STORM_ZOOKEEPER_PORT);
if (stormZookeepers instanceof List && stormZookeepersPort instanceof Number) {
// join the servers and the port together to a single zookeeper connection string for kafka
final StringBuilder zookeepers = new StringBuilder();
final int port = ((Number) stormZookeepersPort).intValue();
for (final Iterator<?> iterator = ((List) stormZookeepers).iterator(); iterator.hasNext(); ) {
zookeepers.append(String.valueOf(iterator.next()));
zookeepers.append(':');
zookeepers.append(port);
if (iterator.hasNext()) {
zookeepers.append(',');
}
}
return zookeepers.toString();
}
// no valid zookeeper configuration found
return null;
} | java | public static String getStormZookeepers(final Map<String, Object> stormConfig) {
final Object stormZookeepers = stormConfig.get(Config.STORM_ZOOKEEPER_SERVERS);
final Object stormZookeepersPort = stormConfig.get(Config.STORM_ZOOKEEPER_PORT);
if (stormZookeepers instanceof List && stormZookeepersPort instanceof Number) {
// join the servers and the port together to a single zookeeper connection string for kafka
final StringBuilder zookeepers = new StringBuilder();
final int port = ((Number) stormZookeepersPort).intValue();
for (final Iterator<?> iterator = ((List) stormZookeepers).iterator(); iterator.hasNext(); ) {
zookeepers.append(String.valueOf(iterator.next()));
zookeepers.append(':');
zookeepers.append(port);
if (iterator.hasNext()) {
zookeepers.append(',');
}
}
return zookeepers.toString();
}
// no valid zookeeper configuration found
return null;
} | [
"public",
"static",
"String",
"getStormZookeepers",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"stormConfig",
")",
"{",
"final",
"Object",
"stormZookeepers",
"=",
"stormConfig",
".",
"get",
"(",
"Config",
".",
"STORM_ZOOKEEPER_SERVERS",
")",
";",
... | Creates a zookeeper connect string usable for the kafka configuration property {@code "zookeeper.connect"} from
storm's configuration map by looking up the {@link org.apache.storm.Config#STORM_ZOOKEEPER_SERVERS} and
{@link org.apache.storm.Config#STORM_ZOOKEEPER_PORT} values. Returns null when this procedure fails.
@param stormConfig Storm's configuration map.
@return A zookeeper connect string if it can be created from storm's config or null. | [
"Creates",
"a",
"zookeeper",
"connect",
"string",
"usable",
"for",
"the",
"kafka",
"configuration",
"property",
"{",
"@code",
"zookeeper",
".",
"connect",
"}",
"from",
"storm",
"s",
"configuration",
"map",
"by",
"looking",
"up",
"the",
"{",
"@link",
"org",
"... | train | https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java#L195-L216 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java | TmdbMovies.getMovieAlternativeTitles | public ResultList<AlternativeTitle> getMovieAlternativeTitles(int movieId, String country) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.COUNTRY, country);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.ALT_TITLES).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
try {
WrapperAlternativeTitles wrapper = MAPPER.readValue(webpage, WrapperAlternativeTitles.class);
ResultList<AlternativeTitle> results = new ResultList<>(wrapper.getTitles());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get alternative titles", url, ex);
}
} | java | public ResultList<AlternativeTitle> getMovieAlternativeTitles(int movieId, String country) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.COUNTRY, country);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.ALT_TITLES).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
try {
WrapperAlternativeTitles wrapper = MAPPER.readValue(webpage, WrapperAlternativeTitles.class);
ResultList<AlternativeTitle> results = new ResultList<>(wrapper.getTitles());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get alternative titles", url, ex);
}
} | [
"public",
"ResultList",
"<",
"AlternativeTitle",
">",
"getMovieAlternativeTitles",
"(",
"int",
"movieId",
",",
"String",
"country",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
"."... | This method is used to retrieve all of the alternative titles we have for a particular movie.
@param movieId
@param country
@return
@throws MovieDbException | [
"This",
"method",
"is",
"used",
"to",
"retrieve",
"all",
"of",
"the",
"alternative",
"titles",
"we",
"have",
"for",
"a",
"particular",
"movie",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java#L176-L191 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/compiler/DRLFactory.java | DRLFactory.getBetterToken | public static String getBetterToken( int tokenType, String defaultValue, LanguageLevelOption languageLevel ) {
switch (languageLevel) {
case DRL5:
return getBetterTokenForDRL5(tokenType, defaultValue);
case DRL6:
case DRL6_STRICT:
return getBetterTokenForDRL6(tokenType, defaultValue);
}
throw new RuntimeException("Unknown language level");
} | java | public static String getBetterToken( int tokenType, String defaultValue, LanguageLevelOption languageLevel ) {
switch (languageLevel) {
case DRL5:
return getBetterTokenForDRL5(tokenType, defaultValue);
case DRL6:
case DRL6_STRICT:
return getBetterTokenForDRL6(tokenType, defaultValue);
}
throw new RuntimeException("Unknown language level");
} | [
"public",
"static",
"String",
"getBetterToken",
"(",
"int",
"tokenType",
",",
"String",
"defaultValue",
",",
"LanguageLevelOption",
"languageLevel",
")",
"{",
"switch",
"(",
"languageLevel",
")",
"{",
"case",
"DRL5",
":",
"return",
"getBetterTokenForDRL5",
"(",
"t... | Helper method that creates a user friendly token definition
@param tokenType
token type
@param defaultValue
default value for identifier token, may be null
@return user friendly token definition | [
"Helper",
"method",
"that",
"creates",
"a",
"user",
"friendly",
"token",
"definition"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/compiler/DRLFactory.java#L148-L157 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/XExtension.java | XExtension.accept | public void accept(XVisitor visitor, XLog log) {
/*
* First call.
*/
visitor.visitExtensionPre(this, log);
/*
* Last call.
*/
visitor.visitExtensionPost(this, log);
} | java | public void accept(XVisitor visitor, XLog log) {
/*
* First call.
*/
visitor.visitExtensionPre(this, log);
/*
* Last call.
*/
visitor.visitExtensionPost(this, log);
} | [
"public",
"void",
"accept",
"(",
"XVisitor",
"visitor",
",",
"XLog",
"log",
")",
"{",
"/*\n\t\t * First call.\n\t\t */",
"visitor",
".",
"visitExtensionPre",
"(",
"this",
",",
"log",
")",
";",
"/*\n\t\t * Last call.\n\t\t */",
"visitor",
".",
"visitExtensionPost",
"... | /*
Runs the given visitor for the given log on this extension. | [
"/",
"*",
"Runs",
"the",
"given",
"visitor",
"for",
"the",
"given",
"log",
"on",
"this",
"extension",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/XExtension.java#L254-L263 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getCorePreferences | public static UserPreferences getCorePreferences(@CheckForNull IProject project, boolean forceRead) {
if (project == null || !isProjectSettingsEnabled(project)) {
// read workspace (user) settings from instance area
return getWorkspacePreferences();
}
// use project settings
return getProjectPreferences(project, forceRead);
} | java | public static UserPreferences getCorePreferences(@CheckForNull IProject project, boolean forceRead) {
if (project == null || !isProjectSettingsEnabled(project)) {
// read workspace (user) settings from instance area
return getWorkspacePreferences();
}
// use project settings
return getProjectPreferences(project, forceRead);
} | [
"public",
"static",
"UserPreferences",
"getCorePreferences",
"(",
"@",
"CheckForNull",
"IProject",
"project",
",",
"boolean",
"forceRead",
")",
"{",
"if",
"(",
"project",
"==",
"null",
"||",
"!",
"isProjectSettingsEnabled",
"(",
"project",
")",
")",
"{",
"// rea... | Get the FindBugs core preferences for given project. This method can
return workspace preferences if project preferences are not created yet
or they are disabled.
@param project
the project (if null, workspace settings are used)
@param forceRead
true to enforce reading properties from disk
@return the preferences for the project or prefs from workspace | [
"Get",
"the",
"FindBugs",
"core",
"preferences",
"for",
"given",
"project",
".",
"This",
"method",
"can",
"return",
"workspace",
"preferences",
"if",
"project",
"preferences",
"are",
"not",
"created",
"yet",
"or",
"they",
"are",
"disabled",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L868-L876 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/category/CmsCategoryTree.java | CmsCategoryTree.setListEnabled | private void setListEnabled(CmsList<? extends I_CmsListItem> list, boolean enabled, String disabledReason) {
for (Widget child : list) {
CmsTreeItem treeItem = (CmsTreeItem)child;
if (enabled) {
treeItem.getCheckBox().enable();
} else {
treeItem.getCheckBox().disable(disabledReason);
}
setListEnabled(treeItem.getChildren(), enabled, disabledReason);
}
} | java | private void setListEnabled(CmsList<? extends I_CmsListItem> list, boolean enabled, String disabledReason) {
for (Widget child : list) {
CmsTreeItem treeItem = (CmsTreeItem)child;
if (enabled) {
treeItem.getCheckBox().enable();
} else {
treeItem.getCheckBox().disable(disabledReason);
}
setListEnabled(treeItem.getChildren(), enabled, disabledReason);
}
} | [
"private",
"void",
"setListEnabled",
"(",
"CmsList",
"<",
"?",
"extends",
"I_CmsListItem",
">",
"list",
",",
"boolean",
"enabled",
",",
"String",
"disabledReason",
")",
"{",
"for",
"(",
"Widget",
"child",
":",
"list",
")",
"{",
"CmsTreeItem",
"treeItem",
"="... | Sets the given tree list enabled/disabled.<p>
@param list the list of tree items
@param enabled <code>true</code> to enable
@param disabledReason the disable reason, will be displayed as check box title | [
"Sets",
"the",
"given",
"tree",
"list",
"enabled",
"/",
"disabled",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/category/CmsCategoryTree.java#L1036-L1047 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java | AbstractSearchStructure.setMetadata | public boolean setMetadata(int iid, Object metaData) {
if (iid < 0 || iid > loadCounter) {
System.out.println("Internal id " + iid + " is out of range!");
return false;
}
MetaDataEntity mde = new MetaDataEntity(iid, metaData);
PrimaryIndex<Integer, MetaDataEntity> primaryIndex = iidToMetadataDB.getPrimaryIndex(Integer.class,
MetaDataEntity.class);
if (primaryIndex.contains(iid)) {
primaryIndex.put(null, mde);
return true;
} else {
return false;
}
} | java | public boolean setMetadata(int iid, Object metaData) {
if (iid < 0 || iid > loadCounter) {
System.out.println("Internal id " + iid + " is out of range!");
return false;
}
MetaDataEntity mde = new MetaDataEntity(iid, metaData);
PrimaryIndex<Integer, MetaDataEntity> primaryIndex = iidToMetadataDB.getPrimaryIndex(Integer.class,
MetaDataEntity.class);
if (primaryIndex.contains(iid)) {
primaryIndex.put(null, mde);
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"setMetadata",
"(",
"int",
"iid",
",",
"Object",
"metaData",
")",
"{",
"if",
"(",
"iid",
"<",
"0",
"||",
"iid",
">",
"loadCounter",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Internal id \"",
"+",
"iid",
"+",
"\" is ou... | This method is used to set the metadata of a previously indexed vector. If the metadata is already set,
this methods replaces it.
@param iid
The internal id of the vector
@param metaData
A java object of any class with the @persistent annotation
@return true if metadata is successfully set, false otherwise | [
"This",
"method",
"is",
"used",
"to",
"set",
"the",
"metadata",
"of",
"a",
"previously",
"indexed",
"vector",
".",
"If",
"the",
"metadata",
"is",
"already",
"set",
"this",
"methods",
"replaces",
"it",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java#L508-L523 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/lucene/BaseLuceneStorage.java | BaseLuceneStorage.doGet | protected Document doGet(String spaceId, String key) throws IOException {
Term termGet = buildIdTerm(spaceId, key);
IndexSearcher indexSearcher = getIndexSearcher();
TopDocs result = indexSearcher.search(new TermQuery(termGet), 1);
ScoreDoc[] hits = result != null ? result.scoreDocs : null;
Document doc = hits != null && hits.length > 0 ? indexSearcher.doc(hits[0].doc) : null;
return doc;
} | java | protected Document doGet(String spaceId, String key) throws IOException {
Term termGet = buildIdTerm(spaceId, key);
IndexSearcher indexSearcher = getIndexSearcher();
TopDocs result = indexSearcher.search(new TermQuery(termGet), 1);
ScoreDoc[] hits = result != null ? result.scoreDocs : null;
Document doc = hits != null && hits.length > 0 ? indexSearcher.doc(hits[0].doc) : null;
return doc;
} | [
"protected",
"Document",
"doGet",
"(",
"String",
"spaceId",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"Term",
"termGet",
"=",
"buildIdTerm",
"(",
"spaceId",
",",
"key",
")",
";",
"IndexSearcher",
"indexSearcher",
"=",
"getIndexSearcher",
"(",
")... | Fetch a document, identified by {@code spaceId:key}, from index.
@param spaceId
@param key
@return
@throws IOException | [
"Fetch",
"a",
"document",
"identified",
"by",
"{",
"@code",
"spaceId",
":",
"key",
"}",
"from",
"index",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/lucene/BaseLuceneStorage.java#L296-L303 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java | SerializerBase.fireCommentEvent | protected void fireCommentEvent(char[] chars, int start, int length)
throws org.xml.sax.SAXException
{
if (m_tracer != null)
{
flushMyWriter();
m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length));
}
} | java | protected void fireCommentEvent(char[] chars, int start, int length)
throws org.xml.sax.SAXException
{
if (m_tracer != null)
{
flushMyWriter();
m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length));
}
} | [
"protected",
"void",
"fireCommentEvent",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"if",
"(",
"m_tracer",
"!=",
"null",
")",
"{",
"flushMyWriter",
... | Report the comment trace event
@param chars content of comment
@param start starting index of comment to output
@param length number of characters to output | [
"Report",
"the",
"comment",
"trace",
"event"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L1061-L1069 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/icon/IconRenderer.java | IconRenderer.decode | @Override
public void decode(FacesContext context, UIComponent component) {
Icon icon = (Icon) component;
if (icon.isDisabled() || icon.isReadonly()) {
return;
}
decodeBehaviors(context, icon); // moved to AJAXRenderer
new AJAXRenderer().decode(context, component);
} | java | @Override
public void decode(FacesContext context, UIComponent component) {
Icon icon = (Icon) component;
if (icon.isDisabled() || icon.isReadonly()) {
return;
}
decodeBehaviors(context, icon); // moved to AJAXRenderer
new AJAXRenderer().decode(context, component);
} | [
"@",
"Override",
"public",
"void",
"decode",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"{",
"Icon",
"icon",
"=",
"(",
"Icon",
")",
"component",
";",
"if",
"(",
"icon",
".",
"isDisabled",
"(",
")",
"||",
"icon",
".",
"isReadonl... | This methods receives and processes input made by the user. More
specifically, it ckecks whether the user has interacted with the current
b:selectBooleanCheckbox. The default implementation simply stores the
input value in the list of submitted values. If the validation checks are
passed, the values in the <code>submittedValues</code> list are store in
the backend bean.
@param context
the FacesContext.
@param component
the current b:selectBooleanCheckbox. | [
"This",
"methods",
"receives",
"and",
"processes",
"input",
"made",
"by",
"the",
"user",
".",
"More",
"specifically",
"it",
"ckecks",
"whether",
"the",
"user",
"has",
"interacted",
"with",
"the",
"current",
"b",
":",
"selectBooleanCheckbox",
".",
"The",
"defau... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/icon/IconRenderer.java#L54-L64 |
apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ProgramTargetDescriptor.java | ProgramTargetDescriptor.of | public static <C> ProgramTargetDescriptor of(C clusterId, JobID jobId, String webInterfaceUrl) {
String clusterIdString;
try {
// check if cluster id has a toString method
clusterId.getClass().getDeclaredMethod("toString");
clusterIdString = clusterId.toString();
} catch (NoSuchMethodException e) {
clusterIdString = clusterId.getClass().getSimpleName();
}
return new ProgramTargetDescriptor(clusterIdString, jobId.toString(), webInterfaceUrl);
} | java | public static <C> ProgramTargetDescriptor of(C clusterId, JobID jobId, String webInterfaceUrl) {
String clusterIdString;
try {
// check if cluster id has a toString method
clusterId.getClass().getDeclaredMethod("toString");
clusterIdString = clusterId.toString();
} catch (NoSuchMethodException e) {
clusterIdString = clusterId.getClass().getSimpleName();
}
return new ProgramTargetDescriptor(clusterIdString, jobId.toString(), webInterfaceUrl);
} | [
"public",
"static",
"<",
"C",
">",
"ProgramTargetDescriptor",
"of",
"(",
"C",
"clusterId",
",",
"JobID",
"jobId",
",",
"String",
"webInterfaceUrl",
")",
"{",
"String",
"clusterIdString",
";",
"try",
"{",
"// check if cluster id has a toString method",
"clusterId",
"... | Creates a program target description from deployment classes.
@param clusterId cluster id
@param jobId job id
@param <C> cluster id type
@return program target descriptor | [
"Creates",
"a",
"program",
"target",
"description",
"from",
"deployment",
"classes",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ProgramTargetDescriptor.java#L69-L79 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java | AbstractSequenceClassifier.loadJarClassifier | public void loadJarClassifier(String modelName, Properties props) {
Timing.startDoing("Loading JAR-internal classifier " + modelName);
try {
InputStream is = getClass().getResourceAsStream(modelName);
if (modelName.endsWith(".gz")) {
is = new GZIPInputStream(is);
}
is = new BufferedInputStream(is);
loadClassifier(is, props);
is.close();
Timing.endDoing();
} catch (Exception e) {
String msg = "Error loading classifier from jar file (most likely you are not running this code from a jar file or the named classifier is not stored in the jar file)";
throw new RuntimeException(msg, e);
}
} | java | public void loadJarClassifier(String modelName, Properties props) {
Timing.startDoing("Loading JAR-internal classifier " + modelName);
try {
InputStream is = getClass().getResourceAsStream(modelName);
if (modelName.endsWith(".gz")) {
is = new GZIPInputStream(is);
}
is = new BufferedInputStream(is);
loadClassifier(is, props);
is.close();
Timing.endDoing();
} catch (Exception e) {
String msg = "Error loading classifier from jar file (most likely you are not running this code from a jar file or the named classifier is not stored in the jar file)";
throw new RuntimeException(msg, e);
}
} | [
"public",
"void",
"loadJarClassifier",
"(",
"String",
"modelName",
",",
"Properties",
"props",
")",
"{",
"Timing",
".",
"startDoing",
"(",
"\"Loading JAR-internal classifier \"",
"+",
"modelName",
")",
";",
"try",
"{",
"InputStream",
"is",
"=",
"getClass",
"(",
... | This function will load a classifier that is stored inside a jar file (if
it is so stored). The classifier should be specified as its full filename,
but the path in the jar file (<code>/classifiers/</code>) is coded in this
class. If the classifier is not stored in the jar file or this is not run
from inside a jar file, then this function will throw a RuntimeException.
@param modelName
The name of the model file. Iff it ends in .gz, then it is assumed
to be gzip compressed.
@param props
A Properties object which can override certain properties in the
serialized file, such as the DocumentReaderAndWriter. You can pass
in <code>null</code> to override nothing. | [
"This",
"function",
"will",
"load",
"a",
"classifier",
"that",
"is",
"stored",
"inside",
"a",
"jar",
"file",
"(",
"if",
"it",
"is",
"so",
"stored",
")",
".",
"The",
"classifier",
"should",
"be",
"specified",
"as",
"its",
"full",
"filename",
"but",
"the",... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java#L1691-L1706 |
redkale/redkale | src/org/redkale/net/http/HttpResponse.java | HttpResponse.finish | @SuppressWarnings("unchecked")
public void finish(final Convert convert, final Type type, final Object obj) {
if (obj == null) {
finish("null");
} else if (obj instanceof CompletableFuture) {
((CompletableFuture) obj).whenComplete((v, e) -> {
if (e != null) {
context.getLogger().log(Level.WARNING, "Servlet occur, force to close channel. request = " + request + ", result is CompletableFuture", (Throwable) e);
finish(500, null);
return;
}
finish(convert, type, v);
});
} else if (obj instanceof CharSequence) {
finish((String) obj.toString());
} else if (obj instanceof byte[]) {
finish((byte[]) obj);
} | java | @SuppressWarnings("unchecked")
public void finish(final Convert convert, final Type type, final Object obj) {
if (obj == null) {
finish("null");
} else if (obj instanceof CompletableFuture) {
((CompletableFuture) obj).whenComplete((v, e) -> {
if (e != null) {
context.getLogger().log(Level.WARNING, "Servlet occur, force to close channel. request = " + request + ", result is CompletableFuture", (Throwable) e);
finish(500, null);
return;
}
finish(convert, type, v);
});
} else if (obj instanceof CharSequence) {
finish((String) obj.toString());
} else if (obj instanceof byte[]) {
finish((byte[]) obj);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"finish",
"(",
"final",
"Convert",
"convert",
",",
"final",
"Type",
"type",
",",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"finish",
"(",
"\"null\""... | 将结果对象输出
@param convert 指定的Convert
@param type 指定的类型
@param obj 输出对象 | [
"将结果对象输出"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpResponse.java#L467-L484 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getDataFile | protected File getDataFile(@NotNull final String key) {
final String file = getString(key);
LOGGER.debug("Settings.getDataFile() - file: '{}'", file);
if (file == null) {
return null;
}
if (file.startsWith("[JAR]")) {
LOGGER.debug("Settings.getDataFile() - transforming filename");
final File jarPath = getJarPath();
LOGGER.debug("Settings.getDataFile() - jar file: '{}'", jarPath.toString());
final File retVal = new File(jarPath, file.substring(6));
LOGGER.debug("Settings.getDataFile() - returning: '{}'", retVal.toString());
return retVal;
}
return new File(file);
} | java | protected File getDataFile(@NotNull final String key) {
final String file = getString(key);
LOGGER.debug("Settings.getDataFile() - file: '{}'", file);
if (file == null) {
return null;
}
if (file.startsWith("[JAR]")) {
LOGGER.debug("Settings.getDataFile() - transforming filename");
final File jarPath = getJarPath();
LOGGER.debug("Settings.getDataFile() - jar file: '{}'", jarPath.toString());
final File retVal = new File(jarPath, file.substring(6));
LOGGER.debug("Settings.getDataFile() - returning: '{}'", retVal.toString());
return retVal;
}
return new File(file);
} | [
"protected",
"File",
"getDataFile",
"(",
"@",
"NotNull",
"final",
"String",
"key",
")",
"{",
"final",
"String",
"file",
"=",
"getString",
"(",
"key",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"Settings.getDataFile() - file: '{}'\"",
",",
"file",
")",
";",
"if... | Returns a value from the properties file as a File object. 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.
This method will check the configured base directory and will use this as
the base of the file path. Additionally, if the base directory begins
with a leading "[JAR]\" sequence with the path to the folder containing
the JAR file containing this class.
@param key the key to lookup within the properties file
@return the property from the properties file converted to a File object | [
"Returns",
"a",
"value",
"from",
"the",
"properties",
"file",
"as",
"a",
"File",
"object",
".",
"If",
"the",
"value",
"was",
"specified",
"as",
"a",
"system",
"property",
"or",
"passed",
"in",
"via",
"the",
"-",
"Dprop",
"=",
"value",
"argument",
"-",
... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L848-L863 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXtypeSemanticSequencer.java | AbstractXtypeSemanticSequencer.sequence_JvmTypeReference | protected void sequence_JvmTypeReference(ISerializationContext context, JvmGenericArrayTypeReference semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0(), semanticObject.getComponentType());
feeder.finish();
} | java | protected void sequence_JvmTypeReference(ISerializationContext context, JvmGenericArrayTypeReference semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0(), semanticObject.getComponentType());
feeder.finish();
} | [
"protected",
"void",
"sequence_JvmTypeReference",
"(",
"ISerializationContext",
"context",
",",
"JvmGenericArrayTypeReference",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
... | Contexts:
JvmTypeReference returns JvmGenericArrayTypeReference
JvmTypeReference.JvmGenericArrayTypeReference_0_1_0_0 returns JvmGenericArrayTypeReference
JvmArgumentTypeReference returns JvmGenericArrayTypeReference
Constraint:
componentType=JvmTypeReference_JvmGenericArrayTypeReference_0_1_0_0 | [
"Contexts",
":",
"JvmTypeReference",
"returns",
"JvmGenericArrayTypeReference",
"JvmTypeReference",
".",
"JvmGenericArrayTypeReference_0_1_0_0",
"returns",
"JvmGenericArrayTypeReference",
"JvmArgumentTypeReference",
"returns",
"JvmGenericArrayTypeReference"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXtypeSemanticSequencer.java#L239-L247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.