repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
218
func_name
stringlengths
5
140
whole_func_string
stringlengths
79
3.99k
language
stringclasses
1 value
func_code_string
stringlengths
79
3.99k
func_code_tokens
listlengths
20
624
func_documentation_string
stringlengths
61
1.96k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
107
339
lightblueseas/jcommons-lang
src/main/java/de/alpharogroup/lang/ScanPackageExtensions.java
ScanPackageExtensions.scanClassNames
public static Set<String> scanClassNames(final String packageName) throws IOException { return scanClassNames(packageName, false, true); }
java
public static Set<String> scanClassNames(final String packageName) throws IOException { return scanClassNames(packageName, false, true); }
[ "public", "static", "Set", "<", "String", ">", "scanClassNames", "(", "final", "String", "packageName", ")", "throws", "IOException", "{", "return", "scanClassNames", "(", "packageName", ",", "false", ",", "true", ")", ";", "}" ]
Scan class names from the given package name. @param packageName the package name @return the list @throws IOException Signals that an I/O exception has occurred.
[ "Scan", "class", "names", "from", "the", "given", "package", "name", "." ]
train
https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/ScanPackageExtensions.java#L59-L62
haraldk/TwelveMonkeys
imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java
QuickDrawContext.eraseArc
public void eraseArc(final Rectangle2D pRectangle, int pStartAngle, int pArcAngle) { eraseShape(toArc(pRectangle, pStartAngle, pArcAngle, true)); }
java
public void eraseArc(final Rectangle2D pRectangle, int pStartAngle, int pArcAngle) { eraseShape(toArc(pRectangle, pStartAngle, pArcAngle, true)); }
[ "public", "void", "eraseArc", "(", "final", "Rectangle2D", "pRectangle", ",", "int", "pStartAngle", ",", "int", "pArcAngle", ")", "{", "eraseShape", "(", "toArc", "(", "pRectangle", ",", "pStartAngle", ",", "pArcAngle", ",", "true", ")", ")", ";", "}" ]
EraseArc(r,int,int) // fills the arc's interior with the background pattern @param pRectangle the rectangle to erase @param pStartAngle start angle in degrees (starting from 12'o clock, this differs from Java) @param pArcAngle rotation angle in degrees (starting from {@code pStartAngle}, this differs from Java arcs)
[ "EraseArc", "(", "r", "int", "int", ")", "//", "fills", "the", "arc", "s", "interior", "with", "the", "background", "pattern" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java#L765-L767
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java
CommerceSubscriptionEntryPersistenceImpl.removeByG_U
@Override public void removeByG_U(long groupId, long userId) { for (CommerceSubscriptionEntry commerceSubscriptionEntry : findByG_U( groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceSubscriptionEntry); } }
java
@Override public void removeByG_U(long groupId, long userId) { for (CommerceSubscriptionEntry commerceSubscriptionEntry : findByG_U( groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceSubscriptionEntry); } }
[ "@", "Override", "public", "void", "removeByG_U", "(", "long", "groupId", ",", "long", "userId", ")", "{", "for", "(", "CommerceSubscriptionEntry", "commerceSubscriptionEntry", ":", "findByG_U", "(", "groupId", ",", "userId", ",", "QueryUtil", ".", "ALL_POS", ",...
Removes all the commerce subscription entries where groupId = &#63; and userId = &#63; from the database. @param groupId the group ID @param userId the user ID
[ "Removes", "all", "the", "commerce", "subscription", "entries", "where", "groupId", "=", "&#63", ";", "and", "userId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L3032-L3038
Azure/azure-sdk-for-java
resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java
ResourcesInner.checkExistenceByIdAsync
public Observable<Boolean> checkExistenceByIdAsync(String resourceId, String apiVersion) { return checkExistenceByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<Boolean>, Boolean>() { @Override public Boolean call(ServiceResponse<Boolean> response) { return response.body(); } }); }
java
public Observable<Boolean> checkExistenceByIdAsync(String resourceId, String apiVersion) { return checkExistenceByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<Boolean>, Boolean>() { @Override public Boolean call(ServiceResponse<Boolean> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Boolean", ">", "checkExistenceByIdAsync", "(", "String", "resourceId", ",", "String", "apiVersion", ")", "{", "return", "checkExistenceByIdWithServiceResponseAsync", "(", "resourceId", ",", "apiVersion", ")", ".", "map", "(", "new", "Fu...
Checks by ID whether a resource exists. @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} @param apiVersion The API version to use for the operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the Boolean object
[ "Checks", "by", "ID", "whether", "a", "resource", "exists", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L1870-L1877
jbake-org/jbake
jbake-core/src/main/java/org/jbake/app/FileUtil.java
FileUtil.directoryOnlyIfNotIgnored
public static boolean directoryOnlyIfNotIgnored(File file) { boolean accept = false; FilenameFilter ignoreFile = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equalsIgnoreCase(".jbakeignore"); } }; accept = file.isDirectory() && (file.listFiles(ignoreFile).length == 0); return accept; }
java
public static boolean directoryOnlyIfNotIgnored(File file) { boolean accept = false; FilenameFilter ignoreFile = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equalsIgnoreCase(".jbakeignore"); } }; accept = file.isDirectory() && (file.listFiles(ignoreFile).length == 0); return accept; }
[ "public", "static", "boolean", "directoryOnlyIfNotIgnored", "(", "File", "file", ")", "{", "boolean", "accept", "=", "false", ";", "FilenameFilter", "ignoreFile", "=", "new", "FilenameFilter", "(", ")", "{", "@", "Override", "public", "boolean", "accept", "(", ...
Ignores directory (and children) if it contains a file named ".jbakeignore". @param file {@link File} @return {@link Boolean} true/false
[ "Ignores", "directory", "(", "and", "children", ")", "if", "it", "contains", "a", "file", "named", ".", "jbakeignore", "." ]
train
https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/FileUtil.java#L70-L83
aws/aws-sdk-java
aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/GetInstancesHealthStatusResult.java
GetInstancesHealthStatusResult.withStatus
public GetInstancesHealthStatusResult withStatus(java.util.Map<String, String> status) { setStatus(status); return this; }
java
public GetInstancesHealthStatusResult withStatus(java.util.Map<String, String> status) { setStatus(status); return this; }
[ "public", "GetInstancesHealthStatusResult", "withStatus", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "status", ")", "{", "setStatus", "(", "status", ")", ";", "return", "this", ";", "}" ]
<p> A complex type that contains the IDs and the health status of the instances that you specified in the <code>GetInstancesHealthStatus</code> request. </p> @param status A complex type that contains the IDs and the health status of the instances that you specified in the <code>GetInstancesHealthStatus</code> request. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "A", "complex", "type", "that", "contains", "the", "IDs", "and", "the", "health", "status", "of", "the", "instances", "that", "you", "specified", "in", "the", "<code", ">", "GetInstancesHealthStatus<", "/", "code", ">", "request", ".", "<", "/",...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/GetInstancesHealthStatusResult.java#L83-L86
opencb/biodata
biodata-tools/src/main/java/org/opencb/biodata/tools/feature/WigUtils.java
WigUtils.getChromosome
public static String getChromosome(String headerLine) throws InvalidObjectException { String chromosome = getHeaderInfo("chrom", headerLine); if (chromosome == null) { throw new InvalidObjectException("WigFile format, it could not find 'chrom' in the header line"); } return chromosome; }
java
public static String getChromosome(String headerLine) throws InvalidObjectException { String chromosome = getHeaderInfo("chrom", headerLine); if (chromosome == null) { throw new InvalidObjectException("WigFile format, it could not find 'chrom' in the header line"); } return chromosome; }
[ "public", "static", "String", "getChromosome", "(", "String", "headerLine", ")", "throws", "InvalidObjectException", "{", "String", "chromosome", "=", "getHeaderInfo", "(", "\"chrom\"", ",", "headerLine", ")", ";", "if", "(", "chromosome", "==", "null", ")", "{"...
Extract the chromosome value from the given Wig header line. @param headerLine Header line where to look for the chromosome @return Chromosome value
[ "Extract", "the", "chromosome", "value", "from", "the", "given", "Wig", "header", "line", "." ]
train
https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/feature/WigUtils.java#L155-L161
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java
IntegrationAccountsInner.createOrUpdate
public IntegrationAccountInner createOrUpdate(String resourceGroupName, String integrationAccountName, IntegrationAccountInner integrationAccount) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, integrationAccount).toBlocking().single().body(); }
java
public IntegrationAccountInner createOrUpdate(String resourceGroupName, String integrationAccountName, IntegrationAccountInner integrationAccount) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, integrationAccount).toBlocking().single().body(); }
[ "public", "IntegrationAccountInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "integrationAccountName", ",", "IntegrationAccountInner", "integrationAccount", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", ...
Creates or updates an integration account. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @param integrationAccount The integration account. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the IntegrationAccountInner object if successful.
[ "Creates", "or", "updates", "an", "integration", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java#L663-L665
s1ck/gdl
src/main/java/org/s1ck/gdl/GDLLoader.java
GDLLoader.getGraphCache
Map<String, Graph> getGraphCache(boolean includeUserDefined, boolean includeAutoGenerated) { return getCache(userGraphCache, autoGraphCache, includeUserDefined, includeAutoGenerated); }
java
Map<String, Graph> getGraphCache(boolean includeUserDefined, boolean includeAutoGenerated) { return getCache(userGraphCache, autoGraphCache, includeUserDefined, includeAutoGenerated); }
[ "Map", "<", "String", ",", "Graph", ">", "getGraphCache", "(", "boolean", "includeUserDefined", ",", "boolean", "includeAutoGenerated", ")", "{", "return", "getCache", "(", "userGraphCache", ",", "autoGraphCache", ",", "includeUserDefined", ",", "includeAutoGenerated"...
Returns a cache containing a mapping from variables to graphs. @param includeUserDefined include user-defined variables @param includeAutoGenerated include auto-generated variables @return immutable graph cache
[ "Returns", "a", "cache", "containing", "a", "mapping", "from", "variables", "to", "graphs", "." ]
train
https://github.com/s1ck/gdl/blob/c89b0f83526661823ad3392f338dbf7dc3e3f834/src/main/java/org/s1ck/gdl/GDLLoader.java#L216-L218
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doDeleteForProxy
protected ClientResponse doDeleteForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.DELETE, parameterMap).getRequestBuilder(); copyHeaders(headers, requestBuilder); return requestBuilder.delete(ClientResponse.class); } catch (ClientHandlerException ex) { throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage()); } finally { this.readLock.unlock(); } }
java
protected ClientResponse doDeleteForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.DELETE, parameterMap).getRequestBuilder(); copyHeaders(headers, requestBuilder); return requestBuilder.delete(ClientResponse.class); } catch (ClientHandlerException ex) { throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage()); } finally { this.readLock.unlock(); } }
[ "protected", "ClientResponse", "doDeleteForProxy", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "parameterMap", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ...
Deletes a resource from a proxied server. @param path the path to the resource. Cannot be <code>null</code>. @param parameterMap query parameters. May be <code>null</code>. @param headers any request headers to add. @return ClientResponse the proxied server's response information. @throws ClientException if the proxied server responds with an "error" status code, which is dependent on the server being called. @see #getResourceUrl() for the URL of the proxied server.
[ "Deletes", "a", "resource", "from", "a", "proxied", "server", "." ]
train
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1004-L1015
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/comm/TransportDecoder.java
TransportDecoder.decodeStream
private InputStream decodeStream(String encoding, InputStream initialStream) throws IOException { if (encoding == null) return initialStream; if ("gzip".equals(encoding)) return new GZIPInputStream(initialStream); if ("deflate".equals(encoding)) return new InflaterInputStream(initialStream); throw new IOException("Unsupported transport encoding " + encoding); }
java
private InputStream decodeStream(String encoding, InputStream initialStream) throws IOException { if (encoding == null) return initialStream; if ("gzip".equals(encoding)) return new GZIPInputStream(initialStream); if ("deflate".equals(encoding)) return new InflaterInputStream(initialStream); throw new IOException("Unsupported transport encoding " + encoding); }
[ "private", "InputStream", "decodeStream", "(", "String", "encoding", ",", "InputStream", "initialStream", ")", "throws", "IOException", "{", "if", "(", "encoding", "==", "null", ")", "return", "initialStream", ";", "if", "(", "\"gzip\"", ".", "equals", "(", "e...
Decodes a transport stream. @param encoding stream encoding. @param initialStream initial stream. @return decoding stream. @throws IOException
[ "Decodes", "a", "transport", "stream", "." ]
train
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/comm/TransportDecoder.java#L48-L57
j-easy/easy-random
easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java
EasyRandomParameters.collectionSizeRange
public EasyRandomParameters collectionSizeRange(final int minCollectionSize, final int maxCollectionSize) { if (minCollectionSize < 0) { throw new IllegalArgumentException("minCollectionSize must be >= 0"); } if (minCollectionSize > maxCollectionSize) { throw new IllegalArgumentException(format("minCollectionSize (%s) must be <= than maxCollectionSize (%s)", minCollectionSize, maxCollectionSize)); } setCollectionSizeRange(new Range<>(minCollectionSize, maxCollectionSize)); return this; }
java
public EasyRandomParameters collectionSizeRange(final int minCollectionSize, final int maxCollectionSize) { if (minCollectionSize < 0) { throw new IllegalArgumentException("minCollectionSize must be >= 0"); } if (minCollectionSize > maxCollectionSize) { throw new IllegalArgumentException(format("minCollectionSize (%s) must be <= than maxCollectionSize (%s)", minCollectionSize, maxCollectionSize)); } setCollectionSizeRange(new Range<>(minCollectionSize, maxCollectionSize)); return this; }
[ "public", "EasyRandomParameters", "collectionSizeRange", "(", "final", "int", "minCollectionSize", ",", "final", "int", "maxCollectionSize", ")", "{", "if", "(", "minCollectionSize", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"minCollection...
Set the collection size range. @param minCollectionSize the minimum collection size @param maxCollectionSize the maximum collection size @return the current {@link EasyRandomParameters} instance for method chaining
[ "Set", "the", "collection", "size", "range", "." ]
train
https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java#L383-L393
esigate/esigate
esigate-core/src/main/java/org/esigate/extension/surrogate/Surrogate.java
Surrogate.getFirstSurrogateFor
private String getFirstSurrogateFor(SurrogateCapabilitiesHeader surrogateCapabilitiesHeader, String capability) { for (SurrogateCapabilities surrogate : surrogateCapabilitiesHeader.getSurrogates()) { for (Capability sc : surrogate.getCapabilities()) { if (capability.equals(sc.toString())) { return surrogate.getDeviceToken(); } } } return null; }
java
private String getFirstSurrogateFor(SurrogateCapabilitiesHeader surrogateCapabilitiesHeader, String capability) { for (SurrogateCapabilities surrogate : surrogateCapabilitiesHeader.getSurrogates()) { for (Capability sc : surrogate.getCapabilities()) { if (capability.equals(sc.toString())) { return surrogate.getDeviceToken(); } } } return null; }
[ "private", "String", "getFirstSurrogateFor", "(", "SurrogateCapabilitiesHeader", "surrogateCapabilitiesHeader", ",", "String", "capability", ")", "{", "for", "(", "SurrogateCapabilities", "surrogate", ":", "surrogateCapabilitiesHeader", ".", "getSurrogates", "(", ")", ")", ...
Returns the first surrogate which supports the requested capability. @param surrogateCapabilitiesHeader @param capability @return a Surrogate or null if the capability is not found.
[ "Returns", "the", "first", "surrogate", "which", "supports", "the", "requested", "capability", "." ]
train
https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/extension/surrogate/Surrogate.java#L489-L499
JavaMoney/jsr354-api
src/main/java/javax/money/Monetary.java
Monetary.isRoundingAvailable
public static boolean isRoundingAvailable(String roundingName, String... providers) { return Optional.ofNullable(monetaryRoundingsSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryRoundingsSpi loaded, query functionality is not available.")) .isRoundingAvailable(roundingName, providers); }
java
public static boolean isRoundingAvailable(String roundingName, String... providers) { return Optional.ofNullable(monetaryRoundingsSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryRoundingsSpi loaded, query functionality is not available.")) .isRoundingAvailable(roundingName, providers); }
[ "public", "static", "boolean", "isRoundingAvailable", "(", "String", "roundingName", ",", "String", "...", "providers", ")", "{", "return", "Optional", ".", "ofNullable", "(", "monetaryRoundingsSingletonSpi", "(", ")", ")", ".", "orElseThrow", "(", "(", ")", "->...
Checks if a {@link MonetaryRounding} is available given a roundingId. @param roundingName The rounding identifier. @param providers the providers and ordering to be used. By default providers and ordering as defined in #getDefaultProviders is used. @return true, if a corresponding {@link javax.money.MonetaryRounding} is available. @throws IllegalArgumentException if no such rounding is registered using a {@link javax.money.spi.RoundingProviderSpi} instance.
[ "Checks", "if", "a", "{", "@link", "MonetaryRounding", "}", "is", "available", "given", "a", "roundingId", "." ]
train
https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L202-L206
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java
ForkJoinPool.tryReactivate
private void tryReactivate(WorkQueue w, WorkQueue[] ws, int r) { long c; int sp, wl; WorkQueue v; if ((sp = (int)(c = ctl)) != 0 && w != null && ws != null && (wl = ws.length) > 0 && ((sp ^ r) & SS_SEQ) == 0 && (v = ws[(wl - 1) & sp]) != null) { long nc = (v.stackPred & SP_MASK) | (UC_MASK & (c + AC_UNIT)); int ns = sp & ~UNSIGNALLED; if (w.scanState < 0 && v.scanState == sp && U.compareAndSwapLong(this, CTL, c, nc)) { v.scanState = ns; LockSupport.unpark(v.parker); } } }
java
private void tryReactivate(WorkQueue w, WorkQueue[] ws, int r) { long c; int sp, wl; WorkQueue v; if ((sp = (int)(c = ctl)) != 0 && w != null && ws != null && (wl = ws.length) > 0 && ((sp ^ r) & SS_SEQ) == 0 && (v = ws[(wl - 1) & sp]) != null) { long nc = (v.stackPred & SP_MASK) | (UC_MASK & (c + AC_UNIT)); int ns = sp & ~UNSIGNALLED; if (w.scanState < 0 && v.scanState == sp && U.compareAndSwapLong(this, CTL, c, nc)) { v.scanState = ns; LockSupport.unpark(v.parker); } } }
[ "private", "void", "tryReactivate", "(", "WorkQueue", "w", ",", "WorkQueue", "[", "]", "ws", ",", "int", "r", ")", "{", "long", "c", ";", "int", "sp", ",", "wl", ";", "WorkQueue", "v", ";", "if", "(", "(", "sp", "=", "(", "int", ")", "(", "c", ...
With approx probability of a missed signal, tries (once) to reactivate worker w (or some other worker), failing if stale or known to be already active. @param w the worker @param ws the workQueue array to use @param r random seed
[ "With", "approx", "probability", "of", "a", "missed", "signal", "tries", "(", "once", ")", "to", "reactivate", "worker", "w", "(", "or", "some", "other", "worker", ")", "failing", "if", "stale", "or", "known", "to", "be", "already", "active", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java#L1752-L1767
nohana/Amalgam
amalgam/src/main/java/com/amalgam/widget/ToastUtils.java
ToastUtils.showOnUiThread
public static void showOnUiThread(Context applicationContext, String message, int duration) { Handler handler = HandlerUtils.getMainHandler(); showOnUiThread(applicationContext, message, duration, handler); }
java
public static void showOnUiThread(Context applicationContext, String message, int duration) { Handler handler = HandlerUtils.getMainHandler(); showOnUiThread(applicationContext, message, duration, handler); }
[ "public", "static", "void", "showOnUiThread", "(", "Context", "applicationContext", ",", "String", "message", ",", "int", "duration", ")", "{", "Handler", "handler", "=", "HandlerUtils", ".", "getMainHandler", "(", ")", ";", "showOnUiThread", "(", "applicationCont...
Show toast on the UI thread. @param applicationContext the application context. @param message the message to show. @param duration the display duration.
[ "Show", "toast", "on", "the", "UI", "thread", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/widget/ToastUtils.java#L61-L64
graphhopper/graphhopper
tools/src/main/java/com/graphhopper/tools/Measurement.java
Measurement.writeSummary
private void writeSummary(String summaryLocation, String propLocation) { logger.info("writing summary to " + summaryLocation); // choose properties that should be in summary here String[] properties = { "graph.nodes", "graph.edges", "graph.import_time", CH.PREPARE + "time", CH.PREPARE + "node.shortcuts", CH.PREPARE + "edge.shortcuts", Landmark.PREPARE + "time", "routing.distance_mean", "routing.mean", "routing.visited_nodes_mean", "routingCH.distance_mean", "routingCH.mean", "routingCH.visited_nodes_mean", "routingCH_no_instr.mean", "routingCH_edge.distance_mean", "routingCH_edge.mean", "routingCH_edge.visited_nodes_mean", "routingCH_edge_no_instr.mean", "routingLM8.distance_mean", "routingLM8.mean", "routingLM8.visited_nodes_mean", "measurement.seed", "measurement.gitinfo", "measurement.timestamp" }; File f = new File(summaryLocation); boolean writeHeader = !f.exists(); try (FileWriter writer = new FileWriter(f, true)) { if (writeHeader) writer.write(getSummaryHeader(properties)); writer.write(getSummaryLogLine(properties, propLocation)); } catch (IOException e) { logger.error("Could not write summary to file '{}'", summaryLocation, e); } }
java
private void writeSummary(String summaryLocation, String propLocation) { logger.info("writing summary to " + summaryLocation); // choose properties that should be in summary here String[] properties = { "graph.nodes", "graph.edges", "graph.import_time", CH.PREPARE + "time", CH.PREPARE + "node.shortcuts", CH.PREPARE + "edge.shortcuts", Landmark.PREPARE + "time", "routing.distance_mean", "routing.mean", "routing.visited_nodes_mean", "routingCH.distance_mean", "routingCH.mean", "routingCH.visited_nodes_mean", "routingCH_no_instr.mean", "routingCH_edge.distance_mean", "routingCH_edge.mean", "routingCH_edge.visited_nodes_mean", "routingCH_edge_no_instr.mean", "routingLM8.distance_mean", "routingLM8.mean", "routingLM8.visited_nodes_mean", "measurement.seed", "measurement.gitinfo", "measurement.timestamp" }; File f = new File(summaryLocation); boolean writeHeader = !f.exists(); try (FileWriter writer = new FileWriter(f, true)) { if (writeHeader) writer.write(getSummaryHeader(properties)); writer.write(getSummaryLogLine(properties, propLocation)); } catch (IOException e) { logger.error("Could not write summary to file '{}'", summaryLocation, e); } }
[ "private", "void", "writeSummary", "(", "String", "summaryLocation", ",", "String", "propLocation", ")", "{", "logger", ".", "info", "(", "\"writing summary to \"", "+", "summaryLocation", ")", ";", "// choose properties that should be in summary here", "String", "[", "...
Writes a selection of measurement results to a single line in a file. Each run of the measurement class will append a new line.
[ "Writes", "a", "selection", "of", "measurement", "results", "to", "a", "single", "line", "in", "a", "file", ".", "Each", "run", "of", "the", "measurement", "class", "will", "append", "a", "new", "line", "." ]
train
https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/tools/src/main/java/com/graphhopper/tools/Measurement.java#L558-L596
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDisplayLayoutUtil.java
CPDisplayLayoutUtil.removeByUUID_G
public static CPDisplayLayout removeByUUID_G(String uuid, long groupId) throws com.liferay.commerce.product.exception.NoSuchCPDisplayLayoutException { return getPersistence().removeByUUID_G(uuid, groupId); }
java
public static CPDisplayLayout removeByUUID_G(String uuid, long groupId) throws com.liferay.commerce.product.exception.NoSuchCPDisplayLayoutException { return getPersistence().removeByUUID_G(uuid, groupId); }
[ "public", "static", "CPDisplayLayout", "removeByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "exception", ".", "NoSuchCPDisplayLayoutException", "{", "return", "getPersistence", ...
Removes the cp display layout where uuid = &#63; and groupId = &#63; from the database. @param uuid the uuid @param groupId the group ID @return the cp display layout that was removed
[ "Removes", "the", "cp", "display", "layout", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDisplayLayoutUtil.java#L315-L318
PureSolTechnologies/parsers
parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java
PackratParser.processIgnoredLeadingTokens
private void processIgnoredLeadingTokens(ParseTreeNode node, int position, int line, MemoEntry progress) throws TreeException, ParserException { if (ignoredLeading) { processIgnoredTokens(node, position, line, progress); } }
java
private void processIgnoredLeadingTokens(ParseTreeNode node, int position, int line, MemoEntry progress) throws TreeException, ParserException { if (ignoredLeading) { processIgnoredTokens(node, position, line, progress); } }
[ "private", "void", "processIgnoredLeadingTokens", "(", "ParseTreeNode", "node", ",", "int", "position", ",", "int", "line", ",", "MemoEntry", "progress", ")", "throws", "TreeException", ",", "ParserException", "{", "if", "(", "ignoredLeading", ")", "{", "processIg...
This method processes leading tokens which are either hidden or ignored. The processing only happens if the configuration allows it. @param node @param position @param id @param line @param progress @throws TreeException @throws ParserException
[ "This", "method", "processes", "leading", "tokens", "which", "are", "either", "hidden", "or", "ignored", ".", "The", "processing", "only", "happens", "if", "the", "configuration", "allows", "it", "." ]
train
https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java#L565-L570
prestodb/presto
presto-hive/src/main/java/com/facebook/presto/hive/metastore/thrift/StaticHiveCluster.java
StaticHiveCluster.createMetastoreClient
@Override public HiveMetastoreClient createMetastoreClient() throws TException { List<HostAndPort> metastores = new ArrayList<>(addresses); Collections.shuffle(metastores.subList(1, metastores.size())); TException lastException = null; for (HostAndPort metastore : metastores) { try { HiveMetastoreClient client = clientFactory.create(metastore); if (!isNullOrEmpty(metastoreUsername)) { client.setUGI(metastoreUsername); } return client; } catch (TException e) { lastException = e; } } throw new TException("Failed connecting to Hive metastore: " + addresses, lastException); }
java
@Override public HiveMetastoreClient createMetastoreClient() throws TException { List<HostAndPort> metastores = new ArrayList<>(addresses); Collections.shuffle(metastores.subList(1, metastores.size())); TException lastException = null; for (HostAndPort metastore : metastores) { try { HiveMetastoreClient client = clientFactory.create(metastore); if (!isNullOrEmpty(metastoreUsername)) { client.setUGI(metastoreUsername); } return client; } catch (TException e) { lastException = e; } } throw new TException("Failed connecting to Hive metastore: " + addresses, lastException); }
[ "@", "Override", "public", "HiveMetastoreClient", "createMetastoreClient", "(", ")", "throws", "TException", "{", "List", "<", "HostAndPort", ">", "metastores", "=", "new", "ArrayList", "<>", "(", "addresses", ")", ";", "Collections", ".", "shuffle", "(", "metas...
Create a metastore client connected to the Hive metastore. <p> As per Hive HA metastore behavior, return the first metastore in the list list of available metastores (i.e. the default metastore) if a connection can be made, else try another of the metastores at random, until either a connection succeeds or there are no more fallback metastores.
[ "Create", "a", "metastore", "client", "connected", "to", "the", "Hive", "metastore", ".", "<p", ">", "As", "per", "Hive", "HA", "metastore", "behavior", "return", "the", "first", "metastore", "in", "the", "list", "list", "of", "available", "metastores", "(",...
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/metastore/thrift/StaticHiveCluster.java#L64-L85
alipay/sofa-hessian
src/main/java/com/caucho/hessian/io/HessianInput.java
HessianInput.readDouble
public double readDouble() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (double) parseLong(); case 'D': return parseDouble(); default: throw expect("long", tag); } }
java
public double readDouble() throws IOException { int tag = read(); switch (tag) { case 'T': return 1; case 'F': return 0; case 'I': return parseInt(); case 'L': return (double) parseLong(); case 'D': return parseDouble(); default: throw expect("long", tag); } }
[ "public", "double", "readDouble", "(", ")", "throws", "IOException", "{", "int", "tag", "=", "read", "(", ")", ";", "switch", "(", "tag", ")", "{", "case", "'", "'", ":", "return", "1", ";", "case", "'", "'", ":", "return", "0", ";", "case", "'",...
Reads a double <pre> D b64 b56 b48 b40 b32 b24 b16 b8 </pre>
[ "Reads", "a", "double" ]
train
https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianInput.java#L604-L624
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java
DBTransaction.addColumn
public void addColumn(String storeName, String rowKey, String columnName, byte[] columnValue) { m_columnUpdates.add(new ColumnUpdate(storeName, rowKey, columnName, columnValue)); }
java
public void addColumn(String storeName, String rowKey, String columnName, byte[] columnValue) { m_columnUpdates.add(new ColumnUpdate(storeName, rowKey, columnName, columnValue)); }
[ "public", "void", "addColumn", "(", "String", "storeName", ",", "String", "rowKey", ",", "String", "columnName", ",", "byte", "[", "]", "columnValue", ")", "{", "m_columnUpdates", ".", "add", "(", "new", "ColumnUpdate", "(", "storeName", ",", "rowKey", ",", ...
Add or set a column with the given binary value. @param storeName Name of store that owns row. @param rowKey Key of row that owns column. @param columnName Name of column. @param columnValue Column value in binary.
[ "Add", "or", "set", "a", "column", "with", "the", "given", "binary", "value", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java#L182-L184
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java
QueueContainer.txnPollBackupReserve
public void txnPollBackupReserve(long itemId, String transactionId) { QueueItem item = getBackupMap().remove(itemId); if (item != null) { txMap.put(itemId, new TxQueueItem(item).setPollOperation(true).setTransactionId(transactionId)); return; } if (txMap.remove(itemId) == null) { logger.warning("Poll backup reserve failed, itemId: " + itemId + " is not found"); } }
java
public void txnPollBackupReserve(long itemId, String transactionId) { QueueItem item = getBackupMap().remove(itemId); if (item != null) { txMap.put(itemId, new TxQueueItem(item).setPollOperation(true).setTransactionId(transactionId)); return; } if (txMap.remove(itemId) == null) { logger.warning("Poll backup reserve failed, itemId: " + itemId + " is not found"); } }
[ "public", "void", "txnPollBackupReserve", "(", "long", "itemId", ",", "String", "transactionId", ")", "{", "QueueItem", "item", "=", "getBackupMap", "(", ")", ".", "remove", "(", "itemId", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "txMap", "."...
Makes a reservation for a poll operation. Should be executed as a part of the prepare phase for a transactional queue poll on the partition backup replica. The ID of the item being polled is determined by the partition owner. @param itemId the ID of the reserved item to be polled @param transactionId the transaction ID @see #txnPollReserve(long, String) @see com.hazelcast.collection.impl.txnqueue.operations.TxnReservePollOperation
[ "Makes", "a", "reservation", "for", "a", "poll", "operation", ".", "Should", "be", "executed", "as", "a", "part", "of", "the", "prepare", "phase", "for", "a", "transactional", "queue", "poll", "on", "the", "partition", "backup", "replica", ".", "The", "ID"...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L216-L225
btrplace/scheduler
json/src/main/java/org/btrplace/json/plan/ActionConverter.java
ActionConverter.attachEvents
private void attachEvents(Action a, JSONObject in) throws JSONConverterException { if (in.containsKey(HOOK_LABEL)) { JSONObject hooks = (JSONObject) in.get(HOOK_LABEL); for (Map.Entry<String, Object> e : hooks.entrySet()) { String k = e.getKey(); try { Action.Hook h = Action.Hook.valueOf(k.toUpperCase()); for (Object o : (JSONArray) e.getValue()) { a.addEvent(h, eventFromJSON((JSONObject) o)); } } catch (IllegalArgumentException ex) { throw new JSONConverterException("Unsupported hook type '" + k + "'", ex); } } } }
java
private void attachEvents(Action a, JSONObject in) throws JSONConverterException { if (in.containsKey(HOOK_LABEL)) { JSONObject hooks = (JSONObject) in.get(HOOK_LABEL); for (Map.Entry<String, Object> e : hooks.entrySet()) { String k = e.getKey(); try { Action.Hook h = Action.Hook.valueOf(k.toUpperCase()); for (Object o : (JSONArray) e.getValue()) { a.addEvent(h, eventFromJSON((JSONObject) o)); } } catch (IllegalArgumentException ex) { throw new JSONConverterException("Unsupported hook type '" + k + "'", ex); } } } }
[ "private", "void", "attachEvents", "(", "Action", "a", ",", "JSONObject", "in", ")", "throws", "JSONConverterException", "{", "if", "(", "in", ".", "containsKey", "(", "HOOK_LABEL", ")", ")", "{", "JSONObject", "hooks", "=", "(", "JSONObject", ")", "in", "...
Decorate the action with optional events. @param a the action to decorate @param in the JSON message containing the event at the "hook" key @throws JSONConverterException in case of error
[ "Decorate", "the", "action", "with", "optional", "events", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/plan/ActionConverter.java#L163-L178
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.getCertificatePolicyAsync
public Observable<CertificatePolicy> getCertificatePolicyAsync(String vaultBaseUrl, String certificateName) { return getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificatePolicy>, CertificatePolicy>() { @Override public CertificatePolicy call(ServiceResponse<CertificatePolicy> response) { return response.body(); } }); }
java
public Observable<CertificatePolicy> getCertificatePolicyAsync(String vaultBaseUrl, String certificateName) { return getCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificatePolicy>, CertificatePolicy>() { @Override public CertificatePolicy call(ServiceResponse<CertificatePolicy> response) { return response.body(); } }); }
[ "public", "Observable", "<", "CertificatePolicy", ">", "getCertificatePolicyAsync", "(", "String", "vaultBaseUrl", ",", "String", "certificateName", ")", "{", "return", "getCertificatePolicyWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "certificateName", ")", ".", ...
Lists the policy for a certificate. The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param certificateName The name of the certificate in a given key vault. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the CertificatePolicy object
[ "Lists", "the", "policy", "for", "a", "certificate", ".", "The", "GetCertificatePolicy", "operation", "returns", "the", "specified", "certificate", "policy", "resources", "in", "the", "specified", "key", "vault", ".", "This", "operation", "requires", "the", "certi...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7179-L7186
blinkfox/zealot
src/main/java/com/blinkfox/zealot/core/ZealotKhala.java
ZealotKhala.andMoreEqual
public ZealotKhala andMoreEqual(String field, Object value) { return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.GTE_SUFFIX, true); }
java
public ZealotKhala andMoreEqual(String field, Object value) { return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.GTE_SUFFIX, true); }
[ "public", "ZealotKhala", "andMoreEqual", "(", "String", "field", ",", "Object", "value", ")", "{", "return", "this", ".", "doNormal", "(", "ZealotConst", ".", "AND_PREFIX", ",", "field", ",", "value", ",", "ZealotConst", ".", "GTE_SUFFIX", ",", "true", ")", ...
生成带" AND "前缀大于等于查询的SQL片段. @param field 数据库字段 @param value 值 @return ZealotKhala实例
[ "生成带", "AND", "前缀大于等于查询的SQL片段", "." ]
train
https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L795-L797
palatable/lambda
src/main/java/com/jnape/palatable/lambda/adt/Either.java
Either.filter
public final Either<L, R> filter(Function<? super R, ? extends Boolean> pred, Supplier<L> leftSupplier) { return filter(pred, __ -> leftSupplier.get()); }
java
public final Either<L, R> filter(Function<? super R, ? extends Boolean> pred, Supplier<L> leftSupplier) { return filter(pred, __ -> leftSupplier.get()); }
[ "public", "final", "Either", "<", "L", ",", "R", ">", "filter", "(", "Function", "<", "?", "super", "R", ",", "?", "extends", "Boolean", ">", "pred", ",", "Supplier", "<", "L", ">", "leftSupplier", ")", "{", "return", "filter", "(", "pred", ",", "_...
If this is a right value, apply <code>pred</code> to it. If the result is <code>true</code>, return the same value; otherwise, return the result of <code>leftSupplier</code> wrapped as a left value. <p> If this is a left value, return it. @param pred the predicate to apply to a right value @param leftSupplier the supplier of a left value if pred fails @return this if a left value or a right value that pred matches; otherwise, the result of leftSupplier wrapped in a left
[ "If", "this", "is", "a", "right", "value", "apply", "<code", ">", "pred<", "/", "code", ">", "to", "it", ".", "If", "the", "result", "is", "<code", ">", "true<", "/", "code", ">", "return", "the", "same", "value", ";", "otherwise", "return", "the", ...
train
https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Either.java#L102-L104
Graylog2/graylog2-server
graylog2-server/src/main/java/org/graylog2/indexer/indices/Indices.java
Indices.catIndices
private JsonNode catIndices(Collection<String> indices, String... fields) { final String fieldNames = String.join(",", fields); final Cat request = new Cat.IndicesBuilder() .addIndex(indices) .setParameter("h", fieldNames) .build(); final CatResult response = JestUtils.execute(jestClient, request, () -> "Unable to read information for indices " + indices); return response.getJsonObject().path("result"); }
java
private JsonNode catIndices(Collection<String> indices, String... fields) { final String fieldNames = String.join(",", fields); final Cat request = new Cat.IndicesBuilder() .addIndex(indices) .setParameter("h", fieldNames) .build(); final CatResult response = JestUtils.execute(jestClient, request, () -> "Unable to read information for indices " + indices); return response.getJsonObject().path("result"); }
[ "private", "JsonNode", "catIndices", "(", "Collection", "<", "String", ">", "indices", ",", "String", "...", "fields", ")", "{", "final", "String", "fieldNames", "=", "String", ".", "join", "(", "\",\"", ",", "fields", ")", ";", "final", "Cat", "request", ...
Retrieve the response for the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html">cat indices</a> request from Elasticsearch. @param fields The fields to show, see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html">cat indices API</a>. @return A {@link JsonNode} with the result of the cat indices request.
[ "Retrieve", "the", "response", "for", "the", "<a", "href", "=", "https", ":", "//", "www", ".", "elastic", ".", "co", "/", "guide", "/", "en", "/", "elasticsearch", "/", "reference", "/", "current", "/", "cat", "-", "indices", ".", "html", ">", "cat"...
train
https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/indexer/indices/Indices.java#L575-L583
line/armeria
core/src/main/java/com/linecorp/armeria/server/docs/TypeSignature.java
TypeSignature.ofBase
public static TypeSignature ofBase(String baseTypeName) { checkBaseTypeName(baseTypeName, "baseTypeName"); return new TypeSignature(baseTypeName, ImmutableList.of()); }
java
public static TypeSignature ofBase(String baseTypeName) { checkBaseTypeName(baseTypeName, "baseTypeName"); return new TypeSignature(baseTypeName, ImmutableList.of()); }
[ "public", "static", "TypeSignature", "ofBase", "(", "String", "baseTypeName", ")", "{", "checkBaseTypeName", "(", "baseTypeName", ",", "\"baseTypeName\"", ")", ";", "return", "new", "TypeSignature", "(", "baseTypeName", ",", "ImmutableList", ".", "of", "(", ")", ...
Creates a new type signature for a base type. @throws IllegalArgumentException if the specified type name is not valid
[ "Creates", "a", "new", "type", "signature", "for", "a", "base", "type", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/docs/TypeSignature.java#L67-L70
nutzam/nutzboot
nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java
FastdfsService.uploadImage
public String uploadImage(byte[] image, byte[] watermark, String ext, Map<String, String> metaInfo) { return uploadImage(image, watermark, ext, metaInfo, DEFAULT_OPACITY, DEFAULT_LOCATION, DEFAULT_MARGIN); }
java
public String uploadImage(byte[] image, byte[] watermark, String ext, Map<String, String> metaInfo) { return uploadImage(image, watermark, ext, metaInfo, DEFAULT_OPACITY, DEFAULT_LOCATION, DEFAULT_MARGIN); }
[ "public", "String", "uploadImage", "(", "byte", "[", "]", "image", ",", "byte", "[", "]", "watermark", ",", "String", "ext", ",", "Map", "<", "String", ",", "String", ">", "metaInfo", ")", "{", "return", "uploadImage", "(", "image", ",", "watermark", "...
上传图片并生成缩略图、水印图 @param image 原图 @param watermark 水印图 @param ext 后缀名 @param metaInfo 元信息 @return
[ "上传图片并生成缩略图、水印图" ]
train
https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java#L420-L422
PureSolTechnologies/parsers
parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java
PackratParser.setupLR
private void setupLR(String production, final LR l) throws ParserException { /* * If the lr object does not contain a head, we found a new recursion * production. Otherwise we already know the production, but we found another * production which is involved in the recursion. */ if (l.getHead() == null) l.setHead(new Head(production)); /* * Go over all heads and...!? */ RuleInvocation s = ruleInvocationStack; while (!l.getHead().getProduction().equals(s.getProduction())) { s.setHead(l.getHead()); l.getHead().addInvolved(s.getProduction()); s = s.getNext(); if (s == null) throw new RuntimeException("We should find the head again, when we search the stack.\n" + "We found a recursion and the rule should be there again."); } }
java
private void setupLR(String production, final LR l) throws ParserException { /* * If the lr object does not contain a head, we found a new recursion * production. Otherwise we already know the production, but we found another * production which is involved in the recursion. */ if (l.getHead() == null) l.setHead(new Head(production)); /* * Go over all heads and...!? */ RuleInvocation s = ruleInvocationStack; while (!l.getHead().getProduction().equals(s.getProduction())) { s.setHead(l.getHead()); l.getHead().addInvolved(s.getProduction()); s = s.getNext(); if (s == null) throw new RuntimeException("We should find the head again, when we search the stack.\n" + "We found a recursion and the rule should be there again."); } }
[ "private", "void", "setupLR", "(", "String", "production", ",", "final", "LR", "l", ")", "throws", "ParserException", "{", "/*\n\t * If the lr object does not contain a head, we found a new recursion\n\t * production. Otherwise we already know the production, but we found another\n\t * p...
After finding a recursion or a seed grow in process, this method puts all information in place for seed grow. This might be the start information for the growth or the current result in the growing, which means the current result. @param production @param l @throws ParserException
[ "After", "finding", "a", "recursion", "or", "a", "seed", "grow", "in", "process", "this", "method", "puts", "all", "information", "in", "place", "for", "seed", "grow", ".", "This", "might", "be", "the", "start", "information", "for", "the", "growth", "or",...
train
https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java#L343-L363
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/br/br_locallicense.java
br_locallicense.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { br_locallicense_responses result = (br_locallicense_responses) service.get_payload_formatter().string_to_resource(br_locallicense_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.br_locallicense_response_array); } br_locallicense[] result_br_locallicense = new br_locallicense[result.br_locallicense_response_array.length]; for(int i = 0; i < result.br_locallicense_response_array.length; i++) { result_br_locallicense[i] = result.br_locallicense_response_array[i].br_locallicense[0]; } return result_br_locallicense; }
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { br_locallicense_responses result = (br_locallicense_responses) service.get_payload_formatter().string_to_resource(br_locallicense_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.br_locallicense_response_array); } br_locallicense[] result_br_locallicense = new br_locallicense[result.br_locallicense_response_array.length]; for(int i = 0; i < result.br_locallicense_response_array.length; i++) { result_br_locallicense[i] = result.br_locallicense_response_array[i].br_locallicense[0]; } return result_br_locallicense; }
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "br_locallicense_responses", "result", "=", "(", "br_locallicense_responses", ")", "service", ".", "get_payloa...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_locallicense.java#L136-L153
CloudSlang/cs-actions
cs-tesseract/src/main/java/io/cloudslang/content/tesseract/actions/ExtractTextFromPDF.java
ExtractTextFromPDF.execute
@Action(name = "Extract text from PDF", description = EXTRACT_TEXT_FROM_PDF_DESC, outputs = { @Output(value = RETURN_CODE, description = RETURN_CODE_DESC), @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC), @Output(value = TEXT_STRING, description = TEXT_STRING_DESC), @Output(value = TEXT_JSON, description = TEXT_JSON_DESC), @Output(value = EXCEPTION, description = EXCEPTION_DESC), }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED, description = SUCCESS_DESC), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR, isOnFail = true, description = FAILURE_DESC) }) public Map<String, String> execute( @Param(value = FILE_PATH, required = true, description = PDF_FILE_PATH_DESC) String filePath, @Param(value = DATA_PATH, required = true, description = DATA_PATH_DESC) String dataPath, @Param(value = LANGUAGE, required = true, description = LANGUAGE_DESC) String language, @Param(value = DPI, description = DPI_DESC) String dpi, @Param(value = TEXT_BLOCKS, description = TEXT_BLOCKS_DESC) String textBlocks, @Param(value = DESKEW, description = DESKEW_DESC) String deskew, @Param(value = FROM_PAGE, description = FROM_PAGE_DESC) String fromPage, @Param(value = TO_PAGE, description = TO_PAGE_DESC) String toPage, @Param(value = PAGE_INDEX, description = PAGE_INDEX_DESC) String pageIndex) { dataPath = defaultIfEmpty(dataPath, EMPTY); language = defaultIfEmpty(language, ENG); dpi = defaultIfEmpty(dpi, DPI_SET); textBlocks = defaultIfEmpty(textBlocks, FALSE); deskew = defaultIfEmpty(deskew, FALSE); fromPage = defaultIfEmpty(fromPage, EMPTY); toPage = defaultIfEmpty(toPage, EMPTY); pageIndex = defaultIfEmpty(pageIndex, EMPTY); final List<String> exceptionMessages = verifyExtractTextFromPDF(filePath, dataPath, textBlocks, deskew, fromPage, toPage, pageIndex, dpi); if (!exceptionMessages.isEmpty()) { return getFailureResultsMap(StringUtilities.join(exceptionMessages, NEW_LINE)); } try { final String resultText = imageConvert(filePath, dataPath, language, dpi, textBlocks, deskew, fromPage, toPage, pageIndex); final Map<String, String> result = getSuccessResultsMap(resultText); if (Boolean.parseBoolean(textBlocks)) { result.put(TEXT_JSON, resultText); } else { result.put(TEXT_STRING, resultText); } return result; } catch (IndexOutOfBoundsException e) { return getFailureResultsMap(EXCEPTION_EXCEEDS_PAGES); } catch (Exception e) { return getFailureResultsMap(e); } }
java
@Action(name = "Extract text from PDF", description = EXTRACT_TEXT_FROM_PDF_DESC, outputs = { @Output(value = RETURN_CODE, description = RETURN_CODE_DESC), @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC), @Output(value = TEXT_STRING, description = TEXT_STRING_DESC), @Output(value = TEXT_JSON, description = TEXT_JSON_DESC), @Output(value = EXCEPTION, description = EXCEPTION_DESC), }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = COMPARE_EQUAL, responseType = RESOLVED, description = SUCCESS_DESC), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = COMPARE_EQUAL, responseType = ERROR, isOnFail = true, description = FAILURE_DESC) }) public Map<String, String> execute( @Param(value = FILE_PATH, required = true, description = PDF_FILE_PATH_DESC) String filePath, @Param(value = DATA_PATH, required = true, description = DATA_PATH_DESC) String dataPath, @Param(value = LANGUAGE, required = true, description = LANGUAGE_DESC) String language, @Param(value = DPI, description = DPI_DESC) String dpi, @Param(value = TEXT_BLOCKS, description = TEXT_BLOCKS_DESC) String textBlocks, @Param(value = DESKEW, description = DESKEW_DESC) String deskew, @Param(value = FROM_PAGE, description = FROM_PAGE_DESC) String fromPage, @Param(value = TO_PAGE, description = TO_PAGE_DESC) String toPage, @Param(value = PAGE_INDEX, description = PAGE_INDEX_DESC) String pageIndex) { dataPath = defaultIfEmpty(dataPath, EMPTY); language = defaultIfEmpty(language, ENG); dpi = defaultIfEmpty(dpi, DPI_SET); textBlocks = defaultIfEmpty(textBlocks, FALSE); deskew = defaultIfEmpty(deskew, FALSE); fromPage = defaultIfEmpty(fromPage, EMPTY); toPage = defaultIfEmpty(toPage, EMPTY); pageIndex = defaultIfEmpty(pageIndex, EMPTY); final List<String> exceptionMessages = verifyExtractTextFromPDF(filePath, dataPath, textBlocks, deskew, fromPage, toPage, pageIndex, dpi); if (!exceptionMessages.isEmpty()) { return getFailureResultsMap(StringUtilities.join(exceptionMessages, NEW_LINE)); } try { final String resultText = imageConvert(filePath, dataPath, language, dpi, textBlocks, deskew, fromPage, toPage, pageIndex); final Map<String, String> result = getSuccessResultsMap(resultText); if (Boolean.parseBoolean(textBlocks)) { result.put(TEXT_JSON, resultText); } else { result.put(TEXT_STRING, resultText); } return result; } catch (IndexOutOfBoundsException e) { return getFailureResultsMap(EXCEPTION_EXCEEDS_PAGES); } catch (Exception e) { return getFailureResultsMap(e); } }
[ "@", "Action", "(", "name", "=", "\"Extract text from PDF\"", ",", "description", "=", "EXTRACT_TEXT_FROM_PDF_DESC", ",", "outputs", "=", "{", "@", "Output", "(", "value", "=", "RETURN_CODE", ",", "description", "=", "RETURN_CODE_DESC", ")", ",", "@", "Output", ...
This operation converts a PDF file given as input and extracts the text using Tesseract's OCR library. @param filePath The path of the file to be extracted. The file must be an image. Most of the common image formats are supported. Required @param dataPath The path to the tessdata folder that contains the tesseract config files. Required @param language The language that will be used by the OCR engine. This input is taken into consideration only when specifying the dataPath input as well. Default value: 'ENG' Required @param dpi The DPI value when converting the PDF file to image. Default value: 300 Optional @param textBlocks If set to 'true' operation will return a json containing text blocks extracted from image. Valid values: false, true Default value: false Optional @param deskew Improve text recognition if an image does not have a normal text orientation(skewed image). If set to 'true' the image will be rotated to the correct text orientation. Valid values: false, true Default value: false Optional @param fromPage The starting page from where the text should be retrieved Optional @param toPage The last page from where the text should be retrieved Optional @param pageIndex A list of indexes from where the text should be retrieved Optional @return a map containing the output of the operation. Keys present in the map are: returnResult - This will contain the extracted text. exception - In case of success response, this result is empty. In case of failure response, this result contains the java stack trace of the runtime exception. textString - The extracted text from image. textJson - A json containing extracted blocks of text from image. returnCode - The returnCode of the operation: 0 for success, -1 for failure.
[ "This", "operation", "converts", "a", "PDF", "file", "given", "as", "input", "and", "extracts", "the", "text", "using", "Tesseract", "s", "OCR", "library", "." ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-tesseract/src/main/java/io/cloudslang/content/tesseract/actions/ExtractTextFromPDF.java#L93-L148
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java
CalendarPanel.getMonthOrYearMenuLocation
private Point getMonthOrYearMenuLocation(JLabel sourceLabel, JPopupMenu filledPopupMenu) { Rectangle labelBounds = sourceLabel.getBounds(); int menuHeight = filledPopupMenu.getPreferredSize().height; int popupX = labelBounds.x + labelBounds.width + 1; int popupY = labelBounds.y + (labelBounds.height / 2) - (menuHeight / 2); return new Point(popupX, popupY); }
java
private Point getMonthOrYearMenuLocation(JLabel sourceLabel, JPopupMenu filledPopupMenu) { Rectangle labelBounds = sourceLabel.getBounds(); int menuHeight = filledPopupMenu.getPreferredSize().height; int popupX = labelBounds.x + labelBounds.width + 1; int popupY = labelBounds.y + (labelBounds.height / 2) - (menuHeight / 2); return new Point(popupX, popupY); }
[ "private", "Point", "getMonthOrYearMenuLocation", "(", "JLabel", "sourceLabel", ",", "JPopupMenu", "filledPopupMenu", ")", "{", "Rectangle", "labelBounds", "=", "sourceLabel", ".", "getBounds", "(", ")", ";", "int", "menuHeight", "=", "filledPopupMenu", ".", "getPre...
getMonthOrYearMenuLocation, This calculates the position should be used to set the location of the month or the year popup menus, relative to their source labels. These menus are used to change the current month or current year from within the calendar panel.
[ "getMonthOrYearMenuLocation", "This", "calculates", "the", "position", "should", "be", "used", "to", "set", "the", "location", "of", "the", "month", "or", "the", "year", "popup", "menus", "relative", "to", "their", "source", "labels", ".", "These", "menus", "a...
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java#L899-L905
Whiley/WhileyCompiler
src/main/java/wyil/util/AbstractTypedVisitor.java
AbstractTypedVisitor.selectArray
public Type.Array selectArray(Type target, Expr expr, Environment environment) { Type.Array type = asType(expr.getType(), Type.Array.class); Type.Array[] records = TYPE_ARRAY_FILTER.apply(target); return selectCandidate(records, type, environment); }
java
public Type.Array selectArray(Type target, Expr expr, Environment environment) { Type.Array type = asType(expr.getType(), Type.Array.class); Type.Array[] records = TYPE_ARRAY_FILTER.apply(target); return selectCandidate(records, type, environment); }
[ "public", "Type", ".", "Array", "selectArray", "(", "Type", "target", ",", "Expr", "expr", ",", "Environment", "environment", ")", "{", "Type", ".", "Array", "type", "=", "asType", "(", "expr", ".", "getType", "(", ")", ",", "Type", ".", "Array", ".", ...
<p> Given an arbitrary target type, filter out the target array types. For example, consider the following method: </p> <pre> method f(int x): null|int[] xs = [x] ... </pre> <p> When type checking the expression <code>[x]</code> the flow type checker will attempt to determine an <i>expected</i> array type. In order to then determine the appropriate expected type for expression <code>x</code> it filters <code>null|int[]</code> down to just <code>int[]</code>. </p> @param target Target type for this value @param expr Source expression for this value @author David J. Pearce
[ "<p", ">", "Given", "an", "arbitrary", "target", "type", "filter", "out", "the", "target", "array", "types", ".", "For", "example", "consider", "the", "following", "method", ":", "<", "/", "p", ">" ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/util/AbstractTypedVisitor.java#L1107-L1111
lucee/Lucee
core/src/main/java/lucee/commons/lang/StringUtil.java
StringUtil.replaceMap
private static String replaceMap(String input, Map map, boolean ignoreCase, boolean doResolveInternals) throws PageException { if (doResolveInternals) map = resolveInternals(map, ignoreCase, 0); String result = input; Iterator<Map.Entry> it = map.entrySet().iterator(); Map.Entry e; while (it.hasNext()) { e = it.next(); result = replace(result, Caster.toString(e.getKey()), Caster.toString(e.getValue()), false, ignoreCase); } return result; }
java
private static String replaceMap(String input, Map map, boolean ignoreCase, boolean doResolveInternals) throws PageException { if (doResolveInternals) map = resolveInternals(map, ignoreCase, 0); String result = input; Iterator<Map.Entry> it = map.entrySet().iterator(); Map.Entry e; while (it.hasNext()) { e = it.next(); result = replace(result, Caster.toString(e.getKey()), Caster.toString(e.getValue()), false, ignoreCase); } return result; }
[ "private", "static", "String", "replaceMap", "(", "String", "input", ",", "Map", "map", ",", "boolean", "ignoreCase", ",", "boolean", "doResolveInternals", ")", "throws", "PageException", "{", "if", "(", "doResolveInternals", ")", "map", "=", "resolveInternals", ...
this is the core of the replaceMap() method. it is called once from the public entry point and then internally from resolveInternals() when doResolveInternals is true -- this method calls resolveInternals. therefore, calls from resolveInternals() must pass false to that param to avoid an infinite ping-pong loop @param input - the string on which the replacements should be performed. @param map - a java.util.Map with key/value pairs where the key is the substring to find and the value is the substring with which to replace the matched key @param ignoreCase - if true then matches will not be case sensitive @param doResolveInternals - only the initial call (from the public entry point) should pass true @return @throws PageException
[ "this", "is", "the", "core", "of", "the", "replaceMap", "()", "method", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L1345-L1356
deephacks/confit
provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaRef.java
JpaRef.filterUnwantedReferences
static void filterUnwantedReferences(List<JpaRef> result, Collection<BeanId> query) { ListIterator<JpaRef> it = result.listIterator(); while (it.hasNext()) { // remove reference from result that was not part of the query BeanId found = it.next().getSource(); if (!query.contains(found)) { it.remove(); } } }
java
static void filterUnwantedReferences(List<JpaRef> result, Collection<BeanId> query) { ListIterator<JpaRef> it = result.listIterator(); while (it.hasNext()) { // remove reference from result that was not part of the query BeanId found = it.next().getSource(); if (!query.contains(found)) { it.remove(); } } }
[ "static", "void", "filterUnwantedReferences", "(", "List", "<", "JpaRef", ">", "result", ",", "Collection", "<", "BeanId", ">", "query", ")", "{", "ListIterator", "<", "JpaRef", ">", "it", "=", "result", ".", "listIterator", "(", ")", ";", "while", "(", ...
Beans with different schemaName may have same instance id. The IN search query is greedy, finding instances that match any combination of instance id and schemaName. Hence, the query may find references belonging to wrong schema so filter those out.
[ "Beans", "with", "different", "schemaName", "may", "have", "same", "instance", "id", "." ]
train
https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaRef.java#L148-L157
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java
AdvancedImpl.cellLayout
@Override public final void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) { try { tableForeground = isBg() ? canvases[PdfPTable.BASECANVAS] : canvases[PdfPTable.TEXTCANVAS]; Rectangle box = getValue(USEPADDING, Boolean.class) ? new Rectangle( position.getLeft() + cell.getPaddingLeft(), position.getBottom() + cell.getPaddingBottom(), position.getRight() - cell.getPaddingRight(), position.getTop() - cell.getPaddingTop()) : position; draw(box, null); tableForeground = null; } catch (VectorPrintException ex) { throw new VectorPrintRuntimeException(ex); } }
java
@Override public final void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) { try { tableForeground = isBg() ? canvases[PdfPTable.BASECANVAS] : canvases[PdfPTable.TEXTCANVAS]; Rectangle box = getValue(USEPADDING, Boolean.class) ? new Rectangle( position.getLeft() + cell.getPaddingLeft(), position.getBottom() + cell.getPaddingBottom(), position.getRight() - cell.getPaddingRight(), position.getTop() - cell.getPaddingTop()) : position; draw(box, null); tableForeground = null; } catch (VectorPrintException ex) { throw new VectorPrintRuntimeException(ex); } }
[ "@", "Override", "public", "final", "void", "cellLayout", "(", "PdfPCell", "cell", ",", "Rectangle", "position", ",", "PdfContentByte", "[", "]", "canvases", ")", "{", "try", "{", "tableForeground", "=", "isBg", "(", ")", "?", "canvases", "[", "PdfPTable", ...
An advanced styler may be added as event to a cell by {@link StyleHelper#style(java.lang.Object, java.lang.Object, java.util.Collection) } when the element styled is a table and the {@link EVENTMODE} is ALL or CELL. This enables drawing near a cell. Calls {@link #draw(com.itextpdf.text.Rectangle, java.lang.String) } with the rectangle of the cell and null as genericTag. When {@link #USEPADDING} is true the rectangle is calculated taking cell padding into account. @see EVENTMODE#CELL @param cell @param position @param canvases
[ "An", "advanced", "styler", "may", "be", "added", "as", "event", "to", "a", "cell", "by", "{", "@link", "StyleHelper#style", "(", "java", ".", "lang", ".", "Object", "java", ".", "lang", ".", "Object", "java", ".", "util", ".", "Collection", ")", "}", ...
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java#L417-L431
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/Astar.java
Astar.createPathFinder
public static PathFinder createPathFinder(MapTile map, int maxSearchDistance, Heuristic heuristic) { return new PathFinderImpl(map, maxSearchDistance, heuristic); }
java
public static PathFinder createPathFinder(MapTile map, int maxSearchDistance, Heuristic heuristic) { return new PathFinderImpl(map, maxSearchDistance, heuristic); }
[ "public", "static", "PathFinder", "createPathFinder", "(", "MapTile", "map", ",", "int", "maxSearchDistance", ",", "Heuristic", "heuristic", ")", "{", "return", "new", "PathFinderImpl", "(", "map", ",", "maxSearchDistance", ",", "heuristic", ")", ";", "}" ]
Create a path finder. @param map The map to be searched. Must have the {@link com.b3dgs.lionengine.game.feature.tile.map.pathfinding.MapTilePath} feature. @param maxSearchDistance The maximum depth we'll search before giving up. @param heuristic The heuristic used to determine the search order of the map. @return The path finder instance.
[ "Create", "a", "path", "finder", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/Astar.java#L37-L40
unic/neba
core/src/main/java/io/neba/core/resourcemodels/registration/ModelRegistry.java
ModelRegistry.resolveMostSpecificModelSources
private Collection<LookupResult> resolveMostSpecificModelSources(Resource resource, String modelName) { Collection<LookupResult> sources = new ArrayList<>(); for (final String resourceType : mappableTypeHierarchyOf(resource)) { Collection<OsgiModelSource<?>> allSourcesForType = this.typeNameToModelSourcesMap.get(resourceType); Collection<OsgiModelSource<?>> sourcesWithMatchingModelName = filter(allSourcesForType, modelName); if (sourcesWithMatchingModelName != null && !sourcesWithMatchingModelName.isEmpty()) { sources.addAll(sourcesWithMatchingModelName.stream().map(source -> new LookupResult(source, resourceType)).collect(Collectors.toList())); break; } } return unmodifiableCollection(sources); }
java
private Collection<LookupResult> resolveMostSpecificModelSources(Resource resource, String modelName) { Collection<LookupResult> sources = new ArrayList<>(); for (final String resourceType : mappableTypeHierarchyOf(resource)) { Collection<OsgiModelSource<?>> allSourcesForType = this.typeNameToModelSourcesMap.get(resourceType); Collection<OsgiModelSource<?>> sourcesWithMatchingModelName = filter(allSourcesForType, modelName); if (sourcesWithMatchingModelName != null && !sourcesWithMatchingModelName.isEmpty()) { sources.addAll(sourcesWithMatchingModelName.stream().map(source -> new LookupResult(source, resourceType)).collect(Collectors.toList())); break; } } return unmodifiableCollection(sources); }
[ "private", "Collection", "<", "LookupResult", ">", "resolveMostSpecificModelSources", "(", "Resource", "resource", ",", "String", "modelName", ")", "{", "Collection", "<", "LookupResult", ">", "sources", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", ...
Finds all {@link OsgiModelSource model sources} representing models for the given {@link Resource} who's {@link OsgiModelSource#getModelName() model name} matches the given model name. @param resource must not be <code>null</code>. @param modelName can be <code>null</code>. @return never <code>null</code> but rather an empty collection.
[ "Finds", "all", "{", "@link", "OsgiModelSource", "model", "sources", "}", "representing", "models", "for", "the", "given", "{", "@link", "Resource", "}", "who", "s", "{", "@link", "OsgiModelSource#getModelName", "()", "model", "name", "}", "matches", "the", "g...
train
https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/core/src/main/java/io/neba/core/resourcemodels/registration/ModelRegistry.java#L428-L439
liyiorg/weixin-popular
src/main/java/weixin/popular/api/MaterialAPI.java
MaterialAPI.update_news
public static BaseResult update_news(String access_token,String media_id,int index,List<Article> articles){ return update_news(access_token, media_id, index, JsonUtil.toJSONString(articles)); }
java
public static BaseResult update_news(String access_token,String media_id,int index,List<Article> articles){ return update_news(access_token, media_id, index, JsonUtil.toJSONString(articles)); }
[ "public", "static", "BaseResult", "update_news", "(", "String", "access_token", ",", "String", "media_id", ",", "int", "index", ",", "List", "<", "Article", ">", "articles", ")", "{", "return", "update_news", "(", "access_token", ",", "media_id", ",", "index",...
修改永久图文素材 @param access_token access_token @param media_id 要修改的图文消息的id @param index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0 @param articles articles @return BaseResult
[ "修改永久图文素材" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MaterialAPI.java#L214-L216
Jasig/uPortal
uPortal-portlets/src/main/java/org/apereo/portal/portlets/PortletPreferencesJsonDaoImpl.java
PortletPreferencesJsonDaoImpl.getJsonNode
@Override public JsonNode getJsonNode(PortletPreferences prefs, String key) throws IOException { final String prefValue = StringUtils.trimToNull(prefs.getValue(key, null)); if (prefValue == null) { // Default to an empty object return mapper.createObjectNode(); } return mapper.readTree(prefValue); }
java
@Override public JsonNode getJsonNode(PortletPreferences prefs, String key) throws IOException { final String prefValue = StringUtils.trimToNull(prefs.getValue(key, null)); if (prefValue == null) { // Default to an empty object return mapper.createObjectNode(); } return mapper.readTree(prefValue); }
[ "@", "Override", "public", "JsonNode", "getJsonNode", "(", "PortletPreferences", "prefs", ",", "String", "key", ")", "throws", "IOException", "{", "final", "String", "prefValue", "=", "StringUtils", ".", "trimToNull", "(", "prefs", ".", "getValue", "(", "key", ...
Read the specified portlet preference and parse it as a JSON string into a {@link JsonNode} If the preference is null returns a {@link JSONObject}. @param prefs Preferences to read from @param key Preference key to read from
[ "Read", "the", "specified", "portlet", "preference", "and", "parse", "it", "as", "a", "JSON", "string", "into", "a", "{", "@link", "JsonNode", "}", "If", "the", "preference", "is", "null", "returns", "a", "{", "@link", "JSONObject", "}", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/PortletPreferencesJsonDaoImpl.java#L80-L88
shrinkwrap/descriptors
api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/Descriptors.java
Descriptors.importAs
public static <T extends Descriptor> DescriptorImporter<T> importAs(final Class<T> type) throws IllegalArgumentException { return importAs(type, null); }
java
public static <T extends Descriptor> DescriptorImporter<T> importAs(final Class<T> type) throws IllegalArgumentException { return importAs(type, null); }
[ "public", "static", "<", "T", "extends", "Descriptor", ">", "DescriptorImporter", "<", "T", ">", "importAs", "(", "final", "Class", "<", "T", ">", "type", ")", "throws", "IllegalArgumentException", "{", "return", "importAs", "(", "type", ",", "null", ")", ...
Returns a new {@link DescriptorImporter} instance, ready to import as a new {@link Descriptor} instance of the given type @param type @return @throws IllegalArgumentException If the type is not specified
[ "Returns", "a", "new", "{", "@link", "DescriptorImporter", "}", "instance", "ready", "to", "import", "as", "a", "new", "{", "@link", "Descriptor", "}", "instance", "of", "the", "given", "type" ]
train
https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/Descriptors.java#L81-L84
bmwcarit/joynr
java/messaging/messaging-common/src/main/java/io/joynr/messaging/util/Utilities.java
Utilities.getUrlWithoutSessionId
public static String getUrlWithoutSessionId(String url, String sessionIdName) { if (isSessionEncodedInUrl(url, sessionIdName)) { return url.substring(0, url.indexOf(getSessionIdSubstring(sessionIdName))); } return url; }
java
public static String getUrlWithoutSessionId(String url, String sessionIdName) { if (isSessionEncodedInUrl(url, sessionIdName)) { return url.substring(0, url.indexOf(getSessionIdSubstring(sessionIdName))); } return url; }
[ "public", "static", "String", "getUrlWithoutSessionId", "(", "String", "url", ",", "String", "sessionIdName", ")", "{", "if", "(", "isSessionEncodedInUrl", "(", "url", ",", "sessionIdName", ")", ")", "{", "return", "url", ".", "substring", "(", "0", ",", "ur...
Returns the URL without the session encoded into the URL. @param url the url to de-code @param sessionIdName the name of the session ID, e.g. jsessionid @return url without session id information or url, if no session was encoded into the URL
[ "Returns", "the", "URL", "without", "the", "session", "encoded", "into", "the", "URL", "." ]
train
https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/messaging-common/src/main/java/io/joynr/messaging/util/Utilities.java#L138-L144
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.decodeBytesToChars
@Nonnull public static char [] decodeBytesToChars (@Nonnull final byte [] aByteArray, @Nonnull final Charset aCharset) { return decodeBytesToChars (aByteArray, 0, aByteArray.length, aCharset); }
java
@Nonnull public static char [] decodeBytesToChars (@Nonnull final byte [] aByteArray, @Nonnull final Charset aCharset) { return decodeBytesToChars (aByteArray, 0, aByteArray.length, aCharset); }
[ "@", "Nonnull", "public", "static", "char", "[", "]", "decodeBytesToChars", "(", "@", "Nonnull", "final", "byte", "[", "]", "aByteArray", ",", "@", "Nonnull", "final", "Charset", "aCharset", ")", "{", "return", "decodeBytesToChars", "(", "aByteArray", ",", "...
Decode a byte array to a char array using the provided charset. This does the same as <code>new String (aByteArray, aCharset)</code> just without the intermediate objects. @param aByteArray The byte array to be decoded. May not be <code>null</code>. @param aCharset Charset to be used. May not be <code>null</code>. @return The created char array. Never <code>null</code>. @since 8.6.4
[ "Decode", "a", "byte", "array", "to", "a", "char", "array", "using", "the", "provided", "charset", ".", "This", "does", "the", "same", "as", "<code", ">", "new", "String", "(", "aByteArray", "aCharset", ")", "<", "/", "code", ">", "just", "without", "t...
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5352-L5356
lastaflute/lasta-di
src/main/java/org/lastaflute/di/util/LdiSrl.java
LdiSrl.substringLastFront
public static String substringLastFront(String str, String... delimiters) { assertStringNotNull(str); return doSubstringFirstRear(true, false, false, str, delimiters); }
java
public static String substringLastFront(String str, String... delimiters) { assertStringNotNull(str); return doSubstringFirstRear(true, false, false, str, delimiters); }
[ "public", "static", "String", "substringLastFront", "(", "String", "str", ",", "String", "...", "delimiters", ")", "{", "assertStringNotNull", "(", "str", ")", ";", "return", "doSubstringFirstRear", "(", "true", ",", "false", ",", "false", ",", "str", ",", "...
Extract front sub-string from last-found delimiter. <pre> substringLastFront("foo.bar/baz.qux", ".", "/") returns "foo.bar/baz" </pre> @param str The target string. (NotNull) @param delimiters The array of delimiters. (NotNull) @return The part of string. (NotNull: if delimiter not found, returns argument-plain string)
[ "Extract", "front", "sub", "-", "string", "from", "last", "-", "found", "delimiter", ".", "<pre", ">", "substringLastFront", "(", "foo", ".", "bar", "/", "baz", ".", "qux", ".", "/", ")", "returns", "foo", ".", "bar", "/", "baz", "<", "/", "pre", "...
train
https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L687-L690
dmurph/jgoogleanalyticstracker
src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java
JGoogleAnalyticsTracker.trackEvent
public void trackEvent(String argCategory, String argAction, String argLabel) { trackEvent(argCategory, argAction, argLabel, null); }
java
public void trackEvent(String argCategory, String argAction, String argLabel) { trackEvent(argCategory, argAction, argLabel, null); }
[ "public", "void", "trackEvent", "(", "String", "argCategory", ",", "String", "argAction", ",", "String", "argLabel", ")", "{", "trackEvent", "(", "argCategory", ",", "argAction", ",", "argLabel", ",", "null", ")", ";", "}" ]
Tracks an event. To provide more info about the page, use {@link #makeCustomRequest(AnalyticsRequestData)}. @param argCategory @param argAction @param argLabel
[ "Tracks", "an", "event", ".", "To", "provide", "more", "info", "about", "the", "page", "use", "{", "@link", "#makeCustomRequest", "(", "AnalyticsRequestData", ")", "}", "." ]
train
https://github.com/dmurph/jgoogleanalyticstracker/blob/69f68caf8e09a53e6f6076477bf05b84bc80e386/src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java#L376-L378
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java
ClusterLocator.locateCluster
public void locateCluster(String cluster, Handler<AsyncResult<String>> doneHandler) { Set<String> registry = vertx.sharedData().getSet(cluster); synchronized (registry) { if (!registry.isEmpty()) { locateNode(cluster, new HashSet<>(registry), doneHandler); } } }
java
public void locateCluster(String cluster, Handler<AsyncResult<String>> doneHandler) { Set<String> registry = vertx.sharedData().getSet(cluster); synchronized (registry) { if (!registry.isEmpty()) { locateNode(cluster, new HashSet<>(registry), doneHandler); } } }
[ "public", "void", "locateCluster", "(", "String", "cluster", ",", "Handler", "<", "AsyncResult", "<", "String", ">", ">", "doneHandler", ")", "{", "Set", "<", "String", ">", "registry", "=", "vertx", ".", "sharedData", "(", ")", ".", "getSet", "(", "clus...
Locates the local address of the nearest node if one exists. @param cluster The cluster in which to search for the node. @param doneHandler A handler to be called once the address has been located.
[ "Locates", "the", "local", "address", "of", "the", "nearest", "node", "if", "one", "exists", "." ]
train
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java#L47-L54
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateMethods
public static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes) { return candidateMethods(collectMethods(clazz, name), argTypes); }
java
public static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes) { return candidateMethods(collectMethods(clazz, name), argTypes); }
[ "public", "static", "Method", "[", "]", "candidateMethods", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "{", "return", "candidateMethods", "(", "collectMethods", "(", "clazz", ",", ...
Finds the best equally-matching methods for the given argument types. @param clazz @param name @param argTypes @return methods
[ "Finds", "the", "best", "equally", "-", "matching", "methods", "for", "the", "given", "argument", "types", "." ]
train
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L187-L189
spring-projects/spring-mobile
spring-mobile-autoconfigure/src/main/java/org/springframework/mobile/autoconfigure/DeviceDelegatingViewResolverFactory.java
DeviceDelegatingViewResolverFactory.createViewResolver
public LiteDeviceDelegatingViewResolver createViewResolver(ViewResolver delegate) { if (!(delegate instanceof Ordered)) { throw new IllegalStateException("ViewResolver " + delegate + " should implement " + Ordered.class.getName()); } int delegateOrder = ((Ordered) delegate).getOrder(); return createViewResolver(delegate, adjustOrder(delegateOrder)); }
java
public LiteDeviceDelegatingViewResolver createViewResolver(ViewResolver delegate) { if (!(delegate instanceof Ordered)) { throw new IllegalStateException("ViewResolver " + delegate + " should implement " + Ordered.class.getName()); } int delegateOrder = ((Ordered) delegate).getOrder(); return createViewResolver(delegate, adjustOrder(delegateOrder)); }
[ "public", "LiteDeviceDelegatingViewResolver", "createViewResolver", "(", "ViewResolver", "delegate", ")", "{", "if", "(", "!", "(", "delegate", "instanceof", "Ordered", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"ViewResolver \"", "+", "delegate", ...
Create a {@link LiteDeviceDelegatingViewResolver} delegating to the specified {@link ViewResolver} and computing a sensible order for it. The specified {@link ViewResolver} should implement {@link Ordered}, consider using {@link #createViewResolver(ViewResolver, int)} if that's not the case. @param delegate the view resolver to delegate to @return a {@link LiteDeviceDelegatingViewResolver} handling the specified resolver
[ "Create", "a", "{" ]
train
https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-autoconfigure/src/main/java/org/springframework/mobile/autoconfigure/DeviceDelegatingViewResolverFactory.java#L69-L76
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.restoreSecretAsync
public ServiceFuture<SecretBundle> restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup, final ServiceCallback<SecretBundle> serviceCallback) { return ServiceFuture.fromResponse(restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup), serviceCallback); }
java
public ServiceFuture<SecretBundle> restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup, final ServiceCallback<SecretBundle> serviceCallback) { return ServiceFuture.fromResponse(restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup), serviceCallback); }
[ "public", "ServiceFuture", "<", "SecretBundle", ">", "restoreSecretAsync", "(", "String", "vaultBaseUrl", ",", "byte", "[", "]", "secretBundleBackup", ",", "final", "ServiceCallback", "<", "SecretBundle", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ...
Restores a backed up secret to a vault. Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param secretBundleBackup The backup blob associated with a secret bundle. @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceFuture} object
[ "Restores", "a", "backed", "up", "secret", "to", "a", "vault", ".", "Restores", "a", "backed", "up", "secret", "and", "all", "its", "versions", "to", "a", "vault", ".", "This", "operation", "requires", "the", "secrets", "/", "restore", "permission", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5008-L5010
phax/ph-web
ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponseDefaultSettings.java
UnifiedResponseDefaultSettings.addResponseHeader
public static void addResponseHeader (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue) { ValueEnforcer.notEmpty (sName, "Name"); ValueEnforcer.notEmpty (sValue, "Value"); s_aRWLock.writeLocked ( () -> s_aResponseHeaderMap.addHeader (sName, sValue)); }
java
public static void addResponseHeader (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue) { ValueEnforcer.notEmpty (sName, "Name"); ValueEnforcer.notEmpty (sValue, "Value"); s_aRWLock.writeLocked ( () -> s_aResponseHeaderMap.addHeader (sName, sValue)); }
[ "public", "static", "void", "addResponseHeader", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sName", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sValue", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sName", ",", "\"Name\"", "...
Adds a response header to the response according to the passed name and value. If an existing header with the same is present, the value is added to the list so that the header is emitted more than once. @param sName Name of the header. May neither be <code>null</code> nor empty. @param sValue Value of the header. May neither be <code>null</code> nor empty.
[ "Adds", "a", "response", "header", "to", "the", "response", "according", "to", "the", "passed", "name", "and", "value", ".", "If", "an", "existing", "header", "with", "the", "same", "is", "present", "the", "value", "is", "added", "to", "the", "list", "so...
train
https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponseDefaultSettings.java#L236-L242
dickschoeller/gedbrowser
gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java
FamilyBuilderImpl.addWifeToFamily
public Wife addWifeToFamily(final Family family, final Person person) { if (family == null || person == null) { return new Wife(); } final FamS famS = new FamS(person, "FAMS", new ObjectId(family.getString())); final Wife wife = new Wife(family, "Wife", new ObjectId(person.getString())); family.insert(wife); person.insert(famS); return wife; }
java
public Wife addWifeToFamily(final Family family, final Person person) { if (family == null || person == null) { return new Wife(); } final FamS famS = new FamS(person, "FAMS", new ObjectId(family.getString())); final Wife wife = new Wife(family, "Wife", new ObjectId(person.getString())); family.insert(wife); person.insert(famS); return wife; }
[ "public", "Wife", "addWifeToFamily", "(", "final", "Family", "family", ",", "final", "Person", "person", ")", "{", "if", "(", "family", "==", "null", "||", "person", "==", "null", ")", "{", "return", "new", "Wife", "(", ")", ";", "}", "final", "FamS", ...
Add a person as the wife in a family. @param family the family @param person the person @return the wife object
[ "Add", "a", "person", "as", "the", "wife", "in", "a", "family", "." ]
train
https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L121-L132
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java
RegionDiskClient.insertRegionDisk
@BetaApi public final Operation insertRegionDisk(ProjectRegionName region, Disk diskResource) { InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder() .setRegion(region == null ? null : region.toString()) .setDiskResource(diskResource) .build(); return insertRegionDisk(request); }
java
@BetaApi public final Operation insertRegionDisk(ProjectRegionName region, Disk diskResource) { InsertRegionDiskHttpRequest request = InsertRegionDiskHttpRequest.newBuilder() .setRegion(region == null ? null : region.toString()) .setDiskResource(diskResource) .build(); return insertRegionDisk(request); }
[ "@", "BetaApi", "public", "final", "Operation", "insertRegionDisk", "(", "ProjectRegionName", "region", ",", "Disk", "diskResource", ")", "{", "InsertRegionDiskHttpRequest", "request", "=", "InsertRegionDiskHttpRequest", ".", "newBuilder", "(", ")", ".", "setRegion", ...
Creates a persistent regional disk in the specified project using the data included in the request. <p>Sample code: <pre><code> try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) { ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); Disk diskResource = Disk.newBuilder().build(); Operation response = regionDiskClient.insertRegionDisk(region, diskResource); } </code></pre> @param region Name of the region for this request. @param diskResource A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==) @throws com.google.api.gax.rpc.ApiException if the remote call fails
[ "Creates", "a", "persistent", "regional", "disk", "in", "the", "specified", "project", "using", "the", "data", "included", "in", "the", "request", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java#L489-L498
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/rfc5626/RFC5626Helper.java
RFC5626Helper.decodeFlowToken
private static HopImpl decodeFlowToken(String user) throws IncorrectFlowIdentifierException { if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token " + user); } byte[] byteConcat = Base64.decodeBase64(user.getBytes()); if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token byteContact after base64 decoding is " + new String(byteConcat).trim()); } String concatenation = new String(byteConcat); int indexOfSlash = concatenation.indexOf("/"); String hmac = concatenation.substring(0, indexOfSlash); String arrayS = concatenation.substring(indexOfSlash + 1, concatenation.length()); if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token recomputing hmac of array S " + arrayS); } byte[] recomputedHmac = mac.doFinal(arrayS.trim().getBytes()); if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token recomputed Hmac" + recomputedHmac); } recomputedHmac = new String(recomputedHmac).trim().getBytes(); if(!Arrays.equals(hmac.trim().getBytes(),recomputedHmac)) { throw new IncorrectFlowIdentifierException("hmac " + hmac + " is different from the recomputed hmac " + new String(recomputedHmac).trim()); } StringTokenizer stringTokenizer = new StringTokenizer(arrayS, "_"); String transport = stringTokenizer.nextToken(); stringTokenizer.nextToken(); stringTokenizer.nextToken(); String initialRemoteAddress = stringTokenizer.nextToken(); int initialRemotePort = Integer.parseInt(stringTokenizer.nextToken()); return new HopImpl(initialRemoteAddress, initialRemotePort, transport); }
java
private static HopImpl decodeFlowToken(String user) throws IncorrectFlowIdentifierException { if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token " + user); } byte[] byteConcat = Base64.decodeBase64(user.getBytes()); if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token byteContact after base64 decoding is " + new String(byteConcat).trim()); } String concatenation = new String(byteConcat); int indexOfSlash = concatenation.indexOf("/"); String hmac = concatenation.substring(0, indexOfSlash); String arrayS = concatenation.substring(indexOfSlash + 1, concatenation.length()); if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token recomputing hmac of array S " + arrayS); } byte[] recomputedHmac = mac.doFinal(arrayS.trim().getBytes()); if(logger.isDebugEnabled()) { logger.debug("Decoding RFC 5626 Flow token recomputed Hmac" + recomputedHmac); } recomputedHmac = new String(recomputedHmac).trim().getBytes(); if(!Arrays.equals(hmac.trim().getBytes(),recomputedHmac)) { throw new IncorrectFlowIdentifierException("hmac " + hmac + " is different from the recomputed hmac " + new String(recomputedHmac).trim()); } StringTokenizer stringTokenizer = new StringTokenizer(arrayS, "_"); String transport = stringTokenizer.nextToken(); stringTokenizer.nextToken(); stringTokenizer.nextToken(); String initialRemoteAddress = stringTokenizer.nextToken(); int initialRemotePort = Integer.parseInt(stringTokenizer.nextToken()); return new HopImpl(initialRemoteAddress, initialRemotePort, transport); }
[ "private", "static", "HopImpl", "decodeFlowToken", "(", "String", "user", ")", "throws", "IncorrectFlowIdentifierException", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Decoding RFC 5626 Flow token \"", "+", ...
/* Excerpt from RFC 5626 Section 5.3.1 Proxies that used the example algorithm described in Section 5.2 to form a flow token follow the procedures below to determine the correct flow. To decode the flow token, take the flow identifier in the user portion of the URI and base64 decode it, then verify the HMAC is correct by recomputing the HMAC and checking that it matches. If the HMAC is not correct, the request has been tampered with.
[ "/", "*", "Excerpt", "from", "RFC", "5626", "Section", "5", ".", "3", ".", "1", "Proxies", "that", "used", "the", "example", "algorithm", "described", "in", "Section", "5", ".", "2", "to", "form", "a", "flow", "token", "follow", "the", "procedures", "b...
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/rfc5626/RFC5626Helper.java#L231-L261
Impetus/Kundera
src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java
DocumentIndexer.getKunderaId
protected String getKunderaId(EntityMetadata metadata, Object id) { return metadata.getEntityClazz().getCanonicalName() + IndexingConstants.DELIMETER + id; }
java
protected String getKunderaId(EntityMetadata metadata, Object id) { return metadata.getEntityClazz().getCanonicalName() + IndexingConstants.DELIMETER + id; }
[ "protected", "String", "getKunderaId", "(", "EntityMetadata", "metadata", ",", "Object", "id", ")", "{", "return", "metadata", ".", "getEntityClazz", "(", ")", ".", "getCanonicalName", "(", ")", "+", "IndexingConstants", ".", "DELIMETER", "+", "id", ";", "}" ]
Gets the kundera id. @param metadata the metadata @param id the id @return the kundera id
[ "Gets", "the", "kundera", "id", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java#L464-L466
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java
Utils.compareStrings
public static boolean compareStrings(String s1, String s2) { if (s1 == s2) return true; if (s1 != null && s2 != null && s1.equals(s2)) return true; return false; }
java
public static boolean compareStrings(String s1, String s2) { if (s1 == s2) return true; if (s1 != null && s2 != null && s1.equals(s2)) return true; return false; }
[ "public", "static", "boolean", "compareStrings", "(", "String", "s1", ",", "String", "s2", ")", "{", "if", "(", "s1", "==", "s2", ")", "return", "true", ";", "if", "(", "s1", "!=", "null", "&&", "s2", "!=", "null", "&&", "s1", ".", "equals", "(", ...
Compares two strings for equality. Either or both of the values may be null. @param s1 @param s2 @return true iff the two strings are equal
[ "Compares", "two", "strings", "for", "equality", ".", "Either", "or", "both", "of", "the", "values", "may", "be", "null", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java#L46-L52
gallandarakhneorg/afc
core/util/src/main/java/org/arakhne/afc/progress/DefaultProgression.java
DefaultProgression.disconnectSubTask
void disconnectSubTask(SubProgressionModel subTask, double value, boolean overwriteComment) { if (this.child == subTask) { if (overwriteComment) { final String cmt = subTask.getComment(); if (cmt != null) { this.comment = cmt; } } this.child = null; setProperties(value, this.min, this.max, this.isAdjusting, this.comment, overwriteComment, true, false, null); } }
java
void disconnectSubTask(SubProgressionModel subTask, double value, boolean overwriteComment) { if (this.child == subTask) { if (overwriteComment) { final String cmt = subTask.getComment(); if (cmt != null) { this.comment = cmt; } } this.child = null; setProperties(value, this.min, this.max, this.isAdjusting, this.comment, overwriteComment, true, false, null); } }
[ "void", "disconnectSubTask", "(", "SubProgressionModel", "subTask", ",", "double", "value", ",", "boolean", "overwriteComment", ")", "{", "if", "(", "this", ".", "child", "==", "subTask", ")", "{", "if", "(", "overwriteComment", ")", "{", "final", "String", ...
Set the parent value and disconnect this subtask from its parent. This method is invoked from a subtask. @param subTask the subtask to disconnect. @param value the value of the task. @param overwriteComment indicates if the comment of this parent model may be overwritten by the child's comment.
[ "Set", "the", "parent", "value", "and", "disconnect", "this", "subtask", "from", "its", "parent", ".", "This", "method", "is", "invoked", "from", "a", "subtask", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/progress/DefaultProgression.java#L398-L409
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(RegionId regionId, String subnetwork) { return new SubnetworkId(regionId.getProject(), regionId.getRegion(), subnetwork); }
java
public static SubnetworkId of(RegionId regionId, String subnetwork) { return new SubnetworkId(regionId.getProject(), regionId.getRegion(), subnetwork); }
[ "public", "static", "SubnetworkId", "of", "(", "RegionId", "regionId", ",", "String", "subnetwork", ")", "{", "return", "new", "SubnetworkId", "(", "regionId", ".", "getProject", "(", ")", ",", "regionId", ".", "getRegion", "(", ")", ",", "subnetwork", ")", ...
Returns a subnetwork identity given the region identity and the subnetwork name. 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 characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. @see <a href="https://www.ietf.org/rfc/rfc1035.txt">RFC1035</a>
[ "Returns", "a", "subnetwork", "identity", "given", "the", "region", "identity", "and", "the", "subnetwork", "name", ".", "The", "subnetwork", "name", "must", "be", "1", "-", "63", "characters", "long", "and", "comply", "with", "RFC1035", ".", "Specifically", ...
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#L127-L129
bbossgroups/bboss-elasticsearch
bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java
RestClientUtil.addDateMapDocument
public String addDateMapDocument(String indexName, Map bean) throws ElasticSearchException{ return addDateMapDocument( indexName, _doc, bean); }
java
public String addDateMapDocument(String indexName, Map bean) throws ElasticSearchException{ return addDateMapDocument( indexName, _doc, bean); }
[ "public", "String", "addDateMapDocument", "(", "String", "indexName", ",", "Map", "bean", ")", "throws", "ElasticSearchException", "{", "return", "addDateMapDocument", "(", "indexName", ",", "_doc", ",", "bean", ")", ";", "}" ]
创建或者更新索引文档 For Elasticsearch 7 and 7+ @param indexName @param bean @return @throws ElasticSearchException
[ "创建或者更新索引文档", "For", "Elasticsearch", "7", "and", "7", "+" ]
train
https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L4427-L4429
graknlabs/grakn
server/src/graql/analytics/CommonOLAP.java
CommonOLAP.loadState
public void loadState(final Graph graph, final Configuration configuration) { // load selected types configuration.subset(PREFIX_SELECTED_TYPE_KEY).getKeys().forEachRemaining(key -> selectedTypes.add((LabelId) configuration.getProperty(PREFIX_SELECTED_TYPE_KEY + "." + key))); // load user specified properties configuration.subset(PREFIX_PERSISTENT_PROPERTIES).getKeys().forEachRemaining(key -> persistentProperties.put(key, configuration.getProperty(PREFIX_PERSISTENT_PROPERTIES + "." + key))); }
java
public void loadState(final Graph graph, final Configuration configuration) { // load selected types configuration.subset(PREFIX_SELECTED_TYPE_KEY).getKeys().forEachRemaining(key -> selectedTypes.add((LabelId) configuration.getProperty(PREFIX_SELECTED_TYPE_KEY + "." + key))); // load user specified properties configuration.subset(PREFIX_PERSISTENT_PROPERTIES).getKeys().forEachRemaining(key -> persistentProperties.put(key, configuration.getProperty(PREFIX_PERSISTENT_PROPERTIES + "." + key))); }
[ "public", "void", "loadState", "(", "final", "Graph", "graph", ",", "final", "Configuration", "configuration", ")", "{", "// load selected types", "configuration", ".", "subset", "(", "PREFIX_SELECTED_TYPE_KEY", ")", ".", "getKeys", "(", ")", ".", "forEachRemaining"...
Load <code>persistentProperties</code> and any hard coded fields from an apache config object for use by the spark executor. @param graph the tinker graph @param configuration the apache config object containing the values
[ "Load", "<code", ">", "persistentProperties<", "/", "code", ">", "and", "any", "hard", "coded", "fields", "from", "an", "apache", "config", "object", "for", "use", "by", "the", "spark", "executor", "." ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/analytics/CommonOLAP.java#L83-L91
LearnLib/automatalib
util/src/main/java/net/automatalib/util/minimizer/TransitionLabel.java
TransitionLabel.addToBucket
public boolean addToBucket(State<S, EP> state) { boolean first = false; if (bucket.isEmpty()) { first = true; } bucket.pushBack(state); return first; }
java
public boolean addToBucket(State<S, EP> state) { boolean first = false; if (bucket.isEmpty()) { first = true; } bucket.pushBack(state); return first; }
[ "public", "boolean", "addToBucket", "(", "State", "<", "S", ",", "EP", ">", "state", ")", "{", "boolean", "first", "=", "false", ";", "if", "(", "bucket", ".", "isEmpty", "(", ")", ")", "{", "first", "=", "true", ";", "}", "bucket", ".", "pushBack"...
Adds a state to this label's bucket. @param state the state to be added to the bucket. @return <code>true</code> if this is the first state to be added to the bucket, <code>false</code> otherwise.
[ "Adds", "a", "state", "to", "this", "label", "s", "bucket", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/minimizer/TransitionLabel.java#L75-L84
bluelinelabs/LoganSquare
core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java
LoganSquare.mapperFor
@SuppressWarnings("unchecked") public static <E> JsonMapper<E> mapperFor(ParameterizedType<E> type) throws NoSuchMapperException { return mapperFor(type, null); }
java
@SuppressWarnings("unchecked") public static <E> JsonMapper<E> mapperFor(ParameterizedType<E> type) throws NoSuchMapperException { return mapperFor(type, null); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "E", ">", "JsonMapper", "<", "E", ">", "mapperFor", "(", "ParameterizedType", "<", "E", ">", "type", ")", "throws", "NoSuchMapperException", "{", "return", "mapperFor", "(", "type", ...
Returns a JsonMapper for a given class that has been annotated with @JsonObject. @param type The ParameterizedType for which the JsonMapper should be fetched.
[ "Returns", "a", "JsonMapper", "for", "a", "given", "class", "that", "has", "been", "annotated", "with", "@JsonObject", "." ]
train
https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L315-L318
astrapi69/jaulp-wicket
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java
AjaxAddableTabbedPanel.onNewTab
public void onNewTab(final AjaxRequestTarget target, final T tab, final int index) { if ((index < 0) || (index >= getTabs().size())) { throw new IndexOutOfBoundsException(); } getTabs().add(index, tab); setSelectedTab(index); target.add(this); }
java
public void onNewTab(final AjaxRequestTarget target, final T tab, final int index) { if ((index < 0) || (index >= getTabs().size())) { throw new IndexOutOfBoundsException(); } getTabs().add(index, tab); setSelectedTab(index); target.add(this); }
[ "public", "void", "onNewTab", "(", "final", "AjaxRequestTarget", "target", ",", "final", "T", "tab", ",", "final", "int", "index", ")", "{", "if", "(", "(", "index", "<", "0", ")", "||", "(", "index", ">=", "getTabs", "(", ")", ".", "size", "(", ")...
On new tab. @param target the target @param tab the tab @param index the index
[ "On", "new", "tab", "." ]
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java#L733-L742
indeedeng/util
urlparsing/src/main/java/com/indeed/util/urlparsing/ParseUtils.java
ParseUtils.parseInt
public static int parseInt(String s, final int start, final int end) throws NumberFormatException { return parseSignedInt(s, start, end); }
java
public static int parseInt(String s, final int start, final int end) throws NumberFormatException { return parseSignedInt(s, start, end); }
[ "public", "static", "int", "parseInt", "(", "String", "s", ",", "final", "int", "start", ",", "final", "int", "end", ")", "throws", "NumberFormatException", "{", "return", "parseSignedInt", "(", "s", ",", "start", ",", "end", ")", ";", "}" ]
Parses out an int value from the provided string, equivalent to Integer.parseInt(s.substring(start, end)), but has significantly less overhead, no object creation and later garbage collection required
[ "Parses", "out", "an", "int", "value", "from", "the", "provided", "string", "equivalent", "to", "Integer", ".", "parseInt", "(", "s", ".", "substring", "(", "start", "end", "))", "but", "has", "significantly", "less", "overhead", "no", "object", "creation", ...
train
https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/urlparsing/src/main/java/com/indeed/util/urlparsing/ParseUtils.java#L21-L23
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
FlowControllerFactory.getPageFlowForRelativeURI
public static PageFlowController getPageFlowForRelativeURI( HttpServletRequest request, HttpServletResponse response, String path, ServletContext servletContext ) { try { return get( servletContext ).getPageFlowForPath( new RequestContext( request, response ), path ); } catch ( InstantiationException e ) { LOG.error( "Could not instantiate PageFlowController for request " + request.getRequestURI(), e ); return null; } catch ( IllegalAccessException e ) { LOG.error( "Could not instantiate PageFlowController for request " + request.getRequestURI(), e ); return null; } }
java
public static PageFlowController getPageFlowForRelativeURI( HttpServletRequest request, HttpServletResponse response, String path, ServletContext servletContext ) { try { return get( servletContext ).getPageFlowForPath( new RequestContext( request, response ), path ); } catch ( InstantiationException e ) { LOG.error( "Could not instantiate PageFlowController for request " + request.getRequestURI(), e ); return null; } catch ( IllegalAccessException e ) { LOG.error( "Could not instantiate PageFlowController for request " + request.getRequestURI(), e ); return null; } }
[ "public", "static", "PageFlowController", "getPageFlowForRelativeURI", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "String", "path", ",", "ServletContext", "servletContext", ")", "{", "try", "{", "return", "get", "(", "servletConte...
Get the page flow instance that should be associated with the given path. If it doesn't exist, create it. If one is created, the page flow stack (for nesting) will be cleared or pushed, and the new instance will be stored as the current page flow. @deprecated Use {@link #getPageFlowForPath(RequestContext, String)} instead. @param request the current HttpServletRequest. @param response the current HttpServletResponse. @param path a <strong>webapp-relative</strong> path. The path should not contain the webapp context path. @param servletContext the current ServletContext. @return the {@link PageFlowController} for the given path, or <code>null</code> if none was found.
[ "Get", "the", "page", "flow", "instance", "that", "should", "be", "associated", "with", "the", "given", "path", ".", "If", "it", "doesn", "t", "exist", "create", "it", ".", "If", "one", "is", "created", "the", "page", "flow", "stack", "(", "for", "nest...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L608-L627
jakenjarvis/Android-OrmLiteContentProvider
ormlite-content-provider-library/src/com/tojc/ormlite/android/framework/MatcherPattern.java
MatcherPattern.setContentMimeTypeVnd
public MatcherPattern setContentMimeTypeVnd(ContentMimeTypeVndInfo contentMimeTypeVndInfo) { if (this.initialized) { throw new IllegalStateException("Can't change the settings after initialization."); } this.contentMimeTypeVndInfo = contentMimeTypeVndInfo; this.mimeTypeVnd = new MimeTypeVnd(this.subType, this.contentMimeTypeVndInfo); return this; }
java
public MatcherPattern setContentMimeTypeVnd(ContentMimeTypeVndInfo contentMimeTypeVndInfo) { if (this.initialized) { throw new IllegalStateException("Can't change the settings after initialization."); } this.contentMimeTypeVndInfo = contentMimeTypeVndInfo; this.mimeTypeVnd = new MimeTypeVnd(this.subType, this.contentMimeTypeVndInfo); return this; }
[ "public", "MatcherPattern", "setContentMimeTypeVnd", "(", "ContentMimeTypeVndInfo", "contentMimeTypeVndInfo", ")", "{", "if", "(", "this", ".", "initialized", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Can't change the settings after initialization.\"", ")", ...
Set the MIME types. This is used when you are not using the DefaultContentMimeTypeVnd annotation, or want to override the setting of the DefaultContentMimeTypeVnd annotation. This method can not be called after MatcherController#hasPreinitialized(). @see com.tojc.ormlite.android.annotation.info.ContentMimeTypeVndInfo @see com.tojc.ormlite.android.annotation.AdditionalAnnotation.DefaultContentMimeTypeVnd @see com.tojc.ormlite.android.framework.MatcherController#hasPreinitialized() @param contentMimeTypeVndInfo @return Instance of the MatcherPattern class.
[ "Set", "the", "MIME", "types", ".", "This", "is", "used", "when", "you", "are", "not", "using", "the", "DefaultContentMimeTypeVnd", "annotation", "or", "want", "to", "override", "the", "setting", "of", "the", "DefaultContentMimeTypeVnd", "annotation", ".", "This...
train
https://github.com/jakenjarvis/Android-OrmLiteContentProvider/blob/8f102f0743b308c9f58d43639e98f832fd951985/ormlite-content-provider-library/src/com/tojc/ormlite/android/framework/MatcherPattern.java#L170-L177
atomix/atomix
utils/src/main/java/io/atomix/utils/Generics.java
Generics.getGenericInterfaceType
public static Type getGenericInterfaceType(Object instance, Class<?> iface, int position) { Class<?> type = instance.getClass(); while (type != Object.class) { for (Type genericType : type.getGenericInterfaces()) { if (genericType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) genericType; if (parameterizedType.getRawType() == iface) { return parameterizedType.getActualTypeArguments()[position]; } } } type = type.getSuperclass(); } return null; }
java
public static Type getGenericInterfaceType(Object instance, Class<?> iface, int position) { Class<?> type = instance.getClass(); while (type != Object.class) { for (Type genericType : type.getGenericInterfaces()) { if (genericType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) genericType; if (parameterizedType.getRawType() == iface) { return parameterizedType.getActualTypeArguments()[position]; } } } type = type.getSuperclass(); } return null; }
[ "public", "static", "Type", "getGenericInterfaceType", "(", "Object", "instance", ",", "Class", "<", "?", ">", "iface", ",", "int", "position", ")", "{", "Class", "<", "?", ">", "type", "=", "instance", ".", "getClass", "(", ")", ";", "while", "(", "ty...
Returns the generic type at the given position for the given interface. @param instance the implementing instance @param iface the generic interface @param position the generic position @return the generic type at the given position
[ "Returns", "the", "generic", "type", "at", "the", "given", "position", "for", "the", "given", "interface", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/Generics.java#L59-L73
probedock/probedock-java
src/main/java/io/probedock/client/core/filters/FilterTargetData.java
FilterTargetData.mergeTags
private static String mergeTags(ProbeTest mAnnotation, ProbeTestClass cAnnotation) { List<String> tags = new ArrayList<>(); if (mAnnotation != null) { tags.addAll(Arrays.asList(mAnnotation.tags())); } if (cAnnotation != null) { tags.addAll(Arrays.asList(cAnnotation.tags())); } return Arrays.toString(tags.toArray(new String[tags.size()])); }
java
private static String mergeTags(ProbeTest mAnnotation, ProbeTestClass cAnnotation) { List<String> tags = new ArrayList<>(); if (mAnnotation != null) { tags.addAll(Arrays.asList(mAnnotation.tags())); } if (cAnnotation != null) { tags.addAll(Arrays.asList(cAnnotation.tags())); } return Arrays.toString(tags.toArray(new String[tags.size()])); }
[ "private", "static", "String", "mergeTags", "(", "ProbeTest", "mAnnotation", ",", "ProbeTestClass", "cAnnotation", ")", "{", "List", "<", "String", ">", "tags", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "mAnnotation", "!=", "null", ")", "{",...
Create a string containing all the tags from method and class annotations @param mAnnotation Method annotation @param cAnnotation Class annotation @return The string of tags
[ "Create", "a", "string", "containing", "all", "the", "tags", "from", "method", "and", "class", "annotations" ]
train
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/core/filters/FilterTargetData.java#L167-L179
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/ascii/rest/HttpCommand.java
HttpCommand.setResponse
public void setResponse(byte[] contentType, byte[] value) { int valueSize = (value == null) ? 0 : value.length; byte[] len = stringToBytes(String.valueOf(valueSize)); int size = RES_200.length; if (contentType != null) { size += CONTENT_TYPE.length; size += contentType.length; size += TextCommandConstants.RETURN.length; } size += CONTENT_LENGTH.length; size += len.length; size += TextCommandConstants.RETURN.length; size += TextCommandConstants.RETURN.length; size += valueSize; this.response = ByteBuffer.allocate(size); response.put(RES_200); if (contentType != null) { response.put(CONTENT_TYPE); response.put(contentType); response.put(TextCommandConstants.RETURN); } response.put(CONTENT_LENGTH); response.put(len); response.put(TextCommandConstants.RETURN); response.put(TextCommandConstants.RETURN); if (value != null) { response.put(value); } response.flip(); }
java
public void setResponse(byte[] contentType, byte[] value) { int valueSize = (value == null) ? 0 : value.length; byte[] len = stringToBytes(String.valueOf(valueSize)); int size = RES_200.length; if (contentType != null) { size += CONTENT_TYPE.length; size += contentType.length; size += TextCommandConstants.RETURN.length; } size += CONTENT_LENGTH.length; size += len.length; size += TextCommandConstants.RETURN.length; size += TextCommandConstants.RETURN.length; size += valueSize; this.response = ByteBuffer.allocate(size); response.put(RES_200); if (contentType != null) { response.put(CONTENT_TYPE); response.put(contentType); response.put(TextCommandConstants.RETURN); } response.put(CONTENT_LENGTH); response.put(len); response.put(TextCommandConstants.RETURN); response.put(TextCommandConstants.RETURN); if (value != null) { response.put(value); } response.flip(); }
[ "public", "void", "setResponse", "(", "byte", "[", "]", "contentType", ",", "byte", "[", "]", "value", ")", "{", "int", "valueSize", "=", "(", "value", "==", "null", ")", "?", "0", ":", "value", ".", "length", ";", "byte", "[", "]", "len", "=", "...
HTTP/1.0 200 OK Date: Fri, 31 Dec 1999 23:59:59 GMT Content-TextCommandType: text/html Content-Length: 1354 @param contentType @param value
[ "HTTP", "/", "1", ".", "0", "200", "OK", "Date", ":", "Fri", "31", "Dec", "1999", "23", ":", "59", ":", "59", "GMT", "Content", "-", "TextCommandType", ":", "text", "/", "html", "Content", "-", "Length", ":", "1354" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/ascii/rest/HttpCommand.java#L150-L179
ops4j/org.ops4j.pax.web
pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/util/DOMJettyWebXmlParser.java
DOMJettyWebXmlParser.propertyObj
private Object propertyObj(Object obj, Element node) throws Exception { String id = getAttribute(node, "id"); String name = getAttribute(node, "name"); String defval = getAttribute(node, "default"); Object prop = null; if (_propertyMap != null && _propertyMap.containsKey(name)) { prop = _propertyMap.get(name); } else { prop = defval; } if (id != null) { _idMap.put(id, prop); } if (prop != null) { configure(prop, node, 0); } return prop; }
java
private Object propertyObj(Object obj, Element node) throws Exception { String id = getAttribute(node, "id"); String name = getAttribute(node, "name"); String defval = getAttribute(node, "default"); Object prop = null; if (_propertyMap != null && _propertyMap.containsKey(name)) { prop = _propertyMap.get(name); } else { prop = defval; } if (id != null) { _idMap.put(id, prop); } if (prop != null) { configure(prop, node, 0); } return prop; }
[ "private", "Object", "propertyObj", "(", "Object", "obj", ",", "Element", "node", ")", "throws", "Exception", "{", "String", "id", "=", "getAttribute", "(", "node", ",", "\"id\"", ")", ";", "String", "name", "=", "getAttribute", "(", "node", ",", "\"name\"...
/* Create a new value object. @param obj @param node @return @exception Exception
[ "/", "*", "Create", "a", "new", "value", "object", "." ]
train
https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/util/DOMJettyWebXmlParser.java#L699-L716
pressgang-ccms/PressGangCCMSQuery
src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java
BaseFilterQueryBuilder.addLikeCondition
protected void addLikeCondition(final String propertyName, final String value) { final Expression<String> propertyNameField = getRootPath().get(propertyName).as(String.class); fieldConditions.add(getCriteriaBuilder().like(propertyNameField, "%" + cleanLikeCondition(value) + "%")); }
java
protected void addLikeCondition(final String propertyName, final String value) { final Expression<String> propertyNameField = getRootPath().get(propertyName).as(String.class); fieldConditions.add(getCriteriaBuilder().like(propertyNameField, "%" + cleanLikeCondition(value) + "%")); }
[ "protected", "void", "addLikeCondition", "(", "final", "String", "propertyName", ",", "final", "String", "value", ")", "{", "final", "Expression", "<", "String", ">", "propertyNameField", "=", "getRootPath", "(", ")", ".", "get", "(", "propertyName", ")", ".",...
Add a Field Search Condition that will search a field for a specified value using the following SQL logic: {@code field LIKE '%value%'} @param propertyName The name of the field as defined in the Entity mapping class. @param value The value to search against.
[ "Add", "a", "Field", "Search", "Condition", "that", "will", "search", "a", "field", "for", "a", "specified", "value", "using", "the", "following", "SQL", "logic", ":", "{", "@code", "field", "LIKE", "%value%", "}" ]
train
https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L199-L202
astrapi69/mystic-crypt
crypt-data/src/main/java/de/alpharogroup/crypto/key/writer/PublicKeyWriter.java
PublicKeyWriter.writeInPemFormat
public static void writeInPemFormat(final PublicKey publicKey, final @NonNull File file) throws IOException { KeyWriter.writeInPemFormat(publicKey, file); }
java
public static void writeInPemFormat(final PublicKey publicKey, final @NonNull File file) throws IOException { KeyWriter.writeInPemFormat(publicKey, file); }
[ "public", "static", "void", "writeInPemFormat", "(", "final", "PublicKey", "publicKey", ",", "final", "@", "NonNull", "File", "file", ")", "throws", "IOException", "{", "KeyWriter", ".", "writeInPemFormat", "(", "publicKey", ",", "file", ")", ";", "}" ]
Write the given {@link PublicKey} into the given {@link File}. @param publicKey the public key @param file the file to write in @throws IOException Signals that an I/O exception has occurred.
[ "Write", "the", "given", "{", "@link", "PublicKey", "}", "into", "the", "given", "{", "@link", "File", "}", "." ]
train
https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/writer/PublicKeyWriter.java#L88-L92
apache/incubator-gobblin
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegistrationUnit.java
HiveRegistrationUnit.setStorageProp
public void setStorageProp(String key, Object value) { this.storageProps.setProp(key, value); updateStorageFields(this.storageProps, key, value); }
java
public void setStorageProp(String key, Object value) { this.storageProps.setProp(key, value); updateStorageFields(this.storageProps, key, value); }
[ "public", "void", "setStorageProp", "(", "String", "key", ",", "Object", "value", ")", "{", "this", ".", "storageProps", ".", "setProp", "(", "key", ",", "value", ")", ";", "updateStorageFields", "(", "this", ".", "storageProps", ",", "key", ",", "value", ...
Set a storage parameter for a table/partition. <p> When using {@link org.apache.gobblin.hive.metastore.HiveMetaStoreBasedRegister}, since it internally use {@link org.apache.hadoop.hive.metastore.api.Table} and {@link org.apache.hadoop.hive.metastore.api.Partition} which distinguishes between table/partition parameters, storage descriptor parameters, and serde parameters, one may need to distinguish them when constructing a {@link HiveRegistrationUnit} by using {@link #setProp(String, Object)}, {@link #setStorageProp(String, Object)} and {@link #setSerDeProp(String, Object)}. When using query-based Hive registration, they do not need to be distinguished since all parameters will be passed via TBLPROPERTIES. </p>
[ "Set", "a", "storage", "parameter", "for", "a", "table", "/", "partition", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegistrationUnit.java#L191-L194
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java
JobExecutionsInner.cancelAsync
public Observable<Void> cancelAsync(String resourceGroupName, String serverName, String jobAgentName, String jobName, UUID jobExecutionId) { return cancelWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobExecutionId).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
java
public Observable<Void> cancelAsync(String resourceGroupName, String serverName, String jobAgentName, String jobName, UUID jobExecutionId) { return cancelWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobExecutionId).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Void", ">", "cancelAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "jobAgentName", ",", "String", "jobName", ",", "UUID", "jobExecutionId", ")", "{", "return", "cancelWithServiceResponseAsync", "(...
Requests cancellation of a job execution. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param jobAgentName The name of the job agent. @param jobName The name of the job. @param jobExecutionId The id of the job execution to cancel. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "Requests", "cancellation", "of", "a", "job", "execution", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java#L446-L453
i-net-software/jlessc
src/com/inet/lib/less/ColorUtils.java
ColorUtils.hslaHue
private static double hslaHue(double h, double m1, double m2) { h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); if (h * 6 < 1) { return m1 + (m2 - m1) * h * 6; } else if (h * 2 < 1) { return m2; } else if (h * 3 < 2) { return m1 + (m2 - m1) * (2F/3 - h) * 6; } else { return m1; } }
java
private static double hslaHue(double h, double m1, double m2) { h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); if (h * 6 < 1) { return m1 + (m2 - m1) * h * 6; } else if (h * 2 < 1) { return m2; } else if (h * 3 < 2) { return m1 + (m2 - m1) * (2F/3 - h) * 6; } else { return m1; } }
[ "private", "static", "double", "hslaHue", "(", "double", "h", ",", "double", "m1", ",", "double", "m2", ")", "{", "h", "=", "h", "<", "0", "?", "h", "+", "1", ":", "(", "h", ">", "1", "?", "h", "-", "1", ":", "h", ")", ";", "if", "(", "h"...
Calculate a single color channel of the HSLA function @param h hue value @param m1 value 1 in range of 0.0 to 1.0 @param m2 value 2 in range of 0.0 to 1.0 @return channel value in range of 0.0 to 1.0
[ "Calculate", "a", "single", "color", "channel", "of", "the", "HSLA", "function" ]
train
https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L202-L208
cdk/cdk
display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/AtomMassGenerator.java
AtomMassGenerator.showCarbon
@Override public boolean showCarbon(IAtom atom, IAtomContainer container, RendererModel model) { Integer massNumber = atom.getMassNumber(); if (massNumber != null) { try { Integer expectedMassNumber = Isotopes.getInstance().getMajorIsotope(atom.getSymbol()).getMassNumber(); if (!massNumber.equals(expectedMassNumber)) return true; } catch (IOException e) { logger.warn(e); } } return super.showCarbon(atom, container, model); }
java
@Override public boolean showCarbon(IAtom atom, IAtomContainer container, RendererModel model) { Integer massNumber = atom.getMassNumber(); if (massNumber != null) { try { Integer expectedMassNumber = Isotopes.getInstance().getMajorIsotope(atom.getSymbol()).getMassNumber(); if (!massNumber.equals(expectedMassNumber)) return true; } catch (IOException e) { logger.warn(e); } } return super.showCarbon(atom, container, model); }
[ "@", "Override", "public", "boolean", "showCarbon", "(", "IAtom", "atom", ",", "IAtomContainer", "container", ",", "RendererModel", "model", ")", "{", "Integer", "massNumber", "=", "atom", ".", "getMassNumber", "(", ")", ";", "if", "(", "massNumber", "!=", "...
Returns true if the mass number of this element is set and not equal the mass number of the most abundant isotope of this element. @param atom {@link IAtom} which is being examined @param container {@link IAtomContainer} of which the atom is part @param model the {@link RendererModel} @return true, when mass number information should be depicted
[ "Returns", "true", "if", "the", "mass", "number", "of", "this", "element", "is", "set", "and", "not", "equal", "the", "mass", "number", "of", "the", "most", "abundant", "isotope", "of", "this", "element", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/AtomMassGenerator.java#L49-L62
lucee/Lucee
core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java
TagLibFactory.loadFromFile
public static TagLib loadFromFile(Resource res, Identification id) throws TagLibException { // Read in XML TagLib lib = TagLibFactory.getHashLib(FunctionLibFactory.id(res)); if (lib == null) { lib = new TagLibFactory(null, res, id).getLib(); TagLibFactory.hashLib.put(FunctionLibFactory.id(res), lib); } lib.setSource(res.toString()); return lib; }
java
public static TagLib loadFromFile(Resource res, Identification id) throws TagLibException { // Read in XML TagLib lib = TagLibFactory.getHashLib(FunctionLibFactory.id(res)); if (lib == null) { lib = new TagLibFactory(null, res, id).getLib(); TagLibFactory.hashLib.put(FunctionLibFactory.id(res), lib); } lib.setSource(res.toString()); return lib; }
[ "public", "static", "TagLib", "loadFromFile", "(", "Resource", "res", ",", "Identification", "id", ")", "throws", "TagLibException", "{", "// Read in XML", "TagLib", "lib", "=", "TagLibFactory", ".", "getHashLib", "(", "FunctionLibFactory", ".", "id", "(", "res", ...
Laedt eine einzelne TagLib. @param file TLD die geladen werden soll. @param saxParser Definition des Sax Parser mit dem die TagLib eingelsesen werden soll. @return TagLib @throws TagLibException
[ "Laedt", "eine", "einzelne", "TagLib", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java#L489-L499
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/search/aggregate/DBEntitySequenceFactory.java
DBEntitySequenceFactory.initializeLinks
void initializeLinks(DBEntity caller, String link, List<String> fields, String category, DBEntitySequenceOptions options) { TableDefinition tableDef = caller.getTableDef(); LRUCache<ObjectID, LinkList> cache = getLinkCache(toIteratorCategory(tableDef.getTableName(),link, fields)); Set<ObjectID> idSet = new HashSet<ObjectID>(); TableDefinition linkedTableDef = tableDef.getLinkExtentTableDef(tableDef.getFieldDef(link)); DBEntitySequenceOptions limitedOptions = options.adjustInitialLinkBufferDimension(cache); List<DBEntity> entities = collectUninitializedEntities(caller, category, linkedTableDef, fields, link, cache, idSet, limitedOptions); if (idSet.size() == 0) return; timers.start(category + " links", "Init"); Timer timer = new Timer(); int capacity = options.initialLinkBuffer; Map<ObjectID, List<ObjectID>> fetchResult = fetchLinks(tableDef, idSet, link, options.initialLinkBuffer); timer.stop(); // Put the fetched results into the cache int resultCount = 0; for (Map.Entry<ObjectID, List<ObjectID>> entry: fetchResult.entrySet()) { cache.put(entry.getKey(), new LinkList(entry.getValue(), capacity)); resultCount += entry.getValue().size(); } timers.stop(category + " links", "Init", resultCount); log.debug("fetch {} {} of {}[{}] links ({})", new Object[]{ resultCount, category, idSet.size(), options.initialLinkBuffer, timer}); // Initialize the child iterators with the cached link lists for (DBEntity entity : entities) { ObjectID id = entity.id(); LinkList columns = cache.get(id); if(columns == null) { columns = new LinkList(new ArrayList<ObjectID>(0), 1); } DBLinkIterator linkIterator = new DBLinkIterator(entity, link, columns, m_options.linkBuffer, this, category); entity.addIterator(category, new DBEntityIterator(linkedTableDef, entity, linkIterator, fields, this, category, m_options)); } }
java
void initializeLinks(DBEntity caller, String link, List<String> fields, String category, DBEntitySequenceOptions options) { TableDefinition tableDef = caller.getTableDef(); LRUCache<ObjectID, LinkList> cache = getLinkCache(toIteratorCategory(tableDef.getTableName(),link, fields)); Set<ObjectID> idSet = new HashSet<ObjectID>(); TableDefinition linkedTableDef = tableDef.getLinkExtentTableDef(tableDef.getFieldDef(link)); DBEntitySequenceOptions limitedOptions = options.adjustInitialLinkBufferDimension(cache); List<DBEntity> entities = collectUninitializedEntities(caller, category, linkedTableDef, fields, link, cache, idSet, limitedOptions); if (idSet.size() == 0) return; timers.start(category + " links", "Init"); Timer timer = new Timer(); int capacity = options.initialLinkBuffer; Map<ObjectID, List<ObjectID>> fetchResult = fetchLinks(tableDef, idSet, link, options.initialLinkBuffer); timer.stop(); // Put the fetched results into the cache int resultCount = 0; for (Map.Entry<ObjectID, List<ObjectID>> entry: fetchResult.entrySet()) { cache.put(entry.getKey(), new LinkList(entry.getValue(), capacity)); resultCount += entry.getValue().size(); } timers.stop(category + " links", "Init", resultCount); log.debug("fetch {} {} of {}[{}] links ({})", new Object[]{ resultCount, category, idSet.size(), options.initialLinkBuffer, timer}); // Initialize the child iterators with the cached link lists for (DBEntity entity : entities) { ObjectID id = entity.id(); LinkList columns = cache.get(id); if(columns == null) { columns = new LinkList(new ArrayList<ObjectID>(0), 1); } DBLinkIterator linkIterator = new DBLinkIterator(entity, link, columns, m_options.linkBuffer, this, category); entity.addIterator(category, new DBEntityIterator(linkedTableDef, entity, linkIterator, fields, this, category, m_options)); } }
[ "void", "initializeLinks", "(", "DBEntity", "caller", ",", "String", "link", ",", "List", "<", "String", ">", "fields", ",", "String", "category", ",", "DBEntitySequenceOptions", "options", ")", "{", "TableDefinition", "tableDef", "=", "caller", ".", "getTableDe...
Fetches first N links of the specified link type. Fetches the links of the specified entity. Also fetches first N links of other entities to be returned by the iterators of the same category Uses {@link #multiget_slice(List, ColumnParent, SlicePredicate)} method method with the 'slice range' parameter to perform bulk fetch Or uses {@link #get_slice(ByteBuffer, ColumnParent, SlicePredicate)} for SV links @param caller next entity to be returned by the iterator (must be initialized first) @param link link name @param fields scalar fields of the linked entities @param category iterator category that will iterate the linked entities @param options defines now many entities should be initialized and how many first links should be fetched
[ "Fetches", "first", "N", "links", "of", "the", "specified", "link", "type", ".", "Fetches", "the", "links", "of", "the", "specified", "entity", ".", "Also", "fetches", "first", "N", "links", "of", "other", "entities", "to", "be", "returned", "by", "the", ...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/search/aggregate/DBEntitySequenceFactory.java#L226-L264
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.isFirstCoveredToken
public static boolean isFirstCoveredToken(final Token token, final Annotation annotation) { final JCas jCas = getJCas(annotation); final List<Token> coveredTokens = JCasUtil.selectCovered(jCas, Token.class, annotation); if (coveredTokens.isEmpty()) { return false; } else { final Token firstCoveredToken = coveredTokens.get(0); return haveSameSpan(token, firstCoveredToken); } }
java
public static boolean isFirstCoveredToken(final Token token, final Annotation annotation) { final JCas jCas = getJCas(annotation); final List<Token> coveredTokens = JCasUtil.selectCovered(jCas, Token.class, annotation); if (coveredTokens.isEmpty()) { return false; } else { final Token firstCoveredToken = coveredTokens.get(0); return haveSameSpan(token, firstCoveredToken); } }
[ "public", "static", "boolean", "isFirstCoveredToken", "(", "final", "Token", "token", ",", "final", "Annotation", "annotation", ")", "{", "final", "JCas", "jCas", "=", "getJCas", "(", "annotation", ")", ";", "final", "List", "<", "Token", ">", "coveredTokens",...
Returns whether the given token is the first token covered by the given annotation. @param token the token @param annotation the annotation @return whether the token is the first covered token
[ "Returns", "whether", "the", "given", "token", "is", "the", "first", "token", "covered", "by", "the", "given", "annotation", "." ]
train
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L236-L248
podio/podio-java
src/main/java/com/podio/status/StatusAPI.java
StatusAPI.updateStatus
public void updateStatus(int statusId, StatusUpdate update) { getResourceFactory().getApiResource("/status/" + statusId) .entity(update, MediaType.APPLICATION_JSON_TYPE).put(); }
java
public void updateStatus(int statusId, StatusUpdate update) { getResourceFactory().getApiResource("/status/" + statusId) .entity(update, MediaType.APPLICATION_JSON_TYPE).put(); }
[ "public", "void", "updateStatus", "(", "int", "statusId", ",", "StatusUpdate", "update", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/status/\"", "+", "statusId", ")", ".", "entity", "(", "update", ",", "MediaType", ".", "APPLICATI...
This will update an existing status message. This will normally only be used to correct spelling and grammatical mistakes. @param statusId The id of the status to be updated @param update The new data for the status
[ "This", "will", "update", "an", "existing", "status", "message", ".", "This", "will", "normally", "only", "be", "used", "to", "correct", "spelling", "and", "grammatical", "mistakes", "." ]
train
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/status/StatusAPI.java#L73-L76
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java
ComputeNodesImpl.uploadBatchServiceLogs
public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, UploadBatchServiceLogsConfiguration uploadBatchServiceLogsConfiguration) { return uploadBatchServiceLogsWithServiceResponseAsync(poolId, nodeId, uploadBatchServiceLogsConfiguration).toBlocking().single().body(); }
java
public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, UploadBatchServiceLogsConfiguration uploadBatchServiceLogsConfiguration) { return uploadBatchServiceLogsWithServiceResponseAsync(poolId, nodeId, uploadBatchServiceLogsConfiguration).toBlocking().single().body(); }
[ "public", "UploadBatchServiceLogsResult", "uploadBatchServiceLogs", "(", "String", "poolId", ",", "String", "nodeId", ",", "UploadBatchServiceLogsConfiguration", "uploadBatchServiceLogsConfiguration", ")", "{", "return", "uploadBatchServiceLogsWithServiceResponseAsync", "(", "poolI...
Upload Azure Batch service log files from the specified compute node to Azure Blob Storage. This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support. The Azure Batch service log files should be shared with Azure support to aid in debugging issues with the Batch service. @param poolId The ID of the pool that contains the compute node. @param nodeId The ID of the compute node from which you want to upload the Azure Batch service log files. @param uploadBatchServiceLogsConfiguration The Azure Batch service log files upload configuration. @throws IllegalArgumentException thrown if parameters fail the validation @throws BatchErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the UploadBatchServiceLogsResult object if successful.
[ "Upload", "Azure", "Batch", "service", "log", "files", "from", "the", "specified", "compute", "node", "to", "Azure", "Blob", "Storage", ".", "This", "is", "for", "gathering", "Azure", "Batch", "service", "log", "files", "in", "an", "automated", "fashion", "f...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L2382-L2384
roboconf/roboconf-platform
core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/TemplatingManager.java
TemplatingManager.resetWatcher
private void resetWatcher() { // Stop the current watcher. stopWatcher(); // Update the template & target directories, based on the provided configuration directory. if( this.templatesDIR == null ) { this.logger.warning( "The templates directory was not specified. DM templating is temporarily disabled." ); } else if( this.outputDIR == null ) { this.logger.warning( "The templates directory was not specified. DM templating is temporarily disabled." ); } else { this.templateWatcher = new TemplateWatcher( this, this.templatesDIR, this.pollInterval ); this.templateWatcher.start(); } }
java
private void resetWatcher() { // Stop the current watcher. stopWatcher(); // Update the template & target directories, based on the provided configuration directory. if( this.templatesDIR == null ) { this.logger.warning( "The templates directory was not specified. DM templating is temporarily disabled." ); } else if( this.outputDIR == null ) { this.logger.warning( "The templates directory was not specified. DM templating is temporarily disabled." ); } else { this.templateWatcher = new TemplateWatcher( this, this.templatesDIR, this.pollInterval ); this.templateWatcher.start(); } }
[ "private", "void", "resetWatcher", "(", ")", "{", "// Stop the current watcher.", "stopWatcher", "(", ")", ";", "// Update the template & target directories, based on the provided configuration directory.", "if", "(", "this", ".", "templatesDIR", "==", "null", ")", "{", "th...
Updates the template watcher after a change in the templating manager configuration.
[ "Updates", "the", "template", "watcher", "after", "a", "change", "in", "the", "templating", "manager", "configuration", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/TemplatingManager.java#L290-L306
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.getDeletedKeyAsync
public ServiceFuture<DeletedKeyBundle> getDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<DeletedKeyBundle> serviceCallback) { return ServiceFuture.fromResponse(getDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); }
java
public ServiceFuture<DeletedKeyBundle> getDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<DeletedKeyBundle> serviceCallback) { return ServiceFuture.fromResponse(getDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback); }
[ "public", "ServiceFuture", "<", "DeletedKeyBundle", ">", "getDeletedKeyAsync", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ",", "final", "ServiceCallback", "<", "DeletedKeyBundle", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ".", "fromRes...
Gets the public part of a deleted key. The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param keyName The name of the key. @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceFuture} object
[ "Gets", "the", "public", "part", "of", "a", "deleted", "key", ".", "The", "Get", "Deleted", "Key", "operation", "is", "applicable", "for", "soft", "-", "delete", "enabled", "vaults", ".", "While", "the", "operation", "can", "be", "invoked", "on", "any", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3072-L3074
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/HttpDateFormatImpl.java
HttpDateFormatImpl.attemptParse
private Date attemptParse(SimpleDateFormat format, String input) { ParsePosition pos = new ParsePosition(0); Date d = format.parse(input, pos); if (0 == pos.getIndex() || pos.getIndex() != input.length()) { // invalid format matching return null; } return d; }
java
private Date attemptParse(SimpleDateFormat format, String input) { ParsePosition pos = new ParsePosition(0); Date d = format.parse(input, pos); if (0 == pos.getIndex() || pos.getIndex() != input.length()) { // invalid format matching return null; } return d; }
[ "private", "Date", "attemptParse", "(", "SimpleDateFormat", "format", ",", "String", "input", ")", "{", "ParsePosition", "pos", "=", "new", "ParsePosition", "(", "0", ")", ";", "Date", "d", "=", "format", ".", "parse", "(", "input", ",", "pos", ")", ";",...
Parse the input value against the formatter but do not throw an exception if it fails to match, instead just return null. <br> @param format @param input @return Date
[ "Parse", "the", "input", "value", "against", "the", "formatter", "but", "do", "not", "throw", "an", "exception", "if", "it", "fails", "to", "match", "instead", "just", "return", "null", ".", "<br", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/HttpDateFormatImpl.java#L279-L287
line/armeria
spring/boot-autoconfigure/src/main/java/com/linecorp/armeria/spring/AbstractServiceRegistrationBean.java
AbstractServiceRegistrationBean.setDecorator
@Deprecated public final U setDecorator( Function<Service<HttpRequest, HttpResponse>, ? extends Service<HttpRequest, HttpResponse>> decorator) { return setDecorators(requireNonNull(decorator, "decorator")); }
java
@Deprecated public final U setDecorator( Function<Service<HttpRequest, HttpResponse>, ? extends Service<HttpRequest, HttpResponse>> decorator) { return setDecorators(requireNonNull(decorator, "decorator")); }
[ "@", "Deprecated", "public", "final", "U", "setDecorator", "(", "Function", "<", "Service", "<", "HttpRequest", ",", "HttpResponse", ">", ",", "?", "extends", "Service", "<", "HttpRequest", ",", "HttpResponse", ">", ">", "decorator", ")", "{", "return", "set...
Sets the decorator of the annotated service object. {@code decorator} are applied to {@code service} in order. @deprecated Use {@link #setDecorators(Function[])} or {@link #setDecorators(List)} instead.
[ "Sets", "the", "decorator", "of", "the", "annotated", "service", "object", ".", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/spring/boot-autoconfigure/src/main/java/com/linecorp/armeria/spring/AbstractServiceRegistrationBean.java#L105-L110
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/SecureClassLoader.java
SecureClassLoader.defineClass
protected final Class<?> defineClass(String name, byte[] b, int off, int len, CodeSource cs) { return defineClass(name, b, off, len, getProtectionDomain(cs)); }
java
protected final Class<?> defineClass(String name, byte[] b, int off, int len, CodeSource cs) { return defineClass(name, b, off, len, getProtectionDomain(cs)); }
[ "protected", "final", "Class", "<", "?", ">", "defineClass", "(", "String", "name", ",", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ",", "CodeSource", "cs", ")", "{", "return", "defineClass", "(", "name", ",", "b", ",", "off", ","...
Converts an array of bytes into an instance of class Class, with an optional CodeSource. Before the class can be used it must be resolved. <p> If a non-null CodeSource is supplied a ProtectionDomain is constructed and associated with the class being defined. <p> @param name the expected name of the class, or {@code null} if not known, using '.' and not '/' as the separator and without a trailing ".class" suffix. @param b the bytes that make up the class data. The bytes in positions {@code off} through {@code off+len-1} should have the format of a valid class file as defined by <cite>The Java&trade; Virtual Machine Specification</cite>. @param off the start offset in {@code b} of the class data @param len the length of the class data @param cs the associated CodeSource, or {@code null} if none @return the {@code Class} object created from the data, and optional CodeSource. @exception ClassFormatError if the data did not contain a valid class @exception IndexOutOfBoundsException if either {@code off} or {@code len} is negative, or if {@code off+len} is greater than {@code b.length}. @exception SecurityException if an attempt is made to add this class to a package that contains classes that were signed by a different set of certificates than this class, or if the class name begins with "java.".
[ "Converts", "an", "array", "of", "bytes", "into", "an", "instance", "of", "class", "Class", "with", "an", "optional", "CodeSource", ".", "Before", "the", "class", "can", "be", "used", "it", "must", "be", "resolved", ".", "<p", ">", "If", "a", "non", "-...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/SecureClassLoader.java#L138-L143
j256/ormlite-core
src/main/java/com/j256/ormlite/support/BaseConnectionSource.java
BaseConnectionSource.isSingleConnection
protected boolean isSingleConnection(DatabaseConnection conn1, DatabaseConnection conn2) throws SQLException { // initialize the connections auto-commit flags conn1.setAutoCommit(true); conn2.setAutoCommit(true); try { // change conn1's auto-commit to be false conn1.setAutoCommit(false); if (conn2.isAutoCommit()) { // if the 2nd connection's auto-commit is still true then we have multiple connections return false; } else { // if the 2nd connection's auto-commit is also false then we have a single connection return true; } } finally { // restore its auto-commit conn1.setAutoCommit(true); } }
java
protected boolean isSingleConnection(DatabaseConnection conn1, DatabaseConnection conn2) throws SQLException { // initialize the connections auto-commit flags conn1.setAutoCommit(true); conn2.setAutoCommit(true); try { // change conn1's auto-commit to be false conn1.setAutoCommit(false); if (conn2.isAutoCommit()) { // if the 2nd connection's auto-commit is still true then we have multiple connections return false; } else { // if the 2nd connection's auto-commit is also false then we have a single connection return true; } } finally { // restore its auto-commit conn1.setAutoCommit(true); } }
[ "protected", "boolean", "isSingleConnection", "(", "DatabaseConnection", "conn1", ",", "DatabaseConnection", "conn2", ")", "throws", "SQLException", "{", "// initialize the connections auto-commit flags", "conn1", ".", "setAutoCommit", "(", "true", ")", ";", "conn2", ".",...
Return true if the two connections seem to one one connection under the covers.
[ "Return", "true", "if", "the", "two", "connections", "seem", "to", "one", "one", "connection", "under", "the", "covers", "." ]
train
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/support/BaseConnectionSource.java#L103-L121
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java
AbstractRegionPainter.desaturate
protected Color desaturate(Color color) { float[] tmp = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); tmp[1] /= 3.0f; tmp[2] = clamp(1.0f - (1.0f - tmp[2]) / 3f); return new Color((Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF)); }
java
protected Color desaturate(Color color) { float[] tmp = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); tmp[1] /= 3.0f; tmp[2] = clamp(1.0f - (1.0f - tmp[2]) / 3f); return new Color((Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF)); }
[ "protected", "Color", "desaturate", "(", "Color", "color", ")", "{", "float", "[", "]", "tmp", "=", "Color", ".", "RGBtoHSB", "(", "color", ".", "getRed", "(", ")", ",", "color", ".", "getGreen", "(", ")", ",", "color", ".", "getBlue", "(", ")", ",...
Returns a new color with the saturation cut to one third the original, and the brightness moved one third closer to white. @param color the original color. @return the new color.
[ "Returns", "a", "new", "color", "with", "the", "saturation", "cut", "to", "one", "third", "the", "original", "and", "the", "brightness", "moved", "one", "third", "closer", "to", "white", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java#L542-L549
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java
ExpressRouteCircuitsInner.getStats
public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); }
java
public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); }
[ "public", "ExpressRouteCircuitStatsInner", "getStats", "(", "String", "resourceGroupName", ",", "String", "circuitName", ")", "{", "return", "getStatsWithServiceResponseAsync", "(", "resourceGroupName", ",", "circuitName", ")", ".", "toBlocking", "(", ")", ".", "single"...
Gets all the stats from an express route circuit in a resource group. @param resourceGroupName The name of the resource group. @param circuitName The name of the express route circuit. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the ExpressRouteCircuitStatsInner object if successful.
[ "Gets", "all", "the", "stats", "from", "an", "express", "route", "circuit", "in", "a", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L1416-L1418
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java
MainFrameComponentFactory.setSourceTab
void setSourceTab(String title, @CheckForNull BugInstance bug) { JComponent label = mainFrame.getGuiLayout().getSourceViewComponent(); if (label != null) { removeLink(label); } mainFrame.getGuiLayout().setSourceTitle(title); }
java
void setSourceTab(String title, @CheckForNull BugInstance bug) { JComponent label = mainFrame.getGuiLayout().getSourceViewComponent(); if (label != null) { removeLink(label); } mainFrame.getGuiLayout().setSourceTitle(title); }
[ "void", "setSourceTab", "(", "String", "title", ",", "@", "CheckForNull", "BugInstance", "bug", ")", "{", "JComponent", "label", "=", "mainFrame", ".", "getGuiLayout", "(", ")", ".", "getSourceViewComponent", "(", ")", ";", "if", "(", "label", "!=", "null", ...
Sets the title of the source tabs for either docking or non-docking versions.
[ "Sets", "the", "title", "of", "the", "source", "tabs", "for", "either", "docking", "or", "non", "-", "docking", "versions", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java#L198-L204
joniles/mpxj
src/main/java/net/sf/mpxj/Resource.java
Resource.setStart
public void setStart(int index, Date value) { set(selectField(ResourceFieldLists.CUSTOM_START, index), value); }
java
public void setStart(int index, Date value) { set(selectField(ResourceFieldLists.CUSTOM_START, index), value); }
[ "public", "void", "setStart", "(", "int", "index", ",", "Date", "value", ")", "{", "set", "(", "selectField", "(", "ResourceFieldLists", ".", "CUSTOM_START", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set a start value. @param index start index (1-10) @param value start value
[ "Set", "a", "start", "value", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1595-L1598
knowm/Datasets
datasets-reuters-21578/src/main/java/org/knowm/datasets/reuters21578/RawData2DB.java
RawData2DB.extractAttribute
protected String extractAttribute(String stringContainingAttributes, String attributeName) { String attributeValue = ""; stringContainingAttributes = stringContainingAttributes.replaceAll("<", "").replaceAll(">", ""); String[] keyValues = stringContainingAttributes.split(" "); for (int i = 0; i < keyValues.length; i++) { String keyValue = keyValues[i].trim(); String[] keyAndValue = keyValue.split("="); if (keyAndValue[0].equalsIgnoreCase(attributeName)) { return keyAndValue[1].substring(1, keyAndValue[1].length() - 1); } } return attributeValue; }
java
protected String extractAttribute(String stringContainingAttributes, String attributeName) { String attributeValue = ""; stringContainingAttributes = stringContainingAttributes.replaceAll("<", "").replaceAll(">", ""); String[] keyValues = stringContainingAttributes.split(" "); for (int i = 0; i < keyValues.length; i++) { String keyValue = keyValues[i].trim(); String[] keyAndValue = keyValue.split("="); if (keyAndValue[0].equalsIgnoreCase(attributeName)) { return keyAndValue[1].substring(1, keyAndValue[1].length() - 1); } } return attributeValue; }
[ "protected", "String", "extractAttribute", "(", "String", "stringContainingAttributes", ",", "String", "attributeName", ")", "{", "String", "attributeValue", "=", "\"\"", ";", "stringContainingAttributes", "=", "stringContainingAttributes", ".", "replaceAll", "(", "\"<\""...
Given a String containing XML-like attributes and a key, it extracts a value @param stringContainingAttributes @param attributeName @return
[ "Given", "a", "String", "containing", "XML", "-", "like", "attributes", "and", "a", "key", "it", "extracts", "a", "value" ]
train
https://github.com/knowm/Datasets/blob/4ea16ccda1d4190a551accff78bbbe05c9c38c79/datasets-reuters-21578/src/main/java/org/knowm/datasets/reuters21578/RawData2DB.java#L293-L309
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java
ExtendedSwidProcessor.setKeywords
public ExtendedSwidProcessor setKeywords(final String... keywordList) { KeywordsComplexType kct = new KeywordsComplexType(); if (keywordList.length > 0) { for (String keyword : keywordList) { kct.getKeyword().add(new Token(keyword, idGenerator.nextId())); } } swidTag.setKeywords(kct); return this; }
java
public ExtendedSwidProcessor setKeywords(final String... keywordList) { KeywordsComplexType kct = new KeywordsComplexType(); if (keywordList.length > 0) { for (String keyword : keywordList) { kct.getKeyword().add(new Token(keyword, idGenerator.nextId())); } } swidTag.setKeywords(kct); return this; }
[ "public", "ExtendedSwidProcessor", "setKeywords", "(", "final", "String", "...", "keywordList", ")", "{", "KeywordsComplexType", "kct", "=", "new", "KeywordsComplexType", "(", ")", ";", "if", "(", "keywordList", ".", "length", ">", "0", ")", "{", "for", "(", ...
Defines product keywords (tag: keywords). @param keywordList product keywords @return a reference to this object.
[ "Defines", "product", "keywords", "(", "tag", ":", "keywords", ")", "." ]
train
https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java#L71-L80
pmwmedia/tinylog
log4j1.2-api/src/main/java/org/apache/log4j/Category.java
Category.l7dlog
public void l7dlog(final Priority priority, final String key, final Throwable t) { ResourceBundle bundle = this.bundle; String message = bundle == null ? key : bundle.getString(key); provider.log(STACKTRACE_DEPTH, null, translatePriority(priority), t, message, (Object[]) null); }
java
public void l7dlog(final Priority priority, final String key, final Throwable t) { ResourceBundle bundle = this.bundle; String message = bundle == null ? key : bundle.getString(key); provider.log(STACKTRACE_DEPTH, null, translatePriority(priority), t, message, (Object[]) null); }
[ "public", "void", "l7dlog", "(", "final", "Priority", "priority", ",", "final", "String", "key", ",", "final", "Throwable", "t", ")", "{", "ResourceBundle", "bundle", "=", "this", ".", "bundle", ";", "String", "message", "=", "bundle", "==", "null", "?", ...
Log a localized message. The user supplied parameter {@code key} is replaced by its localized version from the resource bundle. @param priority Priority for log entry @param key Resource key for translation @param t Exception to log @see #setResourceBundle @since 0.8.4
[ "Log", "a", "localized", "message", ".", "The", "user", "supplied", "parameter", "{", "@code", "key", "}", "is", "replaced", "by", "its", "localized", "version", "from", "the", "resource", "bundle", "." ]
train
https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/log4j1.2-api/src/main/java/org/apache/log4j/Category.java#L628-L633
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java
FirewallRulesInner.updateAsync
public Observable<FirewallRuleInner> updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1<ServiceResponse<FirewallRuleInner>, FirewallRuleInner>() { @Override public FirewallRuleInner call(ServiceResponse<FirewallRuleInner> response) { return response.body(); } }); }
java
public Observable<FirewallRuleInner> updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1<ServiceResponse<FirewallRuleInner>, FirewallRuleInner>() { @Override public FirewallRuleInner call(ServiceResponse<FirewallRuleInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "FirewallRuleInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "firewallRuleName", ",", "UpdateFirewallRuleParameters", "parameters", ")", "{", "return", "updateWithServiceResponseAsync"...
Updates the specified firewall rule. @param resourceGroupName The name of the Azure resource group. @param accountName The name of the Data Lake Store account. @param firewallRuleName The name of the firewall rule to update. @param parameters Parameters supplied to update the firewall rule. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the FirewallRuleInner object
[ "Updates", "the", "specified", "firewall", "rule", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java#L538-L545
mygreen/super-csv-annotation
src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java
MessageInterpolator.evaluateExpression
protected String evaluateExpression(final String expression, final Map<String, ?> values) throws ExpressionEvaluationException { final Map<String, Object> context = new LinkedHashMap<String, Object>(); context.putAll(values); // フォーマッターの追加 context.computeIfAbsent("formatter", key -> new Formatter()); final String value = expressionLanguage.evaluate(expression, context).toString(); if(logger.isTraceEnabled()) { logger.trace("evaluate expression language: expression='{}' ===> value='{}'", expression, value); } return value; }
java
protected String evaluateExpression(final String expression, final Map<String, ?> values) throws ExpressionEvaluationException { final Map<String, Object> context = new LinkedHashMap<String, Object>(); context.putAll(values); // フォーマッターの追加 context.computeIfAbsent("formatter", key -> new Formatter()); final String value = expressionLanguage.evaluate(expression, context).toString(); if(logger.isTraceEnabled()) { logger.trace("evaluate expression language: expression='{}' ===> value='{}'", expression, value); } return value; }
[ "protected", "String", "evaluateExpression", "(", "final", "String", "expression", ",", "final", "Map", "<", "String", ",", "?", ">", "values", ")", "throws", "ExpressionEvaluationException", "{", "final", "Map", "<", "String", ",", "Object", ">", "context", "...
EL式を評価する。 @param expression EL式 @param values EL式中の変数。 @return 評価した式。 @throws ExpressionEvaluationException
[ "EL式を評価する。" ]
train
https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java#L259-L273
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java
Transliterator.registerFactory
public static void registerFactory(String ID, Factory factory) { registry.put(ID, factory, true); }
java
public static void registerFactory(String ID, Factory factory) { registry.put(ID, factory, true); }
[ "public", "static", "void", "registerFactory", "(", "String", "ID", ",", "Factory", "factory", ")", "{", "registry", ".", "put", "(", "ID", ",", "factory", ",", "true", ")", ";", "}" ]
Register a factory object with the given ID. The factory method should return a new instance of the given transliterator. <p>Because ICU may choose to cache Transliterator objects internally, this must be called at application startup, prior to any calls to Transliterator.getInstance to avoid undefined behavior. @param ID the ID of this transliterator @param factory the factory object
[ "Register", "a", "factory", "object", "with", "the", "given", "ID", ".", "The", "factory", "method", "should", "return", "a", "new", "instance", "of", "the", "given", "transliterator", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1689-L1691
sarl/sarl
docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/writers/SarlConstructorWriter.java
SarlConstructorWriter.addAnnotations
protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) { WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer); }
java
protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) { WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer); }
[ "protected", "void", "addAnnotations", "(", "ExecutableMemberDoc", "member", ",", "Content", "htmlTree", ")", "{", "WriterUtils", ".", "addAnnotations", "(", "member", ",", "htmlTree", ",", "this", ".", "configuration", ",", "this", ".", "writer", ")", ";", "}...
Add annotations, except the reserved annotations. @param member the members. @param htmlTree the output.
[ "Add", "annotations", "except", "the", "reserved", "annotations", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/writers/SarlConstructorWriter.java#L82-L84
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java
HFCAClient.createNewInstance
public static HFCAClient createNewInstance(NetworkConfig.CAInfo caInfo) throws MalformedURLException, InvalidArgumentException { try { return createNewInstance(caInfo, CryptoSuite.Factory.getCryptoSuite()); } catch (MalformedURLException e) { throw e; } catch (Exception e) { throw new InvalidArgumentException(e); } }
java
public static HFCAClient createNewInstance(NetworkConfig.CAInfo caInfo) throws MalformedURLException, InvalidArgumentException { try { return createNewInstance(caInfo, CryptoSuite.Factory.getCryptoSuite()); } catch (MalformedURLException e) { throw e; } catch (Exception e) { throw new InvalidArgumentException(e); } }
[ "public", "static", "HFCAClient", "createNewInstance", "(", "NetworkConfig", ".", "CAInfo", "caInfo", ")", "throws", "MalformedURLException", ",", "InvalidArgumentException", "{", "try", "{", "return", "createNewInstance", "(", "caInfo", ",", "CryptoSuite", ".", "Fact...
Create HFCAClient from a NetworkConfig.CAInfo using default crypto suite. @param caInfo created from NetworkConfig.getOrganizationInfo("org_name").getCertificateAuthorities() @return HFCAClient @throws MalformedURLException @throws InvalidArgumentException
[ "Create", "HFCAClient", "from", "a", "NetworkConfig", ".", "CAInfo", "using", "default", "crypto", "suite", "." ]
train
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java#L322-L331