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
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.orthoSymmetricLH
public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne) { """ Apply a symmetric orthographic projection transformation for a left-handed coordinate system using the given NDC z range to this matrix. <p> This method is equivalent to calling {@link #orthoLH(dou...
java
public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne) { return orthoSymmetricLH(width, height, zNear, zFar, zZeroToOne, this); }
[ "public", "Matrix4d", "orthoSymmetricLH", "(", "double", "width", ",", "double", "height", ",", "double", "zNear", ",", "double", "zFar", ",", "boolean", "zZeroToOne", ")", "{", "return", "orthoSymmetricLH", "(", "width", ",", "height", ",", "zNear", ",", "z...
Apply a symmetric orthographic projection transformation for a left-handed coordinate system using the given NDC z range to this matrix. <p> This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double, boolean) orthoLH()} with <code>left=-width/2</code>, <code>right=+width/2</cod...
[ "Apply", "a", "symmetric", "orthographic", "projection", "transformation", "for", "a", "left", "-", "handed", "coordinate", "system", "using", "the", "given", "NDC", "z", "range", "to", "this", "matrix", ".", "<p", ">", "This", "method", "is", "equivalent", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10361-L10363
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
StringGroovyMethods.findAll
public static List<String> findAll(CharSequence self, CharSequence regex) { """ Returns a (possibly empty) list of all occurrences of a regular expression (provided as a CharSequence) found within a CharSequence. <p> For example, if the regex doesn't match, it returns an empty list: <pre> assert [] == "foo".fi...
java
public static List<String> findAll(CharSequence self, CharSequence regex) { return findAll(self, Pattern.compile(regex.toString())); }
[ "public", "static", "List", "<", "String", ">", "findAll", "(", "CharSequence", "self", ",", "CharSequence", "regex", ")", "{", "return", "findAll", "(", "self", ",", "Pattern", ".", "compile", "(", "regex", ".", "toString", "(", ")", ")", ")", ";", "}...
Returns a (possibly empty) list of all occurrences of a regular expression (provided as a CharSequence) found within a CharSequence. <p> For example, if the regex doesn't match, it returns an empty list: <pre> assert [] == "foo".findAll(/(\w*) Fish/) </pre> Any regular expression matches are returned in a list, and all...
[ "Returns", "a", "(", "possibly", "empty", ")", "list", "of", "all", "occurrences", "of", "a", "regular", "expression", "(", "provided", "as", "a", "CharSequence", ")", "found", "within", "a", "CharSequence", ".", "<p", ">", "For", "example", "if", "the", ...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1050-L1052
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/pathanimator/MaterialPathAnimator.java
MaterialPathAnimator.detectOutOfScopeElement
protected void detectOutOfScopeElement(Element element, Functions.Func callback) { """ Will detect if the target / source element is out of scope in the viewport. If it is then we will call {@link ScrollHelper#scrollTo(double)} with default offset position of {@link OffsetPosition#MIDDLE}. """ if (sc...
java
protected void detectOutOfScopeElement(Element element, Functions.Func callback) { if (scrollHelper.isInViewPort(element)) { callback.call(); } else { scrollHelper.setOffsetPosition(OffsetPosition.MIDDLE); scrollHelper.setCompleteCallback(() -> callback.call()); ...
[ "protected", "void", "detectOutOfScopeElement", "(", "Element", "element", ",", "Functions", ".", "Func", "callback", ")", "{", "if", "(", "scrollHelper", ".", "isInViewPort", "(", "element", ")", ")", "{", "callback", ".", "call", "(", ")", ";", "}", "els...
Will detect if the target / source element is out of scope in the viewport. If it is then we will call {@link ScrollHelper#scrollTo(double)} with default offset position of {@link OffsetPosition#MIDDLE}.
[ "Will", "detect", "if", "the", "target", "/", "source", "element", "is", "out", "of", "scope", "in", "the", "viewport", ".", "If", "it", "is", "then", "we", "will", "call", "{" ]
train
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/pathanimator/MaterialPathAnimator.java#L185-L193
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicated_server_serviceName_staticIP_duration_POST
public OvhOrder dedicated_server_serviceName_staticIP_duration_POST(String serviceName, String duration, OvhIpStaticCountryEnum country) throws IOException { """ Create order REST: POST /order/dedicated/server/{serviceName}/staticIP/{duration} @param country [required] Ip localization @param serviceName [requ...
java
public OvhOrder dedicated_server_serviceName_staticIP_duration_POST(String serviceName, String duration, OvhIpStaticCountryEnum country) throws IOException { String qPath = "/order/dedicated/server/{serviceName}/staticIP/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String, Object>o ...
[ "public", "OvhOrder", "dedicated_server_serviceName_staticIP_duration_POST", "(", "String", "serviceName", ",", "String", "duration", ",", "OvhIpStaticCountryEnum", "country", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/dedicated/server/{serviceName}/st...
Create order REST: POST /order/dedicated/server/{serviceName}/staticIP/{duration} @param country [required] Ip localization @param serviceName [required] The internal name of your dedicated server @param duration [required] Duration
[ "Create", "order" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2306-L2313
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/UnXARMojo.java
UnXARMojo.unpackDependentXars
protected void unpackDependentXars(Artifact artifact) throws MojoExecutionException { """ Unpack xar dependencies of the provided artifact. @throws MojoExecutionException error when unpack dependencies. """ try { Set<Artifact> dependencies = resolveArtifactDependencies(artifact); ...
java
protected void unpackDependentXars(Artifact artifact) throws MojoExecutionException { try { Set<Artifact> dependencies = resolveArtifactDependencies(artifact); for (Artifact dependency : dependencies) { unpack(dependency.getFile(), this.outputDirectory, "XAR Plugin", ...
[ "protected", "void", "unpackDependentXars", "(", "Artifact", "artifact", ")", "throws", "MojoExecutionException", "{", "try", "{", "Set", "<", "Artifact", ">", "dependencies", "=", "resolveArtifactDependencies", "(", "artifact", ")", ";", "for", "(", "Artifact", "...
Unpack xar dependencies of the provided artifact. @throws MojoExecutionException error when unpack dependencies.
[ "Unpack", "xar", "dependencies", "of", "the", "provided", "artifact", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/UnXARMojo.java#L125-L135
devcon5io/common
cli/src/main/java/io/devcon5/cli/OptionInjector.java
OptionInjector.getEffectiveValue
private String getEffectiveValue(Map<String, Option> options, CliOption opt) { """ Returns the effective value for the specified option. @param options the parsed option @param opt the cli option annotation for which the actual argument should be retrieved @return the effective value for the given option ...
java
private String getEffectiveValue(Map<String, Option> options, CliOption opt) { final String shortOpt = opt.value(); if (opt.hasArg()) { if (options.containsKey(shortOpt)) { return options.get(shortOpt).getValue(); } return opt.defaultValue(); }...
[ "private", "String", "getEffectiveValue", "(", "Map", "<", "String", ",", "Option", ">", "options", ",", "CliOption", "opt", ")", "{", "final", "String", "shortOpt", "=", "opt", ".", "value", "(", ")", ";", "if", "(", "opt", ".", "hasArg", "(", ")", ...
Returns the effective value for the specified option. @param options the parsed option @param opt the cli option annotation for which the actual argument should be retrieved @return the effective value for the given option <ul> <li>If the option should have an argument, and an argument is provided, the provided argum...
[ "Returns", "the", "effective", "value", "for", "the", "specified", "option", "." ]
train
https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/cli/src/main/java/io/devcon5/cli/OptionInjector.java#L165-L174
ksclarke/freelib-utils
src/main/java/info/freelibrary/util/StringUtils.java
StringUtils.padStart
public static String padStart(final String aString, final String aPadding, final int aRepeatCount) { """ Pads the beginning of a supplied string with the repetition of a supplied value. @param aString The string to pad @param aPadding The string to be repeated as the padding @param aRepeatCount How many times...
java
public static String padStart(final String aString, final String aPadding, final int aRepeatCount) { if (aRepeatCount != 0) { final StringBuilder buffer = new StringBuilder(); for (int index = 0; index < aRepeatCount; index++) { buffer.append(aPadding); } ...
[ "public", "static", "String", "padStart", "(", "final", "String", "aString", ",", "final", "String", "aPadding", ",", "final", "int", "aRepeatCount", ")", "{", "if", "(", "aRepeatCount", "!=", "0", ")", "{", "final", "StringBuilder", "buffer", "=", "new", ...
Pads the beginning of a supplied string with the repetition of a supplied value. @param aString The string to pad @param aPadding The string to be repeated as the padding @param aRepeatCount How many times to repeat the padding @return The front padded string
[ "Pads", "the", "beginning", "of", "a", "supplied", "string", "with", "the", "repetition", "of", "a", "supplied", "value", "." ]
train
https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/StringUtils.java#L163-L175
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java
DwgFile.addDwgSectionOffset
public void addDwgSectionOffset( String key, int seek, int size ) { """ Add a DWG section offset to the dwgSectionOffsets vector @param key Define the DWG section @param seek Offset of the section @param size Size of the section """ DwgSectionOffset dso = new DwgSectionOffset(key, seek, size); ...
java
public void addDwgSectionOffset( String key, int seek, int size ) { DwgSectionOffset dso = new DwgSectionOffset(key, seek, size); dwgSectionOffsets.add(dso); }
[ "public", "void", "addDwgSectionOffset", "(", "String", "key", ",", "int", "seek", ",", "int", "size", ")", "{", "DwgSectionOffset", "dso", "=", "new", "DwgSectionOffset", "(", "key", ",", "seek", ",", "size", ")", ";", "dwgSectionOffsets", ".", "add", "("...
Add a DWG section offset to the dwgSectionOffsets vector @param key Define the DWG section @param seek Offset of the section @param size Size of the section
[ "Add", "a", "DWG", "section", "offset", "to", "the", "dwgSectionOffsets", "vector" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java#L1122-L1125
deeplearning4j/deeplearning4j
datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java
ArrowConverter.vectorFor
public static VarBinaryVector vectorFor(BufferAllocator bufferAllocator,String name,INDArray[] data) { """ Returns a vector representing a tensor view of each ndarray. Each ndarray will be a "row" represented as a tensor object with in the return {@link VarBinaryVector} @param bufferAllocator the buffer alloca...
java
public static VarBinaryVector vectorFor(BufferAllocator bufferAllocator,String name,INDArray[] data) { VarBinaryVector ret = new VarBinaryVector(name,bufferAllocator); ret.allocateNew(); for(int i = 0; i < data.length; i++) { //slice the databuffer to use only the needed portion of t...
[ "public", "static", "VarBinaryVector", "vectorFor", "(", "BufferAllocator", "bufferAllocator", ",", "String", "name", ",", "INDArray", "[", "]", "data", ")", "{", "VarBinaryVector", "ret", "=", "new", "VarBinaryVector", "(", "name", ",", "bufferAllocator", ")", ...
Returns a vector representing a tensor view of each ndarray. Each ndarray will be a "row" represented as a tensor object with in the return {@link VarBinaryVector} @param bufferAllocator the buffer allocator to use @param name the name of the column @param data the input arrays @return
[ "Returns", "a", "vector", "representing", "a", "tensor", "view", "of", "each", "ndarray", ".", "Each", "ndarray", "will", "be", "a", "row", "represented", "as", "a", "tensor", "object", "with", "in", "the", "return", "{" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L898-L909
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F64_2D.java
GeneralPurposeFFT_F64_2D.realInverseFull
public void realInverseFull(double[] a, boolean scale) { """ Computes 2D inverse DFT of real data leaving the result in <code>a</code> . This method computes full real inverse transform, i.e. you will get the same result as from <code>complexInverse</code> called with all imaginary part equal 0. Because the res...
java
public void realInverseFull(double[] a, boolean scale) { // handle special case if( rows == 1 || columns == 1 ) { if( rows > 1 ) fftRows.realInverseFull(a, scale); else fftColumns.realInverseFull(a, scale); return; } if (isPowerOfTwo) { for (int r = 0; r < rows; r++) { fftColumns.realIn...
[ "public", "void", "realInverseFull", "(", "double", "[", "]", "a", ",", "boolean", "scale", ")", "{", "// handle special case", "if", "(", "rows", "==", "1", "||", "columns", "==", "1", ")", "{", "if", "(", "rows", ">", "1", ")", "fftRows", ".", "rea...
Computes 2D inverse DFT of real data leaving the result in <code>a</code> . This method computes full real inverse transform, i.e. you will get the same result as from <code>complexInverse</code> called with all imaginary part equal 0. Because the result is stored in <code>a</code>, the input array must be of size rows...
[ "Computes", "2D", "inverse", "DFT", "of", "real", "data", "leaving", "the", "result", "in", "<code", ">", "a<", "/", "code", ">", ".", "This", "method", "computes", "full", "real", "inverse", "transform", "i", ".", "e", ".", "you", "will", "get", "the"...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F64_2D.java#L377-L398
bluelinelabs/Conductor
conductor/src/main/java/com/bluelinelabs/conductor/Controller.java
Controller.getChildRouter
@NonNull public final Router getChildRouter(@NonNull ViewGroup container, @Nullable String tag) { """ Retrieves the child {@link Router} for the given container/tag combination. If no child router for this container exists yet, it will be created. Note that multiple routers should not exist in the same conta...
java
@NonNull public final Router getChildRouter(@NonNull ViewGroup container, @Nullable String tag) { //noinspection ConstantConditions return getChildRouter(container, tag, true); }
[ "@", "NonNull", "public", "final", "Router", "getChildRouter", "(", "@", "NonNull", "ViewGroup", "container", ",", "@", "Nullable", "String", "tag", ")", "{", "//noinspection ConstantConditions", "return", "getChildRouter", "(", "container", ",", "tag", ",", "true...
Retrieves the child {@link Router} for the given container/tag combination. If no child router for this container exists yet, it will be created. Note that multiple routers should not exist in the same container unless a lot of care is taken to maintain order between them. Avoid using the same container unless you have...
[ "Retrieves", "the", "child", "{", "@link", "Router", "}", "for", "the", "given", "container", "/", "tag", "combination", ".", "If", "no", "child", "router", "for", "this", "container", "exists", "yet", "it", "will", "be", "created", ".", "Note", "that", ...
train
https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java#L195-L199
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java
SDBaseOps.sizeAt
public SDVariable sizeAt(String name, SDVariable in, int dimension) { """ Returns a rank 0 (scalar) variable for the size of the specified dimension. For example, if X has shape [10,20,30] then sizeAt(X,1)=20. Similarly, sizeAt(X,-1)=30 @param name Name of the output variable @param in Input varia...
java
public SDVariable sizeAt(String name, SDVariable in, int dimension) { SDVariable ret = f().sizeAt(in, dimension); return updateVariableNameAndReference(ret, name); }
[ "public", "SDVariable", "sizeAt", "(", "String", "name", ",", "SDVariable", "in", ",", "int", "dimension", ")", "{", "SDVariable", "ret", "=", "f", "(", ")", ".", "sizeAt", "(", "in", ",", "dimension", ")", ";", "return", "updateVariableNameAndReference", ...
Returns a rank 0 (scalar) variable for the size of the specified dimension. For example, if X has shape [10,20,30] then sizeAt(X,1)=20. Similarly, sizeAt(X,-1)=30 @param name Name of the output variable @param in Input variable @param dimension Dimension to get size of @return Scalar SDVariable for size at...
[ "Returns", "a", "rank", "0", "(", "scalar", ")", "variable", "for", "the", "size", "of", "the", "specified", "dimension", ".", "For", "example", "if", "X", "has", "shape", "[", "10", "20", "30", "]", "then", "sizeAt", "(", "X", "1", ")", "=", "20",...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L2442-L2445
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/util/IntegerMap.java
IntegerMap.put
@SuppressWarnings("unchecked") public V put(Integer key, V value) { """ Adds the mapping from the provided key to the value. @param key @param value @throws NullPointerException if the key is {@code null} @throws IllegalArgumentException if the key is not an instance of {@link Integer} """ int k...
java
@SuppressWarnings("unchecked") public V put(Integer key, V value) { int k = checkKey(key); int index = Arrays.binarySearch(keyIndices, k); if (index >= 0) { V old = (V)(values[index]); values[index] = value; return old; } else { int newIndex = 0 - (index + 1); Object[] newValues...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "V", "put", "(", "Integer", "key", ",", "V", "value", ")", "{", "int", "k", "=", "checkKey", "(", "key", ")", ";", "int", "index", "=", "Arrays", ".", "binarySearch", "(", "keyIndices", ",",...
Adds the mapping from the provided key to the value. @param key @param value @throws NullPointerException if the key is {@code null} @throws IllegalArgumentException if the key is not an instance of {@link Integer}
[ "Adds", "the", "mapping", "from", "the", "provided", "key", "to", "the", "value", "." ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/IntegerMap.java#L247-L279
UrielCh/ovh-java-sdk
ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java
ApiOvhPackxdsl.packName_subServices_domain_GET
public net.minidev.ovh.api.pack.xdsl.OvhService packName_subServices_domain_GET(String packName, String domain) throws IOException { """ Get this object properties REST: GET /pack/xdsl/{packName}/subServices/{domain} @param packName [required] The internal name of your pack @param domain [required] """ ...
java
public net.minidev.ovh.api.pack.xdsl.OvhService packName_subServices_domain_GET(String packName, String domain) throws IOException { String qPath = "/pack/xdsl/{packName}/subServices/{domain}"; StringBuilder sb = path(qPath, packName, domain); String resp = exec(qPath, "GET", sb.toString(), null); return conver...
[ "public", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "pack", ".", "xdsl", ".", "OvhService", "packName_subServices_domain_GET", "(", "String", "packName", ",", "String", "domain", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/pack/xds...
Get this object properties REST: GET /pack/xdsl/{packName}/subServices/{domain} @param packName [required] The internal name of your pack @param domain [required]
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L702-L707
Azure/azure-sdk-for-java
compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java
VirtualMachineScaleSetsInner.beginUpdateAsync
public Observable<VirtualMachineScaleSetInner> beginUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { """ Update a VM scale set. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set to create or update....
java
public Observable<VirtualMachineScaleSetInner> beginUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1<ServiceResponse<VirtualMachineScaleSetInner>, Virtua...
[ "public", "Observable", "<", "VirtualMachineScaleSetInner", ">", "beginUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "vmScaleSetName", ",", "VirtualMachineScaleSetUpdate", "parameters", ")", "{", "return", "beginUpdateWithServiceResponseAsync", "(", "resour...
Update a VM scale set. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set to create or update. @param parameters The scale set object. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the VirtualMachineScaleSetI...
[ "Update", "a", "VM", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L481-L488
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/CLARA.java
CLARA.randomSample
static DBIDs randomSample(DBIDs ids, int samplesize, Random rnd, DBIDs previous) { """ Draw a random sample of the desired size. @param ids IDs to sample from @param samplesize Sample size @param rnd Random generator @param previous Previous medoids to always include in the sample. @return Sample """ ...
java
static DBIDs randomSample(DBIDs ids, int samplesize, Random rnd, DBIDs previous) { if(previous == null) { return DBIDUtil.randomSample(ids, samplesize, rnd); } ModifiableDBIDs sample = DBIDUtil.newHashSet(samplesize); sample.addDBIDs(previous); sample.addDBIDs(DBIDUtil.randomSample(ids, sample...
[ "static", "DBIDs", "randomSample", "(", "DBIDs", "ids", ",", "int", "samplesize", ",", "Random", "rnd", ",", "DBIDs", "previous", ")", "{", "if", "(", "previous", "==", "null", ")", "{", "return", "DBIDUtil", ".", "randomSample", "(", "ids", ",", "sample...
Draw a random sample of the desired size. @param ids IDs to sample from @param samplesize Sample size @param rnd Random generator @param previous Previous medoids to always include in the sample. @return Sample
[ "Draw", "a", "random", "sample", "of", "the", "desired", "size", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/CLARA.java#L205-L222
census-instrumentation/opencensus-java
api/src/main/java/io/opencensus/common/TimeUtils.java
TimeUtils.checkedAdd
static long checkedAdd(long x, long y) { """ Adds two longs and throws an {@link ArithmeticException} if the result overflows. This functionality is provided by {@code Math.addExact(long, long)} in Java 8. """ BigInteger sum = BigInteger.valueOf(x).add(BigInteger.valueOf(y)); if (sum.compareTo(MAX_LON...
java
static long checkedAdd(long x, long y) { BigInteger sum = BigInteger.valueOf(x).add(BigInteger.valueOf(y)); if (sum.compareTo(MAX_LONG_VALUE) > 0 || sum.compareTo(MIN_LONG_VALUE) < 0) { throw new ArithmeticException("Long sum overflow: x=" + x + ", y=" + y); } return x + y; }
[ "static", "long", "checkedAdd", "(", "long", "x", ",", "long", "y", ")", "{", "BigInteger", "sum", "=", "BigInteger", ".", "valueOf", "(", "x", ")", ".", "add", "(", "BigInteger", ".", "valueOf", "(", "y", ")", ")", ";", "if", "(", "sum", ".", "c...
Adds two longs and throws an {@link ArithmeticException} if the result overflows. This functionality is provided by {@code Math.addExact(long, long)} in Java 8.
[ "Adds", "two", "longs", "and", "throws", "an", "{" ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/common/TimeUtils.java#L52-L58
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/GroupIterator.java
GroupIterator.hasSubGroup
private boolean hasSubGroup(int tmp_model,int tmp_chain,int tmp_group) { """ recursive method to determine if there is a next group. Helper method for hasNext(). @see #hasNext """ if (tmp_model >= structure.nrModels()) { return false; } List<Chain> model = structure.getModel(tmp_model); if (tmp...
java
private boolean hasSubGroup(int tmp_model,int tmp_chain,int tmp_group) { if (tmp_model >= structure.nrModels()) { return false; } List<Chain> model = structure.getModel(tmp_model); if (tmp_chain >= model.size()) { if(fixed_model) return false; return hasSubGroup(tmp_model + 1, 0, 0); } Chai...
[ "private", "boolean", "hasSubGroup", "(", "int", "tmp_model", ",", "int", "tmp_chain", ",", "int", "tmp_group", ")", "{", "if", "(", "tmp_model", ">=", "structure", ".", "nrModels", "(", ")", ")", "{", "return", "false", ";", "}", "List", "<", "Chain", ...
recursive method to determine if there is a next group. Helper method for hasNext(). @see #hasNext
[ "recursive", "method", "to", "determine", "if", "there", "is", "a", "next", "group", ".", "Helper", "method", "for", "hasNext", "()", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/GroupIterator.java#L107-L126
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.putAt
public static void putAt(List self, List splice, Object value) { """ A helper method to allow lists to work with subscript operators. <pre class="groovyTestCase">def list = ["a", true, 42, 9.4] list[1, 3] = 5 assert list == ["a", 5, 42, 5]</pre> @param self a List @param splice the subset of the list to s...
java
public static void putAt(List self, List splice, Object value) { if (splice.isEmpty()) { return; } Object first = splice.get(0); if (first instanceof Integer) { for (Object index : splice) { self.set((Integer) index, value); } }...
[ "public", "static", "void", "putAt", "(", "List", "self", ",", "List", "splice", ",", "Object", "value", ")", "{", "if", "(", "splice", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "Object", "first", "=", "splice", ".", "get", "(", "0", ...
A helper method to allow lists to work with subscript operators. <pre class="groovyTestCase">def list = ["a", true, 42, 9.4] list[1, 3] = 5 assert list == ["a", 5, 42, 5]</pre> @param self a List @param splice the subset of the list to set @param value the value to put at the given sublist @since 1.0
[ "A", "helper", "method", "to", "allow", "lists", "to", "work", "with", "subscript", "operators", ".", "<pre", "class", "=", "groovyTestCase", ">", "def", "list", "=", "[", "a", "true", "42", "9", ".", "4", "]", "list", "[", "1", "3", "]", "=", "5",...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8111-L8123
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/LineString.java
LineString.fromPolyline
public static LineString fromPolyline(@NonNull String polyline, int precision) { """ Create a new instance of this class by convert a polyline string into a lineString. This is handy when an API provides you with an encoded string representing the line geometry and you'd like to convert it to a useful LineString...
java
public static LineString fromPolyline(@NonNull String polyline, int precision) { return LineString.fromLngLats(PolylineUtils.decode(polyline, precision), null); }
[ "public", "static", "LineString", "fromPolyline", "(", "@", "NonNull", "String", "polyline", ",", "int", "precision", ")", "{", "return", "LineString", ".", "fromLngLats", "(", "PolylineUtils", ".", "decode", "(", "polyline", ",", "precision", ")", ",", "null"...
Create a new instance of this class by convert a polyline string into a lineString. This is handy when an API provides you with an encoded string representing the line geometry and you'd like to convert it to a useful LineString object. Note that the precision that the string geometry was encoded with needs to be known...
[ "Create", "a", "new", "instance", "of", "this", "class", "by", "convert", "a", "polyline", "string", "into", "a", "lineString", ".", "This", "is", "handy", "when", "an", "API", "provides", "you", "with", "an", "encoded", "string", "representing", "the", "l...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/LineString.java#L179-L181
googlegenomics/utils-java
src/main/java/com/google/cloud/genomics/utils/grpc/GenomicsChannel.java
GenomicsChannel.fromOfflineAuth
public static ManagedChannel fromOfflineAuth(OfflineAuth auth, String fields) throws IOException, GeneralSecurityException { """ Create a new gRPC channel to the Google Genomics API, using either OfflineAuth or the application default credentials. This library will work with both the newer and older vers...
java
public static ManagedChannel fromOfflineAuth(OfflineAuth auth, String fields) throws IOException, GeneralSecurityException { return fromCreds(auth.getCredentials(), fields); }
[ "public", "static", "ManagedChannel", "fromOfflineAuth", "(", "OfflineAuth", "auth", ",", "String", "fields", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "return", "fromCreds", "(", "auth", ".", "getCredentials", "(", ")", ",", "fields", ")...
Create a new gRPC channel to the Google Genomics API, using either OfflineAuth or the application default credentials. This library will work with both the newer and older versions of OAuth2 client-side support. https://developers.google.com/identity/protocols/application-default-credentials @param auth The OfflineA...
[ "Create", "a", "new", "gRPC", "channel", "to", "the", "Google", "Genomics", "API", "using", "either", "OfflineAuth", "or", "the", "application", "default", "credentials", "." ]
train
https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/grpc/GenomicsChannel.java#L145-L148
zafarkhaja/jsemver
src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java
ExpressionParser.parseTildeRange
private CompositeExpression parseTildeRange() { """ Parses the {@literal <tilde-range>} non-terminal. <pre> {@literal <tilde-range> ::= "~" <version> } </pre> @return the expression AST """ consumeNextToken(TILDE); int major = intOf(consumeNextToken(NUMERIC).lexeme); if (!toke...
java
private CompositeExpression parseTildeRange() { consumeNextToken(TILDE); int major = intOf(consumeNextToken(NUMERIC).lexeme); if (!tokens.positiveLookahead(DOT)) { return gte(versionFor(major)).and(lt(versionFor(major + 1))); } consumeNextToken(DOT); int minor...
[ "private", "CompositeExpression", "parseTildeRange", "(", ")", "{", "consumeNextToken", "(", "TILDE", ")", ";", "int", "major", "=", "intOf", "(", "consumeNextToken", "(", "NUMERIC", ")", ".", "lexeme", ")", ";", "if", "(", "!", "tokens", ".", "positiveLooka...
Parses the {@literal <tilde-range>} non-terminal. <pre> {@literal <tilde-range> ::= "~" <version> } </pre> @return the expression AST
[ "Parses", "the", "{", "@literal", "<tilde", "-", "range", ">", "}", "non", "-", "terminal", "." ]
train
https://github.com/zafarkhaja/jsemver/blob/1f4996ea3dab06193c378fd66fd4f8fdc8334cc6/src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java#L233-L247
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierValue.java
TypeQualifierValue.getValue
@SuppressWarnings("rawtypes") public static @Nonnull TypeQualifierValue<?> getValue(ClassDescriptor desc, @CheckForNull Object value) { """ Given a ClassDescriptor/value pair, return the interned TypeQualifierValue representing that pair. @param desc a ClassDescriptor denoting a type qualifier annota...
java
@SuppressWarnings("rawtypes") public static @Nonnull TypeQualifierValue<?> getValue(ClassDescriptor desc, @CheckForNull Object value) { DualKeyHashMap<ClassDescriptor, Object, TypeQualifierValue<?>> map = instance.get().typeQualifierMap; TypeQualifierValue<?> result = map.get(desc, value); ...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "@", "Nonnull", "TypeQualifierValue", "<", "?", ">", "getValue", "(", "ClassDescriptor", "desc", ",", "@", "CheckForNull", "Object", "value", ")", "{", "DualKeyHashMap", "<", "ClassDescriptor",...
Given a ClassDescriptor/value pair, return the interned TypeQualifierValue representing that pair. @param desc a ClassDescriptor denoting a type qualifier annotation @param value a value @return an interned TypeQualifierValue object
[ "Given", "a", "ClassDescriptor", "/", "value", "pair", "return", "the", "interned", "TypeQualifierValue", "representing", "that", "pair", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierValue.java#L288-L300
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java
DomHelper.doSetController
protected void doSetController(Element element, GraphicsController controller, int eventMask) { """ Set the controller on an element of this <code>GraphicsContext</code> so it can react to events. @param element the element on which the controller should be set @param controller The new <code>GraphicsControl...
java
protected void doSetController(Element element, GraphicsController controller, int eventMask) { if (element != null) { Dom.setEventListener(element, new EventListenerHelper(element, controller, eventMask)); Dom.sinkEvents(element, eventMask); } }
[ "protected", "void", "doSetController", "(", "Element", "element", ",", "GraphicsController", "controller", ",", "int", "eventMask", ")", "{", "if", "(", "element", "!=", "null", ")", "{", "Dom", ".", "setEventListener", "(", "element", ",", "new", "EventListe...
Set the controller on an element of this <code>GraphicsContext</code> so it can react to events. @param element the element on which the controller should be set @param controller The new <code>GraphicsController</code> @param eventMask a bitmask to specify which events to listen for {@link com.google.gwt.user.client....
[ "Set", "the", "controller", "on", "an", "element", "of", "this", "<code", ">", "GraphicsContext<", "/", "code", ">", "so", "it", "can", "react", "to", "events", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L613-L618
RestComm/sip-servlets
containers/sip-servlets-as10/src/main/java/org/mobicents/servlet/sip/undertow/security/authentication/SipDigestAuthenticationMechanism.java
SipDigestAuthenticationMechanism.removeQuotes
protected static String removeQuotes(String quotedString, boolean quotesRequired) { """ Removes the quotes on a string. RFC2617 states quotes are optional for all parameters except realm. """ // support both quoted and non-quoted if (quotedString.length() > 0 && quotedString.charAt(0) != '"' &&...
java
protected static String removeQuotes(String quotedString, boolean quotesRequired) { // support both quoted and non-quoted if (quotedString.length() > 0 && quotedString.charAt(0) != '"' && !quotesRequired) { return quotedString; } else if (quotedString.length() > 2) { retu...
[ "protected", "static", "String", "removeQuotes", "(", "String", "quotedString", ",", "boolean", "quotesRequired", ")", "{", "// support both quoted and non-quoted", "if", "(", "quotedString", ".", "length", "(", ")", ">", "0", "&&", "quotedString", ".", "charAt", ...
Removes the quotes on a string. RFC2617 states quotes are optional for all parameters except realm.
[ "Removes", "the", "quotes", "on", "a", "string", ".", "RFC2617", "states", "quotes", "are", "optional", "for", "all", "parameters", "except", "realm", "." ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/containers/sip-servlets-as10/src/main/java/org/mobicents/servlet/sip/undertow/security/authentication/SipDigestAuthenticationMechanism.java#L549-L558
janus-project/guava.janusproject.io
guava/src/com/google/common/base/CharMatcher.java
CharMatcher.replaceFrom
@CheckReturnValue public String replaceFrom(CharSequence sequence, CharSequence replacement) { """ Returns a string copy of the input character sequence, with each character that matches this matcher replaced by a given replacement sequence. For example: <pre> {@code CharMatcher.is('a').replaceFrom("yaha",...
java
@CheckReturnValue public String replaceFrom(CharSequence sequence, CharSequence replacement) { int replacementLen = replacement.length(); if (replacementLen == 0) { return removeFrom(sequence); } if (replacementLen == 1) { return replaceFrom(sequence, replacement.charAt(0)); } Str...
[ "@", "CheckReturnValue", "public", "String", "replaceFrom", "(", "CharSequence", "sequence", ",", "CharSequence", "replacement", ")", "{", "int", "replacementLen", "=", "replacement", ".", "length", "(", ")", ";", "if", "(", "replacementLen", "==", "0", ")", "...
Returns a string copy of the input character sequence, with each character that matches this matcher replaced by a given replacement sequence. For example: <pre> {@code CharMatcher.is('a').replaceFrom("yaha", "oo")}</pre> ... returns {@code "yoohoo"}. <p><b>Note:</b> If the replacement is a fixed string with only ...
[ "Returns", "a", "string", "copy", "of", "the", "input", "character", "sequence", "with", "each", "character", "that", "matches", "this", "matcher", "replaced", "by", "a", "given", "replacement", "sequence", ".", "For", "example", ":", "<pre", ">", "{", "@cod...
train
https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/CharMatcher.java#L1146-L1175
btc-ag/redg
redg-runtime/src/main/java/com/btc/redg/runtime/AbstractRedG.java
AbstractRedG.findSingleEntity
public <T extends RedGEntity> T findSingleEntity(final Class<T> type, final Predicate<T> filter) { """ Finds a single entity in the list of entities to insert into the database. If multiple entities match the {@link Predicate}, the entity that was added first will be returned. @param type The class of the en...
java
public <T extends RedGEntity> T findSingleEntity(final Class<T> type, final Predicate<T> filter) { return this.entities.stream() .filter(obj -> Objects.equals(type, obj.getClass())) .map(type::cast) .filter(filter) .findFirst() ...
[ "public", "<", "T", "extends", "RedGEntity", ">", "T", "findSingleEntity", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Predicate", "<", "T", ">", "filter", ")", "{", "return", "this", ".", "entities", ".", "stream", "(", ")", ".", "f...
Finds a single entity in the list of entities to insert into the database. If multiple entities match the {@link Predicate}, the entity that was added first will be returned. @param type The class of the entity @param filter A predicate that gets called for every entity that has the requested type. Should return {@c...
[ "Finds", "a", "single", "entity", "in", "the", "list", "of", "entities", "to", "insert", "into", "the", "database", ".", "If", "multiple", "entities", "match", "the", "{", "@link", "Predicate", "}", "the", "entity", "that", "was", "added", "first", "will",...
train
https://github.com/btc-ag/redg/blob/416a68639d002512cabfebff09afd2e1909e27df/redg-runtime/src/main/java/com/btc/redg/runtime/AbstractRedG.java#L202-L209
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java
AbstractMappingHTTPResponseHandler.populateFaxActionType2ReponseDataPathMappings
protected void populateFaxActionType2ReponseDataPathMappings(FaxActionType[] faxActionTypes,Enum<?>[] configurationKeys) { """ This function populates the fax action type to response data path mappings based on the configuration of the handler. @param faxActionTypes The fax action types used for the mapping...
java
protected void populateFaxActionType2ReponseDataPathMappings(FaxActionType[] faxActionTypes,Enum<?>[] configurationKeys) { //populate map String path=null; for(int index=0;index<faxActionTypes.length;index++) { //get next path path=this.getConfigurationValue(c...
[ "protected", "void", "populateFaxActionType2ReponseDataPathMappings", "(", "FaxActionType", "[", "]", "faxActionTypes", ",", "Enum", "<", "?", ">", "[", "]", "configurationKeys", ")", "{", "//populate map", "String", "path", "=", "null", ";", "for", "(", "int", ...
This function populates the fax action type to response data path mappings based on the configuration of the handler. @param faxActionTypes The fax action types used for the mapping @param configurationKeys The configuration keys used for the mapping
[ "This", "function", "populates", "the", "fax", "action", "type", "to", "response", "data", "path", "mappings", "based", "on", "the", "configuration", "of", "the", "handler", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java#L80-L93
AgNO3/jcifs-ng
src/main/java/jcifs/internal/smb1/AndXServerMessageBlock.java
AndXServerMessageBlock.decode
@Override public int decode ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException { """ /* We overload this because we want readAndXWireFormat to read the parameter words and bytes. This is so when commands are batched together we can recursivly call readAndXWireFormat without reading the ...
java
@Override public int decode ( byte[] buffer, int bufferIndex ) throws SMBProtocolDecodingException { int start = this.headerStart = bufferIndex; bufferIndex += readHeaderWireFormat(buffer, bufferIndex); bufferIndex += readAndXWireFormat(buffer, bufferIndex); int len = bufferIndex -...
[ "@", "Override", "public", "int", "decode", "(", "byte", "[", "]", "buffer", ",", "int", "bufferIndex", ")", "throws", "SMBProtocolDecodingException", "{", "int", "start", "=", "this", ".", "headerStart", "=", "bufferIndex", ";", "bufferIndex", "+=", "readHead...
/* We overload this because we want readAndXWireFormat to read the parameter words and bytes. This is so when commands are batched together we can recursivly call readAndXWireFormat without reading the non-existent header.
[ "/", "*", "We", "overload", "this", "because", "we", "want", "readAndXWireFormat", "to", "read", "the", "parameter", "words", "and", "bytes", ".", "This", "is", "so", "when", "commands", "are", "batched", "together", "we", "can", "recursivly", "call", "readA...
train
https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/internal/smb1/AndXServerMessageBlock.java#L158-L178
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonitor_binding.java
lbmonitor_binding.get
public static lbmonitor_binding get(nitro_service service, String monitorname) throws Exception { """ Use this API to fetch lbmonitor_binding resource of given name . """ lbmonitor_binding obj = new lbmonitor_binding(); obj.set_monitorname(monitorname); lbmonitor_binding response = (lbmonitor_binding) ob...
java
public static lbmonitor_binding get(nitro_service service, String monitorname) throws Exception{ lbmonitor_binding obj = new lbmonitor_binding(); obj.set_monitorname(monitorname); lbmonitor_binding response = (lbmonitor_binding) obj.get_resource(service); return response; }
[ "public", "static", "lbmonitor_binding", "get", "(", "nitro_service", "service", ",", "String", "monitorname", ")", "throws", "Exception", "{", "lbmonitor_binding", "obj", "=", "new", "lbmonitor_binding", "(", ")", ";", "obj", ".", "set_monitorname", "(", "monitor...
Use this API to fetch lbmonitor_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "lbmonitor_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonitor_binding.java#L103-L108
apache/incubator-shardingsphere
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java
ShardingRule.getDataNode
public DataNode getDataNode(final String dataSourceName, final String logicTableName) { """ Find data node by data source and logic table. @param dataSourceName data source name @param logicTableName logic table name @return data node """ TableRule tableRule = getTableRule(logicTableName); ...
java
public DataNode getDataNode(final String dataSourceName, final String logicTableName) { TableRule tableRule = getTableRule(logicTableName); for (DataNode each : tableRule.getActualDataNodes()) { if (shardingDataSourceNames.getDataSourceNames().contains(each.getDataSourceName()) && each.getDa...
[ "public", "DataNode", "getDataNode", "(", "final", "String", "dataSourceName", ",", "final", "String", "logicTableName", ")", "{", "TableRule", "tableRule", "=", "getTableRule", "(", "logicTableName", ")", ";", "for", "(", "DataNode", "each", ":", "tableRule", "...
Find data node by data source and logic table. @param dataSourceName data source name @param logicTableName logic table name @return data node
[ "Find", "data", "node", "by", "data", "source", "and", "logic", "table", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java#L415-L423
taimos/spring-cxf-daemon
src/main/java/de/taimos/springcxfdaemon/websocket/ClientSocketAdapter.java
ClientSocketAdapter.readMessage
protected final <T> T readMessage(String message, Class<T> clazz) { """ reads the received string into the given class by parsing JSON @param <T> the expected type @param message the JSON string @param clazz the target class of type T @return the parsed object or null if parsing was not possible or message i...
java
protected final <T> T readMessage(String message, Class<T> clazz) { if ((message == null) || message.isEmpty()) { ClientSocketAdapter.LOGGER.info("Got empty session data"); return null; } try { return this.mapper.readValue(message, clazz); } catch (IOException e1) { ClientSocketAdapter.LOGGER.info("...
[ "protected", "final", "<", "T", ">", "T", "readMessage", "(", "String", "message", ",", "Class", "<", "T", ">", "clazz", ")", "{", "if", "(", "(", "message", "==", "null", ")", "||", "message", ".", "isEmpty", "(", ")", ")", "{", "ClientSocketAdapter...
reads the received string into the given class by parsing JSON @param <T> the expected type @param message the JSON string @param clazz the target class of type T @return the parsed object or null if parsing was not possible or message is null
[ "reads", "the", "received", "string", "into", "the", "given", "class", "by", "parsing", "JSON" ]
train
https://github.com/taimos/spring-cxf-daemon/blob/a2f2158043ab7339ac08d9acfc3fe61d5a34b43a/src/main/java/de/taimos/springcxfdaemon/websocket/ClientSocketAdapter.java#L98-L109
alkacon/opencms-core
src/org/opencms/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalInt
private int readOptionalInt(JSONObject json, String key) { """ Read an optional int value (stored as string) form a JSON Object. @param json the JSON object to read from. @param key the key for the int value in the provided JSON object. @return the int or 0 if reading the int fails. """ try { ...
java
private int readOptionalInt(JSONObject json, String key) { try { String str = json.getString(key); return Integer.valueOf(str).intValue(); } catch (NumberFormatException | JSONException e) { LOG.debug("Reading optional JSON int failed. Default to provided default val...
[ "private", "int", "readOptionalInt", "(", "JSONObject", "json", ",", "String", "key", ")", "{", "try", "{", "String", "str", "=", "json", ".", "getString", "(", "key", ")", ";", "return", "Integer", ".", "valueOf", "(", "str", ")", ".", "intValue", "("...
Read an optional int value (stored as string) form a JSON Object. @param json the JSON object to read from. @param key the key for the int value in the provided JSON object. @return the int or 0 if reading the int fails.
[ "Read", "an", "optional", "int", "value", "(", "stored", "as", "string", ")", "form", "a", "JSON", "Object", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L350-L359
dwdyer/reportng
reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java
HTMLReporter.generateReport
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectoryName) { """ Generates a set of HTML files that contain data about the outcome of the specified test suites. @param suites Data about the test runs. @param...
java
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectoryName) { removeEmptyDirectories(new File(outputDirectoryName)); boolean useFrames = System.getProperty(FRAMES_PROPERTY, "true").equals...
[ "public", "void", "generateReport", "(", "List", "<", "XmlSuite", ">", "xmlSuites", ",", "List", "<", "ISuite", ">", "suites", ",", "String", "outputDirectoryName", ")", "{", "removeEmptyDirectories", "(", "new", "File", "(", "outputDirectoryName", ")", ")", "...
Generates a set of HTML files that contain data about the outcome of the specified test suites. @param suites Data about the test runs. @param outputDirectoryName The directory in which to create the report.
[ "Generates", "a", "set", "of", "HTML", "files", "that", "contain", "data", "about", "the", "outcome", "of", "the", "specified", "test", "suites", "." ]
train
https://github.com/dwdyer/reportng/blob/df11f9cd9ab3fb5847fbba94ed3098ae0448f770/reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java#L90-L119
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.billboardSpherical
public Matrix4d billboardSpherical(Vector3dc objPos, Vector3dc targetPos) { """ Set this matrix to a spherical billboard transformation that rotates the local +Z axis of a given object with position <code>objPos</code> towards a target position at <code>targetPos</code> using a shortest arc rotation by not preser...
java
public Matrix4d billboardSpherical(Vector3dc objPos, Vector3dc targetPos) { double toDirX = targetPos.x() - objPos.x(); double toDirY = targetPos.y() - objPos.y(); double toDirZ = targetPos.z() - objPos.z(); double x = -toDirY; double y = toDirX; double w = Math.sqrt(toDi...
[ "public", "Matrix4d", "billboardSpherical", "(", "Vector3dc", "objPos", ",", "Vector3dc", "targetPos", ")", "{", "double", "toDirX", "=", "targetPos", ".", "x", "(", ")", "-", "objPos", ".", "x", "(", ")", ";", "double", "toDirY", "=", "targetPos", ".", ...
Set this matrix to a spherical billboard transformation that rotates the local +Z axis of a given object with position <code>objPos</code> towards a target position at <code>targetPos</code> using a shortest arc rotation by not preserving any <i>up</i> vector of the object. <p> This method can be used to create the com...
[ "Set", "this", "matrix", "to", "a", "spherical", "billboard", "transformation", "that", "rotates", "the", "local", "+", "Z", "axis", "of", "a", "given", "object", "with", "position", "<code", ">", "objPos<", "/", "code", ">", "towards", "a", "target", "pos...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L14387-L14421
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/Options.java
Options.setOptions
public void setOptions(final String[] flags, final int startIndex, final int endIndexPlusOne) { """ Set options based on a String array in the style of commandline flags. This method goes through the array until it ends, processing options, as for {@link #setOption}. @param flags Array of options. The option...
java
public void setOptions(final String[] flags, final int startIndex, final int endIndexPlusOne) { for (int i = startIndex; i < endIndexPlusOne;) { i = setOption(flags, i); } }
[ "public", "void", "setOptions", "(", "final", "String", "[", "]", "flags", ",", "final", "int", "startIndex", ",", "final", "int", "endIndexPlusOne", ")", "{", "for", "(", "int", "i", "=", "startIndex", ";", "i", "<", "endIndexPlusOne", ";", ")", "{", ...
Set options based on a String array in the style of commandline flags. This method goes through the array until it ends, processing options, as for {@link #setOption}. @param flags Array of options. The options passed in should be specified like command-line arguments, including with an initial minus sign for exampl...
[ "Set", "options", "based", "on", "a", "String", "array", "in", "the", "style", "of", "commandline", "flags", ".", "This", "method", "goes", "through", "the", "array", "until", "it", "ends", "processing", "options", "as", "for", "{", "@link", "#setOption", ...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/Options.java#L64-L68
jayantk/jklol
src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java
HeadedSyntacticCategory.getReturnType
public HeadedSyntacticCategory getReturnType() { """ Gets the syntactic type and semantic variable assignments to the return type of this category. @return """ SyntacticCategory returnSyntax = syntacticCategory.getReturn(); int[] returnSemantics = ArrayUtils.copyOf(semanticVariables, rootIndex); ...
java
public HeadedSyntacticCategory getReturnType() { SyntacticCategory returnSyntax = syntacticCategory.getReturn(); int[] returnSemantics = ArrayUtils.copyOf(semanticVariables, rootIndex); int returnRoot = returnSyntax.getNumReturnSubcategories(); return new HeadedSyntacticCategory(returnSyntax, returnSema...
[ "public", "HeadedSyntacticCategory", "getReturnType", "(", ")", "{", "SyntacticCategory", "returnSyntax", "=", "syntacticCategory", ".", "getReturn", "(", ")", ";", "int", "[", "]", "returnSemantics", "=", "ArrayUtils", ".", "copyOf", "(", "semanticVariables", ",", ...
Gets the syntactic type and semantic variable assignments to the return type of this category. @return
[ "Gets", "the", "syntactic", "type", "and", "semantic", "variable", "assignments", "to", "the", "return", "type", "of", "this", "category", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L277-L282
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/AbstractPrintQuery.java
AbstractPrintQuery.getMsgPhrase
public String getMsgPhrase(final SelectBuilder _selectBldr, final CIMsgPhrase _msgPhrase) throws EFapsException { """ Get the String representation of a phrase. @param _selectBldr the select bldr @param _msgPhrase the msg phrase @return String representation of the phras...
java
public String getMsgPhrase(final SelectBuilder _selectBldr, final CIMsgPhrase _msgPhrase) throws EFapsException { return getMsgPhrase(_selectBldr, _msgPhrase.getMsgPhrase()); }
[ "public", "String", "getMsgPhrase", "(", "final", "SelectBuilder", "_selectBldr", ",", "final", "CIMsgPhrase", "_msgPhrase", ")", "throws", "EFapsException", "{", "return", "getMsgPhrase", "(", "_selectBldr", ",", "_msgPhrase", ".", "getMsgPhrase", "(", ")", ")", ...
Get the String representation of a phrase. @param _selectBldr the select bldr @param _msgPhrase the msg phrase @return String representation of the phrase @throws EFapsException on error
[ "Get", "the", "String", "representation", "of", "a", "phrase", "." ]
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/AbstractPrintQuery.java#L604-L609
mgm-tp/jfunk
jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java
MailService.findMessages
public List<MailMessage> findMessages(final String accountReservationKey, final Predicate<MailMessage> condition) { """ Tries to find messages for the mail account reserved under the specified {@code accountReservationKey} applying the specified {@code condition} until it times out using the default timeout ( {@...
java
public List<MailMessage> findMessages(final String accountReservationKey, final Predicate<MailMessage> condition) { return findMessages(accountReservationKey, condition, defaultTimeoutSeconds); }
[ "public", "List", "<", "MailMessage", ">", "findMessages", "(", "final", "String", "accountReservationKey", ",", "final", "Predicate", "<", "MailMessage", ">", "condition", ")", "{", "return", "findMessages", "(", "accountReservationKey", ",", "condition", ",", "d...
Tries to find messages for the mail account reserved under the specified {@code accountReservationKey} applying the specified {@code condition} until it times out using the default timeout ( {@link EmailConstants#MAIL_TIMEOUT_SECONDS} and {@link EmailConstants#MAIL_SLEEP_MILLIS}). @param accountReservationKey the key ...
[ "Tries", "to", "find", "messages", "for", "the", "mail", "account", "reserved", "under", "the", "specified", "{", "@code", "accountReservationKey", "}", "applying", "the", "specified", "{", "@code", "condition", "}", "until", "it", "times", "out", "using", "th...
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L221-L223
line/armeria
core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java
ServerSentEvents.fromPublisher
public static <T> HttpResponse fromPublisher(Publisher<T> contentPublisher, Function<? super T, ? extends ServerSentEvent> converter) { """ Creates a new Server-Sent Events stream from the specified {@link Publisher} and {@code converter}. @param contentPublisher...
java
public static <T> HttpResponse fromPublisher(Publisher<T> contentPublisher, Function<? super T, ? extends ServerSentEvent> converter) { return fromPublisher(defaultHttpHeaders, contentPublisher, HttpHeaders.EMPTY_HEADERS, converter); }
[ "public", "static", "<", "T", ">", "HttpResponse", "fromPublisher", "(", "Publisher", "<", "T", ">", "contentPublisher", ",", "Function", "<", "?", "super", "T", ",", "?", "extends", "ServerSentEvent", ">", "converter", ")", "{", "return", "fromPublisher", "...
Creates a new Server-Sent Events stream from the specified {@link Publisher} and {@code converter}. @param contentPublisher the {@link Publisher} which publishes the objects supposed to send as contents @param converter the converter which converts published objects into {@link ServerSentEvent}s
[ "Creates", "a", "new", "Server", "-", "Sent", "Events", "stream", "from", "the", "specified", "{", "@link", "Publisher", "}", "and", "{", "@code", "converter", "}", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java#L125-L128
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/products/ProductVariationUrl.java
ProductVariationUrl.getProductVariationLocalizedDeltaPricesUrl
public static MozuUrl getProductVariationLocalizedDeltaPricesUrl(String productCode, String variationKey) { """ Get Resource Url for GetProductVariationLocalizedDeltaPrices @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. @param vari...
java
public static MozuUrl getProductVariationLocalizedDeltaPricesUrl(String productCode, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations/{variationKey}/localizedDeltaPrice"); formatter.formatUrl("productCode", productCode); formatter...
[ "public", "static", "MozuUrl", "getProductVariationLocalizedDeltaPricesUrl", "(", "String", "productCode", ",", "String", "variationKey", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/catalog/admin/products/{productCode}/variations/{vari...
Get Resource Url for GetProductVariationLocalizedDeltaPrices @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation....
[ "Get", "Resource", "Url", "for", "GetProductVariationLocalizedDeltaPrices" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/products/ProductVariationUrl.java#L22-L28
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/ParallelStepBuilder.java
ParallelStepBuilder.buildFlowInSplitSubJob
public static JSLJob buildFlowInSplitSubJob(long topLevelJobInstanceId, JobContext jobContext, Split split, Flow flow) { """ /* Build a generated job with only one flow in it to submit to the BatchKernel. This is used to build subjobs from splits. """ ObjectFactory jslFactory = new ObjectFactory(); ...
java
public static JSLJob buildFlowInSplitSubJob(long topLevelJobInstanceId, JobContext jobContext, Split split, Flow flow) { ObjectFactory jslFactory = new ObjectFactory(); JSLJob subJob = jslFactory.createJSLJob(); // Uses the true top-level job instance id, not an internal "subjob" id. S...
[ "public", "static", "JSLJob", "buildFlowInSplitSubJob", "(", "long", "topLevelJobInstanceId", ",", "JobContext", "jobContext", ",", "Split", "split", ",", "Flow", "flow", ")", "{", "ObjectFactory", "jslFactory", "=", "new", "ObjectFactory", "(", ")", ";", "JSLJob"...
/* Build a generated job with only one flow in it to submit to the BatchKernel. This is used to build subjobs from splits.
[ "/", "*", "Build", "a", "generated", "job", "with", "only", "one", "flow", "in", "it", "to", "submit", "to", "the", "BatchKernel", ".", "This", "is", "used", "to", "build", "subjobs", "from", "splits", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/ParallelStepBuilder.java#L40-L58
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java
XmlUtil.getNodeListByXPath
public static NodeList getNodeListByXPath(String expression, Object source) { """ 通过XPath方式读取XML的NodeList<br> Xpath相关文章:https://www.ibm.com/developerworks/cn/xml/x-javaxpathapi.html @param expression XPath表达式 @param source 资源,可以是Docunent、Node节点等 @return NodeList @since 4.0.9 """ return (NodeList) get...
java
public static NodeList getNodeListByXPath(String expression, Object source) { return (NodeList) getByXPath(expression, source, XPathConstants.NODESET); }
[ "public", "static", "NodeList", "getNodeListByXPath", "(", "String", "expression", ",", "Object", "source", ")", "{", "return", "(", "NodeList", ")", "getByXPath", "(", "expression", ",", "source", ",", "XPathConstants", ".", "NODESET", ")", ";", "}" ]
通过XPath方式读取XML的NodeList<br> Xpath相关文章:https://www.ibm.com/developerworks/cn/xml/x-javaxpathapi.html @param expression XPath表达式 @param source 资源,可以是Docunent、Node节点等 @return NodeList @since 4.0.9
[ "通过XPath方式读取XML的NodeList<br", ">", "Xpath相关文章:https", ":", "//", "www", ".", "ibm", ".", "com", "/", "developerworks", "/", "cn", "/", "xml", "/", "x", "-", "javaxpathapi", ".", "html" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L585-L587
onelogin/onelogin-java-sdk
src/main/java/com/onelogin/sdk/conn/Client.java
Client.generateMFAToken
public MFAToken generateMFAToken(long userId,Integer expiresIn) throws OAuthSystemException, OAuthProblemException, URISyntaxException { """ Generates an access token for a user @param userId Id of the user @param expiresIn Set the duration of the token in seconds. (default: 259200 seconds = 72h) 72 hours i...
java
public MFAToken generateMFAToken(long userId,Integer expiresIn) throws OAuthSystemException, OAuthProblemException, URISyntaxException { return generateMFAToken(userId, expiresIn, false); }
[ "public", "MFAToken", "generateMFAToken", "(", "long", "userId", ",", "Integer", "expiresIn", ")", "throws", "OAuthSystemException", ",", "OAuthProblemException", ",", "URISyntaxException", "{", "return", "generateMFAToken", "(", "userId", ",", "expiresIn", ",", "fals...
Generates an access token for a user @param userId Id of the user @param expiresIn Set the duration of the token in seconds. (default: 259200 seconds = 72h) 72 hours is the max value. @return Created MFAToken @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection @throws...
[ "Generates", "an", "access", "token", "for", "a", "user" ]
train
https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L777-L779
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPP8Reader.java
MPP8Reader.setTaskNotes
private void setTaskNotes(Task task, byte[] data, ExtendedData taskExtData, FixDeferFix taskVarData) { """ There appear to be two ways of representing task notes in an MPP8 file. This method tries to determine which has been used. @param task task @param data task data @param taskExtData extended task data ...
java
private void setTaskNotes(Task task, byte[] data, ExtendedData taskExtData, FixDeferFix taskVarData) { String notes = taskExtData.getString(TASK_NOTES); if (notes == null && data.length == 366) { byte[] offsetData = taskVarData.getByteArray(getOffset(data, 362)); if (offsetData !=...
[ "private", "void", "setTaskNotes", "(", "Task", "task", ",", "byte", "[", "]", "data", ",", "ExtendedData", "taskExtData", ",", "FixDeferFix", "taskVarData", ")", "{", "String", "notes", "=", "taskExtData", ".", "getString", "(", "TASK_NOTES", ")", ";", "if"...
There appear to be two ways of representing task notes in an MPP8 file. This method tries to determine which has been used. @param task task @param data task data @param taskExtData extended task data @param taskVarData task var data
[ "There", "appear", "to", "be", "two", "ways", "of", "representing", "task", "notes", "in", "an", "MPP8", "file", ".", "This", "method", "tries", "to", "determine", "which", "has", "been", "used", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP8Reader.java#L742-L772
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java
Expression2.substitute
public Expression2 substitute(int index, String newConstantExpression) { """ Replaces the expression at {@code index} in this expression with {@code newConstantExpression} (as a constant expression). @param index @param newConstantExpression @return """ return substitute(index, Expression2.constant(n...
java
public Expression2 substitute(int index, String newConstantExpression) { return substitute(index, Expression2.constant(newConstantExpression)); }
[ "public", "Expression2", "substitute", "(", "int", "index", ",", "String", "newConstantExpression", ")", "{", "return", "substitute", "(", "index", ",", "Expression2", ".", "constant", "(", "newConstantExpression", ")", ")", ";", "}" ]
Replaces the expression at {@code index} in this expression with {@code newConstantExpression} (as a constant expression). @param index @param newConstantExpression @return
[ "Replaces", "the", "expression", "at", "{", "@code", "index", "}", "in", "this", "expression", "with", "{", "@code", "newConstantExpression", "}", "(", "as", "a", "constant", "expression", ")", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java#L217-L219
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.getValue
public static String getValue(String propertyName, String instanceName) { """ Returns a property value as a string. @param propertyName Name of the property whose value is sought. @param instanceName An optional instance name. Use null to indicate the default instance. @return The property value, or null if n...
java
public static String getValue(String propertyName, String instanceName) { return getPropertyService().getValue(propertyName, instanceName); }
[ "public", "static", "String", "getValue", "(", "String", "propertyName", ",", "String", "instanceName", ")", "{", "return", "getPropertyService", "(", ")", ".", "getValue", "(", "propertyName", ",", "instanceName", ")", ";", "}" ]
Returns a property value as a string. @param propertyName Name of the property whose value is sought. @param instanceName An optional instance name. Use null to indicate the default instance. @return The property value, or null if not found. @see IPropertyService#getValue
[ "Returns", "a", "property", "value", "as", "a", "string", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L83-L85
fuinorg/utils4j
src/main/java/org/fuin/utils4j/Utils4J.java
Utils4J.fileInsideDirectory
public static boolean fileInsideDirectory(final File dir, final File file) { """ Checks if a given file is inside the given directory. @param dir Base directory - Cannot be <code>null</code>. @param file File - Cannot be <code>null</code>. @return If the file is inside the directory TRUE, else FALSE. ...
java
public static boolean fileInsideDirectory(final File dir, final File file) { checkNotNull("dir", dir); checkNotNull("file", file); final String dirPath = getCanonicalPath(dir); final String filePath = getCanonicalPath(file); return filePath.startsWith(dirPath); }
[ "public", "static", "boolean", "fileInsideDirectory", "(", "final", "File", "dir", ",", "final", "File", "file", ")", "{", "checkNotNull", "(", "\"dir\"", ",", "dir", ")", ";", "checkNotNull", "(", "\"file\"", ",", "file", ")", ";", "final", "String", "dir...
Checks if a given file is inside the given directory. @param dir Base directory - Cannot be <code>null</code>. @param file File - Cannot be <code>null</code>. @return If the file is inside the directory TRUE, else FALSE.
[ "Checks", "if", "a", "given", "file", "is", "inside", "the", "given", "directory", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L533-L540
jcuda/jcusparse
JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java
JCusparse.cusparseSsctr
public static int cusparseSsctr( cusparseHandle handle, int nnz, Pointer xVal, Pointer xInd, Pointer y, int idxBase) { """ Description: Scatter of elements of the sparse vector x into dense vector y. """ return checkResult(cusparseSsctrNative...
java
public static int cusparseSsctr( cusparseHandle handle, int nnz, Pointer xVal, Pointer xInd, Pointer y, int idxBase) { return checkResult(cusparseSsctrNative(handle, nnz, xVal, xInd, y, idxBase)); }
[ "public", "static", "int", "cusparseSsctr", "(", "cusparseHandle", "handle", ",", "int", "nnz", ",", "Pointer", "xVal", ",", "Pointer", "xInd", ",", "Pointer", "y", ",", "int", "idxBase", ")", "{", "return", "checkResult", "(", "cusparseSsctrNative", "(", "h...
Description: Scatter of elements of the sparse vector x into dense vector y.
[ "Description", ":", "Scatter", "of", "elements", "of", "the", "sparse", "vector", "x", "into", "dense", "vector", "y", "." ]
train
https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L1012-L1021
facebook/fresco
imagepipeline-backends/imagepipeline-okhttp3/src/main/java/com/facebook/imagepipeline/backends/okhttp3/OkHttpNetworkFetcher.java
OkHttpNetworkFetcher.handleException
private void handleException(final Call call, final Exception e, final Callback callback) { """ Handles exceptions. <p> OkHttp notifies callers of cancellations via an IOException. If IOException is caught after request cancellation, then the exception is interpreted as successful cancellation and onCancellat...
java
private void handleException(final Call call, final Exception e, final Callback callback) { if (call.isCanceled()) { callback.onCancellation(); } else { callback.onFailure(e); } }
[ "private", "void", "handleException", "(", "final", "Call", "call", ",", "final", "Exception", "e", ",", "final", "Callback", "callback", ")", "{", "if", "(", "call", ".", "isCanceled", "(", ")", ")", "{", "callback", ".", "onCancellation", "(", ")", ";"...
Handles exceptions. <p> OkHttp notifies callers of cancellations via an IOException. If IOException is caught after request cancellation, then the exception is interpreted as successful cancellation and onCancellation is called. Otherwise onFailure is called.
[ "Handles", "exceptions", "." ]
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-backends/imagepipeline-okhttp3/src/main/java/com/facebook/imagepipeline/backends/okhttp3/OkHttpNetworkFetcher.java#L215-L221
OpenLiberty/open-liberty
dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/web/utils/SocialWebUtils.java
SocialWebUtils.deleteCookie
public void deleteCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, WebAppSecurityConfig webAppSecConfig) { """ Clears the specified cookie and sets its path to the current request URI. """ ReferrerURLCookieHandler referrerURLCookieHandler = getCookieHandler(); ...
java
public void deleteCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, WebAppSecurityConfig webAppSecConfig) { ReferrerURLCookieHandler referrerURLCookieHandler = getCookieHandler(); referrerURLCookieHandler.clearReferrerURLCookie(request, response, cookieName); C...
[ "public", "void", "deleteCookie", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "String", "cookieName", ",", "WebAppSecurityConfig", "webAppSecConfig", ")", "{", "ReferrerURLCookieHandler", "referrerURLCookieHandler", "=", "getCookieHandle...
Clears the specified cookie and sets its path to the current request URI.
[ "Clears", "the", "specified", "cookie", "and", "sets", "its", "path", "to", "the", "current", "request", "URI", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/web/utils/SocialWebUtils.java#L257-L263
inaiat/jqplot4java
src/main/java/br/com/digilabs/jqplot/JqPlotUtils.java
JqPlotUtils.createJquery
public static String createJquery(Chart<?> chart, String divId, String javaScriptVar) { """ Cria um comando jquery @param chart Chart @param divId id of element div @param javaScriptVar javascript variable @return jquery javascript """ StringBuilder builder = new StringBuilder(); builder.ap...
java
public static String createJquery(Chart<?> chart, String divId, String javaScriptVar) { StringBuilder builder = new StringBuilder(); builder.append("$(document).ready(function(){\r\n"); if (javaScriptVar != null) { builder.append(" var ").append(javaScriptVar).append("="); ...
[ "public", "static", "String", "createJquery", "(", "Chart", "<", "?", ">", "chart", ",", "String", "divId", ",", "String", "javaScriptVar", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "builder", ".", "append", "(", "\"...
Cria um comando jquery @param chart Chart @param divId id of element div @param javaScriptVar javascript variable @return jquery javascript
[ "Cria", "um", "comando", "jquery" ]
train
https://github.com/inaiat/jqplot4java/blob/35bcd17749442e88695df0438c8330a65a3977cc/src/main/java/br/com/digilabs/jqplot/JqPlotUtils.java#L81-L94
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java
FilesImpl.listFromTaskNextWithServiceResponseAsync
public Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromTaskHeaders>> listFromTaskNextWithServiceResponseAsync(final String nextPageLink, final FileListFromTaskNextOptions fileListFromTaskNextOptions) { """ Lists the files in a task's directory on its compute node. @param nextPageLink The NextL...
java
public Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromTaskHeaders>> listFromTaskNextWithServiceResponseAsync(final String nextPageLink, final FileListFromTaskNextOptions fileListFromTaskNextOptions) { return listFromTaskNextSinglePageAsync(nextPageLink, fileListFromTaskNextOptions) ...
[ "public", "Observable", "<", "ServiceResponseWithHeaders", "<", "Page", "<", "NodeFile", ">", ",", "FileListFromTaskHeaders", ">", ">", "listFromTaskNextWithServiceResponseAsync", "(", "final", "String", "nextPageLink", ",", "final", "FileListFromTaskNextOptions", "fileList...
Lists the files in a task's directory on its compute node. @param nextPageLink The NextLink from the previous successful call to List operation. @param fileListFromTaskNextOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to...
[ "Lists", "the", "files", "in", "a", "task", "s", "directory", "on", "its", "compute", "node", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L2401-L2413
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/GraphBuilder.java
GraphBuilder.buildNode
public final Node buildNode(Object entity, PersistenceDelegator pd, Object entityId, NodeState nodeState) { """ On build node. @param entity entity @param pc persistence cache @param entityId entity id @return added node. """ String nodeId = ObjectGraphUtils.getNodeId(entityId, entity.getClass...
java
public final Node buildNode(Object entity, PersistenceDelegator pd, Object entityId, NodeState nodeState) { String nodeId = ObjectGraphUtils.getNodeId(entityId, entity.getClass()); Node node = this.graph.getNode(nodeId); // If this node is already there in graph (may happen for bidirection...
[ "public", "final", "Node", "buildNode", "(", "Object", "entity", ",", "PersistenceDelegator", "pd", ",", "Object", "entityId", ",", "NodeState", "nodeState", ")", "{", "String", "nodeId", "=", "ObjectGraphUtils", ".", "getNodeId", "(", "entityId", ",", "entity",...
On build node. @param entity entity @param pc persistence cache @param entityId entity id @return added node.
[ "On", "build", "node", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/GraphBuilder.java#L80-L104
logic-ng/LogicNG
src/main/java/org/logicng/backbones/BackboneGeneration.java
BackboneGeneration.computeNegative
public static Backbone computeNegative(final Formula formula) { """ Computes the negative backbone variables for a given formula. @param formula the given formula @return the negative backbone or {@code null} if the formula is UNSAT """ return compute(formula, formula.variables(), BackboneType.ONLY_N...
java
public static Backbone computeNegative(final Formula formula) { return compute(formula, formula.variables(), BackboneType.ONLY_NEGATIVE); }
[ "public", "static", "Backbone", "computeNegative", "(", "final", "Formula", "formula", ")", "{", "return", "compute", "(", "formula", ",", "formula", ".", "variables", "(", ")", ",", "BackboneType", ".", "ONLY_NEGATIVE", ")", ";", "}" ]
Computes the negative backbone variables for a given formula. @param formula the given formula @return the negative backbone or {@code null} if the formula is UNSAT
[ "Computes", "the", "negative", "backbone", "variables", "for", "a", "given", "formula", "." ]
train
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L230-L232
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/DebugGenerators.java
DebugGenerators.debugPrint
public static InsnList debugPrint(InsnList text) { """ Generates instructions for printing out a string using {@link System#out}. This is useful for debugging. For example, you can print out lines around your instrumented code to make sure that what you think is being run is actually being run. @param text debug...
java
public static InsnList debugPrint(InsnList text) { Validate.notNull(text); InsnList ret = new InsnList(); ret.add(new FieldInsnNode(Opcodes.GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;")); ret.add(text); ret.add(new MethodInsnNode(Opcodes.INVOKEV...
[ "public", "static", "InsnList", "debugPrint", "(", "InsnList", "text", ")", "{", "Validate", ".", "notNull", "(", "text", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "FieldInsnNode", "(", "Opcodes", ...
Generates instructions for printing out a string using {@link System#out}. This is useful for debugging. For example, you can print out lines around your instrumented code to make sure that what you think is being run is actually being run. @param text debug text generation instruction list -- must leave a String on th...
[ "Generates", "instructions", "for", "printing", "out", "a", "string", "using", "{" ]
train
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/DebugGenerators.java#L96-L106
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java
AtomicAllocator.getPointer
@Override @Deprecated public Pointer getPointer(DataBuffer buffer, AllocationShape shape, boolean isView, CudaContext context) { """ This method returns actual device pointer valid for specified shape of current object @param buffer @param shape @param isView """ return memoryHandler.getDe...
java
@Override @Deprecated public Pointer getPointer(DataBuffer buffer, AllocationShape shape, boolean isView, CudaContext context) { return memoryHandler.getDevicePointer(buffer, context); }
[ "@", "Override", "@", "Deprecated", "public", "Pointer", "getPointer", "(", "DataBuffer", "buffer", ",", "AllocationShape", "shape", ",", "boolean", "isView", ",", "CudaContext", "context", ")", "{", "return", "memoryHandler", ".", "getDevicePointer", "(", "buffer...
This method returns actual device pointer valid for specified shape of current object @param buffer @param shape @param isView
[ "This", "method", "returns", "actual", "device", "pointer", "valid", "for", "specified", "shape", "of", "current", "object" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L303-L307
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java
Whitebox.invokeMethod
public static synchronized <T> T invokeMethod(Object instance, Object... arguments) throws Exception { """ Invoke a private or inner class method without the need to specify the method name. This is thus a more refactor friendly version of the {@link #invokeMethod(Object, String, Object...)} method and is recomm...
java
public static synchronized <T> T invokeMethod(Object instance, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(instance, arguments); }
[ "public", "static", "synchronized", "<", "T", ">", "T", "invokeMethod", "(", "Object", "instance", ",", "Object", "...", "arguments", ")", "throws", "Exception", "{", "return", "WhiteboxImpl", ".", "invokeMethod", "(", "instance", ",", "arguments", ")", ";", ...
Invoke a private or inner class method without the need to specify the method name. This is thus a more refactor friendly version of the {@link #invokeMethod(Object, String, Object...)} method and is recommend over this method for that reason. This method might be useful to test private methods. @throws Exception if s...
[ "Invoke", "a", "private", "or", "inner", "class", "method", "without", "the", "need", "to", "specify", "the", "method", "name", ".", "This", "is", "thus", "a", "more", "refactor", "friendly", "version", "of", "the", "{", "@link", "#invokeMethod", "(", "Obj...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L379-L381
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.write
public <TYPE> String write(@NotNull final TYPE obj, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { """ Marshals the object as XML to a string. @param obj Object to marshal. @param jaxbContext Context to use. @return XML String. @throws MarshalObjectException Error writing the ...
java
public <TYPE> String write(@NotNull final TYPE obj, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("jaxbContext", jaxbContext); final StringWriter writer = new StringWriter(); write(obj, w...
[ "public", "<", "TYPE", ">", "String", "write", "(", "@", "NotNull", "final", "TYPE", "obj", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")", "throws", "MarshalObjectException", "{", "Contract", ".", "requireArgNotNull", "(", "\"obj\"", ",", "ob...
Marshals the object as XML to a string. @param obj Object to marshal. @param jaxbContext Context to use. @return XML String. @throws MarshalObjectException Error writing the object. @param <TYPE> Type of the object.
[ "Marshals", "the", "object", "as", "XML", "to", "a", "string", "." ]
train
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L246-L254
undertow-io/undertow
servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java
DeploymentInfo.addAuthenticationMechanism
public DeploymentInfo addAuthenticationMechanism(final String name, final AuthenticationMechanismFactory factory) { """ Adds an authentication mechanism. The name is case insenstive, and will be converted to uppercase internally. @param name The name @param factory The factory @return """ authe...
java
public DeploymentInfo addAuthenticationMechanism(final String name, final AuthenticationMechanismFactory factory) { authenticationMechanisms.put(name.toUpperCase(Locale.US), factory); return this; }
[ "public", "DeploymentInfo", "addAuthenticationMechanism", "(", "final", "String", "name", ",", "final", "AuthenticationMechanismFactory", "factory", ")", "{", "authenticationMechanisms", ".", "put", "(", "name", ".", "toUpperCase", "(", "Locale", ".", "US", ")", ","...
Adds an authentication mechanism. The name is case insenstive, and will be converted to uppercase internally. @param name The name @param factory The factory @return
[ "Adds", "an", "authentication", "mechanism", ".", "The", "name", "is", "case", "insenstive", "and", "will", "be", "converted", "to", "uppercase", "internally", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java#L1047-L1050
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
DefaultGroovyStaticMethods.getBundle
public static ResourceBundle getBundle(ResourceBundle self, String bundleName) { """ Works exactly like ResourceBundle.getBundle(String). This is needed because the java method depends on a particular stack configuration that is not guaranteed in Groovy when calling the Java method. @param self placeho...
java
public static ResourceBundle getBundle(ResourceBundle self, String bundleName) { return getBundle(self, bundleName, Locale.getDefault()); }
[ "public", "static", "ResourceBundle", "getBundle", "(", "ResourceBundle", "self", ",", "String", "bundleName", ")", "{", "return", "getBundle", "(", "self", ",", "bundleName", ",", "Locale", ".", "getDefault", "(", ")", ")", ";", "}" ]
Works exactly like ResourceBundle.getBundle(String). This is needed because the java method depends on a particular stack configuration that is not guaranteed in Groovy when calling the Java method. @param self placeholder variable used by Groovy categories; ignored for default static methods @param bundleName ...
[ "Works", "exactly", "like", "ResourceBundle", ".", "getBundle", "(", "String", ")", ".", "This", "is", "needed", "because", "the", "java", "method", "depends", "on", "a", "particular", "stack", "configuration", "that", "is", "not", "guaranteed", "in", "Groovy"...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java#L192-L194
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/types/CompareHelper.java
CompareHelper.le
public static <T> boolean le(Comparable<T> a, T b) { """ <code>a <= b</code> @param <T> @param a @param b @return true if a <= b """ return le(a.compareTo(b)); }
java
public static <T> boolean le(Comparable<T> a, T b) { return le(a.compareTo(b)); }
[ "public", "static", "<", "T", ">", "boolean", "le", "(", "Comparable", "<", "T", ">", "a", ",", "T", "b", ")", "{", "return", "le", "(", "a", ".", "compareTo", "(", "b", ")", ")", ";", "}" ]
<code>a <= b</code> @param <T> @param a @param b @return true if a <= b
[ "<code", ">", "a", "<", "=", "b<", "/", "code", ">" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/CompareHelper.java#L98-L101
esigate/esigate
esigate-core/src/main/java/org/esigate/events/EventManager.java
EventManager.register
public void register(EventDefinition eventDefinition, IEventListener listener) { """ Start listening to an event. @param eventDefinition @param listener """ if (eventDefinition.getType() == EventDefinition.TYPE_POST) { register(listenersPost, eventDefinition, listener, true); } ...
java
public void register(EventDefinition eventDefinition, IEventListener listener) { if (eventDefinition.getType() == EventDefinition.TYPE_POST) { register(listenersPost, eventDefinition, listener, true); } else { register(listeners, eventDefinition, listener, false); } }
[ "public", "void", "register", "(", "EventDefinition", "eventDefinition", ",", "IEventListener", "listener", ")", "{", "if", "(", "eventDefinition", ".", "getType", "(", ")", "==", "EventDefinition", ".", "TYPE_POST", ")", "{", "register", "(", "listenersPost", "...
Start listening to an event. @param eventDefinition @param listener
[ "Start", "listening", "to", "an", "event", "." ]
train
https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/events/EventManager.java#L127-L133
BlueBrain/bluima
modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java
diff_match_patch.patch_addContext
protected void patch_addContext(Patch patch, String text) { """ Increase the context until it is unique, but don't let the pattern expand beyond Match_MaxBits. @param patch The patch to grow. @param text Source text. """ if (text.length() == 0) { return; } String patt...
java
protected void patch_addContext(Patch patch, String text) { if (text.length() == 0) { return; } String pattern = text.substring(patch.start2, patch.start2 + patch.length1); int padding = 0; // Look for the first and last matches of pattern in text. If...
[ "protected", "void", "patch_addContext", "(", "Patch", "patch", ",", "String", "text", ")", "{", "if", "(", "text", ".", "length", "(", ")", "==", "0", ")", "{", "return", ";", "}", "String", "pattern", "=", "text", ".", "substring", "(", "patch", "....
Increase the context until it is unique, but don't let the pattern expand beyond Match_MaxBits. @param patch The patch to grow. @param text Source text.
[ "Increase", "the", "context", "until", "it", "is", "unique", "but", "don", "t", "let", "the", "pattern", "expand", "beyond", "Match_MaxBits", "." ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L1875-L1920
Azure/azure-sdk-for-java
postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/VirtualNetworkRulesInner.java
VirtualNetworkRulesInner.listByServerAsync
public Observable<Page<VirtualNetworkRuleInner>> listByServerAsync(final String resourceGroupName, final String serverName) { """ Gets a list of virtual network rules in a server. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resourc...
java
public Observable<Page<VirtualNetworkRuleInner>> listByServerAsync(final String resourceGroupName, final String serverName) { return listByServerWithServiceResponseAsync(resourceGroupName, serverName) .map(new Func1<ServiceResponse<Page<VirtualNetworkRuleInner>>, Page<VirtualNetworkRuleInner>>() { ...
[ "public", "Observable", "<", "Page", "<", "VirtualNetworkRuleInner", ">", ">", "listByServerAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "serverName", ")", "{", "return", "listByServerWithServiceResponseAsync", "(", "resourceGroupName", "...
Gets a list of virtual network rules in a server. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @throws IllegalArgumentException thrown if parameters fail the val...
[ "Gets", "a", "list", "of", "virtual", "network", "rules", "in", "a", "server", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/VirtualNetworkRulesInner.java#L592-L600
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryGrid.java
ActionHistoryGrid.setColumnsSize
private void setColumnsSize(final double min, final double max, final String... columnPropertyIds) { """ Conveniently sets min- and max-width for a bunch of columns. @param min minimum width @param max maximum width @param columnPropertyIds all the columns the min and max should be set for. """ ...
java
private void setColumnsSize(final double min, final double max, final String... columnPropertyIds) { for (final String columnPropertyId : columnPropertyIds) { getColumn(columnPropertyId).setMinimumWidth(min); getColumn(columnPropertyId).setMaximumWidth(max); } }
[ "private", "void", "setColumnsSize", "(", "final", "double", "min", ",", "final", "double", "max", ",", "final", "String", "...", "columnPropertyIds", ")", "{", "for", "(", "final", "String", "columnPropertyId", ":", "columnPropertyIds", ")", "{", "getColumn", ...
Conveniently sets min- and max-width for a bunch of columns. @param min minimum width @param max maximum width @param columnPropertyIds all the columns the min and max should be set for.
[ "Conveniently", "sets", "min", "-", "and", "max", "-", "width", "for", "a", "bunch", "of", "columns", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryGrid.java#L496-L501
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java
AppServiceCertificateOrdersInner.updateCertificate
public AppServiceCertificateResourceInner updateCertificate(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificatePatchResource keyVaultCertificate) { """ Creates or updates a certificate and associates with key vault secret. Creates or updates a certificate and associates with ...
java
public AppServiceCertificateResourceInner updateCertificate(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificatePatchResource keyVaultCertificate) { return updateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).toBlockin...
[ "public", "AppServiceCertificateResourceInner", "updateCertificate", "(", "String", "resourceGroupName", ",", "String", "certificateOrderName", ",", "String", "name", ",", "AppServiceCertificatePatchResource", "keyVaultCertificate", ")", "{", "return", "updateCertificateWithServi...
Creates or updates a certificate and associates with key vault secret. Creates or updates a certificate and associates with key vault secret. @param resourceGroupName Name of the resource group to which the resource belongs. @param certificateOrderName Name of the certificate order. @param name Name of the certificate...
[ "Creates", "or", "updates", "a", "certificate", "and", "associates", "with", "key", "vault", "secret", ".", "Creates", "or", "updates", "a", "certificate", "and", "associates", "with", "key", "vault", "secret", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1480-L1482
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.timeTemplate
public static <T extends Comparable<?>> TimeTemplate<T> timeTemplate(Class<? extends T> cl, Template template, Object... args) { """ Create a new Template expression @param cl type of expression @param template template @param args templ...
java
public static <T extends Comparable<?>> TimeTemplate<T> timeTemplate(Class<? extends T> cl, Template template, Object... args) { return timeTemplate(cl, template, ImmutableList.copyOf(args)); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", ">", ">", "TimeTemplate", "<", "T", ">", "timeTemplate", "(", "Class", "<", "?", "extends", "T", ">", "cl", ",", "Template", "template", ",", "Object", "...", "args", ")", "{", "return", ...
Create a new Template expression @param cl type of 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#L684-L687
ineunetOS/knife-commons
knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java
StringUtils.reverseDelimited
public static String reverseDelimited(String str, char separatorChar) { """ <p>Reverses a String that is delimited by a specific character.</p> <p>The Strings between the delimiters are not reversed. Thus java.lang.String becomes String.lang.java (if the delimiter is <code>'.'</code>).</p> <pre> StringUti...
java
public static String reverseDelimited(String str, char separatorChar) { if (str == null) { return null; } // could implement manually, but simple way is to reuse other, // probably slower, methods. String[] strs = split(str, separatorChar); ArrayUtils.reverse(...
[ "public", "static", "String", "reverseDelimited", "(", "String", "str", ",", "char", "separatorChar", ")", "{", "if", "(", "str", "==", "null", ")", "{", "return", "null", ";", "}", "// could implement manually, but simple way is to reuse other,", "// probably slower,...
<p>Reverses a String that is delimited by a specific character.</p> <p>The Strings between the delimiters are not reversed. Thus java.lang.String becomes String.lang.java (if the delimiter is <code>'.'</code>).</p> <pre> StringUtils.reverseDelimited(null, *) = null StringUtils.reverseDelimited("", *) = ""...
[ "<p", ">", "Reverses", "a", "String", "that", "is", "delimited", "by", "a", "specific", "character", ".", "<", "/", "p", ">" ]
train
https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L5692-L5701
vatbub/common
core/src/main/java/com/github/vatbub/common/core/ArrayListWithSortableKey.java
ArrayListWithSortableKey.compareTo
public int compareTo(int sortKey, ArrayListWithSortableKey<E> that) { """ Sets the {@code sortKey} for {@code this} and {@code that} and then calls {@code this.compareTo(that)} @param sortKey The column to be used as the sortKey @param that The {@code ArrayListWithSortableKey} to be compared @return Same a...
java
public int compareTo(int sortKey, ArrayListWithSortableKey<E> that) { this.setSortKey(sortKey); that.setSortKey(sortKey); return this.compareTo(that); }
[ "public", "int", "compareTo", "(", "int", "sortKey", ",", "ArrayListWithSortableKey", "<", "E", ">", "that", ")", "{", "this", ".", "setSortKey", "(", "sortKey", ")", ";", "that", ".", "setSortKey", "(", "sortKey", ")", ";", "return", "this", ".", "compa...
Sets the {@code sortKey} for {@code this} and {@code that} and then calls {@code this.compareTo(that)} @param sortKey The column to be used as the sortKey @param that The {@code ArrayListWithSortableKey} to be compared @return Same as {@link #compareTo(ArrayListWithSortableKey)} after applying the sortKey to {@code th...
[ "Sets", "the", "{", "@code", "sortKey", "}", "for", "{", "@code", "this", "}", "and", "{", "@code", "that", "}", "and", "then", "calls", "{", "@code", "this", ".", "compareTo", "(", "that", ")", "}" ]
train
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/ArrayListWithSortableKey.java#L73-L77
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java
Check.positionIndex
@Throws(IllegalPositionIndexException.class) public static int positionIndex(final int index, final int size) { """ Ensures that a given position index is valid within the size of an array, list or string ... @param index index of an array, list or string @param size size of an array list or string @return...
java
@Throws(IllegalPositionIndexException.class) public static int positionIndex(final int index, final int size) { final boolean isIndexValid = (size >= 0) && (index >= 0) && (index < size); if (!isIndexValid) { throw new IllegalPositionIndexException(index, size); } return index; }
[ "@", "Throws", "(", "IllegalPositionIndexException", ".", "class", ")", "public", "static", "int", "positionIndex", "(", "final", "int", "index", ",", "final", "int", "size", ")", "{", "final", "boolean", "isIndexValid", "=", "(", "size", ">=", "0", ")", "...
Ensures that a given position index is valid within the size of an array, list or string ... @param index index of an array, list or string @param size size of an array list or string @return the index @throws IllegalPositionIndexException if the index is not a valid position index within an array, list or string of ...
[ "Ensures", "that", "a", "given", "position", "index", "is", "valid", "within", "the", "size", "of", "an", "array", "list", "or", "string", "..." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L3200-L3209
ReactiveX/RxNetty
rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/TrailingHeaders.java
TrailingHeaders.setHeader
public TrailingHeaders setHeader(CharSequence name, Object value) { """ Overwrites the current value, if any, of the passed trailing header to the passed value for this request. @param name Name of the header. @param value Value of the header. @return {@code this}. """ lastHttpContent.trailingHe...
java
public TrailingHeaders setHeader(CharSequence name, Object value) { lastHttpContent.trailingHeaders().set(name, value); return this; }
[ "public", "TrailingHeaders", "setHeader", "(", "CharSequence", "name", ",", "Object", "value", ")", "{", "lastHttpContent", ".", "trailingHeaders", "(", ")", ".", "set", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Overwrites the current value, if any, of the passed trailing header to the passed value for this request. @param name Name of the header. @param value Value of the header. @return {@code this}.
[ "Overwrites", "the", "current", "value", "if", "any", "of", "the", "passed", "trailing", "header", "to", "the", "passed", "value", "for", "this", "request", "." ]
train
https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/TrailingHeaders.java#L75-L78
Erudika/para
para-server/src/main/java/com/erudika/para/security/SimpleUserService.java
SimpleUserService.loadUserByUsername
public UserDetails loadUserByUsername(String ident) { """ Loads a user from the data store. @param ident the user identifier @return a user object or null if user is not found """ User user = new User(); // check if the cookie has an appid prefix // and load user from the corresponding app if (String...
java
public UserDetails loadUserByUsername(String ident) { User user = new User(); // check if the cookie has an appid prefix // and load user from the corresponding app if (StringUtils.contains(ident, "/")) { String[] parts = ident.split("/"); user.setAppid(parts[0]); ident = parts[1]; } user.setIdenti...
[ "public", "UserDetails", "loadUserByUsername", "(", "String", "ident", ")", "{", "User", "user", "=", "new", "User", "(", ")", ";", "// check if the cookie has an appid prefix", "// and load user from the corresponding app", "if", "(", "StringUtils", ".", "contains", "(...
Loads a user from the data store. @param ident the user identifier @return a user object or null if user is not found
[ "Loads", "a", "user", "from", "the", "data", "store", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SimpleUserService.java#L44-L61
wanglinsong/thx-webservice
src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java
WebServiceCommunication.newInstance
public static WebServiceCommunication newInstance() throws Exception { """ Needs system properties. <ul> <li>qa.th.comm.ws.HOST, default to localhost if not set</li> <li>qa.th.comm.ws.PORT, default to 443 if not set</li> <li>qa.th.comm.ws.USER, no default</li> <li>qa.th.comm.ws.PASS, no default</li> <li>qa.t...
java
public static WebServiceCommunication newInstance() throws Exception { SystemConfiguration sysConfig = SystemConfiguration.getInstance(); String host = sysConfig.getProperty(WebServiceCommunication.SYSPROP_HOST, "localhost"); int port = sysConfig.getIntProperty(WebServiceCommunication.SYSPROP_PO...
[ "public", "static", "WebServiceCommunication", "newInstance", "(", ")", "throws", "Exception", "{", "SystemConfiguration", "sysConfig", "=", "SystemConfiguration", ".", "getInstance", "(", ")", ";", "String", "host", "=", "sysConfig", ".", "getProperty", "(", "WebSe...
Needs system properties. <ul> <li>qa.th.comm.ws.HOST, default to localhost if not set</li> <li>qa.th.comm.ws.PORT, default to 443 if not set</li> <li>qa.th.comm.ws.USER, no default</li> <li>qa.th.comm.ws.PASS, no default</li> <li>qa.th.comm.ws.CLIENT_CERT, no default</li> <li>qa.th.comm.ws.CLIENT_CERT_PASS, no default<...
[ "Needs", "system", "properties", ".", "<ul", ">", "<li", ">", "qa", ".", "th", ".", "comm", ".", "ws", ".", "HOST", "default", "to", "localhost", "if", "not", "set<", "/", "li", ">", "<li", ">", "qa", ".", "th", ".", "comm", ".", "ws", ".", "PO...
train
https://github.com/wanglinsong/thx-webservice/blob/29bc084b09ad35b012eb7c6b5c9ee55337ddee28/src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java#L249-L269
looly/hutool
hutool-db/src/main/java/cn/hutool/db/DbUtil.java
DbUtil.setShowSqlGlobal
public static void setShowSqlGlobal(boolean isShowSql, boolean isFormatSql, boolean isShowParams, Level level) { """ 设置全局配置:是否通过debug日志显示SQL @param isShowSql 是否显示SQL @param isFormatSql 是否格式化显示的SQL @param isShowParams 是否打印参数 @param level SQL打印到的日志等级 @since 4.1.7 """ SqlLog.INSTASNCE.init(isShowSql, is...
java
public static void setShowSqlGlobal(boolean isShowSql, boolean isFormatSql, boolean isShowParams, Level level) { SqlLog.INSTASNCE.init(isShowSql, isFormatSql, isShowParams, level); }
[ "public", "static", "void", "setShowSqlGlobal", "(", "boolean", "isShowSql", ",", "boolean", "isFormatSql", ",", "boolean", "isShowParams", ",", "Level", "level", ")", "{", "SqlLog", ".", "INSTASNCE", ".", "init", "(", "isShowSql", ",", "isFormatSql", ",", "is...
设置全局配置:是否通过debug日志显示SQL @param isShowSql 是否显示SQL @param isFormatSql 是否格式化显示的SQL @param isShowParams 是否打印参数 @param level SQL打印到的日志等级 @since 4.1.7
[ "设置全局配置:是否通过debug日志显示SQL" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DbUtil.java#L259-L261
NextFaze/power-adapters
power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapters.java
PowerAdapters.toListAdapter
@CheckResult @NonNull public static ListAdapter toListAdapter(@NonNull PowerAdapter powerAdapter) { """ Returns the specified {@link PowerAdapter} as a {@link ListAdapter}. @param powerAdapter The adapter to be converted. @return A list adapter that presents the same views as {@code powerAdapter}. @see ...
java
@CheckResult @NonNull public static ListAdapter toListAdapter(@NonNull PowerAdapter powerAdapter) { // HACK: We simply have to use a magic number here and hope we never exceed it. // ListAdapter interface gives us no other choice, since it requires knowledge of all possible view types //...
[ "@", "CheckResult", "@", "NonNull", "public", "static", "ListAdapter", "toListAdapter", "(", "@", "NonNull", "PowerAdapter", "powerAdapter", ")", "{", "// HACK: We simply have to use a magic number here and hope we never exceed it.", "// ListAdapter interface gives us no other choice...
Returns the specified {@link PowerAdapter} as a {@link ListAdapter}. @param powerAdapter The adapter to be converted. @return A list adapter that presents the same views as {@code powerAdapter}. @see ListView#setAdapter(ListAdapter)
[ "Returns", "the", "specified", "{" ]
train
https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapters.java#L23-L32
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/helper/BaseAdsServiceClientFactoryHelper.java
BaseAdsServiceClientFactoryHelper.createServiceClient
@VisibleForTesting C createServiceClient(Object soapClient, D adsServiceDescriptor, S adsSession) { """ Creates the service client from the factory, descriptor, and SOAP client. """ return adsServiceClientFactory.create(soapClient, adsServiceDescriptor, adsSession); }
java
@VisibleForTesting C createServiceClient(Object soapClient, D adsServiceDescriptor, S adsSession) { return adsServiceClientFactory.create(soapClient, adsServiceDescriptor, adsSession); }
[ "@", "VisibleForTesting", "C", "createServiceClient", "(", "Object", "soapClient", ",", "D", "adsServiceDescriptor", ",", "S", "adsSession", ")", "{", "return", "adsServiceClientFactory", ".", "create", "(", "soapClient", ",", "adsServiceDescriptor", ",", "adsSession"...
Creates the service client from the factory, descriptor, and SOAP client.
[ "Creates", "the", "service", "client", "from", "the", "factory", "descriptor", "and", "SOAP", "client", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/helper/BaseAdsServiceClientFactoryHelper.java#L84-L87
apereo/cas
support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/web/WSFederationValidateRequestCallbackController.java
WSFederationValidateRequestCallbackController.handleFederationRequest
@GetMapping(path = WSFederationConstants.ENDPOINT_FEDERATION_REQUEST_CALLBACK) protected ModelAndView handleFederationRequest(final HttpServletResponse response, final HttpServletRequest request) throws Exception { """ Handle federation request. @param response the response @param request the request @re...
java
@GetMapping(path = WSFederationConstants.ENDPOINT_FEDERATION_REQUEST_CALLBACK) protected ModelAndView handleFederationRequest(final HttpServletResponse response, final HttpServletRequest request) throws Exception { val fedRequest = WSFederationRequest.of(request); LOGGER.debug("Received callback pro...
[ "@", "GetMapping", "(", "path", "=", "WSFederationConstants", ".", "ENDPOINT_FEDERATION_REQUEST_CALLBACK", ")", "protected", "ModelAndView", "handleFederationRequest", "(", "final", "HttpServletResponse", "response", ",", "final", "HttpServletRequest", "request", ")", "thro...
Handle federation request. @param response the response @param request the request @return the model and view @throws Exception the exception
[ "Handle", "federation", "request", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/web/WSFederationValidateRequestCallbackController.java#L76-L105
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.incorrectBodyDefinition
public static void incorrectBodyDefinition(String methodName,String className) { """ Thrown when the body method don't respects the convetions beloging to the dynamic conversion implementation. @param methodName method name @param className class name """ throw new DynamicConversionBodyException(MSG.INSTA...
java
public static void incorrectBodyDefinition(String methodName,String className){ throw new DynamicConversionBodyException(MSG.INSTANCE.message(dynamicConversionBodyException,methodName,className)); }
[ "public", "static", "void", "incorrectBodyDefinition", "(", "String", "methodName", ",", "String", "className", ")", "{", "throw", "new", "DynamicConversionBodyException", "(", "MSG", ".", "INSTANCE", ".", "message", "(", "dynamicConversionBodyException", ",", "method...
Thrown when the body method don't respects the convetions beloging to the dynamic conversion implementation. @param methodName method name @param className class name
[ "Thrown", "when", "the", "body", "method", "don", "t", "respects", "the", "convetions", "beloging", "to", "the", "dynamic", "conversion", "implementation", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L230-L232
craftercms/core
src/main/java/org/craftercms/core/processors/impl/AbstractTaggingProcessor.java
AbstractTaggingProcessor.addNewField
protected void addNewField(Item item, String values) { """ Tags the item adding the new field with the specified values. @param item @param values """ if(logger.isDebugEnabled()) { logger.debug("Tagging item with field: " + newField + " and value: " + values); } Document d...
java
protected void addNewField(Item item, String values) { if(logger.isDebugEnabled()) { logger.debug("Tagging item with field: " + newField + " and value: " + values); } Document document = item.getDescriptorDom(); if(document != null) { Element root = document.getRo...
[ "protected", "void", "addNewField", "(", "Item", "item", ",", "String", "values", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Tagging item with field: \"", "+", "newField", "+", "\" and value: \"", ...
Tags the item adding the new field with the specified values. @param item @param values
[ "Tags", "the", "item", "adding", "the", "new", "field", "with", "the", "specified", "values", "." ]
train
https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/processors/impl/AbstractTaggingProcessor.java#L73-L87
craftercms/profile
security-provider/src/main/java/org/craftercms/security/utils/social/ConnectionUtils.java
ConnectionUtils.removeConnectionData
public static void removeConnectionData(String providerId, String providerUserId, Profile profile) { """ Remove the {@link ConnectionData} associated to the provider ID and user ID. @param providerId the provider ID of the connection @param providerUserId the provider user ID @param profile ...
java
public static void removeConnectionData(String providerId, String providerUserId, Profile profile) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForP...
[ "public", "static", "void", "removeConnectionData", "(", "String", "providerId", ",", "String", "providerUserId", ",", "Profile", "profile", ")", "{", "Map", "<", "String", ",", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", ">", "allConnections...
Remove the {@link ConnectionData} associated to the provider ID and user ID. @param providerId the provider ID of the connection @param providerUserId the provider user ID @param profile the profile where to remove the data from
[ "Remove", "the", "{", "@link", "ConnectionData", "}", "associated", "to", "the", "provider", "ID", "and", "user", "ID", "." ]
train
https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/utils/social/ConnectionUtils.java#L193-L209
tempodb/tempodb-java
src/main/java/com/tempodb/Client.java
Client.readSingleValue
public Result<SingleValue> readSingleValue(Series series, DateTime timestamp, DateTimeZone timezone, Direction direction) { """ Reads a single value for a series at a specific timestamp. <p>The returned value (datapoint) can be null if there are no datapoints in the series or in the specified direction. @para...
java
public Result<SingleValue> readSingleValue(Series series, DateTime timestamp, DateTimeZone timezone, Direction direction) { checkNotNull(series); checkNotNull(timestamp); checkNotNull(timezone); checkNotNull(direction); URI uri = null; try { URIBuilder builder = new URIBuilder(String.form...
[ "public", "Result", "<", "SingleValue", ">", "readSingleValue", "(", "Series", "series", ",", "DateTime", "timestamp", ",", "DateTimeZone", "timezone", ",", "Direction", "direction", ")", "{", "checkNotNull", "(", "series", ")", ";", "checkNotNull", "(", "timest...
Reads a single value for a series at a specific timestamp. <p>The returned value (datapoint) can be null if there are no datapoints in the series or in the specified direction. @param series The series to read from @param timestamp The timestamp to read a value at @param timezone The timezone of the returned datapoint...
[ "Reads", "a", "single", "value", "for", "a", "series", "at", "a", "specific", "timestamp", ".", "<p", ">", "The", "returned", "value", "(", "datapoint", ")", "can", "be", "null", "if", "there", "are", "no", "datapoints", "in", "the", "series", "or", "i...
train
https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L453-L474
Waikato/moa
moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java
Instances.insertAttributeAt
public void insertAttributeAt(Attribute attribute, int position) { """ Insert attribute at. @param attribute the attribute @param position the position """ if (this.instanceInformation == null) { this.instanceInformation = new InstanceInformation(); } this.instanceInform...
java
public void insertAttributeAt(Attribute attribute, int position) { if (this.instanceInformation == null) { this.instanceInformation = new InstanceInformation(); } this.instanceInformation.insertAttributeAt(attribute, position); for (int i = 0; i < numInstances(); i++) { ...
[ "public", "void", "insertAttributeAt", "(", "Attribute", "attribute", ",", "int", "position", ")", "{", "if", "(", "this", ".", "instanceInformation", "==", "null", ")", "{", "this", ".", "instanceInformation", "=", "new", "InstanceInformation", "(", ")", ";",...
Insert attribute at. @param attribute the attribute @param position the position
[ "Insert", "attribute", "at", "." ]
train
https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java#L295-L305
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderParser.java
GenericGenbankHeaderParser.parseHeader
@Override public void parseHeader(String header, S sequence) { """ Parse the header and set the values in the sequence @param header @param sequence """ sequence.setOriginalHeader(header); sequence.setAccession(new AccessionID(accession, DataSource.GENBANK, version, identifier)); sequence.setDescripti...
java
@Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); sequence.setAccession(new AccessionID(accession, DataSource.GENBANK, version, identifier)); sequence.setDescription(description); sequence.setComments(comments); sequence.setReferences(references); }
[ "@", "Override", "public", "void", "parseHeader", "(", "String", "header", ",", "S", "sequence", ")", "{", "sequence", ".", "setOriginalHeader", "(", "header", ")", ";", "sequence", ".", "setAccession", "(", "new", "AccessionID", "(", "accession", ",", "Data...
Parse the header and set the values in the sequence @param header @param sequence
[ "Parse", "the", "header", "and", "set", "the", "values", "in", "the", "sequence" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderParser.java#L54-L61
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java
VMath.setMatrix
public static void setMatrix(final double[][] m1, final int r0, final int r1, final int c0, final int c1, final double[][] m2) { """ Set a submatrix. @param m1 Original matrix @param r0 Initial row index @param r1 Final row index (exclusive) @param c0 Initial column index @param c1 Final column index (exclu...
java
public static void setMatrix(final double[][] m1, final int r0, final int r1, final int c0, final int c1, final double[][] m2) { assert r0 <= r1 && c0 <= c1 : ERR_INVALID_RANGE; assert r1 <= m1.length && c1 <= m1[0].length : ERR_MATRIX_DIMENSIONS; final int coldim = c1 - c0; for(int i = r0; i < r1; i++)...
[ "public", "static", "void", "setMatrix", "(", "final", "double", "[", "]", "[", "]", "m1", ",", "final", "int", "r0", ",", "final", "int", "r1", ",", "final", "int", "c0", ",", "final", "int", "c1", ",", "final", "double", "[", "]", "[", "]", "m2...
Set a submatrix. @param m1 Original matrix @param r0 Initial row index @param r1 Final row index (exclusive) @param c0 Initial column index @param c1 Final column index (exclusive) @param m2 New values for m1(r0:r1-1,c0:c1-1)
[ "Set", "a", "submatrix", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L997-L1004
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java
ClassFileReader.newInstance
public static ClassFileReader newInstance(FileSystem fs, Path path) throws IOException { """ Returns a ClassFileReader instance of a given FileSystem and path. This method is used for reading classes from jrtfs. """ return new DirectoryReader(fs, path); }
java
public static ClassFileReader newInstance(FileSystem fs, Path path) throws IOException { return new DirectoryReader(fs, path); }
[ "public", "static", "ClassFileReader", "newInstance", "(", "FileSystem", "fs", ",", "Path", "path", ")", "throws", "IOException", "{", "return", "new", "DirectoryReader", "(", "fs", ",", "path", ")", ";", "}" ]
Returns a ClassFileReader instance of a given FileSystem and path. This method is used for reading classes from jrtfs.
[ "Returns", "a", "ClassFileReader", "instance", "of", "a", "given", "FileSystem", "and", "path", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java#L92-L94
raphw/byte-buddy
byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java
MethodHandle.ofSpecial
public static MethodHandle ofSpecial(MethodDescription.InDefinedShape methodDescription, TypeDescription typeDescription) { """ Creates a method handle representation of the given method for an explicit special method invocation of an otherwise virtual method. @param methodDescription The method ro represent. ...
java
public static MethodHandle ofSpecial(MethodDescription.InDefinedShape methodDescription, TypeDescription typeDescription) { if (!methodDescription.isSpecializableFor(typeDescription)) { throw new IllegalArgumentException("Cannot specialize " + methodDescription + " for " + typeDescription); ...
[ "public", "static", "MethodHandle", "ofSpecial", "(", "MethodDescription", ".", "InDefinedShape", "methodDescription", ",", "TypeDescription", "typeDescription", ")", "{", "if", "(", "!", "methodDescription", ".", "isSpecializableFor", "(", "typeDescription", ")", ")", ...
Creates a method handle representation of the given method for an explicit special method invocation of an otherwise virtual method. @param methodDescription The method ro represent. @param typeDescription The type on which the method is to be invoked on as a special method invocation. @return A method handle repres...
[ "Creates", "a", "method", "handle", "representation", "of", "the", "given", "method", "for", "an", "explicit", "special", "method", "invocation", "of", "an", "otherwise", "virtual", "method", "." ]
train
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java#L571-L580
kiegroup/droolsjbpm-integration
kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/AbstractKieServicesClientImpl.java
AbstractKieServicesClientImpl.checkResultType
protected void checkResultType(ServiceResponse<?> serviceResponse, Class<?> expectedResultType) { """ Checks whether the specified {@code ServiceResponse} contains the expected result type. In case the type is different, {@code KieServicesClientException} is thrown. This catches the errors early, before returning...
java
protected void checkResultType(ServiceResponse<?> serviceResponse, Class<?> expectedResultType) { Object actualResult = serviceResponse.getResult(); if ( actualResult != null && !expectedResultType.isInstance( actualResult ) ) { throw new KieServicesException( "Error whil...
[ "protected", "void", "checkResultType", "(", "ServiceResponse", "<", "?", ">", "serviceResponse", ",", "Class", "<", "?", ">", "expectedResultType", ")", "{", "Object", "actualResult", "=", "serviceResponse", ".", "getResult", "(", ")", ";", "if", "(", "actual...
Checks whether the specified {@code ServiceResponse} contains the expected result type. In case the type is different, {@code KieServicesClientException} is thrown. This catches the errors early, before returning the result from the client. Without this check users could experience {@code ClassCastException} when retri...
[ "Checks", "whether", "the", "specified", "{" ]
train
https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/AbstractKieServicesClientImpl.java#L600-L607
haraldk/TwelveMonkeys
sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java
XMLTransformTag.doEndTag
public int doEndTag() throws JspException { """ doEndTag implementation, that will perform XML Transformation on the body content. @return super.doEndTag() """ // Get body content (trim is CRUCIAL, as some XML parsers are picky...) String body = bodyContent.getString().trim(); ...
java
public int doEndTag() throws JspException { // Get body content (trim is CRUCIAL, as some XML parsers are picky...) String body = bodyContent.getString().trim(); // Do transformation transform(new StreamSource(new ByteArrayInputStream(body.getBytes()))); return super.doE...
[ "public", "int", "doEndTag", "(", ")", "throws", "JspException", "{", "// Get body content (trim is CRUCIAL, as some XML parsers are picky...)\r", "String", "body", "=", "bodyContent", ".", "getString", "(", ")", ".", "trim", "(", ")", ";", "// Do transformation\r", "tr...
doEndTag implementation, that will perform XML Transformation on the body content. @return super.doEndTag()
[ "doEndTag", "implementation", "that", "will", "perform", "XML", "Transformation", "on", "the", "body", "content", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java#L99-L107
yavijava/yavijava
src/main/java/com/vmware/vim25/mo/HostVsanInternalSystem.java
HostVsanInternalSystem.reconfigureDomObject
public void reconfigureDomObject(String uuid, String policy) throws RuntimeFault, RemoteException { """ Reconfigure DOM object. Typically we expect VM centric APIs to be used for setting storage policies, i.e. to use ReconfigVM() to change the policy/profile of a namespace directory or virtual disk. This is a low...
java
public void reconfigureDomObject(String uuid, String policy) throws RuntimeFault, RemoteException { getVimService().reconfigureDomObject(getMOR(), uuid, policy); }
[ "public", "void", "reconfigureDomObject", "(", "String", "uuid", ",", "String", "policy", ")", "throws", "RuntimeFault", ",", "RemoteException", "{", "getVimService", "(", ")", ".", "reconfigureDomObject", "(", "getMOR", "(", ")", ",", "uuid", ",", "policy", "...
Reconfigure DOM object. Typically we expect VM centric APIs to be used for setting storage policies, i.e. to use ReconfigVM() to change the policy/profile of a namespace directory or virtual disk. This is a low level API to reconfigure any object known by UUID. This API is internal and intended for troubleshooting/debu...
[ "Reconfigure", "DOM", "object", ".", "Typically", "we", "expect", "VM", "centric", "APIs", "to", "be", "used", "for", "setting", "storage", "policies", "i", ".", "e", ".", "to", "use", "ReconfigVM", "()", "to", "change", "the", "policy", "/", "profile", ...
train
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/HostVsanInternalSystem.java#L250-L252
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONAssert.java
JSONAssert.assertNotEquals
public static void assertNotEquals(String message, JSONArray expected, JSONArray actual, JSONCompareMode compareMode) throws JSONException { """ Asserts that the JSONArray provided does not match the expected JSONArray. If it is it throws an {@link AssertionError}. @param message Error message to be d...
java
public static void assertNotEquals(String message, JSONArray expected, JSONArray actual, JSONCompareMode compareMode) throws JSONException { JSONCompareResult result = JSONCompare.compareJSON(expected, actual, compareMode); if (result.passed()) { throw new AssertionError(getCombinedM...
[ "public", "static", "void", "assertNotEquals", "(", "String", "message", ",", "JSONArray", "expected", ",", "JSONArray", "actual", ",", "JSONCompareMode", "compareMode", ")", "throws", "JSONException", "{", "JSONCompareResult", "result", "=", "JSONCompare", ".", "co...
Asserts that the JSONArray provided does not match the expected JSONArray. If it is it throws an {@link AssertionError}. @param message Error message to be displayed in case of assertion failure @param expected Expected JSONArray @param actual JSONArray to compare @param compareMode Specifies which comparison mode to...
[ "Asserts", "that", "the", "JSONArray", "provided", "does", "not", "match", "the", "expected", "JSONArray", ".", "If", "it", "is", "it", "throws", "an", "{", "@link", "AssertionError", "}", "." ]
train
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L754-L760
enioka/jqm
jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java
Helpers.updateNodeConfiguration
static void updateNodeConfiguration(String nodeName, DbConn cnx, int port) { """ Creates or updates a node.<br> This method makes the assumption metadata is valid. e.g. there MUST be a single default queue.<br> Call {@link #updateConfiguration(EntityManager)} before to be sure if necessary. @param nodeName n...
java
static void updateNodeConfiguration(String nodeName, DbConn cnx, int port) { // Node Integer nodeId = null; try { nodeId = cnx.runSelectSingle("node_select_by_key", Integer.class, nodeName); } catch (NoResultException e) { jqmlogger.inf...
[ "static", "void", "updateNodeConfiguration", "(", "String", "nodeName", ",", "DbConn", "cnx", ",", "int", "port", ")", "{", "// Node", "Integer", "nodeId", "=", "null", ";", "try", "{", "nodeId", "=", "cnx", ".", "runSelectSingle", "(", "\"node_select_by_key\"...
Creates or updates a node.<br> This method makes the assumption metadata is valid. e.g. there MUST be a single default queue.<br> Call {@link #updateConfiguration(EntityManager)} before to be sure if necessary. @param nodeName name of the node that should be created or updated (if incompletely defined only) @param em ...
[ "Creates", "or", "updates", "a", "node", ".", "<br", ">", "This", "method", "makes", "the", "assumption", "metadata", "is", "valid", ".", "e", ".", "g", ".", "there", "MUST", "be", "a", "single", "default", "queue", ".", "<br", ">", "Call", "{", "@li...
train
https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java#L312-L339
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/utils/PolylineUtils.java
PolylineUtils.getSqSegDist
private static double getSqSegDist(Point point, Point p1, Point p2) { """ Square distance from a point to a segment. @param point {@link Point} whose distance from segment needs to be determined @param p1,p2 points defining the segment @return square of the distance between first input point and segment defin...
java
private static double getSqSegDist(Point point, Point p1, Point p2) { double horizontal = p1.longitude(); double vertical = p1.latitude(); double diffHorizontal = p2.longitude() - horizontal; double diffVertical = p2.latitude() - vertical; if (diffHorizontal != 0 || diffVertical != 0) { doubl...
[ "private", "static", "double", "getSqSegDist", "(", "Point", "point", ",", "Point", "p1", ",", "Point", "p2", ")", "{", "double", "horizontal", "=", "p1", ".", "longitude", "(", ")", ";", "double", "vertical", "=", "p1", ".", "latitude", "(", ")", ";",...
Square distance from a point to a segment. @param point {@link Point} whose distance from segment needs to be determined @param p1,p2 points defining the segment @return square of the distance between first input point and segment defined by other two input points
[ "Square", "distance", "from", "a", "point", "to", "a", "segment", "." ]
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/utils/PolylineUtils.java#L223-L247
duracloud/duracloud
snapshotstorageprovider/src/main/java/org/duracloud/snapshottask/snapshot/CreateSnapshotTaskRunner.java
CreateSnapshotTaskRunner.buildSnapshotProps
protected String buildSnapshotProps(Map<String, String> props) { """ Constructs the contents of a properties file given a set of key/value pairs @param props snapshot properties @return Properties-file formatted key/value pairs """ Properties snapshotProperties = new Properties(); for (Str...
java
protected String buildSnapshotProps(Map<String, String> props) { Properties snapshotProperties = new Properties(); for (String key : props.keySet()) { snapshotProperties.setProperty(key, props.get(key)); } StringWriter writer = new StringWriter(); try { s...
[ "protected", "String", "buildSnapshotProps", "(", "Map", "<", "String", ",", "String", ">", "props", ")", "{", "Properties", "snapshotProperties", "=", "new", "Properties", "(", ")", ";", "for", "(", "String", "key", ":", "props", ".", "keySet", "(", ")", ...
Constructs the contents of a properties file given a set of key/value pairs @param props snapshot properties @return Properties-file formatted key/value pairs
[ "Constructs", "the", "contents", "of", "a", "properties", "file", "given", "a", "set", "of", "key", "/", "value", "pairs" ]
train
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/snapshotstorageprovider/src/main/java/org/duracloud/snapshottask/snapshot/CreateSnapshotTaskRunner.java#L210-L225
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.core.3.2/src/org/apache/cxf/staxutils/StaxUtils.java
StaxUtils.writeElement
public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { """ Writes an Element to an XMLStreamWriter. The writer must already have started the document (via writeStartDocument()). Also, this probably won't work with just a fragment of a document. T...
java
public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { writeElement(e, writer, repairing, true); }
[ "public", "static", "void", "writeElement", "(", "Element", "e", ",", "XMLStreamWriter", "writer", ",", "boolean", "repairing", ")", "throws", "XMLStreamException", "{", "writeElement", "(", "e", ",", "writer", ",", "repairing", ",", "true", ")", ";", "}" ]
Writes an Element to an XMLStreamWriter. The writer must already have started the document (via writeStartDocument()). Also, this probably won't work with just a fragment of a document. The Element should be the root element of the document. @param e @param writer @throws XMLStreamException
[ "Writes", "an", "Element", "to", "an", "XMLStreamWriter", ".", "The", "writer", "must", "already", "have", "started", "the", "document", "(", "via", "writeStartDocument", "()", ")", ".", "Also", "this", "probably", "won", "t", "work", "with", "just", "a", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.core.3.2/src/org/apache/cxf/staxutils/StaxUtils.java#L948-L951
ops4j/org.ops4j.pax.web
pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/util/TypeUtil.java
TypeUtil.parseInt
public static int parseInt(byte[] b, int offset, int length, int base) { """ Parse an int from a byte array of ascii characters. Negative numbers are not handled. @param b byte array @param offset Offset within string @param length Length of integer or -1 for remainder of string @param base base of t...
java
public static int parseInt(byte[] b, int offset, int length, int base) { int value = 0; //CHECKSTYLE:OFF if (length < 0) { length = b.length - offset; } //CHECKSTYLE:ON for (int i = 0; i < length; i++) { char c = (char) (_0XFF & b[offset + i]); int digit = c - '0'; if (digit < 0 || digit >= b...
[ "public", "static", "int", "parseInt", "(", "byte", "[", "]", "b", ",", "int", "offset", ",", "int", "length", ",", "int", "base", ")", "{", "int", "value", "=", "0", ";", "//CHECKSTYLE:OFF", "if", "(", "length", "<", "0", ")", "{", "length", "=", ...
Parse an int from a byte array of ascii characters. Negative numbers are not handled. @param b byte array @param offset Offset within string @param length Length of integer or -1 for remainder of string @param base base of the integer @return the parsed integer @throws NumberFormatException if the array cannot ...
[ "Parse", "an", "int", "from", "a", "byte", "array", "of", "ascii", "characters", ".", "Negative", "numbers", "are", "not", "handled", "." ]
train
https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/util/TypeUtil.java#L322-L347
wcm-io/wcm-io-handler
commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java
AbstractElement.setAttribute
@Override public final org.jdom2.Element setAttribute(String name, String value, Namespace ns) { """ <p> This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed. </p> @param name name of the attribute to set @param value value of the attribute to...
java
@Override public final org.jdom2.Element setAttribute(String name, String value, Namespace ns) { // remove attribute if value is set to null if (value == null) { super.removeAttribute(name, ns); return this; } else { return super.setAttribute(name, cleanUpString(value), ns); } ...
[ "@", "Override", "public", "final", "org", ".", "jdom2", ".", "Element", "setAttribute", "(", "String", "name", ",", "String", "value", ",", "Namespace", "ns", ")", "{", "// remove attribute if value is set to null", "if", "(", "value", "==", "null", ")", "{",...
<p> This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed. </p> @param name name of the attribute to set @param value value of the attribute to set @param ns namespace of the attribute to set @return this element modified @throws org.jdom2.IllegalNameExcep...
[ "<p", ">", "This", "sets", "an", "attribute", "value", "for", "this", "element", ".", "Any", "existing", "attribute", "with", "the", "same", "name", "and", "namespace", "URI", "is", "removed", ".", "<", "/", "p", ">" ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java#L244-L254
QSFT/Doradus
doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java
SpiderSession.getObject
public DBObject getObject(String tableName, String objectID) { """ Get the object with the given ID from the given table. Null is returned if there is no such object. @param tableName Name of table to get object from. It must belong to this session's application. @param objectID Object's ID. @retur...
java
public DBObject getObject(String tableName, String objectID) { Utils.require(!Utils.isEmpty(tableName), "tableName"); Utils.require(!Utils.isEmpty(objectID), "objectID"); TableDefinition tableDef = m_appDef.getTableDef(tableName); Utils.require(tableDef != null, ...
[ "public", "DBObject", "getObject", "(", "String", "tableName", ",", "String", "objectID", ")", "{", "Utils", ".", "require", "(", "!", "Utils", ".", "isEmpty", "(", "tableName", ")", ",", "\"tableName\"", ")", ";", "Utils", ".", "require", "(", "!", "Uti...
Get the object with the given ID from the given table. Null is returned if there is no such object. @param tableName Name of table to get object from. It must belong to this session's application. @param objectID Object's ID. @return {@link DBObject} containing all of the object's scalar and link...
[ "Get", "the", "object", "with", "the", "given", "ID", "from", "the", "given", "table", ".", "Null", "is", "returned", "if", "there", "is", "no", "such", "object", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java#L349-L376
virgo47/javasimon
console-embed/src/main/java/org/javasimon/console/SimonVisitors.java
SimonVisitors.visitList
public static void visitList(Manager manager, String pattern, Set<SimonType> types, SimonVisitor visitor) throws IOException { """ Visit simons as a list. Calls {@link Manager#getSimons(org.javasimon.SimonFilter)} method then Simons are sorted by name and filtered by type finally the visitor is called on each o...
java
public static void visitList(Manager manager, String pattern, Set<SimonType> types, SimonVisitor visitor) throws IOException { List<Simon> simons = new ArrayList<>(manager.getSimons(SimonPattern.create(pattern))); Collections.sort(simons, new Comparator<Simon>() { public int compare(Simon s1, Simon s2) { ...
[ "public", "static", "void", "visitList", "(", "Manager", "manager", ",", "String", "pattern", ",", "Set", "<", "SimonType", ">", "types", ",", "SimonVisitor", "visitor", ")", "throws", "IOException", "{", "List", "<", "Simon", ">", "simons", "=", "new", "A...
Visit simons as a list. Calls {@link Manager#getSimons(org.javasimon.SimonFilter)} method then Simons are sorted by name and filtered by type finally the visitor is called on each of them. @param manager Simon manager @param pattern Pattern @param types set of Simon types @param visitor Visitor @throws IOException
[ "Visit", "simons", "as", "a", "list", ".", "Calls", "{", "@link", "Manager#getSimons", "(", "org", ".", "javasimon", ".", "SimonFilter", ")", "}", "method", "then", "Simons", "are", "sorted", "by", "name", "and", "filtered", "by", "type", "finally", "the",...
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/SimonVisitors.java#L36-L49
geomajas/geomajas-project-client-gwt
plugin/widget-utility/utility-gwt/src/main/java/org/geomajas/widget/utility/gwt/client/widget/CardLayout.java
CardLayout.addCard
@Api public void addCard(KEY_TYPE key, Canvas card) { """ Add a card to the deck and associate it with the specified key. @param key key associated to the card @param card the card @since 1.0.0 """ if (currentCard != null) { currentCard.hide(); } addMember(card); currentCard = card; cards.pu...
java
@Api public void addCard(KEY_TYPE key, Canvas card) { if (currentCard != null) { currentCard.hide(); } addMember(card); currentCard = card; cards.put(key, card); }
[ "@", "Api", "public", "void", "addCard", "(", "KEY_TYPE", "key", ",", "Canvas", "card", ")", "{", "if", "(", "currentCard", "!=", "null", ")", "{", "currentCard", ".", "hide", "(", ")", ";", "}", "addMember", "(", "card", ")", ";", "currentCard", "="...
Add a card to the deck and associate it with the specified key. @param key key associated to the card @param card the card @since 1.0.0
[ "Add", "a", "card", "to", "the", "deck", "and", "associate", "it", "with", "the", "specified", "key", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-utility/utility-gwt/src/main/java/org/geomajas/widget/utility/gwt/client/widget/CardLayout.java#L41-L49