repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
m-m-m/util | gwt/src/main/resources/net/sf/mmm/util/gwt/supersource/net/sf/mmm/util/exception/api/NlsRuntimeException.java | NlsRuntimeException.printStackTrace | static void printStackTrace(NlsThrowable throwable, Locale locale, Appendable buffer) {
"""
@see NlsThrowable#printStackTrace(Locale, Appendable)
@param throwable is the {@link NlsThrowable} to print.
@param locale is the {@link Locale} to translate to.
@param buffer is where to write the stack trace to.
... | java | static void printStackTrace(NlsThrowable throwable, Locale locale, Appendable buffer) {
try {
synchronized (buffer) {
buffer.append(throwable.getClass().getName());
buffer.append(": ");
throwable.getLocalizedMessage(locale, buffer);
buffer.append('\n');
UUID uuid = thr... | [
"static",
"void",
"printStackTrace",
"(",
"NlsThrowable",
"throwable",
",",
"Locale",
"locale",
",",
"Appendable",
"buffer",
")",
"{",
"try",
"{",
"synchronized",
"(",
"buffer",
")",
"{",
"buffer",
".",
"append",
"(",
"throwable",
".",
"getClass",
"(",
")",
... | @see NlsThrowable#printStackTrace(Locale, Appendable)
@param throwable is the {@link NlsThrowable} to print.
@param locale is the {@link Locale} to translate to.
@param buffer is where to write the stack trace to. | [
"@see",
"NlsThrowable#printStackTrace",
"(",
"Locale",
"Appendable",
")"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/resources/net/sf/mmm/util/gwt/supersource/net/sf/mmm/util/exception/api/NlsRuntimeException.java#L139-L174 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.localizeCategory | public CmsCategory localizeCategory(CmsObject cms, CmsCategory category, Locale locale) {
"""
Localizes a single category by reading its locale-specific properties for title and description, if possible.<p>
@param cms the CMS context to use for reading resources
@param category the category to localize
@param... | java | public CmsCategory localizeCategory(CmsObject cms, CmsCategory category, Locale locale) {
try {
CmsUUID id = category.getId();
CmsResource categoryRes = cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION);
String title = cms.readPropertyObject(
category... | [
"public",
"CmsCategory",
"localizeCategory",
"(",
"CmsObject",
"cms",
",",
"CmsCategory",
"category",
",",
"Locale",
"locale",
")",
"{",
"try",
"{",
"CmsUUID",
"id",
"=",
"category",
".",
"getId",
"(",
")",
";",
"CmsResource",
"categoryRes",
"=",
"cms",
".",... | Localizes a single category by reading its locale-specific properties for title and description, if possible.<p>
@param cms the CMS context to use for reading resources
@param category the category to localize
@param locale the locale to use
@return the localized category | [
"Localizes",
"a",
"single",
"category",
"by",
"reading",
"its",
"locale",
"-",
"specific",
"properties",
"for",
"title",
"and",
"description",
"if",
"possible",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L399-L419 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java | TypeTransformationParser.validRecordTypeExpression | private boolean validRecordTypeExpression(Node expr) {
"""
A record type expression must be of the form:
record(RecordExp, RecordExp, ...)
"""
// The expression must have at least two children. The record keyword and
// a record expression
if (!checkParameterCount(expr, Keywords.RECORD)) {
r... | java | private boolean validRecordTypeExpression(Node expr) {
// The expression must have at least two children. The record keyword and
// a record expression
if (!checkParameterCount(expr, Keywords.RECORD)) {
return false;
}
// Each child must be a valid record
for (int i = 0; i < getCallParamCo... | [
"private",
"boolean",
"validRecordTypeExpression",
"(",
"Node",
"expr",
")",
"{",
"// The expression must have at least two children. The record keyword and",
"// a record expression",
"if",
"(",
"!",
"checkParameterCount",
"(",
"expr",
",",
"Keywords",
".",
"RECORD",
")",
... | A record type expression must be of the form:
record(RecordExp, RecordExp, ...) | [
"A",
"record",
"type",
"expression",
"must",
"be",
"of",
"the",
"form",
":",
"record",
"(",
"RecordExp",
"RecordExp",
"...",
")"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java#L434-L448 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitselector.java | nslimitselector.get | public static nslimitselector get(nitro_service service, String selectorname) throws Exception {
"""
Use this API to fetch nslimitselector resource of given name .
"""
nslimitselector obj = new nslimitselector();
obj.set_selectorname(selectorname);
nslimitselector response = (nslimitselector) obj.get_res... | java | public static nslimitselector get(nitro_service service, String selectorname) throws Exception{
nslimitselector obj = new nslimitselector();
obj.set_selectorname(selectorname);
nslimitselector response = (nslimitselector) obj.get_resource(service);
return response;
} | [
"public",
"static",
"nslimitselector",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"selectorname",
")",
"throws",
"Exception",
"{",
"nslimitselector",
"obj",
"=",
"new",
"nslimitselector",
"(",
")",
";",
"obj",
".",
"set_selectorname",
"(",
"selectornam... | Use this API to fetch nslimitselector resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nslimitselector",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitselector.java#L276-L281 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/TimeStampUtils.java | TimeStampUtils.getTimeStampedMessage | public static String getTimeStampedMessage(String message, String format) {
"""
Returns the provided {@code message} along with a date/time based
on the provided {@code format} which is a SimpleDateFormat string.
If application of the provided {@code format} fails a default format is used.
The DEFAULT format is... | java | public static String getTimeStampedMessage(String message, String format){
StringBuilder timeStampedMessage = new StringBuilder(format.length()+TIME_STAMP_DELIMITER.length()+message.length()+2);
timeStampedMessage.append(currentFormattedTimeStamp(format)); //Timestamp
timeStampedMessage.append(' ').append(... | [
"public",
"static",
"String",
"getTimeStampedMessage",
"(",
"String",
"message",
",",
"String",
"format",
")",
"{",
"StringBuilder",
"timeStampedMessage",
"=",
"new",
"StringBuilder",
"(",
"format",
".",
"length",
"(",
")",
"+",
"TIME_STAMP_DELIMITER",
".",
"lengt... | Returns the provided {@code message} along with a date/time based
on the provided {@code format} which is a SimpleDateFormat string.
If application of the provided {@code format} fails a default format is used.
The DEFAULT format is defined in Messages.properties.
@param message the message to be time stamped
@param fo... | [
"Returns",
"the",
"provided",
"{",
"@code",
"message",
"}",
"along",
"with",
"a",
"date",
"/",
"time",
"based",
"on",
"the",
"provided",
"{",
"@code",
"format",
"}",
"which",
"is",
"a",
"SimpleDateFormat",
"string",
".",
"If",
"application",
"of",
"the",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/TimeStampUtils.java#L91-L99 |
bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java | AdaptiveResultSet.executeAdaptiveQuery | public static ResultSet executeAdaptiveQuery(Session session, Statement statement, int fetchSize) {
"""
Executes a query sychronously, dynamically adjusting the fetch size down if necessary.
"""
int remainingAdaptations = MAX_ADAPTATIONS;
while (true) {
try {
stateme... | java | public static ResultSet executeAdaptiveQuery(Session session, Statement statement, int fetchSize) {
int remainingAdaptations = MAX_ADAPTATIONS;
while (true) {
try {
statement.setFetchSize(fetchSize);
ResultSet resultSet = session.execute(statement);
... | [
"public",
"static",
"ResultSet",
"executeAdaptiveQuery",
"(",
"Session",
"session",
",",
"Statement",
"statement",
",",
"int",
"fetchSize",
")",
"{",
"int",
"remainingAdaptations",
"=",
"MAX_ADAPTATIONS",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"stateme... | Executes a query sychronously, dynamically adjusting the fetch size down if necessary. | [
"Executes",
"a",
"query",
"sychronously",
"dynamically",
"adjusting",
"the",
"fetch",
"size",
"down",
"if",
"necessary",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java#L84-L101 |
real-logic/agrona | agrona/src/main/java/org/agrona/concurrent/AgentRunner.java | AgentRunner.startOnThread | public static Thread startOnThread(final AgentRunner runner, final ThreadFactory threadFactory) {
"""
Start the given agent runner on a new thread.
@param runner the agent runner to start.
@param threadFactory the factory to use to create the thread.
@return the new thread that has been started.
""... | java | public static Thread startOnThread(final AgentRunner runner, final ThreadFactory threadFactory)
{
final Thread thread = threadFactory.newThread(runner);
thread.setName(runner.agent().roleName());
thread.start();
return thread;
} | [
"public",
"static",
"Thread",
"startOnThread",
"(",
"final",
"AgentRunner",
"runner",
",",
"final",
"ThreadFactory",
"threadFactory",
")",
"{",
"final",
"Thread",
"thread",
"=",
"threadFactory",
".",
"newThread",
"(",
"runner",
")",
";",
"thread",
".",
"setName"... | Start the given agent runner on a new thread.
@param runner the agent runner to start.
@param threadFactory the factory to use to create the thread.
@return the new thread that has been started. | [
"Start",
"the",
"given",
"agent",
"runner",
"on",
"a",
"new",
"thread",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/concurrent/AgentRunner.java#L95-L102 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/fiducial/VisualizeFiducial.java | VisualizeFiducial.drawChessboard | public static void drawChessboard( Graphics2D g2 , WorldToCameraToPixel fiducialToPixel ,
int numRows , int numCols , double squareWidth ) {
"""
Renders a translucent chessboard pattern
@param g2 Graphics object it's drawn in
@param fiducialToPixel Coverts a coordinate from fiducial into pixel
@para... | java | public static void drawChessboard( Graphics2D g2 , WorldToCameraToPixel fiducialToPixel ,
int numRows , int numCols , double squareWidth )
{
Point3D_F64 fidPt = new Point3D_F64();
Point2D_F64 pixel0 = new Point2D_F64();
Point2D_F64 pixel1 = new Point2D_F64();
Point2D_F64 pixel2 = new Point2D_F64();... | [
"public",
"static",
"void",
"drawChessboard",
"(",
"Graphics2D",
"g2",
",",
"WorldToCameraToPixel",
"fiducialToPixel",
",",
"int",
"numRows",
",",
"int",
"numCols",
",",
"double",
"squareWidth",
")",
"{",
"Point3D_F64",
"fidPt",
"=",
"new",
"Point3D_F64",
"(",
"... | Renders a translucent chessboard pattern
@param g2 Graphics object it's drawn in
@param fiducialToPixel Coverts a coordinate from fiducial into pixel
@param numRows Number of rows in the calibration grid
@param numCols Number of columns in the calibration grid
@param squareWidth Width of each square | [
"Renders",
"a",
"translucent",
"chessboard",
"pattern"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/fiducial/VisualizeFiducial.java#L160-L211 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.reissueAsync | public Observable<Void> reissueAsync(String resourceGroupName, String certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest) {
"""
Reissue an existing certificate order.
Reissue an existing certificate order.
@param resourceGroupName Name of the resource group to which the resourc... | java | public Observable<Void> reissueAsync(String resourceGroupName, String certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest) {
return reissueWithServiceResponseAsync(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest).map(new Func1<ServiceResponse<Void>, Void>(... | [
"public",
"Observable",
"<",
"Void",
">",
"reissueAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"ReissueCertificateOrderRequest",
"reissueCertificateOrderRequest",
")",
"{",
"return",
"reissueWithServiceResponseAsync",
"(",
"resourceG... | Reissue an existing certificate order.
Reissue an existing certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param reissueCertificateOrderRequest Parameters for the reissue.
@throws IllegalArgumentException ... | [
"Reissue",
"an",
"existing",
"certificate",
"order",
".",
"Reissue",
"an",
"existing",
"certificate",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1613-L1620 |
wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java | SuffixParser.get | @SuppressWarnings("unchecked")
public <T> @Nullable T get(@NotNull String key, @Nullable T defaultValue) {
"""
Extract the value of a named suffix part from this request's suffix
@param key key of the suffix part
@param defaultValue the default value to return if suffix part not set.
Only String, Boolean, Int... | java | @SuppressWarnings("unchecked")
public <T> @Nullable T get(@NotNull String key, @Nullable T defaultValue) {
if (defaultValue instanceof String || defaultValue == null) {
return (T)getString(key, (String)defaultValue);
}
if (defaultValue instanceof Boolean) {
return (T)(Boolean)getBoolean(key, (... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"@",
"Nullable",
"T",
"get",
"(",
"@",
"NotNull",
"String",
"key",
",",
"@",
"Nullable",
"T",
"defaultValue",
")",
"{",
"if",
"(",
"defaultValue",
"instanceof",
"String",
"||",
... | Extract the value of a named suffix part from this request's suffix
@param key key of the suffix part
@param defaultValue the default value to return if suffix part not set.
Only String, Boolean, Integer, Long are supported.
@param <T> Parameter type.
@return the value of that named parameter (or the default value if n... | [
"Extract",
"the",
"value",
"of",
"a",
"named",
"suffix",
"part",
"from",
"this",
"request",
"s",
"suffix"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L107-L122 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/FormSupport.java | FormSupport.setPlaceholderText | public <B extends TextBoxBase> B setPlaceholderText (B box, String placeholder) {
"""
Set the placeholder text to use on the specified form field.
This text will be shown when the field is blank and unfocused.
"""
box.getElement().setAttribute("placeholder", placeholder);
return box;
} | java | public <B extends TextBoxBase> B setPlaceholderText (B box, String placeholder)
{
box.getElement().setAttribute("placeholder", placeholder);
return box;
} | [
"public",
"<",
"B",
"extends",
"TextBoxBase",
">",
"B",
"setPlaceholderText",
"(",
"B",
"box",
",",
"String",
"placeholder",
")",
"{",
"box",
".",
"getElement",
"(",
")",
".",
"setAttribute",
"(",
"\"placeholder\"",
",",
"placeholder",
")",
";",
"return",
... | Set the placeholder text to use on the specified form field.
This text will be shown when the field is blank and unfocused. | [
"Set",
"the",
"placeholder",
"text",
"to",
"use",
"on",
"the",
"specified",
"form",
"field",
".",
"This",
"text",
"will",
"be",
"shown",
"when",
"the",
"field",
"is",
"blank",
"and",
"unfocused",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/FormSupport.java#L35-L39 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.beginCreateOrUpdate | public ExpressRoutePortInner beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
"""
Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the Expres... | java | public ExpressRoutePortInner beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().single().body();
} | [
"public",
"ExpressRoutePortInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
",",
"ExpressRoutePortInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"ex... | Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@param parameters Parameters supplied to the create ExpressRoutePort operation.
@throws IllegalArgumentException thrown if paramete... | [
"Creates",
"or",
"updates",
"the",
"specified",
"ExpressRoutePort",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L437-L439 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java | DiskLruCache.rebuildJournal | private synchronized void rebuildJournal() throws IOException {
"""
Creates a new journal that omits redundant information. This replaces the
current journal if it exists.
"""
if (journalWriter != null) {
journalWriter.close();
}
Writer writer = new BufferedWriter(
new OutputStreamWriter(new Fil... | java | private synchronized void rebuildJournal() throws IOException {
if (journalWriter != null) {
journalWriter.close();
}
Writer writer = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(journalFileTmp), Util.US_ASCII));
try {
writer.write(MAGIC);
writer.write("\n");
writer.write(VER... | [
"private",
"synchronized",
"void",
"rebuildJournal",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"journalWriter",
"!=",
"null",
")",
"{",
"journalWriter",
".",
"close",
"(",
")",
";",
"}",
"Writer",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
... | Creates a new journal that omits redundant information. This replaces the
current journal if it exists. | [
"Creates",
"a",
"new",
"journal",
"that",
"omits",
"redundant",
"information",
".",
"This",
"replaces",
"the",
"current",
"journal",
"if",
"it",
"exists",
"."
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java#L353-L390 |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.openUdpChannel | private DatagramChannel openUdpChannel(InetAddress localAddress, int port, Selector selector) throws IOException {
"""
Opens a datagram channel and binds it to an address.
@param localAddress
The address to bind the channel to.
@param port
The port to use
@return The bound datagram channel
@throws IOExcept... | java | private DatagramChannel openUdpChannel(InetAddress localAddress, int port, Selector selector) throws IOException {
DatagramChannel channel = DatagramChannel.open();
channel.configureBlocking(false);
// Register selector for reading operations
channel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRI... | [
"private",
"DatagramChannel",
"openUdpChannel",
"(",
"InetAddress",
"localAddress",
",",
"int",
"port",
",",
"Selector",
"selector",
")",
"throws",
"IOException",
"{",
"DatagramChannel",
"channel",
"=",
"DatagramChannel",
".",
"open",
"(",
")",
";",
"channel",
"."... | Opens a datagram channel and binds it to an address.
@param localAddress
The address to bind the channel to.
@param port
The port to use
@return The bound datagram channel
@throws IOException
When an error occurs while binding the datagram channel. | [
"Opens",
"a",
"datagram",
"channel",
"and",
"binds",
"it",
"to",
"an",
"address",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L150-L157 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/common/DefaultAgenda.java | DefaultAgenda.addItemToActivationGroup | public void addItemToActivationGroup(final AgendaItem item) {
"""
If the item belongs to an activation group, add it
@param item
"""
if ( item.isRuleAgendaItem() ) {
throw new UnsupportedOperationException("defensive programming, making sure this isn't called, before removing");
... | java | public void addItemToActivationGroup(final AgendaItem item) {
if ( item.isRuleAgendaItem() ) {
throw new UnsupportedOperationException("defensive programming, making sure this isn't called, before removing");
}
String group = item.getRule().getActivationGroup();
if ( group !=... | [
"public",
"void",
"addItemToActivationGroup",
"(",
"final",
"AgendaItem",
"item",
")",
"{",
"if",
"(",
"item",
".",
"isRuleAgendaItem",
"(",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"defensive programming, making sure this isn't called, befor... | If the item belongs to an activation group, add it
@param item | [
"If",
"the",
"item",
"belongs",
"to",
"an",
"activation",
"group",
"add",
"it"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/common/DefaultAgenda.java#L319-L335 |
Teddy-Zhu/SilentGo | utils/src/main/java/com/silentgo/utils/asm/Label.java | Label.addToSubroutine | void addToSubroutine(final long id, final int nbSubroutines) {
"""
Marks this basic block as belonging to the given subroutine.
@param id
a subroutine id.
@param nbSubroutines
the total number of subroutines in the method.
"""
if ((status & VISITED) == 0) {
status |= VISITED;
... | java | void addToSubroutine(final long id, final int nbSubroutines) {
if ((status & VISITED) == 0) {
status |= VISITED;
srcAndRefPositions = new int[nbSubroutines / 32 + 1];
}
srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
} | [
"void",
"addToSubroutine",
"(",
"final",
"long",
"id",
",",
"final",
"int",
"nbSubroutines",
")",
"{",
"if",
"(",
"(",
"status",
"&",
"VISITED",
")",
"==",
"0",
")",
"{",
"status",
"|=",
"VISITED",
";",
"srcAndRefPositions",
"=",
"new",
"int",
"[",
"nb... | Marks this basic block as belonging to the given subroutine.
@param id
a subroutine id.
@param nbSubroutines
the total number of subroutines in the method. | [
"Marks",
"this",
"basic",
"block",
"as",
"belonging",
"to",
"the",
"given",
"subroutine",
"."
] | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/utils/src/main/java/com/silentgo/utils/asm/Label.java#L477-L483 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.retrieveBean | @Override
public <T, C> T retrieveBean(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If th... | java | @Override
public <T, C> T retrieveBean(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
Iterator<T> it = processSelectGroup(name, criteria, result, wheres, orderBy, nativeExpressions, true).iterat... | [
"@",
"Override",
"public",
"<",
"T",
",",
"C",
">",
"T",
"retrieveBean",
"(",
"String",
"name",
",",
"C",
"criteria",
",",
"T",
"result",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Col... | Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param name The filter name which tells the datasource which beans should be returned. The name also sig... | [
"Retrieves",
"the",
"bean",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"bean",
"exists",
"in",
"the",
"datasource",
".",
"If",
"the",
"retrieve",
"function",
"defined",
"for",
"this",
"beans",
"returns",
"more",
"than",
"one"... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1428-L1436 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.setDomainRefererACL | public SetDomainRefererACLResponse setDomainRefererACL(SetDomainRefererACLRequest request) {
"""
Update RefererACL rules of specified domain acceleration.
@param request The request containing all of the options related to the update request.
@return Result of the setDomainRefererACL operation returned by the ... | java | public SetDomainRefererACLResponse setDomainRefererACL(SetDomainRefererACLRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config");
internalRequest.ad... | [
"public",
"SetDomainRefererACLResponse",
"setDomainRefererACL",
"(",
"SetDomainRefererACLRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(... | Update RefererACL rules of specified domain acceleration.
@param request The request containing all of the options related to the update request.
@return Result of the setDomainRefererACL operation returned by the service. | [
"Update",
"RefererACL",
"rules",
"of",
"specified",
"domain",
"acceleration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L398-L404 |
peterbencze/serritor | src/main/java/com/github/peterbencze/serritor/api/BaseCrawler.java | BaseCrawler.downloadFile | protected final void downloadFile(final URI source, final File destination) throws IOException {
"""
Downloads the file specified by the URL.
@param source the source URL
@param destination the destination file
@throws IOException if an I/O error occurs while downloading the file
"""
Valid... | java | protected final void downloadFile(final URI source, final File destination) throws IOException {
Validate.validState(!isStopped, "Cannot download file when the crawler is not started.");
Validate.validState(!isStopping, "Cannot download file when the crawler is stopping.");
Validate.notNull(s... | [
"protected",
"final",
"void",
"downloadFile",
"(",
"final",
"URI",
"source",
",",
"final",
"File",
"destination",
")",
"throws",
"IOException",
"{",
"Validate",
".",
"validState",
"(",
"!",
"isStopped",
",",
"\"Cannot download file when the crawler is not started.\"",
... | Downloads the file specified by the URL.
@param source the source URL
@param destination the destination file
@throws IOException if an I/O error occurs while downloading the file | [
"Downloads",
"the",
"file",
"specified",
"by",
"the",
"URL",
"."
] | train | https://github.com/peterbencze/serritor/blob/10ed6f82c90fa1dccd684382b68b5d77a37652c0/src/main/java/com/github/peterbencze/serritor/api/BaseCrawler.java#L284-L297 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java | Plugin.loadCustomPlugin | public static Plugin loadCustomPlugin(File f, @CheckForNull Project project)
throws PluginException {
"""
Loads the given plugin and enables it for the given project.
@param f
A non-null jar file of custom plugin.
@param project
A nullable target project
"""
URL urlString;
try... | java | public static Plugin loadCustomPlugin(File f, @CheckForNull Project project)
throws PluginException {
URL urlString;
try {
urlString = f.toURI().toURL();
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
return loadCu... | [
"public",
"static",
"Plugin",
"loadCustomPlugin",
"(",
"File",
"f",
",",
"@",
"CheckForNull",
"Project",
"project",
")",
"throws",
"PluginException",
"{",
"URL",
"urlString",
";",
"try",
"{",
"urlString",
"=",
"f",
".",
"toURI",
"(",
")",
".",
"toURL",
"("... | Loads the given plugin and enables it for the given project.
@param f
A non-null jar file of custom plugin.
@param project
A nullable target project | [
"Loads",
"the",
"given",
"plugin",
"and",
"enables",
"it",
"for",
"the",
"given",
"project",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java#L636-L645 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/PreConditions.java | PreConditions.ifNull | public static <T> T ifNull(final T reference, final T defaultValue) {
"""
If our reference is null then return a default value instead.
@param reference the thing to check.
@param defaultValue the default value to return if the above reference is null.
@return the reference if not null, otherwise the default ... | java | public static <T> T ifNull(final T reference, final T defaultValue) {
if (reference == null) {
return defaultValue;
}
return reference;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"ifNull",
"(",
"final",
"T",
"reference",
",",
"final",
"T",
"defaultValue",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"reference",
";",
"}"
] | If our reference is null then return a default value instead.
@param reference the thing to check.
@param defaultValue the default value to return if the above reference is null.
@return the reference if not null, otherwise the default value. Note, if your default value
is null as well then you will get back null, sin... | [
"If",
"our",
"reference",
"is",
"null",
"then",
"return",
"a",
"default",
"value",
"instead",
"."
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/PreConditions.java#L132-L137 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/Directory.java | Directory.setString | @java.lang.SuppressWarnings( {
"""
Sets a <code>String</code> value for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag as a String
""" "ConstantConditions" })
public void setString(int tagType, @NotNull String value)
{
if (value ==... | java | @java.lang.SuppressWarnings({ "ConstantConditions" })
public void setString(int tagType, @NotNull String value)
{
if (value == null)
throw new NullPointerException("cannot set a null String");
setObject(tagType, value);
} | [
"@",
"java",
".",
"lang",
".",
"SuppressWarnings",
"(",
"{",
"\"ConstantConditions\"",
"}",
")",
"public",
"void",
"setString",
"(",
"int",
"tagType",
",",
"@",
"NotNull",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new"... | Sets a <code>String</code> value for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag as a String | [
"Sets",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"value",
"for",
"the",
"specified",
"tag",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/Directory.java#L283-L289 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/io/FileSupport.java | FileSupport.getFilesAndDirectoriesInDirectoryTree | public static ArrayList<File> getFilesAndDirectoriesInDirectoryTree(String path, String includeMask) {
"""
Retrieves all files from a directory and its subdirectories.
@param path path to directory
@param includeMask file name to match
@return a list containing the found files
"""
File file = new File(p... | java | public static ArrayList<File> getFilesAndDirectoriesInDirectoryTree(String path, String includeMask) {
File file = new File(path);
return getContentsInDirectoryTree(file, includeMask, true, true);
} | [
"public",
"static",
"ArrayList",
"<",
"File",
">",
"getFilesAndDirectoriesInDirectoryTree",
"(",
"String",
"path",
",",
"String",
"includeMask",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"path",
")",
";",
"return",
"getContentsInDirectoryTree",
"(",
"fi... | Retrieves all files from a directory and its subdirectories.
@param path path to directory
@param includeMask file name to match
@return a list containing the found files | [
"Retrieves",
"all",
"files",
"from",
"a",
"directory",
"and",
"its",
"subdirectories",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L196-L199 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_virtualNetworkInterface_GET | public ArrayList<String> serviceName_virtualNetworkInterface_GET(String serviceName, OvhVirtualNetworkInterfaceModeEnum mode, String name, String vrack) throws IOException {
"""
List server VirtualNetworkInterfaces
REST: GET /dedicated/server/{serviceName}/virtualNetworkInterface
@param name [required] Filter ... | java | public ArrayList<String> serviceName_virtualNetworkInterface_GET(String serviceName, OvhVirtualNetworkInterfaceModeEnum mode, String name, String vrack) throws IOException {
String qPath = "/dedicated/server/{serviceName}/virtualNetworkInterface";
StringBuilder sb = path(qPath, serviceName);
query(sb, "mode", mod... | [
"public",
"ArrayList",
"<",
"String",
">",
"serviceName_virtualNetworkInterface_GET",
"(",
"String",
"serviceName",
",",
"OvhVirtualNetworkInterfaceModeEnum",
"mode",
",",
"String",
"name",
",",
"String",
"vrack",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | List server VirtualNetworkInterfaces
REST: GET /dedicated/server/{serviceName}/virtualNetworkInterface
@param name [required] Filter the value of name property (=)
@param vrack [required] Filter the value of vrack property (=)
@param mode [required] Filter the value of mode property (=)
@param serviceName [required] T... | [
"List",
"server",
"VirtualNetworkInterfaces"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L185-L193 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/utils/PromptX509TrustManager.java | PromptX509TrustManager.generateDigest | private String generateDigest(String algorithmName, X509Certificate cert) {
"""
This method is used to create a "SHA-1" or "MD5" digest on an
X509Certificate as the "fingerprint".
@param algorithmName
@param cert
@return String
"""
try {
MessageDigest md = MessageDigest.getInstanc... | java | private String generateDigest(String algorithmName, X509Certificate cert) {
try {
MessageDigest md = MessageDigest.getInstance(algorithmName);
md.update(cert.getEncoded());
byte data[] = md.digest();
StringBuilder buffer = new StringBuilder(3 * data.length);
... | [
"private",
"String",
"generateDigest",
"(",
"String",
"algorithmName",
",",
"X509Certificate",
"cert",
")",
"{",
"try",
"{",
"MessageDigest",
"md",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"algorithmName",
")",
";",
"md",
".",
"update",
"(",
"cert",
".",... | This method is used to create a "SHA-1" or "MD5" digest on an
X509Certificate as the "fingerprint".
@param algorithmName
@param cert
@return String | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"SHA",
"-",
"1",
"or",
"MD5",
"digest",
"on",
"an",
"X509Certificate",
"as",
"the",
"fingerprint",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/utils/PromptX509TrustManager.java#L72-L94 |
Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/authorization/DefaultAuthorizationStrategy.java | DefaultAuthorizationStrategy.addAuthorization | @Override
public void addAuthorization(FoxHttpAuthorizationScope foxHttpAuthorizationScope, FoxHttpAuthorization foxHttpAuthorization) {
"""
Add a new FoxHttpAuthorization to the AuthorizationStrategy
@param foxHttpAuthorizationScope scope in which the authorization is used
@param foxHttpAuthorization ... | java | @Override
public void addAuthorization(FoxHttpAuthorizationScope foxHttpAuthorizationScope, FoxHttpAuthorization foxHttpAuthorization) {
if (foxHttpAuthorizations.containsKey(foxHttpAuthorizationScope.toString())) {
foxHttpAuthorizations.get(foxHttpAuthorizationScope.toString()).add(foxHttpAutho... | [
"@",
"Override",
"public",
"void",
"addAuthorization",
"(",
"FoxHttpAuthorizationScope",
"foxHttpAuthorizationScope",
",",
"FoxHttpAuthorization",
"foxHttpAuthorization",
")",
"{",
"if",
"(",
"foxHttpAuthorizations",
".",
"containsKey",
"(",
"foxHttpAuthorizationScope",
".",
... | Add a new FoxHttpAuthorization to the AuthorizationStrategy
@param foxHttpAuthorizationScope scope in which the authorization is used
@param foxHttpAuthorization authorization itself | [
"Add",
"a",
"new",
"FoxHttpAuthorization",
"to",
"the",
"AuthorizationStrategy"
] | train | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/authorization/DefaultAuthorizationStrategy.java#L59-L67 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.seekUnusedZero | protected synchronized long seekUnusedZero(Long bucketId, Aggressiveness aggressiveness) {
"""
This method seeks for unused zero-copy memory allocations
@param bucketId Id of the bucket, serving allocations
@return size of memory that was deallocated
"""
AtomicLong freeSpace = new AtomicLong(0);
... | java | protected synchronized long seekUnusedZero(Long bucketId, Aggressiveness aggressiveness) {
AtomicLong freeSpace = new AtomicLong(0);
int totalElements = (int) memoryHandler.getAllocatedHostObjects(bucketId);
// these 2 variables will contain jvm-wise memory access frequencies
float sho... | [
"protected",
"synchronized",
"long",
"seekUnusedZero",
"(",
"Long",
"bucketId",
",",
"Aggressiveness",
"aggressiveness",
")",
"{",
"AtomicLong",
"freeSpace",
"=",
"new",
"AtomicLong",
"(",
"0",
")",
";",
"int",
"totalElements",
"=",
"(",
"int",
")",
"memoryHandl... | This method seeks for unused zero-copy memory allocations
@param bucketId Id of the bucket, serving allocations
@return size of memory that was deallocated | [
"This",
"method",
"seeks",
"for",
"unused",
"zero",
"-",
"copy",
"memory",
"allocations"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L563-L619 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java | SipMessageStreamBuilder.onPayload | private final State onPayload(final Buffer buffer) {
"""
We may or may not have a payload, which depends on whether there is a Content-length
header available or not. If yes, then we will just slice out that entire thing once
we have enough readable bytes in the buffer.
@param buffer
@return
"""
... | java | private final State onPayload(final Buffer buffer) {
if (contentLength == 0) {
return State.DONE;
}
if (buffer.getReadableBytes() >= contentLength) {
try {
payload = buffer.readBytes(contentLength);
} catch (final IOException e) {
... | [
"private",
"final",
"State",
"onPayload",
"(",
"final",
"Buffer",
"buffer",
")",
"{",
"if",
"(",
"contentLength",
"==",
"0",
")",
"{",
"return",
"State",
".",
"DONE",
";",
"}",
"if",
"(",
"buffer",
".",
"getReadableBytes",
"(",
")",
">=",
"contentLength"... | We may or may not have a payload, which depends on whether there is a Content-length
header available or not. If yes, then we will just slice out that entire thing once
we have enough readable bytes in the buffer.
@param buffer
@return | [
"We",
"may",
"or",
"may",
"not",
"have",
"a",
"payload",
"which",
"depends",
"on",
"whether",
"there",
"is",
"a",
"Content",
"-",
"length",
"header",
"available",
"or",
"not",
".",
"If",
"yes",
"then",
"we",
"will",
"just",
"slice",
"out",
"that",
"ent... | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java#L432-L447 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java | SuperPositionQCP.weightedSuperpose | public Matrix4d weightedSuperpose(Point3d[] fixed, Point3d[] moved, double[] weight) {
"""
Weighted superposition.
@param fixed
@param moved
@param weight
array of weigths for each equivalent point position
@return
"""
set(moved, fixed, weight);
getRotationMatrix();
if (!centered) {
calcTransfo... | java | public Matrix4d weightedSuperpose(Point3d[] fixed, Point3d[] moved, double[] weight) {
set(moved, fixed, weight);
getRotationMatrix();
if (!centered) {
calcTransformation();
} else {
transformation.set(rotmat);
}
return transformation;
} | [
"public",
"Matrix4d",
"weightedSuperpose",
"(",
"Point3d",
"[",
"]",
"fixed",
",",
"Point3d",
"[",
"]",
"moved",
",",
"double",
"[",
"]",
"weight",
")",
"{",
"set",
"(",
"moved",
",",
"fixed",
",",
"weight",
")",
";",
"getRotationMatrix",
"(",
")",
";"... | Weighted superposition.
@param fixed
@param moved
@param weight
array of weigths for each equivalent point position
@return | [
"Weighted",
"superposition",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java#L228-L237 |
agmip/ace-lookup | src/main/java/org/agmip/ace/util/AcePathfinderUtil.java | AcePathfinderUtil.buildNestedBuckets | private static void buildNestedBuckets(HashMap m, String p) {
"""
A helper method to created the nested bucket structure.
@param m The map in which to build the nested structure.
@param p The nested bucket structure to create
"""
String[] components = p.split(":");
int cl = components.length;... | java | private static void buildNestedBuckets(HashMap m, String p) {
String[] components = p.split(":");
int cl = components.length;
if(cl == 1) {
if( ! m.containsKey(components[0]) )
m.put(components[0], new HashMap());
} else {
HashMap temp = m;
... | [
"private",
"static",
"void",
"buildNestedBuckets",
"(",
"HashMap",
"m",
",",
"String",
"p",
")",
"{",
"String",
"[",
"]",
"components",
"=",
"p",
".",
"split",
"(",
"\":\"",
")",
";",
"int",
"cl",
"=",
"components",
".",
"length",
";",
"if",
"(",
"cl... | A helper method to created the nested bucket structure.
@param m The map in which to build the nested structure.
@param p The nested bucket structure to create | [
"A",
"helper",
"method",
"to",
"created",
"the",
"nested",
"bucket",
"structure",
"."
] | train | https://github.com/agmip/ace-lookup/blob/d8224a231cb8c01729e63010916a2a85517ce4c1/src/main/java/org/agmip/ace/util/AcePathfinderUtil.java#L260-L274 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/BasicTimeZone.java | BasicTimeZone.hasEquivalentTransitions | public boolean hasEquivalentTransitions(TimeZone tz, long start, long end) {
"""
<strong>[icu]</strong> Checks if the time zone has equivalent transitions in the time range.
This method returns true when all of transition times, from/to standard
offsets and DST savings used by this time zone match the other in t... | java | public boolean hasEquivalentTransitions(TimeZone tz, long start, long end) {
return hasEquivalentTransitions(tz, start, end, false);
} | [
"public",
"boolean",
"hasEquivalentTransitions",
"(",
"TimeZone",
"tz",
",",
"long",
"start",
",",
"long",
"end",
")",
"{",
"return",
"hasEquivalentTransitions",
"(",
"tz",
",",
"start",
",",
"end",
",",
"false",
")",
";",
"}"
] | <strong>[icu]</strong> Checks if the time zone has equivalent transitions in the time range.
This method returns true when all of transition times, from/to standard
offsets and DST savings used by this time zone match the other in the
time range.
<p>Example code:{{@literal @}.jcite android.icu.samples.util.timezone.Ba... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Checks",
"if",
"the",
"time",
"zone",
"has",
"equivalent",
"transitions",
"in",
"the",
"time",
"range",
".",
"This",
"method",
"returns",
"true",
"when",
"all",
"of",
"transition",
"times",
"from... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/BasicTimeZone.java#L78-L80 |
infinispan/infinispan | core/src/main/java/org/infinispan/container/offheap/OffHeapEntryFactoryImpl.java | OffHeapEntryFactoryImpl.equalsKey | @Override
public boolean equalsKey(long address, WrappedBytes wrappedBytes) {
"""
Assumes the address points to the entry excluding the pointer reference at the beginning
@param address the address of an entry to read
@param wrappedBytes the key to check if it equals
@return whether the key and address are e... | java | @Override
public boolean equalsKey(long address, WrappedBytes wrappedBytes) {
// 16 bytes for eviction if needed (optional)
// 8 bytes for linked pointer
int headerOffset = evictionEnabled ? 24 : 8;
byte type = MEMORY.getByte(address, headerOffset);
headerOffset++;
// First if has... | [
"@",
"Override",
"public",
"boolean",
"equalsKey",
"(",
"long",
"address",
",",
"WrappedBytes",
"wrappedBytes",
")",
"{",
"// 16 bytes for eviction if needed (optional)",
"// 8 bytes for linked pointer",
"int",
"headerOffset",
"=",
"evictionEnabled",
"?",
"24",
":",
"8",
... | Assumes the address points to the entry excluding the pointer reference at the beginning
@param address the address of an entry to read
@param wrappedBytes the key to check if it equals
@return whether the key and address are equal | [
"Assumes",
"the",
"address",
"points",
"to",
"the",
"entry",
"excluding",
"the",
"pointer",
"reference",
"at",
"the",
"beginning"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/offheap/OffHeapEntryFactoryImpl.java#L367-L399 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.getTraitDefinition | public Struct getTraitDefinition(final String guid, final String traitName) throws AtlasServiceException {
"""
Get trait definition for a given entity and traitname
@param guid GUID of the entity
@param traitName
@return trait definition
@throws AtlasServiceException
"""
JSONObject jsonResponse = c... | java | public Struct getTraitDefinition(final String guid, final String traitName) throws AtlasServiceException{
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_TRAIT_DEFINITION, null, guid, TRAIT_DEFINITIONS, traitName);
try {
return InstanceSerialization.fromJsonStruct(jsonResponse.ge... | [
"public",
"Struct",
"getTraitDefinition",
"(",
"final",
"String",
"guid",
",",
"final",
"String",
"traitName",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"GET_TRAIT_DEFINITION",
",",
"nu... | Get trait definition for a given entity and traitname
@param guid GUID of the entity
@param traitName
@return trait definition
@throws AtlasServiceException | [
"Get",
"trait",
"definition",
"for",
"a",
"given",
"entity",
"and",
"traitname"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L736-L744 |
apereo/cas | support/cas-server-support-shell/src/main/java/org/apereo/cas/shell/commands/util/ValidateLdapConnectionCommand.java | ValidateLdapConnectionCommand.validateLdap | @ShellMethod(key = "validate-ldap", value = "Test connections to an LDAP server to verify connectivity, SSL, etc")
public static void validateLdap(
@ShellOption(value = {
"""
Validate endpoint.
@param url the url
@param bindDn the bind dn
@param bindCredential the bind credentia... | java | @ShellMethod(key = "validate-ldap", value = "Test connections to an LDAP server to verify connectivity, SSL, etc")
public static void validateLdap(
@ShellOption(value = {"url"},
help = "LDAP URL to test, comma-separated.") final String url,
@ShellOption(value = {"bindDn"},
he... | [
"@",
"ShellMethod",
"(",
"key",
"=",
"\"validate-ldap\"",
",",
"value",
"=",
"\"Test connections to an LDAP server to verify connectivity, SSL, etc\"",
")",
"public",
"static",
"void",
"validateLdap",
"(",
"@",
"ShellOption",
"(",
"value",
"=",
"{",
"\"url\"",
"}",
",... | Validate endpoint.
@param url the url
@param bindDn the bind dn
@param bindCredential the bind credential
@param baseDn the base dn
@param searchFilter the search filter
@param userPassword the user password
@param userAttributes the user attributes | [
"Validate",
"endpoint",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-shell/src/main/java/org/apereo/cas/shell/commands/util/ValidateLdapConnectionCommand.java#L42-L63 |
hal/core | flow/core/src/main/java/org/jboss/gwt/flow/client/Async.java | Async.whilst | public void whilst(Precondition condition, final Outcome outcome, final Function function) {
"""
Repeatedly call function, while condition is met. Calls the callback when stopped, or an error occurs.
"""
whilst(condition, outcome, function, -1);
} | java | public void whilst(Precondition condition, final Outcome outcome, final Function function) {
whilst(condition, outcome, function, -1);
} | [
"public",
"void",
"whilst",
"(",
"Precondition",
"condition",
",",
"final",
"Outcome",
"outcome",
",",
"final",
"Function",
"function",
")",
"{",
"whilst",
"(",
"condition",
",",
"outcome",
",",
"function",
",",
"-",
"1",
")",
";",
"}"
] | Repeatedly call function, while condition is met. Calls the callback when stopped, or an error occurs. | [
"Repeatedly",
"call",
"function",
"while",
"condition",
"is",
"met",
".",
"Calls",
"the",
"callback",
"when",
"stopped",
"or",
"an",
"error",
"occurs",
"."
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/flow/core/src/main/java/org/jboss/gwt/flow/client/Async.java#L157-L159 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/LossLayer.java | LossLayer.f1Score | @Override
public double f1Score(INDArray examples, INDArray labels) {
"""
Returns the f1 score for the given examples.
Think of this to be like a percentage right.
The higher the number the more it got right.
This is on a scale from 0 to 1.
@param examples te the examples to classify (one example in each... | java | @Override
public double f1Score(INDArray examples, INDArray labels) {
Evaluation eval = new Evaluation();
eval.eval(labels, activate(examples, false, LayerWorkspaceMgr.noWorkspacesImmutable()));
return eval.f1();
} | [
"@",
"Override",
"public",
"double",
"f1Score",
"(",
"INDArray",
"examples",
",",
"INDArray",
"labels",
")",
"{",
"Evaluation",
"eval",
"=",
"new",
"Evaluation",
"(",
")",
";",
"eval",
".",
"eval",
"(",
"labels",
",",
"activate",
"(",
"examples",
",",
"f... | Returns the f1 score for the given examples.
Think of this to be like a percentage right.
The higher the number the more it got right.
This is on a scale from 0 to 1.
@param examples te the examples to classify (one example in each row)
@param labels the true labels
@return the scores for each ndarray | [
"Returns",
"the",
"f1",
"score",
"for",
"the",
"given",
"examples",
".",
"Think",
"of",
"this",
"to",
"be",
"like",
"a",
"percentage",
"right",
".",
"The",
"higher",
"the",
"number",
"the",
"more",
"it",
"got",
"right",
".",
"This",
"is",
"on",
"a",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/LossLayer.java#L225-L230 |
i-net-software/jlessc | src/com/inet/lib/less/FunctionExpression.java | FunctionExpression.evalParam | private void evalParam( int idx, CssFormatter formatter ) {
"""
Evaluate a parameter as this function.
@param idx
the index of the parameter starting with 0
@param formatter
the current formation context
"""
Expression expr = get( idx );
type = expr.getDataType( formatter );
switc... | java | private void evalParam( int idx, CssFormatter formatter ) {
Expression expr = get( idx );
type = expr.getDataType( formatter );
switch( type ) {
case BOOLEAN:
booleanValue = expr.booleanValue( formatter );
break;
case STRING:
... | [
"private",
"void",
"evalParam",
"(",
"int",
"idx",
",",
"CssFormatter",
"formatter",
")",
"{",
"Expression",
"expr",
"=",
"get",
"(",
"idx",
")",
";",
"type",
"=",
"expr",
".",
"getDataType",
"(",
"formatter",
")",
";",
"switch",
"(",
"type",
")",
"{",... | Evaluate a parameter as this function.
@param idx
the index of the parameter starting with 0
@param formatter
the current formation context | [
"Evaluate",
"a",
"parameter",
"as",
"this",
"function",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/FunctionExpression.java#L748-L760 |
pmwmedia/tinylog | tinylog-api/src/main/java/org/tinylog/runtime/AndroidRuntime.java | AndroidRuntime.findStackTraceElement | private static StackTraceElement findStackTraceElement(final String loggerClassName, final StackTraceElement[] trace) {
"""
Gets the stack trace element that appears before the passed logger class name.
@param loggerClassName
Logger class name that should appear before the expected stack trace element
@param ... | java | private static StackTraceElement findStackTraceElement(final String loggerClassName, final StackTraceElement[] trace) {
int index = 0;
while (index < trace.length && !loggerClassName.equals(trace[index].getClassName())) {
index = index + 1;
}
while (index < trace.length && loggerClassName.equals(trace[... | [
"private",
"static",
"StackTraceElement",
"findStackTraceElement",
"(",
"final",
"String",
"loggerClassName",
",",
"final",
"StackTraceElement",
"[",
"]",
"trace",
")",
"{",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"index",
"<",
"trace",
".",
"length",
"&&... | Gets the stack trace element that appears before the passed logger class name.
@param loggerClassName
Logger class name that should appear before the expected stack trace element
@param trace
Source stack trace
@return Found stack trace element or {@code null} | [
"Gets",
"the",
"stack",
"trace",
"element",
"that",
"appears",
"before",
"the",
"passed",
"logger",
"class",
"name",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-api/src/main/java/org/tinylog/runtime/AndroidRuntime.java#L134-L150 |
tango-controls/JTango | server/src/main/java/org/tango/server/servant/DeviceImpl.java | DeviceImpl.initDevice | public synchronized void initDevice() {
"""
Initializes the device: <br>
<ul>
<li>reloads device and class properties</li>
<li>applies memorized value to attributes</li>
<li>restarts polling</li>
<li>calls delete method {@link Delete}
<li>
<li>calls init method {@link Init}
<li>
</ul>
"""
MDC.... | java | public synchronized void initDevice() {
MDC.setContextMap(contextMap);
xlogger.entry();
if (stateImpl == null) {
stateImpl = new StateImpl(businessObject, null, null);
}
if (statusImpl == null) {
statusImpl = new StatusImpl(businessObject, null, null);
... | [
"public",
"synchronized",
"void",
"initDevice",
"(",
")",
"{",
"MDC",
".",
"setContextMap",
"(",
"contextMap",
")",
";",
"xlogger",
".",
"entry",
"(",
")",
";",
"if",
"(",
"stateImpl",
"==",
"null",
")",
"{",
"stateImpl",
"=",
"new",
"StateImpl",
"(",
... | Initializes the device: <br>
<ul>
<li>reloads device and class properties</li>
<li>applies memorized value to attributes</li>
<li>restarts polling</li>
<li>calls delete method {@link Delete}
<li>
<li>calls init method {@link Init}
<li>
</ul> | [
"Initializes",
"the",
"device",
":",
"<br",
">",
"<ul",
">",
"<li",
">",
"reloads",
"device",
"and",
"class",
"properties<",
"/",
"li",
">",
"<li",
">",
"applies",
"memorized",
"value",
"to",
"attributes<",
"/",
"li",
">",
"<li",
">",
"restarts",
"pollin... | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L710-L731 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/MethodDesc.java | MethodDesc.forArguments | public static MethodDesc forArguments(TypeDesc ret, TypeDesc... params) {
"""
Acquire a MethodDesc from a set of arguments.
@param ret return type of method; null implies void
@param params parameters to method; null implies none
"""
final String[] paramNames = createGenericParameterNames(params);
... | java | public static MethodDesc forArguments(TypeDesc ret, TypeDesc... params) {
final String[] paramNames = createGenericParameterNames(params);
return forArguments(ret, params, paramNames);
} | [
"public",
"static",
"MethodDesc",
"forArguments",
"(",
"TypeDesc",
"ret",
",",
"TypeDesc",
"...",
"params",
")",
"{",
"final",
"String",
"[",
"]",
"paramNames",
"=",
"createGenericParameterNames",
"(",
"params",
")",
";",
"return",
"forArguments",
"(",
"ret",
... | Acquire a MethodDesc from a set of arguments.
@param ret return type of method; null implies void
@param params parameters to method; null implies none | [
"Acquire",
"a",
"MethodDesc",
"from",
"a",
"set",
"of",
"arguments",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/MethodDesc.java#L48-L51 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java | ConsoleMenu.getInt | public static int getInt(final String title, final int defaultValue) {
"""
Gets an int from the System.in
@param title for the command line
@param defaultValue defaultValue if title not found
@return int as entered by the user of the console app
"""
int opt;
do {
try {
... | java | public static int getInt(final String title, final int defaultValue) {
int opt;
do {
try {
final String val = ConsoleMenu.getString(title + DEFAULT_TITLE + defaultValue + ")");
if (val.length() == 0) {
opt = defaultValue;
... | [
"public",
"static",
"int",
"getInt",
"(",
"final",
"String",
"title",
",",
"final",
"int",
"defaultValue",
")",
"{",
"int",
"opt",
";",
"do",
"{",
"try",
"{",
"final",
"String",
"val",
"=",
"ConsoleMenu",
".",
"getString",
"(",
"title",
"+",
"DEFAULT_TIT... | Gets an int from the System.in
@param title for the command line
@param defaultValue defaultValue if title not found
@return int as entered by the user of the console app | [
"Gets",
"an",
"int",
"from",
"the",
"System",
".",
"in"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java#L218-L235 |
VoltDB/voltdb | src/frontend/org/voltdb/largequery/LargeBlockTask.java | LargeBlockTask.getLoadTask | public static LargeBlockTask getLoadTask(BlockId blockId, ByteBuffer block) {
"""
Get a new "load" task
@param blockId The block id of the block to load
@param block A ByteBuffer to write data intox
@return An instance of LargeBlockTask that will load a block
"""
return new LargeBlockTask() {... | java | public static LargeBlockTask getLoadTask(BlockId blockId, ByteBuffer block) {
return new LargeBlockTask() {
@Override
public LargeBlockResponse call() throws Exception {
Exception theException = null;
try {
LargeBlockManager.getInstance... | [
"public",
"static",
"LargeBlockTask",
"getLoadTask",
"(",
"BlockId",
"blockId",
",",
"ByteBuffer",
"block",
")",
"{",
"return",
"new",
"LargeBlockTask",
"(",
")",
"{",
"@",
"Override",
"public",
"LargeBlockResponse",
"call",
"(",
")",
"throws",
"Exception",
"{",... | Get a new "load" task
@param blockId The block id of the block to load
@param block A ByteBuffer to write data intox
@return An instance of LargeBlockTask that will load a block | [
"Get",
"a",
"new",
"load",
"task"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/largequery/LargeBlockTask.java#L83-L98 |
wildfly/wildfly-core | deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java | PathUtil.deleteRecursively | public static void deleteRecursively(final Path path) throws IOException {
"""
Delete a path recursively.
@param path a Path pointing to a file or a directory that may not exists anymore.
@throws IOException
"""
DeploymentRepositoryLogger.ROOT_LOGGER.debugf("Deleting %s recursively", path);
i... | java | public static void deleteRecursively(final Path path) throws IOException {
DeploymentRepositoryLogger.ROOT_LOGGER.debugf("Deleting %s recursively", path);
if (Files.exists(path)) {
Files.walkFileTree(path, new FileVisitor<Path>() {
@Override
public FileVisitRe... | [
"public",
"static",
"void",
"deleteRecursively",
"(",
"final",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"DeploymentRepositoryLogger",
".",
"ROOT_LOGGER",
".",
"debugf",
"(",
"\"Deleting %s recursively\"",
",",
"path",
")",
";",
"if",
"(",
"Files",
".",
... | Delete a path recursively.
@param path a Path pointing to a file or a directory that may not exists anymore.
@throws IOException | [
"Delete",
"a",
"path",
"recursively",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java#L105-L133 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ContainerServiceImpl.java | ContainerServiceImpl.find | @Override
public Container find(final FedoraSession session, final String path) {
"""
Retrieve a {@link org.fcrepo.kernel.api.models.Container} instance by pid and dsid
@param path the path
@param session the session
@return A {@link org.fcrepo.kernel.api.models.Container} with the proffered PID
"""
... | java | @Override
public Container find(final FedoraSession session, final String path) {
final Node node = findNode(session, path);
return cast(node);
} | [
"@",
"Override",
"public",
"Container",
"find",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"path",
")",
"{",
"final",
"Node",
"node",
"=",
"findNode",
"(",
"session",
",",
"path",
")",
";",
"return",
"cast",
"(",
"node",
")",
";",
... | Retrieve a {@link org.fcrepo.kernel.api.models.Container} instance by pid and dsid
@param path the path
@param session the session
@return A {@link org.fcrepo.kernel.api.models.Container} with the proffered PID | [
"Retrieve",
"a",
"{",
"@link",
"org",
".",
"fcrepo",
".",
"kernel",
".",
"api",
".",
"models",
".",
"Container",
"}",
"instance",
"by",
"pid",
"and",
"dsid"
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ContainerServiceImpl.java#L119-L124 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINKHDBSCANLinearMemory.java | SLINKHDBSCANLinearMemory.step2 | private void step2(DBIDRef id, DBIDs processedIDs, DistanceQuery<? super O> distQuery, DoubleDataStore coredists, WritableDoubleDataStore m) {
"""
Second step: Determine the pairwise distances from all objects in the
pointer representation to the new object with the specified id.
@param id the id of the object... | java | private void step2(DBIDRef id, DBIDs processedIDs, DistanceQuery<? super O> distQuery, DoubleDataStore coredists, WritableDoubleDataStore m) {
double coreP = coredists.doubleValue(id);
for(DBIDIter it = processedIDs.iter(); it.valid(); it.advance()) {
// M(i) = dist(i, n+1)
double coreQ = coredists.... | [
"private",
"void",
"step2",
"(",
"DBIDRef",
"id",
",",
"DBIDs",
"processedIDs",
",",
"DistanceQuery",
"<",
"?",
"super",
"O",
">",
"distQuery",
",",
"DoubleDataStore",
"coredists",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"double",
"coreP",
"=",
"coredis... | Second step: Determine the pairwise distances from all objects in the
pointer representation to the new object with the specified id.
@param id the id of the object to be inserted into the pointer
representation
@param processedIDs the already processed ids
@param distQuery Distance query
@param m Data store | [
"Second",
"step",
":",
"Determine",
"the",
"pairwise",
"distances",
"from",
"all",
"objects",
"in",
"the",
"pointer",
"representation",
"to",
"the",
"new",
"object",
"with",
"the",
"specified",
"id",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINKHDBSCANLinearMemory.java#L156-L164 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java | RespokeEndpoint.sendMessage | public void sendMessage(String message, boolean push, boolean ccSelf, final Respoke.TaskCompletionListener completionListener) {
"""
Send a message to the endpoint through the infrastructure.
@param message The message to send
@param push A flag indicating if a push notification shou... | java | public void sendMessage(String message, boolean push, boolean ccSelf, final Respoke.TaskCompletionListener completionListener) {
if ((null != signalingChannel) && (signalingChannel.connected)) {
try {
JSONObject data = new JSONObject();
data.put("to", endpointID);
... | [
"public",
"void",
"sendMessage",
"(",
"String",
"message",
",",
"boolean",
"push",
",",
"boolean",
"ccSelf",
",",
"final",
"Respoke",
".",
"TaskCompletionListener",
"completionListener",
")",
"{",
"if",
"(",
"(",
"null",
"!=",
"signalingChannel",
")",
"&&",
"(... | Send a message to the endpoint through the infrastructure.
@param message The message to send
@param push A flag indicating if a push notification should be sent for this message
@param ccSelf A flag indicating if the message should be copied to other devices the client might be... | [
"Send",
"a",
"message",
"to",
"the",
"endpoint",
"through",
"the",
"infrastructure",
"."
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java#L106-L132 |
xfcjscn/sudoor-server-lib | src/main/java/net/gplatform/sudoor/server/security/model/DefaultPermissionEvaluator.java | DefaultPermissionEvaluator.getExpressionString | public String getExpressionString(String name, Object permission) {
"""
Find the expression string recursively from the config file
@param name
@param permission
@return
"""
String expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name + "." + permission);
//Get generic permit
if (expr... | java | public String getExpressionString(String name, Object permission) {
String expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name + "." + permission);
//Get generic permit
if (expression == null) {
expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name);
}
//Get parent permit
... | [
"public",
"String",
"getExpressionString",
"(",
"String",
"name",
",",
"Object",
"permission",
")",
"{",
"String",
"expression",
"=",
"properties",
".",
"getProperty",
"(",
"CONFIG_EXPRESSION_PREFIX",
"+",
"name",
"+",
"\".\"",
"+",
"permission",
")",
";",
"//Ge... | Find the expression string recursively from the config file
@param name
@param permission
@return | [
"Find",
"the",
"expression",
"string",
"recursively",
"from",
"the",
"config",
"file"
] | train | https://github.com/xfcjscn/sudoor-server-lib/blob/37dc1996eaa9cad25c82abd1de315ba565e32097/src/main/java/net/gplatform/sudoor/server/security/model/DefaultPermissionEvaluator.java#L75-L91 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/input/named/AbstractNamedInputHandler.java | AbstractNamedInputHandler.updateProperties | private void updateProperties(T target, Map<String, Object> source) {
"""
Updates bean by using PropertyDescriptors. Values are read from
source.
Is used by {@link #updateBean(Object, java.util.Map)}
@param target target Bean
@param source source Map
"""
Map<String, PropertyDescriptor> mapTargetP... | java | private void updateProperties(T target, Map<String, Object> source) {
Map<String, PropertyDescriptor> mapTargetProps = MappingUtils.mapPropertyDescriptors(target.getClass());
for (String sourceKey : source.keySet()) {
if (mapTargetProps.containsKey(sourceKey) == true) {
Mapp... | [
"private",
"void",
"updateProperties",
"(",
"T",
"target",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"Map",
"<",
"String",
",",
"PropertyDescriptor",
">",
"mapTargetProps",
"=",
"MappingUtils",
".",
"mapPropertyDescriptors",
"(",
"targ... | Updates bean by using PropertyDescriptors. Values are read from
source.
Is used by {@link #updateBean(Object, java.util.Map)}
@param target target Bean
@param source source Map | [
"Updates",
"bean",
"by",
"using",
"PropertyDescriptors",
".",
"Values",
"are",
"read",
"from",
"source",
".",
"Is",
"used",
"by",
"{",
"@link",
"#updateBean",
"(",
"Object",
"java",
".",
"util",
".",
"Map",
")",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/input/named/AbstractNamedInputHandler.java#L104-L112 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readDefaultFile | public CmsResource readDefaultFile(
CmsRequestContext context,
CmsResource resource,
CmsResourceFilter resourceFilter)
throws CmsSecurityException {
"""
Returns the default file for the given folder.<p>
If the given resource is a file, then this file is returned.<p>
Otherwise, in ... | java | public CmsResource readDefaultFile(
CmsRequestContext context,
CmsResource resource,
CmsResourceFilter resourceFilter)
throws CmsSecurityException {
CmsResource result = null;
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
CmsResource ... | [
"public",
"CmsResource",
"readDefaultFile",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"CmsResourceFilter",
"resourceFilter",
")",
"throws",
"CmsSecurityException",
"{",
"CmsResource",
"result",
"=",
"null",
";",
"CmsDbContext",
"dbc",
"="... | Returns the default file for the given folder.<p>
If the given resource is a file, then this file is returned.<p>
Otherwise, in case of a folder:<br>
<ol>
<li>the {@link CmsPropertyDefinition#PROPERTY_DEFAULT_FILE} is checked, and
<li>if still no file could be found, the configured default files in the
<code>opencms-... | [
"Returns",
"the",
"default",
"file",
"for",
"the",
"given",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4183-L4208 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asLong | public static Long asLong(String expression, Node node)
throws XPathExpressionException {
"""
Evaluates the specified XPath expression and returns the result as a
Long.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@... | java | public static Long asLong(String expression, Node node)
throws XPathExpressionException {
return asLong(expression, node, xpath());
} | [
"public",
"static",
"Long",
"asLong",
"(",
"String",
"expression",
",",
"Node",
"node",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"asLong",
"(",
"expression",
",",
"node",
",",
"xpath",
"(",
")",
")",
";",
"}"
] | Evaluates the specified XPath expression and returns the result as a
Long.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@link #asDouble(String, Node, XPath)} instead. Note {@link XPath} is
not thread-safe and not reentrant.
@param expr... | [
"Evaluates",
"the",
"specified",
"XPath",
"expression",
"and",
"returns",
"the",
"result",
"as",
"a",
"Long",
".",
"<p",
">",
"This",
"method",
"can",
"be",
"expensive",
"as",
"a",
"new",
"xpath",
"is",
"instantiated",
"per",
"invocation",
".",
"Consider",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L382-L385 |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.screenToFull | public static Point screenToFull (
MisoSceneMetrics metrics, int sx, int sy, Point fpos) {
"""
Convert the given screen-based pixel coordinates to full
scene-based coordinates that include both the tile coordinates
and the fine coordinates in each dimension. Converted
coordinates are placed in the give... | java | public static Point screenToFull (
MisoSceneMetrics metrics, int sx, int sy, Point fpos)
{
// get the tile coordinates
Point tpos = new Point();
screenToTile(metrics, sx, sy, tpos);
// get the screen coordinates for the containing tile
Point spos = tileToScreen(metri... | [
"public",
"static",
"Point",
"screenToFull",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"sx",
",",
"int",
"sy",
",",
"Point",
"fpos",
")",
"{",
"// get the tile coordinates",
"Point",
"tpos",
"=",
"new",
"Point",
"(",
")",
";",
"screenToTile",
"(",
"met... | Convert the given screen-based pixel coordinates to full
scene-based coordinates that include both the tile coordinates
and the fine coordinates in each dimension. Converted
coordinates are placed in the given point object.
@param sx the screen x-position pixel coordinate.
@param sy the screen y-position pixel coordi... | [
"Convert",
"the",
"given",
"screen",
"-",
"based",
"pixel",
"coordinates",
"to",
"full",
"scene",
"-",
"based",
"coordinates",
"that",
"include",
"both",
"the",
"tile",
"coordinates",
"and",
"the",
"fine",
"coordinates",
"in",
"each",
"dimension",
".",
"Conver... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L317-L342 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.update_child_account | public String update_child_account(Object data) {
"""
/*
Update Child Account.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
@options data {String} company_org: Name of Re... | java | public String update_child_account(Object data) {
Gson gson = new Gson();
String json = gson.toJson(data);
return put("account", json);
} | [
"public",
"String",
"update_child_account",
"(",
"Object",
"data",
")",
"{",
"Gson",
"gson",
"=",
"new",
"Gson",
"(",
")",
";",
"String",
"json",
"=",
"gson",
".",
"toJson",
"(",
"data",
")",
";",
"return",
"put",
"(",
"\"account\"",
",",
"json",
")",
... | /*
Update Child Account.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
@options data {String} company_org: Name of Reseller child’s company [Optional]
@options data {String} first_... | [
"/",
"*",
"Update",
"Child",
"Account",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L212-L216 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/inmemory/AbstractCache.java | AbstractCache.incrementDocCount | @Override
public void incrementDocCount(String word, long howMuch) {
"""
Increment number of documents the label was observed in
Please note: this method is NOT thread-safe
@param word the word to increment by
@param howMuch
"""
T element = extendedVocabulary.get(word);
if (element !... | java | @Override
public void incrementDocCount(String word, long howMuch) {
T element = extendedVocabulary.get(word);
if (element != null) {
element.incrementSequencesCount();
}
} | [
"@",
"Override",
"public",
"void",
"incrementDocCount",
"(",
"String",
"word",
",",
"long",
"howMuch",
")",
"{",
"T",
"element",
"=",
"extendedVocabulary",
".",
"get",
"(",
"word",
")",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"element",
".",
... | Increment number of documents the label was observed in
Please note: this method is NOT thread-safe
@param word the word to increment by
@param howMuch | [
"Increment",
"number",
"of",
"documents",
"the",
"label",
"was",
"observed",
"in"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/inmemory/AbstractCache.java#L334-L340 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.projectionSplit | public static void projectionSplit( DMatrixRMaj P , DMatrixRMaj M , Vector3D_F64 T ) {
"""
Splits the projection matrix into a 3x3 matrix and 3x1 vector.
@param P (Input) 3x4 projection matirx
@param M (Output) M = P(:,0:2)
@param T (Output) T = P(:,3)
"""
CommonOps_DDRM.extract(P,0,3,0,3,M,0,0);
T.x ... | java | public static void projectionSplit( DMatrixRMaj P , DMatrixRMaj M , Vector3D_F64 T ) {
CommonOps_DDRM.extract(P,0,3,0,3,M,0,0);
T.x = P.get(0,3);
T.y = P.get(1,3);
T.z = P.get(2,3);
} | [
"public",
"static",
"void",
"projectionSplit",
"(",
"DMatrixRMaj",
"P",
",",
"DMatrixRMaj",
"M",
",",
"Vector3D_F64",
"T",
")",
"{",
"CommonOps_DDRM",
".",
"extract",
"(",
"P",
",",
"0",
",",
"3",
",",
"0",
",",
"3",
",",
"M",
",",
"0",
",",
"0",
"... | Splits the projection matrix into a 3x3 matrix and 3x1 vector.
@param P (Input) 3x4 projection matirx
@param M (Output) M = P(:,0:2)
@param T (Output) T = P(:,3) | [
"Splits",
"the",
"projection",
"matrix",
"into",
"a",
"3x3",
"matrix",
"and",
"3x1",
"vector",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L650-L655 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getMD5String | public static String getMD5String(String str) {
"""
Calculate MD5 hash of a String
@param str - the String to hash
@return the MD5 hash value
"""
MessageDigest messageDigest = getMessageDigest(MD5);
return getHashString(str, messageDigest);
} | java | public static String getMD5String(String str) {
MessageDigest messageDigest = getMessageDigest(MD5);
return getHashString(str, messageDigest);
} | [
"public",
"static",
"String",
"getMD5String",
"(",
"String",
"str",
")",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"MD5",
")",
";",
"return",
"getHashString",
"(",
"str",
",",
"messageDigest",
")",
";",
"}"
] | Calculate MD5 hash of a String
@param str - the String to hash
@return the MD5 hash value | [
"Calculate",
"MD5",
"hash",
"of",
"a",
"String"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L35-L38 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.createMarkerOptions | public static MarkerOptions createMarkerOptions(GeoPackage geoPackage, FeatureRow featureRow, float density, IconCache iconCache) {
"""
Create new marker options populated with the feature row style (icon or style)
@param geoPackage GeoPackage
@param featureRow feature row
@param density display density: {... | java | public static MarkerOptions createMarkerOptions(GeoPackage geoPackage, FeatureRow featureRow, float density, IconCache iconCache) {
MarkerOptions markerOptions = new MarkerOptions();
setFeatureStyle(markerOptions, geoPackage, featureRow, density, iconCache);
return markerOptions;
} | [
"public",
"static",
"MarkerOptions",
"createMarkerOptions",
"(",
"GeoPackage",
"geoPackage",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
",",
"IconCache",
"iconCache",
")",
"{",
"MarkerOptions",
"markerOptions",
"=",
"new",
"MarkerOptions",
"(",
")",
"... | Create new marker options populated with the feature row style (icon or style)
@param geoPackage GeoPackage
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@param iconCache icon cache
@return marker options populated with the feature style | [
"Create",
"new",
"marker",
"options",
"populated",
"with",
"the",
"feature",
"row",
"style",
"(",
"icon",
"or",
"style",
")"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L48-L54 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.setQuota | public static void setQuota(final GreenMailUser user, final Quota quota) {
"""
Sets a quota for a users.
@param user the user.
@param quota the quota.
"""
Session session = GreenMailUtil.getSession(ServerSetupTest.IMAP);
try {
Store store = session.getStore("imap");
... | java | public static void setQuota(final GreenMailUser user, final Quota quota) {
Session session = GreenMailUtil.getSession(ServerSetupTest.IMAP);
try {
Store store = session.getStore("imap");
store.connect(user.getEmail(), user.getPassword());
try {
(... | [
"public",
"static",
"void",
"setQuota",
"(",
"final",
"GreenMailUser",
"user",
",",
"final",
"Quota",
"quota",
")",
"{",
"Session",
"session",
"=",
"GreenMailUtil",
".",
"getSession",
"(",
"ServerSetupTest",
".",
"IMAP",
")",
";",
"try",
"{",
"Store",
"store... | Sets a quota for a users.
@param user the user.
@param quota the quota. | [
"Sets",
"a",
"quota",
"for",
"a",
"users",
"."
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L391-L405 |
eserating/siren4j | src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java | ReflectingConverter.resolveUri | private String resolveUri(String rawUri, EntityContext context, boolean handleURIOverride) throws Siren4JException {
"""
Resolves the raw uri by replacing field tokens with the actual data.
@param rawUri assumed not <code>null</code> or .
@param context
@return uri with tokens resolved.
@throws Siren4JExcept... | java | private String resolveUri(String rawUri, EntityContext context, boolean handleURIOverride) throws Siren4JException {
String resolvedUri = rawUri;
String baseUri = null;
boolean fullyQualified = false;
if (context.getCurrentObject() instanceof Resource) {
Resource resourc... | [
"private",
"String",
"resolveUri",
"(",
"String",
"rawUri",
",",
"EntityContext",
"context",
",",
"boolean",
"handleURIOverride",
")",
"throws",
"Siren4JException",
"{",
"String",
"resolvedUri",
"=",
"rawUri",
";",
"String",
"baseUri",
"=",
"null",
";",
"boolean",... | Resolves the raw uri by replacing field tokens with the actual data.
@param rawUri assumed not <code>null</code> or .
@param context
@return uri with tokens resolved.
@throws Siren4JException | [
"Resolves",
"the",
"raw",
"uri",
"by",
"replacing",
"field",
"tokens",
"with",
"the",
"actual",
"data",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java#L504-L527 |
TrueNight/Utils | utils/src/main/java/xyz/truenight/utils/Palazzo.java | Palazzo.submitSafe | public void submitSafe(Object tag, Object subTag, Runnable runnable) {
"""
Same as submit(String tag, String subTag, Runnable runnable) but task will NOT be added to queue IF there is same task in queue
@param tag queue tag
@param subTag task tag
@param runnable task
"""
submitSafe(tag, sub... | java | public void submitSafe(Object tag, Object subTag, Runnable runnable) {
submitSafe(tag, subTag, false, runnable);
} | [
"public",
"void",
"submitSafe",
"(",
"Object",
"tag",
",",
"Object",
"subTag",
",",
"Runnable",
"runnable",
")",
"{",
"submitSafe",
"(",
"tag",
",",
"subTag",
",",
"false",
",",
"runnable",
")",
";",
"}"
] | Same as submit(String tag, String subTag, Runnable runnable) but task will NOT be added to queue IF there is same task in queue
@param tag queue tag
@param subTag task tag
@param runnable task | [
"Same",
"as",
"submit",
"(",
"String",
"tag",
"String",
"subTag",
"Runnable",
"runnable",
")",
"but",
"task",
"will",
"NOT",
"be",
"added",
"to",
"queue",
"IF",
"there",
"is",
"same",
"task",
"in",
"queue"
] | train | https://github.com/TrueNight/Utils/blob/78a11faa16258b09f08826797370310ab650530c/utils/src/main/java/xyz/truenight/utils/Palazzo.java#L99-L101 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/io/ByteIOUtils.java | ByteIOUtils.writeShort | public static void writeShort(OutputStream out, short v) throws IOException {
"""
Writes a specific short value (2 bytes) to the output stream.
@param out output stream
@param v short value to write
"""
out.write((byte) (0xff & (v >> 8)));
out.write((byte) (0xff & v));
} | java | public static void writeShort(OutputStream out, short v) throws IOException {
out.write((byte) (0xff & (v >> 8)));
out.write((byte) (0xff & v));
} | [
"public",
"static",
"void",
"writeShort",
"(",
"OutputStream",
"out",
",",
"short",
"v",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"(",
"0xff",
"&",
"(",
"v",
">>",
"8",
")",
")",
")",
";",
"out",
".",
"write",
... | Writes a specific short value (2 bytes) to the output stream.
@param out output stream
@param v short value to write | [
"Writes",
"a",
"specific",
"short",
"value",
"(",
"2",
"bytes",
")",
"to",
"the",
"output",
"stream",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/ByteIOUtils.java#L156-L159 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarBuffer.java | TarBuffer.writeRecord | public void writeRecord(byte[] buf, int offset) throws IOException {
"""
Write an archive record to the archive, where the record may be inside of a larger array buffer. The buffer must
be "offset plus record size" long.
@param buf
The buffer containing the record data to write.
@param offset
The offset of ... | java | public void writeRecord(byte[] buf, int offset) throws IOException {
if (this.debug) {
System.err.println("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
}
if (this.outStream == null) {
throw new IOException("writing to an input buffer");
... | [
"public",
"void",
"writeRecord",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"debug",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"WriteRecord: recIdx = \"",
"+",
"this",
".",
... | Write an archive record to the archive, where the record may be inside of a larger array buffer. The buffer must
be "offset plus record size" long.
@param buf
The buffer containing the record data to write.
@param offset
The offset of the record data within buf. | [
"Write",
"an",
"archive",
"record",
"to",
"the",
"archive",
"where",
"the",
"record",
"may",
"be",
"inside",
"of",
"a",
"larger",
"array",
"buffer",
".",
"The",
"buffer",
"must",
"be",
"offset",
"plus",
"record",
"size",
"long",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarBuffer.java#L302-L323 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/LayoutExtensions.java | LayoutExtensions.addComponent | public static void addComponent(final GridBagLayout gbl, final GridBagConstraints gbc,
final int gridx, final int gridy, final Component component, final Container panelToAdd) {
"""
Adds the component.
@param gbl
the gbl
@param gbc
the gbc
@param gridx
the gridx
@param gridy
the gridy
@param componen... | java | public static void addComponent(final GridBagLayout gbl, final GridBagConstraints gbc,
final int gridx, final int gridy, final Component component, final Container panelToAdd)
{
gbc.anchor = GridBagConstraints.CENTER;
gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets(5, 5, 5, 5);
gbc.gridx = ... | [
"public",
"static",
"void",
"addComponent",
"(",
"final",
"GridBagLayout",
"gbl",
",",
"final",
"GridBagConstraints",
"gbc",
",",
"final",
"int",
"gridx",
",",
"final",
"int",
"gridy",
",",
"final",
"Component",
"component",
",",
"final",
"Container",
"panelToAd... | Adds the component.
@param gbl
the gbl
@param gbc
the gbc
@param gridx
the gridx
@param gridy
the gridy
@param component
the component
@param panelToAdd
the panel to add | [
"Adds",
"the",
"component",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/LayoutExtensions.java#L91-L101 |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.setForegroundIcon | public void setForegroundIcon(final PROVIDER iconProvider, final Color color) {
"""
Changes the foregroundIcon icon.
<p>
Note: previous color setup and animations are reset as well.
@param iconProvider the icon which should be set as the new icon.
@param color the color of the new icon.
"""
... | java | public void setForegroundIcon(final PROVIDER iconProvider, final Color color) {
// copy old images to replace later.
final Shape oldForegroundIcon = foregroundIcon;
final Shape oldForegroundFadeIcon = foregroundFadeIcon;
// create new images.
this.foregroundIcon = createIcon(ico... | [
"public",
"void",
"setForegroundIcon",
"(",
"final",
"PROVIDER",
"iconProvider",
",",
"final",
"Color",
"color",
")",
"{",
"// copy old images to replace later.",
"final",
"Shape",
"oldForegroundIcon",
"=",
"foregroundIcon",
";",
"final",
"Shape",
"oldForegroundFadeIcon",... | Changes the foregroundIcon icon.
<p>
Note: previous color setup and animations are reset as well.
@param iconProvider the icon which should be set as the new icon.
@param color the color of the new icon. | [
"Changes",
"the",
"foregroundIcon",
"icon",
".",
"<p",
">",
"Note",
":",
"previous",
"color",
"setup",
"and",
"animations",
"are",
"reset",
"as",
"well",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L559-L582 |
revapi/revapi | revapi-java-spi/src/main/java/org/revapi/java/spi/CheckBase.java | CheckBase.isBothAccessible | public boolean isBothAccessible(@Nullable JavaModelElement a, @Nullable JavaModelElement b) {
"""
Checks whether both provided elements are public or protected. If one at least one of them is null, the method
returns false, because the accessibility cannot be truthfully detected in that case.
@param a first el... | java | public boolean isBothAccessible(@Nullable JavaModelElement a, @Nullable JavaModelElement b) {
if (a == null || b == null) {
return false;
}
return isAccessible(a) && isAccessible(b);
} | [
"public",
"boolean",
"isBothAccessible",
"(",
"@",
"Nullable",
"JavaModelElement",
"a",
",",
"@",
"Nullable",
"JavaModelElement",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"isAc... | Checks whether both provided elements are public or protected. If one at least one of them is null, the method
returns false, because the accessibility cannot be truthfully detected in that case.
@param a first element
@param b second element
@return true if both elements are not null and accessible (i.e. public or pr... | [
"Checks",
"whether",
"both",
"provided",
"elements",
"are",
"public",
"or",
"protected",
".",
"If",
"one",
"at",
"least",
"one",
"of",
"them",
"is",
"null",
"the",
"method",
"returns",
"false",
"because",
"the",
"accessibility",
"cannot",
"be",
"truthfully",
... | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi-java-spi/src/main/java/org/revapi/java/spi/CheckBase.java#L83-L89 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java | ComplexMath_F64.plus | public static void plus(Complex_F64 a , Complex_F64 b , Complex_F64 result ) {
"""
<p>
Addition: result = a + b
</p>
@param a Complex number. Not modified.
@param b Complex number. Not modified.
@param result Storage for output
"""
result.real = a.real + b.real;
result.imaginary = a.imag... | java | public static void plus(Complex_F64 a , Complex_F64 b , Complex_F64 result ) {
result.real = a.real + b.real;
result.imaginary = a.imaginary + b.imaginary;
} | [
"public",
"static",
"void",
"plus",
"(",
"Complex_F64",
"a",
",",
"Complex_F64",
"b",
",",
"Complex_F64",
"result",
")",
"{",
"result",
".",
"real",
"=",
"a",
".",
"real",
"+",
"b",
".",
"real",
";",
"result",
".",
"imaginary",
"=",
"a",
".",
"imagin... | <p>
Addition: result = a + b
</p>
@param a Complex number. Not modified.
@param b Complex number. Not modified.
@param result Storage for output | [
"<p",
">",
"Addition",
":",
"result",
"=",
"a",
"+",
"b",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java#L52-L55 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java | MappedParametrizedObjectEntry.getParameterBoolean | public Boolean getParameterBoolean(String name, Boolean defaultValue) {
"""
Parse named parameter as Boolean.
@param name
parameter name
@param defaultValue
default value
@return boolean value
"""
String value = getParameterValue(name, null);
if (value != null)
{
return new B... | java | public Boolean getParameterBoolean(String name, Boolean defaultValue)
{
String value = getParameterValue(name, null);
if (value != null)
{
return new Boolean(value);
}
return defaultValue;
} | [
"public",
"Boolean",
"getParameterBoolean",
"(",
"String",
"name",
",",
"Boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getParameterValue",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"new",
"Bool... | Parse named parameter as Boolean.
@param name
parameter name
@param defaultValue
default value
@return boolean value | [
"Parse",
"named",
"parameter",
"as",
"Boolean",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java#L349-L358 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.getOUComboBox | public static ComboBox getOUComboBox(CmsObject cms, String baseOu, Log log) {
"""
Creates the ComboBox for OU selection.<p>
@param cms CmsObject
@param baseOu OU
@param log Logger object
@return ComboBox
"""
return getOUComboBox(cms, baseOu, log, true);
} | java | public static ComboBox getOUComboBox(CmsObject cms, String baseOu, Log log) {
return getOUComboBox(cms, baseOu, log, true);
} | [
"public",
"static",
"ComboBox",
"getOUComboBox",
"(",
"CmsObject",
"cms",
",",
"String",
"baseOu",
",",
"Log",
"log",
")",
"{",
"return",
"getOUComboBox",
"(",
"cms",
",",
"baseOu",
",",
"log",
",",
"true",
")",
";",
"}"
] | Creates the ComboBox for OU selection.<p>
@param cms CmsObject
@param baseOu OU
@param log Logger object
@return ComboBox | [
"Creates",
"the",
"ComboBox",
"for",
"OU",
"selection",
".",
"<p",
">",
"@param",
"cms",
"CmsObject",
"@param",
"baseOu",
"OU",
"@param",
"log",
"Logger",
"object"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L657-L660 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addNotIn | public void addNotIn(String attribute, Collection values) {
"""
Adds NOT IN criteria,
customer_id not in(1,10,33,44)
large values are split into multiple InCriteria
NOT IN (1,10) AND NOT IN(33, 44)
@param attribute The field name to be used
@param values The value Collection
"""
List list... | java | public void addNotIn(String attribute, Collection values)
{
List list = splitInCriteria(attribute, values, true, IN_LIMIT);
InCriteria inCrit;
for (int index = 0; index < list.size(); index++)
{
inCrit = (InCriteria) list.get(index);
addSelectionCriteri... | [
"public",
"void",
"addNotIn",
"(",
"String",
"attribute",
",",
"Collection",
"values",
")",
"{",
"List",
"list",
"=",
"splitInCriteria",
"(",
"attribute",
",",
"values",
",",
"true",
",",
"IN_LIMIT",
")",
";",
"InCriteria",
"inCrit",
";",
"for",
"(",
"int"... | Adds NOT IN criteria,
customer_id not in(1,10,33,44)
large values are split into multiple InCriteria
NOT IN (1,10) AND NOT IN(33, 44)
@param attribute The field name to be used
@param values The value Collection | [
"Adds",
"NOT",
"IN",
"criteria",
"customer_id",
"not",
"in",
"(",
"1",
"10",
"33",
"44",
")",
"large",
"values",
"are",
"split",
"into",
"multiple",
"InCriteria",
"NOT",
"IN",
"(",
"1",
"10",
")",
"AND",
"NOT",
"IN",
"(",
"33",
"44",
")"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L825-L834 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/Symmetry454Date.java | Symmetry454Date.resolvePreviousValid | private static Symmetry454Date resolvePreviousValid(int prolepticYear, int month, int day) {
"""
Consistency check for dates manipulations after calls to
{@link #plus(long, TemporalUnit)},
{@link #minus(long, TemporalUnit)},
{@link #until(AbstractDate, TemporalUnit)} or
{@link #with(TemporalField, long)}.
@... | java | private static Symmetry454Date resolvePreviousValid(int prolepticYear, int month, int day) {
int monthR = Math.min(month, MONTHS_IN_YEAR);
int dayR = Math.min(day,
(monthR % 3 == 2) || (monthR == 12 && INSTANCE.isLeapYear(prolepticYear)) ? DAYS_IN_MONTH_LONG : DAYS_IN_MONTH);
return... | [
"private",
"static",
"Symmetry454Date",
"resolvePreviousValid",
"(",
"int",
"prolepticYear",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"int",
"monthR",
"=",
"Math",
".",
"min",
"(",
"month",
",",
"MONTHS_IN_YEAR",
")",
";",
"int",
"dayR",
"=",
"Mat... | Consistency check for dates manipulations after calls to
{@link #plus(long, TemporalUnit)},
{@link #minus(long, TemporalUnit)},
{@link #until(AbstractDate, TemporalUnit)} or
{@link #with(TemporalField, long)}.
@param prolepticYear the Symmetry454 proleptic-year
@param month the Symmetry454 month, from 1 to 12
@retur... | [
"Consistency",
"check",
"for",
"dates",
"manipulations",
"after",
"calls",
"to",
"{",
"@link",
"#plus",
"(",
"long",
"TemporalUnit",
")",
"}",
"{",
"@link",
"#minus",
"(",
"long",
"TemporalUnit",
")",
"}",
"{",
"@link",
"#until",
"(",
"AbstractDate",
"Tempor... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/Symmetry454Date.java#L296-L302 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java | InterfaceEndpointsInner.getByResourceGroup | public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName) {
"""
Gets the specified interface endpoint by resource group.
@param resourceGroupName The name of the resource group.
@param interfaceEndpointName The name of the interface endpoint.
@throws IllegalArgum... | java | public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().single().body();
} | [
"public",
"InterfaceEndpointInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"interfaceEndpointName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"interfaceEndpointName",
")",
".",
"toBlocking"... | Gets the specified interface endpoint by resource group.
@param resourceGroupName The name of the resource group.
@param interfaceEndpointName The name of the interface endpoint.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server... | [
"Gets",
"the",
"specified",
"interface",
"endpoint",
"by",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java#L266-L268 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/Api.java | Api.updateResourcesAccessModeByIds | public ApiResponse updateResourcesAccessModeByIds(String accessMode, Iterable<String> publicIds, Map options) throws Exception {
"""
Update access mode of one or more resources by publicIds
@param accessMode The new access mode, "public" or "authenticated"
@param publicIds A list of public ids of resources t... | java | public ApiResponse updateResourcesAccessModeByIds(String accessMode, Iterable<String> publicIds, Map options) throws Exception {
return updateResourcesAccessMode(accessMode, "public_ids", publicIds, options);
} | [
"public",
"ApiResponse",
"updateResourcesAccessModeByIds",
"(",
"String",
"accessMode",
",",
"Iterable",
"<",
"String",
">",
"publicIds",
",",
"Map",
"options",
")",
"throws",
"Exception",
"{",
"return",
"updateResourcesAccessMode",
"(",
"accessMode",
",",
"\"public_i... | Update access mode of one or more resources by publicIds
@param accessMode The new access mode, "public" or "authenticated"
@param publicIds A list of public ids of resources to be updated
@param options additional options
<ul>
<li>resource_type - (default "image") - the type of resources to modify</li>
<li>max_r... | [
"Update",
"access",
"mode",
"of",
"one",
"or",
"more",
"resources",
"by",
"publicIds"
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/Api.java#L540-L542 |
JoeKerouac/utils | src/main/java/com/joe/utils/serialize/json/JsonParser.java | JsonParser.readAsObject | @SuppressWarnings("unchecked")
public <T> T readAsObject(String content, Class<T> type) {
"""
解析json
@param content json字符串
@param type json解析后对应的实体类型
@param <T> 实体类型的实际类型
@return 解析失败将返回null
"""
Assert.notNull(type);
try {
if (StringUtils.isEmpty(content)) {
... | java | @SuppressWarnings("unchecked")
public <T> T readAsObject(String content, Class<T> type) {
Assert.notNull(type);
try {
if (StringUtils.isEmpty(content)) {
log.debug("content为空,返回null", content, type);
return null;
} else if (type.equals(String.c... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"readAsObject",
"(",
"String",
"content",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Assert",
".",
"notNull",
"(",
"type",
")",
";",
"try",
"{",
"if",
"(",
"String... | 解析json
@param content json字符串
@param type json解析后对应的实体类型
@param <T> 实体类型的实际类型
@return 解析失败将返回null | [
"解析json"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/serialize/json/JsonParser.java#L114-L129 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java | SpiderTransaction.addAllObjectsColumn | public void addAllObjectsColumn(TableDefinition tableDef, String objID, int shardNo) {
"""
Add an "all objects" column for an object in the given table with the given ID. The
"all objects" lives in the Terms store and its row key is "_" for objects residing
in shard 0, "{shard number}/_" for objects residing in ... | java | public void addAllObjectsColumn(TableDefinition tableDef, String objID, int shardNo) {
String rowKey = ALL_OBJECTS_ROW_KEY;
if (shardNo > 0) {
rowKey = shardNo + "/" + ALL_OBJECTS_ROW_KEY;
}
addColumn(SpiderService.termsStoreName(tableDef), rowKey, objID);
} | [
"public",
"void",
"addAllObjectsColumn",
"(",
"TableDefinition",
"tableDef",
",",
"String",
"objID",
",",
"int",
"shardNo",
")",
"{",
"String",
"rowKey",
"=",
"ALL_OBJECTS_ROW_KEY",
";",
"if",
"(",
"shardNo",
">",
"0",
")",
"{",
"rowKey",
"=",
"shardNo",
"+"... | Add an "all objects" column for an object in the given table with the given ID. The
"all objects" lives in the Terms store and its row key is "_" for objects residing
in shard 0, "{shard number}/_" for objects residing in other shards. The column
added is named with the object's ID but has no value.
@param tableDef {... | [
"Add",
"an",
"all",
"objects",
"column",
"for",
"an",
"object",
"in",
"the",
"given",
"table",
"with",
"the",
"given",
"ID",
".",
"The",
"all",
"objects",
"lives",
"in",
"the",
"Terms",
"store",
"and",
"its",
"row",
"key",
"is",
"_",
"for",
"objects",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L207-L213 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/FormLoginAuthenticator.java | FormLoginAuthenticator.handleRedirect | private AuthenticationResult handleRedirect(HttpServletRequest req,
HttpServletResponse res,
WebRequest webRequest) {
"""
This method save post parameters in the cookie or session and
redirect to a login page.
@para... | java | private AuthenticationResult handleRedirect(HttpServletRequest req,
HttpServletResponse res,
WebRequest webRequest) {
AuthenticationResult authResult;
String loginURL = getFormLoginURL(req, webRequest, webAp... | [
"private",
"AuthenticationResult",
"handleRedirect",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"WebRequest",
"webRequest",
")",
"{",
"AuthenticationResult",
"authResult",
";",
"String",
"loginURL",
"=",
"getFormLoginURL",
"(",
"req",
",",... | This method save post parameters in the cookie or session and
redirect to a login page.
@param req
@param res
@param loginURL
@return authenticationResult | [
"This",
"method",
"save",
"post",
"parameters",
"in",
"the",
"cookie",
"or",
"session",
"and",
"redirect",
"to",
"a",
"login",
"page",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/FormLoginAuthenticator.java#L126-L147 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/demux/DemuxingIoHandler.java | DemuxingIoHandler.messageReceived | @Override
public void messageReceived(IoSession session, Object message)
throws Exception {
"""
Forwards the received events into the appropriate {@link MessageHandler}
which is registered by {@link #addReceivedMessageHandler(Class, MessageHandler)}.
<b>Warning !</b> If you are to overload this... | java | @Override
public void messageReceived(IoSession session, Object message)
throws Exception {
MessageHandler<Object> handler = findReceivedMessageHandler(message.getClass());
if (handler != null) {
handler.handleMessage(session, message);
} else {
throw new ... | [
"@",
"Override",
"public",
"void",
"messageReceived",
"(",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"MessageHandler",
"<",
"Object",
">",
"handler",
"=",
"findReceivedMessageHandler",
"(",
"message",
".",
"getClass",
"(",
... | Forwards the received events into the appropriate {@link MessageHandler}
which is registered by {@link #addReceivedMessageHandler(Class, MessageHandler)}.
<b>Warning !</b> If you are to overload this method, be aware that you
_must_ call the messageHandler in your own method, otherwise it won't
be called. | [
"Forwards",
"the",
"received",
"events",
"into",
"the",
"appropriate",
"{",
"@link",
"MessageHandler",
"}",
"which",
"is",
"registered",
"by",
"{",
"@link",
"#addReceivedMessageHandler",
"(",
"Class",
"MessageHandler",
")",
"}",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/demux/DemuxingIoHandler.java#L223-L234 |
Samsung/GearVRf | GVRf/Extensions/script/src/main/java/org/gearvrf/script/GVRScriptFile.java | GVRScriptFile.invokeFunction | @Override
public boolean invokeFunction(String funcName, Object[] params) {
"""
Invokes a function defined in the script.
@param funcName
The function name.
@param params
The parameter array.
@return
A boolean value representing whether the function is
executed correctly. If the function cannot be fou... | java | @Override
public boolean invokeFunction(String funcName, Object[] params) {
// Run script if it is dirty. This makes sure the script is run
// on the same thread as the caller (suppose the caller is always
// calling from the same thread).
checkDirty();
// Skip bad functions... | [
"@",
"Override",
"public",
"boolean",
"invokeFunction",
"(",
"String",
"funcName",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"// Run script if it is dirty. This makes sure the script is run",
"// on the same thread as the caller (suppose the caller is always",
"// calling from t... | Invokes a function defined in the script.
@param funcName
The function name.
@param params
The parameter array.
@return
A boolean value representing whether the function is
executed correctly. If the function cannot be found, or
parameters don't match, {@code false} is returned. | [
"Invokes",
"a",
"function",
"defined",
"in",
"the",
"script",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/script/src/main/java/org/gearvrf/script/GVRScriptFile.java#L172-L208 |
Javen205/IJPay | src/main/java/com/jpay/unionpay/AcpService.java | AcpService.validate | public static boolean validate(Map<String, String> rspData, String encoding) {
"""
验证签名(SHA-1摘要算法)<br>
@param resData 返回报文数据<br>
@param encoding 上送请求报文域encoding字段的值<br>
@return true 通过 false 未通过<br>
"""
return SDKUtil.validate(rspData, encoding);
} | java | public static boolean validate(Map<String, String> rspData, String encoding) {
return SDKUtil.validate(rspData, encoding);
} | [
"public",
"static",
"boolean",
"validate",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"rspData",
",",
"String",
"encoding",
")",
"{",
"return",
"SDKUtil",
".",
"validate",
"(",
"rspData",
",",
"encoding",
")",
";",
"}"
] | 验证签名(SHA-1摘要算法)<br>
@param resData 返回报文数据<br>
@param encoding 上送请求报文域encoding字段的值<br>
@return true 通过 false 未通过<br> | [
"验证签名",
"(",
"SHA",
"-",
"1摘要算法",
")",
"<br",
">"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/unionpay/AcpService.java#L65-L67 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/AbstractXbaseCompiler.java | AbstractXbaseCompiler.isVariableDeclarationRequired | @Deprecated
protected final boolean isVariableDeclarationRequired(XExpression expr, ITreeAppendable b) {
"""
whether an expression needs to be declared in a statement
If an expression has side effects this method must return true for it.
@param expr the checked expression
@param b the appendable which represen... | java | @Deprecated
protected final boolean isVariableDeclarationRequired(XExpression expr, ITreeAppendable b) {
return isVariableDeclarationRequired(expr, b, true);
} | [
"@",
"Deprecated",
"protected",
"final",
"boolean",
"isVariableDeclarationRequired",
"(",
"XExpression",
"expr",
",",
"ITreeAppendable",
"b",
")",
"{",
"return",
"isVariableDeclarationRequired",
"(",
"expr",
",",
"b",
",",
"true",
")",
";",
"}"
] | whether an expression needs to be declared in a statement
If an expression has side effects this method must return true for it.
@param expr the checked expression
@param b the appendable which represents the current compiler state
@deprecated use {@link #isVariableDeclarationRequired(XExpression, ITreeAppendable, bool... | [
"whether",
"an",
"expression",
"needs",
"to",
"be",
"declared",
"in",
"a",
"statement",
"If",
"an",
"expression",
"has",
"side",
"effects",
"this",
"method",
"must",
"return",
"true",
"for",
"it",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/AbstractXbaseCompiler.java#L661-L664 |
redkale/redkale | src/org/redkale/source/EntityInfo.java | EntityInfo.getEntityValue | protected T getEntityValue(final SelectColumn sels, final ResultSet set) throws SQLException {
"""
将一行的ResultSet组装成一个Entity对象
@param sels 指定字段
@param set ResultSet
@return Entity对象
@throws SQLException SQLException
"""
T obj;
Attribute<T, Serializable>[] attrs = this.queryAttributes;... | java | protected T getEntityValue(final SelectColumn sels, final ResultSet set) throws SQLException {
T obj;
Attribute<T, Serializable>[] attrs = this.queryAttributes;
if (this.constructorParameters == null) {
obj = creator.create();
} else {
Object[] cps = new Obj... | [
"protected",
"T",
"getEntityValue",
"(",
"final",
"SelectColumn",
"sels",
",",
"final",
"ResultSet",
"set",
")",
"throws",
"SQLException",
"{",
"T",
"obj",
";",
"Attribute",
"<",
"T",
",",
"Serializable",
">",
"[",
"]",
"attrs",
"=",
"this",
".",
"queryAtt... | 将一行的ResultSet组装成一个Entity对象
@param sels 指定字段
@param set ResultSet
@return Entity对象
@throws SQLException SQLException | [
"将一行的ResultSet组装成一个Entity对象"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L1044-L1066 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java | SubnetworkId.of | public static SubnetworkId of(String project, String region, String subnetwork) {
"""
Returns a subnetwork identity given project, region and subnetwork names. The subnetwork name
must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the
regular expression {@code [a-z]([-a-z0-9]... | java | public static SubnetworkId of(String project, String region, String subnetwork) {
return new SubnetworkId(project, region, subnetwork);
} | [
"public",
"static",
"SubnetworkId",
"of",
"(",
"String",
"project",
",",
"String",
"region",
",",
"String",
"subnetwork",
")",
"{",
"return",
"new",
"SubnetworkId",
"(",
"project",
",",
"region",
",",
"subnetwork",
")",
";",
"}"
] | Returns a subnetwork identity given project, region and subnetwork names. The subnetwork name
must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the
regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a
lowercase letter, and all following ch... | [
"Returns",
"a",
"subnetwork",
"identity",
"given",
"project",
"region",
"and",
"subnetwork",
"names",
".",
"The",
"subnetwork",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specifically",
"the",
"name",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java#L153-L155 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java | PathOverrideService.setResponseEnabled | public void setResponseEnabled(int pathId, boolean enabled, String clientUUID) throws Exception {
"""
Sets enabled/disabled for a response
@param pathId ID of path
@param enabled 1 for enabled, 0 for disabled
@param clientUUID client ID
@throws Exception exception
"""
PreparedStatement statement ... | java | public void setResponseEnabled(int pathId, boolean enabled, String clientUUID) throws Exception {
PreparedStatement statement = null;
int profileId = EditService.getProfileIdFromPathID(pathId);
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.pr... | [
"public",
"void",
"setResponseEnabled",
"(",
"int",
"pathId",
",",
"boolean",
"enabled",
",",
"String",
"clientUUID",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"int",
"profileId",
"=",
"EditService",
".",
"getProfileIdFro... | Sets enabled/disabled for a response
@param pathId ID of path
@param enabled 1 for enabled, 0 for disabled
@param clientUUID client ID
@throws Exception exception | [
"Sets",
"enabled",
"/",
"disabled",
"for",
"a",
"response"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1351-L1377 |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateReference | private AttributesImpl validateReference(final String attrName, final Attributes atts, final AttributesImpl modified) {
"""
Validate and fix {@code href} or {@code conref} attribute for URI validity.
@return modified attributes, {@code null} if there have been no changes
"""
AttributesImpl res = mod... | java | private AttributesImpl validateReference(final String attrName, final Attributes atts, final AttributesImpl modified) {
AttributesImpl res = modified;
final String href = atts.getValue(attrName);
if (href != null) {
try {
new URI(href);
} catch (final URIS... | [
"private",
"AttributesImpl",
"validateReference",
"(",
"final",
"String",
"attrName",
",",
"final",
"Attributes",
"atts",
",",
"final",
"AttributesImpl",
"modified",
")",
"{",
"AttributesImpl",
"res",
"=",
"modified",
";",
"final",
"String",
"href",
"=",
"atts",
... | Validate and fix {@code href} or {@code conref} attribute for URI validity.
@return modified attributes, {@code null} if there have been no changes | [
"Validate",
"and",
"fix",
"{",
"@code",
"href",
"}",
"or",
"{",
"@code",
"conref",
"}",
"attribute",
"for",
"URI",
"validity",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L183-L212 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutMethodResult.java | PutMethodResult.withRequestModels | public PutMethodResult withRequestModels(java.util.Map<String, String> requestModels) {
"""
<p>
A key-value map specifying data schemas, represented by <a>Model</a> resources, (as the mapped value) of the
request payloads of given content types (as the mapping key).
</p>
@param requestModels
A key-value map... | java | public PutMethodResult withRequestModels(java.util.Map<String, String> requestModels) {
setRequestModels(requestModels);
return this;
} | [
"public",
"PutMethodResult",
"withRequestModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestModels",
")",
"{",
"setRequestModels",
"(",
"requestModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying data schemas, represented by <a>Model</a> resources, (as the mapped value) of the
request payloads of given content types (as the mapping key).
</p>
@param requestModels
A key-value map specifying data schemas, represented by <a>Model</a> resources, (as the mapped value) of
the request p... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"data",
"schemas",
"represented",
"by",
"<a",
">",
"Model<",
"/",
"a",
">",
"resources",
"(",
"as",
"the",
"mapped",
"value",
")",
"of",
"the",
"request",
"payloads",
"of",
"given",
"content",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutMethodResult.java#L614-L617 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.sigToType | Type sigToType(byte[] sig, int offset, int len) {
"""
Convert signature to type, where signature is a byte array segment.
"""
signature = sig;
sigp = offset;
siglimit = offset + len;
return sigToType();
} | java | Type sigToType(byte[] sig, int offset, int len) {
signature = sig;
sigp = offset;
siglimit = offset + len;
return sigToType();
} | [
"Type",
"sigToType",
"(",
"byte",
"[",
"]",
"sig",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"signature",
"=",
"sig",
";",
"sigp",
"=",
"offset",
";",
"siglimit",
"=",
"offset",
"+",
"len",
";",
"return",
"sigToType",
"(",
")",
";",
"}"
] | Convert signature to type, where signature is a byte array segment. | [
"Convert",
"signature",
"to",
"type",
"where",
"signature",
"is",
"a",
"byte",
"array",
"segment",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L652-L657 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/category/IssueCategoryRegistry.java | IssueCategoryRegistry.addDefaults | private void addDefaults() {
"""
Make sure that we have some reasonable defaults available. These would typically be provided by the rulesets
in the real world.
"""
this.issueCategories.putIfAbsent(MANDATORY, new IssueCategory(MANDATORY, IssueCategoryRegistry.class.getCanonicalName(), "Mandatory", MAN... | java | private void addDefaults()
{
this.issueCategories.putIfAbsent(MANDATORY, new IssueCategory(MANDATORY, IssueCategoryRegistry.class.getCanonicalName(), "Mandatory", MANDATORY, 1000, true));
this.issueCategories.putIfAbsent(OPTIONAL, new IssueCategory(OPTIONAL, IssueCategoryRegistry.class.getCanonicalN... | [
"private",
"void",
"addDefaults",
"(",
")",
"{",
"this",
".",
"issueCategories",
".",
"putIfAbsent",
"(",
"MANDATORY",
",",
"new",
"IssueCategory",
"(",
"MANDATORY",
",",
"IssueCategoryRegistry",
".",
"class",
".",
"getCanonicalName",
"(",
")",
",",
"\"Mandatory... | Make sure that we have some reasonable defaults available. These would typically be provided by the rulesets
in the real world. | [
"Make",
"sure",
"that",
"we",
"have",
"some",
"reasonable",
"defaults",
"available",
".",
"These",
"would",
"typically",
"be",
"provided",
"by",
"the",
"rulesets",
"in",
"the",
"real",
"world",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/category/IssueCategoryRegistry.java#L165-L172 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.buildStringToCheck | public String buildStringToCheck(String claimIdentifier, String key, String value) throws Exception {
"""
Build the string to search for (the test app should have logged this string if everything is working as it should)
@param claimIdentifier - an identifier logged by the test app - could be the method used to... | java | public String buildStringToCheck(String claimIdentifier, String key, String value) throws Exception {
String builtString = claimIdentifier.trim();
if (!claimIdentifier.contains(":")) {
builtString = builtString + ":";
}
if (key != null) {
builtString = builtString... | [
"public",
"String",
"buildStringToCheck",
"(",
"String",
"claimIdentifier",
",",
"String",
"key",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"String",
"builtString",
"=",
"claimIdentifier",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"claimIdenti... | Build the string to search for (the test app should have logged this string if everything is working as it should)
@param claimIdentifier - an identifier logged by the test app - could be the method used to obtain the key
@param key - the key to validate
@param value - the value to validate
@return - returns the strin... | [
"Build",
"the",
"string",
"to",
"search",
"for",
"(",
"the",
"test",
"app",
"should",
"have",
"logged",
"this",
"string",
"if",
"everything",
"is",
"working",
"as",
"it",
"should",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L279-L292 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java | TypeRegistry.getReloadableType | public ReloadableType getReloadableType(String slashedClassname, boolean allocateIdIfNotYetLoaded) {
"""
Find the ReloadableType object for a given classname. If the allocateIdIfNotYetLoaded option is set then a new id
will be allocated for this classname if it hasn't previously been seen before. This method does... | java | public ReloadableType getReloadableType(String slashedClassname, boolean allocateIdIfNotYetLoaded) {
if (allocateIdIfNotYetLoaded) {
return getReloadableType(getTypeIdFor(slashedClassname, allocateIdIfNotYetLoaded));
}
else {
for (int i = 0; i < reloadableTypesSize; i++) {
ReloadableType rtype = reloada... | [
"public",
"ReloadableType",
"getReloadableType",
"(",
"String",
"slashedClassname",
",",
"boolean",
"allocateIdIfNotYetLoaded",
")",
"{",
"if",
"(",
"allocateIdIfNotYetLoaded",
")",
"{",
"return",
"getReloadableType",
"(",
"getTypeIdFor",
"(",
"slashedClassname",
",",
"... | Find the ReloadableType object for a given classname. If the allocateIdIfNotYetLoaded option is set then a new id
will be allocated for this classname if it hasn't previously been seen before. This method does not create new
ReloadableType objects, they are expected to come into existence when defined by the classloade... | [
"Find",
"the",
"ReloadableType",
"object",
"for",
"a",
"given",
"classname",
".",
"If",
"the",
"allocateIdIfNotYetLoaded",
"option",
"is",
"set",
"then",
"a",
"new",
"id",
"will",
"be",
"allocated",
"for",
"this",
"classname",
"if",
"it",
"hasn",
"t",
"previ... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L1269-L1282 |
grpc/grpc-java | context/src/main/java/io/grpc/Context.java | Context.withDeadlineAfter | public CancellableContext withDeadlineAfter(long duration, TimeUnit unit,
ScheduledExecutorService scheduler) {
"""
Create a new context which will cancel itself after the given {@code duration} from now.
The returned context will cascade cancellation of its parent. C... | java | public CancellableContext withDeadlineAfter(long duration, TimeUnit unit,
ScheduledExecutorService scheduler) {
return withDeadline(Deadline.after(duration, unit), scheduler);
} | [
"public",
"CancellableContext",
"withDeadlineAfter",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
",",
"ScheduledExecutorService",
"scheduler",
")",
"{",
"return",
"withDeadline",
"(",
"Deadline",
".",
"after",
"(",
"duration",
",",
"unit",
")",
",",
"schedul... | Create a new context which will cancel itself after the given {@code duration} from now.
The returned context will cascade cancellation of its parent. Callers may explicitly cancel
the returned context prior to the deadline just as for {@link #withCancellation()}. If the unit
of work completes before the deadline, the ... | [
"Create",
"a",
"new",
"context",
"which",
"will",
"cancel",
"itself",
"after",
"the",
"given",
"{",
"@code",
"duration",
"}",
"from",
"now",
".",
"The",
"returned",
"context",
"will",
"cascade",
"cancellation",
"of",
"its",
"parent",
".",
"Callers",
"may",
... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/context/src/main/java/io/grpc/Context.java#L269-L272 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/factories/CipherFactory.java | CipherFactory.newCipher | public static Cipher newCipher(final String privateKey, final String algorithm,
final byte[] salt, final int iterationCount, final int operationMode)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException, UnsupportedEncodingExcept... | java | public static Cipher newCipher(final String privateKey, final String algorithm,
final byte[] salt, final int iterationCount, final int operationMode)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException, UnsupportedEncodingExcept... | [
"public",
"static",
"Cipher",
"newCipher",
"(",
"final",
"String",
"privateKey",
",",
"final",
"String",
"algorithm",
",",
"final",
"byte",
"[",
"]",
"salt",
",",
"final",
"int",
"iterationCount",
",",
"final",
"int",
"operationMode",
")",
"throws",
"NoSuchAlg... | Factory method for creating a new {@link Cipher} from the given parameters. 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 Cipher} from the given parameters.
@param privateKey
the private key
@param algorithm
the algorithm... | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Cipher",
"}",
"from",
"the",
"given",
"parameters",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
... | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/factories/CipherFactory.java#L158-L169 |
picoff/java-commons | src/main/java/com/picoff/commons/net/InetAddressAnonymizer.java | InetAddressAnonymizer.anonymize | public static InetAddress anonymize(final InetAddress inetAddress) throws UnknownHostException {
"""
IPv4 addresses have their length truncated to 24 bits, IPv6 to 48 bits
"""
if (inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress()) {
return inetAddress;
}
fi... | java | public static InetAddress anonymize(final InetAddress inetAddress) throws UnknownHostException {
if (inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress()) {
return inetAddress;
}
final int mask = inetAddress instanceof Inet4Address ? 24 : 48;
return truncate(in... | [
"public",
"static",
"InetAddress",
"anonymize",
"(",
"final",
"InetAddress",
"inetAddress",
")",
"throws",
"UnknownHostException",
"{",
"if",
"(",
"inetAddress",
".",
"isAnyLocalAddress",
"(",
")",
"||",
"inetAddress",
".",
"isLoopbackAddress",
"(",
")",
")",
"{",... | IPv4 addresses have their length truncated to 24 bits, IPv6 to 48 bits | [
"IPv4",
"addresses",
"have",
"their",
"length",
"truncated",
"to",
"24",
"bits",
"IPv6",
"to",
"48",
"bits"
] | train | https://github.com/picoff/java-commons/blob/522d12db77c240edfb62db10a3eb8e0023b87317/src/main/java/com/picoff/commons/net/InetAddressAnonymizer.java#L26-L33 |
icode/ameba | src/main/java/ameba/mvc/template/internal/TemplateHelper.java | TemplateHelper.getTemplateOutputEncoding | public static Charset getTemplateOutputEncoding(Configuration configuration, String suffix) {
"""
Get output encoding from configuration.
@param configuration Configuration.
@param suffix Template processor suffix of the
to configuration property {@link org.glassfish.jersey.server.mvc.MvcFeature#ENCODI... | java | public static Charset getTemplateOutputEncoding(Configuration configuration, String suffix) {
final String enc = PropertiesHelper.getValue(configuration.getProperties(), MvcFeature.ENCODING + suffix,
String.class, null);
if (enc == null) {
return DEFAULT_ENCODING;
} e... | [
"public",
"static",
"Charset",
"getTemplateOutputEncoding",
"(",
"Configuration",
"configuration",
",",
"String",
"suffix",
")",
"{",
"final",
"String",
"enc",
"=",
"PropertiesHelper",
".",
"getValue",
"(",
"configuration",
".",
"getProperties",
"(",
")",
",",
"Mv... | Get output encoding from configuration.
@param configuration Configuration.
@param suffix Template processor suffix of the
to configuration property {@link org.glassfish.jersey.server.mvc.MvcFeature#ENCODING}.
@return Encoding read from configuration properties or a default encoding if no encoding is configured... | [
"Get",
"output",
"encoding",
"from",
"configuration",
"."
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/TemplateHelper.java#L152-L160 |
haifengl/smile | core/src/main/java/smile/clustering/PartitionClustering.java | PartitionClustering.squaredDistance | static double squaredDistance(double[] x, double[] y) {
"""
Squared Euclidean distance with handling missing values (represented as NaN).
"""
int n = x.length;
int m = 0;
double dist = 0.0;
for (int i = 0; i < n; i++) {
if (!Double.isNaN(x[i]) && !Double.isNaN(y[i])... | java | static double squaredDistance(double[] x, double[] y) {
int n = x.length;
int m = 0;
double dist = 0.0;
for (int i = 0; i < n; i++) {
if (!Double.isNaN(x[i]) && !Double.isNaN(y[i])) {
m++;
double d = x[i] - y[i];
dist += d * d;... | [
"static",
"double",
"squaredDistance",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"int",
"n",
"=",
"x",
".",
"length",
";",
"int",
"m",
"=",
"0",
";",
"double",
"dist",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
... | Squared Euclidean distance with handling missing values (represented as NaN). | [
"Squared",
"Euclidean",
"distance",
"with",
"handling",
"missing",
"values",
"(",
"represented",
"as",
"NaN",
")",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/clustering/PartitionClustering.java#L67-L87 |
VoltDB/voltdb | src/frontend/org/voltcore/zk/MapCache.java | MapCache.processChildEvent | private void processChildEvent(WatchedEvent event) throws Exception {
"""
Update a modified child and republish a new snapshot. This may indicate
a deleted child or a child with modified data.
"""
HashMap<String, JSONObject> cacheCopy = new HashMap<String, JSONObject>(m_publicCache.get());
Byt... | java | private void processChildEvent(WatchedEvent event) throws Exception {
HashMap<String, JSONObject> cacheCopy = new HashMap<String, JSONObject>(m_publicCache.get());
ByteArrayCallback cb = new ByteArrayCallback();
m_zk.getData(event.getPath(), m_childWatch, cb, null);
try {
byt... | [
"private",
"void",
"processChildEvent",
"(",
"WatchedEvent",
"event",
")",
"throws",
"Exception",
"{",
"HashMap",
"<",
"String",
",",
"JSONObject",
">",
"cacheCopy",
"=",
"new",
"HashMap",
"<",
"String",
",",
"JSONObject",
">",
"(",
"m_publicCache",
".",
"get"... | Update a modified child and republish a new snapshot. This may indicate
a deleted child or a child with modified data. | [
"Update",
"a",
"modified",
"child",
"and",
"republish",
"a",
"new",
"snapshot",
".",
"This",
"may",
"indicate",
"a",
"deleted",
"child",
"or",
"a",
"child",
"with",
"modified",
"data",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/zk/MapCache.java#L277-L292 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/ean/AbstractUPCEAN.java | AbstractUPCEAN.calcChecksumChar | protected static char calcChecksumChar (@Nonnull final String sMsg, @Nonnegative final int nLength) {
"""
Calculates the check character for a given message
@param sMsg
the message
@param nLength
The number of characters to be checked. Must be ≥ 0 and <
message.length
@return char the check character... | java | protected static char calcChecksumChar (@Nonnull final String sMsg, @Nonnegative final int nLength)
{
ValueEnforcer.notNull (sMsg, "Msg");
ValueEnforcer.isBetweenInclusive (nLength, "Length", 0, sMsg.length ());
return asChar (calcChecksum (sMsg.toCharArray (), nLength));
} | [
"protected",
"static",
"char",
"calcChecksumChar",
"(",
"@",
"Nonnull",
"final",
"String",
"sMsg",
",",
"@",
"Nonnegative",
"final",
"int",
"nLength",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sMsg",
",",
"\"Msg\"",
")",
";",
"ValueEnforcer",
".",
"is... | Calculates the check character for a given message
@param sMsg
the message
@param nLength
The number of characters to be checked. Must be ≥ 0 and <
message.length
@return char the check character | [
"Calculates",
"the",
"check",
"character",
"for",
"a",
"given",
"message"
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/ean/AbstractUPCEAN.java#L144-L150 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.pullImage | public static boolean pullImage(Launcher launcher, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
"""
Execute pull docker image on agent
@param launcher
@param imageTag
@param username
@param password
@param host... | java | public static boolean pullImage(Launcher launcher, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {
public Boolean call... | [
"public",
"static",
"boolean",
"pullImage",
"(",
"Launcher",
"launcher",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"username",
",",
"final",
"String",
"password",
",",
"final",
"String",
"host",
")",
"throws",
"IOException",
",",
"InterruptedEx... | Execute pull docker image on agent
@param launcher
@param imageTag
@param username
@param password
@param host
@return
@throws IOException
@throws InterruptedException | [
"Execute",
"pull",
"docker",
"image",
"on",
"agent"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L205-L214 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java | AbstractPlainDatagramSocketImpl.joinGroup | protected void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
throws IOException {
"""
Join the multicast group.
@param mcastaddr multicast address to join.
@param netIf specifies the local interface to receive multicast
datagram packets
@throws IllegalArgumentException if mcastaddr is nul... | java | protected void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
throws IOException {
if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress))
throw new IllegalArgumentException("Unsupported address type");
join(((InetSocketAddress)mcastaddr).getAddress(), netIf);... | [
"protected",
"void",
"joinGroup",
"(",
"SocketAddress",
"mcastaddr",
",",
"NetworkInterface",
"netIf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mcastaddr",
"==",
"null",
"||",
"!",
"(",
"mcastaddr",
"instanceof",
"InetSocketAddress",
")",
")",
"throw",
"ne... | Join the multicast group.
@param mcastaddr multicast address to join.
@param netIf specifies the local interface to receive multicast
datagram packets
@throws IllegalArgumentException if mcastaddr is null or is a
SocketAddress subclass not supported by this socket
@since 1.4 | [
"Join",
"the",
"multicast",
"group",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java#L199-L204 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/component/infinispan/bolt/InfinispanLookupBolt.java | InfinispanLookupBolt.onLookupAfter | protected void onLookupAfter(StreamMessage input, K lookupKey, V lookupValue) {
"""
Infinispanからのデータ取得後に実行される処理。
@param input Tuple
@param lookupKey 取得に使用したKey
@param lookupValue 取得したValue(取得されなかった場合はnull)
"""
// デフォルトでは取得した結果がnull以外の場合、下流にデータを流す。
if (lookupValue != null)
{
... | java | protected void onLookupAfter(StreamMessage input, K lookupKey, V lookupValue)
{
// デフォルトでは取得した結果がnull以外の場合、下流にデータを流す。
if (lookupValue != null)
{
StreamMessage message = new StreamMessage();
message.addField(FieldName.MESSAGE_KEY, lookupKey);
message.addFie... | [
"protected",
"void",
"onLookupAfter",
"(",
"StreamMessage",
"input",
",",
"K",
"lookupKey",
",",
"V",
"lookupValue",
")",
"{",
"// デフォルトでは取得した結果がnull以外の場合、下流にデータを流す。",
"if",
"(",
"lookupValue",
"!=",
"null",
")",
"{",
"StreamMessage",
"message",
"=",
"new",
"Strea... | Infinispanからのデータ取得後に実行される処理。
@param input Tuple
@param lookupKey 取得に使用したKey
@param lookupValue 取得したValue(取得されなかった場合はnull) | [
"Infinispanからのデータ取得後に実行される処理。"
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/component/infinispan/bolt/InfinispanLookupBolt.java#L140-L151 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCredential | public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
GSIConstants.CertificateType certType) throws GeneralSecurityException {
"""
Creates a new proxy credential from the specified certificate chain and a private key.
@see #createCredential(X509Ce... | java | public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
GSIConstants.CertificateType certType) throws GeneralSecurityException {
return createCredential(certs, privateKey, bits, lifetime, certType, (X509ExtensionSet) null, null);
} | [
"public",
"X509Credential",
"createCredential",
"(",
"X509Certificate",
"[",
"]",
"certs",
",",
"PrivateKey",
"privateKey",
",",
"int",
"bits",
",",
"int",
"lifetime",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"GeneralSecurityException",
... | Creates a new proxy credential from the specified certificate chain and a private key.
@see #createCredential(X509Certificate[], PrivateKey, int, int, GSIConstants.CertificateType, X509ExtensionSet, String)
createCredential | [
"Creates",
"a",
"new",
"proxy",
"credential",
"from",
"the",
"specified",
"certificate",
"chain",
"and",
"a",
"private",
"key",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L595-L598 |
OpenTSDB/opentsdb | src/core/RowKey.java | RowKey.metricName | static String metricName(final TSDB tsdb, final byte[] row) {
"""
Extracts the name of the metric ID contained in a row key.
@param tsdb The TSDB to use.
@param row The actual row key.
@return The name of the metric.
@throws NoSuchUniqueId if the UID could not resolve to a string
"""
try {
return... | java | static String metricName(final TSDB tsdb, final byte[] row) {
try {
return metricNameAsync(tsdb, row).joinUninterruptibly();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException("Should never be here", e);
}
} | [
"static",
"String",
"metricName",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"byte",
"[",
"]",
"row",
")",
"{",
"try",
"{",
"return",
"metricNameAsync",
"(",
"tsdb",
",",
"row",
")",
".",
"joinUninterruptibly",
"(",
")",
";",
"}",
"catch",
"(",
"Runti... | Extracts the name of the metric ID contained in a row key.
@param tsdb The TSDB to use.
@param row The actual row key.
@return The name of the metric.
@throws NoSuchUniqueId if the UID could not resolve to a string | [
"Extracts",
"the",
"name",
"of",
"the",
"metric",
"ID",
"contained",
"in",
"a",
"row",
"key",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/RowKey.java#L38-L46 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/IntsRef.java | IntsRef.deepCopyOf | public static IntsRef deepCopyOf(IntsRef other) {
"""
Creates a new IntsRef that points to a copy of the ints from
<code>other</code>
<p>
The returned IntsRef will have a length of other.length
and an offset of zero.
"""
return new IntsRef(Arrays.copyOfRange(other.ints, other.offset, other.offset +... | java | public static IntsRef deepCopyOf(IntsRef other) {
return new IntsRef(Arrays.copyOfRange(other.ints, other.offset, other.offset + other.length), 0, other.length);
} | [
"public",
"static",
"IntsRef",
"deepCopyOf",
"(",
"IntsRef",
"other",
")",
"{",
"return",
"new",
"IntsRef",
"(",
"Arrays",
".",
"copyOfRange",
"(",
"other",
".",
"ints",
",",
"other",
".",
"offset",
",",
"other",
".",
"offset",
"+",
"other",
".",
"length... | Creates a new IntsRef that points to a copy of the ints from
<code>other</code>
<p>
The returned IntsRef will have a length of other.length
and an offset of zero. | [
"Creates",
"a",
"new",
"IntsRef",
"that",
"points",
"to",
"a",
"copy",
"of",
"the",
"ints",
"from",
"<code",
">",
"other<",
"/",
"code",
">",
"<p",
">",
"The",
"returned",
"IntsRef",
"will",
"have",
"a",
"length",
"of",
"other",
".",
"length",
"and",
... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/IntsRef.java#L138-L140 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.