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
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java
COSAPIClient.correctPlusSign
private String correctPlusSign(String origin, String stringToCorrect) { """ Due to SDK bug, list operations may return strings that has spaces instead of + This method will try to fix names for known patterns @param origin original string that may contain @param stringToCorrect string that may contain origina...
java
private String correctPlusSign(String origin, String stringToCorrect) { if (origin.contains("+")) { LOG.debug("Adapt plus sign in {} to avoid SDK bug on {}", origin, stringToCorrect); StringBuilder tmpStringToCorrect = new StringBuilder(stringToCorrect); boolean hasSign = true; int fromIndex...
[ "private", "String", "correctPlusSign", "(", "String", "origin", ",", "String", "stringToCorrect", ")", "{", "if", "(", "origin", ".", "contains", "(", "\"+\"", ")", ")", "{", "LOG", ".", "debug", "(", "\"Adapt plus sign in {} to avoid SDK bug on {}\"", ",", "or...
Due to SDK bug, list operations may return strings that has spaces instead of + This method will try to fix names for known patterns @param origin original string that may contain @param stringToCorrect string that may contain original string with spaces instead of + @return corrected string
[ "Due", "to", "SDK", "bug", "list", "operations", "may", "return", "strings", "that", "has", "spaces", "instead", "of", "+", "This", "method", "will", "try", "to", "fix", "names", "for", "known", "patterns" ]
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L1567-L1593
igniterealtime/Smack
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/MediaNegotiator.java
MediaNegotiator.receiveContentAcceptAction
private IQ receiveContentAcceptAction(Jingle jingle, JingleDescription description) throws XMPPException, NotConnectedException, InterruptedException { """ The other side has sent us a content-accept. The payload types in that message may not match with what we sent, but XEP-167 says that the other side should r...
java
private IQ receiveContentAcceptAction(Jingle jingle, JingleDescription description) throws XMPPException, NotConnectedException, InterruptedException { IQ response; List<PayloadType> offeredPayloads = description.getAudioPayloadTypesList(); bestCommonAudioPt = calculateBestCommonAudioPt(offered...
[ "private", "IQ", "receiveContentAcceptAction", "(", "Jingle", "jingle", ",", "JingleDescription", "description", ")", "throws", "XMPPException", ",", "NotConnectedException", ",", "InterruptedException", "{", "IQ", "response", ";", "List", "<", "PayloadType", ">", "of...
The other side has sent us a content-accept. The payload types in that message may not match with what we sent, but XEP-167 says that the other side should retain the order of the payload types we first sent. This means we can walk through our list, in order, until we find one from their list that matches. This will...
[ "The", "other", "side", "has", "sent", "us", "a", "content", "-", "accept", ".", "The", "payload", "types", "in", "that", "message", "may", "not", "match", "with", "what", "we", "sent", "but", "XEP", "-", "167", "says", "that", "the", "other", "side", ...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/MediaNegotiator.java#L210-L231
elki-project/elki
elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java
OnDiskUpperTriangleMatrix.getRecordBuffer
public synchronized ByteBuffer getRecordBuffer(int x, int y) throws IOException { """ Get a record buffer @param x First coordinate @param y Second coordinate @return Byte buffer for the record @throws IOException on IO errors """ if(x >= matrixsize || y >= matrixsize) { throw new ArrayIndexOut...
java
public synchronized ByteBuffer getRecordBuffer(int x, int y) throws IOException { if(x >= matrixsize || y >= matrixsize) { throw new ArrayIndexOutOfBoundsException(); } return array.getRecordBuffer(computeOffset(x, y)); }
[ "public", "synchronized", "ByteBuffer", "getRecordBuffer", "(", "int", "x", ",", "int", "y", ")", "throws", "IOException", "{", "if", "(", "x", ">=", "matrixsize", "||", "y", ">=", "matrixsize", ")", "{", "throw", "new", "ArrayIndexOutOfBoundsException", "(", ...
Get a record buffer @param x First coordinate @param y Second coordinate @return Byte buffer for the record @throws IOException on IO errors
[ "Get", "a", "record", "buffer" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java#L147-L152
elibom/jogger
src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java
RouterMiddleware.addRoute
public void addRoute(HttpMethod httpMethod, String path, Object controller, Method method) { """ Creates a {@link Route} object from the received arguments and adds it to the list of routes. @param httpMethod the HTTP method to which this route is going to respond. @param path the path to which this route is g...
java
public void addRoute(HttpMethod httpMethod, String path, Object controller, Method method) { // validate signature Class<?>[] paramTypes = method.getParameterTypes(); if (paramTypes.length != 2 || !paramTypes[0].equals(Request.class) || !paramTypes[1].equals(Response.class)) { throw new RoutesException("Expect...
[ "public", "void", "addRoute", "(", "HttpMethod", "httpMethod", ",", "String", "path", ",", "Object", "controller", ",", "Method", "method", ")", "{", "// validate signature", "Class", "<", "?", ">", "[", "]", "paramTypes", "=", "method", ".", "getParameterType...
Creates a {@link Route} object from the received arguments and adds it to the list of routes. @param httpMethod the HTTP method to which this route is going to respond. @param path the path to which this route is going to respond. @param controller the object that will be invoked when this route matches. @param method...
[ "Creates", "a", "{", "@link", "Route", "}", "object", "from", "the", "received", "arguments", "and", "adds", "it", "to", "the", "list", "of", "routes", "." ]
train
https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java#L194-L204
stripe/stripe-android
stripe/src/main/java/com/stripe/android/AbstractEphemeralKey.java
AbstractEphemeralKey.writeToParcel
@Override public void writeToParcel(Parcel out, int flags) { """ Write the object into a {@link Parcel}. Note that if the order of these write operations is changed, an identical change must be made to {@link #AbstractEphemeralKey(Parcel)} constructor above. @param out a {@link Parcel} into which to wri...
java
@Override public void writeToParcel(Parcel out, int flags) { out.writeLong(mCreated); out.writeString(mObjectId); out.writeLong(mExpires); out.writeString(mId); // There is no writeBoolean out.writeInt(mLiveMode ? 1 : 0); out.writeString(mObject); out....
[ "@", "Override", "public", "void", "writeToParcel", "(", "Parcel", "out", ",", "int", "flags", ")", "{", "out", ".", "writeLong", "(", "mCreated", ")", ";", "out", ".", "writeString", "(", "mObjectId", ")", ";", "out", ".", "writeLong", "(", "mExpires", ...
Write the object into a {@link Parcel}. Note that if the order of these write operations is changed, an identical change must be made to {@link #AbstractEphemeralKey(Parcel)} constructor above. @param out a {@link Parcel} into which to write this object @param flags any flags (unused) for writing this object
[ "Write", "the", "object", "into", "a", "{", "@link", "Parcel", "}", ".", "Note", "that", "if", "the", "order", "of", "these", "write", "operations", "is", "changed", "an", "identical", "change", "must", "be", "made", "to", "{", "@link", "#AbstractEphemeral...
train
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/AbstractEphemeralKey.java#L163-L174
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
StringGroovyMethods.takeWhile
public static String takeWhile(GString self, @ClosureParams(value=SimpleType.class, options="char") Closure condition) { """ A GString variant of the equivalent GString method. @param self the original GString @param condition the closure that must evaluate to true to continue taking elements @return a p...
java
public static String takeWhile(GString self, @ClosureParams(value=SimpleType.class, options="char") Closure condition) { return (String) takeWhile(self.toString(), condition); }
[ "public", "static", "String", "takeWhile", "(", "GString", "self", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"char\"", ")", "Closure", "condition", ")", "{", "return", "(", "String", ")", "takeWhile", ...
A GString variant of the equivalent GString method. @param self the original GString @param condition the closure that must evaluate to true to continue taking elements @return a prefix of elements in the GString where each element passed to the given closure evaluates to true @since 2.3.7
[ "A", "GString", "variant", "of", "the", "equivalent", "GString", "method", "." ]
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L3206-L3208
apiman/apiman
gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ok/HttpURLConnectionImpl.java
HttpURLConnectionImpl.setProtocols
private void setProtocols(String protocolsString, boolean append) { """ /* Splits and validates a comma-separated string of protocols. When append == false, we require that the transport list contains "http/1.1". Throws {@link IllegalStateException} when one of the protocols isn't defined in {@link Protocol Ok...
java
private void setProtocols(String protocolsString, boolean append) { List<Protocol> protocolsList = new ArrayList<>(); if (append) { protocolsList.addAll(client.getProtocols()); } for (String protocol : protocolsString.split(",", -1)) { try { protocolsList.add(Protocol.get(protocol));...
[ "private", "void", "setProtocols", "(", "String", "protocolsString", ",", "boolean", "append", ")", "{", "List", "<", "Protocol", ">", "protocolsList", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "append", ")", "{", "protocolsList", ".", "addA...
/* Splits and validates a comma-separated string of protocols. When append == false, we require that the transport list contains "http/1.1". Throws {@link IllegalStateException} when one of the protocols isn't defined in {@link Protocol OkHttp's protocol enumeration}.
[ "/", "*", "Splits", "and", "validates", "a", "comma", "-", "separated", "string", "of", "protocols", ".", "When", "append", "==", "false", "we", "require", "that", "the", "transport", "list", "contains", "http", "/", "1", ".", "1", ".", "Throws", "{" ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ok/HttpURLConnectionImpl.java#L567-L580
jbundle/jbundle
base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HHeadingScreen.java
HHeadingScreen.printScreenFieldData
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions) { """ Output this screen using HTML. @exception DBException File exception. """ ((HScreenField)((ScreenField)sField).getScreenFieldView()).printHtmlHeading(out); ((HScreenField)((ScreenField)sField).ge...
java
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions) { ((HScreenField)((ScreenField)sField).getScreenFieldView()).printHtmlHeading(out); ((HScreenField)((ScreenField)sField).getScreenFieldView()).printDisplayControl(out); }
[ "public", "void", "printScreenFieldData", "(", "ScreenComponent", "sField", ",", "PrintWriter", "out", ",", "int", "iPrintOptions", ")", "{", "(", "(", "HScreenField", ")", "(", "(", "ScreenField", ")", "sField", ")", ".", "getScreenFieldView", "(", ")", ")", ...
Output this screen using HTML. @exception DBException File exception.
[ "Output", "this", "screen", "using", "HTML", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HHeadingScreen.java#L79-L83
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentMetadata.java
StreamSegmentMetadata.cleanupAttributes
synchronized int cleanupAttributes(int maximumAttributeCount, long lastUsedCutoff) { """ Evicts those Extended Attributes from memory that have a LastUsed value prior to the given cutoff. @param maximumAttributeCount The maximum number of Extended Attributes per Segment. Cleanup will only be performed if there...
java
synchronized int cleanupAttributes(int maximumAttributeCount, long lastUsedCutoff) { if (this.extendedAttributes.size() <= maximumAttributeCount) { // Haven't reached the limit yet. return 0; } // Collect candidates and order them by lastUsed (oldest to newest). ...
[ "synchronized", "int", "cleanupAttributes", "(", "int", "maximumAttributeCount", ",", "long", "lastUsedCutoff", ")", "{", "if", "(", "this", ".", "extendedAttributes", ".", "size", "(", ")", "<=", "maximumAttributeCount", ")", "{", "// Haven't reached the limit yet.",...
Evicts those Extended Attributes from memory that have a LastUsed value prior to the given cutoff. @param maximumAttributeCount The maximum number of Extended Attributes per Segment. Cleanup will only be performed if there are at least this many Extended Attributes in memory. @param lastUsedCutoff The cutoff va...
[ "Evicts", "those", "Extended", "Attributes", "from", "memory", "that", "have", "a", "LastUsed", "value", "prior", "to", "the", "given", "cutoff", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentMetadata.java#L371-L397
Esri/geometry-api-java
src/main/java/com/esri/core/geometry/RelationalOperations.java
RelationalOperations.relate
private static boolean relate(Point point_a, Point point_b, SpatialReference sr, int relation, ProgressTracker progress_tracker) { """ interior, and exterior of point_a vs point_b for the given relation. """ if (point_a.isEmpty() || point_b.isEmpty()) { if (relation == Relation.disjoint) return tru...
java
private static boolean relate(Point point_a, Point point_b, SpatialReference sr, int relation, ProgressTracker progress_tracker) { if (point_a.isEmpty() || point_b.isEmpty()) { if (relation == Relation.disjoint) return true; // Always true return false; // Always false } Point2D pt_a = point_a.getX...
[ "private", "static", "boolean", "relate", "(", "Point", "point_a", ",", "Point", "point_b", ",", "SpatialReference", "sr", ",", "int", "relation", ",", "ProgressTracker", "progress_tracker", ")", "{", "if", "(", "point_a", ".", "isEmpty", "(", ")", "||", "po...
interior, and exterior of point_a vs point_b for the given relation.
[ "interior", "and", "exterior", "of", "point_a", "vs", "point_b", "for", "the", "given", "relation", "." ]
train
https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/RelationalOperations.java#L435-L471
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ClientSideHandlerScriptRequestHandler.java
ClientSideHandlerScriptRequestHandler.handleClientSideHandlerRequest
public void handleClientSideHandlerRequest(HttpServletRequest request, HttpServletResponse response) { """ Generates a locale dependent script used to include bundles in non dynamic html pages. Uses a cache of said scripts to avoid constant regeneration. It also keeps track of eTags and if-modified-since headers...
java
public void handleClientSideHandlerRequest(HttpServletRequest request, HttpServletResponse response) { Handler handler; Map<String, String> variants = config.getGeneratorRegistry().resolveVariants(request); String variantKey = VariantUtils.getVariantKey(variants); if (handlerCache.containsKey(variantKey)) { ...
[ "public", "void", "handleClientSideHandlerRequest", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "Handler", "handler", ";", "Map", "<", "String", ",", "String", ">", "variants", "=", "config", ".", "getGeneratorRegistry", "...
Generates a locale dependent script used to include bundles in non dynamic html pages. Uses a cache of said scripts to avoid constant regeneration. It also keeps track of eTags and if-modified-since headers to take advantage of client side caching. @param request the request @param response the response
[ "Generates", "a", "locale", "dependent", "script", "used", "to", "include", "bundles", "in", "non", "dynamic", "html", "pages", ".", "Uses", "a", "cache", "of", "said", "scripts", "to", "avoid", "constant", "regeneration", ".", "It", "also", "keeps", "track"...
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ClientSideHandlerScriptRequestHandler.java#L131-L173
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policyexpression.java
policyexpression.get
public static policyexpression get(nitro_service service, String name) throws Exception { """ Use this API to fetch policyexpression resource of given name . """ policyexpression obj = new policyexpression(); obj.set_name(name); policyexpression response = (policyexpression) obj.get_resource(service); ...
java
public static policyexpression get(nitro_service service, String name) throws Exception{ policyexpression obj = new policyexpression(); obj.set_name(name); policyexpression response = (policyexpression) obj.get_resource(service); return response; }
[ "public", "static", "policyexpression", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "policyexpression", "obj", "=", "new", "policyexpression", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "...
Use this API to fetch policyexpression resource of given name .
[ "Use", "this", "API", "to", "fetch", "policyexpression", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policyexpression.java#L429-L434
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java
ManagedDatabasesInner.beginCompleteRestoreAsync
public Observable<Void> beginCompleteRestoreAsync(String locationName, UUID operationId, String lastBackupName) { """ Completes the restore operation on a managed database. @param locationName The name of the region where the resource is located. @param operationId Management operation id that this request tri...
java
public Observable<Void> beginCompleteRestoreAsync(String locationName, UUID operationId, String lastBackupName) { return beginCompleteRestoreWithServiceResponseAsync(locationName, operationId, lastBackupName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(Servi...
[ "public", "Observable", "<", "Void", ">", "beginCompleteRestoreAsync", "(", "String", "locationName", ",", "UUID", "operationId", ",", "String", "lastBackupName", ")", "{", "return", "beginCompleteRestoreWithServiceResponseAsync", "(", "locationName", ",", "operationId", ...
Completes the restore operation on a managed database. @param locationName The name of the region where the resource is located. @param operationId Management operation id that this request tries to complete. @param lastBackupName The last backup name to apply @throws IllegalArgumentException thrown if parameters fail...
[ "Completes", "the", "restore", "operation", "on", "a", "managed", "database", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java#L229-L236
Swagger2Markup/swagger2markup
src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java
DefinitionsDocument.buildDefinition
private void buildDefinition(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) { """ Generate definition files depending on the generation mode @param definitionName definition name to process @param model definition model to process """ if (logger.isDebugEnabled()) { ...
java
private void buildDefinition(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) { if (logger.isDebugEnabled()) { logger.debug("Definition processed : '{}'", definitionName); } if (config.isSeparatedDefinitionsEnabled()) { MarkupDocBuilder defDocBuilder...
[ "private", "void", "buildDefinition", "(", "MarkupDocBuilder", "markupDocBuilder", ",", "String", "definitionName", ",", "Model", "model", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Definition proces...
Generate definition files depending on the generation mode @param definitionName definition name to process @param model definition model to process
[ "Generate", "definition", "files", "depending", "on", "the", "generation", "mode" ]
train
https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java#L122-L140
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/scrollfire/MaterialScrollfire.java
MaterialScrollfire.apply
public static void apply(String selector, Functions.Func callback) { """ Executes callback method depending on how far into the page you've scrolled """ apply($(selector).asElement(), 100, callback); }
java
public static void apply(String selector, Functions.Func callback) { apply($(selector).asElement(), 100, callback); }
[ "public", "static", "void", "apply", "(", "String", "selector", ",", "Functions", ".", "Func", "callback", ")", "{", "apply", "(", "$", "(", "selector", ")", ".", "asElement", "(", ")", ",", "100", ",", "callback", ")", ";", "}" ]
Executes callback method depending on how far into the page you've scrolled
[ "Executes", "callback", "method", "depending", "on", "how", "far", "into", "the", "page", "you", "ve", "scrolled" ]
train
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/scrollfire/MaterialScrollfire.java#L119-L121
Azure/azure-sdk-for-java
mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/queue/models/CreateQueueOptions.java
CreateQueueOptions.addMetadata
public CreateQueueOptions addMetadata(String key, String value) { """ Adds a key-value pair of {@link String} to the metadata collection to set on a queue when the queue is created. Queue metadata is a user-defined collection of key-value pairs that is opaque to the server. If the key already exists in the meta...
java
public CreateQueueOptions addMetadata(String key, String value) { this.metadata.put(key, value); return this; }
[ "public", "CreateQueueOptions", "addMetadata", "(", "String", "key", ",", "String", "value", ")", "{", "this", ".", "metadata", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds a key-value pair of {@link String} to the metadata collection to set on a queue when the queue is created. Queue metadata is a user-defined collection of key-value pairs that is opaque to the server. If the key already exists in the metadata collection, the value parameter will overwrite the existing value paired ...
[ "Adds", "a", "key", "-", "value", "pair", "of", "{", "@link", "String", "}", "to", "the", "metadata", "collection", "to", "set", "on", "a", "queue", "when", "the", "queue", "is", "created", ".", "Queue", "metadata", "is", "a", "user", "-", "defined", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/queue/models/CreateQueueOptions.java#L92-L95
EdwardRaff/JSAT
JSAT/src/jsat/linear/RowColumnOps.java
RowColumnOps.multCol
public static void multCol(Matrix A, int j, double c) { """ Updates the values of column <tt>j</tt> in the given matrix to be A[:,j] = A[:,j]* c @param A the matrix to perform he update on @param j the row to update @param c the constant to multiply each element by """ multCol(A, j, 0, A.rows(), c...
java
public static void multCol(Matrix A, int j, double c) { multCol(A, j, 0, A.rows(), c); }
[ "public", "static", "void", "multCol", "(", "Matrix", "A", ",", "int", "j", ",", "double", "c", ")", "{", "multCol", "(", "A", ",", "j", ",", "0", ",", "A", ".", "rows", "(", ")", ",", "c", ")", ";", "}" ]
Updates the values of column <tt>j</tt> in the given matrix to be A[:,j] = A[:,j]* c @param A the matrix to perform he update on @param j the row to update @param c the constant to multiply each element by
[ "Updates", "the", "values", "of", "column", "<tt", ">", "j<", "/", "tt", ">", "in", "the", "given", "matrix", "to", "be", "A", "[", ":", "j", "]", "=", "A", "[", ":", "j", "]", "*", "c" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L217-L220
dita-ot/dita-ot
src/main/java/org/dita/dost/util/XMLSerializer.java
XMLSerializer.writeNamespace
public void writeNamespace(final String prefix, final String uri) { """ Write namepace prefix. @param prefix namespace prefix @param uri namespace URI @throws IllegalStateException if start element is not open @throws IllegalArgumentException if prefix is already bound """ if (!openStartElement) ...
java
public void writeNamespace(final String prefix, final String uri) { if (!openStartElement) { throw new IllegalStateException("Current state does not allow Namespace writing"); } final QName qName = elementStack.getFirst(); // peek for (final NamespaceMapping p: qName.mappings...
[ "public", "void", "writeNamespace", "(", "final", "String", "prefix", ",", "final", "String", "uri", ")", "{", "if", "(", "!", "openStartElement", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Current state does not allow Namespace writing\"", ")", ";",...
Write namepace prefix. @param prefix namespace prefix @param uri namespace URI @throws IllegalStateException if start element is not open @throws IllegalArgumentException if prefix is already bound
[ "Write", "namepace", "prefix", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLSerializer.java#L185-L198
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java
CommerceWarehousePersistenceImpl.findAll
@Override public List<CommerceWarehouse> findAll(int start, int end) { """ Returns a range of all the commerce warehouses. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result s...
java
@Override public List<CommerceWarehouse> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceWarehouse", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce warehouses. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>s...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "warehouses", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L5413-L5416
AdeptInternet/auth-java
saml/src/main/java/org/adeptnet/auth/saml/SAMLClient.java
SAMLClient.generateAuthnRequest
public String generateAuthnRequest(final String requestId) throws SAMLException { """ Create a new AuthnRequest suitable for sending to an HTTPRedirect binding endpoint on the IdP. The SPConfig will be used to fill in the ACS and issuer, and the IdP will be used to set the destination. @param requestId random...
java
public String generateAuthnRequest(final String requestId) throws SAMLException { final String request = _createAuthnRequest(requestId); try { final byte[] compressed = deflate(request.getBytes("UTF-8")); return DatatypeConverter.printBase64Binary(compressed); } ...
[ "public", "String", "generateAuthnRequest", "(", "final", "String", "requestId", ")", "throws", "SAMLException", "{", "final", "String", "request", "=", "_createAuthnRequest", "(", "requestId", ")", ";", "try", "{", "final", "byte", "[", "]", "compressed", "=", ...
Create a new AuthnRequest suitable for sending to an HTTPRedirect binding endpoint on the IdP. The SPConfig will be used to fill in the ACS and issuer, and the IdP will be used to set the destination. @param requestId random generated RequestId @return a deflated, base64-encoded AuthnRequest @throws org.adeptnet.auth....
[ "Create", "a", "new", "AuthnRequest", "suitable", "for", "sending", "to", "an", "HTTPRedirect", "binding", "endpoint", "on", "the", "IdP", ".", "The", "SPConfig", "will", "be", "used", "to", "fill", "in", "the", "ACS", "and", "issuer", "and", "the", "IdP",...
train
https://github.com/AdeptInternet/auth-java/blob/644116ed1f50bf899b9cecc5e3682bac7abf7007/saml/src/main/java/org/adeptnet/auth/saml/SAMLClient.java#L452-L463
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java
EstimateSceneCalibrated.addTriangulatedStereoFeatures
void addTriangulatedStereoFeatures(View base , Motion edge , double scale ) { """ Adds features which were triangulated using the stereo pair after the scale factor has been determined. Don't mark the other view as being processed. It's 3D pose will be estimated later on using PNP with the new features and featu...
java
void addTriangulatedStereoFeatures(View base , Motion edge , double scale ) { View viewA = edge.viewSrc; View viewB = edge.viewDst; boolean baseIsA = base == viewA; View other = baseIsA ? viewB : viewA; // Determine transform from other to world edge.a_to_b.T.scale(scale); Se3_F64 otherToBase = baseIsA ...
[ "void", "addTriangulatedStereoFeatures", "(", "View", "base", ",", "Motion", "edge", ",", "double", "scale", ")", "{", "View", "viewA", "=", "edge", ".", "viewSrc", ";", "View", "viewB", "=", "edge", ".", "viewDst", ";", "boolean", "baseIsA", "=", "base", ...
Adds features which were triangulated using the stereo pair after the scale factor has been determined. Don't mark the other view as being processed. It's 3D pose will be estimated later on using PNP with the new features and features determined later on
[ "Adds", "features", "which", "were", "triangulated", "using", "the", "stereo", "pair", "after", "the", "scale", "factor", "has", "been", "determined", ".", "Don", "t", "mark", "the", "other", "view", "as", "being", "processed", ".", "It", "s", "3D", "pose"...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L296-L351
jlinn/quartz-redis-jobstore
src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java
AbstractRedisStorage.checkExists
public boolean checkExists(TriggerKey triggerKey, T jedis) { """ Check if the trigger identified by the given key exists @param triggerKey the key of the desired trigger @param jedis a thread-safe Redis connection @return true if the trigger exists; false otherwise """ return jedis.exists(redisSchem...
java
public boolean checkExists(TriggerKey triggerKey, T jedis){ return jedis.exists(redisSchema.triggerHashKey(triggerKey)); }
[ "public", "boolean", "checkExists", "(", "TriggerKey", "triggerKey", ",", "T", "jedis", ")", "{", "return", "jedis", ".", "exists", "(", "redisSchema", ".", "triggerHashKey", "(", "triggerKey", ")", ")", ";", "}" ]
Check if the trigger identified by the given key exists @param triggerKey the key of the desired trigger @param jedis a thread-safe Redis connection @return true if the trigger exists; false otherwise
[ "Check", "if", "the", "trigger", "identified", "by", "the", "given", "key", "exists" ]
train
https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L363-L365
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/FaultToleranceStateFactory.java
FaultToleranceStateFactory.createSyncBulkheadState
public SyncBulkheadState createSyncBulkheadState(BulkheadPolicy policy, MetricRecorder metricRecorder) { """ Create an object implementing a synchronous Bulkhead @param policy the BulkheadPolicy, may be {@code null} @return a new SyncBulkheadState """ if (policy == null) { return new Sy...
java
public SyncBulkheadState createSyncBulkheadState(BulkheadPolicy policy, MetricRecorder metricRecorder) { if (policy == null) { return new SyncBulkheadStateNullImpl(); } else { return new SyncBulkheadStateImpl(policy, metricRecorder); } }
[ "public", "SyncBulkheadState", "createSyncBulkheadState", "(", "BulkheadPolicy", "policy", ",", "MetricRecorder", "metricRecorder", ")", "{", "if", "(", "policy", "==", "null", ")", "{", "return", "new", "SyncBulkheadStateNullImpl", "(", ")", ";", "}", "else", "{"...
Create an object implementing a synchronous Bulkhead @param policy the BulkheadPolicy, may be {@code null} @return a new SyncBulkheadState
[ "Create", "an", "object", "implementing", "a", "synchronous", "Bulkhead" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/FaultToleranceStateFactory.java#L67-L73
Netflix/spectator
spectator-web-spring/src/main/java/com/netflix/spectator/controllers/MetricsController.java
MetricsController.meterToKind
public static String meterToKind(Registry registry, Meter meter) { """ Determine the type of a meter for reporting purposes. @param registry Used to provide supplemental information (e.g. to search for the meter). @param meter The meters whose kind we want to know. @return A string such as "Counter". I...
java
public static String meterToKind(Registry registry, Meter meter) { String kind; if (meter instanceof Timer) { kind = "Timer"; } else if (meter instanceof Counter) { kind = "Counter"; } else if (meter instanceof Gauge) { kind = "Gauge"; } else if (meter instanceof DistributionSummar...
[ "public", "static", "String", "meterToKind", "(", "Registry", "registry", ",", "Meter", "meter", ")", "{", "String", "kind", ";", "if", "(", "meter", "instanceof", "Timer", ")", "{", "kind", "=", "\"Timer\"", ";", "}", "else", "if", "(", "meter", "instan...
Determine the type of a meter for reporting purposes. @param registry Used to provide supplemental information (e.g. to search for the meter). @param meter The meters whose kind we want to know. @return A string such as "Counter". If the type cannot be identified as one of the standard Spectator api interface varian...
[ "Determine", "the", "type", "of", "a", "meter", "for", "reporting", "purposes", "." ]
train
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-web-spring/src/main/java/com/netflix/spectator/controllers/MetricsController.java#L172-L186
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.getEnterpriseMetadataTemplates
public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates( String scope, BoxAPIConnection api, String ... fields) { """ Returns all metadata templates within a user's scope. Currently only the enterprise scope is supported. @param scope the scope of the metadata templates. @param api th...
java
public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates( String scope, BoxAPIConnection api, String ... fields) { return getEnterpriseMetadataTemplates(ENTERPRISE_METADATA_SCOPE, DEFAULT_ENTRIES_LIMIT, api, fields); }
[ "public", "static", "Iterable", "<", "MetadataTemplate", ">", "getEnterpriseMetadataTemplates", "(", "String", "scope", ",", "BoxAPIConnection", "api", ",", "String", "...", "fields", ")", "{", "return", "getEnterpriseMetadataTemplates", "(", "ENTERPRISE_METADATA_SCOPE", ...
Returns all metadata templates within a user's scope. Currently only the enterprise scope is supported. @param scope the scope of the metadata templates. @param api the API connection to be used. @param fields the fields to retrieve. @return the metadata template returned from the server.
[ "Returns", "all", "metadata", "templates", "within", "a", "user", "s", "scope", ".", "Currently", "only", "the", "enterprise", "scope", "is", "supported", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L485-L488
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java
UTF16.compareCodePoint
public static int compareCodePoint(int codePoint, CharSequence s) { """ Utility for comparing a code point to a string without having to create a new string. Returns the same results as a code point comparison of UTF16.valueOf(codePoint) and s.toString(). More specifically, if <pre> sc = new StringComparator(tr...
java
public static int compareCodePoint(int codePoint, CharSequence s) { if (s == null) { return 1; } final int strLen = s.length(); if (strLen == 0) { return 1; } int second = Character.codePointAt(s, 0); int diff = codePoint - second; ...
[ "public", "static", "int", "compareCodePoint", "(", "int", "codePoint", ",", "CharSequence", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", "1", ";", "}", "final", "int", "strLen", "=", "s", ".", "length", "(", ")", ";", "if", "("...
Utility for comparing a code point to a string without having to create a new string. Returns the same results as a code point comparison of UTF16.valueOf(codePoint) and s.toString(). More specifically, if <pre> sc = new StringComparator(true,false,0); fast = UTF16.compareCodePoint(codePoint, charSequence) slower = sc....
[ "Utility", "for", "comparing", "a", "code", "point", "to", "a", "string", "without", "having", "to", "create", "a", "new", "string", ".", "Returns", "the", "same", "results", "as", "a", "code", "point", "comparison", "of", "UTF16", ".", "valueOf", "(", "...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L2561-L2575
aoindustries/aocode-public
src/main/java/com/aoindustries/io/TempFileList.java
TempFileList.createTempFile
public TempFile createTempFile() throws IOException { """ Creates a new temp file while adding it to the list of files that will be explicitly deleted when this list is deleted. """ TempFile tempFile = new TempFile(prefix, suffix, directory); synchronized(tempFiles) { tempFiles.add(new WeakReference<>(...
java
public TempFile createTempFile() throws IOException { TempFile tempFile = new TempFile(prefix, suffix, directory); synchronized(tempFiles) { tempFiles.add(new WeakReference<>(tempFile)); } return tempFile; }
[ "public", "TempFile", "createTempFile", "(", ")", "throws", "IOException", "{", "TempFile", "tempFile", "=", "new", "TempFile", "(", "prefix", ",", "suffix", ",", "directory", ")", ";", "synchronized", "(", "tempFiles", ")", "{", "tempFiles", ".", "add", "("...
Creates a new temp file while adding it to the list of files that will be explicitly deleted when this list is deleted.
[ "Creates", "a", "new", "temp", "file", "while", "adding", "it", "to", "the", "list", "of", "files", "that", "will", "be", "explicitly", "deleted", "when", "this", "list", "is", "deleted", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/TempFileList.java#L92-L98
JodaOrg/joda-time
src/main/java/org/joda/time/DateTime.java
DateTime.withDate
public DateTime withDate(int year, int monthOfYear, int dayOfMonth) { """ Returns a copy of this datetime with the specified date, retaining the time fields. <p> If the date is already the date passed in, then <code>this</code> is returned. <p> To set a single field use the properties, for example: <pre> Dat...
java
public DateTime withDate(int year, int monthOfYear, int dayOfMonth) { Chronology chrono = getChronology(); long localInstant = chrono.withUTC().getDateTimeMillis(year, monthOfYear, dayOfMonth, getMillisOfDay()); return withMillis(chrono.getZone().convertLocalToUTC(localInstant, false, getMillis(...
[ "public", "DateTime", "withDate", "(", "int", "year", ",", "int", "monthOfYear", ",", "int", "dayOfMonth", ")", "{", "Chronology", "chrono", "=", "getChronology", "(", ")", ";", "long", "localInstant", "=", "chrono", ".", "withUTC", "(", ")", ".", "getDate...
Returns a copy of this datetime with the specified date, retaining the time fields. <p> If the date is already the date passed in, then <code>this</code> is returned. <p> To set a single field use the properties, for example: <pre> DateTime set = monthOfYear().setCopy(6); </pre> <p> If the time is invalid on the new da...
[ "Returns", "a", "copy", "of", "this", "datetime", "with", "the", "specified", "date", "retaining", "the", "time", "fields", ".", "<p", ">", "If", "the", "date", "is", "already", "the", "date", "passed", "in", "then", "<code", ">", "this<", "/", "code", ...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTime.java#L726-L730
eclipse/xtext-core
org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/parser/antlr/splitting/AntlrCodeQualityHelper.java
AntlrCodeQualityHelper.removeDuplicateDFAs
public String removeDuplicateDFAs(String content, AntlrOptions options) { """ Remove duplicate bitset declarations to reduce the size of the static initializer but keep the bitsets that match the given pattern with a normalized name. """ if (!options.isOptimizeCodeQuality()) { return content; } Strin...
java
public String removeDuplicateDFAs(String content, AntlrOptions options) { if (!options.isOptimizeCodeQuality()) { return content; } String newContent = dfaPattern.matcher(content).replaceAll(replacement); newContent = removeDuplicateFields( newContent, dfaStringPattern, 1, 2, "\\bDFA\\d+_\\w+\\b", "dfa_%...
[ "public", "String", "removeDuplicateDFAs", "(", "String", "content", ",", "AntlrOptions", "options", ")", "{", "if", "(", "!", "options", ".", "isOptimizeCodeQuality", "(", ")", ")", "{", "return", "content", ";", "}", "String", "newContent", "=", "dfaPattern"...
Remove duplicate bitset declarations to reduce the size of the static initializer but keep the bitsets that match the given pattern with a normalized name.
[ "Remove", "duplicate", "bitset", "declarations", "to", "reduce", "the", "size", "of", "the", "static", "initializer", "but", "keep", "the", "bitsets", "that", "match", "the", "given", "pattern", "with", "a", "normalized", "name", "." ]
train
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/parser/antlr/splitting/AntlrCodeQualityHelper.java#L157-L167
line/centraldogma
server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java
MetadataService.perUserPermissionPointer
private static JsonPointer perUserPermissionPointer(String repoName, String memberId) { """ Generates the path of {@link JsonPointer} of permission of the specified {@code memberId} in the specified {@code repoName}. """ return JsonPointer.compile("/repos" + encodeSegment(repoName) + ...
java
private static JsonPointer perUserPermissionPointer(String repoName, String memberId) { return JsonPointer.compile("/repos" + encodeSegment(repoName) + "/perUserPermissions" + encodeSegment(memberId)); }
[ "private", "static", "JsonPointer", "perUserPermissionPointer", "(", "String", "repoName", ",", "String", "memberId", ")", "{", "return", "JsonPointer", ".", "compile", "(", "\"/repos\"", "+", "encodeSegment", "(", "repoName", ")", "+", "\"/perUserPermissions\"", "+...
Generates the path of {@link JsonPointer} of permission of the specified {@code memberId} in the specified {@code repoName}.
[ "Generates", "the", "path", "of", "{" ]
train
https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java#L883-L886
FasterXML/jackson-jr
jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSONObjectException.java
JSONObjectException.wrapWithPath
public static JSONObjectException wrapWithPath(Throwable src, Reference ref) { """ Method that can be called to either create a new JsonMappingException (if underlying exception is not a JsonMappingException), or augment given exception with given path/reference information. """ JSONObjectException j...
java
public static JSONObjectException wrapWithPath(Throwable src, Reference ref) { JSONObjectException jme; if (src instanceof JSONObjectException) { jme = (JSONObjectException) src; } else { String msg = src.getMessage(); if (msg == null || msg.length() == 0)...
[ "public", "static", "JSONObjectException", "wrapWithPath", "(", "Throwable", "src", ",", "Reference", "ref", ")", "{", "JSONObjectException", "jme", ";", "if", "(", "src", "instanceof", "JSONObjectException", ")", "{", "jme", "=", "(", "JSONObjectException", ")", ...
Method that can be called to either create a new JsonMappingException (if underlying exception is not a JsonMappingException), or augment given exception with given path/reference information.
[ "Method", "that", "can", "be", "called", "to", "either", "create", "a", "new", "JsonMappingException", "(", "if", "underlying", "exception", "is", "not", "a", "JsonMappingException", ")", "or", "augment", "given", "exception", "with", "given", "path", "/", "re...
train
https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSONObjectException.java#L226-L240
lucee/Lucee
core/src/main/java/lucee/commons/io/ini/IniFile.java
IniFile.getKeyValueEL
public String getKeyValueEL(String strSection, String key) { """ Gets the KeyValue attribute of the IniFile object, if not exist return null @param strSection section to get @param key key to get @return matching alue """ Map map = getSectionEL(strSection); if (map == null) return null; Object o = map....
java
public String getKeyValueEL(String strSection, String key) { Map map = getSectionEL(strSection); if (map == null) return null; Object o = map.get(key.toLowerCase()); if (o == null) return null; return (String) o; }
[ "public", "String", "getKeyValueEL", "(", "String", "strSection", ",", "String", "key", ")", "{", "Map", "map", "=", "getSectionEL", "(", "strSection", ")", ";", "if", "(", "map", "==", "null", ")", "return", "null", ";", "Object", "o", "=", "map", "."...
Gets the KeyValue attribute of the IniFile object, if not exist return null @param strSection section to get @param key key to get @return matching alue
[ "Gets", "the", "KeyValue", "attribute", "of", "the", "IniFile", "object", "if", "not", "exist", "return", "null" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L157-L164
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/io/string/DataFramePrinter.java
DataFramePrinter.getHeaderTemplate
private static String getHeaderTemplate(int[] widths, String[] headers) { """ Returns the header template given the widths specified @param widths the token widths @return the line format template """ return IntStream.range(0, widths.length).mapToObj(i -> { final int width = widths[i]; ...
java
private static String getHeaderTemplate(int[] widths, String[] headers) { return IntStream.range(0, widths.length).mapToObj(i -> { final int width = widths[i]; final int length = headers[i].length(); final int leading = (width - length) / 2; final int trailing = w...
[ "private", "static", "String", "getHeaderTemplate", "(", "int", "[", "]", "widths", ",", "String", "[", "]", "headers", ")", "{", "return", "IntStream", ".", "range", "(", "0", ",", "widths", ".", "length", ")", ".", "mapToObj", "(", "i", "->", "{", ...
Returns the header template given the widths specified @param widths the token widths @return the line format template
[ "Returns", "the", "header", "template", "given", "the", "widths", "specified" ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/io/string/DataFramePrinter.java#L74-L87
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java
Organizer.sortByJavaBeanProperty
public static <T> Collection<T> sortByJavaBeanProperty(String aProperyName, Collection<T> aCollection) { """ Sort collection of object by a given property name @param aProperyName the property name @param aCollection the collection of object to sort @param <T> the type class @return the collection of so...
java
public static <T> Collection<T> sortByJavaBeanProperty(String aProperyName, Collection<T> aCollection) { return sortByJavaBeanProperty(aProperyName, aCollection, false); }
[ "public", "static", "<", "T", ">", "Collection", "<", "T", ">", "sortByJavaBeanProperty", "(", "String", "aProperyName", ",", "Collection", "<", "T", ">", "aCollection", ")", "{", "return", "sortByJavaBeanProperty", "(", "aProperyName", ",", "aCollection", ",", ...
Sort collection of object by a given property name @param aProperyName the property name @param aCollection the collection of object to sort @param <T> the type class @return the collection of sorted values
[ "Sort", "collection", "of", "object", "by", "a", "given", "property", "name" ]
train
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java#L936-L940
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/util/HierarchicalTable.java
HierarchicalTable.doRecordChange
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { """ doRecordChange Method. If this is an update or add type, grab the bookmark. @param field The field that is changing. @param iChangeType The type of change. @param bDisplayOption not used here. """ int iErrorCo...
java
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); return iErrorCode; }
[ "public", "int", "doRecordChange", "(", "FieldInfo", "field", ",", "int", "iChangeType", ",", "boolean", "bDisplayOption", ")", "{", "int", "iErrorCode", "=", "super", ".", "doRecordChange", "(", "field", ",", "iChangeType", ",", "bDisplayOption", ")", ";", "r...
doRecordChange Method. If this is an update or add type, grab the bookmark. @param field The field that is changing. @param iChangeType The type of change. @param bDisplayOption not used here.
[ "doRecordChange", "Method", ".", "If", "this", "is", "an", "update", "or", "add", "type", "grab", "the", "bookmark", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/util/HierarchicalTable.java#L146-L150
twilio/twilio-java
src/main/java/com/twilio/base/Page.java
Page.getUrl
public String getUrl(String domain, String region) { """ Generate page url for a list result. @param domain domain to use @param region region to use @return the page url """ if (url != null) { return url; } return urlFromUri(domain, region, uri); }
java
public String getUrl(String domain, String region) { if (url != null) { return url; } return urlFromUri(domain, region, uri); }
[ "public", "String", "getUrl", "(", "String", "domain", ",", "String", "region", ")", "{", "if", "(", "url", "!=", "null", ")", "{", "return", "url", ";", "}", "return", "urlFromUri", "(", "domain", ",", "region", ",", "uri", ")", ";", "}" ]
Generate page url for a list result. @param domain domain to use @param region region to use @return the page url
[ "Generate", "page", "url", "for", "a", "list", "result", "." ]
train
https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/base/Page.java#L102-L108
alkacon/opencms-core
src/org/opencms/search/galleries/CmsGalleryNameMacroResolver.java
CmsGalleryNameMacroResolver.resolveStringTemplate
private String resolveStringTemplate(String stMacro) { """ Evaluates the contents of a %(stringtemplate:...) macro by evaluating them as StringTemplate code.<p> @param stMacro the contents of the macro after the stringtemplate: prefix @return the StringTemplate evaluation result """ String templat...
java
private String resolveStringTemplate(String stMacro) { String template = m_stringTemplateSource.apply(stMacro.trim()); if (template == null) { return ""; } CmsJspContentAccessBean jspContentAccess = new CmsJspContentAccessBean(m_cms, m_contentLocale, m_content); Map<...
[ "private", "String", "resolveStringTemplate", "(", "String", "stMacro", ")", "{", "String", "template", "=", "m_stringTemplateSource", ".", "apply", "(", "stMacro", ".", "trim", "(", ")", ")", ";", "if", "(", "template", "==", "null", ")", "{", "return", "...
Evaluates the contents of a %(stringtemplate:...) macro by evaluating them as StringTemplate code.<p> @param stMacro the contents of the macro after the stringtemplate: prefix @return the StringTemplate evaluation result
[ "Evaluates", "the", "contents", "of", "a", "%", "(", "stringtemplate", ":", "...", ")", "macro", "by", "evaluating", "them", "as", "StringTemplate", "code", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/galleries/CmsGalleryNameMacroResolver.java#L251-L285
molgenis/molgenis
molgenis-security/src/main/java/org/molgenis/security/acl/TransactionalJdbcMutableAclService.java
TransactionalJdbcMutableAclService.createAcl
@Transactional @Override public MutableAcl createAcl(ObjectIdentity objectIdentity) { """ Same as {@link JdbcMutableAclService#createAcl(ObjectIdentity)} except for duplicate key checking which is handled by by the database for performance reasons. """ Assert.notNull(objectIdentity, "Object Identity r...
java
@Transactional @Override public MutableAcl createAcl(ObjectIdentity objectIdentity) { Assert.notNull(objectIdentity, "Object Identity required"); // Need to retrieve the current principal, in order to know who "owns" this ACL // (can be changed later on) Sid sid = SidUtils.createSecurityContextSid(...
[ "@", "Transactional", "@", "Override", "public", "MutableAcl", "createAcl", "(", "ObjectIdentity", "objectIdentity", ")", "{", "Assert", ".", "notNull", "(", "objectIdentity", ",", "\"Object Identity required\"", ")", ";", "// Need to retrieve the current principal, in orde...
Same as {@link JdbcMutableAclService#createAcl(ObjectIdentity)} except for duplicate key checking which is handled by by the database for performance reasons.
[ "Same", "as", "{" ]
train
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-security/src/main/java/org/molgenis/security/acl/TransactionalJdbcMutableAclService.java#L30-L51
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java
BundlePathMappingBuilder.addPathMapping
private void addPathMapping(BundlePathMapping bundlePathMapping, String pathMapping) { """ Adds a path mapping to the bundle @param pathMapping the path mapping to add """ addFilePathMapping(bundlePathMapping, pathMapping); if (!bundle.getInclusionPattern().isIncludeOnlyOnDebug()) { bundlePathMapp...
java
private void addPathMapping(BundlePathMapping bundlePathMapping, String pathMapping) { addFilePathMapping(bundlePathMapping, pathMapping); if (!bundle.getInclusionPattern().isIncludeOnlyOnDebug()) { bundlePathMapping.getItemPathList().add(new BundlePath(bundle.getBundlePrefix(), pathMapping)); } if (!bund...
[ "private", "void", "addPathMapping", "(", "BundlePathMapping", "bundlePathMapping", ",", "String", "pathMapping", ")", "{", "addFilePathMapping", "(", "bundlePathMapping", ",", "pathMapping", ")", ";", "if", "(", "!", "bundle", ".", "getInclusionPattern", "(", ")", ...
Adds a path mapping to the bundle @param pathMapping the path mapping to add
[ "Adds", "a", "path", "mapping", "to", "the", "bundle" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java#L173-L185
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/domain/controller/operations/coordination/OperationSlaveStepHandler.java
OperationSlaveStepHandler.addBasicStep
private void addBasicStep(OperationContext context, ModelNode operation, ModelNode localReponse) throws OperationFailedException { """ Directly handles the op in the standard way the default prepare step handler would @param context the operation execution context @param operation the operation @throws Operatio...
java
private void addBasicStep(OperationContext context, ModelNode operation, ModelNode localReponse) throws OperationFailedException { final String operationName = operation.require(OP).asString(); final PathAddress pathAddress = PathAddress.pathAddress(operation.get(OP_ADDR)); final OperationEntry ...
[ "private", "void", "addBasicStep", "(", "OperationContext", "context", ",", "ModelNode", "operation", ",", "ModelNode", "localReponse", ")", "throws", "OperationFailedException", "{", "final", "String", "operationName", "=", "operation", ".", "require", "(", "OP", "...
Directly handles the op in the standard way the default prepare step handler would @param context the operation execution context @param operation the operation @throws OperationFailedException if no handler is registered for the operation
[ "Directly", "handles", "the", "op", "in", "the", "standard", "way", "the", "default", "prepare", "step", "handler", "would" ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/coordination/OperationSlaveStepHandler.java#L157-L185
cesarferreira/AndroidQuickUtils
library/src/main/java/quickutils/core/categories/share.java
share.shareMethod
private static void shareMethod(String message, String activityInfoName) { """ Private method that handles facebook and twitter sharing @param message Message to be delivered @param activityInfoName """ Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/...
java
private static void shareMethod(String message, String activityInfoName) { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, message); PackageManager pm = QuickUtils.getContext().getPackageManager(); Li...
[ "private", "static", "void", "shareMethod", "(", "String", "message", ",", "String", "activityInfoName", ")", "{", "Intent", "shareIntent", "=", "new", "Intent", "(", "Intent", ".", "ACTION_SEND", ")", ";", "shareIntent", ".", "setType", "(", "\"text/plain\"", ...
Private method that handles facebook and twitter sharing @param message Message to be delivered @param activityInfoName
[ "Private", "method", "that", "handles", "facebook", "and", "twitter", "sharing" ]
train
https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/share.java#L53-L70
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/script/ScriptBuilder.java
ScriptBuilder.createMultiSigOutputScript
public static Script createMultiSigOutputScript(int threshold, List<ECKey> pubkeys) { """ Creates a program that requires at least N of the given keys to sign, using OP_CHECKMULTISIG. """ checkArgument(threshold > 0); checkArgument(threshold <= pubkeys.size()); checkArgument(pubkeys.siz...
java
public static Script createMultiSigOutputScript(int threshold, List<ECKey> pubkeys) { checkArgument(threshold > 0); checkArgument(threshold <= pubkeys.size()); checkArgument(pubkeys.size() <= 16); // That's the max we can represent with a single opcode. ScriptBuilder builder = new Scrip...
[ "public", "static", "Script", "createMultiSigOutputScript", "(", "int", "threshold", ",", "List", "<", "ECKey", ">", "pubkeys", ")", "{", "checkArgument", "(", "threshold", ">", "0", ")", ";", "checkArgument", "(", "threshold", "<=", "pubkeys", ".", "size", ...
Creates a program that requires at least N of the given keys to sign, using OP_CHECKMULTISIG.
[ "Creates", "a", "program", "that", "requires", "at", "least", "N", "of", "the", "given", "keys", "to", "sign", "using", "OP_CHECKMULTISIG", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/ScriptBuilder.java#L304-L316
bbottema/simple-java-mail
modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java
EmailConverter.emlToEmailBuilder
public static EmailPopulatingBuilder emlToEmailBuilder(@Nonnull final InputStream emlInputStream) { """ Delegates to {@link #emlToEmail(String)} with the full string value read from the given <code>InputStream</code>. """ try { return emlToEmailBuilder(readInputStreamToString(checkNonEmptyArgument(emlInpu...
java
public static EmailPopulatingBuilder emlToEmailBuilder(@Nonnull final InputStream emlInputStream) { try { return emlToEmailBuilder(readInputStreamToString(checkNonEmptyArgument(emlInputStream, "emlInputStream"), UTF_8)); } catch (IOException e) { throw new EmailConverterException(EmailConverterException.ERROR...
[ "public", "static", "EmailPopulatingBuilder", "emlToEmailBuilder", "(", "@", "Nonnull", "final", "InputStream", "emlInputStream", ")", "{", "try", "{", "return", "emlToEmailBuilder", "(", "readInputStreamToString", "(", "checkNonEmptyArgument", "(", "emlInputStream", ",",...
Delegates to {@link #emlToEmail(String)} with the full string value read from the given <code>InputStream</code>.
[ "Delegates", "to", "{" ]
train
https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java#L133-L139
dita-ot/dita-ot
src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java
RelaxNGDefaultsComponent.nullOrValue
private boolean nullOrValue(String test, String value) { """ Test if a string is either null or equal to a certain value @param test The string to test @param value The value to compare to @return <code>true</code> if a string is either null or equal to a certain value """ if (test == null) return...
java
private boolean nullOrValue(String test, String value) { if (test == null) return true; if (test.equals(value)) return true; return false; }
[ "private", "boolean", "nullOrValue", "(", "String", "test", ",", "String", "value", ")", "{", "if", "(", "test", "==", "null", ")", "return", "true", ";", "if", "(", "test", ".", "equals", "(", "value", ")", ")", "return", "true", ";", "return", "fal...
Test if a string is either null or equal to a certain value @param test The string to test @param value The value to compare to @return <code>true</code> if a string is either null or equal to a certain value
[ "Test", "if", "a", "string", "is", "either", "null", "or", "equal", "to", "a", "certain", "value" ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java#L489-L495
fabric8io/fabric8-forge
addons/devops/src/main/java/io/fabric8/forge/devops/springboot/UnzipHelper.java
UnzipHelper.unzip
public static void unzip(File file, File destDir) throws IOException { """ Extracts a zip file specified by the zipFilePath to a directory specified by destDirectory (will be created if does not exists) """ if (!destDir.exists()) { destDir.mkdir(); } ZipInputStream zipIn = ...
java
public static void unzip(File file, File destDir) throws IOException { if (!destDir.exists()) { destDir.mkdir(); } ZipInputStream zipIn = new ZipInputStream(new FileInputStream(file)); ZipEntry entry = zipIn.getNextEntry(); // iterates over entries in the zip file ...
[ "public", "static", "void", "unzip", "(", "File", "file", ",", "File", "destDir", ")", "throws", "IOException", "{", "if", "(", "!", "destDir", ".", "exists", "(", ")", ")", "{", "destDir", ".", "mkdir", "(", ")", ";", "}", "ZipInputStream", "zipIn", ...
Extracts a zip file specified by the zipFilePath to a directory specified by destDirectory (will be created if does not exists)
[ "Extracts", "a", "zip", "file", "specified", "by", "the", "zipFilePath", "to", "a", "directory", "specified", "by", "destDirectory", "(", "will", "be", "created", "if", "does", "not", "exists", ")" ]
train
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/devops/src/main/java/io/fabric8/forge/devops/springboot/UnzipHelper.java#L37-L57
yatechorg/jedis-utils
src/main/java/org/yatech/jedis/utils/lua/LuaScriptBuilder.java
LuaScriptBuilder.endPreparedScriptReturn
public LuaPreparedScript endPreparedScriptReturn(LuaValue value, LuaScriptConfig config) { """ End building the prepared script, adding a return value statement @param value the value to return @param config the configuration for the script to build @return the new {@link LuaPreparedScript} instance """ ...
java
public LuaPreparedScript endPreparedScriptReturn(LuaValue value, LuaScriptConfig config) { add(new LuaAstReturnStatement(argument(value))); return endPreparedScript(config); }
[ "public", "LuaPreparedScript", "endPreparedScriptReturn", "(", "LuaValue", "value", ",", "LuaScriptConfig", "config", ")", "{", "add", "(", "new", "LuaAstReturnStatement", "(", "argument", "(", "value", ")", ")", ")", ";", "return", "endPreparedScript", "(", "conf...
End building the prepared script, adding a return value statement @param value the value to return @param config the configuration for the script to build @return the new {@link LuaPreparedScript} instance
[ "End", "building", "the", "prepared", "script", "adding", "a", "return", "value", "statement" ]
train
https://github.com/yatechorg/jedis-utils/blob/1951609fa6697df4f69be76e7d66b9284924bd97/src/main/java/org/yatech/jedis/utils/lua/LuaScriptBuilder.java#L153-L156
google/truth
extensions/proto/src/main/java/com/google/common/truth/extensions/proto/ProtoTruthMessageDifferencer.java
ProtoTruthMessageDifferencer.diffMessages
DiffResult diffMessages(Message actual, Message expected) { """ Compare the two non-null messages, and return a detailed comparison report. """ checkNotNull(actual); checkNotNull(expected); checkArgument( actual.getDescriptorForType() == expected.getDescriptorForType(), "The actual ...
java
DiffResult diffMessages(Message actual, Message expected) { checkNotNull(actual); checkNotNull(expected); checkArgument( actual.getDescriptorForType() == expected.getDescriptorForType(), "The actual [%s] and expected [%s] message descriptors do not match.", actual.getDescriptorForTyp...
[ "DiffResult", "diffMessages", "(", "Message", "actual", ",", "Message", "expected", ")", "{", "checkNotNull", "(", "actual", ")", ";", "checkNotNull", "(", "expected", ")", ";", "checkArgument", "(", "actual", ".", "getDescriptorForType", "(", ")", "==", "expe...
Compare the two non-null messages, and return a detailed comparison report.
[ "Compare", "the", "two", "non", "-", "null", "messages", "and", "return", "a", "detailed", "comparison", "report", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/ProtoTruthMessageDifferencer.java#L79-L89
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/utils/ReflectUtils.java
ReflectUtils.hasInterface
public static boolean hasInterface(Class<?> has, Class<?> in) { """ Checks for interface "has" in class "in". @param has the has @param in the in @return true, if exists? """ if (has.equals(in)) { return true; } boolean match = false; for (Clas...
java
public static boolean hasInterface(Class<?> has, Class<?> in) { if (has.equals(in)) { return true; } boolean match = false; for (Class<?> intrface : in.getInterfaces()) { if (intrface.getInterfaces().length > 0) { ...
[ "public", "static", "boolean", "hasInterface", "(", "Class", "<", "?", ">", "has", ",", "Class", "<", "?", ">", "in", ")", "{", "if", "(", "has", ".", "equals", "(", "in", ")", ")", "{", "return", "true", ";", "}", "boolean", "match", "=", "false...
Checks for interface "has" in class "in". @param has the has @param in the in @return true, if exists?
[ "Checks", "for", "interface", "has", "in", "class", "in", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/utils/ReflectUtils.java#L54-L78
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java
GeneratedDUserDaoImpl.queryByCity
public Iterable<DUser> queryByCity(java.lang.String city) { """ query-by method for field city @param city the specified attribute @return an Iterable of DUsers for the specified city """ return queryByField(null, DUserMapper.Field.CITY.getFieldName(), city); }
java
public Iterable<DUser> queryByCity(java.lang.String city) { return queryByField(null, DUserMapper.Field.CITY.getFieldName(), city); }
[ "public", "Iterable", "<", "DUser", ">", "queryByCity", "(", "java", ".", "lang", ".", "String", "city", ")", "{", "return", "queryByField", "(", "null", ",", "DUserMapper", ".", "Field", ".", "CITY", ".", "getFieldName", "(", ")", ",", "city", ")", ";...
query-by method for field city @param city the specified attribute @return an Iterable of DUsers for the specified city
[ "query", "-", "by", "method", "for", "field", "city" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L97-L99
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java
TINFeatureFactory.createTriangle
public static Triangle createTriangle(Geometry geom) throws IllegalArgumentException { """ A factory to create a DTriangle from a Geometry @param geom @return @throws IllegalArgumentException If there are not exactly 3 coordinates in geom. """ Coordinate[] coordinates = geom.getCoordinate...
java
public static Triangle createTriangle(Geometry geom) throws IllegalArgumentException { Coordinate[] coordinates = geom.getCoordinates(); if (coordinates.length != 4) { throw new IllegalArgumentException("The geometry must be a triangle"); } ...
[ "public", "static", "Triangle", "createTriangle", "(", "Geometry", "geom", ")", "throws", "IllegalArgumentException", "{", "Coordinate", "[", "]", "coordinates", "=", "geom", ".", "getCoordinates", "(", ")", ";", "if", "(", "coordinates", ".", "length", "!=", ...
A factory to create a DTriangle from a Geometry @param geom @return @throws IllegalArgumentException If there are not exactly 3 coordinates in geom.
[ "A", "factory", "to", "create", "a", "DTriangle", "from", "a", "Geometry" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java#L49-L55
petergeneric/stdlib
guice/webapp/src/main/java/com/peterphi/std/guice/web/rest/jaxrs/GuiceDynamicProxyProvider.java
GuiceDynamicProxyProvider.invoke
@Override public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable { """ A MethodHandler that proxies the Method invocation through to a Guice-acquired instance """ // Get an instance of the implementing class via Guice final Object instance = registry.getInject...
java
@Override public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable { // Get an instance of the implementing class via Guice final Object instance = registry.getInjector().getInstance(clazz); return thisMethod.invoke(instance, args); }
[ "@", "Override", "public", "Object", "invoke", "(", "Object", "self", ",", "Method", "thisMethod", ",", "Method", "proceed", ",", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "// Get an instance of the implementing class via Guice", "final", "Object"...
A MethodHandler that proxies the Method invocation through to a Guice-acquired instance
[ "A", "MethodHandler", "that", "proxies", "the", "Method", "invocation", "through", "to", "a", "Guice", "-", "acquired", "instance" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/webapp/src/main/java/com/peterphi/std/guice/web/rest/jaxrs/GuiceDynamicProxyProvider.java#L48-L55
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/Period.java
Period.and
public Period and(float count, TimeUnit unit) { """ Set the given unit to have the given count. Marks the unit as having been set. This can be used to set multiple units, or to reset a unit to have a new count. This does <b>not</b> add the count to an existing count for this unit. @param count the number ...
java
public Period and(float count, TimeUnit unit) { checkCount(count); return setTimeUnitValue(unit, count); }
[ "public", "Period", "and", "(", "float", "count", ",", "TimeUnit", "unit", ")", "{", "checkCount", "(", "count", ")", ";", "return", "setTimeUnitValue", "(", "unit", ",", "count", ")", ";", "}" ]
Set the given unit to have the given count. Marks the unit as having been set. This can be used to set multiple units, or to reset a unit to have a new count. This does <b>not</b> add the count to an existing count for this unit. @param count the number of units. must be non-negative @param unit the unit @return th...
[ "Set", "the", "given", "unit", "to", "have", "the", "given", "count", ".", "Marks", "the", "unit", "as", "having", "been", "set", ".", "This", "can", "be", "used", "to", "set", "multiple", "units", "or", "to", "reset", "a", "unit", "to", "have", "a",...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/Period.java#L83-L86
mangstadt/biweekly
src/main/java/biweekly/io/TimezoneInfo.java
TimezoneInfo.setFloating
public void setFloating(ICalProperty property, boolean enable) { """ <p> Sets whether a property value should be formatted in floating time when written to an output stream (by default, floating time is disabled for all properties). </p> <p> A floating time value does not have a timezone associated with it, ...
java
public void setFloating(ICalProperty property, boolean enable) { if (enable) { floatingProperties.add(property); } else { removeIdentity(floatingProperties, property); } }
[ "public", "void", "setFloating", "(", "ICalProperty", "property", ",", "boolean", "enable", ")", "{", "if", "(", "enable", ")", "{", "floatingProperties", ".", "add", "(", "property", ")", ";", "}", "else", "{", "removeIdentity", "(", "floatingProperties", "...
<p> Sets whether a property value should be formatted in floating time when written to an output stream (by default, floating time is disabled for all properties). </p> <p> A floating time value does not have a timezone associated with it, and is to be interpreted as being in the local timezone of the computer that is ...
[ "<p", ">", "Sets", "whether", "a", "property", "value", "should", "be", "formatted", "in", "floating", "time", "when", "written", "to", "an", "output", "stream", "(", "by", "default", "floating", "time", "is", "disabled", "for", "all", "properties", ")", "...
train
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/TimezoneInfo.java#L253-L259
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java
GeneratedDOAuth2UserDaoImpl.queryByCreatedBy
public Iterable<DOAuth2User> queryByCreatedBy(java.lang.String createdBy) { """ query-by method for field createdBy @param createdBy the specified attribute @return an Iterable of DOAuth2Users for the specified createdBy """ return queryByField(null, DOAuth2UserMapper.Field.CREATEDBY.getFieldName(), crea...
java
public Iterable<DOAuth2User> queryByCreatedBy(java.lang.String createdBy) { return queryByField(null, DOAuth2UserMapper.Field.CREATEDBY.getFieldName(), createdBy); }
[ "public", "Iterable", "<", "DOAuth2User", ">", "queryByCreatedBy", "(", "java", ".", "lang", ".", "String", "createdBy", ")", "{", "return", "queryByField", "(", "null", ",", "DOAuth2UserMapper", ".", "Field", ".", "CREATEDBY", ".", "getFieldName", "(", ")", ...
query-by method for field createdBy @param createdBy the specified attribute @return an Iterable of DOAuth2Users for the specified createdBy
[ "query", "-", "by", "method", "for", "field", "createdBy" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L70-L72
alibaba/vlayout
vlayout/src/main/java/com/alibaba/android/vlayout/Cantor.java
Cantor.reverseCantor
public static void reverseCantor(long cantor, long[] result) { """ reverse cantor pair to origin number k1 and k2, k1 is stored in result[0], and k2 is stored in result[1] @param cantor a computed cantor number @param result the array to store output values """ if (result == null || result.length < 2...
java
public static void reverseCantor(long cantor, long[] result) { if (result == null || result.length < 2) { result = new long[2]; } // reverse Cantor Function long w = (long) (Math.floor(Math.sqrt(8 * cantor + 1) - 1) / 2); long t = (w * w + w) / 2; long k2 = c...
[ "public", "static", "void", "reverseCantor", "(", "long", "cantor", ",", "long", "[", "]", "result", ")", "{", "if", "(", "result", "==", "null", "||", "result", ".", "length", "<", "2", ")", "{", "result", "=", "new", "long", "[", "2", "]", ";", ...
reverse cantor pair to origin number k1 and k2, k1 is stored in result[0], and k2 is stored in result[1] @param cantor a computed cantor number @param result the array to store output values
[ "reverse", "cantor", "pair", "to", "origin", "number", "k1", "and", "k2", "k1", "is", "stored", "in", "result", "[", "0", "]", "and", "k2", "is", "stored", "in", "result", "[", "1", "]" ]
train
https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/Cantor.java#L26-L38
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendText
public static void sendText(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) { """ Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done. @param pooledData The data to send, it will be ...
java
public static void sendText(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) { sendInternal(pooledData, WebSocketFrameType.TEXT, wsChannel, callback, null, -1); }
[ "public", "static", "void", "sendText", "(", "final", "PooledByteBuffer", "pooledData", ",", "final", "WebSocketChannel", "wsChannel", ",", "final", "WebSocketCallback", "<", "Void", ">", "callback", ")", "{", "sendInternal", "(", "pooledData", ",", "WebSocketFrameT...
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done. @param pooledData The data to send, it will be freed when done @param wsChannel The web socket channel @param callback The callback to invoke on completion
[ "Sends", "a", "complete", "text", "message", "invoking", "the", "callback", "when", "complete", "Automatically", "frees", "the", "pooled", "byte", "buffer", "when", "done", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L148-L150
samskivert/pythagoras
src/main/java/pythagoras/d/Frustum.java
Frustum.setToPerspective
public Frustum setToPerspective (double fovy, double aspect, double znear, double zfar) { """ Sets this frustum to one pointing in the Z- direction with the specified parameters determining its size and shape (see the OpenGL documentation for <code>gluPerspective</code>). @param fovy the vertical field of vie...
java
public Frustum setToPerspective (double fovy, double aspect, double znear, double zfar) { double top = znear * Math.tan(fovy / 2f), bottom = -top; double right = top * aspect, left = -right; return setToFrustum(left, right, bottom, top, znear, zfar); }
[ "public", "Frustum", "setToPerspective", "(", "double", "fovy", ",", "double", "aspect", ",", "double", "znear", ",", "double", "zfar", ")", "{", "double", "top", "=", "znear", "*", "Math", ".", "tan", "(", "fovy", "/", "2f", ")", ",", "bottom", "=", ...
Sets this frustum to one pointing in the Z- direction with the specified parameters determining its size and shape (see the OpenGL documentation for <code>gluPerspective</code>). @param fovy the vertical field of view, in radians. @param aspect the aspect ratio (width over height). @param znear the distance to the nea...
[ "Sets", "this", "frustum", "to", "one", "pointing", "in", "the", "Z", "-", "direction", "with", "the", "specified", "parameters", "determining", "its", "size", "and", "shape", "(", "see", "the", "OpenGL", "documentation", "for", "<code", ">", "gluPerspective<"...
train
https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Frustum.java#L54-L58
google/closure-compiler
src/com/google/javascript/jscomp/CheckAccessControls.java
CheckAccessControls.getPropertyDeprecationInfo
@Nullable private static String getPropertyDeprecationInfo(ObjectType type, String prop) { """ Returns the deprecation reason for the property if it is marked as being deprecated. Returns empty string if the property is deprecated but no reason was given. Returns null if the property is not deprecated. """...
java
@Nullable private static String getPropertyDeprecationInfo(ObjectType type, String prop) { String depReason = getDeprecationReason(type.getOwnPropertyJSDocInfo(prop)); if (depReason != null) { return depReason; } ObjectType implicitProto = type.getImplicitPrototype(); if (implicitProto != n...
[ "@", "Nullable", "private", "static", "String", "getPropertyDeprecationInfo", "(", "ObjectType", "type", ",", "String", "prop", ")", "{", "String", "depReason", "=", "getDeprecationReason", "(", "type", ".", "getOwnPropertyJSDocInfo", "(", "prop", ")", ")", ";", ...
Returns the deprecation reason for the property if it is marked as being deprecated. Returns empty string if the property is deprecated but no reason was given. Returns null if the property is not deprecated.
[ "Returns", "the", "deprecation", "reason", "for", "the", "property", "if", "it", "is", "marked", "as", "being", "deprecated", ".", "Returns", "empty", "string", "if", "the", "property", "is", "deprecated", "but", "no", "reason", "was", "given", ".", "Returns...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckAccessControls.java#L1193-L1205
haraldk/TwelveMonkeys
common/common-image/src/main/java/com/twelvemonkeys/image/InverseColorMap.java
InverseColorMap.getIndexNearest
public final int getIndexNearest(int pRed, int pGreen, int pBlue) { """ Gets the index of the nearest color to from the color map. @param pRed red component of the color to get the nearest color to from color map @param pGreen green component of the color to get the nearest color to from color map @param pBlu...
java
public final int getIndexNearest(int pRed, int pGreen, int pBlue) { // NOTE: the third line in expression for blue is shifting DOWN not UP. return inverseRGB[((pRed << (2 * QUANTBITS - TRUNCBITS)) & QUANTMASK_RED) + ((pGreen << (/* 1 * */ QUANTBITS - TRUNCBITS)) & QUANTMASK_GREEN) + ...
[ "public", "final", "int", "getIndexNearest", "(", "int", "pRed", ",", "int", "pGreen", ",", "int", "pBlue", ")", "{", "// NOTE: the third line in expression for blue is shifting DOWN not UP.\r", "return", "inverseRGB", "[", "(", "(", "pRed", "<<", "(", "2", "*", "...
Gets the index of the nearest color to from the color map. @param pRed red component of the color to get the nearest color to from color map @param pGreen green component of the color to get the nearest color to from color map @param pBlue blue component of the color to get the nearest color to from color map @return ...
[ "Gets", "the", "index", "of", "the", "nearest", "color", "to", "from", "the", "color", "map", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/InverseColorMap.java#L206-L211
craftercms/deployer
src/main/java/org/craftercms/deployer/impl/rest/ExceptionHandlers.java
ExceptionHandlers.handleTargetAlreadyExistsException
@ExceptionHandler(TargetAlreadyExistsException.class) public ResponseEntity<Object> handleTargetAlreadyExistsException(TargetAlreadyExistsException ex, WebRequest request) { """ Handles a {@link TargetAlreadyExistsException} by returning a 409 CONFLICT. @param ex the exception @param request the c...
java
@ExceptionHandler(TargetAlreadyExistsException.class) public ResponseEntity<Object> handleTargetAlreadyExistsException(TargetAlreadyExistsException ex, WebRequest request) { HttpHeaders headers = RestServiceUtils.setLocationHeader(new HttpHeaders(), ...
[ "@", "ExceptionHandler", "(", "TargetAlreadyExistsException", ".", "class", ")", "public", "ResponseEntity", "<", "Object", ">", "handleTargetAlreadyExistsException", "(", "TargetAlreadyExistsException", "ex", ",", "WebRequest", "request", ")", "{", "HttpHeaders", "header...
Handles a {@link TargetAlreadyExistsException} by returning a 409 CONFLICT. @param ex the exception @param request the current request @return the response entity, with the body and status
[ "Handles", "a", "{", "@link", "TargetAlreadyExistsException", "}", "by", "returning", "a", "409", "CONFLICT", "." ]
train
https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/rest/ExceptionHandlers.java#L60-L67
spring-projects/spring-ldap
core/src/main/java/org/springframework/ldap/core/support/DefaultIncrementalAttributesMapper.java
DefaultIncrementalAttributesMapper.lookupAttributeValues
public static List<Object> lookupAttributeValues(LdapOperations ldapOperations, String dn, String attribute) { """ Lookup all values for the specified attribute, looping through the results incrementally if necessary. @param ldapOperations The instance to use for performing the actual lookup. @param dn ...
java
public static List<Object> lookupAttributeValues(LdapOperations ldapOperations, String dn, String attribute) { return lookupAttributeValues(ldapOperations, LdapUtils.newLdapName(dn), attribute); }
[ "public", "static", "List", "<", "Object", ">", "lookupAttributeValues", "(", "LdapOperations", "ldapOperations", ",", "String", "dn", ",", "String", "attribute", ")", "{", "return", "lookupAttributeValues", "(", "ldapOperations", ",", "LdapUtils", ".", "newLdapName...
Lookup all values for the specified attribute, looping through the results incrementally if necessary. @param ldapOperations The instance to use for performing the actual lookup. @param dn The distinguished name of the object to find. @param attribute name of the attribute to request. @return a list w...
[ "Lookup", "all", "values", "for", "the", "specified", "attribute", "looping", "through", "the", "results", "incrementally", "if", "necessary", "." ]
train
https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/DefaultIncrementalAttributesMapper.java#L317-L319
alkacon/opencms-core
src-gwt/org/opencms/ade/publish/client/CmsBrokenLinksPanel.java
CmsBrokenLinksPanel.prepareButton
private void prepareButton(CmsPushButton button, String text) { """ Sets the text on a button and formats the button.<p> @param button the button @param text the text to put on the button """ button.setText(text); button.setUseMinWidth(true); }
java
private void prepareButton(CmsPushButton button, String text) { button.setText(text); button.setUseMinWidth(true); }
[ "private", "void", "prepareButton", "(", "CmsPushButton", "button", ",", "String", "text", ")", "{", "button", ".", "setText", "(", "text", ")", ";", "button", ".", "setUseMinWidth", "(", "true", ")", ";", "}" ]
Sets the text on a button and formats the button.<p> @param button the button @param text the text to put on the button
[ "Sets", "the", "text", "on", "a", "button", "and", "formats", "the", "button", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsBrokenLinksPanel.java#L260-L264
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java
DbsUtilities.joinBySeparator
public static String joinBySeparator( List<String> items, String separator ) { """ Join a list of strings by string. @param items the list of strings. @param separator the separator to use. @return the resulting string. """ int size = items.size(); if (size == 0) { return ""; ...
java
public static String joinBySeparator( List<String> items, String separator ) { int size = items.size(); if (size == 0) { return ""; } StringBuilder sb = new StringBuilder(items.get(0)); for( int i = 1; i < size; i++ ) { sb.append(separator).append(items.ge...
[ "public", "static", "String", "joinBySeparator", "(", "List", "<", "String", ">", "items", ",", "String", "separator", ")", "{", "int", "size", "=", "items", ".", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "{", "return", "\"\"", ";", ...
Join a list of strings by string. @param items the list of strings. @param separator the separator to use. @return the resulting string.
[ "Join", "a", "list", "of", "strings", "by", "string", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L99-L109
beanshell/beanshell
src/main/java/bsh/Reflect.java
Reflect.getClassStaticThis
public static This getClassStaticThis(Class<?> clas, String className) { """ Get the static bsh namespace field from the class. @param className may be the name of clas itself or a superclass of clas. """ try { return (This) getStaticFieldValue(clas, BSHSTATIC + className); } catch...
java
public static This getClassStaticThis(Class<?> clas, String className) { try { return (This) getStaticFieldValue(clas, BSHSTATIC + className); } catch (Exception e) { throw new InterpreterError("Unable to get class static space: " + e, e); } }
[ "public", "static", "This", "getClassStaticThis", "(", "Class", "<", "?", ">", "clas", ",", "String", "className", ")", "{", "try", "{", "return", "(", "This", ")", "getStaticFieldValue", "(", "clas", ",", "BSHSTATIC", "+", "className", ")", ";", "}", "c...
Get the static bsh namespace field from the class. @param className may be the name of clas itself or a superclass of clas.
[ "Get", "the", "static", "bsh", "namespace", "field", "from", "the", "class", "." ]
train
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L728-L734
apache/groovy
src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
IOGroovyMethods.transformLine
public static void transformLine(Reader reader, Writer writer, @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) throws IOException { """ Transforms the lines from a reader with a Closure and write them to a writer. Both Reader and Writer are closed after the operation. @para...
java
public static void transformLine(Reader reader, Writer writer, @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) throws IOException { BufferedReader br = new BufferedReader(reader); BufferedWriter bw = new BufferedWriter(writer); String line; try { ...
[ "public", "static", "void", "transformLine", "(", "Reader", "reader", ",", "Writer", "writer", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"java.lang.String\"", ")", "Closure", "closure", ")", "throws", "IOE...
Transforms the lines from a reader with a Closure and write them to a writer. Both Reader and Writer are closed after the operation. @param reader Lines of text to be transformed. Reader is closed afterwards. @param writer Where transformed lines are written. Writer is closed afterwards. @param closure Single parame...
[ "Transforms", "the", "lines", "from", "a", "reader", "with", "a", "Closure", "and", "write", "them", "to", "a", "writer", ".", "Both", "Reader", "and", "Writer", "are", "closed", "after", "the", "operation", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1413-L1439
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobTracker.java
JobTracker.setJobPriority
synchronized void setJobPriority(JobID jobId, JobPriority priority) { """ Change the run-time priority of the given job. @param jobId job id @param priority new {@link JobPriority} for the job """ JobInProgress job = jobs.get(jobId); if (job != null) { synchronized (taskScheduler) { Job...
java
synchronized void setJobPriority(JobID jobId, JobPriority priority) { JobInProgress job = jobs.get(jobId); if (job != null) { synchronized (taskScheduler) { JobStatus oldStatus = (JobStatus)job.getStatus().clone(); job.setPriority(priority); JobStatus newStatus = (JobStatus)job.get...
[ "synchronized", "void", "setJobPriority", "(", "JobID", "jobId", ",", "JobPriority", "priority", ")", "{", "JobInProgress", "job", "=", "jobs", ".", "get", "(", "jobId", ")", ";", "if", "(", "job", "!=", "null", ")", "{", "synchronized", "(", "taskSchedule...
Change the run-time priority of the given job. @param jobId job id @param priority new {@link JobPriority} for the job
[ "Change", "the", "run", "-", "time", "priority", "of", "the", "given", "job", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3643-L3658
UrielCh/ovh-java-sdk
ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java
ApiOvhDbaaslogs.serviceName_output_graylog_stream_streamId_alert_alertId_GET
public OvhStreamAlertCondition serviceName_output_graylog_stream_streamId_alert_alertId_GET(String serviceName, String streamId, String alertId) throws IOException { """ Returns details of specified graylog stream alert REST: GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/alert/{alertId} @param...
java
public OvhStreamAlertCondition serviceName_output_graylog_stream_streamId_alert_alertId_GET(String serviceName, String streamId, String alertId) throws IOException { String qPath = "/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/alert/{alertId}"; StringBuilder sb = path(qPath, serviceName, streamId, ale...
[ "public", "OvhStreamAlertCondition", "serviceName_output_graylog_stream_streamId_alert_alertId_GET", "(", "String", "serviceName", ",", "String", "streamId", ",", "String", "alertId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dbaas/logs/{serviceName}/output...
Returns details of specified graylog stream alert REST: GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/alert/{alertId} @param serviceName [required] Service name @param streamId [required] Stream ID @param alertId [required] Alert ID
[ "Returns", "details", "of", "specified", "graylog", "stream", "alert" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L1402-L1407
JodaOrg/joda-time
src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java
DateTimeFormatterBuilder.appendTimeZoneOffset
public DateTimeFormatterBuilder appendTimeZoneOffset( String zeroOffsetText, boolean showSeparators, int minFields, int maxFields) { """ Instructs the printer to emit text and numbers to display time zone offset from UTC. A parser will use the parsed time zone offset to adjust the datetim...
java
public DateTimeFormatterBuilder appendTimeZoneOffset( String zeroOffsetText, boolean showSeparators, int minFields, int maxFields) { return append0(new TimeZoneOffset (zeroOffsetText, zeroOffsetText, showSeparators, minFields, maxFields)); }
[ "public", "DateTimeFormatterBuilder", "appendTimeZoneOffset", "(", "String", "zeroOffsetText", ",", "boolean", "showSeparators", ",", "int", "minFields", ",", "int", "maxFields", ")", "{", "return", "append0", "(", "new", "TimeZoneOffset", "(", "zeroOffsetText", ",", ...
Instructs the printer to emit text and numbers to display time zone offset from UTC. A parser will use the parsed time zone offset to adjust the datetime. <p> If zero offset text is supplied, then it will be printed when the zone is zero. During parsing, either the zero offset text, or the offset will be parsed. @para...
[ "Instructs", "the", "printer", "to", "emit", "text", "and", "numbers", "to", "display", "time", "zone", "offset", "from", "UTC", ".", "A", "parser", "will", "use", "the", "parsed", "time", "zone", "offset", "to", "adjust", "the", "datetime", ".", "<p", "...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L1089-L1094
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/property/A_CmsPropertyEditor.java
A_CmsPropertyEditor.setGhostValue
protected void setGhostValue(I_CmsFormField field, String value, boolean ghostMode) { """ Sets the ghost value for a form field if its normal value is empty and the field's widget supports ghost values.<p> @param field the form field @param value the ghost value to set @param ghostMode if true, sets the widge...
java
protected void setGhostValue(I_CmsFormField field, String value, boolean ghostMode) { I_CmsFormWidget widget = field.getWidget(); if ((widget instanceof I_CmsHasGhostValue) && (value != null)) { ((I_CmsHasGhostValue)widget).setGhostValue(value, ghostMode); } }
[ "protected", "void", "setGhostValue", "(", "I_CmsFormField", "field", ",", "String", "value", ",", "boolean", "ghostMode", ")", "{", "I_CmsFormWidget", "widget", "=", "field", ".", "getWidget", "(", ")", ";", "if", "(", "(", "widget", "instanceof", "I_CmsHasGh...
Sets the ghost value for a form field if its normal value is empty and the field's widget supports ghost values.<p> @param field the form field @param value the ghost value to set @param ghostMode if true, sets the widget to ghost mode
[ "Sets", "the", "ghost", "value", "for", "a", "form", "field", "if", "its", "normal", "value", "is", "empty", "and", "the", "field", "s", "widget", "supports", "ghost", "values", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/property/A_CmsPropertyEditor.java#L315-L321
esigate/esigate
esigate-core/src/main/java/org/esigate/events/EventManager.java
EventManager.unregister
public void unregister(EventDefinition eventDefinition, IEventListener eventListener) { """ Stop listening to an event. @param eventDefinition @param eventListener """ if (eventDefinition.getType() == EventDefinition.TYPE_POST) { unregister(listenersPost, eventDefinition, eventListener)...
java
public void unregister(EventDefinition eventDefinition, IEventListener eventListener) { if (eventDefinition.getType() == EventDefinition.TYPE_POST) { unregister(listenersPost, eventDefinition, eventListener); } else { unregister(listeners, eventDefinition, eventListener); ...
[ "public", "void", "unregister", "(", "EventDefinition", "eventDefinition", ",", "IEventListener", "eventListener", ")", "{", "if", "(", "eventDefinition", ".", "getType", "(", ")", "==", "EventDefinition", ".", "TYPE_POST", ")", "{", "unregister", "(", "listenersP...
Stop listening to an event. @param eventDefinition @param eventListener
[ "Stop", "listening", "to", "an", "event", "." ]
train
https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/events/EventManager.java#L177-L183
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/SSLConfigManager.java
SSLConfigManager.removeSSLConfigFromMap
public synchronized void removeSSLConfigFromMap(String alias, SSLConfig sslConfig) throws Exception { """ * This method adds an SSL config to the SSLConfigManager map and list. @param alias @param sslConfig @throws Exception * """ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) ...
java
public synchronized void removeSSLConfigFromMap(String alias, SSLConfig sslConfig) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "removeSSLConfigFromMap", new Object[] { alias }); sslConfigMap.remove(alias); if (TraceComponent.isAny...
[ "public", "synchronized", "void", "removeSSLConfigFromMap", "(", "String", "alias", ",", "SSLConfig", "sslConfig", ")", "throws", "Exception", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")...
* This method adds an SSL config to the SSLConfigManager map and list. @param alias @param sslConfig @throws Exception *
[ "*", "This", "method", "adds", "an", "SSL", "config", "to", "the", "SSLConfigManager", "map", "and", "list", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/SSLConfigManager.java#L1308-L1315
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getIntrinsicInformationContent
public double getIntrinsicInformationContent(Category category) throws WikiApiException { """ Intrinsic information content (Seco Etal. 2004) allows to compute information content from the structure of the taxonomy (no corpus needed). IC(n) = 1 - log( hypo(n) + 1) / log(#cat) hypo(n) is the (recursive) number of...
java
public double getIntrinsicInformationContent(Category category) throws WikiApiException { int node = category.getPageId(); int hyponymCount = getHyponymCountMap().get(node); int numberOfNodes = this.getNumberOfNodes(); if (hyponymCount > numberOfNodes) { throw new WikiApiE...
[ "public", "double", "getIntrinsicInformationContent", "(", "Category", "category", ")", "throws", "WikiApiException", "{", "int", "node", "=", "category", ".", "getPageId", "(", ")", ";", "int", "hyponymCount", "=", "getHyponymCountMap", "(", ")", ".", "get", "(...
Intrinsic information content (Seco Etal. 2004) allows to compute information content from the structure of the taxonomy (no corpus needed). IC(n) = 1 - log( hypo(n) + 1) / log(#cat) hypo(n) is the (recursive) number of hyponyms of a node n. Recursive means that the hyponyms of hyponyms are also taken into account #cat...
[ "Intrinsic", "information", "content", "(", "Seco", "Etal", ".", "2004", ")", "allows", "to", "compute", "information", "content", "from", "the", "structure", "of", "the", "taxonomy", "(", "no", "corpus", "needed", ")", ".", "IC", "(", "n", ")", "=", "1"...
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L951-L968
james-hu/jabb-core
src/main/java/net/sf/jabb/camel/RegistryUtility.java
RegistryUtility.addCodecOnly
static protected void addCodecOnly(CombinedRegistry registry, String name, ChannelHandler codec) { """ Adds codec to Registry only, it will not handle the manipulating of encoders or decoders list in Registry.<br> 仅仅把codec直接加入到Registry中,而不处理加入到Registry里的encoders或decoders列表中。 <p> If a codec with the same name al...
java
static protected void addCodecOnly(CombinedRegistry registry, String name, ChannelHandler codec){ Object oldValue = registry.lookup(name); if (oldValue != null && oldValue != codec){ throw new IllegalArgumentException("Codec name '" + name + "' is already in use in at least one of the registries."); } r...
[ "static", "protected", "void", "addCodecOnly", "(", "CombinedRegistry", "registry", ",", "String", "name", ",", "ChannelHandler", "codec", ")", "{", "Object", "oldValue", "=", "registry", ".", "lookup", "(", "name", ")", ";", "if", "(", "oldValue", "!=", "nu...
Adds codec to Registry only, it will not handle the manipulating of encoders or decoders list in Registry.<br> 仅仅把codec直接加入到Registry中,而不处理加入到Registry里的encoders或decoders列表中。 <p> If a codec with the same name already exists in the Registry, IllegalArgumentException will be thrown.<br> 如果Registry中原先已经有同名的别的codec,则抛出Illega...
[ "Adds", "codec", "to", "Registry", "only", "it", "will", "not", "handle", "the", "manipulating", "of", "encoders", "or", "decoders", "list", "in", "Registry", ".", "<br", ">", "仅仅把codec直接加入到Registry中,而不处理加入到Registry里的encoders或decoders列表中。", "<p", ">", "If", "a", "...
train
https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/camel/RegistryUtility.java#L140-L146
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/config/DefaultDataGridResourceProvider.java
DefaultDataGridResourceProvider.formatMessage
public String formatMessage(String key, Object[] args) { """ Format a message associated with the given key and with the given message arguments. @param key the key @param args the formatting arguments @return the formatted message """ String msg = internalFormatMessage(getMessage(key), args); ...
java
public String formatMessage(String key, Object[] args) { String msg = internalFormatMessage(getMessage(key), args); return msg; }
[ "public", "String", "formatMessage", "(", "String", "key", ",", "Object", "[", "]", "args", ")", "{", "String", "msg", "=", "internalFormatMessage", "(", "getMessage", "(", "key", ")", ",", "args", ")", ";", "return", "msg", ";", "}" ]
Format a message associated with the given key and with the given message arguments. @param key the key @param args the formatting arguments @return the formatted message
[ "Format", "a", "message", "associated", "with", "the", "given", "key", "and", "with", "the", "given", "message", "arguments", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/config/DefaultDataGridResourceProvider.java#L75-L78
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/patterns/FunctionPattern.java
FunctionPattern.fixupVariables
public void fixupVariables(java.util.Vector vars, int globalsSize) { """ This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time. @param vars List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corre...
java
public void fixupVariables(java.util.Vector vars, int globalsSize) { super.fixupVariables(vars, globalsSize); m_functionExpr.fixupVariables(vars, globalsSize); }
[ "public", "void", "fixupVariables", "(", "java", ".", "util", ".", "Vector", "vars", ",", "int", "globalsSize", ")", "{", "super", ".", "fixupVariables", "(", "vars", ",", "globalsSize", ")", ";", "m_functionExpr", ".", "fixupVariables", "(", "vars", ",", ...
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time. @param vars List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector f...
[ "This", "function", "is", "used", "to", "fixup", "variables", "from", "QNames", "to", "stack", "frame", "indexes", "at", "stylesheet", "build", "time", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/patterns/FunctionPattern.java#L82-L86
alibaba/vlayout
vlayout/src/main/java/com/alibaba/android/vlayout/layout/MarginLayoutHelper.java
MarginLayoutHelper.setMargin
public void setMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin) { """ Set margins for this layoutHelper @param leftMargin left margin @param topMargin top margin @param rightMargin right margin @param bottomMargin bottom margin """ this.mMarginLeft = leftMargin; th...
java
public void setMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin) { this.mMarginLeft = leftMargin; this.mMarginTop = topMargin; this.mMarginRight = rightMargin; this.mMarginBottom = bottomMargin; }
[ "public", "void", "setMargin", "(", "int", "leftMargin", ",", "int", "topMargin", ",", "int", "rightMargin", ",", "int", "bottomMargin", ")", "{", "this", ".", "mMarginLeft", "=", "leftMargin", ";", "this", ".", "mMarginTop", "=", "topMargin", ";", "this", ...
Set margins for this layoutHelper @param leftMargin left margin @param topMargin top margin @param rightMargin right margin @param bottomMargin bottom margin
[ "Set", "margins", "for", "this", "layoutHelper" ]
train
https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/layout/MarginLayoutHelper.java#L70-L75
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java
ConfigValidator.checkEvictionConfig
static void checkEvictionConfig(InMemoryFormat inMemoryFormat, EvictionConfig evictionConfig) { """ Checks the merge policy configuration in the context of an {@link ICache}. @param inMemoryFormat the {@link InMemoryFormat} of the cache @param evictionConfig the {@link EvictionConfig} of the cache """ ...
java
static void checkEvictionConfig(InMemoryFormat inMemoryFormat, EvictionConfig evictionConfig) { if (inMemoryFormat == NATIVE) { MaxSizePolicy maxSizePolicy = evictionConfig.getMaximumSizePolicy(); if (maxSizePolicy == MaxSizePolicy.ENTRY_COUNT) { throw new IllegalArgument...
[ "static", "void", "checkEvictionConfig", "(", "InMemoryFormat", "inMemoryFormat", ",", "EvictionConfig", "evictionConfig", ")", "{", "if", "(", "inMemoryFormat", "==", "NATIVE", ")", "{", "MaxSizePolicy", "maxSizePolicy", "=", "evictionConfig", ".", "getMaximumSizePolic...
Checks the merge policy configuration in the context of an {@link ICache}. @param inMemoryFormat the {@link InMemoryFormat} of the cache @param evictionConfig the {@link EvictionConfig} of the cache
[ "Checks", "the", "merge", "policy", "configuration", "in", "the", "context", "of", "an", "{", "@link", "ICache", "}", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L358-L371
zaproxy/zaproxy
src/org/parosproxy/paros/db/DbUtils.java
DbUtils.hasColumn
public static boolean hasColumn(final Connection connection, final String tableName, final String columnName) throws SQLException { """ Tells whether the table {@code tableName} has the column with the given {@code columnName}, or not. @param connection the connection to the database @param tableName the na...
java
public static boolean hasColumn(final Connection connection, final String tableName, final String columnName) throws SQLException { boolean hasColumn = false; ResultSet rs = null; try { rs = connection.getMetaData().getColumns(null, null, tableName, columnName); ...
[ "public", "static", "boolean", "hasColumn", "(", "final", "Connection", "connection", ",", "final", "String", "tableName", ",", "final", "String", "columnName", ")", "throws", "SQLException", "{", "boolean", "hasColumn", "=", "false", ";", "ResultSet", "rs", "="...
Tells whether the table {@code tableName} has the column with the given {@code columnName}, or not. @param connection the connection to the database @param tableName the name of the table that may have the column @param columnName the name of the column that will be checked @return {@code true} if the table {@code tab...
[ "Tells", "whether", "the", "table", "{", "@code", "tableName", "}", "has", "the", "column", "with", "the", "given", "{", "@code", "columnName", "}", "or", "not", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/db/DbUtils.java#L88-L110
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java
ProfileSummaryBuilder.buildInterfaceSummary
public void buildInterfaceSummary(XMLNode node, Content packageSummaryContentTree) { """ Build the summary for the interfaces in the package. @param node the XML element that specifies which components to document @param packageSummaryContentTree the tree to which the interface summary will be added """ ...
java
public void buildInterfaceSummary(XMLNode node, Content packageSummaryContentTree) { String interfaceTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Interface_Summary"), configuration.getText("doclet.interfaces"));...
[ "public", "void", "buildInterfaceSummary", "(", "XMLNode", "node", ",", "Content", "packageSummaryContentTree", ")", "{", "String", "interfaceTableSummary", "=", "configuration", ".", "getText", "(", "\"doclet.Member_Table_Summary\"", ",", "configuration", ".", "getText",...
Build the summary for the interfaces in the package. @param node the XML element that specifies which components to document @param packageSummaryContentTree the tree to which the interface summary will be added
[ "Build", "the", "summary", "for", "the", "interfaces", "in", "the", "package", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L185-L201
Viascom/groundwork
foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/body/request/RequestMultipartBody.java
RequestMultipartBody.addFilePart
public void addFilePart(String fieldName, File uploadFile) throws FileNotFoundException { """ Adds a file to the request @param fieldName name attribute @param uploadFile a File to be uploaded @throws FileNotFoundException """ stream.put(fieldName, new NamedInputStream(uploadFile.getName(), new F...
java
public void addFilePart(String fieldName, File uploadFile) throws FileNotFoundException { stream.put(fieldName, new NamedInputStream(uploadFile.getName(), new FileInputStream(uploadFile), "binary", URLConnection.guessContentTypeFromName(uploadFile.getName()))); }
[ "public", "void", "addFilePart", "(", "String", "fieldName", ",", "File", "uploadFile", ")", "throws", "FileNotFoundException", "{", "stream", ".", "put", "(", "fieldName", ",", "new", "NamedInputStream", "(", "uploadFile", ".", "getName", "(", ")", ",", "new"...
Adds a file to the request @param fieldName name attribute @param uploadFile a File to be uploaded @throws FileNotFoundException
[ "Adds", "a", "file", "to", "the", "request" ]
train
https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/body/request/RequestMultipartBody.java#L141-L143
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_image_imageId_GET
public OvhImage project_serviceName_image_imageId_GET(String serviceName, String imageId) throws IOException { """ Get image REST: GET /cloud/project/{serviceName}/image/{imageId} @param imageId [required] Image id @param serviceName [required] Project id """ String qPath = "/cloud/project/{serviceName}...
java
public OvhImage project_serviceName_image_imageId_GET(String serviceName, String imageId) throws IOException { String qPath = "/cloud/project/{serviceName}/image/{imageId}"; StringBuilder sb = path(qPath, serviceName, imageId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhIma...
[ "public", "OvhImage", "project_serviceName_image_imageId_GET", "(", "String", "serviceName", ",", "String", "imageId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/image/{imageId}\"", ";", "StringBuilder", "sb", "=", "path", "...
Get image REST: GET /cloud/project/{serviceName}/image/{imageId} @param imageId [required] Image id @param serviceName [required] Project id
[ "Get", "image" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1004-L1009
alkacon/opencms-core
src/org/opencms/ui/apps/sessions/CmsSessionsTable.java
CmsSessionsTable.filterTable
public void filterTable(String search) { """ Filters the table according to given search string.<p> @param search string to be looked for. """ m_container.removeAllContainerFilters(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(search)) { m_container.addContainerFilter( ...
java
public void filterTable(String search) { m_container.removeAllContainerFilters(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(search)) { m_container.addContainerFilter( new Or( new SimpleStringFilter(TableProperty.UserName, search, true, false), ...
[ "public", "void", "filterTable", "(", "String", "search", ")", "{", "m_container", ".", "removeAllContainerFilters", "(", ")", ";", "if", "(", "CmsStringUtil", ".", "isNotEmptyOrWhitespaceOnly", "(", "search", ")", ")", "{", "m_container", ".", "addContainerFilter...
Filters the table according to given search string.<p> @param search string to be looked for.
[ "Filters", "the", "table", "according", "to", "given", "search", "string", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sessions/CmsSessionsTable.java#L495-L508
santhosh-tekuri/jlibs
core/src/main/java/jlibs/core/lang/ArrayUtil.java
ArrayUtil.indexOf
public static <T, S extends T> int indexOf(T array[], S item, int fromIndex) { """ returns first index of <code>item<code> in given <code>array</code> starting from <code>fromIndex</code>(inclusive) @param array object array, can be null @param item item to be searched, can be null @param fromIndex ...
java
public static <T, S extends T> int indexOf(T array[], S item, int fromIndex){ if(array==null) return -1; for(int i=fromIndex; i<array.length; i++){ if(Util.equals(array[i], item)) return i; } return -1; }
[ "public", "static", "<", "T", ",", "S", "extends", "T", ">", "int", "indexOf", "(", "T", "array", "[", "]", ",", "S", "item", ",", "int", "fromIndex", ")", "{", "if", "(", "array", "==", "null", ")", "return", "-", "1", ";", "for", "(", "int", ...
returns first index of <code>item<code> in given <code>array</code> starting from <code>fromIndex</code>(inclusive) @param array object array, can be null @param item item to be searched, can be null @param fromIndex index(inclusive) from which search happens. @return -1 if array is null, or the item...
[ "returns", "first", "index", "of", "<code", ">", "item<code", ">", "in", "given", "<code", ">", "array<", "/", "code", ">", "starting", "from", "<code", ">", "fromIndex<", "/", "code", ">", "(", "inclusive", ")" ]
train
https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ArrayUtil.java#L43-L52
sebastiangraf/jSCSI
bundles/target/src/main/java/org/jscsi/target/scsi/cdb/CommandDescriptorBlock.java
CommandDescriptorBlock.addIllegalFieldPointer
protected final void addIllegalFieldPointer (int byteNumber, int bitNumber) { """ Adds an instance {@link FieldPointerSenseKeySpecificData}, which specifies an illegal field by the position of its first byte and its first bit, to {@link #illegalFieldPointers}. @param byteNumber index of the first byte of the i...
java
protected final void addIllegalFieldPointer (int byteNumber, int bitNumber) { FieldPointerSenseKeySpecificData fp = new FieldPointerSenseKeySpecificData(true,// senseKeySpecificDataValid true,// commandData (i.e. invalid field in CDB) true,// bitPointerValid bitNumber,// bitPointer ...
[ "protected", "final", "void", "addIllegalFieldPointer", "(", "int", "byteNumber", ",", "int", "bitNumber", ")", "{", "FieldPointerSenseKeySpecificData", "fp", "=", "new", "FieldPointerSenseKeySpecificData", "(", "true", ",", "// senseKeySpecificDataValid\r", "true", ",", ...
Adds an instance {@link FieldPointerSenseKeySpecificData}, which specifies an illegal field by the position of its first byte and its first bit, to {@link #illegalFieldPointers}. @param byteNumber index of the first byte of the illegal field @param bitNumber index of the first bit of the illegal field
[ "Adds", "an", "instance", "{", "@link", "FieldPointerSenseKeySpecificData", "}", "which", "specifies", "an", "illegal", "field", "by", "the", "position", "of", "its", "first", "byte", "and", "its", "first", "bit", "to", "{", "@link", "#illegalFieldPointers", "}"...
train
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/cdb/CommandDescriptorBlock.java#L139-L146
medallia/Word2VecJava
src/main/java/com/medallia/word2vec/util/FileUtils.java
FileUtils.getDir
public static File getDir(File parent, String item) { """ Returns a subdirectory of a given directory; the subdirectory is expected to already exist. @param parent the directory in which to find the specified subdirectory @param item the name of the subdirectory @return the subdirectory having the specified nam...
java
public static File getDir(File parent, String item) { File dir = new File(parent, item); return (dir.exists() && dir.isDirectory()) ? dir : null; }
[ "public", "static", "File", "getDir", "(", "File", "parent", ",", "String", "item", ")", "{", "File", "dir", "=", "new", "File", "(", "parent", ",", "item", ")", ";", "return", "(", "dir", ".", "exists", "(", ")", "&&", "dir", ".", "isDirectory", "...
Returns a subdirectory of a given directory; the subdirectory is expected to already exist. @param parent the directory in which to find the specified subdirectory @param item the name of the subdirectory @return the subdirectory having the specified name; null if no such directory exists or exists but is a regular fil...
[ "Returns", "a", "subdirectory", "of", "a", "given", "directory", ";", "the", "subdirectory", "is", "expected", "to", "already", "exist", "." ]
train
https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/FileUtils.java#L36-L39
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.getUsersAsyncWithHttpInfo
public ApiResponse<ApiAsyncSuccessResponse> getUsersAsyncWithHttpInfo(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException { """ Get users. Get [CfgPerson](https...
java
public ApiResponse<ApiAsyncSuccessResponse> getUsersAsyncWithHttpInfo(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException { com.squareup.okhttp.Call call = ge...
[ "public", "ApiResponse", "<", "ApiAsyncSuccessResponse", ">", "getUsersAsyncWithHttpInfo", "(", "String", "aioId", ",", "Integer", "limit", ",", "Integer", "offset", ",", "String", "order", ",", "String", "sortBy", ",", "String", "filterName", ",", "String", "filt...
Get users. Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters. @param aioId A unique ID generated on the client (browser) when sending an API request that returns an asynchronous response. (required) @param limit Limit the number of users ...
[ "Get", "users", ".", "Get", "[", "CfgPerson", "]", "(", "https", ":", "//", "docs", ".", "genesys", ".", "com", "/", "Documentation", "/", "PSDK", "/", "latest", "/", "ConfigLayerRef", "/", "CfgPerson", ")", "objects", "based", "on", "the", "specified", ...
train
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L673-L677
dihedron/dihedron-commons
src/main/java/org/dihedron/core/reflection/Reflector.java
Reflector.setElementAtIndex
@SuppressWarnings( { """ Sets the value of the n-th element in an array or a list. @param index the offset of the element to be set; this value can be positive (and the offset is calculated from the start of the array or list), or negative, in which case the offset is calculated according to the rule that e...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public void setElementAtIndex(int index, Object value) throws ReflectorException { if(object == null) { logger.error("object is null: did you specify it using the 'inspect()' method?"); throw new ReflectorException("object is null: did you specify it using th...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "void", "setElementAtIndex", "(", "int", "index", ",", "Object", "value", ")", "throws", "ReflectorException", "{", "if", "(", "object", "==", "null", ")", "{", "log...
Sets the value of the n-th element in an array or a list. @param index the offset of the element to be set; this value can be positive (and the offset is calculated from the start of the array or list), or negative, in which case the offset is calculated according to the rule that element -1 is the last, -2 is the one...
[ "Sets", "the", "value", "of", "the", "n", "-", "th", "element", "in", "an", "array", "or", "a", "list", "." ]
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/reflection/Reflector.java#L271-L286
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
IndexedSliceReader.setToRowStart
private void setToRowStart(RowIndexEntry rowEntry, FileDataInput in) throws IOException { """ Sets the seek position to the start of the row for column scanning. """ if (in == null) { this.file = sstable.getFileDataInput(rowEntry.position); } else { ...
java
private void setToRowStart(RowIndexEntry rowEntry, FileDataInput in) throws IOException { if (in == null) { this.file = sstable.getFileDataInput(rowEntry.position); } else { this.file = in; in.seek(rowEntry.position); } ssta...
[ "private", "void", "setToRowStart", "(", "RowIndexEntry", "rowEntry", ",", "FileDataInput", "in", ")", "throws", "IOException", "{", "if", "(", "in", "==", "null", ")", "{", "this", ".", "file", "=", "sstable", ".", "getFileDataInput", "(", "rowEntry", ".", ...
Sets the seek position to the start of the row for column scanning.
[ "Sets", "the", "seek", "position", "to", "the", "start", "of", "the", "row", "for", "column", "scanning", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java#L103-L115
openbase/jul
storage/src/main/java/org/openbase/jul/storage/registry/AbstractRegistry.java
AbstractRegistry.notifyObservers
protected final boolean notifyObservers() { """ Method triggers a new registry changed notification on all observers. The notification will be skipped in case the registry is busy. But a final notification is always guaranteed. @return true if the notification was performed or false if the notification was ski...
java
protected final boolean notifyObservers() { try { // It is not waited until the write actions are finished because the notification will be triggered after the lock release. if (registryLock.isWriteLockedByCurrentThread()) { logger.debug("Notification of registry[" + this...
[ "protected", "final", "boolean", "notifyObservers", "(", ")", "{", "try", "{", "// It is not waited until the write actions are finished because the notification will be triggered after the lock release.", "if", "(", "registryLock", ".", "isWriteLockedByCurrentThread", "(", ")", ")...
Method triggers a new registry changed notification on all observers. The notification will be skipped in case the registry is busy. But a final notification is always guaranteed. @return true if the notification was performed or false if the notification was skipped.
[ "Method", "triggers", "a", "new", "registry", "changed", "notification", "on", "all", "observers", ".", "The", "notification", "will", "be", "skipped", "in", "case", "the", "registry", "is", "busy", ".", "But", "a", "final", "notification", "is", "always", "...
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/storage/src/main/java/org/openbase/jul/storage/registry/AbstractRegistry.java#L760-L784
FlyingHe/UtilsMaven
src/main/java/com/github/flyinghe/depdcy/AbstractExcelWriter.java
AbstractExcelWriter.createXLSXColor
public XSSFColor createXLSXColor(int r, int g, int b) throws WriteExcelException { """ 创建一个自定义颜色,仅适用于XLSX类型Excel文件。 你可以使用{@link XSSFCellStyle#setFillForegroundColor(XSSFColor)} 来使用自定义颜色 @param r red @param g green @param b blue @return 一个新的自定义颜色 @throws WriteExcelException 异常 @see #createXLSXCellStyle() ...
java
public XSSFColor createXLSXColor(int r, int g, int b) throws WriteExcelException { return this.createXLSXColor(r, g, b, 255); }
[ "public", "XSSFColor", "createXLSXColor", "(", "int", "r", ",", "int", "g", ",", "int", "b", ")", "throws", "WriteExcelException", "{", "return", "this", ".", "createXLSXColor", "(", "r", ",", "g", ",", "b", ",", "255", ")", ";", "}" ]
创建一个自定义颜色,仅适用于XLSX类型Excel文件。 你可以使用{@link XSSFCellStyle#setFillForegroundColor(XSSFColor)} 来使用自定义颜色 @param r red @param g green @param b blue @return 一个新的自定义颜色 @throws WriteExcelException 异常 @see #createXLSXCellStyle() @see #createXLSXColor(int, int, int, int) @see #getXLSPalette()
[ "创建一个自定义颜色", "仅适用于XLSX类型Excel文件。", "你可以使用", "{", "@link", "XSSFCellStyle#setFillForegroundColor", "(", "XSSFColor", ")", "}", "来使用自定义颜色" ]
train
https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/depdcy/AbstractExcelWriter.java#L637-L639
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/javac/code/Symtab.java
Symtab.enterBinop
private void enterBinop(String name, Type left, Type right, Type res, int opcode) { """ Enter a binary operation into symbol table. @param name The name of the operator. @param left The type of the left operand. @param right The type of the left...
java
private void enterBinop(String name, Type left, Type right, Type res, int opcode) { predefClass.members().enter( new OperatorSymbol( makeOperatorName(name), new MethodType(List.of(left, right), res, ...
[ "private", "void", "enterBinop", "(", "String", "name", ",", "Type", "left", ",", "Type", "right", ",", "Type", "res", ",", "int", "opcode", ")", "{", "predefClass", ".", "members", "(", ")", ".", "enter", "(", "new", "OperatorSymbol", "(", "makeOperator...
Enter a binary operation into symbol table. @param name The name of the operator. @param left The type of the left operand. @param right The type of the left operand. @param res The operation's result type. @param opcode The operation's bytecode instruction.
[ "Enter", "a", "binary", "operation", "into", "symbol", "table", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/code/Symtab.java#L251-L261
jbundle/jbundle
thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java
JAltGridScreen.addGridDetailItem
public void addGridDetailItem(TableModel model, int iRowIndex, GridBagLayout gridbag, GridBagConstraints c) { """ Add this item to the grid detail at this row. @param model The table model to read through. @param iRowIndex The row to add this item. @param gridbag The screen layout. @param c The constraint to u...
java
public void addGridDetailItem(TableModel model, int iRowIndex, GridBagLayout gridbag, GridBagConstraints c) { JComponent rgcompoments[] = new JComponent[model.getColumnCount()]; for (int iColumnIndex = 0; iColumnIndex < rgcompoments.length; iColumnIndex++) { Object obj = model.ge...
[ "public", "void", "addGridDetailItem", "(", "TableModel", "model", ",", "int", "iRowIndex", ",", "GridBagLayout", "gridbag", ",", "GridBagConstraints", "c", ")", "{", "JComponent", "rgcompoments", "[", "]", "=", "new", "JComponent", "[", "model", ".", "getColumn...
Add this item to the grid detail at this row. @param model The table model to read through. @param iRowIndex The row to add this item. @param gridbag The screen layout. @param c The constraint to use.
[ "Add", "this", "item", "to", "the", "grid", "detail", "at", "this", "row", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java#L223-L247
EXIficient/exificient-core
src/main/java/com/siemens/ct/exi/core/io/BitOutputStream.java
BitOutputStream.writeBits
public void writeBits(int b, int n) throws IOException { """ Write the n least significant bits of parameter b starting with the most significant, i.e. from left to right. @param b bits @param n number of bits @throws IOException IO exception """ if (n <= capacity) { // all bits fit into the curr...
java
public void writeBits(int b, int n) throws IOException { if (n <= capacity) { // all bits fit into the current buffer buffer = (buffer << n) | (b & (0xff >> (BITS_IN_BYTE - n))); capacity -= n; if (capacity == 0) { ostream.write(buffer); capacity = BITS_IN_BYTE; len++; } } else { // fi...
[ "public", "void", "writeBits", "(", "int", "b", ",", "int", "n", ")", "throws", "IOException", "{", "if", "(", "n", "<=", "capacity", ")", "{", "// all bits fit into the current buffer", "buffer", "=", "(", "buffer", "<<", "n", ")", "|", "(", "b", "&", ...
Write the n least significant bits of parameter b starting with the most significant, i.e. from left to right. @param b bits @param n number of bits @throws IOException IO exception
[ "Write", "the", "n", "least", "significant", "bits", "of", "parameter", "b", "starting", "with", "the", "most", "significant", "i", ".", "e", ".", "from", "left", "to", "right", "." ]
train
https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/io/BitOutputStream.java#L202-L232
tipsy/javalin
src/main/java/io/javalin/apibuilder/ApiBuilder.java
ApiBuilder.wsBefore
public Javalin wsBefore(@NotNull String path, @NotNull Consumer<WsHandler> wsHandler) { """ Adds a WebSocket before handler for the specified path to the {@link Javalin} instance. The method can only be called inside a {@link Javalin#routes(EndpointGroup)}. """ return staticInstance().wsBefore(prefixP...
java
public Javalin wsBefore(@NotNull String path, @NotNull Consumer<WsHandler> wsHandler) { return staticInstance().wsBefore(prefixPath(path), wsHandler); }
[ "public", "Javalin", "wsBefore", "(", "@", "NotNull", "String", "path", ",", "@", "NotNull", "Consumer", "<", "WsHandler", ">", "wsHandler", ")", "{", "return", "staticInstance", "(", ")", ".", "wsBefore", "(", "prefixPath", "(", "path", ")", ",", "wsHandl...
Adds a WebSocket before handler for the specified path to the {@link Javalin} instance. The method can only be called inside a {@link Javalin#routes(EndpointGroup)}.
[ "Adds", "a", "WebSocket", "before", "handler", "for", "the", "specified", "path", "to", "the", "{" ]
train
https://github.com/tipsy/javalin/blob/68b2f7592f237db1c2b597e645697eb75fdaee53/src/main/java/io/javalin/apibuilder/ApiBuilder.java#L412-L414
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.importData
public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count, final Connection conn, final String insertSQL, final int batchSize, final int batchInterval) throws UncheckedSQLException { """ Imports the data from <code>DataSet</code> ...
java
public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count, final Connection conn, final String insertSQL, final int batchSize, final int batchInterval) throws UncheckedSQLException { return importData(dataset, selectColumnName...
[ "public", "static", "int", "importData", "(", "final", "DataSet", "dataset", ",", "final", "Collection", "<", "String", ">", "selectColumnNames", ",", "final", "int", "offset", ",", "final", "int", "count", ",", "final", "Connection", "conn", ",", "final", "...
Imports the data from <code>DataSet</code> to database. @param dataset @param selectColumnNames @param offset @param count @param conn @param insertSQL the column order in the sql must be consistent with the column order in the DataSet. Here is sample about how to create the sql: <pre><code> List<String> columnNameLis...
[ "Imports", "the", "data", "from", "<code", ">", "DataSet<", "/", "code", ">", "to", "database", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1919-L1922
knowm/XChange
xchange-quadrigacx/src/main/java/org/knowm/xchange/quadrigacx/QuadrigaCxUtils.java
QuadrigaCxUtils.parseDate
public static Date parseDate(String dateString) { """ Format a date String for QuadrigaCx @param dateString @return """ try { return DATE_FORMAT.parse(dateString); } catch (ParseException e) { throw new ExchangeException("Illegal date/time format", e); } }
java
public static Date parseDate(String dateString) { try { return DATE_FORMAT.parse(dateString); } catch (ParseException e) { throw new ExchangeException("Illegal date/time format", e); } }
[ "public", "static", "Date", "parseDate", "(", "String", "dateString", ")", "{", "try", "{", "return", "DATE_FORMAT", ".", "parse", "(", "dateString", ")", ";", "}", "catch", "(", "ParseException", "e", ")", "{", "throw", "new", "ExchangeException", "(", "\...
Format a date String for QuadrigaCx @param dateString @return
[ "Format", "a", "date", "String", "for", "QuadrigaCx" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-quadrigacx/src/main/java/org/knowm/xchange/quadrigacx/QuadrigaCxUtils.java#L27-L33
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Assert.java
Assert.isTrue
public static void isTrue(Boolean condition, Supplier<String> message) { """ Asserts that the condition is {@literal true}. The assertion holds if and only if the value is equal to {@literal true}. @param condition {@link Boolean} value being evaluated as a {@literal true} condition. @param message {@link S...
java
public static void isTrue(Boolean condition, Supplier<String> message) { if (isNotTrue(condition)) { throw new IllegalArgumentException(message.get()); } }
[ "public", "static", "void", "isTrue", "(", "Boolean", "condition", ",", "Supplier", "<", "String", ">", "message", ")", "{", "if", "(", "isNotTrue", "(", "condition", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "message", ".", "get", "(...
Asserts that the condition is {@literal true}. The assertion holds if and only if the value is equal to {@literal true}. @param condition {@link Boolean} value being evaluated as a {@literal true} condition. @param message {@link String} containing the message used in the {@link IllegalArgumentException} thrown if th...
[ "Asserts", "that", "the", "condition", "is", "{", "@literal", "true", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L819-L823
radkovo/jStyleParser
src/main/java/cz/vutbr/web/domassign/DeclarationMap.java
DeclarationMap.addDeclaration
public void addDeclaration(Element el, PseudoElementType pseudo, Declaration decl) { """ Adds a declaration for a specified list. If the list does not exist yet, it is created. @param el the element that the declaration belongs to @param pseudo an optional pseudo-element or null @param decl the new declaration ...
java
public void addDeclaration(Element el, PseudoElementType pseudo, Declaration decl) { List<Declaration> list = getOrCreate(el, pseudo); list.add(decl); }
[ "public", "void", "addDeclaration", "(", "Element", "el", ",", "PseudoElementType", "pseudo", ",", "Declaration", "decl", ")", "{", "List", "<", "Declaration", ">", "list", "=", "getOrCreate", "(", "el", ",", "pseudo", ")", ";", "list", ".", "add", "(", ...
Adds a declaration for a specified list. If the list does not exist yet, it is created. @param el the element that the declaration belongs to @param pseudo an optional pseudo-element or null @param decl the new declaration
[ "Adds", "a", "declaration", "for", "a", "specified", "list", ".", "If", "the", "list", "does", "not", "exist", "yet", "it", "is", "created", "." ]
train
https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/domassign/DeclarationMap.java#L32-L36
fuinorg/utils4j
src/main/java/org/fuin/utils4j/Utils4J.java
Utils4J.getCanonicalFile
public static File getCanonicalFile(final File file) { """ Returns the canonical file for the file without throwing a checked exception. A potential {@link IOException} is converted into a {@link RuntimeException} @param file File to return the canonical file for or <code>null</code>. @return Canonical fil...
java
public static File getCanonicalFile(final File file) { if (file == null) { return null; } try { return file.getCanonicalFile(); } catch (final IOException ex) { throw new RuntimeException("Couldn't get canonical file for: " + file, ex); ...
[ "public", "static", "File", "getCanonicalFile", "(", "final", "File", "file", ")", "{", "if", "(", "file", "==", "null", ")", "{", "return", "null", ";", "}", "try", "{", "return", "file", ".", "getCanonicalFile", "(", ")", ";", "}", "catch", "(", "f...
Returns the canonical file for the file without throwing a checked exception. A potential {@link IOException} is converted into a {@link RuntimeException} @param file File to return the canonical file for or <code>null</code>. @return Canonical file for the given argument or <code>null</code> if the input was <code>n...
[ "Returns", "the", "canonical", "file", "for", "the", "file", "without", "throwing", "a", "checked", "exception", ".", "A", "potential", "{", "@link", "IOException", "}", "is", "converted", "into", "a", "{", "@link", "RuntimeException", "}" ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L571-L580
square/mortar
mortar-hellodagger2/src/main/java/com/example/hellodagger2/DaggerService.java
DaggerService.createComponent
public static <T> T createComponent(Class<T> componentClass, Object... dependencies) { """ Magic method that creates a component with its dependencies set, by reflection. Relies on Dagger2 naming conventions. """ String fqn = componentClass.getName(); String packageName = componentClass.getPackage()....
java
public static <T> T createComponent(Class<T> componentClass, Object... dependencies) { String fqn = componentClass.getName(); String packageName = componentClass.getPackage().getName(); // Accounts for inner classes, ie MyApplication$Component String simpleName = fqn.substring(packageName.length() + 1)...
[ "public", "static", "<", "T", ">", "T", "createComponent", "(", "Class", "<", "T", ">", "componentClass", ",", "Object", "...", "dependencies", ")", "{", "String", "fqn", "=", "componentClass", ".", "getName", "(", ")", ";", "String", "packageName", "=", ...
Magic method that creates a component with its dependencies set, by reflection. Relies on Dagger2 naming conventions.
[ "Magic", "method", "that", "creates", "a", "component", "with", "its", "dependencies", "set", "by", "reflection", ".", "Relies", "on", "Dagger2", "naming", "conventions", "." ]
train
https://github.com/square/mortar/blob/c968b99eb96ba56c47e29912c07841be8e2cf97a/mortar-hellodagger2/src/main/java/com/example/hellodagger2/DaggerService.java#L22-L51