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
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/stream/RecordEnvelope.java
RecordEnvelope.setRecordMetadata
public void setRecordMetadata(String key, Object value) { """ Set the record metadata @param key key for the metadata @param value value of the metadata @implNote should not be called concurrently """ if (_recordMetadata == null) { _recordMetadata = new HashMap<>(); } _recordMetadata.pu...
java
public void setRecordMetadata(String key, Object value) { if (_recordMetadata == null) { _recordMetadata = new HashMap<>(); } _recordMetadata.put(key, value); }
[ "public", "void", "setRecordMetadata", "(", "String", "key", ",", "Object", "value", ")", "{", "if", "(", "_recordMetadata", "==", "null", ")", "{", "_recordMetadata", "=", "new", "HashMap", "<>", "(", ")", ";", "}", "_recordMetadata", ".", "put", "(", "...
Set the record metadata @param key key for the metadata @param value value of the metadata @implNote should not be called concurrently
[ "Set", "the", "record", "metadata", "@param", "key", "key", "for", "the", "metadata", "@param", "value", "value", "of", "the", "metadata" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/stream/RecordEnvelope.java#L141-L147
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/Image.java
Image.getFlippedCopy
public Image getFlippedCopy(boolean flipHorizontal, boolean flipVertical) { """ Get a copy image flipped on potentially two axis @param flipHorizontal True if we want to flip the image horizontally @param flipVertical True if we want to flip the image vertically @return The flipped image instance @see {{@lin...
java
public Image getFlippedCopy(boolean flipHorizontal, boolean flipVertical) { init(); Image image = copy(); if (flipHorizontal) { image.textureOffsetX = textureOffsetX + textureWidth; image.textureWidth = -textureWidth; } if (flipVertical) { image.textureOffsetY = textureOffsetY + textureHe...
[ "public", "Image", "getFlippedCopy", "(", "boolean", "flipHorizontal", ",", "boolean", "flipVertical", ")", "{", "init", "(", ")", ";", "Image", "image", "=", "copy", "(", ")", ";", "if", "(", "flipHorizontal", ")", "{", "image", ".", "textureOffsetX", "="...
Get a copy image flipped on potentially two axis @param flipHorizontal True if we want to flip the image horizontally @param flipVertical True if we want to flip the image vertically @return The flipped image instance @see {{@link #getScaledCopy(int, int)} for caveats on scaled images
[ "Get", "a", "copy", "image", "flipped", "on", "potentially", "two", "axis" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L1270-L1284
cdk/cdk
tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricTetrahedralEncoderFactory.java
GeometricTetrahedralEncoderFactory.geometric2D
private static GeometricParity geometric2D(Map<IAtom, Integer> elevationMap, List<IBond> bonds, int i, int[] adjacent, IAtomContainer container) { """ Create the geometric part of an encoder of 2D configurations @param elevationMap temporary map to store the bond elevations (2D) @param bonds ...
java
private static GeometricParity geometric2D(Map<IAtom, Integer> elevationMap, List<IBond> bonds, int i, int[] adjacent, IAtomContainer container) { IAtom atom = container.getAtom(i); // create map of the atoms and their elevation from the center, makeElevationMap(atom, bonds, elevat...
[ "private", "static", "GeometricParity", "geometric2D", "(", "Map", "<", "IAtom", ",", "Integer", ">", "elevationMap", ",", "List", "<", "IBond", ">", "bonds", ",", "int", "i", ",", "int", "[", "]", "adjacent", ",", "IAtomContainer", "container", ")", "{", ...
Create the geometric part of an encoder of 2D configurations @param elevationMap temporary map to store the bond elevations (2D) @param bonds list of bonds connected to the atom at i @param i the central atom (index) @param adjacent adjacent atoms (indices) @param container container @return g...
[ "Create", "the", "geometric", "part", "of", "an", "encoder", "of", "2D", "configurations" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricTetrahedralEncoderFactory.java#L144-L175
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/MapLabelSetterFactory.java
MapLabelSetterFactory.createField
private Optional<MapLabelSetter> createField(final Class<?> beanClass, final String fieldName) { """ フィールドによるラベル情報を格納する場合。 <p>{@code <フィールド名> + Label}のメソッド名</p> @param beanClass フィールドが定義してあるクラスのインスタンス @param fieldName フィールド名 @return ラベル情報の設定用クラス """ final String labelFieldName = fieldN...
java
private Optional<MapLabelSetter> createField(final Class<?> beanClass, final String fieldName) { final String labelFieldName = fieldName + "Label"; final Field labelField; try { labelField = beanClass.getDeclaredField(labelFieldName); labelField.s...
[ "private", "Optional", "<", "MapLabelSetter", ">", "createField", "(", "final", "Class", "<", "?", ">", "beanClass", ",", "final", "String", "fieldName", ")", "{", "final", "String", "labelFieldName", "=", "fieldName", "+", "\"Label\"", ";", "final", "Field", ...
フィールドによるラベル情報を格納する場合。 <p>{@code <フィールド名> + Label}のメソッド名</p> @param beanClass フィールドが定義してあるクラスのインスタンス @param fieldName フィールド名 @return ラベル情報の設定用クラス
[ "フィールドによるラベル情報を格納する場合。", "<p", ">", "{", "@code", "<フィールド名", ">", "+", "Label", "}", "のメソッド名<", "/", "p", ">" ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/MapLabelSetterFactory.java#L179-L229
pravega/pravega
client/src/main/java/io/pravega/client/stream/impl/ModelHelper.java
ModelHelper.decode
public static final StreamConfig decode(String scope, String streamName, final StreamConfiguration configModel) { """ Converts StreamConfiguration into StreamConfig. @param scope the stream's scope @param streamName The Stream Name @param configModel The stream configuration. @return StreamConfig instance. ...
java
public static final StreamConfig decode(String scope, String streamName, final StreamConfiguration configModel) { Preconditions.checkNotNull(configModel, "configModel"); final StreamConfig.Builder builder = StreamConfig.newBuilder() .setStreamInfo(createStreamInfo(scope, streamName)) ...
[ "public", "static", "final", "StreamConfig", "decode", "(", "String", "scope", ",", "String", "streamName", ",", "final", "StreamConfiguration", "configModel", ")", "{", "Preconditions", ".", "checkNotNull", "(", "configModel", ",", "\"configModel\"", ")", ";", "f...
Converts StreamConfiguration into StreamConfig. @param scope the stream's scope @param streamName The Stream Name @param configModel The stream configuration. @return StreamConfig instance.
[ "Converts", "StreamConfiguration", "into", "StreamConfig", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ModelHelper.java#L291-L300
jcuda/jcuda
JCudaJava/src/main/java/jcuda/runtime/JCuda.java
JCuda.cudaArrayGetInfo
public static int cudaArrayGetInfo(cudaChannelFormatDesc desc, cudaExtent extent, int flags[], cudaArray array) { """ Gets info about the specified cudaArray. <pre> cudaError_t cudaArrayGetInfo ( cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array ) </pre> <div> <p>Ge...
java
public static int cudaArrayGetInfo(cudaChannelFormatDesc desc, cudaExtent extent, int flags[], cudaArray array) { return checkResult(cudaArrayGetInfoNative(desc, extent, flags, array)); }
[ "public", "static", "int", "cudaArrayGetInfo", "(", "cudaChannelFormatDesc", "desc", ",", "cudaExtent", "extent", ",", "int", "flags", "[", "]", ",", "cudaArray", "array", ")", "{", "return", "checkResult", "(", "cudaArrayGetInfoNative", "(", "desc", ",", "exten...
Gets info about the specified cudaArray. <pre> cudaError_t cudaArrayGetInfo ( cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array ) </pre> <div> <p>Gets info about the specified cudaArray. Returns in <tt>*desc</tt>, <tt>*extent</tt> and <tt>*flags</tt> respectively, the type, shape ...
[ "Gets", "info", "about", "the", "specified", "cudaArray", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L3562-L3565
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.allParametersAreHidden
public static boolean allParametersAreHidden(Map<String, QueryParameter> map) { """ See if all parameters are hidden @param map map of parameters @return true if all parameters are hidden """ for (QueryParameter qp : map.values()) { if (!qp.isHidden()) { return false; ...
java
public static boolean allParametersAreHidden(Map<String, QueryParameter> map) { for (QueryParameter qp : map.values()) { if (!qp.isHidden()) { return false; } } return true; }
[ "public", "static", "boolean", "allParametersAreHidden", "(", "Map", "<", "String", ",", "QueryParameter", ">", "map", ")", "{", "for", "(", "QueryParameter", "qp", ":", "map", ".", "values", "(", ")", ")", "{", "if", "(", "!", "qp", ".", "isHidden", "...
See if all parameters are hidden @param map map of parameters @return true if all parameters are hidden
[ "See", "if", "all", "parameters", "are", "hidden" ]
train
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L801-L808
allengeorge/libraft
libraft-agent/src/main/java/io/libraft/agent/snapshots/OnDiskSnapshotsStore.java
OnDiskSnapshotsStore.newSnapshotWriter
@Override public ExtendedSnapshotWriter newSnapshotWriter() throws StorageException { """ {@inheritDoc} @throws IllegalStateException if this method is called before {@link OnDiskSnapshotsStore#initialize()} """ checkInitialized(); try { return new SnapshotFileWriter(snapsho...
java
@Override public ExtendedSnapshotWriter newSnapshotWriter() throws StorageException { checkInitialized(); try { return new SnapshotFileWriter(snapshotsDirectory); } catch (Exception e) { throw new StorageException("fail create snapshot request", e); } }
[ "@", "Override", "public", "ExtendedSnapshotWriter", "newSnapshotWriter", "(", ")", "throws", "StorageException", "{", "checkInitialized", "(", ")", ";", "try", "{", "return", "new", "SnapshotFileWriter", "(", "snapshotsDirectory", ")", ";", "}", "catch", "(", "Ex...
{@inheritDoc} @throws IllegalStateException if this method is called before {@link OnDiskSnapshotsStore#initialize()}
[ "{", "@inheritDoc", "}" ]
train
https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/snapshots/OnDiskSnapshotsStore.java#L181-L190
Wikidata/Wikidata-Toolkit
wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/TermStatementUpdate.java
TermStatementUpdate.initUpdatesFromCurrentValues
protected Map<String, NameWithUpdate> initUpdatesFromCurrentValues(Collection<MonolingualTextValue> currentValues) { """ Initializes the list of current values for a type of terms (label or description). @param currentValues current values for the type of terms @return a map of updates (where all terms are ma...
java
protected Map<String, NameWithUpdate> initUpdatesFromCurrentValues(Collection<MonolingualTextValue> currentValues) { Map<String, NameWithUpdate> updates = new HashMap<>(); for(MonolingualTextValue label: currentValues) { updates.put(label.getLanguageCode(), new NameWithUpdat...
[ "protected", "Map", "<", "String", ",", "NameWithUpdate", ">", "initUpdatesFromCurrentValues", "(", "Collection", "<", "MonolingualTextValue", ">", "currentValues", ")", "{", "Map", "<", "String", ",", "NameWithUpdate", ">", "updates", "=", "new", "HashMap", "<>",...
Initializes the list of current values for a type of terms (label or description). @param currentValues current values for the type of terms @return a map of updates (where all terms are marked as not for write)
[ "Initializes", "the", "list", "of", "current", "values", "for", "a", "type", "of", "terms", "(", "label", "or", "description", ")", "." ]
train
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/TermStatementUpdate.java#L153-L160
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java
DescribePointSurf.computeLaplaceSign
public boolean computeLaplaceSign(int x, int y, double scale) { """ Compute the sign of the Laplacian using a sparse convolution. @param x center @param y center @param scale scale of the feature @return true if positive """ int s = (int)Math.ceil(scale); kerXX = DerivativeIntegralImage.kernelDerivXX...
java
public boolean computeLaplaceSign(int x, int y, double scale) { int s = (int)Math.ceil(scale); kerXX = DerivativeIntegralImage.kernelDerivXX(9*s,kerXX); kerYY = DerivativeIntegralImage.kernelDerivYY(9*s,kerYY); double lap = GIntegralImageOps.convolveSparse(ii,kerXX,x,y); lap += GIntegralImageOps.convolveSpars...
[ "public", "boolean", "computeLaplaceSign", "(", "int", "x", ",", "int", "y", ",", "double", "scale", ")", "{", "int", "s", "=", "(", "int", ")", "Math", ".", "ceil", "(", "scale", ")", ";", "kerXX", "=", "DerivativeIntegralImage", ".", "kernelDerivXX", ...
Compute the sign of the Laplacian using a sparse convolution. @param x center @param y center @param scale scale of the feature @return true if positive
[ "Compute", "the", "sign", "of", "the", "Laplacian", "using", "a", "sparse", "convolution", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java#L305-L313
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_voicemail_serviceName_directories_GET
public ArrayList<Long> billingAccount_voicemail_serviceName_directories_GET(String billingAccount, String serviceName, OvhVoicemailMessageFolderDirectoryEnum dir) throws IOException { """ Voicemail directory messages REST: GET /telephony/{billingAccount}/voicemail/{serviceName}/directories @param dir [required...
java
public ArrayList<Long> billingAccount_voicemail_serviceName_directories_GET(String billingAccount, String serviceName, OvhVoicemailMessageFolderDirectoryEnum dir) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/directories"; StringBuilder sb = path(qPath, billingAccount, ser...
[ "public", "ArrayList", "<", "Long", ">", "billingAccount_voicemail_serviceName_directories_GET", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhVoicemailMessageFolderDirectoryEnum", "dir", ")", "throws", "IOException", "{", "String", "qPath", "=", ...
Voicemail directory messages REST: GET /telephony/{billingAccount}/voicemail/{serviceName}/directories @param dir [required] Filter the value of dir property (=) @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Voicemail", "directory", "messages" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7892-L7898
docusign/docusign-java-client
src/main/java/com/docusign/esign/api/PowerFormsApi.java
PowerFormsApi.listPowerFormSenders
public PowerFormSendersResponse listPowerFormSenders(String accountId, PowerFormsApi.ListPowerFormSendersOptions options) throws ApiException { """ Returns the list of PowerForms available to the user. @param accountId The external account number (int) or account ID Guid. (required) @param options for modifyin...
java
public PowerFormSendersResponse listPowerFormSenders(String accountId, PowerFormsApi.ListPowerFormSendersOptions options) throws ApiException { Object localVarPostBody = "{}"; // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException(400, "Missing the...
[ "public", "PowerFormSendersResponse", "listPowerFormSenders", "(", "String", "accountId", ",", "PowerFormsApi", ".", "ListPowerFormSendersOptions", "options", ")", "throws", "ApiException", "{", "Object", "localVarPostBody", "=", "\"{}\"", ";", "// verify the required paramet...
Returns the list of PowerForms available to the user. @param accountId The external account number (int) or account ID Guid. (required) @param options for modifying the method behavior. @return PowerFormSendersResponse @throws ApiException if fails to make API call
[ "Returns", "the", "list", "of", "PowerForms", "available", "to", "the", "user", "." ]
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/PowerFormsApi.java#L367-L403
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
Graph.fromCsvReader
public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) { """ Creates a Graph from a CSV file of vertices and a CSV file of edges. @param verticesPath path to a CSV file with the Vertex data. @param edgesPath path to a CSV file with the Edge data @param ...
java
public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) { return new GraphCsvReader(verticesPath, edgesPath, context); }
[ "public", "static", "GraphCsvReader", "fromCsvReader", "(", "String", "verticesPath", ",", "String", "edgesPath", ",", "ExecutionEnvironment", "context", ")", "{", "return", "new", "GraphCsvReader", "(", "verticesPath", ",", "edgesPath", ",", "context", ")", ";", ...
Creates a Graph from a CSV file of vertices and a CSV file of edges. @param verticesPath path to a CSV file with the Vertex data. @param edgesPath path to a CSV file with the Edge data @param context the Flink execution environment. @return An instance of {@link org.apache.flink.graph.GraphCsvReader}, on which calling...
[ "Creates", "a", "Graph", "from", "a", "CSV", "file", "of", "vertices", "and", "a", "CSV", "file", "of", "edges", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L391-L393
aspectran/aspectran
core/src/main/java/com/aspectran/core/util/BeanDescriptor.java
BeanDescriptor.getSetterAnnotation
public <T extends Annotation> T getSetterAnnotation(String name, Class<T> annotationType) throws NoSuchMethodException { """ Invokes the annotation of the given type. @param name the given setter name @param annotationType the annotation type to look for @param <T> the annotation type @return the...
java
public <T extends Annotation> T getSetterAnnotation(String name, Class<T> annotationType) throws NoSuchMethodException { Method method = getSetter(name); return getSetterAnnotation(method, annotationType); }
[ "public", "<", "T", "extends", "Annotation", ">", "T", "getSetterAnnotation", "(", "String", "name", ",", "Class", "<", "T", ">", "annotationType", ")", "throws", "NoSuchMethodException", "{", "Method", "method", "=", "getSetter", "(", "name", ")", ";", "ret...
Invokes the annotation of the given type. @param name the given setter name @param annotationType the annotation type to look for @param <T> the annotation type @return the annotation object, or null if not found @throws NoSuchMethodException when a setter method cannot be found
[ "Invokes", "the", "annotation", "of", "the", "given", "type", "." ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L311-L315
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderList.java
ProviderList.getServices
public List<Service> getServices(String type, String algorithm) { """ Return a List containing all the Services describing implementations of the specified algorithms in precedence order. If no implementation exists, this method returns an empty List. The elements of this list are determined lazily on demand....
java
public List<Service> getServices(String type, String algorithm) { return new ServiceList(type, algorithm); }
[ "public", "List", "<", "Service", ">", "getServices", "(", "String", "type", ",", "String", "algorithm", ")", "{", "return", "new", "ServiceList", "(", "type", ",", "algorithm", ")", ";", "}" ]
Return a List containing all the Services describing implementations of the specified algorithms in precedence order. If no implementation exists, this method returns an empty List. The elements of this list are determined lazily on demand. The List returned is NOT thread safe.
[ "Return", "a", "List", "containing", "all", "the", "Services", "describing", "implementations", "of", "the", "specified", "algorithms", "in", "precedence", "order", ".", "If", "no", "implementation", "exists", "this", "method", "returns", "an", "empty", "List", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderList.java#L355-L357
Stratio/stratio-cassandra
src/java/org/apache/cassandra/tools/SSTableImport.java
SSTableImport.getKeyValidator
private AbstractType<?> getKeyValidator(ColumnFamily columnFamily) { """ Get key validator for column family @param columnFamily column family instance @return key validator for given column family """ // this is a fix to support backward compatibility // which allows to skip the current key ...
java
private AbstractType<?> getKeyValidator(ColumnFamily columnFamily) { // this is a fix to support backward compatibility // which allows to skip the current key validator // please, take a look onto CASSANDRA-7498 for more details if ("true".equals(System.getProperty("skip.key.validator",...
[ "private", "AbstractType", "<", "?", ">", "getKeyValidator", "(", "ColumnFamily", "columnFamily", ")", "{", "// this is a fix to support backward compatibility", "// which allows to skip the current key validator", "// please, take a look onto CASSANDRA-7498 for more details", "if", "(...
Get key validator for column family @param columnFamily column family instance @return key validator for given column family
[ "Get", "key", "validator", "for", "column", "family" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L435-L443
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java
PathNormalizer.getRelativeWebPath
public static final String getRelativeWebPath(final String oldPath, final String newPath) { """ This method can calculate the relative path between two pathes on a web site. <br/> <pre> PathUtils.getRelativeWebPath( null, null ) = "" PathUtils.getRelativeWebPath( null...
java
public static final String getRelativeWebPath(final String oldPath, final String newPath) { if (StringUtils.isEmpty(oldPath) || StringUtils.isEmpty(newPath)) { return ""; } String resultPath = buildRelativePath(newPath, oldPath, '/'); if (newPath.endsWith("/") && !resultPath.endsWith("/")) { return resu...
[ "public", "static", "final", "String", "getRelativeWebPath", "(", "final", "String", "oldPath", ",", "final", "String", "newPath", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "oldPath", ")", "||", "StringUtils", ".", "isEmpty", "(", "newPath", "...
This method can calculate the relative path between two pathes on a web site. <br/> <pre> PathUtils.getRelativeWebPath( null, null ) = "" PathUtils.getRelativeWebPath( null, "http://plexus.codehaus.org/" ) = "" PathUtils.getRelativeWebPath( "http://plexus.codeha...
[ "This", "method", "can", "calculate", "the", "relative", "path", "between", "two", "pathes", "on", "a", "web", "site", ".", "<br", "/", ">" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java#L761-L773
JodaOrg/joda-time
src/main/java/org/joda/time/convert/NullConverter.java
NullConverter.setInto
public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) { """ Sets the given ReadWritableDuration to zero milliseconds. @param duration duration to get modified @param object the object to convert, which is null @param chrono the chronology to use @throws NullPointerException if ...
java
public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) { duration.setPeriod((Period) null); }
[ "public", "void", "setInto", "(", "ReadWritablePeriod", "duration", ",", "Object", "object", ",", "Chronology", "chrono", ")", "{", "duration", ".", "setPeriod", "(", "(", "Period", ")", "null", ")", ";", "}" ]
Sets the given ReadWritableDuration to zero milliseconds. @param duration duration to get modified @param object the object to convert, which is null @param chrono the chronology to use @throws NullPointerException if the duration is null
[ "Sets", "the", "given", "ReadWritableDuration", "to", "zero", "milliseconds", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/NullConverter.java#L68-L70
jbundle/jbundle
thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/memory/MemoryRemoteTable.java
MemoryRemoteTable.remove
public void remove(Object data, int iOpenMode) throws DBException, RemoteException { """ Delete the current record. @param - This is a dummy param, because this call conflicts with a call in EJBHome. @exception Exception File exception. """ if (m_objCurrentKey == null) throw new DBExcepti...
java
public void remove(Object data, int iOpenMode) throws DBException, RemoteException { if (m_objCurrentKey == null) throw new DBException(Constants.INVALID_RECORD); m_mDataMap.remove(m_objCurrentKey); if (m_iCurrentRecord != -1) m_iCurrentRecord--; // This will keep...
[ "public", "void", "remove", "(", "Object", "data", ",", "int", "iOpenMode", ")", "throws", "DBException", ",", "RemoteException", "{", "if", "(", "m_objCurrentKey", "==", "null", ")", "throw", "new", "DBException", "(", "Constants", ".", "INVALID_RECORD", ")",...
Delete the current record. @param - This is a dummy param, because this call conflicts with a call in EJBHome. @exception Exception File exception.
[ "Delete", "the", "current", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/memory/MemoryRemoteTable.java#L175-L183
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java
BeetlUtil.getFileTemplate
public static Template getFileTemplate(String dir, String templateFileName) { """ 获得本地文件模板 @param dir 目录绝对路径 @param templateFileName 模板内容 @return 模板 @since 3.2.0 """ return getTemplate(createFileGroupTemplate(dir), templateFileName); }
java
public static Template getFileTemplate(String dir, String templateFileName) { return getTemplate(createFileGroupTemplate(dir), templateFileName); }
[ "public", "static", "Template", "getFileTemplate", "(", "String", "dir", ",", "String", "templateFileName", ")", "{", "return", "getTemplate", "(", "createFileGroupTemplate", "(", "dir", ")", ",", "templateFileName", ")", ";", "}" ]
获得本地文件模板 @param dir 目录绝对路径 @param templateFileName 模板内容 @return 模板 @since 3.2.0
[ "获得本地文件模板" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java#L169-L171
NessComputing/service-discovery
jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java
ServiceDiscoveryTransportFactory.registerDiscoveryClient
static void registerDiscoveryClient(UUID injectorId, ReadOnlyDiscoveryClient discoveryClient, DiscoveryJmsConfig config) { """ Register a discoveryClient under a unique id. This works around the TransportFactory's inherent staticness so that we may use the correct discovery client even in the presence of multipl...
java
static void registerDiscoveryClient(UUID injectorId, ReadOnlyDiscoveryClient discoveryClient, DiscoveryJmsConfig config) { DISCO_CLIENTS.put(injectorId, discoveryClient); CONFIGS.put(injectorId, config); LOG.info("Registered discovery client %s as %s", injectorId, discoveryClient); }
[ "static", "void", "registerDiscoveryClient", "(", "UUID", "injectorId", ",", "ReadOnlyDiscoveryClient", "discoveryClient", ",", "DiscoveryJmsConfig", "config", ")", "{", "DISCO_CLIENTS", ".", "put", "(", "injectorId", ",", "discoveryClient", ")", ";", "CONFIGS", ".", ...
Register a discoveryClient under a unique id. This works around the TransportFactory's inherent staticness so that we may use the correct discovery client even in the presence of multiple injectors in the same JVM.
[ "Register", "a", "discoveryClient", "under", "a", "unique", "id", ".", "This", "works", "around", "the", "TransportFactory", "s", "inherent", "staticness", "so", "that", "we", "may", "use", "the", "correct", "discovery", "client", "even", "in", "the", "presenc...
train
https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L70-L74
antopen/alipay-sdk-java
src/main/java/com/alipay/api/internal/util/XmlUtils.java
XmlUtils.getRootElementFromString
public static Element getRootElementFromString(String payload) throws AlipayApiException { """ Gets the root element from the given XML payload. @param payload the XML payload representing the XML file. @return the root element of parsed document @throws ApiException problem parsing the XML payload """ ...
java
public static Element getRootElementFromString(String payload) throws AlipayApiException { if (payload == null || payload.trim().length() < 1) { throw new AlipayApiException("XML_PAYLOAD_EMPTY"); } byte[] bytes = null; try { payload = StringUtils.stripNonValidXMLC...
[ "public", "static", "Element", "getRootElementFromString", "(", "String", "payload", ")", "throws", "AlipayApiException", "{", "if", "(", "payload", "==", "null", "||", "payload", ".", "trim", "(", ")", ".", "length", "(", ")", "<", "1", ")", "{", "throw",...
Gets the root element from the given XML payload. @param payload the XML payload representing the XML file. @return the root element of parsed document @throws ApiException problem parsing the XML payload
[ "Gets", "the", "root", "element", "from", "the", "given", "XML", "payload", "." ]
train
https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/util/XmlUtils.java#L198-L216
mabe02/lanterna
src/main/java/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java
WaitingDialog.showDialog
public static WaitingDialog showDialog(WindowBasedTextGUI textGUI, String title, String text) { """ Creates and displays a waiting dialog without blocking for it to finish @param textGUI GUI to add the dialog to @param title Title of the waiting dialog @param text Text to display on the waiting dialog @return ...
java
public static WaitingDialog showDialog(WindowBasedTextGUI textGUI, String title, String text) { WaitingDialog waitingDialog = createDialog(title, text); waitingDialog.showDialog(textGUI, false); return waitingDialog; }
[ "public", "static", "WaitingDialog", "showDialog", "(", "WindowBasedTextGUI", "textGUI", ",", "String", "title", ",", "String", "text", ")", "{", "WaitingDialog", "waitingDialog", "=", "createDialog", "(", "title", ",", "text", ")", ";", "waitingDialog", ".", "s...
Creates and displays a waiting dialog without blocking for it to finish @param textGUI GUI to add the dialog to @param title Title of the waiting dialog @param text Text to display on the waiting dialog @return Created waiting dialog
[ "Creates", "and", "displays", "a", "waiting", "dialog", "without", "blocking", "for", "it", "to", "finish" ]
train
https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java#L76-L80
tvesalainen/util
util/src/main/java/org/vesalainen/util/CmdArgs.java
CmdArgs.addOption
public final <T> void addOption(Class<T> cls, String name, String description, String exclusiveGroup, boolean mandatory) { """ Add an option @param <T> Type of option @param cls Option type class @param name Option name Option name without @param description Option description @param exclusiveGroup A group of...
java
public final <T> void addOption(Class<T> cls, String name, String description, String exclusiveGroup, boolean mandatory) { if (names.contains(name)) { throw new IllegalArgumentException(name+" is already added as argument"); } Option opt = new Option(cls, name, desc...
[ "public", "final", "<", "T", ">", "void", "addOption", "(", "Class", "<", "T", ">", "cls", ",", "String", "name", ",", "String", "description", ",", "String", "exclusiveGroup", ",", "boolean", "mandatory", ")", "{", "if", "(", "names", ".", "contains", ...
Add an option @param <T> Type of option @param cls Option type class @param name Option name Option name without @param description Option description @param exclusiveGroup A group of options. Only options of a single group are accepted. @param mandatory
[ "Add", "an", "option" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CmdArgs.java#L358-L374
Codearte/catch-exception
catch-exception/src/main/java/com/googlecode/catchexception/CatchException.java
CatchException.catchException
public static void catchException(ThrowingCallable actor, Class<? extends Exception> clazz) { """ Use it to catch an exception of a specific type and to get access to the thrown exception (for further verifications). In the following example you catch exceptions of type MyException that are thrown by obj.doX(...
java
public static void catchException(ThrowingCallable actor, Class<? extends Exception> clazz) { validateArguments(actor, clazz); catchException(actor, clazz, false); }
[ "public", "static", "void", "catchException", "(", "ThrowingCallable", "actor", ",", "Class", "<", "?", "extends", "Exception", ">", "clazz", ")", "{", "validateArguments", "(", "actor", ",", "clazz", ")", ";", "catchException", "(", "actor", ",", "clazz", "...
Use it to catch an exception of a specific type and to get access to the thrown exception (for further verifications). In the following example you catch exceptions of type MyException that are thrown by obj.doX(): <code>catchException(obj, MyException.class).doX(); // catch if (caughtException() != null) { assert "fo...
[ "Use", "it", "to", "catch", "an", "exception", "of", "a", "specific", "type", "and", "to", "get", "access", "to", "the", "thrown", "exception", "(", "for", "further", "verifications", ")", "." ]
train
https://github.com/Codearte/catch-exception/blob/8cfb1c0a68661ef622011484ff0061b41796b165/catch-exception/src/main/java/com/googlecode/catchexception/CatchException.java#L319-L322
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java
WikipediaTemplateInfo.revisionContainsTemplateName
public boolean revisionContainsTemplateName(int revId, String templateName) throws WikiApiException { """ Determines whether a given revision contains a given template name @param revId @param templateName a template name @return @throws WikiApiException """ return revisionContainsTemplateNames(revI...
java
public boolean revisionContainsTemplateName(int revId, String templateName) throws WikiApiException{ return revisionContainsTemplateNames(revId, Arrays.asList(new String[]{templateName})); }
[ "public", "boolean", "revisionContainsTemplateName", "(", "int", "revId", ",", "String", "templateName", ")", "throws", "WikiApiException", "{", "return", "revisionContainsTemplateNames", "(", "revId", ",", "Arrays", ".", "asList", "(", "new", "String", "[", "]", ...
Determines whether a given revision contains a given template name @param revId @param templateName a template name @return @throws WikiApiException
[ "Determines", "whether", "a", "given", "revision", "contains", "a", "given", "template", "name" ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1253-L1255
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java
DefaultApplicationObjectConfigurer.configureCommandIcons
protected void configureCommandIcons(CommandIconConfigurable configurable, String objectName) { """ Sets the icons of the given object. <p> The icons are loaded from this instance's {@link IconSource}. using a key in the format </p> <pre> &lt;objectName&gt;.someIconType </pre> <p> The keys used to r...
java
protected void configureCommandIcons(CommandIconConfigurable configurable, String objectName) { Assert.notNull(configurable, "configurable"); Assert.notNull(objectName, "objectName"); setIconInfo(configurable, objectName, false); setIconInfo(configurable, objectName, true); }
[ "protected", "void", "configureCommandIcons", "(", "CommandIconConfigurable", "configurable", ",", "String", "objectName", ")", "{", "Assert", ".", "notNull", "(", "configurable", ",", "\"configurable\"", ")", ";", "Assert", ".", "notNull", "(", "objectName", ",", ...
Sets the icons of the given object. <p> The icons are loaded from this instance's {@link IconSource}. using a key in the format </p> <pre> &lt;objectName&gt;.someIconType </pre> <p> The keys used to retrieve large icons from the icon source are created by concatenating the given {@code objectName} with a dot (.), th...
[ "Sets", "the", "icons", "of", "the", "given", "object", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L583-L588
groupby/api-java
src/main/java/com/groupbyinc/api/Query.java
Query.addRangeRefinement
public Query addRangeRefinement(String navigationName, String low, String high, boolean exclude) { """ <code> Add a range refinement. Takes a refinement name, a lower and upper bounds, and whether or not to exclude this refinement. </code> @param navigationName The name of the refinement @param low The l...
java
public Query addRangeRefinement(String navigationName, String low, String high, boolean exclude) { return addRefinement(navigationName, new RefinementRange().setLow(low).setHigh(high).setExclude(exclude)); }
[ "public", "Query", "addRangeRefinement", "(", "String", "navigationName", ",", "String", "low", ",", "String", "high", ",", "boolean", "exclude", ")", "{", "return", "addRefinement", "(", "navigationName", ",", "new", "RefinementRange", "(", ")", ".", "setLow", ...
<code> Add a range refinement. Takes a refinement name, a lower and upper bounds, and whether or not to exclude this refinement. </code> @param navigationName The name of the refinement @param low The low value @param high The high value @param exclude True if the results should exclude this range refinement, false o...
[ "<code", ">", "Add", "a", "range", "refinement", ".", "Takes", "a", "refinement", "name", "a", "lower", "and", "upper", "bounds", "and", "whether", "or", "not", "to", "exclude", "this", "refinement", ".", "<", "/", "code", ">" ]
train
https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/Query.java#L757-L759
twitter/finatra
kafka-streams/kafka-streams-static-partitioning/src/main/java/org/apache/kafka/streams/processor/internals/OverridableStreamsPartitionAssignor.java
OverridableStreamsPartitionAssignor.prepareTopic
private void prepareTopic(final Map<String, InternalTopicMetadata> topicPartitions) { """ Internal helper function that creates a Kafka topic @param topicPartitions Map that contains the topic names to be created with the number of partitions """ log.debug("Starting to validate internal topics {} in par...
java
private void prepareTopic(final Map<String, InternalTopicMetadata> topicPartitions) { log.debug("Starting to validate internal topics {} in partition assignor.", topicPartitions); // first construct the topics to make ready final Map<String, InternalTopicConfig> topicsToMakeReady = new HashMap<>(); fo...
[ "private", "void", "prepareTopic", "(", "final", "Map", "<", "String", ",", "InternalTopicMetadata", ">", "topicPartitions", ")", "{", "log", ".", "debug", "(", "\"Starting to validate internal topics {} in partition assignor.\"", ",", "topicPartitions", ")", ";", "// f...
Internal helper function that creates a Kafka topic @param topicPartitions Map that contains the topic names to be created with the number of partitions
[ "Internal", "helper", "function", "that", "creates", "a", "Kafka", "topic" ]
train
https://github.com/twitter/finatra/blob/0f92823927cedf4f843cc7e65d59e8665ad40f4c/kafka-streams/kafka-streams-static-partitioning/src/main/java/org/apache/kafka/streams/processor/internals/OverridableStreamsPartitionAssignor.java#L973-L996
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java
IDNA.convertToASCII
@Deprecated public static StringBuffer convertToASCII(StringBuffer src, int options) throws StringPrepParseException { """ IDNA2003: This function implements the ToASCII operation as defined in the IDNA RFC. This operation is done on <b>single labels</b> before sending it to something that expects AS...
java
@Deprecated public static StringBuffer convertToASCII(StringBuffer src, int options) throws StringPrepParseException{ UCharacterIterator iter = UCharacterIterator.getInstance(src); return convertToASCII(iter,options); }
[ "@", "Deprecated", "public", "static", "StringBuffer", "convertToASCII", "(", "StringBuffer", "src", ",", "int", "options", ")", "throws", "StringPrepParseException", "{", "UCharacterIterator", "iter", "=", "UCharacterIterator", ".", "getInstance", "(", "src", ")", ...
IDNA2003: This function implements the ToASCII operation as defined in the IDNA RFC. This operation is done on <b>single labels</b> before sending it to something that expects ASCII names. A label is an individual part of a domain name. Labels are usually separated by dots; e.g." "www.example.com" is composed of 3 labe...
[ "IDNA2003", ":", "This", "function", "implements", "the", "ToASCII", "operation", "as", "defined", "in", "the", "IDNA", "RFC", ".", "This", "operation", "is", "done", "on", "<b", ">", "single", "labels<", "/", "b", ">", "before", "sending", "it", "to", "...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java#L511-L516
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java
CompareFixture.countDifferencesBetweenAnd
public int countDifferencesBetweenAnd(String first, String second) { """ Determines number of differences (substrings that are not equal) between two strings. @param first first string to compare. @param second second string to compare. @return number of different substrings. """ if (first == null) ...
java
public int countDifferencesBetweenAnd(String first, String second) { if (first == null) { if (second == null) { return 0; } else { first = ""; } } else if (second == null) { second = ""; } LinkedList<DiffMatc...
[ "public", "int", "countDifferencesBetweenAnd", "(", "String", "first", ",", "String", "second", ")", "{", "if", "(", "first", "==", "null", ")", "{", "if", "(", "second", "==", "null", ")", "{", "return", "0", ";", "}", "else", "{", "first", "=", "\"...
Determines number of differences (substrings that are not equal) between two strings. @param first first string to compare. @param second second string to compare. @return number of different substrings.
[ "Determines", "number", "of", "differences", "(", "substrings", "that", "are", "not", "equal", ")", "between", "two", "strings", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/CompareFixture.java#L74-L92
structurizr/java
structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java
Arc42DocumentationTemplate.addSolutionStrategySection
public Section addSolutionStrategySection(SoftwareSystem softwareSystem, File... files) throws IOException { """ Adds a "Solution Strategy" section relating to a {@link SoftwareSystem} from one or more files. @param softwareSystem the {@link SoftwareSystem} the documentation content relates to @param files ...
java
public Section addSolutionStrategySection(SoftwareSystem softwareSystem, File... files) throws IOException { return addSection(softwareSystem, "Solution Strategy", files); }
[ "public", "Section", "addSolutionStrategySection", "(", "SoftwareSystem", "softwareSystem", ",", "File", "...", "files", ")", "throws", "IOException", "{", "return", "addSection", "(", "softwareSystem", ",", "\"Solution Strategy\"", ",", "files", ")", ";", "}" ]
Adds a "Solution Strategy" section relating to a {@link SoftwareSystem} from one or more files. @param softwareSystem the {@link SoftwareSystem} the documentation content relates to @param files one or more File objects that point to the documentation content @return a documentation {@l...
[ "Adds", "a", "Solution", "Strategy", "section", "relating", "to", "a", "{", "@link", "SoftwareSystem", "}", "from", "one", "or", "more", "files", "." ]
train
https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java#L121-L123
cdapio/tigon
tigon-flow/src/main/java/co/cask/tigon/internal/app/runtime/flow/FlowUtils.java
FlowUtils.configureQueue
public static Multimap<String, QueueName> configureQueue(Program program, FlowSpecification flowSpec, QueueAdmin queueAdmin) { """ Configures all queues being used in a flow. @return A Multimap from flowletId to QueueName where the flowlet is a consumer...
java
public static Multimap<String, QueueName> configureQueue(Program program, FlowSpecification flowSpec, QueueAdmin queueAdmin) { // Generate all queues specifications Table<QueueSpecificationGenerator.Node, String, Set<QueueSpecification>> queueSpecs ...
[ "public", "static", "Multimap", "<", "String", ",", "QueueName", ">", "configureQueue", "(", "Program", "program", ",", "FlowSpecification", "flowSpec", ",", "QueueAdmin", "queueAdmin", ")", "{", "// Generate all queues specifications", "Table", "<", "QueueSpecification...
Configures all queues being used in a flow. @return A Multimap from flowletId to QueueName where the flowlet is a consumer of.
[ "Configures", "all", "queues", "being", "used", "in", "a", "flow", "." ]
train
https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-flow/src/main/java/co/cask/tigon/internal/app/runtime/flow/FlowUtils.java#L68-L104
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcrl_binding.java
sslcrl_binding.get
public static sslcrl_binding get(nitro_service service, String crlname) throws Exception { """ Use this API to fetch sslcrl_binding resource of given name . """ sslcrl_binding obj = new sslcrl_binding(); obj.set_crlname(crlname); sslcrl_binding response = (sslcrl_binding) obj.get_resource(service); ret...
java
public static sslcrl_binding get(nitro_service service, String crlname) throws Exception{ sslcrl_binding obj = new sslcrl_binding(); obj.set_crlname(crlname); sslcrl_binding response = (sslcrl_binding) obj.get_resource(service); return response; }
[ "public", "static", "sslcrl_binding", "get", "(", "nitro_service", "service", ",", "String", "crlname", ")", "throws", "Exception", "{", "sslcrl_binding", "obj", "=", "new", "sslcrl_binding", "(", ")", ";", "obj", ".", "set_crlname", "(", "crlname", ")", ";", ...
Use this API to fetch sslcrl_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "sslcrl_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcrl_binding.java#L103-L108
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/io/file/PathHelper.java
PathHelper.getOutputStream
@Nullable public static OutputStream getOutputStream (@Nonnull final Path aFile, @Nonnull final EAppend eAppend) { """ Get an output stream for writing to a file. @param aFile The file to write to. May not be <code>null</code>. @param eAppend Appending mode. May not be <code>null</code>. @return <code>nul...
java
@Nullable public static OutputStream getOutputStream (@Nonnull final Path aFile, @Nonnull final EAppend eAppend) { ValueEnforcer.notNull (aFile, "Path"); ValueEnforcer.notNull (eAppend, "Append"); // OK, parent is present and writable try { return Files.newOutputStream (aFile, eAppend.get...
[ "@", "Nullable", "public", "static", "OutputStream", "getOutputStream", "(", "@", "Nonnull", "final", "Path", "aFile", ",", "@", "Nonnull", "final", "EAppend", "eAppend", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aFile", ",", "\"Path\"", ")", ";", "Va...
Get an output stream for writing to a file. @param aFile The file to write to. May not be <code>null</code>. @param eAppend Appending mode. May not be <code>null</code>. @return <code>null</code> if the file could not be opened
[ "Get", "an", "output", "stream", "for", "writing", "to", "a", "file", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathHelper.java#L345-L360
yanzhenjie/AndServer
api/src/main/java/com/yanzhenjie/andserver/util/DigestUtils.java
DigestUtils.appendMd5DigestAsHex
public static StringBuilder appendMd5DigestAsHex(InputStream inputStream, StringBuilder builder) throws IOException { """ Append a hexadecimal string representation of the MD5 digest of the given inputStream to the given {@link StringBuilder}. @param inputStream the inputStream to calculate the digest ...
java
public static StringBuilder appendMd5DigestAsHex(InputStream inputStream, StringBuilder builder) throws IOException { return appendDigestAsHex(MD5_ALGORITHM_NAME, inputStream, builder); }
[ "public", "static", "StringBuilder", "appendMd5DigestAsHex", "(", "InputStream", "inputStream", ",", "StringBuilder", "builder", ")", "throws", "IOException", "{", "return", "appendDigestAsHex", "(", "MD5_ALGORITHM_NAME", ",", "inputStream", ",", "builder", ")", ";", ...
Append a hexadecimal string representation of the MD5 digest of the given inputStream to the given {@link StringBuilder}. @param inputStream the inputStream to calculate the digest over. @param builder the string builder to append the digest to. @return the given string builder.
[ "Append", "a", "hexadecimal", "string", "representation", "of", "the", "MD5", "digest", "of", "the", "given", "inputStream", "to", "the", "given", "{", "@link", "StringBuilder", "}", "." ]
train
https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/DigestUtils.java#L121-L124
VoltDB/voltdb
src/frontend/org/voltdb/utils/CatalogUtil.java
CatalogUtil.getTableObjectNameFromId
public static Table getTableObjectNameFromId(Database catalog, int tableId) { """ Iterate through all the tables in the catalog, find a table with an id that matches the given table id, and return its name. @param catalog Catalog database @param tableId table id @return table name associated with the given...
java
public static Table getTableObjectNameFromId(Database catalog, int tableId) { for (Table table: catalog.getTables()) { if (table.getRelativeIndex() == tableId) { return table; } } return null; }
[ "public", "static", "Table", "getTableObjectNameFromId", "(", "Database", "catalog", ",", "int", "tableId", ")", "{", "for", "(", "Table", "table", ":", "catalog", ".", "getTables", "(", ")", ")", "{", "if", "(", "table", ".", "getRelativeIndex", "(", ")",...
Iterate through all the tables in the catalog, find a table with an id that matches the given table id, and return its name. @param catalog Catalog database @param tableId table id @return table name associated with the given table id (null if no association is found)
[ "Iterate", "through", "all", "the", "tables", "in", "the", "catalog", "find", "a", "table", "with", "an", "id", "that", "matches", "the", "given", "table", "id", "and", "return", "its", "name", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L2794-L2801
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/concurrent/SimpleLock.java
SimpleLock.lockedThrowing
public <T, EXTYPE extends Exception> T lockedThrowing (@Nonnull final IThrowingSupplier <? extends T, EXTYPE> aCallable) throws EXTYPE { """ Execute the provided callable in a read lock. Note: no nullable/non-nullable can be assumed. @param aCallable Callable to be executed. May not be <code>null</code>. @re...
java
public <T, EXTYPE extends Exception> T lockedThrowing (@Nonnull final IThrowingSupplier <? extends T, EXTYPE> aCallable) throws EXTYPE { ValueEnforcer.notNull (aCallable, "Callable"); lock (); try { return aCallable.get (); } finally { unlock (); } }
[ "public", "<", "T", ",", "EXTYPE", "extends", "Exception", ">", "T", "lockedThrowing", "(", "@", "Nonnull", "final", "IThrowingSupplier", "<", "?", "extends", "T", ",", "EXTYPE", ">", "aCallable", ")", "throws", "EXTYPE", "{", "ValueEnforcer", ".", "notNull"...
Execute the provided callable in a read lock. Note: no nullable/non-nullable can be assumed. @param aCallable Callable to be executed. May not be <code>null</code>. @return The return value of the callable. May be <code>null</code>. @throws EXTYPE If the callable throws the exception @param <T> Return type @param <EXT...
[ "Execute", "the", "provided", "callable", "in", "a", "read", "lock", ".", "Note", ":", "no", "nullable", "/", "non", "-", "nullable", "can", "be", "assumed", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/concurrent/SimpleLock.java#L143-L156
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java
PathOverrideService.setGlobal
public void setGlobal(int pathId, Boolean global) { """ Sets the global setting for this ID @param pathId ID of path @param global True if global, False otherwise """ PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = s...
java
public void setGlobal(int pathId, Boolean global) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "UPDATE " + Constants.DB_TABLE_PATH + " SET " + Constants.PAT...
[ "public", "void", "setGlobal", "(", "int", "pathId", ",", "Boolean", "global", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "statement", ...
Sets the global setting for this ID @param pathId ID of path @param global True if global, False otherwise
[ "Sets", "the", "global", "setting", "for", "this", "ID" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1270-L1292
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.xmlClassInexistent
public static void xmlClassInexistent(String path, Class<?> aClass) { """ Thrown if class isn't present in xml file. @param path xml path @param aClass Class analyzed """ throw new XmlMappingClassDoesNotExistException (MSG.INSTANCE.message(xmlMappingClassDoesNotExistException1,path,aClass.getSimpleName())...
java
public static void xmlClassInexistent(String path, Class<?> aClass){ throw new XmlMappingClassDoesNotExistException (MSG.INSTANCE.message(xmlMappingClassDoesNotExistException1,path,aClass.getSimpleName())); }
[ "public", "static", "void", "xmlClassInexistent", "(", "String", "path", ",", "Class", "<", "?", ">", "aClass", ")", "{", "throw", "new", "XmlMappingClassDoesNotExistException", "(", "MSG", ".", "INSTANCE", ".", "message", "(", "xmlMappingClassDoesNotExistException1...
Thrown if class isn't present in xml file. @param path xml path @param aClass Class analyzed
[ "Thrown", "if", "class", "isn", "t", "present", "in", "xml", "file", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L311-L313
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/source/workunit/MultiWorkUnit.java
MultiWorkUnit.setProp
@Override public void setProp(String key, Object value) { """ Set the specified key, value pair in this {@link MultiWorkUnit} as well as in all the inner {@link WorkUnit}s. {@inheritDoc} @see org.apache.gobblin.configuration.State#setProp(java.lang.String, java.lang.Object) """ super.setProp(key, val...
java
@Override public void setProp(String key, Object value) { super.setProp(key, value); for (WorkUnit workUnit : this.workUnits) { workUnit.setProp(key, value); } }
[ "@", "Override", "public", "void", "setProp", "(", "String", "key", ",", "Object", "value", ")", "{", "super", ".", "setProp", "(", "key", ",", "value", ")", ";", "for", "(", "WorkUnit", "workUnit", ":", "this", ".", "workUnits", ")", "{", "workUnit", ...
Set the specified key, value pair in this {@link MultiWorkUnit} as well as in all the inner {@link WorkUnit}s. {@inheritDoc} @see org.apache.gobblin.configuration.State#setProp(java.lang.String, java.lang.Object)
[ "Set", "the", "specified", "key", "value", "pair", "in", "this", "{", "@link", "MultiWorkUnit", "}", "as", "well", "as", "in", "all", "the", "inner", "{", "@link", "WorkUnit", "}", "s", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/MultiWorkUnit.java#L91-L97
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.stopJob
public static void stopJob(String jobName) throws SundialSchedulerException { """ Triggers a Job interrupt on all Jobs matching the given Job Name. The Job termination mechanism works by setting a flag that the Job should be terminated, but it is up to the logic in the Job to decide at what point termination sho...
java
public static void stopJob(String jobName) throws SundialSchedulerException { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = job...
[ "public", "static", "void", "stopJob", "(", "String", "jobName", ")", "throws", "SundialSchedulerException", "{", "try", "{", "List", "<", "JobExecutionContext", ">", "currentlyExecutingJobs", "=", "getScheduler", "(", ")", ".", "getCurrentlyExecutingJobs", "(", ")"...
Triggers a Job interrupt on all Jobs matching the given Job Name. The Job termination mechanism works by setting a flag that the Job should be terminated, but it is up to the logic in the Job to decide at what point termination should occur. Therefore, in any long-running job that you anticipate the need to terminate, ...
[ "Triggers", "a", "Job", "interrupt", "on", "all", "Jobs", "matching", "the", "given", "Job", "Name", ".", "The", "Job", "termination", "mechanism", "works", "by", "setting", "a", "flag", "that", "the", "Job", "should", "be", "terminated", "but", "it", "is"...
train
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L325-L345
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java
TldFernClassifier.learnFernNoise
public void learnFernNoise(boolean positive, ImageRectangle r) { """ Computes the value for each fern inside the region and update's their P and N value. Noise is added to the image measurements to take in account the variability. """ float rectWidth = r.getWidth(); float rectHeight = r.getHeight(); ...
java
public void learnFernNoise(boolean positive, ImageRectangle r) { float rectWidth = r.getWidth(); float rectHeight = r.getHeight(); float c_x = r.x0+(rectWidth-1)/2.0f; float c_y = r.y0+(rectHeight-1)/2.0f; for( int i = 0; i < ferns.length; i++ ) { // first learn it with no noise int value = computeF...
[ "public", "void", "learnFernNoise", "(", "boolean", "positive", ",", "ImageRectangle", "r", ")", "{", "float", "rectWidth", "=", "r", ".", "getWidth", "(", ")", ";", "float", "rectHeight", "=", "r", ".", "getHeight", "(", ")", ";", "float", "c_x", "=", ...
Computes the value for each fern inside the region and update's their P and N value. Noise is added to the image measurements to take in account the variability.
[ "Computes", "the", "value", "for", "each", "fern", "inside", "the", "region", "and", "update", "s", "their", "P", "and", "N", "value", ".", "Noise", "is", "added", "to", "the", "image", "measurements", "to", "take", "in", "account", "the", "variability", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L127-L148
OpenLiberty/open-liberty
dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java
TwitterEndpointServices.createAuthzHeaderForVerifyCredentialsEndpoint
public String createAuthzHeaderForVerifyCredentialsEndpoint(String endpointUrl, String token) { """ Generates the Authorization header value required for a {@value TwitterConstants#TWITTER_ENDPOINT_VERIFY_CREDENTIALS} endpoint request. See {@link https://dev.twitter.com/rest/reference/get/account/verify_credentia...
java
public String createAuthzHeaderForVerifyCredentialsEndpoint(String endpointUrl, String token) { Map<String, String> parameters = populateVerifyCredentialsEndpointAuthzHeaderParams(token); return signAndCreateAuthzHeader(endpointUrl, parameters); }
[ "public", "String", "createAuthzHeaderForVerifyCredentialsEndpoint", "(", "String", "endpointUrl", ",", "String", "token", ")", "{", "Map", "<", "String", ",", "String", ">", "parameters", "=", "populateVerifyCredentialsEndpointAuthzHeaderParams", "(", "token", ")", ";"...
Generates the Authorization header value required for a {@value TwitterConstants#TWITTER_ENDPOINT_VERIFY_CREDENTIALS} endpoint request. See {@link https://dev.twitter.com/rest/reference/get/account/verify_credentials} for details. @param endpointUrl @param token @return
[ "Generates", "the", "Authorization", "header", "value", "required", "for", "a", "{", "@value", "TwitterConstants#TWITTER_ENDPOINT_VERIFY_CREDENTIALS", "}", "endpoint", "request", ".", "See", "{", "@link", "https", ":", "//", "dev", ".", "twitter", ".", "com", "/",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java#L454-L457
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java
NamedResolverMap.getGroupName
public GroupName getGroupName(@NonNull List<String> prefixPath, @NonNull Map<String, MetricValue> extraTags) { """ Create a GroupName from this NamedResolverMap. @param prefixPath Additional path elements to put in front of the returned path. @param extraTags Additional tags to put in the tag set. The extraTa...
java
public GroupName getGroupName(@NonNull List<String> prefixPath, @NonNull Map<String, MetricValue> extraTags) { final Stream<String> suffixPath = data.entrySet().stream() .filter(entry -> entry.getKey().getLeft().isPresent()) // Only retain int keys. .sorted(Comparator.comparing(e...
[ "public", "GroupName", "getGroupName", "(", "@", "NonNull", "List", "<", "String", ">", "prefixPath", ",", "@", "NonNull", "Map", "<", "String", ",", "MetricValue", ">", "extraTags", ")", "{", "final", "Stream", "<", "String", ">", "suffixPath", "=", "data...
Create a GroupName from this NamedResolverMap. @param prefixPath Additional path elements to put in front of the returned path. @param extraTags Additional tags to put in the tag set. The extraTags argument will override any values present in the NamedResolverMap. @return A group name derived from this NamedResolverMa...
[ "Create", "a", "GroupName", "from", "this", "NamedResolverMap", "." ]
train
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java#L240-L253
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/server/callback/CallFuture.java
CallFuture.await
public void await(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { """ Waits for the CallFuture to complete without returning the result. @param timeout the maximum time to wait. @param unit the time unit of the timeout argument. @throws InterruptedException if interrupted. @th...
java
public void await(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { if (!latch.await(timeout, unit)) { throw new TimeoutException(); } }
[ "public", "void", "await", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "TimeoutException", "{", "if", "(", "!", "latch", ".", "await", "(", "timeout", ",", "unit", ")", ")", "{", "throw", "new", "TimeoutExce...
Waits for the CallFuture to complete without returning the result. @param timeout the maximum time to wait. @param unit the time unit of the timeout argument. @throws InterruptedException if interrupted. @throws TimeoutException if the wait timed out.
[ "Waits", "for", "the", "CallFuture", "to", "complete", "without", "returning", "the", "result", "." ]
train
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/server/callback/CallFuture.java#L136-L140
Harium/keel
src/main/java/com/harium/keel/catalano/math/distance/Distance.java
Distance.BrayCurtis
public static double BrayCurtis(double[] p, double[] q) { """ Gets the Bray Curtis distance between two points. @param p A point in space. @param q A point in space. @return The Bray Curtis distance between x and y. """ double sumP, sumN; sumP = sumN = 0; for (int i = 0; i < p.len...
java
public static double BrayCurtis(double[] p, double[] q) { double sumP, sumN; sumP = sumN = 0; for (int i = 0; i < p.length; i++) { sumN += Math.abs(p[i] - q[i]); sumP += Math.abs(p[i] + q[i]); } return sumN / sumP; }
[ "public", "static", "double", "BrayCurtis", "(", "double", "[", "]", "p", ",", "double", "[", "]", "q", ")", "{", "double", "sumP", ",", "sumN", ";", "sumP", "=", "sumN", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p", "....
Gets the Bray Curtis distance between two points. @param p A point in space. @param q A point in space. @return The Bray Curtis distance between x and y.
[ "Gets", "the", "Bray", "Curtis", "distance", "between", "two", "points", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L86-L96
jbossas/remoting-jmx
src/main/java/org/jboss/remotingjmx/protocol/v2/ClientCommon.java
ClientCommon.toIoException
protected IOException toIoException(Exception e) { """ This Exception conversion needs to return the IOException instead of throwing it, this is so that the compiler can detect that for the final Exception check something is actually thrown. """ if (e instanceof IOException) { return (IOEx...
java
protected IOException toIoException(Exception e) { if (e instanceof IOException) { return (IOException) e; } else { return new IOException("Unexpected failure", e); } }
[ "protected", "IOException", "toIoException", "(", "Exception", "e", ")", "{", "if", "(", "e", "instanceof", "IOException", ")", "{", "return", "(", "IOException", ")", "e", ";", "}", "else", "{", "return", "new", "IOException", "(", "\"Unexpected failure\"", ...
This Exception conversion needs to return the IOException instead of throwing it, this is so that the compiler can detect that for the final Exception check something is actually thrown.
[ "This", "Exception", "conversion", "needs", "to", "return", "the", "IOException", "instead", "of", "throwing", "it", "this", "is", "so", "that", "the", "compiler", "can", "detect", "that", "for", "the", "final", "Exception", "check", "something", "is", "actual...
train
https://github.com/jbossas/remoting-jmx/blob/dbc87bfed47e5bb9e37c355a77ca0ae9a6ea1363/src/main/java/org/jboss/remotingjmx/protocol/v2/ClientCommon.java#L81-L87
validator/validator
src/nu/validator/datatype/AbstractDatatype.java
AbstractDatatype.isValid
@Override public final boolean isValid(String literal, ValidationContext context) { """ Calls <code>checkValid(CharSequence literal)</code>. @param literal the value @param context the validation context (ignored by subclasses) @return <code>true</code> if valid and <code>false</code> if not @see org.relax...
java
@Override public final boolean isValid(String literal, ValidationContext context) { try { checkValid(literal); } catch (DatatypeException e) { return false; } return true; }
[ "@", "Override", "public", "final", "boolean", "isValid", "(", "String", "literal", ",", "ValidationContext", "context", ")", "{", "try", "{", "checkValid", "(", "literal", ")", ";", "}", "catch", "(", "DatatypeException", "e", ")", "{", "return", "false", ...
Calls <code>checkValid(CharSequence literal)</code>. @param literal the value @param context the validation context (ignored by subclasses) @return <code>true</code> if valid and <code>false</code> if not @see org.relaxng.datatype.Datatype#isValid(java.lang.String, org.relaxng.datatype.ValidationContext)
[ "Calls", "<code", ">", "checkValid", "(", "CharSequence", "literal", ")", "<", "/", "code", ">", "." ]
train
https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/datatype/AbstractDatatype.java#L58-L66
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.setupTableLookup
public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton) { """ Same as setupTablePopup for larger files (that don't fit in a pop...
java
public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton) { String keyAreaName = null; if (iQueryKeySeq != -1) ...
[ "public", "ScreenComponent", "setupTableLookup", "(", "ScreenLoc", "itsLocation", ",", "ComponentParent", "targetScreen", ",", "Convert", "converter", ",", "int", "iDisplayFieldDesc", ",", "Rec", "record", ",", "int", "iQueryKeySeq", ",", "int", "iDisplayFieldSeq", ",...
Same as setupTablePopup for larger files (that don't fit in a popup). @return Return the component or ScreenField that is created for this field.
[ "Same", "as", "setupTablePopup", "for", "larger", "files", "(", "that", "don", "t", "fit", "in", "a", "popup", ")", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1270-L1281
alkacon/opencms-core
src/org/opencms/db/CmsAliasManager.java
CmsAliasManager.messageImportCantReadResource
private String messageImportCantReadResource(Locale locale, String path) { """ Message accessor.<p> @param locale the message locale @param path a path @return the message string """ return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_COULD_NOT_READ_RESOURCE_0); }
java
private String messageImportCantReadResource(Locale locale, String path) { return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_COULD_NOT_READ_RESOURCE_0); }
[ "private", "String", "messageImportCantReadResource", "(", "Locale", "locale", ",", "String", "path", ")", "{", "return", "Messages", ".", "get", "(", ")", ".", "getBundle", "(", "locale", ")", ".", "key", "(", "Messages", ".", "ERR_ALIAS_IMPORT_COULD_NOT_READ_R...
Message accessor.<p> @param locale the message locale @param path a path @return the message string
[ "Message", "accessor", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L531-L535
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java
AssetFiltersInner.updateAsync
public Observable<AssetFilterInner> updateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { """ Update an Asset Filter. Updates an existing Asset Filter associated with the specified Asset. @param resourceGroupName The name of the resource g...
java
public Observable<AssetFilterInner> updateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).map(new Func1<ServiceResponse<AssetFilterInne...
[ "public", "Observable", "<", "AssetFilterInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "assetName", ",", "String", "filterName", ",", "AssetFilterInner", "parameters", ")", "{", "return", "updateWithServic...
Update an Asset Filter. Updates an existing Asset Filter associated with the specified Asset. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param assetName The Asset name. @param filterName The Asset Filter name @param parame...
[ "Update", "an", "Asset", "Filter", ".", "Updates", "an", "existing", "Asset", "Filter", "associated", "with", "the", "specified", "Asset", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java#L596-L603
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java
Strs.startAny
public static boolean startAny(String target, String... startWith) { """ Check if target string starts with any of an array of specified strings. @param target @param startWith @return """ return startAny(target, 0, Arrays.asList(startWith)); }
java
public static boolean startAny(String target, String... startWith) { return startAny(target, 0, Arrays.asList(startWith)); }
[ "public", "static", "boolean", "startAny", "(", "String", "target", ",", "String", "...", "startWith", ")", "{", "return", "startAny", "(", "target", ",", "0", ",", "Arrays", ".", "asList", "(", "startWith", ")", ")", ";", "}" ]
Check if target string starts with any of an array of specified strings. @param target @param startWith @return
[ "Check", "if", "target", "string", "starts", "with", "any", "of", "an", "array", "of", "specified", "strings", "." ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L329-L331
motown-io/motown
ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/OcppJsonService.java
OcppJsonService.closeAndRemoveWebSocket
public void closeAndRemoveWebSocket(String chargingStationIdentifier, @Nullable WebSocket webSocket) { """ Close and remove a web socket from the set of sockets. By passing a webSocket object the caller can force this method to check if it's removing the handle that contains this web socket. If the parameter i...
java
public void closeAndRemoveWebSocket(String chargingStationIdentifier, @Nullable WebSocket webSocket) { if (webSocket != null && webSocket.isOpen()) { // received a web socket, close it no matter what webSocket.close(); } WebSocketWrapper existingWrapper = sockets.get(cha...
[ "public", "void", "closeAndRemoveWebSocket", "(", "String", "chargingStationIdentifier", ",", "@", "Nullable", "WebSocket", "webSocket", ")", "{", "if", "(", "webSocket", "!=", "null", "&&", "webSocket", ".", "isOpen", "(", ")", ")", "{", "// received a web socket...
Close and remove a web socket from the set of sockets. By passing a webSocket object the caller can force this method to check if it's removing the handle that contains this web socket. If the parameter is null this method will close whatever it has for the identifier. @param chargingStationIdentifier charging statio...
[ "Close", "and", "remove", "a", "web", "socket", "from", "the", "set", "of", "sockets", "." ]
train
https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/OcppJsonService.java#L456-L484
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java
SVGUtil.svgWaitIcon
public static Element svgWaitIcon(Document document, double x, double y, double w, double h) { """ Draw a simple "please wait" icon (in-progress) as placeholder for running renderings. @param document Document. @param x Left @param y Top @param w Width @param h Height @return New element (currently a {@li...
java
public static Element svgWaitIcon(Document document, double x, double y, double w, double h) { Element g = SVGUtil.svgElement(document, SVGConstants.SVG_G_TAG); setAtt(g, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, "translate(" + x + " " + y + ") scale(" + w + " " + h + ")"); Element thro = SVGUtil.svgElement(doc...
[ "public", "static", "Element", "svgWaitIcon", "(", "Document", "document", ",", "double", "x", ",", "double", "y", ",", "double", "w", ",", "double", "h", ")", "{", "Element", "g", "=", "SVGUtil", ".", "svgElement", "(", "document", ",", "SVGConstants", ...
Draw a simple "please wait" icon (in-progress) as placeholder for running renderings. @param document Document. @param x Left @param y Top @param w Width @param h Height @return New element (currently a {@link SVGConstants#SVG_PATH_TAG})
[ "Draw", "a", "simple", "please", "wait", "icon", "(", "in", "-", "progress", ")", "as", "placeholder", "for", "running", "renderings", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L501-L520
devcon5io/common
mixin/src/main/java/io/devcon5/mixin/Mixin.java
Mixin.loadScript
private static void loadScript(ScriptEngine engine, Supplier<Reader> scriptReader) { """ Loads a single script from an URL into the script engine @param engine the engine that should evaluate the script @param scriptReader the script source to be loaded into the script """ try (Reader reader...
java
private static void loadScript(ScriptEngine engine, Supplier<Reader> scriptReader) { try (Reader reader = scriptReader.get()) { engine.eval(reader); } catch (ScriptException | IOException e) { throw new RuntimeException(e); } }
[ "private", "static", "void", "loadScript", "(", "ScriptEngine", "engine", ",", "Supplier", "<", "Reader", ">", "scriptReader", ")", "{", "try", "(", "Reader", "reader", "=", "scriptReader", ".", "get", "(", ")", ")", "{", "engine", ".", "eval", "(", "rea...
Loads a single script from an URL into the script engine @param engine the engine that should evaluate the script @param scriptReader the script source to be loaded into the script
[ "Loads", "a", "single", "script", "from", "an", "URL", "into", "the", "script", "engine" ]
train
https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/mixin/src/main/java/io/devcon5/mixin/Mixin.java#L156-L164
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java
LocalExtensionStorage.getFilePath
private String getFilePath(ExtensionId id, String fileExtension) { """ Get file path in the local extension repository. @param id the extension id @param fileExtension the file extension @return the encoded file path """ String encodedId = PathUtils.encode(id.getId()); String encodedVersio...
java
private String getFilePath(ExtensionId id, String fileExtension) { String encodedId = PathUtils.encode(id.getId()); String encodedVersion = PathUtils.encode(id.getVersion().toString()); String encodedType = PathUtils.encode(fileExtension); return encodedId + File.separator + encoded...
[ "private", "String", "getFilePath", "(", "ExtensionId", "id", ",", "String", "fileExtension", ")", "{", "String", "encodedId", "=", "PathUtils", ".", "encode", "(", "id", ".", "getId", "(", ")", ")", ";", "String", "encodedVersion", "=", "PathUtils", ".", ...
Get file path in the local extension repository. @param id the extension id @param fileExtension the file extension @return the encoded file path
[ "Get", "file", "path", "in", "the", "local", "extension", "repository", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java#L266-L274
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java
Parser.registerTypeParser
public final void registerTypeParser(Schema schema, TypeParser typeParser) { """ Method is used to register a TypeParser for a given schema. If the schema is already registered, the new TypeParser will replace the existing one. @param schema Schema to register to. This supports any logical type by checking...
java
public final void registerTypeParser(Schema schema, TypeParser typeParser) { Preconditions.checkNotNull(schema, "schema cannot be null."); Preconditions.checkNotNull(typeParser, "typeParser cannot be null."); this.typeParsers.put(new ParserKey(schema), typeParser); }
[ "public", "final", "void", "registerTypeParser", "(", "Schema", "schema", ",", "TypeParser", "typeParser", ")", "{", "Preconditions", ".", "checkNotNull", "(", "schema", ",", "\"schema cannot be null.\"", ")", ";", "Preconditions", ".", "checkNotNull", "(", "typePar...
Method is used to register a TypeParser for a given schema. If the schema is already registered, the new TypeParser will replace the existing one. @param schema Schema to register to. This supports any logical type by checking Schema.name() and schema.type(). @param typeParser The type parser to register for schem...
[ "Method", "is", "used", "to", "register", "a", "TypeParser", "for", "a", "given", "schema", ".", "If", "the", "schema", "is", "already", "registered", "the", "new", "TypeParser", "will", "replace", "the", "existing", "one", "." ]
train
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java#L83-L87
attribyte/wpdb
src/main/java/org/attribyte/wp/db/DB.java
DB.resolveTaxonomyTerm
public TaxonomyTerm resolveTaxonomyTerm(final String taxonomy, final String name) throws SQLException { """ Resolves a taxonomy term. @param taxonomy The taxonomy. @param name The term name. @return The taxonomy term or {@code null} if not found. @throws SQLException on database error. """ TaxonomyTe...
java
public TaxonomyTerm resolveTaxonomyTerm(final String taxonomy, final String name) throws SQLException { TaxonomyTerm term; Cache<String, TaxonomyTerm> taxonomyTermCache = taxonomyTermCaches.get(taxonomy); if(taxonomyTermCache != null) { metrics.taxonomyTermCacheTries.mark(); term = t...
[ "public", "TaxonomyTerm", "resolveTaxonomyTerm", "(", "final", "String", "taxonomy", ",", "final", "String", "name", ")", "throws", "SQLException", "{", "TaxonomyTerm", "term", ";", "Cache", "<", "String", ",", "TaxonomyTerm", ">", "taxonomyTermCache", "=", "taxon...
Resolves a taxonomy term. @param taxonomy The taxonomy. @param name The term name. @return The taxonomy term or {@code null} if not found. @throws SQLException on database error.
[ "Resolves", "a", "taxonomy", "term", "." ]
train
https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L2353-L2371
flow/nbt
src/main/java/com/flowpowered/nbt/util/NBTMapper.java
NBTMapper.getTagValue
public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) { """ Takes in an NBT tag, sanely checks null status, and then returns it value. This method will return null if the value cannot be cast to the given class. @param t Tag to get the value from @param clazz the return type to use @return the v...
java
public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) { Object o = toTagValue(t); if (o == null) { return null; } try { return clazz.cast(o); } catch (ClassCastException e) { return null; } }
[ "public", "static", "<", "T", ">", "T", "getTagValue", "(", "Tag", "<", "?", ">", "t", ",", "Class", "<", "?", "extends", "T", ">", "clazz", ")", "{", "Object", "o", "=", "toTagValue", "(", "t", ")", ";", "if", "(", "o", "==", "null", ")", "{...
Takes in an NBT tag, sanely checks null status, and then returns it value. This method will return null if the value cannot be cast to the given class. @param t Tag to get the value from @param clazz the return type to use @return the value as an onbject of the same type as the given class
[ "Takes", "in", "an", "NBT", "tag", "sanely", "checks", "null", "status", "and", "then", "returns", "it", "value", ".", "This", "method", "will", "return", "null", "if", "the", "value", "cannot", "be", "cast", "to", "the", "given", "class", "." ]
train
https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/util/NBTMapper.java#L53-L63
Azure/azure-sdk-for-java
sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansInner.java
ManagedDatabaseVulnerabilityAssessmentScansInner.initiateScanAsync
public Observable<Void> initiateScanAsync(String resourceGroupName, String managedInstanceName, String databaseName, String scanId) { """ Executes a Vulnerability Assessment database scan. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azur...
java
public Observable<Void> initiateScanAsync(String resourceGroupName, String managedInstanceName, String databaseName, String scanId) { return initiateScanWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, scanId).map(new Func1<ServiceResponse<Void>, Void>() { @Override ...
[ "public", "Observable", "<", "Void", ">", "initiateScanAsync", "(", "String", "resourceGroupName", ",", "String", "managedInstanceName", ",", "String", "databaseName", ",", "String", "scanId", ")", "{", "return", "initiateScanWithServiceResponseAsync", "(", "resourceGro...
Executes a Vulnerability Assessment database scan. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param managedInstanceName The name of the managed instance. @param databaseName The name of the database. ...
[ "Executes", "a", "Vulnerability", "Assessment", "database", "scan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansInner.java#L360-L367
allure-framework/allure-java
allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java
AllureLifecycle.startFixture
private void startFixture(final String uuid, final FixtureResult result) { """ Start a new fixture with given uuid. @param uuid the uuid of fixture. @param result the test fixture. """ storage.put(uuid, result); result.setStage(Stage.RUNNING); result.setStart(System.currentTimeMil...
java
private void startFixture(final String uuid, final FixtureResult result) { storage.put(uuid, result); result.setStage(Stage.RUNNING); result.setStart(System.currentTimeMillis()); threadContext.clear(); threadContext.start(uuid); }
[ "private", "void", "startFixture", "(", "final", "String", "uuid", ",", "final", "FixtureResult", "result", ")", "{", "storage", ".", "put", "(", "uuid", ",", "result", ")", ";", "result", ".", "setStage", "(", "Stage", ".", "RUNNING", ")", ";", "result"...
Start a new fixture with given uuid. @param uuid the uuid of fixture. @param result the test fixture.
[ "Start", "a", "new", "fixture", "with", "given", "uuid", "." ]
train
https://github.com/allure-framework/allure-java/blob/64015ca2b789aa6f7b19c793f1512e2f11d0174e/allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java#L219-L225
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/AccessHelper.java
AccessHelper.createFileOutputStream
static FileOutputStream createFileOutputStream(final File file, final boolean append) throws IOException { """ Using privileged security, create a <code>FileOutputStream</code> over the specified file, using the appropriate truncate/append semantics. <p> @param file the name of the file. The caller must guarant...
java
static FileOutputStream createFileOutputStream(final File file, final boolean append) throws IOException { try { FileOutputStream fs = getInstance().doPrivileged( new PrivilegedExceptionAction<FileOutputStream>() { public FileOutputStream run() throws IOException { if (file instanceof GenericOut...
[ "static", "FileOutputStream", "createFileOutputStream", "(", "final", "File", "file", ",", "final", "boolean", "append", ")", "throws", "IOException", "{", "try", "{", "FileOutputStream", "fs", "=", "getInstance", "(", ")", ".", "doPrivileged", "(", "new", "Priv...
Using privileged security, create a <code>FileOutputStream</code> over the specified file, using the appropriate truncate/append semantics. <p> @param file the name of the file. The caller must guarantee this is non-null @param append if true, append to the file if it exists, if false, truncate the file (this is the de...
[ "Using", "privileged", "security", "create", "a", "<code", ">", "FileOutputStream<", "/", "code", ">", "over", "the", "specified", "file", "using", "the", "appropriate", "truncate", "/", "append", "semantics", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/AccessHelper.java#L319-L338
jmxtrans/jmxtrans
jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java
GangliaWriter.getSpoofedHostName
public static String getSpoofedHostName(String host, String alias) { """ Determines the spoofed host name to be used when emitting metrics to a gmond process. Spoofed host names are of the form IP:hostname. @param host the host of the gmond (ganglia monitor) to which we are connecting, not null @param alias...
java
public static String getSpoofedHostName(String host, String alias) { // Determine the host name to use as the spoofed host name, this should // be of the format IP:hostname String spoofed = host; if (StringUtils.isNotEmpty(alias)) { // If the alias was supplied in the appropriate format, use it // directl...
[ "public", "static", "String", "getSpoofedHostName", "(", "String", "host", ",", "String", "alias", ")", "{", "// Determine the host name to use as the spoofed host name, this should", "// be of the format IP:hostname", "String", "spoofed", "=", "host", ";", "if", "(", "Stri...
Determines the spoofed host name to be used when emitting metrics to a gmond process. Spoofed host names are of the form IP:hostname. @param host the host of the gmond (ganglia monitor) to which we are connecting, not null @param alias the custom alias supplied, may be null @return the host name to use when emitting ...
[ "Determines", "the", "spoofed", "host", "name", "to", "be", "used", "when", "emitting", "metrics", "to", "a", "gmond", "process", ".", "Spoofed", "host", "names", "are", "of", "the", "form", "IP", ":", "hostname", "." ]
train
https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java#L217-L246
threerings/narya
tools/src/main/java/com/threerings/presents/tools/GenTask.java
GenTask.mergeTemplate
protected String mergeTemplate (String template, Map<String, Object> data) throws IOException { """ Merges the specified template using the supplied mapping of string keys to objects. @return a string containing the merged text. """ Reader reader = new InputStreamReader(getClass(...
java
protected String mergeTemplate (String template, Map<String, Object> data) throws IOException { Reader reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(template), UTF_8); return convertEols(Mustache.compiler().escapeHTML(false).compile(reader).execut...
[ "protected", "String", "mergeTemplate", "(", "String", "template", ",", "Map", "<", "String", ",", "Object", ">", "data", ")", "throws", "IOException", "{", "Reader", "reader", "=", "new", "InputStreamReader", "(", "getClass", "(", ")", ".", "getClassLoader", ...
Merges the specified template using the supplied mapping of string keys to objects. @return a string containing the merged text.
[ "Merges", "the", "specified", "template", "using", "the", "supplied", "mapping", "of", "string", "keys", "to", "objects", "." ]
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenTask.java#L217-L223
intuit/QuickBooks-V3-Java-SDK
oauth2-platform-api/src/main/java/com/intuit/oauth2/client/OAuth2PlatformClient.java
OAuth2PlatformClient.refreshToken
public BearerTokenResponse refreshToken(String refreshToken) throws OAuthException { """ Method to renew OAuth2 tokens by passing the refreshToken @param refreshToken @return @throws OAuthException """ logger.debug("Enter OAuth2PlatformClient::refreshToken"); try { Htt...
java
public BearerTokenResponse refreshToken(String refreshToken) throws OAuthException { logger.debug("Enter OAuth2PlatformClient::refreshToken"); try { HttpRequestClient client = new HttpRequestClient(oauth2Config.getProxyConfig()); Request request = new Request.RequestBuil...
[ "public", "BearerTokenResponse", "refreshToken", "(", "String", "refreshToken", ")", "throws", "OAuthException", "{", "logger", ".", "debug", "(", "\"Enter OAuth2PlatformClient::refreshToken\"", ")", ";", "try", "{", "HttpRequestClient", "client", "=", "new", "HttpReque...
Method to renew OAuth2 tokens by passing the refreshToken @param refreshToken @return @throws OAuthException
[ "Method", "to", "renew", "OAuth2", "tokens", "by", "passing", "the", "refreshToken" ]
train
https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/oauth2-platform-api/src/main/java/com/intuit/oauth2/client/OAuth2PlatformClient.java#L126-L152
fuinorg/srcgen4javassist
src/main/java/org/fuin/srcgen4javassist/SgUtils.java
SgUtils.addToStringMethod
public static void addToStringMethod(final SgClassPool pool, final SgClass clasz, final List<SgField> fields) { """ Creates an <code>toString()</code> method with all fields. @param pool Pool to use. @param clasz Class to add the new method to. @param fields List of fields to output. """ ...
java
public static void addToStringMethod(final SgClassPool pool, final SgClass clasz, final List<SgField> fields) { final SgMethod m = new SgMethod(clasz, "public", SgClass.create(pool, String.class), "toString"); m.addBodyLine("return getClass().getSimpleName() + \"{\""); ...
[ "public", "static", "void", "addToStringMethod", "(", "final", "SgClassPool", "pool", ",", "final", "SgClass", "clasz", ",", "final", "List", "<", "SgField", ">", "fields", ")", "{", "final", "SgMethod", "m", "=", "new", "SgMethod", "(", "clasz", ",", "\"p...
Creates an <code>toString()</code> method with all fields. @param pool Pool to use. @param clasz Class to add the new method to. @param fields List of fields to output.
[ "Creates", "an", "<code", ">", "toString", "()", "<", "/", "code", ">", "method", "with", "all", "fields", "." ]
train
https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L355-L371
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.oCRUrlInputWithServiceResponseAsync
public Observable<ServiceResponse<OCR>> oCRUrlInputWithServiceResponseAsync(String language, String contentType, BodyModelModel imageUrl, OCRUrlInputOptionalParameter oCRUrlInputOptionalParameter) { """ Returns any text found in the image for the language specified. If no language is specified in input then the de...
java
public Observable<ServiceResponse<OCR>> oCRUrlInputWithServiceResponseAsync(String language, String contentType, BodyModelModel imageUrl, OCRUrlInputOptionalParameter oCRUrlInputOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUr...
[ "public", "Observable", "<", "ServiceResponse", "<", "OCR", ">", ">", "oCRUrlInputWithServiceResponseAsync", "(", "String", "language", ",", "String", "contentType", ",", "BodyModelModel", "imageUrl", ",", "OCRUrlInputOptionalParameter", "oCRUrlInputOptionalParameter", ")",...
Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English. @param language Language of the terms. @param contentType The content type. @param imageUrl The image url. @param oCRUrlInputOptionalParameter the object representing the optiona...
[ "Returns", "any", "text", "found", "in", "the", "image", "for", "the", "language", "specified", ".", "If", "no", "language", "is", "specified", "in", "input", "then", "the", "detection", "defaults", "to", "English", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1095-L1113
kiswanij/jk-util
src/main/java/com/jk/util/model/table/JKTableModel.java
JKTableModel.setEditable
public void setEditable(final int row, final int col, final boolean enable) { """ Sets the editable. @param row the row @param col the col @param enable the enable """ final int actualIndex = getTableColumn(col).getIndex(); getRecord(row).setColumnEnabled(actualIndex, enable); }
java
public void setEditable(final int row, final int col, final boolean enable) { final int actualIndex = getTableColumn(col).getIndex(); getRecord(row).setColumnEnabled(actualIndex, enable); }
[ "public", "void", "setEditable", "(", "final", "int", "row", ",", "final", "int", "col", ",", "final", "boolean", "enable", ")", "{", "final", "int", "actualIndex", "=", "getTableColumn", "(", "col", ")", ".", "getIndex", "(", ")", ";", "getRecord", "(",...
Sets the editable. @param row the row @param col the col @param enable the enable
[ "Sets", "the", "editable", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKTableModel.java#L907-L910
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java
ZaurusEditor.getChoosenTableIndex
private int getChoosenTableIndex() { """ if the table name is not in vHoldTableNames, create a ZaurusTableForm for it """ String tableName = cTables.getSelectedItem(); // System.out.println("in getChoosenTableIndex, selected Item is "+tableName); int index = getTableIndex(tableName); ...
java
private int getChoosenTableIndex() { String tableName = cTables.getSelectedItem(); // System.out.println("in getChoosenTableIndex, selected Item is "+tableName); int index = getTableIndex(tableName); if (index >= 0) { // System.out.println("table found, index: " + index);...
[ "private", "int", "getChoosenTableIndex", "(", ")", "{", "String", "tableName", "=", "cTables", ".", "getSelectedItem", "(", ")", ";", "// System.out.println(\"in getChoosenTableIndex, selected Item is \"+tableName);", "int", "index", "=", "getTableIndex", "(", "tableName",...
if the table name is not in vHoldTableNames, create a ZaurusTableForm for it
[ "if", "the", "table", "name", "is", "not", "in", "vHoldTableNames", "create", "a", "ZaurusTableForm", "for", "it" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L611-L632
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java
DomHelper.setCursor
public void setCursor(Object parent, String name, String cursor) { """ Set a specific cursor on an element of this <code>GraphicsContext</code>. @param parent the parent of the element on which the cursor should be set. @param name the name of the child element on which the cursor should be set @param curso...
java
public void setCursor(Object parent, String name, String cursor) { Element element = getElement(parent, name); if (element != null) { Dom.setStyleAttribute(element, "cursor", cursor); } }
[ "public", "void", "setCursor", "(", "Object", "parent", ",", "String", "name", ",", "String", "cursor", ")", "{", "Element", "element", "=", "getElement", "(", "parent", ",", "name", ")", ";", "if", "(", "element", "!=", "null", ")", "{", "Dom", ".", ...
Set a specific cursor on an element of this <code>GraphicsContext</code>. @param parent the parent of the element on which the cursor should be set. @param name the name of the child element on which the cursor should be set @param cursor The string representation of the cursor to use.
[ "Set", "a", "specific", "cursor", "on", "an", "element", "of", "this", "<code", ">", "GraphicsContext<", "/", "code", ">", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L649-L654
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java
ProfileSummaryBuilder.getInstance
public static ProfileSummaryBuilder getInstance(Context context, Profile profile, ProfileSummaryWriter profileWriter) { """ Construct a new ProfileSummaryBuilder. @param context the build context. @param profile the profile being documented. @param profileWriter the doclet specific writer that wi...
java
public static ProfileSummaryBuilder getInstance(Context context, Profile profile, ProfileSummaryWriter profileWriter) { return new ProfileSummaryBuilder(context, profile, profileWriter); }
[ "public", "static", "ProfileSummaryBuilder", "getInstance", "(", "Context", "context", ",", "Profile", "profile", ",", "ProfileSummaryWriter", "profileWriter", ")", "{", "return", "new", "ProfileSummaryBuilder", "(", "context", ",", "profile", ",", "profileWriter", ")...
Construct a new ProfileSummaryBuilder. @param context the build context. @param profile the profile being documented. @param profileWriter the doclet specific writer that will output the result. @return an instance of a ProfileSummaryBuilder.
[ "Construct", "a", "new", "ProfileSummaryBuilder", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L96-L99
redkale/redkale-plugins
src/org/redkalex/weixin/WeiXinQYService.java
WeiXinQYService.encryptQY
protected String encryptQY(String randomStr, String text) { """ 对明文进行加密. <p> @param randomStr String @param text 需要加密的明文 @return 加密后base64编码的字符串 """ ByteArray bytes = new ByteArray(); byte[] randomStrBytes = randomStr.getBytes(CHARSET); byte[] textBytes = text.getBytes(CHA...
java
protected String encryptQY(String randomStr, String text) { ByteArray bytes = new ByteArray(); byte[] randomStrBytes = randomStr.getBytes(CHARSET); byte[] textBytes = text.getBytes(CHARSET); byte[] corpidBytes = qycorpid.getBytes(CHARSET); // randomStr + networkBytesOrder ...
[ "protected", "String", "encryptQY", "(", "String", "randomStr", ",", "String", "text", ")", "{", "ByteArray", "bytes", "=", "new", "ByteArray", "(", ")", ";", "byte", "[", "]", "randomStrBytes", "=", "randomStr", ".", "getBytes", "(", "CHARSET", ")", ";", ...
对明文进行加密. <p> @param randomStr String @param text 需要加密的明文 @return 加密后base64编码的字符串
[ "对明文进行加密", ".", "<p", ">", "@param", "randomStr", "String", "@param", "text", "需要加密的明文" ]
train
https://github.com/redkale/redkale-plugins/blob/a1edfc906a444ae19fe6aababce2957c9b5ea9d2/src/org/redkalex/weixin/WeiXinQYService.java#L196-L221
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/rename/RenameFileExtensions.java
RenameFileExtensions.renameFile
public static boolean renameFile(final File fileToRename, final File newFileName) throws IOException, FileIsADirectoryException { """ This method renames a given file. For instance if we have a file which we want to rename with the path "/tmp/test.dat" to "/tmp/renamed.dat" then you call the method as follow: ...
java
public static boolean renameFile(final File fileToRename, final File newFileName) throws IOException, FileIsADirectoryException { return renameFile(fileToRename, newFileName, false); }
[ "public", "static", "boolean", "renameFile", "(", "final", "File", "fileToRename", ",", "final", "File", "newFileName", ")", "throws", "IOException", ",", "FileIsADirectoryException", "{", "return", "renameFile", "(", "fileToRename", ",", "newFileName", ",", "false"...
This method renames a given file. For instance if we have a file which we want to rename with the path "/tmp/test.dat" to "/tmp/renamed.dat" then you call the method as follow: renameFile(new File("C://tmp//test.dat"), new File("C://tmp//renamed.dat")); @param fileToRename The file to rename. @param newFileName The ne...
[ "This", "method", "renames", "a", "given", "file", ".", "For", "instance", "if", "we", "have", "a", "file", "which", "we", "want", "to", "rename", "with", "the", "path", "/", "tmp", "/", "test", ".", "dat", "to", "/", "tmp", "/", "renamed", ".", "d...
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/rename/RenameFileExtensions.java#L287-L291
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.createImagesFromPredictions
public ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch) { """ Add the specified predicted images to the set of training images. This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. @param projectId The project id ...
java
public ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch) { return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); }
[ "public", "ImageCreateSummary", "createImagesFromPredictions", "(", "UUID", "projectId", ",", "ImageIdCreateBatch", "batch", ")", "{", "return", "createImagesFromPredictionsWithServiceResponseAsync", "(", "projectId", ",", "batch", ")", ".", "toBlocking", "(", ")", ".", ...
Add the specified predicted images to the set of training images. This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. @param projectId The project id @param batch Image and tag ids. Limted to 64 images and 20 tags per batch @throws IllegalArgumentException thr...
[ "Add", "the", "specified", "predicted", "images", "to", "the", "set", "of", "training", "images", ".", "This", "API", "creates", "a", "batch", "of", "images", "from", "predicted", "images", "specified", ".", "There", "is", "a", "limit", "of", "64", "images...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3752-L3754
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/execution/script/ScriptfileUtils.java
ScriptfileUtils.writeReader
private static void writeReader(final Reader reader, final FileWriter writer) throws IOException { """ Copy from a Reader to a FileWriter @param reader reader @param writer writer @throws IOException if an error occurs """ writeReader(reader, writer, LineEndingStyle.LOCAL); }
java
private static void writeReader(final Reader reader, final FileWriter writer) throws IOException { writeReader(reader, writer, LineEndingStyle.LOCAL); }
[ "private", "static", "void", "writeReader", "(", "final", "Reader", "reader", ",", "final", "FileWriter", "writer", ")", "throws", "IOException", "{", "writeReader", "(", "reader", ",", "writer", ",", "LineEndingStyle", ".", "LOCAL", ")", ";", "}" ]
Copy from a Reader to a FileWriter @param reader reader @param writer writer @throws IOException if an error occurs
[ "Copy", "from", "a", "Reader", "to", "a", "FileWriter" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/script/ScriptfileUtils.java#L128-L130
allcolor/YaHP-Converter
YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java
CClassLoader.createLoader
private static final CClassLoader createLoader(final ClassLoader parent, final String name) { """ Create a new loader @param parent a reference to the parent loader @param name loader name @return a new loader """ try { return new CClassLoader(parent, name); } catch (final Exception ignore) ...
java
private static final CClassLoader createLoader(final ClassLoader parent, final String name) { try { return new CClassLoader(parent, name); } catch (final Exception ignore) { return null; } }
[ "private", "static", "final", "CClassLoader", "createLoader", "(", "final", "ClassLoader", "parent", ",", "final", "String", "name", ")", "{", "try", "{", "return", "new", "CClassLoader", "(", "parent", ",", "name", ")", ";", "}", "catch", "(", "final", "E...
Create a new loader @param parent a reference to the parent loader @param name loader name @return a new loader
[ "Create", "a", "new", "loader" ]
train
https://github.com/allcolor/YaHP-Converter/blob/d72745281766a784a6b319f3787aa1d8de7cd0fe/YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java#L125-L132
UrielCh/ovh-java-sdk
ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhUtils.java
ApiOvhUtils.createApplication
public void createApplication(String nic, String password) throws IOException { """ Create a new OVH Application using https://eu.api.ovh.com/createApp/ Outout the Application Key and Application Secret in std-out @param nic @param password @throws IOException """ String url = "https://eu.api.ovh.com/cre...
java
public void createApplication(String nic, String password) throws IOException { String url = "https://eu.api.ovh.com/createApp/"; Document doc = Jsoup.connect(url) .data("nic", nic) .data("password", password) .data("applicationName", "One Shoot Token") .data("applicationDescription", "One Shoot Tok...
[ "public", "void", "createApplication", "(", "String", "nic", ",", "String", "password", ")", "throws", "IOException", "{", "String", "url", "=", "\"https://eu.api.ovh.com/createApp/\"", ";", "Document", "doc", "=", "Jsoup", ".", "connect", "(", "url", ")", ".", ...
Create a new OVH Application using https://eu.api.ovh.com/createApp/ Outout the Application Key and Application Secret in std-out @param nic @param password @throws IOException
[ "Create", "a", "new", "OVH", "Application", "using", "https", ":", "//", "eu", ".", "api", ".", "ovh", ".", "com", "/", "createApp", "/", "Outout", "the", "Application", "Key", "and", "Application", "Secret", "in", "std", "-", "out" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhUtils.java#L90-L112
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java
CacheConfigurationBuilder.withResilienceStrategy
public CacheConfigurationBuilder<K, V> withResilienceStrategy(ResilienceStrategy<K, V> resilienceStrategy) { """ Adds a {@link ResilienceStrategy} to the configured builder. @param resilienceStrategy the resilience strategy to use @return a new builder with the added resilience strategy configuration """ ...
java
public CacheConfigurationBuilder<K, V> withResilienceStrategy(ResilienceStrategy<K, V> resilienceStrategy) { return addOrReplaceConfiguration(new DefaultResilienceStrategyConfiguration(requireNonNull(resilienceStrategy, "Null resilienceStrategy"))); }
[ "public", "CacheConfigurationBuilder", "<", "K", ",", "V", ">", "withResilienceStrategy", "(", "ResilienceStrategy", "<", "K", ",", "V", ">", "resilienceStrategy", ")", "{", "return", "addOrReplaceConfiguration", "(", "new", "DefaultResilienceStrategyConfiguration", "("...
Adds a {@link ResilienceStrategy} to the configured builder. @param resilienceStrategy the resilience strategy to use @return a new builder with the added resilience strategy configuration
[ "Adds", "a", "{", "@link", "ResilienceStrategy", "}", "to", "the", "configured", "builder", "." ]
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L361-L363
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java
SpaceGroup.getRotAxisAndAngle
public static AxisAngle4d getRotAxisAndAngle(Matrix3d m) { """ Given a rotation matrix calculates the rotation axis and angle for it. The angle is calculated from the trace, the axis from the eigenvalue decomposition. If given matrix is improper rotation or identity matrix then axis (0,0,0) and angle 0 are ret...
java
public static AxisAngle4d getRotAxisAndAngle(Matrix3d m) { double determinant = m.determinant(); if (!(Math.abs(determinant)-1.0<DELTA)) throw new IllegalArgumentException("Given matrix is not a rotation matrix"); AxisAngle4d axisAndAngle = new AxisAngle4d(new Vector3d(0,0,0),0); double[] d = {m.m00,m.m10,m....
[ "public", "static", "AxisAngle4d", "getRotAxisAndAngle", "(", "Matrix3d", "m", ")", "{", "double", "determinant", "=", "m", ".", "determinant", "(", ")", ";", "if", "(", "!", "(", "Math", ".", "abs", "(", "determinant", ")", "-", "1.0", "<", "DELTA", "...
Given a rotation matrix calculates the rotation axis and angle for it. The angle is calculated from the trace, the axis from the eigenvalue decomposition. If given matrix is improper rotation or identity matrix then axis (0,0,0) and angle 0 are returned. @param m @return @throws IllegalArgumentException if given matrix...
[ "Given", "a", "rotation", "matrix", "calculates", "the", "rotation", "axis", "and", "angle", "for", "it", ".", "The", "angle", "is", "calculated", "from", "the", "trace", "the", "axis", "from", "the", "eigenvalue", "decomposition", ".", "If", "given", "matri...
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java#L498-L532
sculptor/sculptor
sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java
HelperBase.substringBefore
public String substringBefore(String string, String pattern) { """ Gets the substring before a given pattern @param string original string @param pattern pattern to check @return substring before the pattern """ if (string == null || pattern == null) { return string; } int pos = string.indexOf(...
java
public String substringBefore(String string, String pattern) { if (string == null || pattern == null) { return string; } int pos = string.indexOf(pattern); if (pos != -1) { return string.substring(0, pos); } return null; }
[ "public", "String", "substringBefore", "(", "String", "string", ",", "String", "pattern", ")", "{", "if", "(", "string", "==", "null", "||", "pattern", "==", "null", ")", "{", "return", "string", ";", "}", "int", "pos", "=", "string", ".", "indexOf", "...
Gets the substring before a given pattern @param string original string @param pattern pattern to check @return substring before the pattern
[ "Gets", "the", "substring", "before", "a", "given", "pattern" ]
train
https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L567-L576
google/closure-templates
java/src/com/google/template/soy/base/internal/BaseUtils.java
BaseUtils.trimStackTraceTo
public static void trimStackTraceTo(Throwable t, Class<?> cls) { """ Trims the stack trace of the throwable such that the top item points at {@code cls}. """ StackTraceElement[] ste = t.getStackTrace(); String name = cls.getName(); for (int i = 0; i < ste.length; i++) { if (ste[i].getClassNam...
java
public static void trimStackTraceTo(Throwable t, Class<?> cls) { StackTraceElement[] ste = t.getStackTrace(); String name = cls.getName(); for (int i = 0; i < ste.length; i++) { if (ste[i].getClassName().equals(name)) { t.setStackTrace(Arrays.copyOf(ste, i)); return; } } }
[ "public", "static", "void", "trimStackTraceTo", "(", "Throwable", "t", ",", "Class", "<", "?", ">", "cls", ")", "{", "StackTraceElement", "[", "]", "ste", "=", "t", ".", "getStackTrace", "(", ")", ";", "String", "name", "=", "cls", ".", "getName", "(",...
Trims the stack trace of the throwable such that the top item points at {@code cls}.
[ "Trims", "the", "stack", "trace", "of", "the", "throwable", "such", "that", "the", "top", "item", "points", "at", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/base/internal/BaseUtils.java#L275-L284
alkacon/opencms-core
src/org/opencms/main/CmsShellCommands.java
CmsShellCommands.touchResource
public void touchResource(String resourcePath) throws Exception { """ Touches a resource and all its children.<p> This method also rewrites the content for all files in the subtree. @param resourcePath the site path of the resource @throws Exception if something goes wrong """ CmsResource res...
java
public void touchResource(String resourcePath) throws Exception { CmsResource resource = m_cms.readResource(resourcePath); CmsLockActionRecord action = CmsLockUtil.ensureLock(m_cms, resource); try { OpenCms.getWorkplaceManager().flushMessageCache(); // One important reas...
[ "public", "void", "touchResource", "(", "String", "resourcePath", ")", "throws", "Exception", "{", "CmsResource", "resource", "=", "m_cms", ".", "readResource", "(", "resourcePath", ")", ";", "CmsLockActionRecord", "action", "=", "CmsLockUtil", ".", "ensureLock", ...
Touches a resource and all its children.<p> This method also rewrites the content for all files in the subtree. @param resourcePath the site path of the resource @throws Exception if something goes wrong
[ "Touches", "a", "resource", "and", "all", "its", "children", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L1686-L1701
samskivert/samskivert
src/main/java/com/samskivert/velocity/DispatcherServlet.java
DispatcherServlet.loadConfiguration
protected Properties loadConfiguration (ServletConfig config) throws IOException { """ We load our velocity properties from the classpath rather than from a file. """ Properties props = loadVelocityProps(config); // if we failed to create our application for whatever reason; bail ...
java
protected Properties loadConfiguration (ServletConfig config) throws IOException { Properties props = loadVelocityProps(config); // if we failed to create our application for whatever reason; bail if (_app == null) { return props; } // let the applicatio...
[ "protected", "Properties", "loadConfiguration", "(", "ServletConfig", "config", ")", "throws", "IOException", "{", "Properties", "props", "=", "loadVelocityProps", "(", "config", ")", ";", "// if we failed to create our application for whatever reason; bail", "if", "(", "_a...
We load our velocity properties from the classpath rather than from a file.
[ "We", "load", "our", "velocity", "properties", "from", "the", "classpath", "rather", "than", "from", "a", "file", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/DispatcherServlet.java#L216-L242
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java
CudaAffinityManager.tagLocation
@Override public void tagLocation(DataBuffer buffer, Location location) { """ This method marks given DataBuffer as actual in specific location (either host, device, or both) @param buffer @param location """ if (location == Location.HOST) AtomicAllocator.getInstance().getAllocation...
java
@Override public void tagLocation(DataBuffer buffer, Location location) { if (location == Location.HOST) AtomicAllocator.getInstance().getAllocationPoint(buffer).tickHostWrite(); else if (location == Location.DEVICE) AtomicAllocator.getInstance().getAllocationPoint(buffer).ti...
[ "@", "Override", "public", "void", "tagLocation", "(", "DataBuffer", "buffer", ",", "Location", "location", ")", "{", "if", "(", "location", "==", "Location", ".", "HOST", ")", "AtomicAllocator", ".", "getInstance", "(", ")", ".", "getAllocationPoint", "(", ...
This method marks given DataBuffer as actual in specific location (either host, device, or both) @param buffer @param location
[ "This", "method", "marks", "given", "DataBuffer", "as", "actual", "in", "specific", "location", "(", "either", "host", "device", "or", "both", ")" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java#L357-L367
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/EnaValidator.java
EnaValidator.initWriters
protected void initWriters() throws IOException { """ separate method to instantiate so unit tests can call this @throws IOException """ String summarywriter = prefix == null ? "VAL_SUMMARY.txt" : prefix + "_" + "VAL_SUMMARY.txt"; String infowriter = prefix == null ? "VAL_INFO.txt" : prefix + "_" + "VAL...
java
protected void initWriters() throws IOException { String summarywriter = prefix == null ? "VAL_SUMMARY.txt" : prefix + "_" + "VAL_SUMMARY.txt"; String infowriter = prefix == null ? "VAL_INFO.txt" : prefix + "_" + "VAL_INFO.txt"; String errorwriter = prefix == null ? "VAL_ERROR.txt" : prefix + "_" + "VAL_ERROR.tx...
[ "protected", "void", "initWriters", "(", ")", "throws", "IOException", "{", "String", "summarywriter", "=", "prefix", "==", "null", "?", "\"VAL_SUMMARY.txt\"", ":", "prefix", "+", "\"_\"", "+", "\"VAL_SUMMARY.txt\"", ";", "String", "infowriter", "=", "prefix", "...
separate method to instantiate so unit tests can call this @throws IOException
[ "separate", "method", "to", "instantiate", "so", "unit", "tests", "can", "call", "this" ]
train
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/EnaValidator.java#L472-L484
jbundle/jbundle
thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JBitMaskField.java
JBitMaskField.init
public void init(int iCheckCount, boolean bCheckedIsOn) { """ Creates new JCellButton. @param iCheckCount The number of checkboxes to add. @param bCheckedIsOn A 1 bit is a checked checkbox. """ m_bCheckedIsOn = bCheckedIsOn; this.setBorder(null); this.setOpaque(false); ...
java
public void init(int iCheckCount, boolean bCheckedIsOn) { m_bCheckedIsOn = bCheckedIsOn; this.setBorder(null); this.setOpaque(false); this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); for (int i = 0; i < iCheckCount; i++) { JCheckBox checkBo...
[ "public", "void", "init", "(", "int", "iCheckCount", ",", "boolean", "bCheckedIsOn", ")", "{", "m_bCheckedIsOn", "=", "bCheckedIsOn", ";", "this", ".", "setBorder", "(", "null", ")", ";", "this", ".", "setOpaque", "(", "false", ")", ";", "this", ".", "se...
Creates new JCellButton. @param iCheckCount The number of checkboxes to add. @param bCheckedIsOn A 1 bit is a checked checkbox.
[ "Creates", "new", "JCellButton", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JBitMaskField.java#L81-L96
TNG/ArchUnit
archunit/src/main/java/com/tngtech/archunit/library/dependencies/Slices.java
Slices.namingSlices
@PublicAPI(usage = ACCESS) public Slices namingSlices(String pattern) { """ Allows the naming of single slices, where back references to the matching pattern can be denoted by '$' followed by capturing group number. <br> E.g. {@code namingSlices("Slice $1")} would name a slice matching {@code '*..service.(*)...
java
@PublicAPI(usage = ACCESS) public Slices namingSlices(String pattern) { List<Slice> newSlices = new ArrayList<>(); for (Slice slice : slices) { newSlices.add(slice.as(pattern)); } return new Slices(newSlices, description); }
[ "@", "PublicAPI", "(", "usage", "=", "ACCESS", ")", "public", "Slices", "namingSlices", "(", "String", "pattern", ")", "{", "List", "<", "Slice", ">", "newSlices", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Slice", "slice", ":", "slices...
Allows the naming of single slices, where back references to the matching pattern can be denoted by '$' followed by capturing group number. <br> E.g. {@code namingSlices("Slice $1")} would name a slice matching {@code '*..service.(*)..*'} against {@code 'com.some.company.service.hello.something'} as 'Slice hello'.<br> ...
[ "Allows", "the", "naming", "of", "single", "slices", "where", "back", "references", "to", "the", "matching", "pattern", "can", "be", "denoted", "by", "$", "followed", "by", "capturing", "group", "number", ".", "<br", ">", "E", ".", "g", ".", "{", "@code"...
train
https://github.com/TNG/ArchUnit/blob/024c5d2502e91de6cb586b86c7084dbd12f3ef37/archunit/src/main/java/com/tngtech/archunit/library/dependencies/Slices.java#L91-L98
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/MainActivity.java
MainActivity.createPreferenceInitialFragmentButtonListener
private OnClickListener createPreferenceInitialFragmentButtonListener() { """ Creates a and returns a listener, which allows to show a specific header of a {@link PreferenceActivity}. @return The listener, which has been created, as an instance of the type {@link OnClickListener} """ return new On...
java
private OnClickListener createPreferenceInitialFragmentButtonListener() { return new OnClickListener() { @Override public void onClick(final View v) { Intent intent = new Intent(MainActivity.this, SettingsActivity.class); intent.putExtra(PreferenceActivit...
[ "private", "OnClickListener", "createPreferenceInitialFragmentButtonListener", "(", ")", "{", "return", "new", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "View", "v", ")", "{", "Intent", "intent", "=", "new", "I...
Creates a and returns a listener, which allows to show a specific header of a {@link PreferenceActivity}. @return The listener, which has been created, as an instance of the type {@link OnClickListener}
[ "Creates", "a", "and", "returns", "a", "listener", "which", "allows", "to", "show", "a", "specific", "header", "of", "a", "{", "@link", "PreferenceActivity", "}", "." ]
train
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/MainActivity.java#L79-L109
google/error-prone-javac
src/java.compiler/share/classes/javax/tools/ToolProvider.java
ToolProvider.getSystemTool
private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) { """ Get an instance of a system tool using the service loader. @implNote By default, this returns the implementation in the specified module. For limited backward compatibility, if this code is run on an older versi...
java
private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) { if (useLegacy) { try { return Class.forName(className, true, ClassLoader.getSystemClassLoader()). asSubclass(clazz).getConstructor().newInstance(); } catch (Refle...
[ "private", "static", "<", "T", ">", "T", "getSystemTool", "(", "Class", "<", "T", ">", "clazz", ",", "String", "moduleName", ",", "String", "className", ")", "{", "if", "(", "useLegacy", ")", "{", "try", "{", "return", "Class", ".", "forName", "(", "...
Get an instance of a system tool using the service loader. @implNote By default, this returns the implementation in the specified module. For limited backward compatibility, if this code is run on an older version of the Java platform that does not support modules, this method will try and create an instance of...
[ "Get", "an", "instance", "of", "a", "system", "tool", "using", "the", "service", "loader", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/tools/ToolProvider.java#L128-L149
gfk-ba/senbot
SenBotRunner/src/main/java/com/gfk/senbot/framework/cucumber/stepdefinitions/selenium/SeleniumPageRepresentationSteps.java
SeleniumPageRepresentationSteps.the_view_should_contain
@Then("^the \"([^\"]*)\" view should contain the element \"([^\"]*)\"$") public WebElement the_view_should_contain(String viewName, String elementName) throws Throwable { """ A generic way to assert of a view/page contains a certain element. The element lookup is done though a naming convention. variable_Name is...
java
@Then("^the \"([^\"]*)\" view should contain the element \"([^\"]*)\"$") public WebElement the_view_should_contain(String viewName, String elementName) throws Throwable { return seleniumElementService.viewShouldContainElement(viewName, elementName); }
[ "@", "Then", "(", "\"^the \\\"([^\\\"]*)\\\" view should contain the element \\\"([^\\\"]*)\\\"$\"", ")", "public", "WebElement", "the_view_should_contain", "(", "String", "viewName", ",", "String", "elementName", ")", "throws", "Throwable", "{", "return", "seleniumElementServi...
A generic way to assert of a view/page contains a certain element. The element lookup is done though a naming convention. variable_Name is matched up on argument "Variable name". So case insensitive and spaces are replaced by underscores @param viewName @param elementName @throws Throwable
[ "A", "generic", "way", "to", "assert", "of", "a", "view", "/", "page", "contains", "a", "certain", "element", ".", "The", "element", "lookup", "is", "done", "though", "a", "naming", "convention", ".", "variable_Name", "is", "matched", "up", "on", "argument...
train
https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/cucumber/stepdefinitions/selenium/SeleniumPageRepresentationSteps.java#L85-L89
Nordstrom/JUnit-Foundation
src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java
LifecycleHooks.describeChild
public static Description describeChild(Object target, Object child) { """ Get the description of the indicated child object from the runner for the specified test class instance. @param target test class instance @param child child object @return {@link Description} object for the indicated child """ ...
java
public static Description describeChild(Object target, Object child) { Object runner = getRunnerForTarget(target); return invoke(runner, "describeChild", child); }
[ "public", "static", "Description", "describeChild", "(", "Object", "target", ",", "Object", "child", ")", "{", "Object", "runner", "=", "getRunnerForTarget", "(", "target", ")", ";", "return", "invoke", "(", "runner", ",", "\"describeChild\"", ",", "child", ")...
Get the description of the indicated child object from the runner for the specified test class instance. @param target test class instance @param child child object @return {@link Description} object for the indicated child
[ "Get", "the", "description", "of", "the", "indicated", "child", "object", "from", "the", "runner", "for", "the", "specified", "test", "class", "instance", "." ]
train
https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java#L208-L211
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java
JobId.of
public static JobId of(String project, String job) { """ Creates a job identity given project's and job's user-defined id. """ return newBuilder().setProject(checkNotNull(project)).setJob(checkNotNull(job)).build(); }
java
public static JobId of(String project, String job) { return newBuilder().setProject(checkNotNull(project)).setJob(checkNotNull(job)).build(); }
[ "public", "static", "JobId", "of", "(", "String", "project", ",", "String", "job", ")", "{", "return", "newBuilder", "(", ")", ".", "setProject", "(", "checkNotNull", "(", "project", ")", ")", ".", "setJob", "(", "checkNotNull", "(", "job", ")", ")", "...
Creates a job identity given project's and job's user-defined id.
[ "Creates", "a", "job", "identity", "given", "project", "s", "and", "job", "s", "user", "-", "defined", "id", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java#L86-L88
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java
HttpResponseStatus.valueOf
public static HttpResponseStatus valueOf(int code, String reasonPhrase) { """ Returns the {@link HttpResponseStatus} represented by the specified {@code code} and {@code reasonPhrase}. If the specified code is a standard HTTP status {@code code} and {@code reasonPhrase}, a cached instance will be returned. Other...
java
public static HttpResponseStatus valueOf(int code, String reasonPhrase) { HttpResponseStatus responseStatus = valueOf0(code); return responseStatus != null && responseStatus.reasonPhrase().contentEquals(reasonPhrase) ? responseStatus : new HttpResponseStatus(code, reasonPhrase); }
[ "public", "static", "HttpResponseStatus", "valueOf", "(", "int", "code", ",", "String", "reasonPhrase", ")", "{", "HttpResponseStatus", "responseStatus", "=", "valueOf0", "(", "code", ")", ";", "return", "responseStatus", "!=", "null", "&&", "responseStatus", ".",...
Returns the {@link HttpResponseStatus} represented by the specified {@code code} and {@code reasonPhrase}. If the specified code is a standard HTTP status {@code code} and {@code reasonPhrase}, a cached instance will be returned. Otherwise, a new instance will be returned. @param code The response code value. @param re...
[ "Returns", "the", "{" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java#L464-L468
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendBinaryBlocking
public static void sendBinaryBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException { """ Sends a complete binary message using blocking IO Automatically frees the pooled byte buffer when done. @param pooledData The data to send, it will be freed when done @param wsCh...
java
public static void sendBinaryBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(pooledData, WebSocketFrameType.BINARY, wsChannel); }
[ "public", "static", "void", "sendBinaryBlocking", "(", "final", "PooledByteBuffer", "pooledData", ",", "final", "WebSocketChannel", "wsChannel", ")", "throws", "IOException", "{", "sendBlockingInternal", "(", "pooledData", ",", "WebSocketFrameType", ".", "BINARY", ",", ...
Sends a complete binary message using blocking IO Automatically frees the pooled byte buffer when done. @param pooledData The data to send, it will be freed when done @param wsChannel The web socket channel
[ "Sends", "a", "complete", "binary", "message", "using", "blocking", "IO", "Automatically", "frees", "the", "pooled", "byte", "buffer", "when", "done", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L757-L759
OpenLiberty/open-liberty
dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/metadata/MetaDataUtils.java
MetaDataUtils.copyModuleMetaDataSlot
public static boolean copyModuleMetaDataSlot(MetaDataEvent<ModuleMetaData> event, MetaDataSlot slot) { """ Copy slot data from a primary module metadata to a nested module metadata. This is necessary for containers that want to share module-level data for all components in a module, because nested modules have ...
java
public static boolean copyModuleMetaDataSlot(MetaDataEvent<ModuleMetaData> event, MetaDataSlot slot) { Container container = event.getContainer(); MetaData metaData = event.getMetaData(); try { // For now, we just need to copy from WebModuleInfo, and ClientModuleInfo // ...
[ "public", "static", "boolean", "copyModuleMetaDataSlot", "(", "MetaDataEvent", "<", "ModuleMetaData", ">", "event", ",", "MetaDataSlot", "slot", ")", "{", "Container", "container", "=", "event", ".", "getContainer", "(", ")", ";", "MetaData", "metaData", "=", "e...
Copy slot data from a primary module metadata to a nested module metadata. This is necessary for containers that want to share module-level data for all components in a module, because nested modules have their own distinct metadata. @param event event from {@link ModuleMetaDataListener#moduleMetaDataCreated} @param s...
[ "Copy", "slot", "data", "from", "a", "primary", "module", "metadata", "to", "a", "nested", "module", "metadata", ".", "This", "is", "necessary", "for", "containers", "that", "want", "to", "share", "module", "-", "level", "data", "for", "all", "components", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/metadata/MetaDataUtils.java#L36-L66
EdwardRaff/JSAT
JSAT/src/jsat/distributions/discrete/Zipf.java
Zipf.setCardinality
public void setCardinality(double cardinality) { """ Sets the cardinality of the distribution, defining the maximum number of items that Zipf can return. @param cardinality the maximum output range of the distribution, can be {@link Double#POSITIVE_INFINITY infinite}. """ if (cardinality < 0 || Do...
java
public void setCardinality(double cardinality) { if (cardinality < 0 || Double.isNaN(cardinality)) throw new IllegalArgumentException("Cardinality must be a positive integer or infinity, not " + cardinality); this.cardinality = Math.ceil(cardinality); fixCache(); }
[ "public", "void", "setCardinality", "(", "double", "cardinality", ")", "{", "if", "(", "cardinality", "<", "0", "||", "Double", ".", "isNaN", "(", "cardinality", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Cardinality must be a positive integer or ...
Sets the cardinality of the distribution, defining the maximum number of items that Zipf can return. @param cardinality the maximum output range of the distribution, can be {@link Double#POSITIVE_INFINITY infinite}.
[ "Sets", "the", "cardinality", "of", "the", "distribution", "defining", "the", "maximum", "number", "of", "items", "that", "Zipf", "can", "return", "." ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/Zipf.java#L87-L93
belaban/JGroups
src/org/jgroups/util/Bits.java
Bits.readLongSequence
public static void readLongSequence(ByteBuffer buf, long seqnos[]) { """ Reads 2 compressed longs from buf into seqnos <p/> Once variable-length encoding has been implemented, this method will probably get dropped as we can simply read the 2 longs individually. @param buf the buffer to read from @param seqnos...
java
public static void readLongSequence(ByteBuffer buf, long seqnos[]) { byte len=buf.get(); if(len == 0) { seqnos[0]=seqnos[1]=0; return; } byte len1=firstNibble(len), len2=secondNibble(len); seqnos[0]=makeLong(buf, len1); seqnos[1]=makeLong(buf, len2...
[ "public", "static", "void", "readLongSequence", "(", "ByteBuffer", "buf", ",", "long", "seqnos", "[", "]", ")", "{", "byte", "len", "=", "buf", ".", "get", "(", ")", ";", "if", "(", "len", "==", "0", ")", "{", "seqnos", "[", "0", "]", "=", "seqno...
Reads 2 compressed longs from buf into seqnos <p/> Once variable-length encoding has been implemented, this method will probably get dropped as we can simply read the 2 longs individually. @param buf the buffer to read from @param seqnos the array to read the seqnos into, needs to have a length of 2
[ "Reads", "2", "compressed", "longs", "from", "buf", "into", "seqnos", "<p", "/", ">", "Once", "variable", "-", "length", "encoding", "has", "been", "implemented", "this", "method", "will", "probably", "get", "dropped", "as", "we", "can", "simply", "read", ...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L377-L386
craftercms/commons
utilities/src/main/java/org/craftercms/commons/http/HttpUtils.java
HttpUtils.getBaseRequestUrl
public static StringBuilder getBaseRequestUrl(HttpServletRequest request, boolean forceHttps) { """ Returns the portion from the URL that includes the scheme, server name and port number, without the server path. @param request the request object used to build the base URL @param forceHttps if HTTPS ...
java
public static StringBuilder getBaseRequestUrl(HttpServletRequest request, boolean forceHttps) { String scheme = forceHttps ? HTTPS_SCHEME : request.getScheme(); String serverName = request.getServerName(); int serverPort = request.getServerPort(); StringBuilder url = new StringBuilder();...
[ "public", "static", "StringBuilder", "getBaseRequestUrl", "(", "HttpServletRequest", "request", ",", "boolean", "forceHttps", ")", "{", "String", "scheme", "=", "forceHttps", "?", "HTTPS_SCHEME", ":", "request", ".", "getScheme", "(", ")", ";", "String", "serverNa...
Returns the portion from the URL that includes the scheme, server name and port number, without the server path. @param request the request object used to build the base URL @param forceHttps if HTTPS should be enforced @return the base request URL
[ "Returns", "the", "portion", "from", "the", "URL", "that", "includes", "the", "scheme", "server", "name", "and", "port", "number", "without", "the", "server", "path", "." ]
train
https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/http/HttpUtils.java#L64-L78
feroult/yawp
yawp-core/src/main/java/io/yawp/commons/utils/ResourceFinder.java
ResourceFinder.mapAvailableClasses
public Map<String, Class> mapAvailableClasses(String uri) throws IOException { """ Executes mapAvailableStrings assuming the value of each entry in the map is the name of a class that should be loaded. <p/> Any class that cannot be loaded will be skipped and placed in the 'resourcesNotLoaded' collection. <p/>...
java
public Map<String, Class> mapAvailableClasses(String uri) throws IOException { resourcesNotLoaded.clear(); Map<String, Class> classes = new HashMap<>(); Map<String, String> map = mapAvailableStrings(uri); for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();) { ...
[ "public", "Map", "<", "String", ",", "Class", ">", "mapAvailableClasses", "(", "String", "uri", ")", "throws", "IOException", "{", "resourcesNotLoaded", ".", "clear", "(", ")", ";", "Map", "<", "String", ",", "Class", ">", "classes", "=", "new", "HashMap",...
Executes mapAvailableStrings assuming the value of each entry in the map is the name of a class that should be loaded. <p/> Any class that cannot be loaded will be skipped and placed in the 'resourcesNotLoaded' collection. <p/> Example classpath: <p/> META-INF/xmlparsers/xerces META-INF/xmlparsers/crimson <p/> Resource...
[ "Executes", "mapAvailableStrings", "assuming", "the", "value", "of", "each", "entry", "in", "the", "map", "is", "the", "name", "of", "a", "class", "that", "should", "be", "loaded", ".", "<p", "/", ">", "Any", "class", "that", "cannot", "be", "loaded", "w...
train
https://github.com/feroult/yawp/blob/b90deb905edd3fdb3009a5525e310cd17ead7f3d/yawp-core/src/main/java/io/yawp/commons/utils/ResourceFinder.java#L417-L433