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
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/UserApi.java
UserApi.createCustomAttribute
public CustomAttribute createCustomAttribute(final Object userIdOrUsername, final String key, final String value) throws GitLabApiException { """ Creates custom attribute for the given user @param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance @param key for the cus...
java
public CustomAttribute createCustomAttribute(final Object userIdOrUsername, final String key, final String value) throws GitLabApiException { if (Objects.isNull(key) || key.trim().isEmpty()) { throw new IllegalArgumentException("Key can't be null or empty"); } if (Objects.isNull(val...
[ "public", "CustomAttribute", "createCustomAttribute", "(", "final", "Object", "userIdOrUsername", ",", "final", "String", "key", ",", "final", "String", "value", ")", "throws", "GitLabApiException", "{", "if", "(", "Objects", ".", "isNull", "(", "key", ")", "||"...
Creates custom attribute for the given user @param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance @param key for the customAttribute @param value or the customAttribute @return the created CustomAttribute @throws GitLabApiException on failure while setting customAttributes
[ "Creates", "custom", "attribute", "for", "the", "given", "user" ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L911-L924
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java
Client.menuRequest
@SuppressWarnings("SameParameterValue") public Message menuRequest(Message.KnownType requestType, Message.MenuIdentifier targetMenu, CdjStatus.TrackSourceSlot slot, Field... arguments) throws IOException { """ Send a request for a menu that we will retrieve i...
java
@SuppressWarnings("SameParameterValue") public Message menuRequest(Message.KnownType requestType, Message.MenuIdentifier targetMenu, CdjStatus.TrackSourceSlot slot, Field... arguments) throws IOException { return menuRequestTyped(requestType, targetMenu, s...
[ "@", "SuppressWarnings", "(", "\"SameParameterValue\"", ")", "public", "Message", "menuRequest", "(", "Message", ".", "KnownType", "requestType", ",", "Message", ".", "MenuIdentifier", "targetMenu", ",", "CdjStatus", ".", "TrackSourceSlot", "slot", ",", "Field", ".....
Send a request for a menu that we will retrieve items from in subsequent requests. This variant works for nearly all menus, but when you are trying to request metadata for an unanalyzed (non-rekordbox) track, you need to use {@link #menuRequestTyped(Message.KnownType, Message.MenuIdentifier, CdjStatus.TrackSourceSlot, ...
[ "Send", "a", "request", "for", "a", "menu", "that", "we", "will", "retrieve", "items", "from", "in", "subsequent", "requests", ".", "This", "variant", "works", "for", "nearly", "all", "menus", "but", "when", "you", "are", "trying", "to", "request", "metada...
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L380-L385
yavijava/yavijava
src/main/java/com/vmware/vim25/mo/VRPResourceManager.java
VRPResourceManager.undeployVM
public void undeployVM(String vrpId, VirtualMachine vm, ClusterComputeResource cluster) throws InvalidState, NotFound, RuntimeFault, RemoteException { """ Undeploy a VM in given VRP, hub pair. @param vrpId The unique Id of the VRP. @param vm VirtualMachine @param cluster Cluster Object @throws Invalid...
java
public void undeployVM(String vrpId, VirtualMachine vm, ClusterComputeResource cluster) throws InvalidState, NotFound, RuntimeFault, RemoteException { getVimService().undeployVM(getMOR(), vrpId, vm.getMOR(), cluster.getMOR()); }
[ "public", "void", "undeployVM", "(", "String", "vrpId", ",", "VirtualMachine", "vm", ",", "ClusterComputeResource", "cluster", ")", "throws", "InvalidState", ",", "NotFound", ",", "RuntimeFault", ",", "RemoteException", "{", "getVimService", "(", ")", ".", "undepl...
Undeploy a VM in given VRP, hub pair. @param vrpId The unique Id of the VRP. @param vm VirtualMachine @param cluster Cluster Object @throws InvalidState @throws NotFound @throws RuntimeFault @throws RemoteException
[ "Undeploy", "a", "VM", "in", "given", "VRP", "hub", "pair", "." ]
train
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/VRPResourceManager.java#L195-L197
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_catalog/NonObservingFSJobCatalog.java
NonObservingFSJobCatalog.remove
@Override public synchronized void remove(URI jobURI) { """ Allow user to programmatically delete a new JobSpec. This method is designed to be reentrant. @param jobURI The relative Path that specified by user, need to make it into complete path. """ Preconditions.checkState(state() == State.RUNNING, St...
java
@Override public synchronized void remove(URI jobURI) { Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName())); try { long startTime = System.currentTimeMillis(); JobSpec jobSpec = getJobSpec(jobURI); Path jobSpecPath = getPathForUR...
[ "@", "Override", "public", "synchronized", "void", "remove", "(", "URI", "jobURI", ")", "{", "Preconditions", ".", "checkState", "(", "state", "(", ")", "==", "State", ".", "RUNNING", ",", "String", ".", "format", "(", "\"%s is not running.\"", ",", "this", ...
Allow user to programmatically delete a new JobSpec. This method is designed to be reentrant. @param jobURI The relative Path that specified by user, need to make it into complete path.
[ "Allow", "user", "to", "programmatically", "delete", "a", "new", "JobSpec", ".", "This", "method", "is", "designed", "to", "be", "reentrant", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_catalog/NonObservingFSJobCatalog.java#L103-L123
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.stringTemplate
public static StringTemplate stringTemplate(String template, List<?> args) { """ Create a new Template expression @param template template @param args template parameters @return template expression """ return stringTemplate(createTemplate(template), args); }
java
public static StringTemplate stringTemplate(String template, List<?> args) { return stringTemplate(createTemplate(template), args); }
[ "public", "static", "StringTemplate", "stringTemplate", "(", "String", "template", ",", "List", "<", "?", ">", "args", ")", "{", "return", "stringTemplate", "(", "createTemplate", "(", "template", ")", ",", "args", ")", ";", "}" ]
Create a new Template expression @param template template @param args template parameters @return template expression
[ "Create", "a", "new", "Template", "expression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L913-L915
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java
GVRTransform.rotate
public void rotate(float w, float x, float y, float z) { """ Modify the tranform's current rotation in quaternion terms. @param w 'W' component of the quaternion. @param x 'X' component of the quaternion. @param y 'Y' component of the quaternion. @param z 'Z' component of the quaternion. """ ...
java
public void rotate(float w, float x, float y, float z) { NativeTransform.rotate(getNative(), w, x, y, z); }
[ "public", "void", "rotate", "(", "float", "w", ",", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "NativeTransform", ".", "rotate", "(", "getNative", "(", ")", ",", "w", ",", "x", ",", "y", ",", "z", ")", ";", "}" ]
Modify the tranform's current rotation in quaternion terms. @param w 'W' component of the quaternion. @param x 'X' component of the quaternion. @param y 'Y' component of the quaternion. @param z 'Z' component of the quaternion.
[ "Modify", "the", "tranform", "s", "current", "rotation", "in", "quaternion", "terms", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java#L428-L430
jenkinsci/jenkins
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
TokenBasedRememberMeServices2.secureCookie
private void secureCookie(Cookie cookie, HttpServletRequest request) { """ Force always the http-only flag and depending on the request, put also the secure flag. """ // if we can mark the cookie HTTP only, do so to protect this cookie even in case of XSS vulnerability. if (SET_HTTP_ONLY!=null)...
java
private void secureCookie(Cookie cookie, HttpServletRequest request){ // if we can mark the cookie HTTP only, do so to protect this cookie even in case of XSS vulnerability. if (SET_HTTP_ONLY!=null) { try { SET_HTTP_ONLY.invoke(cookie,true); } catch (IllegalAccess...
[ "private", "void", "secureCookie", "(", "Cookie", "cookie", ",", "HttpServletRequest", "request", ")", "{", "// if we can mark the cookie HTTP only, do so to protect this cookie even in case of XSS vulnerability.", "if", "(", "SET_HTTP_ONLY", "!=", "null", ")", "{", "try", "{...
Force always the http-only flag and depending on the request, put also the secure flag.
[ "Force", "always", "the", "http", "-", "only", "flag", "and", "depending", "on", "the", "request", "put", "also", "the", "secure", "flag", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java#L309-L323
redkale/redkale
src/org/redkale/util/ResourceFactory.java
ResourceFactory.register
public <A> A register(final String name, final Type clazz, final A rs) { """ 将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源 @param <A> 泛型 @param name 资源名 @param clazz 资源类型 @param rs 资源对象 @return 旧资源对象 """ return register(true, name, clazz, rs); }
java
public <A> A register(final String name, final Type clazz, final A rs) { return register(true, name, clazz, rs); }
[ "public", "<", "A", ">", "A", "register", "(", "final", "String", "name", ",", "final", "Type", "clazz", ",", "final", "A", "rs", ")", "{", "return", "register", "(", "true", ",", "name", ",", "clazz", ",", "rs", ")", ";", "}" ]
将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源 @param <A> 泛型 @param name 资源名 @param clazz 资源类型 @param rs 资源对象 @return 旧资源对象
[ "将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源" ]
train
https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L386-L388
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/LifecycleParticipant.java
LifecycleParticipant.deliverLifecycleAnnouncement
protected void deliverLifecycleAnnouncement(final Logger logger, final boolean starting) { """ Send a lifecycle announcement to all registered listeners. @param logger the logger to use, so the log entry shows as belonging to the proper subclass. @param starting will be {@code true} if the DeviceFinder is star...
java
protected void deliverLifecycleAnnouncement(final Logger logger, final boolean starting) { new Thread(new Runnable() { @Override public void run() { for (final LifecycleListener listener : getLifecycleListeners()) { try { if (st...
[ "protected", "void", "deliverLifecycleAnnouncement", "(", "final", "Logger", "logger", ",", "final", "boolean", "starting", ")", "{", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "for", "(...
Send a lifecycle announcement to all registered listeners. @param logger the logger to use, so the log entry shows as belonging to the proper subclass. @param starting will be {@code true} if the DeviceFinder is starting, {@code false} if it is stopping.
[ "Send", "a", "lifecycle", "announcement", "to", "all", "registered", "listeners", "." ]
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/LifecycleParticipant.java#L69-L86
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
SameDiff.putFunctionForId
public void putFunctionForId(String id, DifferentialFunction function) { """ Put the function for the given id @param id the id of the function @param function the function """ if (ops.containsKey(id) && ops.get(id).getOp() == null) { throw new ND4JIllegalStateException("Function ...
java
public void putFunctionForId(String id, DifferentialFunction function) { if (ops.containsKey(id) && ops.get(id).getOp() == null) { throw new ND4JIllegalStateException("Function by id already exists!"); } else if (function instanceof SDVariable) { throw new ND4JIllegalStateExcepti...
[ "public", "void", "putFunctionForId", "(", "String", "id", ",", "DifferentialFunction", "function", ")", "{", "if", "(", "ops", ".", "containsKey", "(", "id", ")", "&&", "ops", ".", "get", "(", "id", ")", ".", "getOp", "(", ")", "==", "null", ")", "{...
Put the function for the given id @param id the id of the function @param function the function
[ "Put", "the", "function", "for", "the", "given", "id" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L519-L531
jiaqi/jcli
src/main/java/org/cyclopsgroup/jcli/ArgumentProcessor.java
ArgumentProcessor.forType
public static <T> ArgumentProcessor<T> forType(Class<? extends T> beanType) { """ Create new instance with default parser, a {@link GnuParser} @param <T> Type of the bean @param beanType Type of the bean @return Instance of an implementation of argument processor """ return newInstance(beanType, new G...
java
public static <T> ArgumentProcessor<T> forType(Class<? extends T> beanType) { return newInstance(beanType, new GnuParser()); }
[ "public", "static", "<", "T", ">", "ArgumentProcessor", "<", "T", ">", "forType", "(", "Class", "<", "?", "extends", "T", ">", "beanType", ")", "{", "return", "newInstance", "(", "beanType", ",", "new", "GnuParser", "(", ")", ")", ";", "}" ]
Create new instance with default parser, a {@link GnuParser} @param <T> Type of the bean @param beanType Type of the bean @return Instance of an implementation of argument processor
[ "Create", "new", "instance", "with", "default", "parser", "a", "{", "@link", "GnuParser", "}" ]
train
https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/ArgumentProcessor.java#L25-L27
hdbeukel/james-extensions
src/main/java/org/jamesframework/ext/problems/objectives/WeightedIndex.java
WeightedIndex.addObjective
public void addObjective(Objective<? super SolutionType, ? super DataType> objective, double weight) { """ Add an objective with corresponding weight. Any objective designed for the solution type and data type of this multi-objective (or for more general solution or data types) can be added. The specified weight ...
java
public void addObjective(Objective<? super SolutionType, ? super DataType> objective, double weight) { // check weight if(weight > 0.0){ // add objective to map weights.put(objective, weight); } else { throw new IllegalArgumentException("Error in weighted inde...
[ "public", "void", "addObjective", "(", "Objective", "<", "?", "super", "SolutionType", ",", "?", "super", "DataType", ">", "objective", ",", "double", "weight", ")", "{", "// check weight", "if", "(", "weight", ">", "0.0", ")", "{", "// add objective to map", ...
Add an objective with corresponding weight. Any objective designed for the solution type and data type of this multi-objective (or for more general solution or data types) can be added. The specified weight should be strictly positive, if not, an exception will be thrown. @param objective objective to be added @param ...
[ "Add", "an", "objective", "with", "corresponding", "weight", ".", "Any", "objective", "designed", "for", "the", "solution", "type", "and", "data", "type", "of", "this", "multi", "-", "objective", "(", "or", "for", "more", "general", "solution", "or", "data",...
train
https://github.com/hdbeukel/james-extensions/blob/37a43aa6ac4d67575cabc7aed25fd96c91d4c7b2/src/main/java/org/jamesframework/ext/problems/objectives/WeightedIndex.java#L58-L66
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java
WaveformPreviewComponent.updateWaveform
private void updateWaveform(WaveformPreview preview) { """ Create an image of the proper size to hold a new waveform preview image and draw it. """ this.preview.set(preview); if (preview == null) { waveformImage.set(null); } else { BufferedImage image = new Buffe...
java
private void updateWaveform(WaveformPreview preview) { this.preview.set(preview); if (preview == null) { waveformImage.set(null); } else { BufferedImage image = new BufferedImage(preview.segmentCount, preview.maxHeight, BufferedImage.TYPE_INT_RGB); Graphics g ...
[ "private", "void", "updateWaveform", "(", "WaveformPreview", "preview", ")", "{", "this", ".", "preview", ".", "set", "(", "preview", ")", ";", "if", "(", "preview", "==", "null", ")", "{", "waveformImage", ".", "set", "(", "null", ")", ";", "}", "else...
Create an image of the proper size to hold a new waveform preview image and draw it.
[ "Create", "an", "image", "of", "the", "proper", "size", "to", "hold", "a", "new", "waveform", "preview", "image", "and", "draw", "it", "." ]
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java#L420-L439
google/closure-compiler
src/com/google/javascript/jscomp/RemoveUnusedCode.java
RemoveUnusedCode.process
@Override public void process(Node externs, Node root) { """ Traverses the root, removing all unused variables. Multiple traversals may occur to ensure all unused variables are removed. """ checkState(compiler.getLifeCycleStage().isNormalized()); if (!allowRemovalOfExternProperties) { referenc...
java
@Override public void process(Node externs, Node root) { checkState(compiler.getLifeCycleStage().isNormalized()); if (!allowRemovalOfExternProperties) { referencedPropertyNames.addAll(compiler.getExternProperties()); } traverseAndRemoveUnusedReferences(root); // This pass may remove definiti...
[ "@", "Override", "public", "void", "process", "(", "Node", "externs", ",", "Node", "root", ")", "{", "checkState", "(", "compiler", ".", "getLifeCycleStage", "(", ")", ".", "isNormalized", "(", ")", ")", ";", "if", "(", "!", "allowRemovalOfExternProperties",...
Traverses the root, removing all unused variables. Multiple traversals may occur to ensure all unused variables are removed.
[ "Traverses", "the", "root", "removing", "all", "unused", "variables", ".", "Multiple", "traversals", "may", "occur", "to", "ensure", "all", "unused", "variables", "are", "removed", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RemoveUnusedCode.java#L242-L251
before/uadetector
modules/uadetector-resources/src/main/java/net/sf/uadetector/service/UADetectorServiceFactory.java
UADetectorServiceFactory.getCachingAndUpdatingParser
public static UserAgentStringParser getCachingAndUpdatingParser(final URL dataUrl, final URL versionUrl, final URL fallbackDataURL, final URL fallbackVersionURL) { """ Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of <em>UAS data</em> (also known as ...
java
public static UserAgentStringParser getCachingAndUpdatingParser(final URL dataUrl, final URL versionUrl, final URL fallbackDataURL, final URL fallbackVersionURL) { return CachingAndUpdatingParserHolder.getParser(dataUrl, versionUrl, getCustomFallbackXmlDataStore(fallbackDataURL, fallbackVersionURL)); }
[ "public", "static", "UserAgentStringParser", "getCachingAndUpdatingParser", "(", "final", "URL", "dataUrl", ",", "final", "URL", "versionUrl", ",", "final", "URL", "fallbackDataURL", ",", "final", "URL", "fallbackVersionURL", ")", "{", "return", "CachingAndUpdatingParse...
Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of <em>UAS data</em> (also known as database). When newer data available, it automatically loads and updates it. Additionally the loaded data are stored in a cache file. <p> At initialization time the returned...
[ "Returns", "an", "implementation", "of", "{", "@link", "UserAgentStringParser", "}", "which", "checks", "at", "regular", "intervals", "for", "new", "versions", "of", "<em", ">", "UAS", "data<", "/", "em", ">", "(", "also", "known", "as", "database", ")", "...
train
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-resources/src/main/java/net/sf/uadetector/service/UADetectorServiceFactory.java#L206-L208
pietermartin/sqlg
sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java
Partition.createRangeSubPartitionWithPartition
private static Partition createRangeSubPartitionWithPartition( SqlgGraph sqlgGraph, Partition parentPartition, String name, String from, String to, PartitionType partitionType, String partitionExpression) { """ Create a range parti...
java
private static Partition createRangeSubPartitionWithPartition( SqlgGraph sqlgGraph, Partition parentPartition, String name, String from, String to, PartitionType partitionType, String partitionExpression) { Preconditions.checkA...
[ "private", "static", "Partition", "createRangeSubPartitionWithPartition", "(", "SqlgGraph", "sqlgGraph", ",", "Partition", "parentPartition", ",", "String", "name", ",", "String", "from", ",", "String", "to", ",", "PartitionType", "partitionType", ",", "String", "part...
Create a range partition on an existing {@link Partition} @param sqlgGraph @param parentPartition @param name @param from @param to @return
[ "Create", "a", "range", "partition", "on", "an", "existing", "{", "@link", "Partition", "}" ]
train
https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java#L353-L368
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataSomeValuesFromImpl_CustomFieldSerializer.java
OWLDataSomeValuesFromImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataSomeValuesFromImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.g...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataSomeValuesFromImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLDataSomeValuesFromImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.clie...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataSomeValuesFromImpl_CustomFieldSerializer.java#L72-L75
BBN-E/bue-common-open
common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java
FileUtils.asCompressedCharSource
public static CharSource asCompressedCharSource(File f, Charset charSet) throws IOException { """ Just like {@link Files#asCharSource(java.io.File, java.nio.charset.Charset)}, but decompresses the incoming data using GZIP. """ return asCompressedByteSource(f).asCharSource(charSet); }
java
public static CharSource asCompressedCharSource(File f, Charset charSet) throws IOException { return asCompressedByteSource(f).asCharSource(charSet); }
[ "public", "static", "CharSource", "asCompressedCharSource", "(", "File", "f", ",", "Charset", "charSet", ")", "throws", "IOException", "{", "return", "asCompressedByteSource", "(", "f", ")", ".", "asCharSource", "(", "charSet", ")", ";", "}" ]
Just like {@link Files#asCharSource(java.io.File, java.nio.charset.Charset)}, but decompresses the incoming data using GZIP.
[ "Just", "like", "{" ]
train
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L816-L818
samskivert/samskivert
src/main/java/com/samskivert/util/ListUtil.java
ListUtil.removeRef
public static Object removeRef (Object[] list, Object element) { """ Removes the first element that is referentially equal to the supplied element (<code>list[idx] == element</code>). The elements after the removed element will be slid down the array one spot to fill the place of the removed element. @return...
java
public static Object removeRef (Object[] list, Object element) { return remove(REFERENCE_COMP, list, element); }
[ "public", "static", "Object", "removeRef", "(", "Object", "[", "]", "list", ",", "Object", "element", ")", "{", "return", "remove", "(", "REFERENCE_COMP", ",", "list", ",", "element", ")", ";", "}" ]
Removes the first element that is referentially equal to the supplied element (<code>list[idx] == element</code>). The elements after the removed element will be slid down the array one spot to fill the place of the removed element. @return the object that was removed from the array or null if no matching object was f...
[ "Removes", "the", "first", "element", "that", "is", "referentially", "equal", "to", "the", "supplied", "element", "(", "<code", ">", "list", "[", "idx", "]", "==", "element<", "/", "code", ">", ")", ".", "The", "elements", "after", "the", "removed", "ele...
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L368-L371
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/GtinValidator.java
GtinValidator.isValid
@Override public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) { """ {@inheritDoc} check if given string is a valid gtin. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext) """ final String valueAsSt...
java
@Override public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) { final String valueAsString = Objects.toString(pvalue, null); if (StringUtils.isEmpty(valueAsString)) { return true; } if (!StringUtils.isNumeric(valueAsString)) { // EAN must be numeric...
[ "@", "Override", "public", "final", "boolean", "isValid", "(", "final", "Object", "pvalue", ",", "final", "ConstraintValidatorContext", "pcontext", ")", "{", "final", "String", "valueAsString", "=", "Objects", ".", "toString", "(", "pvalue", ",", "null", ")", ...
{@inheritDoc} check if given string is a valid gtin. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
[ "{", "@inheritDoc", "}", "check", "if", "given", "string", "is", "a", "valid", "gtin", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/GtinValidator.java#L57-L74
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/map/AbstractIntDoubleMap.java
AbstractIntDoubleMap.keyOf
public int keyOf(final double value) { """ Returns the first key the given value is associated with. It is often a good idea to first check with {@link #containsValue(double)} whether there exists an association from a key to this value. Search order is guaranteed to be <i>identical</i> to the order used by meth...
java
public int keyOf(final double value) { final int[] foundKey = new int[1]; boolean notFound = forEachPair( new IntDoubleProcedure() { public boolean apply(int iterKey, double iterValue) { boolean found = value == iterValue; if (found) foundKey[0] = iterKey; return !found; } } ); if (notFound) r...
[ "public", "int", "keyOf", "(", "final", "double", "value", ")", "{", "final", "int", "[", "]", "foundKey", "=", "new", "int", "[", "1", "]", ";", "boolean", "notFound", "=", "forEachPair", "(", "new", "IntDoubleProcedure", "(", ")", "{", "public", "boo...
Returns the first key the given value is associated with. It is often a good idea to first check with {@link #containsValue(double)} whether there exists an association from a key to this value. Search order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(IntProcedure)}. @param valu...
[ "Returns", "the", "first", "key", "the", "given", "value", "is", "associated", "with", ".", "It", "is", "often", "a", "good", "idea", "to", "first", "check", "with", "{", "@link", "#containsValue", "(", "double", ")", "}", "whether", "there", "exists", "...
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractIntDoubleMap.java#L200-L213
ktoso/janbanery
janbanery-core/src/main/java/pl/project13/janbanery/core/JanbaneryFactory.java
JanbaneryFactory.connectAndKeepUsing
public Janbanery connectAndKeepUsing(String user, String password) throws ServerCommunicationException { """ This method will connect to kanbanery via basic user/pass authentication <strong>and will keep using it until forced to switch modes!</strong>. This method is not encouraged, you should use {@link Janbane...
java
public Janbanery connectAndKeepUsing(String user, String password) throws ServerCommunicationException { DefaultConfiguration conf = new DefaultConfiguration(user, password); RestClient restClient = getRestClient(conf); return new Janbanery(conf, restClient); }
[ "public", "Janbanery", "connectAndKeepUsing", "(", "String", "user", ",", "String", "password", ")", "throws", "ServerCommunicationException", "{", "DefaultConfiguration", "conf", "=", "new", "DefaultConfiguration", "(", "user", ",", "password", ")", ";", "RestClient"...
This method will connect to kanbanery via basic user/pass authentication <strong>and will keep using it until forced to switch modes!</strong>. This method is not encouraged, you should use {@link JanbaneryFactory#connectUsing(String, String)} and allow Janbanery to switch to apiKey mode as soon as it load's up to incr...
[ "This", "method", "will", "connect", "to", "kanbanery", "via", "basic", "user", "/", "pass", "authentication", "<strong", ">", "and", "will", "keep", "using", "it", "until", "forced", "to", "switch", "modes!<", "/", "strong", ">", ".", "This", "method", "i...
train
https://github.com/ktoso/janbanery/blob/cd77b774814c7fbb2a0c9c55d4c3f7e76affa636/janbanery-core/src/main/java/pl/project13/janbanery/core/JanbaneryFactory.java#L115-L119
virgo47/javasimon
core/src/main/java/org/javasimon/proxy/DelegatingProxyFactory.java
DelegatingProxyFactory.newProxy
public Object newProxy(ClassLoader classLoader, Class<?>... interfaces) { """ Create a proxy using given classloader and interfaces @param classLoader Class loader @param interfaces Interfaces to implement @return Proxy """ return Proxy.newProxyInstance(classLoader, interfaces, this); }
java
public Object newProxy(ClassLoader classLoader, Class<?>... interfaces) { return Proxy.newProxyInstance(classLoader, interfaces, this); }
[ "public", "Object", "newProxy", "(", "ClassLoader", "classLoader", ",", "Class", "<", "?", ">", "...", "interfaces", ")", "{", "return", "Proxy", ".", "newProxyInstance", "(", "classLoader", ",", "interfaces", ",", "this", ")", ";", "}" ]
Create a proxy using given classloader and interfaces @param classLoader Class loader @param interfaces Interfaces to implement @return Proxy
[ "Create", "a", "proxy", "using", "given", "classloader", "and", "interfaces" ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/proxy/DelegatingProxyFactory.java#L56-L58
inkstand-io/scribble
scribble-file/src/main/java/io/inkstand/scribble/rules/TemporaryZipFile.java
TemporaryZipFile.addEntry
private void addEntry(final Path pathToFile, final URL resource) throws IOException { """ Creates an entry under the specifeid path with the content from the provided resource. @param pathToFile the path to the file in the zip file. @param resource the resource providing the content for the file. Must not be...
java
private void addEntry(final Path pathToFile, final URL resource) throws IOException { final Path parent = pathToFile.getParent(); if (parent != null) { addFolder(parent); } try (InputStream inputStream = resource.openStream()) { Files.copy(inputStream, pathToFile...
[ "private", "void", "addEntry", "(", "final", "Path", "pathToFile", ",", "final", "URL", "resource", ")", "throws", "IOException", "{", "final", "Path", "parent", "=", "pathToFile", ".", "getParent", "(", ")", ";", "if", "(", "parent", "!=", "null", ")", ...
Creates an entry under the specifeid path with the content from the provided resource. @param pathToFile the path to the file in the zip file. @param resource the resource providing the content for the file. Must not be null. @throws IOException
[ "Creates", "an", "entry", "under", "the", "specifeid", "path", "with", "the", "content", "from", "the", "provided", "resource", "." ]
train
https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-file/src/main/java/io/inkstand/scribble/rules/TemporaryZipFile.java#L146-L155
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/SweepHullDelaunay2D.java
SweepHullDelaunay2D.quadraticEuclidean
public static double quadraticEuclidean(double[] v1, double[] v2) { """ Squared euclidean distance. 2d. @param v1 First double[] @param v2 Second double[] @return Quadratic distance """ final double d1 = v1[0] - v2[0], d2 = v1[1] - v2[1]; return (d1 * d1) + (d2 * d2); }
java
public static double quadraticEuclidean(double[] v1, double[] v2) { final double d1 = v1[0] - v2[0], d2 = v1[1] - v2[1]; return (d1 * d1) + (d2 * d2); }
[ "public", "static", "double", "quadraticEuclidean", "(", "double", "[", "]", "v1", ",", "double", "[", "]", "v2", ")", "{", "final", "double", "d1", "=", "v1", "[", "0", "]", "-", "v2", "[", "0", "]", ",", "d2", "=", "v1", "[", "1", "]", "-", ...
Squared euclidean distance. 2d. @param v1 First double[] @param v2 Second double[] @return Quadratic distance
[ "Squared", "euclidean", "distance", ".", "2d", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/SweepHullDelaunay2D.java#L693-L696
banq/jdonframework
src/main/java/com/jdon/util/ObjectCreator.java
ObjectCreator.createObject
public static Object createObject(Class classObject, Object[] params) throws Exception { """ Instantaite an Object instance, requires a constractor with parameters @param classObject , Class object representing the object type to be instantiated @param params an array including the required parameters to ins...
java
public static Object createObject(Class classObject, Object[] params) throws Exception { Constructor[] constructors = classObject.getConstructors(); Object object = null; for (int counter = 0; counter < constructors.length; counter++) { try { object = constructors[counter].newInstance(params); } c...
[ "public", "static", "Object", "createObject", "(", "Class", "classObject", ",", "Object", "[", "]", "params", ")", "throws", "Exception", "{", "Constructor", "[", "]", "constructors", "=", "classObject", ".", "getConstructors", "(", ")", ";", "Object", "object...
Instantaite an Object instance, requires a constractor with parameters @param classObject , Class object representing the object type to be instantiated @param params an array including the required parameters to instantaite the object @return the instantaied Object @exception java.lang.Exception if instantiation fail...
[ "Instantaite", "an", "Object", "instance", "requires", "a", "constractor", "with", "parameters" ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/ObjectCreator.java#L75-L90
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/upload/CommonsPortlet2MultipartResolver.java
CommonsPortlet2MultipartResolver.parseRequest
protected MultipartParsingResult parseRequest(ResourceRequest request) throws MultipartException { """ <p>parseRequest.</p> @param request a {@link javax.portlet.ResourceRequest} object. @return a MultipartParsingResult object. @throws org.springframework.web.multipart.MultipartException if any. """ ...
java
protected MultipartParsingResult parseRequest(ResourceRequest request) throws MultipartException { String encoding = determineEncoding(request); FileUpload fileUpload = prepareFileUpload(encoding); try { @SuppressWarnings("unchecked") List<FileItem> fileItems = ((Portlet2...
[ "protected", "MultipartParsingResult", "parseRequest", "(", "ResourceRequest", "request", ")", "throws", "MultipartException", "{", "String", "encoding", "=", "determineEncoding", "(", "request", ")", ";", "FileUpload", "fileUpload", "=", "prepareFileUpload", "(", "enco...
<p>parseRequest.</p> @param request a {@link javax.portlet.ResourceRequest} object. @return a MultipartParsingResult object. @throws org.springframework.web.multipart.MultipartException if any.
[ "<p", ">", "parseRequest", ".", "<", "/", "p", ">" ]
train
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/upload/CommonsPortlet2MultipartResolver.java#L122-L134
sarxos/win-registry
src/main/java/com/github/sarxos/winreg/WindowsRegistry.java
WindowsRegistry.readString
public String readString(HKey hk, String key, String valueName, String charsetName) throws RegistryException { """ Read a value from key and value name @param hk the HKEY @param key the key @param valueName the value name @param charsetName which charset to use @return String value @throws RegistryExceptio...
java
public String readString(HKey hk, String key, String valueName, String charsetName) throws RegistryException { try { return ReflectedMethods.readString(hk.root(), hk.hex(), key, valueName, charsetName); } catch (Exception e) { throw new RegistryException("Cannot read " + valueName + " value from key " + k...
[ "public", "String", "readString", "(", "HKey", "hk", ",", "String", "key", ",", "String", "valueName", ",", "String", "charsetName", ")", "throws", "RegistryException", "{", "try", "{", "return", "ReflectedMethods", ".", "readString", "(", "hk", ".", "root", ...
Read a value from key and value name @param hk the HKEY @param key the key @param valueName the value name @param charsetName which charset to use @return String value @throws RegistryException when something is not right
[ "Read", "a", "value", "from", "key", "and", "value", "name" ]
train
https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L59-L65
Mozu/mozu-java
mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CouponSetUrl.java
CouponSetUrl.getCouponSetsUrl
public static MozuUrl getCouponSetsUrl(String filter, Boolean includeCounts, Integer pageSize, String responseFields, String sortBy, Integer startIndex) { """ Get Resource Url for GetCouponSets @param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Re...
java
public static MozuUrl getCouponSetsUrl(String filter, Boolean includeCounts, Integer pageSize, String responseFields, String sortBy, Integer startIndex) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&i...
[ "public", "static", "MozuUrl", "getCouponSetsUrl", "(", "String", "filter", ",", "Boolean", "includeCounts", ",", "Integer", "pageSize", ",", "String", "responseFields", ",", "String", "sortBy", ",", "Integer", "startIndex", ")", "{", "UrlFormatter", "formatter", ...
Get Resource Url for GetCouponSets @param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters. @param includeCounts Specifies whether to inc...
[ "Get", "Resource", "Url", "for", "GetCouponSets" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CouponSetUrl.java#L26-L36
netty/netty
microbench/src/main/java/io/netty/handler/codec/http2/HpackHeader.java
HpackHeader.createHeaders
static List<HpackHeader> createHeaders(int numHeaders, int nameLength, int valueLength, boolean limitToAscii) { """ Creates a number of random headers with the given name/value lengths. """ List<HpackHeader> hpackHeaders = new ArrayList<HpackHeader>(numHeaders...
java
static List<HpackHeader> createHeaders(int numHeaders, int nameLength, int valueLength, boolean limitToAscii) { List<HpackHeader> hpackHeaders = new ArrayList<HpackHeader>(numHeaders); for (int i = 0; i < numHeaders; ++i) { byte[] name = randomBytes...
[ "static", "List", "<", "HpackHeader", ">", "createHeaders", "(", "int", "numHeaders", ",", "int", "nameLength", ",", "int", "valueLength", ",", "boolean", "limitToAscii", ")", "{", "List", "<", "HpackHeader", ">", "hpackHeaders", "=", "new", "ArrayList", "<", ...
Creates a number of random headers with the given name/value lengths.
[ "Creates", "a", "number", "of", "random", "headers", "with", "the", "given", "name", "/", "value", "lengths", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/microbench/src/main/java/io/netty/handler/codec/http2/HpackHeader.java#L58-L67
playn/playn
scene/src/playn/scene/LayerUtil.java
LayerUtil.layerToScreen
public static Point layerToScreen(Layer layer, float x, float y) { """ Converts the supplied point from coordinates relative to the specified layer to screen coordinates. """ Point into = new Point(x, y); return layerToScreen(layer, into, into); }
java
public static Point layerToScreen(Layer layer, float x, float y) { Point into = new Point(x, y); return layerToScreen(layer, into, into); }
[ "public", "static", "Point", "layerToScreen", "(", "Layer", "layer", ",", "float", "x", ",", "float", "y", ")", "{", "Point", "into", "=", "new", "Point", "(", "x", ",", "y", ")", ";", "return", "layerToScreen", "(", "layer", ",", "into", ",", "into"...
Converts the supplied point from coordinates relative to the specified layer to screen coordinates.
[ "Converts", "the", "supplied", "point", "from", "coordinates", "relative", "to", "the", "specified", "layer", "to", "screen", "coordinates", "." ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/LayerUtil.java#L44-L47
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/variant/css/CssSkinGenerator.java
CssSkinGenerator.getVariants
private Map<String, VariantSet> getVariants(ResourceBrowser rsBrowser, String rootDir, String defaultSkinName, String defaultLocaleName, boolean mappingSkinLocale) { """ Initialize the skinMapping from the parent path @param rsBrowser the resource browser @param rootDir the skin root dir path @param defa...
java
private Map<String, VariantSet> getVariants(ResourceBrowser rsBrowser, String rootDir, String defaultSkinName, String defaultLocaleName, boolean mappingSkinLocale) { Set<String> paths = rsBrowser.getResourceNames(rootDir); Set<String> skinNames = new HashSet<>(); Set<String> localeVariants = new HashSet<>(); ...
[ "private", "Map", "<", "String", ",", "VariantSet", ">", "getVariants", "(", "ResourceBrowser", "rsBrowser", ",", "String", "rootDir", ",", "String", "defaultSkinName", ",", "String", "defaultLocaleName", ",", "boolean", "mappingSkinLocale", ")", "{", "Set", "<", ...
Initialize the skinMapping from the parent path @param rsBrowser the resource browser @param rootDir the skin root dir path @param defaultSkinName the default skin name @param defaultLocaleName the default locale name
[ "Initialize", "the", "skinMapping", "from", "the", "parent", "path" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/variant/css/CssSkinGenerator.java#L504-L531
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/JFapUtils.java
JFapUtils.debugTraceWsByteBuffer
public static void debugTraceWsByteBuffer(Object _this, TraceComponent _tc, WsByteBuffer buffer, int amount, String comment) { """ Produces a debug trace entry for a WsByteBuffer. This should be used as follows: <code> if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) debugTraceWsByteBuffer(...)...
java
public static void debugTraceWsByteBuffer(Object _this, TraceComponent _tc, WsByteBuffer buffer, int amount, String comment) { byte[] data = null; int start; int count = amount; if (count > buffer.remaining()) count = buffer.remaining(); if (buffer.hasArray()) { data = b...
[ "public", "static", "void", "debugTraceWsByteBuffer", "(", "Object", "_this", ",", "TraceComponent", "_tc", ",", "WsByteBuffer", "buffer", ",", "int", "amount", ",", "String", "comment", ")", "{", "byte", "[", "]", "data", "=", "null", ";", "int", "start", ...
Produces a debug trace entry for a WsByteBuffer. This should be used as follows: <code> if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) debugTraceWsByteBuffer(...); </code> @param _this Reference to the object invoking this method. @param _tc Reference to TraceComponent to use for outputing trac...
[ "Produces", "a", "debug", "trace", "entry", "for", "a", "WsByteBuffer", ".", "This", "should", "be", "used", "as", "follows", ":", "<code", ">", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "()", "&&", "tc", ".", "isDebugEnabled", "()", ")", "d...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/JFapUtils.java#L50-L82
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.getIntentSuggestionsAsync
public Observable<List<IntentsSuggestionExample>> getIntentSuggestionsAsync(UUID appId, String versionId, UUID intentId, GetIntentSuggestionsOptionalParameter getIntentSuggestionsOptionalParameter) { """ Suggests examples that would improve the accuracy of the intent model. @param appId The application ID. @pa...
java
public Observable<List<IntentsSuggestionExample>> getIntentSuggestionsAsync(UUID appId, String versionId, UUID intentId, GetIntentSuggestionsOptionalParameter getIntentSuggestionsOptionalParameter) { return getIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, getIntentSuggestionsOptionalPara...
[ "public", "Observable", "<", "List", "<", "IntentsSuggestionExample", ">", ">", "getIntentSuggestionsAsync", "(", "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 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#L5100-L5107
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.modifyModule
public T modifyModule(final String moduleName, final String slot, final byte[] existingHash, final byte[] newHash) { """ Modify a module. @param moduleName the module name @param slot the module slot @param existingHash the existing hash @param newHash the new hash of the modified content @return the builde...
java
public T modifyModule(final String moduleName, final String slot, final byte[] existingHash, final byte[] newHash) { final ContentItem item = createModuleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.MODIFY, existingHash)); return return...
[ "public", "T", "modifyModule", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "existingHash", ",", "final", "byte", "[", "]", "newHash", ")", "{", "final", "ContentItem", "item", "=", "createModuleItem",...
Modify a module. @param moduleName the module name @param slot the module slot @param existingHash the existing hash @param newHash the new hash of the modified content @return the builder
[ "Modify", "a", "module", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L189-L193
haifengl/smile
plot/src/main/java/smile/plot/PlotCanvas.java
PlotCanvas.screeplot
public static PlotCanvas screeplot(PCA pca) { """ Create a scree plot for PCA. @param pca principal component analysis object. """ int n = pca.getVarianceProportion().length; double[] lowerBound = {0, 0.0}; double[] upperBound = {n + 1, 1.0}; PlotCanvas canvas = new PlotCanva...
java
public static PlotCanvas screeplot(PCA pca) { int n = pca.getVarianceProportion().length; double[] lowerBound = {0, 0.0}; double[] upperBound = {n + 1, 1.0}; PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false); canvas.setAxisLabels("Principal Component", "Proporti...
[ "public", "static", "PlotCanvas", "screeplot", "(", "PCA", "pca", ")", "{", "int", "n", "=", "pca", ".", "getVarianceProportion", "(", ")", ".", "length", ";", "double", "[", "]", "lowerBound", "=", "{", "0", ",", "0.0", "}", ";", "double", "[", "]",...
Create a scree plot for PCA. @param pca principal component analysis object.
[ "Create", "a", "scree", "plot", "for", "PCA", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/PlotCanvas.java#L2249-L2285
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java
CFEndPointSerializer.determineType
static private StringBuilder determineType(String name, Object o) { """ Determine the type of the Object passed in and add the XML format for the result. @param type @param name @param o @return StringBuilder """ String value = null; if (o instanceof String || o instanceof StringBuffer |...
java
static private StringBuilder determineType(String name, Object o) { String value = null; if (o instanceof String || o instanceof StringBuffer || o instanceof java.nio.CharBuffer || o instanceof Integer || o instanceof Long || o instanceof Byte || o instanceof Double || o instanceof Float || ...
[ "static", "private", "StringBuilder", "determineType", "(", "String", "name", ",", "Object", "o", ")", "{", "String", "value", "=", "null", ";", "if", "(", "o", "instanceof", "String", "||", "o", "instanceof", "StringBuffer", "||", "o", "instanceof", "java",...
Determine the type of the Object passed in and add the XML format for the result. @param type @param name @param o @return StringBuilder
[ "Determine", "the", "type", "of", "the", "Object", "passed", "in", "and", "add", "the", "XML", "format", "for", "the", "result", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java#L48-L77
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.lookAt
public Matrix4f lookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ, Matrix4f dest) { """ Apply a "lookat" transformation to this matrix for a right-handed coordinate system, that aligns <code...
java
public Matrix4f lookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ, Matrix4f dest) { if ((properties & PROPERTY_IDENTITY) != 0) return dest.setLookAt(eyeX, eyeY, eyeZ, centerX, ...
[ "public", "Matrix4f", "lookAt", "(", "float", "eyeX", ",", "float", "eyeY", ",", "float", "eyeZ", ",", "float", "centerX", ",", "float", "centerY", ",", "float", "centerZ", ",", "float", "upX", ",", "float", "upY", ",", "float", "upZ", ",", "Matrix4f", ...
Apply a "lookat" transformation to this matrix for a right-handed coordinate system, that aligns <code>-z</code> with <code>center - eye</code> and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix, then the new matrix will be <code>M * L</code...
[ "Apply", "a", "lookat", "transformation", "to", "this", "matrix", "for", "a", "right", "-", "handed", "coordinate", "system", "that", "aligns", "<code", ">", "-", "z<", "/", "code", ">", "with", "<code", ">", "center", "-", "eye<", "/", "code", ">", "a...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L8533-L8541
gallandarakhneorg/afc
advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java
GISCoordinates.L93_WSG84
@Pure public static GeodesicPosition L93_WSG84(double x, double y) { """ This function convert France Lambert 93 coordinate to geographic WSG84 Data. @param x is the coordinate in France Lambert 93 @param y is the coordinate in France Lambert 93 @return lambda and phi in geographic WSG84 in degrees. """ ...
java
@Pure public static GeodesicPosition L93_WSG84(double x, double y) { final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y, LAMBERT_93_N, LAMBERT_93_C, LAMBERT_93_XS, LAMBERT_93_YS); return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY()); }
[ "@", "Pure", "public", "static", "GeodesicPosition", "L93_WSG84", "(", "double", "x", ",", "double", "y", ")", "{", "final", "Point2d", "ntfLambdaPhi", "=", "NTFLambert_NTFLambdaPhi", "(", "x", ",", "y", ",", "LAMBERT_93_N", ",", "LAMBERT_93_C", ",", "LAMBERT_...
This function convert France Lambert 93 coordinate to geographic WSG84 Data. @param x is the coordinate in France Lambert 93 @param y is the coordinate in France Lambert 93 @return lambda and phi in geographic WSG84 in degrees.
[ "This", "function", "convert", "France", "Lambert", "93", "coordinate", "to", "geographic", "WSG84", "Data", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L805-L813
javamelody/javamelody
javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java
LabradorRetriever.read
private static Serializable read(URLConnection connection, InputStream inputStream) throws IOException, ClassNotFoundException { """ Lit l'objet renvoyé dans le flux de réponse. @return Object @param connection URLConnection @param inputStream InputStream à utiliser à la place de connection.getInputStream()...
java
private static Serializable read(URLConnection connection, InputStream inputStream) throws IOException, ClassNotFoundException { InputStream input = inputStream; try { if ("gzip".equals(connection.getContentEncoding())) { // si la taille du flux dépasse x Ko et que l'application a retourné un flux co...
[ "private", "static", "Serializable", "read", "(", "URLConnection", "connection", ",", "InputStream", "inputStream", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "InputStream", "input", "=", "inputStream", ";", "try", "{", "if", "(", "\"gzip\"", ...
Lit l'objet renvoyé dans le flux de réponse. @return Object @param connection URLConnection @param inputStream InputStream à utiliser à la place de connection.getInputStream() @throws IOException Exception de communication @throws ClassNotFoundException Une classe transmise par le serveur n'a pas été trouvée
[ "Lit", "l", "objet", "renvoyé", "dans", "le", "flux", "de", "réponse", "." ]
train
https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java#L320-L351
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringArray.java
RoaringArray.appendCopy
protected void appendCopy(RoaringArray sa, int startingIndex, int end) { """ Append copies of the values from another array @param sa other array @param startingIndex starting index in the other array @param end endingIndex (exclusive) in the other array """ extendArray(end - startingIndex); for (...
java
protected void appendCopy(RoaringArray sa, int startingIndex, int end) { extendArray(end - startingIndex); for (int i = startingIndex; i < end; ++i) { this.keys[this.size] = sa.keys[i]; this.values[this.size] = sa.values[i].clone(); this.size++; } }
[ "protected", "void", "appendCopy", "(", "RoaringArray", "sa", ",", "int", "startingIndex", ",", "int", "end", ")", "{", "extendArray", "(", "end", "-", "startingIndex", ")", ";", "for", "(", "int", "i", "=", "startingIndex", ";", "i", "<", "end", ";", ...
Append copies of the values from another array @param sa other array @param startingIndex starting index in the other array @param end endingIndex (exclusive) in the other array
[ "Append", "copies", "of", "the", "values", "from", "another", "array" ]
train
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringArray.java#L208-L215
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapperTableModel.java
DynamoDBMapperTableModel.createKey
public <H,R> T createKey(final H hashKey, final R rangeKey) { """ Creates a new object instance with the keys populated. @param <H> The hash key type. @param <R> The range key type. @param hashKey The hash key. @param rangeKey The range key (optional if not present on table). @return The new instance. """...
java
public <H,R> T createKey(final H hashKey, final R rangeKey) { final T key = StandardBeanProperties.DeclaringReflect.<T>newInstance(targetType); if (hashKey != null) { final DynamoDBMapperFieldModel<T,H> hk = hashKey(); hk.set(key, hashKey); } if (rangeKey != null)...
[ "public", "<", "H", ",", "R", ">", "T", "createKey", "(", "final", "H", "hashKey", ",", "final", "R", "rangeKey", ")", "{", "final", "T", "key", "=", "StandardBeanProperties", ".", "DeclaringReflect", ".", "<", "T", ">", "newInstance", "(", "targetType",...
Creates a new object instance with the keys populated. @param <H> The hash key type. @param <R> The range key type. @param hashKey The hash key. @param rangeKey The range key (optional if not present on table). @return The new instance.
[ "Creates", "a", "new", "object", "instance", "with", "the", "keys", "populated", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapperTableModel.java#L287-L298
josueeduardo/snappy
plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/MainClassFinder.java
MainClassFinder.findMainClass
public static String findMainClass(JarFile jarFile, String classesLocation) throws IOException { """ Find the main class in a given jar file. @param jarFile the jar file to search @param classesLocation the location within the jar containing classes @return the main class or {@code null} ...
java
public static String findMainClass(JarFile jarFile, String classesLocation) throws IOException { return doWithMainClasses(jarFile, classesLocation, new ClassNameCallback<String>() { @Override public String doWith(String className) { ...
[ "public", "static", "String", "findMainClass", "(", "JarFile", "jarFile", ",", "String", "classesLocation", ")", "throws", "IOException", "{", "return", "doWithMainClasses", "(", "jarFile", ",", "classesLocation", ",", "new", "ClassNameCallback", "<", "String", ">",...
Find the main class in a given jar file. @param jarFile the jar file to search @param classesLocation the location within the jar containing classes @return the main class or {@code null} @throws IOException if the jar file cannot be read
[ "Find", "the", "main", "class", "in", "a", "given", "jar", "file", "." ]
train
https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-maven-plugin/src/main/java/io/joshworks/snappy/maven/tools/MainClassFinder.java#L171-L180
haraldk/TwelveMonkeys
sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java
NetUtil.getBytesHttp
public static byte[] getBytesHttp(String pURL, int pTimeout) throws IOException { """ Gets the content from a given URL, with the given timeout. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout. Supports basic HTTP authentication, using a URL string similar to most browsers. <P/...
java
public static byte[] getBytesHttp(String pURL, int pTimeout) throws IOException { // Get the input stream from the url InputStream in = new BufferedInputStream(getInputStreamHttp(pURL, pTimeout), BUF_SIZE * 2); // Get all the bytes in loop ByteArrayOutputStream bytes = new ByteArrayOutp...
[ "public", "static", "byte", "[", "]", "getBytesHttp", "(", "String", "pURL", ",", "int", "pTimeout", ")", "throws", "IOException", "{", "// Get the input stream from the url", "InputStream", "in", "=", "new", "BufferedInputStream", "(", "getInputStreamHttp", "(", "p...
Gets the content from a given URL, with the given timeout. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout. Supports basic HTTP authentication, using a URL string similar to most browsers. <P/> <SMALL>Implementation note: If the timeout parameter is greater than 0, this method uses my o...
[ "Gets", "the", "content", "from", "a", "given", "URL", "with", "the", "given", "timeout", ".", "The", "timeout", "must", "be", ">", "0", ".", "A", "timeout", "of", "zero", "is", "interpreted", "as", "an", "infinite", "timeout", ".", "Supports", "basic", ...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java#L967-L989
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java
MsgDestEncodingUtilsImpl.decodeOtherProperties
private static void decodeOtherProperties(JmsDestination newDest, byte[] msgForm, int offset) throws JMSException { """ decodeOtherProperties Decode the more interesting JmsDestination properties, which may or may not be included: Queue/Topic name TopicSpace ReadAhead Cluster properties @param newDest ...
java
private static void decodeOtherProperties(JmsDestination newDest, byte[] msgForm, int offset) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "decodeOtherProperties", new Object[]{newDest, msgForm, offset}); PropertyInputStream stream = new PropertyInputSt...
[ "private", "static", "void", "decodeOtherProperties", "(", "JmsDestination", "newDest", ",", "byte", "[", "]", "msgForm", ",", "int", "offset", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", "...
decodeOtherProperties Decode the more interesting JmsDestination properties, which may or may not be included: Queue/Topic name TopicSpace ReadAhead Cluster properties @param newDest The Destination to apply the properties to @param msgForm The byte array containing the encoded Destination va...
[ "decodeOtherProperties", "Decode", "the", "more", "interesting", "JmsDestination", "properties", "which", "may", "or", "may", "not", "be", "included", ":", "Queue", "/", "Topic", "name", "TopicSpace", "ReadAhead", "Cluster", "properties" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java#L760-L788
Ordinastie/MalisisCore
src/main/java/net/malisis/core/util/blockdata/BlockDataMessage.java
BlockDataMessage.sendBlockData
public static void sendBlockData(Chunk chunk, String identifier, ByteBuf data, EntityPlayerMP player) { """ Sends the data to the specified {@link EntityPlayerMP}. @param chunk the chunk @param identifier the identifier @param data the data @param player the player """ MalisisCore.network.sendTo(new Pa...
java
public static void sendBlockData(Chunk chunk, String identifier, ByteBuf data, EntityPlayerMP player) { MalisisCore.network.sendTo(new Packet(chunk, identifier, data), player); }
[ "public", "static", "void", "sendBlockData", "(", "Chunk", "chunk", ",", "String", "identifier", ",", "ByteBuf", "data", ",", "EntityPlayerMP", "player", ")", "{", "MalisisCore", ".", "network", ".", "sendTo", "(", "new", "Packet", "(", "chunk", ",", "identi...
Sends the data to the specified {@link EntityPlayerMP}. @param chunk the chunk @param identifier the identifier @param data the data @param player the player
[ "Sends", "the", "data", "to", "the", "specified", "{", "@link", "EntityPlayerMP", "}", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/blockdata/BlockDataMessage.java#L65-L68
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java
NameService.nameObject
public synchronized void nameObject(String namePrefix, INameable object) { """ This method will create a unique name for an INameable object. The name will be unque within the session. This will throw an IllegalStateException if INameable.setObjectName has previously been called on object. @param namePrefix T...
java
public synchronized void nameObject(String namePrefix, INameable object) { String name = namePrefix + Integer.toString(_nextValue++); object.setObjectName(name); }
[ "public", "synchronized", "void", "nameObject", "(", "String", "namePrefix", ",", "INameable", "object", ")", "{", "String", "name", "=", "namePrefix", "+", "Integer", ".", "toString", "(", "_nextValue", "++", ")", ";", "object", ".", "setObjectName", "(", "...
This method will create a unique name for an INameable object. The name will be unque within the session. This will throw an IllegalStateException if INameable.setObjectName has previously been called on object. @param namePrefix The prefix of the generated name. @param object the INameable object. @throws IllegalSta...
[ "This", "method", "will", "create", "a", "unique", "name", "for", "an", "INameable", "object", ".", "The", "name", "will", "be", "unque", "within", "the", "session", ".", "This", "will", "throw", "an", "IllegalStateException", "if", "INameable", ".", "setObj...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L160-L164
gallandarakhneorg/afc
advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileReader.java
DBaseFileReader.read8ByteDoubleRecordValue
@SuppressWarnings("checkstyle:magicnumber") private static int read8ByteDoubleRecordValue(DBaseFileField field, int nrecord, int nfield, byte[] rawData, int rawOffset, OutputParameter<Double> value) throws IOException { """ Read a 8 BYTE DOUBLE record value. @param field is the current parsed field. @param...
java
@SuppressWarnings("checkstyle:magicnumber") private static int read8ByteDoubleRecordValue(DBaseFileField field, int nrecord, int nfield, byte[] rawData, int rawOffset, OutputParameter<Double> value) throws IOException { final double rawNumber = EndianNumbers.toLEDouble( rawData[rawOffset], rawData[rawOffset +...
[ "@", "SuppressWarnings", "(", "\"checkstyle:magicnumber\"", ")", "private", "static", "int", "read8ByteDoubleRecordValue", "(", "DBaseFileField", "field", ",", "int", "nrecord", ",", "int", "nfield", ",", "byte", "[", "]", "rawData", ",", "int", "rawOffset", ",", ...
Read a 8 BYTE DOUBLE record value. @param field is the current parsed field. @param nrecord is the number of the record @param nfield is the number of the field @param rawData raw data @param rawOffset is the index at which the data could be obtained @param value will be set with the value extracted from the dBASE fil...
[ "Read", "a", "8", "BYTE", "DOUBLE", "record", "value", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileReader.java#L1224-L1238
liyiorg/weixin-popular
src/main/java/weixin/popular/util/PayUtil.java
PayUtil.generateMchAppData
public static MchPayApp generateMchAppData(String prepay_id, String appId, String partnerid, String key) { """ (MCH)生成支付APP请求数据 @param prepay_id 预支付订单号 @param appId appId @param partnerid 商户平台号 @param key 商户支付密钥 @return app data """ Map<String, String> wx_map = new LinkedHashMap<String, String>()...
java
public static MchPayApp generateMchAppData(String prepay_id, String appId, String partnerid, String key) { Map<String, String> wx_map = new LinkedHashMap<String, String>(); wx_map.put("appid", appId); wx_map.put("partnerid", partnerid); wx_map.put("prepayid", prepay_id); wx_map.put("package", "Sign=WXPay...
[ "public", "static", "MchPayApp", "generateMchAppData", "(", "String", "prepay_id", ",", "String", "appId", ",", "String", "partnerid", ",", "String", "key", ")", "{", "Map", "<", "String", ",", "String", ">", "wx_map", "=", "new", "LinkedHashMap", "<", "Stri...
(MCH)生成支付APP请求数据 @param prepay_id 预支付订单号 @param appId appId @param partnerid 商户平台号 @param key 商户支付密钥 @return app data
[ "(", "MCH", ")", "生成支付APP请求数据" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/util/PayUtil.java#L108-L126
kiegroup/jbpm
jbpm-case-mgmt/jbpm-case-mgmt-impl/src/main/java/org/jbpm/casemgmt/impl/CaseRuntimeDataServiceImpl.java
CaseRuntimeDataServiceImpl.internalGetCaseStages
public List<CaseStageInstance> internalGetCaseStages(CaseDefinition caseDef, String caseId, boolean activeOnly, QueryContext queryContext) { """ /* Helper methods to parse process and extract case related information """ CorrelationKey correlationKey = correlationKeyFactory.newCorrelationKey(...
java
public List<CaseStageInstance> internalGetCaseStages(CaseDefinition caseDef, String caseId, boolean activeOnly, QueryContext queryContext) { CorrelationKey correlationKey = correlationKeyFactory.newCorrelationKey(caseId); Collection<org.jbpm.services.api.model.NodeInstanceDesc> nodes = runtimeD...
[ "public", "List", "<", "CaseStageInstance", ">", "internalGetCaseStages", "(", "CaseDefinition", "caseDef", ",", "String", "caseId", ",", "boolean", "activeOnly", ",", "QueryContext", "queryContext", ")", "{", "CorrelationKey", "correlationKey", "=", "correlationKeyFact...
/* Helper methods to parse process and extract case related information
[ "/", "*", "Helper", "methods", "to", "parse", "process", "and", "extract", "case", "related", "information" ]
train
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-case-mgmt/jbpm-case-mgmt-impl/src/main/java/org/jbpm/casemgmt/impl/CaseRuntimeDataServiceImpl.java#L613-L659
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java
ExpressRouteCrossConnectionsInner.createOrUpdateAsync
public Observable<ExpressRouteCrossConnectionInner> createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { """ Update the specified ExpressRouteCrossConnection. @param resourceGroupName The name of the resource group. @param crossConnectionName ...
java
public Observable<ExpressRouteCrossConnectionInner> createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1<ServiceResponse<ExpressRout...
[ "public", "Observable", "<", "ExpressRouteCrossConnectionInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "crossConnectionName", ",", "ExpressRouteCrossConnectionInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsyn...
Update the specified ExpressRouteCrossConnection. @param resourceGroupName The name of the resource group. @param crossConnectionName The name of the ExpressRouteCrossConnection. @param parameters Parameters supplied to the update express route crossConnection operation. @throws IllegalArgumentException thrown if para...
[ "Update", "the", "specified", "ExpressRouteCrossConnection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L471-L478
landawn/AbacusUtil
src/com/landawn/abacus/util/TriIterator.java
TriIterator.forEachRemaining
@Override @Deprecated public void forEachRemaining(java.util.function.Consumer<? super Triple<A, B, C>> action) { """ It's preferred to call <code>forEachRemaining(Try.TriConsumer)</code> to avoid the create the unnecessary <code>Triple</code> Objects. @deprecated """ super.forEachRemaini...
java
@Override @Deprecated public void forEachRemaining(java.util.function.Consumer<? super Triple<A, B, C>> action) { super.forEachRemaining(action); }
[ "@", "Override", "@", "Deprecated", "public", "void", "forEachRemaining", "(", "java", ".", "util", ".", "function", ".", "Consumer", "<", "?", "super", "Triple", "<", "A", ",", "B", ",", "C", ">", ">", "action", ")", "{", "super", ".", "forEachRemaini...
It's preferred to call <code>forEachRemaining(Try.TriConsumer)</code> to avoid the create the unnecessary <code>Triple</code> Objects. @deprecated
[ "It", "s", "preferred", "to", "call", "<code", ">", "forEachRemaining", "(", "Try", ".", "TriConsumer", ")", "<", "/", "code", ">", "to", "avoid", "the", "create", "the", "unnecessary", "<code", ">", "Triple<", "/", "code", ">", "Objects", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/TriIterator.java#L369-L373
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/common/StocatorPath.java
StocatorPath.modifyPathToFinalDestination
public Path modifyPathToFinalDestination(Path path) throws IOException { """ Accept temporary path and return a final destination path @param path path name to modify @return modified path name @throws IOException if error """ String res; if (tempFileOriginator.equals(DEFAULT_FOUTPUTCOMMITTER_V1))...
java
public Path modifyPathToFinalDestination(Path path) throws IOException { String res; if (tempFileOriginator.equals(DEFAULT_FOUTPUTCOMMITTER_V1)) { res = parseHadoopOutputCommitter(path, true, hostNameScheme); } else { res = extractNameFromTempPath(path, true, hostNameScheme); } return ne...
[ "public", "Path", "modifyPathToFinalDestination", "(", "Path", "path", ")", "throws", "IOException", "{", "String", "res", ";", "if", "(", "tempFileOriginator", ".", "equals", "(", "DEFAULT_FOUTPUTCOMMITTER_V1", ")", ")", "{", "res", "=", "parseHadoopOutputCommitter...
Accept temporary path and return a final destination path @param path path name to modify @return modified path name @throws IOException if error
[ "Accept", "temporary", "path", "and", "return", "a", "final", "destination", "path" ]
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/StocatorPath.java#L188-L197
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/Util.java
Util.bytesToNumberLittleEndian
@SuppressWarnings("SameParameterValue") public static long bytesToNumberLittleEndian(byte[] buffer, int start, int length) { """ Reconstructs a number that is represented by more than one byte in a network packet in little-endian order, for the very few protocol values that are sent in this quirky way. @pa...
java
@SuppressWarnings("SameParameterValue") public static long bytesToNumberLittleEndian(byte[] buffer, int start, int length) { long result = 0; for (int index = start + length - 1; index >= start; index--) { result = (result << 8) + unsign(buffer[index]); } return result; ...
[ "@", "SuppressWarnings", "(", "\"SameParameterValue\"", ")", "public", "static", "long", "bytesToNumberLittleEndian", "(", "byte", "[", "]", "buffer", ",", "int", "start", ",", "int", "length", ")", "{", "long", "result", "=", "0", ";", "for", "(", "int", ...
Reconstructs a number that is represented by more than one byte in a network packet in little-endian order, for the very few protocol values that are sent in this quirky way. @param buffer the byte array containing the packet data @param start the index of the first byte containing a numeric value @param length the nu...
[ "Reconstructs", "a", "number", "that", "is", "represented", "by", "more", "than", "one", "byte", "in", "a", "network", "packet", "in", "little", "-", "endian", "order", "for", "the", "very", "few", "protocol", "values", "that", "are", "sent", "in", "this",...
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L259-L266
anotheria/moskito
moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java
ConnectorsRegistry.enableConnector
public void enableConnector(String connectorClass, Properties connectorInitProperties) throws ConnectorInitException { """ Makes enable connector with given class name if it registered and not already enabled. Non-existing or already enabled connectors be ignored @param connectorClass connector class canonica...
java
public void enableConnector(String connectorClass, Properties connectorInitProperties) throws ConnectorInitException { ConnectorEntry connector = connectors.get(connectorClass); if(connector != null) connectors.get(connectorClass).enableConnector(connectorInitProperties); }
[ "public", "void", "enableConnector", "(", "String", "connectorClass", ",", "Properties", "connectorInitProperties", ")", "throws", "ConnectorInitException", "{", "ConnectorEntry", "connector", "=", "connectors", ".", "get", "(", "connectorClass", ")", ";", "if", "(", ...
Makes enable connector with given class name if it registered and not already enabled. Non-existing or already enabled connectors be ignored @param connectorClass connector class canonical name @param connectorInitProperties initialization properties of connector @throws ConnectorInitException
[ "Makes", "enable", "connector", "with", "given", "class", "name", "if", "it", "registered", "and", "not", "already", "enabled", ".", "Non", "-", "existing", "or", "already", "enabled", "connectors", "be", "ignored" ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java#L50-L57
thrau/jarchivelib
src/main/java/org/rauschig/jarchivelib/IOUtils.java
IOUtils.requireDirectory
public static void requireDirectory(File destination) throws IOException, IllegalArgumentException { """ Makes sure that the given {@link File} is either a writable directory, or that it does not exist and a directory can be created at its path. <br> Will throw an exception if the given {@link File} is actually...
java
public static void requireDirectory(File destination) throws IOException, IllegalArgumentException { if (destination.isFile()) { throw new IllegalArgumentException(destination + " exists and is a file, directory or path expected."); } else if (!destination.exists()) { destination...
[ "public", "static", "void", "requireDirectory", "(", "File", "destination", ")", "throws", "IOException", ",", "IllegalArgumentException", "{", "if", "(", "destination", ".", "isFile", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "destinati...
Makes sure that the given {@link File} is either a writable directory, or that it does not exist and a directory can be created at its path. <br> Will throw an exception if the given {@link File} is actually an existing file, or the directory is not writable @param destination the directory which to ensure its existen...
[ "Makes", "sure", "that", "the", "given", "{", "@link", "File", "}", "is", "either", "a", "writable", "directory", "or", "that", "it", "does", "not", "exist", "and", "a", "directory", "can", "be", "created", "at", "its", "path", ".", "<br", ">", "Will",...
train
https://github.com/thrau/jarchivelib/blob/8afee5124c588f589306796985b722d63572bbfa/src/main/java/org/rauschig/jarchivelib/IOUtils.java#L117-L126
zxing/zxing
core/src/main/java/com/google/zxing/common/BitMatrix.java
BitMatrix.getRow
public BitArray getRow(int y, BitArray row) { """ A fast method to retrieve one row of data from the matrix as a BitArray. @param y The row to retrieve @param row An optional caller-allocated BitArray, will be allocated if null or too small @return The resulting BitArray - this reference should always be used...
java
public BitArray getRow(int y, BitArray row) { if (row == null || row.getSize() < width) { row = new BitArray(width); } else { row.clear(); } int offset = y * rowSize; for (int x = 0; x < rowSize; x++) { row.setBulk(x * 32, bits[offset + x]); } return row; }
[ "public", "BitArray", "getRow", "(", "int", "y", ",", "BitArray", "row", ")", "{", "if", "(", "row", "==", "null", "||", "row", ".", "getSize", "(", ")", "<", "width", ")", "{", "row", "=", "new", "BitArray", "(", "width", ")", ";", "}", "else", ...
A fast method to retrieve one row of data from the matrix as a BitArray. @param y The row to retrieve @param row An optional caller-allocated BitArray, will be allocated if null or too small @return The resulting BitArray - this reference should always be used even when passing your own row
[ "A", "fast", "method", "to", "retrieve", "one", "row", "of", "data", "from", "the", "matrix", "as", "a", "BitArray", "." ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/common/BitMatrix.java#L259-L270
haraldk/TwelveMonkeys
imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTUtil.java
PICTUtil.readColorPattern
public static Pattern readColorPattern(final DataInput pStream) throws IOException { """ /* http://developer.apple.com/DOCUMENTATION/mac/QuickDraw/QuickDraw-461.html#MARKER-9-243 IF patType = ditherPat THEN PatType: word; {pattern type = 2} Pat1Data: Pattern; {old pattern data} RGB: RGBC...
java
public static Pattern readColorPattern(final DataInput pStream) throws IOException { short type = pStream.readShort(); Pattern pattern; Pattern fallback = readPattern(pStream); if (type == 1) { // TODO: This is foobar... // PixMap // ColorTable ...
[ "public", "static", "Pattern", "readColorPattern", "(", "final", "DataInput", "pStream", ")", "throws", "IOException", "{", "short", "type", "=", "pStream", ".", "readShort", "(", ")", ";", "Pattern", "pattern", ";", "Pattern", "fallback", "=", "readPattern", ...
/* http://developer.apple.com/DOCUMENTATION/mac/QuickDraw/QuickDraw-461.html#MARKER-9-243 IF patType = ditherPat THEN PatType: word; {pattern type = 2} Pat1Data: Pattern; {old pattern data} RGB: RGBColor; {desired RGB for pattern} ELSE PatType: word; {pattern type = 1} Pat1Data: Patter...
[ "/", "*", "http", ":", "//", "developer", ".", "apple", ".", "com", "/", "DOCUMENTATION", "/", "mac", "/", "QuickDraw", "/", "QuickDraw", "-", "461", ".", "html#MARKER", "-", "9", "-", "243", "IF", "patType", "=", "ditherPat", "THEN", "PatType", ":", ...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTUtil.java#L182-L204
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java
ShapeGenerator.createArrowLeft
public Shape createArrowLeft(final double x, final double y, final double w, final double h) { """ Return a path for an arrow pointing to the left. @param x the X coordinate of the upper-left corner of the arrow @param y the Y coordinate of the upper-left corner of the arrow @param w the width of the arrow...
java
public Shape createArrowLeft(final double x, final double y, final double w, final double h) { path.reset(); path.moveTo(x + w, y); path.lineTo(x, y + h / 2.0); path.lineTo(x + w, y + h); path.closePath(); return path; }
[ "public", "Shape", "createArrowLeft", "(", "final", "double", "x", ",", "final", "double", "y", ",", "final", "double", "w", ",", "final", "double", "h", ")", "{", "path", ".", "reset", "(", ")", ";", "path", ".", "moveTo", "(", "x", "+", "w", ",",...
Return a path for an arrow pointing to the left. @param x the X coordinate of the upper-left corner of the arrow @param y the Y coordinate of the upper-left corner of the arrow @param w the width of the arrow @param h the height of the arrow @return a path representing the shape.
[ "Return", "a", "path", "for", "an", "arrow", "pointing", "to", "the", "left", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L304-L312
jboss/jboss-ejb-api_spec
src/main/java/javax/ejb/embeddable/EJBContainer.java
EJBContainer.createEJBContainer
public static EJBContainer createEJBContainer(Map<?, ?> properties) throws EJBException { """ Create and initialize an embeddable EJB container with an set of configuration properties and names of modules to be initialized. @param properties One or more spec-defined or vendor-specific properties. The sp...
java
public static EJBContainer createEJBContainer(Map<?, ?> properties) throws EJBException { for(EJBContainerProvider factory : factories) { EJBContainer container = factory.createEJBContainer(properties); if(container != null) return container; } throw new EJ...
[ "public", "static", "EJBContainer", "createEJBContainer", "(", "Map", "<", "?", ",", "?", ">", "properties", ")", "throws", "EJBException", "{", "for", "(", "EJBContainerProvider", "factory", ":", "factories", ")", "{", "EJBContainer", "container", "=", "factory...
Create and initialize an embeddable EJB container with an set of configuration properties and names of modules to be initialized. @param properties One or more spec-defined or vendor-specific properties. The spec reserves the prefix "javax.ejb." for spec-defined properties. @return EJBContainer instance @throws EJBExc...
[ "Create", "and", "initialize", "an", "embeddable", "EJB", "container", "with", "an", "set", "of", "configuration", "properties", "and", "names", "of", "modules", "to", "be", "initialized", "." ]
train
https://github.com/jboss/jboss-ejb-api_spec/blob/2efa693ed40cdfcf43bbd6cecbaf49039170bc3b/src/main/java/javax/ejb/embeddable/EJBContainer.java#L72-L82
alkacon/opencms-core
src/org/opencms/ui/A_CmsUI.java
A_CmsUI.openPageOrWarn
public void openPageOrWarn(String link, String target) { """ Tries to open a new browser window, and shows a warning if opening the window fails (usually because of popup blockers).<p> @param link the URL to open in the new window @param target the target window name """ openPageOrWarn(link, targe...
java
public void openPageOrWarn(String link, String target) { openPageOrWarn(link, target, CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_POPUP_BLOCKED_0)); }
[ "public", "void", "openPageOrWarn", "(", "String", "link", ",", "String", "target", ")", "{", "openPageOrWarn", "(", "link", ",", "target", ",", "CmsVaadinUtils", ".", "getMessageText", "(", "org", ".", "opencms", ".", "ui", ".", "Messages", ".", "GUI_POPUP_...
Tries to open a new browser window, and shows a warning if opening the window fails (usually because of popup blockers).<p> @param link the URL to open in the new window @param target the target window name
[ "Tries", "to", "open", "a", "new", "browser", "window", "and", "shows", "a", "warning", "if", "opening", "the", "window", "fails", "(", "usually", "because", "of", "popup", "blockers", ")", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/A_CmsUI.java#L230-L233
loldevs/riotapi
rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/SummonerTeamService.java
SummonerTeamService.kickPlayer
public Team kickPlayer(long summonerId, TeamId teamId) { """ Kick a player from the target team @param summonerId The id of the player @param teamId The id of the team @return The new team state """ return client.sendRpcAndWait(SERVICE, "kickPlayer", summonerId, teamId); }
java
public Team kickPlayer(long summonerId, TeamId teamId) { return client.sendRpcAndWait(SERVICE, "kickPlayer", summonerId, teamId); }
[ "public", "Team", "kickPlayer", "(", "long", "summonerId", ",", "TeamId", "teamId", ")", "{", "return", "client", ".", "sendRpcAndWait", "(", "SERVICE", ",", "\"kickPlayer\"", ",", "summonerId", ",", "teamId", ")", ";", "}" ]
Kick a player from the target team @param summonerId The id of the player @param teamId The id of the team @return The new team state
[ "Kick", "a", "player", "from", "the", "target", "team" ]
train
https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/SummonerTeamService.java#L115-L117
kotcrab/vis-ui
ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java
Dialogs.showOptionDialog
public static OptionDialog showOptionDialog (Stage stage, String title, String text, OptionDialogType type, OptionDialogListener listener) { """ Dialog with text and buttons like Yes, No, Cancel. @param title dialog title @param type specifies what types of buttons will this dialog have @param listener dialog b...
java
public static OptionDialog showOptionDialog (Stage stage, String title, String text, OptionDialogType type, OptionDialogListener listener) { OptionDialog dialog = new OptionDialog(title, text, type, listener); stage.addActor(dialog.fadeIn()); return dialog; }
[ "public", "static", "OptionDialog", "showOptionDialog", "(", "Stage", "stage", ",", "String", "title", ",", "String", "text", ",", "OptionDialogType", "type", ",", "OptionDialogListener", "listener", ")", "{", "OptionDialog", "dialog", "=", "new", "OptionDialog", ...
Dialog with text and buttons like Yes, No, Cancel. @param title dialog title @param type specifies what types of buttons will this dialog have @param listener dialog buttons listener. @return dialog for the purpose of changing buttons text. @see OptionDialog @since 0.6.0
[ "Dialog", "with", "text", "and", "buttons", "like", "Yes", "No", "Cancel", "." ]
train
https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L83-L87
languagetool-org/languagetool
languagetool-core/src/main/java/org/languagetool/rules/patterns/PatternRuleMatcher.java
PatternRuleMatcher.matchPreservesCase
private boolean matchPreservesCase(List<Match> suggestionMatches, String msg) { """ Checks if the suggestion starts with a match that is supposed to preserve case. If it does not, perform the default conversion to uppercase. @return true, if the match preserves the case of the token. """ if (suggestionMa...
java
private boolean matchPreservesCase(List<Match> suggestionMatches, String msg) { if (suggestionMatches != null && !suggestionMatches.isEmpty()) { //PatternRule rule = (PatternRule) this.rule; int sugStart = msg.indexOf(SUGGESTION_START_TAG) + SUGGESTION_START_TAG.length(); for (Match sMatch : sugge...
[ "private", "boolean", "matchPreservesCase", "(", "List", "<", "Match", ">", "suggestionMatches", ",", "String", "msg", ")", "{", "if", "(", "suggestionMatches", "!=", "null", "&&", "!", "suggestionMatches", ".", "isEmpty", "(", ")", ")", "{", "//PatternRule ru...
Checks if the suggestion starts with a match that is supposed to preserve case. If it does not, perform the default conversion to uppercase. @return true, if the match preserves the case of the token.
[ "Checks", "if", "the", "suggestion", "starts", "with", "a", "match", "that", "is", "supposed", "to", "preserve", "case", ".", "If", "it", "does", "not", "perform", "the", "default", "conversion", "to", "uppercase", "." ]
train
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/PatternRuleMatcher.java#L261-L273
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java
ApiOvhDedicatedserver.serviceName_statistics_raid_unit_volume_volume_GET
public OvhRtmRaidVolume serviceName_statistics_raid_unit_volume_volume_GET(String serviceName, String unit, String volume) throws IOException { """ Get this object properties REST: GET /dedicated/server/{serviceName}/statistics/raid/{unit}/volume/{volume} @param serviceName [required] The internal name of your...
java
public OvhRtmRaidVolume serviceName_statistics_raid_unit_volume_volume_GET(String serviceName, String unit, String volume) throws IOException { String qPath = "/dedicated/server/{serviceName}/statistics/raid/{unit}/volume/{volume}"; StringBuilder sb = path(qPath, serviceName, unit, volume); String resp = exec(qPa...
[ "public", "OvhRtmRaidVolume", "serviceName_statistics_raid_unit_volume_volume_GET", "(", "String", "serviceName", ",", "String", "unit", ",", "String", "volume", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicated/server/{serviceName}/statistics/raid/{unit}...
Get this object properties REST: GET /dedicated/server/{serviceName}/statistics/raid/{unit}/volume/{volume} @param serviceName [required] The internal name of your dedicated server @param unit [required] Raid unit @param volume [required] Raid volume name
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1401-L1406
kite-sdk/kite
kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/DataModelUtil.java
DataModelUtil.createRecord
@SuppressWarnings("unchecked") public static <E> E createRecord(Class<E> type, Schema schema) { """ If E implements GenericRecord, but does not implement SpecificRecord, then create a new instance of E using reflection so that GenericDataumReader will use the expected type. Implementations of GenericRecord ...
java
@SuppressWarnings("unchecked") public static <E> E createRecord(Class<E> type, Schema schema) { // Don't instantiate SpecificRecords or interfaces. if (isGeneric(type) && !type.isInterface()) { if (GenericData.Record.class.equals(type)) { return (E) GenericData.get().newRecord(null, schema); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "E", ">", "E", "createRecord", "(", "Class", "<", "E", ">", "type", ",", "Schema", "schema", ")", "{", "// Don't instantiate SpecificRecords or interfaces.", "if", "(", "isGeneric", "("...
If E implements GenericRecord, but does not implement SpecificRecord, then create a new instance of E using reflection so that GenericDataumReader will use the expected type. Implementations of GenericRecord that require a {@link Schema} parameter in the constructor should implement SpecificData.SchemaConstructable. O...
[ "If", "E", "implements", "GenericRecord", "but", "does", "not", "implement", "SpecificRecord", "then", "create", "a", "new", "instance", "of", "E", "using", "reflection", "so", "that", "GenericDataumReader", "will", "use", "the", "expected", "type", "." ]
train
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/DataModelUtil.java#L221-L232
Berico-Technologies/CLAVIN
src/main/java/com/bericotech/clavin/GeoParserFactory.java
GeoParserFactory.getDefault
public static GeoParser getDefault(String pathToLuceneIndex, LocationExtractor extractor, int maxHitDepth, int maxContentWindow, boolean fuzzy) throws ClavinException { """ Get a GeoParser with defined values for maxHitDepth and maxContentWindow, fuzzy matching explicitly turned on or off, and a spec...
java
public static GeoParser getDefault(String pathToLuceneIndex, LocationExtractor extractor, int maxHitDepth, int maxContentWindow, boolean fuzzy) throws ClavinException { // instantiate new LuceneGazetteer Gazetteer gazetteer = new LuceneGazetteer(new File(pathToLuceneIndex)); return n...
[ "public", "static", "GeoParser", "getDefault", "(", "String", "pathToLuceneIndex", ",", "LocationExtractor", "extractor", ",", "int", "maxHitDepth", ",", "int", "maxContentWindow", ",", "boolean", "fuzzy", ")", "throws", "ClavinException", "{", "// instantiate new Lucen...
Get a GeoParser with defined values for maxHitDepth and maxContentWindow, fuzzy matching explicitly turned on or off, and a specific LocationExtractor to use. @param pathToLuceneIndex Path to the local Lucene index. @param extractor A specific implementation of LocationExtractor to be used @param maxHi...
[ "Get", "a", "GeoParser", "with", "defined", "values", "for", "maxHitDepth", "and", "maxContentWindow", "fuzzy", "matching", "explicitly", "turned", "on", "or", "off", "and", "a", "specific", "LocationExtractor", "to", "use", "." ]
train
https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/GeoParserFactory.java#L118-L123
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/BOCSU.java
BOCSU.writeIdenticalLevelRun
public static int writeIdenticalLevelRun(int prev, CharSequence s, int i, int length, ByteArrayWrapper sink) { """ Encode the code points of a string as a sequence of byte-encoded differences (slope detection), preserving lexical order. <p>Optimize the difference-taking for runs of Unicode text within small ...
java
public static int writeIdenticalLevelRun(int prev, CharSequence s, int i, int length, ByteArrayWrapper sink) { while (i < length) { // We must have capacity>=SLOPE_MAX_BYTES in case writeDiff() writes that much, // but we do not want to force the sink to allocate // for a lar...
[ "public", "static", "int", "writeIdenticalLevelRun", "(", "int", "prev", ",", "CharSequence", "s", ",", "int", "i", ",", "int", "length", ",", "ByteArrayWrapper", "sink", ")", "{", "while", "(", "i", "<", "length", ")", "{", "// We must have capacity>=SLOPE_MA...
Encode the code points of a string as a sequence of byte-encoded differences (slope detection), preserving lexical order. <p>Optimize the difference-taking for runs of Unicode text within small scripts: <p>Most small scripts are allocated within aligned 128-blocks of Unicode code points. Lexical order is preserved if...
[ "Encode", "the", "code", "points", "of", "a", "string", "as", "a", "sequence", "of", "byte", "-", "encoded", "differences", "(", "slope", "detection", ")", "preserving", "lexical", "order", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/BOCSU.java#L103-L135
pressgang-ccms/PressGangCCMSCommonUtilities
src/main/java/org/jboss/pressgang/ccms/utils/common/ResourceUtilities.java
ResourceUtilities.resourceFileToXMLDocument
public static Document resourceFileToXMLDocument(final String location, final String fileName) { """ Reads a resource file and converts it into a XML based Document object. @param location The location of the resource file. @param fileName The name of the file. @return The Document that represents the content...
java
public static Document resourceFileToXMLDocument(final String location, final String fileName) { if (location == null || fileName == null) return null; final InputStream in = ResourceUtilities.class.getResourceAsStream(location + fileName); if (in == null) return null; final DocumentBu...
[ "public", "static", "Document", "resourceFileToXMLDocument", "(", "final", "String", "location", ",", "final", "String", "fileName", ")", "{", "if", "(", "location", "==", "null", "||", "fileName", "==", "null", ")", "return", "null", ";", "final", "InputStrea...
Reads a resource file and converts it into a XML based Document object. @param location The location of the resource file. @param fileName The name of the file. @return The Document that represents the contents of the file or null if an error occurred.
[ "Reads", "a", "resource", "file", "and", "converts", "it", "into", "a", "XML", "based", "Document", "object", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/ResourceUtilities.java#L84-L106
unbescape/unbescape
src/main/java/org/unbescape/csv/CsvEscape.java
CsvEscape.escapeCsv
public static void escapeCsv(final Reader reader, final Writer writer) throws IOException { """ <p> Perform a CSV <strong>escape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> This method is <strong>thread-safe</strong>. </p> @param reader the <tt...
java
public static void escapeCsv(final Reader reader, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } CsvEscapeUtil.escape(reader, writer); }
[ "public", "static", "void", "escapeCsv", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'writer' can...
<p> Perform a CSV <strong>escape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> This method is <strong>thread-safe</strong>. </p> @param reader the <tt>Reader</tt> reading the text to be escaped. @param writer the <tt>java.io.Writer</tt> to which the escaped result will b...
[ "<p", ">", "Perform", "a", "CSV", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Writer<", "/", "tt", ">", ".", "<", "/", "p", "...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/csv/CsvEscape.java#L184-L192
haraldk/TwelveMonkeys
sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/TypedMap.java
TypedMap.put
public V put(K pKey, V pValue) { """ Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced. @param pKey key with which the specified value is to be associated. @param pValue value to be associated with the specifi...
java
public V put(K pKey, V pValue) { if (!pKey.isCompatibleValue(pValue)) { throw new IllegalArgumentException("incompatible value for key"); } return entries.put(pKey, pValue); }
[ "public", "V", "put", "(", "K", "pKey", ",", "V", "pValue", ")", "{", "if", "(", "!", "pKey", ".", "isCompatibleValue", "(", "pValue", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"incompatible value for key\"", ")", ";", "}", "return"...
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced. @param pKey key with which the specified value is to be associated. @param pValue value to be associated with the specified key. @return previous value associated with...
[ "Associates", "the", "specified", "value", "with", "the", "specified", "key", "in", "this", "map", ".", "If", "the", "map", "previously", "contained", "a", "mapping", "for", "the", "key", "the", "old", "value", "is", "replaced", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/TypedMap.java#L202-L207
authlete/authlete-java-common
src/main/java/com/authlete/common/web/URLCoder.java
URLCoder.formUrlEncode
public static String formUrlEncode(Map<String, ?> parameters) { """ Convert the given map to a string in {@code x-www-form-urlencoded} format. @param parameters Pairs of key and values. The type of values must be either {@code String[]} or {@code List<String>}. @return A string in {@code x-www-form-urlenc...
java
public static String formUrlEncode(Map<String, ?> parameters) { if (parameters == null) { return null; } StringBuilder sb = new StringBuilder(); // For each key-values pair. for (Map.Entry<String, ?> entry : parameters.entrySet()) { ...
[ "public", "static", "String", "formUrlEncode", "(", "Map", "<", "String", ",", "?", ">", "parameters", ")", "{", "if", "(", "parameters", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ...
Convert the given map to a string in {@code x-www-form-urlencoded} format. @param parameters Pairs of key and values. The type of values must be either {@code String[]} or {@code List<String>}. @return A string in {@code x-www-form-urlencoded} format. {@code null} is returned if {@code parameters} is {@code null}. @...
[ "Convert", "the", "given", "map", "to", "a", "string", "in", "{", "@code", "x", "-", "www", "-", "form", "-", "urlencoded", "}", "format", "." ]
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/web/URLCoder.java#L92-L123
strator-dev/greenpepper-open
extensions-external/php/src/main/java/com/greenpepper/phpsud/fixtures/PHPFixture.java
PHPFixture.findMethod
public static PHPMethodDescriptor findMethod(PHPClassDescriptor desc, String methodName) { """ <p>findMethod.</p> @param desc a {@link com.greenpepper.phpsud.container.PHPClassDescriptor} object. @param methodName a {@link java.lang.String} object. @return a {@link com.greenpepper.phpsud.container.PHPMethodDe...
java
public static PHPMethodDescriptor findMethod(PHPClassDescriptor desc, String methodName) { PHPMethodDescriptor meth; meth = desc.getMethod(Helper.formatProcedureName(methodName)); if (meth != null) { return meth; } meth = desc.getMethod("get" + Helper.formatProcedureName(methodName)); if (meth != null) {...
[ "public", "static", "PHPMethodDescriptor", "findMethod", "(", "PHPClassDescriptor", "desc", ",", "String", "methodName", ")", "{", "PHPMethodDescriptor", "meth", ";", "meth", "=", "desc", ".", "getMethod", "(", "Helper", ".", "formatProcedureName", "(", "methodName"...
<p>findMethod.</p> @param desc a {@link com.greenpepper.phpsud.container.PHPClassDescriptor} object. @param methodName a {@link java.lang.String} object. @return a {@link com.greenpepper.phpsud.container.PHPMethodDescriptor} object.
[ "<p", ">", "findMethod", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/php/src/main/java/com/greenpepper/phpsud/fixtures/PHPFixture.java#L88-L99
spotify/styx
styx-common/src/main/java/com/spotify/styx/util/TimeUtil.java
TimeUtil.nextInstant
public static Instant nextInstant(Instant instant, Schedule schedule) { """ Gets the next execution instant for a {@link Schedule}, relative to a given instant. <p>e.g. an hourly schedule has a next execution instant at 14:00 relative to 13:22. @param instant The instant to calculate the next execution inst...
java
public static Instant nextInstant(Instant instant, Schedule schedule) { final ExecutionTime executionTime = ExecutionTime.forCron(cron(schedule)); final ZonedDateTime utcDateTime = instant.atZone(UTC); return executionTime.nextExecution(utcDateTime) .orElseThrow(IllegalArgumentException::new) // wi...
[ "public", "static", "Instant", "nextInstant", "(", "Instant", "instant", ",", "Schedule", "schedule", ")", "{", "final", "ExecutionTime", "executionTime", "=", "ExecutionTime", ".", "forCron", "(", "cron", "(", "schedule", ")", ")", ";", "final", "ZonedDateTime"...
Gets the next execution instant for a {@link Schedule}, relative to a given instant. <p>e.g. an hourly schedule has a next execution instant at 14:00 relative to 13:22. @param instant The instant to calculate the next execution instant relative to @param schedule The schedule of executions @return an instant at the ...
[ "Gets", "the", "next", "execution", "instant", "for", "a", "{", "@link", "Schedule", "}", "relative", "to", "a", "given", "instant", "." ]
train
https://github.com/spotify/styx/blob/0d63999beeb93a17447e3bbccaa62175b74cf6e4/styx-common/src/main/java/com/spotify/styx/util/TimeUtil.java#L108-L115
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/Config.java
Config.getPropertyDouble
public static Double getPropertyDouble(Class<?> cls, String key) { """ Get a double property @param cls the class associated with the property @param key the property key name @return the double property value """ return getSettings().getPropertyDouble(cls, key); }
java
public static Double getPropertyDouble(Class<?> cls, String key) { return getSettings().getPropertyDouble(cls, key); }
[ "public", "static", "Double", "getPropertyDouble", "(", "Class", "<", "?", ">", "cls", ",", "String", "key", ")", "{", "return", "getSettings", "(", ")", ".", "getPropertyDouble", "(", "cls", ",", "key", ")", ";", "}" ]
Get a double property @param cls the class associated with the property @param key the property key name @return the double property value
[ "Get", "a", "double", "property" ]
train
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Config.java#L316-L320
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java
ProfileSummaryBuilder.buildErrorSummary
public void buildErrorSummary(XMLNode node, Content packageSummaryContentTree) { """ Build the summary for the errors in the package. @param node the XML element that specifies which components to document @param packageSummaryContentTree the tree to which the error summary will be added """ Strin...
java
public void buildErrorSummary(XMLNode node, Content packageSummaryContentTree) { String errorTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Error_Summary"), configuration.getText("doclet.errors")); String[...
[ "public", "void", "buildErrorSummary", "(", "XMLNode", "node", ",", "Content", "packageSummaryContentTree", ")", "{", "String", "errorTableSummary", "=", "configuration", ".", "getText", "(", "\"doclet.Member_Table_Summary\"", ",", "configuration", ".", "getText", "(", ...
Build the summary for the errors in the package. @param node the XML element that specifies which components to document @param packageSummaryContentTree the tree to which the error summary will be added
[ "Build", "the", "summary", "for", "the", "errors", "in", "the", "package", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L285-L301
geomajas/geomajas-project-client-gwt
common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java
HtmlBuilder.openTagClassHtmlContent
public static String openTagClassHtmlContent(String tag, String clazz, String... content) { """ Build a String containing a HTML opening tag with given CSS class and concatenates the given HTML content. @param tag String name of HTML tag @param clazz CSS class of the tag @param content content string @return...
java
public static String openTagClassHtmlContent(String tag, String clazz, String... content) { return openTagHtmlContent(tag, clazz, null, content); }
[ "public", "static", "String", "openTagClassHtmlContent", "(", "String", "tag", ",", "String", "clazz", ",", "String", "...", "content", ")", "{", "return", "openTagHtmlContent", "(", "tag", ",", "clazz", ",", "null", ",", "content", ")", ";", "}" ]
Build a String containing a HTML opening tag with given CSS class and concatenates the given HTML content. @param tag String name of HTML tag @param clazz CSS class of the tag @param content content string @return HTML tag element as string
[ "Build", "a", "String", "containing", "a", "HTML", "opening", "tag", "with", "given", "CSS", "class", "and", "concatenates", "the", "given", "HTML", "content", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L350-L352
apache/incubator-atlas
typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
TypeSystem.createTransientTypeSystem
public TransientTypeSystem createTransientTypeSystem(TypesDef typesDef, boolean isUpdate) throws AtlasException { """ Create an instance of {@link TransientTypeSystem} with the types defined in the {@link TypesDef}. As part of this, a set of verifications are run on the types defined. @param typesDef The new l...
java
public TransientTypeSystem createTransientTypeSystem(TypesDef typesDef, boolean isUpdate) throws AtlasException { ImmutableList<EnumTypeDefinition> enumDefs = ImmutableList.copyOf(typesDef.enumTypesAsJavaList()); ImmutableList<StructTypeDefinition> structDefs = ImmutableList.copyOf(typesDef.structTypesA...
[ "public", "TransientTypeSystem", "createTransientTypeSystem", "(", "TypesDef", "typesDef", ",", "boolean", "isUpdate", ")", "throws", "AtlasException", "{", "ImmutableList", "<", "EnumTypeDefinition", ">", "enumDefs", "=", "ImmutableList", ".", "copyOf", "(", "typesDef"...
Create an instance of {@link TransientTypeSystem} with the types defined in the {@link TypesDef}. As part of this, a set of verifications are run on the types defined. @param typesDef The new list of types to be created or updated. @param isUpdate True, if types are updated, false otherwise. @return {@link TransientTy...
[ "Create", "an", "instance", "of", "{", "@link", "TransientTypeSystem", "}", "with", "the", "types", "defined", "in", "the", "{", "@link", "TypesDef", "}", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java#L343-L353
b3log/latke
latke-core/src/main/java/org/json/JSONArray.java
JSONArray.optBigInteger
public BigInteger optBigInteger(int index, BigInteger defaultValue) { """ Get the optional BigInteger value associated with an index. The defaultValue is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number. @param index The index must be between 0 ...
java
public BigInteger optBigInteger(int index, BigInteger defaultValue) { Object val = this.opt(index); return JSONObject.objectToBigInteger(val, defaultValue); }
[ "public", "BigInteger", "optBigInteger", "(", "int", "index", ",", "BigInteger", "defaultValue", ")", "{", "Object", "val", "=", "this", ".", "opt", "(", "index", ")", ";", "return", "JSONObject", ".", "objectToBigInteger", "(", "val", ",", "defaultValue", "...
Get the optional BigInteger value associated with an index. The defaultValue is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number. @param index The index must be between 0 and length() - 1. @param defaultValue The default value. @return The value.
[ "Get", "the", "optional", "BigInteger", "value", "associated", "with", "an", "index", ".", "The", "defaultValue", "is", "returned", "if", "there", "is", "no", "value", "for", "the", "index", "or", "if", "the", "value", "is", "not", "a", "number", "and", ...
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONArray.java#L709-L712
janus-project/guava.janusproject.io
guava/src/com/google/common/base/CharMatcher.java
CharMatcher.inRange
public static CharMatcher inRange(final char startInclusive, final char endInclusive) { """ Returns a {@code char} matcher that matches any character in a given range (both endpoints are inclusive). For example, to match any lowercase letter of the English alphabet, use {@code CharMatcher.inRange('a', 'z')}. ...
java
public static CharMatcher inRange(final char startInclusive, final char endInclusive) { checkArgument(endInclusive >= startInclusive); return new FastMatcher() { @Override public boolean matches(char c) { return startInclusive <= c && c <= endInclusive; } @GwtIncompatible("java.util.B...
[ "public", "static", "CharMatcher", "inRange", "(", "final", "char", "startInclusive", ",", "final", "char", "endInclusive", ")", "{", "checkArgument", "(", "endInclusive", ">=", "startInclusive", ")", ";", "return", "new", "FastMatcher", "(", ")", "{", "@", "O...
Returns a {@code char} matcher that matches any character in a given range (both endpoints are inclusive). For example, to match any lowercase letter of the English alphabet, use {@code CharMatcher.inRange('a', 'z')}. @throws IllegalArgumentException if {@code endInclusive < startInclusive}
[ "Returns", "a", "{", "@code", "char", "}", "matcher", "that", "matches", "any", "character", "in", "a", "given", "range", "(", "both", "endpoints", "are", "inclusive", ")", ".", "For", "example", "to", "match", "any", "lowercase", "letter", "of", "the", ...
train
https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/CharMatcher.java#L587-L604
JM-Lab/utils-java8
src/main/java/kr/jm/utils/helper/JMThread.java
JMThread.getLimitedBlockingQueue
public static <E> BlockingQueue<E> getLimitedBlockingQueue(int maxQueue) { """ Gets limited blocking queue. @param <E> the type parameter @param maxQueue the max queue @return the limited blocking queue """ return new LinkedBlockingQueue<E>(maxQueue) { @Override public...
java
public static <E> BlockingQueue<E> getLimitedBlockingQueue(int maxQueue) { return new LinkedBlockingQueue<E>(maxQueue) { @Override public boolean offer(E e) { return putInsteadOfOffer(this, e); } }; }
[ "public", "static", "<", "E", ">", "BlockingQueue", "<", "E", ">", "getLimitedBlockingQueue", "(", "int", "maxQueue", ")", "{", "return", "new", "LinkedBlockingQueue", "<", "E", ">", "(", "maxQueue", ")", "{", "@", "Override", "public", "boolean", "offer", ...
Gets limited blocking queue. @param <E> the type parameter @param maxQueue the max queue @return the limited blocking queue
[ "Gets", "limited", "blocking", "queue", "." ]
train
https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMThread.java#L598-L605
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/DateField.java
DateField.moveSQLToField
public void moveSQLToField(ResultSet resultset, int iColumn) throws SQLException { """ Move the physical binary data to this SQL parameter row. @param resultset The resultset to get the SQL data from. @param iColumn the column in the resultset that has my data. @exception SQLException From SQL calls. """ ...
java
public void moveSQLToField(ResultSet resultset, int iColumn) throws SQLException { java.util.Date dateResult = resultset.getDate(iColumn); if (resultset.wasNull()) this.setString(Constants.BLANK, false, DBConstants.READ_MOVE); // Null value else this.setValue((double...
[ "public", "void", "moveSQLToField", "(", "ResultSet", "resultset", ",", "int", "iColumn", ")", "throws", "SQLException", "{", "java", ".", "util", ".", "Date", "dateResult", "=", "resultset", ".", "getDate", "(", "iColumn", ")", ";", "if", "(", "resultset", ...
Move the physical binary data to this SQL parameter row. @param resultset The resultset to get the SQL data from. @param iColumn the column in the resultset that has my data. @exception SQLException From SQL calls.
[ "Move", "the", "physical", "binary", "data", "to", "this", "SQL", "parameter", "row", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/DateField.java#L173-L180
groupe-sii/ogham
ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/sender/impl/cloudhopper/MapCloudhopperCharsetHandler.java
MapCloudhopperCharsetHandler.addCharset
public void addCharset(String nioCharsetName, Charset cloudhopperCharset) { """ Add a charset mapping. @param nioCharsetName Java NIO charset name @param cloudhopperCharset Cloudhopper charset """ LOG.debug("Added charset mapping nio {} -> {}", nioCharsetName, cloudhopperCharset); mapCloudhopperChars...
java
public void addCharset(String nioCharsetName, Charset cloudhopperCharset) { LOG.debug("Added charset mapping nio {} -> {}", nioCharsetName, cloudhopperCharset); mapCloudhopperCharsetByNioCharsetName.put(nioCharsetName, cloudhopperCharset); }
[ "public", "void", "addCharset", "(", "String", "nioCharsetName", ",", "Charset", "cloudhopperCharset", ")", "{", "LOG", ".", "debug", "(", "\"Added charset mapping nio {} -> {}\"", ",", "nioCharsetName", ",", "cloudhopperCharset", ")", ";", "mapCloudhopperCharsetByNioChar...
Add a charset mapping. @param nioCharsetName Java NIO charset name @param cloudhopperCharset Cloudhopper charset
[ "Add", "a", "charset", "mapping", "." ]
train
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/sender/impl/cloudhopper/MapCloudhopperCharsetHandler.java#L87-L90
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/IsinValidator.java
IsinValidator.isValid
@Override public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) { """ {@inheritDoc} check if given string is a valid isin. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext) """ final String valueAsSt...
java
@Override public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) { final String valueAsString = Objects.toString(pvalue, null); if (StringUtils.isEmpty(valueAsString)) { return true; } if (valueAsString.length() != ISIN_LENGTH) { // ISIN size is wrong,...
[ "@", "Override", "public", "final", "boolean", "isValid", "(", "final", "Object", "pvalue", ",", "final", "ConstraintValidatorContext", "pcontext", ")", "{", "final", "String", "valueAsString", "=", "Objects", ".", "toString", "(", "pvalue", ",", "null", ")", ...
{@inheritDoc} check if given string is a valid isin. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
[ "{", "@inheritDoc", "}", "check", "if", "given", "string", "is", "a", "valid", "isin", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/IsinValidator.java#L61-L73
Impetus/Kundera
examples/polyglot/kvapps/src/main/java/com/impetus/kvapps/runner/ExecutorService.java
ExecutorService.findByKey
static User findByKey(final EntityManager em, final String userId) { """ On find by user id. @param em entity manager instance. @param userId user id. """ User user = em.find(User.class, userId); logger.info("[On Find by key]"); System.out.println("###################...
java
static User findByKey(final EntityManager em, final String userId) { User user = em.find(User.class, userId); logger.info("[On Find by key]"); System.out.println("#######################START##########################################"); logger.info("\n"); logger.info("\...
[ "static", "User", "findByKey", "(", "final", "EntityManager", "em", ",", "final", "String", "userId", ")", "{", "User", "user", "=", "em", ".", "find", "(", "User", ".", "class", ",", "userId", ")", ";", "logger", ".", "info", "(", "\"[On Find by key]\""...
On find by user id. @param em entity manager instance. @param userId user id.
[ "On", "find", "by", "user", "id", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/examples/polyglot/kvapps/src/main/java/com/impetus/kvapps/runner/ExecutorService.java#L96-L111
RuedigerMoeller/kontraktor
modules/service-suppport/src/main/java/org/nustaq/kontraktor/services/ServiceActor.java
ServiceActor.RunTCP
public static ServiceActor RunTCP( String args[], Class<? extends ServiceActor> serviceClazz, Class<? extends ServiceArgs> argsClazz) { """ run & connect a service with given cmdline args and classes @param args @param serviceClazz @param argsClazz @return @throws IllegalAccessException @throws Instantiati...
java
public static ServiceActor RunTCP( String args[], Class<? extends ServiceActor> serviceClazz, Class<? extends ServiceArgs> argsClazz) { ServiceActor myService = AsActor(serviceClazz); ServiceArgs options = null; try { options = ServiceRegistry.parseCommandLine(args, null, argsClazz.n...
[ "public", "static", "ServiceActor", "RunTCP", "(", "String", "args", "[", "]", ",", "Class", "<", "?", "extends", "ServiceActor", ">", "serviceClazz", ",", "Class", "<", "?", "extends", "ServiceArgs", ">", "argsClazz", ")", "{", "ServiceActor", "myService", ...
run & connect a service with given cmdline args and classes @param args @param serviceClazz @param argsClazz @return @throws IllegalAccessException @throws InstantiationException
[ "run", "&", "connect", "a", "service", "with", "given", "cmdline", "args", "and", "classes" ]
train
https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/service-suppport/src/main/java/org/nustaq/kontraktor/services/ServiceActor.java#L36-L50
ist-dresden/composum
sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java
MimeTypeUtil.getMimeType
public static MimeType getMimeType(String name, Property property) { """ Detects the mime type of a binary property in the context of the nodes name. @param name the name of the node which defines the binary resource (probably a file name) @param property the binary property (for stream parsing) @return h...
java
public static MimeType getMimeType(String name, Property property) { MimeType result = null; try { Binary binary = property != null ? property.getBinary() : null; if (binary != null) { try { InputStream input = binary.getStream(); ...
[ "public", "static", "MimeType", "getMimeType", "(", "String", "name", ",", "Property", "property", ")", "{", "MimeType", "result", "=", "null", ";", "try", "{", "Binary", "binary", "=", "property", "!=", "null", "?", "property", ".", "getBinary", "(", ")",...
Detects the mime type of a binary property in the context of the nodes name. @param name the name of the node which defines the binary resource (probably a file name) @param property the binary property (for stream parsing) @return he detected mime type or 'null' if the detection was not successful
[ "Detects", "the", "mime", "type", "of", "a", "binary", "property", "in", "the", "context", "of", "the", "nodes", "name", "." ]
train
https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java#L139-L170
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java
StorageWriter.getProcessor
private CompletableFuture<ProcessorCollection> getProcessor(long streamSegmentId) { """ Gets, or creates, a SegmentAggregator for the given StorageOperation. @param streamSegmentId The Id of the StreamSegment to get the aggregator for. """ ProcessorCollection existingProcessor = this.processors.getO...
java
private CompletableFuture<ProcessorCollection> getProcessor(long streamSegmentId) { ProcessorCollection existingProcessor = this.processors.getOrDefault(streamSegmentId, null); if (existingProcessor != null) { if (closeIfNecessary(existingProcessor).isClosed()) { // Existing ...
[ "private", "CompletableFuture", "<", "ProcessorCollection", ">", "getProcessor", "(", "long", "streamSegmentId", ")", "{", "ProcessorCollection", "existingProcessor", "=", "this", ".", "processors", ".", "getOrDefault", "(", "streamSegmentId", ",", "null", ")", ";", ...
Gets, or creates, a SegmentAggregator for the given StorageOperation. @param streamSegmentId The Id of the StreamSegment to get the aggregator for.
[ "Gets", "or", "creates", "a", "SegmentAggregator", "for", "the", "given", "StorageOperation", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L378-L412
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
Section508Compliance.processSetColorOps
private void processSetColorOps(String methodName) throws ClassNotFoundException { """ looks for calls to set the color of components where the color isn't from UIManager @param methodName the method that is called @throws ClassNotFoundException if the gui component class can't be found """ if ...
java
private void processSetColorOps(String methodName) throws ClassNotFoundException { if ("setBackground".equals(methodName) || "setForeground".equals(methodName)) { int argCount = SignatureUtils.getNumParameters(getSigConstantOperand()); if (stack.getStackDepth() > argCount) { ...
[ "private", "void", "processSetColorOps", "(", "String", "methodName", ")", "throws", "ClassNotFoundException", "{", "if", "(", "\"setBackground\"", ".", "equals", "(", "methodName", ")", "||", "\"setForeground\"", ".", "equals", "(", "methodName", ")", ")", "{", ...
looks for calls to set the color of components where the color isn't from UIManager @param methodName the method that is called @throws ClassNotFoundException if the gui component class can't be found
[ "looks", "for", "calls", "to", "set", "the", "color", "of", "components", "where", "the", "color", "isn", "t", "from", "UIManager" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java#L382-L397
voldemort/voldemort
src/java/voldemort/routing/StoreRoutingPlan.java
StoreRoutingPlan.getNodesPartitionIdForKey
public Integer getNodesPartitionIdForKey(int nodeId, final byte[] key) { """ Determines the partition ID that replicates the key on the given node. @param nodeId of the node @param key to look up. @return partitionId if found, otherwise null. """ // this is all the partitions the key replicates to...
java
public Integer getNodesPartitionIdForKey(int nodeId, final byte[] key) { // this is all the partitions the key replicates to. List<Integer> partitionIds = getReplicatingPartitionList(key); for(Integer partitionId: partitionIds) { // check which of the replicating partitions belongs t...
[ "public", "Integer", "getNodesPartitionIdForKey", "(", "int", "nodeId", ",", "final", "byte", "[", "]", "key", ")", "{", "// this is all the partitions the key replicates to.", "List", "<", "Integer", ">", "partitionIds", "=", "getReplicatingPartitionList", "(", "key", ...
Determines the partition ID that replicates the key on the given node. @param nodeId of the node @param key to look up. @return partitionId if found, otherwise null.
[ "Determines", "the", "partition", "ID", "that", "replicates", "the", "key", "on", "the", "given", "node", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/StoreRoutingPlan.java#L214-L225
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/security/internal/J2CSecurityHelper.java
J2CSecurityHelper.updateCustomHashtable
private static void updateCustomHashtable(Hashtable<String, Object> credData, String realmName, String uniqueId, String securityName, List<?> groupList) { """ This method updates the hashtable provided with the information that is required for custom hashtable login. The hashtable should contain the following par...
java
private static void updateCustomHashtable(Hashtable<String, Object> credData, String realmName, String uniqueId, String securityName, List<?> groupList) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "updateCustomHashtable", new Object[] { credData, realmName, uniq...
[ "private", "static", "void", "updateCustomHashtable", "(", "Hashtable", "<", "String", ",", "Object", ">", "credData", ",", "String", "realmName", ",", "String", "uniqueId", ",", "String", "securityName", ",", "List", "<", "?", ">", "groupList", ")", "{", "i...
This method updates the hashtable provided with the information that is required for custom hashtable login. The hashtable should contain the following parameters for this to succeed. Key: com.ibm.wsspi.security.cred.uniqueId, Value: user: ldap.austin.ibm.com:389/cn=pbirk,o=ibm,c=us Key: com.ibm.wsspi.security.cred.rea...
[ "This", "method", "updates", "the", "hashtable", "provided", "with", "the", "information", "that", "is", "required", "for", "custom", "hashtable", "login", ".", "The", "hashtable", "should", "contain", "the", "following", "parameters", "for", "this", "to", "succ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/security/internal/J2CSecurityHelper.java#L82-L105
jparsec/jparsec
jparsec/src/main/java/org/jparsec/pattern/Patterns.java
Patterns.times
public static Pattern times(final int min, final int max, final CharPredicate predicate) { """ Returns a {@link Pattern} that matches at least {@code min} and up to {@code max} number of characters satisfying {@code predicate}, @since 2.2 """ Checks.checkMinMax(min, max); return new Pattern() { ...
java
public static Pattern times(final int min, final int max, final CharPredicate predicate) { Checks.checkMinMax(min, max); return new Pattern() { @Override public int match(CharSequence src, int begin, int end) { int minLen = RepeatCharPredicatePattern.matchRepeat(min, predicate, src, end, beg...
[ "public", "static", "Pattern", "times", "(", "final", "int", "min", ",", "final", "int", "max", ",", "final", "CharPredicate", "predicate", ")", "{", "Checks", ".", "checkMinMax", "(", "min", ",", "max", ")", ";", "return", "new", "Pattern", "(", ")", ...
Returns a {@link Pattern} that matches at least {@code min} and up to {@code max} number of characters satisfying {@code predicate}, @since 2.2
[ "Returns", "a", "{", "@link", "Pattern", "}", "that", "matches", "at", "least", "{", "@code", "min", "}", "and", "up", "to", "{", "@code", "max", "}", "number", "of", "characters", "satisfying", "{", "@code", "predicate", "}" ]
train
https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L411-L422
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java
AbstractHibernateCriteriaBuilder.sqlGroupProjection
protected void sqlGroupProjection(String sql, String groupBy, List<String> columnAliases, List<Type> types) { """ Adds a sql projection to the criteria @param sql SQL projecting @param groupBy group by clause @param columnAliases List of column aliases for the projected values @param types List of types for ...
java
protected void sqlGroupProjection(String sql, String groupBy, List<String> columnAliases, List<Type> types) { projectionList.add(Projections.sqlGroupProjection(sql, groupBy, columnAliases.toArray(new String[columnAliases.size()]), types.toArray(new Type[types.size()]))); }
[ "protected", "void", "sqlGroupProjection", "(", "String", "sql", ",", "String", "groupBy", ",", "List", "<", "String", ">", "columnAliases", ",", "List", "<", "Type", ">", "types", ")", "{", "projectionList", ".", "add", "(", "Projections", ".", "sqlGroupPro...
Adds a sql projection to the criteria @param sql SQL projecting @param groupBy group by clause @param columnAliases List of column aliases for the projected values @param types List of types for the projected values
[ "Adds", "a", "sql", "projection", "to", "the", "criteria" ]
train
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L186-L188
bigdata-mx/factura-electronica
src/main/java/mx/bigdata/sat/security/PrivateKeyLoader.java
PrivateKeyLoader.setPrivateKey
public void setPrivateKey(String privateKeyLocation, String keyPassword) { """ @param privateKeyLocation private key located in filesystem @param keyPassword private key password @throws KeyException thrown when any security exception occurs """ InputStream privateKeyInputStream = nul...
java
public void setPrivateKey(String privateKeyLocation, String keyPassword) { InputStream privateKeyInputStream = null; try { privateKeyInputStream = new FileInputStream(privateKeyLocation); }catch (FileNotFoundException fnfe){ throw new KeyException("La ubicación del arch...
[ "public", "void", "setPrivateKey", "(", "String", "privateKeyLocation", ",", "String", "keyPassword", ")", "{", "InputStream", "privateKeyInputStream", "=", "null", ";", "try", "{", "privateKeyInputStream", "=", "new", "FileInputStream", "(", "privateKeyLocation", ")"...
@param privateKeyLocation private key located in filesystem @param keyPassword private key password @throws KeyException thrown when any security exception occurs
[ "@param", "privateKeyLocation", "private", "key", "located", "in", "filesystem", "@param", "keyPassword", "private", "key", "password" ]
train
https://github.com/bigdata-mx/factura-electronica/blob/ca9b06039075bc3b06e64b080c3545c937e35003/src/main/java/mx/bigdata/sat/security/PrivateKeyLoader.java#L44-L55
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.serializeConfiguredHashinator
public static HashinatorSnapshotData serializeConfiguredHashinator() throws IOException { """ Get optimized configuration data for wire serialization. @return optimized configuration data @throws IOException """ Pair<Long, ? extends TheHashinator> currentInstance = instance.get(); ...
java
public static HashinatorSnapshotData serializeConfiguredHashinator() throws IOException { Pair<Long, ? extends TheHashinator> currentInstance = instance.get(); byte[] cookedData = currentInstance.getSecond().getCookedBytes(); return new HashinatorSnapshotData(cookedData, currentI...
[ "public", "static", "HashinatorSnapshotData", "serializeConfiguredHashinator", "(", ")", "throws", "IOException", "{", "Pair", "<", "Long", ",", "?", "extends", "TheHashinator", ">", "currentInstance", "=", "instance", ".", "get", "(", ")", ";", "byte", "[", "]"...
Get optimized configuration data for wire serialization. @return optimized configuration data @throws IOException
[ "Get", "optimized", "configuration", "data", "for", "wire", "serialization", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L427-L433
alibaba/jstorm
jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java
JstormYarnUtils.isPortAvailable
public static boolean isPortAvailable(String host, int port) { """ See if a port is available for listening on by trying connect to it and seeing if that works or fails @param host @param port @return """ try { Socket socket = new Socket(host, port); socket.close(); ...
java
public static boolean isPortAvailable(String host, int port) { try { Socket socket = new Socket(host, port); socket.close(); return false; } catch (IOException e) { return true; } }
[ "public", "static", "boolean", "isPortAvailable", "(", "String", "host", ",", "int", "port", ")", "{", "try", "{", "Socket", "socket", "=", "new", "Socket", "(", "host", ",", "port", ")", ";", "socket", ".", "close", "(", ")", ";", "return", "false", ...
See if a port is available for listening on by trying connect to it and seeing if that works or fails @param host @param port @return
[ "See", "if", "a", "port", "is", "available", "for", "listening", "on", "by", "trying", "connect", "to", "it", "and", "seeing", "if", "that", "works", "or", "fails" ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L121-L129
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java
XSLTElementDef.equalsMayBeNullOrZeroLen
private static boolean equalsMayBeNullOrZeroLen(String s1, String s2) { """ Tell if the two string refs are equal, equality being defined as: 1) Both strings are null. 2) One string is null and the other is empty. 3) Both strings are non-null, and equal. @param s1 A reference to the first string, or null. ...
java
private static boolean equalsMayBeNullOrZeroLen(String s1, String s2) { int len1 = (s1 == null) ? 0 : s1.length(); int len2 = (s2 == null) ? 0 : s2.length(); return (len1 != len2) ? false : (len1 == 0) ? true : s1.equals(s2); }
[ "private", "static", "boolean", "equalsMayBeNullOrZeroLen", "(", "String", "s1", ",", "String", "s2", ")", "{", "int", "len1", "=", "(", "s1", "==", "null", ")", "?", "0", ":", "s1", ".", "length", "(", ")", ";", "int", "len2", "=", "(", "s2", "=="...
Tell if the two string refs are equal, equality being defined as: 1) Both strings are null. 2) One string is null and the other is empty. 3) Both strings are non-null, and equal. @param s1 A reference to the first string, or null. @param s2 A reference to the second string, or null. @return true if Both strings are n...
[ "Tell", "if", "the", "two", "string", "refs", "are", "equal", "equality", "being", "defined", "as", ":", "1", ")", "Both", "strings", "are", "null", ".", "2", ")", "One", "string", "is", "null", "and", "the", "other", "is", "empty", ".", "3", ")", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java#L326-L335
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java
SeaGlassLookAndFeel.definePanels
private void definePanels(UIDefaults d) { """ Initialize the panel settings. @param d the UI defaults map. """ String p = "Panel"; d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0)); d.put(p + ".background", new ColorUIResource((Color) d.get("control"))); d.put(p ...
java
private void definePanels(UIDefaults d) { String p = "Panel"; d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0)); d.put(p + ".background", new ColorUIResource((Color) d.get("control"))); d.put(p + ".opaque", Boolean.TRUE); }
[ "private", "void", "definePanels", "(", "UIDefaults", "d", ")", "{", "String", "p", "=", "\"Panel\"", ";", "d", ".", "put", "(", "p", "+", "\".contentMargins\"", ",", "new", "InsetsUIResource", "(", "0", ",", "0", ",", "0", ",", "0", ")", ")", ";", ...
Initialize the panel settings. @param d the UI defaults map.
[ "Initialize", "the", "panel", "settings", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L1560-L1565
forge/furnace
container-api/src/main/java/org/jboss/forge/furnace/util/Strings.java
Strings.rangeOf
public static Range rangeOf(final String beginToken, final String endToken, final String string) { """ Return the range from a begining token to an ending token. @param beginToken String to indicate begining of range. @param endToken String to indicate ending of range. @param string String to look...
java
public static Range rangeOf(final String beginToken, final String endToken, final String string) { return rangeOf(beginToken, endToken, string, 0); }
[ "public", "static", "Range", "rangeOf", "(", "final", "String", "beginToken", ",", "final", "String", "endToken", ",", "final", "String", "string", ")", "{", "return", "rangeOf", "(", "beginToken", ",", "endToken", ",", "string", ",", "0", ")", ";", "}" ]
Return the range from a begining token to an ending token. @param beginToken String to indicate begining of range. @param endToken String to indicate ending of range. @param string String to look for range in. @return (begin index, end index) or <i>null</i>.
[ "Return", "the", "range", "from", "a", "begining", "token", "to", "an", "ending", "token", "." ]
train
https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/container-api/src/main/java/org/jboss/forge/furnace/util/Strings.java#L384-L388
boncey/Flickr4Java
src/main/java/com/flickr4java/flickr/photos/SearchParameters.java
SearchParameters.setMedia
public void setMedia(String media) throws FlickrException { """ Filter results by media type. Possible values are all (default), photos or videos. @param media """ if (media.equals("all") || media.equals("photos") || media.equals("videos")) { this.media = media; } else { ...
java
public void setMedia(String media) throws FlickrException { if (media.equals("all") || media.equals("photos") || media.equals("videos")) { this.media = media; } else { throw new FlickrException("0", "Media type is not valid."); } }
[ "public", "void", "setMedia", "(", "String", "media", ")", "throws", "FlickrException", "{", "if", "(", "media", ".", "equals", "(", "\"all\"", ")", "||", "media", ".", "equals", "(", "\"photos\"", ")", "||", "media", ".", "equals", "(", "\"videos\"", ")...
Filter results by media type. Possible values are all (default), photos or videos. @param media
[ "Filter", "results", "by", "media", "type", ".", "Possible", "values", "are", "all", "(", "default", ")", "photos", "or", "videos", "." ]
train
https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java#L457-L463