repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
drinkjava2/jBeanBox
jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java
CheckClassAdapter.checkFormalTypeParameter
private static int checkFormalTypeParameter(final String signature, int pos) { """ Checks a formal type parameter of a class or method signature. @param signature a string containing the signature that must be checked. @param pos index of first character to be checked. @return the index of the first charact...
java
private static int checkFormalTypeParameter(final String signature, int pos) { // FormalTypeParameter: // Identifier : FieldTypeSignature? (: FieldTypeSignature)* pos = checkIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, po...
[ "private", "static", "int", "checkFormalTypeParameter", "(", "final", "String", "signature", ",", "int", "pos", ")", "{", "// FormalTypeParameter:", "// Identifier : FieldTypeSignature? (: FieldTypeSignature)*", "pos", "=", "checkIdentifier", "(", "signature", ",", "pos", ...
Checks a formal type parameter of a class or method signature. @param signature a string containing the signature that must be checked. @param pos index of first character to be checked. @return the index of the first character after the checked part.
[ "Checks", "a", "formal", "type", "parameter", "of", "a", "class", "or", "method", "signature", "." ]
train
https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L796-L809
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/InternalHelper.java
InternalHelper.inheritClientBehaviorsAndSetPublicProperty
public static void inheritClientBehaviorsAndSetPublicProperty(IInheritedBehaviors inheritingObject, Iterable<BatchClientBehavior> baseBehaviors) { """ Inherit the BatchClientBehavior classes from parent object @param inheritingObject the inherit object @param baseBehaviors base class behavior list """ ...
java
public static void inheritClientBehaviorsAndSetPublicProperty(IInheritedBehaviors inheritingObject, Iterable<BatchClientBehavior> baseBehaviors) { // implement inheritance of behaviors List<BatchClientBehavior> customBehaviors = new ArrayList<>(); // if there were any behaviors, pre-populate th...
[ "public", "static", "void", "inheritClientBehaviorsAndSetPublicProperty", "(", "IInheritedBehaviors", "inheritingObject", ",", "Iterable", "<", "BatchClientBehavior", ">", "baseBehaviors", ")", "{", "// implement inheritance of behaviors", "List", "<", "BatchClientBehavior", ">...
Inherit the BatchClientBehavior classes from parent object @param inheritingObject the inherit object @param baseBehaviors base class behavior list
[ "Inherit", "the", "BatchClientBehavior", "classes", "from", "parent", "object" ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/InternalHelper.java#L19-L32
craftercms/deployer
src/main/java/org/craftercms/deployer/utils/ConfigUtils.java
ConfigUtils.getLongProperty
public static Long getLongProperty(Configuration config, String key, Long defaultValue) throws DeployerConfigurationException { """ Returns the specified Long property from the configuration @param config the configuration @param key the key of the property...
java
public static Long getLongProperty(Configuration config, String key, Long defaultValue) throws DeployerConfigurationException { try { return config.getLong(key, defaultValue); } catch (Exception e) { throw new DeployerConfigurationException(...
[ "public", "static", "Long", "getLongProperty", "(", "Configuration", "config", ",", "String", "key", ",", "Long", "defaultValue", ")", "throws", "DeployerConfigurationException", "{", "try", "{", "return", "config", ".", "getLong", "(", "key", ",", "defaultValue",...
Returns the specified Long property from the configuration @param config the configuration @param key the key of the property @param defaultValue the default value if the property is not found @return the Long value of the property, or the default value if not found @throws DeployerConfigurationExceptio...
[ "Returns", "the", "specified", "Long", "property", "from", "the", "configuration" ]
train
https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L213-L220
duracloud/duracloud
glacierstorageprovider/src/main/java/org/duracloud/glacierstorage/GlacierStorageProvider.java
GlacierStorageProvider.checkStorageState
private void checkStorageState(StorageException e) { """ Recognize and handle exceptions due to content which resides in Glacier but has not been retrieved for access. """ if (e.getCause() instanceof AmazonS3Exception) { String errorCode = ((AmazonS3Exception) e.getCause...
java
private void checkStorageState(StorageException e) { if (e.getCause() instanceof AmazonS3Exception) { String errorCode = ((AmazonS3Exception) e.getCause()).getErrorCode(); if (INVALID_OBJECT_STATE.equals(errorCode)) { String message = "The storage sta...
[ "private", "void", "checkStorageState", "(", "StorageException", "e", ")", "{", "if", "(", "e", ".", "getCause", "(", ")", "instanceof", "AmazonS3Exception", ")", "{", "String", "errorCode", "=", "(", "(", "AmazonS3Exception", ")", "e", ".", "getCause", "(",...
Recognize and handle exceptions due to content which resides in Glacier but has not been retrieved for access.
[ "Recognize", "and", "handle", "exceptions", "due", "to", "content", "which", "resides", "in", "Glacier", "but", "has", "not", "been", "retrieved", "for", "access", "." ]
train
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/glacierstorageprovider/src/main/java/org/duracloud/glacierstorage/GlacierStorageProvider.java#L116-L129
citrusframework/citrus
modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/server/FtpServerFtpLet.java
FtpServerFtpLet.writeFtpReply
private void writeFtpReply(FtpSession session, FtpMessage response) { """ Construct ftp reply from response message and write reply to given session. @param session @param response """ try { CommandResultType commandResult = response.getPayload(CommandResultType.class); FtpRep...
java
private void writeFtpReply(FtpSession session, FtpMessage response) { try { CommandResultType commandResult = response.getPayload(CommandResultType.class); FtpReply reply = new DefaultFtpReply(Integer.valueOf(commandResult.getReplyCode()), commandResult.getReplyString()); se...
[ "private", "void", "writeFtpReply", "(", "FtpSession", "session", ",", "FtpMessage", "response", ")", "{", "try", "{", "CommandResultType", "commandResult", "=", "response", ".", "getPayload", "(", "CommandResultType", ".", "class", ")", ";", "FtpReply", "reply", ...
Construct ftp reply from response message and write reply to given session. @param session @param response
[ "Construct", "ftp", "reply", "from", "response", "message", "and", "write", "reply", "to", "given", "session", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/server/FtpServerFtpLet.java#L171-L180
FlyingHe/UtilsMaven
src/main/java/com/github/flyinghe/tools/JDBCUtils.java
JDBCUtils.release
public static void release(ResultSet result, Statement statement, Connection connection) { """ 关闭与数据库的连接资源,包括‘ResultSet’‘Statement’‘Connection’ 的实例对象所占用的资源,注意顺序不能颠倒 @param result 结果集 @param statement 执行SQL语句的Statement对象 @param connection 连接数据库的连接对象 """ if (result != null) { try { ...
java
public static void release(ResultSet result, Statement statement, Connection connection) { if (result != null) { try { result.close(); } catch (SQLException e) { e.printStackTrace(); } } if (statement != null) { try...
[ "public", "static", "void", "release", "(", "ResultSet", "result", ",", "Statement", "statement", ",", "Connection", "connection", ")", "{", "if", "(", "result", "!=", "null", ")", "{", "try", "{", "result", ".", "close", "(", ")", ";", "}", "catch", "...
关闭与数据库的连接资源,包括‘ResultSet’‘Statement’‘Connection’ 的实例对象所占用的资源,注意顺序不能颠倒 @param result 结果集 @param statement 执行SQL语句的Statement对象 @param connection 连接数据库的连接对象
[ "关闭与数据库的连接资源,包括‘ResultSet’‘Statement’‘Connection’", "的实例对象所占用的资源,注意顺序不能颠倒" ]
train
https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/JDBCUtils.java#L206-L226
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java
TrustedIdProvidersInner.updateAsync
public Observable<TrustedIdProviderInner> updateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, UpdateTrustedIdProviderParameters parameters) { """ Updates the specified trusted identity provider. @param resourceGroupName The name of the Azure resource group. @param accountNam...
java
public Observable<TrustedIdProviderInner> updateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, UpdateTrustedIdProviderParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).map(new Func1<ServiceResponse...
[ "public", "Observable", "<", "TrustedIdProviderInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "trustedIdProviderName", ",", "UpdateTrustedIdProviderParameters", "parameters", ")", "{", "return", "updateWithServic...
Updates the specified trusted identity provider. @param resourceGroupName The name of the Azure resource group. @param accountName The name of the Data Lake Store account. @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of providers in the account. @param parame...
[ "Updates", "the", "specified", "trusted", "identity", "provider", "." ]
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/TrustedIdProvidersInner.java#L538-L545
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/service/RegistryService.java
RegistryService.pushImages
public void pushImages(Collection<ImageConfiguration> imageConfigs, int retries, RegistryConfig registryConfig, boolean skipTag) throws DockerAccessException, MojoExecutionException { """ Push a set of images to a registry @param imageConfigs images to push (but only if they have a bu...
java
public void pushImages(Collection<ImageConfiguration> imageConfigs, int retries, RegistryConfig registryConfig, boolean skipTag) throws DockerAccessException, MojoExecutionException { for (ImageConfiguration imageConfig : imageConfigs) { BuildImageConfiguration buildConfig...
[ "public", "void", "pushImages", "(", "Collection", "<", "ImageConfiguration", ">", "imageConfigs", ",", "int", "retries", ",", "RegistryConfig", "registryConfig", ",", "boolean", "skipTag", ")", "throws", "DockerAccessException", ",", "MojoExecutionException", "{", "f...
Push a set of images to a registry @param imageConfigs images to push (but only if they have a build configuration) @param retries how often to retry @param registryConfig a global registry configuration @param skipTag flag to skip pushing tagged images @throws DockerAccessException @throws MojoExecutionException
[ "Push", "a", "set", "of", "images", "to", "a", "registry" ]
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RegistryService.java#L44-L71
meraki-analytics/datapipelines-java
src/main/java/com/merakianalytics/datapipelines/DataPipeline.java
DataPipeline.putMany
@SuppressWarnings("unchecked") // Pipeline ensures the proper type will be accepted by putMany public <T> void putMany(final Class<T> type, final Iterable<T> items) { """ Puts multiple data elements into all accepting {@link com.merakianalytics.datapipelines.sinks.DataSink}s in the {@link com.merakianalytics....
java
@SuppressWarnings("unchecked") // Pipeline ensures the proper type will be accepted by putMany public <T> void putMany(final Class<T> type, final Iterable<T> items) { final Set<SinkHandler<?, ?>> handlers = getSinkHandlers(type); if(handlers.isEmpty()) { return; } final...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// Pipeline ensures the proper type will be accepted by putMany", "public", "<", "T", ">", "void", "putMany", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Iterable", "<", "T", ">", "items", ")", ...
Puts multiple data elements into all accepting {@link com.merakianalytics.datapipelines.sinks.DataSink}s in the {@link com.merakianalytics.datapipelines.DataPipeline} @param <T> the type of the data that should be stored @param type the type of the data that should be stored @param items the data to be stored
[ "Puts", "multiple", "data", "elements", "into", "all", "accepting", "{", "@link", "com", ".", "merakianalytics", ".", "datapipelines", ".", "sinks", ".", "DataSink", "}", "s", "in", "the", "{", "@link", "com", ".", "merakianalytics", ".", "datapipelines", "....
train
https://github.com/meraki-analytics/datapipelines-java/blob/376ff1e8e1f7c67f2f2a5521d2a66e91467e56b0/src/main/java/com/merakianalytics/datapipelines/DataPipeline.java#L382-L395
Graylog2/graylog2-server
graylog2-server/src/main/java/org/graylog2/plugin/Tools.java
Tools.decompressZlib
public static String decompressZlib(byte[] compressedData, long maxBytes) throws IOException { """ Decompress ZLIB (RFC 1950) compressed data @param compressedData A byte array containing the ZLIB-compressed data. @param maxBytes The maximum number of uncompressed bytes to read. @return A string contain...
java
public static String decompressZlib(byte[] compressedData, long maxBytes) throws IOException { try (final ByteArrayInputStream dataStream = new ByteArrayInputStream(compressedData); final InflaterInputStream in = new InflaterInputStream(dataStream); final InputStream limited = ByteStre...
[ "public", "static", "String", "decompressZlib", "(", "byte", "[", "]", "compressedData", ",", "long", "maxBytes", ")", "throws", "IOException", "{", "try", "(", "final", "ByteArrayInputStream", "dataStream", "=", "new", "ByteArrayInputStream", "(", "compressedData",...
Decompress ZLIB (RFC 1950) compressed data @param compressedData A byte array containing the ZLIB-compressed data. @param maxBytes The maximum number of uncompressed bytes to read. @return A string containing the decompressed data
[ "Decompress", "ZLIB", "(", "RFC", "1950", ")", "compressed", "data" ]
train
https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/plugin/Tools.java#L212-L218
fuinorg/utils4swing
src/main/java/org/fuin/utils4swing/dialogs/DirectorySelectionPanel.java
DirectorySelectionPanel.getButtonCancel
protected final JButton getButtonCancel() { """ Returns the 'Cancel' button for usage as default button. @return Button. """ if (buttonCancel == null) { buttonCancel = new JButton(); buttonCancel.setText("Cancel"); buttonCancel.setPreferredSize(new Dimension(8...
java
protected final JButton getButtonCancel() { if (buttonCancel == null) { buttonCancel = new JButton(); buttonCancel.setText("Cancel"); buttonCancel.setPreferredSize(new Dimension(80, 26)); buttonCancel.addActionListener(new ActionListener() { ...
[ "protected", "final", "JButton", "getButtonCancel", "(", ")", "{", "if", "(", "buttonCancel", "==", "null", ")", "{", "buttonCancel", "=", "new", "JButton", "(", ")", ";", "buttonCancel", ".", "setText", "(", "\"Cancel\"", ")", ";", "buttonCancel", ".", "s...
Returns the 'Cancel' button for usage as default button. @return Button.
[ "Returns", "the", "Cancel", "button", "for", "usage", "as", "default", "button", "." ]
train
https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/dialogs/DirectorySelectionPanel.java#L174-L188
jaredrummler/AndroidShell
library/src/main/java/com/jaredrummler/android/shell/Shell.java
Shell.runWithEnv
@WorkerThread public static Process runWithEnv(@NonNull String command, Map<String, String> environment) throws IOException { """ <p>This code is adapted from java.lang.ProcessBuilder.start().</p> <p>The problem is that Android doesn't allow us to modify the map returned by ProcessBuilder.environment(), even ...
java
@WorkerThread public static Process runWithEnv(@NonNull String command, Map<String, String> environment) throws IOException { String[] env; if (environment != null && environment.size() != 0) { Map<String, String> newEnvironment = new HashMap<>(); newEnvironment.putAll(System.getenv()); newE...
[ "@", "WorkerThread", "public", "static", "Process", "runWithEnv", "(", "@", "NonNull", "String", "command", ",", "Map", "<", "String", ",", "String", ">", "environment", ")", "throws", "IOException", "{", "String", "[", "]", "env", ";", "if", "(", "environ...
<p>This code is adapted from java.lang.ProcessBuilder.start().</p> <p>The problem is that Android doesn't allow us to modify the map returned by ProcessBuilder.environment(), even though the JavaDoc indicates that it should. This is because it simply returns the SystemEnvironment object that System.getenv() gives us. ...
[ "<p", ">", "This", "code", "is", "adapted", "from", "java", ".", "lang", ".", "ProcessBuilder", ".", "start", "()", ".", "<", "/", "p", ">" ]
train
https://github.com/jaredrummler/AndroidShell/blob/0826b6f93c208b7bc95344dd20e2989d367a1e43/library/src/main/java/com/jaredrummler/android/shell/Shell.java#L203-L220
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java
SelectListUtil.isEqualWithMatching
private static boolean isEqualWithMatching(final Object option, final Object data) { """ Check for a valid option. Allowing for option/code and legacy matching. @param option the option to test for a match @param data the test data value @return true if the option and data are a match """ return Util.eq...
java
private static boolean isEqualWithMatching(final Object option, final Object data) { return Util.equals(option, data) || isOptionCodeMatch(option, data) || isLegacyMatch(option, data); }
[ "private", "static", "boolean", "isEqualWithMatching", "(", "final", "Object", "option", ",", "final", "Object", "data", ")", "{", "return", "Util", ".", "equals", "(", "option", ",", "data", ")", "||", "isOptionCodeMatch", "(", "option", ",", "data", ")", ...
Check for a valid option. Allowing for option/code and legacy matching. @param option the option to test for a match @param data the test data value @return true if the option and data are a match
[ "Check", "for", "a", "valid", "option", ".", "Allowing", "for", "option", "/", "code", "and", "legacy", "matching", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java#L162-L165
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/GlobalTransformerRegistry.java
GlobalTransformerRegistry.registerTransformer
public void registerTransformer(final PathAddress address, int major, int minor, String operationName, OperationTransformer transformer) { """ Register an operation transformer. @param address the operation handler address @param major the major version @param minor the minor version @param operationName the...
java
public void registerTransformer(final PathAddress address, int major, int minor, String operationName, OperationTransformer transformer) { registerTransformer(address.iterator(), ModelVersion.create(major, minor), operationName, new OperationTransformerRegistry.OperationTransformerEntry(transformer, false)); ...
[ "public", "void", "registerTransformer", "(", "final", "PathAddress", "address", ",", "int", "major", ",", "int", "minor", ",", "String", "operationName", ",", "OperationTransformer", "transformer", ")", "{", "registerTransformer", "(", "address", ".", "iterator", ...
Register an operation transformer. @param address the operation handler address @param major the major version @param minor the minor version @param operationName the operation name @param transformer the operation transformer
[ "Register", "an", "operation", "transformer", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/GlobalTransformerRegistry.java#L88-L90
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java
ImageBandMath.stdDev
public static void stdDev(Planar<GrayS64> input, GrayS64 output, @Nullable GrayS64 avg) { """ Computes the standard deviation for each pixel across all bands in the {@link Planar} image. @param input Planar image - not modified @param output Gray scale image containing average pixel values - modified @p...
java
public static void stdDev(Planar<GrayS64> input, GrayS64 output, @Nullable GrayS64 avg) { stdDev(input,output,avg,0,input.getNumBands() - 1); }
[ "public", "static", "void", "stdDev", "(", "Planar", "<", "GrayS64", ">", "input", ",", "GrayS64", "output", ",", "@", "Nullable", "GrayS64", "avg", ")", "{", "stdDev", "(", "input", ",", "output", ",", "avg", ",", "0", ",", "input", ".", "getNumBands"...
Computes the standard deviation for each pixel across all bands in the {@link Planar} image. @param input Planar image - not modified @param output Gray scale image containing average pixel values - modified @param avg Input Gray scale image containing average image. Can be null
[ "Computes", "the", "standard", "deviation", "for", "each", "pixel", "across", "all", "bands", "in", "the", "{" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java#L859-L861
FasterXML/jackson-jr
jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/JSONReader.java
JSONReader.readListOf
@SuppressWarnings("unchecked") public <T> List<T> readListOf(Class<T> type) throws IOException { """ Method for reading a JSON Array from input and building a {@link java.util.List} out of it. Note that if input does NOT contain a JSON Array, {@link JSONObjectException} will be thrown. """ if (_p...
java
@SuppressWarnings("unchecked") public <T> List<T> readListOf(Class<T> type) throws IOException { if (_parser.isExpectedStartArrayToken()) { return (List<T>) new CollectionReader(List.class, _readerLocator.findReader(type)).read(this, _parser); } if (_parser.hasToken(JsonToken...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "List", "<", "T", ">", "readListOf", "(", "Class", "<", "T", ">", "type", ")", "throws", "IOException", "{", "if", "(", "_parser", ".", "isExpectedStartArrayToken", "(", ")", ")...
Method for reading a JSON Array from input and building a {@link java.util.List} out of it. Note that if input does NOT contain a JSON Array, {@link JSONObjectException} will be thrown.
[ "Method", "for", "reading", "a", "JSON", "Array", "from", "input", "and", "building", "a", "{" ]
train
https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/JSONReader.java#L254-L265
ocelotds/ocelot
ocelot-dashboard/src/main/java/org/ocelotds/dashboard/services/ServiceTools.java
ServiceTools.getTemplateOfIterable
String getTemplateOfIterable(Type[] actualTypeArguments, IJsonMarshaller jsonMarshaller) { """ Get template of iterable class from generic type @param actualTypeArguments @return """ String res = "["; for (Type actualTypeArgument : actualTypeArguments) { String template = _getTemplateOfType(actua...
java
String getTemplateOfIterable(Type[] actualTypeArguments, IJsonMarshaller jsonMarshaller) { String res = "["; for (Type actualTypeArgument : actualTypeArguments) { String template = _getTemplateOfType(actualTypeArgument, jsonMarshaller); res += template + "," + template; break; } return res + "]"...
[ "String", "getTemplateOfIterable", "(", "Type", "[", "]", "actualTypeArguments", ",", "IJsonMarshaller", "jsonMarshaller", ")", "{", "String", "res", "=", "\"[\"", ";", "for", "(", "Type", "actualTypeArgument", ":", "actualTypeArguments", ")", "{", "String", "temp...
Get template of iterable class from generic type @param actualTypeArguments @return
[ "Get", "template", "of", "iterable", "class", "from", "generic", "type" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-dashboard/src/main/java/org/ocelotds/dashboard/services/ServiceTools.java#L267-L275
chen0040/java-moea
src/main/java/com/github/chen0040/moea/problems/TNK.java
TNK.getConstraint
private double getConstraint(double x1, double x2) { """ use the design parameters to compute the constraint equation to get the value """ double c1,c2,h; c1 = -x1*x1-x2*x2+1+0.1*Math.cos(16*Math.atan(x1/x2)); c2 = (x1-0.5)*(x1-0.5)+(x2-0.5)*(x2-0.5)-0.5; if(c1>c2) h = (c1>0)?c...
java
private double getConstraint(double x1, double x2) { double c1,c2,h; c1 = -x1*x1-x2*x2+1+0.1*Math.cos(16*Math.atan(x1/x2)); c2 = (x1-0.5)*(x1-0.5)+(x2-0.5)*(x2-0.5)-0.5; if(c1>c2) h = (c1>0)?c1:0; else h = (c2>0)?c2:0; return h; }
[ "private", "double", "getConstraint", "(", "double", "x1", ",", "double", "x2", ")", "{", "double", "c1", ",", "c2", ",", "h", ";", "c1", "=", "-", "x1", "*", "x1", "-", "x2", "*", "x2", "+", "1", "+", "0.1", "*", "Math", ".", "cos", "(", "16...
use the design parameters to compute the constraint equation to get the value
[ "use", "the", "design", "parameters", "to", "compute", "the", "constraint", "equation", "to", "get", "the", "value" ]
train
https://github.com/chen0040/java-moea/blob/2d865b5ba5a333f44883333efe590460aad7d545/src/main/java/com/github/chen0040/moea/problems/TNK.java#L42-L52
zaproxy/zaproxy
src/org/zaproxy/zap/extension/api/ApiImplementor.java
ApiImplementor.validateApiElement
private static void validateApiElement(List<? extends ApiElement> apiElements, ApiElement apiElement) { """ Validates that the name of the given {@code ApiElement} does not already exist in the given list of {@code ApiElement}. <p> The names should be unique as they are used to select the {@code ApiElement}s. ...
java
private static void validateApiElement(List<? extends ApiElement> apiElements, ApiElement apiElement) { String name = apiElement.getName(); apiElements.stream().filter(e -> name.equals(e.getName())).findFirst().ifPresent(e -> { throw new IllegalArgumentException("An ApiElement with the given name already exists:...
[ "private", "static", "void", "validateApiElement", "(", "List", "<", "?", "extends", "ApiElement", ">", "apiElements", ",", "ApiElement", "apiElement", ")", "{", "String", "name", "=", "apiElement", ".", "getName", "(", ")", ";", "apiElements", ".", "stream", ...
Validates that the name of the given {@code ApiElement} does not already exist in the given list of {@code ApiElement}. <p> The names should be unique as they are used to select the {@code ApiElement}s. @param apiElements the existing API elements. @param apiElement the API element to validate. @throws IllegalArgument...
[ "Validates", "that", "the", "name", "of", "the", "given", "{", "@code", "ApiElement", "}", "does", "not", "already", "exist", "in", "the", "given", "list", "of", "{", "@code", "ApiElement", "}", ".", "<p", ">", "The", "names", "should", "be", "unique", ...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/ApiImplementor.java#L99-L104
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java
ExtendedSwidProcessor.setProductFamily
public ExtendedSwidProcessor setProductFamily(final String productFamily) { """ Defines product family (tag: product_family). @param productFamily product family @return a reference to this object. """ swidTag.setProductFamily(new Token(productFamily, idGenerator.nextId())); return this; ...
java
public ExtendedSwidProcessor setProductFamily(final String productFamily) { swidTag.setProductFamily(new Token(productFamily, idGenerator.nextId())); return this; }
[ "public", "ExtendedSwidProcessor", "setProductFamily", "(", "final", "String", "productFamily", ")", "{", "swidTag", ".", "setProductFamily", "(", "new", "Token", "(", "productFamily", ",", "idGenerator", ".", "nextId", "(", ")", ")", ")", ";", "return", "this",...
Defines product family (tag: product_family). @param productFamily product family @return a reference to this object.
[ "Defines", "product", "family", "(", "tag", ":", "product_family", ")", "." ]
train
https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java#L101-L104
Netflix/conductor
core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java
TaskServiceImpl.ackTaskReceived
@Service public String ackTaskReceived(String taskId, String workerId) { """ Ack Task is received. @param taskId Id of the task @param workerId Id of the worker @return `true|false` if task if received or not """ LOGGER.debug("Ack received for task: {} from worker: {}", taskId, workerId); ...
java
@Service public String ackTaskReceived(String taskId, String workerId) { LOGGER.debug("Ack received for task: {} from worker: {}", taskId, workerId); return String.valueOf(ackTaskReceived(taskId)); }
[ "@", "Service", "public", "String", "ackTaskReceived", "(", "String", "taskId", ",", "String", "workerId", ")", "{", "LOGGER", ".", "debug", "(", "\"Ack received for task: {} from worker: {}\"", ",", "taskId", ",", "workerId", ")", ";", "return", "String", ".", ...
Ack Task is received. @param taskId Id of the task @param workerId Id of the worker @return `true|false` if task if received or not
[ "Ack", "Task", "is", "received", "." ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java#L147-L151
code4everything/util
src/main/java/com/zhazhapan/util/Checker.java
Checker.checkNull
public static Character checkNull(Character value, char elseValue) { """ 检查Character是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Character} @since 1.0.8 """ return checkNull(value, Character.valueOf(elseValue)); }
java
public static Character checkNull(Character value, char elseValue) { return checkNull(value, Character.valueOf(elseValue)); }
[ "public", "static", "Character", "checkNull", "(", "Character", "value", ",", "char", "elseValue", ")", "{", "return", "checkNull", "(", "value", ",", "Character", ".", "valueOf", "(", "elseValue", ")", ")", ";", "}" ]
检查Character是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Character} @since 1.0.8
[ "检查Character是否为null" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L1391-L1393
taimos/RESTUtils
src/main/java/de/taimos/restutils/RESTAssert.java
RESTAssert.assertInt
public static void assertInt(final String string, final StatusType status) { """ assert that string matches [+-]?[0-9]* @param string the string to check @param status the status code to throw @throws WebApplicationException with given status code """ RESTAssert.assertNotEmpty(string); RESTAssert.asse...
java
public static void assertInt(final String string, final StatusType status) { RESTAssert.assertNotEmpty(string); RESTAssert.assertPattern(string, "[+-]?[0-9]*", status); }
[ "public", "static", "void", "assertInt", "(", "final", "String", "string", ",", "final", "StatusType", "status", ")", "{", "RESTAssert", ".", "assertNotEmpty", "(", "string", ")", ";", "RESTAssert", ".", "assertPattern", "(", "string", ",", "\"[+-]?[0-9]*\"", ...
assert that string matches [+-]?[0-9]* @param string the string to check @param status the status code to throw @throws WebApplicationException with given status code
[ "assert", "that", "string", "matches", "[", "+", "-", "]", "?", "[", "0", "-", "9", "]", "*" ]
train
https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L277-L280
phax/ph-schedule
ph-mini-quartz/src/main/java/com/helger/quartz/impl/triggers/DailyTimeIntervalTrigger.java
DailyTimeIntervalTrigger.setRepeatIntervalUnit
public void setRepeatIntervalUnit (final EIntervalUnit intervalUnit) { """ <p> Set the interval unit - the time unit on with the interval applies. </p> @param intervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are {@link EIntervalUnit#SECOND}, {@link EInterval...
java
public void setRepeatIntervalUnit (final EIntervalUnit intervalUnit) { if (m_eRepeatIntervalUnit == null || !((m_eRepeatIntervalUnit.equals (EIntervalUnit.SECOND) || m_eRepeatIntervalUnit.equals (EIntervalUnit.MINUTE) || m_eRepeatIntervalUnit.equals (EIntervalUnit.HOUR)))) thro...
[ "public", "void", "setRepeatIntervalUnit", "(", "final", "EIntervalUnit", "intervalUnit", ")", "{", "if", "(", "m_eRepeatIntervalUnit", "==", "null", "||", "!", "(", "(", "m_eRepeatIntervalUnit", ".", "equals", "(", "EIntervalUnit", ".", "SECOND", ")", "||", "m_...
<p> Set the interval unit - the time unit on with the interval applies. </p> @param intervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are {@link EIntervalUnit#SECOND}, {@link EIntervalUnit#MINUTE}, and {@link EIntervalUnit#HOUR}.
[ "<p", ">", "Set", "the", "interval", "unit", "-", "the", "time", "unit", "on", "with", "the", "interval", "applies", ".", "<", "/", "p", ">" ]
train
https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/triggers/DailyTimeIntervalTrigger.java#L413-L421
ixa-ehu/kaflib
src/main/java/ixa/kaflib/KAFDocument.java
KAFDocument.newCoref
public Coref newCoref(String id, List<Span<Term>> mentions) { """ Creates a coreference object to load an existing Coref. It receives it's ID as an argument. The Coref is added to the document. @param id the ID of the coreference. @param references different mentions (list of targets) to the same entity. @retur...
java
public Coref newCoref(String id, List<Span<Term>> mentions) { idManager.updateCounter(AnnotationType.COREF, id); Coref newCoref = new Coref(id, mentions); annotationContainer.add(newCoref, Layer.COREFERENCES, AnnotationType.COREF); return newCoref; }
[ "public", "Coref", "newCoref", "(", "String", "id", ",", "List", "<", "Span", "<", "Term", ">", ">", "mentions", ")", "{", "idManager", ".", "updateCounter", "(", "AnnotationType", ".", "COREF", ",", "id", ")", ";", "Coref", "newCoref", "=", "new", "Co...
Creates a coreference object to load an existing Coref. It receives it's ID as an argument. The Coref is added to the document. @param id the ID of the coreference. @param references different mentions (list of targets) to the same entity. @return a new coreference.
[ "Creates", "a", "coreference", "object", "to", "load", "an", "existing", "Coref", ".", "It", "receives", "it", "s", "ID", "as", "an", "argument", ".", "The", "Coref", "is", "added", "to", "the", "document", "." ]
train
https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L756-L761
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/model/BaseDrawerItem.java
BaseDrawerItem.getTextColorStateList
protected ColorStateList getTextColorStateList(@ColorInt int color, @ColorInt int selectedTextColor) { """ helper to get the ColorStateList for the text and remembering it so we do not have to recreate it all the time @param color @param selectedTextColor @return """ if (colorStateList == null || ...
java
protected ColorStateList getTextColorStateList(@ColorInt int color, @ColorInt int selectedTextColor) { if (colorStateList == null || color + selectedTextColor != colorStateList.first) { colorStateList = new Pair<>(color + selectedTextColor, DrawerUIUtils.getTextColorStateList(color, selectedTextColo...
[ "protected", "ColorStateList", "getTextColorStateList", "(", "@", "ColorInt", "int", "color", ",", "@", "ColorInt", "int", "selectedTextColor", ")", "{", "if", "(", "colorStateList", "==", "null", "||", "color", "+", "selectedTextColor", "!=", "colorStateList", "....
helper to get the ColorStateList for the text and remembering it so we do not have to recreate it all the time @param color @param selectedTextColor @return
[ "helper", "to", "get", "the", "ColorStateList", "for", "the", "text", "and", "remembering", "it", "so", "we", "do", "not", "have", "to", "recreate", "it", "all", "the", "time" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/model/BaseDrawerItem.java#L342-L348
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/UtilDenoiseWavelet.java
UtilDenoiseWavelet.universalThreshold
public static double universalThreshold(ImageGray image , double noiseSigma ) { """ <p> Computes the universal threshold defined in [1], which is the threshold used by VisuShrink. The same threshold is used by other algorithms. </p> <p> threshold = &sigma; sqrt( 2*log(max(w,h))<br> where (w,h) is the imag...
java
public static double universalThreshold(ImageGray image , double noiseSigma ) { int w = image.width; int h = image.height; return noiseSigma*Math.sqrt(2*Math.log(Math.max(w,h))); }
[ "public", "static", "double", "universalThreshold", "(", "ImageGray", "image", ",", "double", "noiseSigma", ")", "{", "int", "w", "=", "image", ".", "width", ";", "int", "h", "=", "image", ".", "height", ";", "return", "noiseSigma", "*", "Math", ".", "sq...
<p> Computes the universal threshold defined in [1], which is the threshold used by VisuShrink. The same threshold is used by other algorithms. </p> <p> threshold = &sigma; sqrt( 2*log(max(w,h))<br> where (w,h) is the image's width and height. </p> <p> [1] D. L. Donoho and I. M. Johnstone, "Ideal spatial adaption vi...
[ "<p", ">", "Computes", "the", "universal", "threshold", "defined", "in", "[", "1", "]", "which", "is", "the", "threshold", "used", "by", "VisuShrink", ".", "The", "same", "threshold", "is", "used", "by", "other", "algorithms", ".", "<", "/", "p", ">" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/UtilDenoiseWavelet.java#L101-L106
mapbox/mapbox-plugins-android
plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/LocalizationPlugin.java
LocalizationPlugin.setMapLanguage
public void setMapLanguage(@NonNull Locale locale, boolean acceptFallback) { """ If you'd like to set the map language to a specific locale, you can pass it in as a parameter and MapLocale will try matching the information with one of the MapLocales found in its map. If one isn't found, a null point exception wi...
java
public void setMapLanguage(@NonNull Locale locale, boolean acceptFallback) { MapLocale mapLocale = MapLocale.getMapLocale(locale, acceptFallback); if (mapLocale != null) { Timber.d("Locale: %s, set MapLocale: %s", locale.toString(), mapLocale.getMapLanguage()); setMapLanguage(mapLocale); } else ...
[ "public", "void", "setMapLanguage", "(", "@", "NonNull", "Locale", "locale", ",", "boolean", "acceptFallback", ")", "{", "MapLocale", "mapLocale", "=", "MapLocale", ".", "getMapLocale", "(", "locale", ",", "acceptFallback", ")", ";", "if", "(", "mapLocale", "!...
If you'd like to set the map language to a specific locale, you can pass it in as a parameter and MapLocale will try matching the information with one of the MapLocales found in its map. If one isn't found, a null point exception will be thrown. To prevent this, ensure that the locale you are trying to use, has a compl...
[ "If", "you", "d", "like", "to", "set", "the", "map", "language", "to", "a", "specific", "locale", "you", "can", "pass", "it", "in", "as", "a", "parameter", "and", "MapLocale", "will", "try", "matching", "the", "information", "with", "one", "of", "the", ...
train
https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/LocalizationPlugin.java#L206-L214
EMCECS/nfs-client-java
src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java
Nfs3.makeMknodRequest
public Nfs3MknodRequest makeMknodRequest(byte[] parentDirectoryFileHandle, String name, NfsType type, NfsSetAttributes attributes, long[] rdev) throws FileNotFoundException { """ /* (non-Javadoc) @see com.emc.ecs.nfsclient.nfs.Nfs#makeMknodRequest(byte[], java.lang.String, com.emc.ecs.nfsclient.nfs.Nf...
java
public Nfs3MknodRequest makeMknodRequest(byte[] parentDirectoryFileHandle, String name, NfsType type, NfsSetAttributes attributes, long[] rdev) throws FileNotFoundException { return new Nfs3MknodRequest(parentDirectoryFileHandle, name, type, attributes, rdev, _credential); }
[ "public", "Nfs3MknodRequest", "makeMknodRequest", "(", "byte", "[", "]", "parentDirectoryFileHandle", ",", "String", "name", ",", "NfsType", "type", ",", "NfsSetAttributes", "attributes", ",", "long", "[", "]", "rdev", ")", "throws", "FileNotFoundException", "{", ...
/* (non-Javadoc) @see com.emc.ecs.nfsclient.nfs.Nfs#makeMknodRequest(byte[], java.lang.String, com.emc.ecs.nfsclient.nfs.NfsType, com.emc.ecs.nfsclient.nfs.NfsSetAttributes, long[])
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
train
https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java#L896-L899
lamydev/Android-Notification
core/src/zemin/notification/NotificationRemoteCallback.java
NotificationRemoteCallback.onClickRemote
public void onClickRemote(NotificationRemote remote, NotificationEntry entry) { """ Called when notification is clicked. @param remote @param entry """ if (DBG) Log.v(TAG, "onClickRemote - " + entry.ID); }
java
public void onClickRemote(NotificationRemote remote, NotificationEntry entry) { if (DBG) Log.v(TAG, "onClickRemote - " + entry.ID); }
[ "public", "void", "onClickRemote", "(", "NotificationRemote", "remote", ",", "NotificationEntry", "entry", ")", "{", "if", "(", "DBG", ")", "Log", ".", "v", "(", "TAG", ",", "\"onClickRemote - \"", "+", "entry", ".", "ID", ")", ";", "}" ]
Called when notification is clicked. @param remote @param entry
[ "Called", "when", "notification", "is", "clicked", "." ]
train
https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationRemoteCallback.java#L135-L137
astrapi69/mystic-crypt
crypt-data/src/main/java/de/alpharogroup/crypto/factories/SecretKeyFactoryExtensions.java
SecretKeyFactoryExtensions.newSecretKeySpec
public static SecretKeySpec newSecretKeySpec(final byte[] secretKey, final String algorithm) throws NoSuchAlgorithmException { """ Factory method for creating a new {@link SecretKeySpec} from the given algorithm and the given secret key as byte array. @param algorithm the algorithm @param secretKey the se...
java
public static SecretKeySpec newSecretKeySpec(final byte[] secretKey, final String algorithm) throws NoSuchAlgorithmException { final SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey, algorithm); return secretKeySpec; }
[ "public", "static", "SecretKeySpec", "newSecretKeySpec", "(", "final", "byte", "[", "]", "secretKey", ",", "final", "String", "algorithm", ")", "throws", "NoSuchAlgorithmException", "{", "final", "SecretKeySpec", "secretKeySpec", "=", "new", "SecretKeySpec", "(", "s...
Factory method for creating a new {@link SecretKeySpec} from the given algorithm and the given secret key as byte array. @param algorithm the algorithm @param secretKey the secret key @return the new {@link SecretKeySpec} from the given algorithm and the given secret key. @throws NoSuchAlgorithmException the no such a...
[ "Factory", "method", "for", "creating", "a", "new", "{", "@link", "SecretKeySpec", "}", "from", "the", "given", "algorithm", "and", "the", "given", "secret", "key", "as", "byte", "array", "." ]
train
https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/factories/SecretKeyFactoryExtensions.java#L96-L101
nguillaumin/slick2d-maven
slick2d-scalar/src/main/java/org/newdawn/slick/tools/scalar/ImageScale3x.java
ImageScale3x.getScaledImage
public BufferedImage getScaledImage() { """ Retrieve the scaled image. Note this is the method that actually does the work so it may take some time to return @return The newly scaled image """ RawScale3x scaler = new RawScale3x(srcData,width,height); BufferedImage image = new Bu...
java
public BufferedImage getScaledImage() { RawScale3x scaler = new RawScale3x(srcData,width,height); BufferedImage image = new BufferedImage(width*3,height*3,BufferedImage.TYPE_INT_ARGB); image.setRGB(0,0,width*3,height*3,scaler.getScaledData(),0,width*3); retur...
[ "public", "BufferedImage", "getScaledImage", "(", ")", "{", "RawScale3x", "scaler", "=", "new", "RawScale3x", "(", "srcData", ",", "width", ",", "height", ")", ";", "BufferedImage", "image", "=", "new", "BufferedImage", "(", "width", "*", "3", ",", "height",...
Retrieve the scaled image. Note this is the method that actually does the work so it may take some time to return @return The newly scaled image
[ "Retrieve", "the", "scaled", "image", ".", "Note", "this", "is", "the", "method", "that", "actually", "does", "the", "work", "so", "it", "may", "take", "some", "time", "to", "return" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-scalar/src/main/java/org/newdawn/slick/tools/scalar/ImageScale3x.java#L42-L50
VoltDB/voltdb
examples/json-sessions/client/jsonsessions/JSONClient.java
JSONClient.runQuery
private VoltTable runQuery(String description, String SQL) throws Exception { """ Demonstrates various JSON/flexible schema queries. @throws Exception if anything unexpected happens. """ System.out.println(description); ClientResponse resp = client.callProcedure("@AdHoc", SQL); Syste...
java
private VoltTable runQuery(String description, String SQL) throws Exception { System.out.println(description); ClientResponse resp = client.callProcedure("@AdHoc", SQL); System.out.println("SQL query: " + SQL); System.out.println(); VoltTable table = resp.getResults()[0]; ...
[ "private", "VoltTable", "runQuery", "(", "String", "description", ",", "String", "SQL", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "description", ")", ";", "ClientResponse", "resp", "=", "client", ".", "callProcedure", "(", "...
Demonstrates various JSON/flexible schema queries. @throws Exception if anything unexpected happens.
[ "Demonstrates", "various", "JSON", "/", "flexible", "schema", "queries", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/json-sessions/client/jsonsessions/JSONClient.java#L370-L379
selenide/selenide
src/main/java/com/codeborne/selenide/proxy/SelenideProxyServer.java
SelenideProxyServer.addRequestFilter
public void addRequestFilter(String name, RequestFilter requestFilter) { """ Add a custom request filter which allows to track/modify all requests from browser to server @param name unique name of filter @param requestFilter the filter """ if (isRequestFilterAdded(name)) { throw new IllegalArgume...
java
public void addRequestFilter(String name, RequestFilter requestFilter) { if (isRequestFilterAdded(name)) { throw new IllegalArgumentException("Duplicate request filter: " + name); } proxy.addRequestFilter(requestFilter); requestFilters.put(name, requestFilter); }
[ "public", "void", "addRequestFilter", "(", "String", "name", ",", "RequestFilter", "requestFilter", ")", "{", "if", "(", "isRequestFilterAdded", "(", "name", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Duplicate request filter: \"", "+", "name...
Add a custom request filter which allows to track/modify all requests from browser to server @param name unique name of filter @param requestFilter the filter
[ "Add", "a", "custom", "request", "filter", "which", "allows", "to", "track", "/", "modify", "all", "requests", "from", "browser", "to", "server" ]
train
https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/proxy/SelenideProxyServer.java#L78-L84
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Parser.java
Parser.parseSelectKeyword
public static boolean parseSelectKeyword(final char[] query, int offset) { """ Parse string to check presence of SELECT keyword regardless of case. @param query char[] of the query statement @param offset position of query to start checking @return boolean indicates presence of word """ if (query.leng...
java
public static boolean parseSelectKeyword(final char[] query, int offset) { if (query.length < (offset + 6)) { return false; } return (query[offset] | 32) == 's' && (query[offset + 1] | 32) == 'e' && (query[offset + 2] | 32) == 'l' && (query[offset + 3] | 32) == 'e' && ...
[ "public", "static", "boolean", "parseSelectKeyword", "(", "final", "char", "[", "]", "query", ",", "int", "offset", ")", "{", "if", "(", "query", ".", "length", "<", "(", "offset", "+", "6", ")", ")", "{", "return", "false", ";", "}", "return", "(", ...
Parse string to check presence of SELECT keyword regardless of case. @param query char[] of the query statement @param offset position of query to start checking @return boolean indicates presence of word
[ "Parse", "string", "to", "check", "presence", "of", "SELECT", "keyword", "regardless", "of", "case", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L643-L654
opencb/biodata
biodata-tools/src/main/java/org/opencb/biodata/tools/variant/VariantNormalizer.java
VariantNormalizer.reverseIndexOfDifference
public static int reverseIndexOfDifference(final CharSequence cs1, final CharSequence cs2) { """ <p>Compares two CharSequences, and returns the index beginning from the behind, at which the CharSequences begin to differ.</p> Based on {@link StringUtils#indexOfDifference} <p>For example, {@code reverseIndex...
java
public static int reverseIndexOfDifference(final CharSequence cs1, final CharSequence cs2) { if (cs1 == cs2) { return StringUtils.INDEX_NOT_FOUND; } if (cs1 == null || cs2 == null) { return 0; } int i; int cs1Length = cs1.length(); int cs2L...
[ "public", "static", "int", "reverseIndexOfDifference", "(", "final", "CharSequence", "cs1", ",", "final", "CharSequence", "cs2", ")", "{", "if", "(", "cs1", "==", "cs2", ")", "{", "return", "StringUtils", ".", "INDEX_NOT_FOUND", ";", "}", "if", "(", "cs1", ...
<p>Compares two CharSequences, and returns the index beginning from the behind, at which the CharSequences begin to differ.</p> Based on {@link StringUtils#indexOfDifference} <p>For example, {@code reverseIndexOfDifference("you are a machine", "i have one machine") -> 8}</p> <pre> reverseIndexOfDifference(null, null...
[ "<p", ">", "Compares", "two", "CharSequences", "and", "returns", "the", "index", "beginning", "from", "the", "behind", "at", "which", "the", "CharSequences", "begin", "to", "differ", ".", "<", "/", "p", ">" ]
train
https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/VariantNormalizer.java#L1088-L1108
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/XmlReader.java
XmlReader.readFloat
public float readFloat(float defaultValue, String attribute) { """ Read a float. @param defaultValue The value returned if attribute not found. @param attribute The float name (must not be <code>null</code>). @return The float value. @throws LionEngineException If invalid argument. """ return Flo...
java
public float readFloat(float defaultValue, String attribute) { return Float.parseFloat(getValue(String.valueOf(defaultValue), attribute)); }
[ "public", "float", "readFloat", "(", "float", "defaultValue", ",", "String", "attribute", ")", "{", "return", "Float", ".", "parseFloat", "(", "getValue", "(", "String", ".", "valueOf", "(", "defaultValue", ")", ",", "attribute", ")", ")", ";", "}" ]
Read a float. @param defaultValue The value returned if attribute not found. @param attribute The float name (must not be <code>null</code>). @return The float value. @throws LionEngineException If invalid argument.
[ "Read", "a", "float", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/XmlReader.java#L260-L263
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java
XmlSchemaParser.handleError
public static void handleError(final Node node, final String msg) { """ Handle an error condition as consequence of parsing. @param node that is the context of the warning. @param msg associated with the error. """ final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERRO...
java
public static void handleError(final Node node, final String msg) { final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERROR_HANDLER_KEY); if (handler == null) { throw new IllegalStateException("ERROR: " + formatLocationInfo(node) + msg); } ...
[ "public", "static", "void", "handleError", "(", "final", "Node", "node", ",", "final", "String", "msg", ")", "{", "final", "ErrorHandler", "handler", "=", "(", "ErrorHandler", ")", "node", ".", "getOwnerDocument", "(", ")", ".", "getUserData", "(", "ERROR_HA...
Handle an error condition as consequence of parsing. @param node that is the context of the warning. @param msg associated with the error.
[ "Handle", "an", "error", "condition", "as", "consequence", "of", "parsing", "." ]
train
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L238-L250
kirgor/enklib
sql/src/main/java/com/kirgor/enklib/sql/Session.java
Session.getSingle
public <T> T getSingle(String query, Class<T> entityClass, Object... params) throws SQLException, NoSuchFieldException, InstantiationException, IllegalAccessException { """ Executes SQL query, which returns single entity. @param <T> Entity type. @param query SQL query string. @param ...
java
public <T> T getSingle(String query, Class<T> entityClass, Object... params) throws SQLException, NoSuchFieldException, InstantiationException, IllegalAccessException { Cursor<T> cursor = getCursor(query, entityClass, params); return cursor.fetchSingle(); }
[ "public", "<", "T", ">", "T", "getSingle", "(", "String", "query", ",", "Class", "<", "T", ">", "entityClass", ",", "Object", "...", "params", ")", "throws", "SQLException", ",", "NoSuchFieldException", ",", "InstantiationException", ",", "IllegalAccessException...
Executes SQL query, which returns single entity. @param <T> Entity type. @param query SQL query string. @param entityClass Entity class. @param params Parameters, which will be placed instead of '?' signs. @return Single result entity. @throws SQLException In general SQL error case. @throw...
[ "Executes", "SQL", "query", "which", "returns", "single", "entity", "." ]
train
https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/sql/src/main/java/com/kirgor/enklib/sql/Session.java#L131-L135
spring-projects/spring-social
spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectSupport.java
ConnectSupport.buildOAuthUrl
public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) { """ Builds the provider URL to redirect the user to for connection authorization. @param connectionFactory the service provider's connection factory e.g. FacebookConnectionFactory @param request the current web reques...
java
public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request) { return buildOAuthUrl(connectionFactory, request, null); }
[ "public", "String", "buildOAuthUrl", "(", "ConnectionFactory", "<", "?", ">", "connectionFactory", ",", "NativeWebRequest", "request", ")", "{", "return", "buildOAuthUrl", "(", "connectionFactory", ",", "request", ",", "null", ")", ";", "}" ]
Builds the provider URL to redirect the user to for connection authorization. @param connectionFactory the service provider's connection factory e.g. FacebookConnectionFactory @param request the current web request @return the URL to redirect the user to for authorization @throws IllegalArgumentException if the connect...
[ "Builds", "the", "provider", "URL", "to", "redirect", "the", "user", "to", "for", "connection", "authorization", "." ]
train
https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectSupport.java#L112-L114
jbundle/jbundle
app/program/project/src/main/java/org/jbundle/app/program/project/report/ProjectReportScreen.java
ProjectReportScreen.getCurrentLevelInfo
public Record getCurrentLevelInfo(int iOffsetFromCurrentLevel, Record record) { """ Add to the current level, then get the record at this level If the record doesn't exist, clone a new one and return it. @param record The main record (that I will clone if I need to) @param iOffsetFromCurrentLevel The amount to...
java
public Record getCurrentLevelInfo(int iOffsetFromCurrentLevel, Record record) { int dLevel = (int)this.getScreenRecord().getField(ProjectTaskScreenRecord.CURRENT_LEVEL).getValue(); dLevel = dLevel + iOffsetFromCurrentLevel; this.getScreenRecord().getField(ProjectTaskScreenRecord.CURRENT_LEVE...
[ "public", "Record", "getCurrentLevelInfo", "(", "int", "iOffsetFromCurrentLevel", ",", "Record", "record", ")", "{", "int", "dLevel", "=", "(", "int", ")", "this", ".", "getScreenRecord", "(", ")", ".", "getField", "(", "ProjectTaskScreenRecord", ".", "CURRENT_L...
Add to the current level, then get the record at this level If the record doesn't exist, clone a new one and return it. @param record The main record (that I will clone if I need to) @param iOffsetFromCurrentLevel The amount to bump the level @return The record at this (new) level.
[ "Add", "to", "the", "current", "level", "then", "get", "the", "record", "at", "this", "level", "If", "the", "record", "doesn", "t", "exist", "clone", "a", "new", "one", "and", "return", "it", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/project/src/main/java/org/jbundle/app/program/project/report/ProjectReportScreen.java#L164-L179
google/closure-templates
java/src/com/google/template/soy/jbcsrc/shared/Names.java
Names.javaFileName
public static String javaFileName(String soyNamespace, String fileName) { """ Given the soy namespace and file name returns the path where the corresponding resource should be stored. """ checkArgument( BaseUtils.isDottedIdentifier(soyNamespace), "%s is not a valid soy namspace name.", ...
java
public static String javaFileName(String soyNamespace, String fileName) { checkArgument( BaseUtils.isDottedIdentifier(soyNamespace), "%s is not a valid soy namspace name.", soyNamespace); return (CLASS_PREFIX + soyNamespace).replace('.', '/') + '/' + fileName; }
[ "public", "static", "String", "javaFileName", "(", "String", "soyNamespace", ",", "String", "fileName", ")", "{", "checkArgument", "(", "BaseUtils", ".", "isDottedIdentifier", "(", "soyNamespace", ")", ",", "\"%s is not a valid soy namspace name.\"", ",", "soyNamespace"...
Given the soy namespace and file name returns the path where the corresponding resource should be stored.
[ "Given", "the", "soy", "namespace", "and", "file", "name", "returns", "the", "path", "where", "the", "corresponding", "resource", "should", "be", "stored", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/shared/Names.java#L58-L64
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java
GoogleCloudStorageImpl.createItemInfoForStorageObject
public static GoogleCloudStorageItemInfo createItemInfoForStorageObject( StorageResourceId resourceId, StorageObject object) { """ Helper for converting a StorageResourceId + StorageObject into a GoogleCloudStorageItemInfo. """ Preconditions.checkArgument(resourceId != null, "resourceId must not be n...
java
public static GoogleCloudStorageItemInfo createItemInfoForStorageObject( StorageResourceId resourceId, StorageObject object) { Preconditions.checkArgument(resourceId != null, "resourceId must not be null"); Preconditions.checkArgument(object != null, "object must not be null"); Preconditions.checkArgu...
[ "public", "static", "GoogleCloudStorageItemInfo", "createItemInfoForStorageObject", "(", "StorageResourceId", "resourceId", ",", "StorageObject", "object", ")", "{", "Preconditions", ".", "checkArgument", "(", "resourceId", "!=", "null", ",", "\"resourceId must not be null\""...
Helper for converting a StorageResourceId + StorageObject into a GoogleCloudStorageItemInfo.
[ "Helper", "for", "converting", "a", "StorageResourceId", "+", "StorageObject", "into", "a", "GoogleCloudStorageItemInfo", "." ]
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1470-L1515
EvidentSolutions/dalesbred
dalesbred/src/main/java/org/dalesbred/Database.java
Database.findAll
public @NotNull <T> List<T> findAll(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) { """ Executes a query and converts the results to instances of given class using default mechanisms. """ return findAll(cl, SqlQuery.query(sql, args)); }
java
public @NotNull <T> List<T> findAll(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) { return findAll(cl, SqlQuery.query(sql, args)); }
[ "public", "@", "NotNull", "<", "T", ">", "List", "<", "T", ">", "findAll", "(", "@", "NotNull", "Class", "<", "T", ">", "cl", ",", "@", "NotNull", "@", "SQL", "String", "sql", ",", "Object", "...", "args", ")", "{", "return", "findAll", "(", "cl"...
Executes a query and converts the results to instances of given class using default mechanisms.
[ "Executes", "a", "query", "and", "converts", "the", "results", "to", "instances", "of", "given", "class", "using", "default", "mechanisms", "." ]
train
https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L322-L324
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java
SourceMapGenerator.fromSourceMap
public static SourceMapGenerator fromSourceMap(SourceMapConsumer aSourceMapConsumer) { """ Creates a new SourceMapGenerator based on a SourceMapConsumer @param aSourceMapConsumer The SourceMap. """ String sourceRoot = aSourceMapConsumer.sourceRoot; SourceMapGenerator generator = new SourceM...
java
public static SourceMapGenerator fromSourceMap(SourceMapConsumer aSourceMapConsumer) { String sourceRoot = aSourceMapConsumer.sourceRoot; SourceMapGenerator generator = new SourceMapGenerator(aSourceMapConsumer.file, sourceRoot); aSourceMapConsumer.eachMapping().forEach(mapping -> { ...
[ "public", "static", "SourceMapGenerator", "fromSourceMap", "(", "SourceMapConsumer", "aSourceMapConsumer", ")", "{", "String", "sourceRoot", "=", "aSourceMapConsumer", ".", "sourceRoot", ";", "SourceMapGenerator", "generator", "=", "new", "SourceMapGenerator", "(", "aSour...
Creates a new SourceMapGenerator based on a SourceMapConsumer @param aSourceMapConsumer The SourceMap.
[ "Creates", "a", "new", "SourceMapGenerator", "based", "on", "a", "SourceMapConsumer" ]
train
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java#L57-L81
apache/flink
flink-core/src/main/java/org/apache/flink/configuration/Configuration.java
Configuration.getString
@PublicEvolving public String getString(ConfigOption<String> configOption, String overrideDefault) { """ Returns the value associated with the given config option as a string. If no value is mapped under any key of the option, it returns the specified default instead of the option's default value. @param con...
java
@PublicEvolving public String getString(ConfigOption<String> configOption, String overrideDefault) { Object o = getRawValueFromOption(configOption); return o == null ? overrideDefault : o.toString(); }
[ "@", "PublicEvolving", "public", "String", "getString", "(", "ConfigOption", "<", "String", ">", "configOption", ",", "String", "overrideDefault", ")", "{", "Object", "o", "=", "getRawValueFromOption", "(", "configOption", ")", ";", "return", "o", "==", "null", ...
Returns the value associated with the given config option as a string. If no value is mapped under any key of the option, it returns the specified default instead of the option's default value. @param configOption The configuration option @return the (default) value associated with the given config option
[ "Returns", "the", "value", "associated", "with", "the", "given", "config", "option", "as", "a", "string", ".", "If", "no", "value", "is", "mapped", "under", "any", "key", "of", "the", "option", "it", "returns", "the", "specified", "default", "instead", "of...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L163-L167
mfornos/humanize
humanize-slim/src/main/java/humanize/text/ExtendedMessageFormat.java
ExtendedMessageFormat.getQuotedString
private void getQuotedString(String pattern, ParsePosition pos, boolean escapingOn) { """ Consume quoted string only @param pattern pattern to parse @param pos current parse position @param escapingOn whether to process escaped quotes """ appendQuotedString(pattern, pos, null, escapingOn); ...
java
private void getQuotedString(String pattern, ParsePosition pos, boolean escapingOn) { appendQuotedString(pattern, pos, null, escapingOn); }
[ "private", "void", "getQuotedString", "(", "String", "pattern", ",", "ParsePosition", "pos", ",", "boolean", "escapingOn", ")", "{", "appendQuotedString", "(", "pattern", ",", "pos", ",", "null", ",", "escapingOn", ")", ";", "}" ]
Consume quoted string only @param pattern pattern to parse @param pos current parse position @param escapingOn whether to process escaped quotes
[ "Consume", "quoted", "string", "only" ]
train
https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/text/ExtendedMessageFormat.java#L475-L479
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java
ShuttleListBinding.arraysEqual
protected boolean arraysEqual(Object[] a1, Object[] a2) { """ Compare two arrays for equality using the configured comparator. @param a1 First array to compare @param a2 Second array to compare @return boolean true if they are equal """ if (a1 != null && a2 != null && a1.length == a2.length) { // Loo...
java
protected boolean arraysEqual(Object[] a1, Object[] a2) { if (a1 != null && a2 != null && a1.length == a2.length) { // Loop over each element and compare them using our comparator for (int i = 0; i < a1.length; i++) { if (!equalByComparator(a1[i], a2[i])) { return false; } } return true; } ...
[ "protected", "boolean", "arraysEqual", "(", "Object", "[", "]", "a1", ",", "Object", "[", "]", "a2", ")", "{", "if", "(", "a1", "!=", "null", "&&", "a2", "!=", "null", "&&", "a1", ".", "length", "==", "a2", ".", "length", ")", "{", "// Loop over ea...
Compare two arrays for equality using the configured comparator. @param a1 First array to compare @param a2 Second array to compare @return boolean true if they are equal
[ "Compare", "two", "arrays", "for", "equality", "using", "the", "configured", "comparator", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java#L351-L365
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.byteAt
public byte byteAt(int i) { """ Gets a byte within this sequence of bytes @param i index into sequence @return byte @throws IllegalArgumentException if i is out of range """ if (i < 0) { throw new IndexOutOfBoundsException("i < 0, " + i); } if (i >= length) { throw new IndexOutOf...
java
public byte byteAt(int i) { if (i < 0) { throw new IndexOutOfBoundsException("i < 0, " + i); } if (i >= length) { throw new IndexOutOfBoundsException("i >= length, " + i + " >= " + length); } return data[offset + i]; }
[ "public", "byte", "byteAt", "(", "int", "i", ")", "{", "if", "(", "i", "<", "0", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"i < 0, \"", "+", "i", ")", ";", "}", "if", "(", "i", ">=", "length", ")", "{", "throw", "new", "IndexOut...
Gets a byte within this sequence of bytes @param i index into sequence @return byte @throws IllegalArgumentException if i is out of range
[ "Gets", "a", "byte", "within", "this", "sequence", "of", "bytes" ]
train
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L103-L114
rwl/CSparseJ
src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_util.java
Dcs_util.cs_dalloc
public static Dcsd cs_dalloc(int m, int n) { """ Allocate a Dcsd object (a Dulmage-Mendelsohn decomposition). @param m number of rows of the matrix A to be analyzed @param n number of columns of the matrix A to be analyzed @return Dulmage-Mendelsohn decomposition """ Dcsd D; D = new Dc...
java
public static Dcsd cs_dalloc(int m, int n) { Dcsd D; D = new Dcsd(); D.p = new int[m]; D.r = new int[m + 6]; D.q = new int[n]; D.s = new int[n + 6]; D.cc = new int[5]; D.rr = new int[5]; return D; }
[ "public", "static", "Dcsd", "cs_dalloc", "(", "int", "m", ",", "int", "n", ")", "{", "Dcsd", "D", ";", "D", "=", "new", "Dcsd", "(", ")", ";", "D", ".", "p", "=", "new", "int", "[", "m", "]", ";", "D", ".", "r", "=", "new", "int", "[", "m...
Allocate a Dcsd object (a Dulmage-Mendelsohn decomposition). @param m number of rows of the matrix A to be analyzed @param n number of columns of the matrix A to be analyzed @return Dulmage-Mendelsohn decomposition
[ "Allocate", "a", "Dcsd", "object", "(", "a", "Dulmage", "-", "Mendelsohn", "decomposition", ")", "." ]
train
https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_util.java#L108-L118
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/Sessions.java
Sessions.sessionHeartbeat
public void sessionHeartbeat(long sessionId) { """ Performs session heartbeat. @param sessionId the id of the session """ synchronized (mSessions) { if (mSessions.containsKey(sessionId)) { mSessions.get(sessionId).heartbeat(); } else { int sessionTimeoutMs = (int) ServerConfi...
java
public void sessionHeartbeat(long sessionId) { synchronized (mSessions) { if (mSessions.containsKey(sessionId)) { mSessions.get(sessionId).heartbeat(); } else { int sessionTimeoutMs = (int) ServerConfiguration .getMs(PropertyKey.WORKER_SESSION_TIMEOUT_MS); mSessions.p...
[ "public", "void", "sessionHeartbeat", "(", "long", "sessionId", ")", "{", "synchronized", "(", "mSessions", ")", "{", "if", "(", "mSessions", ".", "containsKey", "(", "sessionId", ")", ")", "{", "mSessions", ".", "get", "(", "sessionId", ")", ".", "heartbe...
Performs session heartbeat. @param sessionId the id of the session
[ "Performs", "session", "heartbeat", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/Sessions.java#L90-L100
OpenLiberty/open-liberty
dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/ConfigUtils.java
ConfigUtils.populateCustomRequestParameterMap
public void populateCustomRequestParameterMap(ConfigurationAdmin configAdmin, HashMap<String, String> paramMapToPopulate, String[] configuredCustomRequestParams, String configAttrName, String configAttrValue) { """ Populates a map of custom request parameter names and values to add to a certain OpenID Connect requ...
java
public void populateCustomRequestParameterMap(ConfigurationAdmin configAdmin, HashMap<String, String> paramMapToPopulate, String[] configuredCustomRequestParams, String configAttrName, String configAttrValue) { if (configuredCustomRequestParams == null) { return; } for (String config...
[ "public", "void", "populateCustomRequestParameterMap", "(", "ConfigurationAdmin", "configAdmin", ",", "HashMap", "<", "String", ",", "String", ">", "paramMapToPopulate", ",", "String", "[", "]", "configuredCustomRequestParams", ",", "String", "configAttrName", ",", "Str...
Populates a map of custom request parameter names and values to add to a certain OpenID Connect request type. @param configAdmin Config admin that has access to the necessary server configuration properties. @param paramMapToPopulate Request-specific map of custom parameters to populate (for example, a map of paramete...
[ "Populates", "a", "map", "of", "custom", "request", "parameter", "names", "and", "values", "to", "add", "to", "a", "certain", "OpenID", "Connect", "request", "type", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/ConfigUtils.java#L408-L421
cogroo/cogroo4
cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java
AnnotatorUtil.getType
public static Type getType(TypeSystem typeSystem, String name) throws AnalysisEngineProcessException { """ Retrieves a type of the given name from the given type system. @param typeSystem @param name @return the type @throws AnalysisEngineProcessException """ Type type = typeSystem.getType(na...
java
public static Type getType(TypeSystem typeSystem, String name) throws AnalysisEngineProcessException { Type type = typeSystem.getType(name); if (type == null) { throw new OpenNlpAnnotatorProcessException( ExceptionMessages.TYPE_NOT_FOUND, new Object[] {name}); } return ...
[ "public", "static", "Type", "getType", "(", "TypeSystem", "typeSystem", ",", "String", "name", ")", "throws", "AnalysisEngineProcessException", "{", "Type", "type", "=", "typeSystem", ".", "getType", "(", "name", ")", ";", "if", "(", "type", "==", "null", ")...
Retrieves a type of the given name from the given type system. @param typeSystem @param name @return the type @throws AnalysisEngineProcessException
[ "Retrieves", "a", "type", "of", "the", "given", "name", "from", "the", "given", "type", "system", "." ]
train
https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L50-L61
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/ControlBar.java
ControlBar.addControl
public Widget addControl(String name, int resId, Widget.OnTouchListener listener, int position) { """ Add new control at the control bar with specified touch listener, resource and position. Size of control bar is updated based on new number of controls. @param name name of the control to remove @param resId th...
java
public Widget addControl(String name, int resId, Widget.OnTouchListener listener, int position) { Widget control = findChildByName(name); if (control == null) { control = createControlWidget(resId, name, null); } setupControl(name, control, listener, position); return...
[ "public", "Widget", "addControl", "(", "String", "name", ",", "int", "resId", ",", "Widget", ".", "OnTouchListener", "listener", ",", "int", "position", ")", "{", "Widget", "control", "=", "findChildByName", "(", "name", ")", ";", "if", "(", "control", "==...
Add new control at the control bar with specified touch listener, resource and position. Size of control bar is updated based on new number of controls. @param name name of the control to remove @param resId the control face @param listener touch listener @param position control position in the bar
[ "Add", "new", "control", "at", "the", "control", "bar", "with", "specified", "touch", "listener", "resource", "and", "position", ".", "Size", "of", "control", "bar", "is", "updated", "based", "on", "new", "number", "of", "controls", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/ControlBar.java#L194-L201
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/getters/EvictableGetterCache.java
EvictableGetterCache.evictMap
private void evictMap(SampleableConcurrentHashMap<?, ?> map, int triggeringEvictionSize, int afterEvictionSize) { """ It works on best effort basis. If multi-threaded calls involved it may evict all elements, but it's unlikely. """ map.purgeStaleEntries(); int mapSize = map.size(); if (...
java
private void evictMap(SampleableConcurrentHashMap<?, ?> map, int triggeringEvictionSize, int afterEvictionSize) { map.purgeStaleEntries(); int mapSize = map.size(); if (mapSize - triggeringEvictionSize >= 0) { for (SampleableConcurrentHashMap.SamplingEntry entry : map.getRandomSample...
[ "private", "void", "evictMap", "(", "SampleableConcurrentHashMap", "<", "?", ",", "?", ">", "map", ",", "int", "triggeringEvictionSize", ",", "int", "afterEvictionSize", ")", "{", "map", ".", "purgeStaleEntries", "(", ")", ";", "int", "mapSize", "=", "map", ...
It works on best effort basis. If multi-threaded calls involved it may evict all elements, but it's unlikely.
[ "It", "works", "on", "best", "effort", "basis", ".", "If", "multi", "-", "threaded", "calls", "involved", "it", "may", "evict", "all", "elements", "but", "it", "s", "unlikely", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/getters/EvictableGetterCache.java#L79-L87
pdef/pdef-java
pdef/src/main/java/io/pdef/json/JsonJacksonFormat.java
JsonJacksonFormat.read
public <T> T read(final InputStream stream, final DataTypeDescriptor<T> descriptor) throws Exception { """ Parses an object from an input stream, does not close the input stream. """ if (stream == null) throw new NullPointerException("input"); if (descriptor == null) throw new NullPointerException("desc...
java
public <T> T read(final InputStream stream, final DataTypeDescriptor<T> descriptor) throws Exception { if (stream == null) throw new NullPointerException("input"); if (descriptor == null) throw new NullPointerException("descriptor"); JsonParser parser = factory.createParser(stream); return read(parser, desc...
[ "public", "<", "T", ">", "T", "read", "(", "final", "InputStream", "stream", ",", "final", "DataTypeDescriptor", "<", "T", ">", "descriptor", ")", "throws", "Exception", "{", "if", "(", "stream", "==", "null", ")", "throw", "new", "NullPointerException", "...
Parses an object from an input stream, does not close the input stream.
[ "Parses", "an", "object", "from", "an", "input", "stream", "does", "not", "close", "the", "input", "stream", "." ]
train
https://github.com/pdef/pdef-java/blob/7776c44d1aab0f3dbf7267b0c32b8f9282fe6167/pdef/src/main/java/io/pdef/json/JsonJacksonFormat.java#L212-L219
mkopylec/charon-spring-boot-starter
src/main/java/com/github/mkopylec/charon/core/http/RequestForwarder.java
RequestForwarder.prepareForwardedRequestHeaders
protected void prepareForwardedRequestHeaders(RequestData request, ForwardDestination destination) { """ Remove any protocol-level headers from the clients request that do not apply to the new request we are sending to the remote server. @param request @param destination """ HttpHeaders headers = ...
java
protected void prepareForwardedRequestHeaders(RequestData request, ForwardDestination destination) { HttpHeaders headers = request.getHeaders(); headers.set(HOST, destination.getUri().getAuthority()); headers.remove(TE); }
[ "protected", "void", "prepareForwardedRequestHeaders", "(", "RequestData", "request", ",", "ForwardDestination", "destination", ")", "{", "HttpHeaders", "headers", "=", "request", ".", "getHeaders", "(", ")", ";", "headers", ".", "set", "(", "HOST", ",", "destinat...
Remove any protocol-level headers from the clients request that do not apply to the new request we are sending to the remote server. @param request @param destination
[ "Remove", "any", "protocol", "-", "level", "headers", "from", "the", "clients", "request", "that", "do", "not", "apply", "to", "the", "new", "request", "we", "are", "sending", "to", "the", "remote", "server", "." ]
train
https://github.com/mkopylec/charon-spring-boot-starter/blob/9a3aa4ffd0bae6a1f94cd983bbf17cd36f4ff594/src/main/java/com/github/mkopylec/charon/core/http/RequestForwarder.java#L114-L118
gallandarakhneorg/afc
advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPoint.java
MapPoint.calcBounds
@Override @Pure protected Rectangle2d calcBounds() { """ Compute the bounds of this element. This function does not update the internal attribute replied by {@link #getBoundingBox()} """ double x = this.getX(); double y = this.getY(); final double w = this.doubleFramed ? this.pointSize * 2 : this.po...
java
@Override @Pure protected Rectangle2d calcBounds() { double x = this.getX(); double y = this.getY(); final double w = this.doubleFramed ? this.pointSize * 2 : this.pointSize; final double h = w; x -= w / 2.; y -= h / 2.; return new Rectangle2d(x, y, w, h); }
[ "@", "Override", "@", "Pure", "protected", "Rectangle2d", "calcBounds", "(", ")", "{", "double", "x", "=", "this", ".", "getX", "(", ")", ";", "double", "y", "=", "this", ".", "getY", "(", ")", ";", "final", "double", "w", "=", "this", ".", "double...
Compute the bounds of this element. This function does not update the internal attribute replied by {@link #getBoundingBox()}
[ "Compute", "the", "bounds", "of", "this", "element", ".", "This", "function", "does", "not", "update", "the", "internal", "attribute", "replied", "by", "{" ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPoint.java#L162-L175
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/JobManager.java
JobManager.cancelJob
private TaskCancelResult cancelJob(final ExecutionGraph eg) { """ Cancels all the tasks in the current and upper stages of the given execution graph. @param eg the execution graph representing the job to cancel. @return <code>null</code> if no error occurred during the cancel attempt, otherwise the returned...
java
private TaskCancelResult cancelJob(final ExecutionGraph eg) { TaskCancelResult errorResult = null; /** * Cancel all nodes in the current and upper execution stages. */ final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, eg.getIndexOfCurrentExecutionStage(), false, true); while (it.has...
[ "private", "TaskCancelResult", "cancelJob", "(", "final", "ExecutionGraph", "eg", ")", "{", "TaskCancelResult", "errorResult", "=", "null", ";", "/**\n\t\t * Cancel all nodes in the current and upper execution stages.\n\t\t */", "final", "Iterator", "<", "ExecutionVertex", ">",...
Cancels all the tasks in the current and upper stages of the given execution graph. @param eg the execution graph representing the job to cancel. @return <code>null</code> if no error occurred during the cancel attempt, otherwise the returned object will describe the error
[ "Cancels", "all", "the", "tasks", "in", "the", "current", "and", "upper", "stages", "of", "the", "given", "execution", "graph", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/JobManager.java#L691-L710
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.createPushDeployKey
public GitlabSSHKey createPushDeployKey(Integer targetProjectId, String title, String key) throws IOException { """ Create a new deploy key for the project which can push. @param targetProjectId The id of the Gitlab project @param title The title of the ssh key @param key The public key ...
java
public GitlabSSHKey createPushDeployKey(Integer targetProjectId, String title, String key) throws IOException { return createDeployKey(targetProjectId, title, key, true); }
[ "public", "GitlabSSHKey", "createPushDeployKey", "(", "Integer", "targetProjectId", ",", "String", "title", ",", "String", "key", ")", "throws", "IOException", "{", "return", "createDeployKey", "(", "targetProjectId", ",", "title", ",", "key", ",", "true", ")", ...
Create a new deploy key for the project which can push. @param targetProjectId The id of the Gitlab project @param title The title of the ssh key @param key The public key @return The new GitlabSSHKey @throws IOException on gitlab api call error
[ "Create", "a", "new", "deploy", "key", "for", "the", "project", "which", "can", "push", "." ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3180-L3182
sebastiangraf/jSCSI
bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java
ISID.createRandom
public static final ISID createRandom (final long seed) { """ This method creates an Initiator Session ID of the <code>Random</code> format defined in the iSCSI Standard (RFC3720). @param seed The initialization seed for random generator. @return A instance of an <code>ISID</code>. """ // TODO: I...
java
public static final ISID createRandom (final long seed) { // TODO: Implement Qualifier final Random rand = new Random(seed); final ISID isid = new ISID(Format.RANDOM, Constants.RESERVED_BYTE, (short) rand.nextInt(), (byte) rand.nextInt(), (short) 0); return isid; }
[ "public", "static", "final", "ISID", "createRandom", "(", "final", "long", "seed", ")", "{", "// TODO: Implement Qualifier", "final", "Random", "rand", "=", "new", "Random", "(", "seed", ")", ";", "final", "ISID", "isid", "=", "new", "ISID", "(", "Format", ...
This method creates an Initiator Session ID of the <code>Random</code> format defined in the iSCSI Standard (RFC3720). @param seed The initialization seed for random generator. @return A instance of an <code>ISID</code>.
[ "This", "method", "creates", "an", "Initiator", "Session", "ID", "of", "the", "<code", ">", "Random<", "/", "code", ">", "format", "defined", "in", "the", "iSCSI", "Standard", "(", "RFC3720", ")", "." ]
train
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java#L273-L281
arquillian/arquillian-core
container/spi/src/main/java/org/jboss/arquillian/container/spi/client/deployment/Validate.java
Validate.notNull
public static void notNull(final Object obj, final String message) throws IllegalArgumentException { """ Checks that object is not null, throws exception if it is. @param obj The object to check @param message The exception message @throws IllegalArgumentException Thrown if obj is null """ if...
java
public static void notNull(final Object obj, final String message) throws IllegalArgumentException { if (obj == null) { throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "notNull", "(", "final", "Object", "obj", ",", "final", "String", "message", ")", "throws", "IllegalArgumentException", "{", "if", "(", "obj", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "message", ")", ...
Checks that object is not null, throws exception if it is. @param obj The object to check @param message The exception message @throws IllegalArgumentException Thrown if obj is null
[ "Checks", "that", "object", "is", "not", "null", "throws", "exception", "if", "it", "is", "." ]
train
https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/container/spi/src/main/java/org/jboss/arquillian/container/spi/client/deployment/Validate.java#L85-L89
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/SequenceFileInputFilter.java
SequenceFileInputFilter.setFilterClass
public static void setFilterClass(Configuration conf, Class filterClass) { """ set the filter class @param conf application configuration @param filterClass filter class """ conf.set(FILTER_CLASS, filterClass.getName()); }
java
public static void setFilterClass(Configuration conf, Class filterClass) { conf.set(FILTER_CLASS, filterClass.getName()); }
[ "public", "static", "void", "setFilterClass", "(", "Configuration", "conf", ",", "Class", "filterClass", ")", "{", "conf", ".", "set", "(", "FILTER_CLASS", ",", "filterClass", ".", "getName", "(", ")", ")", ";", "}" ]
set the filter class @param conf application configuration @param filterClass filter class
[ "set", "the", "filter", "class" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/SequenceFileInputFilter.java#L73-L75
BlueBrain/bluima
modules/bluima_typesystem/src/main/java/de/julielab/jules/types/RelationMention.java
RelationMention.setArguments
public void setArguments(int i, ArgumentMention v) { """ indexed setter for arguments - sets an indexed value - @generated @param i index in the array to set @param v value to set into the array """ if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_arguments == null) ...
java
public void setArguments(int i, ArgumentMention v) { if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_arguments == null) jcasType.jcas.throwFeatMissing("arguments", "de.julielab.jules.types.RelationMention"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr...
[ "public", "void", "setArguments", "(", "int", "i", ",", "ArgumentMention", "v", ")", "{", "if", "(", "RelationMention_Type", ".", "featOkTst", "&&", "(", "(", "RelationMention_Type", ")", "jcasType", ")", ".", "casFeat_arguments", "==", "null", ")", "jcasType"...
indexed setter for arguments - sets an indexed value - @generated @param i index in the array to set @param v value to set into the array
[ "indexed", "setter", "for", "arguments", "-", "sets", "an", "indexed", "value", "-" ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/RelationMention.java#L160-L164
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/lang/DRL6StrictParser.java
DRL6StrictParser.lhsEval
private BaseDescr lhsEval(CEDescrBuilder<?, ?> ce) throws RecognitionException { """ lhsEval := EVAL LEFT_PAREN conditionalExpression RIGHT_PAREN @param ce @return @throws org.antlr.runtime.RecognitionException """ EvalDescrBuilder<?> eval = null; try { eval = helper.start(ce,...
java
private BaseDescr lhsEval(CEDescrBuilder<?, ?> ce) throws RecognitionException { EvalDescrBuilder<?> eval = null; try { eval = helper.start(ce, EvalDescrBuilder.class, null); match(input, DRL6Lexer.ID, ...
[ "private", "BaseDescr", "lhsEval", "(", "CEDescrBuilder", "<", "?", ",", "?", ">", "ce", ")", "throws", "RecognitionException", "{", "EvalDescrBuilder", "<", "?", ">", "eval", "=", "null", ";", "try", "{", "eval", "=", "helper", ".", "start", "(", "ce", ...
lhsEval := EVAL LEFT_PAREN conditionalExpression RIGHT_PAREN @param ce @return @throws org.antlr.runtime.RecognitionException
[ "lhsEval", ":", "=", "EVAL", "LEFT_PAREN", "conditionalExpression", "RIGHT_PAREN" ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/lang/DRL6StrictParser.java#L2864-L2891
itfsw/QueryBuilder
src/main/java/com/itfsw/query/builder/support/utils/spring/Assert.java
Assert.notEmpty
public static void notEmpty(Object[] array, String message) { """ Assert that an array contains elements; that is, it must not be {@code null} and must contain at least one element. <pre class="code">Assert.notEmpty(array, "The array must contain elements");</pre> @param array the array to check @param message...
java
public static void notEmpty(Object[] array, String message) { if (ObjectUtils.isEmpty(array)) { throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "notEmpty", "(", "Object", "[", "]", "array", ",", "String", "message", ")", "{", "if", "(", "ObjectUtils", ".", "isEmpty", "(", "array", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "message", ")", ";", "}"...
Assert that an array contains elements; that is, it must not be {@code null} and must contain at least one element. <pre class="code">Assert.notEmpty(array, "The array must contain elements");</pre> @param array the array to check @param message the exception message to use if the assertion fails @throws IllegalArgumen...
[ "Assert", "that", "an", "array", "contains", "elements", ";", "that", "is", "it", "must", "not", "be", "{" ]
train
https://github.com/itfsw/QueryBuilder/blob/231dc9a334d54cf98755cfcb236202201ddee162/src/main/java/com/itfsw/query/builder/support/utils/spring/Assert.java#L226-L230
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
LuceneSpellChecker.getFulltextStatement
private String getFulltextStatement(QueryRootNode aqt) throws RepositoryException { """ Returns the fulltext statement of a spellcheck relation query node or <code>null</code> if none exists in the abstract query tree. @param aqt the abstract query tree. @return the fulltext statement or <code>null</code>. ...
java
private String getFulltextStatement(QueryRootNode aqt) throws RepositoryException { final String[] stmt = new String[1]; aqt.accept(new TraversingQueryNodeVisitor() { @Override public Object visit(RelationQueryNode node, Object o) throws RepositoryException { ...
[ "private", "String", "getFulltextStatement", "(", "QueryRootNode", "aqt", ")", "throws", "RepositoryException", "{", "final", "String", "[", "]", "stmt", "=", "new", "String", "[", "1", "]", ";", "aqt", ".", "accept", "(", "new", "TraversingQueryNodeVisitor", ...
Returns the fulltext statement of a spellcheck relation query node or <code>null</code> if none exists in the abstract query tree. @param aqt the abstract query tree. @return the fulltext statement or <code>null</code>. @throws RepositoryException
[ "Returns", "the", "fulltext", "statement", "of", "a", "spellcheck", "relation", "query", "node", "or", "<code", ">", "null<", "/", "code", ">", "if", "none", "exists", "in", "the", "abstract", "query", "tree", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java#L198-L214
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.definePackage
protected void definePackage(File container, String className) throws IOException { """ Define the package information associated with a class. @param container the file containing the class definition. @param className the class name of for which the package information is to be determined. @exception IOE...
java
protected void definePackage(File container, String className) throws IOException { int classIndex = className.lastIndexOf('.'); if (classIndex == -1) { return; } String packageName = className.substring(0, classIndex); if (getPackage(packageName) != null) { ...
[ "protected", "void", "definePackage", "(", "File", "container", ",", "String", "className", ")", "throws", "IOException", "{", "int", "classIndex", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "classIndex", "==", "-", "1", ")",...
Define the package information associated with a class. @param container the file containing the class definition. @param className the class name of for which the package information is to be determined. @exception IOException if the package information cannot be read from the container.
[ "Define", "the", "package", "information", "associated", "with", "a", "class", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1153-L1171
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java
P2sVpnGatewaysInner.updateTags
public P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { """ Updates virtual wan p2s vpn gateway tags. @param resourceGroupName The resource group name of the P2SVpnGateway. @param gatewayName The name of the gateway. @throws IllegalArgumentException thrown if parameters fail the v...
java
public P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); }
[ "public", "P2SVpnGatewayInner", "updateTags", "(", "String", "resourceGroupName", ",", "String", "gatewayName", ")", "{", "return", "updateTagsWithServiceResponseAsync", "(", "resourceGroupName", ",", "gatewayName", ")", ".", "toBlocking", "(", ")", ".", "last", "(", ...
Updates virtual wan p2s vpn gateway tags. @param resourceGroupName The resource group name of the P2SVpnGateway. @param gatewayName The name of the gateway. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorException thrown if the request is rejected by server @throws RuntimeExcept...
[ "Updates", "virtual", "wan", "p2s", "vpn", "gateway", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java#L390-L392
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/appflow/appflowpolicylabel_binding.java
appflowpolicylabel_binding.get
public static appflowpolicylabel_binding get(nitro_service service, String labelname) throws Exception { """ Use this API to fetch appflowpolicylabel_binding resource of given name . """ appflowpolicylabel_binding obj = new appflowpolicylabel_binding(); obj.set_labelname(labelname); appflowpolicylabel_bi...
java
public static appflowpolicylabel_binding get(nitro_service service, String labelname) throws Exception{ appflowpolicylabel_binding obj = new appflowpolicylabel_binding(); obj.set_labelname(labelname); appflowpolicylabel_binding response = (appflowpolicylabel_binding) obj.get_resource(service); return response; ...
[ "public", "static", "appflowpolicylabel_binding", "get", "(", "nitro_service", "service", ",", "String", "labelname", ")", "throws", "Exception", "{", "appflowpolicylabel_binding", "obj", "=", "new", "appflowpolicylabel_binding", "(", ")", ";", "obj", ".", "set_labeln...
Use this API to fetch appflowpolicylabel_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "appflowpolicylabel_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appflow/appflowpolicylabel_binding.java#L103-L108
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.getColorForBond
public Color getColorForBond(IBond bond, RendererModel model) { """ Determine the color of a bond, returning either the default color, the override color or whatever is in the color hash for that bond. @param bond the bond we are generating an element for @param model the rendering model @return the color to...
java
public Color getColorForBond(IBond bond, RendererModel model) { if (this.overrideColor != null) { return overrideColor; } Color color = model.getParameter(ColorHash.class).getValue().get(bond); if (color == null) { return model.getParameter(DefaultBondColor.class...
[ "public", "Color", "getColorForBond", "(", "IBond", "bond", ",", "RendererModel", "model", ")", "{", "if", "(", "this", ".", "overrideColor", "!=", "null", ")", "{", "return", "overrideColor", ";", "}", "Color", "color", "=", "model", ".", "getParameter", ...
Determine the color of a bond, returning either the default color, the override color or whatever is in the color hash for that bond. @param bond the bond we are generating an element for @param model the rendering model @return the color to paint the bond
[ "Determine", "the", "color", "of", "a", "bond", "returning", "either", "the", "default", "color", "the", "override", "color", "or", "whatever", "is", "in", "the", "color", "hash", "for", "that", "bond", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L223-L234
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getCurrencyInfo
public void getCurrencyInfo(int[] ids, Callback<List<Currency>> callback) throws GuildWars2Exception, NullPointerException { """ For more info on Currency API go <a href="https://wiki.guildwars2.com/wiki/API:2/currencies">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link...
java
public void getCurrencyInfo(int[] ids, Callback<List<Currency>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getCurrencyInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
[ "public", "void", "getCurrencyInfo", "(", "int", "[", "]", "ids", ",", "Callback", "<", "List", "<", "Currency", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "(", "ids...
For more info on Currency API go <a href="https://wiki.guildwars2.com/wiki/API:2/currencies">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param ids list of currency id @param callback callback tha...
[ "For", "more", "info", "on", "Currency", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "currencies", ">", "here<", "/", "a", ">", "<br", "/", ">", "Give", "user"...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1258-L1261
datasalt/pangool
core/src/main/java/com/datasalt/pangool/tuplemr/MapOnlyJobBuilder.java
MapOnlyJobBuilder.setDefaultNamedOutput
public void setDefaultNamedOutput(OutputFormat outputFormat, Class keyClass, Class valueClass) throws TupleMRException { """ Sets the default named output specs. By using this method one can use an arbitrary number of named outputs without pre-defining them beforehand. """ setDefaultNamedOutput(outputForma...
java
public void setDefaultNamedOutput(OutputFormat outputFormat, Class keyClass, Class valueClass) throws TupleMRException { setDefaultNamedOutput(outputFormat, keyClass, valueClass, null); }
[ "public", "void", "setDefaultNamedOutput", "(", "OutputFormat", "outputFormat", ",", "Class", "keyClass", ",", "Class", "valueClass", ")", "throws", "TupleMRException", "{", "setDefaultNamedOutput", "(", "outputFormat", ",", "keyClass", ",", "valueClass", ",", "null",...
Sets the default named output specs. By using this method one can use an arbitrary number of named outputs without pre-defining them beforehand.
[ "Sets", "the", "default", "named", "output", "specs", ".", "By", "using", "this", "method", "one", "can", "use", "an", "arbitrary", "number", "of", "named", "outputs", "without", "pre", "-", "defining", "them", "beforehand", "." ]
train
https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/MapOnlyJobBuilder.java#L103-L105
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/discovery/cloud/aws/AmazonComputeInstanceMetadataResolver.java
AmazonComputeInstanceMetadataResolver.readEc2MetadataUrl
private String readEc2MetadataUrl(URL url, int connectionTimeoutMs, int readTimeoutMs) throws IOException { """ Read EC2 metadata from the given URL. @param url URL to fetch AWS EC2 metadata information @param connectionTimeoutMs connection timeout in millis @param readTimeoutMs read timeout in millis @retur...
java
private String readEc2MetadataUrl(URL url, int connectionTimeoutMs, int readTimeoutMs) throws IOException { if (url.getProtocol().equalsIgnoreCase("file")) { url = rewriteUrl(url); URLConnection urlConnection = url.openConnection(); urlConnection.connect(); try (...
[ "private", "String", "readEc2MetadataUrl", "(", "URL", "url", ",", "int", "connectionTimeoutMs", ",", "int", "readTimeoutMs", ")", "throws", "IOException", "{", "if", "(", "url", ".", "getProtocol", "(", ")", ".", "equalsIgnoreCase", "(", "\"file\"", ")", ")",...
Read EC2 metadata from the given URL. @param url URL to fetch AWS EC2 metadata information @param connectionTimeoutMs connection timeout in millis @param readTimeoutMs read timeout in millis @return AWS EC2 metadata information @throws IOException Signals that an I/O exception of some sort has occurred
[ "Read", "EC2", "metadata", "from", "the", "given", "URL", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/discovery/cloud/aws/AmazonComputeInstanceMetadataResolver.java#L176-L200
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java
PageInBrowserStats.getTotalWindowLoadTime
public long getTotalWindowLoadTime(final String intervalName, final TimeUnit unit) { """ Returns total page loads time for given interval and {@link TimeUnit}. @param intervalName name of the interval @param unit {@link TimeUnit} @return total page loads time """ return unit.transformMillis(tota...
java
public long getTotalWindowLoadTime(final String intervalName, final TimeUnit unit) { return unit.transformMillis(totalWindowLoadTime.getValueAsLong(intervalName)); }
[ "public", "long", "getTotalWindowLoadTime", "(", "final", "String", "intervalName", ",", "final", "TimeUnit", "unit", ")", "{", "return", "unit", ".", "transformMillis", "(", "totalWindowLoadTime", ".", "getValueAsLong", "(", "intervalName", ")", ")", ";", "}" ]
Returns total page loads time for given interval and {@link TimeUnit}. @param intervalName name of the interval @param unit {@link TimeUnit} @return total page loads time
[ "Returns", "total", "page", "loads", "time", "for", "given", "interval", "and", "{", "@link", "TimeUnit", "}", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L232-L234
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/WsSessions.java
WsSessions.createSessionEntry
private SessionEntry createSessionEntry(String sessionKey, Session session) { """ Creates a new {@link SessionEntry} for the given {@code sessionKey} and {@code session}. Iterates over {@link #wsSessionListenerProducers} to get {@link WsSessionListener}s that will be attached to the given {@code session}. <p> ...
java
private SessionEntry createSessionEntry(String sessionKey, Session session) { List<WsSessionListener> sessionListeners = new ArrayList<>(); for (BiFunction<String, Session, WsSessionListener> producer : wsSessionListenerProducers) { WsSessionListener sessionListener = producer.apply(sessionK...
[ "private", "SessionEntry", "createSessionEntry", "(", "String", "sessionKey", ",", "Session", "session", ")", "{", "List", "<", "WsSessionListener", ">", "sessionListeners", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "BiFunction", "<", "String", ...
Creates a new {@link SessionEntry} for the given {@code sessionKey} and {@code session}. Iterates over {@link #wsSessionListenerProducers} to get {@link WsSessionListener}s that will be attached to the given {@code session}. <p> Note that this only produces/assigns websocket session listeners to the sessions, but the l...
[ "Creates", "a", "new", "{", "@link", "SessionEntry", "}", "for", "the", "given", "{", "@code", "sessionKey", "}", "and", "{", "@code", "session", "}", ".", "Iterates", "over", "{", "@link", "#wsSessionListenerProducers", "}", "to", "get", "{", "@link", "Ws...
train
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/WsSessions.java#L174-L183
riversun/d6
src/main/java/org/riversun/d6/core/D6Crud.java
D6Crud.execUpdate
public boolean execUpdate(D6Model modelObj, D6Inex includeExcludeColumnNames) { """ Update Model Object @param modelObj @param includeExcludeColumnNames @return true:DB operation success false:failure """ boolean retVal = false; if (modelObj == null) { return retVal; } final D6Cru...
java
public boolean execUpdate(D6Model modelObj, D6Inex includeExcludeColumnNames) { boolean retVal = false; if (modelObj == null) { return retVal; } final D6CrudUpdateHelper d6CrudUpdateHelper = new D6CrudUpdateHelper(modelObj.getClass()); final String updateSQL = d6CrudUpdateHelper.createUpda...
[ "public", "boolean", "execUpdate", "(", "D6Model", "modelObj", ",", "D6Inex", "includeExcludeColumnNames", ")", "{", "boolean", "retVal", "=", "false", ";", "if", "(", "modelObj", "==", "null", ")", "{", "return", "retVal", ";", "}", "final", "D6CrudUpdateHelp...
Update Model Object @param modelObj @param includeExcludeColumnNames @return true:DB operation success false:failure
[ "Update", "Model", "Object" ]
train
https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/D6Crud.java#L229-L287
anotheria/moskito
moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java
GenericStats.getStatValueAsLong
public long getStatValueAsLong(T metric, String interval) { """ Get value of provided metric for the given interval as long value. @param metric metric which value we wanna get @param interval the name of the Interval or <code>null</code> to get the absolute value @return the current value """ if (m...
java
public long getStatValueAsLong(T metric, String interval) { if (metric.isRateMetric()) { return (long)(getStatValueAsDouble(metric, interval)); } return getMonitoredStatValue(metric).getValueAsLong(interval); }
[ "public", "long", "getStatValueAsLong", "(", "T", "metric", ",", "String", "interval", ")", "{", "if", "(", "metric", ".", "isRateMetric", "(", ")", ")", "{", "return", "(", "long", ")", "(", "getStatValueAsDouble", "(", "metric", ",", "interval", ")", "...
Get value of provided metric for the given interval as long value. @param metric metric which value we wanna get @param interval the name of the Interval or <code>null</code> to get the absolute value @return the current value
[ "Get", "value", "of", "provided", "metric", "for", "the", "given", "interval", "as", "long", "value", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L165-L170
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java
CommonOps_DDF3.elementMult
public static void elementMult( DMatrix3x3 a , DMatrix3x3 b , DMatrix3x3 c ) { """ <p>Performs an element by element multiplication operation:<br> <br> c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br> </p> @param a The left matrix in the multiplication operation. Not modified. @param b The right matrix i...
java
public static void elementMult( DMatrix3x3 a , DMatrix3x3 b , DMatrix3x3 c ) { c.a11 = a.a11*b.a11; c.a12 = a.a12*b.a12; c.a13 = a.a13*b.a13; c.a21 = a.a21*b.a21; c.a22 = a.a22*b.a22; c.a23 = a.a23*b.a23; c.a31 = a.a31*b.a31; c.a32 = a.a32*b.a32; c.a33 = a.a33*b.a33; }
[ "public", "static", "void", "elementMult", "(", "DMatrix3x3", "a", ",", "DMatrix3x3", "b", ",", "DMatrix3x3", "c", ")", "{", "c", ".", "a11", "=", "a", ".", "a11", "*", "b", ".", "a11", ";", "c", ".", "a12", "=", "a", ".", "a12", "*", "b", ".",...
<p>Performs an element by element multiplication operation:<br> <br> c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br> </p> @param a The left matrix in the multiplication operation. Not modified. @param b The right matrix in the multiplication operation. Not modified. @param c Where the results of the operation are...
[ "<p", ">", "Performs", "an", "element", "by", "element", "multiplication", "operation", ":", "<br", ">", "<br", ">", "c<sub", ">", "ij<", "/", "sub", ">", "=", "a<sub", ">", "ij<", "/", "sub", ">", "*", "b<sub", ">", "ij<", "/", "sub", ">", "<br", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L1068-L1072
b3log/latke
latke-core/src/main/java/org/json/JSONObject.java
JSONObject.optBigInteger
public BigInteger optBigInteger(String key, BigInteger defaultValue) { """ Get an optional BigInteger associated with a key, or the defaultValue if there is no such key or if its value is not a number. If the value is a string, an attempt will be made to evaluate it as a number. @param key A key string. @pa...
java
public BigInteger optBigInteger(String key, BigInteger defaultValue) { Object val = this.opt(key); return objectToBigInteger(val, defaultValue); }
[ "public", "BigInteger", "optBigInteger", "(", "String", "key", ",", "BigInteger", "defaultValue", ")", "{", "Object", "val", "=", "this", ".", "opt", "(", "key", ")", ";", "return", "objectToBigInteger", "(", "val", ",", "defaultValue", ")", ";", "}" ]
Get an optional BigInteger associated with a key, or the defaultValue if there is no such key or if its value is not a number. If the value is a string, an attempt will be made to evaluate it as a number. @param key A key string. @param defaultValue The default. @return An object which is the value.
[ "Get", "an", "optional", "BigInteger", "associated", "with", "a", "key", "or", "the", "defaultValue", "if", "there", "is", "no", "such", "key", "or", "if", "its", "value", "is", "not", "a", "number", ".", "If", "the", "value", "is", "a", "string", "an"...
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONObject.java#L1160-L1163
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/Messages.java
Messages.createMessage
public final String createMessage(String msgKey, Object args[]) { """ Creates a message from the specified key and replacement arguments, localized to the given locale. @param msgKey The key for the message text. @param args The arguments to be used as replacement text in the message created. @return ...
java
public final String createMessage(String msgKey, Object args[]) { if (m_resourceBundle == null) m_resourceBundle = loadResourceBundle(m_resourceBundleName); if (m_resourceBundle != null) { return createMsg(m_resourceBundle, msgKey, args); } else ...
[ "public", "final", "String", "createMessage", "(", "String", "msgKey", ",", "Object", "args", "[", "]", ")", "{", "if", "(", "m_resourceBundle", "==", "null", ")", "m_resourceBundle", "=", "loadResourceBundle", "(", "m_resourceBundleName", ")", ";", "if", "(",...
Creates a message from the specified key and replacement arguments, localized to the given locale. @param msgKey The key for the message text. @param args The arguments to be used as replacement text in the message created. @return The formatted message string. @xsl.usage internal
[ "Creates", "a", "message", "from", "the", "specified", "key", "and", "replacement", "arguments", "localized", "to", "the", "given", "locale", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/Messages.java#L172-L183
neo4j-contrib/neo4j-apoc-procedures
src/main/java/apoc/es/ElasticSearch.java
ElasticSearch.getQueryUrl
protected String getQueryUrl(String hostOrKey, String index, String type, String id, Object query) { """ Get the full Elasticsearch url @param hostOrKey @param index @param type @param id @param query @return """ return getElasticSearchUrl(hostOrKey) + formatQueryUrl(index, type, id, query); ...
java
protected String getQueryUrl(String hostOrKey, String index, String type, String id, Object query) { return getElasticSearchUrl(hostOrKey) + formatQueryUrl(index, type, id, query); }
[ "protected", "String", "getQueryUrl", "(", "String", "hostOrKey", ",", "String", "index", ",", "String", "type", ",", "String", "id", ",", "Object", "query", ")", "{", "return", "getElasticSearchUrl", "(", "hostOrKey", ")", "+", "formatQueryUrl", "(", "index",...
Get the full Elasticsearch url @param hostOrKey @param index @param type @param id @param query @return
[ "Get", "the", "full", "Elasticsearch", "url" ]
train
https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/apoc/es/ElasticSearch.java#L51-L53
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java
TldFernClassifier.computeFernValue
protected int computeFernValue(float c_x, float c_y, float rectWidth , float rectHeight , TldFernDescription fern ) { """ Computes the value of the specified fern at the specified location in the image. """ rectWidth -= 1; rectHeight -= 1; int desc = 0; for( int i = 0; i < fern.pairs.length; i++ ) { ...
java
protected int computeFernValue(float c_x, float c_y, float rectWidth , float rectHeight , TldFernDescription fern ) { rectWidth -= 1; rectHeight -= 1; int desc = 0; for( int i = 0; i < fern.pairs.length; i++ ) { Point2D_F32 p_a = fern.pairs[i].a; Point2D_F32 p_b = fern.pairs[i].b; float valA = inter...
[ "protected", "int", "computeFernValue", "(", "float", "c_x", ",", "float", "c_y", ",", "float", "rectWidth", ",", "float", "rectHeight", ",", "TldFernDescription", "fern", ")", "{", "rectWidth", "-=", "1", ";", "rectHeight", "-=", "1", ";", "int", "desc", ...
Computes the value of the specified fern at the specified location in the image.
[ "Computes", "the", "value", "of", "the", "specified", "fern", "at", "the", "specified", "location", "in", "the", "image", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L206-L227
boncey/Flickr4Java
src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java
PhotosInterface.setSafetyLevel
public void setSafetyLevel(String photoId, String safetyLevel, Boolean hidden) throws FlickrException { """ Set the safety level (adultness) of a photo. <p> This method requires authentication with 'write' permission. @param photoId The photo ID @param safetyLevel The safety level of the photo or null @...
java
public void setSafetyLevel(String photoId, String safetyLevel, Boolean hidden) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_SET_SAFETYLEVEL); parameters.put("photo_id", photoId); if (safetyLevel != null) ...
[ "public", "void", "setSafetyLevel", "(", "String", "photoId", ",", "String", "safetyLevel", ",", "Boolean", "hidden", ")", "throws", "FlickrException", "{", "Map", "<", "String", ",", "Object", ">", "parameters", "=", "new", "HashMap", "<", "String", ",", "O...
Set the safety level (adultness) of a photo. <p> This method requires authentication with 'write' permission. @param photoId The photo ID @param safetyLevel The safety level of the photo or null @param hidden Hidden from public searches or not or null @see com.flickr4java.flickr.Flickr#SAFETYLEVEL_SAFE @see com.flick...
[ "Set", "the", "safety", "level", "(", "adultness", ")", "of", "a", "photo", ".", "<p", ">" ]
train
https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java#L1260-L1278
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/global/postprocessor/google/closure/ClosureGlobalPostProcessor.java
ClosureGlobalPostProcessor.getCompilerArgValue
private String getCompilerArgValue(String compilerArgName, String compilerArgValue) { """ Returns the compiler argument value @param compilerArgName the compiler argument name @param compilerArgValue the compiler argument name @return the compiler argument value """ if (compilerArgName.equals(COMPILAT...
java
private String getCompilerArgValue(String compilerArgName, String compilerArgValue) { if (compilerArgName.equals(COMPILATION_LEVEL)) { if (!ADVANCED_OPTIMIZATIONS_COMPILATION_LEVEL.equalsIgnoreCase(compilerArgValue) && !WHITESPACE_ONLY_COMPILATION_LEVEL.equalsIgnoreCase(compilerArgValue) && !SIMPLE_OPTIM...
[ "private", "String", "getCompilerArgValue", "(", "String", "compilerArgName", ",", "String", "compilerArgValue", ")", "{", "if", "(", "compilerArgName", ".", "equals", "(", "COMPILATION_LEVEL", ")", ")", "{", "if", "(", "!", "ADVANCED_OPTIMIZATIONS_COMPILATION_LEVEL",...
Returns the compiler argument value @param compilerArgName the compiler argument name @param compilerArgValue the compiler argument name @return the compiler argument value
[ "Returns", "the", "compiler", "argument", "value" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/global/postprocessor/google/closure/ClosureGlobalPostProcessor.java#L436-L454
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java
JQLChecker.extractFromVariableStatement
public List<JQLPlaceHolder> extractFromVariableStatement(JQLContext jqlContext, String jql) { """ Extract all bind parameters and dynamic part used in query. @param jqlContext the jql context @param jql the jql @return the list """ return extractPlaceHoldersFromVariableStatement(jqlContext, jql, new A...
java
public List<JQLPlaceHolder> extractFromVariableStatement(JQLContext jqlContext, String jql) { return extractPlaceHoldersFromVariableStatement(jqlContext, jql, new ArrayList<JQLPlaceHolder>()); }
[ "public", "List", "<", "JQLPlaceHolder", ">", "extractFromVariableStatement", "(", "JQLContext", "jqlContext", ",", "String", "jql", ")", "{", "return", "extractPlaceHoldersFromVariableStatement", "(", "jqlContext", ",", "jql", ",", "new", "ArrayList", "<", "JQLPlaceH...
Extract all bind parameters and dynamic part used in query. @param jqlContext the jql context @param jql the jql @return the list
[ "Extract", "all", "bind", "parameters", "and", "dynamic", "part", "used", "in", "query", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L859-L861
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java
BeanDefinitionParserUtils.setPropertyValue
public static void setPropertyValue(BeanDefinitionBuilder builder, String propertyValue, String propertyName) { """ Sets the property value on bean definition in case value is set properly. @param builder the bean definition builder to be configured @param propertyValue the property value @param propertyName...
java
public static void setPropertyValue(BeanDefinitionBuilder builder, String propertyValue, String propertyName) { if (StringUtils.hasText(propertyValue)) { builder.addPropertyValue(propertyName, propertyValue); } }
[ "public", "static", "void", "setPropertyValue", "(", "BeanDefinitionBuilder", "builder", ",", "String", "propertyValue", ",", "String", "propertyName", ")", "{", "if", "(", "StringUtils", ".", "hasText", "(", "propertyValue", ")", ")", "{", "builder", ".", "addP...
Sets the property value on bean definition in case value is set properly. @param builder the bean definition builder to be configured @param propertyValue the property value @param propertyName the name of the property
[ "Sets", "the", "property", "value", "on", "bean", "definition", "in", "case", "value", "is", "set", "properly", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java#L48-L52
haraldk/TwelveMonkeys
servlet/src/main/java/com/twelvemonkeys/servlet/image/CropFilter.java
CropFilter.doFilter
protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) { """ Reads the image from the requested URL, scales it, crops it, and returns it in the Servlet stream. See above for details on parameters. """ // Get crop coordinates int x = S...
java
protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) { // Get crop coordinates int x = ServletUtil.getIntParameter(pRequest, PARAM_CROP_X, -1); int y = ServletUtil.getIntParameter(pRequest, PARAM_CROP_Y, -1); int width = Serv...
[ "protected", "RenderedImage", "doFilter", "(", "BufferedImage", "pImage", ",", "ServletRequest", "pRequest", ",", "ImageServletResponse", "pResponse", ")", "{", "// Get crop coordinates\r", "int", "x", "=", "ServletUtil", ".", "getIntParameter", "(", "pRequest", ",", ...
Reads the image from the requested URL, scales it, crops it, and returns it in the Servlet stream. See above for details on parameters.
[ "Reads", "the", "image", "from", "the", "requested", "URL", "scales", "it", "crops", "it", "and", "returns", "it", "in", "the", "Servlet", "stream", ".", "See", "above", "for", "details", "on", "parameters", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/CropFilter.java#L117-L138
ironjacamar/ironjacamar
core/src/main/java/org/ironjacamar/core/deploymentrepository/ResourceAdapterImpl.java
ResourceAdapterImpl.verifyBeanValidation
@SuppressWarnings("unchecked") private void verifyBeanValidation(Object as) throws Exception { """ Verify activation spec against bean validation @param as The activation spec @exception Exception Thrown in case of a violation """ if (beanValidation != null) { ValidatorFactory vf = nu...
java
@SuppressWarnings("unchecked") private void verifyBeanValidation(Object as) throws Exception { if (beanValidation != null) { ValidatorFactory vf = null; try { vf = beanValidation.getValidatorFactory(); Validator v = vf.getValidator(); Co...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "verifyBeanValidation", "(", "Object", "as", ")", "throws", "Exception", "{", "if", "(", "beanValidation", "!=", "null", ")", "{", "ValidatorFactory", "vf", "=", "null", ";", "try", "{", ...
Verify activation spec against bean validation @param as The activation spec @exception Exception Thrown in case of a violation
[ "Verify", "activation", "spec", "against", "bean", "validation" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/deploymentrepository/ResourceAdapterImpl.java#L316-L351
dlemmermann/CalendarFX
CalendarFXRecurrence/src/main/java/com/google/ical/iter/RecurrenceIteratorFactory.java
RecurrenceIteratorFactory.createRecurrenceIterator
public static RecurrenceIterator createRecurrenceIterator( String rdata, DateValue dtStart, TimeZone tzid, boolean strict) throws ParseException { """ given a block of RRULE, EXRULE, RDATE, and EXDATE content lines, parse them into a single recurrence iterator. @param rdata ical text. @p...
java
public static RecurrenceIterator createRecurrenceIterator( String rdata, DateValue dtStart, TimeZone tzid, boolean strict) throws ParseException { return createRecurrenceIterable(rdata, dtStart, tzid, strict).iterator(); }
[ "public", "static", "RecurrenceIterator", "createRecurrenceIterator", "(", "String", "rdata", ",", "DateValue", "dtStart", ",", "TimeZone", "tzid", ",", "boolean", "strict", ")", "throws", "ParseException", "{", "return", "createRecurrenceIterable", "(", "rdata", ",",...
given a block of RRULE, EXRULE, RDATE, and EXDATE content lines, parse them into a single recurrence iterator. @param rdata ical text. @param dtStart the date of the first occurrence in timezone tzid, which is used to fill in optional fields in the RRULE, such as the day of the month for a monthly repetition when no th...
[ "given", "a", "block", "of", "RRULE", "EXRULE", "RDATE", "and", "EXDATE", "content", "lines", "parse", "them", "into", "a", "single", "recurrence", "iterator", "." ]
train
https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/RecurrenceIteratorFactory.java#L91-L95
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
HtmlTree.SPAN
public static HtmlTree SPAN(HtmlStyle styleClass, Content body) { """ Generates a SPAN tag with style class attribute and some content. @param styleClass style class for the tag @param body content for the tag @return an HtmlTree object for the SPAN tag """ HtmlTree htmltree = new HtmlTree(HtmlTag...
java
public static HtmlTree SPAN(HtmlStyle styleClass, Content body) { HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body)); if (styleClass != null) htmltree.addStyle(styleClass); return htmltree; }
[ "public", "static", "HtmlTree", "SPAN", "(", "HtmlStyle", "styleClass", ",", "Content", "body", ")", "{", "HtmlTree", "htmltree", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "SPAN", ",", "nullCheck", "(", "body", ")", ")", ";", "if", "(", "styleClass", ...
Generates a SPAN tag with style class attribute and some content. @param styleClass style class for the tag @param body content for the tag @return an HtmlTree object for the SPAN tag
[ "Generates", "a", "SPAN", "tag", "with", "style", "class", "attribute", "and", "some", "content", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L719-L724
AzureAD/azure-activedirectory-library-for-java
src/main/java/com/microsoft/aad/adal4j/AuthenticationContext.java
AuthenticationContext.acquireDeviceCode
public Future<DeviceCode> acquireDeviceCode(final String clientId, final String resource, final AuthenticationCallback<DeviceCode> callback) { """ Acquires a device code from the authority @param clientId Identifier of the client requesting the token @param reso...
java
public Future<DeviceCode> acquireDeviceCode(final String clientId, final String resource, final AuthenticationCallback<DeviceCode> callback) { validateDeviceCodeRequestInput(clientId, resource); return service.submit( new AcquireDeviceC...
[ "public", "Future", "<", "DeviceCode", ">", "acquireDeviceCode", "(", "final", "String", "clientId", ",", "final", "String", "resource", ",", "final", "AuthenticationCallback", "<", "DeviceCode", ">", "callback", ")", "{", "validateDeviceCodeRequestInput", "(", "cli...
Acquires a device code from the authority @param clientId Identifier of the client requesting the token @param resource Identifier of the target resource that is the recipient of the requested token. @param callback optional callback object for non-blocking execution. @return A {@link Future} object representing the {...
[ "Acquires", "a", "device", "code", "from", "the", "authority" ]
train
https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/main/java/com/microsoft/aad/adal4j/AuthenticationContext.java#L620-L625
taimos/dvalin
cloud/aws/src/main/java/de/taimos/dvalin/cloud/aws/CloudFormation.java
CloudFormation.signalReady
public void signalReady(String stackName, String resourceName) { """ signal success to the given CloudFormation stack.<br> <br> Needed AWS actions: <ul> <li>cloudformation:SignalResource</li> </ul> """ Preconditions.checkArgument(stackName != null && !stackName.isEmpty()); Preconditions.ch...
java
public void signalReady(String stackName, String resourceName) { Preconditions.checkArgument(stackName != null && !stackName.isEmpty()); Preconditions.checkArgument(resourceName != null && !resourceName.isEmpty()); SignalResourceRequest req = new SignalResourceRequest(); req.setLogicalRe...
[ "public", "void", "signalReady", "(", "String", "stackName", ",", "String", "resourceName", ")", "{", "Preconditions", ".", "checkArgument", "(", "stackName", "!=", "null", "&&", "!", "stackName", ".", "isEmpty", "(", ")", ")", ";", "Preconditions", ".", "ch...
signal success to the given CloudFormation stack.<br> <br> Needed AWS actions: <ul> <li>cloudformation:SignalResource</li> </ul>
[ "signal", "success", "to", "the", "given", "CloudFormation", "stack", ".", "<br", ">", "<br", ">", "Needed", "AWS", "actions", ":", "<ul", ">", "<li", ">", "cloudformation", ":", "SignalResource<", "/", "li", ">", "<", "/", "ul", ">" ]
train
https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/cloud/aws/src/main/java/de/taimos/dvalin/cloud/aws/CloudFormation.java#L53-L62
kaazing/gateway
util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java
Asn1Utils.decodeGeneralizedTime
public static Date decodeGeneralizedTime(ByteBuffer buf) { """ Decode an ASN.1 GeneralizedTime. @param buf the DER-encoded GeneralizedTime @return the data and time """ // GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString DerId id = DerId.decode(buf); if (!id.matches(DerId....
java
public static Date decodeGeneralizedTime(ByteBuffer buf) { // GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString DerId id = DerId.decode(buf); if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_GENERALIZED_TIME_TAG_NUM)) { throw new IllegalArgumentExc...
[ "public", "static", "Date", "decodeGeneralizedTime", "(", "ByteBuffer", "buf", ")", "{", "// GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString", "DerId", "id", "=", "DerId", ".", "decode", "(", "buf", ")", ";", "if", "(", "!", "id", ".", "matches", "(", ...
Decode an ASN.1 GeneralizedTime. @param buf the DER-encoded GeneralizedTime @return the data and time
[ "Decode", "an", "ASN", ".", "1", "GeneralizedTime", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L96-L142
drewnoakes/metadata-extractor
Source/com/drew/lang/RandomAccessStreamReader.java
RandomAccessStreamReader.validateIndex
@Override protected void validateIndex(int index, int bytesRequested) throws IOException { """ Ensures that the buffered bytes extend to cover the specified index. If not, an attempt is made to read to that point. <p> If the stream ends before the point is reached, a {@link BufferBoundsException} is raised....
java
@Override protected void validateIndex(int index, int bytesRequested) throws IOException { if (index < 0) { throw new BufferBoundsException(String.format("Attempt to read from buffer using a negative index (%d)", index)); } else if (bytesRequested < 0) { throw new BufferB...
[ "@", "Override", "protected", "void", "validateIndex", "(", "int", "index", ",", "int", "bytesRequested", ")", "throws", "IOException", "{", "if", "(", "index", "<", "0", ")", "{", "throw", "new", "BufferBoundsException", "(", "String", ".", "format", "(", ...
Ensures that the buffered bytes extend to cover the specified index. If not, an attempt is made to read to that point. <p> If the stream ends before the point is reached, a {@link BufferBoundsException} is raised. @param index the index from which the required bytes start @param bytesRequested the number of bytes whic...
[ "Ensures", "that", "the", "buffered", "bytes", "extend", "to", "cover", "the", "specified", "index", ".", "If", "not", "an", "attempt", "is", "made", "to", "read", "to", "that", "point", ".", "<p", ">", "If", "the", "stream", "ends", "before", "the", "...
train
https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/lang/RandomAccessStreamReader.java#L96-L112
apache/groovy
src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
MetaClassRegistryImpl.fireConstantMetaClassUpdate
protected void fireConstantMetaClassUpdate(Object obj, Class c, final MetaClass oldMC, MetaClass newMc) { """ Causes the execution of all registered listeners. This method is used mostly internal to kick of the listener notification. It can also be used by subclasses to achieve the same. @param obj object ins...
java
protected void fireConstantMetaClassUpdate(Object obj, Class c, final MetaClass oldMC, MetaClass newMc) { MetaClassRegistryChangeEventListener[] listener = getMetaClassRegistryChangeEventListeners(); MetaClassRegistryChangeEvent cmcu = new MetaClassRegistryChangeEvent(this, obj, c, oldMC, newMc); ...
[ "protected", "void", "fireConstantMetaClassUpdate", "(", "Object", "obj", ",", "Class", "c", ",", "final", "MetaClass", "oldMC", ",", "MetaClass", "newMc", ")", "{", "MetaClassRegistryChangeEventListener", "[", "]", "listener", "=", "getMetaClassRegistryChangeEventListe...
Causes the execution of all registered listeners. This method is used mostly internal to kick of the listener notification. It can also be used by subclasses to achieve the same. @param obj object instance if the MetaClass change is on a per-instance metaclass (or null if global) @param c the class @param oldMC the ol...
[ "Causes", "the", "execution", "of", "all", "registered", "listeners", ".", "This", "method", "is", "used", "mostly", "internal", "to", "kick", "of", "the", "listener", "notification", ".", "It", "can", "also", "be", "used", "by", "subclasses", "to", "achieve...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java#L402-L408
jmxtrans/jmxtrans
jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java
KeyUtils.getPrefixedKeyString
public static String getPrefixedKeyString(Query query, Result result, List<String> typeNames) { """ Gets the key string, without rootPrefix or Alias @param query the query @param result the result @param typeNames the type names @return the key string """ StringBuilder sb = new StringBuilder(); ...
java
public static String getPrefixedKeyString(Query query, Result result, List<String> typeNames) { StringBuilder sb = new StringBuilder(); addTypeName(query, result, typeNames, sb); addKeyString(query, result, sb); return sb.toString(); }
[ "public", "static", "String", "getPrefixedKeyString", "(", "Query", "query", ",", "Result", "result", ",", "List", "<", "String", ">", "typeNames", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "addTypeName", "(", "query", ",",...
Gets the key string, without rootPrefix or Alias @param query the query @param result the result @param typeNames the type names @return the key string
[ "Gets", "the", "key", "string", "without", "rootPrefix", "or", "Alias" ]
train
https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java#L89-L94
sw926/ImageFileSelector
library/src/main/java/com/sw926/imagefileselector/CommonUtils.java
CommonUtils.generateExternalImageCacheFile
public static File generateExternalImageCacheFile(Context context, String ext) { """ 在图片缓存文件夹生成一个临时文件 @param context context @param ext 文件后缀名 e.g ".jpg" @return 生成的临时文件 """ String fileName = "img_" + System.currentTimeMillis(); return generateExternalImageCacheFile(context, fileName, e...
java
public static File generateExternalImageCacheFile(Context context, String ext) { String fileName = "img_" + System.currentTimeMillis(); return generateExternalImageCacheFile(context, fileName, ext); }
[ "public", "static", "File", "generateExternalImageCacheFile", "(", "Context", "context", ",", "String", "ext", ")", "{", "String", "fileName", "=", "\"img_\"", "+", "System", ".", "currentTimeMillis", "(", ")", ";", "return", "generateExternalImageCacheFile", "(", ...
在图片缓存文件夹生成一个临时文件 @param context context @param ext 文件后缀名 e.g ".jpg" @return 生成的临时文件
[ "在图片缓存文件夹生成一个临时文件" ]
train
https://github.com/sw926/ImageFileSelector/blob/65ca79c37d4f67286f9a51942f426691182e833d/library/src/main/java/com/sw926/imagefileselector/CommonUtils.java#L57-L60
b3log/latke
latke-core/src/main/java/org/b3log/latke/servlet/renderer/AbstractFreeMarkerRenderer.java
AbstractFreeMarkerRenderer.doRender
protected void doRender(final String html, final HttpServletRequest request, final HttpServletResponse response) throws Exception { """ Processes the specified FreeMarker template with the specified request, data model and response. <p> Puts the page response contents into cache with the key getting from request...
java
protected void doRender(final String html, final HttpServletRequest request, final HttpServletResponse response) throws Exception { PrintWriter writer; try { writer = response.getWriter(); } catch (final Exception e) { writer = new PrintWriter(response.getOutputStream());...
[ "protected", "void", "doRender", "(", "final", "String", "html", ",", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ")", "throws", "Exception", "{", "PrintWriter", "writer", ";", "try", "{", "writer", "=", "response", ...
Processes the specified FreeMarker template with the specified request, data model and response. <p> Puts the page response contents into cache with the key getting from request attribute specified by <i>page cache key</i>. </p> @param html the specified HTML content @param request the specified request @param re...
[ "Processes", "the", "specified", "FreeMarker", "template", "with", "the", "specified", "request", "data", "model", "and", "response", ".", "<p", ">", "Puts", "the", "page", "response", "contents", "into", "cache", "with", "the", "key", "getting", "from", "requ...
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/servlet/renderer/AbstractFreeMarkerRenderer.java#L179-L201
JOML-CI/JOML
src/org/joml/Intersectionf.java
Intersectionf.intersectPolygonRay
public static int intersectPolygonRay(float[] verticesXY, float originX, float originY, float dirX, float dirY, Vector2f p) { """ Determine whether the polygon specified by the given sequence of <code>(x, y)</code> coordinate pairs intersects with the ray with given origin <code>(originX, originY, originZ)</code>...
java
public static int intersectPolygonRay(float[] verticesXY, float originX, float originY, float dirX, float dirY, Vector2f p) { float nearestT = Float.POSITIVE_INFINITY; int count = verticesXY.length >> 1; int edgeIndex = -1; float aX = verticesXY[(count-1)<<1], aY = verticesXY[((count-1)<...
[ "public", "static", "int", "intersectPolygonRay", "(", "float", "[", "]", "verticesXY", ",", "float", "originX", ",", "float", "originY", ",", "float", "dirX", ",", "float", "dirY", ",", "Vector2f", "p", ")", "{", "float", "nearestT", "=", "Float", ".", ...
Determine whether the polygon specified by the given sequence of <code>(x, y)</code> coordinate pairs intersects with the ray with given origin <code>(originX, originY, originZ)</code> and direction <code>(dirX, dirY, dirZ)</code>, and store the point of intersection into the given vector <code>p</code>. <p> If the pol...
[ "Determine", "whether", "the", "polygon", "specified", "by", "the", "given", "sequence", "of", "<code", ">", "(", "x", "y", ")", "<", "/", "code", ">", "coordinate", "pairs", "intersects", "with", "the", "ray", "with", "given", "origin", "<code", ">", "(...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L4842-L4866