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
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java
Settings.setArrayIfNotEmpty
public void setArrayIfNotEmpty(@NotNull final String key, @Nullable final List<String> value) { """ Sets a property value only if the array value is not null and not empty. @param key the key for the property @param value the value for the property """ if (null != value && !value.isEmpty()) { ...
java
public void setArrayIfNotEmpty(@NotNull final String key, @Nullable final List<String> value) { if (null != value && !value.isEmpty()) { setString(key, new Gson().toJson(value)); } }
[ "public", "void", "setArrayIfNotEmpty", "(", "@", "NotNull", "final", "String", "key", ",", "@", "Nullable", "final", "List", "<", "String", ">", "value", ")", "{", "if", "(", "null", "!=", "value", "&&", "!", "value", ".", "isEmpty", "(", ")", ")", ...
Sets a property value only if the array value is not null and not empty. @param key the key for the property @param value the value for the property
[ "Sets", "a", "property", "value", "only", "if", "the", "array", "value", "is", "not", "null", "and", "not", "empty", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L712-L716
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/expressions/Expressions.java
Expressions.isEqual
public static BooleanIsEqual isEqual(ComparableExpression<Boolean> left, Boolean constant) { """ Creates a BooleanIsEqual expression from the given expression and constant. @param left The left expression. @param constant The constant to compare to. @return A new BooleanIsEqual binary expression. """ ...
java
public static BooleanIsEqual isEqual(ComparableExpression<Boolean> left, Boolean constant) { return new BooleanIsEqual(left, constant(constant)); }
[ "public", "static", "BooleanIsEqual", "isEqual", "(", "ComparableExpression", "<", "Boolean", ">", "left", ",", "Boolean", "constant", ")", "{", "return", "new", "BooleanIsEqual", "(", "left", ",", "constant", "(", "constant", ")", ")", ";", "}" ]
Creates a BooleanIsEqual expression from the given expression and constant. @param left The left expression. @param constant The constant to compare to. @return A new BooleanIsEqual binary expression.
[ "Creates", "a", "BooleanIsEqual", "expression", "from", "the", "given", "expression", "and", "constant", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L186-L188
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.getIntentSuggestions
public List<IntentsSuggestionExample> getIntentSuggestions(UUID appId, String versionId, UUID intentId, GetIntentSuggestionsOptionalParameter getIntentSuggestionsOptionalParameter) { """ Suggests examples that would improve the accuracy of the intent model. @param appId The application ID. @param versionId The...
java
public List<IntentsSuggestionExample> getIntentSuggestions(UUID appId, String versionId, UUID intentId, GetIntentSuggestionsOptionalParameter getIntentSuggestionsOptionalParameter) { return getIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, getIntentSuggestionsOptionalParameter).toBlocking...
[ "public", "List", "<", "IntentsSuggestionExample", ">", "getIntentSuggestions", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "intentId", ",", "GetIntentSuggestionsOptionalParameter", "getIntentSuggestionsOptionalParameter", ")", "{", "return", "getIntentSu...
Suggests examples that would improve the accuracy of the intent model. @param appId The application ID. @param versionId The version ID. @param intentId The intent classifier ID. @param getIntentSuggestionsOptionalParameter the object representing the optional parameters to be set before calling this API @throws Illeg...
[ "Suggests", "examples", "that", "would", "improve", "the", "accuracy", "of", "the", "intent", "model", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5071-L5073
samskivert/samskivert
src/main/java/com/samskivert/util/CollectionUtil.java
CollectionUtil.addAll
@ReplacedBy("com.google.common.collect.Iterators#addAll()") public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter) { """ Adds all items returned by the iterator to the supplied collection and returns the supplied collection. """ while (iter.hasNext()) { ...
java
@ReplacedBy("com.google.common.collect.Iterators#addAll()") public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter) { while (iter.hasNext()) { col.add(iter.next()); } return col; }
[ "@", "ReplacedBy", "(", "\"com.google.common.collect.Iterators#addAll()\"", ")", "public", "static", "<", "T", ",", "C", "extends", "Collection", "<", "T", ">", ">", "C", "addAll", "(", "C", "col", ",", "Iterator", "<", "?", "extends", "T", ">", "iter", ")...
Adds all items returned by the iterator to the supplied collection and returns the supplied collection.
[ "Adds", "all", "items", "returned", "by", "the", "iterator", "to", "the", "supplied", "collection", "and", "returns", "the", "supplied", "collection", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L43-L50
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java
TileBoundingBoxUtils.getTileGrid
public static TileGrid getTileGrid(Point point, int zoom, Projection projection) { """ Get the tile grid for the location specified as the projection @param point point @param zoom zoom level @param projection projection @return tile grid @since 1.1.0 """ ProjectionTransform toWebMercator = proj...
java
public static TileGrid getTileGrid(Point point, int zoom, Projection projection) { ProjectionTransform toWebMercator = projection .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); Point webMercatorPoint = toWebMercator.transform(point); BoundingBox boundingBox = new BoundingBox(webMercatorPoint.ge...
[ "public", "static", "TileGrid", "getTileGrid", "(", "Point", "point", ",", "int", "zoom", ",", "Projection", "projection", ")", "{", "ProjectionTransform", "toWebMercator", "=", "projection", ".", "getTransformation", "(", "ProjectionConstants", ".", "EPSG_WEB_MERCATO...
Get the tile grid for the location specified as the projection @param point point @param zoom zoom level @param projection projection @return tile grid @since 1.1.0
[ "Get", "the", "tile", "grid", "for", "the", "location", "specified", "as", "the", "projection" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L574-L583
groovy/groovy-core
src/main/groovy/lang/GroovyClassLoader.java
GroovyClassLoader.parseClass
public Class parseClass(GroovyCodeSource codeSource, boolean shouldCacheSource) throws CompilationFailedException { """ Parses the given code source into a Java class. If there is a class file for the given code source, then no parsing is done, instead the cached class is returned. @param shouldCacheSource if ...
java
public Class parseClass(GroovyCodeSource codeSource, boolean shouldCacheSource) throws CompilationFailedException { synchronized (sourceCache) { Class answer = sourceCache.get(codeSource.getName()); if (answer != null) return answer; answer = doParseClass(codeSource); ...
[ "public", "Class", "parseClass", "(", "GroovyCodeSource", "codeSource", ",", "boolean", "shouldCacheSource", ")", "throws", "CompilationFailedException", "{", "synchronized", "(", "sourceCache", ")", "{", "Class", "answer", "=", "sourceCache", ".", "get", "(", "code...
Parses the given code source into a Java class. If there is a class file for the given code source, then no parsing is done, instead the cached class is returned. @param shouldCacheSource if true then the generated class will be stored in the source cache @return the main class defined in the given script
[ "Parses", "the", "given", "code", "source", "into", "a", "Java", "class", ".", "If", "there", "is", "a", "class", "file", "for", "the", "given", "code", "source", "then", "no", "parsing", "is", "done", "instead", "the", "cached", "class", "is", "returned...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/GroovyClassLoader.java#L265-L273
bitcoinj/bitcoinj
tools/src/main/java/org/bitcoinj/tools/WalletTool.java
WalletTool.parseLockTimeStr
private static long parseLockTimeStr(String lockTimeStr) throws ParseException { """ Parses the string either as a whole number of blocks, or if it contains slashes as a YYYY/MM/DD format date and returns the lock time in wire format. """ if (lockTimeStr.indexOf("/") != -1) { SimpleDateFor...
java
private static long parseLockTimeStr(String lockTimeStr) throws ParseException { if (lockTimeStr.indexOf("/") != -1) { SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd", Locale.US); Date date = format.parse(lockTimeStr); return date.getTime() / 1000; } ...
[ "private", "static", "long", "parseLockTimeStr", "(", "String", "lockTimeStr", ")", "throws", "ParseException", "{", "if", "(", "lockTimeStr", ".", "indexOf", "(", "\"/\"", ")", "!=", "-", "1", ")", "{", "SimpleDateFormat", "format", "=", "new", "SimpleDateFor...
Parses the string either as a whole number of blocks, or if it contains slashes as a YYYY/MM/DD format date and returns the lock time in wire format.
[ "Parses", "the", "string", "either", "as", "a", "whole", "number", "of", "blocks", "or", "if", "it", "contains", "slashes", "as", "a", "YYYY", "/", "MM", "/", "DD", "format", "date", "and", "returns", "the", "lock", "time", "in", "wire", "format", "." ...
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/tools/src/main/java/org/bitcoinj/tools/WalletTool.java#L1064-L1071
OpenLiberty/open-liberty
dev/com.ibm.ws.logging/src/com/ibm/ws/logging/utils/FileLogHolder.java
FileLogHolder.createFileLogHolder
public static FileLogHolder createFileLogHolder(TraceWriter oldLog, FileLogHeader logHeader, File logDirectory, String newFileName, int maxFiles, long maxSizeBytes) { """ This method will check to see if the sup...
java
public static FileLogHolder createFileLogHolder(TraceWriter oldLog, FileLogHeader logHeader, File logDirectory, String newFileName, int maxFiles, long maxSizeBytes) { return createFileLogHolder(oldLog, logHea...
[ "public", "static", "FileLogHolder", "createFileLogHolder", "(", "TraceWriter", "oldLog", ",", "FileLogHeader", "logHeader", ",", "File", "logDirectory", ",", "String", "newFileName", ",", "int", "maxFiles", ",", "long", "maxSizeBytes", ")", "{", "return", "createFi...
This method will check to see if the supplied parameters match the settings on the <code>oldLog</code>, if they do then the <code>oldLog</code> is returned, otherwise a new FileLogHolder will be created. @param oldLog The previous FileLogHolder that may or may not be replaced by a new one, may be <code>null</code> (wi...
[ "This", "method", "will", "check", "to", "see", "if", "the", "supplied", "parameters", "match", "the", "settings", "on", "the", "<code", ">", "oldLog<", "/", "code", ">", "if", "they", "do", "then", "the", "<code", ">", "oldLog<", "/", "code", ">", "is...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/utils/FileLogHolder.java#L132-L136
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java
MessageRequest.withContext
public MessageRequest withContext(java.util.Map<String, String> context) { """ A map of custom attributes to attributes to be attached to the message. This payload is added to the push notification's 'data.pinpoint' object or added to the email/sms delivery receipt event attributes. @param context A map of cu...
java
public MessageRequest withContext(java.util.Map<String, String> context) { setContext(context); return this; }
[ "public", "MessageRequest", "withContext", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "context", ")", "{", "setContext", "(", "context", ")", ";", "return", "this", ";", "}" ]
A map of custom attributes to attributes to be attached to the message. This payload is added to the push notification's 'data.pinpoint' object or added to the email/sms delivery receipt event attributes. @param context A map of custom attributes to attributes to be attached to the message. This payload is added to th...
[ "A", "map", "of", "custom", "attributes", "to", "attributes", "to", "be", "attached", "to", "the", "message", ".", "This", "payload", "is", "added", "to", "the", "push", "notification", "s", "data", ".", "pinpoint", "object", "or", "added", "to", "the", ...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java#L146-L149
neo4j/neo4j-java-driver
driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java
DriverFactory.createSecurityPlanImpl
@SuppressWarnings( "deprecation" ) private static SecurityPlan createSecurityPlanImpl( BoltServerAddress address, Config config ) throws GeneralSecurityException, IOException { """ /* Establish a complete SecurityPlan based on the details provided for driver construction. """ if ( con...
java
@SuppressWarnings( "deprecation" ) private static SecurityPlan createSecurityPlanImpl( BoltServerAddress address, Config config ) throws GeneralSecurityException, IOException { if ( config.encrypted() ) { Logger logger = config.logging().getLog( "SecurityPlan" ); ...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "private", "static", "SecurityPlan", "createSecurityPlanImpl", "(", "BoltServerAddress", "address", ",", "Config", "config", ")", "throws", "GeneralSecurityException", ",", "IOException", "{", "if", "(", "config", ...
/* Establish a complete SecurityPlan based on the details provided for driver construction.
[ "/", "*", "Establish", "a", "complete", "SecurityPlan", "based", "on", "the", "details", "provided", "for", "driver", "construction", "." ]
train
https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java#L290-L327
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuModuleGetGlobal
public static int cuModuleGetGlobal(CUdeviceptr dptr, long bytes[], CUmodule hmod, String name) { """ Returns a global pointer from a module. <pre> CUresult cuModuleGetGlobal ( CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name ) </pre> <div> <p>Returns a global pointer from a module. Re...
java
public static int cuModuleGetGlobal(CUdeviceptr dptr, long bytes[], CUmodule hmod, String name) { return checkResult(cuModuleGetGlobalNative(dptr, bytes, hmod, name)); }
[ "public", "static", "int", "cuModuleGetGlobal", "(", "CUdeviceptr", "dptr", ",", "long", "bytes", "[", "]", ",", "CUmodule", "hmod", ",", "String", "name", ")", "{", "return", "checkResult", "(", "cuModuleGetGlobalNative", "(", "dptr", ",", "bytes", ",", "hm...
Returns a global pointer from a module. <pre> CUresult cuModuleGetGlobal ( CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name ) </pre> <div> <p>Returns a global pointer from a module. Returns in <tt>*dptr</tt> and <tt>*bytes</tt> the base pointer and size of the global of name <tt>name</tt> located in m...
[ "Returns", "a", "global", "pointer", "from", "a", "module", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L2636-L2639
phax/ph-schedule
ph-mini-quartz/src/main/java/com/helger/quartz/JobBuilder.java
JobBuilder.withIdentity
public JobBuilder withIdentity (final String name, final String group) { """ Use a <code>JobKey</code> with the given name and group to identify the JobDetail. <p> If none of the 'withIdentity' methods are set on the JobBuilder, then a random, unique JobKey will be generated. </p> @param name the name ele...
java
public JobBuilder withIdentity (final String name, final String group) { m_aKey = new JobKey (name, group); return this; }
[ "public", "JobBuilder", "withIdentity", "(", "final", "String", "name", ",", "final", "String", "group", ")", "{", "m_aKey", "=", "new", "JobKey", "(", "name", ",", "group", ")", ";", "return", "this", ";", "}" ]
Use a <code>JobKey</code> with the given name and group to identify the JobDetail. <p> If none of the 'withIdentity' methods are set on the JobBuilder, then a random, unique JobKey will be generated. </p> @param name the name element for the Job's JobKey @param group the group element for the Job's JobKey @return the ...
[ "Use", "a", "<code", ">", "JobKey<", "/", "code", ">", "with", "the", "given", "name", "and", "group", "to", "identify", "the", "JobDetail", ".", "<p", ">", "If", "none", "of", "the", "withIdentity", "methods", "are", "set", "on", "the", "JobBuilder", ...
train
https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/JobBuilder.java#L153-L157
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/OutputLayerUtil.java
OutputLayerUtil.validateOutputLayer
public static void validateOutputLayer(String layerName, Layer layer) { """ Validate the output layer (or loss layer) configuration, to detect invalid consfiugrations. A DL4JInvalidConfigException will be thrown for invalid configurations (like softmax + nOut=1).<br> If the specified layer is not an output lay...
java
public static void validateOutputLayer(String layerName, Layer layer){ IActivation activation; ILossFunction loss; long nOut; boolean isLossLayer = false; if (layer instanceof BaseOutputLayer && !(layer instanceof OCNNOutputLayer)) { activation = ((BaseOutputLayer) la...
[ "public", "static", "void", "validateOutputLayer", "(", "String", "layerName", ",", "Layer", "layer", ")", "{", "IActivation", "activation", ";", "ILossFunction", "loss", ";", "long", "nOut", ";", "boolean", "isLossLayer", "=", "false", ";", "if", "(", "layer"...
Validate the output layer (or loss layer) configuration, to detect invalid consfiugrations. A DL4JInvalidConfigException will be thrown for invalid configurations (like softmax + nOut=1).<br> If the specified layer is not an output layer, this is a no-op @param layerName Name of the layer @param layer Layer
[ "Validate", "the", "output", "layer", "(", "or", "loss", "layer", ")", "configuration", "to", "detect", "invalid", "consfiugrations", ".", "A", "DL4JInvalidConfigException", "will", "be", "thrown", "for", "invalid", "configurations", "(", "like", "softmax", "+", ...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/OutputLayerUtil.java#L74-L103
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java
CommandUtil.associateCommand
public static void associateCommand(String commandName, BaseUIComponent component) { """ Associates a UI component with a command. @param commandName Name of the command. @param component Component to be associated. """ associateCommand(commandName, component, (BaseUIComponent) null); }
java
public static void associateCommand(String commandName, BaseUIComponent component) { associateCommand(commandName, component, (BaseUIComponent) null); }
[ "public", "static", "void", "associateCommand", "(", "String", "commandName", ",", "BaseUIComponent", "component", ")", "{", "associateCommand", "(", "commandName", ",", "component", ",", "(", "BaseUIComponent", ")", "null", ")", ";", "}" ]
Associates a UI component with a command. @param commandName Name of the command. @param component Component to be associated.
[ "Associates", "a", "UI", "component", "with", "a", "command", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java#L176-L178
JRebirth/JRebirth
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java
ClassUtility.getLastClassAnnotation
public static <A extends Annotation> A getLastClassAnnotation(final Class<?> sourceClass, final Class<A> annotationClass) { """ Extract the last annotation requested found into the class hierarchy.<br /> Interfaces are not yet supported. @param sourceClass the class (wit its parent classes) to inspect @param ...
java
public static <A extends Annotation> A getLastClassAnnotation(final Class<?> sourceClass, final Class<A> annotationClass) { A annotation = null; Class<?> currentClass = sourceClass; while (annotation == null && currentClass != null) { annotation = currentClass.getAnnotation(annotatio...
[ "public", "static", "<", "A", "extends", "Annotation", ">", "A", "getLastClassAnnotation", "(", "final", "Class", "<", "?", ">", "sourceClass", ",", "final", "Class", "<", "A", ">", "annotationClass", ")", "{", "A", "annotation", "=", "null", ";", "Class",...
Extract the last annotation requested found into the class hierarchy.<br /> Interfaces are not yet supported. @param sourceClass the class (wit its parent classes) to inspect @param annotationClass the annotation to find @param <A> the type of the requested annotation @return the request annotation or null if none h...
[ "Extract", "the", "last", "annotation", "requested", "found", "into", "the", "class", "hierarchy", ".", "<br", "/", ">", "Interfaces", "are", "not", "yet", "supported", "." ]
train
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L399-L407
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java
RecurrenceIteratorFactory.join
public static RecurrenceIterator join(RecurrenceIterator first, RecurrenceIterator... rest) { """ Generates a recurrence iterator that iterates over the union of the given recurrence iterators. @param first the first recurrence iterator @param rest the other recurrence iterators @return the union iterator ...
java
public static RecurrenceIterator join(RecurrenceIterator first, RecurrenceIterator... rest) { List<RecurrenceIterator> all = new ArrayList<RecurrenceIterator>(); all.add(first); all.addAll(Arrays.asList(rest)); return new CompoundIteratorImpl(all, Collections.<RecurrenceIterator> emptyList()); }
[ "public", "static", "RecurrenceIterator", "join", "(", "RecurrenceIterator", "first", ",", "RecurrenceIterator", "...", "rest", ")", "{", "List", "<", "RecurrenceIterator", ">", "all", "=", "new", "ArrayList", "<", "RecurrenceIterator", ">", "(", ")", ";", "all"...
Generates a recurrence iterator that iterates over the union of the given recurrence iterators. @param first the first recurrence iterator @param rest the other recurrence iterators @return the union iterator
[ "Generates", "a", "recurrence", "iterator", "that", "iterates", "over", "the", "union", "of", "the", "given", "recurrence", "iterators", "." ]
train
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java#L461-L466
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java
Whitebox.setInternalState
public static void setInternalState(Object object, String fieldName, Object value, Class<?> where) { """ Set the value of a field using reflection. Use this method when you need to specify in which class the field is declared. This might be useful when you have mocked the instance you are trying to modify. @p...
java
public static void setInternalState(Object object, String fieldName, Object value, Class<?> where) { WhiteboxImpl.setInternalState(object, fieldName, value, where); }
[ "public", "static", "void", "setInternalState", "(", "Object", "object", ",", "String", "fieldName", ",", "Object", "value", ",", "Class", "<", "?", ">", "where", ")", "{", "WhiteboxImpl", ".", "setInternalState", "(", "object", ",", "fieldName", ",", "value...
Set the value of a field using reflection. Use this method when you need to specify in which class the field is declared. This might be useful when you have mocked the instance you are trying to modify. @param object the object to modify @param fieldName the name of the field @param value the new value of the field @p...
[ "Set", "the", "value", "of", "a", "field", "using", "reflection", ".", "Use", "this", "method", "when", "you", "need", "to", "specify", "in", "which", "class", "the", "field", "is", "declared", ".", "This", "might", "be", "useful", "when", "you", "have",...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L240-L242
infinispan/infinispan
server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheContainerRemoveHandler.java
CacheContainerRemoveHandler.recoverServices
@Override protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { """ Method to re-install any services associated with existing local caches. @param context @param operation @param model @throws OperationFailedException """ ...
java
@Override protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { PathAddress address = context.getCurrentAddress(); // re-install the cache container services CacheContainerAddHandler.installRuntimeServices(context, ...
[ "@", "Override", "protected", "void", "recoverServices", "(", "OperationContext", "context", ",", "ModelNode", "operation", ",", "ModelNode", "model", ")", "throws", "OperationFailedException", "{", "PathAddress", "address", "=", "context", ".", "getCurrentAddress", "...
Method to re-install any services associated with existing local caches. @param context @param operation @param model @throws OperationFailedException
[ "Method", "to", "re", "-", "install", "any", "services", "associated", "with", "existing", "local", "caches", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheContainerRemoveHandler.java#L67-L85
knowm/Yank
src/main/java/org/knowm/yank/Yank.java
Yank.queryScalarSQLKey
public static <T> T queryScalarSQLKey( String poolName, String sqlKey, Class<T> scalarType, Object[] params) throws SQLStatementNotFoundException, YankSQLException { """ Return just one scalar given a SQL Key using an SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQL...
java
public static <T> T queryScalarSQLKey( String poolName, String sqlKey, Class<T> scalarType, Object[] params) throws SQLStatementNotFoundException, YankSQLException { String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey); if (sql == null || sql.equalsIgnoreCase("")) { thr...
[ "public", "static", "<", "T", ">", "T", "queryScalarSQLKey", "(", "String", "poolName", ",", "String", "sqlKey", ",", "Class", "<", "T", ">", "scalarType", ",", "Object", "[", "]", "params", ")", "throws", "SQLStatementNotFoundException", ",", "YankSQLExceptio...
Return just one scalar given a SQL Key using an SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...). If more than one row match the query, only the first row is returned. @param poolName The name of the connection pool to query against @param sqlKey The SQL Key found in ...
[ "Return", "just", "one", "scalar", "given", "a", "SQL", "Key", "using", "an", "SQL", "statement", "matching", "the", "sqlKey", "String", "in", "a", "properties", "file", "loaded", "via", "Yank", ".", "addSQLStatements", "(", "...", ")", ".", "If", "more", ...
train
https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L253-L263
junit-team/junit4
src/main/java/org/junit/runners/ParentRunner.java
ParentRunner.withClassRules
private Statement withClassRules(Statement statement) { """ Returns a {@link Statement}: apply all static fields assignable to {@link TestRule} annotated with {@link ClassRule}. @param statement the base statement @return a RunRules statement if any class-level {@link Rule}s are found, or the base statement...
java
private Statement withClassRules(Statement statement) { List<TestRule> classRules = classRules(); return classRules.isEmpty() ? statement : new RunRules(statement, classRules, getDescription()); }
[ "private", "Statement", "withClassRules", "(", "Statement", "statement", ")", "{", "List", "<", "TestRule", ">", "classRules", "=", "classRules", "(", ")", ";", "return", "classRules", ".", "isEmpty", "(", ")", "?", "statement", ":", "new", "RunRules", "(", ...
Returns a {@link Statement}: apply all static fields assignable to {@link TestRule} annotated with {@link ClassRule}. @param statement the base statement @return a RunRules statement if any class-level {@link Rule}s are found, or the base statement
[ "Returns", "a", "{", "@link", "Statement", "}", ":", "apply", "all", "static", "fields", "assignable", "to", "{", "@link", "TestRule", "}", "annotated", "with", "{", "@link", "ClassRule", "}", "." ]
train
https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/ParentRunner.java#L266-L270
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java
CommandGroup.createButtonBar
public JComponent createButtonBar(final ColumnSpec columnSpec, final RowSpec rowSpec, final Border border) { """ Create a button bar with buttons for all the commands in this. @param columnSpec Custom columnSpec for each column containing a button, can be <code>null</code>. @param rowSpec Custom rowspec for t...
java
public JComponent createButtonBar(final ColumnSpec columnSpec, final RowSpec rowSpec, final Border border) { final ButtonBarGroupContainerPopulator container = new ButtonBarGroupContainerPopulator(); container.setColumnSpec(columnSpec); container.setRowSpec(rowSpec); addCommandsToGroupContainer(container); re...
[ "public", "JComponent", "createButtonBar", "(", "final", "ColumnSpec", "columnSpec", ",", "final", "RowSpec", "rowSpec", ",", "final", "Border", "border", ")", "{", "final", "ButtonBarGroupContainerPopulator", "container", "=", "new", "ButtonBarGroupContainerPopulator", ...
Create a button bar with buttons for all the commands in this. @param columnSpec Custom columnSpec for each column containing a button, can be <code>null</code>. @param rowSpec Custom rowspec for the buttonbar, can be <code>null</code>. @param border if null, then don't use a border @return never null
[ "Create", "a", "button", "bar", "with", "buttons", "for", "all", "the", "commands", "in", "this", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L472-L478
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/GroupChainGenerator.java
GroupChainGenerator.insertInheritedGroups
private void insertInheritedGroups(final Class<?> clazz, final GroupChain chain) { """ Recursively add inherited groups into the group chain. @param clazz The group interface @param chain The group chain we are currently building. """ validationGroupsMetadata.getParentsOfGroup(clazz).forEach(inheritedG...
java
private void insertInheritedGroups(final Class<?> clazz, final GroupChain chain) { validationGroupsMetadata.getParentsOfGroup(clazz).forEach(inheritedGroup -> { final Group group = new Group(inheritedGroup); chain.insertGroup(group); insertInheritedGroups(inheritedGroup, chain); }); }
[ "private", "void", "insertInheritedGroups", "(", "final", "Class", "<", "?", ">", "clazz", ",", "final", "GroupChain", "chain", ")", "{", "validationGroupsMetadata", ".", "getParentsOfGroup", "(", "clazz", ")", ".", "forEach", "(", "inheritedGroup", "->", "{", ...
Recursively add inherited groups into the group chain. @param clazz The group interface @param chain The group chain we are currently building.
[ "Recursively", "add", "inherited", "groups", "into", "the", "group", "chain", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/GroupChainGenerator.java#L128-L134
Netflix/ribbon
ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java
ClientFactory.registerNamedLoadBalancerFromclientConfig
public static ILoadBalancer registerNamedLoadBalancerFromclientConfig(String name, IClientConfig clientConfig) throws ClientException { """ Create and register a load balancer with the name and given the class of configClass. @throws ClientException if load balancer with the same name already exists or any erro...
java
public static ILoadBalancer registerNamedLoadBalancerFromclientConfig(String name, IClientConfig clientConfig) throws ClientException { if (namedLBMap.get(name) != null) { throw new ClientException("LoadBalancer for name " + name + " already exists"); } ILoadBalancer lb = null; ...
[ "public", "static", "ILoadBalancer", "registerNamedLoadBalancerFromclientConfig", "(", "String", "name", ",", "IClientConfig", "clientConfig", ")", "throws", "ClientException", "{", "if", "(", "namedLBMap", ".", "get", "(", "name", ")", "!=", "null", ")", "{", "th...
Create and register a load balancer with the name and given the class of configClass. @throws ClientException if load balancer with the same name already exists or any error occurs @see #instantiateInstanceWithClientConfig(String, IClientConfig)
[ "Create", "and", "register", "a", "load", "balancer", "with", "the", "name", "and", "given", "the", "class", "of", "configClass", "." ]
train
https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java#L178-L192
wcm-io/wcm-io-handler
url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java
SuffixParser.getResource
public @Nullable Resource getResource(@NotNull Predicate<Resource> filter) { """ Parse the suffix as resource paths, return the first resource from the suffix (relativ to the current page's content) that matches the given filter. @param filter a filter that selects only the resource you're interested in. @retur...
java
public @Nullable Resource getResource(@NotNull Predicate<Resource> filter) { return getResource(filter, (Resource)null); }
[ "public", "@", "Nullable", "Resource", "getResource", "(", "@", "NotNull", "Predicate", "<", "Resource", ">", "filter", ")", "{", "return", "getResource", "(", "filter", ",", "(", "Resource", ")", "null", ")", ";", "}" ]
Parse the suffix as resource paths, return the first resource from the suffix (relativ to the current page's content) that matches the given filter. @param filter a filter that selects only the resource you're interested in. @return the resource or null if no such resource was selected by suffix
[ "Parse", "the", "suffix", "as", "resource", "paths", "return", "the", "first", "resource", "from", "the", "suffix", "(", "relativ", "to", "the", "current", "page", "s", "content", ")", "that", "matches", "the", "given", "filter", "." ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L208-L210
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java
AbstractAsymmetricCrypto.encrypt
public byte[] encrypt(String data, KeyType keyType) { """ 加密,使用UTF-8编码 @param data 被加密的字符串 @param keyType 私钥或公钥 {@link KeyType} @return 加密后的bytes """ return encrypt(StrUtil.bytes(data, CharsetUtil.CHARSET_UTF_8), keyType); }
java
public byte[] encrypt(String data, KeyType keyType) { return encrypt(StrUtil.bytes(data, CharsetUtil.CHARSET_UTF_8), keyType); }
[ "public", "byte", "[", "]", "encrypt", "(", "String", "data", ",", "KeyType", "keyType", ")", "{", "return", "encrypt", "(", "StrUtil", ".", "bytes", "(", "data", ",", "CharsetUtil", ".", "CHARSET_UTF_8", ")", ",", "keyType", ")", ";", "}" ]
加密,使用UTF-8编码 @param data 被加密的字符串 @param keyType 私钥或公钥 {@link KeyType} @return 加密后的bytes
[ "加密,使用UTF", "-", "8编码" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L100-L102
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/preview/CmsFocalPointController.java
CmsFocalPointController.updateImage
public void updateImage(FlowPanel container, Image previewImage) { """ Updates the image.<p> @param container the parent widget for the image @param previewImage the image """ if (!ENABLED) { return; } String path = m_imageInfoProvider.get().getResourcePath(); i...
java
public void updateImage(FlowPanel container, Image previewImage) { if (!ENABLED) { return; } String path = m_imageInfoProvider.get().getResourcePath(); if (CmsClientStringUtil.checkIsPathOrLinkToSvg(path)) { return; } m_image = previewImage; ...
[ "public", "void", "updateImage", "(", "FlowPanel", "container", ",", "Image", "previewImage", ")", "{", "if", "(", "!", "ENABLED", ")", "{", "return", ";", "}", "String", "path", "=", "m_imageInfoProvider", ".", "get", "(", ")", ".", "getResourcePath", "("...
Updates the image.<p> @param container the parent widget for the image @param previewImage the image
[ "Updates", "the", "image", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsFocalPointController.java#L224-L249
sebastiangraf/jSCSI
bundles/target/src/main/java/org/jscsi/target/settings/SettingsNegotiator.java
SettingsNegotiator.getEntry
static final Entry getEntry (final String key, final Collection<Entry> entries) { """ Returns the first {@link Entry} in the specified {@link Collection} for which {@link Entry#matchKey(String)} returns <code>true</code>. @param key the key String identifying the {@link Entry} @param entries a {@link Collecti...
java
static final Entry getEntry (final String key, final Collection<Entry> entries) { for (Entry e : entries) if (e.matchKey(key)) return e; return null; }
[ "static", "final", "Entry", "getEntry", "(", "final", "String", "key", ",", "final", "Collection", "<", "Entry", ">", "entries", ")", "{", "for", "(", "Entry", "e", ":", "entries", ")", "if", "(", "e", ".", "matchKey", "(", "key", ")", ")", "return",...
Returns the first {@link Entry} in the specified {@link Collection} for which {@link Entry#matchKey(String)} returns <code>true</code>. @param key the key String identifying the {@link Entry} @param entries a {@link Collection} of {@link Entry} objects. @return a matching {@link Entry} or null, if no such {@link Entry...
[ "Returns", "the", "first", "{", "@link", "Entry", "}", "in", "the", "specified", "{", "@link", "Collection", "}", "for", "which", "{", "@link", "Entry#matchKey", "(", "String", ")", "}", "returns", "<code", ">", "true<", "/", "code", ">", "." ]
train
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/settings/SettingsNegotiator.java#L43-L47
zaproxy/zaproxy
src/org/zaproxy/zap/extension/script/ExtensionScript.java
ExtensionScript.getScriptCount
public int getScriptCount(File dir) { """ Gets the numbers of scripts for the given directory for the currently registered script engines and types. @param dir the directory to check. @return the number of scripts. @since 2.4.1 """ int scripts = 0; for (ScriptType type : this.getScriptTypes()) {...
java
public int getScriptCount(File dir) { int scripts = 0; for (ScriptType type : this.getScriptTypes()) { File locDir = new File(dir, type.getName()); if (locDir.exists()) { for (File f : locDir.listFiles()) { String ext = f.getName().substring(f.getName().lastIndexOf(".") + 1); String e...
[ "public", "int", "getScriptCount", "(", "File", "dir", ")", "{", "int", "scripts", "=", "0", ";", "for", "(", "ScriptType", "type", ":", "this", ".", "getScriptTypes", "(", ")", ")", "{", "File", "locDir", "=", "new", "File", "(", "dir", ",", "type",...
Gets the numbers of scripts for the given directory for the currently registered script engines and types. @param dir the directory to check. @return the number of scripts. @since 2.4.1
[ "Gets", "the", "numbers", "of", "scripts", "for", "the", "given", "directory", "for", "the", "currently", "registered", "script", "engines", "and", "types", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L983-L999
tvesalainen/bcc
src/main/java/org/vesalainen/bcc/SubClass.java
SubClass.resolveFieldIndex
private int resolveFieldIndex(TypeElement declaringClass, String name, String descriptor) { """ Returns the constant map index to field If entry doesn't exist it is created. @param declaringClass @param name @param descriptor @return """ int size = 0; int index = 0; constantRead...
java
private int resolveFieldIndex(TypeElement declaringClass, String name, String descriptor) { int size = 0; int index = 0; constantReadLock.lock(); try { size = getConstantPoolSize(); index = getRefIndex(Fieldref.class, declaringClass.getQualifie...
[ "private", "int", "resolveFieldIndex", "(", "TypeElement", "declaringClass", ",", "String", "name", ",", "String", "descriptor", ")", "{", "int", "size", "=", "0", ";", "int", "index", "=", "0", ";", "constantReadLock", ".", "lock", "(", ")", ";", "try", ...
Returns the constant map index to field If entry doesn't exist it is created. @param declaringClass @param name @param descriptor @return
[ "Returns", "the", "constant", "map", "index", "to", "field", "If", "entry", "doesn", "t", "exist", "it", "is", "created", "." ]
train
https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/SubClass.java#L195-L217
maddingo/sojo
src/main/java/net/sf/sojo/core/reflect/Property.java
Property.executeSetValue
public void executeSetValue(Object pvObject, Object pvArgs) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { """ Call the setter Method or set value from Field. @param pvObject Object, on which the value is set @param pvArgs the set value """ AccessController.doPrivil...
java
public void executeSetValue(Object pvObject, Object pvArgs) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { AccessController.doPrivileged(new AccessiblePrivilegedAction(accessibleObject)); if (propertyType == PROPERTY_TYPE_METHOD) { ((Method) accessibleObject).invoke(pvObj...
[ "public", "void", "executeSetValue", "(", "Object", "pvObject", ",", "Object", "pvArgs", ")", "throws", "IllegalArgumentException", ",", "IllegalAccessException", ",", "InvocationTargetException", "{", "AccessController", ".", "doPrivileged", "(", "new", "AccessiblePrivil...
Call the setter Method or set value from Field. @param pvObject Object, on which the value is set @param pvArgs the set value
[ "Call", "the", "setter", "Method", "or", "set", "value", "from", "Field", "." ]
train
https://github.com/maddingo/sojo/blob/99e9e0a146b502deb7f507fe0623227402ed675b/src/main/java/net/sf/sojo/core/reflect/Property.java#L58-L65
BotMill/fb-botmill
src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java
TextMessageBuilder.build
public FbBotMillResponse build(MessageEnvelope envelope) { """ {@inheritDoc} Returns a response containing a plain text message. """ User recipient = getRecipient(envelope); Message message = new TextMessage(messageText); message.setQuickReplies(quickReplies); return new FbBotMillMessageResponse(recipi...
java
public FbBotMillResponse build(MessageEnvelope envelope) { User recipient = getRecipient(envelope); Message message = new TextMessage(messageText); message.setQuickReplies(quickReplies); return new FbBotMillMessageResponse(recipient, message); }
[ "public", "FbBotMillResponse", "build", "(", "MessageEnvelope", "envelope", ")", "{", "User", "recipient", "=", "getRecipient", "(", "envelope", ")", ";", "Message", "message", "=", "new", "TextMessage", "(", "messageText", ")", ";", "message", ".", "setQuickRep...
{@inheritDoc} Returns a response containing a plain text message.
[ "{" ]
train
https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java#L142-L147
jbundle/jbundle
base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java
ToolScreen.getNextLocation
public ScreenLocation getNextLocation(short position, short setNewAnchor) { """ Code this position and Anchor to add it to the LayoutManager. @param position The location constant (see ScreenConstants). @param setNewAnchor The anchor constant. @return The new screen location object. """ if (position...
java
public ScreenLocation getNextLocation(short position, short setNewAnchor) { if (position == ScreenConstants.FIRST_LOCATION) position = ScreenConstants.FIRST_FIELD_BUTTON_LOCATION; if (position == ScreenConstants.NEXT_LOGICAL) position = ScreenConstants.RIGHT_OF_LAST_BUTTON; ...
[ "public", "ScreenLocation", "getNextLocation", "(", "short", "position", ",", "short", "setNewAnchor", ")", "{", "if", "(", "position", "==", "ScreenConstants", ".", "FIRST_LOCATION", ")", "position", "=", "ScreenConstants", ".", "FIRST_FIELD_BUTTON_LOCATION", ";", ...
Code this position and Anchor to add it to the LayoutManager. @param position The location constant (see ScreenConstants). @param setNewAnchor The anchor constant. @return The new screen location object.
[ "Code", "this", "position", "and", "Anchor", "to", "add", "it", "to", "the", "LayoutManager", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java#L99-L106
joniles/mpxj
src/main/java/net/sf/mpxj/Task.java
Task.selectField
private TaskField selectField(TaskField[] fields, int index) { """ Maps a field index to a TaskField instance. @param fields array of fields used as the basis for the mapping. @param index required field index @return TaskField instance """ if (index < 1 || index > fields.length) { th...
java
private TaskField selectField(TaskField[] fields, int index) { if (index < 1 || index > fields.length) { throw new IllegalArgumentException(index + " is not a valid field index"); } return (fields[index - 1]); }
[ "private", "TaskField", "selectField", "(", "TaskField", "[", "]", "fields", ",", "int", "index", ")", "{", "if", "(", "index", "<", "1", "||", "index", ">", "fields", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "index", "+"...
Maps a field index to a TaskField instance. @param fields array of fields used as the basis for the mapping. @param index required field index @return TaskField instance
[ "Maps", "a", "field", "index", "to", "a", "TaskField", "instance", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4670-L4677
knowm/XChange
xchange-bitcoinium/src/main/java/org/knowm/xchange/bitcoinium/BitcoiniumAdapters.java
BitcoiniumAdapters.adaptOrderbook
public static OrderBook adaptOrderbook( BitcoiniumOrderbook bitcoiniumOrderbook, CurrencyPair currencyPair) { """ Adapts a BitcoiniumOrderbook to a OrderBook Object @param bitcoiniumOrderbook @return the XChange OrderBook """ List<LimitOrder> asks = createOrders(currencyPair, Order.Order...
java
public static OrderBook adaptOrderbook( BitcoiniumOrderbook bitcoiniumOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = createOrders(currencyPair, Order.OrderType.ASK, bitcoiniumOrderbook.getAsks()); List<LimitOrder> bids = createOrders(currencyPair, Order.OrderType.BID, bit...
[ "public", "static", "OrderBook", "adaptOrderbook", "(", "BitcoiniumOrderbook", "bitcoiniumOrderbook", ",", "CurrencyPair", "currencyPair", ")", "{", "List", "<", "LimitOrder", ">", "asks", "=", "createOrders", "(", "currencyPair", ",", "Order", ".", "OrderType", "."...
Adapts a BitcoiniumOrderbook to a OrderBook Object @param bitcoiniumOrderbook @return the XChange OrderBook
[ "Adapts", "a", "BitcoiniumOrderbook", "to", "a", "OrderBook", "Object" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitcoinium/src/main/java/org/knowm/xchange/bitcoinium/BitcoiniumAdapters.java#L54-L67
beangle/beangle3
commons/core/src/main/java/org/beangle/commons/text/inflector/RuleBasedPluralizer.java
RuleBasedPluralizer.postProcess
protected String postProcess(String trimmedWord, String pluralizedWord) { """ <p> Apply processing to <code>pluralizedWord</code>. This implementation ensures the case of the plural is consistent with the case of the input word. </p> <p> If <code>trimmedWord</code> is all uppercase, then <code>pluralizedWord<...
java
protected String postProcess(String trimmedWord, String pluralizedWord) { if (pluPattern1.matcher(trimmedWord).matches()) { return pluralizedWord.toUpperCase(locale); } else if (pluPattern2.matcher(trimmedWord).matches()) { return pluralizedWord.substring(0, 1) .toUpperCase(locale) + pluralizedWor...
[ "protected", "String", "postProcess", "(", "String", "trimmedWord", ",", "String", "pluralizedWord", ")", "{", "if", "(", "pluPattern1", ".", "matcher", "(", "trimmedWord", ")", ".", "matches", "(", ")", ")", "{", "return", "pluralizedWord", ".", "toUpperCase"...
<p> Apply processing to <code>pluralizedWord</code>. This implementation ensures the case of the plural is consistent with the case of the input word. </p> <p> If <code>trimmedWord</code> is all uppercase, then <code>pluralizedWord</code> is uppercased. If <code>trimmedWord</code> is titlecase, then <code>pluralizedWor...
[ "<p", ">", "Apply", "processing", "to", "<code", ">", "pluralizedWord<", "/", "code", ">", ".", "This", "implementation", "ensures", "the", "case", "of", "the", "plural", "is", "consistent", "with", "the", "case", "of", "the", "input", "word", ".", "<", ...
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/text/inflector/RuleBasedPluralizer.java#L241-L247
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java
LongExtensions.operator_modulo
@Pure @Inline(value="($1 % $2)", constantExpression=true) public static double operator_modulo(long a, double b) { """ The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator. @param a a long. @param b a double. @return <code>a%b</code> @since 2.3 """ r...
java
@Pure @Inline(value="($1 % $2)", constantExpression=true) public static double operator_modulo(long a, double b) { return a % b; }
[ "@", "Pure", "@", "Inline", "(", "value", "=", "\"($1 % $2)\"", ",", "constantExpression", "=", "true", ")", "public", "static", "double", "operator_modulo", "(", "long", "a", ",", "double", "b", ")", "{", "return", "a", "%", "b", ";", "}" ]
The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator. @param a a long. @param b a double. @return <code>a%b</code> @since 2.3
[ "The", "binary", "<code", ">", "modulo<", "/", "code", ">", "operator", ".", "This", "is", "the", "equivalent", "to", "the", "Java", "<code", ">", "%<", "/", "code", ">", "operator", "." ]
train
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java#L306-L310
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java
BaseApplet.popBrowserHistory
public void popBrowserHistory(int quanityToPop, boolean bCommandHandledByJava, String browserTitle) { """ Pop commands off the browser stack. @param quanityToPop The number of commands to pop off the stack @param bCommandHandledByJava If I say false, the browser will do a 'back', otherwise, it just pops to top c...
java
public void popBrowserHistory(int quanityToPop, boolean bCommandHandledByJava, String browserTitle) { if (this.getBrowserManager() != null) this.getBrowserManager().popBrowserHistory(quanityToPop, bCommandHandledByJava, this.getStatusText(Constants.INFORMATION)); // Let browser know about...
[ "public", "void", "popBrowserHistory", "(", "int", "quanityToPop", ",", "boolean", "bCommandHandledByJava", ",", "String", "browserTitle", ")", "{", "if", "(", "this", ".", "getBrowserManager", "(", ")", "!=", "null", ")", "this", ".", "getBrowserManager", "(", ...
Pop commands off the browser stack. @param quanityToPop The number of commands to pop off the stack @param bCommandHandledByJava If I say false, the browser will do a 'back', otherwise, it just pops to top command(s)
[ "Pop", "commands", "off", "the", "browser", "stack", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L1279-L1283
haifengl/smile
math/src/main/java/smile/math/Math.java
Math.KullbackLeiblerDivergence
public static double KullbackLeiblerDivergence(double[] x, double[] y) { """ Kullback-Leibler divergence. The Kullback-Leibler divergence (also information divergence, information gain, relative entropy, or KLIC) is a non-symmetric measure of the difference between two probability distributions P and Q. KL meas...
java
public static double KullbackLeiblerDivergence(double[] x, double[] y) { boolean intersection = false; double kl = 0.0; for (int i = 0; i < x.length; i++) { if (x[i] != 0.0 && y[i] != 0.0) { intersection = true; kl += x[i] * Math.log(x[i] / y[i]); ...
[ "public", "static", "double", "KullbackLeiblerDivergence", "(", "double", "[", "]", "x", ",", "double", "[", "]", "y", ")", "{", "boolean", "intersection", "=", "false", ";", "double", "kl", "=", "0.0", ";", "for", "(", "int", "i", "=", "0", ";", "i"...
Kullback-Leibler divergence. The Kullback-Leibler divergence (also information divergence, information gain, relative entropy, or KLIC) is a non-symmetric measure of the difference between two probability distributions P and Q. KL measures the expected number of extra bits required to code samples from P when using a c...
[ "Kullback", "-", "Leibler", "divergence", ".", "The", "Kullback", "-", "Leibler", "divergence", "(", "also", "information", "divergence", "information", "gain", "relative", "entropy", "or", "KLIC", ")", "is", "a", "non", "-", "symmetric", "measure", "of", "the...
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L2255-L2271
aws/aws-sdk-java
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/DomainEntry.java
DomainEntry.setOptions
@Deprecated public void setOptions(java.util.Map<String, String> options) { """ <p> (Deprecated) The options for the domain entry. </p> <note> <p> In releases prior to November 29, 2017, this parameter was not included in the API response. It is now deprecated. </p> </note> @param options (Deprecat...
java
@Deprecated public void setOptions(java.util.Map<String, String> options) { this.options = options; }
[ "@", "Deprecated", "public", "void", "setOptions", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "options", ")", "{", "this", ".", "options", "=", "options", ";", "}" ]
<p> (Deprecated) The options for the domain entry. </p> <note> <p> In releases prior to November 29, 2017, this parameter was not included in the API response. It is now deprecated. </p> </note> @param options (Deprecated) The options for the domain entry.</p> <note> <p> In releases prior to November 29, 2017, this pa...
[ "<p", ">", "(", "Deprecated", ")", "The", "options", "for", "the", "domain", "entry", ".", "<", "/", "p", ">", "<note", ">", "<p", ">", "In", "releases", "prior", "to", "November", "29", "2017", "this", "parameter", "was", "not", "included", "in", "t...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/DomainEntry.java#L661-L664
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java
CassandraSchemaMgr.getKeyspaces
public Collection<String> getKeyspaces(DBConn dbConn) { """ Get a list of all known keyspaces. This method can be used with any DB connection. @param dbConn Database connection to use. @return List of all known keyspaces, empty if none. """ List<String> result = new ArrayList<>(); ...
java
public Collection<String> getKeyspaces(DBConn dbConn) { List<String> result = new ArrayList<>(); try { for (KsDef ksDef : dbConn.getClientSession().describe_keyspaces()) { result.add(ksDef.getName()); } } catch (Exception e) { String err...
[ "public", "Collection", "<", "String", ">", "getKeyspaces", "(", "DBConn", "dbConn", ")", "{", "List", "<", "String", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "for", "(", "KsDef", "ksDef", ":", "dbConn", ".", "getClientS...
Get a list of all known keyspaces. This method can be used with any DB connection. @param dbConn Database connection to use. @return List of all known keyspaces, empty if none.
[ "Get", "a", "list", "of", "all", "known", "keyspaces", ".", "This", "method", "can", "be", "used", "with", "any", "DB", "connection", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java#L58-L70
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageHelper.java
ImageHelper.getScaledInstance
public static BufferedImage getScaledInstance(BufferedImage image, int targetWidth, int targetHeight) { """ Convenience method that returns a scaled instance of the provided {@code BufferedImage}. @param image the original image to be scaled @param targetWidth the desired width of the scaled instance, in pixe...
java
public static BufferedImage getScaledInstance(BufferedImage image, int targetWidth, int targetHeight) { int type = (image.getTransparency() == Transparency.OPAQUE) ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB; BufferedImage tmp = new BufferedImage(targetWidth, targetHeig...
[ "public", "static", "BufferedImage", "getScaledInstance", "(", "BufferedImage", "image", ",", "int", "targetWidth", ",", "int", "targetHeight", ")", "{", "int", "type", "=", "(", "image", ".", "getTransparency", "(", ")", "==", "Transparency", ".", "OPAQUE", "...
Convenience method that returns a scaled instance of the provided {@code BufferedImage}. @param image the original image to be scaled @param targetWidth the desired width of the scaled instance, in pixels @param targetHeight the desired height of the scaled instance, in pixels @return a scaled version of the original ...
[ "Convenience", "method", "that", "returns", "a", "scaled", "instance", "of", "the", "provided", "{", "@code", "BufferedImage", "}", "." ]
train
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L39-L48
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java
GridRowSet.getCellPolygon
private Polygon getCellPolygon() { """ Compute the polygon corresponding to the cell @return Polygon of the cell """ final Coordinate[] summits = new Coordinate[5]; double x1 = minX + cellI * deltaX; double y1 = minY + cellJ * deltaY; double x2 = minX + (cellI + 1) * deltaX; ...
java
private Polygon getCellPolygon() { final Coordinate[] summits = new Coordinate[5]; double x1 = minX + cellI * deltaX; double y1 = minY + cellJ * deltaY; double x2 = minX + (cellI + 1) * deltaX; double y2 = minY + (cellJ + 1) * deltaY; summits[0] = new Coordinate(x1, y1); ...
[ "private", "Polygon", "getCellPolygon", "(", ")", "{", "final", "Coordinate", "[", "]", "summits", "=", "new", "Coordinate", "[", "5", "]", ";", "double", "x1", "=", "minX", "+", "cellI", "*", "deltaX", ";", "double", "y1", "=", "minY", "+", "cellJ", ...
Compute the polygon corresponding to the cell @return Polygon of the cell
[ "Compute", "the", "polygon", "corresponding", "to", "the", "cell" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java#L143-L158
Bearded-Hen/Android-Bootstrap
AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java
AwesomeTextView.setIcon
public void setIcon(CharSequence iconCode, IconSet iconSet) { """ Sets the text to display a FontIcon, replacing whatever text is already present. Used to set the text to display a FontAwesome Icon. @param iconSet - An implementation of FontIcon """ setBootstrapText(new BootstrapText.Builder(getCon...
java
public void setIcon(CharSequence iconCode, IconSet iconSet) { setBootstrapText(new BootstrapText.Builder(getContext(), isInEditMode()).addIcon(iconCode, iconSet).build()); }
[ "public", "void", "setIcon", "(", "CharSequence", "iconCode", ",", "IconSet", "iconSet", ")", "{", "setBootstrapText", "(", "new", "BootstrapText", ".", "Builder", "(", "getContext", "(", ")", ",", "isInEditMode", "(", ")", ")", ".", "addIcon", "(", "iconCod...
Sets the text to display a FontIcon, replacing whatever text is already present. Used to set the text to display a FontAwesome Icon. @param iconSet - An implementation of FontIcon
[ "Sets", "the", "text", "to", "display", "a", "FontIcon", "replacing", "whatever", "text", "is", "already", "present", ".", "Used", "to", "set", "the", "text", "to", "display", "a", "FontAwesome", "Icon", "." ]
train
https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java#L212-L214
mgormley/pacaya
src/main/java/edu/jhu/pacaya/util/Threads.java
Threads.initDefaultPool
public static void initDefaultPool(int numThreads, boolean isDaemon) { """ Initializes the default thread pool and adds a shutdown hook which will attempt to shutdown the thread pool on a call to System.exit(). If numThreads > 1 and isDaemon = true, then System.exit() or Threads.shutdownDefaultPool() must be ...
java
public static void initDefaultPool(int numThreads, boolean isDaemon) { if (numThreads == 1) { Threads.defaultPool = MoreExecutors.newDirectExecutorService(); Threads.numThreads = 1; } else { log.info("Initialized default thread pool to {} threads. (This must be closed...
[ "public", "static", "void", "initDefaultPool", "(", "int", "numThreads", ",", "boolean", "isDaemon", ")", "{", "if", "(", "numThreads", "==", "1", ")", "{", "Threads", ".", "defaultPool", "=", "MoreExecutors", ".", "newDirectExecutorService", "(", ")", ";", ...
Initializes the default thread pool and adds a shutdown hook which will attempt to shutdown the thread pool on a call to System.exit(). If numThreads > 1 and isDaemon = true, then System.exit() or Threads.shutdownDefaultPool() must be explicitly called. Otherwise, the JVM may hang. @param numThreads The number of thr...
[ "Initializes", "the", "default", "thread", "pool", "and", "adds", "a", "shutdown", "hook", "which", "will", "attempt", "to", "shutdown", "the", "thread", "pool", "on", "a", "call", "to", "System", ".", "exit", "()", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/util/Threads.java#L64-L86
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/MessageFormat.java
MessageFormat.setFormatByArgumentIndex
public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) { """ Sets the format to use for the format elements within the previously set pattern string that use the given argument index. The argument index is part of the format element definition and represents an index into the <code>arguments...
java
public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) { for (int j = 0; j <= maxOffset; j++) { if (argumentNumbers[j] == argumentIndex) { formats[j] = newFormat; } } }
[ "public", "void", "setFormatByArgumentIndex", "(", "int", "argumentIndex", ",", "Format", "newFormat", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<=", "maxOffset", ";", "j", "++", ")", "{", "if", "(", "argumentNumbers", "[", "j", "]", "==",...
Sets the format to use for the format elements within the previously set pattern string that use the given argument index. The argument index is part of the format element definition and represents an index into the <code>arguments</code> array passed to the <code>format</code> methods or the result array returned by t...
[ "Sets", "the", "format", "to", "use", "for", "the", "format", "elements", "within", "the", "previously", "set", "pattern", "string", "that", "use", "the", "given", "argument", "index", ".", "The", "argument", "index", "is", "part", "of", "the", "format", "...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/MessageFormat.java#L667-L673
ptgoetz/storm-hbase
src/main/java/org/apache/storm/hbase/common/ColumnList.java
ColumnList.addCounter
public ColumnList addCounter(byte[] family, byte[] qualifier, long incr) { """ Add an HBase counter column. @param family @param qualifier @param incr @return """ counters().add(new Counter(family, qualifier, incr)); return this; }
java
public ColumnList addCounter(byte[] family, byte[] qualifier, long incr){ counters().add(new Counter(family, qualifier, incr)); return this; }
[ "public", "ColumnList", "addCounter", "(", "byte", "[", "]", "family", ",", "byte", "[", "]", "qualifier", ",", "long", "incr", ")", "{", "counters", "(", ")", ".", "add", "(", "new", "Counter", "(", "family", ",", "qualifier", ",", "incr", ")", ")",...
Add an HBase counter column. @param family @param qualifier @param incr @return
[ "Add", "an", "HBase", "counter", "column", "." ]
train
https://github.com/ptgoetz/storm-hbase/blob/509e41514bb92ef65dba1449bbd935557dc8193c/src/main/java/org/apache/storm/hbase/common/ColumnList.java#L151-L154
RogerParkinson/madura-objects-parent
madura-rules/src/main/java/nz/co/senanque/rulesparser/ParsePackage.java
ParsePackage.processRule
private AbstractRule processRule(RulesTextProvider textProvider) { """ Method processRule. Parse the rule. Rules have an if/then structure with conditions and actions @return Rule @throws ParserException """ log.debug("processRule"); int start = textProvider.getPos(); Rule rule = new Rule(...
java
private AbstractRule processRule(RulesTextProvider textProvider) { log.debug("processRule"); int start = textProvider.getPos(); Rule rule = new Rule(); LoadCommonRuleData(rule,textProvider); textProvider.addTOCElement(null, rule.getDescription(), start, textProvider.getPos(), TYPE_...
[ "private", "AbstractRule", "processRule", "(", "RulesTextProvider", "textProvider", ")", "{", "log", ".", "debug", "(", "\"processRule\"", ")", ";", "int", "start", "=", "textProvider", ".", "getPos", "(", ")", ";", "Rule", "rule", "=", "new", "Rule", "(", ...
Method processRule. Parse the rule. Rules have an if/then structure with conditions and actions @return Rule @throws ParserException
[ "Method", "processRule", ".", "Parse", "the", "rule", ".", "Rules", "have", "an", "if", "/", "then", "structure", "with", "conditions", "and", "actions" ]
train
https://github.com/RogerParkinson/madura-objects-parent/blob/9b5385dd0437611f0ce8506f63646e018d06fb8e/madura-rules/src/main/java/nz/co/senanque/rulesparser/ParsePackage.java#L242-L266
lucee/Lucee
core/src/main/java/lucee/runtime/net/ntp/NtpClient.java
NtpClient.getOffset
public long getOffset() throws IOException { """ returns the offest from the ntp server to local system @return @throws IOException """ /// Send request DatagramSocket socket = null; try { socket = new DatagramSocket(); socket.setSoTimeout(20000); InetAddress address = InetAddress.getByNa...
java
public long getOffset() throws IOException { /// Send request DatagramSocket socket = null; try { socket = new DatagramSocket(); socket.setSoTimeout(20000); InetAddress address = InetAddress.getByName(serverName); byte[] buf = new NtpMessage().toByteArray(); DatagramPacket packet = new Datag...
[ "public", "long", "getOffset", "(", ")", "throws", "IOException", "{", "/// Send request", "DatagramSocket", "socket", "=", "null", ";", "try", "{", "socket", "=", "new", "DatagramSocket", "(", ")", ";", "socket", ".", "setSoTimeout", "(", "20000", ")", ";",...
returns the offest from the ntp server to local system @return @throws IOException
[ "returns", "the", "offest", "from", "the", "ntp", "server", "to", "local", "system" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ntp/NtpClient.java#L51-L84
zaproxy/zaproxy
src/org/zaproxy/zap/model/Context.java
Context.duplicate
public Context duplicate() { """ Creates a copy of the Context. The copy is deep, with the exception of the TechSet. @return the context """ Context newContext = new Context(session, getIndex()); newContext.description = this.description; newContext.name = this.name; newContext.includeInRegexs =...
java
public Context duplicate() { Context newContext = new Context(session, getIndex()); newContext.description = this.description; newContext.name = this.name; newContext.includeInRegexs = new ArrayList<>(this.includeInRegexs); newContext.includeInPatterns = new ArrayList<>(this.includeInPatterns); newCon...
[ "public", "Context", "duplicate", "(", ")", "{", "Context", "newContext", "=", "new", "Context", "(", "session", ",", "getIndex", "(", ")", ")", ";", "newContext", ".", "description", "=", "this", ".", "description", ";", "newContext", ".", "name", "=", ...
Creates a copy of the Context. The copy is deep, with the exception of the TechSet. @return the context
[ "Creates", "a", "copy", "of", "the", "Context", ".", "The", "copy", "is", "deep", "with", "the", "exception", "of", "the", "TechSet", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/model/Context.java#L736-L753
UrielCh/ovh-java-sdk
ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java
ApiOvhIp.ip_ripe_PUT
public void ip_ripe_PUT(String ip, OvhRipeInfos body) throws IOException { """ Alter this object properties REST: PUT /ip/{ip}/ripe @param body [required] New object properties @param ip [required] """ String qPath = "/ip/{ip}/ripe"; StringBuilder sb = path(qPath, ip); exec(qPath, "PUT", sb.toString...
java
public void ip_ripe_PUT(String ip, OvhRipeInfos body) throws IOException { String qPath = "/ip/{ip}/ripe"; StringBuilder sb = path(qPath, ip); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "ip_ripe_PUT", "(", "String", "ip", ",", "OvhRipeInfos", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ip/{ip}/ripe\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "ip", ")", ";", "exec", "(", "qPa...
Alter this object properties REST: PUT /ip/{ip}/ripe @param body [required] New object properties @param ip [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L182-L186
netty/netty
common/src/main/java/io/netty/util/internal/ThreadExecutorMap.java
ThreadExecutorMap.apply
public static ThreadFactory apply(final ThreadFactory threadFactory, final EventExecutor eventExecutor) { """ Decorate the given {@link ThreadFactory} and ensure {@link #currentExecutor()} will return {@code eventExecutor} when called from within the {@link Runnable} during execution. """ ObjectUtil.c...
java
public static ThreadFactory apply(final ThreadFactory threadFactory, final EventExecutor eventExecutor) { ObjectUtil.checkNotNull(threadFactory, "command"); ObjectUtil.checkNotNull(eventExecutor, "eventExecutor"); return new ThreadFactory() { @Override public Thread newTh...
[ "public", "static", "ThreadFactory", "apply", "(", "final", "ThreadFactory", "threadFactory", ",", "final", "EventExecutor", "eventExecutor", ")", "{", "ObjectUtil", ".", "checkNotNull", "(", "threadFactory", ",", "\"command\"", ")", ";", "ObjectUtil", ".", "checkNo...
Decorate the given {@link ThreadFactory} and ensure {@link #currentExecutor()} will return {@code eventExecutor} when called from within the {@link Runnable} during execution.
[ "Decorate", "the", "given", "{" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ThreadExecutorMap.java#L86-L95
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java
GeneralizedCounter.incrementCount2D
public void incrementCount2D(K first, K second, double count) { """ Equivalent to incrementCount( new Object[] { first, second }, count ). Makes the special case easier, and also more efficient. """ if (depth != 2) { wrongDepth(); //throws exception } this.addToTotal(count); Gener...
java
public void incrementCount2D(K first, K second, double count) { if (depth != 2) { wrongDepth(); //throws exception } this.addToTotal(count); GeneralizedCounter<K> next = this.conditionalizeHelper(first); next.incrementCount1D(second, count); }
[ "public", "void", "incrementCount2D", "(", "K", "first", ",", "K", "second", ",", "double", "count", ")", "{", "if", "(", "depth", "!=", "2", ")", "{", "wrongDepth", "(", ")", ";", "//throws exception\r", "}", "this", ".", "addToTotal", "(", "count", "...
Equivalent to incrementCount( new Object[] { first, second }, count ). Makes the special case easier, and also more efficient.
[ "Equivalent", "to", "incrementCount", "(", "new", "Object", "[]", "{", "first", "second", "}", "count", ")", ".", "Makes", "the", "special", "case", "easier", "and", "also", "more", "efficient", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java#L492-L500
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextItems.java
ContextItems.addItems
private void addItems(Map<String, String> values) { """ Adds property values to the context item list. @param values Values to add. """ for (String itemName : values.keySet()) { setItem(itemName, values.get(itemName)); } }
java
private void addItems(Map<String, String> values) { for (String itemName : values.keySet()) { setItem(itemName, values.get(itemName)); } }
[ "private", "void", "addItems", "(", "Map", "<", "String", ",", "String", ">", "values", ")", "{", "for", "(", "String", "itemName", ":", "values", ".", "keySet", "(", ")", ")", "{", "setItem", "(", "itemName", ",", "values", ".", "get", "(", "itemNam...
Adds property values to the context item list. @param values Values to add.
[ "Adds", "property", "values", "to", "the", "context", "item", "list", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextItems.java#L336-L340
jenkinsci/jenkins
core/src/main/java/hudson/model/User.java
User.getOrCreateById
private static @Nullable User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) { """ Retrieve a user by its ID, and create a new one if requested. @return An existing or created user. May be {@code null} if a user does not exist and {@code create} is false. """ User...
java
private static @Nullable User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) { User u = AllUsers.get(id); if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) { u = new User(id, fullName); AllUsers.put(id, u); if (!i...
[ "private", "static", "@", "Nullable", "User", "getOrCreateById", "(", "@", "Nonnull", "String", "id", ",", "@", "Nonnull", "String", "fullName", ",", "boolean", "create", ")", "{", "User", "u", "=", "AllUsers", ".", "get", "(", "id", ")", ";", "if", "(...
Retrieve a user by its ID, and create a new one if requested. @return An existing or created user. May be {@code null} if a user does not exist and {@code create} is false.
[ "Retrieve", "a", "user", "by", "its", "ID", "and", "create", "a", "new", "one", "if", "requested", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/User.java#L515-L530
SonarSource/sonarqube
sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/RangeDistributionBuilder.java
RangeDistributionBuilder.add
public RangeDistributionBuilder add(Number value, int count) { """ Increments an entry @param value the value to use to pick the entry to increment @param count the number by which to increment """ if (greaterOrEqualsThan(value, bottomLimits[0])) { addValue(value, count); isEmpty = false; ...
java
public RangeDistributionBuilder add(Number value, int count) { if (greaterOrEqualsThan(value, bottomLimits[0])) { addValue(value, count); isEmpty = false; } return this; }
[ "public", "RangeDistributionBuilder", "add", "(", "Number", "value", ",", "int", "count", ")", "{", "if", "(", "greaterOrEqualsThan", "(", "value", ",", "bottomLimits", "[", "0", "]", ")", ")", "{", "addValue", "(", "value", ",", "count", ")", ";", "isEm...
Increments an entry @param value the value to use to pick the entry to increment @param count the number by which to increment
[ "Increments", "an", "entry" ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/RangeDistributionBuilder.java#L77-L83
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/Event.java
Event.withAttributes
public Event withAttributes(java.util.Map<String, String> attributes) { """ Custom attributes that are associated with the event you're adding or updating. @param attributes Custom attributes that are associated with the event you're adding or updating. @return Returns a reference to this object so that metho...
java
public Event withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
[ "public", "Event", "withAttributes", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "attributes", ")", "{", "setAttributes", "(", "attributes", ")", ";", "return", "this", ";", "}" ]
Custom attributes that are associated with the event you're adding or updating. @param attributes Custom attributes that are associated with the event you're adding or updating. @return Returns a reference to this object so that method calls can be chained together.
[ "Custom", "attributes", "that", "are", "associated", "with", "the", "event", "you", "re", "adding", "or", "updating", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/Event.java#L181-L184
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterHeartbeatManager.java
ClusterHeartbeatManager.sendHeartbeat
private void sendHeartbeat(Member target) { """ Send a {@link HeartbeatOp} to the {@code target} @param target target Member """ if (target == null) { return; } try { MembersViewMetadata membersViewMetadata = clusterService.getMembershipManager().createLocalMemb...
java
private void sendHeartbeat(Member target) { if (target == null) { return; } try { MembersViewMetadata membersViewMetadata = clusterService.getMembershipManager().createLocalMembersViewMetadata(); Operation op = new HeartbeatOp(membersViewMetadata, target.getUu...
[ "private", "void", "sendHeartbeat", "(", "Member", "target", ")", "{", "if", "(", "target", "==", "null", ")", "{", "return", ";", "}", "try", "{", "MembersViewMetadata", "membersViewMetadata", "=", "clusterService", ".", "getMembershipManager", "(", ")", ".",...
Send a {@link HeartbeatOp} to the {@code target} @param target target Member
[ "Send", "a", "{" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterHeartbeatManager.java#L614-L628
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/DerivativeLaplacian.java
DerivativeLaplacian.process
public static void process(GrayF32 orig, GrayF32 deriv, @Nullable ImageBorder_F32 border) { """ Computes the Laplacian of 'orig'. @param orig Input image. Not modified. @param deriv Where the Laplacian is written to. Modified. """ deriv.reshape(orig.width,orig.height); if( BoofConcurrency.USE_CONCUR...
java
public static void process(GrayF32 orig, GrayF32 deriv, @Nullable ImageBorder_F32 border) { deriv.reshape(orig.width,orig.height); if( BoofConcurrency.USE_CONCURRENT ) { DerivativeLaplacian_Inner_MT.process(orig,deriv); } else { DerivativeLaplacian_Inner.process(orig,deriv); } if( border != null ) { ...
[ "public", "static", "void", "process", "(", "GrayF32", "orig", ",", "GrayF32", "deriv", ",", "@", "Nullable", "ImageBorder_F32", "border", ")", "{", "deriv", ".", "reshape", "(", "orig", ".", "width", ",", "orig", ".", "height", ")", ";", "if", "(", "B...
Computes the Laplacian of 'orig'. @param orig Input image. Not modified. @param deriv Where the Laplacian is written to. Modified.
[ "Computes", "the", "Laplacian", "of", "orig", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/DerivativeLaplacian.java#L114-L127
MorphiaOrg/morphia
morphia/src/main/java/dev/morphia/utils/IterHelper.java
IterHelper.loopOrSingle
@SuppressWarnings( { """ Calls eval for each entry found, or just once if the "x" isn't iterable/collection/list/etc. with "x" @param x the object process @param callback the callback """"unchecked"}) public void loopOrSingle(final Object x, final IterCallback<V> callback) { if (x == nul...
java
@SuppressWarnings({"unchecked"}) public void loopOrSingle(final Object x, final IterCallback<V> callback) { if (x == null) { return; } //A collection if (x instanceof Collection<?>) { final Collection<?> l = (Collection<?>) x; for (final Object o ...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", "}", ")", "public", "void", "loopOrSingle", "(", "final", "Object", "x", ",", "final", "IterCallback", "<", "V", ">", "callback", ")", "{", "if", "(", "x", "==", "null", ")", "{", "return", ";", "}", ...
Calls eval for each entry found, or just once if the "x" isn't iterable/collection/list/etc. with "x" @param x the object process @param callback the callback
[ "Calls", "eval", "for", "each", "entry", "found", "or", "just", "once", "if", "the", "x", "isn", "t", "iterable", "/", "collection", "/", "list", "/", "etc", ".", "with", "x" ]
train
https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/IterHelper.java#L69-L93
google/closure-templates
java/src/com/google/template/soy/incrementaldomsrc/GenIncrementalDomCodeVisitor.java
GenIncrementalDomCodeVisitor.visitLetParamContentNode
private void visitLetParamContentNode(RenderUnitNode node, String generatedVarName) { """ Generates the content of a {@code let} or {@code param} statement. For HTML and attribute let/param statements, the generated instructions inside the node are wrapped in a function which will be optionally passed to another...
java
private void visitLetParamContentNode(RenderUnitNode node, String generatedVarName) { // The html transform step, performed by HtmlContextVisitor, ensures that // we always have a content kind specified. checkState(node.getContentKind() != null); IncrementalDomCodeBuilder jsCodeBuilder = getJsCodeBuild...
[ "private", "void", "visitLetParamContentNode", "(", "RenderUnitNode", "node", ",", "String", "generatedVarName", ")", "{", "// The html transform step, performed by HtmlContextVisitor, ensures that", "// we always have a content kind specified.", "checkState", "(", "node", ".", "ge...
Generates the content of a {@code let} or {@code param} statement. For HTML and attribute let/param statements, the generated instructions inside the node are wrapped in a function which will be optionally passed to another template and invoked in the correct location. All other kinds of let statements are generated as...
[ "Generates", "the", "content", "of", "a", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/incrementaldomsrc/GenIncrementalDomCodeVisitor.java#L647-L697
eobermuhlner/big-math
ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java
BigDecimalMath.atanh
public static BigDecimal atanh(BigDecimal x, MathContext mathContext) { """ Calculates the arc hyperbolic tangens (inverse hyperbolic tangens) of {@link BigDecimal} x. <p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p> @param x the {@link BigDecimal} to...
java
public static BigDecimal atanh(BigDecimal x, MathContext mathContext) { if (x.compareTo(BigDecimal.ONE) >= 0) { throw new ArithmeticException("Illegal atanh(x) for x >= 1: x = " + x); } if (x.compareTo(MINUS_ONE) <= 0) { throw new ArithmeticException("Illegal atanh(x) for...
[ "public", "static", "BigDecimal", "atanh", "(", "BigDecimal", "x", ",", "MathContext", "mathContext", ")", "{", "if", "(", "x", ".", "compareTo", "(", "BigDecimal", ".", "ONE", ")", ">=", "0", ")", "{", "throw", "new", "ArithmeticException", "(", "\"Illega...
Calculates the arc hyperbolic tangens (inverse hyperbolic tangens) of {@link BigDecimal} x. <p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p> @param x the {@link BigDecimal} to calculate the arc hyperbolic tangens for @param mathContext the {@link MathContext} ...
[ "Calculates", "the", "arc", "hyperbolic", "tangens", "(", "inverse", "hyperbolic", "tangens", ")", "of", "{", "@link", "BigDecimal", "}", "x", "." ]
train
https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1635-L1647
apollographql/apollo-android
apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java
ResponseField.forLong
public static ResponseField forLong(String responseName, String fieldName, Map<String, Object> arguments, boolean optional, List<Condition> conditions) { """ Factory method for creating a Field instance representing {@link Type#LONG}. @param responseName alias for the result of a field @param fieldName ...
java
public static ResponseField forLong(String responseName, String fieldName, Map<String, Object> arguments, boolean optional, List<Condition> conditions) { return new ResponseField(Type.LONG, responseName, fieldName, arguments, optional, conditions); }
[ "public", "static", "ResponseField", "forLong", "(", "String", "responseName", ",", "String", "fieldName", ",", "Map", "<", "String", ",", "Object", ">", "arguments", ",", "boolean", "optional", ",", "List", "<", "Condition", ">", "conditions", ")", "{", "re...
Factory method for creating a Field instance representing {@link Type#LONG}. @param responseName alias for the result of a field @param fieldName name of the field in the GraphQL operation @param arguments arguments to be passed along with the field @param optional whether the arguments passed along are opti...
[ "Factory", "method", "for", "creating", "a", "Field", "instance", "representing", "{", "@link", "Type#LONG", "}", "." ]
train
https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java#L70-L73
google/error-prone
check_api/src/main/java/com/google/errorprone/SuppressionInfo.java
SuppressionInfo.forCompilationUnit
public SuppressionInfo forCompilationUnit(CompilationUnitTree tree, VisitorState state) { """ Generates the {@link SuppressionInfo} for a {@link CompilationUnitTree}. This differs in that {@code isGenerated} is determined by inspecting the annotations of the outermost class so that matchers on {@link Compilation...
java
public SuppressionInfo forCompilationUnit(CompilationUnitTree tree, VisitorState state) { AtomicBoolean generated = new AtomicBoolean(false); new SimpleTreeVisitor<Void, Void>() { @Override public Void visitClass(ClassTree node, Void unused) { ClassSymbol symbol = ASTHelpers.getSymbol(node);...
[ "public", "SuppressionInfo", "forCompilationUnit", "(", "CompilationUnitTree", "tree", ",", "VisitorState", "state", ")", "{", "AtomicBoolean", "generated", "=", "new", "AtomicBoolean", "(", "false", ")", ";", "new", "SimpleTreeVisitor", "<", "Void", ",", "Void", ...
Generates the {@link SuppressionInfo} for a {@link CompilationUnitTree}. This differs in that {@code isGenerated} is determined by inspecting the annotations of the outermost class so that matchers on {@link CompilationUnitTree} will also be suppressed.
[ "Generates", "the", "{" ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/SuppressionInfo.java#L116-L127
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/wan/merkletree/MerkleTreeUtil.java
MerkleTreeUtil.getLeafOrderForHash
static int getLeafOrderForHash(int hash, int level) { """ Returns the breadth-first order of the leaf that a given {@code hash} belongs to @param hash The hash for which the leaf order to be calculated @param level The level @return the breadth-first order of the leaf for the given {@code hash} """ ...
java
static int getLeafOrderForHash(int hash, int level) { long hashStepForLevel = getNodeHashRangeOnLevel(level); long hashDistanceFromMin = ((long) hash) - Integer.MIN_VALUE; int steps = (int) (hashDistanceFromMin / hashStepForLevel); int leftMostNodeOrderOnLevel = getLeftMostNodeOrderOnLev...
[ "static", "int", "getLeafOrderForHash", "(", "int", "hash", ",", "int", "level", ")", "{", "long", "hashStepForLevel", "=", "getNodeHashRangeOnLevel", "(", "level", ")", ";", "long", "hashDistanceFromMin", "=", "(", "(", "long", ")", "hash", ")", "-", "Integ...
Returns the breadth-first order of the leaf that a given {@code hash} belongs to @param hash The hash for which the leaf order to be calculated @param level The level @return the breadth-first order of the leaf for the given {@code hash}
[ "Returns", "the", "breadth", "-", "first", "order", "of", "the", "leaf", "that", "a", "given", "{", "@code", "hash", "}", "belongs", "to" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/wan/merkletree/MerkleTreeUtil.java#L48-L55
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryConfiguration.java
MetricRegistryConfiguration.fromConfiguration
public static MetricRegistryConfiguration fromConfiguration(Configuration configuration) { """ Create a metric registry configuration object from the given {@link Configuration}. @param configuration to generate the metric registry configuration from @return Metric registry configuration generated from the con...
java
public static MetricRegistryConfiguration fromConfiguration(Configuration configuration) { ScopeFormats scopeFormats; try { scopeFormats = ScopeFormats.fromConfig(configuration); } catch (Exception e) { LOG.warn("Failed to parse scope format, using default scope formats", e); scopeFormats = ScopeFormats....
[ "public", "static", "MetricRegistryConfiguration", "fromConfiguration", "(", "Configuration", "configuration", ")", "{", "ScopeFormats", "scopeFormats", ";", "try", "{", "scopeFormats", "=", "ScopeFormats", ".", "fromConfig", "(", "configuration", ")", ";", "}", "catc...
Create a metric registry configuration object from the given {@link Configuration}. @param configuration to generate the metric registry configuration from @return Metric registry configuration generated from the configuration
[ "Create", "a", "metric", "registry", "configuration", "object", "from", "the", "given", "{", "@link", "Configuration", "}", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryConfiguration.java#L83-L106
apereo/cas
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java
OAuth20Utils.checkResponseTypes
public static boolean checkResponseTypes(final String type, final OAuth20ResponseTypes... expectedTypes) { """ Check the response type against expected response types. @param type the current response type @param expectedTypes the expected response types @return whether the response type is supported...
java
public static boolean checkResponseTypes(final String type, final OAuth20ResponseTypes... expectedTypes) { LOGGER.debug("Response type: [{}]", type); val checked = Stream.of(expectedTypes).anyMatch(t -> OAuth20Utils.isResponseType(type, t)); if (!checked) { LOGGER.error("Unsupported ...
[ "public", "static", "boolean", "checkResponseTypes", "(", "final", "String", "type", ",", "final", "OAuth20ResponseTypes", "...", "expectedTypes", ")", "{", "LOGGER", ".", "debug", "(", "\"Response type: [{}]\"", ",", "type", ")", ";", "val", "checked", "=", "St...
Check the response type against expected response types. @param type the current response type @param expectedTypes the expected response types @return whether the response type is supported
[ "Check", "the", "response", "type", "against", "expected", "response", "types", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java#L406-L413
apache/incubator-gobblin
gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java
AzkabanClient.handleResponse
protected static Map<String, String> handleResponse(HttpResponse response) throws IOException { """ Convert a {@link HttpResponse} to a <string, string> map. Put protected modifier here so it is visible to {@link AzkabanAjaxAPIClient}. @param response An http response returned by {@link org.apache.http.client....
java
protected static Map<String, String> handleResponse(HttpResponse response) throws IOException { int code = response.getStatusLine().getStatusCode(); if (code != HttpStatus.SC_CREATED && code != HttpStatus.SC_OK) { log.error("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); t...
[ "protected", "static", "Map", "<", "String", ",", "String", ">", "handleResponse", "(", "HttpResponse", "response", ")", "throws", "IOException", "{", "int", "code", "=", "response", ".", "getStatusLine", "(", ")", ".", "getStatusCode", "(", ")", ";", "if", ...
Convert a {@link HttpResponse} to a <string, string> map. Put protected modifier here so it is visible to {@link AzkabanAjaxAPIClient}. @param response An http response returned by {@link org.apache.http.client.HttpClient} execution. This should be JSON string. @return A map composed by the first level of KV pair of j...
[ "Convert", "a", "{", "@link", "HttpResponse", "}", "to", "a", "<string", "string", ">", "map", ".", "Put", "protected", "modifier", "here", "so", "it", "is", "visible", "to", "{", "@link", "AzkabanAjaxAPIClient", "}", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L206-L230
languagetool-org/languagetool
languagetool-server/src/main/java/org/languagetool/server/ServerTools.java
ServerTools.print
static void print(String s, PrintStream outputStream) { """ /* replace with structured logging: check done cache stats maybe: (could be combined in table) Access denied: request size / rate limit / ... more interesting: error rate too high text checking took longer than ... misc.: language code unknow...
java
static void print(String s, PrintStream outputStream) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZ"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); String now = dateFormat.format(new Date()); outputStream.println(now + " " + s); }
[ "static", "void", "print", "(", "String", "s", ",", "PrintStream", "outputStream", ")", "{", "SimpleDateFormat", "dateFormat", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd HH:mm:ss ZZ\"", ")", ";", "dateFormat", ".", "setTimeZone", "(", "TimeZone", ".", "get...
/* replace with structured logging: check done cache stats maybe: (could be combined in table) Access denied: request size / rate limit / ... more interesting: error rate too high text checking took longer than ... misc.: language code unknown missing arguments old api blacklisted referrer various other exceptions
[ "/", "*", "replace", "with", "structured", "logging", ":", "check", "done", "cache", "stats" ]
train
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-server/src/main/java/org/languagetool/server/ServerTools.java#L68-L73
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java
RemovePreferenceHeaderDialogBuilder.createRemovePreferenceHeaderClickListener
private OnClickListener createRemovePreferenceHeaderClickListener() { """ Creates and returns a listener, which allows to notify the registered listener, when the user closes the dialog confirmatively. @return The listener, which has been created, as an instance of the type {@link OnClickListener} """ ...
java
private OnClickListener createRemovePreferenceHeaderClickListener() { return new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { int position = spinner.getSelectedItemPosition(); listener.onRemovePreferen...
[ "private", "OnClickListener", "createRemovePreferenceHeaderClickListener", "(", ")", "{", "return", "new", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "DialogInterface", "dialog", ",", "final", "int", "which", ")", ...
Creates and returns a listener, which allows to notify the registered listener, when the user closes the dialog confirmatively. @return The listener, which has been created, as an instance of the type {@link OnClickListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "notify", "the", "registered", "listener", "when", "the", "user", "closes", "the", "dialog", "confirmatively", "." ]
train
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java#L132-L142
Azure/azure-sdk-for-java
sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java
SyncGroupsInner.listHubSchemasWithServiceResponseAsync
public Observable<ServiceResponse<Page<SyncFullSchemaPropertiesInner>>> listHubSchemasWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName) { """ Gets a collection of hub database schemas. @param resourceGroupName The name of the...
java
public Observable<ServiceResponse<Page<SyncFullSchemaPropertiesInner>>> listHubSchemasWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName) { return listHubSchemasSinglePageAsync(resourceGroupName, serverName, databaseName, syncG...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "SyncFullSchemaPropertiesInner", ">", ">", ">", "listHubSchemasWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "serverName", ",", "final", "String", "databa...
Gets a collection of hub database schemas. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database on which the sync group is h...
[ "Gets", "a", "collection", "of", "hub", "database", "schemas", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L516-L528
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
NodeIndexer.createFulltextField
protected Fieldable createFulltextField(Reader value) { """ Creates a fulltext field for the reader <code>value</code>. @param value the reader value. @return a lucene field. """ if (supportHighlighting) { return new TextFieldExtractor(FieldNames.FULLTEXT, value, true, true); } ...
java
protected Fieldable createFulltextField(Reader value) { if (supportHighlighting) { return new TextFieldExtractor(FieldNames.FULLTEXT, value, true, true); } else { return new TextFieldExtractor(FieldNames.FULLTEXT, value, false, false); } }
[ "protected", "Fieldable", "createFulltextField", "(", "Reader", "value", ")", "{", "if", "(", "supportHighlighting", ")", "{", "return", "new", "TextFieldExtractor", "(", "FieldNames", ".", "FULLTEXT", ",", "value", ",", "true", ",", "true", ")", ";", "}", "...
Creates a fulltext field for the reader <code>value</code>. @param value the reader value. @return a lucene field.
[ "Creates", "a", "fulltext", "field", "for", "the", "reader", "<code", ">", "value<", "/", "code", ">", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L919-L929
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/rest/RegisteredCommand.java
RegisteredCommand.compareNodes
private static int compareNodes(String node1, String node2) { """ path nodes are query parameters. Either node can be empty, but not null. """ assert node1 != null; assert node2 != null; if (node1.equals(node2)) { return 0; } if (node1.length() > 0 &...
java
private static int compareNodes(String node1, String node2) { assert node1 != null; assert node2 != null; if (node1.equals(node2)) { return 0; } if (node1.length() > 0 && node1.charAt(0) == '{') { if (node2.length() > 0 && node2.charAt(0) == '{') ...
[ "private", "static", "int", "compareNodes", "(", "String", "node1", ",", "String", "node2", ")", "{", "assert", "node1", "!=", "null", ";", "assert", "node2", "!=", "null", ";", "if", "(", "node1", ".", "equals", "(", "node2", ")", ")", "{", "return", ...
path nodes are query parameters. Either node can be empty, but not null.
[ "path", "nodes", "are", "query", "parameters", ".", "Either", "node", "can", "be", "empty", "but", "not", "null", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RegisteredCommand.java#L223-L240
xiancloud/xian
xian-zookeeper/xian-curator/xian-curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java
CuratorFrameworkFactory.newClient
public static CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy) { """ Create a new client @param connectString list of servers to connect to @param sessionTimeoutMs session timeout @param connectionTimeoutMs connection timeout @p...
java
public static CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy) { return builder(). connectString(connectString). sessionTimeoutMs(sessionTimeoutMs). connectionTimeoutMs(connectionTimeoutMs). ...
[ "public", "static", "CuratorFramework", "newClient", "(", "String", "connectString", ",", "int", "sessionTimeoutMs", ",", "int", "connectionTimeoutMs", ",", "RetryPolicy", "retryPolicy", ")", "{", "return", "builder", "(", ")", ".", "connectString", "(", "connectStr...
Create a new client @param connectString list of servers to connect to @param sessionTimeoutMs session timeout @param connectionTimeoutMs connection timeout @param retryPolicy retry policy to use @return client
[ "Create", "a", "new", "client" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java#L93-L101
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/style/stylers/Image.java
Image.style
@Override public final <E> E style(E element, Object data) throws VectorPrintException { """ Calls {@link #initURL(String) }, {@link #createImage(com.itextpdf.text.pdf.PdfContentByte, java.lang.Object, float) }, {@link #applySettings(com.itextpdf.text.Image) }. Calls {@link VectorPrintDocument#addHook(com.vect...
java
@Override public final <E> E style(E element, Object data) throws VectorPrintException { initURL(String.valueOf((data != null) ? convert(data) : getData())); try { /* always call createImage when styling, subclasses may do their own document writing etc. in createImage */ ...
[ "@", "Override", "public", "final", "<", "E", ">", "E", "style", "(", "E", "element", ",", "Object", "data", ")", "throws", "VectorPrintException", "{", "initURL", "(", "String", ".", "valueOf", "(", "(", "data", "!=", "null", ")", "?", "convert", "(",...
Calls {@link #initURL(String) }, {@link #createImage(com.itextpdf.text.pdf.PdfContentByte, java.lang.Object, float) }, {@link #applySettings(com.itextpdf.text.Image) }. Calls {@link VectorPrintDocument#addHook(com.vectorprint.report.itext.VectorPrintDocument.AddElementHook) } for drawing image shadow and for drawing ne...
[ "Calls", "{", "@link", "#initURL", "(", "String", ")", "}", "{", "@link", "#createImage", "(", "com", ".", "itextpdf", ".", "text", ".", "pdf", ".", "PdfContentByte", "java", ".", "lang", ".", "Object", "float", ")", "}", "{", "@link", "#applySettings", ...
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/Image.java#L173-L200
openbase/jul
extension/type/storage/src/main/java/org/openbase/jul/extension/type/storage/registry/consistency/TransformationFrameConsistencyHandler.java
TransformationFrameConsistencyHandler.verifyAndUpdatePlacement
protected PlacementConfig verifyAndUpdatePlacement(final String alias, final PlacementConfig placementConfig) throws CouldNotPerformException, EntryModification { """ Methods verifies and updates the transformation frame id for the given placement configuration. If the given placement configuration is up to date ...
java
protected PlacementConfig verifyAndUpdatePlacement(final String alias, final PlacementConfig placementConfig) throws CouldNotPerformException, EntryModification { try { if (alias == null || alias.isEmpty()) { throw new NotAvailableException("label"); } if (pl...
[ "protected", "PlacementConfig", "verifyAndUpdatePlacement", "(", "final", "String", "alias", ",", "final", "PlacementConfig", "placementConfig", ")", "throws", "CouldNotPerformException", ",", "EntryModification", "{", "try", "{", "if", "(", "alias", "==", "null", "||...
Methods verifies and updates the transformation frame id for the given placement configuration. If the given placement configuration is up to date this the method returns null. @param alias @param placementConfig @return @throws CouldNotPerformException @throws EntryModification
[ "Methods", "verifies", "and", "updates", "the", "transformation", "frame", "id", "for", "the", "given", "placement", "configuration", ".", "If", "the", "given", "placement", "configuration", "is", "up", "to", "date", "this", "the", "method", "returns", "null", ...
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/storage/src/main/java/org/openbase/jul/extension/type/storage/registry/consistency/TransformationFrameConsistencyHandler.java#L64-L85
netkicorp/java-wns-resolver
src/main/java/com/netki/tlsa/CertChainValidator.java
CertChainValidator.validateKeyChain
public boolean validateKeyChain(X509Certificate client, KeyStore keyStore) throws KeyStoreException, CertificateException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { """ Validate keychain @param client is the client X509Certificate @param keyStore containing all t...
java
public boolean validateKeyChain(X509Certificate client, KeyStore keyStore) throws KeyStoreException, CertificateException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { X509Certificate[] certs = new X509Certificate[keyStore.size()]; int i = 0; Enumerat...
[ "public", "boolean", "validateKeyChain", "(", "X509Certificate", "client", ",", "KeyStore", "keyStore", ")", "throws", "KeyStoreException", ",", "CertificateException", ",", "InvalidAlgorithmParameterException", ",", "NoSuchAlgorithmException", ",", "NoSuchProviderException", ...
Validate keychain @param client is the client X509Certificate @param keyStore containing all trusted certificate @return true if validation until root certificate success, false otherwise @throws KeyStoreException KeyStore is invalid @throws CertificateException Certificate is Invalid @throws InvalidAlgorithmParamet...
[ "Validate", "keychain" ]
train
https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/CertChainValidator.java#L27-L39
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.getBranchLogStream
public static InputStream getBranchLogStream(String[] branches, long startRevision, long endRevision, String baseUrl, String user, String pwd) throws IOException { """ Retrieve the XML-log of changes on the given branch, starting with the given revision up to HEAD. This method returns an {@link InputStream} that ...
java
public static InputStream getBranchLogStream(String[] branches, long startRevision, long endRevision, String baseUrl, String user, String pwd) throws IOException { CommandLine cmdLine = getCommandLineForXMLLog(user, pwd); cmdLine.addArgument(startRevision + ":" + (endRevision != -1 ? endRevision : "HEAD...
[ "public", "static", "InputStream", "getBranchLogStream", "(", "String", "[", "]", "branches", ",", "long", "startRevision", ",", "long", "endRevision", ",", "String", "baseUrl", ",", "String", "user", ",", "String", "pwd", ")", "throws", "IOException", "{", "C...
Retrieve the XML-log of changes on the given branch, starting with the given revision up to HEAD. This method returns an {@link InputStream} that can be used to read and process the XML data without storing the complete result. This is useful when you are potentially reading many revisions and thus need to avoid being ...
[ "Retrieve", "the", "XML", "-", "log", "of", "changes", "on", "the", "given", "branch", "starting", "with", "the", "given", "revision", "up", "to", "HEAD", ".", "This", "method", "returns", "an", "{", "@link", "InputStream", "}", "that", "can", "be", "use...
train
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L167-L173
jayantk/jklol
src/com/jayantkrish/jklol/cfg/CfgParser.java
CfgParser.parseInsideMarginal
public CfgParseChart parseInsideMarginal(List<?> terminals, boolean useSumProduct) { """ Calculate the inside probabilities (i.e., run the upward pass of variable elimination). """ CfgParseChart chart = createParseChart(terminals, useSumProduct); initializeChart(chart, terminals); upwardChartPass(...
java
public CfgParseChart parseInsideMarginal(List<?> terminals, boolean useSumProduct) { CfgParseChart chart = createParseChart(terminals, useSumProduct); initializeChart(chart, terminals); upwardChartPass(chart); return chart; }
[ "public", "CfgParseChart", "parseInsideMarginal", "(", "List", "<", "?", ">", "terminals", ",", "boolean", "useSumProduct", ")", "{", "CfgParseChart", "chart", "=", "createParseChart", "(", "terminals", ",", "useSumProduct", ")", ";", "initializeChart", "(", "char...
Calculate the inside probabilities (i.e., run the upward pass of variable elimination).
[ "Calculate", "the", "inside", "probabilities", "(", "i", ".", "e", ".", "run", "the", "upward", "pass", "of", "variable", "elimination", ")", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L360-L365
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRest.java
TemplateRest.getTemplateByUuid
@GET @Path(" { """ Gets the information of an specific template. <pre> GET /templates/{template_id} Request: GET /templates/{template_id} HTTP/1.1 Response: HTTP/1.1 200 Ok {@code <?xml version="1.0" encoding="UTF-8"?> <wsag:Template>...</wsag:Template> } </pre> Example: <li>curl ...
java
@GET @Path("{id}") @Produces(MediaType.APPLICATION_XML) public Response getTemplateByUuid(@PathParam("id") String templateId){ logger.debug("StartOf getTemplateByUuid - REQUEST for /templates/{uuid}" + templateId); try{ TemplateHelper templateRestService = getTemplateHelper(); ...
[ "@", "GET", "@", "Path", "(", "\"{id}\"", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_XML", ")", "public", "Response", "getTemplateByUuid", "(", "@", "PathParam", "(", "\"id\"", ")", "String", "templateId", ")", "{", "logger", ".", "debug", "...
Gets the information of an specific template. <pre> GET /templates/{template_id} Request: GET /templates/{template_id} HTTP/1.1 Response: HTTP/1.1 200 Ok {@code <?xml version="1.0" encoding="UTF-8"?> <wsag:Template>...</wsag:Template> } </pre> Example: <li>curl http://localhost:8080/sla-service/templates/contr...
[ "Gets", "the", "information", "of", "an", "specific", "template", "." ]
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRest.java#L195-L217
census-instrumentation/opencensus-java
exporters/trace/zipkin/src/main/java/io/opencensus/exporter/trace/zipkin/ZipkinTraceExporter.java
ZipkinTraceExporter.createAndRegister
public static void createAndRegister( SpanBytesEncoder encoder, Sender sender, String serviceName) { """ Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin exporter can be registered at any point. @param encoder Usually {@link SpanBytesEncoder#JSON_V2} @param send...
java
public static void createAndRegister( SpanBytesEncoder encoder, Sender sender, String serviceName) { synchronized (monitor) { checkState(handler == null, "Zipkin exporter is already registered."); Handler newHandler = new ZipkinExporterHandler(encoder, sender, serviceName); handler = newHand...
[ "public", "static", "void", "createAndRegister", "(", "SpanBytesEncoder", "encoder", ",", "Sender", "sender", ",", "String", "serviceName", ")", "{", "synchronized", "(", "monitor", ")", "{", "checkState", "(", "handler", "==", "null", ",", "\"Zipkin exporter is a...
Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin exporter can be registered at any point. @param encoder Usually {@link SpanBytesEncoder#JSON_V2} @param sender Often, but not necessarily an http sender. This could be Kafka or SQS. @param serviceName the {@link Span#localServic...
[ "Creates", "and", "registers", "the", "Zipkin", "Trace", "exporter", "to", "the", "OpenCensus", "library", ".", "Only", "one", "Zipkin", "exporter", "can", "be", "registered", "at", "any", "point", "." ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/exporters/trace/zipkin/src/main/java/io/opencensus/exporter/trace/zipkin/ZipkinTraceExporter.java#L80-L88
Mozu/mozu-java
mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/B2BAccountUrl.java
B2BAccountUrl.getB2BAccountAttributeUrl
public static MozuUrl getB2BAccountAttributeUrl(Integer accountId, String attributeFQN, String responseFields) { """ Get Resource Url for GetB2BAccountAttribute @param accountId Unique identifier of the customer account. @param attributeFQN Fully qualified name for an attribute. @param responseFields Filtering ...
java
public static MozuUrl getB2BAccountAttributeUrl(Integer accountId, String attributeFQN, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/attributes/{attributeFQN}?responseFields={responseFields}"); formatter.formatUrl("accountId", accountId); form...
[ "public", "static", "MozuUrl", "getB2BAccountAttributeUrl", "(", "Integer", "accountId", ",", "String", "attributeFQN", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/customer/b2baccounts/{accountId}...
Get Resource Url for GetB2BAccountAttribute @param accountId Unique identifier of the customer account. @param attributeFQN Fully qualified name for an attribute. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter shoul...
[ "Get", "Resource", "Url", "for", "GetB2BAccountAttribute" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/B2BAccountUrl.java#L49-L56
Stratio/cassandra-lucene-index
plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilder.java
SearchBuilder.toJson
public String toJson() { """ Returns the JSON representation of this object. @return a JSON representation of this object """ build(); try { return JsonSerializer.toString(this); } catch (IOException e) { throw new IndexException(e, "Unformateable JSON search:...
java
public String toJson() { build(); try { return JsonSerializer.toString(this); } catch (IOException e) { throw new IndexException(e, "Unformateable JSON search: {}", e.getMessage()); } }
[ "public", "String", "toJson", "(", ")", "{", "build", "(", ")", ";", "try", "{", "return", "JsonSerializer", ".", "toString", "(", "this", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "IndexException", "(", "e", ",", "\"...
Returns the JSON representation of this object. @return a JSON representation of this object
[ "Returns", "the", "JSON", "representation", "of", "this", "object", "." ]
train
https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilder.java#L140-L147
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java
AbstractResilienceStrategy.inconsistent
protected void inconsistent(Iterable<? extends K> keys, StoreAccessException because, StoreAccessException... cleanup) { """ Called when the cache failed to recover from a failing store operation on a list of keys. @param keys @param because exception thrown by the failing operation @param cleanup all the exc...
java
protected void inconsistent(Iterable<? extends K> keys, StoreAccessException because, StoreAccessException... cleanup) { pacedErrorLog("Ehcache keys {} in possible inconsistent state", keys, because); }
[ "protected", "void", "inconsistent", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "because", ",", "StoreAccessException", "...", "cleanup", ")", "{", "pacedErrorLog", "(", "\"Ehcache keys {} in possible inconsistent state\"", ",",...
Called when the cache failed to recover from a failing store operation on a list of keys. @param keys @param because exception thrown by the failing operation @param cleanup all the exceptions that occurred during cleanup
[ "Called", "when", "the", "cache", "failed", "to", "recover", "from", "a", "failing", "store", "operation", "on", "a", "list", "of", "keys", "." ]
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java#L157-L159
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java
JDBC4PreparedStatement.setArray
@Override public void setArray(int parameterIndex, Array x) throws SQLException { """ Sets the designated parameter to the given java.sql.Array object. """ checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
java
@Override public void setArray(int parameterIndex, Array x) throws SQLException { checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
[ "@", "Override", "public", "void", "setArray", "(", "int", "parameterIndex", ",", "Array", "x", ")", "throws", "SQLException", "{", "checkParameterBounds", "(", "parameterIndex", ")", ";", "throw", "SQLError", ".", "noSupport", "(", ")", ";", "}" ]
Sets the designated parameter to the given java.sql.Array object.
[ "Sets", "the", "designated", "parameter", "to", "the", "given", "java", ".", "sql", ".", "Array", "object", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L158-L163
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/GlobalizationPreferences.java
GlobalizationPreferences.guessDateFormat
protected DateFormat guessDateFormat(int dateStyle, int timeStyle) { """ This function can be overridden by subclasses to use different heuristics. <b>It MUST return a 'safe' value, one whose modification will not affect this object.</b> @param dateStyle @param timeStyle @hide draft / provisional / internal...
java
protected DateFormat guessDateFormat(int dateStyle, int timeStyle) { DateFormat result; ULocale dfLocale = getAvailableLocale(TYPE_DATEFORMAT); if (dfLocale == null) { dfLocale = ULocale.ROOT; } if (timeStyle == DF_NONE) { result = DateFormat.getDateInstan...
[ "protected", "DateFormat", "guessDateFormat", "(", "int", "dateStyle", ",", "int", "timeStyle", ")", "{", "DateFormat", "result", ";", "ULocale", "dfLocale", "=", "getAvailableLocale", "(", "TYPE_DATEFORMAT", ")", ";", "if", "(", "dfLocale", "==", "null", ")", ...
This function can be overridden by subclasses to use different heuristics. <b>It MUST return a 'safe' value, one whose modification will not affect this object.</b> @param dateStyle @param timeStyle @hide draft / provisional / internal are hidden on Android
[ "This", "function", "can", "be", "overridden", "by", "subclasses", "to", "use", "different", "heuristics", ".", "<b", ">", "It", "MUST", "return", "a", "safe", "value", "one", "whose", "modification", "will", "not", "affect", "this", "object", ".", "<", "/...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/GlobalizationPreferences.java#L915-L929
awslabs/dynamodb-janusgraph-storage-backend
src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java
DynamoDbStoreTransaction.contains
public boolean contains(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column) { """ Determins whether a particular key and column are part of this transaction @param key key to check for existence @param column column to check for existence @return true if both the key and column...
java
public boolean contains(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column) { return expectedValues.containsKey(store) && expectedValues.get(store).containsKey(key) && expectedValues.get(store).get(key).containsKey(column); }
[ "public", "boolean", "contains", "(", "final", "AbstractDynamoDbStore", "store", ",", "final", "StaticBuffer", "key", ",", "final", "StaticBuffer", "column", ")", "{", "return", "expectedValues", ".", "containsKey", "(", "store", ")", "&&", "expectedValues", ".", ...
Determins whether a particular key and column are part of this transaction @param key key to check for existence @param column column to check for existence @return true if both the key and column combination are in this transaction and false otherwise.
[ "Determins", "whether", "a", "particular", "key", "and", "column", "are", "part", "of", "this", "transaction" ]
train
https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java#L87-L91
jfinal/jfinal
src/main/java/com/jfinal/plugin/redis/Cache.java
Cache.zrank
public Long zrank(Object key, Object member) { """ 返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递增(从小到大)顺序排列。 排名以 0 为底,也就是说, score 值最小的成员排名为 0 。 使用 ZREVRANK 命令可以获得成员按 score 值递减(从大到小)排列的排名。 """ Jedis jedis = getJedis(); try { return jedis.zrank(keyToBytes(key), valueToBytes(member)); } finally {cl...
java
public Long zrank(Object key, Object member) { Jedis jedis = getJedis(); try { return jedis.zrank(keyToBytes(key), valueToBytes(member)); } finally {close(jedis);} }
[ "public", "Long", "zrank", "(", "Object", "key", ",", "Object", "member", ")", "{", "Jedis", "jedis", "=", "getJedis", "(", ")", ";", "try", "{", "return", "jedis", ".", "zrank", "(", "keyToBytes", "(", "key", ")", ",", "valueToBytes", "(", "member", ...
返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递增(从小到大)顺序排列。 排名以 0 为底,也就是说, score 值最小的成员排名为 0 。 使用 ZREVRANK 命令可以获得成员按 score 值递减(从大到小)排列的排名。
[ "返回有序集", "key", "中成员", "member", "的排名。其中有序集成员按", "score", "值递增", "(", "从小到大", ")", "顺序排列。", "排名以", "0", "为底,也就是说,", "score", "值最小的成员排名为", "0", "。", "使用", "ZREVRANK", "命令可以获得成员按", "score", "值递减", "(", "从大到小", ")", "排列的排名。" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L1106-L1112
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/CmsVfsTabHandler.java
CmsVfsTabHandler.onSelectFolder
public void onSelectFolder(String folder, boolean selected) { """ This method is called when a folder is selected or deselected in the VFS tab.<p> @param folder the folder which is selected or deselected @param selected true if the folder has been selected, false if it has been deselected """ if...
java
public void onSelectFolder(String folder, boolean selected) { if (selected) { m_controller.addFolder(folder); } else { m_controller.removeFolder(folder); } }
[ "public", "void", "onSelectFolder", "(", "String", "folder", ",", "boolean", "selected", ")", "{", "if", "(", "selected", ")", "{", "m_controller", ".", "addFolder", "(", "folder", ")", ";", "}", "else", "{", "m_controller", ".", "removeFolder", "(", "fold...
This method is called when a folder is selected or deselected in the VFS tab.<p> @param folder the folder which is selected or deselected @param selected true if the folder has been selected, false if it has been deselected
[ "This", "method", "is", "called", "when", "a", "folder", "is", "selected", "or", "deselected", "in", "the", "VFS", "tab", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsVfsTabHandler.java#L156-L163
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/formula/RoundRobinFormulaGenerator.java
RangeMassDecomposer.maybeDecomposable
boolean maybeDecomposable(double from, double to) { """ Check if a mass is decomposable. This is done in constant time (especially: it is very very very fast!). But it doesn't check if there is a valid decomposition. Therefore, even if the method returns true, all decompositions may be invalid for the given vali...
java
boolean maybeDecomposable(double from, double to) { init(); final int[][][] ERTs = this.ERTs; final int[] minmax = new int[2]; //normal version seems to be faster, because it returns after first hit integerBound(from, to, minmax); final int a = weights.get(0).getIntegerMa...
[ "boolean", "maybeDecomposable", "(", "double", "from", ",", "double", "to", ")", "{", "init", "(", ")", ";", "final", "int", "[", "]", "[", "]", "[", "]", "ERTs", "=", "this", ".", "ERTs", ";", "final", "int", "[", "]", "minmax", "=", "new", "int...
Check if a mass is decomposable. This is done in constant time (especially: it is very very very fast!). But it doesn't check if there is a valid decomposition. Therefore, even if the method returns true, all decompositions may be invalid for the given validator or given bounds. #decompose(mass) uses this function befo...
[ "Check", "if", "a", "mass", "is", "decomposable", ".", "This", "is", "done", "in", "constant", "time", "(", "especially", ":", "it", "is", "very", "very", "very", "fast!", ")", ".", "But", "it", "doesn", "t", "check", "if", "there", "is", "a", "valid...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/RoundRobinFormulaGenerator.java#L280-L292
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.colorRes
@NonNull public IconicsDrawable colorRes(@ColorRes int colorResId) { """ Set the color of the drawable. @param colorResId The color resource, from your R file. @return The current IconicsDrawable for chaining. """ return color(ContextCompat.getColor(mContext, colorResId)); }
java
@NonNull public IconicsDrawable colorRes(@ColorRes int colorResId) { return color(ContextCompat.getColor(mContext, colorResId)); }
[ "@", "NonNull", "public", "IconicsDrawable", "colorRes", "(", "@", "ColorRes", "int", "colorResId", ")", "{", "return", "color", "(", "ContextCompat", ".", "getColor", "(", "mContext", ",", "colorResId", ")", ")", ";", "}" ]
Set the color of the drawable. @param colorResId The color resource, from your R file. @return The current IconicsDrawable for chaining.
[ "Set", "the", "color", "of", "the", "drawable", "." ]
train
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L477-L480
cloudant/sync-android
cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchClient.java
CouchClient.revsDiff
public Map<String, MissingRevisions> revsDiff(Map<String, Set<String>> revisions) { """ Returns the subset of given the documentId/revisions that are not stored in the database. The input revisions is a map, whose key is document ID, and value is a list of revisions. An example input could be (in JSON format):...
java
public Map<String, MissingRevisions> revsDiff(Map<String, Set<String>> revisions) { Misc.checkNotNull(revisions, "Input revisions"); URI uri = this.uriHelper.revsDiffUri(); String payload = JSONUtils.toJson(revisions); HttpConnection connection = Http.POST(uri, "application/json"); ...
[ "public", "Map", "<", "String", ",", "MissingRevisions", ">", "revsDiff", "(", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "revisions", ")", "{", "Misc", ".", "checkNotNull", "(", "revisions", ",", "\"Input revisions\"", ")", ";", "URI", "...
Returns the subset of given the documentId/revisions that are not stored in the database. The input revisions is a map, whose key is document ID, and value is a list of revisions. An example input could be (in JSON format): { "03ee06461a12f3c288bb865b22000170": [ "1-b2e54331db828310f3c772d6e042ac9c", "2-3a24009a9525b...
[ "Returns", "the", "subset", "of", "given", "the", "documentId", "/", "revisions", "that", "are", "not", "stored", "in", "the", "database", "." ]
train
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchClient.java#L865-L873
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java
DeprecatedAPIListBuilder.composeDeprecatedList
private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) { """ Add the members into a single list of deprecated members. @param list List of all the particular deprecated members, e.g. methods. @param members members to be added in the list. """ for (int i = 0; i < members.length; i+...
java
private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) { for (int i = 0; i < members.length; i++) { if (Util.isDeprecated(members[i])) { list.add(members[i]); } } }
[ "private", "void", "composeDeprecatedList", "(", "List", "<", "Doc", ">", "list", ",", "MemberDoc", "[", "]", "members", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "members", ".", "length", ";", "i", "++", ")", "{", "if", "(", "Ut...
Add the members into a single list of deprecated members. @param list List of all the particular deprecated members, e.g. methods. @param members members to be added in the list.
[ "Add", "the", "members", "into", "a", "single", "list", "of", "deprecated", "members", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java#L133-L139
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java
DomainsInner.getOwnershipIdentifierAsync
public Observable<DomainOwnershipIdentifierInner> getOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name) { """ Get ownership identifier for domain. Get ownership identifier for domain. @param resourceGroupName Name of the resource group to which the resource belongs. @param doma...
java
public Observable<DomainOwnershipIdentifierInner> getOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name) { return getOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name).map(new Func1<ServiceResponse<DomainOwnershipIdentifierInner>, DomainOwnershipIdent...
[ "public", "Observable", "<", "DomainOwnershipIdentifierInner", ">", "getOwnershipIdentifierAsync", "(", "String", "resourceGroupName", ",", "String", "domainName", ",", "String", "name", ")", "{", "return", "getOwnershipIdentifierWithServiceResponseAsync", "(", "resourceGroup...
Get ownership identifier for domain. Get ownership identifier for domain. @param resourceGroupName Name of the resource group to which the resource belongs. @param domainName Name of domain. @param name Name of identifier. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable...
[ "Get", "ownership", "identifier", "for", "domain", ".", "Get", "ownership", "identifier", "for", "domain", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1452-L1459
JodaOrg/joda-time
src/main/java/org/joda/time/DateTimeZone.java
DateTimeZone.forOffsetMillis
public static DateTimeZone forOffsetMillis(int millisOffset) { """ Gets a time zone instance for the specified offset to UTC in milliseconds. @param millisOffset the offset in millis from UTC, from -23:59:59.999 to +23:59:59.999 @return the DateTimeZone object for the offset """ if (millisOffset <...
java
public static DateTimeZone forOffsetMillis(int millisOffset) { if (millisOffset < -MAX_MILLIS || millisOffset > MAX_MILLIS) { throw new IllegalArgumentException("Millis out of range: " + millisOffset); } String id = printOffset(millisOffset); return fixedOffsetZone(id, millis...
[ "public", "static", "DateTimeZone", "forOffsetMillis", "(", "int", "millisOffset", ")", "{", "if", "(", "millisOffset", "<", "-", "MAX_MILLIS", "||", "millisOffset", ">", "MAX_MILLIS", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Millis out of range...
Gets a time zone instance for the specified offset to UTC in milliseconds. @param millisOffset the offset in millis from UTC, from -23:59:59.999 to +23:59:59.999 @return the DateTimeZone object for the offset
[ "Gets", "a", "time", "zone", "instance", "for", "the", "specified", "offset", "to", "UTC", "in", "milliseconds", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L316-L322
google/j2objc
jre_emul/android/frameworks/base/core/java/android/util/Log.java
Log.println
public static int println(int priority, String tag, String msg) { """ Low-level logging call. @param priority The priority/type of this log message @param tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs. @param msg The message you would l...
java
public static int println(int priority, String tag, String msg) { return println_native(LOG_ID_MAIN, priority, tag, msg); }
[ "public", "static", "int", "println", "(", "int", "priority", ",", "String", "tag", ",", "String", "msg", ")", "{", "return", "println_native", "(", "LOG_ID_MAIN", ",", "priority", ",", "tag", ",", "msg", ")", ";", "}" ]
Low-level logging call. @param priority The priority/type of this log message @param tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs. @param msg The message you would like logged. @return The number of bytes written.
[ "Low", "-", "level", "logging", "call", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/Log.java#L395-L397
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/spider/FieldUpdater.java
FieldUpdater.createFieldUpdater
public static FieldUpdater createFieldUpdater(ObjectUpdater objUpdater, DBObject dbObj, String fieldName) { """ Create a FieldUpdater that will handle updates for the given object and field. @param tableDef {@link TableDefinition} of table in which object resides. @param dbObj {@link DBObject} of ...
java
public static FieldUpdater createFieldUpdater(ObjectUpdater objUpdater, DBObject dbObj, String fieldName) { if (fieldName.charAt(0) == '_') { if (fieldName.equals(CommonDefs.ID_FIELD)) { return new IDFieldUpdater(objUpdater, dbObj); } else { // Allow ...
[ "public", "static", "FieldUpdater", "createFieldUpdater", "(", "ObjectUpdater", "objUpdater", ",", "DBObject", "dbObj", ",", "String", "fieldName", ")", "{", "if", "(", "fieldName", ".", "charAt", "(", "0", ")", "==", "'", "'", ")", "{", "if", "(", "fieldN...
Create a FieldUpdater that will handle updates for the given object and field. @param tableDef {@link TableDefinition} of table in which object resides. @param dbObj {@link DBObject} of object being added, updated, or deleted. @param fieldName Name of field the new FieldUpdater will handle. Can be the...
[ "Create", "a", "FieldUpdater", "that", "will", "handle", "updates", "for", "the", "given", "object", "and", "field", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/FieldUpdater.java#L54-L70
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/util/CmsClientStringUtil.java
CmsClientStringUtil.getStackTrace
public static String getStackTrace(Throwable t, String separator) { """ Returns the stack trace of the Throwable as a string.<p> @param t the Throwable for which the stack trace should be returned @param separator the separator between the lines of the stack trace @return a string representing a stack trace...
java
public static String getStackTrace(Throwable t, String separator) { Throwable cause = t; String result = ""; while (cause != null) { result += getStackTraceAsString(cause.getStackTrace(), separator); cause = cause.getCause(); } return result; }
[ "public", "static", "String", "getStackTrace", "(", "Throwable", "t", ",", "String", "separator", ")", "{", "Throwable", "cause", "=", "t", ";", "String", "result", "=", "\"\"", ";", "while", "(", "cause", "!=", "null", ")", "{", "result", "+=", "getStac...
Returns the stack trace of the Throwable as a string.<p> @param t the Throwable for which the stack trace should be returned @param separator the separator between the lines of the stack trace @return a string representing a stack trace
[ "Returns", "the", "stack", "trace", "of", "the", "Throwable", "as", "a", "string", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsClientStringUtil.java#L100-L109
google/truth
extensions/java8/src/main/java/com/google/common/truth/IntStreamSubject.java
IntStreamSubject.containsAllOf
@SuppressWarnings("GoodTime") // false positive; b/122617528 @CanIgnoreReturnValue public Ordered containsAllOf(int first, int second, int... rest) { """ Fails if the subject does not contain all of the given elements. If an element appears more than once in the given elements, then it must appear at least th...
java
@SuppressWarnings("GoodTime") // false positive; b/122617528 @CanIgnoreReturnValue public Ordered containsAllOf(int first, int second, int... rest) { return check().that(actualList).containsAtLeast(first, second, box(rest)); }
[ "@", "SuppressWarnings", "(", "\"GoodTime\"", ")", "// false positive; b/122617528", "@", "CanIgnoreReturnValue", "public", "Ordered", "containsAllOf", "(", "int", "first", ",", "int", "second", ",", "int", "...", "rest", ")", "{", "return", "check", "(", ")", "...
Fails if the subject does not contain all of the given elements. If an element appears more than once in the given elements, then it must appear at least that number of times in the actual elements. <p>To also test that the contents appear in the given order, make a call to {@code inOrder()} on the object returned by ...
[ "Fails", "if", "the", "subject", "does", "not", "contain", "all", "of", "the", "given", "elements", ".", "If", "an", "element", "appears", "more", "than", "once", "in", "the", "given", "elements", "then", "it", "must", "appear", "at", "least", "that", "n...
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/java8/src/main/java/com/google/common/truth/IntStreamSubject.java#L117-L121
alkacon/opencms-core
src/org/opencms/ade/containerpage/CmsDetailOnlyContainerPageBuilder.java
CmsDetailOnlyContainerPageBuilder.addContainerElement
public void addContainerElement(String name, CmsResource resource) { """ Adds a resource to a container as an element.<p> @param name the container name @param resource the resource to add as a container elementv """ getContainerInfo(name).getResources().add(resource); }
java
public void addContainerElement(String name, CmsResource resource) { getContainerInfo(name).getResources().add(resource); }
[ "public", "void", "addContainerElement", "(", "String", "name", ",", "CmsResource", "resource", ")", "{", "getContainerInfo", "(", "name", ")", ".", "getResources", "(", ")", ".", "add", "(", "resource", ")", ";", "}" ]
Adds a resource to a container as an element.<p> @param name the container name @param resource the resource to add as a container elementv
[ "Adds", "a", "resource", "to", "a", "container", "as", "an", "element", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsDetailOnlyContainerPageBuilder.java#L215-L218
Coveros/selenified
src/main/java/com/coveros/selenified/application/WaitFor.java
WaitFor.promptMatches
public void promptMatches(double seconds, String expectedPromptPattern) { """ Waits up to the provided wait time for a prompt present on the page has content matching the expected text. This information will be logged and recorded, with a screenshot for traceability and added debugging support. @param expecte...
java
public void promptMatches(double seconds, String expectedPromptPattern) { try { double timeTook = popup(seconds); timeTook = popupMatches(seconds - timeTook, expectedPromptPattern); checkPromptMatches(expectedPromptPattern, seconds, timeTook); } catch (TimeoutExceptio...
[ "public", "void", "promptMatches", "(", "double", "seconds", ",", "String", "expectedPromptPattern", ")", "{", "try", "{", "double", "timeTook", "=", "popup", "(", "seconds", ")", ";", "timeTook", "=", "popupMatches", "(", "seconds", "-", "timeTook", ",", "e...
Waits up to the provided wait time for a prompt present on the page has content matching the expected text. This information will be logged and recorded, with a screenshot for traceability and added debugging support. @param expectedPromptPattern the expected text of the prompt @param seconds the number ...
[ "Waits", "up", "to", "the", "provided", "wait", "time", "for", "a", "prompt", "present", "on", "the", "page", "has", "content", "matching", "the", "expected", "text", ".", "This", "information", "will", "be", "logged", "and", "recorded", "with", "a", "scre...
train
https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L646-L654